bsv2 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bsv2.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ie=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gt(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}function Kd(d){if(Object.prototype.hasOwnProperty.call(d,"__esModule"))return d;var e=d.default;if(typeof e=="function"){var t=function i(){var u=!1;try{u=this instanceof i}catch{}return u?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(d).forEach(function(i){var u=Object.getOwnPropertyDescriptor(d,i);Object.defineProperty(t,i,u.get?u:{enumerable:!0,get:function(){return d[i]}})}),t}var yi,Is;function jd(){if(Is)return yi;Is=1,yi=d;function d(e){this._tables[0][0][0]||this._precompute();var t,i,u,r=this._tables[0][4],s=this._tables[1],a=e.length,o=1;if(a!==4&&a!==6&&a!==8)throw new Error("invalid aes key size");this._key=[i=e.slice(0),u=[]];for(var f=a;f<4*a+28;f++)t=i[f-1],(f%a===0||a===8&&f%a===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[t&255],f%a===0&&(t=t<<8^t>>>24^o<<24,o=o<<1^(o>>7)*283)),i[f]=i[f-a]^t;for(var n=0;f;n++,f--)t=i[n&3?f:f-4],f<=4||n<4?u[n]=t:u[n]=s[0][r[t>>>24]]^s[1][r[t>>16&255]]^s[2][r[t>>8&255]]^s[3][r[t&255]]}return d.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],i=e[4],u=t[4],r,s,a,o=new Uint8Array(256),f=new Uint8Array(256),n,c,h,l,b,p;for(r=0;r<256;r++)f[(o[r]=r<<1^(r>>7)*283)^r]=r;for(s=a=0;!i[s];s^=n||1,a=f[a]||1)for(l=a^a<<1^a<<2^a<<3^a<<4,l=l>>8^l&255^99,i[s]=l,u[l]=s,h=o[c=o[n=o[s]]],p=h*16843009^c*65537^n*257^s*16843008,b=o[l]*257^l*16843008,r=0;r<4;r++)e[r][s]=b=b<<24^b>>>8,t[r][l]=p=p<<24^p>>>8},_crypt:function(e,t){if(e.length!==4)throw new Error("invalid aes block size");var i=this._key[t],u=e[0]^i[0],r=e[t?3:1]^i[1],s=e[2]^i[2],a=e[t?1:3]^i[3],o,f,n,c=i.length/4-2,h,l=4,b=new Uint32Array(4),p=this._tables[t],y=p[0],v=p[1],g=p[2],x=p[3],B=p[4];for(h=0;h<c;h++)o=y[u>>>24]^v[r>>16&255]^g[s>>8&255]^x[a&255]^i[l],f=y[r>>>24]^v[s>>16&255]^g[a>>8&255]^x[u&255]^i[l+1],n=y[s>>>24]^v[a>>16&255]^g[u>>8&255]^x[r&255]^i[l+2],a=y[a>>>24]^v[u>>16&255]^g[r>>8&255]^x[s&255]^i[l+3],l+=4,u=o,r=f,s=n;for(h=0;h<4;h++)b[t?3&-h:h]=B[u>>>24]<<24^B[r>>16&255]<<16^B[s>>8&255]<<8^B[a&255]^i[l++],o=u,u=r,r=s,s=a,a=o;return b}},yi}var zd=jd();const is=Gt(zd);var Tr={exports:{}};const Vd={},Gd=Object.freeze(Object.defineProperty({__proto__:null,default:Vd},Symbol.toStringTag,{value:"Module"})),$t=Kd(Gd);var $d=Tr.exports,As;function Te(){return As||(As=1,(function(d){(function(e,t){function i(k,m){if(!k)throw new Error(m||"Assertion failed")}function u(k,m){k.super_=m;var E=function(){};E.prototype=m.prototype,k.prototype=new E,k.prototype.constructor=k}function r(k,m,E){if(r.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((m==="le"||m==="be")&&(E=m,m=10),this._init(k||0,m||10,E||"be"))}typeof e=="object"?e.exports=r:t.BN=r,r.BN=r,r.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=$t.Buffer}catch{}r.isBN=function(m){return m instanceof r?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===r.wordSize&&Array.isArray(m.words)},r.max=function(m,E){return m.cmp(E)>0?m:E},r.min=function(m,E){return m.cmp(E)<0?m:E},r.prototype._init=function(m,E,O){if(typeof m=="number")return this._initNumber(m,E,O);if(typeof m=="object")return this._initArray(m,E,O);E==="hex"&&(E=16),i(E===(E|0)&&E>=2&&E<=36),m=m.toString().replace(/\s+/g,"");var R=0;m[0]==="-"&&(R++,this.negative=1),R<m.length&&(E===16?this._parseHex(m,R,O):(this._parseBase(m,E,R),O==="le"&&this._initArray(this.toArray(),E,O)))},r.prototype._initNumber=function(m,E,O){m<0&&(this.negative=1,m=-m),m<67108864?(this.words=[m&67108863],this.length=1):m<4503599627370496?(this.words=[m&67108863,m/67108864&67108863],this.length=2):(i(m<9007199254740992),this.words=[m&67108863,m/67108864&67108863,1],this.length=3),O==="le"&&this._initArray(this.toArray(),E,O)},r.prototype._initArray=function(m,E,O){if(i(typeof m.length=="number"),m.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(m.length/3),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var A,F,K=0;if(O==="be")for(R=m.length-1,A=0;R>=0;R-=3)F=m[R]|m[R-1]<<8|m[R-2]<<16,this.words[A]|=F<<K&67108863,this.words[A+1]=F>>>26-K&67108863,K+=24,K>=26&&(K-=26,A++);else if(O==="le")for(R=0,A=0;R<m.length;R+=3)F=m[R]|m[R+1]<<8|m[R+2]<<16,this.words[A]|=F<<K&67108863,this.words[A+1]=F>>>26-K&67108863,K+=24,K>=26&&(K-=26,A++);return this._strip()};function a(k,m){var E=k.charCodeAt(m);if(E>=48&&E<=57)return E-48;if(E>=65&&E<=70)return E-55;if(E>=97&&E<=102)return E-87;i(!1,"Invalid character in "+k)}function o(k,m,E){var O=a(k,E);return E-1>=m&&(O|=a(k,E-1)<<4),O}r.prototype._parseHex=function(m,E,O){this.length=Math.ceil((m.length-E)/6),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var A=0,F=0,K;if(O==="be")for(R=m.length-1;R>=E;R-=2)K=o(m,E,R)<<A,this.words[F]|=K&67108863,A>=18?(A-=18,F+=1,this.words[F]|=K>>>26):A+=8;else{var L=m.length-E;for(R=L%2===0?E+1:E;R<m.length;R+=2)K=o(m,E,R)<<A,this.words[F]|=K&67108863,A>=18?(A-=18,F+=1,this.words[F]|=K>>>26):A+=8}this._strip()};function f(k,m,E,O){for(var R=0,A=0,F=Math.min(k.length,E),K=m;K<F;K++){var L=k.charCodeAt(K)-48;R*=O,L>=49?A=L-49+10:L>=17?A=L-17+10:A=L,i(L>=0&&A<O,"Invalid character"),R+=A}return R}r.prototype._parseBase=function(m,E,O){this.words=[0],this.length=1;for(var R=0,A=1;A<=67108863;A*=E)R++;R--,A=A/E|0;for(var F=m.length-O,K=F%R,L=Math.min(F,F-K)+O,_=0,U=O;U<L;U+=R)_=f(m,U,U+R,E),this.imuln(A),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_);if(K!==0){var fe=1;for(_=f(m,U,m.length,E),U=0;U<K;U++)fe*=E;this.imuln(fe),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_)}this._strip()},r.prototype.copy=function(m){m.words=new Array(this.length);for(var E=0;E<this.length;E++)m.words[E]=this.words[E];m.length=this.length,m.negative=this.negative,m.red=this.red};function n(k,m){k.words=m.words,k.length=m.length,k.negative=m.negative,k.red=m.red}if(r.prototype._move=function(m){n(m,this)},r.prototype.clone=function(){var m=new r(null);return this.copy(m),m},r.prototype._expand=function(m){for(;this.length<m;)this.words[this.length++]=0;return this},r.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{r.prototype.inspect=c}else r.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","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"],l=[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];r.prototype.toString=function(m,E){m=m||10,E=E|0||1;var O;if(m===16||m==="hex"){O="";for(var R=0,A=0,F=0;F<this.length;F++){var K=this.words[F],L=((K<<R|A)&16777215).toString(16);A=K>>>24-R&16777215,R+=2,R>=26&&(R-=26,F--),A!==0||F!==this.length-1?O=h[6-L.length]+L+O:O=L+O}for(A!==0&&(O=A.toString(16)+O);O.length%E!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}if(m===(m|0)&&m>=2&&m<=36){var _=l[m],U=b[m];O="";var fe=this.clone();for(fe.negative=0;!fe.isZero();){var se=fe.modrn(U).toString(m);fe=fe.idivn(U),fe.isZero()?O=se+O:O=h[_-se.length]+se+O}for(this.isZero()&&(O="0"+O);O.length%E!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},r.prototype.toJSON=function(){return this.toString(16,2)},s&&(r.prototype.toBuffer=function(m,E){return this.toArrayLike(s,m,E)}),r.prototype.toArray=function(m,E){return this.toArrayLike(Array,m,E)};var p=function(m,E){return m.allocUnsafe?m.allocUnsafe(E):new m(E)};r.prototype.toArrayLike=function(m,E,O){this._strip();var R=this.byteLength(),A=O||Math.max(1,R);i(R<=A,"byte array longer than desired length"),i(A>0,"Requested array length <= 0");var F=p(m,A),K=E==="le"?"LE":"BE";return this["_toArrayLike"+K](F,R),F},r.prototype._toArrayLikeLE=function(m,E){for(var O=0,R=0,A=0,F=0;A<this.length;A++){var K=this.words[A]<<F|R;m[O++]=K&255,O<m.length&&(m[O++]=K>>8&255),O<m.length&&(m[O++]=K>>16&255),F===6?(O<m.length&&(m[O++]=K>>24&255),R=0,F=0):(R=K>>>24,F+=2)}if(O<m.length)for(m[O++]=R;O<m.length;)m[O++]=0},r.prototype._toArrayLikeBE=function(m,E){for(var O=m.length-1,R=0,A=0,F=0;A<this.length;A++){var K=this.words[A]<<F|R;m[O--]=K&255,O>=0&&(m[O--]=K>>8&255),O>=0&&(m[O--]=K>>16&255),F===6?(O>=0&&(m[O--]=K>>24&255),R=0,F=0):(R=K>>>24,F+=2)}if(O>=0)for(m[O--]=R;O>=0;)m[O--]=0},Math.clz32?r.prototype._countBits=function(m){return 32-Math.clz32(m)}:r.prototype._countBits=function(m){var E=m,O=0;return E>=4096&&(O+=13,E>>>=13),E>=64&&(O+=7,E>>>=7),E>=8&&(O+=4,E>>>=4),E>=2&&(O+=2,E>>>=2),O+E},r.prototype._zeroBits=function(m){if(m===0)return 26;var E=m,O=0;return(E&8191)===0&&(O+=13,E>>>=13),(E&127)===0&&(O+=7,E>>>=7),(E&15)===0&&(O+=4,E>>>=4),(E&3)===0&&(O+=2,E>>>=2),(E&1)===0&&O++,O},r.prototype.bitLength=function(){var m=this.words[this.length-1],E=this._countBits(m);return(this.length-1)*26+E};function y(k){for(var m=new Array(k.bitLength()),E=0;E<m.length;E++){var O=E/26|0,R=E%26;m[E]=k.words[O]>>>R&1}return m}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,E=0;E<this.length;E++){var O=this._zeroBits(this.words[E]);if(m+=O,O!==26)break}return m},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(m){return this.negative!==0?this.abs().inotn(m).iaddn(1):this.clone()},r.prototype.fromTwos=function(m){return this.testn(m-1)?this.notn(m).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(m){for(;this.length<m.length;)this.words[this.length++]=0;for(var E=0;E<m.length;E++)this.words[E]=this.words[E]|m.words[E];return this._strip()},r.prototype.ior=function(m){return i((this.negative|m.negative)===0),this.iuor(m)},r.prototype.or=function(m){return this.length>m.length?this.clone().ior(m):m.clone().ior(this)},r.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},r.prototype.iuand=function(m){var E;this.length>m.length?E=m:E=this;for(var O=0;O<E.length;O++)this.words[O]=this.words[O]&m.words[O];return this.length=E.length,this._strip()},r.prototype.iand=function(m){return i((this.negative|m.negative)===0),this.iuand(m)},r.prototype.and=function(m){return this.length>m.length?this.clone().iand(m):m.clone().iand(this)},r.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},r.prototype.iuxor=function(m){var E,O;this.length>m.length?(E=this,O=m):(E=m,O=this);for(var R=0;R<O.length;R++)this.words[R]=E.words[R]^O.words[R];if(this!==E)for(;R<E.length;R++)this.words[R]=E.words[R];return this.length=E.length,this._strip()},r.prototype.ixor=function(m){return i((this.negative|m.negative)===0),this.iuxor(m)},r.prototype.xor=function(m){return this.length>m.length?this.clone().ixor(m):m.clone().ixor(this)},r.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},r.prototype.inotn=function(m){i(typeof m=="number"&&m>=0);var E=Math.ceil(m/26)|0,O=m%26;this._expand(E),O>0&&E--;for(var R=0;R<E;R++)this.words[R]=~this.words[R]&67108863;return O>0&&(this.words[R]=~this.words[R]&67108863>>26-O),this._strip()},r.prototype.notn=function(m){return this.clone().inotn(m)},r.prototype.setn=function(m,E){i(typeof m=="number"&&m>=0);var O=m/26|0,R=m%26;return this._expand(O+1),E?this.words[O]=this.words[O]|1<<R:this.words[O]=this.words[O]&~(1<<R),this._strip()},r.prototype.iadd=function(m){var E;if(this.negative!==0&&m.negative===0)return this.negative=0,E=this.isub(m),this.negative^=1,this._normSign();if(this.negative===0&&m.negative!==0)return m.negative=0,E=this.isub(m),m.negative=1,E._normSign();var O,R;this.length>m.length?(O=this,R=m):(O=m,R=this);for(var A=0,F=0;F<R.length;F++)E=(O.words[F]|0)+(R.words[F]|0)+A,this.words[F]=E&67108863,A=E>>>26;for(;A!==0&&F<O.length;F++)E=(O.words[F]|0)+A,this.words[F]=E&67108863,A=E>>>26;if(this.length=O.length,A!==0)this.words[this.length]=A,this.length++;else if(O!==this)for(;F<O.length;F++)this.words[F]=O.words[F];return this},r.prototype.add=function(m){var E;return m.negative!==0&&this.negative===0?(m.negative=0,E=this.sub(m),m.negative^=1,E):m.negative===0&&this.negative!==0?(this.negative=0,E=m.sub(this),this.negative=1,E):this.length>m.length?this.clone().iadd(m):m.clone().iadd(this)},r.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var E=this.iadd(m);return m.negative=1,E._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var O=this.cmp(m);if(O===0)return this.negative=0,this.length=1,this.words[0]=0,this;var R,A;O>0?(R=this,A=m):(R=m,A=this);for(var F=0,K=0;K<A.length;K++)E=(R.words[K]|0)-(A.words[K]|0)+F,F=E>>26,this.words[K]=E&67108863;for(;F!==0&&K<R.length;K++)E=(R.words[K]|0)+F,F=E>>26,this.words[K]=E&67108863;if(F===0&&K<R.length&&R!==this)for(;K<R.length;K++)this.words[K]=R.words[K];return this.length=Math.max(this.length,K),R!==this&&(this.negative=1),this._strip()},r.prototype.sub=function(m){return this.clone().isub(m)};function v(k,m,E){E.negative=m.negative^k.negative;var O=k.length+m.length|0;E.length=O,O=O-1|0;var R=k.words[0]|0,A=m.words[0]|0,F=R*A,K=F&67108863,L=F/67108864|0;E.words[0]=K;for(var _=1;_<O;_++){for(var U=L>>>26,fe=L&67108863,se=Math.min(_,m.length-1),V=Math.max(0,_-k.length+1);V<=se;V++){var P=_-V|0;R=k.words[P]|0,A=m.words[V]|0,F=R*A+fe,U+=F/67108864|0,fe=F&67108863}E.words[_]=fe|0,L=U|0}return L!==0?E.words[_]=L|0:E.length--,E._strip()}var g=function(m,E,O){var R=m.words,A=E.words,F=O.words,K=0,L,_,U,fe=R[0]|0,se=fe&8191,V=fe>>>13,P=R[1]|0,M=P&8191,Y=P>>>13,Q=R[2]|0,D=Q&8191,C=Q>>>13,J=R[3]|0,ie=J&8191,he=J>>>13,oe=R[4]|0,ue=oe&8191,ge=oe>>>13,Ke=R[5]|0,Se=Ke&8191,de=Ke>>>13,Re=R[6]|0,ve=Re&8191,me=Re>>>13,Le=R[7]|0,Pe=Le&8191,N=Le>>>13,w=R[8]|0,S=w&8191,H=w>>>13,W=R[9]|0,X=W&8191,ee=W>>>13,Be=A[0]|0,we=Be&8191,ye=Be>>>13,Fe=A[1]|0,be=Fe&8191,ze=Fe>>>13,gs=A[2]|0,Ve=gs&8191,Ge=gs>>>13,ws=A[3]|0,$e=ws&8191,We=ws>>>13,_s=A[4]|0,Ye=_s&8191,Je=_s>>>13,Ss=A[5]|0,Xe=Ss&8191,Qe=Ss>>>13,xs=A[6]|0,Ze=xs&8191,et=xs>>>13,Es=A[7]|0,tt=Es&8191,rt=Es>>>13,Bs=A[8]|0,it=Bs&8191,nt=Bs>>>13,Rs=A[9]|0,at=Rs&8191,ft=Rs>>>13;O.negative=m.negative^E.negative,O.length=19,L=Math.imul(se,we),_=Math.imul(se,ye),_=_+Math.imul(V,we)|0,U=Math.imul(V,ye);var Zr=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,L=Math.imul(M,we),_=Math.imul(M,ye),_=_+Math.imul(Y,we)|0,U=Math.imul(Y,ye),L=L+Math.imul(se,be)|0,_=_+Math.imul(se,ze)|0,_=_+Math.imul(V,be)|0,U=U+Math.imul(V,ze)|0;var ei=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ei>>>26)|0,ei&=67108863,L=Math.imul(D,we),_=Math.imul(D,ye),_=_+Math.imul(C,we)|0,U=Math.imul(C,ye),L=L+Math.imul(M,be)|0,_=_+Math.imul(M,ze)|0,_=_+Math.imul(Y,be)|0,U=U+Math.imul(Y,ze)|0,L=L+Math.imul(se,Ve)|0,_=_+Math.imul(se,Ge)|0,_=_+Math.imul(V,Ve)|0,U=U+Math.imul(V,Ge)|0;var ti=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ti>>>26)|0,ti&=67108863,L=Math.imul(ie,we),_=Math.imul(ie,ye),_=_+Math.imul(he,we)|0,U=Math.imul(he,ye),L=L+Math.imul(D,be)|0,_=_+Math.imul(D,ze)|0,_=_+Math.imul(C,be)|0,U=U+Math.imul(C,ze)|0,L=L+Math.imul(M,Ve)|0,_=_+Math.imul(M,Ge)|0,_=_+Math.imul(Y,Ve)|0,U=U+Math.imul(Y,Ge)|0,L=L+Math.imul(se,$e)|0,_=_+Math.imul(se,We)|0,_=_+Math.imul(V,$e)|0,U=U+Math.imul(V,We)|0;var ri=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ri>>>26)|0,ri&=67108863,L=Math.imul(ue,we),_=Math.imul(ue,ye),_=_+Math.imul(ge,we)|0,U=Math.imul(ge,ye),L=L+Math.imul(ie,be)|0,_=_+Math.imul(ie,ze)|0,_=_+Math.imul(he,be)|0,U=U+Math.imul(he,ze)|0,L=L+Math.imul(D,Ve)|0,_=_+Math.imul(D,Ge)|0,_=_+Math.imul(C,Ve)|0,U=U+Math.imul(C,Ge)|0,L=L+Math.imul(M,$e)|0,_=_+Math.imul(M,We)|0,_=_+Math.imul(Y,$e)|0,U=U+Math.imul(Y,We)|0,L=L+Math.imul(se,Ye)|0,_=_+Math.imul(se,Je)|0,_=_+Math.imul(V,Ye)|0,U=U+Math.imul(V,Je)|0;var ii=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ii>>>26)|0,ii&=67108863,L=Math.imul(Se,we),_=Math.imul(Se,ye),_=_+Math.imul(de,we)|0,U=Math.imul(de,ye),L=L+Math.imul(ue,be)|0,_=_+Math.imul(ue,ze)|0,_=_+Math.imul(ge,be)|0,U=U+Math.imul(ge,ze)|0,L=L+Math.imul(ie,Ve)|0,_=_+Math.imul(ie,Ge)|0,_=_+Math.imul(he,Ve)|0,U=U+Math.imul(he,Ge)|0,L=L+Math.imul(D,$e)|0,_=_+Math.imul(D,We)|0,_=_+Math.imul(C,$e)|0,U=U+Math.imul(C,We)|0,L=L+Math.imul(M,Ye)|0,_=_+Math.imul(M,Je)|0,_=_+Math.imul(Y,Ye)|0,U=U+Math.imul(Y,Je)|0,L=L+Math.imul(se,Xe)|0,_=_+Math.imul(se,Qe)|0,_=_+Math.imul(V,Xe)|0,U=U+Math.imul(V,Qe)|0;var ni=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ni>>>26)|0,ni&=67108863,L=Math.imul(ve,we),_=Math.imul(ve,ye),_=_+Math.imul(me,we)|0,U=Math.imul(me,ye),L=L+Math.imul(Se,be)|0,_=_+Math.imul(Se,ze)|0,_=_+Math.imul(de,be)|0,U=U+Math.imul(de,ze)|0,L=L+Math.imul(ue,Ve)|0,_=_+Math.imul(ue,Ge)|0,_=_+Math.imul(ge,Ve)|0,U=U+Math.imul(ge,Ge)|0,L=L+Math.imul(ie,$e)|0,_=_+Math.imul(ie,We)|0,_=_+Math.imul(he,$e)|0,U=U+Math.imul(he,We)|0,L=L+Math.imul(D,Ye)|0,_=_+Math.imul(D,Je)|0,_=_+Math.imul(C,Ye)|0,U=U+Math.imul(C,Je)|0,L=L+Math.imul(M,Xe)|0,_=_+Math.imul(M,Qe)|0,_=_+Math.imul(Y,Xe)|0,U=U+Math.imul(Y,Qe)|0,L=L+Math.imul(se,Ze)|0,_=_+Math.imul(se,et)|0,_=_+Math.imul(V,Ze)|0,U=U+Math.imul(V,et)|0;var ai=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ai>>>26)|0,ai&=67108863,L=Math.imul(Pe,we),_=Math.imul(Pe,ye),_=_+Math.imul(N,we)|0,U=Math.imul(N,ye),L=L+Math.imul(ve,be)|0,_=_+Math.imul(ve,ze)|0,_=_+Math.imul(me,be)|0,U=U+Math.imul(me,ze)|0,L=L+Math.imul(Se,Ve)|0,_=_+Math.imul(Se,Ge)|0,_=_+Math.imul(de,Ve)|0,U=U+Math.imul(de,Ge)|0,L=L+Math.imul(ue,$e)|0,_=_+Math.imul(ue,We)|0,_=_+Math.imul(ge,$e)|0,U=U+Math.imul(ge,We)|0,L=L+Math.imul(ie,Ye)|0,_=_+Math.imul(ie,Je)|0,_=_+Math.imul(he,Ye)|0,U=U+Math.imul(he,Je)|0,L=L+Math.imul(D,Xe)|0,_=_+Math.imul(D,Qe)|0,_=_+Math.imul(C,Xe)|0,U=U+Math.imul(C,Qe)|0,L=L+Math.imul(M,Ze)|0,_=_+Math.imul(M,et)|0,_=_+Math.imul(Y,Ze)|0,U=U+Math.imul(Y,et)|0,L=L+Math.imul(se,tt)|0,_=_+Math.imul(se,rt)|0,_=_+Math.imul(V,tt)|0,U=U+Math.imul(V,rt)|0;var fi=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(fi>>>26)|0,fi&=67108863,L=Math.imul(S,we),_=Math.imul(S,ye),_=_+Math.imul(H,we)|0,U=Math.imul(H,ye),L=L+Math.imul(Pe,be)|0,_=_+Math.imul(Pe,ze)|0,_=_+Math.imul(N,be)|0,U=U+Math.imul(N,ze)|0,L=L+Math.imul(ve,Ve)|0,_=_+Math.imul(ve,Ge)|0,_=_+Math.imul(me,Ve)|0,U=U+Math.imul(me,Ge)|0,L=L+Math.imul(Se,$e)|0,_=_+Math.imul(Se,We)|0,_=_+Math.imul(de,$e)|0,U=U+Math.imul(de,We)|0,L=L+Math.imul(ue,Ye)|0,_=_+Math.imul(ue,Je)|0,_=_+Math.imul(ge,Ye)|0,U=U+Math.imul(ge,Je)|0,L=L+Math.imul(ie,Xe)|0,_=_+Math.imul(ie,Qe)|0,_=_+Math.imul(he,Xe)|0,U=U+Math.imul(he,Qe)|0,L=L+Math.imul(D,Ze)|0,_=_+Math.imul(D,et)|0,_=_+Math.imul(C,Ze)|0,U=U+Math.imul(C,et)|0,L=L+Math.imul(M,tt)|0,_=_+Math.imul(M,rt)|0,_=_+Math.imul(Y,tt)|0,U=U+Math.imul(Y,rt)|0,L=L+Math.imul(se,it)|0,_=_+Math.imul(se,nt)|0,_=_+Math.imul(V,it)|0,U=U+Math.imul(V,nt)|0;var si=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(si>>>26)|0,si&=67108863,L=Math.imul(X,we),_=Math.imul(X,ye),_=_+Math.imul(ee,we)|0,U=Math.imul(ee,ye),L=L+Math.imul(S,be)|0,_=_+Math.imul(S,ze)|0,_=_+Math.imul(H,be)|0,U=U+Math.imul(H,ze)|0,L=L+Math.imul(Pe,Ve)|0,_=_+Math.imul(Pe,Ge)|0,_=_+Math.imul(N,Ve)|0,U=U+Math.imul(N,Ge)|0,L=L+Math.imul(ve,$e)|0,_=_+Math.imul(ve,We)|0,_=_+Math.imul(me,$e)|0,U=U+Math.imul(me,We)|0,L=L+Math.imul(Se,Ye)|0,_=_+Math.imul(Se,Je)|0,_=_+Math.imul(de,Ye)|0,U=U+Math.imul(de,Je)|0,L=L+Math.imul(ue,Xe)|0,_=_+Math.imul(ue,Qe)|0,_=_+Math.imul(ge,Xe)|0,U=U+Math.imul(ge,Qe)|0,L=L+Math.imul(ie,Ze)|0,_=_+Math.imul(ie,et)|0,_=_+Math.imul(he,Ze)|0,U=U+Math.imul(he,et)|0,L=L+Math.imul(D,tt)|0,_=_+Math.imul(D,rt)|0,_=_+Math.imul(C,tt)|0,U=U+Math.imul(C,rt)|0,L=L+Math.imul(M,it)|0,_=_+Math.imul(M,nt)|0,_=_+Math.imul(Y,it)|0,U=U+Math.imul(Y,nt)|0,L=L+Math.imul(se,at)|0,_=_+Math.imul(se,ft)|0,_=_+Math.imul(V,at)|0,U=U+Math.imul(V,ft)|0;var oi=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(oi>>>26)|0,oi&=67108863,L=Math.imul(X,be),_=Math.imul(X,ze),_=_+Math.imul(ee,be)|0,U=Math.imul(ee,ze),L=L+Math.imul(S,Ve)|0,_=_+Math.imul(S,Ge)|0,_=_+Math.imul(H,Ve)|0,U=U+Math.imul(H,Ge)|0,L=L+Math.imul(Pe,$e)|0,_=_+Math.imul(Pe,We)|0,_=_+Math.imul(N,$e)|0,U=U+Math.imul(N,We)|0,L=L+Math.imul(ve,Ye)|0,_=_+Math.imul(ve,Je)|0,_=_+Math.imul(me,Ye)|0,U=U+Math.imul(me,Je)|0,L=L+Math.imul(Se,Xe)|0,_=_+Math.imul(Se,Qe)|0,_=_+Math.imul(de,Xe)|0,U=U+Math.imul(de,Qe)|0,L=L+Math.imul(ue,Ze)|0,_=_+Math.imul(ue,et)|0,_=_+Math.imul(ge,Ze)|0,U=U+Math.imul(ge,et)|0,L=L+Math.imul(ie,tt)|0,_=_+Math.imul(ie,rt)|0,_=_+Math.imul(he,tt)|0,U=U+Math.imul(he,rt)|0,L=L+Math.imul(D,it)|0,_=_+Math.imul(D,nt)|0,_=_+Math.imul(C,it)|0,U=U+Math.imul(C,nt)|0,L=L+Math.imul(M,at)|0,_=_+Math.imul(M,ft)|0,_=_+Math.imul(Y,at)|0,U=U+Math.imul(Y,ft)|0;var ci=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ci>>>26)|0,ci&=67108863,L=Math.imul(X,Ve),_=Math.imul(X,Ge),_=_+Math.imul(ee,Ve)|0,U=Math.imul(ee,Ge),L=L+Math.imul(S,$e)|0,_=_+Math.imul(S,We)|0,_=_+Math.imul(H,$e)|0,U=U+Math.imul(H,We)|0,L=L+Math.imul(Pe,Ye)|0,_=_+Math.imul(Pe,Je)|0,_=_+Math.imul(N,Ye)|0,U=U+Math.imul(N,Je)|0,L=L+Math.imul(ve,Xe)|0,_=_+Math.imul(ve,Qe)|0,_=_+Math.imul(me,Xe)|0,U=U+Math.imul(me,Qe)|0,L=L+Math.imul(Se,Ze)|0,_=_+Math.imul(Se,et)|0,_=_+Math.imul(de,Ze)|0,U=U+Math.imul(de,et)|0,L=L+Math.imul(ue,tt)|0,_=_+Math.imul(ue,rt)|0,_=_+Math.imul(ge,tt)|0,U=U+Math.imul(ge,rt)|0,L=L+Math.imul(ie,it)|0,_=_+Math.imul(ie,nt)|0,_=_+Math.imul(he,it)|0,U=U+Math.imul(he,nt)|0,L=L+Math.imul(D,at)|0,_=_+Math.imul(D,ft)|0,_=_+Math.imul(C,at)|0,U=U+Math.imul(C,ft)|0;var ui=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(ui>>>26)|0,ui&=67108863,L=Math.imul(X,$e),_=Math.imul(X,We),_=_+Math.imul(ee,$e)|0,U=Math.imul(ee,We),L=L+Math.imul(S,Ye)|0,_=_+Math.imul(S,Je)|0,_=_+Math.imul(H,Ye)|0,U=U+Math.imul(H,Je)|0,L=L+Math.imul(Pe,Xe)|0,_=_+Math.imul(Pe,Qe)|0,_=_+Math.imul(N,Xe)|0,U=U+Math.imul(N,Qe)|0,L=L+Math.imul(ve,Ze)|0,_=_+Math.imul(ve,et)|0,_=_+Math.imul(me,Ze)|0,U=U+Math.imul(me,et)|0,L=L+Math.imul(Se,tt)|0,_=_+Math.imul(Se,rt)|0,_=_+Math.imul(de,tt)|0,U=U+Math.imul(de,rt)|0,L=L+Math.imul(ue,it)|0,_=_+Math.imul(ue,nt)|0,_=_+Math.imul(ge,it)|0,U=U+Math.imul(ge,nt)|0,L=L+Math.imul(ie,at)|0,_=_+Math.imul(ie,ft)|0,_=_+Math.imul(he,at)|0,U=U+Math.imul(he,ft)|0;var hi=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(hi>>>26)|0,hi&=67108863,L=Math.imul(X,Ye),_=Math.imul(X,Je),_=_+Math.imul(ee,Ye)|0,U=Math.imul(ee,Je),L=L+Math.imul(S,Xe)|0,_=_+Math.imul(S,Qe)|0,_=_+Math.imul(H,Xe)|0,U=U+Math.imul(H,Qe)|0,L=L+Math.imul(Pe,Ze)|0,_=_+Math.imul(Pe,et)|0,_=_+Math.imul(N,Ze)|0,U=U+Math.imul(N,et)|0,L=L+Math.imul(ve,tt)|0,_=_+Math.imul(ve,rt)|0,_=_+Math.imul(me,tt)|0,U=U+Math.imul(me,rt)|0,L=L+Math.imul(Se,it)|0,_=_+Math.imul(Se,nt)|0,_=_+Math.imul(de,it)|0,U=U+Math.imul(de,nt)|0,L=L+Math.imul(ue,at)|0,_=_+Math.imul(ue,ft)|0,_=_+Math.imul(ge,at)|0,U=U+Math.imul(ge,ft)|0;var di=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(di>>>26)|0,di&=67108863,L=Math.imul(X,Xe),_=Math.imul(X,Qe),_=_+Math.imul(ee,Xe)|0,U=Math.imul(ee,Qe),L=L+Math.imul(S,Ze)|0,_=_+Math.imul(S,et)|0,_=_+Math.imul(H,Ze)|0,U=U+Math.imul(H,et)|0,L=L+Math.imul(Pe,tt)|0,_=_+Math.imul(Pe,rt)|0,_=_+Math.imul(N,tt)|0,U=U+Math.imul(N,rt)|0,L=L+Math.imul(ve,it)|0,_=_+Math.imul(ve,nt)|0,_=_+Math.imul(me,it)|0,U=U+Math.imul(me,nt)|0,L=L+Math.imul(Se,at)|0,_=_+Math.imul(Se,ft)|0,_=_+Math.imul(de,at)|0,U=U+Math.imul(de,ft)|0;var li=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(li>>>26)|0,li&=67108863,L=Math.imul(X,Ze),_=Math.imul(X,et),_=_+Math.imul(ee,Ze)|0,U=Math.imul(ee,et),L=L+Math.imul(S,tt)|0,_=_+Math.imul(S,rt)|0,_=_+Math.imul(H,tt)|0,U=U+Math.imul(H,rt)|0,L=L+Math.imul(Pe,it)|0,_=_+Math.imul(Pe,nt)|0,_=_+Math.imul(N,it)|0,U=U+Math.imul(N,nt)|0,L=L+Math.imul(ve,at)|0,_=_+Math.imul(ve,ft)|0,_=_+Math.imul(me,at)|0,U=U+Math.imul(me,ft)|0;var bi=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(bi>>>26)|0,bi&=67108863,L=Math.imul(X,tt),_=Math.imul(X,rt),_=_+Math.imul(ee,tt)|0,U=Math.imul(ee,rt),L=L+Math.imul(S,it)|0,_=_+Math.imul(S,nt)|0,_=_+Math.imul(H,it)|0,U=U+Math.imul(H,nt)|0,L=L+Math.imul(Pe,at)|0,_=_+Math.imul(Pe,ft)|0,_=_+Math.imul(N,at)|0,U=U+Math.imul(N,ft)|0;var pi=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(pi>>>26)|0,pi&=67108863,L=Math.imul(X,it),_=Math.imul(X,nt),_=_+Math.imul(ee,it)|0,U=Math.imul(ee,nt),L=L+Math.imul(S,at)|0,_=_+Math.imul(S,ft)|0,_=_+Math.imul(H,at)|0,U=U+Math.imul(H,ft)|0;var vi=(K+L|0)+((_&8191)<<13)|0;K=(U+(_>>>13)|0)+(vi>>>26)|0,vi&=67108863,L=Math.imul(X,at),_=Math.imul(X,ft),_=_+Math.imul(ee,at)|0,U=Math.imul(ee,ft);var mi=(K+L|0)+((_&8191)<<13)|0;return K=(U+(_>>>13)|0)+(mi>>>26)|0,mi&=67108863,F[0]=Zr,F[1]=ei,F[2]=ti,F[3]=ri,F[4]=ii,F[5]=ni,F[6]=ai,F[7]=fi,F[8]=si,F[9]=oi,F[10]=ci,F[11]=ui,F[12]=hi,F[13]=di,F[14]=li,F[15]=bi,F[16]=pi,F[17]=vi,F[18]=mi,K!==0&&(F[19]=K,O.length++),O};Math.imul||(g=v);function x(k,m,E){E.negative=m.negative^k.negative,E.length=k.length+m.length;for(var O=0,R=0,A=0;A<E.length-1;A++){var F=R;R=0;for(var K=O&67108863,L=Math.min(A,m.length-1),_=Math.max(0,A-k.length+1);_<=L;_++){var U=A-_,fe=k.words[U]|0,se=m.words[_]|0,V=fe*se,P=V&67108863;F=F+(V/67108864|0)|0,P=P+K|0,K=P&67108863,F=F+(P>>>26)|0,R+=F>>>26,F&=67108863}E.words[A]=K,O=F,F=R}return O!==0?E.words[A]=O:E.length--,E._strip()}function B(k,m,E){return x(k,m,E)}r.prototype.mulTo=function(m,E){var O,R=this.length+m.length;return this.length===10&&m.length===10?O=g(this,m,E):R<63?O=v(this,m,E):R<1024?O=x(this,m,E):O=B(this,m,E),O},r.prototype.mul=function(m){var E=new r(null);return E.words=new Array(this.length+m.length),this.mulTo(m,E)},r.prototype.mulf=function(m){var E=new r(null);return E.words=new Array(this.length+m.length),B(this,m,E)},r.prototype.imul=function(m){return this.clone().mulTo(m,this)},r.prototype.imuln=function(m){var E=m<0;E&&(m=-m),i(typeof m=="number"),i(m<67108864);for(var O=0,R=0;R<this.length;R++){var A=(this.words[R]|0)*m,F=(A&67108863)+(O&67108863);O>>=26,O+=A/67108864|0,O+=F>>>26,this.words[R]=F&67108863}return O!==0&&(this.words[R]=O,this.length++),this.length=m===0?1:this.length,E?this.ineg():this},r.prototype.muln=function(m){return this.clone().imuln(m)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(m){var E=y(m);if(E.length===0)return new r(1);for(var O=this,R=0;R<E.length&&E[R]===0;R++,O=O.sqr());if(++R<E.length)for(var A=O.sqr();R<E.length;R++,A=A.sqr())E[R]!==0&&(O=O.mul(A));return O},r.prototype.iushln=function(m){i(typeof m=="number"&&m>=0);var E=m%26,O=(m-E)/26,R=67108863>>>26-E<<26-E,A;if(E!==0){var F=0;for(A=0;A<this.length;A++){var K=this.words[A]&R,L=(this.words[A]|0)-K<<E;this.words[A]=L|F,F=K>>>26-E}F&&(this.words[A]=F,this.length++)}if(O!==0){for(A=this.length-1;A>=0;A--)this.words[A+O]=this.words[A];for(A=0;A<O;A++)this.words[A]=0;this.length+=O}return this._strip()},r.prototype.ishln=function(m){return i(this.negative===0),this.iushln(m)},r.prototype.iushrn=function(m,E,O){i(typeof m=="number"&&m>=0);var R;E?R=(E-E%26)/26:R=0;var A=m%26,F=Math.min((m-A)/26,this.length),K=67108863^67108863>>>A<<A,L=O;if(R-=F,R=Math.max(0,R),L){for(var _=0;_<F;_++)L.words[_]=this.words[_];L.length=F}if(F!==0)if(this.length>F)for(this.length-=F,_=0;_<this.length;_++)this.words[_]=this.words[_+F];else this.words[0]=0,this.length=1;var U=0;for(_=this.length-1;_>=0&&(U!==0||_>=R);_--){var fe=this.words[_]|0;this.words[_]=U<<26-A|fe>>>A,U=fe&K}return L&&U!==0&&(L.words[L.length++]=U),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.ishrn=function(m,E,O){return i(this.negative===0),this.iushrn(m,E,O)},r.prototype.shln=function(m){return this.clone().ishln(m)},r.prototype.ushln=function(m){return this.clone().iushln(m)},r.prototype.shrn=function(m){return this.clone().ishrn(m)},r.prototype.ushrn=function(m){return this.clone().iushrn(m)},r.prototype.testn=function(m){i(typeof m=="number"&&m>=0);var E=m%26,O=(m-E)/26,R=1<<E;if(this.length<=O)return!1;var A=this.words[O];return!!(A&R)},r.prototype.imaskn=function(m){i(typeof m=="number"&&m>=0);var E=m%26,O=(m-E)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=O)return this;if(E!==0&&O++,this.length=Math.min(O,this.length),E!==0){var R=67108863^67108863>>>E<<E;this.words[this.length-1]&=R}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.maskn=function(m){return this.clone().imaskn(m)},r.prototype.iaddn=function(m){return i(typeof m=="number"),i(m<67108864),m<0?this.isubn(-m):this.negative!==0?this.length===1&&(this.words[0]|0)<=m?(this.words[0]=m-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(m),this.negative=1,this):this._iaddn(m)},r.prototype._iaddn=function(m){this.words[0]+=m;for(var E=0;E<this.length&&this.words[E]>=67108864;E++)this.words[E]-=67108864,E===this.length-1?this.words[E+1]=1:this.words[E+1]++;return this.length=Math.max(this.length,E+1),this},r.prototype.isubn=function(m){if(i(typeof m=="number"),i(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var E=0;E<this.length&&this.words[E]<0;E++)this.words[E]+=67108864,this.words[E+1]-=1;return this._strip()},r.prototype.addn=function(m){return this.clone().iaddn(m)},r.prototype.subn=function(m){return this.clone().isubn(m)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(m,E,O){var R=m.length+O,A;this._expand(R);var F,K=0;for(A=0;A<m.length;A++){F=(this.words[A+O]|0)+K;var L=(m.words[A]|0)*E;F-=L&67108863,K=(F>>26)-(L/67108864|0),this.words[A+O]=F&67108863}for(;A<this.length-O;A++)F=(this.words[A+O]|0)+K,K=F>>26,this.words[A+O]=F&67108863;if(K===0)return this._strip();for(i(K===-1),K=0,A=0;A<this.length;A++)F=-(this.words[A]|0)+K,K=F>>26,this.words[A]=F&67108863;return this.negative=1,this._strip()},r.prototype._wordDiv=function(m,E){var O=this.length-m.length,R=this.clone(),A=m,F=A.words[A.length-1]|0,K=this._countBits(F);O=26-K,O!==0&&(A=A.ushln(O),R.iushln(O),F=A.words[A.length-1]|0);var L=R.length-A.length,_;if(E!=="mod"){_=new r(null),_.length=L+1,_.words=new Array(_.length);for(var U=0;U<_.length;U++)_.words[U]=0}var fe=R.clone()._ishlnsubmul(A,1,L);fe.negative===0&&(R=fe,_&&(_.words[L]=1));for(var se=L-1;se>=0;se--){var V=(R.words[A.length+se]|0)*67108864+(R.words[A.length+se-1]|0);for(V=Math.min(V/F|0,67108863),R._ishlnsubmul(A,V,se);R.negative!==0;)V--,R.negative=0,R._ishlnsubmul(A,1,se),R.isZero()||(R.negative^=1);_&&(_.words[se]=V)}return _&&_._strip(),R._strip(),E!=="div"&&O!==0&&R.iushrn(O),{div:_||null,mod:R}},r.prototype.divmod=function(m,E,O){if(i(!m.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var R,A,F;return this.negative!==0&&m.negative===0?(F=this.neg().divmod(m,E),E!=="mod"&&(R=F.div.neg()),E!=="div"&&(A=F.mod.neg(),O&&A.negative!==0&&A.iadd(m)),{div:R,mod:A}):this.negative===0&&m.negative!==0?(F=this.divmod(m.neg(),E),E!=="mod"&&(R=F.div.neg()),{div:R,mod:F.mod}):(this.negative&m.negative)!==0?(F=this.neg().divmod(m.neg(),E),E!=="div"&&(A=F.mod.neg(),O&&A.negative!==0&&A.isub(m)),{div:F.div,mod:A}):m.length>this.length||this.cmp(m)<0?{div:new r(0),mod:this}:m.length===1?E==="div"?{div:this.divn(m.words[0]),mod:null}:E==="mod"?{div:null,mod:new r(this.modrn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new r(this.modrn(m.words[0]))}:this._wordDiv(m,E)},r.prototype.div=function(m){return this.divmod(m,"div",!1).div},r.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},r.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},r.prototype.divRound=function(m){var E=this.divmod(m);if(E.mod.isZero())return E.div;var O=E.div.negative!==0?E.mod.isub(m):E.mod,R=m.ushrn(1),A=m.andln(1),F=O.cmp(R);return F<0||A===1&&F===0?E.div:E.div.negative!==0?E.div.isubn(1):E.div.iaddn(1)},r.prototype.modrn=function(m){var E=m<0;E&&(m=-m),i(m<=67108863);for(var O=(1<<26)%m,R=0,A=this.length-1;A>=0;A--)R=(O*R+(this.words[A]|0))%m;return E?-R:R},r.prototype.modn=function(m){return this.modrn(m)},r.prototype.idivn=function(m){var E=m<0;E&&(m=-m),i(m<=67108863);for(var O=0,R=this.length-1;R>=0;R--){var A=(this.words[R]|0)+O*67108864;this.words[R]=A/m|0,O=A%m}return this._strip(),E?this.ineg():this},r.prototype.divn=function(m){return this.clone().idivn(m)},r.prototype.egcd=function(m){i(m.negative===0),i(!m.isZero());var E=this,O=m.clone();E.negative!==0?E=E.umod(m):E=E.clone();for(var R=new r(1),A=new r(0),F=new r(0),K=new r(1),L=0;E.isEven()&&O.isEven();)E.iushrn(1),O.iushrn(1),++L;for(var _=O.clone(),U=E.clone();!E.isZero();){for(var fe=0,se=1;(E.words[0]&se)===0&&fe<26;++fe,se<<=1);if(fe>0)for(E.iushrn(fe);fe-- >0;)(R.isOdd()||A.isOdd())&&(R.iadd(_),A.isub(U)),R.iushrn(1),A.iushrn(1);for(var V=0,P=1;(O.words[0]&P)===0&&V<26;++V,P<<=1);if(V>0)for(O.iushrn(V);V-- >0;)(F.isOdd()||K.isOdd())&&(F.iadd(_),K.isub(U)),F.iushrn(1),K.iushrn(1);E.cmp(O)>=0?(E.isub(O),R.isub(F),A.isub(K)):(O.isub(E),F.isub(R),K.isub(A))}return{a:F,b:K,gcd:O.iushln(L)}},r.prototype._invmp=function(m){i(m.negative===0),i(!m.isZero());var E=this,O=m.clone();E.negative!==0?E=E.umod(m):E=E.clone();for(var R=new r(1),A=new r(0),F=O.clone();E.cmpn(1)>0&&O.cmpn(1)>0;){for(var K=0,L=1;(E.words[0]&L)===0&&K<26;++K,L<<=1);if(K>0)for(E.iushrn(K);K-- >0;)R.isOdd()&&R.iadd(F),R.iushrn(1);for(var _=0,U=1;(O.words[0]&U)===0&&_<26;++_,U<<=1);if(_>0)for(O.iushrn(_);_-- >0;)A.isOdd()&&A.iadd(F),A.iushrn(1);E.cmp(O)>=0?(E.isub(O),R.isub(A)):(O.isub(E),A.isub(R))}var fe;return E.cmpn(1)===0?fe=R:fe=A,fe.cmpn(0)<0&&fe.iadd(m),fe},r.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var E=this.clone(),O=m.clone();E.negative=0,O.negative=0;for(var R=0;E.isEven()&&O.isEven();R++)E.iushrn(1),O.iushrn(1);do{for(;E.isEven();)E.iushrn(1);for(;O.isEven();)O.iushrn(1);var A=E.cmp(O);if(A<0){var F=E;E=O,O=F}else if(A===0||O.cmpn(1)===0)break;E.isub(O)}while(!0);return O.iushln(R)},r.prototype.invm=function(m){return this.egcd(m).a.umod(m)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(m){return this.words[0]&m},r.prototype.bincn=function(m){i(typeof m=="number");var E=m%26,O=(m-E)/26,R=1<<E;if(this.length<=O)return this._expand(O+1),this.words[O]|=R,this;for(var A=R,F=O;A!==0&&F<this.length;F++){var K=this.words[F]|0;K+=A,A=K>>>26,K&=67108863,this.words[F]=K}return A!==0&&(this.words[F]=A,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(m){var E=m<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;this._strip();var O;if(this.length>1)O=1;else{E&&(m=-m),i(m<=67108863,"Number is too big");var R=this.words[0]|0;O=R===m?0:R<m?-1:1}return this.negative!==0?-O|0:O},r.prototype.cmp=function(m){if(this.negative!==0&&m.negative===0)return-1;if(this.negative===0&&m.negative!==0)return 1;var E=this.ucmp(m);return this.negative!==0?-E|0:E},r.prototype.ucmp=function(m){if(this.length>m.length)return 1;if(this.length<m.length)return-1;for(var E=0,O=this.length-1;O>=0;O--){var R=this.words[O]|0,A=m.words[O]|0;if(R!==A){R<A?E=-1:R>A&&(E=1);break}}return E},r.prototype.gtn=function(m){return this.cmpn(m)===1},r.prototype.gt=function(m){return this.cmp(m)===1},r.prototype.gten=function(m){return this.cmpn(m)>=0},r.prototype.gte=function(m){return this.cmp(m)>=0},r.prototype.ltn=function(m){return this.cmpn(m)===-1},r.prototype.lt=function(m){return this.cmp(m)===-1},r.prototype.lten=function(m){return this.cmpn(m)<=0},r.prototype.lte=function(m){return this.cmp(m)<=0},r.prototype.eqn=function(m){return this.cmpn(m)===0},r.prototype.eq=function(m){return this.cmp(m)===0},r.red=function(m){return new ne(m)},r.prototype.toRed=function(m){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(m){return this.red=m,this},r.prototype.forceRed=function(m){return i(!this.red,"Already a number in reduction context"),this._forceRed(m)},r.prototype.redAdd=function(m){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},r.prototype.redIAdd=function(m){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},r.prototype.redSub=function(m){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},r.prototype.redISub=function(m){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},r.prototype.redShl=function(m){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},r.prototype.redMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},r.prototype.redIMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(m){return i(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var I={k256:null,p224:null,p192:null,p25519:null};function T(k,m){this.name=k,this.p=new r(m,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var m=new r(null);return m.words=new Array(Math.ceil(this.n/13)),m},T.prototype.ireduce=function(m){var E=m,O;do this.split(E,this.tmp),E=this.imulK(E),E=E.iadd(this.tmp),O=E.bitLength();while(O>this.n);var R=O<this.n?-1:E.ucmp(this.p);return R===0?(E.words[0]=0,E.length=1):R>0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},T.prototype.split=function(m,E){m.iushrn(this.n,0,E)},T.prototype.imulK=function(m){return m.imul(this.k)};function j(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}u(j,T),j.prototype.split=function(m,E){for(var O=4194303,R=Math.min(m.length,9),A=0;A<R;A++)E.words[A]=m.words[A];if(E.length=R,m.length<=9){m.words[0]=0,m.length=1;return}var F=m.words[9];for(E.words[E.length++]=F&O,A=10;A<m.length;A++){var K=m.words[A]|0;m.words[A-10]=(K&O)<<4|F>>>22,F=K}F>>>=22,m.words[A-10]=F,F===0&&m.length>10?m.length-=10:m.length-=9},j.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var E=0,O=0;O<m.length;O++){var R=m.words[O]|0;E+=R*977,m.words[O]=E&67108863,E=R*64+(E/67108864|0)}return m.words[m.length-1]===0&&(m.length--,m.words[m.length-1]===0&&m.length--),m};function G(){T.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}u(G,T);function z(){T.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}u(z,T);function te(){T.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}u(te,T),te.prototype.imulK=function(m){for(var E=0,O=0;O<m.length;O++){var R=(m.words[O]|0)*19+E,A=R&67108863;R>>>=26,m.words[O]=A,E=R}return E!==0&&(m.words[m.length++]=E),m},r._prime=function(m){if(I[m])return I[m];var E;if(m==="k256")E=new j;else if(m==="p224")E=new G;else if(m==="p192")E=new z;else if(m==="p25519")E=new te;else throw new Error("Unknown prime "+m);return I[m]=E,E};function ne(k){if(typeof k=="string"){var m=r._prime(k);this.m=m.p,this.prime=m}else i(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}ne.prototype._verify1=function(m){i(m.negative===0,"red works only with positives"),i(m.red,"red works only with red numbers")},ne.prototype._verify2=function(m,E){i((m.negative|E.negative)===0,"red works only with positives"),i(m.red&&m.red===E.red,"red works only with red numbers")},ne.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):(n(m,m.umod(this.m)._forceRed(this)),m)},ne.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},ne.prototype.add=function(m,E){this._verify2(m,E);var O=m.add(E);return O.cmp(this.m)>=0&&O.isub(this.m),O._forceRed(this)},ne.prototype.iadd=function(m,E){this._verify2(m,E);var O=m.iadd(E);return O.cmp(this.m)>=0&&O.isub(this.m),O},ne.prototype.sub=function(m,E){this._verify2(m,E);var O=m.sub(E);return O.cmpn(0)<0&&O.iadd(this.m),O._forceRed(this)},ne.prototype.isub=function(m,E){this._verify2(m,E);var O=m.isub(E);return O.cmpn(0)<0&&O.iadd(this.m),O},ne.prototype.shl=function(m,E){return this._verify1(m),this.imod(m.ushln(E))},ne.prototype.imul=function(m,E){return this._verify2(m,E),this.imod(m.imul(E))},ne.prototype.mul=function(m,E){return this._verify2(m,E),this.imod(m.mul(E))},ne.prototype.isqr=function(m){return this.imul(m,m.clone())},ne.prototype.sqr=function(m){return this.mul(m,m)},ne.prototype.sqrt=function(m){if(m.isZero())return m.clone();var E=this.m.andln(3);if(i(E%2===1),E===3){var O=this.m.add(new r(1)).iushrn(2);return this.pow(m,O)}for(var R=this.m.subn(1),A=0;!R.isZero()&&R.andln(1)===0;)A++,R.iushrn(1);i(!R.isZero());var F=new r(1).toRed(this),K=F.redNeg(),L=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new r(2*_*_).toRed(this);this.pow(_,L).cmp(K)!==0;)_.redIAdd(K);for(var U=this.pow(_,R),fe=this.pow(m,R.addn(1).iushrn(1)),se=this.pow(m,R),V=A;se.cmp(F)!==0;){for(var P=se,M=0;P.cmp(F)!==0;M++)P=P.redSqr();i(M<V);var Y=this.pow(U,new r(1).iushln(V-M-1));fe=fe.redMul(Y),U=Y.redSqr(),se=se.redMul(U),V=M}return fe},ne.prototype.invm=function(m){var E=m._invmp(this.m);return E.negative!==0?(E.negative=0,this.imod(E).redNeg()):this.imod(E)},ne.prototype.pow=function(m,E){if(E.isZero())return new r(1).toRed(this);if(E.cmpn(1)===0)return m.clone();var O=4,R=new Array(1<<O);R[0]=new r(1).toRed(this),R[1]=m;for(var A=2;A<R.length;A++)R[A]=this.mul(R[A-1],m);var F=R[0],K=0,L=0,_=E.bitLength()%26;for(_===0&&(_=26),A=E.length-1;A>=0;A--){for(var U=E.words[A],fe=_-1;fe>=0;fe--){var se=U>>fe&1;if(F!==R[0]&&(F=this.sqr(F)),se===0&&K===0){L=0;continue}K<<=1,K|=se,L++,!(L!==O&&(A!==0||fe!==0))&&(F=this.mul(F,R[K]),L=0,K=0)}_=26}return F},ne.prototype.convertTo=function(m){var E=m.umod(this.m);return E===m?E.clone():E},ne.prototype.convertFrom=function(m){var E=m.clone();return E.red=null,E},r.mont=function(m){return new $(m)};function $(k){ne.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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)}u($,ne),$.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},$.prototype.convertFrom=function(m){var E=this.imod(m.mul(this.rinv));return E.red=null,E},$.prototype.imul=function(m,E){if(m.isZero()||E.isZero())return m.words[0]=0,m.length=1,m;var O=m.imul(E),R=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=O.isub(R).iushrn(this.shift),F=A;return A.cmp(this.m)>=0?F=A.isub(this.m):A.cmpn(0)<0&&(F=A.iadd(this.m)),F._forceRed(this)},$.prototype.mul=function(m,E){if(m.isZero()||E.isZero())return new r(0)._forceRed(this);var O=m.mul(E),R=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=O.isub(R).iushrn(this.shift),F=A;return A.cmp(this.m)>=0?F=A.isub(this.m):A.cmpn(0)<0&&(F=A.iadd(this.m)),F._forceRed(this)},$.prototype.invm=function(m){var E=this.imod(m._invmp(this.m).mul(this.r2));return E._forceRed(this)}})(d,$d)})(Tr)),Tr.exports}var Wd=Te();const ut=Gt(Wd);function Yd(d){if(d.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<d.length;f++){const n=d.charAt(f),c=n.charCodeAt(0);if(e[c]!==255)throw new TypeError(n+" is ambiguous");e[c]=f}const t=d.length,i=d.charAt(0),u=Math.log(t)/Math.log(256),r=Math.log(256)/Math.log(t);function s(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 n=0,c=0,h=0;const l=f.length;for(;h!==l&&f[h]===0;)h++,n++;const b=(l-h)*r+1>>>0,p=new Uint8Array(b);for(;h!==l;){let g=f[h],x=0;for(let B=b-1;(g!==0||x<c)&&B!==-1;B--,x++)g+=256*p[B]>>>0,p[B]=g%t>>>0,g=g/t>>>0;if(g!==0)throw new Error("Non-zero carry");c=x,h++}let y=b-c;for(;y!==b&&p[y]===0;)y++;let v=i.repeat(n);for(;y<b;++y)v+=d.charAt(p[y]);return v}function a(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;let n=0,c=0,h=0;for(;f[n]===i;)c++,n++;const l=(f.length-n)*u+1>>>0,b=new Uint8Array(l);for(;n<f.length;){const g=f.charCodeAt(n);if(g>255)return;let x=e[g];if(x===255)return;let B=0;for(let I=l-1;(x!==0||B<h)&&I!==-1;I--,B++)x+=t*b[I]>>>0,b[I]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");h=B,n++}let p=l-h;for(;p!==l&&b[p]===0;)p++;const y=new Uint8Array(c+(l-p));let v=c;for(;p!==l;)y[v++]=b[p++];return y}function o(f){const n=a(f);if(n)return n;throw new Error("Non-base"+t+" character")}return{encode:s,decodeUnsafe:a,decode:o}}var Jd="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Wf=Yd(Jd);var gi={};const Xd="7.0.1",Qd={version:Xd};var wi={},_i,Os;function lt(){if(Os)return _i;Os=1,_i=d;function d(e,t){if(!e)throw new Error(t||"Assertion failed")}return d.equal=function(t,i,u){if(t!=i)throw new Error(u||"Assertion failed: "+t+" != "+i)},_i}var Si={},Ps;function ns(){return Ps||(Ps=1,(function(d){var e=d;function t(r,s){if(Array.isArray(r))return r.slice();if(!r)return[];var a=[];if(typeof r!="string"){for(var o=0;o<r.length;o++)a[o]=r[o]|0;return a}if(s==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var o=0;o<r.length;o+=2)a.push(parseInt(r[o]+r[o+1],16))}else for(var o=0;o<r.length;o++){var f=r.charCodeAt(o),n=f>>8,c=f&255;n?a.push(n,c):a.push(c)}return a}e.toArray=t;function i(r){return r.length===1?"0"+r:r}e.zero2=i;function u(r){for(var s="",a=0;a<r.length;a++)s+=i(r[a].toString(16));return s}e.toHex=u,e.encode=function(s,a){return a==="hex"?u(s):s}})(Si)),Si}var ks;function qt(){return ks||(ks=1,(function(d){var e=d,t=Te(),i=lt(),u=ns();e.assert=i,e.toArray=u.toArray,e.zero2=u.zero2,e.toHex=u.toHex,e.encode=u.encode;function r(n,c,h){var l=new Array(Math.max(n.bitLength(),h)+1);l.fill(0);for(var b=1<<c+1,p=n.clone(),y=0;y<l.length;y++){var v,g=p.andln(b-1);p.isOdd()?(g>(b>>1)-1?v=(b>>1)-g:v=g,p.isubn(v)):v=0,l[y]=v,p.iushrn(1)}return l}e.getNAF=r;function s(n,c){var h=[[],[]];n=n.clone(),c=c.clone();for(var l=0,b=0;n.cmpn(-l)>0||c.cmpn(-b)>0;){var p=n.andln(3)+l&3,y=c.andln(3)+b&3;p===3&&(p=-1),y===3&&(y=-1);var v;if((p&1)===0)v=0;else{var g=n.andln(7)+l&7;(g===3||g===5)&&y===2?v=-p:v=p}h[0].push(v);var x;if((y&1)===0)x=0;else{var g=c.andln(7)+b&7;(g===3||g===5)&&p===2?x=-y:x=y}h[1].push(x),2*l===v+1&&(l=1-l),2*b===x+1&&(b=1-b),n.iushrn(1),c.iushrn(1)}return h}e.getJSF=s;function a(n,c,h){var l="_"+c;n.prototype[c]=function(){return this[l]!==void 0?this[l]:this[l]=h.call(this)}}e.cachedProperty=a;function o(n){return typeof n=="string"?e.toArray(n,"hex"):n}e.parseBytes=o;function f(n){return new t(n,"hex","le")}e.intFromLE=f})(wi)),wi}var gr={exports:{}},xe={},wr={exports:{}},_r={exports:{}},xi={},Jt={},Ns;function Zd(){if(Ns)return Jt;Ns=1,Jt.byteLength=a,Jt.toByteArray=f,Jt.fromByteArray=h;for(var d=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,r=i.length;u<r;++u)d[u]=i[u],e[i.charCodeAt(u)]=u;e[45]=62,e[95]=63;function s(l){var b=l.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=l.indexOf("=");p===-1&&(p=b);var y=p===b?0:4-p%4;return[p,y]}function a(l){var b=s(l),p=b[0],y=b[1];return(p+y)*3/4-y}function o(l,b,p){return(b+p)*3/4-p}function f(l){var b,p=s(l),y=p[0],v=p[1],g=new t(o(l,y,v)),x=0,B=v>0?y-4:y,I;for(I=0;I<B;I+=4)b=e[l.charCodeAt(I)]<<18|e[l.charCodeAt(I+1)]<<12|e[l.charCodeAt(I+2)]<<6|e[l.charCodeAt(I+3)],g[x++]=b>>16&255,g[x++]=b>>8&255,g[x++]=b&255;return v===2&&(b=e[l.charCodeAt(I)]<<2|e[l.charCodeAt(I+1)]>>4,g[x++]=b&255),v===1&&(b=e[l.charCodeAt(I)]<<10|e[l.charCodeAt(I+1)]<<4|e[l.charCodeAt(I+2)]>>2,g[x++]=b>>8&255,g[x++]=b&255),g}function n(l){return d[l>>18&63]+d[l>>12&63]+d[l>>6&63]+d[l&63]}function c(l,b,p){for(var y,v=[],g=b;g<p;g+=3)y=(l[g]<<16&16711680)+(l[g+1]<<8&65280)+(l[g+2]&255),v.push(n(y));return v.join("")}function h(l){for(var b,p=l.length,y=p%3,v=[],g=16383,x=0,B=p-y;x<B;x+=g)v.push(c(l,x,x+g>B?B:x+g));return y===1?(b=l[p-1],v.push(d[b>>2]+d[b<<4&63]+"==")):y===2&&(b=(l[p-2]<<8)+l[p-1],v.push(d[b>>10]+d[b>>4&63]+d[b<<2&63]+"=")),v.join("")}return Jt}var Sr={};var Ms;function e0(){return Ms||(Ms=1,Sr.read=function(d,e,t,i,u){var r,s,a=u*8-i-1,o=(1<<a)-1,f=o>>1,n=-7,c=t?u-1:0,h=t?-1:1,l=d[e+c];for(c+=h,r=l&(1<<-n)-1,l>>=-n,n+=a;n>0;r=r*256+d[e+c],c+=h,n-=8);for(s=r&(1<<-n)-1,r>>=-n,n+=i;n>0;s=s*256+d[e+c],c+=h,n-=8);if(r===0)r=1-f;else{if(r===o)return s?NaN:(l?-1:1)*(1/0);s=s+Math.pow(2,i),r=r-f}return(l?-1:1)*s*Math.pow(2,r-i)},Sr.write=function(d,e,t,i,u,r){var s,a,o,f=r*8-u-1,n=(1<<f)-1,c=n>>1,h=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:r-1,b=i?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=n):(s=Math.floor(Math.log(e)/Math.LN2),e*(o=Math.pow(2,-s))<1&&(s--,o*=2),s+c>=1?e+=h/o:e+=h*Math.pow(2,1-c),e*o>=2&&(s++,o/=2),s+c>=n?(a=0,s=n):s+c>=1?(a=(e*o-1)*Math.pow(2,u),s=s+c):(a=e*Math.pow(2,c-1)*Math.pow(2,u),s=0));u>=8;d[t+l]=a&255,l+=b,a/=256,u-=8);for(s=s<<u|a,f+=u;f>0;d[t+l]=s&255,l+=b,s/=256,f-=8);d[t+l-b]|=p*128}),Sr}var Cs;function xt(){return Cs||(Cs=1,(function(d){const e=Zd(),t=e0(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;d.Buffer=a,d.SlowBuffer=g,d.INSPECT_MAX_BYTES=50;const u=2147483647;d.kMaxLength=u,a.TYPED_ARRAY_SUPPORT=r(),!a.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 r(){try{const N=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(N,w),N.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(N){if(N>u)throw new RangeError('The value "'+N+'" is invalid for option "size"');const w=new Uint8Array(N);return Object.setPrototypeOf(w,a.prototype),w}function a(N,w,S){if(typeof N=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(N)}return o(N,w,S)}a.poolSize=8192;function o(N,w,S){if(typeof N=="string")return h(N,w);if(ArrayBuffer.isView(N))return b(N);if(N==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N);if(Re(N,ArrayBuffer)||N&&Re(N.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Re(N,SharedArrayBuffer)||N&&Re(N.buffer,SharedArrayBuffer)))return p(N,w,S);if(typeof N=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=N.valueOf&&N.valueOf();if(H!=null&&H!==N)return a.from(H,w,S);const W=y(N);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof N[Symbol.toPrimitive]=="function")return a.from(N[Symbol.toPrimitive]("string"),w,S);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N)}a.from=function(N,w,S){return o(N,w,S)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function f(N){if(typeof N!="number")throw new TypeError('"size" argument must be of type number');if(N<0)throw new RangeError('The value "'+N+'" is invalid for option "size"')}function n(N,w,S){return f(N),N<=0?s(N):w!==void 0?typeof S=="string"?s(N).fill(w,S):s(N).fill(w):s(N)}a.alloc=function(N,w,S){return n(N,w,S)};function c(N){return f(N),s(N<0?0:v(N)|0)}a.allocUnsafe=function(N){return c(N)},a.allocUnsafeSlow=function(N){return c(N)};function h(N,w){if((typeof w!="string"||w==="")&&(w="utf8"),!a.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const S=x(N,w)|0;let H=s(S);const W=H.write(N,w);return W!==S&&(H=H.slice(0,W)),H}function l(N){const w=N.length<0?0:v(N.length)|0,S=s(w);for(let H=0;H<w;H+=1)S[H]=N[H]&255;return S}function b(N){if(Re(N,Uint8Array)){const w=new Uint8Array(N);return p(w.buffer,w.byteOffset,w.byteLength)}return l(N)}function p(N,w,S){if(w<0||N.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(N.byteLength<w+(S||0))throw new RangeError('"length" is outside of buffer bounds');let H;return w===void 0&&S===void 0?H=new Uint8Array(N):S===void 0?H=new Uint8Array(N,w):H=new Uint8Array(N,w,S),Object.setPrototypeOf(H,a.prototype),H}function y(N){if(a.isBuffer(N)){const w=v(N.length)|0,S=s(w);return S.length===0||N.copy(S,0,0,w),S}if(N.length!==void 0)return typeof N.length!="number"||ve(N.length)?s(0):l(N);if(N.type==="Buffer"&&Array.isArray(N.data))return l(N.data)}function v(N){if(N>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return N|0}function g(N){return+N!=N&&(N=0),a.alloc(+N)}a.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==a.prototype},a.compare=function(w,S){if(Re(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),Re(S,Uint8Array)&&(S=a.from(S,S.offset,S.byteLength)),!a.isBuffer(w)||!a.isBuffer(S))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===S)return 0;let H=w.length,W=S.length;for(let X=0,ee=Math.min(H,W);X<ee;++X)if(w[X]!==S[X]){H=w[X],W=S[X];break}return H<W?-1:W<H?1:0},a.isEncoding=function(w){switch(String(w).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(w,S){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return a.alloc(0);let H;if(S===void 0)for(S=0,H=0;H<w.length;++H)S+=w[H].length;const W=a.allocUnsafe(S);let X=0;for(H=0;H<w.length;++H){let ee=w[H];if(Re(ee,Uint8Array))X+ee.length>W.length?(a.isBuffer(ee)||(ee=a.from(ee)),ee.copy(W,X)):Uint8Array.prototype.set.call(W,ee,X);else if(a.isBuffer(ee))ee.copy(W,X);else throw new TypeError('"list" argument must be an Array of Buffers');X+=ee.length}return W};function x(N,w){if(a.isBuffer(N))return N.length;if(ArrayBuffer.isView(N)||Re(N,ArrayBuffer))return N.byteLength;if(typeof N!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof N);const S=N.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&S===0)return 0;let W=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return S;case"utf8":case"utf-8":return ue(N).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S*2;case"hex":return S>>>1;case"base64":return Se(N).length;default:if(W)return H?-1:ue(N).length;w=(""+w).toLowerCase(),W=!0}}a.byteLength=x;function B(N,w,S){let H=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((S===void 0||S>this.length)&&(S=this.length),S<=0)||(S>>>=0,w>>>=0,S<=w))return"";for(N||(N="utf8");;)switch(N){case"hex":return F(this,w,S);case"utf8":case"utf-8":return m(this,w,S);case"ascii":return R(this,w,S);case"latin1":case"binary":return A(this,w,S);case"base64":return k(this,w,S);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,w,S);default:if(H)throw new TypeError("Unknown encoding: "+N);N=(N+"").toLowerCase(),H=!0}}a.prototype._isBuffer=!0;function I(N,w,S){const H=N[w];N[w]=N[S],N[S]=H}a.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let S=0;S<w;S+=2)I(this,S,S+1);return this},a.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let S=0;S<w;S+=4)I(this,S,S+3),I(this,S+1,S+2);return this},a.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let S=0;S<w;S+=8)I(this,S,S+7),I(this,S+1,S+6),I(this,S+2,S+5),I(this,S+3,S+4);return this},a.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?m(this,0,w):B.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(w){if(!a.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:a.compare(this,w)===0},a.prototype.inspect=function(){let w="";const S=d.INSPECT_MAX_BYTES;return w=this.toString("hex",0,S).replace(/(.{2})/g,"$1 ").trim(),this.length>S&&(w+=" ... "),"<Buffer "+w+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(w,S,H,W,X){if(Re(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),!a.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(S===void 0&&(S=0),H===void 0&&(H=w?w.length:0),W===void 0&&(W=0),X===void 0&&(X=this.length),S<0||H>w.length||W<0||X>this.length)throw new RangeError("out of range index");if(W>=X&&S>=H)return 0;if(W>=X)return-1;if(S>=H)return 1;if(S>>>=0,H>>>=0,W>>>=0,X>>>=0,this===w)return 0;let ee=X-W,Be=H-S;const we=Math.min(ee,Be),ye=this.slice(W,X),Fe=w.slice(S,H);for(let be=0;be<we;++be)if(ye[be]!==Fe[be]){ee=ye[be],Be=Fe[be];break}return ee<Be?-1:Be<ee?1:0};function T(N,w,S,H,W){if(N.length===0)return-1;if(typeof S=="string"?(H=S,S=0):S>2147483647?S=2147483647:S<-2147483648&&(S=-2147483648),S=+S,ve(S)&&(S=W?0:N.length-1),S<0&&(S=N.length+S),S>=N.length){if(W)return-1;S=N.length-1}else if(S<0)if(W)S=0;else return-1;if(typeof w=="string"&&(w=a.from(w,H)),a.isBuffer(w))return w.length===0?-1:j(N,w,S,H,W);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(N,w,S):Uint8Array.prototype.lastIndexOf.call(N,w,S):j(N,[w],S,H,W);throw new TypeError("val must be string, number or Buffer")}function j(N,w,S,H,W){let X=1,ee=N.length,Be=w.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(N.length<2||w.length<2)return-1;X=2,ee/=2,Be/=2,S/=2}function we(Fe,be){return X===1?Fe[be]:Fe.readUInt16BE(be*X)}let ye;if(W){let Fe=-1;for(ye=S;ye<ee;ye++)if(we(N,ye)===we(w,Fe===-1?0:ye-Fe)){if(Fe===-1&&(Fe=ye),ye-Fe+1===Be)return Fe*X}else Fe!==-1&&(ye-=ye-Fe),Fe=-1}else for(S+Be>ee&&(S=ee-Be),ye=S;ye>=0;ye--){let Fe=!0;for(let be=0;be<Be;be++)if(we(N,ye+be)!==we(w,be)){Fe=!1;break}if(Fe)return ye}return-1}a.prototype.includes=function(w,S,H){return this.indexOf(w,S,H)!==-1},a.prototype.indexOf=function(w,S,H){return T(this,w,S,H,!0)},a.prototype.lastIndexOf=function(w,S,H){return T(this,w,S,H,!1)};function G(N,w,S,H){S=Number(S)||0;const W=N.length-S;H?(H=Number(H),H>W&&(H=W)):H=W;const X=w.length;H>X/2&&(H=X/2);let ee;for(ee=0;ee<H;++ee){const Be=parseInt(w.substr(ee*2,2),16);if(ve(Be))return ee;N[S+ee]=Be}return ee}function z(N,w,S,H){return de(ue(w,N.length-S),N,S,H)}function te(N,w,S,H){return de(ge(w),N,S,H)}function ne(N,w,S,H){return de(Se(w),N,S,H)}function $(N,w,S,H){return de(Ke(w,N.length-S),N,S,H)}a.prototype.write=function(w,S,H,W){if(S===void 0)W="utf8",H=this.length,S=0;else if(H===void 0&&typeof S=="string")W=S,H=this.length,S=0;else if(isFinite(S))S=S>>>0,isFinite(H)?(H=H>>>0,W===void 0&&(W="utf8")):(W=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const X=this.length-S;if((H===void 0||H>X)&&(H=X),w.length>0&&(H<0||S<0)||S>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let ee=!1;for(;;)switch(W){case"hex":return G(this,w,S,H);case"utf8":case"utf-8":return z(this,w,S,H);case"ascii":case"latin1":case"binary":return te(this,w,S,H);case"base64":return ne(this,w,S,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,w,S,H);default:if(ee)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),ee=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(N,w,S){return w===0&&S===N.length?e.fromByteArray(N):e.fromByteArray(N.slice(w,S))}function m(N,w,S){S=Math.min(N.length,S);const H=[];let W=w;for(;W<S;){const X=N[W];let ee=null,Be=X>239?4:X>223?3:X>191?2:1;if(W+Be<=S){let we,ye,Fe,be;switch(Be){case 1:X<128&&(ee=X);break;case 2:we=N[W+1],(we&192)===128&&(be=(X&31)<<6|we&63,be>127&&(ee=be));break;case 3:we=N[W+1],ye=N[W+2],(we&192)===128&&(ye&192)===128&&(be=(X&15)<<12|(we&63)<<6|ye&63,be>2047&&(be<55296||be>57343)&&(ee=be));break;case 4:we=N[W+1],ye=N[W+2],Fe=N[W+3],(we&192)===128&&(ye&192)===128&&(Fe&192)===128&&(be=(X&15)<<18|(we&63)<<12|(ye&63)<<6|Fe&63,be>65535&&be<1114112&&(ee=be))}}ee===null?(ee=65533,Be=1):ee>65535&&(ee-=65536,H.push(ee>>>10&1023|55296),ee=56320|ee&1023),H.push(ee),W+=Be}return O(H)}const E=4096;function O(N){const w=N.length;if(w<=E)return String.fromCharCode.apply(String,N);let S="",H=0;for(;H<w;)S+=String.fromCharCode.apply(String,N.slice(H,H+=E));return S}function R(N,w,S){let H="";S=Math.min(N.length,S);for(let W=w;W<S;++W)H+=String.fromCharCode(N[W]&127);return H}function A(N,w,S){let H="";S=Math.min(N.length,S);for(let W=w;W<S;++W)H+=String.fromCharCode(N[W]);return H}function F(N,w,S){const H=N.length;(!w||w<0)&&(w=0),(!S||S<0||S>H)&&(S=H);let W="";for(let X=w;X<S;++X)W+=me[N[X]];return W}function K(N,w,S){const H=N.slice(w,S);let W="";for(let X=0;X<H.length-1;X+=2)W+=String.fromCharCode(H[X]+H[X+1]*256);return W}a.prototype.slice=function(w,S){const H=this.length;w=~~w,S=S===void 0?H:~~S,w<0?(w+=H,w<0&&(w=0)):w>H&&(w=H),S<0?(S+=H,S<0&&(S=0)):S>H&&(S=H),S<w&&(S=w);const W=this.subarray(w,S);return Object.setPrototypeOf(W,a.prototype),W};function L(N,w,S){if(N%1!==0||N<0)throw new RangeError("offset is not uint");if(N+w>S)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=this[w],X=1,ee=0;for(;++ee<S&&(X*=256);)W+=this[w+ee]*X;return W},a.prototype.readUintBE=a.prototype.readUIntBE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=this[w+--S],X=1;for(;S>0&&(X*=256);)W+=this[w+--S]*X;return W},a.prototype.readUint8=a.prototype.readUInt8=function(w,S){return w=w>>>0,S||L(w,1,this.length),this[w]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(w,S){return w=w>>>0,S||L(w,2,this.length),this[w]|this[w+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(w,S){return w=w>>>0,S||L(w,2,this.length),this[w]<<8|this[w+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(w,S){return w=w>>>0,S||L(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(w,S){return w=w>>>0,S||L(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},a.prototype.readBigUInt64LE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=S+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24,X=this[++w]+this[++w]*2**8+this[++w]*2**16+H*2**24;return BigInt(W)+(BigInt(X)<<BigInt(32))}),a.prototype.readBigUInt64BE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=S*2**24+this[++w]*2**16+this[++w]*2**8+this[++w],X=this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+H;return(BigInt(W)<<BigInt(32))+BigInt(X)}),a.prototype.readIntLE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=this[w],X=1,ee=0;for(;++ee<S&&(X*=256);)W+=this[w+ee]*X;return X*=128,W>=X&&(W-=Math.pow(2,8*S)),W},a.prototype.readIntBE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=S,X=1,ee=this[w+--W];for(;W>0&&(X*=256);)ee+=this[w+--W]*X;return X*=128,ee>=X&&(ee-=Math.pow(2,8*S)),ee},a.prototype.readInt8=function(w,S){return w=w>>>0,S||L(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},a.prototype.readInt16LE=function(w,S){w=w>>>0,S||L(w,2,this.length);const H=this[w]|this[w+1]<<8;return H&32768?H|4294901760:H},a.prototype.readInt16BE=function(w,S){w=w>>>0,S||L(w,2,this.length);const H=this[w+1]|this[w]<<8;return H&32768?H|4294901760:H},a.prototype.readInt32LE=function(w,S){return w=w>>>0,S||L(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},a.prototype.readInt32BE=function(w,S){return w=w>>>0,S||L(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},a.prototype.readBigInt64LE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=this[w+4]+this[w+5]*2**8+this[w+6]*2**16+(H<<24);return(BigInt(W)<<BigInt(32))+BigInt(S+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24)}),a.prototype.readBigInt64BE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=(S<<24)+this[++w]*2**16+this[++w]*2**8+this[++w];return(BigInt(W)<<BigInt(32))+BigInt(this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+H)}),a.prototype.readFloatLE=function(w,S){return w=w>>>0,S||L(w,4,this.length),t.read(this,w,!0,23,4)},a.prototype.readFloatBE=function(w,S){return w=w>>>0,S||L(w,4,this.length),t.read(this,w,!1,23,4)},a.prototype.readDoubleLE=function(w,S){return w=w>>>0,S||L(w,8,this.length),t.read(this,w,!0,52,8)},a.prototype.readDoubleBE=function(w,S){return w=w>>>0,S||L(w,8,this.length),t.read(this,w,!1,52,8)};function _(N,w,S,H,W,X){if(!a.isBuffer(N))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>W||w<X)throw new RangeError('"value" argument is out of bounds');if(S+H>N.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(w,S,H,W){if(w=+w,S=S>>>0,H=H>>>0,!W){const Be=Math.pow(2,8*H)-1;_(this,w,S,H,Be,0)}let X=1,ee=0;for(this[S]=w&255;++ee<H&&(X*=256);)this[S+ee]=w/X&255;return S+H},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(w,S,H,W){if(w=+w,S=S>>>0,H=H>>>0,!W){const Be=Math.pow(2,8*H)-1;_(this,w,S,H,Be,0)}let X=H-1,ee=1;for(this[S+X]=w&255;--X>=0&&(ee*=256);)this[S+X]=w/ee&255;return S+H},a.prototype.writeUint8=a.prototype.writeUInt8=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,1,255,0),this[S]=w&255,S+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,65535,0),this[S]=w&255,this[S+1]=w>>>8,S+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,65535,0),this[S]=w>>>8,this[S+1]=w&255,S+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,4294967295,0),this[S+3]=w>>>24,this[S+2]=w>>>16,this[S+1]=w>>>8,this[S]=w&255,S+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,4294967295,0),this[S]=w>>>24,this[S+1]=w>>>16,this[S+2]=w>>>8,this[S+3]=w&255,S+4};function U(N,w,S,H,W){C(w,H,W,N,S,7);let X=Number(w&BigInt(4294967295));N[S++]=X,X=X>>8,N[S++]=X,X=X>>8,N[S++]=X,X=X>>8,N[S++]=X;let ee=Number(w>>BigInt(32)&BigInt(4294967295));return N[S++]=ee,ee=ee>>8,N[S++]=ee,ee=ee>>8,N[S++]=ee,ee=ee>>8,N[S++]=ee,S}function fe(N,w,S,H,W){C(w,H,W,N,S,7);let X=Number(w&BigInt(4294967295));N[S+7]=X,X=X>>8,N[S+6]=X,X=X>>8,N[S+5]=X,X=X>>8,N[S+4]=X;let ee=Number(w>>BigInt(32)&BigInt(4294967295));return N[S+3]=ee,ee=ee>>8,N[S+2]=ee,ee=ee>>8,N[S+1]=ee,ee=ee>>8,N[S]=ee,S+8}a.prototype.writeBigUInt64LE=Le(function(w,S=0){return U(this,w,S,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Le(function(w,S=0){return fe(this,w,S,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(w,S,H,W){if(w=+w,S=S>>>0,!W){const we=Math.pow(2,8*H-1);_(this,w,S,H,we-1,-we)}let X=0,ee=1,Be=0;for(this[S]=w&255;++X<H&&(ee*=256);)w<0&&Be===0&&this[S+X-1]!==0&&(Be=1),this[S+X]=(w/ee>>0)-Be&255;return S+H},a.prototype.writeIntBE=function(w,S,H,W){if(w=+w,S=S>>>0,!W){const we=Math.pow(2,8*H-1);_(this,w,S,H,we-1,-we)}let X=H-1,ee=1,Be=0;for(this[S+X]=w&255;--X>=0&&(ee*=256);)w<0&&Be===0&&this[S+X+1]!==0&&(Be=1),this[S+X]=(w/ee>>0)-Be&255;return S+H},a.prototype.writeInt8=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,1,127,-128),w<0&&(w=255+w+1),this[S]=w&255,S+1},a.prototype.writeInt16LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,32767,-32768),this[S]=w&255,this[S+1]=w>>>8,S+2},a.prototype.writeInt16BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,32767,-32768),this[S]=w>>>8,this[S+1]=w&255,S+2},a.prototype.writeInt32LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,2147483647,-2147483648),this[S]=w&255,this[S+1]=w>>>8,this[S+2]=w>>>16,this[S+3]=w>>>24,S+4},a.prototype.writeInt32BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[S]=w>>>24,this[S+1]=w>>>16,this[S+2]=w>>>8,this[S+3]=w&255,S+4},a.prototype.writeBigInt64LE=Le(function(w,S=0){return U(this,w,S,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Le(function(w,S=0){return fe(this,w,S,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function se(N,w,S,H,W,X){if(S+H>N.length)throw new RangeError("Index out of range");if(S<0)throw new RangeError("Index out of range")}function V(N,w,S,H,W){return w=+w,S=S>>>0,W||se(N,w,S,4),t.write(N,w,S,H,23,4),S+4}a.prototype.writeFloatLE=function(w,S,H){return V(this,w,S,!0,H)},a.prototype.writeFloatBE=function(w,S,H){return V(this,w,S,!1,H)};function P(N,w,S,H,W){return w=+w,S=S>>>0,W||se(N,w,S,8),t.write(N,w,S,H,52,8),S+8}a.prototype.writeDoubleLE=function(w,S,H){return P(this,w,S,!0,H)},a.prototype.writeDoubleBE=function(w,S,H){return P(this,w,S,!1,H)},a.prototype.copy=function(w,S,H,W){if(!a.isBuffer(w))throw new TypeError("argument should be a Buffer");if(H||(H=0),!W&&W!==0&&(W=this.length),S>=w.length&&(S=w.length),S||(S=0),W>0&&W<H&&(W=H),W===H||w.length===0||this.length===0)return 0;if(S<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),w.length-S<W-H&&(W=w.length-S+H);const X=W-H;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(S,H,W):Uint8Array.prototype.set.call(w,this.subarray(H,W),S),X},a.prototype.fill=function(w,S,H,W){if(typeof w=="string"){if(typeof S=="string"?(W=S,S=0,H=this.length):typeof H=="string"&&(W=H,H=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!a.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(w.length===1){const ee=w.charCodeAt(0);(W==="utf8"&&ee<128||W==="latin1")&&(w=ee)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(S<0||this.length<S||this.length<H)throw new RangeError("Out of range index");if(H<=S)return this;S=S>>>0,H=H===void 0?this.length:H>>>0,w||(w=0);let X;if(typeof w=="number")for(X=S;X<H;++X)this[X]=w;else{const ee=a.isBuffer(w)?w:a.from(w,W),Be=ee.length;if(Be===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(X=0;X<H-S;++X)this[X+S]=ee[X%Be]}return this};const M={};function Y(N,w,S){M[N]=class extends S{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${N}]`,this.stack,delete this.name}get code(){return N}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${N}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(N){return N?`${N} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(N,w){return`The "${N}" argument must be of type number. Received type ${typeof w}`},TypeError),Y("ERR_OUT_OF_RANGE",function(N,w,S){let H=`The value of "${N}" is out of range.`,W=S;return Number.isInteger(S)&&Math.abs(S)>2**32?W=Q(String(S)):typeof S=="bigint"&&(W=String(S),(S>BigInt(2)**BigInt(32)||S<-(BigInt(2)**BigInt(32)))&&(W=Q(W)),W+="n"),H+=` It must be ${w}. Received ${W}`,H},RangeError);function Q(N){let w="",S=N.length;const H=N[0]==="-"?1:0;for(;S>=H+4;S-=3)w=`_${N.slice(S-3,S)}${w}`;return`${N.slice(0,S)}${w}`}function D(N,w,S){J(w,"offset"),(N[w]===void 0||N[w+S]===void 0)&&ie(w,N.length-(S+1))}function C(N,w,S,H,W,X){if(N>S||N<w){const ee=typeof w=="bigint"?"n":"";let Be;throw w===0||w===BigInt(0)?Be=`>= 0${ee} and < 2${ee} ** ${(X+1)*8}${ee}`:Be=`>= -(2${ee} ** ${(X+1)*8-1}${ee}) and < 2 ** ${(X+1)*8-1}${ee}`,new M.ERR_OUT_OF_RANGE("value",Be,N)}D(H,W,X)}function J(N,w){if(typeof N!="number")throw new M.ERR_INVALID_ARG_TYPE(w,"number",N)}function ie(N,w,S){throw Math.floor(N)!==N?(J(N,S),new M.ERR_OUT_OF_RANGE("offset","an integer",N)):w<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${w}`,N)}const he=/[^+/0-9A-Za-z-_]/g;function oe(N){if(N=N.split("=")[0],N=N.trim().replace(he,""),N.length<2)return"";for(;N.length%4!==0;)N=N+"=";return N}function ue(N,w){w=w||1/0;let S;const H=N.length;let W=null;const X=[];for(let ee=0;ee<H;++ee){if(S=N.charCodeAt(ee),S>55295&&S<57344){if(!W){if(S>56319){(w-=3)>-1&&X.push(239,191,189);continue}else if(ee+1===H){(w-=3)>-1&&X.push(239,191,189);continue}W=S;continue}if(S<56320){(w-=3)>-1&&X.push(239,191,189),W=S;continue}S=(W-55296<<10|S-56320)+65536}else W&&(w-=3)>-1&&X.push(239,191,189);if(W=null,S<128){if((w-=1)<0)break;X.push(S)}else if(S<2048){if((w-=2)<0)break;X.push(S>>6|192,S&63|128)}else if(S<65536){if((w-=3)<0)break;X.push(S>>12|224,S>>6&63|128,S&63|128)}else if(S<1114112){if((w-=4)<0)break;X.push(S>>18|240,S>>12&63|128,S>>6&63|128,S&63|128)}else throw new Error("Invalid code point")}return X}function ge(N){const w=[];for(let S=0;S<N.length;++S)w.push(N.charCodeAt(S)&255);return w}function Ke(N,w){let S,H,W;const X=[];for(let ee=0;ee<N.length&&!((w-=2)<0);++ee)S=N.charCodeAt(ee),H=S>>8,W=S%256,X.push(W),X.push(H);return X}function Se(N){return e.toByteArray(oe(N))}function de(N,w,S,H){let W;for(W=0;W<H&&!(W+S>=w.length||W>=N.length);++W)w[W+S]=N[W];return W}function Re(N,w){return N instanceof w||N!=null&&N.constructor!=null&&N.constructor.name!=null&&N.constructor.name===w.name}function ve(N){return N!==N}const me=(function(){const N="0123456789abcdef",w=new Array(256);for(let S=0;S<16;++S){const H=S*16;for(let W=0;W<16;++W)w[H+W]=N[S]+N[W]}return w})();function Le(N){return typeof BigInt>"u"?Pe:N}function Pe(){throw new Error("BigInt not supported")}})(xi)),xi}var Ts;function _e(){return Ts||(Ts=1,(function(d,e){var t=xt(),i=t.Buffer;function u(s,a){for(var o in s)a[o]=s[o]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?d.exports=t:(u(t,e),e.Buffer=r);function r(s,a,o){return i(s,a,o)}r.prototype=Object.create(i.prototype),u(i,r),r.from=function(s,a,o){if(typeof s=="number")throw new TypeError("Argument must not be a number");return i(s,a,o)},r.alloc=function(s,a,o){if(typeof s!="number")throw new TypeError("Argument must be a number");var f=i(s);return a!==void 0?typeof o=="string"?f.fill(a,o):f.fill(a):f.fill(0),f},r.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return i(s)},r.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(s)}})(_r,_r.exports)),_r.exports}var Ls;function Ut(){if(Ls)return wr.exports;Ls=1;var d=65536,e=4294967295;function t(){throw new Error(`Secure random number generation is not supported by this browser.
2
- Use Chrome, Firefox or Internet Explorer 11`)}var i=_e().Buffer,u=Ie.crypto||Ie.msCrypto;u&&u.getRandomValues?wr.exports=r:wr.exports=t;function r(s,a){if(s>e)throw new RangeError("requested too many random bytes");var o=i.allocUnsafe(s);if(s>0)if(s>d)for(var f=0;f<s;f+=d)u.getRandomValues(o.slice(f,f+d));else u.getRandomValues(o);return typeof a=="function"?process.nextTick(function(){a(null,o)}):o}return wr.exports}var xr={exports:{}},Ds;function pe(){return Ds||(Ds=1,typeof Object.create=="function"?xr.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:xr.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}),xr.exports}var Er={exports:{}},Fs;function fr(){if(Fs)return Er.exports;Fs=1;var d=typeof Reflect=="object"?Reflect:null,e=d&&typeof d.apply=="function"?d.apply:function(I,T,j){return Function.prototype.apply.call(I,T,j)},t;d&&typeof d.ownKeys=="function"?t=d.ownKeys:Object.getOwnPropertySymbols?t=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:t=function(I){return Object.getOwnPropertyNames(I)};function i(B){console&&console.warn&&console.warn(B)}var u=Number.isNaN||function(I){return I!==I};function r(){r.init.call(this)}Er.exports=r,Er.exports.once=v,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var s=10;function a(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(B){if(typeof B!="number"||B<0||u(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");s=B}}),r.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},r.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||u(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 o(B){return B._maxListeners===void 0?r.defaultMaxListeners:B._maxListeners}r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(I){for(var T=[],j=1;j<arguments.length;j++)T.push(arguments[j]);var G=I==="error",z=this._events;if(z!==void 0)G=G&&z.error===void 0;else if(!G)return!1;if(G){var te;if(T.length>0&&(te=T[0]),te instanceof Error)throw te;var ne=new Error("Unhandled error."+(te?" ("+te.message+")":""));throw ne.context=te,ne}var $=z[I];if($===void 0)return!1;if(typeof $=="function")e($,this,T);else for(var k=$.length,m=b($,k),j=0;j<k;++j)e(m[j],this,T);return!0};function f(B,I,T,j){var G,z,te;if(a(T),z=B._events,z===void 0?(z=B._events=Object.create(null),B._eventsCount=0):(z.newListener!==void 0&&(B.emit("newListener",I,T.listener?T.listener:T),z=B._events),te=z[I]),te===void 0)te=z[I]=T,++B._eventsCount;else if(typeof te=="function"?te=z[I]=j?[T,te]:[te,T]:j?te.unshift(T):te.push(T),G=o(B),G>0&&te.length>G&&!te.warned){te.warned=!0;var ne=new Error("Possible EventEmitter memory leak detected. "+te.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");ne.name="MaxListenersExceededWarning",ne.emitter=B,ne.type=I,ne.count=te.length,i(ne)}return B}r.prototype.addListener=function(I,T){return f(this,I,T,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(I,T){return f(this,I,T,!0)};function n(){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 c(B,I,T){var j={fired:!1,wrapFn:void 0,target:B,type:I,listener:T},G=n.bind(j);return G.listener=T,j.wrapFn=G,G}r.prototype.once=function(I,T){return a(T),this.on(I,c(this,I,T)),this},r.prototype.prependOnceListener=function(I,T){return a(T),this.prependListener(I,c(this,I,T)),this},r.prototype.removeListener=function(I,T){var j,G,z,te,ne;if(a(T),G=this._events,G===void 0)return this;if(j=G[I],j===void 0)return this;if(j===T||j.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete G[I],G.removeListener&&this.emit("removeListener",I,j.listener||T));else if(typeof j!="function"){for(z=-1,te=j.length-1;te>=0;te--)if(j[te]===T||j[te].listener===T){ne=j[te].listener,z=te;break}if(z<0)return this;z===0?j.shift():p(j,z),j.length===1&&(G[I]=j[0]),G.removeListener!==void 0&&this.emit("removeListener",I,ne||T)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(I){var T,j,G;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),te;for(G=0;G<z.length;++G)te=z[G],te!=="removeListener"&&this.removeAllListeners(te);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=j[I],typeof T=="function")this.removeListener(I,T);else if(T!==void 0)for(G=T.length-1;G>=0;G--)this.removeListener(I,T[G]);return this};function h(B,I,T){var j=B._events;if(j===void 0)return[];var G=j[I];return G===void 0?[]:typeof G=="function"?T?[G.listener||G]:[G]:T?y(G):b(G,G.length)}r.prototype.listeners=function(I){return h(this,I,!0)},r.prototype.rawListeners=function(I){return h(this,I,!1)},r.listenerCount=function(B,I){return typeof B.listenerCount=="function"?B.listenerCount(I):l.call(B,I)},r.prototype.listenerCount=l;function l(B){var I=this._events;if(I!==void 0){var T=I[B];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function b(B,I){for(var T=new Array(I),j=0;j<I;++j)T[j]=B[j];return T}function p(B,I){for(;I+1<B.length;I++)B[I]=B[I+1];B.pop()}function y(B){for(var I=new Array(B.length),T=0;T<I.length;++T)I[T]=B[T].listener||B[T];return I}function v(B,I){return new Promise(function(T,j){function G(te){B.removeListener(I,z),j(te)}function z(){typeof B.removeListener=="function"&&B.removeListener("error",G),T([].slice.call(arguments))}x(B,I,z,{once:!0}),I!=="error"&&g(B,G,{once:!0})})}function g(B,I,T){typeof B.on=="function"&&x(B,"error",I,T)}function x(B,I,T,j){if(typeof B.on=="function")j.once?B.once(I,T):B.on(I,T);else if(typeof B.addEventListener=="function")B.addEventListener(I,function G(z){j.once&&B.removeEventListener(I,G),T(z)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}return Er.exports}var Ei,qs;function Th(){return qs||(qs=1,Ei=fr().EventEmitter),Ei}var Bi,Us;function t0(){if(Us)return Bi;Us=1;function d(b,p){var y=Object.keys(b);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(b);p&&(v=v.filter(function(g){return Object.getOwnPropertyDescriptor(b,g).enumerable})),y.push.apply(y,v)}return y}function e(b){for(var p=1;p<arguments.length;p++){var y=arguments[p]!=null?arguments[p]:{};p%2?d(Object(y),!0).forEach(function(v){t(b,v,y[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(y)):d(Object(y)).forEach(function(v){Object.defineProperty(b,v,Object.getOwnPropertyDescriptor(y,v))})}return b}function t(b,p,y){return p=s(p),p in b?Object.defineProperty(b,p,{value:y,enumerable:!0,configurable:!0,writable:!0}):b[p]=y,b}function i(b,p){if(!(b instanceof p))throw new TypeError("Cannot call a class as a function")}function u(b,p){for(var y=0;y<p.length;y++){var v=p[y];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(b,s(v.key),v)}}function r(b,p,y){return p&&u(b.prototype,p),Object.defineProperty(b,"prototype",{writable:!1}),b}function s(b){var p=a(b,"string");return typeof p=="symbol"?p:String(p)}function a(b,p){if(typeof b!="object"||b===null)return b;var y=b[Symbol.toPrimitive];if(y!==void 0){var v=y.call(b,p);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}var o=xt(),f=o.Buffer,n=$t,c=n.inspect,h=c&&c.custom||"inspect";function l(b,p,y){f.prototype.copy.call(b,p,y)}return Bi=(function(){function b(){i(this,b),this.head=null,this.tail=null,this.length=0}return r(b,[{key:"push",value:function(y){var v={data:y,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(y){var v={data:y,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var v=this.head,g=""+v.data;v=v.next;)g+=y+v.data;return g}},{key:"concat",value:function(y){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(y>>>0),g=this.head,x=0;g;)l(g.data,v,x),x+=g.data.length,g=g.next;return v}},{key:"consume",value:function(y,v){var g;return y<this.head.data.length?(g=this.head.data.slice(0,y),this.head.data=this.head.data.slice(y)):y===this.head.data.length?g=this.shift():g=v?this._getString(y):this._getBuffer(y),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(y){var v=this.head,g=1,x=v.data;for(y-=x.length;v=v.next;){var B=v.data,I=y>B.length?B.length:y;if(I===B.length?x+=B:x+=B.slice(0,y),y-=I,y===0){I===B.length?(++g,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=B.slice(I));break}++g}return this.length-=g,x}},{key:"_getBuffer",value:function(y){var v=f.allocUnsafe(y),g=this.head,x=1;for(g.data.copy(v),y-=g.data.length;g=g.next;){var B=g.data,I=y>B.length?B.length:y;if(B.copy(v,v.length-y,0,I),y-=I,y===0){I===B.length?(++x,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=B.slice(I));break}++x}return this.length-=x,v}},{key:h,value:function(y,v){return c(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),b})(),Bi}var Ri,Hs;function Lh(){if(Hs)return Ri;Hs=1;function d(s,a){var o=this,f=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return f||n?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(u,this,s)):process.nextTick(u,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(c){!a&&c?o._writableState?o._writableState.errorEmitted?process.nextTick(t,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,c)):process.nextTick(e,o,c):a?(process.nextTick(t,o),a(c)):process.nextTick(t,o)}),this)}function e(s,a){u(s,a),t(s)}function t(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function i(){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 u(s,a){s.emit("error",a)}function r(s,a){var o=s._readableState,f=s._writableState;o&&o.autoDestroy||f&&f.autoDestroy?s.destroy(a):s.emit("error",a)}return Ri={destroy:d,undestroy:i,errorOrDestroy:r},Ri}var Ii={},Ks;function Wt(){if(Ks)return Ii;Ks=1;function d(a,o){a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.__proto__=o}var e={};function t(a,o,f){f||(f=Error);function n(h,l,b){return typeof o=="string"?o:o(h,l,b)}var c=(function(h){d(l,h);function l(b,p,y){return h.call(this,n(b,p,y))||this}return l})(f);c.prototype.name=f.name,c.prototype.code=a,e[a]=c}function i(a,o){if(Array.isArray(a)){var f=a.length;return a=a.map(function(n){return String(n)}),f>2?"one of ".concat(o," ").concat(a.slice(0,f-1).join(", "),", or ")+a[f-1]:f===2?"one of ".concat(o," ").concat(a[0]," or ").concat(a[1]):"of ".concat(o," ").concat(a[0])}else return"of ".concat(o," ").concat(String(a))}function u(a,o,f){return a.substr(0,o.length)===o}function r(a,o,f){return(f===void 0||f>a.length)&&(f=a.length),a.substring(f-o.length,f)===o}function s(a,o,f){return typeof f!="number"&&(f=0),f+o.length>a.length?!1:a.indexOf(o,f)!==-1}return t("ERR_INVALID_OPT_VALUE",function(a,o){return'The value "'+o+'" is invalid for option "'+a+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(a,o,f){var n;typeof o=="string"&&u(o,"not ")?(n="must not be",o=o.replace(/^not /,"")):n="must be";var c;if(r(a," argument"))c="The ".concat(a," ").concat(n," ").concat(i(o,"type"));else{var h=s(a,".")?"property":"argument";c='The "'.concat(a,'" ').concat(h," ").concat(n," ").concat(i(o,"type"))}return c+=". Received type ".concat(typeof f),c},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ii.codes=e,Ii}var Ai,js;function Dh(){if(js)return Ai;js=1;var d=Wt().codes.ERR_INVALID_OPT_VALUE;function e(i,u,r){return i.highWaterMark!=null?i.highWaterMark:u?i[r]:null}function t(i,u,r,s){var a=e(u,s,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=s?r:"highWaterMark";throw new d(o,a)}return Math.floor(a)}return i.objectMode?16:16*1024}return Ai={getHighWaterMark:t},Ai}var Oi,zs;function Fh(){if(zs)return Oi;zs=1,Oi=d;function d(t,i){if(e("noDeprecation"))return t;var u=!1;function r(){if(!u){if(e("throwDeprecation"))throw new Error(i);e("traceDeprecation")?console.trace(i):console.warn(i),u=!0}return t.apply(this,arguments)}return r}function e(t){try{if(!Ie.localStorage)return!1}catch{return!1}var i=Ie.localStorage[t];return i==null?!1:String(i).toLowerCase()==="true"}return Oi}var Pi,Vs;function qh(){if(Vs)return Pi;Vs=1,Pi=G;function d(V){var P=this;this.next=null,this.entry=null,this.finish=function(){se(P,V)}}var e;G.WritableState=T;var t={deprecate:Fh()},i=Th(),u=xt().Buffer,r=(typeof Ie<"u"?Ie:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(V){return u.from(V)}function a(V){return u.isBuffer(V)||V instanceof r}var o=Lh(),f=Dh(),n=f.getHighWaterMark,c=Wt().codes,h=c.ERR_INVALID_ARG_TYPE,l=c.ERR_METHOD_NOT_IMPLEMENTED,b=c.ERR_MULTIPLE_CALLBACK,p=c.ERR_STREAM_CANNOT_PIPE,y=c.ERR_STREAM_DESTROYED,v=c.ERR_STREAM_NULL_VALUES,g=c.ERR_STREAM_WRITE_AFTER_END,x=c.ERR_UNKNOWN_ENCODING,B=o.errorOrDestroy;pe()(G,i);function I(){}function T(V,P,M){e=e||jt(),V=V||{},typeof M!="boolean"&&(M=P instanceof e),this.objectMode=!!V.objectMode,M&&(this.objectMode=this.objectMode||!!V.writableObjectMode),this.highWaterMark=n(this,V,"writableHighWaterMark",M),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Y=V.decodeStrings===!1;this.decodeStrings=!Y,this.defaultEncoding=V.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){O(P,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}T.prototype.getBuffer=function(){for(var P=this.bufferedRequest,M=[];P;)M.push(P),P=P.next;return M},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var j;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(j=Function.prototype[Symbol.hasInstance],Object.defineProperty(G,Symbol.hasInstance,{value:function(P){return j.call(this,P)?!0:this!==G?!1:P&&P._writableState instanceof T}})):j=function(P){return P instanceof this};function G(V){e=e||jt();var P=this instanceof e;if(!P&&!j.call(G,this))return new G(V);this._writableState=new T(V,this,P),this.writable=!0,V&&(typeof V.write=="function"&&(this._write=V.write),typeof V.writev=="function"&&(this._writev=V.writev),typeof V.destroy=="function"&&(this._destroy=V.destroy),typeof V.final=="function"&&(this._final=V.final)),i.call(this)}G.prototype.pipe=function(){B(this,new p)};function z(V,P){var M=new g;B(V,M),process.nextTick(P,M)}function te(V,P,M,Y){var Q;return M===null?Q=new v:typeof M!="string"&&!P.objectMode&&(Q=new h("chunk",["string","Buffer"],M)),Q?(B(V,Q),process.nextTick(Y,Q),!1):!0}G.prototype.write=function(V,P,M){var Y=this._writableState,Q=!1,D=!Y.objectMode&&a(V);return D&&!u.isBuffer(V)&&(V=s(V)),typeof P=="function"&&(M=P,P=null),D?P="buffer":P||(P=Y.defaultEncoding),typeof M!="function"&&(M=I),Y.ending?z(this,M):(D||te(this,Y,V,M))&&(Y.pendingcb++,Q=$(this,Y,D,V,P,M)),Q},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){var V=this._writableState;V.corked&&(V.corked--,!V.writing&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&F(this,V))},G.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 x(P);return this._writableState.defaultEncoding=P,this},Object.defineProperty(G.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ne(V,P,M){return!V.objectMode&&V.decodeStrings!==!1&&typeof P=="string"&&(P=u.from(P,M)),P}Object.defineProperty(G.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(V,P,M,Y,Q,D){if(!M){var C=ne(P,Y,Q);Y!==C&&(M=!0,Q="buffer",Y=C)}var J=P.objectMode?1:Y.length;P.length+=J;var ie=P.length<P.highWaterMark;if(ie||(P.needDrain=!0),P.writing||P.corked){var he=P.lastBufferedRequest;P.lastBufferedRequest={chunk:Y,encoding:Q,isBuf:M,callback:D,next:null},he?he.next=P.lastBufferedRequest:P.bufferedRequest=P.lastBufferedRequest,P.bufferedRequestCount+=1}else k(V,P,!1,J,Y,Q,D);return ie}function k(V,P,M,Y,Q,D,C){P.writelen=Y,P.writecb=C,P.writing=!0,P.sync=!0,P.destroyed?P.onwrite(new y("write")):M?V._writev(Q,P.onwrite):V._write(Q,D,P.onwrite),P.sync=!1}function m(V,P,M,Y,Q){--P.pendingcb,M?(process.nextTick(Q,Y),process.nextTick(U,V,P),V._writableState.errorEmitted=!0,B(V,Y)):(Q(Y),V._writableState.errorEmitted=!0,B(V,Y),U(V,P))}function E(V){V.writing=!1,V.writecb=null,V.length-=V.writelen,V.writelen=0}function O(V,P){var M=V._writableState,Y=M.sync,Q=M.writecb;if(typeof Q!="function")throw new b;if(E(M),P)m(V,M,Y,P,Q);else{var D=K(M)||V.destroyed;!D&&!M.corked&&!M.bufferProcessing&&M.bufferedRequest&&F(V,M),Y?process.nextTick(R,V,M,D,Q):R(V,M,D,Q)}}function R(V,P,M,Y){M||A(V,P),P.pendingcb--,Y(),U(V,P)}function A(V,P){P.length===0&&P.needDrain&&(P.needDrain=!1,V.emit("drain"))}function F(V,P){P.bufferProcessing=!0;var M=P.bufferedRequest;if(V._writev&&M&&M.next){var Y=P.bufferedRequestCount,Q=new Array(Y),D=P.corkedRequestsFree;D.entry=M;for(var C=0,J=!0;M;)Q[C]=M,M.isBuf||(J=!1),M=M.next,C+=1;Q.allBuffers=J,k(V,P,!0,P.length,Q,"",D.finish),P.pendingcb++,P.lastBufferedRequest=null,D.next?(P.corkedRequestsFree=D.next,D.next=null):P.corkedRequestsFree=new d(P),P.bufferedRequestCount=0}else{for(;M;){var ie=M.chunk,he=M.encoding,oe=M.callback,ue=P.objectMode?1:ie.length;if(k(V,P,!1,ue,ie,he,oe),M=M.next,P.bufferedRequestCount--,P.writing)break}M===null&&(P.lastBufferedRequest=null)}P.bufferedRequest=M,P.bufferProcessing=!1}G.prototype._write=function(V,P,M){M(new l("_write()"))},G.prototype._writev=null,G.prototype.end=function(V,P,M){var Y=this._writableState;return typeof V=="function"?(M=V,V=null,P=null):typeof P=="function"&&(M=P,P=null),V!=null&&this.write(V,P),Y.corked&&(Y.corked=1,this.uncork()),Y.ending||fe(this,Y,M),this},Object.defineProperty(G.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function K(V){return V.ending&&V.length===0&&V.bufferedRequest===null&&!V.finished&&!V.writing}function L(V,P){V._final(function(M){P.pendingcb--,M&&B(V,M),P.prefinished=!0,V.emit("prefinish"),U(V,P)})}function _(V,P){!P.prefinished&&!P.finalCalled&&(typeof V._final=="function"&&!P.destroyed?(P.pendingcb++,P.finalCalled=!0,process.nextTick(L,V,P)):(P.prefinished=!0,V.emit("prefinish")))}function U(V,P){var M=K(P);if(M&&(_(V,P),P.pendingcb===0&&(P.finished=!0,V.emit("finish"),P.autoDestroy))){var Y=V._readableState;(!Y||Y.autoDestroy&&Y.endEmitted)&&V.destroy()}return M}function fe(V,P,M){P.ending=!0,U(V,P),M&&(P.finished?process.nextTick(M):V.once("finish",M)),P.ended=!0,V.writable=!1}function se(V,P,M){var Y=V.entry;for(V.entry=null;Y;){var Q=Y.callback;P.pendingcb--,Q(M),Y=Y.next}P.corkedRequestsFree.next=V}return Object.defineProperty(G.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(P){this._writableState&&(this._writableState.destroyed=P)}}),G.prototype.destroy=o.destroy,G.prototype._undestroy=o.undestroy,G.prototype._destroy=function(V,P){P(V)},Pi}var ki,Gs;function jt(){if(Gs)return ki;Gs=1;var d=Object.keys||function(f){var n=[];for(var c in f)n.push(c);return n};ki=s;var e=Uh(),t=qh();pe()(s,e);for(var i=d(t.prototype),u=0;u<i.length;u++){var r=i[u];s.prototype[r]||(s.prototype[r]=t.prototype[r])}function s(f){if(!(this instanceof s))return new s(f);e.call(this,f),t.call(this,f),this.allowHalfOpen=!0,f&&(f.readable===!1&&(this.readable=!1),f.writable===!1&&(this.writable=!1),f.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(o,this)}function o(f){f.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(n){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=n,this._writableState.destroyed=n)}}),ki}var Ni={},$s;function Yf(){if($s)return Ni;$s=1;var d=_e().Buffer,e=d.isEncoding||function(v){switch(v=""+v,v&&v.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(v){if(!v)return"utf8";for(var g;;)switch(v){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 v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function i(v){var g=t(v);if(typeof g!="string"&&(d.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return g||v}Ni.StringDecoder=u;function u(v){this.encoding=i(v);var g;switch(this.encoding){case"utf16le":this.text=c,this.end=h,g=4;break;case"utf8":this.fillLast=o,g=4;break;case"base64":this.text=l,this.end=b,g=3;break;default:this.write=p,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=d.allocUnsafe(g)}u.prototype.write=function(v){if(v.length===0)return"";var g,x;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<v.length?g?g+this.text(v,x):this.text(v,x):g||""},u.prototype.end=n,u.prototype.text=f,u.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function r(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,g,x){var B=g.length-1;if(B<x)return 0;var I=r(g[B]);return I>=0?(I>0&&(v.lastNeed=I-1),I):--B<x||I===-2?0:(I=r(g[B]),I>=0?(I>0&&(v.lastNeed=I-2),I):--B<x||I===-2?0:(I=r(g[B]),I>=0?(I>0&&(I===2?I=0:v.lastNeed=I-3),I):0))}function a(v,g,x){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return v.lastNeed=2,"�"}}function o(v){var g=this.lastTotal-this.lastNeed,x=a(this,v);if(x!==void 0)return x;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function f(v,g){var x=s(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=x;var B=v.length-(x-this.lastNeed);return v.copy(this.lastChar,0,B),v.toString("utf8",g,B)}function n(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+"�":g}function c(v,g){if((v.length-g)%2===0){var x=v.toString("utf16le",g);if(x){var B=x.charCodeAt(x.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function h(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,x)}return g}function l(v,g){var x=(v.length-g)%3;return x===0?v.toString("base64",g):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",g,v.length-x))}function b(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function p(v){return v.toString(this.encoding)}function y(v){return v&&v.length?this.write(v):""}return Ni}var Mi,Ws;function as(){if(Ws)return Mi;Ws=1;var d=Wt().codes.ERR_STREAM_PREMATURE_CLOSE;function e(r){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,o=new Array(a),f=0;f<a;f++)o[f]=arguments[f];r.apply(this,o)}}}function t(){}function i(r){return r.setHeader&&typeof r.abort=="function"}function u(r,s,a){if(typeof s=="function")return u(r,null,s);s||(s={}),a=e(a||t);var o=s.readable||s.readable!==!1&&r.readable,f=s.writable||s.writable!==!1&&r.writable,n=function(){r.writable||h()},c=r._writableState&&r._writableState.finished,h=function(){f=!1,c=!0,o||a.call(r)},l=r._readableState&&r._readableState.endEmitted,b=function(){o=!1,l=!0,f||a.call(r)},p=function(x){a.call(r,x)},y=function(){var x;if(o&&!l)return(!r._readableState||!r._readableState.ended)&&(x=new d),a.call(r,x);if(f&&!c)return(!r._writableState||!r._writableState.ended)&&(x=new d),a.call(r,x)},v=function(){r.req.on("finish",h)};return i(r)?(r.on("complete",h),r.on("abort",y),r.req?v():r.on("request",v)):f&&!r._writableState&&(r.on("end",n),r.on("close",n)),r.on("end",b),r.on("finish",h),s.error!==!1&&r.on("error",p),r.on("close",y),function(){r.removeListener("complete",h),r.removeListener("abort",y),r.removeListener("request",v),r.req&&r.req.removeListener("finish",h),r.removeListener("end",n),r.removeListener("close",n),r.removeListener("finish",h),r.removeListener("end",b),r.removeListener("error",p),r.removeListener("close",y)}}return Mi=u,Mi}var Ci,Ys;function r0(){if(Ys)return Ci;Ys=1;var d;function e(x,B,I){return B=t(B),B in x?Object.defineProperty(x,B,{value:I,enumerable:!0,configurable:!0,writable:!0}):x[B]=I,x}function t(x){var B=i(x,"string");return typeof B=="symbol"?B:String(B)}function i(x,B){if(typeof x!="object"||x===null)return x;var I=x[Symbol.toPrimitive];if(I!==void 0){var T=I.call(x,B);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(B==="string"?String:Number)(x)}var u=as(),r=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),o=Symbol("ended"),f=Symbol("lastPromise"),n=Symbol("handlePromise"),c=Symbol("stream");function h(x,B){return{value:x,done:B}}function l(x){var B=x[r];if(B!==null){var I=x[c].read();I!==null&&(x[f]=null,x[r]=null,x[s]=null,B(h(I,!1)))}}function b(x){process.nextTick(l,x)}function p(x,B){return function(I,T){x.then(function(){if(B[o]){I(h(void 0,!0));return}B[n](I,T)},T)}}var y=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((d={get stream(){return this[c]},next:function(){var B=this,I=this[a];if(I!==null)return Promise.reject(I);if(this[o])return Promise.resolve(h(void 0,!0));if(this[c].destroyed)return new Promise(function(z,te){process.nextTick(function(){B[a]?te(B[a]):z(h(void 0,!0))})});var T=this[f],j;if(T)j=new Promise(p(T,this));else{var G=this[c].read();if(G!==null)return Promise.resolve(h(G,!1));j=new Promise(this[n])}return this[f]=j,j}},e(d,Symbol.asyncIterator,function(){return this}),e(d,"return",function(){var B=this;return new Promise(function(I,T){B[c].destroy(null,function(j){if(j){T(j);return}I(h(void 0,!0))})})}),d),y),g=function(B){var I,T=Object.create(v,(I={},e(I,c,{value:B,writable:!0}),e(I,r,{value:null,writable:!0}),e(I,s,{value:null,writable:!0}),e(I,a,{value:null,writable:!0}),e(I,o,{value:B._readableState.endEmitted,writable:!0}),e(I,n,{value:function(G,z){var te=T[c].read();te?(T[f]=null,T[r]=null,T[s]=null,G(h(te,!1))):(T[r]=G,T[s]=z)},writable:!0}),I));return T[f]=null,u(B,function(j){if(j&&j.code!=="ERR_STREAM_PREMATURE_CLOSE"){var G=T[s];G!==null&&(T[f]=null,T[r]=null,T[s]=null,G(j)),T[a]=j;return}var z=T[r];z!==null&&(T[f]=null,T[r]=null,T[s]=null,z(h(void 0,!0))),T[o]=!0}),B.on("readable",b.bind(null,T)),T};return Ci=g,Ci}var Ti,Js;function i0(){return Js||(Js=1,Ti=function(){throw new Error("Readable.from is not available in the browser")}),Ti}var Li,Xs;function Uh(){if(Xs)return Li;Xs=1,Li=z;var d;z.ReadableState=G,fr().EventEmitter;var e=function(C,J){return C.listeners(J).length},t=Th(),i=xt().Buffer,u=(typeof Ie<"u"?Ie:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function r(D){return i.from(D)}function s(D){return i.isBuffer(D)||D instanceof u}var a=$t,o;a&&a.debuglog?o=a.debuglog("stream"):o=function(){};var f=t0(),n=Lh(),c=Dh(),h=c.getHighWaterMark,l=Wt().codes,b=l.ERR_INVALID_ARG_TYPE,p=l.ERR_STREAM_PUSH_AFTER_EOF,y=l.ERR_METHOD_NOT_IMPLEMENTED,v=l.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,x,B;pe()(z,t);var I=n.errorOrDestroy,T=["error","close","destroy","pause","resume"];function j(D,C,J){if(typeof D.prependListener=="function")return D.prependListener(C,J);!D._events||!D._events[C]?D.on(C,J):Array.isArray(D._events[C])?D._events[C].unshift(J):D._events[C]=[J,D._events[C]]}function G(D,C,J){d=d||jt(),D=D||{},typeof J!="boolean"&&(J=C instanceof d),this.objectMode=!!D.objectMode,J&&(this.objectMode=this.objectMode||!!D.readableObjectMode),this.highWaterMark=h(this,D,"readableHighWaterMark",J),this.buffer=new f,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=D.emitClose!==!1,this.autoDestroy=!!D.autoDestroy,this.destroyed=!1,this.defaultEncoding=D.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,D.encoding&&(g||(g=Yf().StringDecoder),this.decoder=new g(D.encoding),this.encoding=D.encoding)}function z(D){if(d=d||jt(),!(this instanceof z))return new z(D);var C=this instanceof d;this._readableState=new G(D,this,C),this.readable=!0,D&&(typeof D.read=="function"&&(this._read=D.read),typeof D.destroy=="function"&&(this._destroy=D.destroy)),t.call(this)}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(C){this._readableState&&(this._readableState.destroyed=C)}}),z.prototype.destroy=n.destroy,z.prototype._undestroy=n.undestroy,z.prototype._destroy=function(D,C){C(D)},z.prototype.push=function(D,C){var J=this._readableState,ie;return J.objectMode?ie=!0:typeof D=="string"&&(C=C||J.defaultEncoding,C!==J.encoding&&(D=i.from(D,C),C=""),ie=!0),te(this,D,C,!1,ie)},z.prototype.unshift=function(D){return te(this,D,null,!0,!1)};function te(D,C,J,ie,he){o("readableAddChunk",C);var oe=D._readableState;if(C===null)oe.reading=!1,O(D,oe);else{var ue;if(he||(ue=$(oe,C)),ue)I(D,ue);else if(oe.objectMode||C&&C.length>0)if(typeof C!="string"&&!oe.objectMode&&Object.getPrototypeOf(C)!==i.prototype&&(C=r(C)),ie)oe.endEmitted?I(D,new v):ne(D,oe,C,!0);else if(oe.ended)I(D,new p);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!J?(C=oe.decoder.write(C),oe.objectMode||C.length!==0?ne(D,oe,C,!1):F(D,oe)):ne(D,oe,C,!1)}else ie||(oe.reading=!1,F(D,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function ne(D,C,J,ie){C.flowing&&C.length===0&&!C.sync?(C.awaitDrain=0,D.emit("data",J)):(C.length+=C.objectMode?1:J.length,ie?C.buffer.unshift(J):C.buffer.push(J),C.needReadable&&R(D)),F(D,C)}function $(D,C){var J;return!s(C)&&typeof C!="string"&&C!==void 0&&!D.objectMode&&(J=new b("chunk",["string","Buffer","Uint8Array"],C)),J}z.prototype.isPaused=function(){return this._readableState.flowing===!1},z.prototype.setEncoding=function(D){g||(g=Yf().StringDecoder);var C=new g(D);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;for(var J=this._readableState.buffer.head,ie="";J!==null;)ie+=C.write(J.data),J=J.next;return this._readableState.buffer.clear(),ie!==""&&this._readableState.buffer.push(ie),this._readableState.length=ie.length,this};var k=1073741824;function m(D){return D>=k?D=k:(D--,D|=D>>>1,D|=D>>>2,D|=D>>>4,D|=D>>>8,D|=D>>>16,D++),D}function E(D,C){return D<=0||C.length===0&&C.ended?0:C.objectMode?1:D!==D?C.flowing&&C.length?C.buffer.head.data.length:C.length:(D>C.highWaterMark&&(C.highWaterMark=m(D)),D<=C.length?D:C.ended?C.length:(C.needReadable=!0,0))}z.prototype.read=function(D){o("read",D),D=parseInt(D,10);var C=this._readableState,J=D;if(D!==0&&(C.emittedReadable=!1),D===0&&C.needReadable&&((C.highWaterMark!==0?C.length>=C.highWaterMark:C.length>0)||C.ended))return o("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?M(this):R(this),null;if(D=E(D,C),D===0&&C.ended)return C.length===0&&M(this),null;var ie=C.needReadable;o("need readable",ie),(C.length===0||C.length-D<C.highWaterMark)&&(ie=!0,o("length less than watermark",ie)),C.ended||C.reading?(ie=!1,o("reading or ended",ie)):ie&&(o("do read"),C.reading=!0,C.sync=!0,C.length===0&&(C.needReadable=!0),this._read(C.highWaterMark),C.sync=!1,C.reading||(D=E(J,C)));var he;return D>0?he=P(D,C):he=null,he===null?(C.needReadable=C.length<=C.highWaterMark,D=0):(C.length-=D,C.awaitDrain=0),C.length===0&&(C.ended||(C.needReadable=!0),J!==D&&C.ended&&M(this)),he!==null&&this.emit("data",he),he};function O(D,C){if(o("onEofChunk"),!C.ended){if(C.decoder){var J=C.decoder.end();J&&J.length&&(C.buffer.push(J),C.length+=C.objectMode?1:J.length)}C.ended=!0,C.sync?R(D):(C.needReadable=!1,C.emittedReadable||(C.emittedReadable=!0,A(D)))}}function R(D){var C=D._readableState;o("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(o("emitReadable",C.flowing),C.emittedReadable=!0,process.nextTick(A,D))}function A(D){var C=D._readableState;o("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&(C.length||C.ended)&&(D.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,V(D)}function F(D,C){C.readingMore||(C.readingMore=!0,process.nextTick(K,D,C))}function K(D,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){var J=C.length;if(o("maybeReadMore read 0"),D.read(0),J===C.length)break}C.readingMore=!1}z.prototype._read=function(D){I(this,new y("_read()"))},z.prototype.pipe=function(D,C){var J=this,ie=this._readableState;switch(ie.pipesCount){case 0:ie.pipes=D;break;case 1:ie.pipes=[ie.pipes,D];break;default:ie.pipes.push(D);break}ie.pipesCount+=1,o("pipe count=%d opts=%j",ie.pipesCount,C);var he=(!C||C.end!==!1)&&D!==process.stdout&&D!==process.stderr,oe=he?ge:Pe;ie.endEmitted?process.nextTick(oe):J.once("end",oe),D.on("unpipe",ue);function ue(N,w){o("onunpipe"),N===J&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,de())}function ge(){o("onend"),D.end()}var Ke=L(J);D.on("drain",Ke);var Se=!1;function de(){o("cleanup"),D.removeListener("close",me),D.removeListener("finish",Le),D.removeListener("drain",Ke),D.removeListener("error",ve),D.removeListener("unpipe",ue),J.removeListener("end",ge),J.removeListener("end",Pe),J.removeListener("data",Re),Se=!0,ie.awaitDrain&&(!D._writableState||D._writableState.needDrain)&&Ke()}J.on("data",Re);function Re(N){o("ondata");var w=D.write(N);o("dest.write",w),w===!1&&((ie.pipesCount===1&&ie.pipes===D||ie.pipesCount>1&&Q(ie.pipes,D)!==-1)&&!Se&&(o("false write response, pause",ie.awaitDrain),ie.awaitDrain++),J.pause())}function ve(N){o("onerror",N),Pe(),D.removeListener("error",ve),e(D,"error")===0&&I(D,N)}j(D,"error",ve);function me(){D.removeListener("finish",Le),Pe()}D.once("close",me);function Le(){o("onfinish"),D.removeListener("close",me),Pe()}D.once("finish",Le);function Pe(){o("unpipe"),J.unpipe(D)}return D.emit("pipe",J),ie.flowing||(o("pipe resume"),J.resume()),D};function L(D){return function(){var J=D._readableState;o("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&e(D,"data")&&(J.flowing=!0,V(D))}}z.prototype.unpipe=function(D){var C=this._readableState,J={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return D&&D!==C.pipes?this:(D||(D=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,D&&D.emit("unpipe",this,J),this);if(!D){var ie=C.pipes,he=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var oe=0;oe<he;oe++)ie[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var ue=Q(C.pipes,D);return ue===-1?this:(C.pipes.splice(ue,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),D.emit("unpipe",this,J),this)},z.prototype.on=function(D,C){var J=t.prototype.on.call(this,D,C),ie=this._readableState;return D==="data"?(ie.readableListening=this.listenerCount("readable")>0,ie.flowing!==!1&&this.resume()):D==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,o("on readable",ie.length,ie.reading),ie.length?R(this):ie.reading||process.nextTick(U,this)),J},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(D,C){var J=t.prototype.removeListener.call(this,D,C);return D==="readable"&&process.nextTick(_,this),J},z.prototype.removeAllListeners=function(D){var C=t.prototype.removeAllListeners.apply(this,arguments);return(D==="readable"||D===void 0)&&process.nextTick(_,this),C};function _(D){var C=D._readableState;C.readableListening=D.listenerCount("readable")>0,C.resumeScheduled&&!C.paused?C.flowing=!0:D.listenerCount("data")>0&&D.resume()}function U(D){o("readable nexttick read 0"),D.read(0)}z.prototype.resume=function(){var D=this._readableState;return D.flowing||(o("resume"),D.flowing=!D.readableListening,fe(this,D)),D.paused=!1,this};function fe(D,C){C.resumeScheduled||(C.resumeScheduled=!0,process.nextTick(se,D,C))}function se(D,C){o("resume",C.reading),C.reading||D.read(0),C.resumeScheduled=!1,D.emit("resume"),V(D),C.flowing&&!C.reading&&D.read(0)}z.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function V(D){var C=D._readableState;for(o("flow",C.flowing);C.flowing&&D.read()!==null;);}z.prototype.wrap=function(D){var C=this,J=this._readableState,ie=!1;D.on("end",function(){if(o("wrapped end"),J.decoder&&!J.ended){var ue=J.decoder.end();ue&&ue.length&&C.push(ue)}C.push(null)}),D.on("data",function(ue){if(o("wrapped data"),J.decoder&&(ue=J.decoder.write(ue)),!(J.objectMode&&ue==null)&&!(!J.objectMode&&(!ue||!ue.length))){var ge=C.push(ue);ge||(ie=!0,D.pause())}});for(var he in D)this[he]===void 0&&typeof D[he]=="function"&&(this[he]=(function(ge){return function(){return D[ge].apply(D,arguments)}})(he));for(var oe=0;oe<T.length;oe++)D.on(T[oe],this.emit.bind(this,T[oe]));return this._read=function(ue){o("wrapped _read",ue),ie&&(ie=!1,D.resume())},this},typeof Symbol=="function"&&(z.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=r0()),x(this)}),Object.defineProperty(z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(C){this._readableState&&(this._readableState.flowing=C)}}),z._fromList=P,Object.defineProperty(z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function P(D,C){if(C.length===0)return null;var J;return C.objectMode?J=C.buffer.shift():!D||D>=C.length?(C.decoder?J=C.buffer.join(""):C.buffer.length===1?J=C.buffer.first():J=C.buffer.concat(C.length),C.buffer.clear()):J=C.buffer.consume(D,C.decoder),J}function M(D){var C=D._readableState;o("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,process.nextTick(Y,C,D))}function Y(D,C){if(o("endReadableNT",D.endEmitted,D.length),!D.endEmitted&&D.length===0&&(D.endEmitted=!0,C.readable=!1,C.emit("end"),D.autoDestroy)){var J=C._writableState;(!J||J.autoDestroy&&J.finished)&&C.destroy()}}typeof Symbol=="function"&&(z.from=function(D,C){return B===void 0&&(B=i0()),B(z,D,C)});function Q(D,C){for(var J=0,ie=D.length;J<ie;J++)if(D[J]===C)return J;return-1}return Li}var Di,Qs;function Hh(){if(Qs)return Di;Qs=1,Di=a;var d=Wt().codes,e=d.ERR_METHOD_NOT_IMPLEMENTED,t=d.ERR_MULTIPLE_CALLBACK,i=d.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=d.ERR_TRANSFORM_WITH_LENGTH_0,r=jt();pe()(a,r);function s(n,c){var h=this._transformState;h.transforming=!1;var l=h.writecb;if(l===null)return this.emit("error",new t);h.writechunk=null,h.writecb=null,c!=null&&this.push(c),l(n);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function a(n){if(!(this instanceof a))return new a(n);r.call(this,n),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",o)}function o(){var n=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(c,h){f(n,c,h)}):f(this,null,null)}a.prototype.push=function(n,c){return this._transformState.needTransform=!1,r.prototype.push.call(this,n,c)},a.prototype._transform=function(n,c,h){h(new e("_transform()"))},a.prototype._write=function(n,c,h){var l=this._transformState;if(l.writecb=h,l.writechunk=n,l.writeencoding=c,!l.transforming){var b=this._readableState;(l.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},a.prototype._read=function(n){var c=this._transformState;c.writechunk!==null&&!c.transforming?(c.transforming=!0,this._transform(c.writechunk,c.writeencoding,c.afterTransform)):c.needTransform=!0},a.prototype._destroy=function(n,c){r.prototype._destroy.call(this,n,function(h){c(h)})};function f(n,c,h){if(c)return n.emit("error",c);if(h!=null&&n.push(h),n._writableState.length)throw new u;if(n._transformState.transforming)throw new i;return n.push(null)}return Di}var Fi,Zs;function n0(){if(Zs)return Fi;Zs=1,Fi=e;var d=Hh();pe()(e,d);function e(t){if(!(this instanceof e))return new e(t);d.call(this,t)}return e.prototype._transform=function(t,i,u){u(null,t)},Fi}var qi,eo;function a0(){if(eo)return qi;eo=1;var d;function e(h){var l=!1;return function(){l||(l=!0,h.apply(void 0,arguments))}}var t=Wt().codes,i=t.ERR_MISSING_ARGS,u=t.ERR_STREAM_DESTROYED;function r(h){if(h)throw h}function s(h){return h.setHeader&&typeof h.abort=="function"}function a(h,l,b,p){p=e(p);var y=!1;h.on("close",function(){y=!0}),d===void 0&&(d=as()),d(h,{readable:l,writable:b},function(g){if(g)return p(g);y=!0,p()});var v=!1;return function(g){if(!y&&!v){if(v=!0,s(h))return h.abort();if(typeof h.destroy=="function")return h.destroy();p(g||new u("pipe"))}}}function o(h){h()}function f(h,l){return h.pipe(l)}function n(h){return!h.length||typeof h[h.length-1]!="function"?r:h.pop()}function c(){for(var h=arguments.length,l=new Array(h),b=0;b<h;b++)l[b]=arguments[b];var p=n(l);if(Array.isArray(l[0])&&(l=l[0]),l.length<2)throw new i("streams");var y,v=l.map(function(g,x){var B=x<l.length-1,I=x>0;return a(g,B,I,function(T){y||(y=T),T&&v.forEach(o),!B&&(v.forEach(o),p(y))})});return l.reduce(f)}return qi=c,qi}var Ui,to;function Kh(){if(to)return Ui;to=1,Ui=t;var d=fr().EventEmitter,e=pe();e(t,d),t.Readable=Uh(),t.Writable=qh(),t.Duplex=jt(),t.Transform=Hh(),t.PassThrough=n0(),t.finished=as(),t.pipeline=a0(),t.Stream=t;function t(){d.call(this)}return t.prototype.pipe=function(i,u){var r=this;function s(l){i.writable&&i.write(l)===!1&&r.pause&&r.pause()}r.on("data",s);function a(){r.readable&&r.resume&&r.resume()}i.on("drain",a),!i._isStdio&&(!u||u.end!==!1)&&(r.on("end",f),r.on("close",n));var o=!1;function f(){o||(o=!0,i.end())}function n(){o||(o=!0,typeof i.destroy=="function"&&i.destroy())}function c(l){if(h(),d.listenerCount(this,"error")===0)throw l}r.on("error",c),i.on("error",c);function h(){r.removeListener("data",s),i.removeListener("drain",a),r.removeListener("end",f),r.removeListener("close",n),r.removeListener("error",c),i.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),i.removeListener("close",h)}return r.on("end",h),r.on("close",h),i.on("close",h),i.emit("pipe",r),i},Ui}var Hi,ro;function f0(){if(ro)return Hi;ro=1;var d=_e().Buffer,e=Kh().Transform,t=pe();function i(a){e.call(this),this._block=d.allocUnsafe(a),this._blockSize=a,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(i,e),i.prototype._transform=function(a,o,f){var n=null;try{this.update(a,o)}catch(c){n=c}f(n)},i.prototype._flush=function(a){var o=null;try{this.push(this.digest())}catch(f){o=f}a(o)};var u=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(d.prototype instanceof Uint8Array||d.TYPED_ARRAY_SUPPORT);function s(a,o){if(a instanceof d)return a;if(typeof a=="string")return d.from(a,o);if(r&&ArrayBuffer.isView(a)){if(a.byteLength===0)return d.alloc(0);var f=d.from(a.buffer,a.byteOffset,a.byteLength);if(f.byteLength===a.byteLength)return f}if(u&&a instanceof Uint8Array||d.isBuffer(a)&&a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a))return d.from(a);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return i.prototype.update=function(a,o){if(this._finalized)throw new Error("Digest already called");a=s(a,o);for(var f=this._block,n=0;this._blockOffset+a.length-n>=this._blockSize;){for(var c=this._blockOffset;c<this._blockSize;)f[c++]=a[n++];this._update(),this._blockOffset=0}for(;n<a.length;)f[this._blockOffset++]=a[n++];for(var h=0,l=a.length*8;l>0;++h)this._length[h]+=l,l=this._length[h]/4294967296|0,l>0&&(this._length[h]-=4294967296*l);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(a){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var o=this._digest();a!==void 0&&(o=o.toString(a)),this._block.fill(0),this._blockOffset=0;for(var f=0;f<4;++f)this._length[f]=0;return o},i.prototype._digest=function(){throw new Error("_digest is not implemented")},Hi=i,Hi}var Ki,io;function fs(){if(io)return Ki;io=1;var d=pe(),e=f0(),t=_e().Buffer,i=new Array(16);function u(){e.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}d(u,e),u.prototype._update=function(){for(var n=i,c=0;c<16;++c)n[c]=this._block.readInt32LE(c*4);var h=this._a,l=this._b,b=this._c,p=this._d;h=s(h,l,b,p,n[0],3614090360,7),p=s(p,h,l,b,n[1],3905402710,12),b=s(b,p,h,l,n[2],606105819,17),l=s(l,b,p,h,n[3],3250441966,22),h=s(h,l,b,p,n[4],4118548399,7),p=s(p,h,l,b,n[5],1200080426,12),b=s(b,p,h,l,n[6],2821735955,17),l=s(l,b,p,h,n[7],4249261313,22),h=s(h,l,b,p,n[8],1770035416,7),p=s(p,h,l,b,n[9],2336552879,12),b=s(b,p,h,l,n[10],4294925233,17),l=s(l,b,p,h,n[11],2304563134,22),h=s(h,l,b,p,n[12],1804603682,7),p=s(p,h,l,b,n[13],4254626195,12),b=s(b,p,h,l,n[14],2792965006,17),l=s(l,b,p,h,n[15],1236535329,22),h=a(h,l,b,p,n[1],4129170786,5),p=a(p,h,l,b,n[6],3225465664,9),b=a(b,p,h,l,n[11],643717713,14),l=a(l,b,p,h,n[0],3921069994,20),h=a(h,l,b,p,n[5],3593408605,5),p=a(p,h,l,b,n[10],38016083,9),b=a(b,p,h,l,n[15],3634488961,14),l=a(l,b,p,h,n[4],3889429448,20),h=a(h,l,b,p,n[9],568446438,5),p=a(p,h,l,b,n[14],3275163606,9),b=a(b,p,h,l,n[3],4107603335,14),l=a(l,b,p,h,n[8],1163531501,20),h=a(h,l,b,p,n[13],2850285829,5),p=a(p,h,l,b,n[2],4243563512,9),b=a(b,p,h,l,n[7],1735328473,14),l=a(l,b,p,h,n[12],2368359562,20),h=o(h,l,b,p,n[5],4294588738,4),p=o(p,h,l,b,n[8],2272392833,11),b=o(b,p,h,l,n[11],1839030562,16),l=o(l,b,p,h,n[14],4259657740,23),h=o(h,l,b,p,n[1],2763975236,4),p=o(p,h,l,b,n[4],1272893353,11),b=o(b,p,h,l,n[7],4139469664,16),l=o(l,b,p,h,n[10],3200236656,23),h=o(h,l,b,p,n[13],681279174,4),p=o(p,h,l,b,n[0],3936430074,11),b=o(b,p,h,l,n[3],3572445317,16),l=o(l,b,p,h,n[6],76029189,23),h=o(h,l,b,p,n[9],3654602809,4),p=o(p,h,l,b,n[12],3873151461,11),b=o(b,p,h,l,n[15],530742520,16),l=o(l,b,p,h,n[2],3299628645,23),h=f(h,l,b,p,n[0],4096336452,6),p=f(p,h,l,b,n[7],1126891415,10),b=f(b,p,h,l,n[14],2878612391,15),l=f(l,b,p,h,n[5],4237533241,21),h=f(h,l,b,p,n[12],1700485571,6),p=f(p,h,l,b,n[3],2399980690,10),b=f(b,p,h,l,n[10],4293915773,15),l=f(l,b,p,h,n[1],2240044497,21),h=f(h,l,b,p,n[8],1873313359,6),p=f(p,h,l,b,n[15],4264355552,10),b=f(b,p,h,l,n[6],2734768916,15),l=f(l,b,p,h,n[13],1309151649,21),h=f(h,l,b,p,n[4],4149444226,6),p=f(p,h,l,b,n[11],3174756917,10),b=f(b,p,h,l,n[2],718787259,15),l=f(l,b,p,h,n[9],3951481745,21),this._a=this._a+h|0,this._b=this._b+l|0,this._c=this._c+b|0,this._d=this._d+p|0},u.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 n=t.allocUnsafe(16);return n.writeInt32LE(this._a,0),n.writeInt32LE(this._b,4),n.writeInt32LE(this._c,8),n.writeInt32LE(this._d,12),n};function r(n,c){return n<<c|n>>>32-c}function s(n,c,h,l,b,p,y){return r(n+(c&h|~c&l)+b+p|0,y)+c|0}function a(n,c,h,l,b,p,y){return r(n+(c&l|h&~l)+b+p|0,y)+c|0}function o(n,c,h,l,b,p,y){return r(n+(c^h^l)+b+p|0,y)+c|0}function f(n,c,h,l,b,p,y){return r(n+(h^(c|~l))+b+p|0,y)+c|0}return Ki=u,Ki}var ji,no;function s0(){if(no)return ji;no=1;var d={}.toString;return ji=Array.isArray||function(e){return d.call(e)=="[object Array]"},ji}var zi,ao;function sr(){return ao||(ao=1,zi=TypeError),zi}var Vi,fo;function jh(){return fo||(fo=1,Vi=Object),Vi}var Gi,so;function o0(){return so||(so=1,Gi=Error),Gi}var $i,oo;function c0(){return oo||(oo=1,$i=EvalError),$i}var Wi,co;function u0(){return co||(co=1,Wi=RangeError),Wi}var Yi,uo;function h0(){return uo||(uo=1,Yi=ReferenceError),Yi}var Ji,ho;function zh(){return ho||(ho=1,Ji=SyntaxError),Ji}var Xi,lo;function d0(){return lo||(lo=1,Xi=URIError),Xi}var Qi,bo;function l0(){return bo||(bo=1,Qi=Math.abs),Qi}var Zi,po;function b0(){return po||(po=1,Zi=Math.floor),Zi}var en,vo;function p0(){return vo||(vo=1,en=Math.max),en}var tn,mo;function v0(){return mo||(mo=1,tn=Math.min),tn}var rn,yo;function m0(){return yo||(yo=1,rn=Math.pow),rn}var nn,go;function y0(){return go||(go=1,nn=Math.round),nn}var an,wo;function g0(){return wo||(wo=1,an=Number.isNaN||function(e){return e!==e}),an}var fn,_o;function w0(){if(_o)return fn;_o=1;var d=g0();return fn=function(t){return d(t)||t===0?t:t<0?-1:1},fn}var sn,So;function _0(){return So||(So=1,sn=Object.getOwnPropertyDescriptor),sn}var on,xo;function or(){if(xo)return on;xo=1;var d=_0();if(d)try{d([],"length")}catch{d=null}return on=d,on}var cn,Eo;function jr(){if(Eo)return cn;Eo=1;var d=Object.defineProperty||!1;if(d)try{d({},"a",{value:1})}catch{d=!1}return cn=d,cn}var un,Bo;function Vh(){return Bo||(Bo=1,un=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var u=42;e[t]=u;for(var r 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 s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==u||a.enumerable!==!0)return!1}return!0}),un}var hn,Ro;function S0(){if(Ro)return hn;Ro=1;var d=typeof Symbol<"u"&&Symbol,e=Vh();return hn=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},hn}var dn,Io;function Gh(){return Io||(Io=1,dn=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),dn}var ln,Ao;function $h(){if(Ao)return ln;Ao=1;var d=jh();return ln=d.getPrototypeOf||null,ln}var bn,Oo;function x0(){if(Oo)return bn;Oo=1;var d="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,i="[object Function]",u=function(o,f){for(var n=[],c=0;c<o.length;c+=1)n[c]=o[c];for(var h=0;h<f.length;h+=1)n[h+o.length]=f[h];return n},r=function(o,f){for(var n=[],c=f,h=0;c<o.length;c+=1,h+=1)n[h]=o[c];return n},s=function(a,o){for(var f="",n=0;n<a.length;n+=1)f+=a[n],n+1<a.length&&(f+=o);return f};return bn=function(o){var f=this;if(typeof f!="function"||e.apply(f)!==i)throw new TypeError(d+f);for(var n=r(arguments,1),c,h=function(){if(this instanceof c){var v=f.apply(this,u(n,arguments));return Object(v)===v?v:this}return f.apply(o,u(n,arguments))},l=t(0,f.length-n.length),b=[],p=0;p<l;p++)b[p]="$"+p;if(c=Function("binder","return function ("+s(b,",")+"){ return binder.apply(this,arguments); }")(h),f.prototype){var y=function(){};y.prototype=f.prototype,c.prototype=new y,y.prototype=null}return c},bn}var pn,Po;function cr(){if(Po)return pn;Po=1;var d=x0();return pn=Function.prototype.bind||d,pn}var vn,ko;function ss(){return ko||(ko=1,vn=Function.prototype.call),vn}var mn,No;function os(){return No||(No=1,mn=Function.prototype.apply),mn}var yn,Mo;function E0(){return Mo||(Mo=1,yn=typeof Reflect<"u"&&Reflect&&Reflect.apply),yn}var gn,Co;function Wh(){if(Co)return gn;Co=1;var d=cr(),e=os(),t=ss(),i=E0();return gn=i||d.call(t,e),gn}var wn,To;function cs(){if(To)return wn;To=1;var d=cr(),e=sr(),t=ss(),i=Wh();return wn=function(r){if(r.length<1||typeof r[0]!="function")throw new e("a function is required");return i(d,t,r)},wn}var _n,Lo;function B0(){if(Lo)return _n;Lo=1;var d=cs(),e=or(),t;try{t=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var i=!!t&&e&&e(Object.prototype,"__proto__"),u=Object,r=u.getPrototypeOf;return _n=i&&typeof i.get=="function"?d([i.get]):typeof r=="function"?function(a){return r(a==null?a:u(a))}:!1,_n}var Sn,Do;function R0(){if(Do)return Sn;Do=1;var d=Gh(),e=$h(),t=B0();return Sn=d?function(u){return d(u)}:e?function(u){if(!u||typeof u!="object"&&typeof u!="function")throw new TypeError("getProto: not an object");return e(u)}:t?function(u){return t(u)}:null,Sn}var xn,Fo;function I0(){if(Fo)return xn;Fo=1;var d=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=cr();return xn=t.call(d,e),xn}var En,qo;function Yh(){if(qo)return En;qo=1;var d,e=jh(),t=o0(),i=c0(),u=u0(),r=h0(),s=zh(),a=sr(),o=d0(),f=l0(),n=b0(),c=p0(),h=v0(),l=m0(),b=y0(),p=w0(),y=Function,v=function(Y){try{return y('"use strict"; return ('+Y+").constructor;")()}catch{}},g=or(),x=jr(),B=function(){throw new a},I=g?(function(){try{return arguments.callee,B}catch{try{return g(arguments,"callee").get}catch{return B}}})():B,T=S0()(),j=R0(),G=$h(),z=Gh(),te=os(),ne=ss(),$={},k=typeof Uint8Array>"u"||!j?d:j(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":T&&j?j([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?d:Float16Array,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":$,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&j?j(j([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!j?d:j(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":u,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!j?d:j(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&j?j(""[Symbol.iterator]()):d,"%Symbol%":T?Symbol:d,"%SyntaxError%":s,"%ThrowTypeError%":I,"%TypedArray%":k,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet,"%Function.prototype.call%":ne,"%Function.prototype.apply%":te,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":G,"%Math.abs%":f,"%Math.floor%":n,"%Math.max%":c,"%Math.min%":h,"%Math.pow%":l,"%Math.round%":b,"%Math.sign%":p,"%Reflect.getPrototypeOf%":z};if(j)try{null.error}catch(Y){var E=j(j(Y));m["%Error.prototype%"]=E}var O=function Y(Q){var D;if(Q==="%AsyncFunction%")D=v("async function () {}");else if(Q==="%GeneratorFunction%")D=v("function* () {}");else if(Q==="%AsyncGeneratorFunction%")D=v("async function* () {}");else if(Q==="%AsyncGenerator%"){var C=Y("%AsyncGeneratorFunction%");C&&(D=C.prototype)}else if(Q==="%AsyncIteratorPrototype%"){var J=Y("%AsyncGenerator%");J&&j&&(D=j(J.prototype))}return m[Q]=D,D},R={__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"]},A=cr(),F=I0(),K=A.call(ne,Array.prototype.concat),L=A.call(te,Array.prototype.splice),_=A.call(ne,String.prototype.replace),U=A.call(ne,String.prototype.slice),fe=A.call(ne,RegExp.prototype.exec),se=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,P=function(Q){var D=U(Q,0,1),C=U(Q,-1);if(D==="%"&&C!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(C==="%"&&D!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var J=[];return _(Q,se,function(ie,he,oe,ue){J[J.length]=oe?_(ue,V,"$1"):he||ie}),J},M=function(Q,D){var C=Q,J;if(F(R,C)&&(J=R[C],C="%"+J[0]+"%"),F(m,C)){var ie=m[C];if(ie===$&&(ie=O(C)),typeof ie>"u"&&!D)throw new a("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:J,name:C,value:ie}}throw new s("intrinsic "+Q+" does not exist!")};return En=function(Q,D){if(typeof Q!="string"||Q.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof D!="boolean")throw new a('"allowMissing" argument must be a boolean');if(fe(/^%?[^%]*%?$/,Q)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var C=P(Q),J=C.length>0?C[0]:"",ie=M("%"+J+"%",D),he=ie.name,oe=ie.value,ue=!1,ge=ie.alias;ge&&(J=ge[0],L(C,K([0,1],ge)));for(var Ke=1,Se=!0;Ke<C.length;Ke+=1){var de=C[Ke],Re=U(de,0,1),ve=U(de,-1);if((Re==='"'||Re==="'"||Re==="`"||ve==='"'||ve==="'"||ve==="`")&&Re!==ve)throw new s("property names with quotes must have matching quotes");if((de==="constructor"||!Se)&&(ue=!0),J+="."+de,he="%"+J+"%",F(m,he))oe=m[he];else if(oe!=null){if(!(de in oe)){if(!D)throw new a("base intrinsic for "+Q+" exists, but the property is not available.");return}if(g&&Ke+1>=C.length){var me=g(oe,de);Se=!!me,Se&&"get"in me&&!("originalValue"in me.get)?oe=me.get:oe=oe[de]}else Se=F(oe,de),oe=oe[de];Se&&!ue&&(m[he]=oe)}}return oe},En}var Bn,Uo;function Jh(){if(Uo)return Bn;Uo=1;var d=Yh(),e=cs(),t=e([d("%String.prototype.indexOf%")]);return Bn=function(u,r){var s=d(u,!!r);return typeof s=="function"&&t(u,".prototype.")>-1?e([s]):s},Bn}var Rn,Ho;function A0(){if(Ho)return Rn;Ho=1;var d=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,i;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw i}}),i={},e(function(){throw 42},null,t)}catch(g){g!==i&&(e=null)}else e=null;var u=/^\s*class\b/,r=function(x){try{var B=d.call(x);return u.test(B)}catch{return!1}},s=function(x){try{return r(x)?!1:(d.call(x),!0)}catch{return!1}},a=Object.prototype.toString,o="[object Object]",f="[object Function]",n="[object GeneratorFunction]",c="[object HTMLAllCollection]",h="[object HTML document.all class]",l="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,p=!(0 in[,]),y=function(){return!1};if(typeof document=="object"){var v=document.all;a.call(v)===a.call(document.all)&&(y=function(x){if((p||!x)&&(typeof x>"u"||typeof x=="object"))try{var B=a.call(x);return(B===c||B===h||B===l||B===o)&&x("")==null}catch{}return!1})}return Rn=e?function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{e(x,null,t)}catch(B){if(B!==i)return!1}return!r(x)&&s(x)}:function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(b)return s(x);if(r(x))return!1;var B=a.call(x);return B!==f&&B!==n&&!/^\[object HTML/.test(B)?!1:s(x)},Rn}var In,Ko;function O0(){if(Ko)return In;Ko=1;var d=A0(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,i=function(o,f,n){for(var c=0,h=o.length;c<h;c++)t.call(o,c)&&(n==null?f(o[c],c,o):f.call(n,o[c],c,o))},u=function(o,f,n){for(var c=0,h=o.length;c<h;c++)n==null?f(o.charAt(c),c,o):f.call(n,o.charAt(c),c,o)},r=function(o,f,n){for(var c in o)t.call(o,c)&&(n==null?f(o[c],c,o):f.call(n,o[c],c,o))},s=function(o,f,n){if(!d(f))throw new TypeError("iterator must be a function");var c;arguments.length>=3&&(c=n),e.call(o)==="[object Array]"?i(o,f,c):typeof o=="string"?u(o,f,c):r(o,f,c)};return In=s,In}var An,jo;function P0(){return jo||(jo=1,An=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),An}var On,zo;function k0(){if(zo)return On;zo=1;var d=P0(),e=typeof globalThis>"u"?Ie:globalThis;return On=function(){for(var i=[],u=0;u<d.length;u++)typeof e[d[u]]=="function"&&(i[i.length]=d[u]);return i},On}var Pn={exports:{}},kn,Vo;function N0(){if(Vo)return kn;Vo=1;var d=jr(),e=zh(),t=sr(),i=or();return kn=function(r,s,a){if(!r||typeof r!="object"&&typeof r!="function")throw new t("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="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 o=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!i&&i(r,s);if(d)d(r,s,{configurable:n===null&&h?h.configurable:!n,enumerable:o===null&&h?h.enumerable:!o,value:a,writable:f===null&&h?h.writable:!f});else if(c||!o&&!f&&!n)r[s]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},kn}var Nn,Go;function M0(){if(Go)return Nn;Go=1;var d=jr(),e=function(){return!!d};return e.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},Nn=e,Nn}var Mn,$o;function C0(){if($o)return Mn;$o=1;var d=Yh(),e=N0(),t=M0()(),i=or(),u=sr(),r=d("%Math.floor%");return Mn=function(a,o){if(typeof a!="function")throw new u("`fn` is not a function");if(typeof o!="number"||o<0||o>4294967295||r(o)!==o)throw new u("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in a&&i){var h=i(a,"length");h&&!h.configurable&&(n=!1),h&&!h.writable&&(c=!1)}return(n||c||!f)&&(t?e(a,"length",o,!0,!0):e(a,"length",o)),a},Mn}var Cn,Wo;function T0(){if(Wo)return Cn;Wo=1;var d=cr(),e=os(),t=Wh();return Cn=function(){return t(d,e,arguments)},Cn}var Yo;function L0(){return Yo||(Yo=1,(function(d){var e=C0(),t=jr(),i=cs(),u=T0();d.exports=function(s){var a=i(arguments),o=s.length-(arguments.length-1);return e(a,1+(o>0?o:0),!0)},t?t(d.exports,"apply",{value:u}):d.exports.apply=u})(Pn)),Pn.exports}var Tn,Jo;function D0(){if(Jo)return Tn;Jo=1;var d=Vh();return Tn=function(){return d()&&!!Symbol.toStringTag},Tn}var Ln,Xo;function F0(){if(Xo)return Ln;Xo=1;var d=O0(),e=k0(),t=L0(),i=Jh(),u=or(),r=i("Object.prototype.toString"),s=D0()(),a=typeof globalThis>"u"?Ie:globalThis,o=e(),f=i("String.prototype.slice"),n=Object.getPrototypeOf,c=i("Array.prototype.indexOf",!0)||function(y,v){for(var g=0;g<y.length;g+=1)if(y[g]===v)return g;return-1},h={__proto__:null};s&&u&&n?d(o,function(p){var y=new a[p];if(Symbol.toStringTag in y){var v=n(y),g=u(v,Symbol.toStringTag);if(!g){var x=n(v);g=u(x,Symbol.toStringTag)}h["$"+p]=t(g.get)}}):d(o,function(p){var y=new a[p],v=y.slice||y.set;v&&(h["$"+p]=t(v))});var l=function(y){var v=!1;return d(h,function(g,x){if(!v)try{"$"+g(y)===x&&(v=f(x,1))}catch{}}),v},b=function(y){var v=!1;return d(h,function(g,x){if(!v)try{g(y),v=f(x,1)}catch{}}),v};return Ln=function(y){if(!y||typeof y!="object")return!1;if(!s){var v=f(r(y),8,-1);return c(o,v)>-1?v:v!=="Object"?!1:b(y)}return u?l(y):null},Ln}var Dn,Qo;function q0(){if(Qo)return Dn;Qo=1;var d=F0();return Dn=function(t){return!!d(t)},Dn}var Fn,Zo;function U0(){if(Zo)return Fn;Zo=1;var d=sr(),e=Jh(),t=e("TypedArray.prototype.buffer",!0),i=q0();return Fn=t||function(r){if(!i(r))throw new d("Not a Typed Array");return r.buffer},Fn}var qn,ec;function zr(){if(ec)return qn;ec=1;var d=_e().Buffer,e=s0(),t=U0(),i=ArrayBuffer.isView||function(o){try{return t(o),!0}catch{return!1}},u=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s=r&&(d.prototype instanceof Uint8Array||d.TYPED_ARRAY_SUPPORT);return qn=function(o,f){if(d.isBuffer(o))return o.constructor&&!("isBuffer"in o)?d.from(o):o;if(typeof o=="string")return d.from(o,f);if(r&&i(o)){if(o.byteLength===0)return d.alloc(0);if(s){var n=d.from(o.buffer,o.byteOffset,o.byteLength);if(n.byteLength===o.byteLength)return n}var c=o instanceof Uint8Array?o:new Uint8Array(o.buffer,o.byteOffset,o.byteLength),h=d.from(c);if(h.length===o.byteLength)return h}if(u&&o instanceof Uint8Array)return d.from(o);var l=e(o);if(l)for(var b=0;b<o.length;b+=1){var p=o[b];if(typeof p!="number"||p<0||p>255||~~p!==p)throw new RangeError("Array items must be numbers in the range 0-255.")}if(l||d.isBuffer(o)&&o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o))return d.from(o);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},qn}var Un,tc;function H0(){if(tc)return Un;tc=1;var d=_e().Buffer,e=zr(),t=typeof Uint8Array<"u",i=t&&typeof ArrayBuffer<"u",u=i&&ArrayBuffer.isView;return Un=function(r,s){if(typeof r=="string"||d.isBuffer(r)||t&&r instanceof Uint8Array||u&&u(r))return e(r,s);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},Un}var Br={exports:{}},Rr={exports:{}},rc;function Vr(){if(rc)return Rr.exports;rc=1,typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Rr.exports={nextTick:d}:Rr.exports=process;function d(e,t,i,u){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,s,a;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,i)});case 4:return process.nextTick(function(){e.call(null,t,i,u)});default:for(s=new Array(r-1),a=0;a<s.length;)s[a++]=arguments[a];return process.nextTick(function(){e.apply(null,s)})}}return Rr.exports}var Hn,ic;function K0(){if(ic)return Hn;ic=1;var d={}.toString;return Hn=Array.isArray||function(e){return d.call(e)=="[object Array]"},Hn}var Kn,nc;function Xh(){return nc||(nc=1,Kn=fr().EventEmitter),Kn}var Ir={exports:{}},ac;function Gr(){return ac||(ac=1,(function(d,e){var t=xt(),i=t.Buffer;function u(s,a){for(var o in s)a[o]=s[o]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?d.exports=t:(u(t,e),e.Buffer=r);function r(s,a,o){return i(s,a,o)}u(i,r),r.from=function(s,a,o){if(typeof s=="number")throw new TypeError("Argument must not be a number");return i(s,a,o)},r.alloc=function(s,a,o){if(typeof s!="number")throw new TypeError("Argument must be a number");var f=i(s);return a!==void 0?typeof o=="string"?f.fill(a,o):f.fill(a):f.fill(0),f},r.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return i(s)},r.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(s)}})(Ir,Ir.exports)),Ir.exports}var ot={},fc;function ur(){if(fc)return ot;fc=1;function d(p){return Array.isArray?Array.isArray(p):b(p)==="[object Array]"}ot.isArray=d;function e(p){return typeof p=="boolean"}ot.isBoolean=e;function t(p){return p===null}ot.isNull=t;function i(p){return p==null}ot.isNullOrUndefined=i;function u(p){return typeof p=="number"}ot.isNumber=u;function r(p){return typeof p=="string"}ot.isString=r;function s(p){return typeof p=="symbol"}ot.isSymbol=s;function a(p){return p===void 0}ot.isUndefined=a;function o(p){return b(p)==="[object RegExp]"}ot.isRegExp=o;function f(p){return typeof p=="object"&&p!==null}ot.isObject=f;function n(p){return b(p)==="[object Date]"}ot.isDate=n;function c(p){return b(p)==="[object Error]"||p instanceof Error}ot.isError=c;function h(p){return typeof p=="function"}ot.isFunction=h;function l(p){return p===null||typeof p=="boolean"||typeof p=="number"||typeof p=="string"||typeof p=="symbol"||typeof p>"u"}ot.isPrimitive=l,ot.isBuffer=xt().Buffer.isBuffer;function b(p){return Object.prototype.toString.call(p)}return ot}var jn={exports:{}},sc;function j0(){return sc||(sc=1,(function(d){function e(r,s){if(!(r instanceof s))throw new TypeError("Cannot call a class as a function")}var t=Gr().Buffer,i=$t;function u(r,s,a){r.copy(s,a)}d.exports=(function(){function r(){e(this,r),this.head=null,this.tail=null,this.length=0}return r.prototype.push=function(a){var o={data:a,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length},r.prototype.unshift=function(a){var o={data:a,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length},r.prototype.shift=function(){if(this.length!==0){var a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(a){if(this.length===0)return"";for(var o=this.head,f=""+o.data;o=o.next;)f+=a+o.data;return f},r.prototype.concat=function(a){if(this.length===0)return t.alloc(0);for(var o=t.allocUnsafe(a>>>0),f=this.head,n=0;f;)u(f.data,o,n),n+=f.data.length,f=f.next;return o},r})(),i&&i.inspect&&i.inspect.custom&&(d.exports.prototype[i.inspect.custom]=function(){var r=i.inspect({length:this.length});return this.constructor.name+" "+r})})(jn)),jn.exports}var zn,oc;function Qh(){if(oc)return zn;oc=1;var d=Vr();function e(u,r){var s=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(r?r(u):u&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,d.nextTick(i,this,u)):d.nextTick(i,this,u)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(f){!r&&f?s._writableState?s._writableState.errorEmitted||(s._writableState.errorEmitted=!0,d.nextTick(i,s,f)):d.nextTick(i,s,f):r&&r(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 i(u,r){u.emit("error",r)}return zn={destroy:e,undestroy:t},zn}var Vn,cc;function Zh(){if(cc)return Vn;cc=1;var d=Vr();Vn=p;function e(R){var A=this;this.next=null,this.entry=null,this.finish=function(){O(A,R)}}var t=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:d.nextTick,i;p.WritableState=l;var u=Object.create(ur());u.inherits=pe();var r={deprecate:Fh()},s=Xh(),a=Gr().Buffer,o=(typeof Ie<"u"?Ie:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(R){return a.from(R)}function n(R){return a.isBuffer(R)||R instanceof o}var c=Qh();u.inherits(p,s);function h(){}function l(R,A){i=i||zt(),R=R||{};var F=A instanceof i;this.objectMode=!!R.objectMode,F&&(this.objectMode=this.objectMode||!!R.writableObjectMode);var K=R.highWaterMark,L=R.writableHighWaterMark,_=this.objectMode?16:16*1024;K||K===0?this.highWaterMark=K:F&&(L||L===0)?this.highWaterMark=L:this.highWaterMark=_,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 U=R.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(fe){j(A,fe)},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)}l.prototype.getBuffer=function(){for(var A=this.bufferedRequest,F=[];A;)F.push(A),A=A.next;return F},(function(){try{Object.defineProperty(l.prototype,"buffer",{get:r.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(p,Symbol.hasInstance,{value:function(R){return b.call(this,R)?!0:this!==p?!1:R&&R._writableState instanceof l}})):b=function(R){return R instanceof this};function p(R){if(i=i||zt(),!b.call(p,this)&&!(this instanceof i))return new p(R);this._writableState=new l(R,this),this.writable=!0,R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final)),s.call(this)}p.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function y(R,A){var F=new Error("write after end");R.emit("error",F),d.nextTick(A,F)}function v(R,A,F,K){var L=!0,_=!1;return F===null?_=new TypeError("May not write null values to stream"):typeof F!="string"&&F!==void 0&&!A.objectMode&&(_=new TypeError("Invalid non-string/buffer chunk")),_&&(R.emit("error",_),d.nextTick(K,_),L=!1),L}p.prototype.write=function(R,A,F){var K=this._writableState,L=!1,_=!K.objectMode&&n(R);return _&&!a.isBuffer(R)&&(R=f(R)),typeof A=="function"&&(F=A,A=null),_?A="buffer":A||(A=K.defaultEncoding),typeof F!="function"&&(F=h),K.ended?y(this,F):(_||v(this,K,R,F))&&(K.pendingcb++,L=x(this,K,_,R,A,F)),L},p.prototype.cork=function(){var R=this._writableState;R.corked++},p.prototype.uncork=function(){var R=this._writableState;R.corked&&(R.corked--,!R.writing&&!R.corked&&!R.bufferProcessing&&R.bufferedRequest&&te(this,R))},p.prototype.setDefaultEncoding=function(A){if(typeof A=="string"&&(A=A.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((A+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+A);return this._writableState.defaultEncoding=A,this};function g(R,A,F){return!R.objectMode&&R.decodeStrings!==!1&&typeof A=="string"&&(A=a.from(A,F)),A}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function x(R,A,F,K,L,_){if(!F){var U=g(A,K,L);K!==U&&(F=!0,L="buffer",K=U)}var fe=A.objectMode?1:K.length;A.length+=fe;var se=A.length<A.highWaterMark;if(se||(A.needDrain=!0),A.writing||A.corked){var V=A.lastBufferedRequest;A.lastBufferedRequest={chunk:K,encoding:L,isBuf:F,callback:_,next:null},V?V.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else B(R,A,!1,fe,K,L,_);return se}function B(R,A,F,K,L,_,U){A.writelen=K,A.writecb=U,A.writing=!0,A.sync=!0,F?R._writev(L,A.onwrite):R._write(L,_,A.onwrite),A.sync=!1}function I(R,A,F,K,L){--A.pendingcb,F?(d.nextTick(L,K),d.nextTick(m,R,A),R._writableState.errorEmitted=!0,R.emit("error",K)):(L(K),R._writableState.errorEmitted=!0,R.emit("error",K),m(R,A))}function T(R){R.writing=!1,R.writecb=null,R.length-=R.writelen,R.writelen=0}function j(R,A){var F=R._writableState,K=F.sync,L=F.writecb;if(T(F),A)I(R,F,K,A,L);else{var _=ne(F);!_&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&te(R,F),K?t(G,R,F,_,L):G(R,F,_,L)}}function G(R,A,F,K){F||z(R,A),A.pendingcb--,K(),m(R,A)}function z(R,A){A.length===0&&A.needDrain&&(A.needDrain=!1,R.emit("drain"))}function te(R,A){A.bufferProcessing=!0;var F=A.bufferedRequest;if(R._writev&&F&&F.next){var K=A.bufferedRequestCount,L=new Array(K),_=A.corkedRequestsFree;_.entry=F;for(var U=0,fe=!0;F;)L[U]=F,F.isBuf||(fe=!1),F=F.next,U+=1;L.allBuffers=fe,B(R,A,!0,A.length,L,"",_.finish),A.pendingcb++,A.lastBufferedRequest=null,_.next?(A.corkedRequestsFree=_.next,_.next=null):A.corkedRequestsFree=new e(A),A.bufferedRequestCount=0}else{for(;F;){var se=F.chunk,V=F.encoding,P=F.callback,M=A.objectMode?1:se.length;if(B(R,A,!1,M,se,V,P),F=F.next,A.bufferedRequestCount--,A.writing)break}F===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=F,A.bufferProcessing=!1}p.prototype._write=function(R,A,F){F(new Error("_write() is not implemented"))},p.prototype._writev=null,p.prototype.end=function(R,A,F){var K=this._writableState;typeof R=="function"?(F=R,R=null,A=null):typeof A=="function"&&(F=A,A=null),R!=null&&this.write(R,A),K.corked&&(K.corked=1,this.uncork()),K.ending||E(this,K,F)};function ne(R){return R.ending&&R.length===0&&R.bufferedRequest===null&&!R.finished&&!R.writing}function $(R,A){R._final(function(F){A.pendingcb--,F&&R.emit("error",F),A.prefinished=!0,R.emit("prefinish"),m(R,A)})}function k(R,A){!A.prefinished&&!A.finalCalled&&(typeof R._final=="function"?(A.pendingcb++,A.finalCalled=!0,d.nextTick($,R,A)):(A.prefinished=!0,R.emit("prefinish")))}function m(R,A){var F=ne(A);return F&&(k(R,A),A.pendingcb===0&&(A.finished=!0,R.emit("finish"))),F}function E(R,A,F){A.ending=!0,m(R,A),F&&(A.finished?d.nextTick(F):R.once("finish",F)),A.ended=!0,R.writable=!1}function O(R,A,F){var K=R.entry;for(R.entry=null;K;){var L=K.callback;A.pendingcb--,L(F),K=K.next}A.corkedRequestsFree.next=R}return Object.defineProperty(p.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(R){this._writableState&&(this._writableState.destroyed=R)}}),p.prototype.destroy=c.destroy,p.prototype._undestroy=c.undestroy,p.prototype._destroy=function(R,A){this.end(),A(R)},Vn}var Gn,uc;function zt(){if(uc)return Gn;uc=1;var d=Vr(),e=Object.keys||function(c){var h=[];for(var l in c)h.push(l);return h};Gn=o;var t=Object.create(ur());t.inherits=pe();var i=ed(),u=Zh();t.inherits(o,i);for(var r=e(u.prototype),s=0;s<r.length;s++){var a=r[s];o.prototype[a]||(o.prototype[a]=u.prototype[a])}function o(c){if(!(this instanceof o))return new o(c);i.call(this,c),u.call(this,c),c&&c.readable===!1&&(this.readable=!1),c&&c.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,c&&c.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",f)}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function f(){this.allowHalfOpen||this._writableState.ended||d.nextTick(n,this)}function n(c){c.end()}return Object.defineProperty(o.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),o.prototype._destroy=function(c,h){this.push(null),this.end(),d.nextTick(h,c)},Gn}var $n={},hc;function dc(){if(hc)return $n;hc=1;var d=Gr().Buffer,e=d.isEncoding||function(v){switch(v=""+v,v&&v.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(v){if(!v)return"utf8";for(var g;;)switch(v){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 v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function i(v){var g=t(v);if(typeof g!="string"&&(d.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return g||v}$n.StringDecoder=u;function u(v){this.encoding=i(v);var g;switch(this.encoding){case"utf16le":this.text=c,this.end=h,g=4;break;case"utf8":this.fillLast=o,g=4;break;case"base64":this.text=l,this.end=b,g=3;break;default:this.write=p,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=d.allocUnsafe(g)}u.prototype.write=function(v){if(v.length===0)return"";var g,x;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<v.length?g?g+this.text(v,x):this.text(v,x):g||""},u.prototype.end=n,u.prototype.text=f,u.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function r(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,g,x){var B=g.length-1;if(B<x)return 0;var I=r(g[B]);return I>=0?(I>0&&(v.lastNeed=I-1),I):--B<x||I===-2?0:(I=r(g[B]),I>=0?(I>0&&(v.lastNeed=I-2),I):--B<x||I===-2?0:(I=r(g[B]),I>=0?(I>0&&(I===2?I=0:v.lastNeed=I-3),I):0))}function a(v,g,x){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return v.lastNeed=2,"�"}}function o(v){var g=this.lastTotal-this.lastNeed,x=a(this,v);if(x!==void 0)return x;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function f(v,g){var x=s(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=x;var B=v.length-(x-this.lastNeed);return v.copy(this.lastChar,0,B),v.toString("utf8",g,B)}function n(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+"�":g}function c(v,g){if((v.length-g)%2===0){var x=v.toString("utf16le",g);if(x){var B=x.charCodeAt(x.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function h(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,x)}return g}function l(v,g){var x=(v.length-g)%3;return x===0?v.toString("base64",g):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",g,v.length-x))}function b(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function p(v){return v.toString(this.encoding)}function y(v){return v&&v.length?this.write(v):""}return $n}var Wn,lc;function ed(){if(lc)return Wn;lc=1;var d=Vr();Wn=g;var e=K0(),t;g.ReadableState=v,fr().EventEmitter;var i=function(P,M){return P.listeners(M).length},u=Xh(),r=Gr().Buffer,s=(typeof Ie<"u"?Ie:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(P){return r.from(P)}function o(P){return r.isBuffer(P)||P instanceof s}var f=Object.create(ur());f.inherits=pe();var n=$t,c=void 0;n&&n.debuglog?c=n.debuglog("stream"):c=function(){};var h=j0(),l=Qh(),b;f.inherits(g,u);var p=["error","close","destroy","pause","resume"];function y(P,M,Y){if(typeof P.prependListener=="function")return P.prependListener(M,Y);!P._events||!P._events[M]?P.on(M,Y):e(P._events[M])?P._events[M].unshift(Y):P._events[M]=[Y,P._events[M]]}function v(P,M){t=t||zt(),P=P||{};var Y=M instanceof t;this.objectMode=!!P.objectMode,Y&&(this.objectMode=this.objectMode||!!P.readableObjectMode);var Q=P.highWaterMark,D=P.readableHighWaterMark,C=this.objectMode?16:16*1024;Q||Q===0?this.highWaterMark=Q:Y&&(D||D===0)?this.highWaterMark=D:this.highWaterMark=C,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,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=P.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,P.encoding&&(b||(b=dc().StringDecoder),this.decoder=new b(P.encoding),this.encoding=P.encoding)}function g(P){if(t=t||zt(),!(this instanceof g))return new g(P);this._readableState=new v(P,this),this.readable=!0,P&&(typeof P.read=="function"&&(this._read=P.read),typeof P.destroy=="function"&&(this._destroy=P.destroy)),u.call(this)}Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(P){this._readableState&&(this._readableState.destroyed=P)}}),g.prototype.destroy=l.destroy,g.prototype._undestroy=l.undestroy,g.prototype._destroy=function(P,M){this.push(null),M(P)},g.prototype.push=function(P,M){var Y=this._readableState,Q;return Y.objectMode?Q=!0:typeof P=="string"&&(M=M||Y.defaultEncoding,M!==Y.encoding&&(P=r.from(P,M),M=""),Q=!0),x(this,P,M,!1,Q)},g.prototype.unshift=function(P){return x(this,P,null,!0,!1)};function x(P,M,Y,Q,D){var C=P._readableState;if(M===null)C.reading=!1,te(P,C);else{var J;D||(J=I(C,M)),J?P.emit("error",J):C.objectMode||M&&M.length>0?(typeof M!="string"&&!C.objectMode&&Object.getPrototypeOf(M)!==r.prototype&&(M=a(M)),Q?C.endEmitted?P.emit("error",new Error("stream.unshift() after end event")):B(P,C,M,!0):C.ended?P.emit("error",new Error("stream.push() after EOF")):(C.reading=!1,C.decoder&&!Y?(M=C.decoder.write(M),C.objectMode||M.length!==0?B(P,C,M,!1):k(P,C)):B(P,C,M,!1))):Q||(C.reading=!1)}return T(C)}function B(P,M,Y,Q){M.flowing&&M.length===0&&!M.sync?(P.emit("data",Y),P.read(0)):(M.length+=M.objectMode?1:Y.length,Q?M.buffer.unshift(Y):M.buffer.push(Y),M.needReadable&&ne(P)),k(P,M)}function I(P,M){var Y;return!o(M)&&typeof M!="string"&&M!==void 0&&!P.objectMode&&(Y=new TypeError("Invalid non-string/buffer chunk")),Y}function T(P){return!P.ended&&(P.needReadable||P.length<P.highWaterMark||P.length===0)}g.prototype.isPaused=function(){return this._readableState.flowing===!1},g.prototype.setEncoding=function(P){return b||(b=dc().StringDecoder),this._readableState.decoder=new b(P),this._readableState.encoding=P,this};var j=8388608;function G(P){return P>=j?P=j:(P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++),P}function z(P,M){return P<=0||M.length===0&&M.ended?0:M.objectMode?1:P!==P?M.flowing&&M.length?M.buffer.head.data.length:M.length:(P>M.highWaterMark&&(M.highWaterMark=G(P)),P<=M.length?P:M.ended?M.length:(M.needReadable=!0,0))}g.prototype.read=function(P){c("read",P),P=parseInt(P,10);var M=this._readableState,Y=P;if(P!==0&&(M.emittedReadable=!1),P===0&&M.needReadable&&(M.length>=M.highWaterMark||M.ended))return c("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?fe(this):ne(this),null;if(P=z(P,M),P===0&&M.ended)return M.length===0&&fe(this),null;var Q=M.needReadable;c("need readable",Q),(M.length===0||M.length-P<M.highWaterMark)&&(Q=!0,c("length less than watermark",Q)),M.ended||M.reading?(Q=!1,c("reading or ended",Q)):Q&&(c("do read"),M.reading=!0,M.sync=!0,M.length===0&&(M.needReadable=!0),this._read(M.highWaterMark),M.sync=!1,M.reading||(P=z(Y,M)));var D;return P>0?D=K(P,M):D=null,D===null?(M.needReadable=!0,P=0):M.length-=P,M.length===0&&(M.ended||(M.needReadable=!0),Y!==P&&M.ended&&fe(this)),D!==null&&this.emit("data",D),D};function te(P,M){if(!M.ended){if(M.decoder){var Y=M.decoder.end();Y&&Y.length&&(M.buffer.push(Y),M.length+=M.objectMode?1:Y.length)}M.ended=!0,ne(P)}}function ne(P){var M=P._readableState;M.needReadable=!1,M.emittedReadable||(c("emitReadable",M.flowing),M.emittedReadable=!0,M.sync?d.nextTick($,P):$(P))}function $(P){c("emit readable"),P.emit("readable"),F(P)}function k(P,M){M.readingMore||(M.readingMore=!0,d.nextTick(m,P,M))}function m(P,M){for(var Y=M.length;!M.reading&&!M.flowing&&!M.ended&&M.length<M.highWaterMark&&(c("maybeReadMore read 0"),P.read(0),Y!==M.length);)Y=M.length;M.readingMore=!1}g.prototype._read=function(P){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(P,M){var Y=this,Q=this._readableState;switch(Q.pipesCount){case 0:Q.pipes=P;break;case 1:Q.pipes=[Q.pipes,P];break;default:Q.pipes.push(P);break}Q.pipesCount+=1,c("pipe count=%d opts=%j",Q.pipesCount,M);var D=(!M||M.end!==!1)&&P!==process.stdout&&P!==process.stderr,C=D?ie:ve;Q.endEmitted?d.nextTick(C):Y.once("end",C),P.on("unpipe",J);function J(me,Le){c("onunpipe"),me===Y&&Le&&Le.hasUnpiped===!1&&(Le.hasUnpiped=!0,ue())}function ie(){c("onend"),P.end()}var he=E(Y);P.on("drain",he);var oe=!1;function ue(){c("cleanup"),P.removeListener("close",de),P.removeListener("finish",Re),P.removeListener("drain",he),P.removeListener("error",Se),P.removeListener("unpipe",J),Y.removeListener("end",ie),Y.removeListener("end",ve),Y.removeListener("data",Ke),oe=!0,Q.awaitDrain&&(!P._writableState||P._writableState.needDrain)&&he()}var ge=!1;Y.on("data",Ke);function Ke(me){c("ondata"),ge=!1;var Le=P.write(me);Le===!1&&!ge&&((Q.pipesCount===1&&Q.pipes===P||Q.pipesCount>1&&V(Q.pipes,P)!==-1)&&!oe&&(c("false write response, pause",Q.awaitDrain),Q.awaitDrain++,ge=!0),Y.pause())}function Se(me){c("onerror",me),ve(),P.removeListener("error",Se),i(P,"error")===0&&P.emit("error",me)}y(P,"error",Se);function de(){P.removeListener("finish",Re),ve()}P.once("close",de);function Re(){c("onfinish"),P.removeListener("close",de),ve()}P.once("finish",Re);function ve(){c("unpipe"),Y.unpipe(P)}return P.emit("pipe",Y),Q.flowing||(c("pipe resume"),Y.resume()),P};function E(P){return function(){var M=P._readableState;c("pipeOnDrain",M.awaitDrain),M.awaitDrain&&M.awaitDrain--,M.awaitDrain===0&&i(P,"data")&&(M.flowing=!0,F(P))}}g.prototype.unpipe=function(P){var M=this._readableState,Y={hasUnpiped:!1};if(M.pipesCount===0)return this;if(M.pipesCount===1)return P&&P!==M.pipes?this:(P||(P=M.pipes),M.pipes=null,M.pipesCount=0,M.flowing=!1,P&&P.emit("unpipe",this,Y),this);if(!P){var Q=M.pipes,D=M.pipesCount;M.pipes=null,M.pipesCount=0,M.flowing=!1;for(var C=0;C<D;C++)Q[C].emit("unpipe",this,{hasUnpiped:!1});return this}var J=V(M.pipes,P);return J===-1?this:(M.pipes.splice(J,1),M.pipesCount-=1,M.pipesCount===1&&(M.pipes=M.pipes[0]),P.emit("unpipe",this,Y),this)},g.prototype.on=function(P,M){var Y=u.prototype.on.call(this,P,M);if(P==="data")this._readableState.flowing!==!1&&this.resume();else if(P==="readable"){var Q=this._readableState;!Q.endEmitted&&!Q.readableListening&&(Q.readableListening=Q.needReadable=!0,Q.emittedReadable=!1,Q.reading?Q.length&&ne(this):d.nextTick(O,this))}return Y},g.prototype.addListener=g.prototype.on;function O(P){c("readable nexttick read 0"),P.read(0)}g.prototype.resume=function(){var P=this._readableState;return P.flowing||(c("resume"),P.flowing=!0,R(this,P)),this};function R(P,M){M.resumeScheduled||(M.resumeScheduled=!0,d.nextTick(A,P,M))}function A(P,M){M.reading||(c("resume read 0"),P.read(0)),M.resumeScheduled=!1,M.awaitDrain=0,P.emit("resume"),F(P),M.flowing&&!M.reading&&P.read(0)}g.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function F(P){var M=P._readableState;for(c("flow",M.flowing);M.flowing&&P.read()!==null;);}g.prototype.wrap=function(P){var M=this,Y=this._readableState,Q=!1;P.on("end",function(){if(c("wrapped end"),Y.decoder&&!Y.ended){var J=Y.decoder.end();J&&J.length&&M.push(J)}M.push(null)}),P.on("data",function(J){if(c("wrapped data"),Y.decoder&&(J=Y.decoder.write(J)),!(Y.objectMode&&J==null)&&!(!Y.objectMode&&(!J||!J.length))){var ie=M.push(J);ie||(Q=!0,P.pause())}});for(var D in P)this[D]===void 0&&typeof P[D]=="function"&&(this[D]=(function(J){return function(){return P[J].apply(P,arguments)}})(D));for(var C=0;C<p.length;C++)P.on(p[C],this.emit.bind(this,p[C]));return this._read=function(J){c("wrapped _read",J),Q&&(Q=!1,P.resume())},this},Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),g._fromList=K;function K(P,M){if(M.length===0)return null;var Y;return M.objectMode?Y=M.buffer.shift():!P||P>=M.length?(M.decoder?Y=M.buffer.join(""):M.buffer.length===1?Y=M.buffer.head.data:Y=M.buffer.concat(M.length),M.buffer.clear()):Y=L(P,M.buffer,M.decoder),Y}function L(P,M,Y){var Q;return P<M.head.data.length?(Q=M.head.data.slice(0,P),M.head.data=M.head.data.slice(P)):P===M.head.data.length?Q=M.shift():Q=Y?_(P,M):U(P,M),Q}function _(P,M){var Y=M.head,Q=1,D=Y.data;for(P-=D.length;Y=Y.next;){var C=Y.data,J=P>C.length?C.length:P;if(J===C.length?D+=C:D+=C.slice(0,P),P-=J,P===0){J===C.length?(++Q,Y.next?M.head=Y.next:M.head=M.tail=null):(M.head=Y,Y.data=C.slice(J));break}++Q}return M.length-=Q,D}function U(P,M){var Y=r.allocUnsafe(P),Q=M.head,D=1;for(Q.data.copy(Y),P-=Q.data.length;Q=Q.next;){var C=Q.data,J=P>C.length?C.length:P;if(C.copy(Y,Y.length-P,0,J),P-=J,P===0){J===C.length?(++D,Q.next?M.head=Q.next:M.head=M.tail=null):(M.head=Q,Q.data=C.slice(J));break}++D}return M.length-=D,Y}function fe(P){var M=P._readableState;if(M.length>0)throw new Error('"endReadable()" called on non-empty stream');M.endEmitted||(M.ended=!0,d.nextTick(se,M,P))}function se(P,M){!P.endEmitted&&P.length===0&&(P.endEmitted=!0,M.readable=!1,M.emit("end"))}function V(P,M){for(var Y=0,Q=P.length;Y<Q;Y++)if(P[Y]===M)return Y;return-1}return Wn}var Yn,bc;function td(){if(bc)return Yn;bc=1,Yn=i;var d=zt(),e=Object.create(ur());e.inherits=pe(),e.inherits(i,d);function t(s,a){var o=this._transformState;o.transforming=!1;var f=o.writecb;if(!f)return this.emit("error",new Error("write callback called multiple times"));o.writechunk=null,o.writecb=null,a!=null&&this.push(a),f(s);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function i(s){if(!(this instanceof i))return new i(s);d.call(this,s),this._transformState={afterTransform:t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,s&&(typeof s.transform=="function"&&(this._transform=s.transform),typeof s.flush=="function"&&(this._flush=s.flush)),this.on("prefinish",u)}function u(){var s=this;typeof this._flush=="function"?this._flush(function(a,o){r(s,a,o)}):r(this,null,null)}i.prototype.push=function(s,a){return this._transformState.needTransform=!1,d.prototype.push.call(this,s,a)},i.prototype._transform=function(s,a,o){throw new Error("_transform() is not implemented")},i.prototype._write=function(s,a,o){var f=this._transformState;if(f.writecb=o,f.writechunk=s,f.writeencoding=a,!f.transforming){var n=this._readableState;(f.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},i.prototype._read=function(s){var a=this._transformState;a.writechunk!==null&&a.writecb&&!a.transforming?(a.transforming=!0,this._transform(a.writechunk,a.writeencoding,a.afterTransform)):a.needTransform=!0},i.prototype._destroy=function(s,a){var o=this;d.prototype._destroy.call(this,s,function(f){a(f),o.emit("close")})};function r(s,a,o){if(a)return s.emit("error",a);if(o!=null&&s.push(o),s._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(s._transformState.transforming)throw new Error("Calling transform done when still transforming");return s.push(null)}return Yn}var Jn,pc;function z0(){if(pc)return Jn;pc=1,Jn=t;var d=td(),e=Object.create(ur());e.inherits=pe(),e.inherits(t,d);function t(i){if(!(this instanceof t))return new t(i);d.call(this,i)}return t.prototype._transform=function(i,u,r){r(null,i)},Jn}var vc;function rd(){return vc||(vc=1,(function(d,e){e=d.exports=ed(),e.Stream=e,e.Readable=e,e.Writable=Zh(),e.Duplex=zt(),e.Transform=td(),e.PassThrough=z0()})(Br,Br.exports)),Br.exports}var Xn,mc;function V0(){if(mc)return Xn;mc=1;var d=_e().Buffer,e=H0(),t=rd().Transform,i=pe();function u(r){t.call(this),this._block=d.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return i(u,t),u.prototype._transform=function(r,s,a){var o=null;try{this.update(r,s)}catch(f){o=f}a(o)},u.prototype._flush=function(r){var s=null;try{this.push(this.digest())}catch(a){s=a}r(s)},u.prototype.update=function(r,s){if(this._finalized)throw new Error("Digest already called");for(var a=e(r,s),o=this._block,f=0;this._blockOffset+a.length-f>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)o[n]=a[f],n+=1,f+=1;this._update(),this._blockOffset=0}for(;f<a.length;)o[this._blockOffset]=a[f],this._blockOffset+=1,f+=1;for(var c=0,h=a.length*8;h>0;++c)this._length[c]+=h,h=this._length[c]/4294967296|0,h>0&&(this._length[c]-=4294967296*h);return this},u.prototype._update=function(){throw new Error("_update is not implemented")},u.prototype.digest=function(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var s=this._digest();r!==void 0&&(s=s.toString(r)),this._block.fill(0),this._blockOffset=0;for(var a=0;a<4;++a)this._length[a]=0;return s},u.prototype._digest=function(){throw new Error("_digest is not implemented")},Xn=u,Xn}var Qn,yc;function us(){if(yc)return Qn;yc=1;var d=xt().Buffer,e=pe(),t=V0(),i=new Array(16),u=[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],r=[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],s=[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],a=[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],o=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function n(v,g){return v<<g|v>>>32-g}function c(v,g,x,B,I,T,j,G){return n(v+(g^x^B)+T+j|0,G)+I|0}function h(v,g,x,B,I,T,j,G){return n(v+(g&x|~g&B)+T+j|0,G)+I|0}function l(v,g,x,B,I,T,j,G){return n(v+((g|~x)^B)+T+j|0,G)+I|0}function b(v,g,x,B,I,T,j,G){return n(v+(g&B|x&~B)+T+j|0,G)+I|0}function p(v,g,x,B,I,T,j,G){return n(v+(g^(x|~B))+T+j|0,G)+I|0}function y(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return e(y,t),y.prototype._update=function(){for(var v=i,g=0;g<16;++g)v[g]=this._block.readInt32LE(g*4);for(var x=this._a|0,B=this._b|0,I=this._c|0,T=this._d|0,j=this._e|0,G=this._a|0,z=this._b|0,te=this._c|0,ne=this._d|0,$=this._e|0,k=0;k<80;k+=1){var m,E;k<16?(m=c(x,B,I,T,j,v[u[k]],o[0],s[k]),E=p(G,z,te,ne,$,v[r[k]],f[0],a[k])):k<32?(m=h(x,B,I,T,j,v[u[k]],o[1],s[k]),E=b(G,z,te,ne,$,v[r[k]],f[1],a[k])):k<48?(m=l(x,B,I,T,j,v[u[k]],o[2],s[k]),E=l(G,z,te,ne,$,v[r[k]],f[2],a[k])):k<64?(m=b(x,B,I,T,j,v[u[k]],o[3],s[k]),E=h(G,z,te,ne,$,v[r[k]],f[3],a[k])):(m=p(x,B,I,T,j,v[u[k]],o[4],s[k]),E=c(G,z,te,ne,$,v[r[k]],f[4],a[k])),x=j,j=T,T=n(I,10),I=B,B=m,G=$,$=ne,ne=n(te,10),te=z,z=E}var O=this._b+I+ne|0;this._b=this._c+T+$|0,this._c=this._d+j+G|0,this._d=this._e+x+z|0,this._e=this._a+B+te|0,this._a=O},y.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 v=d.alloc?d.alloc(20):new d(20);return v.writeInt32LE(this._a,0),v.writeInt32LE(this._b,4),v.writeInt32LE(this._c,8),v.writeInt32LE(this._d,12),v.writeInt32LE(this._e,16),v},Qn=y,Qn}var Zn={exports:{}},ea,gc;function Yt(){if(gc)return ea;gc=1;var d=_e().Buffer,e=zr();function t(i,u){this._block=d.alloc(i),this._finalSize=u,this._blockSize=i,this._len=0}return t.prototype.update=function(i,u){i=e(i,u||"utf8");for(var r=this._block,s=this._blockSize,a=i.length,o=this._len,f=0;f<a;){for(var n=o%s,c=Math.min(a-f,s-n),h=0;h<c;h++)r[n+h]=i[f+h];o+=c,f+=c,o%s===0&&this._update(r)}return this._len+=a,this},t.prototype.digest=function(i){var u=this._len%this._blockSize;this._block[u]=128,this._block.fill(0,u+1),u>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var s=(r&4294967295)>>>0,a=(r-s)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(s,this._blockSize-4)}this._update(this._block);var o=this._hash();return i?o.toString(i):o},t.prototype._update=function(){throw new Error("_update must be implemented by subclass")},ea=t,ea}var ta,wc;function G0(){if(wc)return ta;wc=1;var d=pe(),e=Yt(),t=_e().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function r(){this.init(),this._w=u,e.call(this,64,56)}d(r,e),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function s(f){return f<<5|f>>>27}function a(f){return f<<30|f>>>2}function o(f,n,c,h){return f===0?n&c|~n&h:f===2?n&c|n&h|c&h:n^c^h}return r.prototype._update=function(f){for(var n=this._w,c=this._a|0,h=this._b|0,l=this._c|0,b=this._d|0,p=this._e|0,y=0;y<16;++y)n[y]=f.readInt32BE(y*4);for(;y<80;++y)n[y]=n[y-3]^n[y-8]^n[y-14]^n[y-16];for(var v=0;v<80;++v){var g=~~(v/20),x=s(c)+o(g,h,l,b)+p+n[v]+i[g]|0;p=b,b=l,l=a(h),h=c,c=x}this._a=c+this._a|0,this._b=h+this._b|0,this._c=l+this._c|0,this._d=b+this._d|0,this._e=p+this._e|0},r.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},ta=r,ta}var ra,_c;function $0(){if(_c)return ra;_c=1;var d=pe(),e=Yt(),t=_e().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function r(){this.init(),this._w=u,e.call(this,64,56)}d(r,e),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function s(n){return n<<1|n>>>31}function a(n){return n<<5|n>>>27}function o(n){return n<<30|n>>>2}function f(n,c,h,l){return n===0?c&h|~c&l:n===2?c&h|c&l|h&l:c^h^l}return r.prototype._update=function(n){for(var c=this._w,h=this._a|0,l=this._b|0,b=this._c|0,p=this._d|0,y=this._e|0,v=0;v<16;++v)c[v]=n.readInt32BE(v*4);for(;v<80;++v)c[v]=s(c[v-3]^c[v-8]^c[v-14]^c[v-16]);for(var g=0;g<80;++g){var x=~~(g/20),B=a(h)+f(x,l,b,p)+y+c[g]+i[x]|0;y=p,p=b,b=o(l),l=h,h=B}this._a=h+this._a|0,this._b=l+this._b|0,this._c=b+this._c|0,this._d=p+this._d|0,this._e=y+this._e|0},r.prototype._hash=function(){var n=t.allocUnsafe(20);return n.writeInt32BE(this._a|0,0),n.writeInt32BE(this._b|0,4),n.writeInt32BE(this._c|0,8),n.writeInt32BE(this._d|0,12),n.writeInt32BE(this._e|0,16),n},ra=r,ra}var ia,Sc;function id(){if(Sc)return ia;Sc=1;var d=pe(),e=Yt(),t=_e().Buffer,i=[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],u=new Array(64);function r(){this.init(),this._w=u,e.call(this,64,56)}d(r,e),r.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 s(h,l,b){return b^h&(l^b)}function a(h,l,b){return h&l|b&(h|l)}function o(h){return(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10)}function f(h){return(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7)}function n(h){return(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3}function c(h){return(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10}return r.prototype._update=function(h){for(var l=this._w,b=this._a|0,p=this._b|0,y=this._c|0,v=this._d|0,g=this._e|0,x=this._f|0,B=this._g|0,I=this._h|0,T=0;T<16;++T)l[T]=h.readInt32BE(T*4);for(;T<64;++T)l[T]=c(l[T-2])+l[T-7]+n(l[T-15])+l[T-16]|0;for(var j=0;j<64;++j){var G=I+f(g)+s(g,x,B)+i[j]+l[j]|0,z=o(b)+a(b,p,y)|0;I=B,B=x,x=g,g=v+G|0,v=y,y=p,p=b,b=G+z|0}this._a=b+this._a|0,this._b=p+this._b|0,this._c=y+this._c|0,this._d=v+this._d|0,this._e=g+this._e|0,this._f=x+this._f|0,this._g=B+this._g|0,this._h=I+this._h|0},r.prototype._hash=function(){var h=t.allocUnsafe(32);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h.writeInt32BE(this._h,28),h},ia=r,ia}var na,xc;function W0(){if(xc)return na;xc=1;var d=pe(),e=id(),t=Yt(),i=_e().Buffer,u=new Array(64);function r(){this.init(),this._w=u,t.call(this,64,56)}return d(r,e),r.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},r.prototype._hash=function(){var s=i.allocUnsafe(28);return s.writeInt32BE(this._a,0),s.writeInt32BE(this._b,4),s.writeInt32BE(this._c,8),s.writeInt32BE(this._d,12),s.writeInt32BE(this._e,16),s.writeInt32BE(this._f,20),s.writeInt32BE(this._g,24),s},na=r,na}var aa,Ec;function nd(){if(Ec)return aa;Ec=1;var d=pe(),e=Yt(),t=_e().Buffer,i=[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],u=new Array(160);function r(){this.init(),this._w=u,e.call(this,128,112)}d(r,e),r.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 s(p,y,v){return v^p&(y^v)}function a(p,y,v){return p&y|v&(p|y)}function o(p,y){return(p>>>28|y<<4)^(y>>>2|p<<30)^(y>>>7|p<<25)}function f(p,y){return(p>>>14|y<<18)^(p>>>18|y<<14)^(y>>>9|p<<23)}function n(p,y){return(p>>>1|y<<31)^(p>>>8|y<<24)^p>>>7}function c(p,y){return(p>>>1|y<<31)^(p>>>8|y<<24)^(p>>>7|y<<25)}function h(p,y){return(p>>>19|y<<13)^(y>>>29|p<<3)^p>>>6}function l(p,y){return(p>>>19|y<<13)^(y>>>29|p<<3)^(p>>>6|y<<26)}function b(p,y){return p>>>0<y>>>0?1:0}return r.prototype._update=function(p){for(var y=this._w,v=this._ah|0,g=this._bh|0,x=this._ch|0,B=this._dh|0,I=this._eh|0,T=this._fh|0,j=this._gh|0,G=this._hh|0,z=this._al|0,te=this._bl|0,ne=this._cl|0,$=this._dl|0,k=this._el|0,m=this._fl|0,E=this._gl|0,O=this._hl|0,R=0;R<32;R+=2)y[R]=p.readInt32BE(R*4),y[R+1]=p.readInt32BE(R*4+4);for(;R<160;R+=2){var A=y[R-30],F=y[R-30+1],K=n(A,F),L=c(F,A);A=y[R-4],F=y[R-4+1];var _=h(A,F),U=l(F,A),fe=y[R-14],se=y[R-14+1],V=y[R-32],P=y[R-32+1],M=L+se|0,Y=K+fe+b(M,L)|0;M=M+U|0,Y=Y+_+b(M,U)|0,M=M+P|0,Y=Y+V+b(M,P)|0,y[R]=Y,y[R+1]=M}for(var Q=0;Q<160;Q+=2){Y=y[Q],M=y[Q+1];var D=a(v,g,x),C=a(z,te,ne),J=o(v,z),ie=o(z,v),he=f(I,k),oe=f(k,I),ue=i[Q],ge=i[Q+1],Ke=s(I,T,j),Se=s(k,m,E),de=O+oe|0,Re=G+he+b(de,O)|0;de=de+Se|0,Re=Re+Ke+b(de,Se)|0,de=de+ge|0,Re=Re+ue+b(de,ge)|0,de=de+M|0,Re=Re+Y+b(de,M)|0;var ve=ie+C|0,me=J+D+b(ve,ie)|0;G=j,O=E,j=T,E=m,T=I,m=k,k=$+de|0,I=B+Re+b(k,$)|0,B=x,$=ne,x=g,ne=te,g=v,te=z,z=de+ve|0,v=Re+me+b(z,de)|0}this._al=this._al+z|0,this._bl=this._bl+te|0,this._cl=this._cl+ne|0,this._dl=this._dl+$|0,this._el=this._el+k|0,this._fl=this._fl+m|0,this._gl=this._gl+E|0,this._hl=this._hl+O|0,this._ah=this._ah+v+b(this._al,z)|0,this._bh=this._bh+g+b(this._bl,te)|0,this._ch=this._ch+x+b(this._cl,ne)|0,this._dh=this._dh+B+b(this._dl,$)|0,this._eh=this._eh+I+b(this._el,k)|0,this._fh=this._fh+T+b(this._fl,m)|0,this._gh=this._gh+j+b(this._gl,E)|0,this._hh=this._hh+G+b(this._hl,O)|0},r.prototype._hash=function(){var p=t.allocUnsafe(64);function y(v,g,x){p.writeInt32BE(v,x),p.writeInt32BE(g,x+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),y(this._gh,this._gl,48),y(this._hh,this._hl,56),p},aa=r,aa}var fa,Bc;function Y0(){if(Bc)return fa;Bc=1;var d=pe(),e=nd(),t=Yt(),i=_e().Buffer,u=new Array(160);function r(){this.init(),this._w=u,t.call(this,128,112)}return d(r,e),r.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},r.prototype._hash=function(){var s=i.allocUnsafe(48);function a(o,f,n){s.writeInt32BE(o,n),s.writeInt32BE(f,n+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),s},fa=r,fa}var Rc;function hs(){return Rc||(Rc=1,(function(d){d.exports=function(t){var i=t.toLowerCase(),u=d.exports[i];if(!u)throw new Error(i+" is not supported (we accept pull requests)");return new u},d.exports.sha=G0(),d.exports.sha1=$0(),d.exports.sha224=W0(),d.exports.sha256=id(),d.exports.sha384=Y0(),d.exports.sha512=nd()})(Zn)),Zn.exports}var sa,Ic;function Pt(){if(Ic)return sa;Ic=1;var d=_e().Buffer,e=Kh().Transform,t=Yf().StringDecoder,i=pe(),u=zr();function r(s){e.call(this),this.hashMode=typeof s=="string",this.hashMode?this[s]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return i(r,e),r.prototype.update=function(s,a,o){var f=u(s,a),n=this._update(f);return this.hashMode?this:(o&&(n=this._toString(n,o)),n)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(s,a,o){var f;try{this.hashMode?this._update(s):this.push(this._update(s))}catch(n){f=n}finally{o(f)}},r.prototype._flush=function(s){var a;try{this.push(this.__final())}catch(o){a=o}s(a)},r.prototype._finalOrDigest=function(s){var a=this.__final()||d.alloc(0);return s&&(a=this._toString(a,s,!0)),a},r.prototype._toString=function(s,a,o){if(this._decoder||(this._decoder=new t(a),this._encoding=a),this._encoding!==a)throw new Error("can’t switch encodings");var f=this._decoder.write(s);return o&&(f+=this._decoder.end()),f},sa=r,sa}var oa,Ac;function hr(){if(Ac)return oa;Ac=1;var d=pe(),e=fs(),t=us(),i=hs(),u=Pt();function r(s){u.call(this,"digest"),this._hash=s}return d(r,u),r.prototype._update=function(s){this._hash.update(s)},r.prototype._final=function(){return this._hash.digest()},oa=function(a){return a=a.toLowerCase(),a==="md5"?new e:a==="rmd160"||a==="ripemd160"?new t:new r(i(a))},oa}var ca,Oc;function J0(){if(Oc)return ca;Oc=1;var d=pe(),e=_e().Buffer,t=Pt(),i=e.alloc(128),u=64;function r(s,a){t.call(this,"digest"),typeof a=="string"&&(a=e.from(a)),this._alg=s,this._key=a,a.length>u?a=s(a):a.length<u&&(a=e.concat([a,i],u));for(var o=this._ipad=e.allocUnsafe(u),f=this._opad=e.allocUnsafe(u),n=0;n<u;n++)o[n]=a[n]^54,f[n]=a[n]^92;this._hash=[o]}return d(r,t),r.prototype._update=function(s){this._hash.push(s)},r.prototype._final=function(){var s=this._alg(e.concat(this._hash));return this._alg(e.concat([this._opad,s]))},ca=r,ca}var ua,Pc;function ad(){if(Pc)return ua;Pc=1;var d=fs();return ua=function(e){return new d().update(e).digest()},ua}var ha,kc;function fd(){if(kc)return ha;kc=1;var d=pe(),e=J0(),t=Pt(),i=_e().Buffer,u=ad(),r=us(),s=hs(),a=i.alloc(128);function o(f,n){t.call(this,"digest"),typeof n=="string"&&(n=i.from(n));var c=f==="sha512"||f==="sha384"?128:64;if(this._alg=f,this._key=n,n.length>c){var h=f==="rmd160"?new r:s(f);n=h.update(n).digest()}else n.length<c&&(n=i.concat([n,a],c));for(var l=this._ipad=i.allocUnsafe(c),b=this._opad=i.allocUnsafe(c),p=0;p<c;p++)l[p]=n[p]^54,b[p]=n[p]^92;this._hash=f==="rmd160"?new r:s(f),this._hash.update(l)}return d(o,t),o.prototype._update=function(f){this._hash.update(f)},o.prototype._final=function(){var f=this._hash.digest(),n=this._alg==="rmd160"?new r:s(this._alg);return n.update(this._opad).update(f).digest()},ha=function(n,c){return n=n.toLowerCase(),n==="rmd160"||n==="ripemd160"?new o("rmd160",c):n==="md5"?new e(u,c):new o(n,c)},ha}const X0={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},Q0={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},Z0={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},el={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},tl={sign:"ecdsa",hash:"sha256",id:""},rl={sign:"ecdsa",hash:"sha224",id:""},il={sign:"ecdsa",hash:"sha384",id:""},nl={sign:"ecdsa",hash:"sha512",id:""},al={sign:"dsa",hash:"sha1",id:""},fl={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},sl={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},sd={sha224WithRSAEncryption:X0,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:Q0,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:Z0,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:el,"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:tl,sha224:rl,sha384:il,sha512:nl,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:al,"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:fl,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:sl,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var da,Nc;function ol(){return Nc||(Nc=1,da=sd),da}var Ar={},la,Mc;function od(){if(Mc)return la;Mc=1;var d=isFinite,e=Math.pow(2,30)-1;return la=function(t,i){if(typeof t!="number")throw new TypeError("Iterations not a number");if(t<0||!d(t))throw new TypeError("Bad iterations");if(typeof i!="number")throw new TypeError("Key length not a number");if(i<0||i>e||i!==i)throw new TypeError("Bad key length");return i+0},la}var ba,Cc;function cd(){if(Cc)return ba;Cc=1;var d;if(Ie.process&&Ie.process.browser)d="utf-8";else if(Ie.process&&Ie.process.version){var e=parseInt(process.version.split(".")[0].slice(1),10);d=e>=6?"utf-8":"binary"}else d="utf-8";return ba=d,ba}var pa,Tc;function ud(){if(Tc)return pa;Tc=1;var d=_e().Buffer,e=zr(),t=typeof Uint8Array<"u",i=t&&typeof ArrayBuffer<"u",u=i&&ArrayBuffer.isView;return pa=function(r,s,a){if(typeof r=="string"||d.isBuffer(r)||t&&r instanceof Uint8Array||u&&u(r))return e(r,s);throw new TypeError(a+" must be a string, a Buffer, a Uint8Array, or a DataView")},pa}var va,Lc;function hd(){if(Lc)return va;Lc=1;var d=ad(),e=us(),t=hs(),i=_e().Buffer,u=od(),r=cd(),s=ud(),a=i.alloc(128),o={__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 n(b){return new e().update(b).digest()}function c(b){function p(y){return t(b).update(y).digest()}return b==="rmd160"||b==="ripemd160"?n:b==="md5"?d:p}function h(b,p,y){var v=c(b),g=b==="sha512"||b==="sha384"?128:64;p.length>g?p=v(p):p.length<g&&(p=i.concat([p,a],g));for(var x=i.allocUnsafe(g+o[b]),B=i.allocUnsafe(g+o[b]),I=0;I<g;I++)x[I]=p[I]^54,B[I]=p[I]^92;var T=i.allocUnsafe(g+y+4);x.copy(T,0,0,g),this.ipad1=T,this.ipad2=x,this.opad=B,this.alg=b,this.blocksize=g,this.hash=v,this.size=o[b]}h.prototype.run=function(b,p){b.copy(p,this.blocksize);var y=this.hash(p);return y.copy(this.opad,this.blocksize),this.hash(this.opad)};function l(b,p,y,v,g){v=u(y,v),b=s(b,r,"Password"),p=s(p,r,"Salt");var x=(g||"sha1").toLowerCase(),B=f[x]||x,I=o[B];if(typeof I!="number"||!I)throw new TypeError("Digest algorithm not supported: "+g);var T=new h(B,b,p.length),j=i.allocUnsafe(v),G=i.allocUnsafe(p.length+4);p.copy(G,0,0,p.length);for(var z=0,te=I,ne=Math.ceil(v/te),$=1;$<=ne;$++){G.writeUInt32BE($,p.length);for(var k=T.run(G,T.ipad1),m=k,E=1;E<y;E++){m=T.run(m,T.ipad2);for(var O=0;O<te;O++)k[O]^=m[O]}k.copy(j,z),z+=te}return j}return va=l,va}var ma,Dc;function cl(){if(Dc)return ma;Dc=1;var d=_e().Buffer,e=od(),t=cd(),i=hd(),u=ud(),r,s=Ie.crypto&&Ie.crypto.subtle,a={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"},o=[],f;function n(){return f||(Ie.process&&Ie.process.nextTick?f=Ie.process.nextTick:Ie.queueMicrotask?f=Ie.queueMicrotask:Ie.setImmediate?f=Ie.setImmediate:f=Ie.setTimeout,f)}function c(b,p,y,v,g){return s.importKey("raw",b,{name:"PBKDF2"},!1,["deriveBits"]).then(function(x){return s.deriveBits({name:"PBKDF2",salt:p,iterations:y,hash:{name:g}},x,v<<3)}).then(function(x){return d.from(x)})}function h(b){if(Ie.process&&!Ie.process.browser||!s||!s.importKey||!s.deriveBits)return Promise.resolve(!1);if(o[b]!==void 0)return o[b];r=r||d.alloc(8);var p=c(r,r,10,128,b).then(function(){return!0},function(){return!1});return o[b]=p,p}function l(b,p){b.then(function(y){n()(function(){p(null,y)})},function(y){n()(function(){p(y)})})}return ma=function(b,p,y,v,g,x){if(typeof g=="function"&&(x=g,g=void 0),v=e(y,v),b=u(b,t,"Password"),p=u(p,t,"Salt"),typeof x!="function")throw new Error("No callback provided to pbkdf2");g=g||"sha1";var B=a[g.toLowerCase()];if(!B||typeof Ie.Promise!="function"){n()(function(){var I;try{I=i(b,p,y,v,g)}catch(T){x(T);return}x(null,I)});return}l(h(B).then(function(I){return I?c(b,p,y,v,B):i(b,p,y,v,g)}),x)},ma}var Fc;function ds(){return Fc||(Fc=1,Ar.pbkdf2=cl(),Ar.pbkdf2Sync=hd()),Ar}var bt={},Nt={},dt={},qc;function dd(){if(qc)return dt;qc=1,dt.readUInt32BE=function(u,r){var s=u[0+r]<<24|u[1+r]<<16|u[2+r]<<8|u[3+r];return s>>>0},dt.writeUInt32BE=function(u,r,s){u[0+s]=r>>>24,u[1+s]=r>>>16&255,u[2+s]=r>>>8&255,u[3+s]=r&255},dt.ip=function(u,r,s,a){for(var o=0,f=0,n=6;n>=0;n-=2){for(var c=0;c<=24;c+=8)o<<=1,o|=r>>>c+n&1;for(var c=0;c<=24;c+=8)o<<=1,o|=u>>>c+n&1}for(var n=6;n>=0;n-=2){for(var c=1;c<=25;c+=8)f<<=1,f|=r>>>c+n&1;for(var c=1;c<=25;c+=8)f<<=1,f|=u>>>c+n&1}s[a+0]=o>>>0,s[a+1]=f>>>0},dt.rip=function(u,r,s,a){for(var o=0,f=0,n=0;n<4;n++)for(var c=24;c>=0;c-=8)o<<=1,o|=r>>>c+n&1,o<<=1,o|=u>>>c+n&1;for(var n=4;n<8;n++)for(var c=24;c>=0;c-=8)f<<=1,f|=r>>>c+n&1,f<<=1,f|=u>>>c+n&1;s[a+0]=o>>>0,s[a+1]=f>>>0},dt.pc1=function(u,r,s,a){for(var o=0,f=0,n=7;n>=5;n--){for(var c=0;c<=24;c+=8)o<<=1,o|=r>>c+n&1;for(var c=0;c<=24;c+=8)o<<=1,o|=u>>c+n&1}for(var c=0;c<=24;c+=8)o<<=1,o|=r>>c+n&1;for(var n=1;n<=3;n++){for(var c=0;c<=24;c+=8)f<<=1,f|=r>>c+n&1;for(var c=0;c<=24;c+=8)f<<=1,f|=u>>c+n&1}for(var c=0;c<=24;c+=8)f<<=1,f|=u>>c+n&1;s[a+0]=o>>>0,s[a+1]=f>>>0},dt.r28shl=function(u,r){return u<<r&268435455|u>>>28-r};var d=[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];dt.pc2=function(u,r,s,a){for(var o=0,f=0,n=d.length>>>1,c=0;c<n;c++)o<<=1,o|=u>>>d[c]&1;for(var c=n;c<d.length;c++)f<<=1,f|=r>>>d[c]&1;s[a+0]=o>>>0,s[a+1]=f>>>0},dt.expand=function(u,r,s){var a=0,o=0;a=(u&1)<<5|u>>>27;for(var f=23;f>=15;f-=4)a<<=6,a|=u>>>f&63;for(var f=11;f>=3;f-=4)o|=u>>>f&63,o<<=6;o|=(u&31)<<1|u>>>31,r[s+0]=a>>>0,r[s+1]=o>>>0};var e=[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];dt.substitute=function(u,r){for(var s=0,a=0;a<4;a++){var o=u>>>18-a*6&63,f=e[a*64+o];s<<=4,s|=f}for(var a=0;a<4;a++){var o=r>>>18-a*6&63,f=e[256+a*64+o];s<<=4,s|=f}return s>>>0};var t=[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 dt.permute=function(u){for(var r=0,s=0;s<t.length;s++)r<<=1,r|=u>>>t[s]&1;return r>>>0},dt.padSplit=function(u,r,s){for(var a=u.toString(2);a.length<r;)a="0"+a;for(var o=[],f=0;f<r;f+=s)o.push(a.slice(f,f+s));return o.join(" ")},dt}var ya,Uc;function ls(){if(Uc)return ya;Uc=1;var d=lt();function e(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=t.padding!==!1}return ya=e,e.prototype._init=function(){},e.prototype.update=function(i){return i.length===0?[]:this.type==="decrypt"?this._updateDecrypt(i):this._updateEncrypt(i)},e.prototype._buffer=function(i,u){for(var r=Math.min(this.buffer.length-this.bufferOff,i.length-u),s=0;s<r;s++)this.buffer[this.bufferOff+s]=i[u+s];return this.bufferOff+=r,r},e.prototype._flushBuffer=function(i,u){return this._update(this.buffer,0,i,u),this.bufferOff=0,this.blockSize},e.prototype._updateEncrypt=function(i){var u=0,r=0,s=(this.bufferOff+i.length)/this.blockSize|0,a=new Array(s*this.blockSize);this.bufferOff!==0&&(u+=this._buffer(i,u),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(a,r)));for(var o=i.length-(i.length-u)%this.blockSize;u<o;u+=this.blockSize)this._update(i,u,a,r),r+=this.blockSize;for(;u<i.length;u++,this.bufferOff++)this.buffer[this.bufferOff]=i[u];return a},e.prototype._updateDecrypt=function(i){for(var u=0,r=0,s=Math.ceil((this.bufferOff+i.length)/this.blockSize)-1,a=new Array(s*this.blockSize);s>0;s--)u+=this._buffer(i,u),r+=this._flushBuffer(a,r);return u+=this._buffer(i,u),a},e.prototype.final=function(i){var u;i&&(u=this.update(i));var r;return this.type==="encrypt"?r=this._finalEncrypt():r=this._finalDecrypt(),u?u.concat(r):r},e.prototype._pad=function(i,u){if(u===0)return!1;for(;u<i.length;)i[u++]=0;return!0},e.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var i=new Array(this.blockSize);return this._update(this.buffer,0,i,0),i},e.prototype._unpad=function(i){return i},e.prototype._finalDecrypt=function(){d.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var i=new Array(this.blockSize);return this._flushBuffer(i,0),this._unpad(i)},ya}var ga,Hc;function ld(){if(Hc)return ga;Hc=1;var d=lt(),e=pe(),t=dd(),i=ls();function u(){this.tmp=new Array(2),this.keys=null}function r(a){i.call(this,a);var o=new u;this._desState=o,this.deriveKeys(o,a.key)}e(r,i),ga=r,r.create=function(o){return new r(o)};var s=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return r.prototype.deriveKeys=function(o,f){o.keys=new Array(32),d.equal(f.length,this.blockSize,"Invalid key length");var n=t.readUInt32BE(f,0),c=t.readUInt32BE(f,4);t.pc1(n,c,o.tmp,0),n=o.tmp[0],c=o.tmp[1];for(var h=0;h<o.keys.length;h+=2){var l=s[h>>>1];n=t.r28shl(n,l),c=t.r28shl(c,l),t.pc2(n,c,o.keys,h)}},r.prototype._update=function(o,f,n,c){var h=this._desState,l=t.readUInt32BE(o,f),b=t.readUInt32BE(o,f+4);t.ip(l,b,h.tmp,0),l=h.tmp[0],b=h.tmp[1],this.type==="encrypt"?this._encrypt(h,l,b,h.tmp,0):this._decrypt(h,l,b,h.tmp,0),l=h.tmp[0],b=h.tmp[1],t.writeUInt32BE(n,l,c),t.writeUInt32BE(n,b,c+4)},r.prototype._pad=function(o,f){if(this.padding===!1)return!1;for(var n=o.length-f,c=f;c<o.length;c++)o[c]=n;return!0},r.prototype._unpad=function(o){if(this.padding===!1)return o;for(var f=o[o.length-1],n=o.length-f;n<o.length;n++)d.equal(o[n],f);return o.slice(0,o.length-f)},r.prototype._encrypt=function(o,f,n,c,h){for(var l=f,b=n,p=0;p<o.keys.length;p+=2){var y=o.keys[p],v=o.keys[p+1];t.expand(b,o.tmp,0),y^=o.tmp[0],v^=o.tmp[1];var g=t.substitute(y,v),x=t.permute(g),B=b;b=(l^x)>>>0,l=B}t.rip(b,l,c,h)},r.prototype._decrypt=function(o,f,n,c,h){for(var l=n,b=f,p=o.keys.length-2;p>=0;p-=2){var y=o.keys[p],v=o.keys[p+1];t.expand(l,o.tmp,0),y^=o.tmp[0],v^=o.tmp[1];var g=t.substitute(y,v),x=t.permute(g),B=l;l=(b^x)>>>0,b=B}t.rip(l,b,c,h)},ga}var wa={},Kc;function ul(){if(Kc)return wa;Kc=1;var d=lt(),e=pe(),t={};function i(r){d.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var s=0;s<this.iv.length;s++)this.iv[s]=r[s]}function u(r){function s(n){r.call(this,n),this._cbcInit()}e(s,r);for(var a=Object.keys(t),o=0;o<a.length;o++){var f=a[o];s.prototype[f]=t[f]}return s.create=function(c){return new s(c)},s}return wa.instantiate=u,t._cbcInit=function(){var s=new i(this.options.iv);this._cbcState=s},t._update=function(s,a,o,f){var n=this._cbcState,c=this.constructor.super_.prototype,h=n.iv;if(this.type==="encrypt"){for(var l=0;l<this.blockSize;l++)h[l]^=s[a+l];c._update.call(this,h,0,o,f);for(var l=0;l<this.blockSize;l++)h[l]=o[f+l]}else{c._update.call(this,s,a,o,f);for(var l=0;l<this.blockSize;l++)o[f+l]^=h[l];for(var l=0;l<this.blockSize;l++)h[l]=s[a+l]}},wa}var _a,jc;function hl(){if(jc)return _a;jc=1;var d=lt(),e=pe(),t=ls(),i=ld();function u(s,a){d.equal(a.length,24,"Invalid key length");var o=a.slice(0,8),f=a.slice(8,16),n=a.slice(16,24);s==="encrypt"?this.ciphers=[i.create({type:"encrypt",key:o}),i.create({type:"decrypt",key:f}),i.create({type:"encrypt",key:n})]:this.ciphers=[i.create({type:"decrypt",key:n}),i.create({type:"encrypt",key:f}),i.create({type:"decrypt",key:o})]}function r(s){t.call(this,s);var a=new u(this.type,this.options.key);this._edeState=a}return e(r,t),_a=r,r.create=function(a){return new r(a)},r.prototype._update=function(a,o,f,n){var c=this._edeState;c.ciphers[0]._update(a,o,f,n),c.ciphers[1]._update(f,n,f,n),c.ciphers[2]._update(f,n,f,n)},r.prototype._pad=i.prototype._pad,r.prototype._unpad=i.prototype._unpad,_a}var zc;function dl(){return zc||(zc=1,Nt.utils=dd(),Nt.Cipher=ls(),Nt.DES=ld(),Nt.CBC=ul(),Nt.EDE=hl()),Nt}var Sa,Vc;function ll(){if(Vc)return Sa;Vc=1;var d=Pt(),e=dl(),t=pe(),i=_e().Buffer,u={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};u.des=u["des-cbc"],u.des3=u["des-ede3-cbc"],Sa=r,t(r,d);function r(s){d.call(this);var a=s.mode.toLowerCase(),o=u[a],f;s.decrypt?f="decrypt":f="encrypt";var n=s.key;i.isBuffer(n)||(n=i.from(n)),(a==="des-ede"||a==="des-ede-cbc")&&(n=i.concat([n,n.slice(0,8)]));var c=s.iv;i.isBuffer(c)||(c=i.from(c)),this._des=o.create({key:n,iv:c,type:f})}return r.prototype._update=function(s){return i.from(this._des.update(s))},r.prototype._final=function(){return i.from(this._des.final())},Sa}var pt={},Or={},Pr={},Gc;function bl(){return Gc||(Gc=1,Pr.encrypt=function(d,e){return d._cipher.encryptBlock(e)},Pr.decrypt=function(d,e){return d._cipher.decryptBlock(e)}),Pr}var kr={},xa,$c;function dr(){return $c||($c=1,xa=function(e,t){for(var i=Math.min(e.length,t.length),u=new Buffer(i),r=0;r<i;++r)u[r]=e[r]^t[r];return u}),xa}var Wc;function pl(){if(Wc)return kr;Wc=1;var d=dr();return kr.encrypt=function(e,t){var i=d(t,e._prev);return e._prev=e._cipher.encryptBlock(i),e._prev},kr.decrypt=function(e,t){var i=e._prev;e._prev=t;var u=e._cipher.decryptBlock(t);return d(u,i)},kr}var Ea={},Yc;function vl(){if(Yc)return Ea;Yc=1;var d=_e().Buffer,e=dr();function t(i,u,r){var s=u.length,a=e(u,i._cache);return i._cache=i._cache.slice(s),i._prev=d.concat([i._prev,r?u:a]),a}return Ea.encrypt=function(i,u,r){for(var s=d.allocUnsafe(0),a;u.length;)if(i._cache.length===0&&(i._cache=i._cipher.encryptBlock(i._prev),i._prev=d.allocUnsafe(0)),i._cache.length<=u.length)a=i._cache.length,s=d.concat([s,t(i,u.slice(0,a),r)]),u=u.slice(a);else{s=d.concat([s,t(i,u,r)]);break}return s},Ea}var Ba={},Jc;function ml(){if(Jc)return Ba;Jc=1;var d=_e().Buffer;function e(t,i,u){var r=t._cipher.encryptBlock(t._prev),s=r[0]^i;return t._prev=d.concat([t._prev.slice(1),d.from([u?i:s])]),s}return Ba.encrypt=function(t,i,u){for(var r=i.length,s=d.allocUnsafe(r),a=-1;++a<r;)s[a]=e(t,i[a],u);return s},Ba}var Ra={},Xc;function yl(){if(Xc)return Ra;Xc=1;var d=_e().Buffer;function e(i,u,r){for(var s,a=-1,o=8,f=0,n,c;++a<o;)s=i._cipher.encryptBlock(i._prev),n=u&1<<7-a?128:0,c=s[0]^n,f+=(c&128)>>a%8,i._prev=t(i._prev,r?n:c);return f}function t(i,u){var r=i.length,s=-1,a=d.allocUnsafe(i.length);for(i=d.concat([i,d.from([u])]);++s<r;)a[s]=i[s]<<1|i[s+1]>>7;return a}return Ra.encrypt=function(i,u,r){for(var s=u.length,a=d.allocUnsafe(s),o=-1;++o<s;)a[o]=e(i,u[o],r);return a},Ra}var Ia={},Qc;function gl(){if(Qc)return Ia;Qc=1;var d=dr();function e(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}return Ia.encrypt=function(t,i){for(;t._cache.length<i.length;)t._cache=Buffer.concat([t._cache,e(t)]);var u=t._cache.slice(0,i.length);return t._cache=t._cache.slice(i.length),d(i,u)},Ia}var Aa={},Oa,Zc;function bd(){if(Zc)return Oa;Zc=1;function d(e){for(var t=e.length,i;t--;)if(i=e.readUInt8(t),i===255)e.writeUInt8(0,t);else{i++,e.writeUInt8(i,t);break}}return Oa=d,Oa}var eu;function tu(){if(eu)return Aa;eu=1;var d=dr(),e=_e().Buffer,t=bd();function i(r){var s=r._cipher.encryptBlockRaw(r._prev);return t(r._prev),s}var u=16;return Aa.encrypt=function(r,s){var a=Math.ceil(s.length/u),o=r._cache.length;r._cache=e.concat([r._cache,e.allocUnsafe(a*u)]);for(var f=0;f<a;f++){var n=i(r),c=o+f*u;r._cache.writeUInt32BE(n[0],c+0),r._cache.writeUInt32BE(n[1],c+4),r._cache.writeUInt32BE(n[2],c+8),r._cache.writeUInt32BE(n[3],c+12)}var h=r._cache.slice(0,s.length);return r._cache=r._cache.slice(s.length),d(s,h)},Aa}const wl={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},_l={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},Sl={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},pd={"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:wl,aes192:_l,aes256:Sl,"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 Pa,ru;function bs(){if(ru)return Pa;ru=1;var d={ECB:bl(),CBC:pl(),CFB:vl(),CFB8:ml(),CFB1:yl(),OFB:gl(),CTR:tu(),GCM:tu()},e=pd;for(var t in e)e[t].module=d[e[t].mode];return Pa=e,Pa}var ka={},iu;function $r(){if(iu)return ka;iu=1;var d=_e().Buffer;function e(a){d.isBuffer(a)||(a=d.from(a));for(var o=a.length/4|0,f=new Array(o),n=0;n<o;n++)f[n]=a.readUInt32BE(n*4);return f}function t(a){for(var o=0;o<a.length;a++)a[o]=0}function i(a,o,f,n,c){for(var h=f[0],l=f[1],b=f[2],p=f[3],y=a[0]^o[0],v=a[1]^o[1],g=a[2]^o[2],x=a[3]^o[3],B,I,T,j,G=4,z=1;z<c;z++)B=h[y>>>24]^l[v>>>16&255]^b[g>>>8&255]^p[x&255]^o[G++],I=h[v>>>24]^l[g>>>16&255]^b[x>>>8&255]^p[y&255]^o[G++],T=h[g>>>24]^l[x>>>16&255]^b[y>>>8&255]^p[v&255]^o[G++],j=h[x>>>24]^l[y>>>16&255]^b[v>>>8&255]^p[g&255]^o[G++],y=B,v=I,g=T,x=j;return B=(n[y>>>24]<<24|n[v>>>16&255]<<16|n[g>>>8&255]<<8|n[x&255])^o[G++],I=(n[v>>>24]<<24|n[g>>>16&255]<<16|n[x>>>8&255]<<8|n[y&255])^o[G++],T=(n[g>>>24]<<24|n[x>>>16&255]<<16|n[y>>>8&255]<<8|n[v&255])^o[G++],j=(n[x>>>24]<<24|n[y>>>16&255]<<16|n[v>>>8&255]<<8|n[g&255])^o[G++],B=B>>>0,I=I>>>0,T=T>>>0,j=j>>>0,[B,I,T,j]}var u=[0,1,2,4,8,16,32,64,128,27,54],r=(function(){for(var a=new Array(256),o=0;o<256;o++)o<128?a[o]=o<<1:a[o]=o<<1^283;for(var f=[],n=[],c=[[],[],[],[]],h=[[],[],[],[]],l=0,b=0,p=0;p<256;++p){var y=b^b<<1^b<<2^b<<3^b<<4;y=y>>>8^y&255^99,f[l]=y,n[y]=l;var v=a[l],g=a[v],x=a[g],B=a[y]*257^y*16843008;c[0][l]=B<<24|B>>>8,c[1][l]=B<<16|B>>>16,c[2][l]=B<<8|B>>>24,c[3][l]=B,B=x*16843009^g*65537^v*257^l*16843008,h[0][y]=B<<24|B>>>8,h[1][y]=B<<16|B>>>16,h[2][y]=B<<8|B>>>24,h[3][y]=B,l===0?l=b=1:(l=v^a[a[a[x^v]]],b^=a[a[b]])}return{SBOX:f,INV_SBOX:n,SUB_MIX:c,INV_SUB_MIX:h}})();function s(a){this._key=e(a),this._reset()}return s.blockSize=16,s.keySize=256/8,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var a=this._key,o=a.length,f=o+6,n=(f+1)*4,c=[],h=0;h<o;h++)c[h]=a[h];for(h=o;h<n;h++){var l=c[h-1];h%o===0?(l=l<<8|l>>>24,l=r.SBOX[l>>>24]<<24|r.SBOX[l>>>16&255]<<16|r.SBOX[l>>>8&255]<<8|r.SBOX[l&255],l^=u[h/o|0]<<24):o>6&&h%o===4&&(l=r.SBOX[l>>>24]<<24|r.SBOX[l>>>16&255]<<16|r.SBOX[l>>>8&255]<<8|r.SBOX[l&255]),c[h]=c[h-o]^l}for(var b=[],p=0;p<n;p++){var y=n-p,v=c[y-(p%4?0:4)];p<4||y<=4?b[p]=v:b[p]=r.INV_SUB_MIX[0][r.SBOX[v>>>24]]^r.INV_SUB_MIX[1][r.SBOX[v>>>16&255]]^r.INV_SUB_MIX[2][r.SBOX[v>>>8&255]]^r.INV_SUB_MIX[3][r.SBOX[v&255]]}this._nRounds=f,this._keySchedule=c,this._invKeySchedule=b},s.prototype.encryptBlockRaw=function(a){return a=e(a),i(a,this._keySchedule,r.SUB_MIX,r.SBOX,this._nRounds)},s.prototype.encryptBlock=function(a){var o=this.encryptBlockRaw(a),f=d.allocUnsafe(16);return f.writeUInt32BE(o[0],0),f.writeUInt32BE(o[1],4),f.writeUInt32BE(o[2],8),f.writeUInt32BE(o[3],12),f},s.prototype.decryptBlock=function(a){a=e(a);var o=a[1];a[1]=a[3],a[3]=o;var f=i(a,this._invKeySchedule,r.INV_SUB_MIX,r.INV_SBOX,this._nRounds),n=d.allocUnsafe(16);return n.writeUInt32BE(f[0],0),n.writeUInt32BE(f[3],4),n.writeUInt32BE(f[2],8),n.writeUInt32BE(f[1],12),n},s.prototype.scrub=function(){t(this._keySchedule),t(this._invKeySchedule),t(this._key)},ka.AES=s,ka}var Na,nu;function xl(){if(nu)return Na;nu=1;var d=_e().Buffer,e=d.alloc(16,0);function t(r){return[r.readUInt32BE(0),r.readUInt32BE(4),r.readUInt32BE(8),r.readUInt32BE(12)]}function i(r){var s=d.allocUnsafe(16);return s.writeUInt32BE(r[0]>>>0,0),s.writeUInt32BE(r[1]>>>0,4),s.writeUInt32BE(r[2]>>>0,8),s.writeUInt32BE(r[3]>>>0,12),s}function u(r){this.h=r,this.state=d.alloc(16,0),this.cache=d.allocUnsafe(0)}return u.prototype.ghash=function(r){for(var s=-1;++s<r.length;)this.state[s]^=r[s];this._multiply()},u.prototype._multiply=function(){for(var r=t(this.h),s=[0,0,0,0],a,o,f,n=-1;++n<128;){for(o=(this.state[~~(n/8)]&1<<7-n%8)!==0,o&&(s[0]^=r[0],s[1]^=r[1],s[2]^=r[2],s[3]^=r[3]),f=(r[3]&1)!==0,a=3;a>0;a--)r[a]=r[a]>>>1|(r[a-1]&1)<<31;r[0]=r[0]>>>1,f&&(r[0]=r[0]^225<<24)}this.state=i(s)},u.prototype.update=function(r){this.cache=d.concat([this.cache,r]);for(var s;this.cache.length>=16;)s=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(s)},u.prototype.final=function(r,s){return this.cache.length&&this.ghash(d.concat([this.cache,e],16)),this.ghash(i([0,r,0,s])),this.state},Na=u,Na}var Ma,au;function vd(){if(au)return Ma;au=1;var d=$r(),e=_e().Buffer,t=Pt(),i=pe(),u=xl(),r=dr(),s=bd();function a(n,c){var h=0;n.length!==c.length&&h++;for(var l=Math.min(n.length,c.length),b=0;b<l;++b)h+=n[b]^c[b];return h}function o(n,c,h){if(c.length===12)return n._finID=e.concat([c,e.from([0,0,0,1])]),e.concat([c,e.from([0,0,0,2])]);var l=new u(h),b=c.length,p=b%16;l.update(c),p&&(p=16-p,l.update(e.alloc(p,0))),l.update(e.alloc(8,0));var y=b*8,v=e.alloc(8);v.writeUIntBE(y,0,8),l.update(v),n._finID=l.state;var g=e.from(n._finID);return s(g),g}function f(n,c,h,l){t.call(this);var b=e.alloc(4,0);this._cipher=new d.AES(c);var p=this._cipher.encryptBlock(b);this._ghash=new u(p),h=o(this,h,p),this._prev=e.from(h),this._cache=e.allocUnsafe(0),this._secCache=e.allocUnsafe(0),this._decrypt=l,this._alen=0,this._len=0,this._mode=n,this._authTag=null,this._called=!1}return i(f,t),f.prototype._update=function(n){if(!this._called&&this._alen){var c=16-this._alen%16;c<16&&(c=e.alloc(c,0),this._ghash.update(c))}this._called=!0;var h=this._mode.encrypt(this,n);return this._decrypt?this._ghash.update(n):this._ghash.update(h),this._len+=n.length,h},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var n=r(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&a(n,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=n,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!e.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(c){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=c},f.prototype.setAAD=function(c){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(c),this._alen+=c.length},Ma=f,Ma}var Ca,fu;function md(){if(fu)return Ca;fu=1;var d=$r(),e=_e().Buffer,t=Pt(),i=pe();function u(r,s,a,o){t.call(this),this._cipher=new d.AES(s),this._prev=e.from(a),this._cache=e.allocUnsafe(0),this._secCache=e.allocUnsafe(0),this._decrypt=o,this._mode=r}return i(u,t),u.prototype._update=function(r){return this._mode.encrypt(this,r,this._decrypt)},u.prototype._final=function(){this._cipher.scrub()},Ca=u,Ca}var Ta,su;function Wr(){if(su)return Ta;su=1;var d=_e().Buffer,e=fs();function t(i,u,r,s){if(d.isBuffer(i)||(i=d.from(i,"binary")),u&&(d.isBuffer(u)||(u=d.from(u,"binary")),u.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,o=d.alloc(a),f=d.alloc(s||0),n=d.alloc(0);a>0||s>0;){var c=new e;c.update(n),c.update(i),u&&c.update(u),n=c.digest();var h=0;if(a>0){var l=o.length-a;h=Math.min(a,n.length),n.copy(o,l,0,h),a-=h}if(h<n.length&&s>0){var b=f.length-s,p=Math.min(s,n.length-h);n.copy(f,b,h,h+p),s-=p}}return n.fill(0),{key:o,iv:f}}return Ta=t,Ta}var ou;function El(){if(ou)return Or;ou=1;var d=bs(),e=vd(),t=_e().Buffer,i=md(),u=Pt(),r=$r(),s=Wr(),a=pe();function o(l,b,p){u.call(this),this._cache=new n,this._cipher=new r.AES(b),this._prev=t.from(p),this._mode=l,this._autopadding=!0}a(o,u),o.prototype._update=function(l){this._cache.add(l);for(var b,p,y=[];b=this._cache.get();)p=this._mode.encrypt(this,b),y.push(p);return t.concat(y)};var f=t.alloc(16,16);o.prototype._final=function(){var l=this._cache.flush();if(this._autopadding)return l=this._mode.encrypt(this,l),this._cipher.scrub(),l;if(!l.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(l){return this._autopadding=!!l,this};function n(){this.cache=t.allocUnsafe(0)}n.prototype.add=function(l){this.cache=t.concat([this.cache,l])},n.prototype.get=function(){if(this.cache.length>15){var l=this.cache.slice(0,16);return this.cache=this.cache.slice(16),l}return null},n.prototype.flush=function(){for(var l=16-this.cache.length,b=t.allocUnsafe(l),p=-1;++p<l;)b.writeUInt8(l,p);return t.concat([this.cache,b])};function c(l,b,p){var y=d[l.toLowerCase()];if(!y)throw new TypeError("invalid suite type");if(typeof b=="string"&&(b=t.from(b)),b.length!==y.key/8)throw new TypeError("invalid key length "+b.length);if(typeof p=="string"&&(p=t.from(p)),y.mode!=="GCM"&&p.length!==y.iv)throw new TypeError("invalid iv length "+p.length);return y.type==="stream"?new i(y.module,b,p):y.type==="auth"?new e(y.module,b,p):new o(y.module,b,p)}function h(l,b){var p=d[l.toLowerCase()];if(!p)throw new TypeError("invalid suite type");var y=s(b,!1,p.key,p.iv);return c(l,y.key,y.iv)}return Or.createCipheriv=c,Or.createCipher=h,Or}var Nr={},cu;function Bl(){if(cu)return Nr;cu=1;var d=vd(),e=_e().Buffer,t=bs(),i=md(),u=Pt(),r=$r(),s=Wr(),a=pe();function o(l,b,p){u.call(this),this._cache=new f,this._last=void 0,this._cipher=new r.AES(b),this._prev=e.from(p),this._mode=l,this._autopadding=!0}a(o,u),o.prototype._update=function(l){this._cache.add(l);for(var b,p,y=[];b=this._cache.get(this._autopadding);)p=this._mode.decrypt(this,b),y.push(p);return e.concat(y)},o.prototype._final=function(){var l=this._cache.flush();if(this._autopadding)return n(this._mode.decrypt(this,l));if(l)throw new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(l){return this._autopadding=!!l,this};function f(){this.cache=e.allocUnsafe(0)}f.prototype.add=function(l){this.cache=e.concat([this.cache,l])},f.prototype.get=function(l){var b;if(l){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},f.prototype.flush=function(){if(this.cache.length)return this.cache};function n(l){var b=l[15];if(b<1||b>16)throw new Error("unable to decrypt data");for(var p=-1;++p<b;)if(l[p+(16-b)]!==b)throw new Error("unable to decrypt data");if(b!==16)return l.slice(0,16-b)}function c(l,b,p){var y=t[l.toLowerCase()];if(!y)throw new TypeError("invalid suite type");if(typeof p=="string"&&(p=e.from(p)),y.mode!=="GCM"&&p.length!==y.iv)throw new TypeError("invalid iv length "+p.length);if(typeof b=="string"&&(b=e.from(b)),b.length!==y.key/8)throw new TypeError("invalid key length "+b.length);return y.type==="stream"?new i(y.module,b,p,!0):y.type==="auth"?new d(y.module,b,p,!0):new o(y.module,b,p)}function h(l,b){var p=t[l.toLowerCase()];if(!p)throw new TypeError("invalid suite type");var y=s(b,!1,p.key,p.iv);return c(l,y.key,y.iv)}return Nr.createDecipher=h,Nr.createDecipheriv=c,Nr}var uu;function ps(){if(uu)return pt;uu=1;var d=El(),e=Bl(),t=pd;function i(){return Object.keys(t)}return pt.createCipher=pt.Cipher=d.createCipher,pt.createCipheriv=pt.Cipheriv=d.createCipheriv,pt.createDecipher=pt.Decipher=e.createDecipher,pt.createDecipheriv=pt.Decipheriv=e.createDecipheriv,pt.listCiphers=pt.getCiphers=i,pt}var La={},hu;function Rl(){return hu||(hu=1,(function(d){d["des-ecb"]={key:8,iv:0},d["des-cbc"]=d.des={key:8,iv:8},d["des-ede3-cbc"]=d.des3={key:24,iv:8},d["des-ede3"]={key:24,iv:0},d["des-ede-cbc"]={key:16,iv:8},d["des-ede"]={key:16,iv:0}})(La)),La}var du;function Il(){if(du)return bt;du=1;var d=ll(),e=ps(),t=bs(),i=Rl(),u=Wr();function r(n,c){n=n.toLowerCase();var h,l;if(t[n])h=t[n].key,l=t[n].iv;else if(i[n])h=i[n].key*8,l=i[n].iv;else throw new TypeError("invalid suite type");var b=u(c,!1,h,l);return a(n,b.key,b.iv)}function s(n,c){n=n.toLowerCase();var h,l;if(t[n])h=t[n].key,l=t[n].iv;else if(i[n])h=i[n].key*8,l=i[n].iv;else throw new TypeError("invalid suite type");var b=u(c,!1,h,l);return o(n,b.key,b.iv)}function a(n,c,h){if(n=n.toLowerCase(),t[n])return e.createCipheriv(n,c,h);if(i[n])return new d({key:c,iv:h,mode:n});throw new TypeError("invalid suite type")}function o(n,c,h){if(n=n.toLowerCase(),t[n])return e.createDecipheriv(n,c,h);if(i[n])return new d({key:c,iv:h,mode:n,decrypt:!0});throw new TypeError("invalid suite type")}function f(){return Object.keys(i).concat(e.getCiphers())}return bt.createCipher=bt.Cipher=r,bt.createCipheriv=bt.Cipheriv=a,bt.createDecipher=bt.Decipher=s,bt.createDecipheriv=bt.Decipheriv=o,bt.listCiphers=bt.getCiphers=f,bt}var Mt={},Da,lu;function yd(){if(lu)return Da;lu=1;var d=Te(),e=vr();function t(i){this.rand=i||new e.Rand}return Da=t,t.create=function(u){return new t(u)},t.prototype._randbelow=function(u){var r=u.bitLength(),s=Math.ceil(r/8);do var a=new d(this.rand.generate(s));while(a.cmp(u)>=0);return a},t.prototype._randrange=function(u,r){var s=r.sub(u);return u.add(this._randbelow(s))},t.prototype.test=function(u,r,s){var a=u.bitLength(),o=d.mont(u),f=new d(1).toRed(o);r||(r=Math.max(1,a/48|0));for(var n=u.subn(1),c=0;!n.testn(c);c++);for(var h=u.shrn(c),l=n.toRed(o),b=!0;r>0;r--){var p=this._randrange(new d(2),n);s&&s(p);var y=p.toRed(o).redPow(h);if(!(y.cmp(f)===0||y.cmp(l)===0)){for(var v=1;v<c;v++){if(y=y.redSqr(),y.cmp(f)===0)return!1;if(y.cmp(l)===0)break}if(v===c)return!1}}return b},t.prototype.getDivisor=function(u,r){var s=u.bitLength(),a=d.mont(u),o=new d(1).toRed(a);r||(r=Math.max(1,s/48|0));for(var f=u.subn(1),n=0;!f.testn(n);n++);for(var c=u.shrn(n),h=f.toRed(a);r>0;r--){var l=this._randrange(new d(2),f),b=u.gcd(l);if(b.cmpn(1)!==0)return b;var p=l.toRed(a).redPow(c);if(!(p.cmp(o)===0||p.cmp(h)===0)){for(var y=1;y<n;y++){if(p=p.redSqr(),p.cmp(o)===0)return p.fromRed().subn(1).gcd(u);if(p.cmp(h)===0)break}if(y===n)return p=p.redSqr(),p.fromRed().subn(1).gcd(u)}}return!1},Da}var Fa,bu;function gd(){if(bu)return Fa;bu=1;var d=Ut();Fa=y,y.simpleSieve=b,y.fermatTest=p;var e=Te(),t=new e(24),i=yd(),u=new i,r=new e(1),s=new e(2),a=new e(5);new e(16),new e(8);var o=new e(10),f=new e(3);new e(7);var n=new e(11),c=new e(4);new e(12);var h=null;function l(){if(h!==null)return h;var v=1048576,g=[];g[0]=2;for(var x=1,B=3;B<v;B+=2){for(var I=Math.ceil(Math.sqrt(B)),T=0;T<x&&g[T]<=I&&B%g[T]!==0;T++);x!==T&&g[T]<=I||(g[x++]=B)}return h=g,g}function b(v){for(var g=l(),x=0;x<g.length;x++)if(v.modn(g[x])===0)return v.cmpn(g[x])===0;return!0}function p(v){var g=e.mont(v);return s.toRed(g).redPow(v.subn(1)).fromRed().cmpn(1)===0}function y(v,g){if(v<16)return g===2||g===5?new e([140,123]):new e([140,39]);g=new e(g);for(var x,B;;){for(x=new e(d(Math.ceil(v/8)));x.bitLength()>v;)x.ishrn(1);if(x.isEven()&&x.iadd(r),x.testn(1)||x.iadd(s),g.cmp(s)){if(!g.cmp(a))for(;x.mod(o).cmp(f);)x.iadd(c)}else for(;x.mod(t).cmp(n);)x.iadd(c);if(B=x.shrn(1),b(B)&&b(x)&&p(B)&&p(x)&&u.test(B)&&u.test(x))return x}}return Fa}const Al={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},Ol={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},Pl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},kl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},Nl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},Ml={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},Cl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},Tl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},Ll={modp1:Al,modp2:Ol,modp5:Pl,modp14:kl,modp15:Nl,modp16:Ml,modp17:Cl,modp18:Tl};var qa,pu;function Dl(){if(pu)return qa;pu=1;var d=Te(),e=yd(),t=new e,i=new d(24),u=new d(11),r=new d(10),s=new d(3),a=new d(7),o=gd(),f=Ut();qa=b;function n(y,v){return v=v||"utf8",Buffer.isBuffer(y)||(y=new Buffer(y,v)),this._pub=new d(y),this}function c(y,v){return v=v||"utf8",Buffer.isBuffer(y)||(y=new Buffer(y,v)),this._priv=new d(y),this}var h={};function l(y,v){var g=v.toString("hex"),x=[g,y.toString(16)].join("_");if(x in h)return h[x];var B=0;if(y.isEven()||!o.simpleSieve||!o.fermatTest(y)||!t.test(y))return B+=1,g==="02"||g==="05"?B+=8:B+=4,h[x]=B,B;t.test(y.shrn(1))||(B+=2);var I;switch(g){case"02":y.mod(i).cmp(u)&&(B+=8);break;case"05":I=y.mod(r),I.cmp(s)&&I.cmp(a)&&(B+=8);break;default:B+=4}return h[x]=B,B}function b(y,v,g){this.setGenerator(v),this.__prime=new d(y),this._prime=d.mont(this.__prime),this._primeLen=y.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,g?(this.setPublicKey=n,this.setPrivateKey=c):this._primeCode=8}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=l(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new d(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(y){y=new d(y),y=y.toRed(this._prime);var v=y.redPow(this._priv).fromRed(),g=new Buffer(v.toArray()),x=this.getPrime();if(g.length<x.length){var B=new Buffer(x.length-g.length);B.fill(0),g=Buffer.concat([B,g])}return g},b.prototype.getPublicKey=function(v){return p(this._pub,v)},b.prototype.getPrivateKey=function(v){return p(this._priv,v)},b.prototype.getPrime=function(y){return p(this.__prime,y)},b.prototype.getGenerator=function(y){return p(this._gen,y)},b.prototype.setGenerator=function(y,v){return v=v||"utf8",Buffer.isBuffer(y)||(y=new Buffer(y,v)),this.__gen=y,this._gen=new d(y),this};function p(y,v){var g=new Buffer(y.toArray());return v?g.toString(v):g}return qa}var vu;function Fl(){if(vu)return Mt;vu=1;var d=gd(),e=Ll,t=Dl();function i(s){var a=new Buffer(e[s].prime,"hex"),o=new Buffer(e[s].gen,"hex");return new t(a,o)}var u={binary:!0,hex:!0,base64:!0};function r(s,a,o,f){return Buffer.isBuffer(a)||u[a]===void 0?r(s,"binary",a,o):(a=a||"binary",f=f||"binary",o=o||new Buffer([2]),Buffer.isBuffer(o)||(o=new Buffer(o,f)),typeof s=="number"?new t(d(s,o),o,!0):(Buffer.isBuffer(s)||(s=new Buffer(s,a)),new t(s,o,!0)))}return Mt.DiffieHellmanGroup=Mt.createDiffieHellmanGroup=Mt.getDiffieHellman=i,Mt.createDiffieHellman=Mt.DiffieHellman=r,Mt}var Xt={exports:{}},Ua,mu;function vs(){if(mu)return Ua;mu=1;var d=Te(),e=Ut(),t=_e().Buffer;function i(s){var a=s.modulus.byteLength(),o;do o=new d(e(a));while(o.cmp(s.modulus)>=0||!o.umod(s.prime1)||!o.umod(s.prime2));return o}function u(s){var a=i(s),o=a.toRed(d.mont(s.modulus)).redPow(new d(s.publicExponent)).fromRed();return{blinder:o,unblinder:a.invm(s.modulus)}}function r(s,a){var o=u(a),f=a.modulus.byteLength(),n=new d(s).mul(o.blinder).umod(a.modulus),c=n.toRed(d.mont(a.prime1)),h=n.toRed(d.mont(a.prime2)),l=a.coefficient,b=a.prime1,p=a.prime2,y=c.redPow(a.exponent1).fromRed(),v=h.redPow(a.exponent2).fromRed(),g=y.isub(v).imul(l).umod(b).imul(p);return v.iadd(g).imul(o.unblinder).umod(a.modulus).toArrayLike(t,"be",f)}return r.getr=i,Ua=r,Ua}var Ha={};const ql="6.6.1",Ul={version:ql};var Ka={},yu;function St(){return yu||(yu=1,(function(d){var e=d,t=Te(),i=lt(),u=ns();e.assert=i,e.toArray=u.toArray,e.zero2=u.zero2,e.toHex=u.toHex,e.encode=u.encode;function r(n,c,h){var l=new Array(Math.max(n.bitLength(),h)+1),b;for(b=0;b<l.length;b+=1)l[b]=0;var p=1<<c+1,y=n.clone();for(b=0;b<l.length;b++){var v,g=y.andln(p-1);y.isOdd()?(g>(p>>1)-1?v=(p>>1)-g:v=g,y.isubn(v)):v=0,l[b]=v,y.iushrn(1)}return l}e.getNAF=r;function s(n,c){var h=[[],[]];n=n.clone(),c=c.clone();for(var l=0,b=0,p;n.cmpn(-l)>0||c.cmpn(-b)>0;){var y=n.andln(3)+l&3,v=c.andln(3)+b&3;y===3&&(y=-1),v===3&&(v=-1);var g;(y&1)===0?g=0:(p=n.andln(7)+l&7,(p===3||p===5)&&v===2?g=-y:g=y),h[0].push(g);var x;(v&1)===0?x=0:(p=c.andln(7)+b&7,(p===3||p===5)&&y===2?x=-v:x=v),h[1].push(x),2*l===g+1&&(l=1-l),2*b===x+1&&(b=1-b),n.iushrn(1),c.iushrn(1)}return h}e.getJSF=s;function a(n,c,h){var l="_"+c;n.prototype[c]=function(){return this[l]!==void 0?this[l]:this[l]=h.call(this)}}e.cachedProperty=a;function o(n){return typeof n=="string"?e.toArray(n,"hex"):n}e.parseBytes=o;function f(n){return new t(n,"hex","le")}e.intFromLE=f})(Ka)),Ka}var ja={},za,gu;function Yr(){if(gu)return za;gu=1;var d=Te(),e=St(),t=e.getNAF,i=e.getJSF,u=e.assert;function r(a,o){this.type=a,this.p=new d(o.p,16),this.red=o.prime?d.red(o.prime):d.mont(this.p),this.zero=new d(0).toRed(this.red),this.one=new d(1).toRed(this.red),this.two=new d(2).toRed(this.red),this.n=o.n&&new d(o.n,16),this.g=o.g&&this.pointFromJSON(o.g,o.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))}za=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(o,f){u(o.precomputed);var n=o._getDoubles(),c=t(f,1,this._bitLength),h=(1<<n.step+1)-(n.step%2===0?2:1);h/=3;var l=[],b,p;for(b=0;b<c.length;b+=n.step){p=0;for(var y=b+n.step-1;y>=b;y--)p=(p<<1)+c[y];l.push(p)}for(var v=this.jpoint(null,null,null),g=this.jpoint(null,null,null),x=h;x>0;x--){for(b=0;b<l.length;b++)p=l[b],p===x?g=g.mixedAdd(n.points[b]):p===-x&&(g=g.mixedAdd(n.points[b].neg()));v=v.add(g)}return v.toP()},r.prototype._wnafMul=function(o,f){var n=4,c=o._getNAFPoints(n);n=c.wnd;for(var h=c.points,l=t(f,n,this._bitLength),b=this.jpoint(null,null,null),p=l.length-1;p>=0;p--){for(var y=0;p>=0&&l[p]===0;p--)y++;if(p>=0&&y++,b=b.dblp(y),p<0)break;var v=l[p];u(v!==0),o.type==="affine"?v>0?b=b.mixedAdd(h[v-1>>1]):b=b.mixedAdd(h[-v-1>>1].neg()):v>0?b=b.add(h[v-1>>1]):b=b.add(h[-v-1>>1].neg())}return o.type==="affine"?b.toP():b},r.prototype._wnafMulAdd=function(o,f,n,c,h){var l=this._wnafT1,b=this._wnafT2,p=this._wnafT3,y=0,v,g,x;for(v=0;v<c;v++){x=f[v];var B=x._getNAFPoints(o);l[v]=B.wnd,b[v]=B.points}for(v=c-1;v>=1;v-=2){var I=v-1,T=v;if(l[I]!==1||l[T]!==1){p[I]=t(n[I],l[I],this._bitLength),p[T]=t(n[T],l[T],this._bitLength),y=Math.max(p[I].length,y),y=Math.max(p[T].length,y);continue}var j=[f[I],null,null,f[T]];f[I].y.cmp(f[T].y)===0?(j[1]=f[I].add(f[T]),j[2]=f[I].toJ().mixedAdd(f[T].neg())):f[I].y.cmp(f[T].y.redNeg())===0?(j[1]=f[I].toJ().mixedAdd(f[T]),j[2]=f[I].add(f[T].neg())):(j[1]=f[I].toJ().mixedAdd(f[T]),j[2]=f[I].toJ().mixedAdd(f[T].neg()));var G=[-3,-1,-5,-7,0,7,5,1,3],z=i(n[I],n[T]);for(y=Math.max(z[0].length,y),p[I]=new Array(y),p[T]=new Array(y),g=0;g<y;g++){var te=z[0][g]|0,ne=z[1][g]|0;p[I][g]=G[(te+1)*3+(ne+1)],p[T][g]=0,b[I]=j}}var $=this.jpoint(null,null,null),k=this._wnafT4;for(v=y;v>=0;v--){for(var m=0;v>=0;){var E=!0;for(g=0;g<c;g++)k[g]=p[g][v]|0,k[g]!==0&&(E=!1);if(!E)break;m++,v--}if(v>=0&&m++,$=$.dblp(m),v<0)break;for(g=0;g<c;g++){var O=k[g];O!==0&&(O>0?x=b[g][O-1>>1]:O<0&&(x=b[g][-O-1>>1].neg()),x.type==="affine"?$=$.mixedAdd(x):$=$.add(x))}}for(v=0;v<c;v++)b[v]=null;return h?$:$.toP()};function s(a,o){this.curve=a,this.type=o,this.precomputed=null}return r.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},r.prototype.decodePoint=function(o,f){o=e.toArray(o,f);var n=this.p.byteLength();if((o[0]===4||o[0]===6||o[0]===7)&&o.length-1===2*n){o[0]===6?u(o[o.length-1]%2===0):o[0]===7&&u(o[o.length-1]%2===1);var c=this.point(o.slice(1,1+n),o.slice(1+n,1+2*n));return c}else if((o[0]===2||o[0]===3)&&o.length-1===n)return this.pointFromX(o.slice(1,1+n),o[0]===3);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(o){return this.encode(o,!0)},s.prototype._encode=function(o){var f=this.curve.p.byteLength(),n=this.getX().toArray("be",f);return o?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",f))},s.prototype.encode=function(o,f){return e.encode(this._encode(f),o)},s.prototype.precompute=function(o){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,o),f.beta=this._getBeta(),this.precomputed=f,this},s.prototype._hasDoubles=function(o){if(!this.precomputed)return!1;var f=this.precomputed.doubles;return f?f.points.length>=Math.ceil((o.bitLength()+1)/f.step):!1},s.prototype._getDoubles=function(o,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],c=this,h=0;h<f;h+=o){for(var l=0;l<o;l++)c=c.dbl();n.push(c)}return{step:o,points:n}},s.prototype._getNAFPoints=function(o){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var f=[this],n=(1<<o)-1,c=n===1?null:this.dbl(),h=1;h<n;h++)f[h]=f[h-1].add(c);return{wnd:o,points:f}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(o){for(var f=this,n=0;n<o;n++)f=f.dbl();return f},za}var Va,wu;function Hl(){if(wu)return Va;wu=1;var d=St(),e=Te(),t=pe(),i=Yr(),u=d.assert;function r(o){i.call(this,"short",o),this.a=new e(o.a,16).toRed(this.red),this.b=new e(o.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(o),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}t(r,i),Va=r,r.prototype._getEndomorphism=function(f){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var n,c;if(f.beta)n=new e(f.beta,16).toRed(this.red);else{var h=this._getEndoRoots(this.p);n=h[0].cmp(h[1])<0?h[0]:h[1],n=n.toRed(this.red)}if(f.lambda)c=new e(f.lambda,16);else{var l=this._getEndoRoots(this.n);this.g.mul(l[0]).x.cmp(this.g.x.redMul(n))===0?c=l[0]:(c=l[1],u(this.g.mul(c).x.cmp(this.g.x.redMul(n))===0))}var b;return f.basis?b=f.basis.map(function(p){return{a:new e(p.a,16),b:new e(p.b,16)}}):b=this._getEndoBasis(c),{beta:n,lambda:c,basis:b}}},r.prototype._getEndoRoots=function(f){var n=f===this.p?this.red:e.mont(f),c=new e(2).toRed(n).redInvm(),h=c.redNeg(),l=new e(3).toRed(n).redNeg().redSqrt().redMul(c),b=h.redAdd(l).fromRed(),p=h.redSub(l).fromRed();return[b,p]},r.prototype._getEndoBasis=function(f){for(var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=f,h=this.n.clone(),l=new e(1),b=new e(0),p=new e(0),y=new e(1),v,g,x,B,I,T,j,G=0,z,te;c.cmpn(0)!==0;){var ne=h.div(c);z=h.sub(ne.mul(c)),te=p.sub(ne.mul(l));var $=y.sub(ne.mul(b));if(!x&&z.cmp(n)<0)v=j.neg(),g=l,x=z.neg(),B=te;else if(x&&++G===2)break;j=z,h=c,c=z,p=l,l=te,y=b,b=$}I=z.neg(),T=te;var k=x.sqr().add(B.sqr()),m=I.sqr().add(T.sqr());return m.cmp(k)>=0&&(I=v,T=g),x.negative&&(x=x.neg(),B=B.neg()),I.negative&&(I=I.neg(),T=T.neg()),[{a:x,b:B},{a:I,b:T}]},r.prototype._endoSplit=function(f){var n=this.endo.basis,c=n[0],h=n[1],l=h.b.mul(f).divRound(this.n),b=c.b.neg().mul(f).divRound(this.n),p=l.mul(c.a),y=b.mul(h.a),v=l.mul(c.b),g=b.mul(h.b),x=f.sub(p).sub(y),B=v.add(g).neg();return{k1:x,k2:B}},r.prototype.pointFromX=function(f,n){f=new e(f,16),f.red||(f=f.toRed(this.red));var c=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),h=c.redSqrt();if(h.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var l=h.fromRed().isOdd();return(n&&!l||!n&&l)&&(h=h.redNeg()),this.point(f,h)},r.prototype.validate=function(f){if(f.inf)return!0;var n=f.x,c=f.y,h=this.a.redMul(n),l=n.redSqr().redMul(n).redIAdd(h).redIAdd(this.b);return c.redSqr().redISub(l).cmpn(0)===0},r.prototype._endoWnafMulAdd=function(f,n,c){for(var h=this._endoWnafT1,l=this._endoWnafT2,b=0;b<f.length;b++){var p=this._endoSplit(n[b]),y=f[b],v=y._getBeta();p.k1.negative&&(p.k1.ineg(),y=y.neg(!0)),p.k2.negative&&(p.k2.ineg(),v=v.neg(!0)),h[b*2]=y,h[b*2+1]=v,l[b*2]=p.k1,l[b*2+1]=p.k2}for(var g=this._wnafMulAdd(1,h,l,b*2,c),x=0;x<b*2;x++)h[x]=null,l[x]=null;return g};function s(o,f,n,c){i.BasePoint.call(this,o,"affine"),f===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(f,16),this.y=new e(n,16),c&&(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(s,i.BasePoint),r.prototype.point=function(f,n,c){return new s(this,f,n,c)},r.prototype.pointFromJSON=function(f,n){return s.fromJSON(this,f,n)},s.prototype._getBeta=function(){if(this.curve.endo){var f=this.precomputed;if(f&&f.beta)return f.beta;var n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var c=this.curve,h=function(l){return c.point(l.x.redMul(c.endo.beta),l.y)};f.beta=n,n.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(h)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(h)}}}return n}},s.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]},s.fromJSON=function(f,n,c){typeof n=="string"&&(n=JSON.parse(n));var h=f.point(n[0],n[1],c);if(!n[2])return h;function l(p){return f.point(p[0],p[1],c)}var b=n[2];return h.precomputed={beta:null,doubles:b.doubles&&{step:b.doubles.step,points:[h].concat(b.doubles.points.map(l))},naf:b.naf&&{wnd:b.naf.wnd,points:[h].concat(b.naf.points.map(l))}},h},s.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)+">"},s.prototype.isInfinity=function(){return this.inf},s.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 n=this.y.redSub(f.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(f.x).redInvm()));var c=n.redSqr().redISub(this.x).redISub(f.x),h=n.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,h)},s.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 n=this.curve.a,c=this.x.redSqr(),h=f.redInvm(),l=c.redAdd(c).redIAdd(c).redIAdd(n).redMul(h),b=l.redSqr().redISub(this.x.redAdd(this.x)),p=l.redMul(this.x.redSub(b)).redISub(this.y);return this.curve.point(b,p)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.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)},s.prototype.mulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l):this.curve._wnafMulAdd(1,h,l,2)},s.prototype.jmulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l,!0):this.curve._wnafMulAdd(1,h,l,2,!0)},s.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)},s.prototype.neg=function(f){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var c=this.precomputed,h=function(l){return l.neg()};n.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(h)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(h)}}}return n},s.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 a(o,f,n,c){i.BasePoint.call(this,o,"jacobian"),f===null&&n===null&&c===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(n,16),this.z=new e(c,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(a,i.BasePoint),r.prototype.jpoint=function(f,n,c){return new a(this,f,n,c)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),n=f.redSqr(),c=this.x.redMul(n),h=this.y.redMul(n).redMul(f);return this.curve.point(c,h)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var n=f.z.redSqr(),c=this.z.redSqr(),h=this.x.redMul(n),l=f.x.redMul(c),b=this.y.redMul(n.redMul(f.z)),p=f.y.redMul(c.redMul(this.z)),y=h.redSub(l),v=b.redSub(p);if(y.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=y.redSqr(),x=g.redMul(y),B=h.redMul(g),I=v.redSqr().redIAdd(x).redISub(B).redISub(B),T=v.redMul(B.redISub(I)).redISub(b.redMul(x)),j=this.z.redMul(f.z).redMul(y);return this.curve.jpoint(I,T,j)},a.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var n=this.z.redSqr(),c=this.x,h=f.x.redMul(n),l=this.y,b=f.y.redMul(n).redMul(this.z),p=c.redSub(h),y=l.redSub(b);if(p.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=p.redSqr(),g=v.redMul(p),x=c.redMul(v),B=y.redSqr().redIAdd(g).redISub(x).redISub(x),I=y.redMul(x.redISub(B)).redISub(l.redMul(g)),T=this.z.redMul(p);return this.curve.jpoint(B,I,T)},a.prototype.dblp=function(f){if(f===0)return this;if(this.isInfinity())return this;if(!f)return this.dbl();var n;if(this.curve.zeroA||this.curve.threeA){var c=this;for(n=0;n<f;n++)c=c.dbl();return c}var h=this.curve.a,l=this.curve.tinv,b=this.x,p=this.y,y=this.z,v=y.redSqr().redSqr(),g=p.redAdd(p);for(n=0;n<f;n++){var x=b.redSqr(),B=g.redSqr(),I=B.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(h.redMul(v)),j=b.redMul(B),G=T.redSqr().redISub(j.redAdd(j)),z=j.redISub(G),te=T.redMul(z);te=te.redIAdd(te).redISub(I);var ne=g.redMul(y);n+1<f&&(v=v.redMul(I)),b=G,y=ne,g=te}return this.curve.jpoint(b,g.redMul(l),y)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),b=l.redSqr(),p=this.x.redAdd(l).redSqr().redISub(h).redISub(b);p=p.redIAdd(p);var y=h.redAdd(h).redIAdd(h),v=y.redSqr().redISub(p).redISub(p),g=b.redIAdd(b);g=g.redIAdd(g),g=g.redIAdd(g),f=v,n=y.redMul(p.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),B=this.y.redSqr(),I=B.redSqr(),T=this.x.redAdd(B).redSqr().redISub(x).redISub(I);T=T.redIAdd(T);var j=x.redAdd(x).redIAdd(x),G=j.redSqr(),z=I.redIAdd(I);z=z.redIAdd(z),z=z.redIAdd(z),f=G.redISub(T).redISub(T),n=j.redMul(T.redISub(f)).redISub(z),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(f,n,c)},a.prototype._threeDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),b=l.redSqr(),p=this.x.redAdd(l).redSqr().redISub(h).redISub(b);p=p.redIAdd(p);var y=h.redAdd(h).redIAdd(h).redIAdd(this.curve.a),v=y.redSqr().redISub(p).redISub(p);f=v;var g=b.redIAdd(b);g=g.redIAdd(g),g=g.redIAdd(g),n=y.redMul(p.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),B=this.y.redSqr(),I=this.x.redMul(B),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var j=I.redIAdd(I);j=j.redIAdd(j);var G=j.redAdd(j);f=T.redSqr().redISub(G),c=this.y.redAdd(this.z).redSqr().redISub(B).redISub(x);var z=B.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),n=T.redMul(j.redISub(f)).redISub(z)}return this.curve.jpoint(f,n,c)},a.prototype._dbl=function(){var f=this.curve.a,n=this.x,c=this.y,h=this.z,l=h.redSqr().redSqr(),b=n.redSqr(),p=c.redSqr(),y=b.redAdd(b).redIAdd(b).redIAdd(f.redMul(l)),v=n.redAdd(n);v=v.redIAdd(v);var g=v.redMul(p),x=y.redSqr().redISub(g.redAdd(g)),B=g.redISub(x),I=p.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=y.redMul(B).redISub(I),j=c.redAdd(c).redMul(h);return this.curve.jpoint(x,T,j)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),n=this.y.redSqr(),c=this.z.redSqr(),h=n.redSqr(),l=f.redAdd(f).redIAdd(f),b=l.redSqr(),p=this.x.redAdd(n).redSqr().redISub(f).redISub(h);p=p.redIAdd(p),p=p.redAdd(p).redIAdd(p),p=p.redISub(b);var y=p.redSqr(),v=h.redIAdd(h);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var g=l.redIAdd(p).redSqr().redISub(b).redISub(y).redISub(v),x=n.redMul(g);x=x.redIAdd(x),x=x.redIAdd(x);var B=this.x.redMul(y).redISub(x);B=B.redIAdd(B),B=B.redIAdd(B);var I=this.y.redMul(g.redMul(v.redISub(g)).redISub(p.redMul(y)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=this.z.redAdd(p).redSqr().redISub(c).redISub(y);return this.curve.jpoint(B,I,T)},a.prototype.mul=function(f,n){return f=new e(f,n),this.curve._wnafMul(this,f)},a.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var n=this.z.redSqr(),c=f.z.redSqr();if(this.x.redMul(c).redISub(f.x.redMul(n)).cmpn(0)!==0)return!1;var h=n.redMul(this.z),l=c.redMul(f.z);return this.y.redMul(l).redISub(f.y.redMul(h)).cmpn(0)===0},a.prototype.eqXToP=function(f){var n=this.z.redSqr(),c=f.toRed(this.curve.red).redMul(n);if(this.x.cmp(c)===0)return!0;for(var h=f.clone(),l=this.curve.redN.redMul(n);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(l),this.x.cmp(c)===0)return!0}},a.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)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Va}var Ga,_u;function Kl(){if(_u)return Ga;_u=1;var d=Te(),e=pe(),t=Yr(),i=St();function u(s){t.call(this,"mont",s),this.a=new d(s.a,16).toRed(this.red),this.b=new d(s.b,16).toRed(this.red),this.i4=new d(4).toRed(this.red).redInvm(),this.two=new d(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}e(u,t),Ga=u,u.prototype.validate=function(a){var o=a.normalize().x,f=o.redSqr(),n=f.redMul(o).redAdd(f.redMul(this.a)).redAdd(o),c=n.redSqrt();return c.redSqr().cmp(n)===0};function r(s,a,o){t.BasePoint.call(this,s,"projective"),a===null&&o===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new d(a,16),this.z=new d(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return e(r,t.BasePoint),u.prototype.decodePoint=function(a,o){return this.point(i.toArray(a,o),1)},u.prototype.point=function(a,o){return new r(this,a,o)},u.prototype.pointFromJSON=function(a){return r.fromJSON(this,a)},r.prototype.precompute=function(){},r.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},r.fromJSON=function(a,o){return new r(a,o[0],o[1]||a.one)},r.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)+">"},r.prototype.isInfinity=function(){return this.z.cmpn(0)===0},r.prototype.dbl=function(){var a=this.x.redAdd(this.z),o=a.redSqr(),f=this.x.redSub(this.z),n=f.redSqr(),c=o.redSub(n),h=o.redMul(n),l=c.redMul(n.redAdd(this.curve.a24.redMul(c)));return this.curve.point(h,l)},r.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.diffAdd=function(a,o){var f=this.x.redAdd(this.z),n=this.x.redSub(this.z),c=a.x.redAdd(a.z),h=a.x.redSub(a.z),l=h.redMul(f),b=c.redMul(n),p=o.z.redMul(l.redAdd(b).redSqr()),y=o.x.redMul(l.redISub(b).redSqr());return this.curve.point(p,y)},r.prototype.mul=function(a){for(var o=a.clone(),f=this,n=this.curve.point(null,null),c=this,h=[];o.cmpn(0)!==0;o.iushrn(1))h.push(o.andln(1));for(var l=h.length-1;l>=0;l--)h[l]===0?(f=f.diffAdd(n,c),n=n.dbl()):(n=f.diffAdd(n,c),f=f.dbl());return n},r.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.eq=function(a){return this.getX().cmp(a.getX())===0},r.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},r.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Ga}var $a,Su;function jl(){if(Su)return $a;Su=1;var d=St(),e=Te(),t=pe(),i=Yr(),u=d.assert;function r(a){this.twisted=(a.a|0)!==1,this.mOneA=this.twisted&&(a.a|0)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new e(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new e(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new e(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(a.c|0)===1}t(r,i),$a=r,r.prototype._mulA=function(o){return this.mOneA?o.redNeg():this.a.redMul(o)},r.prototype._mulC=function(o){return this.oneC?o:this.c.redMul(o)},r.prototype.jpoint=function(o,f,n,c){return this.point(o,f,n,c)},r.prototype.pointFromX=function(o,f){o=new e(o,16),o.red||(o=o.toRed(this.red));var n=o.redSqr(),c=this.c2.redSub(this.a.redMul(n)),h=this.one.redSub(this.c2.redMul(this.d).redMul(n)),l=c.redMul(h.redInvm()),b=l.redSqrt();if(b.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");var p=b.fromRed().isOdd();return(f&&!p||!f&&p)&&(b=b.redNeg()),this.point(o,b)},r.prototype.pointFromY=function(o,f){o=new e(o,16),o.red||(o=o.toRed(this.red));var n=o.redSqr(),c=n.redSub(this.c2),h=n.redMul(this.d).redMul(this.c2).redSub(this.a),l=c.redMul(h.redInvm());if(l.cmp(this.zero)===0){if(f)throw new Error("invalid point");return this.point(this.zero,o)}var b=l.redSqrt();if(b.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");return b.fromRed().isOdd()!==f&&(b=b.redNeg()),this.point(b,o)},r.prototype.validate=function(o){if(o.isInfinity())return!0;o.normalize();var f=o.x.redSqr(),n=o.y.redSqr(),c=f.redMul(this.a).redAdd(n),h=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(n)));return c.cmp(h)===0};function s(a,o,f,n,c){i.BasePoint.call(this,a,"projective"),o===null&&f===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new e(o,16),this.y=new e(f,16),this.z=n?new e(n,16):this.curve.one,this.t=c&&new e(c,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 t(s,i.BasePoint),r.prototype.pointFromJSON=function(o){return s.fromJSON(this,o)},r.prototype.point=function(o,f,n,c){return new s(this,o,f,n,c)},s.fromJSON=function(o,f){return new s(o,f[0],f[1],f[2])},s.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)+">"},s.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},s.prototype._extDbl=function(){var o=this.x.redSqr(),f=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var c=this.curve._mulA(o),h=this.x.redAdd(this.y).redSqr().redISub(o).redISub(f),l=c.redAdd(f),b=l.redSub(n),p=c.redSub(f),y=h.redMul(b),v=l.redMul(p),g=h.redMul(p),x=b.redMul(l);return this.curve.point(y,v,x,g)},s.prototype._projDbl=function(){var o=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),n=this.y.redSqr(),c,h,l,b,p,y;if(this.curve.twisted){b=this.curve._mulA(f);var v=b.redAdd(n);this.zOne?(c=o.redSub(f).redSub(n).redMul(v.redSub(this.curve.two)),h=v.redMul(b.redSub(n)),l=v.redSqr().redSub(v).redSub(v)):(p=this.z.redSqr(),y=v.redSub(p).redISub(p),c=o.redSub(f).redISub(n).redMul(y),h=v.redMul(b.redSub(n)),l=v.redMul(y))}else b=f.redAdd(n),p=this.curve._mulC(this.z).redSqr(),y=b.redSub(p).redSub(p),c=this.curve._mulC(o.redISub(b)).redMul(y),h=this.curve._mulC(b).redMul(f.redISub(n)),l=b.redMul(y);return this.curve.point(c,h,l)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(o){var f=this.y.redSub(this.x).redMul(o.y.redSub(o.x)),n=this.y.redAdd(this.x).redMul(o.y.redAdd(o.x)),c=this.t.redMul(this.curve.dd).redMul(o.t),h=this.z.redMul(o.z.redAdd(o.z)),l=n.redSub(f),b=h.redSub(c),p=h.redAdd(c),y=n.redAdd(f),v=l.redMul(b),g=p.redMul(y),x=l.redMul(y),B=b.redMul(p);return this.curve.point(v,g,B,x)},s.prototype._projAdd=function(o){var f=this.z.redMul(o.z),n=f.redSqr(),c=this.x.redMul(o.x),h=this.y.redMul(o.y),l=this.curve.d.redMul(c).redMul(h),b=n.redSub(l),p=n.redAdd(l),y=this.x.redAdd(this.y).redMul(o.x.redAdd(o.y)).redISub(c).redISub(h),v=f.redMul(b).redMul(y),g,x;return this.curve.twisted?(g=f.redMul(p).redMul(h.redSub(this.curve._mulA(c))),x=b.redMul(p)):(g=f.redMul(p).redMul(h.redSub(c)),x=this.curve._mulC(b).redMul(p)),this.curve.point(v,g,x)},s.prototype.add=function(o){return this.isInfinity()?o:o.isInfinity()?this:this.curve.extended?this._extAdd(o):this._projAdd(o)},s.prototype.mul=function(o){return this._hasDoubles(o)?this.curve._fixedNafMul(this,o):this.curve._wnafMul(this,o)},s.prototype.mulAdd=function(o,f,n){return this.curve._wnafMulAdd(1,[this,f],[o,n],2,!1)},s.prototype.jmulAdd=function(o,f,n){return this.curve._wnafMulAdd(1,[this,f],[o,n],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var o=this.z.redInvm();return this.x=this.x.redMul(o),this.y=this.y.redMul(o),this.t&&(this.t=this.t.redMul(o)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(o){return this===o||this.getX().cmp(o.getX())===0&&this.getY().cmp(o.getY())===0},s.prototype.eqXToP=function(o){var f=o.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;for(var n=o.clone(),c=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(c),this.x.cmp(f)===0)return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,$a}var xu;function wd(){return xu||(xu=1,(function(d){var e=d;e.base=Yr(),e.short=Hl(),e.mont=Kl(),e.edwards=jl()})(ja)),ja}var Wa={},Ya={},Me={},Eu;function It(){if(Eu)return Me;Eu=1;var d=lt(),e=pe();Me.inherits=e;function t($,k){return($.charCodeAt(k)&64512)!==55296||k<0||k+1>=$.length?!1:($.charCodeAt(k+1)&64512)===56320}function i($,k){if(Array.isArray($))return $.slice();if(!$)return[];var m=[];if(typeof $=="string")if(k){if(k==="hex")for($=$.replace(/[^a-z0-9]+/ig,""),$.length%2!==0&&($="0"+$),O=0;O<$.length;O+=2)m.push(parseInt($[O]+$[O+1],16))}else for(var E=0,O=0;O<$.length;O++){var R=$.charCodeAt(O);R<128?m[E++]=R:R<2048?(m[E++]=R>>6|192,m[E++]=R&63|128):t($,O)?(R=65536+((R&1023)<<10)+($.charCodeAt(++O)&1023),m[E++]=R>>18|240,m[E++]=R>>12&63|128,m[E++]=R>>6&63|128,m[E++]=R&63|128):(m[E++]=R>>12|224,m[E++]=R>>6&63|128,m[E++]=R&63|128)}else for(O=0;O<$.length;O++)m[O]=$[O]|0;return m}Me.toArray=i;function u($){for(var k="",m=0;m<$.length;m++)k+=a($[m].toString(16));return k}Me.toHex=u;function r($){var k=$>>>24|$>>>8&65280|$<<8&16711680|($&255)<<24;return k>>>0}Me.htonl=r;function s($,k){for(var m="",E=0;E<$.length;E++){var O=$[E];k==="little"&&(O=r(O)),m+=o(O.toString(16))}return m}Me.toHex32=s;function a($){return $.length===1?"0"+$:$}Me.zero2=a;function o($){return $.length===7?"0"+$:$.length===6?"00"+$:$.length===5?"000"+$:$.length===4?"0000"+$:$.length===3?"00000"+$:$.length===2?"000000"+$:$.length===1?"0000000"+$:$}Me.zero8=o;function f($,k,m,E){var O=m-k;d(O%4===0);for(var R=new Array(O/4),A=0,F=k;A<R.length;A++,F+=4){var K;E==="big"?K=$[F]<<24|$[F+1]<<16|$[F+2]<<8|$[F+3]:K=$[F+3]<<24|$[F+2]<<16|$[F+1]<<8|$[F],R[A]=K>>>0}return R}Me.join32=f;function n($,k){for(var m=new Array($.length*4),E=0,O=0;E<$.length;E++,O+=4){var R=$[E];k==="big"?(m[O]=R>>>24,m[O+1]=R>>>16&255,m[O+2]=R>>>8&255,m[O+3]=R&255):(m[O+3]=R>>>24,m[O+2]=R>>>16&255,m[O+1]=R>>>8&255,m[O]=R&255)}return m}Me.split32=n;function c($,k){return $>>>k|$<<32-k}Me.rotr32=c;function h($,k){return $<<k|$>>>32-k}Me.rotl32=h;function l($,k){return $+k>>>0}Me.sum32=l;function b($,k,m){return $+k+m>>>0}Me.sum32_3=b;function p($,k,m,E){return $+k+m+E>>>0}Me.sum32_4=p;function y($,k,m,E,O){return $+k+m+E+O>>>0}Me.sum32_5=y;function v($,k,m,E){var O=$[k],R=$[k+1],A=E+R>>>0,F=(A<E?1:0)+m+O;$[k]=F>>>0,$[k+1]=A}Me.sum64=v;function g($,k,m,E){var O=k+E>>>0,R=(O<k?1:0)+$+m;return R>>>0}Me.sum64_hi=g;function x($,k,m,E){var O=k+E;return O>>>0}Me.sum64_lo=x;function B($,k,m,E,O,R,A,F){var K=0,L=k;L=L+E>>>0,K+=L<k?1:0,L=L+R>>>0,K+=L<R?1:0,L=L+F>>>0,K+=L<F?1:0;var _=$+m+O+A+K;return _>>>0}Me.sum64_4_hi=B;function I($,k,m,E,O,R,A,F){var K=k+E+R+F;return K>>>0}Me.sum64_4_lo=I;function T($,k,m,E,O,R,A,F,K,L){var _=0,U=k;U=U+E>>>0,_+=U<k?1:0,U=U+R>>>0,_+=U<R?1:0,U=U+F>>>0,_+=U<F?1:0,U=U+L>>>0,_+=U<L?1:0;var fe=$+m+O+A+K+_;return fe>>>0}Me.sum64_5_hi=T;function j($,k,m,E,O,R,A,F,K,L){var _=k+E+R+F+L;return _>>>0}Me.sum64_5_lo=j;function G($,k,m){var E=k<<32-m|$>>>m;return E>>>0}Me.rotr64_hi=G;function z($,k,m){var E=$<<32-m|k>>>m;return E>>>0}Me.rotr64_lo=z;function te($,k,m){return $>>>m}Me.shr64_hi=te;function ne($,k,m){var E=$<<32-m|k>>>m;return E>>>0}return Me.shr64_lo=ne,Me}var Ja={},Bu;function lr(){if(Bu)return Ja;Bu=1;var d=It(),e=lt();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 Ja.BlockHash=t,t.prototype.update=function(u,r){if(u=d.toArray(u,r),this.pending?this.pending=this.pending.concat(u):this.pending=u,this.pendingTotal+=u.length,this.pending.length>=this._delta8){u=this.pending;var s=u.length%this._delta8;this.pending=u.slice(u.length-s,u.length),this.pending.length===0&&(this.pending=null),u=d.join32(u,0,u.length-s,this.endian);for(var a=0;a<u.length;a+=this._delta32)this._update(u,a,a+this._delta32)}return this},t.prototype.digest=function(u){return this.update(this._pad()),e(this.pending===null),this._digest(u)},t.prototype._pad=function(){var u=this.pendingTotal,r=this._delta8,s=r-(u+this.padLength)%r,a=new Array(s+this.padLength);a[0]=128;for(var o=1;o<s;o++)a[o]=0;if(u<<=3,this.endian==="big"){for(var f=8;f<this.padLength;f++)a[o++]=0;a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=u>>>24&255,a[o++]=u>>>16&255,a[o++]=u>>>8&255,a[o++]=u&255}else for(a[o++]=u&255,a[o++]=u>>>8&255,a[o++]=u>>>16&255,a[o++]=u>>>24&255,a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0,f=8;f<this.padLength;f++)a[o++]=0;return a},Ja}var Ct={},Et={},Ru;function _d(){if(Ru)return Et;Ru=1;var d=It(),e=d.rotr32;function t(n,c,h,l){if(n===0)return i(c,h,l);if(n===1||n===3)return r(c,h,l);if(n===2)return u(c,h,l)}Et.ft_1=t;function i(n,c,h){return n&c^~n&h}Et.ch32=i;function u(n,c,h){return n&c^n&h^c&h}Et.maj32=u;function r(n,c,h){return n^c^h}Et.p32=r;function s(n){return e(n,2)^e(n,13)^e(n,22)}Et.s0_256=s;function a(n){return e(n,6)^e(n,11)^e(n,25)}Et.s1_256=a;function o(n){return e(n,7)^e(n,18)^n>>>3}Et.g0_256=o;function f(n){return e(n,17)^e(n,19)^n>>>10}return Et.g1_256=f,Et}var Xa,Iu;function zl(){if(Iu)return Xa;Iu=1;var d=It(),e=lr(),t=_d(),i=d.rotl32,u=d.sum32,r=d.sum32_5,s=t.ft_1,a=e.BlockHash,o=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return d.inherits(f,a),Xa=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(c,h){for(var l=this.W,b=0;b<16;b++)l[b]=c[h+b];for(;b<l.length;b++)l[b]=i(l[b-3]^l[b-8]^l[b-14]^l[b-16],1);var p=this.h[0],y=this.h[1],v=this.h[2],g=this.h[3],x=this.h[4];for(b=0;b<l.length;b++){var B=~~(b/20),I=r(i(p,5),s(B,y,v,g),x,l[b],o[B]);x=g,g=v,v=i(y,30),y=p,p=I}this.h[0]=u(this.h[0],p),this.h[1]=u(this.h[1],y),this.h[2]=u(this.h[2],v),this.h[3]=u(this.h[3],g),this.h[4]=u(this.h[4],x)},f.prototype._digest=function(c){return c==="hex"?d.toHex32(this.h,"big"):d.split32(this.h,"big")},Xa}var Qa,Au;function Sd(){if(Au)return Qa;Au=1;var d=It(),e=lr(),t=_d(),i=lt(),u=d.sum32,r=d.sum32_4,s=d.sum32_5,a=t.ch32,o=t.maj32,f=t.s0_256,n=t.s1_256,c=t.g0_256,h=t.g1_256,l=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 p(){if(!(this instanceof p))return new p;l.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}return d.inherits(p,l),Qa=p,p.blockSize=512,p.outSize=256,p.hmacStrength=192,p.padLength=64,p.prototype._update=function(v,g){for(var x=this.W,B=0;B<16;B++)x[B]=v[g+B];for(;B<x.length;B++)x[B]=r(h(x[B-2]),x[B-7],c(x[B-15]),x[B-16]);var I=this.h[0],T=this.h[1],j=this.h[2],G=this.h[3],z=this.h[4],te=this.h[5],ne=this.h[6],$=this.h[7];for(i(this.k.length===x.length),B=0;B<x.length;B++){var k=s($,n(z),a(z,te,ne),this.k[B],x[B]),m=u(f(I),o(I,T,j));$=ne,ne=te,te=z,z=u(G,k),G=j,j=T,T=I,I=u(k,m)}this.h[0]=u(this.h[0],I),this.h[1]=u(this.h[1],T),this.h[2]=u(this.h[2],j),this.h[3]=u(this.h[3],G),this.h[4]=u(this.h[4],z),this.h[5]=u(this.h[5],te),this.h[6]=u(this.h[6],ne),this.h[7]=u(this.h[7],$)},p.prototype._digest=function(v){return v==="hex"?d.toHex32(this.h,"big"):d.split32(this.h,"big")},Qa}var Za,Ou;function Vl(){if(Ou)return Za;Ou=1;var d=It(),e=Sd();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return d.inherits(t,e),Za=t,t.blockSize=512,t.outSize=224,t.hmacStrength=192,t.padLength=64,t.prototype._digest=function(u){return u==="hex"?d.toHex32(this.h.slice(0,7),"big"):d.split32(this.h.slice(0,7),"big")},Za}var ef,Pu;function xd(){if(Pu)return ef;Pu=1;var d=It(),e=lr(),t=lt(),i=d.rotr64_hi,u=d.rotr64_lo,r=d.shr64_hi,s=d.shr64_lo,a=d.sum64,o=d.sum64_hi,f=d.sum64_lo,n=d.sum64_4_hi,c=d.sum64_4_lo,h=d.sum64_5_hi,l=d.sum64_5_lo,b=e.BlockHash,p=[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 y(){if(!(this instanceof y))return new y;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=p,this.W=new Array(160)}d.inherits(y,b),ef=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(m,E){for(var O=this.W,R=0;R<32;R++)O[R]=m[E+R];for(;R<O.length;R+=2){var A=ne(O[R-4],O[R-3]),F=$(O[R-4],O[R-3]),K=O[R-14],L=O[R-13],_=z(O[R-30],O[R-29]),U=te(O[R-30],O[R-29]),fe=O[R-32],se=O[R-31];O[R]=n(A,F,K,L,_,U,fe,se),O[R+1]=c(A,F,K,L,_,U,fe,se)}},y.prototype._update=function(m,E){this._prepareBlock(m,E);var O=this.W,R=this.h[0],A=this.h[1],F=this.h[2],K=this.h[3],L=this.h[4],_=this.h[5],U=this.h[6],fe=this.h[7],se=this.h[8],V=this.h[9],P=this.h[10],M=this.h[11],Y=this.h[12],Q=this.h[13],D=this.h[14],C=this.h[15];t(this.k.length===O.length);for(var J=0;J<O.length;J+=2){var ie=D,he=C,oe=j(se,V),ue=G(se,V),ge=v(se,V,P,M,Y),Ke=g(se,V,P,M,Y,Q),Se=this.k[J],de=this.k[J+1],Re=O[J],ve=O[J+1],me=h(ie,he,oe,ue,ge,Ke,Se,de,Re,ve),Le=l(ie,he,oe,ue,ge,Ke,Se,de,Re,ve);ie=I(R,A),he=T(R,A),oe=x(R,A,F,K,L),ue=B(R,A,F,K,L,_);var Pe=o(ie,he,oe,ue),N=f(ie,he,oe,ue);D=Y,C=Q,Y=P,Q=M,P=se,M=V,se=o(U,fe,me,Le),V=f(fe,fe,me,Le),U=L,fe=_,L=F,_=K,F=R,K=A,R=o(me,Le,Pe,N),A=f(me,Le,Pe,N)}a(this.h,0,R,A),a(this.h,2,F,K),a(this.h,4,L,_),a(this.h,6,U,fe),a(this.h,8,se,V),a(this.h,10,P,M),a(this.h,12,Y,Q),a(this.h,14,D,C)},y.prototype._digest=function(m){return m==="hex"?d.toHex32(this.h,"big"):d.split32(this.h,"big")};function v(k,m,E,O,R){var A=k&E^~k&R;return A<0&&(A+=4294967296),A}function g(k,m,E,O,R,A){var F=m&O^~m&A;return F<0&&(F+=4294967296),F}function x(k,m,E,O,R){var A=k&E^k&R^E&R;return A<0&&(A+=4294967296),A}function B(k,m,E,O,R,A){var F=m&O^m&A^O&A;return F<0&&(F+=4294967296),F}function I(k,m){var E=i(k,m,28),O=i(m,k,2),R=i(m,k,7),A=E^O^R;return A<0&&(A+=4294967296),A}function T(k,m){var E=u(k,m,28),O=u(m,k,2),R=u(m,k,7),A=E^O^R;return A<0&&(A+=4294967296),A}function j(k,m){var E=i(k,m,14),O=i(k,m,18),R=i(m,k,9),A=E^O^R;return A<0&&(A+=4294967296),A}function G(k,m){var E=u(k,m,14),O=u(k,m,18),R=u(m,k,9),A=E^O^R;return A<0&&(A+=4294967296),A}function z(k,m){var E=i(k,m,1),O=i(k,m,8),R=r(k,m,7),A=E^O^R;return A<0&&(A+=4294967296),A}function te(k,m){var E=u(k,m,1),O=u(k,m,8),R=s(k,m,7),A=E^O^R;return A<0&&(A+=4294967296),A}function ne(k,m){var E=i(k,m,19),O=i(m,k,29),R=r(k,m,6),A=E^O^R;return A<0&&(A+=4294967296),A}function $(k,m){var E=u(k,m,19),O=u(m,k,29),R=s(k,m,6),A=E^O^R;return A<0&&(A+=4294967296),A}return ef}var tf,ku;function Gl(){if(ku)return tf;ku=1;var d=It(),e=xd();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 d.inherits(t,e),tf=t,t.blockSize=1024,t.outSize=384,t.hmacStrength=192,t.padLength=128,t.prototype._digest=function(u){return u==="hex"?d.toHex32(this.h.slice(0,12),"big"):d.split32(this.h.slice(0,12),"big")},tf}var Nu;function $l(){return Nu||(Nu=1,Ct.sha1=zl(),Ct.sha224=Vl(),Ct.sha256=Sd(),Ct.sha384=Gl(),Ct.sha512=xd()),Ct}var rf={},Mu;function Wl(){if(Mu)return rf;Mu=1;var d=It(),e=lr(),t=d.rotl32,i=d.sum32,u=d.sum32_3,r=d.sum32_4,s=e.BlockHash;function a(){if(!(this instanceof a))return new a;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}d.inherits(a,s),rf.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(y,v){for(var g=this.h[0],x=this.h[1],B=this.h[2],I=this.h[3],T=this.h[4],j=g,G=x,z=B,te=I,ne=T,$=0;$<80;$++){var k=i(t(r(g,o($,x,B,I),y[c[$]+v],f($)),l[$]),T);g=T,T=I,I=t(B,10),B=x,x=k,k=i(t(r(j,o(79-$,G,z,te),y[h[$]+v],n($)),b[$]),ne),j=ne,ne=te,te=t(z,10),z=G,G=k}k=u(this.h[1],B,te),this.h[1]=u(this.h[2],I,ne),this.h[2]=u(this.h[3],T,j),this.h[3]=u(this.h[4],g,G),this.h[4]=u(this.h[0],x,z),this.h[0]=k},a.prototype._digest=function(y){return y==="hex"?d.toHex32(this.h,"little"):d.split32(this.h,"little")};function o(p,y,v,g){return p<=15?y^v^g:p<=31?y&v|~y&g:p<=47?(y|~v)^g:p<=63?y&g|v&~g:y^(v|~g)}function f(p){return p<=15?0:p<=31?1518500249:p<=47?1859775393:p<=63?2400959708:2840853838}function n(p){return p<=15?1352829926:p<=31?1548603684:p<=47?1836072691:p<=63?2053994217:0}var c=[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],h=[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],l=[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 rf}var nf,Cu;function Yl(){if(Cu)return nf;Cu=1;var d=It(),e=lt();function t(i,u,r){if(!(this instanceof t))return new t(i,u,r);this.Hash=i,this.blockSize=i.blockSize/8,this.outSize=i.outSize/8,this.inner=null,this.outer=null,this._init(d.toArray(u,r))}return nf=t,t.prototype._init=function(u){u.length>this.blockSize&&(u=new this.Hash().update(u).digest()),e(u.length<=this.blockSize);for(var r=u.length;r<this.blockSize;r++)u.push(0);for(r=0;r<u.length;r++)u[r]^=54;for(this.inner=new this.Hash().update(u),r=0;r<u.length;r++)u[r]^=106;this.outer=new this.Hash().update(u)},t.prototype.update=function(u,r){return this.inner.update(u,r),this},t.prototype.digest=function(u){return this.outer.update(this.inner.digest()),this.outer.digest(u)},nf}var Tu;function br(){return Tu||(Tu=1,(function(d){var e=d;e.utils=It(),e.common=lr(),e.sha=$l(),e.ripemd=Wl(),e.hmac=Yl(),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})(Ya)),Ya}var af,Lu;function Jl(){return Lu||(Lu=1,af={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"]]}}),af}var Du;function ms(){return Du||(Du=1,(function(d){var e=d,t=br(),i=wd(),u=St(),r=u.assert;function s(f){f.type==="short"?this.curve=new i.short(f):f.type==="edwards"?this.curve=new i.edwards(f):this.curve=new i.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,r(this.g.validate(),"Invalid curve"),r(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=s;function a(f,n){Object.defineProperty(e,f,{configurable:!0,enumerable:!0,get:function(){var c=new s(n);return Object.defineProperty(e,f,{configurable:!0,enumerable:!0,value:c}),c}})}a("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:t.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:t.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:t.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:t.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"]}),a("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:t.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["9"]}),a("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:t.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=Jl()}catch{o=void 0}a("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",o]})})(Wa)),Wa}var ff,Fu;function Ed(){if(Fu)return ff;Fu=1;var d=br(),e=ns(),t=lt();function i(u){if(!(this instanceof i))return new i(u);this.hash=u.hash,this.predResist=!!u.predResist,this.outLen=this.hash.outSize,this.minEntropy=u.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var r=e.toArray(u.entropy,u.entropyEnc||"hex"),s=e.toArray(u.nonce,u.nonceEnc||"hex"),a=e.toArray(u.pers,u.persEnc||"hex");t(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(r,s,a)}return ff=i,i.prototype._init=function(r,s,a){var o=r.concat(s).concat(a);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(o),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new d.hmac(this.hash,this.K)},i.prototype._update=function(r){var s=this._hmac().update(this.V).update([0]);r&&(s=s.update(r)),this.K=s.digest(),this.V=this._hmac().update(this.V).digest(),r&&(this.K=this._hmac().update(this.V).update([1]).update(r).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(r,s,a,o){typeof s!="string"&&(o=a,a=s,s=null),r=e.toArray(r,s),a=e.toArray(a,o),t(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(a||[])),this._reseed=1},i.prototype.generate=function(r,s,a,o){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof s!="string"&&(o=a,a=s,s=null),a&&(a=e.toArray(a,o||"hex"),this._update(a));for(var f=[];f.length<r;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var n=f.slice(0,r);return this._update(a),this._reseed++,e.encode(n,s)},ff}var sf,qu;function Xl(){if(qu)return sf;qu=1;var d=Te(),e=St(),t=e.assert;function i(u,r){this.ec=u,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}return sf=i,i.fromPublic=function(r,s,a){return s instanceof i?s:new i(r,{pub:s,pubEnc:a})},i.fromPrivate=function(r,s,a){return s instanceof i?s:new i(r,{priv:s,privEnc:a})},i.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.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"}},i.prototype.getPublic=function(r,s){return typeof r=="string"&&(s=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),s?this.pub.encode(s,r):this.pub},i.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(r,s){this.priv=new d(r,s||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(r,s){if(r.x||r.y){this.ec.curve.type==="mont"?t(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&t(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,s)},i.prototype.derive=function(r){return r.validate()||t(r.validate(),"public point not validated"),r.mul(this.priv).getX()},i.prototype.sign=function(r,s,a){return this.ec.sign(r,this,s,a)},i.prototype.verify=function(r,s,a){return this.ec.verify(r,s,this,void 0,a)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},sf}var of,Uu;function Ql(){if(Uu)return of;Uu=1;var d=Te(),e=St(),t=e.assert;function i(o,f){if(o instanceof i)return o;this._importDER(o,f)||(t(o.r&&o.s,"Signature without r or s"),this.r=new d(o.r,16),this.s=new d(o.s,16),o.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=o.recoveryParam)}of=i;function u(){this.place=0}function r(o,f){var n=o[f.place++];if(!(n&128))return n;var c=n&15;if(c===0||c>4||o[f.place]===0)return!1;for(var h=0,l=0,b=f.place;l<c;l++,b++)h<<=8,h|=o[b],h>>>=0;return h<=127?!1:(f.place=b,h)}function s(o){for(var f=0,n=o.length-1;!o[f]&&!(o[f+1]&128)&&f<n;)f++;return f===0?o:o.slice(f)}i.prototype._importDER=function(f,n){f=e.toArray(f,n);var c=new u;if(f[c.place++]!==48)return!1;var h=r(f,c);if(h===!1||h+c.place!==f.length||f[c.place++]!==2)return!1;var l=r(f,c);if(l===!1||(f[c.place]&128)!==0)return!1;var b=f.slice(c.place,l+c.place);if(c.place+=l,f[c.place++]!==2)return!1;var p=r(f,c);if(p===!1||f.length!==p+c.place||(f[c.place]&128)!==0)return!1;var y=f.slice(c.place,p+c.place);if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;if(y[0]===0)if(y[1]&128)y=y.slice(1);else return!1;return this.r=new d(b),this.s=new d(y),this.recoveryParam=null,!0};function a(o,f){if(f<128){o.push(f);return}var n=1+(Math.log(f)/Math.LN2>>>3);for(o.push(n|128);--n;)o.push(f>>>(n<<3)&255);o.push(f)}return i.prototype.toDER=function(f){var n=this.r.toArray(),c=this.s.toArray();for(n[0]&128&&(n=[0].concat(n)),c[0]&128&&(c=[0].concat(c)),n=s(n),c=s(c);!c[0]&&!(c[1]&128);)c=c.slice(1);var h=[2];a(h,n.length),h=h.concat(n),h.push(2),a(h,c.length);var l=h.concat(c),b=[48];return a(b,l.length),b=b.concat(l),e.encode(b,f)},of}var cf,Hu;function Zl(){if(Hu)return cf;Hu=1;var d=Te(),e=Ed(),t=St(),i=ms(),u=vr(),r=t.assert,s=Xl(),a=Ql();function o(f){if(!(this instanceof o))return new o(f);typeof f=="string"&&(r(Object.prototype.hasOwnProperty.call(i,f),"Unknown curve "+f),f=i[f]),f instanceof i.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 cf=o,o.prototype.keyPair=function(n){return new s(this,n)},o.prototype.keyFromPrivate=function(n,c){return s.fromPrivate(this,n,c)},o.prototype.keyFromPublic=function(n,c){return s.fromPublic(this,n,c)},o.prototype.genKeyPair=function(n){n||(n={});for(var c=new e({hash:this.hash,pers:n.pers,persEnc:n.persEnc||"utf8",entropy:n.entropy||u(this.hash.hmacStrength),entropyEnc:n.entropy&&n.entropyEnc||"utf8",nonce:this.n.toArray()}),h=this.n.byteLength(),l=this.n.sub(new d(2));;){var b=new d(c.generate(h));if(!(b.cmp(l)>0))return b.iaddn(1),this.keyFromPrivate(b)}},o.prototype._truncateToN=function(n,c,h){var l;if(d.isBN(n)||typeof n=="number")n=new d(n,16),l=n.byteLength();else if(typeof n=="object")l=n.length,n=new d(n,16);else{var b=n.toString();l=b.length+1>>>1,n=new d(b,16)}typeof h!="number"&&(h=l*8);var p=h-this.n.bitLength();return p>0&&(n=n.ushrn(p)),!c&&n.cmp(this.n)>=0?n.sub(this.n):n},o.prototype.sign=function(n,c,h,l){if(typeof h=="object"&&(l=h,h=null),l||(l={}),typeof n!="string"&&typeof n!="number"&&!d.isBN(n)){r(typeof n=="object"&&n&&typeof n.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),r(n.length>>>0===n.length);for(var b=0;b<n.length;b++)r((n[b]&255)===n[b])}c=this.keyFromPrivate(c,h),n=this._truncateToN(n,!1,l.msgBitLength),r(!n.isNeg(),"Can not sign a negative message");var p=this.n.byteLength(),y=c.getPrivate().toArray("be",p),v=n.toArray("be",p);r(new d(v).eq(n),"Can not sign message");for(var g=new e({hash:this.hash,entropy:y,nonce:v,pers:l.pers,persEnc:l.persEnc||"utf8"}),x=this.n.sub(new d(1)),B=0;;B++){var I=l.k?l.k(B):new d(g.generate(this.n.byteLength()));if(I=this._truncateToN(I,!0),!(I.cmpn(1)<=0||I.cmp(x)>=0)){var T=this.g.mul(I);if(!T.isInfinity()){var j=T.getX(),G=j.umod(this.n);if(G.cmpn(0)!==0){var z=I.invm(this.n).mul(G.mul(c.getPrivate()).iadd(n));if(z=z.umod(this.n),z.cmpn(0)!==0){var te=(T.getY().isOdd()?1:0)|(j.cmp(G)!==0?2:0);return l.canonical&&z.cmp(this.nh)>0&&(z=this.n.sub(z),te^=1),new a({r:G,s:z,recoveryParam:te})}}}}}},o.prototype.verify=function(n,c,h,l,b){b||(b={}),n=this._truncateToN(n,!1,b.msgBitLength),h=this.keyFromPublic(h,l),c=new a(c,"hex");var p=c.r,y=c.s;if(p.cmpn(1)<0||p.cmp(this.n)>=0||y.cmpn(1)<0||y.cmp(this.n)>=0)return!1;var v=y.invm(this.n),g=v.mul(n).umod(this.n),x=v.mul(p).umod(this.n),B;return this.curve._maxwellTrick?(B=this.g.jmulAdd(g,h.getPublic(),x),B.isInfinity()?!1:B.eqXToP(p)):(B=this.g.mulAdd(g,h.getPublic(),x),B.isInfinity()?!1:B.getX().umod(this.n).cmp(p)===0)},o.prototype.recoverPubKey=function(f,n,c,h){r((3&c)===c,"The recovery param is more than two bits"),n=new a(n,h);var l=this.n,b=new d(f),p=n.r,y=n.s,v=c&1,g=c>>1;if(p.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?p=this.curve.pointFromX(p.add(this.curve.n),v):p=this.curve.pointFromX(p,v);var x=n.r.invm(l),B=l.sub(b).mul(x).umod(l),I=y.mul(x).umod(l);return this.g.mulAdd(B,p,I)},o.prototype.getKeyRecoveryParam=function(f,n,c,h){if(n=new a(n,h),n.recoveryParam!==null)return n.recoveryParam;for(var l=0;l<4;l++){var b;try{b=this.recoverPubKey(f,n,l)}catch{continue}if(b.eq(c))return l}throw new Error("Unable to find valid recovery factor")},cf}var uf,Ku;function e1(){if(Ku)return uf;Ku=1;var d=St(),e=d.assert,t=d.parseBytes,i=d.cachedProperty;function u(r,s){this.eddsa=r,this._secret=t(s.secret),r.isPoint(s.pub)?this._pub=s.pub:this._pubBytes=t(s.pub)}return u.fromPublic=function(s,a){return a instanceof u?a:new u(s,{pub:a})},u.fromSecret=function(s,a){return a instanceof u?a:new u(s,{secret:a})},u.prototype.secret=function(){return this._secret},i(u,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(u,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(u,"privBytes",function(){var s=this.eddsa,a=this.hash(),o=s.encodingLength-1,f=a.slice(0,s.encodingLength);return f[0]&=248,f[o]&=127,f[o]|=64,f}),i(u,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(u,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(u,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),u.prototype.sign=function(s){return e(this._secret,"KeyPair can only verify"),this.eddsa.sign(s,this)},u.prototype.verify=function(s,a){return this.eddsa.verify(s,a,this)},u.prototype.getSecret=function(s){return e(this._secret,"KeyPair is public only"),d.encode(this.secret(),s)},u.prototype.getPublic=function(s){return d.encode(this.pubBytes(),s)},uf=u,uf}var hf,ju;function t1(){if(ju)return hf;ju=1;var d=Te(),e=St(),t=e.assert,i=e.cachedProperty,u=e.parseBytes;function r(s,a){this.eddsa=s,typeof a!="object"&&(a=u(a)),Array.isArray(a)&&(t(a.length===s.encodingLength*2,"Signature has invalid size"),a={R:a.slice(0,s.encodingLength),S:a.slice(s.encodingLength)}),t(a.R&&a.S,"Signature without R or S"),s.isPoint(a.R)&&(this._R=a.R),a.S instanceof d&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}return i(r,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),i(r,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),i(r,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),i(r,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),r.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},r.prototype.toHex=function(){return e.encode(this.toBytes(),"hex").toUpperCase()},hf=r,hf}var df,zu;function r1(){if(zu)return df;zu=1;var d=br(),e=ms(),t=St(),i=t.assert,u=t.parseBytes,r=e1(),s=t1();function a(o){if(i(o==="ed25519","only tested with ed25519 so far"),!(this instanceof a))return new a(o);o=e[o].curve,this.curve=o,this.g=o.g,this.g.precompute(o.n.bitLength()+1),this.pointClass=o.point().constructor,this.encodingLength=Math.ceil(o.n.bitLength()/8),this.hash=d.sha512}return df=a,a.prototype.sign=function(f,n){f=u(f);var c=this.keyFromSecret(n),h=this.hashInt(c.messagePrefix(),f),l=this.g.mul(h),b=this.encodePoint(l),p=this.hashInt(b,c.pubBytes(),f).mul(c.priv()),y=h.add(p).umod(this.curve.n);return this.makeSignature({R:l,S:y,Rencoded:b})},a.prototype.verify=function(f,n,c){if(f=u(f),n=this.makeSignature(n),n.S().gte(n.eddsa.curve.n)||n.S().isNeg())return!1;var h=this.keyFromPublic(c),l=this.hashInt(n.Rencoded(),h.pubBytes(),f),b=this.g.mul(n.S()),p=n.R().add(h.pub().mul(l));return p.eq(b)},a.prototype.hashInt=function(){for(var f=this.hash(),n=0;n<arguments.length;n++)f.update(arguments[n]);return t.intFromLE(f.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(f){return r.fromPublic(this,f)},a.prototype.keyFromSecret=function(f){return r.fromSecret(this,f)},a.prototype.makeSignature=function(f){return f instanceof s?f:new s(this,f)},a.prototype.encodePoint=function(f){var n=f.getY().toArray("le",this.encodingLength);return n[this.encodingLength-1]|=f.getX().isOdd()?128:0,n},a.prototype.decodePoint=function(f){f=t.parseBytes(f);var n=f.length-1,c=f.slice(0,n).concat(f[n]&-129),h=(f[n]&128)!==0,l=t.intFromLE(c);return this.curve.pointFromY(l,h)},a.prototype.encodeInt=function(f){return f.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(f){return t.intFromLE(f)},a.prototype.isPoint=function(f){return f instanceof this.pointClass},df}var Vu;function ys(){return Vu||(Vu=1,(function(d){var e=d;e.version=Ul.version,e.utils=St(),e.rand=vr(),e.curve=wd(),e.curves=ms(),e.ec=Zl(),e.eddsa=r1()})(Ha)),Ha}var vt={},lf={},bf={},Gu;function i1(){return Gu||(Gu=1,(function(d){var e=pr(),t=pe(),i=d;i.define=function(s,a){return new u(s,a)};function u(r,s){this.name=r,this.body=s,this.decoders={},this.encoders={}}u.prototype._createNamed=function(s){var a;try{a=$t.runInThisContext("(function "+this.name+`(entity) {
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}function $d(d){if(Object.prototype.hasOwnProperty.call(d,"__esModule"))return d;var e=d.default;if(typeof e=="function"){var t=function i(){var u=!1;try{u=this instanceof i}catch{}return u?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(d).forEach(function(i){var u=Object.getOwnPropertyDescriptor(d,i);Object.defineProperty(t,i,u.get?u:{enumerable:!0,get:function(){return d[i]}})}),t}var wi,Ns;function Wd(){if(Ns)return wi;Ns=1,wi=d;function d(e){this._tables[0][0][0]||this._precompute();var t,i,u,r=this._tables[0][4],s=this._tables[1],a=e.length,o=1;if(a!==4&&a!==6&&a!==8)throw new Error("invalid aes key size");this._key=[i=e.slice(0),u=[]];for(var f=a;f<4*a+28;f++)t=i[f-1],(f%a===0||a===8&&f%a===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[t&255],f%a===0&&(t=t<<8^t>>>24^o<<24,o=o<<1^(o>>7)*283)),i[f]=i[f-a]^t;for(var n=0;f;n++,f--)t=i[n&3?f:f-4],f<=4||n<4?u[n]=t:u[n]=s[0][r[t>>>24]]^s[1][r[t>>16&255]]^s[2][r[t>>8&255]]^s[3][r[t&255]]}return d.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],i=e[4],u=t[4],r,s,a,o=new Uint8Array(256),f=new Uint8Array(256),n,c,h,l,p,b;for(r=0;r<256;r++)f[(o[r]=r<<1^(r>>7)*283)^r]=r;for(s=a=0;!i[s];s^=n||1,a=f[a]||1)for(l=a^a<<1^a<<2^a<<3^a<<4,l=l>>8^l&255^99,i[s]=l,u[l]=s,h=o[c=o[n=o[s]]],b=h*16843009^c*65537^n*257^s*16843008,p=o[l]*257^l*16843008,r=0;r<4;r++)e[r][s]=p=p<<24^p>>>8,t[r][l]=b=b<<24^b>>>8},_crypt:function(e,t){if(e.length!==4)throw new Error("invalid aes block size");var i=this._key[t],u=e[0]^i[0],r=e[t?3:1]^i[1],s=e[2]^i[2],a=e[t?1:3]^i[3],o,f,n,c=i.length/4-2,h,l=4,p=new Uint32Array(4),b=this._tables[t],y=b[0],v=b[1],g=b[2],x=b[3],B=b[4];for(h=0;h<c;h++)o=y[u>>>24]^v[r>>16&255]^g[s>>8&255]^x[a&255]^i[l],f=y[r>>>24]^v[s>>16&255]^g[a>>8&255]^x[u&255]^i[l+1],n=y[s>>>24]^v[a>>16&255]^g[u>>8&255]^x[r&255]^i[l+2],a=y[a>>>24]^v[u>>16&255]^g[r>>8&255]^x[s&255]^i[l+3],l+=4,u=o,r=f,s=n;for(h=0;h<4;h++)p[t?3&-h:h]=B[u>>>24]<<24^B[r>>16&255]<<16^B[s>>8&255]<<8^B[a&255]^i[l++],o=u,u=r,r=s,s=a,a=o;return p}},wi}var Yd=Wd();const as=$t(Yd);var Dr={exports:{}};const Jd={},Xd=Object.freeze(Object.defineProperty({__proto__:null,default:Jd},Symbol.toStringTag,{value:"Module"})),Wt=$d(Xd);var Qd=Dr.exports,ks;function Te(){return ks||(ks=1,(function(d){(function(e,t){function i(N,m){if(!N)throw new Error(m||"Assertion failed")}function u(N,m){N.super_=m;var E=function(){};E.prototype=m.prototype,N.prototype=new E,N.prototype.constructor=N}function r(N,m,E){if(r.isBN(N))return N;this.negative=0,this.words=null,this.length=0,this.red=null,N!==null&&((m==="le"||m==="be")&&(E=m,m=10),this._init(N||0,m||10,E||"be"))}typeof e=="object"?e.exports=r:t.BN=r,r.BN=r,r.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=Wt.Buffer}catch{}r.isBN=function(m){return m instanceof r?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===r.wordSize&&Array.isArray(m.words)},r.max=function(m,E){return m.cmp(E)>0?m:E},r.min=function(m,E){return m.cmp(E)<0?m:E},r.prototype._init=function(m,E,O){if(typeof m=="number")return this._initNumber(m,E,O);if(typeof m=="object")return this._initArray(m,E,O);E==="hex"&&(E=16),i(E===(E|0)&&E>=2&&E<=36),m=m.toString().replace(/\s+/g,"");var I=0;m[0]==="-"&&(I++,this.negative=1),I<m.length&&(E===16?this._parseHex(m,I,O):(this._parseBase(m,E,I),O==="le"&&this._initArray(this.toArray(),E,O)))},r.prototype._initNumber=function(m,E,O){m<0&&(this.negative=1,m=-m),m<67108864?(this.words=[m&67108863],this.length=1):m<4503599627370496?(this.words=[m&67108863,m/67108864&67108863],this.length=2):(i(m<9007199254740992),this.words=[m&67108863,m/67108864&67108863,1],this.length=3),O==="le"&&this._initArray(this.toArray(),E,O)},r.prototype._initArray=function(m,E,O){if(i(typeof m.length=="number"),m.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(m.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var A,F,K=0;if(O==="be")for(I=m.length-1,A=0;I>=0;I-=3)F=m[I]|m[I-1]<<8|m[I-2]<<16,this.words[A]|=F<<K&67108863,this.words[A+1]=F>>>26-K&67108863,K+=24,K>=26&&(K-=26,A++);else if(O==="le")for(I=0,A=0;I<m.length;I+=3)F=m[I]|m[I+1]<<8|m[I+2]<<16,this.words[A]|=F<<K&67108863,this.words[A+1]=F>>>26-K&67108863,K+=24,K>=26&&(K-=26,A++);return this._strip()};function a(N,m){var E=N.charCodeAt(m);if(E>=48&&E<=57)return E-48;if(E>=65&&E<=70)return E-55;if(E>=97&&E<=102)return E-87;i(!1,"Invalid character in "+N)}function o(N,m,E){var O=a(N,E);return E-1>=m&&(O|=a(N,E-1)<<4),O}r.prototype._parseHex=function(m,E,O){this.length=Math.ceil((m.length-E)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var A=0,F=0,K;if(O==="be")for(I=m.length-1;I>=E;I-=2)K=o(m,E,I)<<A,this.words[F]|=K&67108863,A>=18?(A-=18,F+=1,this.words[F]|=K>>>26):A+=8;else{var L=m.length-E;for(I=L%2===0?E+1:E;I<m.length;I+=2)K=o(m,E,I)<<A,this.words[F]|=K&67108863,A>=18?(A-=18,F+=1,this.words[F]|=K>>>26):A+=8}this._strip()};function f(N,m,E,O){for(var I=0,A=0,F=Math.min(N.length,E),K=m;K<F;K++){var L=N.charCodeAt(K)-48;I*=O,L>=49?A=L-49+10:L>=17?A=L-17+10:A=L,i(L>=0&&A<O,"Invalid character"),I+=A}return I}r.prototype._parseBase=function(m,E,O){this.words=[0],this.length=1;for(var I=0,A=1;A<=67108863;A*=E)I++;I--,A=A/E|0;for(var F=m.length-O,K=F%I,L=Math.min(F,F-K)+O,_=0,q=O;q<L;q+=I)_=f(m,q,q+I,E),this.imuln(A),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_);if(K!==0){var fe=1;for(_=f(m,q,m.length,E),q=0;q<K;q++)fe*=E;this.imuln(fe),this.words[0]+_<67108864?this.words[0]+=_:this._iaddn(_)}this._strip()},r.prototype.copy=function(m){m.words=new Array(this.length);for(var E=0;E<this.length;E++)m.words[E]=this.words[E];m.length=this.length,m.negative=this.negative,m.red=this.red};function n(N,m){N.words=m.words,N.length=m.length,N.negative=m.negative,N.red=m.red}if(r.prototype._move=function(m){n(m,this)},r.prototype.clone=function(){var m=new r(null);return this.copy(m),m},r.prototype._expand=function(m){for(;this.length<m;)this.words[this.length++]=0;return this},r.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch{r.prototype.inspect=c}else r.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","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"],l=[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],p=[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];r.prototype.toString=function(m,E){m=m||10,E=E|0||1;var O;if(m===16||m==="hex"){O="";for(var I=0,A=0,F=0;F<this.length;F++){var K=this.words[F],L=((K<<I|A)&16777215).toString(16);A=K>>>24-I&16777215,I+=2,I>=26&&(I-=26,F--),A!==0||F!==this.length-1?O=h[6-L.length]+L+O:O=L+O}for(A!==0&&(O=A.toString(16)+O);O.length%E!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}if(m===(m|0)&&m>=2&&m<=36){var _=l[m],q=p[m];O="";var fe=this.clone();for(fe.negative=0;!fe.isZero();){var se=fe.modrn(q).toString(m);fe=fe.idivn(q),fe.isZero()?O=se+O:O=h[_-se.length]+se+O}for(this.isZero()&&(O="0"+O);O.length%E!==0;)O="0"+O;return this.negative!==0&&(O="-"+O),O}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},r.prototype.toJSON=function(){return this.toString(16,2)},s&&(r.prototype.toBuffer=function(m,E){return this.toArrayLike(s,m,E)}),r.prototype.toArray=function(m,E){return this.toArrayLike(Array,m,E)};var b=function(m,E){return m.allocUnsafe?m.allocUnsafe(E):new m(E)};r.prototype.toArrayLike=function(m,E,O){this._strip();var I=this.byteLength(),A=O||Math.max(1,I);i(I<=A,"byte array longer than desired length"),i(A>0,"Requested array length <= 0");var F=b(m,A),K=E==="le"?"LE":"BE";return this["_toArrayLike"+K](F,I),F},r.prototype._toArrayLikeLE=function(m,E){for(var O=0,I=0,A=0,F=0;A<this.length;A++){var K=this.words[A]<<F|I;m[O++]=K&255,O<m.length&&(m[O++]=K>>8&255),O<m.length&&(m[O++]=K>>16&255),F===6?(O<m.length&&(m[O++]=K>>24&255),I=0,F=0):(I=K>>>24,F+=2)}if(O<m.length)for(m[O++]=I;O<m.length;)m[O++]=0},r.prototype._toArrayLikeBE=function(m,E){for(var O=m.length-1,I=0,A=0,F=0;A<this.length;A++){var K=this.words[A]<<F|I;m[O--]=K&255,O>=0&&(m[O--]=K>>8&255),O>=0&&(m[O--]=K>>16&255),F===6?(O>=0&&(m[O--]=K>>24&255),I=0,F=0):(I=K>>>24,F+=2)}if(O>=0)for(m[O--]=I;O>=0;)m[O--]=0},Math.clz32?r.prototype._countBits=function(m){return 32-Math.clz32(m)}:r.prototype._countBits=function(m){var E=m,O=0;return E>=4096&&(O+=13,E>>>=13),E>=64&&(O+=7,E>>>=7),E>=8&&(O+=4,E>>>=4),E>=2&&(O+=2,E>>>=2),O+E},r.prototype._zeroBits=function(m){if(m===0)return 26;var E=m,O=0;return(E&8191)===0&&(O+=13,E>>>=13),(E&127)===0&&(O+=7,E>>>=7),(E&15)===0&&(O+=4,E>>>=4),(E&3)===0&&(O+=2,E>>>=2),(E&1)===0&&O++,O},r.prototype.bitLength=function(){var m=this.words[this.length-1],E=this._countBits(m);return(this.length-1)*26+E};function y(N){for(var m=new Array(N.bitLength()),E=0;E<m.length;E++){var O=E/26|0,I=E%26;m[E]=N.words[O]>>>I&1}return m}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,E=0;E<this.length;E++){var O=this._zeroBits(this.words[E]);if(m+=O,O!==26)break}return m},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(m){return this.negative!==0?this.abs().inotn(m).iaddn(1):this.clone()},r.prototype.fromTwos=function(m){return this.testn(m-1)?this.notn(m).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(m){for(;this.length<m.length;)this.words[this.length++]=0;for(var E=0;E<m.length;E++)this.words[E]=this.words[E]|m.words[E];return this._strip()},r.prototype.ior=function(m){return i((this.negative|m.negative)===0),this.iuor(m)},r.prototype.or=function(m){return this.length>m.length?this.clone().ior(m):m.clone().ior(this)},r.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},r.prototype.iuand=function(m){var E;this.length>m.length?E=m:E=this;for(var O=0;O<E.length;O++)this.words[O]=this.words[O]&m.words[O];return this.length=E.length,this._strip()},r.prototype.iand=function(m){return i((this.negative|m.negative)===0),this.iuand(m)},r.prototype.and=function(m){return this.length>m.length?this.clone().iand(m):m.clone().iand(this)},r.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},r.prototype.iuxor=function(m){var E,O;this.length>m.length?(E=this,O=m):(E=m,O=this);for(var I=0;I<O.length;I++)this.words[I]=E.words[I]^O.words[I];if(this!==E)for(;I<E.length;I++)this.words[I]=E.words[I];return this.length=E.length,this._strip()},r.prototype.ixor=function(m){return i((this.negative|m.negative)===0),this.iuxor(m)},r.prototype.xor=function(m){return this.length>m.length?this.clone().ixor(m):m.clone().ixor(this)},r.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},r.prototype.inotn=function(m){i(typeof m=="number"&&m>=0);var E=Math.ceil(m/26)|0,O=m%26;this._expand(E),O>0&&E--;for(var I=0;I<E;I++)this.words[I]=~this.words[I]&67108863;return O>0&&(this.words[I]=~this.words[I]&67108863>>26-O),this._strip()},r.prototype.notn=function(m){return this.clone().inotn(m)},r.prototype.setn=function(m,E){i(typeof m=="number"&&m>=0);var O=m/26|0,I=m%26;return this._expand(O+1),E?this.words[O]=this.words[O]|1<<I:this.words[O]=this.words[O]&~(1<<I),this._strip()},r.prototype.iadd=function(m){var E;if(this.negative!==0&&m.negative===0)return this.negative=0,E=this.isub(m),this.negative^=1,this._normSign();if(this.negative===0&&m.negative!==0)return m.negative=0,E=this.isub(m),m.negative=1,E._normSign();var O,I;this.length>m.length?(O=this,I=m):(O=m,I=this);for(var A=0,F=0;F<I.length;F++)E=(O.words[F]|0)+(I.words[F]|0)+A,this.words[F]=E&67108863,A=E>>>26;for(;A!==0&&F<O.length;F++)E=(O.words[F]|0)+A,this.words[F]=E&67108863,A=E>>>26;if(this.length=O.length,A!==0)this.words[this.length]=A,this.length++;else if(O!==this)for(;F<O.length;F++)this.words[F]=O.words[F];return this},r.prototype.add=function(m){var E;return m.negative!==0&&this.negative===0?(m.negative=0,E=this.sub(m),m.negative^=1,E):m.negative===0&&this.negative!==0?(this.negative=0,E=m.sub(this),this.negative=1,E):this.length>m.length?this.clone().iadd(m):m.clone().iadd(this)},r.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var E=this.iadd(m);return m.negative=1,E._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var O=this.cmp(m);if(O===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,A;O>0?(I=this,A=m):(I=m,A=this);for(var F=0,K=0;K<A.length;K++)E=(I.words[K]|0)-(A.words[K]|0)+F,F=E>>26,this.words[K]=E&67108863;for(;F!==0&&K<I.length;K++)E=(I.words[K]|0)+F,F=E>>26,this.words[K]=E&67108863;if(F===0&&K<I.length&&I!==this)for(;K<I.length;K++)this.words[K]=I.words[K];return this.length=Math.max(this.length,K),I!==this&&(this.negative=1),this._strip()},r.prototype.sub=function(m){return this.clone().isub(m)};function v(N,m,E){E.negative=m.negative^N.negative;var O=N.length+m.length|0;E.length=O,O=O-1|0;var I=N.words[0]|0,A=m.words[0]|0,F=I*A,K=F&67108863,L=F/67108864|0;E.words[0]=K;for(var _=1;_<O;_++){for(var q=L>>>26,fe=L&67108863,se=Math.min(_,m.length-1),V=Math.max(0,_-N.length+1);V<=se;V++){var P=_-V|0;I=N.words[P]|0,A=m.words[V]|0,F=I*A+fe,q+=F/67108864|0,fe=F&67108863}E.words[_]=fe|0,L=q|0}return L!==0?E.words[_]=L|0:E.length--,E._strip()}var g=function(m,E,O){var I=m.words,A=E.words,F=O.words,K=0,L,_,q,fe=I[0]|0,se=fe&8191,V=fe>>>13,P=I[1]|0,M=P&8191,Y=P>>>13,Q=I[2]|0,D=Q&8191,C=Q>>>13,J=I[3]|0,ie=J&8191,he=J>>>13,oe=I[4]|0,ue=oe&8191,ge=oe>>>13,Ke=I[5]|0,Se=Ke&8191,de=Ke>>>13,Ie=I[6]|0,ve=Ie&8191,me=Ie>>>13,Le=I[7]|0,Ne=Le&8191,k=Le>>>13,w=I[8]|0,S=w&8191,H=w>>>13,W=I[9]|0,X=W&8191,ee=W>>>13,Be=A[0]|0,we=Be&8191,ye=Be>>>13,Fe=A[1]|0,pe=Fe&8191,ze=Fe>>>13,xs=A[2]|0,Ve=xs&8191,Ge=xs>>>13,Es=A[3]|0,$e=Es&8191,We=Es>>>13,Bs=A[4]|0,Ye=Bs&8191,Je=Bs>>>13,Is=A[5]|0,Xe=Is&8191,Qe=Is>>>13,Rs=A[6]|0,Ze=Rs&8191,et=Rs>>>13,As=A[7]|0,tt=As&8191,rt=As>>>13,Os=A[8]|0,it=Os&8191,nt=Os>>>13,Ps=A[9]|0,at=Ps&8191,ft=Ps>>>13;O.negative=m.negative^E.negative,O.length=19,L=Math.imul(se,we),_=Math.imul(se,ye),_=_+Math.imul(V,we)|0,q=Math.imul(V,ye);var ti=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(ti>>>26)|0,ti&=67108863,L=Math.imul(M,we),_=Math.imul(M,ye),_=_+Math.imul(Y,we)|0,q=Math.imul(Y,ye),L=L+Math.imul(se,pe)|0,_=_+Math.imul(se,ze)|0,_=_+Math.imul(V,pe)|0,q=q+Math.imul(V,ze)|0;var ri=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(ri>>>26)|0,ri&=67108863,L=Math.imul(D,we),_=Math.imul(D,ye),_=_+Math.imul(C,we)|0,q=Math.imul(C,ye),L=L+Math.imul(M,pe)|0,_=_+Math.imul(M,ze)|0,_=_+Math.imul(Y,pe)|0,q=q+Math.imul(Y,ze)|0,L=L+Math.imul(se,Ve)|0,_=_+Math.imul(se,Ge)|0,_=_+Math.imul(V,Ve)|0,q=q+Math.imul(V,Ge)|0;var ii=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(ii>>>26)|0,ii&=67108863,L=Math.imul(ie,we),_=Math.imul(ie,ye),_=_+Math.imul(he,we)|0,q=Math.imul(he,ye),L=L+Math.imul(D,pe)|0,_=_+Math.imul(D,ze)|0,_=_+Math.imul(C,pe)|0,q=q+Math.imul(C,ze)|0,L=L+Math.imul(M,Ve)|0,_=_+Math.imul(M,Ge)|0,_=_+Math.imul(Y,Ve)|0,q=q+Math.imul(Y,Ge)|0,L=L+Math.imul(se,$e)|0,_=_+Math.imul(se,We)|0,_=_+Math.imul(V,$e)|0,q=q+Math.imul(V,We)|0;var ni=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(ni>>>26)|0,ni&=67108863,L=Math.imul(ue,we),_=Math.imul(ue,ye),_=_+Math.imul(ge,we)|0,q=Math.imul(ge,ye),L=L+Math.imul(ie,pe)|0,_=_+Math.imul(ie,ze)|0,_=_+Math.imul(he,pe)|0,q=q+Math.imul(he,ze)|0,L=L+Math.imul(D,Ve)|0,_=_+Math.imul(D,Ge)|0,_=_+Math.imul(C,Ve)|0,q=q+Math.imul(C,Ge)|0,L=L+Math.imul(M,$e)|0,_=_+Math.imul(M,We)|0,_=_+Math.imul(Y,$e)|0,q=q+Math.imul(Y,We)|0,L=L+Math.imul(se,Ye)|0,_=_+Math.imul(se,Je)|0,_=_+Math.imul(V,Ye)|0,q=q+Math.imul(V,Je)|0;var ai=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(ai>>>26)|0,ai&=67108863,L=Math.imul(Se,we),_=Math.imul(Se,ye),_=_+Math.imul(de,we)|0,q=Math.imul(de,ye),L=L+Math.imul(ue,pe)|0,_=_+Math.imul(ue,ze)|0,_=_+Math.imul(ge,pe)|0,q=q+Math.imul(ge,ze)|0,L=L+Math.imul(ie,Ve)|0,_=_+Math.imul(ie,Ge)|0,_=_+Math.imul(he,Ve)|0,q=q+Math.imul(he,Ge)|0,L=L+Math.imul(D,$e)|0,_=_+Math.imul(D,We)|0,_=_+Math.imul(C,$e)|0,q=q+Math.imul(C,We)|0,L=L+Math.imul(M,Ye)|0,_=_+Math.imul(M,Je)|0,_=_+Math.imul(Y,Ye)|0,q=q+Math.imul(Y,Je)|0,L=L+Math.imul(se,Xe)|0,_=_+Math.imul(se,Qe)|0,_=_+Math.imul(V,Xe)|0,q=q+Math.imul(V,Qe)|0;var fi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(fi>>>26)|0,fi&=67108863,L=Math.imul(ve,we),_=Math.imul(ve,ye),_=_+Math.imul(me,we)|0,q=Math.imul(me,ye),L=L+Math.imul(Se,pe)|0,_=_+Math.imul(Se,ze)|0,_=_+Math.imul(de,pe)|0,q=q+Math.imul(de,ze)|0,L=L+Math.imul(ue,Ve)|0,_=_+Math.imul(ue,Ge)|0,_=_+Math.imul(ge,Ve)|0,q=q+Math.imul(ge,Ge)|0,L=L+Math.imul(ie,$e)|0,_=_+Math.imul(ie,We)|0,_=_+Math.imul(he,$e)|0,q=q+Math.imul(he,We)|0,L=L+Math.imul(D,Ye)|0,_=_+Math.imul(D,Je)|0,_=_+Math.imul(C,Ye)|0,q=q+Math.imul(C,Je)|0,L=L+Math.imul(M,Xe)|0,_=_+Math.imul(M,Qe)|0,_=_+Math.imul(Y,Xe)|0,q=q+Math.imul(Y,Qe)|0,L=L+Math.imul(se,Ze)|0,_=_+Math.imul(se,et)|0,_=_+Math.imul(V,Ze)|0,q=q+Math.imul(V,et)|0;var si=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(si>>>26)|0,si&=67108863,L=Math.imul(Ne,we),_=Math.imul(Ne,ye),_=_+Math.imul(k,we)|0,q=Math.imul(k,ye),L=L+Math.imul(ve,pe)|0,_=_+Math.imul(ve,ze)|0,_=_+Math.imul(me,pe)|0,q=q+Math.imul(me,ze)|0,L=L+Math.imul(Se,Ve)|0,_=_+Math.imul(Se,Ge)|0,_=_+Math.imul(de,Ve)|0,q=q+Math.imul(de,Ge)|0,L=L+Math.imul(ue,$e)|0,_=_+Math.imul(ue,We)|0,_=_+Math.imul(ge,$e)|0,q=q+Math.imul(ge,We)|0,L=L+Math.imul(ie,Ye)|0,_=_+Math.imul(ie,Je)|0,_=_+Math.imul(he,Ye)|0,q=q+Math.imul(he,Je)|0,L=L+Math.imul(D,Xe)|0,_=_+Math.imul(D,Qe)|0,_=_+Math.imul(C,Xe)|0,q=q+Math.imul(C,Qe)|0,L=L+Math.imul(M,Ze)|0,_=_+Math.imul(M,et)|0,_=_+Math.imul(Y,Ze)|0,q=q+Math.imul(Y,et)|0,L=L+Math.imul(se,tt)|0,_=_+Math.imul(se,rt)|0,_=_+Math.imul(V,tt)|0,q=q+Math.imul(V,rt)|0;var oi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(oi>>>26)|0,oi&=67108863,L=Math.imul(S,we),_=Math.imul(S,ye),_=_+Math.imul(H,we)|0,q=Math.imul(H,ye),L=L+Math.imul(Ne,pe)|0,_=_+Math.imul(Ne,ze)|0,_=_+Math.imul(k,pe)|0,q=q+Math.imul(k,ze)|0,L=L+Math.imul(ve,Ve)|0,_=_+Math.imul(ve,Ge)|0,_=_+Math.imul(me,Ve)|0,q=q+Math.imul(me,Ge)|0,L=L+Math.imul(Se,$e)|0,_=_+Math.imul(Se,We)|0,_=_+Math.imul(de,$e)|0,q=q+Math.imul(de,We)|0,L=L+Math.imul(ue,Ye)|0,_=_+Math.imul(ue,Je)|0,_=_+Math.imul(ge,Ye)|0,q=q+Math.imul(ge,Je)|0,L=L+Math.imul(ie,Xe)|0,_=_+Math.imul(ie,Qe)|0,_=_+Math.imul(he,Xe)|0,q=q+Math.imul(he,Qe)|0,L=L+Math.imul(D,Ze)|0,_=_+Math.imul(D,et)|0,_=_+Math.imul(C,Ze)|0,q=q+Math.imul(C,et)|0,L=L+Math.imul(M,tt)|0,_=_+Math.imul(M,rt)|0,_=_+Math.imul(Y,tt)|0,q=q+Math.imul(Y,rt)|0,L=L+Math.imul(se,it)|0,_=_+Math.imul(se,nt)|0,_=_+Math.imul(V,it)|0,q=q+Math.imul(V,nt)|0;var ci=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(ci>>>26)|0,ci&=67108863,L=Math.imul(X,we),_=Math.imul(X,ye),_=_+Math.imul(ee,we)|0,q=Math.imul(ee,ye),L=L+Math.imul(S,pe)|0,_=_+Math.imul(S,ze)|0,_=_+Math.imul(H,pe)|0,q=q+Math.imul(H,ze)|0,L=L+Math.imul(Ne,Ve)|0,_=_+Math.imul(Ne,Ge)|0,_=_+Math.imul(k,Ve)|0,q=q+Math.imul(k,Ge)|0,L=L+Math.imul(ve,$e)|0,_=_+Math.imul(ve,We)|0,_=_+Math.imul(me,$e)|0,q=q+Math.imul(me,We)|0,L=L+Math.imul(Se,Ye)|0,_=_+Math.imul(Se,Je)|0,_=_+Math.imul(de,Ye)|0,q=q+Math.imul(de,Je)|0,L=L+Math.imul(ue,Xe)|0,_=_+Math.imul(ue,Qe)|0,_=_+Math.imul(ge,Xe)|0,q=q+Math.imul(ge,Qe)|0,L=L+Math.imul(ie,Ze)|0,_=_+Math.imul(ie,et)|0,_=_+Math.imul(he,Ze)|0,q=q+Math.imul(he,et)|0,L=L+Math.imul(D,tt)|0,_=_+Math.imul(D,rt)|0,_=_+Math.imul(C,tt)|0,q=q+Math.imul(C,rt)|0,L=L+Math.imul(M,it)|0,_=_+Math.imul(M,nt)|0,_=_+Math.imul(Y,it)|0,q=q+Math.imul(Y,nt)|0,L=L+Math.imul(se,at)|0,_=_+Math.imul(se,ft)|0,_=_+Math.imul(V,at)|0,q=q+Math.imul(V,ft)|0;var ui=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(ui>>>26)|0,ui&=67108863,L=Math.imul(X,pe),_=Math.imul(X,ze),_=_+Math.imul(ee,pe)|0,q=Math.imul(ee,ze),L=L+Math.imul(S,Ve)|0,_=_+Math.imul(S,Ge)|0,_=_+Math.imul(H,Ve)|0,q=q+Math.imul(H,Ge)|0,L=L+Math.imul(Ne,$e)|0,_=_+Math.imul(Ne,We)|0,_=_+Math.imul(k,$e)|0,q=q+Math.imul(k,We)|0,L=L+Math.imul(ve,Ye)|0,_=_+Math.imul(ve,Je)|0,_=_+Math.imul(me,Ye)|0,q=q+Math.imul(me,Je)|0,L=L+Math.imul(Se,Xe)|0,_=_+Math.imul(Se,Qe)|0,_=_+Math.imul(de,Xe)|0,q=q+Math.imul(de,Qe)|0,L=L+Math.imul(ue,Ze)|0,_=_+Math.imul(ue,et)|0,_=_+Math.imul(ge,Ze)|0,q=q+Math.imul(ge,et)|0,L=L+Math.imul(ie,tt)|0,_=_+Math.imul(ie,rt)|0,_=_+Math.imul(he,tt)|0,q=q+Math.imul(he,rt)|0,L=L+Math.imul(D,it)|0,_=_+Math.imul(D,nt)|0,_=_+Math.imul(C,it)|0,q=q+Math.imul(C,nt)|0,L=L+Math.imul(M,at)|0,_=_+Math.imul(M,ft)|0,_=_+Math.imul(Y,at)|0,q=q+Math.imul(Y,ft)|0;var hi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(hi>>>26)|0,hi&=67108863,L=Math.imul(X,Ve),_=Math.imul(X,Ge),_=_+Math.imul(ee,Ve)|0,q=Math.imul(ee,Ge),L=L+Math.imul(S,$e)|0,_=_+Math.imul(S,We)|0,_=_+Math.imul(H,$e)|0,q=q+Math.imul(H,We)|0,L=L+Math.imul(Ne,Ye)|0,_=_+Math.imul(Ne,Je)|0,_=_+Math.imul(k,Ye)|0,q=q+Math.imul(k,Je)|0,L=L+Math.imul(ve,Xe)|0,_=_+Math.imul(ve,Qe)|0,_=_+Math.imul(me,Xe)|0,q=q+Math.imul(me,Qe)|0,L=L+Math.imul(Se,Ze)|0,_=_+Math.imul(Se,et)|0,_=_+Math.imul(de,Ze)|0,q=q+Math.imul(de,et)|0,L=L+Math.imul(ue,tt)|0,_=_+Math.imul(ue,rt)|0,_=_+Math.imul(ge,tt)|0,q=q+Math.imul(ge,rt)|0,L=L+Math.imul(ie,it)|0,_=_+Math.imul(ie,nt)|0,_=_+Math.imul(he,it)|0,q=q+Math.imul(he,nt)|0,L=L+Math.imul(D,at)|0,_=_+Math.imul(D,ft)|0,_=_+Math.imul(C,at)|0,q=q+Math.imul(C,ft)|0;var di=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(di>>>26)|0,di&=67108863,L=Math.imul(X,$e),_=Math.imul(X,We),_=_+Math.imul(ee,$e)|0,q=Math.imul(ee,We),L=L+Math.imul(S,Ye)|0,_=_+Math.imul(S,Je)|0,_=_+Math.imul(H,Ye)|0,q=q+Math.imul(H,Je)|0,L=L+Math.imul(Ne,Xe)|0,_=_+Math.imul(Ne,Qe)|0,_=_+Math.imul(k,Xe)|0,q=q+Math.imul(k,Qe)|0,L=L+Math.imul(ve,Ze)|0,_=_+Math.imul(ve,et)|0,_=_+Math.imul(me,Ze)|0,q=q+Math.imul(me,et)|0,L=L+Math.imul(Se,tt)|0,_=_+Math.imul(Se,rt)|0,_=_+Math.imul(de,tt)|0,q=q+Math.imul(de,rt)|0,L=L+Math.imul(ue,it)|0,_=_+Math.imul(ue,nt)|0,_=_+Math.imul(ge,it)|0,q=q+Math.imul(ge,nt)|0,L=L+Math.imul(ie,at)|0,_=_+Math.imul(ie,ft)|0,_=_+Math.imul(he,at)|0,q=q+Math.imul(he,ft)|0;var li=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(li>>>26)|0,li&=67108863,L=Math.imul(X,Ye),_=Math.imul(X,Je),_=_+Math.imul(ee,Ye)|0,q=Math.imul(ee,Je),L=L+Math.imul(S,Xe)|0,_=_+Math.imul(S,Qe)|0,_=_+Math.imul(H,Xe)|0,q=q+Math.imul(H,Qe)|0,L=L+Math.imul(Ne,Ze)|0,_=_+Math.imul(Ne,et)|0,_=_+Math.imul(k,Ze)|0,q=q+Math.imul(k,et)|0,L=L+Math.imul(ve,tt)|0,_=_+Math.imul(ve,rt)|0,_=_+Math.imul(me,tt)|0,q=q+Math.imul(me,rt)|0,L=L+Math.imul(Se,it)|0,_=_+Math.imul(Se,nt)|0,_=_+Math.imul(de,it)|0,q=q+Math.imul(de,nt)|0,L=L+Math.imul(ue,at)|0,_=_+Math.imul(ue,ft)|0,_=_+Math.imul(ge,at)|0,q=q+Math.imul(ge,ft)|0;var pi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(pi>>>26)|0,pi&=67108863,L=Math.imul(X,Xe),_=Math.imul(X,Qe),_=_+Math.imul(ee,Xe)|0,q=Math.imul(ee,Qe),L=L+Math.imul(S,Ze)|0,_=_+Math.imul(S,et)|0,_=_+Math.imul(H,Ze)|0,q=q+Math.imul(H,et)|0,L=L+Math.imul(Ne,tt)|0,_=_+Math.imul(Ne,rt)|0,_=_+Math.imul(k,tt)|0,q=q+Math.imul(k,rt)|0,L=L+Math.imul(ve,it)|0,_=_+Math.imul(ve,nt)|0,_=_+Math.imul(me,it)|0,q=q+Math.imul(me,nt)|0,L=L+Math.imul(Se,at)|0,_=_+Math.imul(Se,ft)|0,_=_+Math.imul(de,at)|0,q=q+Math.imul(de,ft)|0;var bi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(bi>>>26)|0,bi&=67108863,L=Math.imul(X,Ze),_=Math.imul(X,et),_=_+Math.imul(ee,Ze)|0,q=Math.imul(ee,et),L=L+Math.imul(S,tt)|0,_=_+Math.imul(S,rt)|0,_=_+Math.imul(H,tt)|0,q=q+Math.imul(H,rt)|0,L=L+Math.imul(Ne,it)|0,_=_+Math.imul(Ne,nt)|0,_=_+Math.imul(k,it)|0,q=q+Math.imul(k,nt)|0,L=L+Math.imul(ve,at)|0,_=_+Math.imul(ve,ft)|0,_=_+Math.imul(me,at)|0,q=q+Math.imul(me,ft)|0;var vi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(vi>>>26)|0,vi&=67108863,L=Math.imul(X,tt),_=Math.imul(X,rt),_=_+Math.imul(ee,tt)|0,q=Math.imul(ee,rt),L=L+Math.imul(S,it)|0,_=_+Math.imul(S,nt)|0,_=_+Math.imul(H,it)|0,q=q+Math.imul(H,nt)|0,L=L+Math.imul(Ne,at)|0,_=_+Math.imul(Ne,ft)|0,_=_+Math.imul(k,at)|0,q=q+Math.imul(k,ft)|0;var mi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(mi>>>26)|0,mi&=67108863,L=Math.imul(X,it),_=Math.imul(X,nt),_=_+Math.imul(ee,it)|0,q=Math.imul(ee,nt),L=L+Math.imul(S,at)|0,_=_+Math.imul(S,ft)|0,_=_+Math.imul(H,at)|0,q=q+Math.imul(H,ft)|0;var yi=(K+L|0)+((_&8191)<<13)|0;K=(q+(_>>>13)|0)+(yi>>>26)|0,yi&=67108863,L=Math.imul(X,at),_=Math.imul(X,ft),_=_+Math.imul(ee,at)|0,q=Math.imul(ee,ft);var gi=(K+L|0)+((_&8191)<<13)|0;return K=(q+(_>>>13)|0)+(gi>>>26)|0,gi&=67108863,F[0]=ti,F[1]=ri,F[2]=ii,F[3]=ni,F[4]=ai,F[5]=fi,F[6]=si,F[7]=oi,F[8]=ci,F[9]=ui,F[10]=hi,F[11]=di,F[12]=li,F[13]=pi,F[14]=bi,F[15]=vi,F[16]=mi,F[17]=yi,F[18]=gi,K!==0&&(F[19]=K,O.length++),O};Math.imul||(g=v);function x(N,m,E){E.negative=m.negative^N.negative,E.length=N.length+m.length;for(var O=0,I=0,A=0;A<E.length-1;A++){var F=I;I=0;for(var K=O&67108863,L=Math.min(A,m.length-1),_=Math.max(0,A-N.length+1);_<=L;_++){var q=A-_,fe=N.words[q]|0,se=m.words[_]|0,V=fe*se,P=V&67108863;F=F+(V/67108864|0)|0,P=P+K|0,K=P&67108863,F=F+(P>>>26)|0,I+=F>>>26,F&=67108863}E.words[A]=K,O=F,F=I}return O!==0?E.words[A]=O:E.length--,E._strip()}function B(N,m,E){return x(N,m,E)}r.prototype.mulTo=function(m,E){var O,I=this.length+m.length;return this.length===10&&m.length===10?O=g(this,m,E):I<63?O=v(this,m,E):I<1024?O=x(this,m,E):O=B(this,m,E),O},r.prototype.mul=function(m){var E=new r(null);return E.words=new Array(this.length+m.length),this.mulTo(m,E)},r.prototype.mulf=function(m){var E=new r(null);return E.words=new Array(this.length+m.length),B(this,m,E)},r.prototype.imul=function(m){return this.clone().mulTo(m,this)},r.prototype.imuln=function(m){var E=m<0;E&&(m=-m),i(typeof m=="number"),i(m<67108864);for(var O=0,I=0;I<this.length;I++){var A=(this.words[I]|0)*m,F=(A&67108863)+(O&67108863);O>>=26,O+=A/67108864|0,O+=F>>>26,this.words[I]=F&67108863}return O!==0&&(this.words[I]=O,this.length++),this.length=m===0?1:this.length,E?this.ineg():this},r.prototype.muln=function(m){return this.clone().imuln(m)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(m){var E=y(m);if(E.length===0)return new r(1);for(var O=this,I=0;I<E.length&&E[I]===0;I++,O=O.sqr());if(++I<E.length)for(var A=O.sqr();I<E.length;I++,A=A.sqr())E[I]!==0&&(O=O.mul(A));return O},r.prototype.iushln=function(m){i(typeof m=="number"&&m>=0);var E=m%26,O=(m-E)/26,I=67108863>>>26-E<<26-E,A;if(E!==0){var F=0;for(A=0;A<this.length;A++){var K=this.words[A]&I,L=(this.words[A]|0)-K<<E;this.words[A]=L|F,F=K>>>26-E}F&&(this.words[A]=F,this.length++)}if(O!==0){for(A=this.length-1;A>=0;A--)this.words[A+O]=this.words[A];for(A=0;A<O;A++)this.words[A]=0;this.length+=O}return this._strip()},r.prototype.ishln=function(m){return i(this.negative===0),this.iushln(m)},r.prototype.iushrn=function(m,E,O){i(typeof m=="number"&&m>=0);var I;E?I=(E-E%26)/26:I=0;var A=m%26,F=Math.min((m-A)/26,this.length),K=67108863^67108863>>>A<<A,L=O;if(I-=F,I=Math.max(0,I),L){for(var _=0;_<F;_++)L.words[_]=this.words[_];L.length=F}if(F!==0)if(this.length>F)for(this.length-=F,_=0;_<this.length;_++)this.words[_]=this.words[_+F];else this.words[0]=0,this.length=1;var q=0;for(_=this.length-1;_>=0&&(q!==0||_>=I);_--){var fe=this.words[_]|0;this.words[_]=q<<26-A|fe>>>A,q=fe&K}return L&&q!==0&&(L.words[L.length++]=q),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.ishrn=function(m,E,O){return i(this.negative===0),this.iushrn(m,E,O)},r.prototype.shln=function(m){return this.clone().ishln(m)},r.prototype.ushln=function(m){return this.clone().iushln(m)},r.prototype.shrn=function(m){return this.clone().ishrn(m)},r.prototype.ushrn=function(m){return this.clone().iushrn(m)},r.prototype.testn=function(m){i(typeof m=="number"&&m>=0);var E=m%26,O=(m-E)/26,I=1<<E;if(this.length<=O)return!1;var A=this.words[O];return!!(A&I)},r.prototype.imaskn=function(m){i(typeof m=="number"&&m>=0);var E=m%26,O=(m-E)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=O)return this;if(E!==0&&O++,this.length=Math.min(O,this.length),E!==0){var I=67108863^67108863>>>E<<E;this.words[this.length-1]&=I}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.maskn=function(m){return this.clone().imaskn(m)},r.prototype.iaddn=function(m){return i(typeof m=="number"),i(m<67108864),m<0?this.isubn(-m):this.negative!==0?this.length===1&&(this.words[0]|0)<=m?(this.words[0]=m-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(m),this.negative=1,this):this._iaddn(m)},r.prototype._iaddn=function(m){this.words[0]+=m;for(var E=0;E<this.length&&this.words[E]>=67108864;E++)this.words[E]-=67108864,E===this.length-1?this.words[E+1]=1:this.words[E+1]++;return this.length=Math.max(this.length,E+1),this},r.prototype.isubn=function(m){if(i(typeof m=="number"),i(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var E=0;E<this.length&&this.words[E]<0;E++)this.words[E]+=67108864,this.words[E+1]-=1;return this._strip()},r.prototype.addn=function(m){return this.clone().iaddn(m)},r.prototype.subn=function(m){return this.clone().isubn(m)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(m,E,O){var I=m.length+O,A;this._expand(I);var F,K=0;for(A=0;A<m.length;A++){F=(this.words[A+O]|0)+K;var L=(m.words[A]|0)*E;F-=L&67108863,K=(F>>26)-(L/67108864|0),this.words[A+O]=F&67108863}for(;A<this.length-O;A++)F=(this.words[A+O]|0)+K,K=F>>26,this.words[A+O]=F&67108863;if(K===0)return this._strip();for(i(K===-1),K=0,A=0;A<this.length;A++)F=-(this.words[A]|0)+K,K=F>>26,this.words[A]=F&67108863;return this.negative=1,this._strip()},r.prototype._wordDiv=function(m,E){var O=this.length-m.length,I=this.clone(),A=m,F=A.words[A.length-1]|0,K=this._countBits(F);O=26-K,O!==0&&(A=A.ushln(O),I.iushln(O),F=A.words[A.length-1]|0);var L=I.length-A.length,_;if(E!=="mod"){_=new r(null),_.length=L+1,_.words=new Array(_.length);for(var q=0;q<_.length;q++)_.words[q]=0}var fe=I.clone()._ishlnsubmul(A,1,L);fe.negative===0&&(I=fe,_&&(_.words[L]=1));for(var se=L-1;se>=0;se--){var V=(I.words[A.length+se]|0)*67108864+(I.words[A.length+se-1]|0);for(V=Math.min(V/F|0,67108863),I._ishlnsubmul(A,V,se);I.negative!==0;)V--,I.negative=0,I._ishlnsubmul(A,1,se),I.isZero()||(I.negative^=1);_&&(_.words[se]=V)}return _&&_._strip(),I._strip(),E!=="div"&&O!==0&&I.iushrn(O),{div:_||null,mod:I}},r.prototype.divmod=function(m,E,O){if(i(!m.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var I,A,F;return this.negative!==0&&m.negative===0?(F=this.neg().divmod(m,E),E!=="mod"&&(I=F.div.neg()),E!=="div"&&(A=F.mod.neg(),O&&A.negative!==0&&A.iadd(m)),{div:I,mod:A}):this.negative===0&&m.negative!==0?(F=this.divmod(m.neg(),E),E!=="mod"&&(I=F.div.neg()),{div:I,mod:F.mod}):(this.negative&m.negative)!==0?(F=this.neg().divmod(m.neg(),E),E!=="div"&&(A=F.mod.neg(),O&&A.negative!==0&&A.isub(m)),{div:F.div,mod:A}):m.length>this.length||this.cmp(m)<0?{div:new r(0),mod:this}:m.length===1?E==="div"?{div:this.divn(m.words[0]),mod:null}:E==="mod"?{div:null,mod:new r(this.modrn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new r(this.modrn(m.words[0]))}:this._wordDiv(m,E)},r.prototype.div=function(m){return this.divmod(m,"div",!1).div},r.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},r.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},r.prototype.divRound=function(m){var E=this.divmod(m);if(E.mod.isZero())return E.div;var O=E.div.negative!==0?E.mod.isub(m):E.mod,I=m.ushrn(1),A=m.andln(1),F=O.cmp(I);return F<0||A===1&&F===0?E.div:E.div.negative!==0?E.div.isubn(1):E.div.iaddn(1)},r.prototype.modrn=function(m){var E=m<0;E&&(m=-m),i(m<=67108863);for(var O=(1<<26)%m,I=0,A=this.length-1;A>=0;A--)I=(O*I+(this.words[A]|0))%m;return E?-I:I},r.prototype.modn=function(m){return this.modrn(m)},r.prototype.idivn=function(m){var E=m<0;E&&(m=-m),i(m<=67108863);for(var O=0,I=this.length-1;I>=0;I--){var A=(this.words[I]|0)+O*67108864;this.words[I]=A/m|0,O=A%m}return this._strip(),E?this.ineg():this},r.prototype.divn=function(m){return this.clone().idivn(m)},r.prototype.egcd=function(m){i(m.negative===0),i(!m.isZero());var E=this,O=m.clone();E.negative!==0?E=E.umod(m):E=E.clone();for(var I=new r(1),A=new r(0),F=new r(0),K=new r(1),L=0;E.isEven()&&O.isEven();)E.iushrn(1),O.iushrn(1),++L;for(var _=O.clone(),q=E.clone();!E.isZero();){for(var fe=0,se=1;(E.words[0]&se)===0&&fe<26;++fe,se<<=1);if(fe>0)for(E.iushrn(fe);fe-- >0;)(I.isOdd()||A.isOdd())&&(I.iadd(_),A.isub(q)),I.iushrn(1),A.iushrn(1);for(var V=0,P=1;(O.words[0]&P)===0&&V<26;++V,P<<=1);if(V>0)for(O.iushrn(V);V-- >0;)(F.isOdd()||K.isOdd())&&(F.iadd(_),K.isub(q)),F.iushrn(1),K.iushrn(1);E.cmp(O)>=0?(E.isub(O),I.isub(F),A.isub(K)):(O.isub(E),F.isub(I),K.isub(A))}return{a:F,b:K,gcd:O.iushln(L)}},r.prototype._invmp=function(m){i(m.negative===0),i(!m.isZero());var E=this,O=m.clone();E.negative!==0?E=E.umod(m):E=E.clone();for(var I=new r(1),A=new r(0),F=O.clone();E.cmpn(1)>0&&O.cmpn(1)>0;){for(var K=0,L=1;(E.words[0]&L)===0&&K<26;++K,L<<=1);if(K>0)for(E.iushrn(K);K-- >0;)I.isOdd()&&I.iadd(F),I.iushrn(1);for(var _=0,q=1;(O.words[0]&q)===0&&_<26;++_,q<<=1);if(_>0)for(O.iushrn(_);_-- >0;)A.isOdd()&&A.iadd(F),A.iushrn(1);E.cmp(O)>=0?(E.isub(O),I.isub(A)):(O.isub(E),A.isub(I))}var fe;return E.cmpn(1)===0?fe=I:fe=A,fe.cmpn(0)<0&&fe.iadd(m),fe},r.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var E=this.clone(),O=m.clone();E.negative=0,O.negative=0;for(var I=0;E.isEven()&&O.isEven();I++)E.iushrn(1),O.iushrn(1);do{for(;E.isEven();)E.iushrn(1);for(;O.isEven();)O.iushrn(1);var A=E.cmp(O);if(A<0){var F=E;E=O,O=F}else if(A===0||O.cmpn(1)===0)break;E.isub(O)}while(!0);return O.iushln(I)},r.prototype.invm=function(m){return this.egcd(m).a.umod(m)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(m){return this.words[0]&m},r.prototype.bincn=function(m){i(typeof m=="number");var E=m%26,O=(m-E)/26,I=1<<E;if(this.length<=O)return this._expand(O+1),this.words[O]|=I,this;for(var A=I,F=O;A!==0&&F<this.length;F++){var K=this.words[F]|0;K+=A,A=K>>>26,K&=67108863,this.words[F]=K}return A!==0&&(this.words[F]=A,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(m){var E=m<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;this._strip();var O;if(this.length>1)O=1;else{E&&(m=-m),i(m<=67108863,"Number is too big");var I=this.words[0]|0;O=I===m?0:I<m?-1:1}return this.negative!==0?-O|0:O},r.prototype.cmp=function(m){if(this.negative!==0&&m.negative===0)return-1;if(this.negative===0&&m.negative!==0)return 1;var E=this.ucmp(m);return this.negative!==0?-E|0:E},r.prototype.ucmp=function(m){if(this.length>m.length)return 1;if(this.length<m.length)return-1;for(var E=0,O=this.length-1;O>=0;O--){var I=this.words[O]|0,A=m.words[O]|0;if(I!==A){I<A?E=-1:I>A&&(E=1);break}}return E},r.prototype.gtn=function(m){return this.cmpn(m)===1},r.prototype.gt=function(m){return this.cmp(m)===1},r.prototype.gten=function(m){return this.cmpn(m)>=0},r.prototype.gte=function(m){return this.cmp(m)>=0},r.prototype.ltn=function(m){return this.cmpn(m)===-1},r.prototype.lt=function(m){return this.cmp(m)===-1},r.prototype.lten=function(m){return this.cmpn(m)<=0},r.prototype.lte=function(m){return this.cmp(m)<=0},r.prototype.eqn=function(m){return this.cmpn(m)===0},r.prototype.eq=function(m){return this.cmp(m)===0},r.red=function(m){return new ne(m)},r.prototype.toRed=function(m){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(m){return this.red=m,this},r.prototype.forceRed=function(m){return i(!this.red,"Already a number in reduction context"),this._forceRed(m)},r.prototype.redAdd=function(m){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},r.prototype.redIAdd=function(m){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},r.prototype.redSub=function(m){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},r.prototype.redISub=function(m){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},r.prototype.redShl=function(m){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},r.prototype.redMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},r.prototype.redIMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(m){return i(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var R={k256:null,p224:null,p192:null,p25519:null};function T(N,m){this.name=N,this.p=new r(m,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}T.prototype._tmp=function(){var m=new r(null);return m.words=new Array(Math.ceil(this.n/13)),m},T.prototype.ireduce=function(m){var E=m,O;do this.split(E,this.tmp),E=this.imulK(E),E=E.iadd(this.tmp),O=E.bitLength();while(O>this.n);var I=O<this.n?-1:E.ucmp(this.p);return I===0?(E.words[0]=0,E.length=1):I>0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},T.prototype.split=function(m,E){m.iushrn(this.n,0,E)},T.prototype.imulK=function(m){return m.imul(this.k)};function j(){T.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}u(j,T),j.prototype.split=function(m,E){for(var O=4194303,I=Math.min(m.length,9),A=0;A<I;A++)E.words[A]=m.words[A];if(E.length=I,m.length<=9){m.words[0]=0,m.length=1;return}var F=m.words[9];for(E.words[E.length++]=F&O,A=10;A<m.length;A++){var K=m.words[A]|0;m.words[A-10]=(K&O)<<4|F>>>22,F=K}F>>>=22,m.words[A-10]=F,F===0&&m.length>10?m.length-=10:m.length-=9},j.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var E=0,O=0;O<m.length;O++){var I=m.words[O]|0;E+=I*977,m.words[O]=E&67108863,E=I*64+(E/67108864|0)}return m.words[m.length-1]===0&&(m.length--,m.words[m.length-1]===0&&m.length--),m};function G(){T.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}u(G,T);function z(){T.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}u(z,T);function te(){T.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}u(te,T),te.prototype.imulK=function(m){for(var E=0,O=0;O<m.length;O++){var I=(m.words[O]|0)*19+E,A=I&67108863;I>>>=26,m.words[O]=A,E=I}return E!==0&&(m.words[m.length++]=E),m},r._prime=function(m){if(R[m])return R[m];var E;if(m==="k256")E=new j;else if(m==="p224")E=new G;else if(m==="p192")E=new z;else if(m==="p25519")E=new te;else throw new Error("Unknown prime "+m);return R[m]=E,E};function ne(N){if(typeof N=="string"){var m=r._prime(N);this.m=m.p,this.prime=m}else i(N.gtn(1),"modulus must be greater than 1"),this.m=N,this.prime=null}ne.prototype._verify1=function(m){i(m.negative===0,"red works only with positives"),i(m.red,"red works only with red numbers")},ne.prototype._verify2=function(m,E){i((m.negative|E.negative)===0,"red works only with positives"),i(m.red&&m.red===E.red,"red works only with red numbers")},ne.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):(n(m,m.umod(this.m)._forceRed(this)),m)},ne.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},ne.prototype.add=function(m,E){this._verify2(m,E);var O=m.add(E);return O.cmp(this.m)>=0&&O.isub(this.m),O._forceRed(this)},ne.prototype.iadd=function(m,E){this._verify2(m,E);var O=m.iadd(E);return O.cmp(this.m)>=0&&O.isub(this.m),O},ne.prototype.sub=function(m,E){this._verify2(m,E);var O=m.sub(E);return O.cmpn(0)<0&&O.iadd(this.m),O._forceRed(this)},ne.prototype.isub=function(m,E){this._verify2(m,E);var O=m.isub(E);return O.cmpn(0)<0&&O.iadd(this.m),O},ne.prototype.shl=function(m,E){return this._verify1(m),this.imod(m.ushln(E))},ne.prototype.imul=function(m,E){return this._verify2(m,E),this.imod(m.imul(E))},ne.prototype.mul=function(m,E){return this._verify2(m,E),this.imod(m.mul(E))},ne.prototype.isqr=function(m){return this.imul(m,m.clone())},ne.prototype.sqr=function(m){return this.mul(m,m)},ne.prototype.sqrt=function(m){if(m.isZero())return m.clone();var E=this.m.andln(3);if(i(E%2===1),E===3){var O=this.m.add(new r(1)).iushrn(2);return this.pow(m,O)}for(var I=this.m.subn(1),A=0;!I.isZero()&&I.andln(1)===0;)A++,I.iushrn(1);i(!I.isZero());var F=new r(1).toRed(this),K=F.redNeg(),L=this.m.subn(1).iushrn(1),_=this.m.bitLength();for(_=new r(2*_*_).toRed(this);this.pow(_,L).cmp(K)!==0;)_.redIAdd(K);for(var q=this.pow(_,I),fe=this.pow(m,I.addn(1).iushrn(1)),se=this.pow(m,I),V=A;se.cmp(F)!==0;){for(var P=se,M=0;P.cmp(F)!==0;M++)P=P.redSqr();i(M<V);var Y=this.pow(q,new r(1).iushln(V-M-1));fe=fe.redMul(Y),q=Y.redSqr(),se=se.redMul(q),V=M}return fe},ne.prototype.invm=function(m){var E=m._invmp(this.m);return E.negative!==0?(E.negative=0,this.imod(E).redNeg()):this.imod(E)},ne.prototype.pow=function(m,E){if(E.isZero())return new r(1).toRed(this);if(E.cmpn(1)===0)return m.clone();var O=4,I=new Array(1<<O);I[0]=new r(1).toRed(this),I[1]=m;for(var A=2;A<I.length;A++)I[A]=this.mul(I[A-1],m);var F=I[0],K=0,L=0,_=E.bitLength()%26;for(_===0&&(_=26),A=E.length-1;A>=0;A--){for(var q=E.words[A],fe=_-1;fe>=0;fe--){var se=q>>fe&1;if(F!==I[0]&&(F=this.sqr(F)),se===0&&K===0){L=0;continue}K<<=1,K|=se,L++,!(L!==O&&(A!==0||fe!==0))&&(F=this.mul(F,I[K]),L=0,K=0)}_=26}return F},ne.prototype.convertTo=function(m){var E=m.umod(this.m);return E===m?E.clone():E},ne.prototype.convertFrom=function(m){var E=m.clone();return E.red=null,E},r.mont=function(m){return new $(m)};function $(N){ne.call(this,N),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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)}u($,ne),$.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},$.prototype.convertFrom=function(m){var E=this.imod(m.mul(this.rinv));return E.red=null,E},$.prototype.imul=function(m,E){if(m.isZero()||E.isZero())return m.words[0]=0,m.length=1,m;var O=m.imul(E),I=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=O.isub(I).iushrn(this.shift),F=A;return A.cmp(this.m)>=0?F=A.isub(this.m):A.cmpn(0)<0&&(F=A.iadd(this.m)),F._forceRed(this)},$.prototype.mul=function(m,E){if(m.isZero()||E.isZero())return new r(0)._forceRed(this);var O=m.mul(E),I=O.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=O.isub(I).iushrn(this.shift),F=A;return A.cmp(this.m)>=0?F=A.isub(this.m):A.cmpn(0)<0&&(F=A.iadd(this.m)),F._forceRed(this)},$.prototype.invm=function(m){var E=this.imod(m._invmp(this.m).mul(this.r2));return E._forceRed(this)}})(d,Qd)})(Dr)),Dr.exports}var Zd=Te();const ut=$t(Zd);function e0(d){if(d.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<d.length;f++){const n=d.charAt(f),c=n.charCodeAt(0);if(e[c]!==255)throw new TypeError(n+" is ambiguous");e[c]=f}const t=d.length,i=d.charAt(0),u=Math.log(t)/Math.log(256),r=Math.log(256)/Math.log(t);function s(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 n=0,c=0,h=0;const l=f.length;for(;h!==l&&f[h]===0;)h++,n++;const p=(l-h)*r+1>>>0,b=new Uint8Array(p);for(;h!==l;){let g=f[h],x=0;for(let B=p-1;(g!==0||x<c)&&B!==-1;B--,x++)g+=256*b[B]>>>0,b[B]=g%t>>>0,g=g/t>>>0;if(g!==0)throw new Error("Non-zero carry");c=x,h++}let y=p-c;for(;y!==p&&b[y]===0;)y++;let v=i.repeat(n);for(;y<p;++y)v+=d.charAt(b[y]);return v}function a(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;let n=0,c=0,h=0;for(;f[n]===i;)c++,n++;const l=(f.length-n)*u+1>>>0,p=new Uint8Array(l);for(;n<f.length;){const g=f.charCodeAt(n);if(g>255)return;let x=e[g];if(x===255)return;let B=0;for(let R=l-1;(x!==0||B<h)&&R!==-1;R--,B++)x+=t*p[R]>>>0,p[R]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");h=B,n++}let b=l-h;for(;b!==l&&p[b]===0;)b++;const y=new Uint8Array(c+(l-b));let v=c;for(;b!==l;)y[v++]=p[b++];return y}function o(f){const n=a(f);if(n)return n;throw new Error("Non-base"+t+" character")}return{encode:s,decodeUnsafe:a,decode:o}}var t0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const Jf=e0(t0);var _i={};const r0="7.0.1",i0={version:r0};var Si={},xi,Ms;function lt(){if(Ms)return xi;Ms=1,xi=d;function d(e,t){if(!e)throw new Error(t||"Assertion failed")}return d.equal=function(t,i,u){if(t!=i)throw new Error(u||"Assertion failed: "+t+" != "+i)},xi}var Ei={},Cs;function fs(){return Cs||(Cs=1,(function(d){var e=d;function t(r,s){if(Array.isArray(r))return r.slice();if(!r)return[];var a=[];if(typeof r!="string"){for(var o=0;o<r.length;o++)a[o]=r[o]|0;return a}if(s==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var o=0;o<r.length;o+=2)a.push(parseInt(r[o]+r[o+1],16))}else for(var o=0;o<r.length;o++){var f=r.charCodeAt(o),n=f>>8,c=f&255;n?a.push(n,c):a.push(c)}return a}e.toArray=t;function i(r){return r.length===1?"0"+r:r}e.zero2=i;function u(r){for(var s="",a=0;a<r.length;a++)s+=i(r[a].toString(16));return s}e.toHex=u,e.encode=function(s,a){return a==="hex"?u(s):s}})(Ei)),Ei}var Ts;function qt(){return Ts||(Ts=1,(function(d){var e=d,t=Te(),i=lt(),u=fs();e.assert=i,e.toArray=u.toArray,e.zero2=u.zero2,e.toHex=u.toHex,e.encode=u.encode;function r(n,c,h){var l=new Array(Math.max(n.bitLength(),h)+1);l.fill(0);for(var p=1<<c+1,b=n.clone(),y=0;y<l.length;y++){var v,g=b.andln(p-1);b.isOdd()?(g>(p>>1)-1?v=(p>>1)-g:v=g,b.isubn(v)):v=0,l[y]=v,b.iushrn(1)}return l}e.getNAF=r;function s(n,c){var h=[[],[]];n=n.clone(),c=c.clone();for(var l=0,p=0;n.cmpn(-l)>0||c.cmpn(-p)>0;){var b=n.andln(3)+l&3,y=c.andln(3)+p&3;b===3&&(b=-1),y===3&&(y=-1);var v;if((b&1)===0)v=0;else{var g=n.andln(7)+l&7;(g===3||g===5)&&y===2?v=-b:v=b}h[0].push(v);var x;if((y&1)===0)x=0;else{var g=c.andln(7)+p&7;(g===3||g===5)&&b===2?x=-y:x=y}h[1].push(x),2*l===v+1&&(l=1-l),2*p===x+1&&(p=1-p),n.iushrn(1),c.iushrn(1)}return h}e.getJSF=s;function a(n,c,h){var l="_"+c;n.prototype[c]=function(){return this[l]!==void 0?this[l]:this[l]=h.call(this)}}e.cachedProperty=a;function o(n){return typeof n=="string"?e.toArray(n,"hex"):n}e.parseBytes=o;function f(n){return new t(n,"hex","le")}e.intFromLE=f})(Si)),Si}var _r={exports:{}},xe={},Sr={exports:{}},xr={exports:{}},Bi={},Xt={},Ls;function n0(){if(Ls)return Xt;Ls=1,Xt.byteLength=a,Xt.toByteArray=f,Xt.fromByteArray=h;for(var d=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,r=i.length;u<r;++u)d[u]=i[u],e[i.charCodeAt(u)]=u;e[45]=62,e[95]=63;function s(l){var p=l.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=l.indexOf("=");b===-1&&(b=p);var y=b===p?0:4-b%4;return[b,y]}function a(l){var p=s(l),b=p[0],y=p[1];return(b+y)*3/4-y}function o(l,p,b){return(p+b)*3/4-b}function f(l){var p,b=s(l),y=b[0],v=b[1],g=new t(o(l,y,v)),x=0,B=v>0?y-4:y,R;for(R=0;R<B;R+=4)p=e[l.charCodeAt(R)]<<18|e[l.charCodeAt(R+1)]<<12|e[l.charCodeAt(R+2)]<<6|e[l.charCodeAt(R+3)],g[x++]=p>>16&255,g[x++]=p>>8&255,g[x++]=p&255;return v===2&&(p=e[l.charCodeAt(R)]<<2|e[l.charCodeAt(R+1)]>>4,g[x++]=p&255),v===1&&(p=e[l.charCodeAt(R)]<<10|e[l.charCodeAt(R+1)]<<4|e[l.charCodeAt(R+2)]>>2,g[x++]=p>>8&255,g[x++]=p&255),g}function n(l){return d[l>>18&63]+d[l>>12&63]+d[l>>6&63]+d[l&63]}function c(l,p,b){for(var y,v=[],g=p;g<b;g+=3)y=(l[g]<<16&16711680)+(l[g+1]<<8&65280)+(l[g+2]&255),v.push(n(y));return v.join("")}function h(l){for(var p,b=l.length,y=b%3,v=[],g=16383,x=0,B=b-y;x<B;x+=g)v.push(c(l,x,x+g>B?B:x+g));return y===1?(p=l[b-1],v.push(d[p>>2]+d[p<<4&63]+"==")):y===2&&(p=(l[b-2]<<8)+l[b-1],v.push(d[p>>10]+d[p>>4&63]+d[p<<2&63]+"=")),v.join("")}return Xt}var Er={};var Ds;function a0(){return Ds||(Ds=1,Er.read=function(d,e,t,i,u){var r,s,a=u*8-i-1,o=(1<<a)-1,f=o>>1,n=-7,c=t?u-1:0,h=t?-1:1,l=d[e+c];for(c+=h,r=l&(1<<-n)-1,l>>=-n,n+=a;n>0;r=r*256+d[e+c],c+=h,n-=8);for(s=r&(1<<-n)-1,r>>=-n,n+=i;n>0;s=s*256+d[e+c],c+=h,n-=8);if(r===0)r=1-f;else{if(r===o)return s?NaN:(l?-1:1)*(1/0);s=s+Math.pow(2,i),r=r-f}return(l?-1:1)*s*Math.pow(2,r-i)},Er.write=function(d,e,t,i,u,r){var s,a,o,f=r*8-u-1,n=(1<<f)-1,c=n>>1,h=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,l=i?0:r-1,p=i?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=n):(s=Math.floor(Math.log(e)/Math.LN2),e*(o=Math.pow(2,-s))<1&&(s--,o*=2),s+c>=1?e+=h/o:e+=h*Math.pow(2,1-c),e*o>=2&&(s++,o/=2),s+c>=n?(a=0,s=n):s+c>=1?(a=(e*o-1)*Math.pow(2,u),s=s+c):(a=e*Math.pow(2,c-1)*Math.pow(2,u),s=0));u>=8;d[t+l]=a&255,l+=p,a/=256,u-=8);for(s=s<<u|a,f+=u;f>0;d[t+l]=s&255,l+=p,s/=256,f-=8);d[t+l-p]|=b*128}),Er}var Fs;function xt(){return Fs||(Fs=1,(function(d){const e=n0(),t=a0(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;d.Buffer=a,d.SlowBuffer=g,d.INSPECT_MAX_BYTES=50;const u=2147483647;d.kMaxLength=u,a.TYPED_ARRAY_SUPPORT=r(),!a.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 r(){try{const k=new Uint8Array(1),w={foo:function(){return 42}};return Object.setPrototypeOf(w,Uint8Array.prototype),Object.setPrototypeOf(k,w),k.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(k){if(k>u)throw new RangeError('The value "'+k+'" is invalid for option "size"');const w=new Uint8Array(k);return Object.setPrototypeOf(w,a.prototype),w}function a(k,w,S){if(typeof k=="number"){if(typeof w=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(k)}return o(k,w,S)}a.poolSize=8192;function o(k,w,S){if(typeof k=="string")return h(k,w);if(ArrayBuffer.isView(k))return p(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(Ie(k,ArrayBuffer)||k&&Ie(k.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ie(k,SharedArrayBuffer)||k&&Ie(k.buffer,SharedArrayBuffer)))return b(k,w,S);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=k.valueOf&&k.valueOf();if(H!=null&&H!==k)return a.from(H,w,S);const W=y(k);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return a.from(k[Symbol.toPrimitive]("string"),w,S);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}a.from=function(k,w,S){return o(k,w,S)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function f(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function n(k,w,S){return f(k),k<=0?s(k):w!==void 0?typeof S=="string"?s(k).fill(w,S):s(k).fill(w):s(k)}a.alloc=function(k,w,S){return n(k,w,S)};function c(k){return f(k),s(k<0?0:v(k)|0)}a.allocUnsafe=function(k){return c(k)},a.allocUnsafeSlow=function(k){return c(k)};function h(k,w){if((typeof w!="string"||w==="")&&(w="utf8"),!a.isEncoding(w))throw new TypeError("Unknown encoding: "+w);const S=x(k,w)|0;let H=s(S);const W=H.write(k,w);return W!==S&&(H=H.slice(0,W)),H}function l(k){const w=k.length<0?0:v(k.length)|0,S=s(w);for(let H=0;H<w;H+=1)S[H]=k[H]&255;return S}function p(k){if(Ie(k,Uint8Array)){const w=new Uint8Array(k);return b(w.buffer,w.byteOffset,w.byteLength)}return l(k)}function b(k,w,S){if(w<0||k.byteLength<w)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<w+(S||0))throw new RangeError('"length" is outside of buffer bounds');let H;return w===void 0&&S===void 0?H=new Uint8Array(k):S===void 0?H=new Uint8Array(k,w):H=new Uint8Array(k,w,S),Object.setPrototypeOf(H,a.prototype),H}function y(k){if(a.isBuffer(k)){const w=v(k.length)|0,S=s(w);return S.length===0||k.copy(S,0,0,w),S}if(k.length!==void 0)return typeof k.length!="number"||ve(k.length)?s(0):l(k);if(k.type==="Buffer"&&Array.isArray(k.data))return l(k.data)}function v(k){if(k>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return k|0}function g(k){return+k!=k&&(k=0),a.alloc(+k)}a.isBuffer=function(w){return w!=null&&w._isBuffer===!0&&w!==a.prototype},a.compare=function(w,S){if(Ie(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),Ie(S,Uint8Array)&&(S=a.from(S,S.offset,S.byteLength)),!a.isBuffer(w)||!a.isBuffer(S))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(w===S)return 0;let H=w.length,W=S.length;for(let X=0,ee=Math.min(H,W);X<ee;++X)if(w[X]!==S[X]){H=w[X],W=S[X];break}return H<W?-1:W<H?1:0},a.isEncoding=function(w){switch(String(w).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(w,S){if(!Array.isArray(w))throw new TypeError('"list" argument must be an Array of Buffers');if(w.length===0)return a.alloc(0);let H;if(S===void 0)for(S=0,H=0;H<w.length;++H)S+=w[H].length;const W=a.allocUnsafe(S);let X=0;for(H=0;H<w.length;++H){let ee=w[H];if(Ie(ee,Uint8Array))X+ee.length>W.length?(a.isBuffer(ee)||(ee=a.from(ee)),ee.copy(W,X)):Uint8Array.prototype.set.call(W,ee,X);else if(a.isBuffer(ee))ee.copy(W,X);else throw new TypeError('"list" argument must be an Array of Buffers');X+=ee.length}return W};function x(k,w){if(a.isBuffer(k))return k.length;if(ArrayBuffer.isView(k)||Ie(k,ArrayBuffer))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const S=k.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&S===0)return 0;let W=!1;for(;;)switch(w){case"ascii":case"latin1":case"binary":return S;case"utf8":case"utf-8":return ue(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S*2;case"hex":return S>>>1;case"base64":return Se(k).length;default:if(W)return H?-1:ue(k).length;w=(""+w).toLowerCase(),W=!0}}a.byteLength=x;function B(k,w,S){let H=!1;if((w===void 0||w<0)&&(w=0),w>this.length||((S===void 0||S>this.length)&&(S=this.length),S<=0)||(S>>>=0,w>>>=0,S<=w))return"";for(k||(k="utf8");;)switch(k){case"hex":return F(this,w,S);case"utf8":case"utf-8":return m(this,w,S);case"ascii":return I(this,w,S);case"latin1":case"binary":return A(this,w,S);case"base64":return N(this,w,S);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,w,S);default:if(H)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),H=!0}}a.prototype._isBuffer=!0;function R(k,w,S){const H=k[w];k[w]=k[S],k[S]=H}a.prototype.swap16=function(){const w=this.length;if(w%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let S=0;S<w;S+=2)R(this,S,S+1);return this},a.prototype.swap32=function(){const w=this.length;if(w%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let S=0;S<w;S+=4)R(this,S,S+3),R(this,S+1,S+2);return this},a.prototype.swap64=function(){const w=this.length;if(w%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let S=0;S<w;S+=8)R(this,S,S+7),R(this,S+1,S+6),R(this,S+2,S+5),R(this,S+3,S+4);return this},a.prototype.toString=function(){const w=this.length;return w===0?"":arguments.length===0?m(this,0,w):B.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(w){if(!a.isBuffer(w))throw new TypeError("Argument must be a Buffer");return this===w?!0:a.compare(this,w)===0},a.prototype.inspect=function(){let w="";const S=d.INSPECT_MAX_BYTES;return w=this.toString("hex",0,S).replace(/(.{2})/g,"$1 ").trim(),this.length>S&&(w+=" ... "),"<Buffer "+w+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(w,S,H,W,X){if(Ie(w,Uint8Array)&&(w=a.from(w,w.offset,w.byteLength)),!a.isBuffer(w))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof w);if(S===void 0&&(S=0),H===void 0&&(H=w?w.length:0),W===void 0&&(W=0),X===void 0&&(X=this.length),S<0||H>w.length||W<0||X>this.length)throw new RangeError("out of range index");if(W>=X&&S>=H)return 0;if(W>=X)return-1;if(S>=H)return 1;if(S>>>=0,H>>>=0,W>>>=0,X>>>=0,this===w)return 0;let ee=X-W,Be=H-S;const we=Math.min(ee,Be),ye=this.slice(W,X),Fe=w.slice(S,H);for(let pe=0;pe<we;++pe)if(ye[pe]!==Fe[pe]){ee=ye[pe],Be=Fe[pe];break}return ee<Be?-1:Be<ee?1:0};function T(k,w,S,H,W){if(k.length===0)return-1;if(typeof S=="string"?(H=S,S=0):S>2147483647?S=2147483647:S<-2147483648&&(S=-2147483648),S=+S,ve(S)&&(S=W?0:k.length-1),S<0&&(S=k.length+S),S>=k.length){if(W)return-1;S=k.length-1}else if(S<0)if(W)S=0;else return-1;if(typeof w=="string"&&(w=a.from(w,H)),a.isBuffer(w))return w.length===0?-1:j(k,w,S,H,W);if(typeof w=="number")return w=w&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(k,w,S):Uint8Array.prototype.lastIndexOf.call(k,w,S):j(k,[w],S,H,W);throw new TypeError("val must be string, number or Buffer")}function j(k,w,S,H,W){let X=1,ee=k.length,Be=w.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(k.length<2||w.length<2)return-1;X=2,ee/=2,Be/=2,S/=2}function we(Fe,pe){return X===1?Fe[pe]:Fe.readUInt16BE(pe*X)}let ye;if(W){let Fe=-1;for(ye=S;ye<ee;ye++)if(we(k,ye)===we(w,Fe===-1?0:ye-Fe)){if(Fe===-1&&(Fe=ye),ye-Fe+1===Be)return Fe*X}else Fe!==-1&&(ye-=ye-Fe),Fe=-1}else for(S+Be>ee&&(S=ee-Be),ye=S;ye>=0;ye--){let Fe=!0;for(let pe=0;pe<Be;pe++)if(we(k,ye+pe)!==we(w,pe)){Fe=!1;break}if(Fe)return ye}return-1}a.prototype.includes=function(w,S,H){return this.indexOf(w,S,H)!==-1},a.prototype.indexOf=function(w,S,H){return T(this,w,S,H,!0)},a.prototype.lastIndexOf=function(w,S,H){return T(this,w,S,H,!1)};function G(k,w,S,H){S=Number(S)||0;const W=k.length-S;H?(H=Number(H),H>W&&(H=W)):H=W;const X=w.length;H>X/2&&(H=X/2);let ee;for(ee=0;ee<H;++ee){const Be=parseInt(w.substr(ee*2,2),16);if(ve(Be))return ee;k[S+ee]=Be}return ee}function z(k,w,S,H){return de(ue(w,k.length-S),k,S,H)}function te(k,w,S,H){return de(ge(w),k,S,H)}function ne(k,w,S,H){return de(Se(w),k,S,H)}function $(k,w,S,H){return de(Ke(w,k.length-S),k,S,H)}a.prototype.write=function(w,S,H,W){if(S===void 0)W="utf8",H=this.length,S=0;else if(H===void 0&&typeof S=="string")W=S,H=this.length,S=0;else if(isFinite(S))S=S>>>0,isFinite(H)?(H=H>>>0,W===void 0&&(W="utf8")):(W=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const X=this.length-S;if((H===void 0||H>X)&&(H=X),w.length>0&&(H<0||S<0)||S>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let ee=!1;for(;;)switch(W){case"hex":return G(this,w,S,H);case"utf8":case"utf-8":return z(this,w,S,H);case"ascii":case"latin1":case"binary":return te(this,w,S,H);case"base64":return ne(this,w,S,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,w,S,H);default:if(ee)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),ee=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(k,w,S){return w===0&&S===k.length?e.fromByteArray(k):e.fromByteArray(k.slice(w,S))}function m(k,w,S){S=Math.min(k.length,S);const H=[];let W=w;for(;W<S;){const X=k[W];let ee=null,Be=X>239?4:X>223?3:X>191?2:1;if(W+Be<=S){let we,ye,Fe,pe;switch(Be){case 1:X<128&&(ee=X);break;case 2:we=k[W+1],(we&192)===128&&(pe=(X&31)<<6|we&63,pe>127&&(ee=pe));break;case 3:we=k[W+1],ye=k[W+2],(we&192)===128&&(ye&192)===128&&(pe=(X&15)<<12|(we&63)<<6|ye&63,pe>2047&&(pe<55296||pe>57343)&&(ee=pe));break;case 4:we=k[W+1],ye=k[W+2],Fe=k[W+3],(we&192)===128&&(ye&192)===128&&(Fe&192)===128&&(pe=(X&15)<<18|(we&63)<<12|(ye&63)<<6|Fe&63,pe>65535&&pe<1114112&&(ee=pe))}}ee===null?(ee=65533,Be=1):ee>65535&&(ee-=65536,H.push(ee>>>10&1023|55296),ee=56320|ee&1023),H.push(ee),W+=Be}return O(H)}const E=4096;function O(k){const w=k.length;if(w<=E)return String.fromCharCode.apply(String,k);let S="",H=0;for(;H<w;)S+=String.fromCharCode.apply(String,k.slice(H,H+=E));return S}function I(k,w,S){let H="";S=Math.min(k.length,S);for(let W=w;W<S;++W)H+=String.fromCharCode(k[W]&127);return H}function A(k,w,S){let H="";S=Math.min(k.length,S);for(let W=w;W<S;++W)H+=String.fromCharCode(k[W]);return H}function F(k,w,S){const H=k.length;(!w||w<0)&&(w=0),(!S||S<0||S>H)&&(S=H);let W="";for(let X=w;X<S;++X)W+=me[k[X]];return W}function K(k,w,S){const H=k.slice(w,S);let W="";for(let X=0;X<H.length-1;X+=2)W+=String.fromCharCode(H[X]+H[X+1]*256);return W}a.prototype.slice=function(w,S){const H=this.length;w=~~w,S=S===void 0?H:~~S,w<0?(w+=H,w<0&&(w=0)):w>H&&(w=H),S<0?(S+=H,S<0&&(S=0)):S>H&&(S=H),S<w&&(S=w);const W=this.subarray(w,S);return Object.setPrototypeOf(W,a.prototype),W};function L(k,w,S){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+w>S)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=this[w],X=1,ee=0;for(;++ee<S&&(X*=256);)W+=this[w+ee]*X;return W},a.prototype.readUintBE=a.prototype.readUIntBE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=this[w+--S],X=1;for(;S>0&&(X*=256);)W+=this[w+--S]*X;return W},a.prototype.readUint8=a.prototype.readUInt8=function(w,S){return w=w>>>0,S||L(w,1,this.length),this[w]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(w,S){return w=w>>>0,S||L(w,2,this.length),this[w]|this[w+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(w,S){return w=w>>>0,S||L(w,2,this.length),this[w]<<8|this[w+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(w,S){return w=w>>>0,S||L(w,4,this.length),(this[w]|this[w+1]<<8|this[w+2]<<16)+this[w+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(w,S){return w=w>>>0,S||L(w,4,this.length),this[w]*16777216+(this[w+1]<<16|this[w+2]<<8|this[w+3])},a.prototype.readBigUInt64LE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=S+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24,X=this[++w]+this[++w]*2**8+this[++w]*2**16+H*2**24;return BigInt(W)+(BigInt(X)<<BigInt(32))}),a.prototype.readBigUInt64BE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=S*2**24+this[++w]*2**16+this[++w]*2**8+this[++w],X=this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+H;return(BigInt(W)<<BigInt(32))+BigInt(X)}),a.prototype.readIntLE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=this[w],X=1,ee=0;for(;++ee<S&&(X*=256);)W+=this[w+ee]*X;return X*=128,W>=X&&(W-=Math.pow(2,8*S)),W},a.prototype.readIntBE=function(w,S,H){w=w>>>0,S=S>>>0,H||L(w,S,this.length);let W=S,X=1,ee=this[w+--W];for(;W>0&&(X*=256);)ee+=this[w+--W]*X;return X*=128,ee>=X&&(ee-=Math.pow(2,8*S)),ee},a.prototype.readInt8=function(w,S){return w=w>>>0,S||L(w,1,this.length),this[w]&128?(255-this[w]+1)*-1:this[w]},a.prototype.readInt16LE=function(w,S){w=w>>>0,S||L(w,2,this.length);const H=this[w]|this[w+1]<<8;return H&32768?H|4294901760:H},a.prototype.readInt16BE=function(w,S){w=w>>>0,S||L(w,2,this.length);const H=this[w+1]|this[w]<<8;return H&32768?H|4294901760:H},a.prototype.readInt32LE=function(w,S){return w=w>>>0,S||L(w,4,this.length),this[w]|this[w+1]<<8|this[w+2]<<16|this[w+3]<<24},a.prototype.readInt32BE=function(w,S){return w=w>>>0,S||L(w,4,this.length),this[w]<<24|this[w+1]<<16|this[w+2]<<8|this[w+3]},a.prototype.readBigInt64LE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=this[w+4]+this[w+5]*2**8+this[w+6]*2**16+(H<<24);return(BigInt(W)<<BigInt(32))+BigInt(S+this[++w]*2**8+this[++w]*2**16+this[++w]*2**24)}),a.prototype.readBigInt64BE=Le(function(w){w=w>>>0,J(w,"offset");const S=this[w],H=this[w+7];(S===void 0||H===void 0)&&ie(w,this.length-8);const W=(S<<24)+this[++w]*2**16+this[++w]*2**8+this[++w];return(BigInt(W)<<BigInt(32))+BigInt(this[++w]*2**24+this[++w]*2**16+this[++w]*2**8+H)}),a.prototype.readFloatLE=function(w,S){return w=w>>>0,S||L(w,4,this.length),t.read(this,w,!0,23,4)},a.prototype.readFloatBE=function(w,S){return w=w>>>0,S||L(w,4,this.length),t.read(this,w,!1,23,4)},a.prototype.readDoubleLE=function(w,S){return w=w>>>0,S||L(w,8,this.length),t.read(this,w,!0,52,8)},a.prototype.readDoubleBE=function(w,S){return w=w>>>0,S||L(w,8,this.length),t.read(this,w,!1,52,8)};function _(k,w,S,H,W,X){if(!a.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(w>W||w<X)throw new RangeError('"value" argument is out of bounds');if(S+H>k.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(w,S,H,W){if(w=+w,S=S>>>0,H=H>>>0,!W){const Be=Math.pow(2,8*H)-1;_(this,w,S,H,Be,0)}let X=1,ee=0;for(this[S]=w&255;++ee<H&&(X*=256);)this[S+ee]=w/X&255;return S+H},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(w,S,H,W){if(w=+w,S=S>>>0,H=H>>>0,!W){const Be=Math.pow(2,8*H)-1;_(this,w,S,H,Be,0)}let X=H-1,ee=1;for(this[S+X]=w&255;--X>=0&&(ee*=256);)this[S+X]=w/ee&255;return S+H},a.prototype.writeUint8=a.prototype.writeUInt8=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,1,255,0),this[S]=w&255,S+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,65535,0),this[S]=w&255,this[S+1]=w>>>8,S+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,65535,0),this[S]=w>>>8,this[S+1]=w&255,S+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,4294967295,0),this[S+3]=w>>>24,this[S+2]=w>>>16,this[S+1]=w>>>8,this[S]=w&255,S+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,4294967295,0),this[S]=w>>>24,this[S+1]=w>>>16,this[S+2]=w>>>8,this[S+3]=w&255,S+4};function q(k,w,S,H,W){C(w,H,W,k,S,7);let X=Number(w&BigInt(4294967295));k[S++]=X,X=X>>8,k[S++]=X,X=X>>8,k[S++]=X,X=X>>8,k[S++]=X;let ee=Number(w>>BigInt(32)&BigInt(4294967295));return k[S++]=ee,ee=ee>>8,k[S++]=ee,ee=ee>>8,k[S++]=ee,ee=ee>>8,k[S++]=ee,S}function fe(k,w,S,H,W){C(w,H,W,k,S,7);let X=Number(w&BigInt(4294967295));k[S+7]=X,X=X>>8,k[S+6]=X,X=X>>8,k[S+5]=X,X=X>>8,k[S+4]=X;let ee=Number(w>>BigInt(32)&BigInt(4294967295));return k[S+3]=ee,ee=ee>>8,k[S+2]=ee,ee=ee>>8,k[S+1]=ee,ee=ee>>8,k[S]=ee,S+8}a.prototype.writeBigUInt64LE=Le(function(w,S=0){return q(this,w,S,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Le(function(w,S=0){return fe(this,w,S,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(w,S,H,W){if(w=+w,S=S>>>0,!W){const we=Math.pow(2,8*H-1);_(this,w,S,H,we-1,-we)}let X=0,ee=1,Be=0;for(this[S]=w&255;++X<H&&(ee*=256);)w<0&&Be===0&&this[S+X-1]!==0&&(Be=1),this[S+X]=(w/ee>>0)-Be&255;return S+H},a.prototype.writeIntBE=function(w,S,H,W){if(w=+w,S=S>>>0,!W){const we=Math.pow(2,8*H-1);_(this,w,S,H,we-1,-we)}let X=H-1,ee=1,Be=0;for(this[S+X]=w&255;--X>=0&&(ee*=256);)w<0&&Be===0&&this[S+X+1]!==0&&(Be=1),this[S+X]=(w/ee>>0)-Be&255;return S+H},a.prototype.writeInt8=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,1,127,-128),w<0&&(w=255+w+1),this[S]=w&255,S+1},a.prototype.writeInt16LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,32767,-32768),this[S]=w&255,this[S+1]=w>>>8,S+2},a.prototype.writeInt16BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,2,32767,-32768),this[S]=w>>>8,this[S+1]=w&255,S+2},a.prototype.writeInt32LE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,2147483647,-2147483648),this[S]=w&255,this[S+1]=w>>>8,this[S+2]=w>>>16,this[S+3]=w>>>24,S+4},a.prototype.writeInt32BE=function(w,S,H){return w=+w,S=S>>>0,H||_(this,w,S,4,2147483647,-2147483648),w<0&&(w=4294967295+w+1),this[S]=w>>>24,this[S+1]=w>>>16,this[S+2]=w>>>8,this[S+3]=w&255,S+4},a.prototype.writeBigInt64LE=Le(function(w,S=0){return q(this,w,S,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Le(function(w,S=0){return fe(this,w,S,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function se(k,w,S,H,W,X){if(S+H>k.length)throw new RangeError("Index out of range");if(S<0)throw new RangeError("Index out of range")}function V(k,w,S,H,W){return w=+w,S=S>>>0,W||se(k,w,S,4),t.write(k,w,S,H,23,4),S+4}a.prototype.writeFloatLE=function(w,S,H){return V(this,w,S,!0,H)},a.prototype.writeFloatBE=function(w,S,H){return V(this,w,S,!1,H)};function P(k,w,S,H,W){return w=+w,S=S>>>0,W||se(k,w,S,8),t.write(k,w,S,H,52,8),S+8}a.prototype.writeDoubleLE=function(w,S,H){return P(this,w,S,!0,H)},a.prototype.writeDoubleBE=function(w,S,H){return P(this,w,S,!1,H)},a.prototype.copy=function(w,S,H,W){if(!a.isBuffer(w))throw new TypeError("argument should be a Buffer");if(H||(H=0),!W&&W!==0&&(W=this.length),S>=w.length&&(S=w.length),S||(S=0),W>0&&W<H&&(W=H),W===H||w.length===0||this.length===0)return 0;if(S<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),w.length-S<W-H&&(W=w.length-S+H);const X=W-H;return this===w&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(S,H,W):Uint8Array.prototype.set.call(w,this.subarray(H,W),S),X},a.prototype.fill=function(w,S,H,W){if(typeof w=="string"){if(typeof S=="string"?(W=S,S=0,H=this.length):typeof H=="string"&&(W=H,H=this.length),W!==void 0&&typeof W!="string")throw new TypeError("encoding must be a string");if(typeof W=="string"&&!a.isEncoding(W))throw new TypeError("Unknown encoding: "+W);if(w.length===1){const ee=w.charCodeAt(0);(W==="utf8"&&ee<128||W==="latin1")&&(w=ee)}}else typeof w=="number"?w=w&255:typeof w=="boolean"&&(w=Number(w));if(S<0||this.length<S||this.length<H)throw new RangeError("Out of range index");if(H<=S)return this;S=S>>>0,H=H===void 0?this.length:H>>>0,w||(w=0);let X;if(typeof w=="number")for(X=S;X<H;++X)this[X]=w;else{const ee=a.isBuffer(w)?w:a.from(w,W),Be=ee.length;if(Be===0)throw new TypeError('The value "'+w+'" is invalid for argument "value"');for(X=0;X<H-S;++X)this[X+S]=ee[X%Be]}return this};const M={};function Y(k,w,S){M[k]=class extends S{constructor(){super(),Object.defineProperty(this,"message",{value:w.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(k,w){return`The "${k}" argument must be of type number. Received type ${typeof w}`},TypeError),Y("ERR_OUT_OF_RANGE",function(k,w,S){let H=`The value of "${k}" is out of range.`,W=S;return Number.isInteger(S)&&Math.abs(S)>2**32?W=Q(String(S)):typeof S=="bigint"&&(W=String(S),(S>BigInt(2)**BigInt(32)||S<-(BigInt(2)**BigInt(32)))&&(W=Q(W)),W+="n"),H+=` It must be ${w}. Received ${W}`,H},RangeError);function Q(k){let w="",S=k.length;const H=k[0]==="-"?1:0;for(;S>=H+4;S-=3)w=`_${k.slice(S-3,S)}${w}`;return`${k.slice(0,S)}${w}`}function D(k,w,S){J(w,"offset"),(k[w]===void 0||k[w+S]===void 0)&&ie(w,k.length-(S+1))}function C(k,w,S,H,W,X){if(k>S||k<w){const ee=typeof w=="bigint"?"n":"";let Be;throw w===0||w===BigInt(0)?Be=`>= 0${ee} and < 2${ee} ** ${(X+1)*8}${ee}`:Be=`>= -(2${ee} ** ${(X+1)*8-1}${ee}) and < 2 ** ${(X+1)*8-1}${ee}`,new M.ERR_OUT_OF_RANGE("value",Be,k)}D(H,W,X)}function J(k,w){if(typeof k!="number")throw new M.ERR_INVALID_ARG_TYPE(w,"number",k)}function ie(k,w,S){throw Math.floor(k)!==k?(J(k,S),new M.ERR_OUT_OF_RANGE("offset","an integer",k)):w<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${w}`,k)}const he=/[^+/0-9A-Za-z-_]/g;function oe(k){if(k=k.split("=")[0],k=k.trim().replace(he,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function ue(k,w){w=w||1/0;let S;const H=k.length;let W=null;const X=[];for(let ee=0;ee<H;++ee){if(S=k.charCodeAt(ee),S>55295&&S<57344){if(!W){if(S>56319){(w-=3)>-1&&X.push(239,191,189);continue}else if(ee+1===H){(w-=3)>-1&&X.push(239,191,189);continue}W=S;continue}if(S<56320){(w-=3)>-1&&X.push(239,191,189),W=S;continue}S=(W-55296<<10|S-56320)+65536}else W&&(w-=3)>-1&&X.push(239,191,189);if(W=null,S<128){if((w-=1)<0)break;X.push(S)}else if(S<2048){if((w-=2)<0)break;X.push(S>>6|192,S&63|128)}else if(S<65536){if((w-=3)<0)break;X.push(S>>12|224,S>>6&63|128,S&63|128)}else if(S<1114112){if((w-=4)<0)break;X.push(S>>18|240,S>>12&63|128,S>>6&63|128,S&63|128)}else throw new Error("Invalid code point")}return X}function ge(k){const w=[];for(let S=0;S<k.length;++S)w.push(k.charCodeAt(S)&255);return w}function Ke(k,w){let S,H,W;const X=[];for(let ee=0;ee<k.length&&!((w-=2)<0);++ee)S=k.charCodeAt(ee),H=S>>8,W=S%256,X.push(W),X.push(H);return X}function Se(k){return e.toByteArray(oe(k))}function de(k,w,S,H){let W;for(W=0;W<H&&!(W+S>=w.length||W>=k.length);++W)w[W+S]=k[W];return W}function Ie(k,w){return k instanceof w||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===w.name}function ve(k){return k!==k}const me=(function(){const k="0123456789abcdef",w=new Array(256);for(let S=0;S<16;++S){const H=S*16;for(let W=0;W<16;++W)w[H+W]=k[S]+k[W]}return w})();function Le(k){return typeof BigInt>"u"?Ne:k}function Ne(){throw new Error("BigInt not supported")}})(Bi)),Bi}var Us;function _e(){return Us||(Us=1,(function(d,e){var t=xt(),i=t.Buffer;function u(s,a){for(var o in s)a[o]=s[o]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?d.exports=t:(u(t,e),e.Buffer=r);function r(s,a,o){return i(s,a,o)}r.prototype=Object.create(i.prototype),u(i,r),r.from=function(s,a,o){if(typeof s=="number")throw new TypeError("Argument must not be a number");return i(s,a,o)},r.alloc=function(s,a,o){if(typeof s!="number")throw new TypeError("Argument must be a number");var f=i(s);return a!==void 0?typeof o=="string"?f.fill(a,o):f.fill(a):f.fill(0),f},r.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return i(s)},r.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(s)}})(xr,xr.exports)),xr.exports}var qs;function Ht(){if(qs)return Sr.exports;qs=1;var d=65536,e=4294967295;function t(){throw new Error(`Secure random number generation is not supported by this browser.
2
+ Use Chrome, Firefox or Internet Explorer 11`)}var i=_e().Buffer,u=Re.crypto||Re.msCrypto;u&&u.getRandomValues?Sr.exports=r:Sr.exports=t;function r(s,a){if(s>e)throw new RangeError("requested too many random bytes");var o=i.allocUnsafe(s);if(s>0)if(s>d)for(var f=0;f<s;f+=d)u.getRandomValues(o.slice(f,f+d));else u.getRandomValues(o);return typeof a=="function"?process.nextTick(function(){a(null,o)}):o}return Sr.exports}var Br={exports:{}},Hs;function be(){return Hs||(Hs=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 i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}),Br.exports}var Ir={exports:{}},Ks;function or(){if(Ks)return Ir.exports;Ks=1;var d=typeof Reflect=="object"?Reflect:null,e=d&&typeof d.apply=="function"?d.apply:function(R,T,j){return Function.prototype.apply.call(R,T,j)},t;d&&typeof d.ownKeys=="function"?t=d.ownKeys:Object.getOwnPropertySymbols?t=function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:t=function(R){return Object.getOwnPropertyNames(R)};function i(B){console&&console.warn&&console.warn(B)}var u=Number.isNaN||function(R){return R!==R};function r(){r.init.call(this)}Ir.exports=r,Ir.exports.once=v,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var s=10;function a(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(B){if(typeof B!="number"||B<0||u(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");s=B}}),r.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},r.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||u(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function o(B){return B._maxListeners===void 0?r.defaultMaxListeners:B._maxListeners}r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(R){for(var T=[],j=1;j<arguments.length;j++)T.push(arguments[j]);var G=R==="error",z=this._events;if(z!==void 0)G=G&&z.error===void 0;else if(!G)return!1;if(G){var te;if(T.length>0&&(te=T[0]),te instanceof Error)throw te;var ne=new Error("Unhandled error."+(te?" ("+te.message+")":""));throw ne.context=te,ne}var $=z[R];if($===void 0)return!1;if(typeof $=="function")e($,this,T);else for(var N=$.length,m=p($,N),j=0;j<N;++j)e(m[j],this,T);return!0};function f(B,R,T,j){var G,z,te;if(a(T),z=B._events,z===void 0?(z=B._events=Object.create(null),B._eventsCount=0):(z.newListener!==void 0&&(B.emit("newListener",R,T.listener?T.listener:T),z=B._events),te=z[R]),te===void 0)te=z[R]=T,++B._eventsCount;else if(typeof te=="function"?te=z[R]=j?[T,te]:[te,T]:j?te.unshift(T):te.push(T),G=o(B),G>0&&te.length>G&&!te.warned){te.warned=!0;var ne=new Error("Possible EventEmitter memory leak detected. "+te.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");ne.name="MaxListenersExceededWarning",ne.emitter=B,ne.type=R,ne.count=te.length,i(ne)}return B}r.prototype.addListener=function(R,T){return f(this,R,T,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(R,T){return f(this,R,T,!0)};function n(){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 c(B,R,T){var j={fired:!1,wrapFn:void 0,target:B,type:R,listener:T},G=n.bind(j);return G.listener=T,j.wrapFn=G,G}r.prototype.once=function(R,T){return a(T),this.on(R,c(this,R,T)),this},r.prototype.prependOnceListener=function(R,T){return a(T),this.prependListener(R,c(this,R,T)),this},r.prototype.removeListener=function(R,T){var j,G,z,te,ne;if(a(T),G=this._events,G===void 0)return this;if(j=G[R],j===void 0)return this;if(j===T||j.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete G[R],G.removeListener&&this.emit("removeListener",R,j.listener||T));else if(typeof j!="function"){for(z=-1,te=j.length-1;te>=0;te--)if(j[te]===T||j[te].listener===T){ne=j[te].listener,z=te;break}if(z<0)return this;z===0?j.shift():b(j,z),j.length===1&&(G[R]=j[0]),G.removeListener!==void 0&&this.emit("removeListener",R,ne||T)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(R){var T,j,G;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[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[R]),this;if(arguments.length===0){var z=Object.keys(j),te;for(G=0;G<z.length;++G)te=z[G],te!=="removeListener"&&this.removeAllListeners(te);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=j[R],typeof T=="function")this.removeListener(R,T);else if(T!==void 0)for(G=T.length-1;G>=0;G--)this.removeListener(R,T[G]);return this};function h(B,R,T){var j=B._events;if(j===void 0)return[];var G=j[R];return G===void 0?[]:typeof G=="function"?T?[G.listener||G]:[G]:T?y(G):p(G,G.length)}r.prototype.listeners=function(R){return h(this,R,!0)},r.prototype.rawListeners=function(R){return h(this,R,!1)},r.listenerCount=function(B,R){return typeof B.listenerCount=="function"?B.listenerCount(R):l.call(B,R)},r.prototype.listenerCount=l;function l(B){var R=this._events;if(R!==void 0){var T=R[B];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function p(B,R){for(var T=new Array(R),j=0;j<R;++j)T[j]=B[j];return T}function b(B,R){for(;R+1<B.length;R++)B[R]=B[R+1];B.pop()}function y(B){for(var R=new Array(B.length),T=0;T<R.length;++T)R[T]=B[T].listener||B[T];return R}function v(B,R){return new Promise(function(T,j){function G(te){B.removeListener(R,z),j(te)}function z(){typeof B.removeListener=="function"&&B.removeListener("error",G),T([].slice.call(arguments))}x(B,R,z,{once:!0}),R!=="error"&&g(B,G,{once:!0})})}function g(B,R,T){typeof B.on=="function"&&x(B,"error",R,T)}function x(B,R,T,j){if(typeof B.on=="function")j.once?B.once(R,T):B.on(R,T);else if(typeof B.addEventListener=="function")B.addEventListener(R,function G(z){j.once&&B.removeEventListener(R,G),T(z)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}return Ir.exports}var Ii,js;function qh(){return js||(js=1,Ii=or().EventEmitter),Ii}var Ri,zs;function f0(){if(zs)return Ri;zs=1;function d(p,b){var y=Object.keys(p);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(p);b&&(v=v.filter(function(g){return Object.getOwnPropertyDescriptor(p,g).enumerable})),y.push.apply(y,v)}return y}function e(p){for(var b=1;b<arguments.length;b++){var y=arguments[b]!=null?arguments[b]:{};b%2?d(Object(y),!0).forEach(function(v){t(p,v,y[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(y)):d(Object(y)).forEach(function(v){Object.defineProperty(p,v,Object.getOwnPropertyDescriptor(y,v))})}return p}function t(p,b,y){return b=s(b),b in p?Object.defineProperty(p,b,{value:y,enumerable:!0,configurable:!0,writable:!0}):p[b]=y,p}function i(p,b){if(!(p instanceof b))throw new TypeError("Cannot call a class as a function")}function u(p,b){for(var y=0;y<b.length;y++){var v=b[y];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,s(v.key),v)}}function r(p,b,y){return b&&u(p.prototype,b),Object.defineProperty(p,"prototype",{writable:!1}),p}function s(p){var b=a(p,"string");return typeof b=="symbol"?b:String(b)}function a(p,b){if(typeof p!="object"||p===null)return p;var y=p[Symbol.toPrimitive];if(y!==void 0){var v=y.call(p,b);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(p)}var o=xt(),f=o.Buffer,n=Wt,c=n.inspect,h=c&&c.custom||"inspect";function l(p,b,y){f.prototype.copy.call(p,b,y)}return Ri=(function(){function p(){i(this,p),this.head=null,this.tail=null,this.length=0}return r(p,[{key:"push",value:function(y){var v={data:y,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(y){var v={data:y,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var v=this.head,g=""+v.data;v=v.next;)g+=y+v.data;return g}},{key:"concat",value:function(y){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(y>>>0),g=this.head,x=0;g;)l(g.data,v,x),x+=g.data.length,g=g.next;return v}},{key:"consume",value:function(y,v){var g;return y<this.head.data.length?(g=this.head.data.slice(0,y),this.head.data=this.head.data.slice(y)):y===this.head.data.length?g=this.shift():g=v?this._getString(y):this._getBuffer(y),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(y){var v=this.head,g=1,x=v.data;for(y-=x.length;v=v.next;){var B=v.data,R=y>B.length?B.length:y;if(R===B.length?x+=B:x+=B.slice(0,y),y-=R,y===0){R===B.length?(++g,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=B.slice(R));break}++g}return this.length-=g,x}},{key:"_getBuffer",value:function(y){var v=f.allocUnsafe(y),g=this.head,x=1;for(g.data.copy(v),y-=g.data.length;g=g.next;){var B=g.data,R=y>B.length?B.length:y;if(B.copy(v,v.length-y,0,R),y-=R,y===0){R===B.length?(++x,g.next?this.head=g.next:this.head=this.tail=null):(this.head=g,g.data=B.slice(R));break}++x}return this.length-=x,v}},{key:h,value:function(y,v){return c(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),p})(),Ri}var Ai,Vs;function Hh(){if(Vs)return Ai;Vs=1;function d(s,a){var o=this,f=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return f||n?(a?a(s):s&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(u,this,s)):process.nextTick(u,this,s)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(s||null,function(c){!a&&c?o._writableState?o._writableState.errorEmitted?process.nextTick(t,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,c)):process.nextTick(e,o,c):a?(process.nextTick(t,o),a(c)):process.nextTick(t,o)}),this)}function e(s,a){u(s,a),t(s)}function t(s){s._writableState&&!s._writableState.emitClose||s._readableState&&!s._readableState.emitClose||s.emit("close")}function i(){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 u(s,a){s.emit("error",a)}function r(s,a){var o=s._readableState,f=s._writableState;o&&o.autoDestroy||f&&f.autoDestroy?s.destroy(a):s.emit("error",a)}return Ai={destroy:d,undestroy:i,errorOrDestroy:r},Ai}var Oi={},Gs;function Yt(){if(Gs)return Oi;Gs=1;function d(a,o){a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.__proto__=o}var e={};function t(a,o,f){f||(f=Error);function n(h,l,p){return typeof o=="string"?o:o(h,l,p)}var c=(function(h){d(l,h);function l(p,b,y){return h.call(this,n(p,b,y))||this}return l})(f);c.prototype.name=f.name,c.prototype.code=a,e[a]=c}function i(a,o){if(Array.isArray(a)){var f=a.length;return a=a.map(function(n){return String(n)}),f>2?"one of ".concat(o," ").concat(a.slice(0,f-1).join(", "),", or ")+a[f-1]:f===2?"one of ".concat(o," ").concat(a[0]," or ").concat(a[1]):"of ".concat(o," ").concat(a[0])}else return"of ".concat(o," ").concat(String(a))}function u(a,o,f){return a.substr(0,o.length)===o}function r(a,o,f){return(f===void 0||f>a.length)&&(f=a.length),a.substring(f-o.length,f)===o}function s(a,o,f){return typeof f!="number"&&(f=0),f+o.length>a.length?!1:a.indexOf(o,f)!==-1}return t("ERR_INVALID_OPT_VALUE",function(a,o){return'The value "'+o+'" is invalid for option "'+a+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(a,o,f){var n;typeof o=="string"&&u(o,"not ")?(n="must not be",o=o.replace(/^not /,"")):n="must be";var c;if(r(a," argument"))c="The ".concat(a," ").concat(n," ").concat(i(o,"type"));else{var h=s(a,".")?"property":"argument";c='The "'.concat(a,'" ').concat(h," ").concat(n," ").concat(i(o,"type"))}return c+=". Received type ".concat(typeof f),c},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(a){return"The "+a+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(a){return"Cannot call "+a+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(a){return"Unknown encoding: "+a},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Oi.codes=e,Oi}var Pi,$s;function Kh(){if($s)return Pi;$s=1;var d=Yt().codes.ERR_INVALID_OPT_VALUE;function e(i,u,r){return i.highWaterMark!=null?i.highWaterMark:u?i[r]:null}function t(i,u,r,s){var a=e(u,s,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var o=s?r:"highWaterMark";throw new d(o,a)}return Math.floor(a)}return i.objectMode?16:16*1024}return Pi={getHighWaterMark:t},Pi}var Ni,Ws;function jh(){if(Ws)return Ni;Ws=1,Ni=d;function d(t,i){if(e("noDeprecation"))return t;var u=!1;function r(){if(!u){if(e("throwDeprecation"))throw new Error(i);e("traceDeprecation")?console.trace(i):console.warn(i),u=!0}return t.apply(this,arguments)}return r}function e(t){try{if(!Re.localStorage)return!1}catch{return!1}var i=Re.localStorage[t];return i==null?!1:String(i).toLowerCase()==="true"}return Ni}var ki,Ys;function zh(){if(Ys)return ki;Ys=1,ki=G;function d(V){var P=this;this.next=null,this.entry=null,this.finish=function(){se(P,V)}}var e;G.WritableState=T;var t={deprecate:jh()},i=qh(),u=xt().Buffer,r=(typeof Re<"u"?Re:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(V){return u.from(V)}function a(V){return u.isBuffer(V)||V instanceof r}var o=Hh(),f=Kh(),n=f.getHighWaterMark,c=Yt().codes,h=c.ERR_INVALID_ARG_TYPE,l=c.ERR_METHOD_NOT_IMPLEMENTED,p=c.ERR_MULTIPLE_CALLBACK,b=c.ERR_STREAM_CANNOT_PIPE,y=c.ERR_STREAM_DESTROYED,v=c.ERR_STREAM_NULL_VALUES,g=c.ERR_STREAM_WRITE_AFTER_END,x=c.ERR_UNKNOWN_ENCODING,B=o.errorOrDestroy;be()(G,i);function R(){}function T(V,P,M){e=e||zt(),V=V||{},typeof M!="boolean"&&(M=P instanceof e),this.objectMode=!!V.objectMode,M&&(this.objectMode=this.objectMode||!!V.writableObjectMode),this.highWaterMark=n(this,V,"writableHighWaterMark",M),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Y=V.decodeStrings===!1;this.decodeStrings=!Y,this.defaultEncoding=V.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){O(P,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}T.prototype.getBuffer=function(){for(var P=this.bufferedRequest,M=[];P;)M.push(P),P=P.next;return M},(function(){try{Object.defineProperty(T.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var j;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(j=Function.prototype[Symbol.hasInstance],Object.defineProperty(G,Symbol.hasInstance,{value:function(P){return j.call(this,P)?!0:this!==G?!1:P&&P._writableState instanceof T}})):j=function(P){return P instanceof this};function G(V){e=e||zt();var P=this instanceof e;if(!P&&!j.call(G,this))return new G(V);this._writableState=new T(V,this,P),this.writable=!0,V&&(typeof V.write=="function"&&(this._write=V.write),typeof V.writev=="function"&&(this._writev=V.writev),typeof V.destroy=="function"&&(this._destroy=V.destroy),typeof V.final=="function"&&(this._final=V.final)),i.call(this)}G.prototype.pipe=function(){B(this,new b)};function z(V,P){var M=new g;B(V,M),process.nextTick(P,M)}function te(V,P,M,Y){var Q;return M===null?Q=new v:typeof M!="string"&&!P.objectMode&&(Q=new h("chunk",["string","Buffer"],M)),Q?(B(V,Q),process.nextTick(Y,Q),!1):!0}G.prototype.write=function(V,P,M){var Y=this._writableState,Q=!1,D=!Y.objectMode&&a(V);return D&&!u.isBuffer(V)&&(V=s(V)),typeof P=="function"&&(M=P,P=null),D?P="buffer":P||(P=Y.defaultEncoding),typeof M!="function"&&(M=R),Y.ending?z(this,M):(D||te(this,Y,V,M))&&(Y.pendingcb++,Q=$(this,Y,D,V,P,M)),Q},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){var V=this._writableState;V.corked&&(V.corked--,!V.writing&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&F(this,V))},G.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 x(P);return this._writableState.defaultEncoding=P,this},Object.defineProperty(G.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ne(V,P,M){return!V.objectMode&&V.decodeStrings!==!1&&typeof P=="string"&&(P=u.from(P,M)),P}Object.defineProperty(G.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(V,P,M,Y,Q,D){if(!M){var C=ne(P,Y,Q);Y!==C&&(M=!0,Q="buffer",Y=C)}var J=P.objectMode?1:Y.length;P.length+=J;var ie=P.length<P.highWaterMark;if(ie||(P.needDrain=!0),P.writing||P.corked){var he=P.lastBufferedRequest;P.lastBufferedRequest={chunk:Y,encoding:Q,isBuf:M,callback:D,next:null},he?he.next=P.lastBufferedRequest:P.bufferedRequest=P.lastBufferedRequest,P.bufferedRequestCount+=1}else N(V,P,!1,J,Y,Q,D);return ie}function N(V,P,M,Y,Q,D,C){P.writelen=Y,P.writecb=C,P.writing=!0,P.sync=!0,P.destroyed?P.onwrite(new y("write")):M?V._writev(Q,P.onwrite):V._write(Q,D,P.onwrite),P.sync=!1}function m(V,P,M,Y,Q){--P.pendingcb,M?(process.nextTick(Q,Y),process.nextTick(q,V,P),V._writableState.errorEmitted=!0,B(V,Y)):(Q(Y),V._writableState.errorEmitted=!0,B(V,Y),q(V,P))}function E(V){V.writing=!1,V.writecb=null,V.length-=V.writelen,V.writelen=0}function O(V,P){var M=V._writableState,Y=M.sync,Q=M.writecb;if(typeof Q!="function")throw new p;if(E(M),P)m(V,M,Y,P,Q);else{var D=K(M)||V.destroyed;!D&&!M.corked&&!M.bufferProcessing&&M.bufferedRequest&&F(V,M),Y?process.nextTick(I,V,M,D,Q):I(V,M,D,Q)}}function I(V,P,M,Y){M||A(V,P),P.pendingcb--,Y(),q(V,P)}function A(V,P){P.length===0&&P.needDrain&&(P.needDrain=!1,V.emit("drain"))}function F(V,P){P.bufferProcessing=!0;var M=P.bufferedRequest;if(V._writev&&M&&M.next){var Y=P.bufferedRequestCount,Q=new Array(Y),D=P.corkedRequestsFree;D.entry=M;for(var C=0,J=!0;M;)Q[C]=M,M.isBuf||(J=!1),M=M.next,C+=1;Q.allBuffers=J,N(V,P,!0,P.length,Q,"",D.finish),P.pendingcb++,P.lastBufferedRequest=null,D.next?(P.corkedRequestsFree=D.next,D.next=null):P.corkedRequestsFree=new d(P),P.bufferedRequestCount=0}else{for(;M;){var ie=M.chunk,he=M.encoding,oe=M.callback,ue=P.objectMode?1:ie.length;if(N(V,P,!1,ue,ie,he,oe),M=M.next,P.bufferedRequestCount--,P.writing)break}M===null&&(P.lastBufferedRequest=null)}P.bufferedRequest=M,P.bufferProcessing=!1}G.prototype._write=function(V,P,M){M(new l("_write()"))},G.prototype._writev=null,G.prototype.end=function(V,P,M){var Y=this._writableState;return typeof V=="function"?(M=V,V=null,P=null):typeof P=="function"&&(M=P,P=null),V!=null&&this.write(V,P),Y.corked&&(Y.corked=1,this.uncork()),Y.ending||fe(this,Y,M),this},Object.defineProperty(G.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function K(V){return V.ending&&V.length===0&&V.bufferedRequest===null&&!V.finished&&!V.writing}function L(V,P){V._final(function(M){P.pendingcb--,M&&B(V,M),P.prefinished=!0,V.emit("prefinish"),q(V,P)})}function _(V,P){!P.prefinished&&!P.finalCalled&&(typeof V._final=="function"&&!P.destroyed?(P.pendingcb++,P.finalCalled=!0,process.nextTick(L,V,P)):(P.prefinished=!0,V.emit("prefinish")))}function q(V,P){var M=K(P);if(M&&(_(V,P),P.pendingcb===0&&(P.finished=!0,V.emit("finish"),P.autoDestroy))){var Y=V._readableState;(!Y||Y.autoDestroy&&Y.endEmitted)&&V.destroy()}return M}function fe(V,P,M){P.ending=!0,q(V,P),M&&(P.finished?process.nextTick(M):V.once("finish",M)),P.ended=!0,V.writable=!1}function se(V,P,M){var Y=V.entry;for(V.entry=null;Y;){var Q=Y.callback;P.pendingcb--,Q(M),Y=Y.next}P.corkedRequestsFree.next=V}return Object.defineProperty(G.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(P){this._writableState&&(this._writableState.destroyed=P)}}),G.prototype.destroy=o.destroy,G.prototype._undestroy=o.undestroy,G.prototype._destroy=function(V,P){P(V)},ki}var Mi,Js;function zt(){if(Js)return Mi;Js=1;var d=Object.keys||function(f){var n=[];for(var c in f)n.push(c);return n};Mi=s;var e=Vh(),t=zh();be()(s,e);for(var i=d(t.prototype),u=0;u<i.length;u++){var r=i[u];s.prototype[r]||(s.prototype[r]=t.prototype[r])}function s(f){if(!(this instanceof s))return new s(f);e.call(this,f),t.call(this,f),this.allowHalfOpen=!0,f&&(f.readable===!1&&(this.readable=!1),f.writable===!1&&(this.writable=!1),f.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(o,this)}function o(f){f.end()}return Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(n){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=n,this._writableState.destroyed=n)}}),Mi}var Ci={},Xs;function Xf(){if(Xs)return Ci;Xs=1;var d=_e().Buffer,e=d.isEncoding||function(v){switch(v=""+v,v&&v.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(v){if(!v)return"utf8";for(var g;;)switch(v){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 v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function i(v){var g=t(v);if(typeof g!="string"&&(d.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return g||v}Ci.StringDecoder=u;function u(v){this.encoding=i(v);var g;switch(this.encoding){case"utf16le":this.text=c,this.end=h,g=4;break;case"utf8":this.fillLast=o,g=4;break;case"base64":this.text=l,this.end=p,g=3;break;default:this.write=b,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=d.allocUnsafe(g)}u.prototype.write=function(v){if(v.length===0)return"";var g,x;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<v.length?g?g+this.text(v,x):this.text(v,x):g||""},u.prototype.end=n,u.prototype.text=f,u.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function r(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,g,x){var B=g.length-1;if(B<x)return 0;var R=r(g[B]);return R>=0?(R>0&&(v.lastNeed=R-1),R):--B<x||R===-2?0:(R=r(g[B]),R>=0?(R>0&&(v.lastNeed=R-2),R):--B<x||R===-2?0:(R=r(g[B]),R>=0?(R>0&&(R===2?R=0:v.lastNeed=R-3),R):0))}function a(v,g,x){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return v.lastNeed=2,"�"}}function o(v){var g=this.lastTotal-this.lastNeed,x=a(this,v);if(x!==void 0)return x;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function f(v,g){var x=s(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=x;var B=v.length-(x-this.lastNeed);return v.copy(this.lastChar,0,B),v.toString("utf8",g,B)}function n(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+"�":g}function c(v,g){if((v.length-g)%2===0){var x=v.toString("utf16le",g);if(x){var B=x.charCodeAt(x.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function h(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,x)}return g}function l(v,g){var x=(v.length-g)%3;return x===0?v.toString("base64",g):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",g,v.length-x))}function p(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function b(v){return v.toString(this.encoding)}function y(v){return v&&v.length?this.write(v):""}return Ci}var Ti,Qs;function ss(){if(Qs)return Ti;Qs=1;var d=Yt().codes.ERR_STREAM_PREMATURE_CLOSE;function e(r){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,o=new Array(a),f=0;f<a;f++)o[f]=arguments[f];r.apply(this,o)}}}function t(){}function i(r){return r.setHeader&&typeof r.abort=="function"}function u(r,s,a){if(typeof s=="function")return u(r,null,s);s||(s={}),a=e(a||t);var o=s.readable||s.readable!==!1&&r.readable,f=s.writable||s.writable!==!1&&r.writable,n=function(){r.writable||h()},c=r._writableState&&r._writableState.finished,h=function(){f=!1,c=!0,o||a.call(r)},l=r._readableState&&r._readableState.endEmitted,p=function(){o=!1,l=!0,f||a.call(r)},b=function(x){a.call(r,x)},y=function(){var x;if(o&&!l)return(!r._readableState||!r._readableState.ended)&&(x=new d),a.call(r,x);if(f&&!c)return(!r._writableState||!r._writableState.ended)&&(x=new d),a.call(r,x)},v=function(){r.req.on("finish",h)};return i(r)?(r.on("complete",h),r.on("abort",y),r.req?v():r.on("request",v)):f&&!r._writableState&&(r.on("end",n),r.on("close",n)),r.on("end",p),r.on("finish",h),s.error!==!1&&r.on("error",b),r.on("close",y),function(){r.removeListener("complete",h),r.removeListener("abort",y),r.removeListener("request",v),r.req&&r.req.removeListener("finish",h),r.removeListener("end",n),r.removeListener("close",n),r.removeListener("finish",h),r.removeListener("end",p),r.removeListener("error",b),r.removeListener("close",y)}}return Ti=u,Ti}var Li,Zs;function s0(){if(Zs)return Li;Zs=1;var d;function e(x,B,R){return B=t(B),B in x?Object.defineProperty(x,B,{value:R,enumerable:!0,configurable:!0,writable:!0}):x[B]=R,x}function t(x){var B=i(x,"string");return typeof B=="symbol"?B:String(B)}function i(x,B){if(typeof x!="object"||x===null)return x;var R=x[Symbol.toPrimitive];if(R!==void 0){var T=R.call(x,B);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(B==="string"?String:Number)(x)}var u=ss(),r=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),o=Symbol("ended"),f=Symbol("lastPromise"),n=Symbol("handlePromise"),c=Symbol("stream");function h(x,B){return{value:x,done:B}}function l(x){var B=x[r];if(B!==null){var R=x[c].read();R!==null&&(x[f]=null,x[r]=null,x[s]=null,B(h(R,!1)))}}function p(x){process.nextTick(l,x)}function b(x,B){return function(R,T){x.then(function(){if(B[o]){R(h(void 0,!0));return}B[n](R,T)},T)}}var y=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((d={get stream(){return this[c]},next:function(){var B=this,R=this[a];if(R!==null)return Promise.reject(R);if(this[o])return Promise.resolve(h(void 0,!0));if(this[c].destroyed)return new Promise(function(z,te){process.nextTick(function(){B[a]?te(B[a]):z(h(void 0,!0))})});var T=this[f],j;if(T)j=new Promise(b(T,this));else{var G=this[c].read();if(G!==null)return Promise.resolve(h(G,!1));j=new Promise(this[n])}return this[f]=j,j}},e(d,Symbol.asyncIterator,function(){return this}),e(d,"return",function(){var B=this;return new Promise(function(R,T){B[c].destroy(null,function(j){if(j){T(j);return}R(h(void 0,!0))})})}),d),y),g=function(B){var R,T=Object.create(v,(R={},e(R,c,{value:B,writable:!0}),e(R,r,{value:null,writable:!0}),e(R,s,{value:null,writable:!0}),e(R,a,{value:null,writable:!0}),e(R,o,{value:B._readableState.endEmitted,writable:!0}),e(R,n,{value:function(G,z){var te=T[c].read();te?(T[f]=null,T[r]=null,T[s]=null,G(h(te,!1))):(T[r]=G,T[s]=z)},writable:!0}),R));return T[f]=null,u(B,function(j){if(j&&j.code!=="ERR_STREAM_PREMATURE_CLOSE"){var G=T[s];G!==null&&(T[f]=null,T[r]=null,T[s]=null,G(j)),T[a]=j;return}var z=T[r];z!==null&&(T[f]=null,T[r]=null,T[s]=null,z(h(void 0,!0))),T[o]=!0}),B.on("readable",p.bind(null,T)),T};return Li=g,Li}var Di,eo;function o0(){return eo||(eo=1,Di=function(){throw new Error("Readable.from is not available in the browser")}),Di}var Fi,to;function Vh(){if(to)return Fi;to=1,Fi=z;var d;z.ReadableState=G,or().EventEmitter;var e=function(C,J){return C.listeners(J).length},t=qh(),i=xt().Buffer,u=(typeof Re<"u"?Re:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function r(D){return i.from(D)}function s(D){return i.isBuffer(D)||D instanceof u}var a=Wt,o;a&&a.debuglog?o=a.debuglog("stream"):o=function(){};var f=f0(),n=Hh(),c=Kh(),h=c.getHighWaterMark,l=Yt().codes,p=l.ERR_INVALID_ARG_TYPE,b=l.ERR_STREAM_PUSH_AFTER_EOF,y=l.ERR_METHOD_NOT_IMPLEMENTED,v=l.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,g,x,B;be()(z,t);var R=n.errorOrDestroy,T=["error","close","destroy","pause","resume"];function j(D,C,J){if(typeof D.prependListener=="function")return D.prependListener(C,J);!D._events||!D._events[C]?D.on(C,J):Array.isArray(D._events[C])?D._events[C].unshift(J):D._events[C]=[J,D._events[C]]}function G(D,C,J){d=d||zt(),D=D||{},typeof J!="boolean"&&(J=C instanceof d),this.objectMode=!!D.objectMode,J&&(this.objectMode=this.objectMode||!!D.readableObjectMode),this.highWaterMark=h(this,D,"readableHighWaterMark",J),this.buffer=new f,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=D.emitClose!==!1,this.autoDestroy=!!D.autoDestroy,this.destroyed=!1,this.defaultEncoding=D.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,D.encoding&&(g||(g=Xf().StringDecoder),this.decoder=new g(D.encoding),this.encoding=D.encoding)}function z(D){if(d=d||zt(),!(this instanceof z))return new z(D);var C=this instanceof d;this._readableState=new G(D,this,C),this.readable=!0,D&&(typeof D.read=="function"&&(this._read=D.read),typeof D.destroy=="function"&&(this._destroy=D.destroy)),t.call(this)}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(C){this._readableState&&(this._readableState.destroyed=C)}}),z.prototype.destroy=n.destroy,z.prototype._undestroy=n.undestroy,z.prototype._destroy=function(D,C){C(D)},z.prototype.push=function(D,C){var J=this._readableState,ie;return J.objectMode?ie=!0:typeof D=="string"&&(C=C||J.defaultEncoding,C!==J.encoding&&(D=i.from(D,C),C=""),ie=!0),te(this,D,C,!1,ie)},z.prototype.unshift=function(D){return te(this,D,null,!0,!1)};function te(D,C,J,ie,he){o("readableAddChunk",C);var oe=D._readableState;if(C===null)oe.reading=!1,O(D,oe);else{var ue;if(he||(ue=$(oe,C)),ue)R(D,ue);else if(oe.objectMode||C&&C.length>0)if(typeof C!="string"&&!oe.objectMode&&Object.getPrototypeOf(C)!==i.prototype&&(C=r(C)),ie)oe.endEmitted?R(D,new v):ne(D,oe,C,!0);else if(oe.ended)R(D,new b);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!J?(C=oe.decoder.write(C),oe.objectMode||C.length!==0?ne(D,oe,C,!1):F(D,oe)):ne(D,oe,C,!1)}else ie||(oe.reading=!1,F(D,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function ne(D,C,J,ie){C.flowing&&C.length===0&&!C.sync?(C.awaitDrain=0,D.emit("data",J)):(C.length+=C.objectMode?1:J.length,ie?C.buffer.unshift(J):C.buffer.push(J),C.needReadable&&I(D)),F(D,C)}function $(D,C){var J;return!s(C)&&typeof C!="string"&&C!==void 0&&!D.objectMode&&(J=new p("chunk",["string","Buffer","Uint8Array"],C)),J}z.prototype.isPaused=function(){return this._readableState.flowing===!1},z.prototype.setEncoding=function(D){g||(g=Xf().StringDecoder);var C=new g(D);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;for(var J=this._readableState.buffer.head,ie="";J!==null;)ie+=C.write(J.data),J=J.next;return this._readableState.buffer.clear(),ie!==""&&this._readableState.buffer.push(ie),this._readableState.length=ie.length,this};var N=1073741824;function m(D){return D>=N?D=N:(D--,D|=D>>>1,D|=D>>>2,D|=D>>>4,D|=D>>>8,D|=D>>>16,D++),D}function E(D,C){return D<=0||C.length===0&&C.ended?0:C.objectMode?1:D!==D?C.flowing&&C.length?C.buffer.head.data.length:C.length:(D>C.highWaterMark&&(C.highWaterMark=m(D)),D<=C.length?D:C.ended?C.length:(C.needReadable=!0,0))}z.prototype.read=function(D){o("read",D),D=parseInt(D,10);var C=this._readableState,J=D;if(D!==0&&(C.emittedReadable=!1),D===0&&C.needReadable&&((C.highWaterMark!==0?C.length>=C.highWaterMark:C.length>0)||C.ended))return o("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?M(this):I(this),null;if(D=E(D,C),D===0&&C.ended)return C.length===0&&M(this),null;var ie=C.needReadable;o("need readable",ie),(C.length===0||C.length-D<C.highWaterMark)&&(ie=!0,o("length less than watermark",ie)),C.ended||C.reading?(ie=!1,o("reading or ended",ie)):ie&&(o("do read"),C.reading=!0,C.sync=!0,C.length===0&&(C.needReadable=!0),this._read(C.highWaterMark),C.sync=!1,C.reading||(D=E(J,C)));var he;return D>0?he=P(D,C):he=null,he===null?(C.needReadable=C.length<=C.highWaterMark,D=0):(C.length-=D,C.awaitDrain=0),C.length===0&&(C.ended||(C.needReadable=!0),J!==D&&C.ended&&M(this)),he!==null&&this.emit("data",he),he};function O(D,C){if(o("onEofChunk"),!C.ended){if(C.decoder){var J=C.decoder.end();J&&J.length&&(C.buffer.push(J),C.length+=C.objectMode?1:J.length)}C.ended=!0,C.sync?I(D):(C.needReadable=!1,C.emittedReadable||(C.emittedReadable=!0,A(D)))}}function I(D){var C=D._readableState;o("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(o("emitReadable",C.flowing),C.emittedReadable=!0,process.nextTick(A,D))}function A(D){var C=D._readableState;o("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&(C.length||C.ended)&&(D.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,V(D)}function F(D,C){C.readingMore||(C.readingMore=!0,process.nextTick(K,D,C))}function K(D,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){var J=C.length;if(o("maybeReadMore read 0"),D.read(0),J===C.length)break}C.readingMore=!1}z.prototype._read=function(D){R(this,new y("_read()"))},z.prototype.pipe=function(D,C){var J=this,ie=this._readableState;switch(ie.pipesCount){case 0:ie.pipes=D;break;case 1:ie.pipes=[ie.pipes,D];break;default:ie.pipes.push(D);break}ie.pipesCount+=1,o("pipe count=%d opts=%j",ie.pipesCount,C);var he=(!C||C.end!==!1)&&D!==process.stdout&&D!==process.stderr,oe=he?ge:Ne;ie.endEmitted?process.nextTick(oe):J.once("end",oe),D.on("unpipe",ue);function ue(k,w){o("onunpipe"),k===J&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,de())}function ge(){o("onend"),D.end()}var Ke=L(J);D.on("drain",Ke);var Se=!1;function de(){o("cleanup"),D.removeListener("close",me),D.removeListener("finish",Le),D.removeListener("drain",Ke),D.removeListener("error",ve),D.removeListener("unpipe",ue),J.removeListener("end",ge),J.removeListener("end",Ne),J.removeListener("data",Ie),Se=!0,ie.awaitDrain&&(!D._writableState||D._writableState.needDrain)&&Ke()}J.on("data",Ie);function Ie(k){o("ondata");var w=D.write(k);o("dest.write",w),w===!1&&((ie.pipesCount===1&&ie.pipes===D||ie.pipesCount>1&&Q(ie.pipes,D)!==-1)&&!Se&&(o("false write response, pause",ie.awaitDrain),ie.awaitDrain++),J.pause())}function ve(k){o("onerror",k),Ne(),D.removeListener("error",ve),e(D,"error")===0&&R(D,k)}j(D,"error",ve);function me(){D.removeListener("finish",Le),Ne()}D.once("close",me);function Le(){o("onfinish"),D.removeListener("close",me),Ne()}D.once("finish",Le);function Ne(){o("unpipe"),J.unpipe(D)}return D.emit("pipe",J),ie.flowing||(o("pipe resume"),J.resume()),D};function L(D){return function(){var J=D._readableState;o("pipeOnDrain",J.awaitDrain),J.awaitDrain&&J.awaitDrain--,J.awaitDrain===0&&e(D,"data")&&(J.flowing=!0,V(D))}}z.prototype.unpipe=function(D){var C=this._readableState,J={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return D&&D!==C.pipes?this:(D||(D=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,D&&D.emit("unpipe",this,J),this);if(!D){var ie=C.pipes,he=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var oe=0;oe<he;oe++)ie[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var ue=Q(C.pipes,D);return ue===-1?this:(C.pipes.splice(ue,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),D.emit("unpipe",this,J),this)},z.prototype.on=function(D,C){var J=t.prototype.on.call(this,D,C),ie=this._readableState;return D==="data"?(ie.readableListening=this.listenerCount("readable")>0,ie.flowing!==!1&&this.resume()):D==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,o("on readable",ie.length,ie.reading),ie.length?I(this):ie.reading||process.nextTick(q,this)),J},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(D,C){var J=t.prototype.removeListener.call(this,D,C);return D==="readable"&&process.nextTick(_,this),J},z.prototype.removeAllListeners=function(D){var C=t.prototype.removeAllListeners.apply(this,arguments);return(D==="readable"||D===void 0)&&process.nextTick(_,this),C};function _(D){var C=D._readableState;C.readableListening=D.listenerCount("readable")>0,C.resumeScheduled&&!C.paused?C.flowing=!0:D.listenerCount("data")>0&&D.resume()}function q(D){o("readable nexttick read 0"),D.read(0)}z.prototype.resume=function(){var D=this._readableState;return D.flowing||(o("resume"),D.flowing=!D.readableListening,fe(this,D)),D.paused=!1,this};function fe(D,C){C.resumeScheduled||(C.resumeScheduled=!0,process.nextTick(se,D,C))}function se(D,C){o("resume",C.reading),C.reading||D.read(0),C.resumeScheduled=!1,D.emit("resume"),V(D),C.flowing&&!C.reading&&D.read(0)}z.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function V(D){var C=D._readableState;for(o("flow",C.flowing);C.flowing&&D.read()!==null;);}z.prototype.wrap=function(D){var C=this,J=this._readableState,ie=!1;D.on("end",function(){if(o("wrapped end"),J.decoder&&!J.ended){var ue=J.decoder.end();ue&&ue.length&&C.push(ue)}C.push(null)}),D.on("data",function(ue){if(o("wrapped data"),J.decoder&&(ue=J.decoder.write(ue)),!(J.objectMode&&ue==null)&&!(!J.objectMode&&(!ue||!ue.length))){var ge=C.push(ue);ge||(ie=!0,D.pause())}});for(var he in D)this[he]===void 0&&typeof D[he]=="function"&&(this[he]=(function(ge){return function(){return D[ge].apply(D,arguments)}})(he));for(var oe=0;oe<T.length;oe++)D.on(T[oe],this.emit.bind(this,T[oe]));return this._read=function(ue){o("wrapped _read",ue),ie&&(ie=!1,D.resume())},this},typeof Symbol=="function"&&(z.prototype[Symbol.asyncIterator]=function(){return x===void 0&&(x=s0()),x(this)}),Object.defineProperty(z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(C){this._readableState&&(this._readableState.flowing=C)}}),z._fromList=P,Object.defineProperty(z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function P(D,C){if(C.length===0)return null;var J;return C.objectMode?J=C.buffer.shift():!D||D>=C.length?(C.decoder?J=C.buffer.join(""):C.buffer.length===1?J=C.buffer.first():J=C.buffer.concat(C.length),C.buffer.clear()):J=C.buffer.consume(D,C.decoder),J}function M(D){var C=D._readableState;o("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,process.nextTick(Y,C,D))}function Y(D,C){if(o("endReadableNT",D.endEmitted,D.length),!D.endEmitted&&D.length===0&&(D.endEmitted=!0,C.readable=!1,C.emit("end"),D.autoDestroy)){var J=C._writableState;(!J||J.autoDestroy&&J.finished)&&C.destroy()}}typeof Symbol=="function"&&(z.from=function(D,C){return B===void 0&&(B=o0()),B(z,D,C)});function Q(D,C){for(var J=0,ie=D.length;J<ie;J++)if(D[J]===C)return J;return-1}return Fi}var Ui,ro;function Gh(){if(ro)return Ui;ro=1,Ui=a;var d=Yt().codes,e=d.ERR_METHOD_NOT_IMPLEMENTED,t=d.ERR_MULTIPLE_CALLBACK,i=d.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=d.ERR_TRANSFORM_WITH_LENGTH_0,r=zt();be()(a,r);function s(n,c){var h=this._transformState;h.transforming=!1;var l=h.writecb;if(l===null)return this.emit("error",new t);h.writechunk=null,h.writecb=null,c!=null&&this.push(c),l(n);var p=this._readableState;p.reading=!1,(p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}function a(n){if(!(this instanceof a))return new a(n);r.call(this,n),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.on("prefinish",o)}function o(){var n=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(c,h){f(n,c,h)}):f(this,null,null)}a.prototype.push=function(n,c){return this._transformState.needTransform=!1,r.prototype.push.call(this,n,c)},a.prototype._transform=function(n,c,h){h(new e("_transform()"))},a.prototype._write=function(n,c,h){var l=this._transformState;if(l.writecb=h,l.writechunk=n,l.writeencoding=c,!l.transforming){var p=this._readableState;(l.needTransform||p.needReadable||p.length<p.highWaterMark)&&this._read(p.highWaterMark)}},a.prototype._read=function(n){var c=this._transformState;c.writechunk!==null&&!c.transforming?(c.transforming=!0,this._transform(c.writechunk,c.writeencoding,c.afterTransform)):c.needTransform=!0},a.prototype._destroy=function(n,c){r.prototype._destroy.call(this,n,function(h){c(h)})};function f(n,c,h){if(c)return n.emit("error",c);if(h!=null&&n.push(h),n._writableState.length)throw new u;if(n._transformState.transforming)throw new i;return n.push(null)}return Ui}var qi,io;function c0(){if(io)return qi;io=1,qi=e;var d=Gh();be()(e,d);function e(t){if(!(this instanceof e))return new e(t);d.call(this,t)}return e.prototype._transform=function(t,i,u){u(null,t)},qi}var Hi,no;function u0(){if(no)return Hi;no=1;var d;function e(h){var l=!1;return function(){l||(l=!0,h.apply(void 0,arguments))}}var t=Yt().codes,i=t.ERR_MISSING_ARGS,u=t.ERR_STREAM_DESTROYED;function r(h){if(h)throw h}function s(h){return h.setHeader&&typeof h.abort=="function"}function a(h,l,p,b){b=e(b);var y=!1;h.on("close",function(){y=!0}),d===void 0&&(d=ss()),d(h,{readable:l,writable:p},function(g){if(g)return b(g);y=!0,b()});var v=!1;return function(g){if(!y&&!v){if(v=!0,s(h))return h.abort();if(typeof h.destroy=="function")return h.destroy();b(g||new u("pipe"))}}}function o(h){h()}function f(h,l){return h.pipe(l)}function n(h){return!h.length||typeof h[h.length-1]!="function"?r:h.pop()}function c(){for(var h=arguments.length,l=new Array(h),p=0;p<h;p++)l[p]=arguments[p];var b=n(l);if(Array.isArray(l[0])&&(l=l[0]),l.length<2)throw new i("streams");var y,v=l.map(function(g,x){var B=x<l.length-1,R=x>0;return a(g,B,R,function(T){y||(y=T),T&&v.forEach(o),!B&&(v.forEach(o),b(y))})});return l.reduce(f)}return Hi=c,Hi}var Ki,ao;function $h(){if(ao)return Ki;ao=1,Ki=t;var d=or().EventEmitter,e=be();e(t,d),t.Readable=Vh(),t.Writable=zh(),t.Duplex=zt(),t.Transform=Gh(),t.PassThrough=c0(),t.finished=ss(),t.pipeline=u0(),t.Stream=t;function t(){d.call(this)}return t.prototype.pipe=function(i,u){var r=this;function s(l){i.writable&&i.write(l)===!1&&r.pause&&r.pause()}r.on("data",s);function a(){r.readable&&r.resume&&r.resume()}i.on("drain",a),!i._isStdio&&(!u||u.end!==!1)&&(r.on("end",f),r.on("close",n));var o=!1;function f(){o||(o=!0,i.end())}function n(){o||(o=!0,typeof i.destroy=="function"&&i.destroy())}function c(l){if(h(),d.listenerCount(this,"error")===0)throw l}r.on("error",c),i.on("error",c);function h(){r.removeListener("data",s),i.removeListener("drain",a),r.removeListener("end",f),r.removeListener("close",n),r.removeListener("error",c),i.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),i.removeListener("close",h)}return r.on("end",h),r.on("close",h),i.on("close",h),i.emit("pipe",r),i},Ki}var ji,fo;function h0(){if(fo)return ji;fo=1;var d=_e().Buffer,e=$h().Transform,t=be();function i(a){e.call(this),this._block=d.allocUnsafe(a),this._blockSize=a,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t(i,e),i.prototype._transform=function(a,o,f){var n=null;try{this.update(a,o)}catch(c){n=c}f(n)},i.prototype._flush=function(a){var o=null;try{this.push(this.digest())}catch(f){o=f}a(o)};var u=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(d.prototype instanceof Uint8Array||d.TYPED_ARRAY_SUPPORT);function s(a,o){if(a instanceof d)return a;if(typeof a=="string")return d.from(a,o);if(r&&ArrayBuffer.isView(a)){if(a.byteLength===0)return d.alloc(0);var f=d.from(a.buffer,a.byteOffset,a.byteLength);if(f.byteLength===a.byteLength)return f}if(u&&a instanceof Uint8Array||d.isBuffer(a)&&a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a))return d.from(a);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return i.prototype.update=function(a,o){if(this._finalized)throw new Error("Digest already called");a=s(a,o);for(var f=this._block,n=0;this._blockOffset+a.length-n>=this._blockSize;){for(var c=this._blockOffset;c<this._blockSize;)f[c++]=a[n++];this._update(),this._blockOffset=0}for(;n<a.length;)f[this._blockOffset++]=a[n++];for(var h=0,l=a.length*8;l>0;++h)this._length[h]+=l,l=this._length[h]/4294967296|0,l>0&&(this._length[h]-=4294967296*l);return this},i.prototype._update=function(){throw new Error("_update is not implemented")},i.prototype.digest=function(a){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var o=this._digest();a!==void 0&&(o=o.toString(a)),this._block.fill(0),this._blockOffset=0;for(var f=0;f<4;++f)this._length[f]=0;return o},i.prototype._digest=function(){throw new Error("_digest is not implemented")},ji=i,ji}var zi,so;function os(){if(so)return zi;so=1;var d=be(),e=h0(),t=_e().Buffer,i=new Array(16);function u(){e.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}d(u,e),u.prototype._update=function(){for(var n=i,c=0;c<16;++c)n[c]=this._block.readInt32LE(c*4);var h=this._a,l=this._b,p=this._c,b=this._d;h=s(h,l,p,b,n[0],3614090360,7),b=s(b,h,l,p,n[1],3905402710,12),p=s(p,b,h,l,n[2],606105819,17),l=s(l,p,b,h,n[3],3250441966,22),h=s(h,l,p,b,n[4],4118548399,7),b=s(b,h,l,p,n[5],1200080426,12),p=s(p,b,h,l,n[6],2821735955,17),l=s(l,p,b,h,n[7],4249261313,22),h=s(h,l,p,b,n[8],1770035416,7),b=s(b,h,l,p,n[9],2336552879,12),p=s(p,b,h,l,n[10],4294925233,17),l=s(l,p,b,h,n[11],2304563134,22),h=s(h,l,p,b,n[12],1804603682,7),b=s(b,h,l,p,n[13],4254626195,12),p=s(p,b,h,l,n[14],2792965006,17),l=s(l,p,b,h,n[15],1236535329,22),h=a(h,l,p,b,n[1],4129170786,5),b=a(b,h,l,p,n[6],3225465664,9),p=a(p,b,h,l,n[11],643717713,14),l=a(l,p,b,h,n[0],3921069994,20),h=a(h,l,p,b,n[5],3593408605,5),b=a(b,h,l,p,n[10],38016083,9),p=a(p,b,h,l,n[15],3634488961,14),l=a(l,p,b,h,n[4],3889429448,20),h=a(h,l,p,b,n[9],568446438,5),b=a(b,h,l,p,n[14],3275163606,9),p=a(p,b,h,l,n[3],4107603335,14),l=a(l,p,b,h,n[8],1163531501,20),h=a(h,l,p,b,n[13],2850285829,5),b=a(b,h,l,p,n[2],4243563512,9),p=a(p,b,h,l,n[7],1735328473,14),l=a(l,p,b,h,n[12],2368359562,20),h=o(h,l,p,b,n[5],4294588738,4),b=o(b,h,l,p,n[8],2272392833,11),p=o(p,b,h,l,n[11],1839030562,16),l=o(l,p,b,h,n[14],4259657740,23),h=o(h,l,p,b,n[1],2763975236,4),b=o(b,h,l,p,n[4],1272893353,11),p=o(p,b,h,l,n[7],4139469664,16),l=o(l,p,b,h,n[10],3200236656,23),h=o(h,l,p,b,n[13],681279174,4),b=o(b,h,l,p,n[0],3936430074,11),p=o(p,b,h,l,n[3],3572445317,16),l=o(l,p,b,h,n[6],76029189,23),h=o(h,l,p,b,n[9],3654602809,4),b=o(b,h,l,p,n[12],3873151461,11),p=o(p,b,h,l,n[15],530742520,16),l=o(l,p,b,h,n[2],3299628645,23),h=f(h,l,p,b,n[0],4096336452,6),b=f(b,h,l,p,n[7],1126891415,10),p=f(p,b,h,l,n[14],2878612391,15),l=f(l,p,b,h,n[5],4237533241,21),h=f(h,l,p,b,n[12],1700485571,6),b=f(b,h,l,p,n[3],2399980690,10),p=f(p,b,h,l,n[10],4293915773,15),l=f(l,p,b,h,n[1],2240044497,21),h=f(h,l,p,b,n[8],1873313359,6),b=f(b,h,l,p,n[15],4264355552,10),p=f(p,b,h,l,n[6],2734768916,15),l=f(l,p,b,h,n[13],1309151649,21),h=f(h,l,p,b,n[4],4149444226,6),b=f(b,h,l,p,n[11],3174756917,10),p=f(p,b,h,l,n[2],718787259,15),l=f(l,p,b,h,n[9],3951481745,21),this._a=this._a+h|0,this._b=this._b+l|0,this._c=this._c+p|0,this._d=this._d+b|0},u.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 n=t.allocUnsafe(16);return n.writeInt32LE(this._a,0),n.writeInt32LE(this._b,4),n.writeInt32LE(this._c,8),n.writeInt32LE(this._d,12),n};function r(n,c){return n<<c|n>>>32-c}function s(n,c,h,l,p,b,y){return r(n+(c&h|~c&l)+p+b|0,y)+c|0}function a(n,c,h,l,p,b,y){return r(n+(c&l|h&~l)+p+b|0,y)+c|0}function o(n,c,h,l,p,b,y){return r(n+(c^h^l)+p+b|0,y)+c|0}function f(n,c,h,l,p,b,y){return r(n+(h^(c|~l))+p+b|0,y)+c|0}return zi=u,zi}var Vi,oo;function d0(){if(oo)return Vi;oo=1;var d={}.toString;return Vi=Array.isArray||function(e){return d.call(e)=="[object Array]"},Vi}var Gi,co;function cr(){return co||(co=1,Gi=TypeError),Gi}var $i,uo;function Wh(){return uo||(uo=1,$i=Object),$i}var Wi,ho;function l0(){return ho||(ho=1,Wi=Error),Wi}var Yi,lo;function p0(){return lo||(lo=1,Yi=EvalError),Yi}var Ji,po;function b0(){return po||(po=1,Ji=RangeError),Ji}var Xi,bo;function v0(){return bo||(bo=1,Xi=ReferenceError),Xi}var Qi,vo;function Yh(){return vo||(vo=1,Qi=SyntaxError),Qi}var Zi,mo;function m0(){return mo||(mo=1,Zi=URIError),Zi}var en,yo;function y0(){return yo||(yo=1,en=Math.abs),en}var tn,go;function g0(){return go||(go=1,tn=Math.floor),tn}var rn,wo;function w0(){return wo||(wo=1,rn=Math.max),rn}var nn,_o;function _0(){return _o||(_o=1,nn=Math.min),nn}var an,So;function S0(){return So||(So=1,an=Math.pow),an}var fn,xo;function x0(){return xo||(xo=1,fn=Math.round),fn}var sn,Eo;function E0(){return Eo||(Eo=1,sn=Number.isNaN||function(e){return e!==e}),sn}var on,Bo;function B0(){if(Bo)return on;Bo=1;var d=E0();return on=function(t){return d(t)||t===0?t:t<0?-1:1},on}var cn,Io;function I0(){return Io||(Io=1,cn=Object.getOwnPropertyDescriptor),cn}var un,Ro;function ur(){if(Ro)return un;Ro=1;var d=I0();if(d)try{d([],"length")}catch{d=null}return un=d,un}var hn,Ao;function Vr(){if(Ao)return hn;Ao=1;var d=Object.defineProperty||!1;if(d)try{d({},"a",{value:1})}catch{d=!1}return hn=d,hn}var dn,Oo;function Jh(){return Oo||(Oo=1,dn=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var u=42;e[t]=u;for(var r 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 s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==u||a.enumerable!==!0)return!1}return!0}),dn}var ln,Po;function R0(){if(Po)return ln;Po=1;var d=typeof Symbol<"u"&&Symbol,e=Jh();return ln=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ln}var pn,No;function Xh(){return No||(No=1,pn=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),pn}var bn,ko;function Qh(){if(ko)return bn;ko=1;var d=Wh();return bn=d.getPrototypeOf||null,bn}var vn,Mo;function A0(){if(Mo)return vn;Mo=1;var d="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,i="[object Function]",u=function(o,f){for(var n=[],c=0;c<o.length;c+=1)n[c]=o[c];for(var h=0;h<f.length;h+=1)n[h+o.length]=f[h];return n},r=function(o,f){for(var n=[],c=f,h=0;c<o.length;c+=1,h+=1)n[h]=o[c];return n},s=function(a,o){for(var f="",n=0;n<a.length;n+=1)f+=a[n],n+1<a.length&&(f+=o);return f};return vn=function(o){var f=this;if(typeof f!="function"||e.apply(f)!==i)throw new TypeError(d+f);for(var n=r(arguments,1),c,h=function(){if(this instanceof c){var v=f.apply(this,u(n,arguments));return Object(v)===v?v:this}return f.apply(o,u(n,arguments))},l=t(0,f.length-n.length),p=[],b=0;b<l;b++)p[b]="$"+b;if(c=Function("binder","return function ("+s(p,",")+"){ return binder.apply(this,arguments); }")(h),f.prototype){var y=function(){};y.prototype=f.prototype,c.prototype=new y,y.prototype=null}return c},vn}var mn,Co;function hr(){if(Co)return mn;Co=1;var d=A0();return mn=Function.prototype.bind||d,mn}var yn,To;function cs(){return To||(To=1,yn=Function.prototype.call),yn}var gn,Lo;function us(){return Lo||(Lo=1,gn=Function.prototype.apply),gn}var wn,Do;function O0(){return Do||(Do=1,wn=typeof Reflect<"u"&&Reflect&&Reflect.apply),wn}var _n,Fo;function Zh(){if(Fo)return _n;Fo=1;var d=hr(),e=us(),t=cs(),i=O0();return _n=i||d.call(t,e),_n}var Sn,Uo;function hs(){if(Uo)return Sn;Uo=1;var d=hr(),e=cr(),t=cs(),i=Zh();return Sn=function(r){if(r.length<1||typeof r[0]!="function")throw new e("a function is required");return i(d,t,r)},Sn}var xn,qo;function P0(){if(qo)return xn;qo=1;var d=hs(),e=ur(),t;try{t=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var i=!!t&&e&&e(Object.prototype,"__proto__"),u=Object,r=u.getPrototypeOf;return xn=i&&typeof i.get=="function"?d([i.get]):typeof r=="function"?function(a){return r(a==null?a:u(a))}:!1,xn}var En,Ho;function N0(){if(Ho)return En;Ho=1;var d=Xh(),e=Qh(),t=P0();return En=d?function(u){return d(u)}:e?function(u){if(!u||typeof u!="object"&&typeof u!="function")throw new TypeError("getProto: not an object");return e(u)}:t?function(u){return t(u)}:null,En}var Bn,Ko;function k0(){if(Ko)return Bn;Ko=1;var d=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=hr();return Bn=t.call(d,e),Bn}var In,jo;function ed(){if(jo)return In;jo=1;var d,e=Wh(),t=l0(),i=p0(),u=b0(),r=v0(),s=Yh(),a=cr(),o=m0(),f=y0(),n=g0(),c=w0(),h=_0(),l=S0(),p=x0(),b=B0(),y=Function,v=function(Y){try{return y('"use strict"; return ('+Y+").constructor;")()}catch{}},g=ur(),x=Vr(),B=function(){throw new a},R=g?(function(){try{return arguments.callee,B}catch{try{return g(arguments,"callee").get}catch{return B}}})():B,T=R0()(),j=N0(),G=Qh(),z=Xh(),te=us(),ne=cs(),$={},N=typeof Uint8Array>"u"||!j?d:j(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":T&&j?j([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":$,"%AsyncGenerator%":$,"%AsyncGeneratorFunction%":$,"%AsyncIteratorPrototype%":$,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?d:Float16Array,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":$,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&j?j(j([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!j?d:j(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":u,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!j?d:j(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&j?j(""[Symbol.iterator]()):d,"%Symbol%":T?Symbol:d,"%SyntaxError%":s,"%ThrowTypeError%":R,"%TypedArray%":N,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet,"%Function.prototype.call%":ne,"%Function.prototype.apply%":te,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":G,"%Math.abs%":f,"%Math.floor%":n,"%Math.max%":c,"%Math.min%":h,"%Math.pow%":l,"%Math.round%":p,"%Math.sign%":b,"%Reflect.getPrototypeOf%":z};if(j)try{null.error}catch(Y){var E=j(j(Y));m["%Error.prototype%"]=E}var O=function Y(Q){var D;if(Q==="%AsyncFunction%")D=v("async function () {}");else if(Q==="%GeneratorFunction%")D=v("function* () {}");else if(Q==="%AsyncGeneratorFunction%")D=v("async function* () {}");else if(Q==="%AsyncGenerator%"){var C=Y("%AsyncGeneratorFunction%");C&&(D=C.prototype)}else if(Q==="%AsyncIteratorPrototype%"){var J=Y("%AsyncGenerator%");J&&j&&(D=j(J.prototype))}return m[Q]=D,D},I={__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"]},A=hr(),F=k0(),K=A.call(ne,Array.prototype.concat),L=A.call(te,Array.prototype.splice),_=A.call(ne,String.prototype.replace),q=A.call(ne,String.prototype.slice),fe=A.call(ne,RegExp.prototype.exec),se=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V=/\\(\\)?/g,P=function(Q){var D=q(Q,0,1),C=q(Q,-1);if(D==="%"&&C!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(C==="%"&&D!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var J=[];return _(Q,se,function(ie,he,oe,ue){J[J.length]=oe?_(ue,V,"$1"):he||ie}),J},M=function(Q,D){var C=Q,J;if(F(I,C)&&(J=I[C],C="%"+J[0]+"%"),F(m,C)){var ie=m[C];if(ie===$&&(ie=O(C)),typeof ie>"u"&&!D)throw new a("intrinsic "+Q+" exists, but is not available. Please file an issue!");return{alias:J,name:C,value:ie}}throw new s("intrinsic "+Q+" does not exist!")};return In=function(Q,D){if(typeof Q!="string"||Q.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof D!="boolean")throw new a('"allowMissing" argument must be a boolean');if(fe(/^%?[^%]*%?$/,Q)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var C=P(Q),J=C.length>0?C[0]:"",ie=M("%"+J+"%",D),he=ie.name,oe=ie.value,ue=!1,ge=ie.alias;ge&&(J=ge[0],L(C,K([0,1],ge)));for(var Ke=1,Se=!0;Ke<C.length;Ke+=1){var de=C[Ke],Ie=q(de,0,1),ve=q(de,-1);if((Ie==='"'||Ie==="'"||Ie==="`"||ve==='"'||ve==="'"||ve==="`")&&Ie!==ve)throw new s("property names with quotes must have matching quotes");if((de==="constructor"||!Se)&&(ue=!0),J+="."+de,he="%"+J+"%",F(m,he))oe=m[he];else if(oe!=null){if(!(de in oe)){if(!D)throw new a("base intrinsic for "+Q+" exists, but the property is not available.");return}if(g&&Ke+1>=C.length){var me=g(oe,de);Se=!!me,Se&&"get"in me&&!("originalValue"in me.get)?oe=me.get:oe=oe[de]}else Se=F(oe,de),oe=oe[de];Se&&!ue&&(m[he]=oe)}}return oe},In}var Rn,zo;function td(){if(zo)return Rn;zo=1;var d=ed(),e=hs(),t=e([d("%String.prototype.indexOf%")]);return Rn=function(u,r){var s=d(u,!!r);return typeof s=="function"&&t(u,".prototype.")>-1?e([s]):s},Rn}var An,Vo;function M0(){if(Vo)return An;Vo=1;var d=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,i;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw i}}),i={},e(function(){throw 42},null,t)}catch(g){g!==i&&(e=null)}else e=null;var u=/^\s*class\b/,r=function(x){try{var B=d.call(x);return u.test(B)}catch{return!1}},s=function(x){try{return r(x)?!1:(d.call(x),!0)}catch{return!1}},a=Object.prototype.toString,o="[object Object]",f="[object Function]",n="[object GeneratorFunction]",c="[object HTMLAllCollection]",h="[object HTML document.all class]",l="[object HTMLCollection]",p=typeof Symbol=="function"&&!!Symbol.toStringTag,b=!(0 in[,]),y=function(){return!1};if(typeof document=="object"){var v=document.all;a.call(v)===a.call(document.all)&&(y=function(x){if((b||!x)&&(typeof x>"u"||typeof x=="object"))try{var B=a.call(x);return(B===c||B===h||B===l||B===o)&&x("")==null}catch{}return!1})}return An=e?function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;try{e(x,null,t)}catch(B){if(B!==i)return!1}return!r(x)&&s(x)}:function(x){if(y(x))return!0;if(!x||typeof x!="function"&&typeof x!="object")return!1;if(p)return s(x);if(r(x))return!1;var B=a.call(x);return B!==f&&B!==n&&!/^\[object HTML/.test(B)?!1:s(x)},An}var On,Go;function C0(){if(Go)return On;Go=1;var d=M0(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,i=function(o,f,n){for(var c=0,h=o.length;c<h;c++)t.call(o,c)&&(n==null?f(o[c],c,o):f.call(n,o[c],c,o))},u=function(o,f,n){for(var c=0,h=o.length;c<h;c++)n==null?f(o.charAt(c),c,o):f.call(n,o.charAt(c),c,o)},r=function(o,f,n){for(var c in o)t.call(o,c)&&(n==null?f(o[c],c,o):f.call(n,o[c],c,o))},s=function(o,f,n){if(!d(f))throw new TypeError("iterator must be a function");var c;arguments.length>=3&&(c=n),e.call(o)==="[object Array]"?i(o,f,c):typeof o=="string"?u(o,f,c):r(o,f,c)};return On=s,On}var Pn,$o;function T0(){return $o||($o=1,Pn=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Pn}var Nn,Wo;function L0(){if(Wo)return Nn;Wo=1;var d=T0(),e=typeof globalThis>"u"?Re:globalThis;return Nn=function(){for(var i=[],u=0;u<d.length;u++)typeof e[d[u]]=="function"&&(i[i.length]=d[u]);return i},Nn}var kn={exports:{}},Mn,Yo;function D0(){if(Yo)return Mn;Yo=1;var d=Vr(),e=Yh(),t=cr(),i=ur();return Mn=function(r,s,a){if(!r||typeof r!="object"&&typeof r!="function")throw new t("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="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 o=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!i&&i(r,s);if(d)d(r,s,{configurable:n===null&&h?h.configurable:!n,enumerable:o===null&&h?h.enumerable:!o,value:a,writable:f===null&&h?h.writable:!f});else if(c||!o&&!f&&!n)r[s]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Mn}var Cn,Jo;function F0(){if(Jo)return Cn;Jo=1;var d=Vr(),e=function(){return!!d};return e.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},Cn=e,Cn}var Tn,Xo;function U0(){if(Xo)return Tn;Xo=1;var d=ed(),e=D0(),t=F0()(),i=ur(),u=cr(),r=d("%Math.floor%");return Tn=function(a,o){if(typeof a!="function")throw new u("`fn` is not a function");if(typeof o!="number"||o<0||o>4294967295||r(o)!==o)throw new u("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in a&&i){var h=i(a,"length");h&&!h.configurable&&(n=!1),h&&!h.writable&&(c=!1)}return(n||c||!f)&&(t?e(a,"length",o,!0,!0):e(a,"length",o)),a},Tn}var Ln,Qo;function q0(){if(Qo)return Ln;Qo=1;var d=hr(),e=us(),t=Zh();return Ln=function(){return t(d,e,arguments)},Ln}var Zo;function H0(){return Zo||(Zo=1,(function(d){var e=U0(),t=Vr(),i=hs(),u=q0();d.exports=function(s){var a=i(arguments),o=s.length-(arguments.length-1);return e(a,1+(o>0?o:0),!0)},t?t(d.exports,"apply",{value:u}):d.exports.apply=u})(kn)),kn.exports}var Dn,ec;function K0(){if(ec)return Dn;ec=1;var d=Jh();return Dn=function(){return d()&&!!Symbol.toStringTag},Dn}var Fn,tc;function j0(){if(tc)return Fn;tc=1;var d=C0(),e=L0(),t=H0(),i=td(),u=ur(),r=i("Object.prototype.toString"),s=K0()(),a=typeof globalThis>"u"?Re:globalThis,o=e(),f=i("String.prototype.slice"),n=Object.getPrototypeOf,c=i("Array.prototype.indexOf",!0)||function(y,v){for(var g=0;g<y.length;g+=1)if(y[g]===v)return g;return-1},h={__proto__:null};s&&u&&n?d(o,function(b){var y=new a[b];if(Symbol.toStringTag in y){var v=n(y),g=u(v,Symbol.toStringTag);if(!g){var x=n(v);g=u(x,Symbol.toStringTag)}h["$"+b]=t(g.get)}}):d(o,function(b){var y=new a[b],v=y.slice||y.set;v&&(h["$"+b]=t(v))});var l=function(y){var v=!1;return d(h,function(g,x){if(!v)try{"$"+g(y)===x&&(v=f(x,1))}catch{}}),v},p=function(y){var v=!1;return d(h,function(g,x){if(!v)try{g(y),v=f(x,1)}catch{}}),v};return Fn=function(y){if(!y||typeof y!="object")return!1;if(!s){var v=f(r(y),8,-1);return c(o,v)>-1?v:v!=="Object"?!1:p(y)}return u?l(y):null},Fn}var Un,rc;function z0(){if(rc)return Un;rc=1;var d=j0();return Un=function(t){return!!d(t)},Un}var qn,ic;function V0(){if(ic)return qn;ic=1;var d=cr(),e=td(),t=e("TypedArray.prototype.buffer",!0),i=z0();return qn=t||function(r){if(!i(r))throw new d("Not a Typed Array");return r.buffer},qn}var Hn,nc;function Gr(){if(nc)return Hn;nc=1;var d=_e().Buffer,e=d0(),t=V0(),i=ArrayBuffer.isView||function(o){try{return t(o),!0}catch{return!1}},u=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s=r&&(d.prototype instanceof Uint8Array||d.TYPED_ARRAY_SUPPORT);return Hn=function(o,f){if(d.isBuffer(o))return o.constructor&&!("isBuffer"in o)?d.from(o):o;if(typeof o=="string")return d.from(o,f);if(r&&i(o)){if(o.byteLength===0)return d.alloc(0);if(s){var n=d.from(o.buffer,o.byteOffset,o.byteLength);if(n.byteLength===o.byteLength)return n}var c=o instanceof Uint8Array?o:new Uint8Array(o.buffer,o.byteOffset,o.byteLength),h=d.from(c);if(h.length===o.byteLength)return h}if(u&&o instanceof Uint8Array)return d.from(o);var l=e(o);if(l)for(var p=0;p<o.length;p+=1){var b=o[p];if(typeof b!="number"||b<0||b>255||~~b!==b)throw new RangeError("Array items must be numbers in the range 0-255.")}if(l||d.isBuffer(o)&&o.constructor&&typeof o.constructor.isBuffer=="function"&&o.constructor.isBuffer(o))return d.from(o);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Hn}var Kn,ac;function G0(){if(ac)return Kn;ac=1;var d=_e().Buffer,e=Gr(),t=typeof Uint8Array<"u",i=t&&typeof ArrayBuffer<"u",u=i&&ArrayBuffer.isView;return Kn=function(r,s){if(typeof r=="string"||d.isBuffer(r)||t&&r instanceof Uint8Array||u&&u(r))return e(r,s);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},Kn}var Rr={exports:{}},Ar={exports:{}},fc;function $r(){if(fc)return Ar.exports;fc=1,typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Ar.exports={nextTick:d}:Ar.exports=process;function d(e,t,i,u){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,s,a;switch(r){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,i)});case 4:return process.nextTick(function(){e.call(null,t,i,u)});default:for(s=new Array(r-1),a=0;a<s.length;)s[a++]=arguments[a];return process.nextTick(function(){e.apply(null,s)})}}return Ar.exports}var jn,sc;function $0(){if(sc)return jn;sc=1;var d={}.toString;return jn=Array.isArray||function(e){return d.call(e)=="[object Array]"},jn}var zn,oc;function rd(){return oc||(oc=1,zn=or().EventEmitter),zn}var Or={exports:{}},cc;function Wr(){return cc||(cc=1,(function(d,e){var t=xt(),i=t.Buffer;function u(s,a){for(var o in s)a[o]=s[o]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?d.exports=t:(u(t,e),e.Buffer=r);function r(s,a,o){return i(s,a,o)}u(i,r),r.from=function(s,a,o){if(typeof s=="number")throw new TypeError("Argument must not be a number");return i(s,a,o)},r.alloc=function(s,a,o){if(typeof s!="number")throw new TypeError("Argument must be a number");var f=i(s);return a!==void 0?typeof o=="string"?f.fill(a,o):f.fill(a):f.fill(0),f},r.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return i(s)},r.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(s)}})(Or,Or.exports)),Or.exports}var ot={},uc;function dr(){if(uc)return ot;uc=1;function d(b){return Array.isArray?Array.isArray(b):p(b)==="[object Array]"}ot.isArray=d;function e(b){return typeof b=="boolean"}ot.isBoolean=e;function t(b){return b===null}ot.isNull=t;function i(b){return b==null}ot.isNullOrUndefined=i;function u(b){return typeof b=="number"}ot.isNumber=u;function r(b){return typeof b=="string"}ot.isString=r;function s(b){return typeof b=="symbol"}ot.isSymbol=s;function a(b){return b===void 0}ot.isUndefined=a;function o(b){return p(b)==="[object RegExp]"}ot.isRegExp=o;function f(b){return typeof b=="object"&&b!==null}ot.isObject=f;function n(b){return p(b)==="[object Date]"}ot.isDate=n;function c(b){return p(b)==="[object Error]"||b instanceof Error}ot.isError=c;function h(b){return typeof b=="function"}ot.isFunction=h;function l(b){return b===null||typeof b=="boolean"||typeof b=="number"||typeof b=="string"||typeof b=="symbol"||typeof b>"u"}ot.isPrimitive=l,ot.isBuffer=xt().Buffer.isBuffer;function p(b){return Object.prototype.toString.call(b)}return ot}var Vn={exports:{}},hc;function W0(){return hc||(hc=1,(function(d){function e(r,s){if(!(r instanceof s))throw new TypeError("Cannot call a class as a function")}var t=Wr().Buffer,i=Wt;function u(r,s,a){r.copy(s,a)}d.exports=(function(){function r(){e(this,r),this.head=null,this.tail=null,this.length=0}return r.prototype.push=function(a){var o={data:a,next:null};this.length>0?this.tail.next=o:this.head=o,this.tail=o,++this.length},r.prototype.unshift=function(a){var o={data:a,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length},r.prototype.shift=function(){if(this.length!==0){var a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(a){if(this.length===0)return"";for(var o=this.head,f=""+o.data;o=o.next;)f+=a+o.data;return f},r.prototype.concat=function(a){if(this.length===0)return t.alloc(0);for(var o=t.allocUnsafe(a>>>0),f=this.head,n=0;f;)u(f.data,o,n),n+=f.data.length,f=f.next;return o},r})(),i&&i.inspect&&i.inspect.custom&&(d.exports.prototype[i.inspect.custom]=function(){var r=i.inspect({length:this.length});return this.constructor.name+" "+r})})(Vn)),Vn.exports}var Gn,dc;function id(){if(dc)return Gn;dc=1;var d=$r();function e(u,r){var s=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(r?r(u):u&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,d.nextTick(i,this,u)):d.nextTick(i,this,u)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(f){!r&&f?s._writableState?s._writableState.errorEmitted||(s._writableState.errorEmitted=!0,d.nextTick(i,s,f)):d.nextTick(i,s,f):r&&r(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 i(u,r){u.emit("error",r)}return Gn={destroy:e,undestroy:t},Gn}var $n,lc;function nd(){if(lc)return $n;lc=1;var d=$r();$n=b;function e(I){var A=this;this.next=null,this.entry=null,this.finish=function(){O(A,I)}}var t=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:d.nextTick,i;b.WritableState=l;var u=Object.create(dr());u.inherits=be();var r={deprecate:jh()},s=rd(),a=Wr().Buffer,o=(typeof Re<"u"?Re:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(I){return a.from(I)}function n(I){return a.isBuffer(I)||I instanceof o}var c=id();u.inherits(b,s);function h(){}function l(I,A){i=i||Vt(),I=I||{};var F=A instanceof i;this.objectMode=!!I.objectMode,F&&(this.objectMode=this.objectMode||!!I.writableObjectMode);var K=I.highWaterMark,L=I.writableHighWaterMark,_=this.objectMode?16:16*1024;K||K===0?this.highWaterMark=K:F&&(L||L===0)?this.highWaterMark=L:this.highWaterMark=_,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=I.decodeStrings===!1;this.decodeStrings=!q,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(fe){j(A,fe)},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)}l.prototype.getBuffer=function(){for(var A=this.bufferedRequest,F=[];A;)F.push(A),A=A.next;return F},(function(){try{Object.defineProperty(l.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var p;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(I){return p.call(this,I)?!0:this!==b?!1:I&&I._writableState instanceof l}})):p=function(I){return I instanceof this};function b(I){if(i=i||Vt(),!p.call(b,this)&&!(this instanceof i))return new b(I);this._writableState=new l(I,this),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),s.call(this)}b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function y(I,A){var F=new Error("write after end");I.emit("error",F),d.nextTick(A,F)}function v(I,A,F,K){var L=!0,_=!1;return F===null?_=new TypeError("May not write null values to stream"):typeof F!="string"&&F!==void 0&&!A.objectMode&&(_=new TypeError("Invalid non-string/buffer chunk")),_&&(I.emit("error",_),d.nextTick(K,_),L=!1),L}b.prototype.write=function(I,A,F){var K=this._writableState,L=!1,_=!K.objectMode&&n(I);return _&&!a.isBuffer(I)&&(I=f(I)),typeof A=="function"&&(F=A,A=null),_?A="buffer":A||(A=K.defaultEncoding),typeof F!="function"&&(F=h),K.ended?y(this,F):(_||v(this,K,I,F))&&(K.pendingcb++,L=x(this,K,_,I,A,F)),L},b.prototype.cork=function(){var I=this._writableState;I.corked++},b.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&te(this,I))},b.prototype.setDefaultEncoding=function(A){if(typeof A=="string"&&(A=A.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((A+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+A);return this._writableState.defaultEncoding=A,this};function g(I,A,F){return!I.objectMode&&I.decodeStrings!==!1&&typeof A=="string"&&(A=a.from(A,F)),A}Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function x(I,A,F,K,L,_){if(!F){var q=g(A,K,L);K!==q&&(F=!0,L="buffer",K=q)}var fe=A.objectMode?1:K.length;A.length+=fe;var se=A.length<A.highWaterMark;if(se||(A.needDrain=!0),A.writing||A.corked){var V=A.lastBufferedRequest;A.lastBufferedRequest={chunk:K,encoding:L,isBuf:F,callback:_,next:null},V?V.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else B(I,A,!1,fe,K,L,_);return se}function B(I,A,F,K,L,_,q){A.writelen=K,A.writecb=q,A.writing=!0,A.sync=!0,F?I._writev(L,A.onwrite):I._write(L,_,A.onwrite),A.sync=!1}function R(I,A,F,K,L){--A.pendingcb,F?(d.nextTick(L,K),d.nextTick(m,I,A),I._writableState.errorEmitted=!0,I.emit("error",K)):(L(K),I._writableState.errorEmitted=!0,I.emit("error",K),m(I,A))}function T(I){I.writing=!1,I.writecb=null,I.length-=I.writelen,I.writelen=0}function j(I,A){var F=I._writableState,K=F.sync,L=F.writecb;if(T(F),A)R(I,F,K,A,L);else{var _=ne(F);!_&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&te(I,F),K?t(G,I,F,_,L):G(I,F,_,L)}}function G(I,A,F,K){F||z(I,A),A.pendingcb--,K(),m(I,A)}function z(I,A){A.length===0&&A.needDrain&&(A.needDrain=!1,I.emit("drain"))}function te(I,A){A.bufferProcessing=!0;var F=A.bufferedRequest;if(I._writev&&F&&F.next){var K=A.bufferedRequestCount,L=new Array(K),_=A.corkedRequestsFree;_.entry=F;for(var q=0,fe=!0;F;)L[q]=F,F.isBuf||(fe=!1),F=F.next,q+=1;L.allBuffers=fe,B(I,A,!0,A.length,L,"",_.finish),A.pendingcb++,A.lastBufferedRequest=null,_.next?(A.corkedRequestsFree=_.next,_.next=null):A.corkedRequestsFree=new e(A),A.bufferedRequestCount=0}else{for(;F;){var se=F.chunk,V=F.encoding,P=F.callback,M=A.objectMode?1:se.length;if(B(I,A,!1,M,se,V,P),F=F.next,A.bufferedRequestCount--,A.writing)break}F===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=F,A.bufferProcessing=!1}b.prototype._write=function(I,A,F){F(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(I,A,F){var K=this._writableState;typeof I=="function"?(F=I,I=null,A=null):typeof A=="function"&&(F=A,A=null),I!=null&&this.write(I,A),K.corked&&(K.corked=1,this.uncork()),K.ending||E(this,K,F)};function ne(I){return I.ending&&I.length===0&&I.bufferedRequest===null&&!I.finished&&!I.writing}function $(I,A){I._final(function(F){A.pendingcb--,F&&I.emit("error",F),A.prefinished=!0,I.emit("prefinish"),m(I,A)})}function N(I,A){!A.prefinished&&!A.finalCalled&&(typeof I._final=="function"?(A.pendingcb++,A.finalCalled=!0,d.nextTick($,I,A)):(A.prefinished=!0,I.emit("prefinish")))}function m(I,A){var F=ne(A);return F&&(N(I,A),A.pendingcb===0&&(A.finished=!0,I.emit("finish"))),F}function E(I,A,F){A.ending=!0,m(I,A),F&&(A.finished?d.nextTick(F):I.once("finish",F)),A.ended=!0,I.writable=!1}function O(I,A,F){var K=I.entry;for(I.entry=null;K;){var L=K.callback;A.pendingcb--,L(F),K=K.next}A.corkedRequestsFree.next=I}return Object.defineProperty(b.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(I){this._writableState&&(this._writableState.destroyed=I)}}),b.prototype.destroy=c.destroy,b.prototype._undestroy=c.undestroy,b.prototype._destroy=function(I,A){this.end(),A(I)},$n}var Wn,pc;function Vt(){if(pc)return Wn;pc=1;var d=$r(),e=Object.keys||function(c){var h=[];for(var l in c)h.push(l);return h};Wn=o;var t=Object.create(dr());t.inherits=be();var i=ad(),u=nd();t.inherits(o,i);for(var r=e(u.prototype),s=0;s<r.length;s++){var a=r[s];o.prototype[a]||(o.prototype[a]=u.prototype[a])}function o(c){if(!(this instanceof o))return new o(c);i.call(this,c),u.call(this,c),c&&c.readable===!1&&(this.readable=!1),c&&c.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,c&&c.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",f)}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function f(){this.allowHalfOpen||this._writableState.ended||d.nextTick(n,this)}function n(c){c.end()}return Object.defineProperty(o.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(c){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=c,this._writableState.destroyed=c)}}),o.prototype._destroy=function(c,h){this.push(null),this.end(),d.nextTick(h,c)},Wn}var Yn={},bc;function vc(){if(bc)return Yn;bc=1;var d=Wr().Buffer,e=d.isEncoding||function(v){switch(v=""+v,v&&v.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(v){if(!v)return"utf8";for(var g;;)switch(v){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 v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function i(v){var g=t(v);if(typeof g!="string"&&(d.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return g||v}Yn.StringDecoder=u;function u(v){this.encoding=i(v);var g;switch(this.encoding){case"utf16le":this.text=c,this.end=h,g=4;break;case"utf8":this.fillLast=o,g=4;break;case"base64":this.text=l,this.end=p,g=3;break;default:this.write=b,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=d.allocUnsafe(g)}u.prototype.write=function(v){if(v.length===0)return"";var g,x;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<v.length?g?g+this.text(v,x):this.text(v,x):g||""},u.prototype.end=n,u.prototype.text=f,u.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function r(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,g,x){var B=g.length-1;if(B<x)return 0;var R=r(g[B]);return R>=0?(R>0&&(v.lastNeed=R-1),R):--B<x||R===-2?0:(R=r(g[B]),R>=0?(R>0&&(v.lastNeed=R-2),R):--B<x||R===-2?0:(R=r(g[B]),R>=0?(R>0&&(R===2?R=0:v.lastNeed=R-3),R):0))}function a(v,g,x){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2&&(g[2]&192)!==128)return v.lastNeed=2,"�"}}function o(v){var g=this.lastTotal-this.lastNeed,x=a(this,v);if(x!==void 0)return x;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function f(v,g){var x=s(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=x;var B=v.length-(x-this.lastNeed);return v.copy(this.lastChar,0,B),v.toString("utf8",g,B)}function n(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+"�":g}function c(v,g){if((v.length-g)%2===0){var x=v.toString("utf16le",g);if(x){var B=x.charCodeAt(x.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function h(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,x)}return g}function l(v,g){var x=(v.length-g)%3;return x===0?v.toString("base64",g):(this.lastNeed=3-x,this.lastTotal=3,x===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",g,v.length-x))}function p(v){var g=v&&v.length?this.write(v):"";return this.lastNeed?g+this.lastChar.toString("base64",0,3-this.lastNeed):g}function b(v){return v.toString(this.encoding)}function y(v){return v&&v.length?this.write(v):""}return Yn}var Jn,mc;function ad(){if(mc)return Jn;mc=1;var d=$r();Jn=g;var e=$0(),t;g.ReadableState=v,or().EventEmitter;var i=function(P,M){return P.listeners(M).length},u=rd(),r=Wr().Buffer,s=(typeof Re<"u"?Re:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(P){return r.from(P)}function o(P){return r.isBuffer(P)||P instanceof s}var f=Object.create(dr());f.inherits=be();var n=Wt,c=void 0;n&&n.debuglog?c=n.debuglog("stream"):c=function(){};var h=W0(),l=id(),p;f.inherits(g,u);var b=["error","close","destroy","pause","resume"];function y(P,M,Y){if(typeof P.prependListener=="function")return P.prependListener(M,Y);!P._events||!P._events[M]?P.on(M,Y):e(P._events[M])?P._events[M].unshift(Y):P._events[M]=[Y,P._events[M]]}function v(P,M){t=t||Vt(),P=P||{};var Y=M instanceof t;this.objectMode=!!P.objectMode,Y&&(this.objectMode=this.objectMode||!!P.readableObjectMode);var Q=P.highWaterMark,D=P.readableHighWaterMark,C=this.objectMode?16:16*1024;Q||Q===0?this.highWaterMark=Q:Y&&(D||D===0)?this.highWaterMark=D:this.highWaterMark=C,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,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=P.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,P.encoding&&(p||(p=vc().StringDecoder),this.decoder=new p(P.encoding),this.encoding=P.encoding)}function g(P){if(t=t||Vt(),!(this instanceof g))return new g(P);this._readableState=new v(P,this),this.readable=!0,P&&(typeof P.read=="function"&&(this._read=P.read),typeof P.destroy=="function"&&(this._destroy=P.destroy)),u.call(this)}Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(P){this._readableState&&(this._readableState.destroyed=P)}}),g.prototype.destroy=l.destroy,g.prototype._undestroy=l.undestroy,g.prototype._destroy=function(P,M){this.push(null),M(P)},g.prototype.push=function(P,M){var Y=this._readableState,Q;return Y.objectMode?Q=!0:typeof P=="string"&&(M=M||Y.defaultEncoding,M!==Y.encoding&&(P=r.from(P,M),M=""),Q=!0),x(this,P,M,!1,Q)},g.prototype.unshift=function(P){return x(this,P,null,!0,!1)};function x(P,M,Y,Q,D){var C=P._readableState;if(M===null)C.reading=!1,te(P,C);else{var J;D||(J=R(C,M)),J?P.emit("error",J):C.objectMode||M&&M.length>0?(typeof M!="string"&&!C.objectMode&&Object.getPrototypeOf(M)!==r.prototype&&(M=a(M)),Q?C.endEmitted?P.emit("error",new Error("stream.unshift() after end event")):B(P,C,M,!0):C.ended?P.emit("error",new Error("stream.push() after EOF")):(C.reading=!1,C.decoder&&!Y?(M=C.decoder.write(M),C.objectMode||M.length!==0?B(P,C,M,!1):N(P,C)):B(P,C,M,!1))):Q||(C.reading=!1)}return T(C)}function B(P,M,Y,Q){M.flowing&&M.length===0&&!M.sync?(P.emit("data",Y),P.read(0)):(M.length+=M.objectMode?1:Y.length,Q?M.buffer.unshift(Y):M.buffer.push(Y),M.needReadable&&ne(P)),N(P,M)}function R(P,M){var Y;return!o(M)&&typeof M!="string"&&M!==void 0&&!P.objectMode&&(Y=new TypeError("Invalid non-string/buffer chunk")),Y}function T(P){return!P.ended&&(P.needReadable||P.length<P.highWaterMark||P.length===0)}g.prototype.isPaused=function(){return this._readableState.flowing===!1},g.prototype.setEncoding=function(P){return p||(p=vc().StringDecoder),this._readableState.decoder=new p(P),this._readableState.encoding=P,this};var j=8388608;function G(P){return P>=j?P=j:(P--,P|=P>>>1,P|=P>>>2,P|=P>>>4,P|=P>>>8,P|=P>>>16,P++),P}function z(P,M){return P<=0||M.length===0&&M.ended?0:M.objectMode?1:P!==P?M.flowing&&M.length?M.buffer.head.data.length:M.length:(P>M.highWaterMark&&(M.highWaterMark=G(P)),P<=M.length?P:M.ended?M.length:(M.needReadable=!0,0))}g.prototype.read=function(P){c("read",P),P=parseInt(P,10);var M=this._readableState,Y=P;if(P!==0&&(M.emittedReadable=!1),P===0&&M.needReadable&&(M.length>=M.highWaterMark||M.ended))return c("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?fe(this):ne(this),null;if(P=z(P,M),P===0&&M.ended)return M.length===0&&fe(this),null;var Q=M.needReadable;c("need readable",Q),(M.length===0||M.length-P<M.highWaterMark)&&(Q=!0,c("length less than watermark",Q)),M.ended||M.reading?(Q=!1,c("reading or ended",Q)):Q&&(c("do read"),M.reading=!0,M.sync=!0,M.length===0&&(M.needReadable=!0),this._read(M.highWaterMark),M.sync=!1,M.reading||(P=z(Y,M)));var D;return P>0?D=K(P,M):D=null,D===null?(M.needReadable=!0,P=0):M.length-=P,M.length===0&&(M.ended||(M.needReadable=!0),Y!==P&&M.ended&&fe(this)),D!==null&&this.emit("data",D),D};function te(P,M){if(!M.ended){if(M.decoder){var Y=M.decoder.end();Y&&Y.length&&(M.buffer.push(Y),M.length+=M.objectMode?1:Y.length)}M.ended=!0,ne(P)}}function ne(P){var M=P._readableState;M.needReadable=!1,M.emittedReadable||(c("emitReadable",M.flowing),M.emittedReadable=!0,M.sync?d.nextTick($,P):$(P))}function $(P){c("emit readable"),P.emit("readable"),F(P)}function N(P,M){M.readingMore||(M.readingMore=!0,d.nextTick(m,P,M))}function m(P,M){for(var Y=M.length;!M.reading&&!M.flowing&&!M.ended&&M.length<M.highWaterMark&&(c("maybeReadMore read 0"),P.read(0),Y!==M.length);)Y=M.length;M.readingMore=!1}g.prototype._read=function(P){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(P,M){var Y=this,Q=this._readableState;switch(Q.pipesCount){case 0:Q.pipes=P;break;case 1:Q.pipes=[Q.pipes,P];break;default:Q.pipes.push(P);break}Q.pipesCount+=1,c("pipe count=%d opts=%j",Q.pipesCount,M);var D=(!M||M.end!==!1)&&P!==process.stdout&&P!==process.stderr,C=D?ie:ve;Q.endEmitted?d.nextTick(C):Y.once("end",C),P.on("unpipe",J);function J(me,Le){c("onunpipe"),me===Y&&Le&&Le.hasUnpiped===!1&&(Le.hasUnpiped=!0,ue())}function ie(){c("onend"),P.end()}var he=E(Y);P.on("drain",he);var oe=!1;function ue(){c("cleanup"),P.removeListener("close",de),P.removeListener("finish",Ie),P.removeListener("drain",he),P.removeListener("error",Se),P.removeListener("unpipe",J),Y.removeListener("end",ie),Y.removeListener("end",ve),Y.removeListener("data",Ke),oe=!0,Q.awaitDrain&&(!P._writableState||P._writableState.needDrain)&&he()}var ge=!1;Y.on("data",Ke);function Ke(me){c("ondata"),ge=!1;var Le=P.write(me);Le===!1&&!ge&&((Q.pipesCount===1&&Q.pipes===P||Q.pipesCount>1&&V(Q.pipes,P)!==-1)&&!oe&&(c("false write response, pause",Q.awaitDrain),Q.awaitDrain++,ge=!0),Y.pause())}function Se(me){c("onerror",me),ve(),P.removeListener("error",Se),i(P,"error")===0&&P.emit("error",me)}y(P,"error",Se);function de(){P.removeListener("finish",Ie),ve()}P.once("close",de);function Ie(){c("onfinish"),P.removeListener("close",de),ve()}P.once("finish",Ie);function ve(){c("unpipe"),Y.unpipe(P)}return P.emit("pipe",Y),Q.flowing||(c("pipe resume"),Y.resume()),P};function E(P){return function(){var M=P._readableState;c("pipeOnDrain",M.awaitDrain),M.awaitDrain&&M.awaitDrain--,M.awaitDrain===0&&i(P,"data")&&(M.flowing=!0,F(P))}}g.prototype.unpipe=function(P){var M=this._readableState,Y={hasUnpiped:!1};if(M.pipesCount===0)return this;if(M.pipesCount===1)return P&&P!==M.pipes?this:(P||(P=M.pipes),M.pipes=null,M.pipesCount=0,M.flowing=!1,P&&P.emit("unpipe",this,Y),this);if(!P){var Q=M.pipes,D=M.pipesCount;M.pipes=null,M.pipesCount=0,M.flowing=!1;for(var C=0;C<D;C++)Q[C].emit("unpipe",this,{hasUnpiped:!1});return this}var J=V(M.pipes,P);return J===-1?this:(M.pipes.splice(J,1),M.pipesCount-=1,M.pipesCount===1&&(M.pipes=M.pipes[0]),P.emit("unpipe",this,Y),this)},g.prototype.on=function(P,M){var Y=u.prototype.on.call(this,P,M);if(P==="data")this._readableState.flowing!==!1&&this.resume();else if(P==="readable"){var Q=this._readableState;!Q.endEmitted&&!Q.readableListening&&(Q.readableListening=Q.needReadable=!0,Q.emittedReadable=!1,Q.reading?Q.length&&ne(this):d.nextTick(O,this))}return Y},g.prototype.addListener=g.prototype.on;function O(P){c("readable nexttick read 0"),P.read(0)}g.prototype.resume=function(){var P=this._readableState;return P.flowing||(c("resume"),P.flowing=!0,I(this,P)),this};function I(P,M){M.resumeScheduled||(M.resumeScheduled=!0,d.nextTick(A,P,M))}function A(P,M){M.reading||(c("resume read 0"),P.read(0)),M.resumeScheduled=!1,M.awaitDrain=0,P.emit("resume"),F(P),M.flowing&&!M.reading&&P.read(0)}g.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function F(P){var M=P._readableState;for(c("flow",M.flowing);M.flowing&&P.read()!==null;);}g.prototype.wrap=function(P){var M=this,Y=this._readableState,Q=!1;P.on("end",function(){if(c("wrapped end"),Y.decoder&&!Y.ended){var J=Y.decoder.end();J&&J.length&&M.push(J)}M.push(null)}),P.on("data",function(J){if(c("wrapped data"),Y.decoder&&(J=Y.decoder.write(J)),!(Y.objectMode&&J==null)&&!(!Y.objectMode&&(!J||!J.length))){var ie=M.push(J);ie||(Q=!0,P.pause())}});for(var D in P)this[D]===void 0&&typeof P[D]=="function"&&(this[D]=(function(J){return function(){return P[J].apply(P,arguments)}})(D));for(var C=0;C<b.length;C++)P.on(b[C],this.emit.bind(this,b[C]));return this._read=function(J){c("wrapped _read",J),Q&&(Q=!1,P.resume())},this},Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),g._fromList=K;function K(P,M){if(M.length===0)return null;var Y;return M.objectMode?Y=M.buffer.shift():!P||P>=M.length?(M.decoder?Y=M.buffer.join(""):M.buffer.length===1?Y=M.buffer.head.data:Y=M.buffer.concat(M.length),M.buffer.clear()):Y=L(P,M.buffer,M.decoder),Y}function L(P,M,Y){var Q;return P<M.head.data.length?(Q=M.head.data.slice(0,P),M.head.data=M.head.data.slice(P)):P===M.head.data.length?Q=M.shift():Q=Y?_(P,M):q(P,M),Q}function _(P,M){var Y=M.head,Q=1,D=Y.data;for(P-=D.length;Y=Y.next;){var C=Y.data,J=P>C.length?C.length:P;if(J===C.length?D+=C:D+=C.slice(0,P),P-=J,P===0){J===C.length?(++Q,Y.next?M.head=Y.next:M.head=M.tail=null):(M.head=Y,Y.data=C.slice(J));break}++Q}return M.length-=Q,D}function q(P,M){var Y=r.allocUnsafe(P),Q=M.head,D=1;for(Q.data.copy(Y),P-=Q.data.length;Q=Q.next;){var C=Q.data,J=P>C.length?C.length:P;if(C.copy(Y,Y.length-P,0,J),P-=J,P===0){J===C.length?(++D,Q.next?M.head=Q.next:M.head=M.tail=null):(M.head=Q,Q.data=C.slice(J));break}++D}return M.length-=D,Y}function fe(P){var M=P._readableState;if(M.length>0)throw new Error('"endReadable()" called on non-empty stream');M.endEmitted||(M.ended=!0,d.nextTick(se,M,P))}function se(P,M){!P.endEmitted&&P.length===0&&(P.endEmitted=!0,M.readable=!1,M.emit("end"))}function V(P,M){for(var Y=0,Q=P.length;Y<Q;Y++)if(P[Y]===M)return Y;return-1}return Jn}var Xn,yc;function fd(){if(yc)return Xn;yc=1,Xn=i;var d=Vt(),e=Object.create(dr());e.inherits=be(),e.inherits(i,d);function t(s,a){var o=this._transformState;o.transforming=!1;var f=o.writecb;if(!f)return this.emit("error",new Error("write callback called multiple times"));o.writechunk=null,o.writecb=null,a!=null&&this.push(a),f(s);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function i(s){if(!(this instanceof i))return new i(s);d.call(this,s),this._transformState={afterTransform:t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,s&&(typeof s.transform=="function"&&(this._transform=s.transform),typeof s.flush=="function"&&(this._flush=s.flush)),this.on("prefinish",u)}function u(){var s=this;typeof this._flush=="function"?this._flush(function(a,o){r(s,a,o)}):r(this,null,null)}i.prototype.push=function(s,a){return this._transformState.needTransform=!1,d.prototype.push.call(this,s,a)},i.prototype._transform=function(s,a,o){throw new Error("_transform() is not implemented")},i.prototype._write=function(s,a,o){var f=this._transformState;if(f.writecb=o,f.writechunk=s,f.writeencoding=a,!f.transforming){var n=this._readableState;(f.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},i.prototype._read=function(s){var a=this._transformState;a.writechunk!==null&&a.writecb&&!a.transforming?(a.transforming=!0,this._transform(a.writechunk,a.writeencoding,a.afterTransform)):a.needTransform=!0},i.prototype._destroy=function(s,a){var o=this;d.prototype._destroy.call(this,s,function(f){a(f),o.emit("close")})};function r(s,a,o){if(a)return s.emit("error",a);if(o!=null&&s.push(o),s._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(s._transformState.transforming)throw new Error("Calling transform done when still transforming");return s.push(null)}return Xn}var Qn,gc;function Y0(){if(gc)return Qn;gc=1,Qn=t;var d=fd(),e=Object.create(dr());e.inherits=be(),e.inherits(t,d);function t(i){if(!(this instanceof t))return new t(i);d.call(this,i)}return t.prototype._transform=function(i,u,r){r(null,i)},Qn}var wc;function sd(){return wc||(wc=1,(function(d,e){e=d.exports=ad(),e.Stream=e,e.Readable=e,e.Writable=nd(),e.Duplex=Vt(),e.Transform=fd(),e.PassThrough=Y0()})(Rr,Rr.exports)),Rr.exports}var Zn,_c;function J0(){if(_c)return Zn;_c=1;var d=_e().Buffer,e=G0(),t=sd().Transform,i=be();function u(r){t.call(this),this._block=d.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return i(u,t),u.prototype._transform=function(r,s,a){var o=null;try{this.update(r,s)}catch(f){o=f}a(o)},u.prototype._flush=function(r){var s=null;try{this.push(this.digest())}catch(a){s=a}r(s)},u.prototype.update=function(r,s){if(this._finalized)throw new Error("Digest already called");for(var a=e(r,s),o=this._block,f=0;this._blockOffset+a.length-f>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)o[n]=a[f],n+=1,f+=1;this._update(),this._blockOffset=0}for(;f<a.length;)o[this._blockOffset]=a[f],this._blockOffset+=1,f+=1;for(var c=0,h=a.length*8;h>0;++c)this._length[c]+=h,h=this._length[c]/4294967296|0,h>0&&(this._length[c]-=4294967296*h);return this},u.prototype._update=function(){throw new Error("_update is not implemented")},u.prototype.digest=function(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var s=this._digest();r!==void 0&&(s=s.toString(r)),this._block.fill(0),this._blockOffset=0;for(var a=0;a<4;++a)this._length[a]=0;return s},u.prototype._digest=function(){throw new Error("_digest is not implemented")},Zn=u,Zn}var ea,Sc;function ds(){if(Sc)return ea;Sc=1;var d=xt().Buffer,e=be(),t=J0(),i=new Array(16),u=[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],r=[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],s=[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],a=[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],o=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function n(v,g){return v<<g|v>>>32-g}function c(v,g,x,B,R,T,j,G){return n(v+(g^x^B)+T+j|0,G)+R|0}function h(v,g,x,B,R,T,j,G){return n(v+(g&x|~g&B)+T+j|0,G)+R|0}function l(v,g,x,B,R,T,j,G){return n(v+((g|~x)^B)+T+j|0,G)+R|0}function p(v,g,x,B,R,T,j,G){return n(v+(g&B|x&~B)+T+j|0,G)+R|0}function b(v,g,x,B,R,T,j,G){return n(v+(g^(x|~B))+T+j|0,G)+R|0}function y(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return e(y,t),y.prototype._update=function(){for(var v=i,g=0;g<16;++g)v[g]=this._block.readInt32LE(g*4);for(var x=this._a|0,B=this._b|0,R=this._c|0,T=this._d|0,j=this._e|0,G=this._a|0,z=this._b|0,te=this._c|0,ne=this._d|0,$=this._e|0,N=0;N<80;N+=1){var m,E;N<16?(m=c(x,B,R,T,j,v[u[N]],o[0],s[N]),E=b(G,z,te,ne,$,v[r[N]],f[0],a[N])):N<32?(m=h(x,B,R,T,j,v[u[N]],o[1],s[N]),E=p(G,z,te,ne,$,v[r[N]],f[1],a[N])):N<48?(m=l(x,B,R,T,j,v[u[N]],o[2],s[N]),E=l(G,z,te,ne,$,v[r[N]],f[2],a[N])):N<64?(m=p(x,B,R,T,j,v[u[N]],o[3],s[N]),E=h(G,z,te,ne,$,v[r[N]],f[3],a[N])):(m=b(x,B,R,T,j,v[u[N]],o[4],s[N]),E=c(G,z,te,ne,$,v[r[N]],f[4],a[N])),x=j,j=T,T=n(R,10),R=B,B=m,G=$,$=ne,ne=n(te,10),te=z,z=E}var O=this._b+R+ne|0;this._b=this._c+T+$|0,this._c=this._d+j+G|0,this._d=this._e+x+z|0,this._e=this._a+B+te|0,this._a=O},y.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 v=d.alloc?d.alloc(20):new d(20);return v.writeInt32LE(this._a,0),v.writeInt32LE(this._b,4),v.writeInt32LE(this._c,8),v.writeInt32LE(this._d,12),v.writeInt32LE(this._e,16),v},ea=y,ea}var ta={exports:{}},ra,xc;function Jt(){if(xc)return ra;xc=1;var d=_e().Buffer,e=Gr();function t(i,u){this._block=d.alloc(i),this._finalSize=u,this._blockSize=i,this._len=0}return t.prototype.update=function(i,u){i=e(i,u||"utf8");for(var r=this._block,s=this._blockSize,a=i.length,o=this._len,f=0;f<a;){for(var n=o%s,c=Math.min(a-f,s-n),h=0;h<c;h++)r[n+h]=i[f+h];o+=c,f+=c,o%s===0&&this._update(r)}return this._len+=a,this},t.prototype.digest=function(i){var u=this._len%this._blockSize;this._block[u]=128,this._block.fill(0,u+1),u>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var s=(r&4294967295)>>>0,a=(r-s)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(s,this._blockSize-4)}this._update(this._block);var o=this._hash();return i?o.toString(i):o},t.prototype._update=function(){throw new Error("_update must be implemented by subclass")},ra=t,ra}var ia,Ec;function X0(){if(Ec)return ia;Ec=1;var d=be(),e=Jt(),t=_e().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function r(){this.init(),this._w=u,e.call(this,64,56)}d(r,e),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function s(f){return f<<5|f>>>27}function a(f){return f<<30|f>>>2}function o(f,n,c,h){return f===0?n&c|~n&h:f===2?n&c|n&h|c&h:n^c^h}return r.prototype._update=function(f){for(var n=this._w,c=this._a|0,h=this._b|0,l=this._c|0,p=this._d|0,b=this._e|0,y=0;y<16;++y)n[y]=f.readInt32BE(y*4);for(;y<80;++y)n[y]=n[y-3]^n[y-8]^n[y-14]^n[y-16];for(var v=0;v<80;++v){var g=~~(v/20),x=s(c)+o(g,h,l,p)+b+n[v]+i[g]|0;b=p,p=l,l=a(h),h=c,c=x}this._a=c+this._a|0,this._b=h+this._b|0,this._c=l+this._c|0,this._d=p+this._d|0,this._e=b+this._e|0},r.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},ia=r,ia}var na,Bc;function Q0(){if(Bc)return na;Bc=1;var d=be(),e=Jt(),t=_e().Buffer,i=[1518500249,1859775393,-1894007588,-899497514],u=new Array(80);function r(){this.init(),this._w=u,e.call(this,64,56)}d(r,e),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function s(n){return n<<1|n>>>31}function a(n){return n<<5|n>>>27}function o(n){return n<<30|n>>>2}function f(n,c,h,l){return n===0?c&h|~c&l:n===2?c&h|c&l|h&l:c^h^l}return r.prototype._update=function(n){for(var c=this._w,h=this._a|0,l=this._b|0,p=this._c|0,b=this._d|0,y=this._e|0,v=0;v<16;++v)c[v]=n.readInt32BE(v*4);for(;v<80;++v)c[v]=s(c[v-3]^c[v-8]^c[v-14]^c[v-16]);for(var g=0;g<80;++g){var x=~~(g/20),B=a(h)+f(x,l,p,b)+y+c[g]+i[x]|0;y=b,b=p,p=o(l),l=h,h=B}this._a=h+this._a|0,this._b=l+this._b|0,this._c=p+this._c|0,this._d=b+this._d|0,this._e=y+this._e|0},r.prototype._hash=function(){var n=t.allocUnsafe(20);return n.writeInt32BE(this._a|0,0),n.writeInt32BE(this._b|0,4),n.writeInt32BE(this._c|0,8),n.writeInt32BE(this._d|0,12),n.writeInt32BE(this._e|0,16),n},na=r,na}var aa,Ic;function od(){if(Ic)return aa;Ic=1;var d=be(),e=Jt(),t=_e().Buffer,i=[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],u=new Array(64);function r(){this.init(),this._w=u,e.call(this,64,56)}d(r,e),r.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 s(h,l,p){return p^h&(l^p)}function a(h,l,p){return h&l|p&(h|l)}function o(h){return(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10)}function f(h){return(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7)}function n(h){return(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3}function c(h){return(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10}return r.prototype._update=function(h){for(var l=this._w,p=this._a|0,b=this._b|0,y=this._c|0,v=this._d|0,g=this._e|0,x=this._f|0,B=this._g|0,R=this._h|0,T=0;T<16;++T)l[T]=h.readInt32BE(T*4);for(;T<64;++T)l[T]=c(l[T-2])+l[T-7]+n(l[T-15])+l[T-16]|0;for(var j=0;j<64;++j){var G=R+f(g)+s(g,x,B)+i[j]+l[j]|0,z=o(p)+a(p,b,y)|0;R=B,B=x,x=g,g=v+G|0,v=y,y=b,b=p,p=G+z|0}this._a=p+this._a|0,this._b=b+this._b|0,this._c=y+this._c|0,this._d=v+this._d|0,this._e=g+this._e|0,this._f=x+this._f|0,this._g=B+this._g|0,this._h=R+this._h|0},r.prototype._hash=function(){var h=t.allocUnsafe(32);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h.writeInt32BE(this._h,28),h},aa=r,aa}var fa,Rc;function Z0(){if(Rc)return fa;Rc=1;var d=be(),e=od(),t=Jt(),i=_e().Buffer,u=new Array(64);function r(){this.init(),this._w=u,t.call(this,64,56)}return d(r,e),r.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},r.prototype._hash=function(){var s=i.allocUnsafe(28);return s.writeInt32BE(this._a,0),s.writeInt32BE(this._b,4),s.writeInt32BE(this._c,8),s.writeInt32BE(this._d,12),s.writeInt32BE(this._e,16),s.writeInt32BE(this._f,20),s.writeInt32BE(this._g,24),s},fa=r,fa}var sa,Ac;function cd(){if(Ac)return sa;Ac=1;var d=be(),e=Jt(),t=_e().Buffer,i=[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],u=new Array(160);function r(){this.init(),this._w=u,e.call(this,128,112)}d(r,e),r.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 s(b,y,v){return v^b&(y^v)}function a(b,y,v){return b&y|v&(b|y)}function o(b,y){return(b>>>28|y<<4)^(y>>>2|b<<30)^(y>>>7|b<<25)}function f(b,y){return(b>>>14|y<<18)^(b>>>18|y<<14)^(y>>>9|b<<23)}function n(b,y){return(b>>>1|y<<31)^(b>>>8|y<<24)^b>>>7}function c(b,y){return(b>>>1|y<<31)^(b>>>8|y<<24)^(b>>>7|y<<25)}function h(b,y){return(b>>>19|y<<13)^(y>>>29|b<<3)^b>>>6}function l(b,y){return(b>>>19|y<<13)^(y>>>29|b<<3)^(b>>>6|y<<26)}function p(b,y){return b>>>0<y>>>0?1:0}return r.prototype._update=function(b){for(var y=this._w,v=this._ah|0,g=this._bh|0,x=this._ch|0,B=this._dh|0,R=this._eh|0,T=this._fh|0,j=this._gh|0,G=this._hh|0,z=this._al|0,te=this._bl|0,ne=this._cl|0,$=this._dl|0,N=this._el|0,m=this._fl|0,E=this._gl|0,O=this._hl|0,I=0;I<32;I+=2)y[I]=b.readInt32BE(I*4),y[I+1]=b.readInt32BE(I*4+4);for(;I<160;I+=2){var A=y[I-30],F=y[I-30+1],K=n(A,F),L=c(F,A);A=y[I-4],F=y[I-4+1];var _=h(A,F),q=l(F,A),fe=y[I-14],se=y[I-14+1],V=y[I-32],P=y[I-32+1],M=L+se|0,Y=K+fe+p(M,L)|0;M=M+q|0,Y=Y+_+p(M,q)|0,M=M+P|0,Y=Y+V+p(M,P)|0,y[I]=Y,y[I+1]=M}for(var Q=0;Q<160;Q+=2){Y=y[Q],M=y[Q+1];var D=a(v,g,x),C=a(z,te,ne),J=o(v,z),ie=o(z,v),he=f(R,N),oe=f(N,R),ue=i[Q],ge=i[Q+1],Ke=s(R,T,j),Se=s(N,m,E),de=O+oe|0,Ie=G+he+p(de,O)|0;de=de+Se|0,Ie=Ie+Ke+p(de,Se)|0,de=de+ge|0,Ie=Ie+ue+p(de,ge)|0,de=de+M|0,Ie=Ie+Y+p(de,M)|0;var ve=ie+C|0,me=J+D+p(ve,ie)|0;G=j,O=E,j=T,E=m,T=R,m=N,N=$+de|0,R=B+Ie+p(N,$)|0,B=x,$=ne,x=g,ne=te,g=v,te=z,z=de+ve|0,v=Ie+me+p(z,de)|0}this._al=this._al+z|0,this._bl=this._bl+te|0,this._cl=this._cl+ne|0,this._dl=this._dl+$|0,this._el=this._el+N|0,this._fl=this._fl+m|0,this._gl=this._gl+E|0,this._hl=this._hl+O|0,this._ah=this._ah+v+p(this._al,z)|0,this._bh=this._bh+g+p(this._bl,te)|0,this._ch=this._ch+x+p(this._cl,ne)|0,this._dh=this._dh+B+p(this._dl,$)|0,this._eh=this._eh+R+p(this._el,N)|0,this._fh=this._fh+T+p(this._fl,m)|0,this._gh=this._gh+j+p(this._gl,E)|0,this._hh=this._hh+G+p(this._hl,O)|0},r.prototype._hash=function(){var b=t.allocUnsafe(64);function y(v,g,x){b.writeInt32BE(v,x),b.writeInt32BE(g,x+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),y(this._gh,this._gl,48),y(this._hh,this._hl,56),b},sa=r,sa}var oa,Oc;function el(){if(Oc)return oa;Oc=1;var d=be(),e=cd(),t=Jt(),i=_e().Buffer,u=new Array(160);function r(){this.init(),this._w=u,t.call(this,128,112)}return d(r,e),r.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},r.prototype._hash=function(){var s=i.allocUnsafe(48);function a(o,f,n){s.writeInt32BE(o,n),s.writeInt32BE(f,n+4)}return a(this._ah,this._al,0),a(this._bh,this._bl,8),a(this._ch,this._cl,16),a(this._dh,this._dl,24),a(this._eh,this._el,32),a(this._fh,this._fl,40),s},oa=r,oa}var Pc;function ls(){return Pc||(Pc=1,(function(d){d.exports=function(t){var i=t.toLowerCase(),u=d.exports[i];if(!u)throw new Error(i+" is not supported (we accept pull requests)");return new u},d.exports.sha=X0(),d.exports.sha1=Q0(),d.exports.sha224=Z0(),d.exports.sha256=od(),d.exports.sha384=el(),d.exports.sha512=cd()})(ta)),ta.exports}var ca,Nc;function Pt(){if(Nc)return ca;Nc=1;var d=_e().Buffer,e=$h().Transform,t=Xf().StringDecoder,i=be(),u=Gr();function r(s){e.call(this),this.hashMode=typeof s=="string",this.hashMode?this[s]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return i(r,e),r.prototype.update=function(s,a,o){var f=u(s,a),n=this._update(f);return this.hashMode?this:(o&&(n=this._toString(n,o)),n)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(s,a,o){var f;try{this.hashMode?this._update(s):this.push(this._update(s))}catch(n){f=n}finally{o(f)}},r.prototype._flush=function(s){var a;try{this.push(this.__final())}catch(o){a=o}s(a)},r.prototype._finalOrDigest=function(s){var a=this.__final()||d.alloc(0);return s&&(a=this._toString(a,s,!0)),a},r.prototype._toString=function(s,a,o){if(this._decoder||(this._decoder=new t(a),this._encoding=a),this._encoding!==a)throw new Error("can’t switch encodings");var f=this._decoder.write(s);return o&&(f+=this._decoder.end()),f},ca=r,ca}var ua,kc;function lr(){if(kc)return ua;kc=1;var d=be(),e=os(),t=ds(),i=ls(),u=Pt();function r(s){u.call(this,"digest"),this._hash=s}return d(r,u),r.prototype._update=function(s){this._hash.update(s)},r.prototype._final=function(){return this._hash.digest()},ua=function(a){return a=a.toLowerCase(),a==="md5"?new e:a==="rmd160"||a==="ripemd160"?new t:new r(i(a))},ua}var ha,Mc;function tl(){if(Mc)return ha;Mc=1;var d=be(),e=_e().Buffer,t=Pt(),i=e.alloc(128),u=64;function r(s,a){t.call(this,"digest"),typeof a=="string"&&(a=e.from(a)),this._alg=s,this._key=a,a.length>u?a=s(a):a.length<u&&(a=e.concat([a,i],u));for(var o=this._ipad=e.allocUnsafe(u),f=this._opad=e.allocUnsafe(u),n=0;n<u;n++)o[n]=a[n]^54,f[n]=a[n]^92;this._hash=[o]}return d(r,t),r.prototype._update=function(s){this._hash.push(s)},r.prototype._final=function(){var s=this._alg(e.concat(this._hash));return this._alg(e.concat([this._opad,s]))},ha=r,ha}var da,Cc;function ud(){if(Cc)return da;Cc=1;var d=os();return da=function(e){return new d().update(e).digest()},da}var la,Tc;function hd(){if(Tc)return la;Tc=1;var d=be(),e=tl(),t=Pt(),i=_e().Buffer,u=ud(),r=ds(),s=ls(),a=i.alloc(128);function o(f,n){t.call(this,"digest"),typeof n=="string"&&(n=i.from(n));var c=f==="sha512"||f==="sha384"?128:64;if(this._alg=f,this._key=n,n.length>c){var h=f==="rmd160"?new r:s(f);n=h.update(n).digest()}else n.length<c&&(n=i.concat([n,a],c));for(var l=this._ipad=i.allocUnsafe(c),p=this._opad=i.allocUnsafe(c),b=0;b<c;b++)l[b]=n[b]^54,p[b]=n[b]^92;this._hash=f==="rmd160"?new r:s(f),this._hash.update(l)}return d(o,t),o.prototype._update=function(f){this._hash.update(f)},o.prototype._final=function(){var f=this._hash.digest(),n=this._alg==="rmd160"?new r:s(this._alg);return n.update(this._opad).update(f).digest()},la=function(n,c){return n=n.toLowerCase(),n==="rmd160"||n==="ripemd160"?new o("rmd160",c):n==="md5"?new e(u,c):new o(n,c)},la}const rl={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},il={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},nl={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},al={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},fl={sign:"ecdsa",hash:"sha256",id:""},sl={sign:"ecdsa",hash:"sha224",id:""},ol={sign:"ecdsa",hash:"sha384",id:""},cl={sign:"ecdsa",hash:"sha512",id:""},ul={sign:"dsa",hash:"sha1",id:""},hl={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},dl={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},dd={sha224WithRSAEncryption:rl,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:il,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:nl,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:al,"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:fl,sha224:sl,sha384:ol,sha512:cl,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:ul,"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:hl,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:dl,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var pa,Lc;function ll(){return Lc||(Lc=1,pa=dd),pa}var Pr={},ba,Dc;function ld(){if(Dc)return ba;Dc=1;var d=isFinite,e=Math.pow(2,30)-1;return ba=function(t,i){if(typeof t!="number")throw new TypeError("Iterations not a number");if(t<0||!d(t))throw new TypeError("Bad iterations");if(typeof i!="number")throw new TypeError("Key length not a number");if(i<0||i>e||i!==i)throw new TypeError("Bad key length");return i+0},ba}var va,Fc;function pd(){if(Fc)return va;Fc=1;var d;if(Re.process&&Re.process.browser)d="utf-8";else if(Re.process&&Re.process.version){var e=parseInt(process.version.split(".")[0].slice(1),10);d=e>=6?"utf-8":"binary"}else d="utf-8";return va=d,va}var ma,Uc;function bd(){if(Uc)return ma;Uc=1;var d=_e().Buffer,e=Gr(),t=typeof Uint8Array<"u",i=t&&typeof ArrayBuffer<"u",u=i&&ArrayBuffer.isView;return ma=function(r,s,a){if(typeof r=="string"||d.isBuffer(r)||t&&r instanceof Uint8Array||u&&u(r))return e(r,s);throw new TypeError(a+" must be a string, a Buffer, a Uint8Array, or a DataView")},ma}var ya,qc;function vd(){if(qc)return ya;qc=1;var d=ud(),e=ds(),t=ls(),i=_e().Buffer,u=ld(),r=pd(),s=bd(),a=i.alloc(128),o={__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 n(p){return new e().update(p).digest()}function c(p){function b(y){return t(p).update(y).digest()}return p==="rmd160"||p==="ripemd160"?n:p==="md5"?d:b}function h(p,b,y){var v=c(p),g=p==="sha512"||p==="sha384"?128:64;b.length>g?b=v(b):b.length<g&&(b=i.concat([b,a],g));for(var x=i.allocUnsafe(g+o[p]),B=i.allocUnsafe(g+o[p]),R=0;R<g;R++)x[R]=b[R]^54,B[R]=b[R]^92;var T=i.allocUnsafe(g+y+4);x.copy(T,0,0,g),this.ipad1=T,this.ipad2=x,this.opad=B,this.alg=p,this.blocksize=g,this.hash=v,this.size=o[p]}h.prototype.run=function(p,b){p.copy(b,this.blocksize);var y=this.hash(b);return y.copy(this.opad,this.blocksize),this.hash(this.opad)};function l(p,b,y,v,g){v=u(y,v),p=s(p,r,"Password"),b=s(b,r,"Salt");var x=(g||"sha1").toLowerCase(),B=f[x]||x,R=o[B];if(typeof R!="number"||!R)throw new TypeError("Digest algorithm not supported: "+g);var T=new h(B,p,b.length),j=i.allocUnsafe(v),G=i.allocUnsafe(b.length+4);b.copy(G,0,0,b.length);for(var z=0,te=R,ne=Math.ceil(v/te),$=1;$<=ne;$++){G.writeUInt32BE($,b.length);for(var N=T.run(G,T.ipad1),m=N,E=1;E<y;E++){m=T.run(m,T.ipad2);for(var O=0;O<te;O++)N[O]^=m[O]}N.copy(j,z),z+=te}return j}return ya=l,ya}var ga,Hc;function pl(){if(Hc)return ga;Hc=1;var d=_e().Buffer,e=ld(),t=pd(),i=vd(),u=bd(),r,s=Re.crypto&&Re.crypto.subtle,a={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"},o=[],f;function n(){return f||(Re.process&&Re.process.nextTick?f=Re.process.nextTick:Re.queueMicrotask?f=Re.queueMicrotask:Re.setImmediate?f=Re.setImmediate:f=Re.setTimeout,f)}function c(p,b,y,v,g){return s.importKey("raw",p,{name:"PBKDF2"},!1,["deriveBits"]).then(function(x){return s.deriveBits({name:"PBKDF2",salt:b,iterations:y,hash:{name:g}},x,v<<3)}).then(function(x){return d.from(x)})}function h(p){if(Re.process&&!Re.process.browser||!s||!s.importKey||!s.deriveBits)return Promise.resolve(!1);if(o[p]!==void 0)return o[p];r=r||d.alloc(8);var b=c(r,r,10,128,p).then(function(){return!0},function(){return!1});return o[p]=b,b}function l(p,b){p.then(function(y){n()(function(){b(null,y)})},function(y){n()(function(){b(y)})})}return ga=function(p,b,y,v,g,x){if(typeof g=="function"&&(x=g,g=void 0),v=e(y,v),p=u(p,t,"Password"),b=u(b,t,"Salt"),typeof x!="function")throw new Error("No callback provided to pbkdf2");g=g||"sha1";var B=a[g.toLowerCase()];if(!B||typeof Re.Promise!="function"){n()(function(){var R;try{R=i(p,b,y,v,g)}catch(T){x(T);return}x(null,R)});return}l(h(B).then(function(R){return R?c(p,b,y,v,B):i(p,b,y,v,g)}),x)},ga}var Kc;function ps(){return Kc||(Kc=1,Pr.pbkdf2=pl(),Pr.pbkdf2Sync=vd()),Pr}var pt={},kt={},dt={},jc;function md(){if(jc)return dt;jc=1,dt.readUInt32BE=function(u,r){var s=u[0+r]<<24|u[1+r]<<16|u[2+r]<<8|u[3+r];return s>>>0},dt.writeUInt32BE=function(u,r,s){u[0+s]=r>>>24,u[1+s]=r>>>16&255,u[2+s]=r>>>8&255,u[3+s]=r&255},dt.ip=function(u,r,s,a){for(var o=0,f=0,n=6;n>=0;n-=2){for(var c=0;c<=24;c+=8)o<<=1,o|=r>>>c+n&1;for(var c=0;c<=24;c+=8)o<<=1,o|=u>>>c+n&1}for(var n=6;n>=0;n-=2){for(var c=1;c<=25;c+=8)f<<=1,f|=r>>>c+n&1;for(var c=1;c<=25;c+=8)f<<=1,f|=u>>>c+n&1}s[a+0]=o>>>0,s[a+1]=f>>>0},dt.rip=function(u,r,s,a){for(var o=0,f=0,n=0;n<4;n++)for(var c=24;c>=0;c-=8)o<<=1,o|=r>>>c+n&1,o<<=1,o|=u>>>c+n&1;for(var n=4;n<8;n++)for(var c=24;c>=0;c-=8)f<<=1,f|=r>>>c+n&1,f<<=1,f|=u>>>c+n&1;s[a+0]=o>>>0,s[a+1]=f>>>0},dt.pc1=function(u,r,s,a){for(var o=0,f=0,n=7;n>=5;n--){for(var c=0;c<=24;c+=8)o<<=1,o|=r>>c+n&1;for(var c=0;c<=24;c+=8)o<<=1,o|=u>>c+n&1}for(var c=0;c<=24;c+=8)o<<=1,o|=r>>c+n&1;for(var n=1;n<=3;n++){for(var c=0;c<=24;c+=8)f<<=1,f|=r>>c+n&1;for(var c=0;c<=24;c+=8)f<<=1,f|=u>>c+n&1}for(var c=0;c<=24;c+=8)f<<=1,f|=u>>c+n&1;s[a+0]=o>>>0,s[a+1]=f>>>0},dt.r28shl=function(u,r){return u<<r&268435455|u>>>28-r};var d=[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];dt.pc2=function(u,r,s,a){for(var o=0,f=0,n=d.length>>>1,c=0;c<n;c++)o<<=1,o|=u>>>d[c]&1;for(var c=n;c<d.length;c++)f<<=1,f|=r>>>d[c]&1;s[a+0]=o>>>0,s[a+1]=f>>>0},dt.expand=function(u,r,s){var a=0,o=0;a=(u&1)<<5|u>>>27;for(var f=23;f>=15;f-=4)a<<=6,a|=u>>>f&63;for(var f=11;f>=3;f-=4)o|=u>>>f&63,o<<=6;o|=(u&31)<<1|u>>>31,r[s+0]=a>>>0,r[s+1]=o>>>0};var e=[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];dt.substitute=function(u,r){for(var s=0,a=0;a<4;a++){var o=u>>>18-a*6&63,f=e[a*64+o];s<<=4,s|=f}for(var a=0;a<4;a++){var o=r>>>18-a*6&63,f=e[256+a*64+o];s<<=4,s|=f}return s>>>0};var t=[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 dt.permute=function(u){for(var r=0,s=0;s<t.length;s++)r<<=1,r|=u>>>t[s]&1;return r>>>0},dt.padSplit=function(u,r,s){for(var a=u.toString(2);a.length<r;)a="0"+a;for(var o=[],f=0;f<r;f+=s)o.push(a.slice(f,f+s));return o.join(" ")},dt}var wa,zc;function bs(){if(zc)return wa;zc=1;var d=lt();function e(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=t.padding!==!1}return wa=e,e.prototype._init=function(){},e.prototype.update=function(i){return i.length===0?[]:this.type==="decrypt"?this._updateDecrypt(i):this._updateEncrypt(i)},e.prototype._buffer=function(i,u){for(var r=Math.min(this.buffer.length-this.bufferOff,i.length-u),s=0;s<r;s++)this.buffer[this.bufferOff+s]=i[u+s];return this.bufferOff+=r,r},e.prototype._flushBuffer=function(i,u){return this._update(this.buffer,0,i,u),this.bufferOff=0,this.blockSize},e.prototype._updateEncrypt=function(i){var u=0,r=0,s=(this.bufferOff+i.length)/this.blockSize|0,a=new Array(s*this.blockSize);this.bufferOff!==0&&(u+=this._buffer(i,u),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(a,r)));for(var o=i.length-(i.length-u)%this.blockSize;u<o;u+=this.blockSize)this._update(i,u,a,r),r+=this.blockSize;for(;u<i.length;u++,this.bufferOff++)this.buffer[this.bufferOff]=i[u];return a},e.prototype._updateDecrypt=function(i){for(var u=0,r=0,s=Math.ceil((this.bufferOff+i.length)/this.blockSize)-1,a=new Array(s*this.blockSize);s>0;s--)u+=this._buffer(i,u),r+=this._flushBuffer(a,r);return u+=this._buffer(i,u),a},e.prototype.final=function(i){var u;i&&(u=this.update(i));var r;return this.type==="encrypt"?r=this._finalEncrypt():r=this._finalDecrypt(),u?u.concat(r):r},e.prototype._pad=function(i,u){if(u===0)return!1;for(;u<i.length;)i[u++]=0;return!0},e.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var i=new Array(this.blockSize);return this._update(this.buffer,0,i,0),i},e.prototype._unpad=function(i){return i},e.prototype._finalDecrypt=function(){d.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var i=new Array(this.blockSize);return this._flushBuffer(i,0),this._unpad(i)},wa}var _a,Vc;function yd(){if(Vc)return _a;Vc=1;var d=lt(),e=be(),t=md(),i=bs();function u(){this.tmp=new Array(2),this.keys=null}function r(a){i.call(this,a);var o=new u;this._desState=o,this.deriveKeys(o,a.key)}e(r,i),_a=r,r.create=function(o){return new r(o)};var s=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return r.prototype.deriveKeys=function(o,f){o.keys=new Array(32),d.equal(f.length,this.blockSize,"Invalid key length");var n=t.readUInt32BE(f,0),c=t.readUInt32BE(f,4);t.pc1(n,c,o.tmp,0),n=o.tmp[0],c=o.tmp[1];for(var h=0;h<o.keys.length;h+=2){var l=s[h>>>1];n=t.r28shl(n,l),c=t.r28shl(c,l),t.pc2(n,c,o.keys,h)}},r.prototype._update=function(o,f,n,c){var h=this._desState,l=t.readUInt32BE(o,f),p=t.readUInt32BE(o,f+4);t.ip(l,p,h.tmp,0),l=h.tmp[0],p=h.tmp[1],this.type==="encrypt"?this._encrypt(h,l,p,h.tmp,0):this._decrypt(h,l,p,h.tmp,0),l=h.tmp[0],p=h.tmp[1],t.writeUInt32BE(n,l,c),t.writeUInt32BE(n,p,c+4)},r.prototype._pad=function(o,f){if(this.padding===!1)return!1;for(var n=o.length-f,c=f;c<o.length;c++)o[c]=n;return!0},r.prototype._unpad=function(o){if(this.padding===!1)return o;for(var f=o[o.length-1],n=o.length-f;n<o.length;n++)d.equal(o[n],f);return o.slice(0,o.length-f)},r.prototype._encrypt=function(o,f,n,c,h){for(var l=f,p=n,b=0;b<o.keys.length;b+=2){var y=o.keys[b],v=o.keys[b+1];t.expand(p,o.tmp,0),y^=o.tmp[0],v^=o.tmp[1];var g=t.substitute(y,v),x=t.permute(g),B=p;p=(l^x)>>>0,l=B}t.rip(p,l,c,h)},r.prototype._decrypt=function(o,f,n,c,h){for(var l=n,p=f,b=o.keys.length-2;b>=0;b-=2){var y=o.keys[b],v=o.keys[b+1];t.expand(l,o.tmp,0),y^=o.tmp[0],v^=o.tmp[1];var g=t.substitute(y,v),x=t.permute(g),B=l;l=(p^x)>>>0,p=B}t.rip(l,p,c,h)},_a}var Sa={},Gc;function bl(){if(Gc)return Sa;Gc=1;var d=lt(),e=be(),t={};function i(r){d.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var s=0;s<this.iv.length;s++)this.iv[s]=r[s]}function u(r){function s(n){r.call(this,n),this._cbcInit()}e(s,r);for(var a=Object.keys(t),o=0;o<a.length;o++){var f=a[o];s.prototype[f]=t[f]}return s.create=function(c){return new s(c)},s}return Sa.instantiate=u,t._cbcInit=function(){var s=new i(this.options.iv);this._cbcState=s},t._update=function(s,a,o,f){var n=this._cbcState,c=this.constructor.super_.prototype,h=n.iv;if(this.type==="encrypt"){for(var l=0;l<this.blockSize;l++)h[l]^=s[a+l];c._update.call(this,h,0,o,f);for(var l=0;l<this.blockSize;l++)h[l]=o[f+l]}else{c._update.call(this,s,a,o,f);for(var l=0;l<this.blockSize;l++)o[f+l]^=h[l];for(var l=0;l<this.blockSize;l++)h[l]=s[a+l]}},Sa}var xa,$c;function vl(){if($c)return xa;$c=1;var d=lt(),e=be(),t=bs(),i=yd();function u(s,a){d.equal(a.length,24,"Invalid key length");var o=a.slice(0,8),f=a.slice(8,16),n=a.slice(16,24);s==="encrypt"?this.ciphers=[i.create({type:"encrypt",key:o}),i.create({type:"decrypt",key:f}),i.create({type:"encrypt",key:n})]:this.ciphers=[i.create({type:"decrypt",key:n}),i.create({type:"encrypt",key:f}),i.create({type:"decrypt",key:o})]}function r(s){t.call(this,s);var a=new u(this.type,this.options.key);this._edeState=a}return e(r,t),xa=r,r.create=function(a){return new r(a)},r.prototype._update=function(a,o,f,n){var c=this._edeState;c.ciphers[0]._update(a,o,f,n),c.ciphers[1]._update(f,n,f,n),c.ciphers[2]._update(f,n,f,n)},r.prototype._pad=i.prototype._pad,r.prototype._unpad=i.prototype._unpad,xa}var Wc;function ml(){return Wc||(Wc=1,kt.utils=md(),kt.Cipher=bs(),kt.DES=yd(),kt.CBC=bl(),kt.EDE=vl()),kt}var Ea,Yc;function yl(){if(Yc)return Ea;Yc=1;var d=Pt(),e=ml(),t=be(),i=_e().Buffer,u={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};u.des=u["des-cbc"],u.des3=u["des-ede3-cbc"],Ea=r,t(r,d);function r(s){d.call(this);var a=s.mode.toLowerCase(),o=u[a],f;s.decrypt?f="decrypt":f="encrypt";var n=s.key;i.isBuffer(n)||(n=i.from(n)),(a==="des-ede"||a==="des-ede-cbc")&&(n=i.concat([n,n.slice(0,8)]));var c=s.iv;i.isBuffer(c)||(c=i.from(c)),this._des=o.create({key:n,iv:c,type:f})}return r.prototype._update=function(s){return i.from(this._des.update(s))},r.prototype._final=function(){return i.from(this._des.final())},Ea}var bt={},Nr={},kr={},Jc;function gl(){return Jc||(Jc=1,kr.encrypt=function(d,e){return d._cipher.encryptBlock(e)},kr.decrypt=function(d,e){return d._cipher.decryptBlock(e)}),kr}var Mr={},Ba,Xc;function pr(){return Xc||(Xc=1,Ba=function(e,t){for(var i=Math.min(e.length,t.length),u=new Buffer(i),r=0;r<i;++r)u[r]=e[r]^t[r];return u}),Ba}var Qc;function wl(){if(Qc)return Mr;Qc=1;var d=pr();return Mr.encrypt=function(e,t){var i=d(t,e._prev);return e._prev=e._cipher.encryptBlock(i),e._prev},Mr.decrypt=function(e,t){var i=e._prev;e._prev=t;var u=e._cipher.decryptBlock(t);return d(u,i)},Mr}var Ia={},Zc;function _l(){if(Zc)return Ia;Zc=1;var d=_e().Buffer,e=pr();function t(i,u,r){var s=u.length,a=e(u,i._cache);return i._cache=i._cache.slice(s),i._prev=d.concat([i._prev,r?u:a]),a}return Ia.encrypt=function(i,u,r){for(var s=d.allocUnsafe(0),a;u.length;)if(i._cache.length===0&&(i._cache=i._cipher.encryptBlock(i._prev),i._prev=d.allocUnsafe(0)),i._cache.length<=u.length)a=i._cache.length,s=d.concat([s,t(i,u.slice(0,a),r)]),u=u.slice(a);else{s=d.concat([s,t(i,u,r)]);break}return s},Ia}var Ra={},eu;function Sl(){if(eu)return Ra;eu=1;var d=_e().Buffer;function e(t,i,u){var r=t._cipher.encryptBlock(t._prev),s=r[0]^i;return t._prev=d.concat([t._prev.slice(1),d.from([u?i:s])]),s}return Ra.encrypt=function(t,i,u){for(var r=i.length,s=d.allocUnsafe(r),a=-1;++a<r;)s[a]=e(t,i[a],u);return s},Ra}var Aa={},tu;function xl(){if(tu)return Aa;tu=1;var d=_e().Buffer;function e(i,u,r){for(var s,a=-1,o=8,f=0,n,c;++a<o;)s=i._cipher.encryptBlock(i._prev),n=u&1<<7-a?128:0,c=s[0]^n,f+=(c&128)>>a%8,i._prev=t(i._prev,r?n:c);return f}function t(i,u){var r=i.length,s=-1,a=d.allocUnsafe(i.length);for(i=d.concat([i,d.from([u])]);++s<r;)a[s]=i[s]<<1|i[s+1]>>7;return a}return Aa.encrypt=function(i,u,r){for(var s=u.length,a=d.allocUnsafe(s),o=-1;++o<s;)a[o]=e(i,u[o],r);return a},Aa}var Oa={},ru;function El(){if(ru)return Oa;ru=1;var d=pr();function e(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}return Oa.encrypt=function(t,i){for(;t._cache.length<i.length;)t._cache=Buffer.concat([t._cache,e(t)]);var u=t._cache.slice(0,i.length);return t._cache=t._cache.slice(i.length),d(i,u)},Oa}var Pa={},Na,iu;function gd(){if(iu)return Na;iu=1;function d(e){for(var t=e.length,i;t--;)if(i=e.readUInt8(t),i===255)e.writeUInt8(0,t);else{i++,e.writeUInt8(i,t);break}}return Na=d,Na}var nu;function au(){if(nu)return Pa;nu=1;var d=pr(),e=_e().Buffer,t=gd();function i(r){var s=r._cipher.encryptBlockRaw(r._prev);return t(r._prev),s}var u=16;return Pa.encrypt=function(r,s){var a=Math.ceil(s.length/u),o=r._cache.length;r._cache=e.concat([r._cache,e.allocUnsafe(a*u)]);for(var f=0;f<a;f++){var n=i(r),c=o+f*u;r._cache.writeUInt32BE(n[0],c+0),r._cache.writeUInt32BE(n[1],c+4),r._cache.writeUInt32BE(n[2],c+8),r._cache.writeUInt32BE(n[3],c+12)}var h=r._cache.slice(0,s.length);return r._cache=r._cache.slice(s.length),d(s,h)},Pa}const Bl={cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},Il={cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},Rl={cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},wd={"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:Bl,aes192:Il,aes256:Rl,"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 ka,fu;function vs(){if(fu)return ka;fu=1;var d={ECB:gl(),CBC:wl(),CFB:_l(),CFB8:Sl(),CFB1:xl(),OFB:El(),CTR:au(),GCM:au()},e=wd;for(var t in e)e[t].module=d[e[t].mode];return ka=e,ka}var Ma={},su;function Yr(){if(su)return Ma;su=1;var d=_e().Buffer;function e(a){d.isBuffer(a)||(a=d.from(a));for(var o=a.length/4|0,f=new Array(o),n=0;n<o;n++)f[n]=a.readUInt32BE(n*4);return f}function t(a){for(var o=0;o<a.length;a++)a[o]=0}function i(a,o,f,n,c){for(var h=f[0],l=f[1],p=f[2],b=f[3],y=a[0]^o[0],v=a[1]^o[1],g=a[2]^o[2],x=a[3]^o[3],B,R,T,j,G=4,z=1;z<c;z++)B=h[y>>>24]^l[v>>>16&255]^p[g>>>8&255]^b[x&255]^o[G++],R=h[v>>>24]^l[g>>>16&255]^p[x>>>8&255]^b[y&255]^o[G++],T=h[g>>>24]^l[x>>>16&255]^p[y>>>8&255]^b[v&255]^o[G++],j=h[x>>>24]^l[y>>>16&255]^p[v>>>8&255]^b[g&255]^o[G++],y=B,v=R,g=T,x=j;return B=(n[y>>>24]<<24|n[v>>>16&255]<<16|n[g>>>8&255]<<8|n[x&255])^o[G++],R=(n[v>>>24]<<24|n[g>>>16&255]<<16|n[x>>>8&255]<<8|n[y&255])^o[G++],T=(n[g>>>24]<<24|n[x>>>16&255]<<16|n[y>>>8&255]<<8|n[v&255])^o[G++],j=(n[x>>>24]<<24|n[y>>>16&255]<<16|n[v>>>8&255]<<8|n[g&255])^o[G++],B=B>>>0,R=R>>>0,T=T>>>0,j=j>>>0,[B,R,T,j]}var u=[0,1,2,4,8,16,32,64,128,27,54],r=(function(){for(var a=new Array(256),o=0;o<256;o++)o<128?a[o]=o<<1:a[o]=o<<1^283;for(var f=[],n=[],c=[[],[],[],[]],h=[[],[],[],[]],l=0,p=0,b=0;b<256;++b){var y=p^p<<1^p<<2^p<<3^p<<4;y=y>>>8^y&255^99,f[l]=y,n[y]=l;var v=a[l],g=a[v],x=a[g],B=a[y]*257^y*16843008;c[0][l]=B<<24|B>>>8,c[1][l]=B<<16|B>>>16,c[2][l]=B<<8|B>>>24,c[3][l]=B,B=x*16843009^g*65537^v*257^l*16843008,h[0][y]=B<<24|B>>>8,h[1][y]=B<<16|B>>>16,h[2][y]=B<<8|B>>>24,h[3][y]=B,l===0?l=p=1:(l=v^a[a[a[x^v]]],p^=a[a[p]])}return{SBOX:f,INV_SBOX:n,SUB_MIX:c,INV_SUB_MIX:h}})();function s(a){this._key=e(a),this._reset()}return s.blockSize=16,s.keySize=256/8,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var a=this._key,o=a.length,f=o+6,n=(f+1)*4,c=[],h=0;h<o;h++)c[h]=a[h];for(h=o;h<n;h++){var l=c[h-1];h%o===0?(l=l<<8|l>>>24,l=r.SBOX[l>>>24]<<24|r.SBOX[l>>>16&255]<<16|r.SBOX[l>>>8&255]<<8|r.SBOX[l&255],l^=u[h/o|0]<<24):o>6&&h%o===4&&(l=r.SBOX[l>>>24]<<24|r.SBOX[l>>>16&255]<<16|r.SBOX[l>>>8&255]<<8|r.SBOX[l&255]),c[h]=c[h-o]^l}for(var p=[],b=0;b<n;b++){var y=n-b,v=c[y-(b%4?0:4)];b<4||y<=4?p[b]=v:p[b]=r.INV_SUB_MIX[0][r.SBOX[v>>>24]]^r.INV_SUB_MIX[1][r.SBOX[v>>>16&255]]^r.INV_SUB_MIX[2][r.SBOX[v>>>8&255]]^r.INV_SUB_MIX[3][r.SBOX[v&255]]}this._nRounds=f,this._keySchedule=c,this._invKeySchedule=p},s.prototype.encryptBlockRaw=function(a){return a=e(a),i(a,this._keySchedule,r.SUB_MIX,r.SBOX,this._nRounds)},s.prototype.encryptBlock=function(a){var o=this.encryptBlockRaw(a),f=d.allocUnsafe(16);return f.writeUInt32BE(o[0],0),f.writeUInt32BE(o[1],4),f.writeUInt32BE(o[2],8),f.writeUInt32BE(o[3],12),f},s.prototype.decryptBlock=function(a){a=e(a);var o=a[1];a[1]=a[3],a[3]=o;var f=i(a,this._invKeySchedule,r.INV_SUB_MIX,r.INV_SBOX,this._nRounds),n=d.allocUnsafe(16);return n.writeUInt32BE(f[0],0),n.writeUInt32BE(f[3],4),n.writeUInt32BE(f[2],8),n.writeUInt32BE(f[1],12),n},s.prototype.scrub=function(){t(this._keySchedule),t(this._invKeySchedule),t(this._key)},Ma.AES=s,Ma}var Ca,ou;function Al(){if(ou)return Ca;ou=1;var d=_e().Buffer,e=d.alloc(16,0);function t(r){return[r.readUInt32BE(0),r.readUInt32BE(4),r.readUInt32BE(8),r.readUInt32BE(12)]}function i(r){var s=d.allocUnsafe(16);return s.writeUInt32BE(r[0]>>>0,0),s.writeUInt32BE(r[1]>>>0,4),s.writeUInt32BE(r[2]>>>0,8),s.writeUInt32BE(r[3]>>>0,12),s}function u(r){this.h=r,this.state=d.alloc(16,0),this.cache=d.allocUnsafe(0)}return u.prototype.ghash=function(r){for(var s=-1;++s<r.length;)this.state[s]^=r[s];this._multiply()},u.prototype._multiply=function(){for(var r=t(this.h),s=[0,0,0,0],a,o,f,n=-1;++n<128;){for(o=(this.state[~~(n/8)]&1<<7-n%8)!==0,o&&(s[0]^=r[0],s[1]^=r[1],s[2]^=r[2],s[3]^=r[3]),f=(r[3]&1)!==0,a=3;a>0;a--)r[a]=r[a]>>>1|(r[a-1]&1)<<31;r[0]=r[0]>>>1,f&&(r[0]=r[0]^225<<24)}this.state=i(s)},u.prototype.update=function(r){this.cache=d.concat([this.cache,r]);for(var s;this.cache.length>=16;)s=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(s)},u.prototype.final=function(r,s){return this.cache.length&&this.ghash(d.concat([this.cache,e],16)),this.ghash(i([0,r,0,s])),this.state},Ca=u,Ca}var Ta,cu;function _d(){if(cu)return Ta;cu=1;var d=Yr(),e=_e().Buffer,t=Pt(),i=be(),u=Al(),r=pr(),s=gd();function a(n,c){var h=0;n.length!==c.length&&h++;for(var l=Math.min(n.length,c.length),p=0;p<l;++p)h+=n[p]^c[p];return h}function o(n,c,h){if(c.length===12)return n._finID=e.concat([c,e.from([0,0,0,1])]),e.concat([c,e.from([0,0,0,2])]);var l=new u(h),p=c.length,b=p%16;l.update(c),b&&(b=16-b,l.update(e.alloc(b,0))),l.update(e.alloc(8,0));var y=p*8,v=e.alloc(8);v.writeUIntBE(y,0,8),l.update(v),n._finID=l.state;var g=e.from(n._finID);return s(g),g}function f(n,c,h,l){t.call(this);var p=e.alloc(4,0);this._cipher=new d.AES(c);var b=this._cipher.encryptBlock(p);this._ghash=new u(b),h=o(this,h,b),this._prev=e.from(h),this._cache=e.allocUnsafe(0),this._secCache=e.allocUnsafe(0),this._decrypt=l,this._alen=0,this._len=0,this._mode=n,this._authTag=null,this._called=!1}return i(f,t),f.prototype._update=function(n){if(!this._called&&this._alen){var c=16-this._alen%16;c<16&&(c=e.alloc(c,0),this._ghash.update(c))}this._called=!0;var h=this._mode.encrypt(this,n);return this._decrypt?this._ghash.update(n):this._ghash.update(h),this._len+=n.length,h},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var n=r(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&a(n,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=n,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!e.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(c){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=c},f.prototype.setAAD=function(c){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(c),this._alen+=c.length},Ta=f,Ta}var La,uu;function Sd(){if(uu)return La;uu=1;var d=Yr(),e=_e().Buffer,t=Pt(),i=be();function u(r,s,a,o){t.call(this),this._cipher=new d.AES(s),this._prev=e.from(a),this._cache=e.allocUnsafe(0),this._secCache=e.allocUnsafe(0),this._decrypt=o,this._mode=r}return i(u,t),u.prototype._update=function(r){return this._mode.encrypt(this,r,this._decrypt)},u.prototype._final=function(){this._cipher.scrub()},La=u,La}var Da,hu;function Jr(){if(hu)return Da;hu=1;var d=_e().Buffer,e=os();function t(i,u,r,s){if(d.isBuffer(i)||(i=d.from(i,"binary")),u&&(d.isBuffer(u)||(u=d.from(u,"binary")),u.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,o=d.alloc(a),f=d.alloc(s||0),n=d.alloc(0);a>0||s>0;){var c=new e;c.update(n),c.update(i),u&&c.update(u),n=c.digest();var h=0;if(a>0){var l=o.length-a;h=Math.min(a,n.length),n.copy(o,l,0,h),a-=h}if(h<n.length&&s>0){var p=f.length-s,b=Math.min(s,n.length-h);n.copy(f,p,h,h+b),s-=b}}return n.fill(0),{key:o,iv:f}}return Da=t,Da}var du;function Ol(){if(du)return Nr;du=1;var d=vs(),e=_d(),t=_e().Buffer,i=Sd(),u=Pt(),r=Yr(),s=Jr(),a=be();function o(l,p,b){u.call(this),this._cache=new n,this._cipher=new r.AES(p),this._prev=t.from(b),this._mode=l,this._autopadding=!0}a(o,u),o.prototype._update=function(l){this._cache.add(l);for(var p,b,y=[];p=this._cache.get();)b=this._mode.encrypt(this,p),y.push(b);return t.concat(y)};var f=t.alloc(16,16);o.prototype._final=function(){var l=this._cache.flush();if(this._autopadding)return l=this._mode.encrypt(this,l),this._cipher.scrub(),l;if(!l.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(l){return this._autopadding=!!l,this};function n(){this.cache=t.allocUnsafe(0)}n.prototype.add=function(l){this.cache=t.concat([this.cache,l])},n.prototype.get=function(){if(this.cache.length>15){var l=this.cache.slice(0,16);return this.cache=this.cache.slice(16),l}return null},n.prototype.flush=function(){for(var l=16-this.cache.length,p=t.allocUnsafe(l),b=-1;++b<l;)p.writeUInt8(l,b);return t.concat([this.cache,p])};function c(l,p,b){var y=d[l.toLowerCase()];if(!y)throw new TypeError("invalid suite type");if(typeof p=="string"&&(p=t.from(p)),p.length!==y.key/8)throw new TypeError("invalid key length "+p.length);if(typeof b=="string"&&(b=t.from(b)),y.mode!=="GCM"&&b.length!==y.iv)throw new TypeError("invalid iv length "+b.length);return y.type==="stream"?new i(y.module,p,b):y.type==="auth"?new e(y.module,p,b):new o(y.module,p,b)}function h(l,p){var b=d[l.toLowerCase()];if(!b)throw new TypeError("invalid suite type");var y=s(p,!1,b.key,b.iv);return c(l,y.key,y.iv)}return Nr.createCipheriv=c,Nr.createCipher=h,Nr}var Cr={},lu;function Pl(){if(lu)return Cr;lu=1;var d=_d(),e=_e().Buffer,t=vs(),i=Sd(),u=Pt(),r=Yr(),s=Jr(),a=be();function o(l,p,b){u.call(this),this._cache=new f,this._last=void 0,this._cipher=new r.AES(p),this._prev=e.from(b),this._mode=l,this._autopadding=!0}a(o,u),o.prototype._update=function(l){this._cache.add(l);for(var p,b,y=[];p=this._cache.get(this._autopadding);)b=this._mode.decrypt(this,p),y.push(b);return e.concat(y)},o.prototype._final=function(){var l=this._cache.flush();if(this._autopadding)return n(this._mode.decrypt(this,l));if(l)throw new Error("data not multiple of block length")},o.prototype.setAutoPadding=function(l){return this._autopadding=!!l,this};function f(){this.cache=e.allocUnsafe(0)}f.prototype.add=function(l){this.cache=e.concat([this.cache,l])},f.prototype.get=function(l){var p;if(l){if(this.cache.length>16)return p=this.cache.slice(0,16),this.cache=this.cache.slice(16),p}else if(this.cache.length>=16)return p=this.cache.slice(0,16),this.cache=this.cache.slice(16),p;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache};function n(l){var p=l[15];if(p<1||p>16)throw new Error("unable to decrypt data");for(var b=-1;++b<p;)if(l[b+(16-p)]!==p)throw new Error("unable to decrypt data");if(p!==16)return l.slice(0,16-p)}function c(l,p,b){var y=t[l.toLowerCase()];if(!y)throw new TypeError("invalid suite type");if(typeof b=="string"&&(b=e.from(b)),y.mode!=="GCM"&&b.length!==y.iv)throw new TypeError("invalid iv length "+b.length);if(typeof p=="string"&&(p=e.from(p)),p.length!==y.key/8)throw new TypeError("invalid key length "+p.length);return y.type==="stream"?new i(y.module,p,b,!0):y.type==="auth"?new d(y.module,p,b,!0):new o(y.module,p,b)}function h(l,p){var b=t[l.toLowerCase()];if(!b)throw new TypeError("invalid suite type");var y=s(p,!1,b.key,b.iv);return c(l,y.key,y.iv)}return Cr.createDecipher=h,Cr.createDecipheriv=c,Cr}var pu;function ms(){if(pu)return bt;pu=1;var d=Ol(),e=Pl(),t=wd;function i(){return Object.keys(t)}return bt.createCipher=bt.Cipher=d.createCipher,bt.createCipheriv=bt.Cipheriv=d.createCipheriv,bt.createDecipher=bt.Decipher=e.createDecipher,bt.createDecipheriv=bt.Decipheriv=e.createDecipheriv,bt.listCiphers=bt.getCiphers=i,bt}var Fa={},bu;function Nl(){return bu||(bu=1,(function(d){d["des-ecb"]={key:8,iv:0},d["des-cbc"]=d.des={key:8,iv:8},d["des-ede3-cbc"]=d.des3={key:24,iv:8},d["des-ede3"]={key:24,iv:0},d["des-ede-cbc"]={key:16,iv:8},d["des-ede"]={key:16,iv:0}})(Fa)),Fa}var vu;function kl(){if(vu)return pt;vu=1;var d=yl(),e=ms(),t=vs(),i=Nl(),u=Jr();function r(n,c){n=n.toLowerCase();var h,l;if(t[n])h=t[n].key,l=t[n].iv;else if(i[n])h=i[n].key*8,l=i[n].iv;else throw new TypeError("invalid suite type");var p=u(c,!1,h,l);return a(n,p.key,p.iv)}function s(n,c){n=n.toLowerCase();var h,l;if(t[n])h=t[n].key,l=t[n].iv;else if(i[n])h=i[n].key*8,l=i[n].iv;else throw new TypeError("invalid suite type");var p=u(c,!1,h,l);return o(n,p.key,p.iv)}function a(n,c,h){if(n=n.toLowerCase(),t[n])return e.createCipheriv(n,c,h);if(i[n])return new d({key:c,iv:h,mode:n});throw new TypeError("invalid suite type")}function o(n,c,h){if(n=n.toLowerCase(),t[n])return e.createDecipheriv(n,c,h);if(i[n])return new d({key:c,iv:h,mode:n,decrypt:!0});throw new TypeError("invalid suite type")}function f(){return Object.keys(i).concat(e.getCiphers())}return pt.createCipher=pt.Cipher=r,pt.createCipheriv=pt.Cipheriv=a,pt.createDecipher=pt.Decipher=s,pt.createDecipheriv=pt.Decipheriv=o,pt.listCiphers=pt.getCiphers=f,pt}var Mt={},Ua,mu;function xd(){if(mu)return Ua;mu=1;var d=Te(),e=yr();function t(i){this.rand=i||new e.Rand}return Ua=t,t.create=function(u){return new t(u)},t.prototype._randbelow=function(u){var r=u.bitLength(),s=Math.ceil(r/8);do var a=new d(this.rand.generate(s));while(a.cmp(u)>=0);return a},t.prototype._randrange=function(u,r){var s=r.sub(u);return u.add(this._randbelow(s))},t.prototype.test=function(u,r,s){var a=u.bitLength(),o=d.mont(u),f=new d(1).toRed(o);r||(r=Math.max(1,a/48|0));for(var n=u.subn(1),c=0;!n.testn(c);c++);for(var h=u.shrn(c),l=n.toRed(o),p=!0;r>0;r--){var b=this._randrange(new d(2),n);s&&s(b);var y=b.toRed(o).redPow(h);if(!(y.cmp(f)===0||y.cmp(l)===0)){for(var v=1;v<c;v++){if(y=y.redSqr(),y.cmp(f)===0)return!1;if(y.cmp(l)===0)break}if(v===c)return!1}}return p},t.prototype.getDivisor=function(u,r){var s=u.bitLength(),a=d.mont(u),o=new d(1).toRed(a);r||(r=Math.max(1,s/48|0));for(var f=u.subn(1),n=0;!f.testn(n);n++);for(var c=u.shrn(n),h=f.toRed(a);r>0;r--){var l=this._randrange(new d(2),f),p=u.gcd(l);if(p.cmpn(1)!==0)return p;var b=l.toRed(a).redPow(c);if(!(b.cmp(o)===0||b.cmp(h)===0)){for(var y=1;y<n;y++){if(b=b.redSqr(),b.cmp(o)===0)return b.fromRed().subn(1).gcd(u);if(b.cmp(h)===0)break}if(y===n)return b=b.redSqr(),b.fromRed().subn(1).gcd(u)}}return!1},Ua}var qa,yu;function Ed(){if(yu)return qa;yu=1;var d=Ht();qa=y,y.simpleSieve=p,y.fermatTest=b;var e=Te(),t=new e(24),i=xd(),u=new i,r=new e(1),s=new e(2),a=new e(5);new e(16),new e(8);var o=new e(10),f=new e(3);new e(7);var n=new e(11),c=new e(4);new e(12);var h=null;function l(){if(h!==null)return h;var v=1048576,g=[];g[0]=2;for(var x=1,B=3;B<v;B+=2){for(var R=Math.ceil(Math.sqrt(B)),T=0;T<x&&g[T]<=R&&B%g[T]!==0;T++);x!==T&&g[T]<=R||(g[x++]=B)}return h=g,g}function p(v){for(var g=l(),x=0;x<g.length;x++)if(v.modn(g[x])===0)return v.cmpn(g[x])===0;return!0}function b(v){var g=e.mont(v);return s.toRed(g).redPow(v.subn(1)).fromRed().cmpn(1)===0}function y(v,g){if(v<16)return g===2||g===5?new e([140,123]):new e([140,39]);g=new e(g);for(var x,B;;){for(x=new e(d(Math.ceil(v/8)));x.bitLength()>v;)x.ishrn(1);if(x.isEven()&&x.iadd(r),x.testn(1)||x.iadd(s),g.cmp(s)){if(!g.cmp(a))for(;x.mod(o).cmp(f);)x.iadd(c)}else for(;x.mod(t).cmp(n);)x.iadd(c);if(B=x.shrn(1),p(B)&&p(x)&&b(B)&&b(x)&&u.test(B)&&u.test(x))return x}}return qa}const Ml={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},Cl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},Tl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},Ll={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},Dl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},Fl={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},Ul={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},ql={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},Hl={modp1:Ml,modp2:Cl,modp5:Tl,modp14:Ll,modp15:Dl,modp16:Fl,modp17:Ul,modp18:ql};var Ha,gu;function Kl(){if(gu)return Ha;gu=1;var d=Te(),e=xd(),t=new e,i=new d(24),u=new d(11),r=new d(10),s=new d(3),a=new d(7),o=Ed(),f=Ht();Ha=p;function n(y,v){return v=v||"utf8",Buffer.isBuffer(y)||(y=new Buffer(y,v)),this._pub=new d(y),this}function c(y,v){return v=v||"utf8",Buffer.isBuffer(y)||(y=new Buffer(y,v)),this._priv=new d(y),this}var h={};function l(y,v){var g=v.toString("hex"),x=[g,y.toString(16)].join("_");if(x in h)return h[x];var B=0;if(y.isEven()||!o.simpleSieve||!o.fermatTest(y)||!t.test(y))return B+=1,g==="02"||g==="05"?B+=8:B+=4,h[x]=B,B;t.test(y.shrn(1))||(B+=2);var R;switch(g){case"02":y.mod(i).cmp(u)&&(B+=8);break;case"05":R=y.mod(r),R.cmp(s)&&R.cmp(a)&&(B+=8);break;default:B+=4}return h[x]=B,B}function p(y,v,g){this.setGenerator(v),this.__prime=new d(y),this._prime=d.mont(this.__prime),this._primeLen=y.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,g?(this.setPublicKey=n,this.setPrivateKey=c):this._primeCode=8}Object.defineProperty(p.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=l(this.__prime,this.__gen)),this._primeCode}}),p.prototype.generateKeys=function(){return this._priv||(this._priv=new d(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},p.prototype.computeSecret=function(y){y=new d(y),y=y.toRed(this._prime);var v=y.redPow(this._priv).fromRed(),g=new Buffer(v.toArray()),x=this.getPrime();if(g.length<x.length){var B=new Buffer(x.length-g.length);B.fill(0),g=Buffer.concat([B,g])}return g},p.prototype.getPublicKey=function(v){return b(this._pub,v)},p.prototype.getPrivateKey=function(v){return b(this._priv,v)},p.prototype.getPrime=function(y){return b(this.__prime,y)},p.prototype.getGenerator=function(y){return b(this._gen,y)},p.prototype.setGenerator=function(y,v){return v=v||"utf8",Buffer.isBuffer(y)||(y=new Buffer(y,v)),this.__gen=y,this._gen=new d(y),this};function b(y,v){var g=new Buffer(y.toArray());return v?g.toString(v):g}return Ha}var wu;function jl(){if(wu)return Mt;wu=1;var d=Ed(),e=Hl,t=Kl();function i(s){var a=new Buffer(e[s].prime,"hex"),o=new Buffer(e[s].gen,"hex");return new t(a,o)}var u={binary:!0,hex:!0,base64:!0};function r(s,a,o,f){return Buffer.isBuffer(a)||u[a]===void 0?r(s,"binary",a,o):(a=a||"binary",f=f||"binary",o=o||new Buffer([2]),Buffer.isBuffer(o)||(o=new Buffer(o,f)),typeof s=="number"?new t(d(s,o),o,!0):(Buffer.isBuffer(s)||(s=new Buffer(s,a)),new t(s,o,!0)))}return Mt.DiffieHellmanGroup=Mt.createDiffieHellmanGroup=Mt.getDiffieHellman=i,Mt.createDiffieHellman=Mt.DiffieHellman=r,Mt}var Qt={exports:{}},Ka,_u;function ys(){if(_u)return Ka;_u=1;var d=Te(),e=Ht(),t=_e().Buffer;function i(s){var a=s.modulus.byteLength(),o;do o=new d(e(a));while(o.cmp(s.modulus)>=0||!o.umod(s.prime1)||!o.umod(s.prime2));return o}function u(s){var a=i(s),o=a.toRed(d.mont(s.modulus)).redPow(new d(s.publicExponent)).fromRed();return{blinder:o,unblinder:a.invm(s.modulus)}}function r(s,a){var o=u(a),f=a.modulus.byteLength(),n=new d(s).mul(o.blinder).umod(a.modulus),c=n.toRed(d.mont(a.prime1)),h=n.toRed(d.mont(a.prime2)),l=a.coefficient,p=a.prime1,b=a.prime2,y=c.redPow(a.exponent1).fromRed(),v=h.redPow(a.exponent2).fromRed(),g=y.isub(v).imul(l).umod(p).imul(b);return v.iadd(g).imul(o.unblinder).umod(a.modulus).toArrayLike(t,"be",f)}return r.getr=i,Ka=r,Ka}var ja={};const zl="6.6.1",Vl={version:zl};var za={},Su;function St(){return Su||(Su=1,(function(d){var e=d,t=Te(),i=lt(),u=fs();e.assert=i,e.toArray=u.toArray,e.zero2=u.zero2,e.toHex=u.toHex,e.encode=u.encode;function r(n,c,h){var l=new Array(Math.max(n.bitLength(),h)+1),p;for(p=0;p<l.length;p+=1)l[p]=0;var b=1<<c+1,y=n.clone();for(p=0;p<l.length;p++){var v,g=y.andln(b-1);y.isOdd()?(g>(b>>1)-1?v=(b>>1)-g:v=g,y.isubn(v)):v=0,l[p]=v,y.iushrn(1)}return l}e.getNAF=r;function s(n,c){var h=[[],[]];n=n.clone(),c=c.clone();for(var l=0,p=0,b;n.cmpn(-l)>0||c.cmpn(-p)>0;){var y=n.andln(3)+l&3,v=c.andln(3)+p&3;y===3&&(y=-1),v===3&&(v=-1);var g;(y&1)===0?g=0:(b=n.andln(7)+l&7,(b===3||b===5)&&v===2?g=-y:g=y),h[0].push(g);var x;(v&1)===0?x=0:(b=c.andln(7)+p&7,(b===3||b===5)&&y===2?x=-v:x=v),h[1].push(x),2*l===g+1&&(l=1-l),2*p===x+1&&(p=1-p),n.iushrn(1),c.iushrn(1)}return h}e.getJSF=s;function a(n,c,h){var l="_"+c;n.prototype[c]=function(){return this[l]!==void 0?this[l]:this[l]=h.call(this)}}e.cachedProperty=a;function o(n){return typeof n=="string"?e.toArray(n,"hex"):n}e.parseBytes=o;function f(n){return new t(n,"hex","le")}e.intFromLE=f})(za)),za}var Va={},Ga,xu;function Xr(){if(xu)return Ga;xu=1;var d=Te(),e=St(),t=e.getNAF,i=e.getJSF,u=e.assert;function r(a,o){this.type=a,this.p=new d(o.p,16),this.red=o.prime?d.red(o.prime):d.mont(this.p),this.zero=new d(0).toRed(this.red),this.one=new d(1).toRed(this.red),this.two=new d(2).toRed(this.red),this.n=o.n&&new d(o.n,16),this.g=o.g&&this.pointFromJSON(o.g,o.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))}Ga=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(o,f){u(o.precomputed);var n=o._getDoubles(),c=t(f,1,this._bitLength),h=(1<<n.step+1)-(n.step%2===0?2:1);h/=3;var l=[],p,b;for(p=0;p<c.length;p+=n.step){b=0;for(var y=p+n.step-1;y>=p;y--)b=(b<<1)+c[y];l.push(b)}for(var v=this.jpoint(null,null,null),g=this.jpoint(null,null,null),x=h;x>0;x--){for(p=0;p<l.length;p++)b=l[p],b===x?g=g.mixedAdd(n.points[p]):b===-x&&(g=g.mixedAdd(n.points[p].neg()));v=v.add(g)}return v.toP()},r.prototype._wnafMul=function(o,f){var n=4,c=o._getNAFPoints(n);n=c.wnd;for(var h=c.points,l=t(f,n,this._bitLength),p=this.jpoint(null,null,null),b=l.length-1;b>=0;b--){for(var y=0;b>=0&&l[b]===0;b--)y++;if(b>=0&&y++,p=p.dblp(y),b<0)break;var v=l[b];u(v!==0),o.type==="affine"?v>0?p=p.mixedAdd(h[v-1>>1]):p=p.mixedAdd(h[-v-1>>1].neg()):v>0?p=p.add(h[v-1>>1]):p=p.add(h[-v-1>>1].neg())}return o.type==="affine"?p.toP():p},r.prototype._wnafMulAdd=function(o,f,n,c,h){var l=this._wnafT1,p=this._wnafT2,b=this._wnafT3,y=0,v,g,x;for(v=0;v<c;v++){x=f[v];var B=x._getNAFPoints(o);l[v]=B.wnd,p[v]=B.points}for(v=c-1;v>=1;v-=2){var R=v-1,T=v;if(l[R]!==1||l[T]!==1){b[R]=t(n[R],l[R],this._bitLength),b[T]=t(n[T],l[T],this._bitLength),y=Math.max(b[R].length,y),y=Math.max(b[T].length,y);continue}var j=[f[R],null,null,f[T]];f[R].y.cmp(f[T].y)===0?(j[1]=f[R].add(f[T]),j[2]=f[R].toJ().mixedAdd(f[T].neg())):f[R].y.cmp(f[T].y.redNeg())===0?(j[1]=f[R].toJ().mixedAdd(f[T]),j[2]=f[R].add(f[T].neg())):(j[1]=f[R].toJ().mixedAdd(f[T]),j[2]=f[R].toJ().mixedAdd(f[T].neg()));var G=[-3,-1,-5,-7,0,7,5,1,3],z=i(n[R],n[T]);for(y=Math.max(z[0].length,y),b[R]=new Array(y),b[T]=new Array(y),g=0;g<y;g++){var te=z[0][g]|0,ne=z[1][g]|0;b[R][g]=G[(te+1)*3+(ne+1)],b[T][g]=0,p[R]=j}}var $=this.jpoint(null,null,null),N=this._wnafT4;for(v=y;v>=0;v--){for(var m=0;v>=0;){var E=!0;for(g=0;g<c;g++)N[g]=b[g][v]|0,N[g]!==0&&(E=!1);if(!E)break;m++,v--}if(v>=0&&m++,$=$.dblp(m),v<0)break;for(g=0;g<c;g++){var O=N[g];O!==0&&(O>0?x=p[g][O-1>>1]:O<0&&(x=p[g][-O-1>>1].neg()),x.type==="affine"?$=$.mixedAdd(x):$=$.add(x))}}for(v=0;v<c;v++)p[v]=null;return h?$:$.toP()};function s(a,o){this.curve=a,this.type=o,this.precomputed=null}return r.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},r.prototype.decodePoint=function(o,f){o=e.toArray(o,f);var n=this.p.byteLength();if((o[0]===4||o[0]===6||o[0]===7)&&o.length-1===2*n){o[0]===6?u(o[o.length-1]%2===0):o[0]===7&&u(o[o.length-1]%2===1);var c=this.point(o.slice(1,1+n),o.slice(1+n,1+2*n));return c}else if((o[0]===2||o[0]===3)&&o.length-1===n)return this.pointFromX(o.slice(1,1+n),o[0]===3);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(o){return this.encode(o,!0)},s.prototype._encode=function(o){var f=this.curve.p.byteLength(),n=this.getX().toArray("be",f);return o?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",f))},s.prototype.encode=function(o,f){return e.encode(this._encode(f),o)},s.prototype.precompute=function(o){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,o),f.beta=this._getBeta(),this.precomputed=f,this},s.prototype._hasDoubles=function(o){if(!this.precomputed)return!1;var f=this.precomputed.doubles;return f?f.points.length>=Math.ceil((o.bitLength()+1)/f.step):!1},s.prototype._getDoubles=function(o,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],c=this,h=0;h<f;h+=o){for(var l=0;l<o;l++)c=c.dbl();n.push(c)}return{step:o,points:n}},s.prototype._getNAFPoints=function(o){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var f=[this],n=(1<<o)-1,c=n===1?null:this.dbl(),h=1;h<n;h++)f[h]=f[h-1].add(c);return{wnd:o,points:f}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(o){for(var f=this,n=0;n<o;n++)f=f.dbl();return f},Ga}var $a,Eu;function Gl(){if(Eu)return $a;Eu=1;var d=St(),e=Te(),t=be(),i=Xr(),u=d.assert;function r(o){i.call(this,"short",o),this.a=new e(o.a,16).toRed(this.red),this.b=new e(o.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(o),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}t(r,i),$a=r,r.prototype._getEndomorphism=function(f){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var n,c;if(f.beta)n=new e(f.beta,16).toRed(this.red);else{var h=this._getEndoRoots(this.p);n=h[0].cmp(h[1])<0?h[0]:h[1],n=n.toRed(this.red)}if(f.lambda)c=new e(f.lambda,16);else{var l=this._getEndoRoots(this.n);this.g.mul(l[0]).x.cmp(this.g.x.redMul(n))===0?c=l[0]:(c=l[1],u(this.g.mul(c).x.cmp(this.g.x.redMul(n))===0))}var p;return f.basis?p=f.basis.map(function(b){return{a:new e(b.a,16),b:new e(b.b,16)}}):p=this._getEndoBasis(c),{beta:n,lambda:c,basis:p}}},r.prototype._getEndoRoots=function(f){var n=f===this.p?this.red:e.mont(f),c=new e(2).toRed(n).redInvm(),h=c.redNeg(),l=new e(3).toRed(n).redNeg().redSqrt().redMul(c),p=h.redAdd(l).fromRed(),b=h.redSub(l).fromRed();return[p,b]},r.prototype._getEndoBasis=function(f){for(var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=f,h=this.n.clone(),l=new e(1),p=new e(0),b=new e(0),y=new e(1),v,g,x,B,R,T,j,G=0,z,te;c.cmpn(0)!==0;){var ne=h.div(c);z=h.sub(ne.mul(c)),te=b.sub(ne.mul(l));var $=y.sub(ne.mul(p));if(!x&&z.cmp(n)<0)v=j.neg(),g=l,x=z.neg(),B=te;else if(x&&++G===2)break;j=z,h=c,c=z,b=l,l=te,y=p,p=$}R=z.neg(),T=te;var N=x.sqr().add(B.sqr()),m=R.sqr().add(T.sqr());return m.cmp(N)>=0&&(R=v,T=g),x.negative&&(x=x.neg(),B=B.neg()),R.negative&&(R=R.neg(),T=T.neg()),[{a:x,b:B},{a:R,b:T}]},r.prototype._endoSplit=function(f){var n=this.endo.basis,c=n[0],h=n[1],l=h.b.mul(f).divRound(this.n),p=c.b.neg().mul(f).divRound(this.n),b=l.mul(c.a),y=p.mul(h.a),v=l.mul(c.b),g=p.mul(h.b),x=f.sub(b).sub(y),B=v.add(g).neg();return{k1:x,k2:B}},r.prototype.pointFromX=function(f,n){f=new e(f,16),f.red||(f=f.toRed(this.red));var c=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),h=c.redSqrt();if(h.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var l=h.fromRed().isOdd();return(n&&!l||!n&&l)&&(h=h.redNeg()),this.point(f,h)},r.prototype.validate=function(f){if(f.inf)return!0;var n=f.x,c=f.y,h=this.a.redMul(n),l=n.redSqr().redMul(n).redIAdd(h).redIAdd(this.b);return c.redSqr().redISub(l).cmpn(0)===0},r.prototype._endoWnafMulAdd=function(f,n,c){for(var h=this._endoWnafT1,l=this._endoWnafT2,p=0;p<f.length;p++){var b=this._endoSplit(n[p]),y=f[p],v=y._getBeta();b.k1.negative&&(b.k1.ineg(),y=y.neg(!0)),b.k2.negative&&(b.k2.ineg(),v=v.neg(!0)),h[p*2]=y,h[p*2+1]=v,l[p*2]=b.k1,l[p*2+1]=b.k2}for(var g=this._wnafMulAdd(1,h,l,p*2,c),x=0;x<p*2;x++)h[x]=null,l[x]=null;return g};function s(o,f,n,c){i.BasePoint.call(this,o,"affine"),f===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(f,16),this.y=new e(n,16),c&&(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(s,i.BasePoint),r.prototype.point=function(f,n,c){return new s(this,f,n,c)},r.prototype.pointFromJSON=function(f,n){return s.fromJSON(this,f,n)},s.prototype._getBeta=function(){if(this.curve.endo){var f=this.precomputed;if(f&&f.beta)return f.beta;var n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var c=this.curve,h=function(l){return c.point(l.x.redMul(c.endo.beta),l.y)};f.beta=n,n.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(h)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(h)}}}return n}},s.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]},s.fromJSON=function(f,n,c){typeof n=="string"&&(n=JSON.parse(n));var h=f.point(n[0],n[1],c);if(!n[2])return h;function l(b){return f.point(b[0],b[1],c)}var p=n[2];return h.precomputed={beta:null,doubles:p.doubles&&{step:p.doubles.step,points:[h].concat(p.doubles.points.map(l))},naf:p.naf&&{wnd:p.naf.wnd,points:[h].concat(p.naf.points.map(l))}},h},s.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)+">"},s.prototype.isInfinity=function(){return this.inf},s.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 n=this.y.redSub(f.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(f.x).redInvm()));var c=n.redSqr().redISub(this.x).redISub(f.x),h=n.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,h)},s.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 n=this.curve.a,c=this.x.redSqr(),h=f.redInvm(),l=c.redAdd(c).redIAdd(c).redIAdd(n).redMul(h),p=l.redSqr().redISub(this.x.redAdd(this.x)),b=l.redMul(this.x.redSub(p)).redISub(this.y);return this.curve.point(p,b)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.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)},s.prototype.mulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l):this.curve._wnafMulAdd(1,h,l,2)},s.prototype.jmulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l,!0):this.curve._wnafMulAdd(1,h,l,2,!0)},s.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)},s.prototype.neg=function(f){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var c=this.precomputed,h=function(l){return l.neg()};n.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(h)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(h)}}}return n},s.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 a(o,f,n,c){i.BasePoint.call(this,o,"jacobian"),f===null&&n===null&&c===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(n,16),this.z=new e(c,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(a,i.BasePoint),r.prototype.jpoint=function(f,n,c){return new a(this,f,n,c)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),n=f.redSqr(),c=this.x.redMul(n),h=this.y.redMul(n).redMul(f);return this.curve.point(c,h)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var n=f.z.redSqr(),c=this.z.redSqr(),h=this.x.redMul(n),l=f.x.redMul(c),p=this.y.redMul(n.redMul(f.z)),b=f.y.redMul(c.redMul(this.z)),y=h.redSub(l),v=p.redSub(b);if(y.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=y.redSqr(),x=g.redMul(y),B=h.redMul(g),R=v.redSqr().redIAdd(x).redISub(B).redISub(B),T=v.redMul(B.redISub(R)).redISub(p.redMul(x)),j=this.z.redMul(f.z).redMul(y);return this.curve.jpoint(R,T,j)},a.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var n=this.z.redSqr(),c=this.x,h=f.x.redMul(n),l=this.y,p=f.y.redMul(n).redMul(this.z),b=c.redSub(h),y=l.redSub(p);if(b.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=b.redSqr(),g=v.redMul(b),x=c.redMul(v),B=y.redSqr().redIAdd(g).redISub(x).redISub(x),R=y.redMul(x.redISub(B)).redISub(l.redMul(g)),T=this.z.redMul(b);return this.curve.jpoint(B,R,T)},a.prototype.dblp=function(f){if(f===0)return this;if(this.isInfinity())return this;if(!f)return this.dbl();var n;if(this.curve.zeroA||this.curve.threeA){var c=this;for(n=0;n<f;n++)c=c.dbl();return c}var h=this.curve.a,l=this.curve.tinv,p=this.x,b=this.y,y=this.z,v=y.redSqr().redSqr(),g=b.redAdd(b);for(n=0;n<f;n++){var x=p.redSqr(),B=g.redSqr(),R=B.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(h.redMul(v)),j=p.redMul(B),G=T.redSqr().redISub(j.redAdd(j)),z=j.redISub(G),te=T.redMul(z);te=te.redIAdd(te).redISub(R);var ne=g.redMul(y);n+1<f&&(v=v.redMul(R)),p=G,y=ne,g=te}return this.curve.jpoint(p,g.redMul(l),y)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),p=l.redSqr(),b=this.x.redAdd(l).redSqr().redISub(h).redISub(p);b=b.redIAdd(b);var y=h.redAdd(h).redIAdd(h),v=y.redSqr().redISub(b).redISub(b),g=p.redIAdd(p);g=g.redIAdd(g),g=g.redIAdd(g),f=v,n=y.redMul(b.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),B=this.y.redSqr(),R=B.redSqr(),T=this.x.redAdd(B).redSqr().redISub(x).redISub(R);T=T.redIAdd(T);var j=x.redAdd(x).redIAdd(x),G=j.redSqr(),z=R.redIAdd(R);z=z.redIAdd(z),z=z.redIAdd(z),f=G.redISub(T).redISub(T),n=j.redMul(T.redISub(f)).redISub(z),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(f,n,c)},a.prototype._threeDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),p=l.redSqr(),b=this.x.redAdd(l).redSqr().redISub(h).redISub(p);b=b.redIAdd(b);var y=h.redAdd(h).redIAdd(h).redIAdd(this.curve.a),v=y.redSqr().redISub(b).redISub(b);f=v;var g=p.redIAdd(p);g=g.redIAdd(g),g=g.redIAdd(g),n=y.redMul(b.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),B=this.y.redSqr(),R=this.x.redMul(B),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var j=R.redIAdd(R);j=j.redIAdd(j);var G=j.redAdd(j);f=T.redSqr().redISub(G),c=this.y.redAdd(this.z).redSqr().redISub(B).redISub(x);var z=B.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),n=T.redMul(j.redISub(f)).redISub(z)}return this.curve.jpoint(f,n,c)},a.prototype._dbl=function(){var f=this.curve.a,n=this.x,c=this.y,h=this.z,l=h.redSqr().redSqr(),p=n.redSqr(),b=c.redSqr(),y=p.redAdd(p).redIAdd(p).redIAdd(f.redMul(l)),v=n.redAdd(n);v=v.redIAdd(v);var g=v.redMul(b),x=y.redSqr().redISub(g.redAdd(g)),B=g.redISub(x),R=b.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var T=y.redMul(B).redISub(R),j=c.redAdd(c).redMul(h);return this.curve.jpoint(x,T,j)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),n=this.y.redSqr(),c=this.z.redSqr(),h=n.redSqr(),l=f.redAdd(f).redIAdd(f),p=l.redSqr(),b=this.x.redAdd(n).redSqr().redISub(f).redISub(h);b=b.redIAdd(b),b=b.redAdd(b).redIAdd(b),b=b.redISub(p);var y=b.redSqr(),v=h.redIAdd(h);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var g=l.redIAdd(b).redSqr().redISub(p).redISub(y).redISub(v),x=n.redMul(g);x=x.redIAdd(x),x=x.redIAdd(x);var B=this.x.redMul(y).redISub(x);B=B.redIAdd(B),B=B.redIAdd(B);var R=this.y.redMul(g.redMul(v.redISub(g)).redISub(b.redMul(y)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var T=this.z.redAdd(b).redSqr().redISub(c).redISub(y);return this.curve.jpoint(B,R,T)},a.prototype.mul=function(f,n){return f=new e(f,n),this.curve._wnafMul(this,f)},a.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var n=this.z.redSqr(),c=f.z.redSqr();if(this.x.redMul(c).redISub(f.x.redMul(n)).cmpn(0)!==0)return!1;var h=n.redMul(this.z),l=c.redMul(f.z);return this.y.redMul(l).redISub(f.y.redMul(h)).cmpn(0)===0},a.prototype.eqXToP=function(f){var n=this.z.redSqr(),c=f.toRed(this.curve.red).redMul(n);if(this.x.cmp(c)===0)return!0;for(var h=f.clone(),l=this.curve.redN.redMul(n);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(l),this.x.cmp(c)===0)return!0}},a.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)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},$a}var Wa,Bu;function $l(){if(Bu)return Wa;Bu=1;var d=Te(),e=be(),t=Xr(),i=St();function u(s){t.call(this,"mont",s),this.a=new d(s.a,16).toRed(this.red),this.b=new d(s.b,16).toRed(this.red),this.i4=new d(4).toRed(this.red).redInvm(),this.two=new d(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}e(u,t),Wa=u,u.prototype.validate=function(a){var o=a.normalize().x,f=o.redSqr(),n=f.redMul(o).redAdd(f.redMul(this.a)).redAdd(o),c=n.redSqrt();return c.redSqr().cmp(n)===0};function r(s,a,o){t.BasePoint.call(this,s,"projective"),a===null&&o===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new d(a,16),this.z=new d(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return e(r,t.BasePoint),u.prototype.decodePoint=function(a,o){return this.point(i.toArray(a,o),1)},u.prototype.point=function(a,o){return new r(this,a,o)},u.prototype.pointFromJSON=function(a){return r.fromJSON(this,a)},r.prototype.precompute=function(){},r.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},r.fromJSON=function(a,o){return new r(a,o[0],o[1]||a.one)},r.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)+">"},r.prototype.isInfinity=function(){return this.z.cmpn(0)===0},r.prototype.dbl=function(){var a=this.x.redAdd(this.z),o=a.redSqr(),f=this.x.redSub(this.z),n=f.redSqr(),c=o.redSub(n),h=o.redMul(n),l=c.redMul(n.redAdd(this.curve.a24.redMul(c)));return this.curve.point(h,l)},r.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.diffAdd=function(a,o){var f=this.x.redAdd(this.z),n=this.x.redSub(this.z),c=a.x.redAdd(a.z),h=a.x.redSub(a.z),l=h.redMul(f),p=c.redMul(n),b=o.z.redMul(l.redAdd(p).redSqr()),y=o.x.redMul(l.redISub(p).redSqr());return this.curve.point(b,y)},r.prototype.mul=function(a){for(var o=a.clone(),f=this,n=this.curve.point(null,null),c=this,h=[];o.cmpn(0)!==0;o.iushrn(1))h.push(o.andln(1));for(var l=h.length-1;l>=0;l--)h[l]===0?(f=f.diffAdd(n,c),n=n.dbl()):(n=f.diffAdd(n,c),f=f.dbl());return n},r.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.eq=function(a){return this.getX().cmp(a.getX())===0},r.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},r.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Wa}var Ya,Iu;function Wl(){if(Iu)return Ya;Iu=1;var d=St(),e=Te(),t=be(),i=Xr(),u=d.assert;function r(a){this.twisted=(a.a|0)!==1,this.mOneA=this.twisted&&(a.a|0)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new e(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new e(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new e(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),u(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(a.c|0)===1}t(r,i),Ya=r,r.prototype._mulA=function(o){return this.mOneA?o.redNeg():this.a.redMul(o)},r.prototype._mulC=function(o){return this.oneC?o:this.c.redMul(o)},r.prototype.jpoint=function(o,f,n,c){return this.point(o,f,n,c)},r.prototype.pointFromX=function(o,f){o=new e(o,16),o.red||(o=o.toRed(this.red));var n=o.redSqr(),c=this.c2.redSub(this.a.redMul(n)),h=this.one.redSub(this.c2.redMul(this.d).redMul(n)),l=c.redMul(h.redInvm()),p=l.redSqrt();if(p.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");var b=p.fromRed().isOdd();return(f&&!b||!f&&b)&&(p=p.redNeg()),this.point(o,p)},r.prototype.pointFromY=function(o,f){o=new e(o,16),o.red||(o=o.toRed(this.red));var n=o.redSqr(),c=n.redSub(this.c2),h=n.redMul(this.d).redMul(this.c2).redSub(this.a),l=c.redMul(h.redInvm());if(l.cmp(this.zero)===0){if(f)throw new Error("invalid point");return this.point(this.zero,o)}var p=l.redSqrt();if(p.redSqr().redSub(l).cmp(this.zero)!==0)throw new Error("invalid point");return p.fromRed().isOdd()!==f&&(p=p.redNeg()),this.point(p,o)},r.prototype.validate=function(o){if(o.isInfinity())return!0;o.normalize();var f=o.x.redSqr(),n=o.y.redSqr(),c=f.redMul(this.a).redAdd(n),h=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(n)));return c.cmp(h)===0};function s(a,o,f,n,c){i.BasePoint.call(this,a,"projective"),o===null&&f===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new e(o,16),this.y=new e(f,16),this.z=n?new e(n,16):this.curve.one,this.t=c&&new e(c,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 t(s,i.BasePoint),r.prototype.pointFromJSON=function(o){return s.fromJSON(this,o)},r.prototype.point=function(o,f,n,c){return new s(this,o,f,n,c)},s.fromJSON=function(o,f){return new s(o,f[0],f[1],f[2])},s.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)+">"},s.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},s.prototype._extDbl=function(){var o=this.x.redSqr(),f=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var c=this.curve._mulA(o),h=this.x.redAdd(this.y).redSqr().redISub(o).redISub(f),l=c.redAdd(f),p=l.redSub(n),b=c.redSub(f),y=h.redMul(p),v=l.redMul(b),g=h.redMul(b),x=p.redMul(l);return this.curve.point(y,v,x,g)},s.prototype._projDbl=function(){var o=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),n=this.y.redSqr(),c,h,l,p,b,y;if(this.curve.twisted){p=this.curve._mulA(f);var v=p.redAdd(n);this.zOne?(c=o.redSub(f).redSub(n).redMul(v.redSub(this.curve.two)),h=v.redMul(p.redSub(n)),l=v.redSqr().redSub(v).redSub(v)):(b=this.z.redSqr(),y=v.redSub(b).redISub(b),c=o.redSub(f).redISub(n).redMul(y),h=v.redMul(p.redSub(n)),l=v.redMul(y))}else p=f.redAdd(n),b=this.curve._mulC(this.z).redSqr(),y=p.redSub(b).redSub(b),c=this.curve._mulC(o.redISub(p)).redMul(y),h=this.curve._mulC(p).redMul(f.redISub(n)),l=p.redMul(y);return this.curve.point(c,h,l)},s.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},s.prototype._extAdd=function(o){var f=this.y.redSub(this.x).redMul(o.y.redSub(o.x)),n=this.y.redAdd(this.x).redMul(o.y.redAdd(o.x)),c=this.t.redMul(this.curve.dd).redMul(o.t),h=this.z.redMul(o.z.redAdd(o.z)),l=n.redSub(f),p=h.redSub(c),b=h.redAdd(c),y=n.redAdd(f),v=l.redMul(p),g=b.redMul(y),x=l.redMul(y),B=p.redMul(b);return this.curve.point(v,g,B,x)},s.prototype._projAdd=function(o){var f=this.z.redMul(o.z),n=f.redSqr(),c=this.x.redMul(o.x),h=this.y.redMul(o.y),l=this.curve.d.redMul(c).redMul(h),p=n.redSub(l),b=n.redAdd(l),y=this.x.redAdd(this.y).redMul(o.x.redAdd(o.y)).redISub(c).redISub(h),v=f.redMul(p).redMul(y),g,x;return this.curve.twisted?(g=f.redMul(b).redMul(h.redSub(this.curve._mulA(c))),x=p.redMul(b)):(g=f.redMul(b).redMul(h.redSub(c)),x=this.curve._mulC(p).redMul(b)),this.curve.point(v,g,x)},s.prototype.add=function(o){return this.isInfinity()?o:o.isInfinity()?this:this.curve.extended?this._extAdd(o):this._projAdd(o)},s.prototype.mul=function(o){return this._hasDoubles(o)?this.curve._fixedNafMul(this,o):this.curve._wnafMul(this,o)},s.prototype.mulAdd=function(o,f,n){return this.curve._wnafMulAdd(1,[this,f],[o,n],2,!1)},s.prototype.jmulAdd=function(o,f,n){return this.curve._wnafMulAdd(1,[this,f],[o,n],2,!0)},s.prototype.normalize=function(){if(this.zOne)return this;var o=this.z.redInvm();return this.x=this.x.redMul(o),this.y=this.y.redMul(o),this.t&&(this.t=this.t.redMul(o)),this.z=this.curve.one,this.zOne=!0,this},s.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},s.prototype.getX=function(){return this.normalize(),this.x.fromRed()},s.prototype.getY=function(){return this.normalize(),this.y.fromRed()},s.prototype.eq=function(o){return this===o||this.getX().cmp(o.getX())===0&&this.getY().cmp(o.getY())===0},s.prototype.eqXToP=function(o){var f=o.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;for(var n=o.clone(),c=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(c),this.x.cmp(f)===0)return!0}},s.prototype.toP=s.prototype.normalize,s.prototype.mixedAdd=s.prototype.add,Ya}var Ru;function Bd(){return Ru||(Ru=1,(function(d){var e=d;e.base=Xr(),e.short=Gl(),e.mont=$l(),e.edwards=Wl()})(Va)),Va}var Ja={},Xa={},Me={},Au;function Rt(){if(Au)return Me;Au=1;var d=lt(),e=be();Me.inherits=e;function t($,N){return($.charCodeAt(N)&64512)!==55296||N<0||N+1>=$.length?!1:($.charCodeAt(N+1)&64512)===56320}function i($,N){if(Array.isArray($))return $.slice();if(!$)return[];var m=[];if(typeof $=="string")if(N){if(N==="hex")for($=$.replace(/[^a-z0-9]+/ig,""),$.length%2!==0&&($="0"+$),O=0;O<$.length;O+=2)m.push(parseInt($[O]+$[O+1],16))}else for(var E=0,O=0;O<$.length;O++){var I=$.charCodeAt(O);I<128?m[E++]=I:I<2048?(m[E++]=I>>6|192,m[E++]=I&63|128):t($,O)?(I=65536+((I&1023)<<10)+($.charCodeAt(++O)&1023),m[E++]=I>>18|240,m[E++]=I>>12&63|128,m[E++]=I>>6&63|128,m[E++]=I&63|128):(m[E++]=I>>12|224,m[E++]=I>>6&63|128,m[E++]=I&63|128)}else for(O=0;O<$.length;O++)m[O]=$[O]|0;return m}Me.toArray=i;function u($){for(var N="",m=0;m<$.length;m++)N+=a($[m].toString(16));return N}Me.toHex=u;function r($){var N=$>>>24|$>>>8&65280|$<<8&16711680|($&255)<<24;return N>>>0}Me.htonl=r;function s($,N){for(var m="",E=0;E<$.length;E++){var O=$[E];N==="little"&&(O=r(O)),m+=o(O.toString(16))}return m}Me.toHex32=s;function a($){return $.length===1?"0"+$:$}Me.zero2=a;function o($){return $.length===7?"0"+$:$.length===6?"00"+$:$.length===5?"000"+$:$.length===4?"0000"+$:$.length===3?"00000"+$:$.length===2?"000000"+$:$.length===1?"0000000"+$:$}Me.zero8=o;function f($,N,m,E){var O=m-N;d(O%4===0);for(var I=new Array(O/4),A=0,F=N;A<I.length;A++,F+=4){var K;E==="big"?K=$[F]<<24|$[F+1]<<16|$[F+2]<<8|$[F+3]:K=$[F+3]<<24|$[F+2]<<16|$[F+1]<<8|$[F],I[A]=K>>>0}return I}Me.join32=f;function n($,N){for(var m=new Array($.length*4),E=0,O=0;E<$.length;E++,O+=4){var I=$[E];N==="big"?(m[O]=I>>>24,m[O+1]=I>>>16&255,m[O+2]=I>>>8&255,m[O+3]=I&255):(m[O+3]=I>>>24,m[O+2]=I>>>16&255,m[O+1]=I>>>8&255,m[O]=I&255)}return m}Me.split32=n;function c($,N){return $>>>N|$<<32-N}Me.rotr32=c;function h($,N){return $<<N|$>>>32-N}Me.rotl32=h;function l($,N){return $+N>>>0}Me.sum32=l;function p($,N,m){return $+N+m>>>0}Me.sum32_3=p;function b($,N,m,E){return $+N+m+E>>>0}Me.sum32_4=b;function y($,N,m,E,O){return $+N+m+E+O>>>0}Me.sum32_5=y;function v($,N,m,E){var O=$[N],I=$[N+1],A=E+I>>>0,F=(A<E?1:0)+m+O;$[N]=F>>>0,$[N+1]=A}Me.sum64=v;function g($,N,m,E){var O=N+E>>>0,I=(O<N?1:0)+$+m;return I>>>0}Me.sum64_hi=g;function x($,N,m,E){var O=N+E;return O>>>0}Me.sum64_lo=x;function B($,N,m,E,O,I,A,F){var K=0,L=N;L=L+E>>>0,K+=L<N?1:0,L=L+I>>>0,K+=L<I?1:0,L=L+F>>>0,K+=L<F?1:0;var _=$+m+O+A+K;return _>>>0}Me.sum64_4_hi=B;function R($,N,m,E,O,I,A,F){var K=N+E+I+F;return K>>>0}Me.sum64_4_lo=R;function T($,N,m,E,O,I,A,F,K,L){var _=0,q=N;q=q+E>>>0,_+=q<N?1:0,q=q+I>>>0,_+=q<I?1:0,q=q+F>>>0,_+=q<F?1:0,q=q+L>>>0,_+=q<L?1:0;var fe=$+m+O+A+K+_;return fe>>>0}Me.sum64_5_hi=T;function j($,N,m,E,O,I,A,F,K,L){var _=N+E+I+F+L;return _>>>0}Me.sum64_5_lo=j;function G($,N,m){var E=N<<32-m|$>>>m;return E>>>0}Me.rotr64_hi=G;function z($,N,m){var E=$<<32-m|N>>>m;return E>>>0}Me.rotr64_lo=z;function te($,N,m){return $>>>m}Me.shr64_hi=te;function ne($,N,m){var E=$<<32-m|N>>>m;return E>>>0}return Me.shr64_lo=ne,Me}var Qa={},Ou;function br(){if(Ou)return Qa;Ou=1;var d=Rt(),e=lt();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 Qa.BlockHash=t,t.prototype.update=function(u,r){if(u=d.toArray(u,r),this.pending?this.pending=this.pending.concat(u):this.pending=u,this.pendingTotal+=u.length,this.pending.length>=this._delta8){u=this.pending;var s=u.length%this._delta8;this.pending=u.slice(u.length-s,u.length),this.pending.length===0&&(this.pending=null),u=d.join32(u,0,u.length-s,this.endian);for(var a=0;a<u.length;a+=this._delta32)this._update(u,a,a+this._delta32)}return this},t.prototype.digest=function(u){return this.update(this._pad()),e(this.pending===null),this._digest(u)},t.prototype._pad=function(){var u=this.pendingTotal,r=this._delta8,s=r-(u+this.padLength)%r,a=new Array(s+this.padLength);a[0]=128;for(var o=1;o<s;o++)a[o]=0;if(u<<=3,this.endian==="big"){for(var f=8;f<this.padLength;f++)a[o++]=0;a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=u>>>24&255,a[o++]=u>>>16&255,a[o++]=u>>>8&255,a[o++]=u&255}else for(a[o++]=u&255,a[o++]=u>>>8&255,a[o++]=u>>>16&255,a[o++]=u>>>24&255,a[o++]=0,a[o++]=0,a[o++]=0,a[o++]=0,f=8;f<this.padLength;f++)a[o++]=0;return a},Qa}var Ct={},Et={},Pu;function Id(){if(Pu)return Et;Pu=1;var d=Rt(),e=d.rotr32;function t(n,c,h,l){if(n===0)return i(c,h,l);if(n===1||n===3)return r(c,h,l);if(n===2)return u(c,h,l)}Et.ft_1=t;function i(n,c,h){return n&c^~n&h}Et.ch32=i;function u(n,c,h){return n&c^n&h^c&h}Et.maj32=u;function r(n,c,h){return n^c^h}Et.p32=r;function s(n){return e(n,2)^e(n,13)^e(n,22)}Et.s0_256=s;function a(n){return e(n,6)^e(n,11)^e(n,25)}Et.s1_256=a;function o(n){return e(n,7)^e(n,18)^n>>>3}Et.g0_256=o;function f(n){return e(n,17)^e(n,19)^n>>>10}return Et.g1_256=f,Et}var Za,Nu;function Yl(){if(Nu)return Za;Nu=1;var d=Rt(),e=br(),t=Id(),i=d.rotl32,u=d.sum32,r=d.sum32_5,s=t.ft_1,a=e.BlockHash,o=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return d.inherits(f,a),Za=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(c,h){for(var l=this.W,p=0;p<16;p++)l[p]=c[h+p];for(;p<l.length;p++)l[p]=i(l[p-3]^l[p-8]^l[p-14]^l[p-16],1);var b=this.h[0],y=this.h[1],v=this.h[2],g=this.h[3],x=this.h[4];for(p=0;p<l.length;p++){var B=~~(p/20),R=r(i(b,5),s(B,y,v,g),x,l[p],o[B]);x=g,g=v,v=i(y,30),y=b,b=R}this.h[0]=u(this.h[0],b),this.h[1]=u(this.h[1],y),this.h[2]=u(this.h[2],v),this.h[3]=u(this.h[3],g),this.h[4]=u(this.h[4],x)},f.prototype._digest=function(c){return c==="hex"?d.toHex32(this.h,"big"):d.split32(this.h,"big")},Za}var ef,ku;function Rd(){if(ku)return ef;ku=1;var d=Rt(),e=br(),t=Id(),i=lt(),u=d.sum32,r=d.sum32_4,s=d.sum32_5,a=t.ch32,o=t.maj32,f=t.s0_256,n=t.s1_256,c=t.g0_256,h=t.g1_256,l=e.BlockHash,p=[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 b(){if(!(this instanceof b))return new b;l.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=p,this.W=new Array(64)}return d.inherits(b,l),ef=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(v,g){for(var x=this.W,B=0;B<16;B++)x[B]=v[g+B];for(;B<x.length;B++)x[B]=r(h(x[B-2]),x[B-7],c(x[B-15]),x[B-16]);var R=this.h[0],T=this.h[1],j=this.h[2],G=this.h[3],z=this.h[4],te=this.h[5],ne=this.h[6],$=this.h[7];for(i(this.k.length===x.length),B=0;B<x.length;B++){var N=s($,n(z),a(z,te,ne),this.k[B],x[B]),m=u(f(R),o(R,T,j));$=ne,ne=te,te=z,z=u(G,N),G=j,j=T,T=R,R=u(N,m)}this.h[0]=u(this.h[0],R),this.h[1]=u(this.h[1],T),this.h[2]=u(this.h[2],j),this.h[3]=u(this.h[3],G),this.h[4]=u(this.h[4],z),this.h[5]=u(this.h[5],te),this.h[6]=u(this.h[6],ne),this.h[7]=u(this.h[7],$)},b.prototype._digest=function(v){return v==="hex"?d.toHex32(this.h,"big"):d.split32(this.h,"big")},ef}var tf,Mu;function Jl(){if(Mu)return tf;Mu=1;var d=Rt(),e=Rd();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return d.inherits(t,e),tf=t,t.blockSize=512,t.outSize=224,t.hmacStrength=192,t.padLength=64,t.prototype._digest=function(u){return u==="hex"?d.toHex32(this.h.slice(0,7),"big"):d.split32(this.h.slice(0,7),"big")},tf}var rf,Cu;function Ad(){if(Cu)return rf;Cu=1;var d=Rt(),e=br(),t=lt(),i=d.rotr64_hi,u=d.rotr64_lo,r=d.shr64_hi,s=d.shr64_lo,a=d.sum64,o=d.sum64_hi,f=d.sum64_lo,n=d.sum64_4_hi,c=d.sum64_4_lo,h=d.sum64_5_hi,l=d.sum64_5_lo,p=e.BlockHash,b=[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 y(){if(!(this instanceof y))return new y;p.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}d.inherits(y,p),rf=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(m,E){for(var O=this.W,I=0;I<32;I++)O[I]=m[E+I];for(;I<O.length;I+=2){var A=ne(O[I-4],O[I-3]),F=$(O[I-4],O[I-3]),K=O[I-14],L=O[I-13],_=z(O[I-30],O[I-29]),q=te(O[I-30],O[I-29]),fe=O[I-32],se=O[I-31];O[I]=n(A,F,K,L,_,q,fe,se),O[I+1]=c(A,F,K,L,_,q,fe,se)}},y.prototype._update=function(m,E){this._prepareBlock(m,E);var O=this.W,I=this.h[0],A=this.h[1],F=this.h[2],K=this.h[3],L=this.h[4],_=this.h[5],q=this.h[6],fe=this.h[7],se=this.h[8],V=this.h[9],P=this.h[10],M=this.h[11],Y=this.h[12],Q=this.h[13],D=this.h[14],C=this.h[15];t(this.k.length===O.length);for(var J=0;J<O.length;J+=2){var ie=D,he=C,oe=j(se,V),ue=G(se,V),ge=v(se,V,P,M,Y),Ke=g(se,V,P,M,Y,Q),Se=this.k[J],de=this.k[J+1],Ie=O[J],ve=O[J+1],me=h(ie,he,oe,ue,ge,Ke,Se,de,Ie,ve),Le=l(ie,he,oe,ue,ge,Ke,Se,de,Ie,ve);ie=R(I,A),he=T(I,A),oe=x(I,A,F,K,L),ue=B(I,A,F,K,L,_);var Ne=o(ie,he,oe,ue),k=f(ie,he,oe,ue);D=Y,C=Q,Y=P,Q=M,P=se,M=V,se=o(q,fe,me,Le),V=f(fe,fe,me,Le),q=L,fe=_,L=F,_=K,F=I,K=A,I=o(me,Le,Ne,k),A=f(me,Le,Ne,k)}a(this.h,0,I,A),a(this.h,2,F,K),a(this.h,4,L,_),a(this.h,6,q,fe),a(this.h,8,se,V),a(this.h,10,P,M),a(this.h,12,Y,Q),a(this.h,14,D,C)},y.prototype._digest=function(m){return m==="hex"?d.toHex32(this.h,"big"):d.split32(this.h,"big")};function v(N,m,E,O,I){var A=N&E^~N&I;return A<0&&(A+=4294967296),A}function g(N,m,E,O,I,A){var F=m&O^~m&A;return F<0&&(F+=4294967296),F}function x(N,m,E,O,I){var A=N&E^N&I^E&I;return A<0&&(A+=4294967296),A}function B(N,m,E,O,I,A){var F=m&O^m&A^O&A;return F<0&&(F+=4294967296),F}function R(N,m){var E=i(N,m,28),O=i(m,N,2),I=i(m,N,7),A=E^O^I;return A<0&&(A+=4294967296),A}function T(N,m){var E=u(N,m,28),O=u(m,N,2),I=u(m,N,7),A=E^O^I;return A<0&&(A+=4294967296),A}function j(N,m){var E=i(N,m,14),O=i(N,m,18),I=i(m,N,9),A=E^O^I;return A<0&&(A+=4294967296),A}function G(N,m){var E=u(N,m,14),O=u(N,m,18),I=u(m,N,9),A=E^O^I;return A<0&&(A+=4294967296),A}function z(N,m){var E=i(N,m,1),O=i(N,m,8),I=r(N,m,7),A=E^O^I;return A<0&&(A+=4294967296),A}function te(N,m){var E=u(N,m,1),O=u(N,m,8),I=s(N,m,7),A=E^O^I;return A<0&&(A+=4294967296),A}function ne(N,m){var E=i(N,m,19),O=i(m,N,29),I=r(N,m,6),A=E^O^I;return A<0&&(A+=4294967296),A}function $(N,m){var E=u(N,m,19),O=u(m,N,29),I=s(N,m,6),A=E^O^I;return A<0&&(A+=4294967296),A}return rf}var nf,Tu;function Xl(){if(Tu)return nf;Tu=1;var d=Rt(),e=Ad();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 d.inherits(t,e),nf=t,t.blockSize=1024,t.outSize=384,t.hmacStrength=192,t.padLength=128,t.prototype._digest=function(u){return u==="hex"?d.toHex32(this.h.slice(0,12),"big"):d.split32(this.h.slice(0,12),"big")},nf}var Lu;function Ql(){return Lu||(Lu=1,Ct.sha1=Yl(),Ct.sha224=Jl(),Ct.sha256=Rd(),Ct.sha384=Xl(),Ct.sha512=Ad()),Ct}var af={},Du;function Zl(){if(Du)return af;Du=1;var d=Rt(),e=br(),t=d.rotl32,i=d.sum32,u=d.sum32_3,r=d.sum32_4,s=e.BlockHash;function a(){if(!(this instanceof a))return new a;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}d.inherits(a,s),af.ripemd160=a,a.blockSize=512,a.outSize=160,a.hmacStrength=192,a.padLength=64,a.prototype._update=function(y,v){for(var g=this.h[0],x=this.h[1],B=this.h[2],R=this.h[3],T=this.h[4],j=g,G=x,z=B,te=R,ne=T,$=0;$<80;$++){var N=i(t(r(g,o($,x,B,R),y[c[$]+v],f($)),l[$]),T);g=T,T=R,R=t(B,10),B=x,x=N,N=i(t(r(j,o(79-$,G,z,te),y[h[$]+v],n($)),p[$]),ne),j=ne,ne=te,te=t(z,10),z=G,G=N}N=u(this.h[1],B,te),this.h[1]=u(this.h[2],R,ne),this.h[2]=u(this.h[3],T,j),this.h[3]=u(this.h[4],g,G),this.h[4]=u(this.h[0],x,z),this.h[0]=N},a.prototype._digest=function(y){return y==="hex"?d.toHex32(this.h,"little"):d.split32(this.h,"little")};function o(b,y,v,g){return b<=15?y^v^g:b<=31?y&v|~y&g:b<=47?(y|~v)^g:b<=63?y&g|v&~g:y^(v|~g)}function f(b){return b<=15?0:b<=31?1518500249:b<=47?1859775393:b<=63?2400959708:2840853838}function n(b){return b<=15?1352829926:b<=31?1548603684:b<=47?1836072691:b<=63?2053994217:0}var c=[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],h=[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],l=[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],p=[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 af}var ff,Fu;function e1(){if(Fu)return ff;Fu=1;var d=Rt(),e=lt();function t(i,u,r){if(!(this instanceof t))return new t(i,u,r);this.Hash=i,this.blockSize=i.blockSize/8,this.outSize=i.outSize/8,this.inner=null,this.outer=null,this._init(d.toArray(u,r))}return ff=t,t.prototype._init=function(u){u.length>this.blockSize&&(u=new this.Hash().update(u).digest()),e(u.length<=this.blockSize);for(var r=u.length;r<this.blockSize;r++)u.push(0);for(r=0;r<u.length;r++)u[r]^=54;for(this.inner=new this.Hash().update(u),r=0;r<u.length;r++)u[r]^=106;this.outer=new this.Hash().update(u)},t.prototype.update=function(u,r){return this.inner.update(u,r),this},t.prototype.digest=function(u){return this.outer.update(this.inner.digest()),this.outer.digest(u)},ff}var Uu;function vr(){return Uu||(Uu=1,(function(d){var e=d;e.utils=Rt(),e.common=br(),e.sha=Ql(),e.ripemd=Zl(),e.hmac=e1(),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})(Xa)),Xa}var sf,qu;function t1(){return qu||(qu=1,sf={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"]]}}),sf}var Hu;function gs(){return Hu||(Hu=1,(function(d){var e=d,t=vr(),i=Bd(),u=St(),r=u.assert;function s(f){f.type==="short"?this.curve=new i.short(f):f.type==="edwards"?this.curve=new i.edwards(f):this.curve=new i.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,r(this.g.validate(),"Invalid curve"),r(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=s;function a(f,n){Object.defineProperty(e,f,{configurable:!0,enumerable:!0,get:function(){var c=new s(n);return Object.defineProperty(e,f,{configurable:!0,enumerable:!0,value:c}),c}})}a("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:t.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:t.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:t.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:t.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"]}),a("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:t.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["9"]}),a("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:t.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=t1()}catch{o=void 0}a("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",o]})})(Ja)),Ja}var of,Ku;function Od(){if(Ku)return of;Ku=1;var d=vr(),e=fs(),t=lt();function i(u){if(!(this instanceof i))return new i(u);this.hash=u.hash,this.predResist=!!u.predResist,this.outLen=this.hash.outSize,this.minEntropy=u.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var r=e.toArray(u.entropy,u.entropyEnc||"hex"),s=e.toArray(u.nonce,u.nonceEnc||"hex"),a=e.toArray(u.pers,u.persEnc||"hex");t(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(r,s,a)}return of=i,i.prototype._init=function(r,s,a){var o=r.concat(s).concat(a);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(o),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new d.hmac(this.hash,this.K)},i.prototype._update=function(r){var s=this._hmac().update(this.V).update([0]);r&&(s=s.update(r)),this.K=s.digest(),this.V=this._hmac().update(this.V).digest(),r&&(this.K=this._hmac().update(this.V).update([1]).update(r).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(r,s,a,o){typeof s!="string"&&(o=a,a=s,s=null),r=e.toArray(r,s),a=e.toArray(a,o),t(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(a||[])),this._reseed=1},i.prototype.generate=function(r,s,a,o){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof s!="string"&&(o=a,a=s,s=null),a&&(a=e.toArray(a,o||"hex"),this._update(a));for(var f=[];f.length<r;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var n=f.slice(0,r);return this._update(a),this._reseed++,e.encode(n,s)},of}var cf,ju;function r1(){if(ju)return cf;ju=1;var d=Te(),e=St(),t=e.assert;function i(u,r){this.ec=u,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}return cf=i,i.fromPublic=function(r,s,a){return s instanceof i?s:new i(r,{pub:s,pubEnc:a})},i.fromPrivate=function(r,s,a){return s instanceof i?s:new i(r,{priv:s,privEnc:a})},i.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.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"}},i.prototype.getPublic=function(r,s){return typeof r=="string"&&(s=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),s?this.pub.encode(s,r):this.pub},i.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(r,s){this.priv=new d(r,s||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(r,s){if(r.x||r.y){this.ec.curve.type==="mont"?t(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&t(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,s)},i.prototype.derive=function(r){return r.validate()||t(r.validate(),"public point not validated"),r.mul(this.priv).getX()},i.prototype.sign=function(r,s,a){return this.ec.sign(r,this,s,a)},i.prototype.verify=function(r,s,a){return this.ec.verify(r,s,this,void 0,a)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},cf}var uf,zu;function i1(){if(zu)return uf;zu=1;var d=Te(),e=St(),t=e.assert;function i(o,f){if(o instanceof i)return o;this._importDER(o,f)||(t(o.r&&o.s,"Signature without r or s"),this.r=new d(o.r,16),this.s=new d(o.s,16),o.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=o.recoveryParam)}uf=i;function u(){this.place=0}function r(o,f){var n=o[f.place++];if(!(n&128))return n;var c=n&15;if(c===0||c>4||o[f.place]===0)return!1;for(var h=0,l=0,p=f.place;l<c;l++,p++)h<<=8,h|=o[p],h>>>=0;return h<=127?!1:(f.place=p,h)}function s(o){for(var f=0,n=o.length-1;!o[f]&&!(o[f+1]&128)&&f<n;)f++;return f===0?o:o.slice(f)}i.prototype._importDER=function(f,n){f=e.toArray(f,n);var c=new u;if(f[c.place++]!==48)return!1;var h=r(f,c);if(h===!1||h+c.place!==f.length||f[c.place++]!==2)return!1;var l=r(f,c);if(l===!1||(f[c.place]&128)!==0)return!1;var p=f.slice(c.place,l+c.place);if(c.place+=l,f[c.place++]!==2)return!1;var b=r(f,c);if(b===!1||f.length!==b+c.place||(f[c.place]&128)!==0)return!1;var y=f.slice(c.place,b+c.place);if(p[0]===0)if(p[1]&128)p=p.slice(1);else return!1;if(y[0]===0)if(y[1]&128)y=y.slice(1);else return!1;return this.r=new d(p),this.s=new d(y),this.recoveryParam=null,!0};function a(o,f){if(f<128){o.push(f);return}var n=1+(Math.log(f)/Math.LN2>>>3);for(o.push(n|128);--n;)o.push(f>>>(n<<3)&255);o.push(f)}return i.prototype.toDER=function(f){var n=this.r.toArray(),c=this.s.toArray();for(n[0]&128&&(n=[0].concat(n)),c[0]&128&&(c=[0].concat(c)),n=s(n),c=s(c);!c[0]&&!(c[1]&128);)c=c.slice(1);var h=[2];a(h,n.length),h=h.concat(n),h.push(2),a(h,c.length);var l=h.concat(c),p=[48];return a(p,l.length),p=p.concat(l),e.encode(p,f)},uf}var hf,Vu;function n1(){if(Vu)return hf;Vu=1;var d=Te(),e=Od(),t=St(),i=gs(),u=yr(),r=t.assert,s=r1(),a=i1();function o(f){if(!(this instanceof o))return new o(f);typeof f=="string"&&(r(Object.prototype.hasOwnProperty.call(i,f),"Unknown curve "+f),f=i[f]),f instanceof i.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 hf=o,o.prototype.keyPair=function(n){return new s(this,n)},o.prototype.keyFromPrivate=function(n,c){return s.fromPrivate(this,n,c)},o.prototype.keyFromPublic=function(n,c){return s.fromPublic(this,n,c)},o.prototype.genKeyPair=function(n){n||(n={});for(var c=new e({hash:this.hash,pers:n.pers,persEnc:n.persEnc||"utf8",entropy:n.entropy||u(this.hash.hmacStrength),entropyEnc:n.entropy&&n.entropyEnc||"utf8",nonce:this.n.toArray()}),h=this.n.byteLength(),l=this.n.sub(new d(2));;){var p=new d(c.generate(h));if(!(p.cmp(l)>0))return p.iaddn(1),this.keyFromPrivate(p)}},o.prototype._truncateToN=function(n,c,h){var l;if(d.isBN(n)||typeof n=="number")n=new d(n,16),l=n.byteLength();else if(typeof n=="object")l=n.length,n=new d(n,16);else{var p=n.toString();l=p.length+1>>>1,n=new d(p,16)}typeof h!="number"&&(h=l*8);var b=h-this.n.bitLength();return b>0&&(n=n.ushrn(b)),!c&&n.cmp(this.n)>=0?n.sub(this.n):n},o.prototype.sign=function(n,c,h,l){if(typeof h=="object"&&(l=h,h=null),l||(l={}),typeof n!="string"&&typeof n!="number"&&!d.isBN(n)){r(typeof n=="object"&&n&&typeof n.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),r(n.length>>>0===n.length);for(var p=0;p<n.length;p++)r((n[p]&255)===n[p])}c=this.keyFromPrivate(c,h),n=this._truncateToN(n,!1,l.msgBitLength),r(!n.isNeg(),"Can not sign a negative message");var b=this.n.byteLength(),y=c.getPrivate().toArray("be",b),v=n.toArray("be",b);r(new d(v).eq(n),"Can not sign message");for(var g=new e({hash:this.hash,entropy:y,nonce:v,pers:l.pers,persEnc:l.persEnc||"utf8"}),x=this.n.sub(new d(1)),B=0;;B++){var R=l.k?l.k(B):new d(g.generate(this.n.byteLength()));if(R=this._truncateToN(R,!0),!(R.cmpn(1)<=0||R.cmp(x)>=0)){var T=this.g.mul(R);if(!T.isInfinity()){var j=T.getX(),G=j.umod(this.n);if(G.cmpn(0)!==0){var z=R.invm(this.n).mul(G.mul(c.getPrivate()).iadd(n));if(z=z.umod(this.n),z.cmpn(0)!==0){var te=(T.getY().isOdd()?1:0)|(j.cmp(G)!==0?2:0);return l.canonical&&z.cmp(this.nh)>0&&(z=this.n.sub(z),te^=1),new a({r:G,s:z,recoveryParam:te})}}}}}},o.prototype.verify=function(n,c,h,l,p){p||(p={}),n=this._truncateToN(n,!1,p.msgBitLength),h=this.keyFromPublic(h,l),c=new a(c,"hex");var b=c.r,y=c.s;if(b.cmpn(1)<0||b.cmp(this.n)>=0||y.cmpn(1)<0||y.cmp(this.n)>=0)return!1;var v=y.invm(this.n),g=v.mul(n).umod(this.n),x=v.mul(b).umod(this.n),B;return this.curve._maxwellTrick?(B=this.g.jmulAdd(g,h.getPublic(),x),B.isInfinity()?!1:B.eqXToP(b)):(B=this.g.mulAdd(g,h.getPublic(),x),B.isInfinity()?!1:B.getX().umod(this.n).cmp(b)===0)},o.prototype.recoverPubKey=function(f,n,c,h){r((3&c)===c,"The recovery param is more than two bits"),n=new a(n,h);var l=this.n,p=new d(f),b=n.r,y=n.s,v=c&1,g=c>>1;if(b.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?b=this.curve.pointFromX(b.add(this.curve.n),v):b=this.curve.pointFromX(b,v);var x=n.r.invm(l),B=l.sub(p).mul(x).umod(l),R=y.mul(x).umod(l);return this.g.mulAdd(B,b,R)},o.prototype.getKeyRecoveryParam=function(f,n,c,h){if(n=new a(n,h),n.recoveryParam!==null)return n.recoveryParam;for(var l=0;l<4;l++){var p;try{p=this.recoverPubKey(f,n,l)}catch{continue}if(p.eq(c))return l}throw new Error("Unable to find valid recovery factor")},hf}var df,Gu;function a1(){if(Gu)return df;Gu=1;var d=St(),e=d.assert,t=d.parseBytes,i=d.cachedProperty;function u(r,s){this.eddsa=r,this._secret=t(s.secret),r.isPoint(s.pub)?this._pub=s.pub:this._pubBytes=t(s.pub)}return u.fromPublic=function(s,a){return a instanceof u?a:new u(s,{pub:a})},u.fromSecret=function(s,a){return a instanceof u?a:new u(s,{secret:a})},u.prototype.secret=function(){return this._secret},i(u,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(u,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(u,"privBytes",function(){var s=this.eddsa,a=this.hash(),o=s.encodingLength-1,f=a.slice(0,s.encodingLength);return f[0]&=248,f[o]&=127,f[o]|=64,f}),i(u,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(u,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(u,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),u.prototype.sign=function(s){return e(this._secret,"KeyPair can only verify"),this.eddsa.sign(s,this)},u.prototype.verify=function(s,a){return this.eddsa.verify(s,a,this)},u.prototype.getSecret=function(s){return e(this._secret,"KeyPair is public only"),d.encode(this.secret(),s)},u.prototype.getPublic=function(s){return d.encode(this.pubBytes(),s)},df=u,df}var lf,$u;function f1(){if($u)return lf;$u=1;var d=Te(),e=St(),t=e.assert,i=e.cachedProperty,u=e.parseBytes;function r(s,a){this.eddsa=s,typeof a!="object"&&(a=u(a)),Array.isArray(a)&&(t(a.length===s.encodingLength*2,"Signature has invalid size"),a={R:a.slice(0,s.encodingLength),S:a.slice(s.encodingLength)}),t(a.R&&a.S,"Signature without R or S"),s.isPoint(a.R)&&(this._R=a.R),a.S instanceof d&&(this._S=a.S),this._Rencoded=Array.isArray(a.R)?a.R:a.Rencoded,this._Sencoded=Array.isArray(a.S)?a.S:a.Sencoded}return i(r,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),i(r,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),i(r,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),i(r,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),r.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},r.prototype.toHex=function(){return e.encode(this.toBytes(),"hex").toUpperCase()},lf=r,lf}var pf,Wu;function s1(){if(Wu)return pf;Wu=1;var d=vr(),e=gs(),t=St(),i=t.assert,u=t.parseBytes,r=a1(),s=f1();function a(o){if(i(o==="ed25519","only tested with ed25519 so far"),!(this instanceof a))return new a(o);o=e[o].curve,this.curve=o,this.g=o.g,this.g.precompute(o.n.bitLength()+1),this.pointClass=o.point().constructor,this.encodingLength=Math.ceil(o.n.bitLength()/8),this.hash=d.sha512}return pf=a,a.prototype.sign=function(f,n){f=u(f);var c=this.keyFromSecret(n),h=this.hashInt(c.messagePrefix(),f),l=this.g.mul(h),p=this.encodePoint(l),b=this.hashInt(p,c.pubBytes(),f).mul(c.priv()),y=h.add(b).umod(this.curve.n);return this.makeSignature({R:l,S:y,Rencoded:p})},a.prototype.verify=function(f,n,c){if(f=u(f),n=this.makeSignature(n),n.S().gte(n.eddsa.curve.n)||n.S().isNeg())return!1;var h=this.keyFromPublic(c),l=this.hashInt(n.Rencoded(),h.pubBytes(),f),p=this.g.mul(n.S()),b=n.R().add(h.pub().mul(l));return b.eq(p)},a.prototype.hashInt=function(){for(var f=this.hash(),n=0;n<arguments.length;n++)f.update(arguments[n]);return t.intFromLE(f.digest()).umod(this.curve.n)},a.prototype.keyFromPublic=function(f){return r.fromPublic(this,f)},a.prototype.keyFromSecret=function(f){return r.fromSecret(this,f)},a.prototype.makeSignature=function(f){return f instanceof s?f:new s(this,f)},a.prototype.encodePoint=function(f){var n=f.getY().toArray("le",this.encodingLength);return n[this.encodingLength-1]|=f.getX().isOdd()?128:0,n},a.prototype.decodePoint=function(f){f=t.parseBytes(f);var n=f.length-1,c=f.slice(0,n).concat(f[n]&-129),h=(f[n]&128)!==0,l=t.intFromLE(c);return this.curve.pointFromY(l,h)},a.prototype.encodeInt=function(f){return f.toArray("le",this.encodingLength)},a.prototype.decodeInt=function(f){return t.intFromLE(f)},a.prototype.isPoint=function(f){return f instanceof this.pointClass},pf}var Yu;function ws(){return Yu||(Yu=1,(function(d){var e=d;e.version=Vl.version,e.utils=St(),e.rand=yr(),e.curve=Bd(),e.curves=gs(),e.ec=n1(),e.eddsa=s1()})(ja)),ja}var vt={},bf={},vf={},Ju;function o1(){return Ju||(Ju=1,(function(d){var e=mr(),t=be(),i=d;i.define=function(s,a){return new u(s,a)};function u(r,s){this.name=r,this.body=s,this.decoders={},this.encoders={}}u.prototype._createNamed=function(s){var a;try{a=Wt.runInThisContext("(function "+this.name+`(entity) {
3
3
  this._initNamed(entity);
4
- })`)}catch{a=function(f){this._initNamed(f)}}return t(a,s),a.prototype._initNamed=function(f){s.call(this,f)},new a(this)},u.prototype._getDecoder=function(s){return s=s||"der",this.decoders.hasOwnProperty(s)||(this.decoders[s]=this._createNamed(e.decoders[s])),this.decoders[s]},u.prototype.decode=function(s,a,o){return this._getDecoder(a).decode(s,o)},u.prototype._getEncoder=function(s){return s=s||"der",this.encoders.hasOwnProperty(s)||(this.encoders[s]=this._createNamed(e.encoders[s])),this.encoders[s]},u.prototype.encode=function(s,a,o){return this._getEncoder(a).encode(s,o)}})(bf)),bf}var pf={},vf={},$u;function n1(){if($u)return vf;$u=1;var d=pe();function e(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}vf.Reporter=e,e.prototype.isError=function(u){return u instanceof t},e.prototype.save=function(){var u=this._reporterState;return{obj:u.obj,pathLen:u.path.length}},e.prototype.restore=function(u){var r=this._reporterState;r.obj=u.obj,r.path=r.path.slice(0,u.pathLen)},e.prototype.enterKey=function(u){return this._reporterState.path.push(u)},e.prototype.exitKey=function(u){var r=this._reporterState;r.path=r.path.slice(0,u-1)},e.prototype.leaveKey=function(u,r,s){var a=this._reporterState;this.exitKey(u),a.obj!==null&&(a.obj[r]=s)},e.prototype.path=function(){return this._reporterState.path.join("/")},e.prototype.enterObject=function(){var u=this._reporterState,r=u.obj;return u.obj={},r},e.prototype.leaveObject=function(u){var r=this._reporterState,s=r.obj;return r.obj=u,s},e.prototype.error=function(u){var r,s=this._reporterState,a=u instanceof t;if(a?r=u:r=new t(s.path.map(function(o){return"["+JSON.stringify(o)+"]"}).join(""),u.message||u,u.stack),!s.options.partial)throw r;return a||s.errors.push(r),r},e.prototype.wrapResult=function(u){var r=this._reporterState;return r.options.partial?{result:this.isError(u)?null:u,errors:r.errors}:u};function t(i,u){this.path=i,this.rethrow(u)}return d(t,Error),t.prototype.rethrow=function(u){if(this.message=u+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,t),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this},vf}var Mr={},Wu;function Yu(){if(Wu)return Mr;Wu=1;var d=pe(),e=rr().Reporter,t=xt().Buffer;function i(r,s){if(e.call(this,s),!t.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}d(i,e),Mr.DecoderBuffer=i,i.prototype.save=function(){return{offset:this.offset,reporter:e.prototype.save.call(this)}},i.prototype.restore=function(s){var a=new i(this.base);return a.offset=s.offset,a.length=this.offset,this.offset=s.offset,e.prototype.restore.call(this,s.reporter),a},i.prototype.isEmpty=function(){return this.offset===this.length},i.prototype.readUInt8=function(s){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(s||"DecoderBuffer overrun")},i.prototype.skip=function(s,a){if(!(this.offset+s<=this.length))return this.error(a||"DecoderBuffer overrun");var o=new i(this.base);return o._reporterState=this._reporterState,o.offset=this.offset,o.length=this.offset+s,this.offset+=s,o},i.prototype.raw=function(s){return this.base.slice(s?s.offset:this.offset,this.length)};function u(r,s){if(Array.isArray(r))this.length=0,this.value=r.map(function(a){return a instanceof u||(a=new u(a,s)),this.length+=a.length,a},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return s.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=t.byteLength(r);else if(t.isBuffer(r))this.value=r,this.length=r.length;else return s.error("Unsupported type: "+typeof r)}return Mr.EncoderBuffer=u,u.prototype.join=function(s,a){return s||(s=new t(this.length)),a||(a=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(o){o.join(s,a),a+=o.length}):(typeof this.value=="number"?s[a]=this.value:typeof this.value=="string"?s.write(this.value,a):t.isBuffer(this.value)&&this.value.copy(s,a),a+=this.length)),s},Mr}var mf,Ju;function a1(){if(Ju)return mf;Ju=1;var d=rr().Reporter,e=rr().EncoderBuffer,t=rr().DecoderBuffer,i=lt(),u=["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"],r=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(u),s=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function a(f,n){var c={};this._baseState=c,c.enc=f,c.parent=n||null,c.children=null,c.tag=null,c.args=null,c.reverseArgs=null,c.choice=null,c.optional=!1,c.any=!1,c.obj=!1,c.use=null,c.useDecoder=null,c.key=null,c.default=null,c.explicit=null,c.implicit=null,c.contains=null,c.parent||(c.children=[],this._wrap())}mf=a;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return a.prototype.clone=function(){var n=this._baseState,c={};o.forEach(function(l){c[l]=n[l]});var h=new this.constructor(c.parent);return h._baseState=c,h},a.prototype._wrap=function(){var n=this._baseState;r.forEach(function(c){this[c]=function(){var l=new this.constructor(this);return n.children.push(l),l[c].apply(l,arguments)}},this)},a.prototype._init=function(n){var c=this._baseState;i(c.parent===null),n.call(this),c.children=c.children.filter(function(h){return h._baseState.parent===this},this),i.equal(c.children.length,1,"Root node can have only one child")},a.prototype._useArgs=function(n){var c=this._baseState,h=n.filter(function(l){return l instanceof this.constructor},this);n=n.filter(function(l){return!(l instanceof this.constructor)},this),h.length!==0&&(i(c.children===null),c.children=h,h.forEach(function(l){l._baseState.parent=this},this)),n.length!==0&&(i(c.args===null),c.args=n,c.reverseArgs=n.map(function(l){if(typeof l!="object"||l.constructor!==Object)return l;var b={};return Object.keys(l).forEach(function(p){p==(p|0)&&(p|=0);var y=l[p];b[y]=p}),b}))},s.forEach(function(f){a.prototype[f]=function(){var c=this._baseState;throw new Error(f+" not implemented for encoding: "+c.enc)}}),u.forEach(function(f){a.prototype[f]=function(){var c=this._baseState,h=Array.prototype.slice.call(arguments);return i(c.tag===null),c.tag=f,this._useArgs(h),this}}),a.prototype.use=function(n){i(n);var c=this._baseState;return i(c.use===null),c.use=n,this},a.prototype.optional=function(){var n=this._baseState;return n.optional=!0,this},a.prototype.def=function(n){var c=this._baseState;return i(c.default===null),c.default=n,c.optional=!0,this},a.prototype.explicit=function(n){var c=this._baseState;return i(c.explicit===null&&c.implicit===null),c.explicit=n,this},a.prototype.implicit=function(n){var c=this._baseState;return i(c.explicit===null&&c.implicit===null),c.implicit=n,this},a.prototype.obj=function(){var n=this._baseState,c=Array.prototype.slice.call(arguments);return n.obj=!0,c.length!==0&&this._useArgs(c),this},a.prototype.key=function(n){var c=this._baseState;return i(c.key===null),c.key=n,this},a.prototype.any=function(){var n=this._baseState;return n.any=!0,this},a.prototype.choice=function(n){var c=this._baseState;return i(c.choice===null),c.choice=n,this._useArgs(Object.keys(n).map(function(h){return n[h]})),this},a.prototype.contains=function(n){var c=this._baseState;return i(c.use===null),c.contains=n,this},a.prototype._decode=function(n,c){var h=this._baseState;if(h.parent===null)return n.wrapResult(h.children[0]._decode(n,c));var l=h.default,b=!0,p=null;if(h.key!==null&&(p=n.enterKey(h.key)),h.optional){var y=null;if(h.explicit!==null?y=h.explicit:h.implicit!==null?y=h.implicit:h.tag!==null&&(y=h.tag),y===null&&!h.any){var v=n.save();try{h.choice===null?this._decodeGeneric(h.tag,n,c):this._decodeChoice(n,c),b=!0}catch{b=!1}n.restore(v)}else if(b=this._peekTag(n,y,h.any),n.isError(b))return b}var g;if(h.obj&&b&&(g=n.enterObject()),b){if(h.explicit!==null){var x=this._decodeTag(n,h.explicit);if(n.isError(x))return x;n=x}var B=n.offset;if(h.use===null&&h.choice===null){if(h.any)var v=n.save();var I=this._decodeTag(n,h.implicit!==null?h.implicit:h.tag,h.any);if(n.isError(I))return I;h.any?l=n.raw(v):n=I}if(c&&c.track&&h.tag!==null&&c.track(n.path(),B,n.length,"tagged"),c&&c.track&&h.tag!==null&&c.track(n.path(),n.offset,n.length,"content"),h.any?l=l:h.choice===null?l=this._decodeGeneric(h.tag,n,c):l=this._decodeChoice(n,c),n.isError(l))return l;if(!h.any&&h.choice===null&&h.children!==null&&h.children.forEach(function(G){G._decode(n,c)}),h.contains&&(h.tag==="octstr"||h.tag==="bitstr")){var T=new t(l);l=this._getUse(h.contains,n._reporterState.obj)._decode(T,c)}}return h.obj&&b&&(l=n.leaveObject(g)),h.key!==null&&(l!==null||b===!0)?n.leaveKey(p,h.key,l):p!==null&&n.exitKey(p),l},a.prototype._decodeGeneric=function(n,c,h){var l=this._baseState;return n==="seq"||n==="set"?null:n==="seqof"||n==="setof"?this._decodeList(c,n,l.args[0],h):/str$/.test(n)?this._decodeStr(c,n,h):n==="objid"&&l.args?this._decodeObjid(c,l.args[0],l.args[1],h):n==="objid"?this._decodeObjid(c,null,null,h):n==="gentime"||n==="utctime"?this._decodeTime(c,n,h):n==="null_"?this._decodeNull(c,h):n==="bool"?this._decodeBool(c,h):n==="objDesc"?this._decodeStr(c,n,h):n==="int"||n==="enum"?this._decodeInt(c,l.args&&l.args[0],h):l.use!==null?this._getUse(l.use,c._reporterState.obj)._decode(c,h):c.error("unknown tag: "+n)},a.prototype._getUse=function(n,c){var h=this._baseState;return h.useDecoder=this._use(n,c),i(h.useDecoder._baseState.parent===null),h.useDecoder=h.useDecoder._baseState.children[0],h.implicit!==h.useDecoder._baseState.implicit&&(h.useDecoder=h.useDecoder.clone(),h.useDecoder._baseState.implicit=h.implicit),h.useDecoder},a.prototype._decodeChoice=function(n,c){var h=this._baseState,l=null,b=!1;return Object.keys(h.choice).some(function(p){var y=n.save(),v=h.choice[p];try{var g=v._decode(n,c);if(n.isError(g))return!1;l={type:p,value:g},b=!0}catch{return n.restore(y),!1}return!0},this),b?l:n.error("Choice not matched")},a.prototype._createEncoderBuffer=function(n){return new e(n,this.reporter)},a.prototype._encode=function(n,c,h){var l=this._baseState;if(!(l.default!==null&&l.default===n)){var b=this._encodeValue(n,c,h);if(b!==void 0&&!this._skipDefault(b,c,h))return b}},a.prototype._encodeValue=function(n,c,h){var l=this._baseState;if(l.parent===null)return l.children[0]._encode(n,c||new d);var v=null;if(this.reporter=c,l.optional&&n===void 0)if(l.default!==null)n=l.default;else return;var b=null,p=!1;if(l.any)v=this._createEncoderBuffer(n);else if(l.choice)v=this._encodeChoice(n,c);else if(l.contains)b=this._getUse(l.contains,h)._encode(n,c),p=!0;else if(l.children)b=l.children.map(function(B){if(B._baseState.tag==="null_")return B._encode(null,c,n);if(B._baseState.key===null)return c.error("Child should have a key");var I=c.enterKey(B._baseState.key);if(typeof n!="object")return c.error("Child expected, but input is not object");var T=B._encode(n[B._baseState.key],c,n);return c.leaveKey(I),T},this).filter(function(B){return B}),b=this._createEncoderBuffer(b);else if(l.tag==="seqof"||l.tag==="setof"){if(!(l.args&&l.args.length===1))return c.error("Too many args for : "+l.tag);if(!Array.isArray(n))return c.error("seqof/setof, but data is not Array");var y=this.clone();y._baseState.implicit=null,b=this._createEncoderBuffer(n.map(function(B){var I=this._baseState;return this._getUse(I.args[0],n)._encode(B,c)},y))}else l.use!==null?v=this._getUse(l.use,h)._encode(n,c):(b=this._encodePrimitive(l.tag,n),p=!0);var v;if(!l.any&&l.choice===null){var g=l.implicit!==null?l.implicit:l.tag,x=l.implicit===null?"universal":"context";g===null?l.use===null&&c.error("Tag could be omitted only for .use()"):l.use===null&&(v=this._encodeComposite(g,p,x,b))}return l.explicit!==null&&(v=this._encodeComposite(l.explicit,!1,"context",v)),v},a.prototype._encodeChoice=function(n,c){var h=this._baseState,l=h.choice[n.type];return l||i(!1,n.type+" not found in "+JSON.stringify(Object.keys(h.choice))),l._encode(n.value,c)},a.prototype._encodePrimitive=function(n,c){var h=this._baseState;if(/str$/.test(n))return this._encodeStr(c,n);if(n==="objid"&&h.args)return this._encodeObjid(c,h.reverseArgs[0],h.args[1]);if(n==="objid")return this._encodeObjid(c,null,null);if(n==="gentime"||n==="utctime")return this._encodeTime(c,n);if(n==="null_")return this._encodeNull();if(n==="int"||n==="enum")return this._encodeInt(c,h.args&&h.reverseArgs[0]);if(n==="bool")return this._encodeBool(c);if(n==="objDesc")return this._encodeStr(c,n);throw new Error("Unsupported tag: "+n)},a.prototype._isNumstr=function(n){return/^[0-9 ]*$/.test(n)},a.prototype._isPrintstr=function(n){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(n)},mf}var Xu;function rr(){return Xu||(Xu=1,(function(d){var e=d;e.Reporter=n1().Reporter,e.DecoderBuffer=Yu().DecoderBuffer,e.EncoderBuffer=Yu().EncoderBuffer,e.Node=a1()})(pf)),pf}var yf={},gf={},Qu;function f1(){return Qu||(Qu=1,(function(d){var e=Bd();d.tagClass={0:"universal",1:"application",2:"context",3:"private"},d.tagClassByName=e._reverse(d.tagClass),d.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"},d.tagByName=e._reverse(d.tag)})(gf)),gf}var Zu;function Bd(){return Zu||(Zu=1,(function(d){var e=d;e._reverse=function(i){var u={};return Object.keys(i).forEach(function(r){(r|0)==r&&(r=r|0);var s=i[r];u[s]=r}),u},e.der=f1()})(yf)),yf}var wf={},_f,eh;function Rd(){if(eh)return _f;eh=1;var d=pe(),e=pr(),t=e.base,i=e.bignum,u=e.constants.der;function r(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new s,this.tree._init(f.body)}_f=r,r.prototype.decode=function(n,c){return n instanceof t.DecoderBuffer||(n=new t.DecoderBuffer(n,c)),this.tree._decode(n,c)};function s(f){t.Node.call(this,"der",f)}d(s,t.Node),s.prototype._peekTag=function(n,c,h){if(n.isEmpty())return!1;var l=n.save(),b=a(n,'Failed to peek tag: "'+c+'"');return n.isError(b)?b:(n.restore(l),b.tag===c||b.tagStr===c||b.tagStr+"of"===c||h)},s.prototype._decodeTag=function(n,c,h){var l=a(n,'Failed to decode tag of "'+c+'"');if(n.isError(l))return l;var b=o(n,l.primitive,'Failed to get length of "'+c+'"');if(n.isError(b))return b;if(!h&&l.tag!==c&&l.tagStr!==c&&l.tagStr+"of"!==c)return n.error('Failed to match tag: "'+c+'"');if(l.primitive||b!==null)return n.skip(b,'Failed to match body of: "'+c+'"');var p=n.save(),y=this._skipUntilEnd(n,'Failed to skip indefinite length body: "'+this.tag+'"');return n.isError(y)?y:(b=n.offset-p.offset,n.restore(p),n.skip(b,'Failed to match body of: "'+c+'"'))},s.prototype._skipUntilEnd=function(n,c){for(;;){var h=a(n,c);if(n.isError(h))return h;var l=o(n,h.primitive,c);if(n.isError(l))return l;var b;if(h.primitive||l!==null?b=n.skip(l):b=this._skipUntilEnd(n,c),n.isError(b))return b;if(h.tagStr==="end")break}},s.prototype._decodeList=function(n,c,h,l){for(var b=[];!n.isEmpty();){var p=this._peekTag(n,"end");if(n.isError(p))return p;var y=h.decode(n,"der",l);if(n.isError(y)&&p)break;b.push(y)}return b},s.prototype._decodeStr=function(n,c){if(c==="bitstr"){var h=n.readUInt8();return n.isError(h)?h:{unused:h,data:n.raw()}}else if(c==="bmpstr"){var l=n.raw();if(l.length%2===1)return n.error("Decoding of string type: bmpstr length mismatch");for(var b="",p=0;p<l.length/2;p++)b+=String.fromCharCode(l.readUInt16BE(p*2));return b}else if(c==="numstr"){var y=n.raw().toString("ascii");return this._isNumstr(y)?y:n.error("Decoding of string type: numstr unsupported characters")}else{if(c==="octstr")return n.raw();if(c==="objDesc")return n.raw();if(c==="printstr"){var v=n.raw().toString("ascii");return this._isPrintstr(v)?v:n.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(c)?n.raw().toString():n.error("Decoding of string type: "+c+" unsupported")}},s.prototype._decodeObjid=function(n,c,h){for(var l,b=[],p=0;!n.isEmpty();){var y=n.readUInt8();p<<=7,p|=y&127,(y&128)===0&&(b.push(p),p=0)}y&128&&b.push(p);var v=b[0]/40|0,g=b[0]%40;if(h?l=b:l=[v,g].concat(b.slice(1)),c){var x=c[l.join(" ")];x===void 0&&(x=c[l.join(".")]),x!==void 0&&(l=x)}return l},s.prototype._decodeTime=function(n,c){var h=n.raw().toString();if(c==="gentime")var l=h.slice(0,4)|0,b=h.slice(4,6)|0,p=h.slice(6,8)|0,y=h.slice(8,10)|0,v=h.slice(10,12)|0,g=h.slice(12,14)|0;else if(c==="utctime"){var l=h.slice(0,2)|0,b=h.slice(2,4)|0,p=h.slice(4,6)|0,y=h.slice(6,8)|0,v=h.slice(8,10)|0,g=h.slice(10,12)|0;l<70?l=2e3+l:l=1900+l}else return n.error("Decoding "+c+" time is not supported yet");return Date.UTC(l,b-1,p,y,v,g,0)},s.prototype._decodeNull=function(n){return null},s.prototype._decodeBool=function(n){var c=n.readUInt8();return n.isError(c)?c:c!==0},s.prototype._decodeInt=function(n,c){var h=n.raw(),l=new i(h);return c&&(l=c[l.toString(10)]||l),l},s.prototype._use=function(n,c){return typeof n=="function"&&(n=n(c)),n._getDecoder("der").tree};function a(f,n){var c=f.readUInt8(n);if(f.isError(c))return c;var h=u.tagClass[c>>6],l=(c&32)===0;if((c&31)===31){var b=c;for(c=0;(b&128)===128;){if(b=f.readUInt8(n),f.isError(b))return b;c<<=7,c|=b&127}}else c&=31;var p=u.tag[c];return{cls:h,primitive:l,tag:c,tagStr:p}}function o(f,n,c){var h=f.readUInt8(c);if(f.isError(h))return h;if(!n&&h===128)return null;if((h&128)===0)return h;var l=h&127;if(l>4)return f.error("length octect is too long");h=0;for(var b=0;b<l;b++){h<<=8;var p=f.readUInt8(c);if(f.isError(p))return p;h|=p}return h}return _f}var Sf,th;function s1(){if(th)return Sf;th=1;var d=pe(),e=xt().Buffer,t=Rd();function i(u){t.call(this,u),this.enc="pem"}return d(i,t),Sf=i,i.prototype.decode=function(r,s){for(var a=r.toString().split(/[\r\n]+/g),o=s.label.toUpperCase(),f=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,c=-1,h=0;h<a.length;h++){var l=a[h].match(f);if(l!==null&&l[2]===o)if(n===-1){if(l[1]!=="BEGIN")break;n=h}else{if(l[1]!=="END")break;c=h;break}}if(n===-1||c===-1)throw new Error("PEM section not found for: "+o);var b=a.slice(n+1,c).join("");b.replace(/[^a-z0-9\+\/=]+/gi,"");var p=new e(b,"base64");return t.prototype.decode.call(this,p,s)},Sf}var rh;function o1(){return rh||(rh=1,(function(d){var e=d;e.der=Rd(),e.pem=s1()})(wf)),wf}var xf={},Ef,ih;function Id(){if(ih)return Ef;ih=1;var d=pe(),e=xt().Buffer,t=pr(),i=t.base,u=t.constants.der;function r(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new s,this.tree._init(f.body)}Ef=r,r.prototype.encode=function(n,c){return this.tree._encode(n,c).join()};function s(f){i.Node.call(this,"der",f)}d(s,i.Node),s.prototype._encodeComposite=function(n,c,h,l){var b=o(n,c,h,this.reporter);if(l.length<128){var v=new e(2);return v[0]=b,v[1]=l.length,this._createEncoderBuffer([v,l])}for(var p=1,y=l.length;y>=256;y>>=8)p++;var v=new e(2+p);v[0]=b,v[1]=128|p;for(var y=1+p,g=l.length;g>0;y--,g>>=8)v[y]=g&255;return this._createEncoderBuffer([v,l])},s.prototype._encodeStr=function(n,c){if(c==="bitstr")return this._createEncoderBuffer([n.unused|0,n.data]);if(c==="bmpstr"){for(var h=new e(n.length*2),l=0;l<n.length;l++)h.writeUInt16BE(n.charCodeAt(l),l*2);return this._createEncoderBuffer(h)}else return c==="numstr"?this._isNumstr(n)?this._createEncoderBuffer(n):this.reporter.error("Encoding of string type: numstr supports only digits and space"):c==="printstr"?this._isPrintstr(n)?this._createEncoderBuffer(n):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(c)?this._createEncoderBuffer(n):c==="objDesc"?this._createEncoderBuffer(n):this.reporter.error("Encoding of string type: "+c+" unsupported")},s.prototype._encodeObjid=function(n,c,h){if(typeof n=="string"){if(!c)return this.reporter.error("string objid given, but no values map found");if(!c.hasOwnProperty(n))return this.reporter.error("objid not found in values map");n=c[n].split(/[\s\.]+/g);for(var l=0;l<n.length;l++)n[l]|=0}else if(Array.isArray(n)){n=n.slice();for(var l=0;l<n.length;l++)n[l]|=0}if(!Array.isArray(n))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(n));if(!h){if(n[1]>=40)return this.reporter.error("Second objid identifier OOB");n.splice(0,2,n[0]*40+n[1])}for(var b=0,l=0;l<n.length;l++){var p=n[l];for(b++;p>=128;p>>=7)b++}for(var y=new e(b),v=y.length-1,l=n.length-1;l>=0;l--){var p=n[l];for(y[v--]=p&127;(p>>=7)>0;)y[v--]=128|p&127}return this._createEncoderBuffer(y)};function a(f){return f<10?"0"+f:f}s.prototype._encodeTime=function(n,c){var h,l=new Date(n);return c==="gentime"?h=[a(l.getFullYear()),a(l.getUTCMonth()+1),a(l.getUTCDate()),a(l.getUTCHours()),a(l.getUTCMinutes()),a(l.getUTCSeconds()),"Z"].join(""):c==="utctime"?h=[a(l.getFullYear()%100),a(l.getUTCMonth()+1),a(l.getUTCDate()),a(l.getUTCHours()),a(l.getUTCMinutes()),a(l.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+c+" time is not supported yet"),this._encodeStr(h,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(n,c){if(typeof n=="string"){if(!c)return this.reporter.error("String int or enum given, but no values map");if(!c.hasOwnProperty(n))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(n));n=c[n]}if(typeof n!="number"&&!e.isBuffer(n)){var h=n.toArray();!n.sign&&h[0]&128&&h.unshift(0),n=new e(h)}if(e.isBuffer(n)){var l=n.length;n.length===0&&l++;var p=new e(l);return n.copy(p),n.length===0&&(p[0]=0),this._createEncoderBuffer(p)}if(n<128)return this._createEncoderBuffer(n);if(n<256)return this._createEncoderBuffer([0,n]);for(var l=1,b=n;b>=256;b>>=8)l++;for(var p=new Array(l),b=p.length-1;b>=0;b--)p[b]=n&255,n>>=8;return p[0]&128&&p.unshift(0),this._createEncoderBuffer(new e(p))},s.prototype._encodeBool=function(n){return this._createEncoderBuffer(n?255:0)},s.prototype._use=function(n,c){return typeof n=="function"&&(n=n(c)),n._getEncoder("der").tree},s.prototype._skipDefault=function(n,c,h){var l=this._baseState,b;if(l.default===null)return!1;var p=n.join();if(l.defaultBuffer===void 0&&(l.defaultBuffer=this._encodeValue(l.default,c,h).join()),p.length!==l.defaultBuffer.length)return!1;for(b=0;b<p.length;b++)if(p[b]!==l.defaultBuffer[b])return!1;return!0};function o(f,n,c,h){var l;if(f==="seqof"?f="seq":f==="setof"&&(f="set"),u.tagByName.hasOwnProperty(f))l=u.tagByName[f];else if(typeof f=="number"&&(f|0)===f)l=f;else return h.error("Unknown tag: "+f);return l>=31?h.error("Multi-octet tag encoding unsupported"):(n||(l|=32),l|=u.tagClassByName[c||"universal"]<<6,l)}return Ef}var Bf,nh;function c1(){if(nh)return Bf;nh=1;var d=pe(),e=Id();function t(i){e.call(this,i),this.enc="pem"}return d(t,e),Bf=t,t.prototype.encode=function(u,r){for(var s=e.prototype.encode.call(this,u),a=s.toString("base64"),o=["-----BEGIN "+r.label+"-----"],f=0;f<a.length;f+=64)o.push(a.slice(f,f+64));return o.push("-----END "+r.label+"-----"),o.join(`
5
- `)},Bf}var ah;function u1(){return ah||(ah=1,(function(d){var e=d;e.der=Id(),e.pem=c1()})(xf)),xf}var fh;function pr(){return fh||(fh=1,(function(d){var e=d;e.bignum=Te(),e.define=i1().define,e.base=rr(),e.constants=Bd(),e.decoders=o1(),e.encoders=u1()})(lf)),lf}var Rf,sh;function h1(){if(sh)return Rf;sh=1;var d=pr(),e=d.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),t=d.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),i=d.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),u=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())}),r=d.define("RelativeDistinguishedName",function(){this.setof(t)}),s=d.define("RDNSequence",function(){this.seqof(r)}),a=d.define("Name",function(){this.choice({rdnSequence:this.use(s)})}),o=d.define("Validity",function(){this.seq().obj(this.key("notBefore").use(e),this.key("notAfter").use(e))}),f=d.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),n=d.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(i),this.key("issuer").use(a),this.key("validity").use(o),this.key("subject").use(a),this.key("subjectPublicKeyInfo").use(u),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())}),c=d.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(n),this.key("signatureAlgorithm").use(i),this.key("signatureValue").bitstr())});return Rf=c,Rf}var oh;function d1(){if(oh)return vt;oh=1;var d=pr();vt.certificate=h1();var e=d.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())});vt.RSAPrivateKey=e;var t=d.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});vt.RSAPublicKey=t;var i=d.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())}),u=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())});vt.PublicKey=u;var r=d.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())});vt.PrivateKey=r;var s=d.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())});vt.EncryptedPrivateKey=s;var a=d.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())});vt.DSAPrivateKey=a,vt.DSAparam=d.define("DSAparam",function(){this.int()});var o=d.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),f=d.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(o),this.key("publicKey").optional().explicit(1).bitstr())});return vt.ECPrivateKey=f,vt.signature=d.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),vt}const l1={"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 If,ch;function b1(){if(ch)return If;ch=1;var d=/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,e=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,t=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,i=Wr(),u=ps(),r=_e().Buffer;return If=function(s,a){var o=s.toString(),f=o.match(d),n;if(f){var h="aes"+f[1],l=r.from(f[2],"hex"),b=r.from(f[3].replace(/[\r\n]/g,""),"base64"),p=i(a,l.slice(0,8),parseInt(f[1],10)).key,y=[],v=u.createDecipheriv(h,p,l);y.push(v.update(b)),y.push(v.final()),n=r.concat(y)}else{var c=o.match(t);n=r.from(c[2].replace(/[\r\n]/g,""),"base64")}var g=o.match(e)[1];return{tag:g,data:n}},If}var Af,uh;function Jr(){if(uh)return Af;uh=1;var d=d1(),e=l1,t=b1(),i=ps(),u=ds().pbkdf2Sync,r=_e().Buffer;function s(o,f){var n=o.algorithm.decrypt.kde.kdeparams.salt,c=parseInt(o.algorithm.decrypt.kde.kdeparams.iters.toString(),10),h=e[o.algorithm.decrypt.cipher.algo.join(".")],l=o.algorithm.decrypt.cipher.iv,b=o.subjectPrivateKey,p=parseInt(h.split("-")[1],10)/8,y=u(f,n,c,p,"sha1"),v=i.createDecipheriv(h,y,l),g=[];return g.push(v.update(b)),g.push(v.final()),r.concat(g)}function a(o){var f;typeof o=="object"&&!r.isBuffer(o)&&(f=o.passphrase,o=o.key),typeof o=="string"&&(o=r.from(o));var n=t(o,f),c=n.tag,h=n.data,l,b;switch(c){case"CERTIFICATE":b=d.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=d.PublicKey.decode(h,"der")),l=b.algorithm.algorithm.join("."),l){case"1.2.840.113549.1.1.1":return d.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=d.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+l)}case"ENCRYPTED PRIVATE KEY":h=d.EncryptedPrivateKey.decode(h,"der"),h=s(h,f);case"PRIVATE KEY":switch(b=d.PrivateKey.decode(h,"der"),l=b.algorithm.algorithm.join("."),l){case"1.2.840.113549.1.1.1":return d.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:d.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=d.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+l)}case"RSA PUBLIC KEY":return d.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return d.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:d.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return h=d.ECPrivateKey.decode(h,"der"),{curve:h.parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+c)}}return a.signature=d.signature,Af=a,Af}const Ad={"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 hh;function p1(){if(hh)return Xt.exports;hh=1;var d=_e().Buffer,e=fd(),t=vs(),i=ys().ec,u=Te(),r=Jr(),s=Ad,a=1;function o(v,g,x,B,I){var T=r(g);if(T.curve){if(B!=="ecdsa"&&B!=="ecdsa/rsa")throw new Error("wrong private key type");return f(v,T)}else if(T.type==="dsa"){if(B!=="dsa")throw new Error("wrong private key type");return n(v,T,x)}if(B!=="rsa"&&B!=="ecdsa/rsa")throw new Error("wrong private key type");if(g.padding!==void 0&&g.padding!==a)throw new Error("illegal or unsupported padding mode");v=d.concat([I,v]);for(var j=T.modulus.byteLength(),G=[0,1];v.length+G.length+1<j;)G.push(255);G.push(0);for(var z=-1;++z<v.length;)G.push(v[z]);var te=t(G,T);return te}function f(v,g){var x=s[g.curve.join(".")];if(!x)throw new Error("unknown curve "+g.curve.join("."));var B=new i(x),I=B.keyFromPrivate(g.privateKey),T=I.sign(v);return d.from(T.toDER())}function n(v,g,x){for(var B=g.params.priv_key,I=g.params.p,T=g.params.q,j=g.params.g,G=new u(0),z,te=l(v,T).mod(T),ne=!1,$=h(B,T,v,x);ne===!1;)z=p(T,$,x),G=y(j,z,I,T),ne=z.invm(T).imul(te.add(B.mul(G))).mod(T),ne.cmpn(0)===0&&(ne=!1,G=new u(0));return c(G,ne)}function c(v,g){v=v.toArray(),g=g.toArray(),v[0]&128&&(v=[0].concat(v)),g[0]&128&&(g=[0].concat(g));var x=v.length+g.length+4,B=[48,x,2,v.length];return B=B.concat(v,[2,g.length],g),d.from(B)}function h(v,g,x,B){if(v=d.from(v.toArray()),v.length<g.byteLength()){var I=d.alloc(g.byteLength()-v.length);v=d.concat([I,v])}var T=x.length,j=b(x,g),G=d.alloc(T);G.fill(1);var z=d.alloc(T);return z=e(B,z).update(G).update(d.from([0])).update(v).update(j).digest(),G=e(B,z).update(G).digest(),z=e(B,z).update(G).update(d.from([1])).update(v).update(j).digest(),G=e(B,z).update(G).digest(),{k:z,v:G}}function l(v,g){var x=new u(v),B=(v.length<<3)-g.bitLength();return B>0&&x.ishrn(B),x}function b(v,g){v=l(v,g),v=v.mod(g);var x=d.from(v.toArray());if(x.length<g.byteLength()){var B=d.alloc(g.byteLength()-x.length);x=d.concat([B,x])}return x}function p(v,g,x){var B,I;do{for(B=d.alloc(0);B.length*8<v.bitLength();)g.v=e(x,g.k).update(g.v).digest(),B=d.concat([B,g.v]);I=l(B,v),g.k=e(x,g.k).update(g.v).update(d.from([0])).digest(),g.v=e(x,g.k).update(g.v).digest()}while(I.cmp(v)!==-1);return I}function y(v,g,x,B){return v.toRed(u.mont(x)).redPow(g).fromRed().mod(B)}return Xt.exports=o,Xt.exports.getKey=h,Xt.exports.makeKey=p,Xt.exports}var Of,dh;function v1(){if(dh)return Of;dh=1;var d=_e().Buffer,e=Te(),t=ys().ec,i=Jr(),u=Ad;function r(f,n,c,h,l){var b=i(c);if(b.type==="ec"){if(h!=="ecdsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");return s(f,n,b)}else if(b.type==="dsa"){if(h!=="dsa")throw new Error("wrong public key type");return a(f,n,b)}if(h!=="rsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");n=d.concat([l,n]);for(var p=b.modulus.byteLength(),y=[1],v=0;n.length+y.length+2<p;)y.push(255),v+=1;y.push(0);for(var g=-1;++g<n.length;)y.push(n[g]);y=d.from(y);var x=e.mont(b.modulus);f=new e(f).toRed(x),f=f.redPow(new e(b.publicExponent)),f=d.from(f.fromRed().toArray());var B=v<8?1:0;for(p=Math.min(f.length,y.length),f.length!==y.length&&(B=1),g=-1;++g<p;)B|=f[g]^y[g];return B===0}function s(f,n,c){var h=u[c.data.algorithm.curve.join(".")];if(!h)throw new Error("unknown curve "+c.data.algorithm.curve.join("."));var l=new t(h),b=c.data.subjectPrivateKey.data;return l.verify(n,f,b)}function a(f,n,c){var h=c.data.p,l=c.data.q,b=c.data.g,p=c.data.pub_key,y=i.signature.decode(f,"der"),v=y.s,g=y.r;o(v,l),o(g,l);var x=e.mont(h),B=v.invm(l),I=b.toRed(x).redPow(new e(n).mul(B).mod(l)).fromRed().mul(p.toRed(x).redPow(g.mul(B).mod(l)).fromRed()).mod(h).mod(l);return I.cmp(g)===0}function o(f,n){if(f.cmpn(0)<=0)throw new Error("invalid sig");if(f.cmp(n)>=0)throw new Error("invalid sig")}return Of=r,Of}var Pf,lh;function m1(){if(lh)return Pf;lh=1;var d=_e().Buffer,e=hr(),t=rd(),i=pe(),u=p1(),r=v1(),s=sd;Object.keys(s).forEach(function(c){s[c].id=d.from(s[c].id,"hex"),s[c.toLowerCase()]=s[c]});function a(c){t.Writable.call(this);var h=s[c];if(!h)throw new Error("Unknown message digest");this._hashType=h.hash,this._hash=e(h.hash),this._tag=h.id,this._signType=h.sign}i(a,t.Writable),a.prototype._write=function(h,l,b){this._hash.update(h),b()},a.prototype.update=function(h,l){return this._hash.update(typeof h=="string"?d.from(h,l):h),this},a.prototype.sign=function(h,l){this.end();var b=this._hash.digest(),p=u(b,h,this._hashType,this._signType,this._tag);return l?p.toString(l):p};function o(c){t.Writable.call(this);var h=s[c];if(!h)throw new Error("Unknown message digest");this._hash=e(h.hash),this._tag=h.id,this._signType=h.sign}i(o,t.Writable),o.prototype._write=function(h,l,b){this._hash.update(h),b()},o.prototype.update=function(h,l){return this._hash.update(typeof h=="string"?d.from(h,l):h),this},o.prototype.verify=function(h,l,b){var p=typeof l=="string"?d.from(l,b):l;this.end();var y=this._hash.digest();return r(p,y,h,this._signType,this._tag)};function f(c){return new a(c)}function n(c){return new o(c)}return Pf={Sign:f,Verify:n,createSign:f,createVerify:n},Pf}var kf,bh;function y1(){if(bh)return kf;bh=1;var d=ys(),e=Te();kf=function(s){return new i(s)};var t={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}};t.p224=t.secp224r1,t.p256=t.secp256r1=t.prime256v1,t.p192=t.secp192r1=t.prime192v1,t.p384=t.secp384r1,t.p521=t.secp521r1;function i(r){this.curveType=t[r],this.curveType||(this.curveType={name:r}),this.curve=new d.ec(this.curveType.name),this.keys=void 0}i.prototype.generateKeys=function(r,s){return this.keys=this.curve.genKeyPair(),this.getPublicKey(r,s)},i.prototype.computeSecret=function(r,s,a){s=s||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,s));var o=this.curve.keyFromPublic(r).getPublic(),f=o.mul(this.keys.getPrivate()).getX();return u(f,a,this.curveType.byteLength)},i.prototype.getPublicKey=function(r,s){var a=this.keys.getPublic(s==="compressed",!0);return s==="hybrid"&&(a[a.length-1]%2?a[0]=7:a[0]=6),u(a,r)},i.prototype.getPrivateKey=function(r){return u(this.keys.getPrivate(),r)},i.prototype.setPublicKey=function(r,s){return s=s||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,s)),this.keys._importPublic(r),this},i.prototype.setPrivateKey=function(r,s){s=s||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,s));var a=new e(r);return a=a.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(a),this};function u(r,s,a){Array.isArray(r)||(r=r.toArray());var o=new Buffer(r);if(a&&o.length<a){var f=new Buffer(a-o.length);f.fill(0),o=Buffer.concat([f,o])}return s?o.toString(s):o}return kf}var Nf={},Mf,ph;function Od(){if(ph)return Mf;ph=1;var d=hr(),e=_e().Buffer;Mf=function(i,u){for(var r=e.alloc(0),s=0,a;r.length<u;)a=t(s++),r=e.concat([r,d("sha1").update(i).update(a).digest()]);return r.slice(0,u)};function t(i){var u=e.allocUnsafe(4);return u.writeUInt32BE(i,0),u}return Mf}var Cf,vh;function Pd(){return vh||(vh=1,Cf=function(e,t){for(var i=e.length,u=-1;++u<i;)e[u]^=t[u];return e}),Cf}var Tf,mh;function kd(){if(mh)return Tf;mh=1;var d=Te(),e=_e().Buffer;function t(i,u){return e.from(i.toRed(d.mont(u.modulus)).redPow(new d(u.publicExponent)).fromRed().toArray())}return Tf=t,Tf}var Lf,yh;function g1(){if(yh)return Lf;yh=1;var d=Jr(),e=Ut(),t=hr(),i=Od(),u=Pd(),r=Te(),s=kd(),a=vs(),o=_e().Buffer;Lf=function(l,b,p){var y;l.padding?y=l.padding:p?y=1:y=4;var v=d(l),g;if(y===4)g=f(v,b);else if(y===1)g=n(v,b,p);else if(y===3){if(g=new r(b),g.cmp(v.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return p?a(g,v):s(g,v)};function f(h,l){var b=h.modulus.byteLength(),p=l.length,y=t("sha1").update(o.alloc(0)).digest(),v=y.length,g=2*v;if(p>b-g-2)throw new Error("message too long");var x=o.alloc(b-p-g-2),B=b-v-1,I=e(v),T=u(o.concat([y,x,o.alloc(1,1),l],B),i(I,B)),j=u(I,i(T,v));return new r(o.concat([o.alloc(1),j,T],b))}function n(h,l,b){var p=l.length,y=h.modulus.byteLength();if(p>y-11)throw new Error("message too long");var v;return b?v=o.alloc(y-p-3,255):v=c(y-p-3),new r(o.concat([o.from([0,b?1:2]),v,o.alloc(1),l],y))}function c(h){for(var l=o.allocUnsafe(h),b=0,p=e(h*2),y=0,v;b<h;)y===p.length&&(p=e(h*2),y=0),v=p[y++],v&&(l[b++]=v);return l}return Lf}var Df,gh;function w1(){if(gh)return Df;gh=1;var d=Jr(),e=Od(),t=Pd(),i=Te(),u=vs(),r=hr(),s=kd(),a=_e().Buffer;Df=function(h,l,b){var p;h.padding?p=h.padding:b?p=1:p=4;var y=d(h),v=y.modulus.byteLength();if(l.length>v||new i(l).cmp(y.modulus)>=0)throw new Error("decryption error");var g;b?g=s(new i(l),y):g=u(l,y);var x=a.alloc(v-g.length);if(g=a.concat([x,g],v),p===4)return o(y,g);if(p===1)return f(y,g,b);if(p===3)return g;throw new Error("unknown padding")};function o(c,h){var l=c.modulus.byteLength(),b=r("sha1").update(a.alloc(0)).digest(),p=b.length;if(h[0]!==0)throw new Error("decryption error");var y=h.slice(1,p+1),v=h.slice(p+1),g=t(y,e(v,p)),x=t(v,e(g,l-p-1));if(n(b,x.slice(0,p)))throw new Error("decryption error");for(var B=p;x[B]===0;)B++;if(x[B++]!==1)throw new Error("decryption error");return x.slice(B)}function f(c,h,l){for(var b=h.slice(0,2),p=2,y=0;h[p++]!==0;)if(p>=h.length){y++;break}var v=h.slice(2,p-1);if((b.toString("hex")!=="0002"&&!l||b.toString("hex")!=="0001"&&l)&&y++,v.length<8&&y++,y)throw new Error("decryption error");return h.slice(p)}function n(c,h){c=a.from(c),h=a.from(h);var l=0,b=c.length;c.length!==h.length&&(l++,b=Math.min(c.length,h.length));for(var p=-1;++p<b;)l+=c[p]^h[p];return l}return Df}var wh;function _1(){return wh||(wh=1,(function(d){d.publicEncrypt=g1(),d.privateDecrypt=w1(),d.privateEncrypt=function(t,i){return d.publicEncrypt(t,i,!0)},d.publicDecrypt=function(t,i){return d.privateDecrypt(t,i,!0)}})(Nf)),Nf}var Ht={},_h;function S1(){if(_h)return Ht;_h=1;function d(){throw new Error(`secure random number generation not supported by this browser
6
- use chrome, FireFox or Internet Explorer 11`)}var e=_e(),t=Ut(),i=e.Buffer,u=e.kMaxLength,r=Ie.crypto||Ie.msCrypto,s=Math.pow(2,32)-1;function a(h,l){if(typeof h!="number"||h!==h)throw new TypeError("offset must be a number");if(h>s||h<0)throw new TypeError("offset must be a uint32");if(h>u||h>l)throw new RangeError("offset out of range")}function o(h,l,b){if(typeof h!="number"||h!==h)throw new TypeError("size must be a number");if(h>s||h<0)throw new TypeError("size must be a uint32");if(h+l>b||h>u)throw new RangeError("buffer too small")}r&&r.getRandomValues||!process.browser?(Ht.randomFill=f,Ht.randomFillSync=c):(Ht.randomFill=d,Ht.randomFillSync=d);function f(h,l,b,p){if(!i.isBuffer(h)&&!(h instanceof Ie.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof l=="function")p=l,l=0,b=h.length;else if(typeof b=="function")p=b,b=h.length-l;else if(typeof p!="function")throw new TypeError('"cb" argument must be a function');return a(l,h.length),o(b,l,h.length),n(h,l,b,p)}function n(h,l,b,p){if(process.browser){var y=h.buffer,v=new Uint8Array(y,l,b);if(r.getRandomValues(v),p){process.nextTick(function(){p(null,h)});return}return h}if(p){t(b,function(x,B){if(x)return p(x);B.copy(h,l),p(null,h)});return}var g=t(b);return g.copy(h,l),h}function c(h,l,b){if(typeof l>"u"&&(l=0),!i.isBuffer(h)&&!(h instanceof Ie.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return a(l,h.length),b===void 0&&(b=h.length-l),o(b,l,h.length),n(h,l,b)}return Ht}var Sh;function x1(){if(Sh)return xe;Sh=1,xe.randomBytes=xe.rng=xe.pseudoRandomBytes=xe.prng=Ut(),xe.createHash=xe.Hash=hr(),xe.createHmac=xe.Hmac=fd();var d=ol(),e=Object.keys(d),t=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(e);xe.getHashes=function(){return t};var i=ds();xe.pbkdf2=i.pbkdf2,xe.pbkdf2Sync=i.pbkdf2Sync;var u=Il();xe.Cipher=u.Cipher,xe.createCipher=u.createCipher,xe.Cipheriv=u.Cipheriv,xe.createCipheriv=u.createCipheriv,xe.Decipher=u.Decipher,xe.createDecipher=u.createDecipher,xe.Decipheriv=u.Decipheriv,xe.createDecipheriv=u.createDecipheriv,xe.getCiphers=u.getCiphers,xe.listCiphers=u.listCiphers;var r=Fl();xe.DiffieHellmanGroup=r.DiffieHellmanGroup,xe.createDiffieHellmanGroup=r.createDiffieHellmanGroup,xe.getDiffieHellman=r.getDiffieHellman,xe.createDiffieHellman=r.createDiffieHellman,xe.DiffieHellman=r.DiffieHellman;var s=m1();xe.createSign=s.createSign,xe.Sign=s.Sign,xe.createVerify=s.createVerify,xe.Verify=s.Verify,xe.createECDH=y1();var a=_1();xe.publicEncrypt=a.publicEncrypt,xe.privateEncrypt=a.privateEncrypt,xe.publicDecrypt=a.publicDecrypt,xe.privateDecrypt=a.privateDecrypt;var o=S1();return xe.randomFill=o.randomFill,xe.randomFillSync=o.randomFillSync,xe.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
4
+ })`)}catch{a=function(f){this._initNamed(f)}}return t(a,s),a.prototype._initNamed=function(f){s.call(this,f)},new a(this)},u.prototype._getDecoder=function(s){return s=s||"der",this.decoders.hasOwnProperty(s)||(this.decoders[s]=this._createNamed(e.decoders[s])),this.decoders[s]},u.prototype.decode=function(s,a,o){return this._getDecoder(a).decode(s,o)},u.prototype._getEncoder=function(s){return s=s||"der",this.encoders.hasOwnProperty(s)||(this.encoders[s]=this._createNamed(e.encoders[s])),this.encoders[s]},u.prototype.encode=function(s,a,o){return this._getEncoder(a).encode(s,o)}})(vf)),vf}var mf={},yf={},Xu;function c1(){if(Xu)return yf;Xu=1;var d=be();function e(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}yf.Reporter=e,e.prototype.isError=function(u){return u instanceof t},e.prototype.save=function(){var u=this._reporterState;return{obj:u.obj,pathLen:u.path.length}},e.prototype.restore=function(u){var r=this._reporterState;r.obj=u.obj,r.path=r.path.slice(0,u.pathLen)},e.prototype.enterKey=function(u){return this._reporterState.path.push(u)},e.prototype.exitKey=function(u){var r=this._reporterState;r.path=r.path.slice(0,u-1)},e.prototype.leaveKey=function(u,r,s){var a=this._reporterState;this.exitKey(u),a.obj!==null&&(a.obj[r]=s)},e.prototype.path=function(){return this._reporterState.path.join("/")},e.prototype.enterObject=function(){var u=this._reporterState,r=u.obj;return u.obj={},r},e.prototype.leaveObject=function(u){var r=this._reporterState,s=r.obj;return r.obj=u,s},e.prototype.error=function(u){var r,s=this._reporterState,a=u instanceof t;if(a?r=u:r=new t(s.path.map(function(o){return"["+JSON.stringify(o)+"]"}).join(""),u.message||u,u.stack),!s.options.partial)throw r;return a||s.errors.push(r),r},e.prototype.wrapResult=function(u){var r=this._reporterState;return r.options.partial?{result:this.isError(u)?null:u,errors:r.errors}:u};function t(i,u){this.path=i,this.rethrow(u)}return d(t,Error),t.prototype.rethrow=function(u){if(this.message=u+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,t),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this},yf}var Tr={},Qu;function Zu(){if(Qu)return Tr;Qu=1;var d=be(),e=ir().Reporter,t=xt().Buffer;function i(r,s){if(e.call(this,s),!t.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}d(i,e),Tr.DecoderBuffer=i,i.prototype.save=function(){return{offset:this.offset,reporter:e.prototype.save.call(this)}},i.prototype.restore=function(s){var a=new i(this.base);return a.offset=s.offset,a.length=this.offset,this.offset=s.offset,e.prototype.restore.call(this,s.reporter),a},i.prototype.isEmpty=function(){return this.offset===this.length},i.prototype.readUInt8=function(s){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(s||"DecoderBuffer overrun")},i.prototype.skip=function(s,a){if(!(this.offset+s<=this.length))return this.error(a||"DecoderBuffer overrun");var o=new i(this.base);return o._reporterState=this._reporterState,o.offset=this.offset,o.length=this.offset+s,this.offset+=s,o},i.prototype.raw=function(s){return this.base.slice(s?s.offset:this.offset,this.length)};function u(r,s){if(Array.isArray(r))this.length=0,this.value=r.map(function(a){return a instanceof u||(a=new u(a,s)),this.length+=a.length,a},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return s.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=t.byteLength(r);else if(t.isBuffer(r))this.value=r,this.length=r.length;else return s.error("Unsupported type: "+typeof r)}return Tr.EncoderBuffer=u,u.prototype.join=function(s,a){return s||(s=new t(this.length)),a||(a=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(o){o.join(s,a),a+=o.length}):(typeof this.value=="number"?s[a]=this.value:typeof this.value=="string"?s.write(this.value,a):t.isBuffer(this.value)&&this.value.copy(s,a),a+=this.length)),s},Tr}var gf,eh;function u1(){if(eh)return gf;eh=1;var d=ir().Reporter,e=ir().EncoderBuffer,t=ir().DecoderBuffer,i=lt(),u=["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"],r=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(u),s=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function a(f,n){var c={};this._baseState=c,c.enc=f,c.parent=n||null,c.children=null,c.tag=null,c.args=null,c.reverseArgs=null,c.choice=null,c.optional=!1,c.any=!1,c.obj=!1,c.use=null,c.useDecoder=null,c.key=null,c.default=null,c.explicit=null,c.implicit=null,c.contains=null,c.parent||(c.children=[],this._wrap())}gf=a;var o=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return a.prototype.clone=function(){var n=this._baseState,c={};o.forEach(function(l){c[l]=n[l]});var h=new this.constructor(c.parent);return h._baseState=c,h},a.prototype._wrap=function(){var n=this._baseState;r.forEach(function(c){this[c]=function(){var l=new this.constructor(this);return n.children.push(l),l[c].apply(l,arguments)}},this)},a.prototype._init=function(n){var c=this._baseState;i(c.parent===null),n.call(this),c.children=c.children.filter(function(h){return h._baseState.parent===this},this),i.equal(c.children.length,1,"Root node can have only one child")},a.prototype._useArgs=function(n){var c=this._baseState,h=n.filter(function(l){return l instanceof this.constructor},this);n=n.filter(function(l){return!(l instanceof this.constructor)},this),h.length!==0&&(i(c.children===null),c.children=h,h.forEach(function(l){l._baseState.parent=this},this)),n.length!==0&&(i(c.args===null),c.args=n,c.reverseArgs=n.map(function(l){if(typeof l!="object"||l.constructor!==Object)return l;var p={};return Object.keys(l).forEach(function(b){b==(b|0)&&(b|=0);var y=l[b];p[y]=b}),p}))},s.forEach(function(f){a.prototype[f]=function(){var c=this._baseState;throw new Error(f+" not implemented for encoding: "+c.enc)}}),u.forEach(function(f){a.prototype[f]=function(){var c=this._baseState,h=Array.prototype.slice.call(arguments);return i(c.tag===null),c.tag=f,this._useArgs(h),this}}),a.prototype.use=function(n){i(n);var c=this._baseState;return i(c.use===null),c.use=n,this},a.prototype.optional=function(){var n=this._baseState;return n.optional=!0,this},a.prototype.def=function(n){var c=this._baseState;return i(c.default===null),c.default=n,c.optional=!0,this},a.prototype.explicit=function(n){var c=this._baseState;return i(c.explicit===null&&c.implicit===null),c.explicit=n,this},a.prototype.implicit=function(n){var c=this._baseState;return i(c.explicit===null&&c.implicit===null),c.implicit=n,this},a.prototype.obj=function(){var n=this._baseState,c=Array.prototype.slice.call(arguments);return n.obj=!0,c.length!==0&&this._useArgs(c),this},a.prototype.key=function(n){var c=this._baseState;return i(c.key===null),c.key=n,this},a.prototype.any=function(){var n=this._baseState;return n.any=!0,this},a.prototype.choice=function(n){var c=this._baseState;return i(c.choice===null),c.choice=n,this._useArgs(Object.keys(n).map(function(h){return n[h]})),this},a.prototype.contains=function(n){var c=this._baseState;return i(c.use===null),c.contains=n,this},a.prototype._decode=function(n,c){var h=this._baseState;if(h.parent===null)return n.wrapResult(h.children[0]._decode(n,c));var l=h.default,p=!0,b=null;if(h.key!==null&&(b=n.enterKey(h.key)),h.optional){var y=null;if(h.explicit!==null?y=h.explicit:h.implicit!==null?y=h.implicit:h.tag!==null&&(y=h.tag),y===null&&!h.any){var v=n.save();try{h.choice===null?this._decodeGeneric(h.tag,n,c):this._decodeChoice(n,c),p=!0}catch{p=!1}n.restore(v)}else if(p=this._peekTag(n,y,h.any),n.isError(p))return p}var g;if(h.obj&&p&&(g=n.enterObject()),p){if(h.explicit!==null){var x=this._decodeTag(n,h.explicit);if(n.isError(x))return x;n=x}var B=n.offset;if(h.use===null&&h.choice===null){if(h.any)var v=n.save();var R=this._decodeTag(n,h.implicit!==null?h.implicit:h.tag,h.any);if(n.isError(R))return R;h.any?l=n.raw(v):n=R}if(c&&c.track&&h.tag!==null&&c.track(n.path(),B,n.length,"tagged"),c&&c.track&&h.tag!==null&&c.track(n.path(),n.offset,n.length,"content"),h.any?l=l:h.choice===null?l=this._decodeGeneric(h.tag,n,c):l=this._decodeChoice(n,c),n.isError(l))return l;if(!h.any&&h.choice===null&&h.children!==null&&h.children.forEach(function(G){G._decode(n,c)}),h.contains&&(h.tag==="octstr"||h.tag==="bitstr")){var T=new t(l);l=this._getUse(h.contains,n._reporterState.obj)._decode(T,c)}}return h.obj&&p&&(l=n.leaveObject(g)),h.key!==null&&(l!==null||p===!0)?n.leaveKey(b,h.key,l):b!==null&&n.exitKey(b),l},a.prototype._decodeGeneric=function(n,c,h){var l=this._baseState;return n==="seq"||n==="set"?null:n==="seqof"||n==="setof"?this._decodeList(c,n,l.args[0],h):/str$/.test(n)?this._decodeStr(c,n,h):n==="objid"&&l.args?this._decodeObjid(c,l.args[0],l.args[1],h):n==="objid"?this._decodeObjid(c,null,null,h):n==="gentime"||n==="utctime"?this._decodeTime(c,n,h):n==="null_"?this._decodeNull(c,h):n==="bool"?this._decodeBool(c,h):n==="objDesc"?this._decodeStr(c,n,h):n==="int"||n==="enum"?this._decodeInt(c,l.args&&l.args[0],h):l.use!==null?this._getUse(l.use,c._reporterState.obj)._decode(c,h):c.error("unknown tag: "+n)},a.prototype._getUse=function(n,c){var h=this._baseState;return h.useDecoder=this._use(n,c),i(h.useDecoder._baseState.parent===null),h.useDecoder=h.useDecoder._baseState.children[0],h.implicit!==h.useDecoder._baseState.implicit&&(h.useDecoder=h.useDecoder.clone(),h.useDecoder._baseState.implicit=h.implicit),h.useDecoder},a.prototype._decodeChoice=function(n,c){var h=this._baseState,l=null,p=!1;return Object.keys(h.choice).some(function(b){var y=n.save(),v=h.choice[b];try{var g=v._decode(n,c);if(n.isError(g))return!1;l={type:b,value:g},p=!0}catch{return n.restore(y),!1}return!0},this),p?l:n.error("Choice not matched")},a.prototype._createEncoderBuffer=function(n){return new e(n,this.reporter)},a.prototype._encode=function(n,c,h){var l=this._baseState;if(!(l.default!==null&&l.default===n)){var p=this._encodeValue(n,c,h);if(p!==void 0&&!this._skipDefault(p,c,h))return p}},a.prototype._encodeValue=function(n,c,h){var l=this._baseState;if(l.parent===null)return l.children[0]._encode(n,c||new d);var v=null;if(this.reporter=c,l.optional&&n===void 0)if(l.default!==null)n=l.default;else return;var p=null,b=!1;if(l.any)v=this._createEncoderBuffer(n);else if(l.choice)v=this._encodeChoice(n,c);else if(l.contains)p=this._getUse(l.contains,h)._encode(n,c),b=!0;else if(l.children)p=l.children.map(function(B){if(B._baseState.tag==="null_")return B._encode(null,c,n);if(B._baseState.key===null)return c.error("Child should have a key");var R=c.enterKey(B._baseState.key);if(typeof n!="object")return c.error("Child expected, but input is not object");var T=B._encode(n[B._baseState.key],c,n);return c.leaveKey(R),T},this).filter(function(B){return B}),p=this._createEncoderBuffer(p);else if(l.tag==="seqof"||l.tag==="setof"){if(!(l.args&&l.args.length===1))return c.error("Too many args for : "+l.tag);if(!Array.isArray(n))return c.error("seqof/setof, but data is not Array");var y=this.clone();y._baseState.implicit=null,p=this._createEncoderBuffer(n.map(function(B){var R=this._baseState;return this._getUse(R.args[0],n)._encode(B,c)},y))}else l.use!==null?v=this._getUse(l.use,h)._encode(n,c):(p=this._encodePrimitive(l.tag,n),b=!0);var v;if(!l.any&&l.choice===null){var g=l.implicit!==null?l.implicit:l.tag,x=l.implicit===null?"universal":"context";g===null?l.use===null&&c.error("Tag could be omitted only for .use()"):l.use===null&&(v=this._encodeComposite(g,b,x,p))}return l.explicit!==null&&(v=this._encodeComposite(l.explicit,!1,"context",v)),v},a.prototype._encodeChoice=function(n,c){var h=this._baseState,l=h.choice[n.type];return l||i(!1,n.type+" not found in "+JSON.stringify(Object.keys(h.choice))),l._encode(n.value,c)},a.prototype._encodePrimitive=function(n,c){var h=this._baseState;if(/str$/.test(n))return this._encodeStr(c,n);if(n==="objid"&&h.args)return this._encodeObjid(c,h.reverseArgs[0],h.args[1]);if(n==="objid")return this._encodeObjid(c,null,null);if(n==="gentime"||n==="utctime")return this._encodeTime(c,n);if(n==="null_")return this._encodeNull();if(n==="int"||n==="enum")return this._encodeInt(c,h.args&&h.reverseArgs[0]);if(n==="bool")return this._encodeBool(c);if(n==="objDesc")return this._encodeStr(c,n);throw new Error("Unsupported tag: "+n)},a.prototype._isNumstr=function(n){return/^[0-9 ]*$/.test(n)},a.prototype._isPrintstr=function(n){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(n)},gf}var th;function ir(){return th||(th=1,(function(d){var e=d;e.Reporter=c1().Reporter,e.DecoderBuffer=Zu().DecoderBuffer,e.EncoderBuffer=Zu().EncoderBuffer,e.Node=u1()})(mf)),mf}var wf={},_f={},rh;function h1(){return rh||(rh=1,(function(d){var e=Pd();d.tagClass={0:"universal",1:"application",2:"context",3:"private"},d.tagClassByName=e._reverse(d.tagClass),d.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"},d.tagByName=e._reverse(d.tag)})(_f)),_f}var ih;function Pd(){return ih||(ih=1,(function(d){var e=d;e._reverse=function(i){var u={};return Object.keys(i).forEach(function(r){(r|0)==r&&(r=r|0);var s=i[r];u[s]=r}),u},e.der=h1()})(wf)),wf}var Sf={},xf,nh;function Nd(){if(nh)return xf;nh=1;var d=be(),e=mr(),t=e.base,i=e.bignum,u=e.constants.der;function r(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new s,this.tree._init(f.body)}xf=r,r.prototype.decode=function(n,c){return n instanceof t.DecoderBuffer||(n=new t.DecoderBuffer(n,c)),this.tree._decode(n,c)};function s(f){t.Node.call(this,"der",f)}d(s,t.Node),s.prototype._peekTag=function(n,c,h){if(n.isEmpty())return!1;var l=n.save(),p=a(n,'Failed to peek tag: "'+c+'"');return n.isError(p)?p:(n.restore(l),p.tag===c||p.tagStr===c||p.tagStr+"of"===c||h)},s.prototype._decodeTag=function(n,c,h){var l=a(n,'Failed to decode tag of "'+c+'"');if(n.isError(l))return l;var p=o(n,l.primitive,'Failed to get length of "'+c+'"');if(n.isError(p))return p;if(!h&&l.tag!==c&&l.tagStr!==c&&l.tagStr+"of"!==c)return n.error('Failed to match tag: "'+c+'"');if(l.primitive||p!==null)return n.skip(p,'Failed to match body of: "'+c+'"');var b=n.save(),y=this._skipUntilEnd(n,'Failed to skip indefinite length body: "'+this.tag+'"');return n.isError(y)?y:(p=n.offset-b.offset,n.restore(b),n.skip(p,'Failed to match body of: "'+c+'"'))},s.prototype._skipUntilEnd=function(n,c){for(;;){var h=a(n,c);if(n.isError(h))return h;var l=o(n,h.primitive,c);if(n.isError(l))return l;var p;if(h.primitive||l!==null?p=n.skip(l):p=this._skipUntilEnd(n,c),n.isError(p))return p;if(h.tagStr==="end")break}},s.prototype._decodeList=function(n,c,h,l){for(var p=[];!n.isEmpty();){var b=this._peekTag(n,"end");if(n.isError(b))return b;var y=h.decode(n,"der",l);if(n.isError(y)&&b)break;p.push(y)}return p},s.prototype._decodeStr=function(n,c){if(c==="bitstr"){var h=n.readUInt8();return n.isError(h)?h:{unused:h,data:n.raw()}}else if(c==="bmpstr"){var l=n.raw();if(l.length%2===1)return n.error("Decoding of string type: bmpstr length mismatch");for(var p="",b=0;b<l.length/2;b++)p+=String.fromCharCode(l.readUInt16BE(b*2));return p}else if(c==="numstr"){var y=n.raw().toString("ascii");return this._isNumstr(y)?y:n.error("Decoding of string type: numstr unsupported characters")}else{if(c==="octstr")return n.raw();if(c==="objDesc")return n.raw();if(c==="printstr"){var v=n.raw().toString("ascii");return this._isPrintstr(v)?v:n.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(c)?n.raw().toString():n.error("Decoding of string type: "+c+" unsupported")}},s.prototype._decodeObjid=function(n,c,h){for(var l,p=[],b=0;!n.isEmpty();){var y=n.readUInt8();b<<=7,b|=y&127,(y&128)===0&&(p.push(b),b=0)}y&128&&p.push(b);var v=p[0]/40|0,g=p[0]%40;if(h?l=p:l=[v,g].concat(p.slice(1)),c){var x=c[l.join(" ")];x===void 0&&(x=c[l.join(".")]),x!==void 0&&(l=x)}return l},s.prototype._decodeTime=function(n,c){var h=n.raw().toString();if(c==="gentime")var l=h.slice(0,4)|0,p=h.slice(4,6)|0,b=h.slice(6,8)|0,y=h.slice(8,10)|0,v=h.slice(10,12)|0,g=h.slice(12,14)|0;else if(c==="utctime"){var l=h.slice(0,2)|0,p=h.slice(2,4)|0,b=h.slice(4,6)|0,y=h.slice(6,8)|0,v=h.slice(8,10)|0,g=h.slice(10,12)|0;l<70?l=2e3+l:l=1900+l}else return n.error("Decoding "+c+" time is not supported yet");return Date.UTC(l,p-1,b,y,v,g,0)},s.prototype._decodeNull=function(n){return null},s.prototype._decodeBool=function(n){var c=n.readUInt8();return n.isError(c)?c:c!==0},s.prototype._decodeInt=function(n,c){var h=n.raw(),l=new i(h);return c&&(l=c[l.toString(10)]||l),l},s.prototype._use=function(n,c){return typeof n=="function"&&(n=n(c)),n._getDecoder("der").tree};function a(f,n){var c=f.readUInt8(n);if(f.isError(c))return c;var h=u.tagClass[c>>6],l=(c&32)===0;if((c&31)===31){var p=c;for(c=0;(p&128)===128;){if(p=f.readUInt8(n),f.isError(p))return p;c<<=7,c|=p&127}}else c&=31;var b=u.tag[c];return{cls:h,primitive:l,tag:c,tagStr:b}}function o(f,n,c){var h=f.readUInt8(c);if(f.isError(h))return h;if(!n&&h===128)return null;if((h&128)===0)return h;var l=h&127;if(l>4)return f.error("length octect is too long");h=0;for(var p=0;p<l;p++){h<<=8;var b=f.readUInt8(c);if(f.isError(b))return b;h|=b}return h}return xf}var Ef,ah;function d1(){if(ah)return Ef;ah=1;var d=be(),e=xt().Buffer,t=Nd();function i(u){t.call(this,u),this.enc="pem"}return d(i,t),Ef=i,i.prototype.decode=function(r,s){for(var a=r.toString().split(/[\r\n]+/g),o=s.label.toUpperCase(),f=/^-----(BEGIN|END) ([^-]+)-----$/,n=-1,c=-1,h=0;h<a.length;h++){var l=a[h].match(f);if(l!==null&&l[2]===o)if(n===-1){if(l[1]!=="BEGIN")break;n=h}else{if(l[1]!=="END")break;c=h;break}}if(n===-1||c===-1)throw new Error("PEM section not found for: "+o);var p=a.slice(n+1,c).join("");p.replace(/[^a-z0-9\+\/=]+/gi,"");var b=new e(p,"base64");return t.prototype.decode.call(this,b,s)},Ef}var fh;function l1(){return fh||(fh=1,(function(d){var e=d;e.der=Nd(),e.pem=d1()})(Sf)),Sf}var Bf={},If,sh;function kd(){if(sh)return If;sh=1;var d=be(),e=xt().Buffer,t=mr(),i=t.base,u=t.constants.der;function r(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new s,this.tree._init(f.body)}If=r,r.prototype.encode=function(n,c){return this.tree._encode(n,c).join()};function s(f){i.Node.call(this,"der",f)}d(s,i.Node),s.prototype._encodeComposite=function(n,c,h,l){var p=o(n,c,h,this.reporter);if(l.length<128){var v=new e(2);return v[0]=p,v[1]=l.length,this._createEncoderBuffer([v,l])}for(var b=1,y=l.length;y>=256;y>>=8)b++;var v=new e(2+b);v[0]=p,v[1]=128|b;for(var y=1+b,g=l.length;g>0;y--,g>>=8)v[y]=g&255;return this._createEncoderBuffer([v,l])},s.prototype._encodeStr=function(n,c){if(c==="bitstr")return this._createEncoderBuffer([n.unused|0,n.data]);if(c==="bmpstr"){for(var h=new e(n.length*2),l=0;l<n.length;l++)h.writeUInt16BE(n.charCodeAt(l),l*2);return this._createEncoderBuffer(h)}else return c==="numstr"?this._isNumstr(n)?this._createEncoderBuffer(n):this.reporter.error("Encoding of string type: numstr supports only digits and space"):c==="printstr"?this._isPrintstr(n)?this._createEncoderBuffer(n):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(c)?this._createEncoderBuffer(n):c==="objDesc"?this._createEncoderBuffer(n):this.reporter.error("Encoding of string type: "+c+" unsupported")},s.prototype._encodeObjid=function(n,c,h){if(typeof n=="string"){if(!c)return this.reporter.error("string objid given, but no values map found");if(!c.hasOwnProperty(n))return this.reporter.error("objid not found in values map");n=c[n].split(/[\s\.]+/g);for(var l=0;l<n.length;l++)n[l]|=0}else if(Array.isArray(n)){n=n.slice();for(var l=0;l<n.length;l++)n[l]|=0}if(!Array.isArray(n))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(n));if(!h){if(n[1]>=40)return this.reporter.error("Second objid identifier OOB");n.splice(0,2,n[0]*40+n[1])}for(var p=0,l=0;l<n.length;l++){var b=n[l];for(p++;b>=128;b>>=7)p++}for(var y=new e(p),v=y.length-1,l=n.length-1;l>=0;l--){var b=n[l];for(y[v--]=b&127;(b>>=7)>0;)y[v--]=128|b&127}return this._createEncoderBuffer(y)};function a(f){return f<10?"0"+f:f}s.prototype._encodeTime=function(n,c){var h,l=new Date(n);return c==="gentime"?h=[a(l.getFullYear()),a(l.getUTCMonth()+1),a(l.getUTCDate()),a(l.getUTCHours()),a(l.getUTCMinutes()),a(l.getUTCSeconds()),"Z"].join(""):c==="utctime"?h=[a(l.getFullYear()%100),a(l.getUTCMonth()+1),a(l.getUTCDate()),a(l.getUTCHours()),a(l.getUTCMinutes()),a(l.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+c+" time is not supported yet"),this._encodeStr(h,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(n,c){if(typeof n=="string"){if(!c)return this.reporter.error("String int or enum given, but no values map");if(!c.hasOwnProperty(n))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(n));n=c[n]}if(typeof n!="number"&&!e.isBuffer(n)){var h=n.toArray();!n.sign&&h[0]&128&&h.unshift(0),n=new e(h)}if(e.isBuffer(n)){var l=n.length;n.length===0&&l++;var b=new e(l);return n.copy(b),n.length===0&&(b[0]=0),this._createEncoderBuffer(b)}if(n<128)return this._createEncoderBuffer(n);if(n<256)return this._createEncoderBuffer([0,n]);for(var l=1,p=n;p>=256;p>>=8)l++;for(var b=new Array(l),p=b.length-1;p>=0;p--)b[p]=n&255,n>>=8;return b[0]&128&&b.unshift(0),this._createEncoderBuffer(new e(b))},s.prototype._encodeBool=function(n){return this._createEncoderBuffer(n?255:0)},s.prototype._use=function(n,c){return typeof n=="function"&&(n=n(c)),n._getEncoder("der").tree},s.prototype._skipDefault=function(n,c,h){var l=this._baseState,p;if(l.default===null)return!1;var b=n.join();if(l.defaultBuffer===void 0&&(l.defaultBuffer=this._encodeValue(l.default,c,h).join()),b.length!==l.defaultBuffer.length)return!1;for(p=0;p<b.length;p++)if(b[p]!==l.defaultBuffer[p])return!1;return!0};function o(f,n,c,h){var l;if(f==="seqof"?f="seq":f==="setof"&&(f="set"),u.tagByName.hasOwnProperty(f))l=u.tagByName[f];else if(typeof f=="number"&&(f|0)===f)l=f;else return h.error("Unknown tag: "+f);return l>=31?h.error("Multi-octet tag encoding unsupported"):(n||(l|=32),l|=u.tagClassByName[c||"universal"]<<6,l)}return If}var Rf,oh;function p1(){if(oh)return Rf;oh=1;var d=be(),e=kd();function t(i){e.call(this,i),this.enc="pem"}return d(t,e),Rf=t,t.prototype.encode=function(u,r){for(var s=e.prototype.encode.call(this,u),a=s.toString("base64"),o=["-----BEGIN "+r.label+"-----"],f=0;f<a.length;f+=64)o.push(a.slice(f,f+64));return o.push("-----END "+r.label+"-----"),o.join(`
5
+ `)},Rf}var ch;function b1(){return ch||(ch=1,(function(d){var e=d;e.der=kd(),e.pem=p1()})(Bf)),Bf}var uh;function mr(){return uh||(uh=1,(function(d){var e=d;e.bignum=Te(),e.define=o1().define,e.base=ir(),e.constants=Pd(),e.decoders=l1(),e.encoders=b1()})(bf)),bf}var Af,hh;function v1(){if(hh)return Af;hh=1;var d=mr(),e=d.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),t=d.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),i=d.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),u=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())}),r=d.define("RelativeDistinguishedName",function(){this.setof(t)}),s=d.define("RDNSequence",function(){this.seqof(r)}),a=d.define("Name",function(){this.choice({rdnSequence:this.use(s)})}),o=d.define("Validity",function(){this.seq().obj(this.key("notBefore").use(e),this.key("notAfter").use(e))}),f=d.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),n=d.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(i),this.key("issuer").use(a),this.key("validity").use(o),this.key("subject").use(a),this.key("subjectPublicKeyInfo").use(u),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())}),c=d.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(n),this.key("signatureAlgorithm").use(i),this.key("signatureValue").bitstr())});return Af=c,Af}var dh;function m1(){if(dh)return vt;dh=1;var d=mr();vt.certificate=v1();var e=d.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())});vt.RSAPrivateKey=e;var t=d.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});vt.RSAPublicKey=t;var i=d.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())}),u=d.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())});vt.PublicKey=u;var r=d.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())});vt.PrivateKey=r;var s=d.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())});vt.EncryptedPrivateKey=s;var a=d.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())});vt.DSAPrivateKey=a,vt.DSAparam=d.define("DSAparam",function(){this.int()});var o=d.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),f=d.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(o),this.key("publicKey").optional().explicit(1).bitstr())});return vt.ECPrivateKey=f,vt.signature=d.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),vt}const y1={"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 Of,lh;function g1(){if(lh)return Of;lh=1;var d=/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,e=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,t=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,i=Jr(),u=ms(),r=_e().Buffer;return Of=function(s,a){var o=s.toString(),f=o.match(d),n;if(f){var h="aes"+f[1],l=r.from(f[2],"hex"),p=r.from(f[3].replace(/[\r\n]/g,""),"base64"),b=i(a,l.slice(0,8),parseInt(f[1],10)).key,y=[],v=u.createDecipheriv(h,b,l);y.push(v.update(p)),y.push(v.final()),n=r.concat(y)}else{var c=o.match(t);n=r.from(c[2].replace(/[\r\n]/g,""),"base64")}var g=o.match(e)[1];return{tag:g,data:n}},Of}var Pf,ph;function Qr(){if(ph)return Pf;ph=1;var d=m1(),e=y1,t=g1(),i=ms(),u=ps().pbkdf2Sync,r=_e().Buffer;function s(o,f){var n=o.algorithm.decrypt.kde.kdeparams.salt,c=parseInt(o.algorithm.decrypt.kde.kdeparams.iters.toString(),10),h=e[o.algorithm.decrypt.cipher.algo.join(".")],l=o.algorithm.decrypt.cipher.iv,p=o.subjectPrivateKey,b=parseInt(h.split("-")[1],10)/8,y=u(f,n,c,b,"sha1"),v=i.createDecipheriv(h,y,l),g=[];return g.push(v.update(p)),g.push(v.final()),r.concat(g)}function a(o){var f;typeof o=="object"&&!r.isBuffer(o)&&(f=o.passphrase,o=o.key),typeof o=="string"&&(o=r.from(o));var n=t(o,f),c=n.tag,h=n.data,l,p;switch(c){case"CERTIFICATE":p=d.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(p||(p=d.PublicKey.decode(h,"der")),l=p.algorithm.algorithm.join("."),l){case"1.2.840.113549.1.1.1":return d.RSAPublicKey.decode(p.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return p.subjectPrivateKey=p.subjectPublicKey,{type:"ec",data:p};case"1.2.840.10040.4.1":return p.algorithm.params.pub_key=d.DSAparam.decode(p.subjectPublicKey.data,"der"),{type:"dsa",data:p.algorithm.params};default:throw new Error("unknown key id "+l)}case"ENCRYPTED PRIVATE KEY":h=d.EncryptedPrivateKey.decode(h,"der"),h=s(h,f);case"PRIVATE KEY":switch(p=d.PrivateKey.decode(h,"der"),l=p.algorithm.algorithm.join("."),l){case"1.2.840.113549.1.1.1":return d.RSAPrivateKey.decode(p.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:p.algorithm.curve,privateKey:d.ECPrivateKey.decode(p.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return p.algorithm.params.priv_key=d.DSAparam.decode(p.subjectPrivateKey,"der"),{type:"dsa",params:p.algorithm.params};default:throw new Error("unknown key id "+l)}case"RSA PUBLIC KEY":return d.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return d.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:d.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return h=d.ECPrivateKey.decode(h,"der"),{curve:h.parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+c)}}return a.signature=d.signature,Pf=a,Pf}const Md={"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 bh;function w1(){if(bh)return Qt.exports;bh=1;var d=_e().Buffer,e=hd(),t=ys(),i=ws().ec,u=Te(),r=Qr(),s=Md,a=1;function o(v,g,x,B,R){var T=r(g);if(T.curve){if(B!=="ecdsa"&&B!=="ecdsa/rsa")throw new Error("wrong private key type");return f(v,T)}else if(T.type==="dsa"){if(B!=="dsa")throw new Error("wrong private key type");return n(v,T,x)}if(B!=="rsa"&&B!=="ecdsa/rsa")throw new Error("wrong private key type");if(g.padding!==void 0&&g.padding!==a)throw new Error("illegal or unsupported padding mode");v=d.concat([R,v]);for(var j=T.modulus.byteLength(),G=[0,1];v.length+G.length+1<j;)G.push(255);G.push(0);for(var z=-1;++z<v.length;)G.push(v[z]);var te=t(G,T);return te}function f(v,g){var x=s[g.curve.join(".")];if(!x)throw new Error("unknown curve "+g.curve.join("."));var B=new i(x),R=B.keyFromPrivate(g.privateKey),T=R.sign(v);return d.from(T.toDER())}function n(v,g,x){for(var B=g.params.priv_key,R=g.params.p,T=g.params.q,j=g.params.g,G=new u(0),z,te=l(v,T).mod(T),ne=!1,$=h(B,T,v,x);ne===!1;)z=b(T,$,x),G=y(j,z,R,T),ne=z.invm(T).imul(te.add(B.mul(G))).mod(T),ne.cmpn(0)===0&&(ne=!1,G=new u(0));return c(G,ne)}function c(v,g){v=v.toArray(),g=g.toArray(),v[0]&128&&(v=[0].concat(v)),g[0]&128&&(g=[0].concat(g));var x=v.length+g.length+4,B=[48,x,2,v.length];return B=B.concat(v,[2,g.length],g),d.from(B)}function h(v,g,x,B){if(v=d.from(v.toArray()),v.length<g.byteLength()){var R=d.alloc(g.byteLength()-v.length);v=d.concat([R,v])}var T=x.length,j=p(x,g),G=d.alloc(T);G.fill(1);var z=d.alloc(T);return z=e(B,z).update(G).update(d.from([0])).update(v).update(j).digest(),G=e(B,z).update(G).digest(),z=e(B,z).update(G).update(d.from([1])).update(v).update(j).digest(),G=e(B,z).update(G).digest(),{k:z,v:G}}function l(v,g){var x=new u(v),B=(v.length<<3)-g.bitLength();return B>0&&x.ishrn(B),x}function p(v,g){v=l(v,g),v=v.mod(g);var x=d.from(v.toArray());if(x.length<g.byteLength()){var B=d.alloc(g.byteLength()-x.length);x=d.concat([B,x])}return x}function b(v,g,x){var B,R;do{for(B=d.alloc(0);B.length*8<v.bitLength();)g.v=e(x,g.k).update(g.v).digest(),B=d.concat([B,g.v]);R=l(B,v),g.k=e(x,g.k).update(g.v).update(d.from([0])).digest(),g.v=e(x,g.k).update(g.v).digest()}while(R.cmp(v)!==-1);return R}function y(v,g,x,B){return v.toRed(u.mont(x)).redPow(g).fromRed().mod(B)}return Qt.exports=o,Qt.exports.getKey=h,Qt.exports.makeKey=b,Qt.exports}var Nf,vh;function _1(){if(vh)return Nf;vh=1;var d=_e().Buffer,e=Te(),t=ws().ec,i=Qr(),u=Md;function r(f,n,c,h,l){var p=i(c);if(p.type==="ec"){if(h!=="ecdsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");return s(f,n,p)}else if(p.type==="dsa"){if(h!=="dsa")throw new Error("wrong public key type");return a(f,n,p)}if(h!=="rsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");n=d.concat([l,n]);for(var b=p.modulus.byteLength(),y=[1],v=0;n.length+y.length+2<b;)y.push(255),v+=1;y.push(0);for(var g=-1;++g<n.length;)y.push(n[g]);y=d.from(y);var x=e.mont(p.modulus);f=new e(f).toRed(x),f=f.redPow(new e(p.publicExponent)),f=d.from(f.fromRed().toArray());var B=v<8?1:0;for(b=Math.min(f.length,y.length),f.length!==y.length&&(B=1),g=-1;++g<b;)B|=f[g]^y[g];return B===0}function s(f,n,c){var h=u[c.data.algorithm.curve.join(".")];if(!h)throw new Error("unknown curve "+c.data.algorithm.curve.join("."));var l=new t(h),p=c.data.subjectPrivateKey.data;return l.verify(n,f,p)}function a(f,n,c){var h=c.data.p,l=c.data.q,p=c.data.g,b=c.data.pub_key,y=i.signature.decode(f,"der"),v=y.s,g=y.r;o(v,l),o(g,l);var x=e.mont(h),B=v.invm(l),R=p.toRed(x).redPow(new e(n).mul(B).mod(l)).fromRed().mul(b.toRed(x).redPow(g.mul(B).mod(l)).fromRed()).mod(h).mod(l);return R.cmp(g)===0}function o(f,n){if(f.cmpn(0)<=0)throw new Error("invalid sig");if(f.cmp(n)>=0)throw new Error("invalid sig")}return Nf=r,Nf}var kf,mh;function S1(){if(mh)return kf;mh=1;var d=_e().Buffer,e=lr(),t=sd(),i=be(),u=w1(),r=_1(),s=dd;Object.keys(s).forEach(function(c){s[c].id=d.from(s[c].id,"hex"),s[c.toLowerCase()]=s[c]});function a(c){t.Writable.call(this);var h=s[c];if(!h)throw new Error("Unknown message digest");this._hashType=h.hash,this._hash=e(h.hash),this._tag=h.id,this._signType=h.sign}i(a,t.Writable),a.prototype._write=function(h,l,p){this._hash.update(h),p()},a.prototype.update=function(h,l){return this._hash.update(typeof h=="string"?d.from(h,l):h),this},a.prototype.sign=function(h,l){this.end();var p=this._hash.digest(),b=u(p,h,this._hashType,this._signType,this._tag);return l?b.toString(l):b};function o(c){t.Writable.call(this);var h=s[c];if(!h)throw new Error("Unknown message digest");this._hash=e(h.hash),this._tag=h.id,this._signType=h.sign}i(o,t.Writable),o.prototype._write=function(h,l,p){this._hash.update(h),p()},o.prototype.update=function(h,l){return this._hash.update(typeof h=="string"?d.from(h,l):h),this},o.prototype.verify=function(h,l,p){var b=typeof l=="string"?d.from(l,p):l;this.end();var y=this._hash.digest();return r(b,y,h,this._signType,this._tag)};function f(c){return new a(c)}function n(c){return new o(c)}return kf={Sign:f,Verify:n,createSign:f,createVerify:n},kf}var Mf,yh;function x1(){if(yh)return Mf;yh=1;var d=ws(),e=Te();Mf=function(s){return new i(s)};var t={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}};t.p224=t.secp224r1,t.p256=t.secp256r1=t.prime256v1,t.p192=t.secp192r1=t.prime192v1,t.p384=t.secp384r1,t.p521=t.secp521r1;function i(r){this.curveType=t[r],this.curveType||(this.curveType={name:r}),this.curve=new d.ec(this.curveType.name),this.keys=void 0}i.prototype.generateKeys=function(r,s){return this.keys=this.curve.genKeyPair(),this.getPublicKey(r,s)},i.prototype.computeSecret=function(r,s,a){s=s||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,s));var o=this.curve.keyFromPublic(r).getPublic(),f=o.mul(this.keys.getPrivate()).getX();return u(f,a,this.curveType.byteLength)},i.prototype.getPublicKey=function(r,s){var a=this.keys.getPublic(s==="compressed",!0);return s==="hybrid"&&(a[a.length-1]%2?a[0]=7:a[0]=6),u(a,r)},i.prototype.getPrivateKey=function(r){return u(this.keys.getPrivate(),r)},i.prototype.setPublicKey=function(r,s){return s=s||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,s)),this.keys._importPublic(r),this},i.prototype.setPrivateKey=function(r,s){s=s||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,s));var a=new e(r);return a=a.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(a),this};function u(r,s,a){Array.isArray(r)||(r=r.toArray());var o=new Buffer(r);if(a&&o.length<a){var f=new Buffer(a-o.length);f.fill(0),o=Buffer.concat([f,o])}return s?o.toString(s):o}return Mf}var Cf={},Tf,gh;function Cd(){if(gh)return Tf;gh=1;var d=lr(),e=_e().Buffer;Tf=function(i,u){for(var r=e.alloc(0),s=0,a;r.length<u;)a=t(s++),r=e.concat([r,d("sha1").update(i).update(a).digest()]);return r.slice(0,u)};function t(i){var u=e.allocUnsafe(4);return u.writeUInt32BE(i,0),u}return Tf}var Lf,wh;function Td(){return wh||(wh=1,Lf=function(e,t){for(var i=e.length,u=-1;++u<i;)e[u]^=t[u];return e}),Lf}var Df,_h;function Ld(){if(_h)return Df;_h=1;var d=Te(),e=_e().Buffer;function t(i,u){return e.from(i.toRed(d.mont(u.modulus)).redPow(new d(u.publicExponent)).fromRed().toArray())}return Df=t,Df}var Ff,Sh;function E1(){if(Sh)return Ff;Sh=1;var d=Qr(),e=Ht(),t=lr(),i=Cd(),u=Td(),r=Te(),s=Ld(),a=ys(),o=_e().Buffer;Ff=function(l,p,b){var y;l.padding?y=l.padding:b?y=1:y=4;var v=d(l),g;if(y===4)g=f(v,p);else if(y===1)g=n(v,p,b);else if(y===3){if(g=new r(p),g.cmp(v.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return b?a(g,v):s(g,v)};function f(h,l){var p=h.modulus.byteLength(),b=l.length,y=t("sha1").update(o.alloc(0)).digest(),v=y.length,g=2*v;if(b>p-g-2)throw new Error("message too long");var x=o.alloc(p-b-g-2),B=p-v-1,R=e(v),T=u(o.concat([y,x,o.alloc(1,1),l],B),i(R,B)),j=u(R,i(T,v));return new r(o.concat([o.alloc(1),j,T],p))}function n(h,l,p){var b=l.length,y=h.modulus.byteLength();if(b>y-11)throw new Error("message too long");var v;return p?v=o.alloc(y-b-3,255):v=c(y-b-3),new r(o.concat([o.from([0,p?1:2]),v,o.alloc(1),l],y))}function c(h){for(var l=o.allocUnsafe(h),p=0,b=e(h*2),y=0,v;p<h;)y===b.length&&(b=e(h*2),y=0),v=b[y++],v&&(l[p++]=v);return l}return Ff}var Uf,xh;function B1(){if(xh)return Uf;xh=1;var d=Qr(),e=Cd(),t=Td(),i=Te(),u=ys(),r=lr(),s=Ld(),a=_e().Buffer;Uf=function(h,l,p){var b;h.padding?b=h.padding:p?b=1:b=4;var y=d(h),v=y.modulus.byteLength();if(l.length>v||new i(l).cmp(y.modulus)>=0)throw new Error("decryption error");var g;p?g=s(new i(l),y):g=u(l,y);var x=a.alloc(v-g.length);if(g=a.concat([x,g],v),b===4)return o(y,g);if(b===1)return f(y,g,p);if(b===3)return g;throw new Error("unknown padding")};function o(c,h){var l=c.modulus.byteLength(),p=r("sha1").update(a.alloc(0)).digest(),b=p.length;if(h[0]!==0)throw new Error("decryption error");var y=h.slice(1,b+1),v=h.slice(b+1),g=t(y,e(v,b)),x=t(v,e(g,l-b-1));if(n(p,x.slice(0,b)))throw new Error("decryption error");for(var B=b;x[B]===0;)B++;if(x[B++]!==1)throw new Error("decryption error");return x.slice(B)}function f(c,h,l){for(var p=h.slice(0,2),b=2,y=0;h[b++]!==0;)if(b>=h.length){y++;break}var v=h.slice(2,b-1);if((p.toString("hex")!=="0002"&&!l||p.toString("hex")!=="0001"&&l)&&y++,v.length<8&&y++,y)throw new Error("decryption error");return h.slice(b)}function n(c,h){c=a.from(c),h=a.from(h);var l=0,p=c.length;c.length!==h.length&&(l++,p=Math.min(c.length,h.length));for(var b=-1;++b<p;)l+=c[b]^h[b];return l}return Uf}var Eh;function I1(){return Eh||(Eh=1,(function(d){d.publicEncrypt=E1(),d.privateDecrypt=B1(),d.privateEncrypt=function(t,i){return d.publicEncrypt(t,i,!0)},d.publicDecrypt=function(t,i){return d.privateDecrypt(t,i,!0)}})(Cf)),Cf}var Kt={},Bh;function R1(){if(Bh)return Kt;Bh=1;function d(){throw new Error(`secure random number generation not supported by this browser
6
+ use chrome, FireFox or Internet Explorer 11`)}var e=_e(),t=Ht(),i=e.Buffer,u=e.kMaxLength,r=Re.crypto||Re.msCrypto,s=Math.pow(2,32)-1;function a(h,l){if(typeof h!="number"||h!==h)throw new TypeError("offset must be a number");if(h>s||h<0)throw new TypeError("offset must be a uint32");if(h>u||h>l)throw new RangeError("offset out of range")}function o(h,l,p){if(typeof h!="number"||h!==h)throw new TypeError("size must be a number");if(h>s||h<0)throw new TypeError("size must be a uint32");if(h+l>p||h>u)throw new RangeError("buffer too small")}r&&r.getRandomValues||!process.browser?(Kt.randomFill=f,Kt.randomFillSync=c):(Kt.randomFill=d,Kt.randomFillSync=d);function f(h,l,p,b){if(!i.isBuffer(h)&&!(h instanceof Re.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof l=="function")b=l,l=0,p=h.length;else if(typeof p=="function")b=p,p=h.length-l;else if(typeof b!="function")throw new TypeError('"cb" argument must be a function');return a(l,h.length),o(p,l,h.length),n(h,l,p,b)}function n(h,l,p,b){if(process.browser){var y=h.buffer,v=new Uint8Array(y,l,p);if(r.getRandomValues(v),b){process.nextTick(function(){b(null,h)});return}return h}if(b){t(p,function(x,B){if(x)return b(x);B.copy(h,l),b(null,h)});return}var g=t(p);return g.copy(h,l),h}function c(h,l,p){if(typeof l>"u"&&(l=0),!i.isBuffer(h)&&!(h instanceof Re.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return a(l,h.length),p===void 0&&(p=h.length-l),o(p,l,h.length),n(h,l,p)}return Kt}var Ih;function A1(){if(Ih)return xe;Ih=1,xe.randomBytes=xe.rng=xe.pseudoRandomBytes=xe.prng=Ht(),xe.createHash=xe.Hash=lr(),xe.createHmac=xe.Hmac=hd();var d=ll(),e=Object.keys(d),t=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(e);xe.getHashes=function(){return t};var i=ps();xe.pbkdf2=i.pbkdf2,xe.pbkdf2Sync=i.pbkdf2Sync;var u=kl();xe.Cipher=u.Cipher,xe.createCipher=u.createCipher,xe.Cipheriv=u.Cipheriv,xe.createCipheriv=u.createCipheriv,xe.Decipher=u.Decipher,xe.createDecipher=u.createDecipher,xe.Decipheriv=u.Decipheriv,xe.createDecipheriv=u.createDecipheriv,xe.getCiphers=u.getCiphers,xe.listCiphers=u.listCiphers;var r=jl();xe.DiffieHellmanGroup=r.DiffieHellmanGroup,xe.createDiffieHellmanGroup=r.createDiffieHellmanGroup,xe.getDiffieHellman=r.getDiffieHellman,xe.createDiffieHellman=r.createDiffieHellman,xe.DiffieHellman=r.DiffieHellman;var s=S1();xe.createSign=s.createSign,xe.Sign=s.Sign,xe.createVerify=s.createVerify,xe.Verify=s.Verify,xe.createECDH=x1();var a=I1();xe.publicEncrypt=a.publicEncrypt,xe.privateEncrypt=a.privateEncrypt,xe.publicDecrypt=a.publicDecrypt,xe.privateDecrypt=a.privateDecrypt;var o=R1();return xe.randomFill=o.randomFill,xe.randomFillSync=o.randomFillSync,xe.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
7
7
  we accept pull requests
8
- https://github.com/browserify/crypto-browserify`)},xe.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},xe}var xh;function vr(){if(xh)return gr.exports;xh=1;var d;gr.exports=function(u){return d||(d=new e(null)),d.generate(u)};function e(i){this.rand=i}if(gr.exports.Rand=e,e.prototype.generate=function(u){return this._rand(u)},e.prototype._rand=function(u){if(this.rand.getBytes)return this.rand.getBytes(u);for(var r=new Uint8Array(u),s=0;s<r.length;s++)r[s]=this.rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(u){var r=new Uint8Array(u);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(u){var r=new Uint8Array(u);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var t=x1();if(typeof t.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(u){return t.randomBytes(u)}}catch{}return gr.exports}var Ff={},qf,Eh;function Nd(){if(Eh)return qf;Eh=1;var d=Te(),e=qt(),t=e.getNAF,i=e.getJSF,u=e.assert;function r(a,o){this.type=a,this.p=new d(o.p,16),this.red=o.prime?d.red(o.prime):d.mont(this.p),this.zero=new d(0).toRed(this.red),this.one=new d(1).toRed(this.red),this.two=new d(2).toRed(this.red),this.n=o.n&&new d(o.n,16),this.g=o.g&&this.pointFromJSON(o.g,o.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))}qf=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(o,f){u(o.precomputed);var n=o._getDoubles(),c=t(f,1,this._bitLength),h=(1<<n.step+1)-(n.step%2===0?2:1);h/=3;for(var l=[],b=0;b<c.length;b+=n.step){for(var p=0,f=b+n.step-1;f>=b;f--)p=(p<<1)+c[f];l.push(p)}for(var y=this.jpoint(null,null,null),v=this.jpoint(null,null,null),g=h;g>0;g--){for(var b=0;b<l.length;b++){var p=l[b];p===g?v=v.mixedAdd(n.points[b]):p===-g&&(v=v.mixedAdd(n.points[b].neg()))}y=y.add(v)}return y.toP()},r.prototype._wnafMul=function(o,f){var n=4,c=o._getNAFPoints(n);n=c.wnd;for(var h=c.points,l=t(f,n,this._bitLength),b=this.jpoint(null,null,null),p=l.length-1;p>=0;p--){for(var f=0;p>=0&&l[p]===0;p--)f++;if(p>=0&&f++,b=b.dblp(f),p<0)break;var y=l[p];u(y!==0),o.type==="affine"?y>0?b=b.mixedAdd(h[y-1>>1]):b=b.mixedAdd(h[-y-1>>1].neg()):y>0?b=b.add(h[y-1>>1]):b=b.add(h[-y-1>>1].neg())}return o.type==="affine"?b.toP():b},r.prototype._wnafMulAdd=function(o,f,n,c,h){for(var l=this._wnafT1,b=this._wnafT2,p=this._wnafT3,y=0,v=0;v<c;v++){var g=f[v],x=g._getNAFPoints(o);l[v]=x.wnd,b[v]=x.points}for(var v=c-1;v>=1;v-=2){var B=v-1,I=v;if(l[B]!==1||l[I]!==1){p[B]=t(n[B],l[B],this._bitLength),p[I]=t(n[I],l[I],this._bitLength),y=Math.max(p[B].length,y),y=Math.max(p[I].length,y);continue}var T=[f[B],null,null,f[I]];f[B].y.cmp(f[I].y)===0?(T[1]=f[B].add(f[I]),T[2]=f[B].toJ().mixedAdd(f[I].neg())):f[B].y.cmp(f[I].y.redNeg())===0?(T[1]=f[B].toJ().mixedAdd(f[I]),T[2]=f[B].add(f[I].neg())):(T[1]=f[B].toJ().mixedAdd(f[I]),T[2]=f[B].toJ().mixedAdd(f[I].neg()));var j=[-3,-1,-5,-7,0,7,5,1,3],G=i(n[B],n[I]);y=Math.max(G[0].length,y),p[B]=new Array(y),p[I]=new Array(y);for(var z=0;z<y;z++){var te=G[0][z]|0,ne=G[1][z]|0;p[B][z]=j[(te+1)*3+(ne+1)],p[I][z]=0,b[B]=T}}for(var $=this.jpoint(null,null,null),k=this._wnafT4,v=y;v>=0;v--){for(var m=0;v>=0;){for(var E=!0,z=0;z<c;z++)k[z]=p[z][v]|0,k[z]!==0&&(E=!1);if(!E)break;m++,v--}if(v>=0&&m++,$=$.dblp(m),v<0)break;for(var z=0;z<c;z++){var O=k[z],g;O!==0&&(O>0?g=b[z][O-1>>1]:O<0&&(g=b[z][-O-1>>1].neg()),g.type==="affine"?$=$.mixedAdd(g):$=$.add(g))}}for(var v=0;v<c;v++)b[v]=null;return h?$:$.toP()};function s(a,o){this.curve=a,this.type=o,this.precomputed=null}return r.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},r.prototype.decodePoint=function(o,f){o=e.toArray(o,f);var n=this.p.byteLength();if((o[0]===4||o[0]===6||o[0]===7)&&o.length-1===2*n){o[0]===6?u(o[o.length-1]%2===0):o[0]===7&&u(o[o.length-1]%2===1);var c=this.point(o.slice(1,1+n),o.slice(1+n,1+2*n));return c}else if((o[0]===2||o[0]===3)&&o.length-1===n)return this.pointFromX(o.slice(1,1+n),o[0]===3);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(o){return this.encode(o,!0)},s.prototype._encode=function(o){var f=this.curve.p.byteLength(),n=this.getX().toArray("be",f);return o?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",f))},s.prototype.encode=function(o,f){return e.encode(this._encode(f),o)},s.prototype.precompute=function(o){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,o),f.beta=this._getBeta(),this.precomputed=f,this},s.prototype._hasDoubles=function(o){if(!this.precomputed)return!1;var f=this.precomputed.doubles;return f?f.points.length>=Math.ceil((o.bitLength()+1)/f.step):!1},s.prototype._getDoubles=function(o,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],c=this,h=0;h<f;h+=o){for(var l=0;l<o;l++)c=c.dbl();n.push(c)}return{step:o,points:n}},s.prototype._getNAFPoints=function(o){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var f=[this],n=(1<<o)-1,c=n===1?null:this.dbl(),h=1;h<n;h++)f[h]=f[h-1].add(c);return{wnd:o,points:f}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(o){for(var f=this,n=0;n<o;n++)f=f.dbl();return f},qf}var Uf,Bh;function E1(){if(Bh)return Uf;Bh=1;var d=qt(),e=Te(),t=pe(),i=Nd(),u=d.assert;function r(o){i.call(this,"short",o),this.a=new e(o.a,16).toRed(this.red),this.b=new e(o.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(o),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}t(r,i),Uf=r,r.prototype._getEndomorphism=function(f){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var n,c;if(f.beta)n=new e(f.beta,16).toRed(this.red);else{var h=this._getEndoRoots(this.p);n=h[0].cmp(h[1])<0?h[0]:h[1],n=n.toRed(this.red)}if(f.lambda)c=new e(f.lambda,16);else{var l=this._getEndoRoots(this.n);this.g.mul(l[0]).x.cmp(this.g.x.redMul(n))===0?c=l[0]:(c=l[1],u(this.g.mul(c).x.cmp(this.g.x.redMul(n))===0))}var b;return f.basis?b=f.basis.map(function(p){return{a:new e(p.a,16),b:new e(p.b,16)}}):b=this._getEndoBasis(c),{beta:n,lambda:c,basis:b}}},r.prototype._getEndoRoots=function(f){var n=f===this.p?this.red:e.mont(f),c=new e(2).toRed(n).redInvm(),h=c.redNeg(),l=new e(3).toRed(n).redNeg().redSqrt().redMul(c),b=h.redAdd(l).fromRed(),p=h.redSub(l).fromRed();return[b,p]},r.prototype._getEndoBasis=function(f){for(var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=f,h=this.n.clone(),l=new e(1),b=new e(0),p=new e(0),y=new e(1),v,g,x,B,I,T,j,G=0,z,te;c.cmpn(0)!==0;){var ne=h.div(c);z=h.sub(ne.mul(c)),te=p.sub(ne.mul(l));var $=y.sub(ne.mul(b));if(!x&&z.cmp(n)<0)v=j.neg(),g=l,x=z.neg(),B=te;else if(x&&++G===2)break;j=z,h=c,c=z,p=l,l=te,y=b,b=$}I=z.neg(),T=te;var k=x.sqr().add(B.sqr()),m=I.sqr().add(T.sqr());return m.cmp(k)>=0&&(I=v,T=g),x.negative&&(x=x.neg(),B=B.neg()),I.negative&&(I=I.neg(),T=T.neg()),[{a:x,b:B},{a:I,b:T}]},r.prototype._endoSplit=function(f){var n=this.endo.basis,c=n[0],h=n[1],l=h.b.mul(f).divRound(this.n),b=c.b.neg().mul(f).divRound(this.n),p=l.mul(c.a),y=b.mul(h.a),v=l.mul(c.b),g=b.mul(h.b),x=f.sub(p).sub(y),B=v.add(g).neg();return{k1:x,k2:B}},r.prototype.pointFromX=function(f,n){f=new e(f,16),f.red||(f=f.toRed(this.red));var c=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),h=c.redSqrt();if(h.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var l=h.fromRed().isOdd();return(n&&!l||!n&&l)&&(h=h.redNeg()),this.point(f,h)},r.prototype.validate=function(f){if(f.inf)return!0;var n=f.x,c=f.y,h=this.a.redMul(n),l=n.redSqr().redMul(n).redIAdd(h).redIAdd(this.b);return c.redSqr().redISub(l).cmpn(0)===0},r.prototype._endoWnafMulAdd=function(f,n,c){for(var h=this._endoWnafT1,l=this._endoWnafT2,b=0;b<f.length;b++){var p=this._endoSplit(n[b]),y=f[b],v=y._getBeta();p.k1.negative&&(p.k1.ineg(),y=y.neg(!0)),p.k2.negative&&(p.k2.ineg(),v=v.neg(!0)),h[b*2]=y,h[b*2+1]=v,l[b*2]=p.k1,l[b*2+1]=p.k2}for(var g=this._wnafMulAdd(1,h,l,b*2,c),x=0;x<b*2;x++)h[x]=null,l[x]=null;return g};function s(o,f,n,c){i.BasePoint.call(this,o,"affine"),f===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(f,16),this.y=new e(n,16),c&&(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(s,i.BasePoint),r.prototype.point=function(f,n,c){return new s(this,f,n,c)},r.prototype.pointFromJSON=function(f,n){return s.fromJSON(this,f,n)},s.prototype._getBeta=function(){if(this.curve.endo){var f=this.precomputed;if(f&&f.beta)return f.beta;var n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var c=this.curve,h=function(l){return c.point(l.x.redMul(c.endo.beta),l.y)};f.beta=n,n.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(h)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(h)}}}return n}},s.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]},s.fromJSON=function(f,n,c){typeof n=="string"&&(n=JSON.parse(n));var h=f.point(n[0],n[1],c);if(!n[2])return h;function l(p){return f.point(p[0],p[1],c)}var b=n[2];return h.precomputed={beta:null,doubles:b.doubles&&{step:b.doubles.step,points:[h].concat(b.doubles.points.map(l))},naf:b.naf&&{wnd:b.naf.wnd,points:[h].concat(b.naf.points.map(l))}},h},s.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)+">"},s.prototype.isInfinity=function(){return this.inf},s.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 n=this.y.redSub(f.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(f.x).redInvm()));var c=n.redSqr().redISub(this.x).redISub(f.x),h=n.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,h)},s.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 n=this.curve.a,c=this.x.redSqr(),h=f.redInvm(),l=c.redAdd(c).redIAdd(c).redIAdd(n).redMul(h),b=l.redSqr().redISub(this.x.redAdd(this.x)),p=l.redMul(this.x.redSub(b)).redISub(this.y);return this.curve.point(b,p)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.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)},s.prototype.mulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l):this.curve._wnafMulAdd(1,h,l,2)},s.prototype.jmulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l,!0):this.curve._wnafMulAdd(1,h,l,2,!0)},s.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)},s.prototype.neg=function(f){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var c=this.precomputed,h=function(l){return l.neg()};n.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(h)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(h)}}}return n},s.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 a(o,f,n,c){i.BasePoint.call(this,o,"jacobian"),f===null&&n===null&&c===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(n,16),this.z=new e(c,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(a,i.BasePoint),r.prototype.jpoint=function(f,n,c){return new a(this,f,n,c)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),n=f.redSqr(),c=this.x.redMul(n),h=this.y.redMul(n).redMul(f);return this.curve.point(c,h)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var n=f.z.redSqr(),c=this.z.redSqr(),h=this.x.redMul(n),l=f.x.redMul(c),b=this.y.redMul(n.redMul(f.z)),p=f.y.redMul(c.redMul(this.z)),y=h.redSub(l),v=b.redSub(p);if(y.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=y.redSqr(),x=g.redMul(y),B=h.redMul(g),I=v.redSqr().redIAdd(x).redISub(B).redISub(B),T=v.redMul(B.redISub(I)).redISub(b.redMul(x)),j=this.z.redMul(f.z).redMul(y);return this.curve.jpoint(I,T,j)},a.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var n=this.z.redSqr(),c=this.x,h=f.x.redMul(n),l=this.y,b=f.y.redMul(n).redMul(this.z),p=c.redSub(h),y=l.redSub(b);if(p.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=p.redSqr(),g=v.redMul(p),x=c.redMul(v),B=y.redSqr().redIAdd(g).redISub(x).redISub(x),I=y.redMul(x.redISub(B)).redISub(l.redMul(g)),T=this.z.redMul(p);return this.curve.jpoint(B,I,T)},a.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 n=this,c=0;c<f;c++)n=n.dbl();return n}for(var h=this.curve.a,l=this.curve.tinv,b=this.x,p=this.y,y=this.z,v=y.redSqr().redSqr(),g=p.redAdd(p),c=0;c<f;c++){var x=b.redSqr(),B=g.redSqr(),I=B.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(h.redMul(v)),j=b.redMul(B),G=T.redSqr().redISub(j.redAdd(j)),z=j.redISub(G),te=T.redMul(z);te=te.redIAdd(te).redISub(I);var ne=g.redMul(y);c+1<f&&(v=v.redMul(I)),b=G,y=ne,g=te}return this.curve.jpoint(b,g.redMul(l),y)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),b=l.redSqr(),p=this.x.redAdd(l).redSqr().redISub(h).redISub(b);p=p.redIAdd(p);var y=h.redAdd(h).redIAdd(h),v=y.redSqr().redISub(p).redISub(p),g=b.redIAdd(b);g=g.redIAdd(g),g=g.redIAdd(g),f=v,n=y.redMul(p.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),B=this.y.redSqr(),I=B.redSqr(),T=this.x.redAdd(B).redSqr().redISub(x).redISub(I);T=T.redIAdd(T);var j=x.redAdd(x).redIAdd(x),G=j.redSqr(),z=I.redIAdd(I);z=z.redIAdd(z),z=z.redIAdd(z),f=G.redISub(T).redISub(T),n=j.redMul(T.redISub(f)).redISub(z),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(f,n,c)},a.prototype._threeDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),b=l.redSqr(),p=this.x.redAdd(l).redSqr().redISub(h).redISub(b);p=p.redIAdd(p);var y=h.redAdd(h).redIAdd(h).redIAdd(this.curve.a),v=y.redSqr().redISub(p).redISub(p);f=v;var g=b.redIAdd(b);g=g.redIAdd(g),g=g.redIAdd(g),n=y.redMul(p.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),B=this.y.redSqr(),I=this.x.redMul(B),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var j=I.redIAdd(I);j=j.redIAdd(j);var G=j.redAdd(j);f=T.redSqr().redISub(G),c=this.y.redAdd(this.z).redSqr().redISub(B).redISub(x);var z=B.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),n=T.redMul(j.redISub(f)).redISub(z)}return this.curve.jpoint(f,n,c)},a.prototype._dbl=function(){var f=this.curve.a,n=this.x,c=this.y,h=this.z,l=h.redSqr().redSqr(),b=n.redSqr(),p=c.redSqr(),y=b.redAdd(b).redIAdd(b).redIAdd(f.redMul(l)),v=n.redAdd(n);v=v.redIAdd(v);var g=v.redMul(p),x=y.redSqr().redISub(g.redAdd(g)),B=g.redISub(x),I=p.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=y.redMul(B).redISub(I),j=c.redAdd(c).redMul(h);return this.curve.jpoint(x,T,j)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),n=this.y.redSqr(),c=this.z.redSqr(),h=n.redSqr(),l=f.redAdd(f).redIAdd(f),b=l.redSqr(),p=this.x.redAdd(n).redSqr().redISub(f).redISub(h);p=p.redIAdd(p),p=p.redAdd(p).redIAdd(p),p=p.redISub(b);var y=p.redSqr(),v=h.redIAdd(h);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var g=l.redIAdd(p).redSqr().redISub(b).redISub(y).redISub(v),x=n.redMul(g);x=x.redIAdd(x),x=x.redIAdd(x);var B=this.x.redMul(y).redISub(x);B=B.redIAdd(B),B=B.redIAdd(B);var I=this.y.redMul(g.redMul(v.redISub(g)).redISub(p.redMul(y)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var T=this.z.redAdd(p).redSqr().redISub(c).redISub(y);return this.curve.jpoint(B,I,T)},a.prototype.mul=function(f,n){return f=new e(f,n),this.curve._wnafMul(this,f)},a.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var n=this.z.redSqr(),c=f.z.redSqr();if(this.x.redMul(c).redISub(f.x.redMul(n)).cmpn(0)!==0)return!1;var h=n.redMul(this.z),l=c.redMul(f.z);return this.y.redMul(l).redISub(f.y.redMul(h)).cmpn(0)===0},a.prototype.eqXToP=function(f){var n=this.z.redSqr(),c=f.toRed(this.curve.red).redMul(n);if(this.x.cmp(c)===0)return!0;for(var h=f.clone(),l=this.curve.redN.redMul(n);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(l),this.x.cmp(c)===0)return!0}},a.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)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Uf}var Rh;function Md(){return Rh||(Rh=1,(function(d){var e=d;e.base=Nd(),e.short=E1()})(Ff)),Ff}var Hf={},Kf,Ih;function B1(){return Ih||(Ih=1,Kf={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"]]}}),Kf}var Ah;function Cd(){return Ah||(Ah=1,(function(d){var e=d,t=br(),i=Md(),u=qt(),r=u.assert;function s(f){if(f.type!=="short")throw new Error("invalid curve type");this.curve=new i.short(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,r(this.g.validate(),"Invalid curve"),r(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=s;function a(f,n){Object.defineProperty(e,f,{configurable:!0,enumerable:!0,get:function(){var c=new s(n);return Object.defineProperty(e,f,{configurable:!0,enumerable:!0,value:c}),c}})}var o;try{o=B1()}catch{o=void 0}a("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",o]})})(Hf)),Hf}var jf,Oh;function R1(){if(Oh)return jf;Oh=1;var d=Te(),e=qt(),t=e.assert;function i(u,r){this.ec=u,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}return jf=i,i.fromPublic=function(r,s,a){return s instanceof i?s:new i(r,{pub:s,pubEnc:a})},i.fromPrivate=function(r,s,a){return s instanceof i?s:new i(r,{priv:s,privEnc:a})},i.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.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"}},i.prototype.getPublic=function(r,s){return typeof r=="string"&&(s=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),s?this.pub.encode(s,r):this.pub},i.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(r,s){this.priv=new d(r,s||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(r,s){if(r.x||r.y){this.ec.curve.type==="mont"?t(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&t(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,s)},i.prototype.derive=function(r){return r.mul(this.priv).getX()},i.prototype.sign=function(r,s,a){return this.ec.sign(r,this,s,a)},i.prototype.verify=function(r,s){return this.ec.verify(r,s,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},jf}var zf,Ph;function I1(){if(Ph)return zf;Ph=1;var d=Te(),e=qt(),t=e.assert;function i(o,f){if(o instanceof i)return o;this._importDER(o,f)||(t(o.r&&o.s,"Signature without r or s"),this.r=new d(o.r,16),this.s=new d(o.s,16),o.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=o.recoveryParam)}zf=i;function u(){this.place=0}function r(o,f){var n=o[f.place++];if(!(n&128))return n;for(var c=n&15,h=0,l=0,b=f.place;l<c;l++,b++)h<<=8,h|=o[b];return f.place=b,h}function s(o){for(var f=0,n=o.length-1;!o[f]&&!(o[f+1]&128)&&f<n;)f++;return f===0?o:o.slice(f)}i.prototype._importDER=function(f,n){f=e.toArray(f,n);var c=new u;if(f[c.place++]!==48)return!1;var h=r(f,c);if(h+c.place!==f.length||f[c.place++]!==2)return!1;var l=r(f,c),b=f.slice(c.place,l+c.place);if(c.place+=l,f[c.place++]!==2)return!1;var p=r(f,c);if(f.length!==p+c.place)return!1;var y=f.slice(c.place,p+c.place);return b[0]===0&&b[1]&128&&(b=b.slice(1)),y[0]===0&&y[1]&128&&(y=y.slice(1)),this.r=new d(b),this.s=new d(y),this.recoveryParam=null,!0};function a(o,f){if(f<128){o.push(f);return}var n=1+(Math.log(f)/Math.LN2>>>3);for(o.push(n|128);--n;)o.push(f>>>(n<<3)&255);o.push(f)}return i.prototype.toDER=function(f){var n=this.r.toArray(),c=this.s.toArray();for(n[0]&128&&(n=[0].concat(n)),c[0]&128&&(c=[0].concat(c)),n=s(n),c=s(c);!c[0]&&!(c[1]&128);)c=c.slice(1);var h=[2];a(h,n.length),h=h.concat(n),h.push(2),a(h,c.length);var l=h.concat(c),b=[48];return a(b,l.length),b=b.concat(l),e.encode(b,f)},zf}var Vf,kh;function A1(){if(kh)return Vf;kh=1;var d=Te(),e=Ed(),t=qt(),i=Cd(),u=vr(),r=t.assert,s=R1(),a=I1();function o(f){if(!(this instanceof o))return new o(f);typeof f=="string"&&(r(i.hasOwnProperty(f),"Unknown curve "+f),f=i[f]),f instanceof i.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 Vf=o,o.prototype.keyPair=function(n){return new s(this,n)},o.prototype.keyFromPrivate=function(n,c){return s.fromPrivate(this,n,c)},o.prototype.keyFromPublic=function(n,c){return s.fromPublic(this,n,c)},o.prototype.genKeyPair=function(n){n||(n={});var c=new e({hash:this.hash,pers:n.pers,persEnc:n.persEnc||"utf8",entropy:n.entropy||u(this.hash.hmacStrength),entropyEnc:n.entropy&&n.entropyEnc||"utf8",nonce:this.n.toArray()}),h=this.n.byteLength(),l=this.n.sub(new d(2));do{var b=new d(c.generate(h));if(!(b.cmp(l)>0))return b.iaddn(1),this.keyFromPrivate(b)}while(!0)},o.prototype._truncateToN=function(n,c){var h=n.byteLength()*8-this.n.bitLength();return h>0&&(n=n.ushrn(h)),!c&&n.cmp(this.n)>=0?n.sub(this.n):n},o.prototype.sign=function(n,c,h,l){typeof h=="object"&&(l=h,h=null),l||(l={}),c=this.keyFromPrivate(c,h),n=this._truncateToN(new d(n,16));for(var b=this.n.byteLength(),p=c.getPrivate().toArray("be",b),y=n.toArray("be",b),v=new e({hash:this.hash,entropy:p,nonce:y,pers:l.pers,persEnc:l.persEnc||"utf8"}),g=this.n.sub(new d(1)),x=0;;x++){var B=l.k?l.k(x):new d(v.generate(this.n.byteLength()));if(B=this._truncateToN(B,!0),!(B.cmpn(1)<=0||B.cmp(g)>=0)){var I=this.g.mul(B);if(!I.isInfinity()){var T=I.getX(),j=T.umod(this.n);if(j.cmpn(0)!==0){var G=B.invm(this.n).mul(j.mul(c.getPrivate()).iadd(n));if(G=G.umod(this.n),G.cmpn(0)!==0){var z=(I.getY().isOdd()?1:0)|(T.cmp(j)!==0?2:0);return l.canonical&&G.cmp(this.nh)>0&&(G=this.n.sub(G),z^=1),new a({r:j,s:G,recoveryParam:z})}}}}}},o.prototype.verify=function(n,c,h,l){n=this._truncateToN(new d(n,16)),h=this.keyFromPublic(h,l),c=new a(c,"hex");var b=c.r,p=c.s;if(b.cmpn(1)<0||b.cmp(this.n)>=0||p.cmpn(1)<0||p.cmp(this.n)>=0)return!1;var y=p.invm(this.n),v=y.mul(n).umod(this.n),g=y.mul(b).umod(this.n);if(!this.curve._maxwellTrick){var x=this.g.mulAdd(v,h.getPublic(),g);return x.isInfinity()?!1:x.getX().umod(this.n).cmp(b)===0}var x=this.g.jmulAdd(v,h.getPublic(),g);return x.isInfinity()?!1:x.eqXToP(b)},o.prototype.recoverPubKey=function(f,n,c,h){r((3&c)===c,"The recovery param is more than two bits"),n=new a(n,h);var l=this.n,b=new d(f),p=n.r,y=n.s,v=c&1,g=c>>1;if(p.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?p=this.curve.pointFromX(p.add(this.curve.n),v):p=this.curve.pointFromX(p,v);var x=n.r.invm(l),B=l.sub(b).mul(x).umod(l),I=y.mul(x).umod(l);return this.g.mulAdd(B,p,I)},o.prototype.getKeyRecoveryParam=function(f,n,c,h){if(n=new a(n,h),n.recoveryParam!==null)return n.recoveryParam;for(var l=0;l<4;l++){var b;try{b=this.recoverPubKey(f,n,l)}catch{continue}if(b.eq(c))return l}throw new Error("Unable to find valid recovery factor")},Vf}var Nh;function O1(){return Nh||(Nh=1,(function(d){var e=d;e.version=Qd.version,e.utils=qt(),e.rand=vr(),e.curve=Md(),e.curves=Cd(),e.ec=A1()})(gi)),gi}var P1=O1();const Td=Gt(P1);var k1=br();const mr=Gt(k1);var N1=ds();const Ld=Gt(N1);var M1=xt();const C1="2.4.0",T1={version:C1};function Z(d,e,t){if(!(this instanceof Z))return new Z(d,e,t);if(d&&(d instanceof ut||d.constructor.name==="BN"||d.constructor.name==="Bn")){ut.call(this,0),d.copy(this),this.negative=d.negative,this.length=d.length,this.red=d.red;return}ut.call(this,d,e,t)}Z.prototype=Object.create(ut.prototype);Z.prototype.constructor=Z;Object.keys(ut).forEach(function(d){Z[d]||(Z[d]=ut[d])});function Xr(d){const e=Buffer.alloc(d.length);for(let t=0;t<d.length;t++)e[t]=d[d.length-1-t];return e}Z.prototype.fromHex=function(d,e){return this.fromBuffer(Buffer.from(d,"hex"),e)};Z.prototype.toHex=function(d){return this.toBuffer(d).toString("hex")};Z.prototype.toJSON=function(){return this.toString()};Z.prototype.fromJSON=function(d){return new Z(d).copy(this),this};Z.prototype.fromNumber=function(d){return new Z(d).copy(this),this};Z.prototype.toNumber=function(){return parseInt(this.toString(10),10)};Z.prototype.fromString=function(d,e){return new Z(d,e).copy(this),this};Z.fromBuffer=function(d,e={endian:"big"}){e.endian==="little"&&(d=Xr(d));const t=d.toString("hex");return new Z(t,16)};Z.prototype.fromBuffer=function(d,e){return Z.fromBuffer(d,e).copy(this),this};Z.prototype.toBuffer=function(d={size:void 0,endian:"big"}){let e;if(d.size){const i=this.toString(16,2),u=i.length/2;if(e=Buffer.from(i,"hex"),u!==d.size){if(u>d.size)e=e.slice(u-e.length,e.length);else if(u<d.size){const r=Buffer.alloc(d.size);for(let s=0;s<e.length;s++)r[r.length-1-s]=e[e.length-1-s];for(let s=0;s<d.size-u;s++)r[s]=0;e=r}}}else{const i=this.toString(16,2);e=Buffer.from(i,"hex")}d.endian==="little"&&(e=Xr(e));const t=Buffer.from([0]);return Buffer.compare(e,t)===0?Buffer.from([]):e};Z.prototype.toFastBuffer=function(d){return this.toBuffer(d)};Z.fromFastBuffer=Z.fromBuffer;Z.prototype.fromFastBuffer=Z.prototype.fromBuffer;Z.prototype.fromSm=function(d,e={endian:"big"}){if(d.length===0)return this.fromBuffer(Buffer.from([0])),this.negative=0,this;let t=Buffer.from(d);return e.endian==="little"&&(t=Xr(t)),t[0]&128?(t[0]=t[0]&127,this.fromBuffer(t),this.ineg()):(this.fromBuffer(t),this.negative=0),this};Z.prototype.toSm=function(d={endian:"big"}){const e=d.endian;let t;return this.negative?(t=this.abs().toBuffer(),t.length>0&&t[0]&128?t=Buffer.concat([Buffer.from([128]),t]):t.length>0?t[0]=t[0]|128:t=Buffer.from([128])):(t=this.toBuffer(),t.length>0&&t[0]&128&&(t=Buffer.concat([Buffer.from([0]),t]))),t.length===1&&t[0]===0&&(t=Buffer.from([])),e==="little"&&(t=Xr(t)),t};Z.prototype.fromBits=function(d,e={strict:!1}){let t=Buffer.alloc(4);if(t.writeUInt32BE(d,0),d=t.readInt32BE(0),e.strict&&d&8388608)throw new Error("negative bit set");const i=d>>24,u=d&8388607;if(t=Buffer.alloc(4),t.writeInt32BE(u),i<=3)t=t.slice(1,i+1);else{const r=Buffer.alloc(i-3);r.fill(0),t=Buffer.concat([t,r])}return this.fromBuffer(t),d&8388608&&this.ineg(),this};Z.prototype.toBits=function(){const d=this.negative,t=this.abs().toBuffer();let i=t.length,u;if(i>3)u=Buffer.concat([Buffer.from([0]),t.slice(0,3)]).readUInt32BE(0);else if(i<=3){u=0;for(let a=0;a<i;a++)u|=t[a]<<8*(2-a)}u&8388608&&(u>>=8,i++),d&&(u|=8388608);const r=i<<24|u,s=Buffer.alloc(4);return s.writeInt32BE(r,0),s.readUInt32BE(0)};Z.prototype.fromScriptNumBuffer=function(d,e,t){if(t===void 0&&(t=4),d.length>t)throw new Error(`script number overflow nMaxNumSize: ${t}`);if(e&&d.length>0&&(d[d.length-1]&127)===0&&(d.length<=1||(d[d.length-2]&128)===0))throw new Error("non-minimally encoded script number");return this.fromSm(d,{endian:"little"})};Z.prototype.toScriptNumBuffer=function(){return this.toSm({endian:"little"})};const yr=function(d){return d&&(d instanceof ut||d.constructor.name==="BN"||d.constructor.name==="Bn")&&!(d instanceof Z)?new Z(d):d},L1=["add","sub","mul","div","mod","umod","invm","and","or","xor","redAdd","redSub","redMul","redPow","gcd","egcd","lcm"];L1.forEach(d=>{const e=ut.prototype[d];Z.prototype[d]=function(t,...i){return(typeof t=="string"||typeof t=="number")&&(t=new Z(t)),yr(e.call(this,t,...i))}});const D1=["ushln","ushrn","shln","shrn","testn","maskn","setn","clrn","bincn"];D1.forEach(d=>{const e=ut.prototype[d];Z.prototype[d]=function(t,...i){return t&&(t instanceof ut||t.constructor.name==="BN"||t.constructor.name==="Bn")&&(t=t.toNumber()),yr(e.call(this,t,...i))}});const F1=["sqr","neg","abs","not","redSqr","redSqrt","redNeg"];F1.forEach(d=>{const e=ut.prototype[d];Z.prototype[d]=function(){return yr(e.call(this))}});Z.prototype.toRed=function(d){return yr(ut.prototype.toRed.call(this,d))};Z.prototype.fromRed=function(){return yr(ut.prototype.fromRed.call(this))};const q1=["cmp","gt","geq","lt","leq","eq","neq"];q1.forEach(d=>{const e=ut.prototype.cmp;Z.prototype[d]=function(t){(typeof t=="string"||typeof t=="number")&&(t=new Z(t));const i=e.call(this,t);return d==="eq"?i===0:d==="neq"?i!==0:d==="gt"?i>0:d==="geq"?i>=0:d==="lt"?i<0:d==="leq"?i<=0:i}});class st{constructor(e,t=!1){this.strict=t,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 i=Buffer.alloc(t.length);for(let u=0;u<i.length;u++)i[u]=t[t.length-1-u];return i}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 Z().fromBuffer(e);return this.pos=this.pos+8,t}readUInt64LEBn(){const e=this.readReverse(8);return new Z().fromBuffer(e)}readVarIntNum(){if(this.strict)return this.readVarIntNumStrict();const e=this.readUInt8();let t,i;switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(t=this.readUInt64LEBn(),i=t.toNumber(),i<=Math.pow(2,53))return i;throw new Error("number too large to retain precision - use readVarIntBn");default:return e}}readVarIntNumStrict(){const e=this.readUInt8();if(e<253)return e;if(e===253){const i=this.readUInt16LE();if(i<253)throw new Error("non-canonical varInt");return i}if(e===254){const i=this.readUInt32LE();if(i<=65535)throw new Error("non-canonical varInt");return i}const t=this.readUInt64LEBn();if(t.lte(new Z(4294967295)))throw new Error("non-canonical varInt");if(t.abs().toString(16)==="ffffffffffffffff")return-1;if(t.gt(new Z(Number.MAX_SAFE_INTEGER)))throw new Error("number too large to retain precision - use readVarIntBn");return t.toNumber()}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 Z(this.readUInt16LE());case 254:return new Z(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new Z(e)}}}class ke{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 i=this.bufs[t];e=e+i.length}return e}toBuffer(){return Buffer.concat(this.bufs)}write(e){return this.bufs.push(e),this}writeReverse(e){const t=Buffer.alloc(e.length);for(let i=0;i<t.length;i++)t[i]=e[e.length-1-i];return this.bufs.push(t),this}writeUInt8(e){const t=Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this}writeInt8(e){const t=Buffer.alloc(1);return t.writeInt8(e,0),this.write(t),this}writeUInt16BE(e){const t=Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this}writeInt16BE(e){const t=Buffer.alloc(2);return t.writeInt16BE(e,0),this.write(t),this}writeUInt16LE(e){const t=Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this}writeInt16LE(e){const t=Buffer.alloc(2);return t.writeInt16LE(e,0),this.write(t),this}writeUInt32BE(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this}writeInt32BE(e){const t=Buffer.alloc(4);return t.writeInt32BE(e,0),this.write(t),this}writeUInt32LE(e){const t=Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this}writeInt32LE(e){const t=Buffer.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=ke.varIntBufNum(e);return this.write(t),this}writeVarIntBn(e){const t=ke.varIntBufBn(e);return this.write(t),this}static varIntBufNum(e){let t;return e<253?(t=Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=Buffer.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 i=e.toNumber();if(i<253)t=Buffer.alloc(1),t.writeUInt8(i,0);else if(i<65536)t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(i,1);else if(i<4294967296)t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(i,1);else{const u=new ke;u.writeUInt8(255),u.writeUInt64LEBn(e),t=u.toBuffer()}return t}}function U1(d){const e=typeof d=="string"?d.charCodeAt(0):d;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}const Gf=U1;class Ce{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 st?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 st?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 i=t;const u=new ke;let r=0;for(t&&(u.write(t),r+=t.length);r<e;)i=yield e-r,i&&(u.write(i),r+=i.length);i=u.toBuffer();const s=r-e,a=i.slice(i.length-s,i.length);return i=i.slice(0,i.length-s),{buf:i,remainderbuf:a}}fromBuffer(e,...t){if(!Buffer.isBuffer(e))throw new Error("buf must be a buffer");const i=new st(e);return this.fromBr(i,...t)}static fromBuffer(...e){return new this().fromBuffer(...e)}asyncFromBuffer(e,...t){if(!Buffer.isBuffer(e))throw new Error("buf must be a buffer");const i=new st(e);return this.asyncFromBr(i,...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?Buffer.alloc(0):this.toBuffer(...e)}fromHex(e,...t){if(!Gf(e))throw new Error("invalid hex string");const i=Buffer.from(e,"hex");return this.fromBuffer(i,...t)}static fromHex(e,...t){return new this().fromHex(e,...t)}asyncFromHex(e,...t){if(!Gf(e))throw new Error("invalid hex string");const i=Buffer.from(e,"hex");return this.asyncFromBuffer(i,...t)}static asyncFromHex(e,...t){return new this().asyncFromHex(e,...t)}fromFastHex(e,...t){if(!Gf(e))throw new Error("invalid hex string");const i=Buffer.from(e,"hex");return this.fromFastBuffer(i,...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 i=[];for(const u in this[t])typeof this[t][u].toJSON=="function"?i.push(this[t][u].toJSON()):i.push(JSON.stringify(this[t][u]));e[t]=i}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(Buffer.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 Vt extends Ce{constructor(e){super({buf:e})}fromHex(e){return this.fromBuffer(Buffer.from(e,"hex"))}toHex(){return this.toBuffer().toString("hex")}static encode(e){if(!Buffer.isBuffer(e))throw new Error("Input should be a buffer");return Wf.encode(e)}static decode(e){if(typeof e!="string")throw new Error("Input should be a string");return Buffer.from(Wf.decode(e))}fromBuffer(e){return this.buf=e,this}fromString(e){const t=Vt.decode(e);return this.buf=t,this}toBuffer(){return this.buf}toString(){return Vt.encode(this.buf)}}const kt=(d,e)=>{if(!Buffer.isBuffer(d)||!Buffer.isBuffer(e))throw new Error("buf1 and buf2 must be buffers");if(d.length!==e.length)return!1;let t=0;for(let i=0;i<d.length;i++){const u=d[i],r=e[i];t|=u^r}return t===0};class Jf extends Ce{constructor(e,t,i){super({resbuf:e,isError:t,id:i})}fromResult(e,t){return e.toFastBuffer?this.resbuf=e.toFastBuffer():Buffer.isBuffer(e)?this.resbuf=e:this.resbuf=Buffer.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=Buffer.from(JSON.stringify(e.message)),this.isError=!0,this.id=t,this}toBw(e){return e||(e=new ke),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 Ot;class le{constructor(e=[],t=0,i=[],u=new Map){this.nativeWorkers=e,this.lastid=t,this.incompconsteRes=i,this.promisemap=u}asyncObjectMethod(e,t,i,u=this.lastid+1){if(!i)throw new Error("must specify args");const r=e[t](...i);return new Jf().fromResult(r,u)}static asyncObjectMethod(e,t,i,u){return Ot||(Ot=new le),Ot.asyncObjectMethod(e,t,i,u)}asyncClassMethod(e,t,i,u=this.lastid+1){if(!i)throw new Error("must specify args");const r=e[t](...i);return new Jf().fromResult(r,u)}static asyncClassMethod(e,t,i,u){return Ot||(Ot=new le),Ot.asyncClassMethod(e,t,i,u)}static endGlobalWorkers(){Ot&&!process.browser&&(Ot=void 0)}}class ae{}ae.sha1=function(d){if(!Buffer.isBuffer(d))throw new Error("sha1 hash must be of a buffer");const e=mr.sha1,t=new e().update(d).digest();return Buffer.from(t)};ae.sha1.blockSize=512;ae.asyncSha1=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha1",e)).resbuf};ae.sha256=function(d){if(!Buffer.isBuffer(d))throw new Error("sha256 hash must be of a buffer");const e=mr.sha256,t=new e().update(d).digest();return Buffer.from(t)};ae.sha256.blockSize=512;ae.asyncSha256=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha256",e)).resbuf};ae.sha256Sha256=function(d){try{return ae.sha256(ae.sha256(d))}catch(e){throw new Error("sha256Sha256 hash must be of a buffer: "+e)}};ae.asyncSha256Sha256=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha256Sha256",e)).resbuf};ae.ripemd160=function(d){if(!Buffer.isBuffer(d))throw new Error("ripemd160 hash must be of a buffer");const e=mr.ripemd160,t=new e().update(d).digest();return Buffer.from(t)};ae.asyncRipemd160=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"ripemd160",e)).resbuf};ae.sha256Ripemd160=function(d){try{return ae.ripemd160(ae.sha256(d))}catch(e){throw new Error("sha256Ripemd160 hash must be of a buffer: "+e)}};ae.asyncSha256Ripemd160=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha256Ripemd160",e)).resbuf};ae.sha512=function(d){if(!Buffer.isBuffer(d))throw new Error("sha512 hash must be of a buffer");const e=mr.sha512,t=new e().update(d).digest();return Buffer.from(t)};ae.asyncSha512=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha512",e)).resbuf};ae.sha512.blockSize=1024;ae.hmac=function(d,e,t){if(d!=="sha1"&&d!=="sha256"&&d!=="sha512")throw new Error("invalid choice of hash function");const i=ae[d];if(!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new Error("data and key must be buffers");const u=i.blockSize/8;if(t.length>u&&(t=i(t)),t.length<u){const a=Buffer.alloc(u);a.fill(0,t.length),t.copy(a),t=a}const r=Buffer.alloc(u),s=Buffer.alloc(u);for(let a=0;a<u;a++)r[a]=92^t[a],s[a]=54^t[a];return i(Buffer.concat([r,i(Buffer.concat([s,e]))]))};ae.sha1Hmac=function(d,e){return ae.hmac("sha1",d,e)};ae.asyncSha1Hmac=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(ae,"sha1Hmac",t)).resbuf};ae.sha1Hmac.bitsize=160;ae.sha256Hmac=function(d,e){return ae.hmac("sha256",d,e)};ae.asyncSha256Hmac=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(ae,"sha256Hmac",t)).resbuf};ae.sha256Hmac.bitsize=256;ae.sha512Hmac=function(d,e){return ae.hmac("sha512",d,e)};ae.asyncSha512Hmac=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(ae,"sha512Hmac",t)).resbuf};ae.sha512Hmac.bitsize=512;class Bt extends Ce{constructor(e){super({buf:e})}fromHex(e){return this.fromBuffer(Buffer.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=Vt.decode(e);if(t.length<4)throw new Error("Input string too short");const i=t.slice(0,-4),u=t.slice(-4),s=ae.sha256Sha256(i).slice(0,4);if(!kt(u,s))throw new Error("Checksum mismatch");return i}static encode(e){if(!Buffer.isBuffer(e))throw new Error("Input must be a buffer");const t=Buffer.alloc(e.length+4),i=ae.sha256Sha256(e);return e.copy(t),i.copy(t,e.length),Vt.encode(t)}fromBuffer(e){return this.buf=e,this}fromString(e){const t=Bt.decode(e);return this.buf=t,this}toBuffer(){return this.buf}toString(){return Bt.encode(this.buf)}}class H1{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 K1{constructor(){this.variables={}}build(){return new H1(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,i){if(i===void 0)throw new Error(`Failed to add "${e}" property. Default value cannot be undefined`);return this.addValue(e,t===void 0?i:t)}}const Qt=new K1().addValue("NETWORK","mainnet").build(),Oe={};Oe.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}};Oe.Testnet=Object.assign({},Oe.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}});Oe.Regtest=Object.assign({},Oe.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}});Oe.STN=Object.assign({},Oe.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}});if(Qt.get("NETWORK")==="testnet")Oe.Default=Object.assign({},Oe.Testnet);else if(Qt.get("NETWORK")==="mainnet")Oe.Default=Object.assign({},Oe.Mainnet);else if(Qt.get("NETWORK")==="regtest")Oe.Default=Object.assign({},Oe.Regtest);else if(Qt.get("NETWORK")==="stn")Oe.Default=Object.assign({},Oe.STN);else throw new Error(`must set network in environment variable - mainnet, testnet, regtest or stn?, received ${Qt.get("NETWORK")}`);const j1=d=>Oe.Mainnet.Msg.magicNum===d?Oe.Mainnet:Oe.Testnet.Msg.magicNum===d?Oe.Testnet:Oe.Regtest.Msg.magicNum===d?Oe.Regtest:Oe.STN.Msg.magicNum===d?Oe.STN:Oe.Default,Zt={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},er={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 q extends Ce{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=er[e];if(t===void 0)throw new Error("Invalid opCodeStr");return this.num=t,this}fromNoOpString(e){const t=Zt[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=q.str[this.num];return e===void 0?this.num>0&&this.num<q.OP_PUSHDATA1?this.num.toString():"OP_"+this.num.toNumber():e}toNoOpString(){const e=q.noopstr[this.num];return e===void 0?this.num>0&&this.num<q.OP_PUSHDATA1?this.num.toString():this.num.toNumber():e}}q.str={};q.noopstr={};for(const d in er)q[d]=er[d],Object.prototype.hasOwnProperty.call(er,d)&&(q.str[er[d]]=d);for(const d in Zt)q[d]=Zt[d],Object.prototype.hasOwnProperty.call(Zt,d)&&(q.noopstr[Zt[d]]=d);q.OP_SUBSTR_CHRONICLE=179;q.OP_LEFT_CHRONICLE=180;q.OP_RIGHT_CHRONICLE=181;q.OP_LSHIFTNUM=182;q.OP_RSHIFTNUM=183;const tr=Td.curves.secp256k1,z1=tr.curve.point(),Tt=z1.constructor;class Ae extends Tt{constructor(e,t,i){super(tr.curve,e,t,i)}static fromX(e,t){const i=tr.curve.pointFromX(t,e);return Object.create(Ae.prototype).copyFrom(i)}copyFrom(e){if(!(e instanceof Tt))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=Tt.prototype.add.call(this,e),Object.create(Ae.prototype).copyFrom(e)}mul(e){if(!e.lt(Ae.getN()))throw new Error("point mul out of range");const t=Tt.prototype.mul.call(this,e);return Object.create(Ae.prototype).copyFrom(t)}mulAdd(e,t,i){const u=Tt.prototype.mulAdd.call(this,e,t,i);return t=Object.create(Ae.prototype),t.copyFrom(u)}getX(){const e=Tt.prototype.getX.call(this),t=Object.create(Z.prototype);return e.copy(t),t}getY(){const e=Tt.prototype.getY.call(this),t=Object.create(Z.prototype);return e.copy(t),t}fromX(e,t){const i=Ae.fromX(e,t);return this.copyFrom(i)}toJSON(){return{x:this.getX().toString(),y:this.getY().toString()}}fromJSON(e){const t=new Z().fromString(e.x),i=new Z().fromString(e.y),u=new Ae(t,i);return this.copyFrom(u)}toString(){return JSON.stringify(this.toJSON())}fromString(e){const t=JSON.parse(e),i=new Ae().fromJSON(t);return this.copyFrom(i)}static getG(){const e=tr.curve.g;return Object.create(Ae.prototype).copyFrom(e)}static getN(){return new Z(tr.curve.n.toArray())}validate(){if(Ae.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(Ae.getN()))||!(this.getY().gt(-1)&&this.getY().lt(Ae.getN())))throw new Error("Point does not lie on the curve");return this}}class Ue extends Ce{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:Ae.getG().mul(e.bn),compressed:e.compressed}),this}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){const t=await le.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 i=[e,t],u=await le.asyncObjectMethod(this,"fromBuffer",i);return this.fromFastBuffer(u.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 i=e.slice(1,33),u=e.slice(33,65);if(i.length!==32||u.length!==32||e.length!==65)throw new Error("LEngth of x and y must be 32 bytes");const r=new Z(i),s=new Z(u);this.point=new Ae(r,s),this.compressed=!1}else if(e[0]===3){const i=e.slice(1),u=new Z(i);this.fromX(!0,u),this.compressed=!0}else if(e[0]===2){const i=e.slice(1),u=new Z(i);this.fromX(!1,u),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(Buffer.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=Ae.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 Buffer.alloc(0);const e=new ke,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(),i=this.point.getY(),u=t.toBuffer({size:32}),r=i.toBuffer({size:32});let s;return e?(r[r.length-1]%2?s=Buffer.from([3]):s=Buffer.from([2]),Buffer.concat([s,u])):(s=Buffer.from([4]),Buffer.concat([s,u,r]))}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 Ae(new Z(0),new Z(0))))throw new Error("point: Point cannot be equal to 0, 0");return this.point.validate(),this}}var V1=Ut();const G1=Gt(V1);class Rt{}Rt.getRandomBuffer=function(d){return Buffer.from(G1(d))};class wt extends Ce{constructor(e,t,i=null){super({bn:e,compressed:t}),i=i||Oe.Default.PrivKey,this.Constants=i}fromJSON(e){return this.fromHex(e),this}toJSON(){return this.toHex()}fromRandom(){let e,t,i;do e=Rt.getRandomBuffer(32),t=new Z().fromBuffer(e),i=t.lt(Ae.getN());while(!i);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 i;return e?i=Buffer.concat([Buffer.from([this.Constants.versionByteNum]),t,Buffer.from([1])]):i=Buffer.concat([Buffer.from([this.Constants.versionByteNum]),t]),i}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 Z().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(Ae.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 Bt.encode(this.toBuffer())}fromWif(e){return this.fromBuffer(Bt.decode(e))}static fromWif(e){return new this().fromWif(e)}toString(){return this.toWif()}fromString(e){return this.fromWif(e)}}wt.Mainnet=class extends wt{constructor(d,e){super(d,e,Oe.Mainnet.PrivKey)}};wt.Testnet=class extends wt{constructor(d,e){super(d,e,Oe.Testnet.PrivKey)}};class ce extends Ce{constructor(e,t,i,u,r){super({r:e,s:t,nHashType:i,recovery:u,compressed:r})}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,i=e.slice(0,1)[0]-27-4;if(i<0&&(t=!1,i=i+4),!(i===0||i===1||i===2||i===3))throw new Error("i must be 0, 1, 2, or 3");this.compressed=t,this.recovery=i;const u=e.slice(1);return this.fromRS(u),this}static fromCompact(e){return new this().fromCompact(e)}fromRS(e){const t=e.slice(0,32),i=e.slice(32,64);if(t.length!==32)throw new Error("r must be 32 bytes");if(i.length!==32||e.length>64)throw new Error("s must be 32 bytes");return this.r=new Z().fromBuffer(t),this.s=new Z().fromBuffer(i),this}static fromRS(e){return new this().fromRS(e)}fromDer(e,t){const i=ce.parseDer(e,t);return this.r=i.r,this.s=i.s,this}static fromDer(e,t){return new this().fromDer(e,t)}fromTxFormat(e){if(e.length===0)return this.r=new Z(1),this.s=new Z(1),this.nHashType=1,this;const t=e.readUInt8(e.length-1),i=e.slice(0,e.length-1);return this.fromDer(i,!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),!Buffer.isBuffer(e))throw new Error("DER formatted signature should be a buffer");const i=e[0];if(i!==48)throw new Error("Header byte should be 0x30");let u=e[1];const r=e.slice(2).length;if(t&&u!==r)throw new Error("LEngth byte should length of what follows");u=u<r?u:r;const s=e[2];if(s!==2)throw new Error("Integer byte for r should be 0x02");const a=e[3],o=e.slice(4,4+a),f=new Z().fromBuffer(o),n=e[4]===0;if(a!==o.length)throw new Error("LEngth of r incorrect");const c=e[4+a+0];if(c!==2)throw new Error("Integer byte for s should be 0x02");const h=e[4+a+1],l=e.slice(4+a+2,4+a+2+h),b=new Z().fromBuffer(l),p=e[4+a+2+2]===0;if(h!==l.length)throw new Error("LEngth of s incorrect");const y=4+a+2+h;if(u!==y-2)throw new Error("LEngth of signature incorrect");return{header:i,length:u,rheader:s,rlength:a,rneg:n,rbuf:o,r:f,sheader:c,slength:h,sneg:p,sbuf:l,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 i=e[5+t];if(t+i+7!==e.length)return!1;const u=e.slice(4);if(e[2]!==2||t===0||u[0]&128||t>1&&u[0]===0&&!(u[1]&128))return!1;const r=e.slice(6+t);return!(e[6+t-2]!==2||i===0||r[0]&128||i>1&&r[0]===0&&!(r[1]&128))}hasLowS(){return!(this.s.lt(1)||this.s.gt(Z.fromBuffer(Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))))}isChronicle(){return(this.nHashType&ce.SIGHASH_CHRONICLE)!==0}hasDefinedHashType(){const e=this.nHashType&~(ce.SIGHASH_CHRONICLE|ce.SIGHASH_FORKID|ce.SIGHASH_ANYONECANPAY);return!(e<ce.SIGHASH_ALL||e>ce.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 i=e+27+4;t===!1&&(i=i-4);const u=Buffer.from([i]),r=this.r.toBuffer({size:32}),s=this.s.toBuffer({size:32});return Buffer.concat([u,r,s])}toRS(){return Buffer.concat([this.r.toBuffer({size:32}),this.s.toBuffer({size:32})])}toDer(){const e=this.r.toBuffer(),t=this.s.toBuffer(),i=e[0]&128,u=t[0]&128,r=i?Buffer.concat([Buffer.from([0]),e]):e,s=u?Buffer.concat([Buffer.from([0]),t]):t,a=2+r.length+2+s.length,o=r.length,f=s.length;return Buffer.concat([Buffer.from([48,a,2,o]),r,Buffer.from([2,f]),s])}toTxFormat(){const e=this.toDer(),t=Buffer.alloc(1);return t.writeUInt8(this.nHashType,0),Buffer.concat([e,t])}toString(){return this.toHex()}}ce.SIGHASH_ALL=1;ce.SIGHASH_NONE=2;ce.SIGHASH_SINGLE=3;ce.SIGHASH_CHRONICLE=32;ce.SIGHASH_FORKID=64;ce.SIGHASH_ANYONECANPAY=128;class Ee extends Ce{constructor(e=[]){super({chunks:e})}fromJSON(e){return this.fromString(e)}toJSON(){return this.toString()}fromBuffer(e){this.chunks=[];const t=new st(e);for(;!t.eof();){const i=t.readUInt8();let u=0,r=Buffer.from([]);if(i>0&&i<q.OP_PUSHDATA1)u=i,this.chunks.push({buf:t.read(u),len:u,opCodeNum:i});else if(i===q.OP_PUSHDATA1){try{u=t.readUInt8(),r=t.read(u)}catch{t.read()}this.chunks.push({buf:r,len:u,opCodeNum:i})}else if(i===q.OP_PUSHDATA2){try{u=t.readUInt16LE(),r=t.read(u)}catch{t.read()}this.chunks.push({buf:r,len:u,opCodeNum:i})}else if(i===q.OP_PUSHDATA4){try{u=t.readUInt32LE(),r=t.read(u)}catch{t.read()}this.chunks.push({buf:r,len:u,opCodeNum:i})}else this.chunks.push({opCodeNum:i})}return this}toBuffer(){const e=new ke;for(let t=0;t<this.chunks.length;t++){const i=this.chunks[t],u=i.opCodeNum;e.writeUInt8(u),i.buf&&(u<q.OP_PUSHDATA1?e.write(i.buf):u===q.OP_PUSHDATA1?(e.writeUInt8(i.len),e.write(i.buf)):u===q.OP_PUSHDATA2?(e.writeUInt16LE(i.len),e.write(i.buf)):u===q.OP_PUSHDATA4&&(e.writeUInt32LE(i.len),e.write(i.buf)))}return e.toBuffer()}fromString(e){if(this.chunks=[],e===""||e===void 0)return this;const t=e.split(" ");let i=0;for(;i<t.length;){const u=t[i];let r;try{r=new q().fromString(u).toNumber()}catch{}if(r===void 0)if(r=parseInt(u,10),r>0&&r<q.OP_PUSHDATA1)this.chunks.push({buf:Buffer.from(t[i+1].slice(2),"hex"),len:r,opCodeNum:r}),i=i+2;else if(r===0)this.chunks.push({opCodeNum:0}),i=i+1;else throw new Error("Invalid script");else if(r===q.OP_PUSHDATA1||r===q.OP_PUSHDATA2||r===q.OP_PUSHDATA4){if(t[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");this.chunks.push({buf:Buffer.from(t[i+2].slice(2),"hex"),len:parseInt(t[i+1],10),opCodeNum:r}),i=i+3}else this.chunks.push({opCodeNum:r}),i=i+1}return this}toString(e={noOp:!1}){let t="";for(let i=0;i<this.chunks.length;i++){const u=this.chunks[i],r=u.opCodeNum?.num?u.opCodeNum.num:u.opCodeNum;u.buf?((r===q.OP_PUSHDATA1||r===q.OP_PUSHDATA2||r===q.OP_PUSHDATA4)&&(t=e.noOp?t+" "+new q(r).toNoOpString():t+" "+new q(r).toString()),t=t+" "+u.len,t=t+" 0x"+u.buf.toString("hex")):q.str[r]!==void 0||q.noopstr[r]!==void 0?t=e.noOp?t+" "+new q(r).toNoOpString():t+" "+new q(r).toString():t=t+" 0x"+r.toString(16)}return t.substr(1)}fromBitcoindString(e){const t=new ke,i=e.split(" ");let u;for(u=0;u<i.length;u++){const s=i[u];if(s!=="")if(s[0]==="0"&&s[1]==="x"){const a=s.slice(2);t.write(Buffer.from(a,"hex"))}else if(s[0]==="'"){const a=s.slice(1,s.length-1),o=Buffer.from(a),f=new Ee().writeBuffer(o).toBuffer();t.write(f)}else if(q["OP_"+s]!==void 0){const a="OP_"+s,o=q[a];t.writeUInt8(o)}else if(typeof q[s]=="number"){const o=q[s];t.writeUInt8(o)}else{if(isNaN(parseInt(s,10)))throw new Error("Could not determine type of script value");{const a=new Z(s),f=new Ee().writeBn(a).toBuffer();t.write(f)}}}const r=t.toBuffer();return this.fromBuffer(r)}static fromBitcoindString(e){return new this().fromBitcoindString(e)}toBitcoindString(){let e="";for(let t=0;t<this.chunks.length;t++){const i=this.chunks[t];if(i.buf){const r=new Ee([i]).toBuffer().toString("hex");e=e+" 0x"+r}else if(q.str[i.opCodeNum]!==void 0){const u=new q(i.opCodeNum).toString();e=e+" "+u.slice(3)}else e=e+" 0x"+i.opCodeNum.toString(16)}return e.substr(1)}fromAsmString(e){this.chunks=[];const t=e.split(" ");let i=0;for(;i<t.length;){const u=t[i];let r,s;try{r=q.fromString(u),s=r.toNumber()}catch{r=void 0,s=void 0}if(u==="0")s=0,this.chunks.push({opCodeNum:s}),i=i+1;else if(u==="-1")s=q.OP_1NEGATE,this.chunks.push({opCodeNum:s}),i=i+1;else if(r===void 0){const a=t[i],o=Buffer.from(a,"hex");if(o.toString("hex")!==a)throw new Error("invalid hex string in script");const f=o.length;f>=0&&f<q.OP_PUSHDATA1?s=f:f<Math.pow(2,8)?s=q.OP_PUSHDATA1:f<Math.pow(2,16)?s=q.OP_PUSHDATA2:f<Math.pow(2,32)&&(s=q.OP_PUSHDATA4),this.chunks.push({buf:o,len:o.length,opCodeNum:s}),i=i+1}else this.chunks.push({opCodeNum:s}),i=i+1}return this}static fromAsmString(e){return new this().fromAsmString(e)}toAsmString(e={noOp:!1}){let t="";for(let i=0;i<this.chunks.length;i++){const u=this.chunks[i];t+=this._chunkToString(u,e)}return t.substr(1)}_chunkToString(e,t={noOp:!1}){const i=e.opCodeNum;let u="";if(e.buf)e.len>0&&(u=u+" "+e.buf.toString("hex"));else if(typeof q.str[i]<"u")i===0?u=u+" 0":i===79?u=u+" -1":u=t.noOp?u+" "+new q(i).toNoOpString():u+" "+new q(i).toString();else{let r=i.toString(16);r.length%2!==0&&(r="0"+r),u=u+" "+r}return u}fromOpReturnData(e){return this.writeOpCode(q.OP_RETURN),this.writeBuffer(e),this}static fromOpReturnData(e){return new this().fromOpReturnData(e)}fromSafeData(e){return this.writeOpCode(q.OP_FALSE),this.writeOpCode(q.OP_RETURN),this.writeBuffer(e),this}static fromSafeData(e){return new this().fromSafeData(e)}fromSafeDataArray(e){this.writeOpCode(q.OP_FALSE),this.writeOpCode(q.OP_RETURN);for(const t in e){const i=e[t];this.writeBuffer(i)}return this}static fromSafeDataArray(e){return new this().fromSafeDataArray(e)}getData(){if(this.isSafeDataOut())return this.chunks.slice(2).map(i=>i.buf);if(this.isOpReturn())return this.chunks.slice(1).map(i=>i.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(q.OP_DUP),this.writeOpCode(q.OP_HASH160),this.writeBuffer(e),this.writeOpCode(q.OP_EQUALVERIFY),this.writeOpCode(q.OP_CHECKSIG),this}static fromPubKeyHash(e){return new this().fromPubKeyHash(e)}static sortPubKeys(e){return e.slice().sort((t,i)=>{const u=t.toBuffer(),r=i.toBuffer(),s=Math.max(u.length,r.length);for(let a=0;a<s;a++){if(u[a]===void 0)return-1;if(r[a]===void 0)return 1;if(u[a]<r[a])return-1;if(u[a]>r[a])return 1}return 0})}fromPubKeys(e,t,i=!0){if(typeof e!="number")throw new Error("m must be a number");i===!0&&(t=Ee.sortPubKeys(t)),this.writeOpCode(e+q.OP_1-1);for(const u in t)this.writeBuffer(t[u].toBuffer());return this.writeOpCode(t.length+q.OP_1-1),this.writeOpCode(q.OP_CHECKMULTISIG),this}static fromPubKeys(e,t,i){return new this().fromPubKeys(e,t,i)}removeCodeseparators(){const e=[];for(let t=0;t<this.chunks.length;t++)this.chunks[t].opCodeNum!==q.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>q.OP_16)return!1;return!0}isNonSpendable(){const e=this.chunks[0]&&this.chunks[0].opCodeNum===q.OP_FALSE,t=this.chunks[1]&&this.chunks[1].opCodeNum===q.OP_RETURN;return!!e&&!!t}isOpReturn(){return!!(this.chunks[0]&&this.chunks[0].opCodeNum===q.OP_RETURN&&this.chunks.filter(e=>Buffer.isBuffer(e.buf)).length===this.chunks.slice(1).length)}isSafeDataOut(){if(this.chunks.length<2||this.chunks[0].opCodeNum!==q.OP_FALSE)return!1;const e=this.chunks.slice(1);return new Ee(e).isOpReturn()}isPubKeyHashOut(){return!!(this.chunks[0]&&this.chunks[0].opCodeNum===q.OP_DUP&&this.chunks[1]&&this.chunks[1].opCodeNum===q.OP_HASH160&&this.chunks[2].buf&&this.chunks[3]&&this.chunks[3].opCodeNum===q.OP_EQUALVERIFY&&this.chunks[4]&&this.chunks[4].opCodeNum===q.OP_CHECKSIG)}isPubKeyHashIn(){return!!(this.chunks.length===2&&(this.chunks[0].buf||this.chunks[0].opCodeNum===q.OP_0)&&(this.chunks[1].buf||this.chunks[1].opCodeNum===q.OP_0))}isScriptHashOut(){const e=this.toBuffer();return e.length===23&&e[0]===q.OP_HASH160&&e[1]===20&&e[22]===q.OP_EQUAL}isScriptHashIn(){if(!this.isPushOnly())return!1;const e=this.chunks[this.chunks.length-1];if(!e||!e.buf)return!1;try{new Ee().fromBuffer(e.buf)}catch{return!1}return!0}isMultiSigOut(){if(this.chunks.length<3)return!1;const e=this.chunks[0].opCodeNum-q.OP_1+1;if(!(e>=1&&e<=16)||!this.chunks.slice(1,this.chunks.length-2).every(u=>{try{const r=u.buf;return new Ue().fromDer(r).validate(),!0}catch{return!1}}))return!1;const i=this.chunks[this.chunks.length-2].opCodeNum-q.OP_1+1;return!(!(i>=e&&i<=16)||!this.chunks[1+i+1]||this.chunks[1+i+1].opCodeNum!==q.OP_CHECKMULTISIG)}isMultiSigIn(){if(!this.chunks[0]||this.chunks[0].opCodeNum!==q.OP_0)return!1;const e=this.chunks.slice(1);return e.length<1?!1:e.every(t=>Buffer.isBuffer(t.buf)&&ce.IsTxDer(t.buf))}findAndDelete(e){const t=e.toBuffer();if(t.length===0)return this;let i=0;for(;i<this.chunks.length;){const u=new Ee([this.chunks[i]]);kt(t,u.toBuffer())?this.chunks.splice(i,1):i++}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 Ee().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)===q.OP_0)this.chunks.push({opCodeNum:q.OP_0});else if(e.cmp(-1)===0)this.chunks.push({opCodeNum:q.OP_1NEGATE});else if(e.cmp(1)>=0&&e.cmp(16)<=0)this.chunks.push({opCodeNum:e.toNumber()+q.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 Z().fromNumber(e)),this}static writeNumber(e){return new this().writeNumber(e)}setChunkBn(e,t){return this.chunks[e]=new Ee().writeBn(t).chunks[0],this}writeBuffer(e){e=Buffer.from(e);let t;const i=e.length;if(e.length>0&&e.length<q.OP_PUSHDATA1)t=e.length;else if(e.length===0)t=q.OP_0;else if(e.length<Math.pow(2,8))t=q.OP_PUSHDATA1;else if(e.length<Math.pow(2,16))t=q.OP_PUSHDATA2;else if(e.length<Math.pow(2,32))t=q.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this.chunks.push({buf:e,len:i,opCodeNum:t}),this}static writeBuffer(e){return new this().writeBuffer(e)}setChunkBuffer(e,t){return this.chunks[e]=new Ee().writeBuffer(t).chunks[0],this}checkMinimalPush(e){const t=this.chunks[e],i=t.buf,u=t.opCodeNum;return i?i.length===0?u===q.OP_0:i.length===1&&i[0]>=1&&i[0]<=16?u===q.OP_1+(i[0]-1):i.length===1&&i[0]===129?u===q.OP_1NEGATE:i.length<=75?u===i.length:i.length<=255?u===q.OP_PUSHDATA1:i.length<=65535?u===q.OP_PUSHDATA2:!0:!0}}class gt extends Ce{constructor(e,t,i=null){super({versionByteNum:e,hashBuf:t}),i=i||Oe.Default.Address,this.Constants=i}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=ae.sha256Ripemd160(e.toBuffer());return this.fromPubKeyHashBuf(t)}static fromPubKey(e){return new this().fromPubKey(e)}async asyncFromPubKey(e){const t=[e],i=await le.asyncObjectMethod(this,"fromPubKey",t);return this.fromFastBuffer(i.resbuf)}static asyncFromPubKey(e){return new this().asyncFromPubKey(e)}fromPrivKey(e){const t=new Ue().fromPrivKey(e),i=ae.sha256Ripemd160(t.toBuffer());return this.fromPubKeyHashBuf(i)}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){const t=[e],i=await le.asyncObjectMethod(this,"fromPrivKey",t);return this.fromFastBuffer(i.resbuf)}static asyncFromPrivKey(e){return new this().fromPrivKey(e)}fromRandom(){const e=new wt().fromRandom();return this.fromPrivKey(e)}static fromRandom(){return new this().fromRandom()}async asyncFromRandom(){const e=[],t=await le.asyncObjectMethod(this,"fromRandom",e);return this.fromFastBuffer(t.resbuf)}static asyncFromRandom(){return new this().fromRandom()}fromString(e){const t=Bt.decode(e);return this.fromBuffer(t)}async asyncFromString(e){const t=[e],i=await le.asyncObjectMethod(this,"fromString",t);return this.fromFastBuffer(i.resbuf)}static asyncFromString(e){return new this().asyncFromString(e)}static isValid(e){let t;try{t=new gt().fromString(e)}catch{return!1}return t.isValid()}isValid(){try{return this.validate(),!0}catch{return!1}}toTxOutScript(){const e=new Ee;return e.writeOpCode(q.OP_DUP),e.writeOpCode(q.OP_HASH160),e.writeBuffer(this.hashBuf),e.writeOpCode(q.OP_EQUALVERIFY),e.writeOpCode(q.OP_CHECKSIG),e}fromTxInScript(e){const t=ae.sha256Ripemd160(e.chunks[1].buf||Buffer.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=Buffer.from([this.versionByteNum]);return Buffer.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=Buffer.from(e.hashBuf,"hex")),typeof e.versionByteNum<"u"&&(this.versionByteNum=e.versionByteNum),this}toString(){return Bt.encode(this.toBuffer())}async asyncToString(){const e=[],t=await le.asyncObjectMethod(this,"toString",e);return JSON.parse(t.resbuf.toString())}validate(){if(!Buffer.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}}gt.Mainnet=class extends gt{constructor(d,e){super(d,e,Oe.Mainnet.Address)}};gt.Testnet=class extends gt{constructor(d,e){super(d,e,Oe.Testnet.Address)}};class nr extends Ce{constructor(e,t,i,u,r,s,a,o=null,f=wt){super({versionBytesNum:e,depth:t,parentFingerPrint:i,childIndex:u,chainCode:r,privKey:s,pubKey:a}),o=o||Oe.Default.Bip32,this.Constants=o,this.PrivKey=f}fromRandom(){return this.versionBytesNum=this.Constants.privKey,this.depth=0,this.parentFingerPrint=Buffer.from([0,0,0,0]),this.childIndex=0,this.chainCode=Rt.getRandomBuffer(32),this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new Ue().fromPrivKey(this.privKey),this}static fromRandom(){return new this().fromRandom()}fromString(e){return this.fromBuffer(Bt.decode(e))}async asyncFromString(e){const t=[e],i=await le.asyncObjectMethod(this,"fromString",t);return this.fromFastBuffer(i.resbuf)}fromSeed(e){if(!Buffer.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=ae.sha512Hmac(e,Buffer.from("Bitcoin seed"));return this.depth=0,this.parentFingerPrint=Buffer.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(Z().fromBuffer(t.slice(0,32))),this.pubKey=new Ue().fromPrivKey(this.privKey),this}static fromSeed(e){return new this().fromSeed(e)}async asyncFromSeed(e){const t=await le.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),i=this.versionBytesNum===this.Constants.privKey,u=this.versionBytesNum===this.Constants.pubKey;if(i&&t[0]===0)this.privKey=new this.PrivKey().fromBn(Z().fromBuffer(t.slice(1,33))),this.pubKey=new Ue().fromPrivKey(this.privKey);else if(u&&(t[0]===2||t[0]===3))this.pubKey=new Ue().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),i=this.versionBytesNum===this.Constants.privKey,u=this.versionBytesNum===this.Constants.pubKey;if(i&&t[0]===0&&e.length===78)this.privKey=new this.PrivKey().fromBn(Z().fromBuffer(t.slice(1,33))),this.pubKey=new Ue().fromPrivKey(this.privKey);else if(u&&e.length===111)this.pubKey=new Ue().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 i=this;for(const u in t){const r=t[u];if(u==="0"){if(r!=="m")throw new Error("invalid path");continue}if(parseInt(r.replace("'",""),10).toString()!==r.replace("'",""))throw new Error("invalid path");const s=r.length>1&&r[r.length-1]==="'";let a=parseInt(s?r.slice(0,r.length-1):r,10)&2147483647;s&&(a+=2147483648),i=i.deriveChild(a)}return i}async asyncDerive(e){const t=await le.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=Buffer.from(t);const i=(e&2147483648)!==0,u=this.versionBytesNum===this.Constants.privKey;if(i&&(!this.privKey||!u))throw new Error("Cannot do private key derivation without private key");let r=null;if(this.privKey){let a=null;i?a=Buffer.concat([Buffer.from([0]),this.privKey.bn.toBuffer({size:32}),t]):a=Buffer.concat([this.pubKey.toBuffer({size:32}),t]);const o=ae.sha512Hmac(a,this.chainCode),f=Z().fromBuffer(o.slice(0,32),{size:32}),n=o.slice(32,64),c=f.add(this.privKey.bn).mod(Ae.getN());r=new this.constructor,r.chainCode=n,r.privKey=new this.PrivKey().fromBn(c),r.pubKey=new Ue().fromPrivKey(r.privKey)}else{const a=Buffer.concat([this.pubKey.toBuffer(),t]),o=ae.sha512Hmac(a,this.chainCode),f=Z().fromBuffer(o.slice(0,32)),n=o.slice(32,64),c=Ae.getG().mul(f),h=this.pubKey.point,l=c.add(h),b=new Ue;b.point=l,r=new this.constructor,r.chainCode=n,r.pubKey=b}r.childIndex=e;const s=ae.sha256Ripemd160(this.pubKey.toBuffer());return r.parentFingerPrint=s.slice(0,4),r.versionBytesNum=this.versionBytesNum,r.depth=this.depth+1,r}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 ke().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 ke().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 Buffer.alloc(0);const e=this.versionBytesNum===this.Constants.privKey,t=this.versionBytesNum===this.Constants.pubKey;if(e)return new ke().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 ke().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 Bt.encode(this.toBuffer())}async asyncToString(){const e=await le.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}}nr.Mainnet=class extends nr{constructor(d,e,t,i,u,r,s){super(d,e,t,i,u,r,s,Oe.Mainnet.Bip32,wt.Mainnet)}};nr.Testnet=class extends nr{constructor(d,e,t,i,u,r,s){super(d,e,t,i,u,r,s,Oe.Testnet.Bip32,wt.Testnet)}};const Lr=["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"];Lr.space=" ";const Dr=["あいこくしん","あいさつ","あいだ","あおぞら","あかちゃん","あきる","あけがた","あける","あこがれる","あさい","あさひ","あしあと","あじわう","あずかる","あずき","あそぶ","あたえる","あたためる","あたりまえ","あたる","あつい","あつかう","あっしゅく","あつまり","あつめる","あてな","あてはまる","あひる","あぶら","あぶる","あふれる","あまい","あまど","あまやかす","あまり","あみもの","あめりか","あやまる","あゆむ","あらいぐま","あらし","あらすじ","あらためる","あらゆる","あらわす","ありがとう","あわせる","あわてる","あんい","あんがい","あんこ","あんぜん","あんてい","あんない","あんまり","いいだす","いおん","いがい","いがく","いきおい","いきなり","いきもの","いきる","いくじ","いくぶん","いけばな","いけん","いこう","いこく","いこつ","いさましい","いさん","いしき","いじゅう","いじょう","いじわる","いずみ","いずれ","いせい","いせえび","いせかい","いせき","いぜん","いそうろう","いそがしい","いだい","いだく","いたずら","いたみ","いたりあ","いちおう","いちじ","いちど","いちば","いちぶ","いちりゅう","いつか","いっしゅん","いっせい","いっそう","いったん","いっち","いってい","いっぽう","いてざ","いてん","いどう","いとこ","いない","いなか","いねむり","いのち","いのる","いはつ","いばる","いはん","いびき","いひん","いふく","いへん","いほう","いみん","いもうと","いもたれ","いもり","いやがる","いやす","いよかん","いよく","いらい","いらすと","いりぐち","いりょう","いれい","いれもの","いれる","いろえんぴつ","いわい","いわう","いわかん","いわば","いわゆる","いんげんまめ","いんさつ","いんしょう","いんよう","うえき","うえる","うおざ","うがい","うかぶ","うかべる","うきわ","うくらいな","うくれれ","うけたまわる","うけつけ","うけとる","うけもつ","うける","うごかす","うごく","うこん","うさぎ","うしなう","うしろがみ","うすい","うすぎ","うすぐらい","うすめる","うせつ","うちあわせ","うちがわ","うちき","うちゅう","うっかり","うつくしい","うったえる","うつる","うどん","うなぎ","うなじ","うなずく","うなる","うねる","うのう","うぶげ","うぶごえ","うまれる","うめる","うもう","うやまう","うよく","うらがえす","うらぐち","うらない","うりあげ","うりきれ","うるさい","うれしい","うれゆき","うれる","うろこ","うわき","うわさ","うんこう","うんちん","うんてん","うんどう","えいえん","えいが","えいきょう","えいご","えいせい","えいぶん","えいよう","えいわ","えおり","えがお","えがく","えきたい","えくせる","えしゃく","えすて","えつらん","えのぐ","えほうまき","えほん","えまき","えもじ","えもの","えらい","えらぶ","えりあ","えんえん","えんかい","えんぎ","えんげき","えんしゅう","えんぜつ","えんそく","えんちょう","えんとつ","おいかける","おいこす","おいしい","おいつく","おうえん","おうさま","おうじ","おうせつ","おうたい","おうふく","おうべい","おうよう","おえる","おおい","おおう","おおどおり","おおや","おおよそ","おかえり","おかず","おがむ","おかわり","おぎなう","おきる","おくさま","おくじょう","おくりがな","おくる","おくれる","おこす","おこなう","おこる","おさえる","おさない","おさめる","おしいれ","おしえる","おじぎ","おじさん","おしゃれ","おそらく","おそわる","おたがい","おたく","おだやか","おちつく","おっと","おつり","おでかけ","おとしもの","おとなしい","おどり","おどろかす","おばさん","おまいり","おめでとう","おもいで","おもう","おもたい","おもちゃ","おやつ","おやゆび","およぼす","おらんだ","おろす","おんがく","おんけい","おんしゃ","おんせん","おんだん","おんちゅう","おんどけい","かあつ","かいが","がいき","がいけん","がいこう","かいさつ","かいしゃ","かいすいよく","かいぜん","かいぞうど","かいつう","かいてん","かいとう","かいふく","がいへき","かいほう","かいよう","がいらい","かいわ","かえる","かおり","かかえる","かがく","かがし","かがみ","かくご","かくとく","かざる","がぞう","かたい","かたち","がちょう","がっきゅう","がっこう","がっさん","がっしょう","かなざわし","かのう","がはく","かぶか","かほう","かほご","かまう","かまぼこ","かめれおん","かゆい","かようび","からい","かるい","かろう","かわく","かわら","がんか","かんけい","かんこう","かんしゃ","かんそう","かんたん","かんち","がんばる","きあい","きあつ","きいろ","ぎいん","きうい","きうん","きえる","きおう","きおく","きおち","きおん","きかい","きかく","きかんしゃ","ききて","きくばり","きくらげ","きけんせい","きこう","きこえる","きこく","きさい","きさく","きさま","きさらぎ","ぎじかがく","ぎしき","ぎじたいけん","ぎじにってい","ぎじゅつしゃ","きすう","きせい","きせき","きせつ","きそう","きぞく","きぞん","きたえる","きちょう","きつえん","ぎっちり","きつつき","きつね","きてい","きどう","きどく","きない","きなが","きなこ","きぬごし","きねん","きのう","きのした","きはく","きびしい","きひん","きふく","きぶん","きぼう","きほん","きまる","きみつ","きむずかしい","きめる","きもだめし","きもち","きもの","きゃく","きやく","ぎゅうにく","きよう","きょうりゅう","きらい","きらく","きりん","きれい","きれつ","きろく","ぎろん","きわめる","ぎんいろ","きんかくじ","きんじょ","きんようび","ぐあい","くいず","くうかん","くうき","くうぐん","くうこう","ぐうせい","くうそう","ぐうたら","くうふく","くうぼ","くかん","くきょう","くげん","ぐこう","くさい","くさき","くさばな","くさる","くしゃみ","くしょう","くすのき","くすりゆび","くせげ","くせん","ぐたいてき","くださる","くたびれる","くちこみ","くちさき","くつした","ぐっすり","くつろぐ","くとうてん","くどく","くなん","くねくね","くのう","くふう","くみあわせ","くみたてる","くめる","くやくしょ","くらす","くらべる","くるま","くれる","くろう","くわしい","ぐんかん","ぐんしょく","ぐんたい","ぐんて","けあな","けいかく","けいけん","けいこ","けいさつ","げいじゅつ","けいたい","げいのうじん","けいれき","けいろ","けおとす","けおりもの","げきか","げきげん","げきだん","げきちん","げきとつ","げきは","げきやく","げこう","げこくじょう","げざい","けさき","げざん","けしき","けしごむ","けしょう","げすと","けたば","けちゃっぷ","けちらす","けつあつ","けつい","けつえき","けっこん","けつじょ","けっせき","けってい","けつまつ","げつようび","げつれい","けつろん","げどく","けとばす","けとる","けなげ","けなす","けなみ","けぬき","げねつ","けねん","けはい","げひん","けぶかい","げぼく","けまり","けみかる","けむし","けむり","けもの","けらい","けろけろ","けわしい","けんい","けんえつ","けんお","けんか","げんき","けんげん","けんこう","けんさく","けんしゅう","けんすう","げんそう","けんちく","けんてい","けんとう","けんない","けんにん","げんぶつ","けんま","けんみん","けんめい","けんらん","けんり","こあくま","こいぬ","こいびと","ごうい","こうえん","こうおん","こうかん","ごうきゅう","ごうけい","こうこう","こうさい","こうじ","こうすい","ごうせい","こうそく","こうたい","こうちゃ","こうつう","こうてい","こうどう","こうない","こうはい","ごうほう","ごうまん","こうもく","こうりつ","こえる","こおり","ごかい","ごがつ","ごかん","こくご","こくさい","こくとう","こくない","こくはく","こぐま","こけい","こける","ここのか","こころ","こさめ","こしつ","こすう","こせい","こせき","こぜん","こそだて","こたい","こたえる","こたつ","こちょう","こっか","こつこつ","こつばん","こつぶ","こてい","こてん","ことがら","ことし","ことば","ことり","こなごな","こねこね","このまま","このみ","このよ","ごはん","こひつじ","こふう","こふん","こぼれる","ごまあぶら","こまかい","ごますり","こまつな","こまる","こむぎこ","こもじ","こもち","こもの","こもん","こやく","こやま","こゆう","こゆび","こよい","こよう","こりる","これくしょん","ころっけ","こわもて","こわれる","こんいん","こんかい","こんき","こんしゅう","こんすい","こんだて","こんとん","こんなん","こんびに","こんぽん","こんまけ","こんや","こんれい","こんわく","ざいえき","さいかい","さいきん","ざいげん","ざいこ","さいしょ","さいせい","ざいたく","ざいちゅう","さいてき","ざいりょう","さうな","さかいし","さがす","さかな","さかみち","さがる","さぎょう","さくし","さくひん","さくら","さこく","さこつ","さずかる","ざせき","さたん","さつえい","ざつおん","ざっか","ざつがく","さっきょく","ざっし","さつじん","ざっそう","さつたば","さつまいも","さてい","さといも","さとう","さとおや","さとし","さとる","さのう","さばく","さびしい","さべつ","さほう","さほど","さます","さみしい","さみだれ","さむけ","さめる","さやえんどう","さゆう","さよう","さよく","さらだ","ざるそば","さわやか","さわる","さんいん","さんか","さんきゃく","さんこう","さんさい","ざんしょ","さんすう","さんせい","さんそ","さんち","さんま","さんみ","さんらん","しあい","しあげ","しあさって","しあわせ","しいく","しいん","しうち","しえい","しおけ","しかい","しかく","じかん","しごと","しすう","じだい","したうけ","したぎ","したて","したみ","しちょう","しちりん","しっかり","しつじ","しつもん","してい","してき","してつ","じてん","じどう","しなぎれ","しなもの","しなん","しねま","しねん","しのぐ","しのぶ","しはい","しばかり","しはつ","しはらい","しはん","しひょう","しふく","じぶん","しへい","しほう","しほん","しまう","しまる","しみん","しむける","じむしょ","しめい","しめる","しもん","しゃいん","しゃうん","しゃおん","じゃがいも","しやくしょ","しゃくほう","しゃけん","しゃこ","しゃざい","しゃしん","しゃせん","しゃそう","しゃたい","しゃちょう","しゃっきん","じゃま","しゃりん","しゃれい","じゆう","じゅうしょ","しゅくはく","じゅしん","しゅっせき","しゅみ","しゅらば","じゅんばん","しょうかい","しょくたく","しょっけん","しょどう","しょもつ","しらせる","しらべる","しんか","しんこう","じんじゃ","しんせいじ","しんちく","しんりん","すあげ","すあし","すあな","ずあん","すいえい","すいか","すいとう","ずいぶん","すいようび","すうがく","すうじつ","すうせん","すおどり","すきま","すくう","すくない","すける","すごい","すこし","ずさん","すずしい","すすむ","すすめる","すっかり","ずっしり","ずっと","すてき","すてる","すねる","すのこ","すはだ","すばらしい","ずひょう","ずぶぬれ","すぶり","すふれ","すべて","すべる","ずほう","すぼん","すまい","すめし","すもう","すやき","すらすら","するめ","すれちがう","すろっと","すわる","すんぜん","すんぽう","せあぶら","せいかつ","せいげん","せいじ","せいよう","せおう","せかいかん","せきにん","せきむ","せきゆ","せきらんうん","せけん","せこう","せすじ","せたい","せたけ","せっかく","せっきゃく","ぜっく","せっけん","せっこつ","せっさたくま","せつぞく","せつだん","せつでん","せっぱん","せつび","せつぶん","せつめい","せつりつ","せなか","せのび","せはば","せびろ","せぼね","せまい","せまる","せめる","せもたれ","せりふ","ぜんあく","せんい","せんえい","せんか","せんきょ","せんく","せんげん","ぜんご","せんさい","せんしゅ","せんすい","せんせい","せんぞ","せんたく","せんちょう","せんてい","せんとう","せんぬき","せんねん","せんぱい","ぜんぶ","ぜんぽう","せんむ","せんめんじょ","せんもん","せんやく","せんゆう","せんよう","ぜんら","ぜんりゃく","せんれい","せんろ","そあく","そいとげる","そいね","そうがんきょう","そうき","そうご","そうしん","そうだん","そうなん","そうび","そうめん","そうり","そえもの","そえん","そがい","そげき","そこう","そこそこ","そざい","そしな","そせい","そせん","そそぐ","そだてる","そつう","そつえん","そっかん","そつぎょう","そっけつ","そっこう","そっせん","そっと","そとがわ","そとづら","そなえる","そなた","そふぼ","そぼく","そぼろ","そまつ","そまる","そむく","そむりえ","そめる","そもそも","そよかぜ","そらまめ","そろう","そんかい","そんけい","そんざい","そんしつ","そんぞく","そんちょう","ぞんび","ぞんぶん","そんみん","たあい","たいいん","たいうん","たいえき","たいおう","だいがく","たいき","たいぐう","たいけん","たいこ","たいざい","だいじょうぶ","だいすき","たいせつ","たいそう","だいたい","たいちょう","たいてい","だいどころ","たいない","たいねつ","たいのう","たいはん","だいひょう","たいふう","たいへん","たいほ","たいまつばな","たいみんぐ","たいむ","たいめん","たいやき","たいよう","たいら","たいりょく","たいる","たいわん","たうえ","たえる","たおす","たおる","たおれる","たかい","たかね","たきび","たくさん","たこく","たこやき","たさい","たしざん","だじゃれ","たすける","たずさわる","たそがれ","たたかう","たたく","ただしい","たたみ","たちばな","だっかい","だっきゃく","だっこ","だっしゅつ","だったい","たてる","たとえる","たなばた","たにん","たぬき","たのしみ","たはつ","たぶん","たべる","たぼう","たまご","たまる","だむる","ためいき","ためす","ためる","たもつ","たやすい","たよる","たらす","たりきほんがん","たりょう","たりる","たると","たれる","たれんと","たろっと","たわむれる","だんあつ","たんい","たんおん","たんか","たんき","たんけん","たんご","たんさん","たんじょうび","だんせい","たんそく","たんたい","だんち","たんてい","たんとう","だんな","たんにん","だんねつ","たんのう","たんぴん","だんぼう","たんまつ","たんめい","だんれつ","だんろ","だんわ","ちあい","ちあん","ちいき","ちいさい","ちえん","ちかい","ちから","ちきゅう","ちきん","ちけいず","ちけん","ちこく","ちさい","ちしき","ちしりょう","ちせい","ちそう","ちたい","ちたん","ちちおや","ちつじょ","ちてき","ちてん","ちぬき","ちぬり","ちのう","ちひょう","ちへいせん","ちほう","ちまた","ちみつ","ちみどろ","ちめいど","ちゃんこなべ","ちゅうい","ちゆりょく","ちょうし","ちょさくけん","ちらし","ちらみ","ちりがみ","ちりょう","ちるど","ちわわ","ちんたい","ちんもく","ついか","ついたち","つうか","つうじょう","つうはん","つうわ","つかう","つかれる","つくね","つくる","つけね","つける","つごう","つたえる","つづく","つつじ","つつむ","つとめる","つながる","つなみ","つねづね","つのる","つぶす","つまらない","つまる","つみき","つめたい","つもり","つもる","つよい","つるぼ","つるみく","つわもの","つわり","てあし","てあて","てあみ","ていおん","ていか","ていき","ていけい","ていこく","ていさつ","ていし","ていせい","ていたい","ていど","ていねい","ていひょう","ていへん","ていぼう","てうち","ておくれ","てきとう","てくび","でこぼこ","てさぎょう","てさげ","てすり","てそう","てちがい","てちょう","てつがく","てつづき","でっぱ","てつぼう","てつや","でぬかえ","てぬき","てぬぐい","てのひら","てはい","てぶくろ","てふだ","てほどき","てほん","てまえ","てまきずし","てみじか","てみやげ","てらす","てれび","てわけ","てわたし","でんあつ","てんいん","てんかい","てんき","てんぐ","てんけん","てんごく","てんさい","てんし","てんすう","でんち","てんてき","てんとう","てんない","てんぷら","てんぼうだい","てんめつ","てんらんかい","でんりょく","でんわ","どあい","といれ","どうかん","とうきゅう","どうぐ","とうし","とうむぎ","とおい","とおか","とおく","とおす","とおる","とかい","とかす","ときおり","ときどき","とくい","とくしゅう","とくてん","とくに","とくべつ","とけい","とける","とこや","とさか","としょかん","とそう","とたん","とちゅう","とっきゅう","とっくん","とつぜん","とつにゅう","とどける","ととのえる","とない","となえる","となり","とのさま","とばす","どぶがわ","とほう","とまる","とめる","ともだち","ともる","どようび","とらえる","とんかつ","どんぶり","ないかく","ないこう","ないしょ","ないす","ないせん","ないそう","なおす","ながい","なくす","なげる","なこうど","なさけ","なたでここ","なっとう","なつやすみ","ななおし","なにごと","なにもの","なにわ","なのか","なふだ","なまいき","なまえ","なまみ","なみだ","なめらか","なめる","なやむ","ならう","ならび","ならぶ","なれる","なわとび","なわばり","にあう","にいがた","にうけ","におい","にかい","にがて","にきび","にくしみ","にくまん","にげる","にさんかたんそ","にしき","にせもの","にちじょう","にちようび","にっか","にっき","にっけい","にっこう","にっさん","にっしょく","にっすう","にっせき","にってい","になう","にほん","にまめ","にもつ","にやり","にゅういん","にりんしゃ","にわとり","にんい","にんか","にんき","にんげん","にんしき","にんずう","にんそう","にんたい","にんち","にんてい","にんにく","にんぷ","にんまり","にんむ","にんめい","にんよう","ぬいくぎ","ぬかす","ぬぐいとる","ぬぐう","ぬくもり","ぬすむ","ぬまえび","ぬめり","ぬらす","ぬんちゃく","ねあげ","ねいき","ねいる","ねいろ","ねぐせ","ねくたい","ねくら","ねこぜ","ねこむ","ねさげ","ねすごす","ねそべる","ねだん","ねつい","ねっしん","ねつぞう","ねったいぎょ","ねぶそく","ねふだ","ねぼう","ねほりはほり","ねまき","ねまわし","ねみみ","ねむい","ねむたい","ねもと","ねらう","ねわざ","ねんいり","ねんおし","ねんかん","ねんきん","ねんぐ","ねんざ","ねんし","ねんちゃく","ねんど","ねんぴ","ねんぶつ","ねんまつ","ねんりょう","ねんれい","のいず","のおづま","のがす","のきなみ","のこぎり","のこす","のこる","のせる","のぞく","のぞむ","のたまう","のちほど","のっく","のばす","のはら","のべる","のぼる","のみもの","のやま","のらいぬ","のらねこ","のりもの","のりゆき","のれん","のんき","ばあい","はあく","ばあさん","ばいか","ばいく","はいけん","はいご","はいしん","はいすい","はいせん","はいそう","はいち","ばいばい","はいれつ","はえる","はおる","はかい","ばかり","はかる","はくしゅ","はけん","はこぶ","はさみ","はさん","はしご","ばしょ","はしる","はせる","ぱそこん","はそん","はたん","はちみつ","はつおん","はっかく","はづき","はっきり","はっくつ","はっけん","はっこう","はっさん","はっしん","はったつ","はっちゅう","はってん","はっぴょう","はっぽう","はなす","はなび","はにかむ","はぶらし","はみがき","はむかう","はめつ","はやい","はやし","はらう","はろうぃん","はわい","はんい","はんえい","はんおん","はんかく","はんきょう","ばんぐみ","はんこ","はんしゃ","はんすう","はんだん","ぱんち","ぱんつ","はんてい","はんとし","はんのう","はんぱ","はんぶん","はんぺん","はんぼうき","はんめい","はんらん","はんろん","ひいき","ひうん","ひえる","ひかく","ひかり","ひかる","ひかん","ひくい","ひけつ","ひこうき","ひこく","ひさい","ひさしぶり","ひさん","びじゅつかん","ひしょ","ひそか","ひそむ","ひたむき","ひだり","ひたる","ひつぎ","ひっこし","ひっし","ひつじゅひん","ひっす","ひつぜん","ぴったり","ぴっちり","ひつよう","ひてい","ひとごみ","ひなまつり","ひなん","ひねる","ひはん","ひびく","ひひょう","ひほう","ひまわり","ひまん","ひみつ","ひめい","ひめじし","ひやけ","ひやす","ひよう","びょうき","ひらがな","ひらく","ひりつ","ひりょう","ひるま","ひるやすみ","ひれい","ひろい","ひろう","ひろき","ひろゆき","ひんかく","ひんけつ","ひんこん","ひんしゅ","ひんそう","ぴんち","ひんぱん","びんぼう","ふあん","ふいうち","ふうけい","ふうせん","ぷうたろう","ふうとう","ふうふ","ふえる","ふおん","ふかい","ふきん","ふくざつ","ふくぶくろ","ふこう","ふさい","ふしぎ","ふじみ","ふすま","ふせい","ふせぐ","ふそく","ぶたにく","ふたん","ふちょう","ふつう","ふつか","ふっかつ","ふっき","ふっこく","ぶどう","ふとる","ふとん","ふのう","ふはい","ふひょう","ふへん","ふまん","ふみん","ふめつ","ふめん","ふよう","ふりこ","ふりる","ふるい","ふんいき","ぶんがく","ぶんぐ","ふんしつ","ぶんせき","ふんそう","ぶんぽう","へいあん","へいおん","へいがい","へいき","へいげん","へいこう","へいさ","へいしゃ","へいせつ","へいそ","へいたく","へいてん","へいねつ","へいわ","へきが","へこむ","べにいろ","べにしょうが","へらす","へんかん","べんきょう","べんごし","へんさい","へんたい","べんり","ほあん","ほいく","ぼうぎょ","ほうこく","ほうそう","ほうほう","ほうもん","ほうりつ","ほえる","ほおん","ほかん","ほきょう","ぼきん","ほくろ","ほけつ","ほけん","ほこう","ほこる","ほしい","ほしつ","ほしゅ","ほしょう","ほせい","ほそい","ほそく","ほたて","ほたる","ぽちぶくろ","ほっきょく","ほっさ","ほったん","ほとんど","ほめる","ほんい","ほんき","ほんけ","ほんしつ","ほんやく","まいにち","まかい","まかせる","まがる","まける","まこと","まさつ","まじめ","ますく","まぜる","まつり","まとめ","まなぶ","まぬけ","まねく","まほう","まもる","まゆげ","まよう","まろやか","まわす","まわり","まわる","まんが","まんきつ","まんぞく","まんなか","みいら","みうち","みえる","みがく","みかた","みかん","みけん","みこん","みじかい","みすい","みすえる","みせる","みっか","みつかる","みつける","みてい","みとめる","みなと","みなみかさい","みねらる","みのう","みのがす","みほん","みもと","みやげ","みらい","みりょく","みわく","みんか","みんぞく","むいか","むえき","むえん","むかい","むかう","むかえ","むかし","むぎちゃ","むける","むげん","むさぼる","むしあつい","むしば","むじゅん","むしろ","むすう","むすこ","むすぶ","むすめ","むせる","むせん","むちゅう","むなしい","むのう","むやみ","むよう","むらさき","むりょう","むろん","めいあん","めいうん","めいえん","めいかく","めいきょく","めいさい","めいし","めいそう","めいぶつ","めいれい","めいわく","めぐまれる","めざす","めした","めずらしい","めだつ","めまい","めやす","めんきょ","めんせき","めんどう","もうしあげる","もうどうけん","もえる","もくし","もくてき","もくようび","もちろん","もどる","もらう","もんく","もんだい","やおや","やける","やさい","やさしい","やすい","やすたろう","やすみ","やせる","やそう","やたい","やちん","やっと","やっぱり","やぶる","やめる","ややこしい","やよい","やわらかい","ゆうき","ゆうびんきょく","ゆうべ","ゆうめい","ゆけつ","ゆしゅつ","ゆせん","ゆそう","ゆたか","ゆちゃく","ゆでる","ゆにゅう","ゆびわ","ゆらい","ゆれる","ようい","ようか","ようきゅう","ようじ","ようす","ようちえん","よかぜ","よかん","よきん","よくせい","よくぼう","よけい","よごれる","よさん","よしゅう","よそう","よそく","よっか","よてい","よどがわく","よねつ","よやく","よゆう","よろこぶ","よろしい","らいう","らくがき","らくご","らくさつ","らくだ","らしんばん","らせん","らぞく","らたい","らっか","られつ","りえき","りかい","りきさく","りきせつ","りくぐん","りくつ","りけん","りこう","りせい","りそう","りそく","りてん","りねん","りゆう","りゅうがく","りよう","りょうり","りょかん","りょくちゃ","りょこう","りりく","りれき","りろん","りんご","るいけい","るいさい","るいじ","るいせき","るすばん","るりがわら","れいかん","れいぎ","れいせい","れいぞうこ","れいとう","れいぼう","れきし","れきだい","れんあい","れんけい","れんこん","れんさい","れんしゅう","れんぞく","れんらく","ろうか","ろうご","ろうじん","ろうそく","ろくが","ろこつ","ろじうら","ろしゅつ","ろせん","ろてん","ろめん","ろれつ","ろんぎ","ろんぱ","ろんぶん","ろんり","わかす","わかめ","わかやま","わかれる","わしつ","わじまし","わすれもの","わらう","われる"];Dr.space=" ";const Fr=["á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"];Fr.space=" ";class qr extends Ce{constructor(e,t,i){super({mnemonic:e,seed:t,wordlist:i}),this.Wordlist=i||Lr,this.es=Fr,this.jp=Dr}setLang(e){switch(e){case"es":this.Wordlist=Fr;break;case"jp":this.Wordlist=Dr;break;default:this.Wordlist=Lr;break}}toBw(e){if(e||(e=new ke),this.mnemonic){const t=Buffer.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 i=e.readVarIntNum();return i>0&&(this.seed=e.read(i)),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");if(e>256)throw new Error("bits must be at most 256");const t=Rt.getRandomBuffer(e/8);return this.entropy2Mnemonic(t),this.mnemonic2Seed(),this}static fromRandom(e){return new this().fromRandom(e)}async asyncFromRandom(e){if(e||(e=128),e%32!==0||e<128||e>256)throw new Error("bits must be a multiple of 32 between 128 and 256");const t=Rt.getRandomBuffer(e/8);let i=await le.asyncObjectMethod(this,"entropy2Mnemonic",[t]);const u=new qr().fromFastBuffer(i.resbuf);return i=await le.asyncObjectMethod(u,"mnemonic2Seed",[]),this.fromFastBuffer(i.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 le.asyncObjectMethod(this,"fromEntropy",[e]);return this.fromFastBuffer(t.resbuf)}static asyncFromEntropy(e){return new this().asyncFromEntropy(e)}fromString(e){return this.mnemonic=e,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 le.asyncObjectMethod(this,"toSeed",t)).resbuf}entropy2Mnemonic(e){if(!Buffer.isBuffer(e)||e.length<128/8)throw new Error("Entropy is less than 128 bits. It must be 128 bits or more.");const t=ae.sha256(e);let i="";const u=e.length*8;for(let a=0;a<e.length;a++)i=i+("00000000"+e[a].toString(2)).slice(-8);let r=t[0].toString(2);if(r=("00000000"+r).slice(-8).slice(0,u/32),i=i+r,i.length%11!==0)throw new Error("internal error - entropy not an even multiple of 11 bits - "+i.length);let s="";for(let a=0;a<i.length/11;a++){s!==""&&(s=s+this.Wordlist.space);const o=parseInt(i.slice(a*11,(a+1)*11),2);s=s+this.Wordlist[o]}return this.mnemonic=s,this}check(){const t=this.mnemonic.split(this.Wordlist.space);let i="";for(let n=0;n<t.length;n++){const c=this.Wordlist.indexOf(t[n]);if(c<0)return!1;i=i+("00000000000"+c.toString(2)).slice(-11)}if(i.length%11!==0)return!1;const u=i.length/33;if(!Number.isInteger(u))return!1;const r=i.slice(-u),s=i.slice(0,i.length-u),a=Buffer.alloc(s.length/8);for(let n=0;n<s.length/8;n++)a.writeUInt8(parseInt(i.slice(n*8,(n+1)*8),2),n);let f=ae.sha256(a)[0].toString(2);return f=("00000000"+f).slice(-8).slice(0,u),f===r}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 i=Buffer.from(t),u=Buffer.concat([Buffer.from("mnemonic"),Buffer.from(e)]);return this.seed=Buffer.from(Ld.pbkdf2Sync(i,u,2048,64,"sha512")),this}isValid(e=""){let t;try{t=!!this.mnemonic2Seed(e)}catch{t=!1}return t}static isValid(e,t=""){return new qr(e).isValid(t)}}class $1{constructor(e=Buffer.alloc(0)){this.buf=Buffer.from(e),this.pos=0}get length(){return this.buf.length}eof(){return this.pos>=this.buf.length}read(e){if(e<0||this.pos+e>this.buf.length)throw new RangeError("read beyond end of buffer");const t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}readUInt8(){return this.read(1).readUInt8(0)}readUInt16LE(){return this.read(2).readUInt16LE(0)}readUInt32LE(){return this.read(4).readUInt32LE(0)}readUInt64LEBn(){return new Z().fromBuffer(this.read(8),{endian:"little"})}readVarIntNum(){const e=this.readUInt8();if(e<253)return e;if(e===253){const i=this.readUInt16LE();if(i<253)throw new Error("non-canonical varInt");return i}if(e===254){const i=this.readUInt32LE();if(i<=65535)throw new Error("non-canonical varInt");return i}const t=this.readUInt64LEBn();if(t.lte(new Z(4294967295)))throw new Error("non-canonical varInt");if(t.abs().toString(16)==="ffffffffffffffff")return-1;if(t.gt(new Z(Number.MAX_SAFE_INTEGER)))throw new Error("number too large to retain precision");return t.toNumber()}}class ct extends Ce{constructor(e,t,i=wt){super({privKey:e,pubKey:t}),this.PrivKey=i}fromJSON(e){return e.privKey&&(this.privKey=this.PrivKey.fromJSON(e.privKey)),e.pubKey&&(this.pubKey=Ue.fromJSON(e.pubKey)),this}fromBr(e){const t=e.readUInt8();t>0&&(this.privKey=new this.PrivKey().fromFastBuffer(e.read(t)));const i=e.readUInt8();return i>0&&(this.pubKey=new Ue().fromFastBuffer(e.read(i))),this}toBw(e){if(e||(e=new ke),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 ct().fromObject(this);return e.privKey=void 0,e}fromPrivKey(e){return this.privKey=e,this.pubKey=new Ue().fromPrivKey(e),this}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){return this.privKey=e,this.pubKey=await new Ue().asyncFromPrivKey(e),this}static asyncFromPrivKey(e){return new this().asyncFromPrivKey(e)}fromRandom(){return this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new Ue().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()}}ct.Mainnet=class extends ct{constructor(d,e){super(d,e,wt.Mainnet)}};ct.Testnet=class extends ct{constructor(d,e){super(d,e,wt.Testnet)}};class ht extends Ce{constructor(e,t,i,u,r,s){super({sig:e,keyPair:t,hashBuf:i,k:u,endian:r,verified:s})}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 ce().fromString(e.sig):void 0,this.keyPair=e.keyPair?new ct().fromBuffer(Buffer.from(e.keyPair,"hex")):void 0,this.hashBuf=e.hashBuf?Buffer.from(e.hashBuf,"hex"):void 0,this.k=e.k?new Z().fromString(e.k):void 0,this.endian=e.endian,this.verified=e.verified,this}toBuffer(){const e=JSON.stringify(this.toJSON());return Buffer.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 i=this.keyPair.pubKey.compressed;return this.sig.compressed=this.keyPair.pubKey.compressed===void 0?!0:i,this}}throw this.sig.recovery=void 0,new Error("Unable to find valid recovery factor")}async asyncCalcrecovery(){const e=await le.asyncObjectMethod(this,"calcrecovery",[]);return this.fromFastBuffer(e.resbuf)}static calcrecovery(e,t,i){return new ht().fromObject({sig:e,keyPair:new ct().fromObject({pubKey:t}),hashBuf:i}).calcrecovery().sig}static async asyncCalcrecovery(e,t,i){const u=await le.asyncClassMethod(ht,"calcrecovery",[e,t,i]);return new ce().fromFastBuffer(u.resbuf)}fromString(e){const t=JSON.parse(e);return t.hashBuf&&(this.hashBuf=Buffer.from(t.hashBuf,"hex")),t.keyPair&&(this.keyPair=new ct().fromString(t.keyPair)),t.sig&&(this.sig=new ce().fromString(t.sig)),t.k&&(this.k=new Z(t.k,10)),this}randomK(){const e=Ae.getN();let t;do t=new Z().fromBuffer(Rt.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(0)));return this.k=t,this}deterministicK(e){let t=Buffer.alloc(32);t.fill(1);let i=Buffer.alloc(32);i.fill(0);const u=this.keyPair.privKey.bn.toBuffer({size:32});i=ae.sha256Hmac(Buffer.concat([t,Buffer.from([0]),u,this.hashBuf]),i),t=ae.sha256Hmac(t,i),i=ae.sha256Hmac(Buffer.concat([t,Buffer.from([1]),u,this.hashBuf]),i),t=ae.sha256Hmac(t,i),t=ae.sha256Hmac(t,i);let r=new Z().fromBuffer(t);const s=Ae.getN();e===void 0&&(e=0);for(let a=0;a<e||!(r.lt(s)&&r.gt(0));a++)i=ae.sha256Hmac(Buffer.concat([t,Buffer.from([0])]),i),t=ae.sha256Hmac(t,i),t=ae.sha256Hmac(t,i),r=new Z().fromBuffer(t);return this.k=r,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 Z().fromBuffer(this.hashBuf),i=this.sig.r,u=this.sig.s,r=e&1,s=e>>1,a=Ae.getN(),o=Ae.getG(),f=s?i.add(a):i,n=Ae.fromX(r,f);let c="";try{n.mul(a)}catch(y){c=y.message}if(c!=="point mul out of range")throw new Error("nR is not a valid curve point");const h=t.neg().umod(a),l=i.invm(a),b=n.mul(u).add(o.mul(h)).mul(l),p=new Ue(b);return p.compressed=this.sig.compressed,p.validate(),p}async asyncSig2PubKey(){const e=await le.asyncObjectMethod(this,"sig2PubKey",[]);return Ue.fromFastBuffer(e.resbuf)}static sig2PubKey(e,t){return new ht().fromObject({sig:e,hashBuf:t}).sig2PubKey()}static async asyncSig2PubKey(e,t){return await new ht().fromObject({sig:e,hashBuf:t}).asyncSig2PubKey()}verifyStr(e=!0){if(!Buffer.isBuffer(this.hashBuf)||this.hashBuf.length!==32)return"hashBuf must be a 32 byte buffer";try{this.keyPair.pubKey.validate()}catch(n){return"Invalid pubKey: "+n}const t=this.sig.r,i=this.sig.s;if(!(t.gt(0)&&t.lt(Ae.getN()))||!(i.gt(0)&&i.lt(Ae.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 u=new Z().fromBuffer(this.hashBuf,this.endian?{endian:this.endian}:void 0),r=Ae.getN(),s=i.invm(r),a=s.mul(u).mod(r),o=s.mul(t).mod(r),f=Ae.getG().mulAdd(a,this.keyPair.pubKey.point,o);return f.isInfinity()?"p is infinity":f.getX().mod(r).cmp(t)!==0?"Invalid signature":!1}sign(){const e=this.endian==="little"?new st(this.hashBuf).readReverse():this.hashBuf,t=this.keyPair.privKey,i=t.bn;if(!e||!t||!i)throw new Error("invalid parameters");if(!Buffer.isBuffer(e)||e.length!==32)throw new Error("hashBuf must be a 32 byte buffer");const u=Ae.getN(),r=Ae.getG(),s=new Z().fromBuffer(e);let a=0,o,f,n,c;do(!this.k||a>0)&&this.deterministicK(a),a++,o=this.k,f=r.mul(o),n=f.getX().mod(u),c=o.invm(u).mul(s.add(i.mul(n))).mod(u);while(n.cmp(0)<=0||c.cmp(0)<=0);return c.gt(new Z().fromBuffer(Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(c=Ae.getN().sub(c)),this.sig=ce.fromObject({r:n,s:c,compressed:this.keyPair.pubKey.compressed}),this}async asyncSign(){const e=await le.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 le.asyncObjectMethod(this,"verify",[e]);return this.fromFastBuffer(t.resbuf)}static sign(e,t,i){return new ht().fromObject({hashBuf:e,endian:i,keyPair:t}).sign().sig}static async asyncSign(e,t,i){const u=new ht().fromObject({hashBuf:e,endian:i,keyPair:t});return await u.asyncSign(),u.sig}static verify(e,t,i,u,r=!0){return new ht().fromObject({hashBuf:e,endian:u,sig:t,keyPair:new ct().fromObject({pubKey:i})}).verify(r).verified}static async asyncVerify(e,t,i,u,r=!0){const s=new ht().fromObject({hashBuf:e,endian:u,sig:t,keyPair:new ct().fromObject({pubKey:i})});return await s.asyncVerify(r),s.verified}}class mt extends Ce{constructor(e,t,i,u,r){super({messageBuf:e,keyPair:t,sig:i,address:u,verified:r})}static magicHash(e){if(!Buffer.isBuffer(e))throw new Error("messageBuf must be a buffer");const t=new ke;t.writeVarIntNum(mt.magicBytes.length),t.write(mt.magicBytes),t.writeVarIntNum(e.length),t.write(e);const i=t.toBuffer();return ae.sha256Sha256(i)}static async asyncMagicHash(e){const t=[e];return(await le.asyncClassMethod(mt,"magicHash",t)).resbuf}static sign(e,t){const i=new mt(e,t);return i.sign(),i.sig.toCompact().toString("base64")}static async asyncSign(e,t){const i=[e,t],u=await le.asyncClassMethod(mt,"sign",i);return JSON.parse(u.resbuf.toString())}static verify(e,t,i){const u=Buffer.from(t,"base64"),r=new mt;return r.messageBuf=e,r.sig=new ce().fromCompact(u),r.address=i,r.verify().verified}static async asyncVerify(e,t,i){const u=[e,t,i],r=await le.asyncClassMethod(mt,"verify",u);return JSON.parse(r.resbuf.toString())}sign(){const e=mt.magicHash(this.messageBuf),t=new ht().fromObject({hashBuf:e,keyPair:this.keyPair});return t.sign(),t.calcrecovery(),this.sig=t.sig,this}verify(){const e=mt.magicHash(this.messageBuf),t=new ht;if(t.hashBuf=e,t.sig=this.sig,t.keyPair=new ct,t.keyPair.pubKey=t.sig2PubKey(),!t.verify())return this.verified=!1,this;const i=new gt().fromPubKey(t.keyPair.pubKey,void 0,this.sig.compressed);return kt(i.hashBuf,this.address.hashBuf)?this.verified=!0:this.verified=!1,this}}mt.magicBytes=Buffer.from(`Bitcoin Signed Message:
9
- `);class W1{constructor(){this.chunks=[]}write(e){return this.chunks.push(Buffer.from(e)),this}writeUInt8(e){const t=Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t)}writeUInt16LE(e){const t=Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t)}writeUInt32LE(e){const t=Buffer.alloc(4);return t.writeUInt32LE(e>>>0,0),this.write(t)}writeUInt64LE(e){const t=e instanceof Z?e:new Z(e);return this.write(t.toBuffer({size:8,endian:"little"}))}toBuffer(){return Buffer.concat(this.chunks)}toUint8Array(){return new Uint8Array(this.toBuffer())}}const Y1=["__proto__","prototype","constructor"];class Lt{constructor(e){if(this.map=new Map,e!==void 0)for(const t of Object.keys(e))this.set(t,e[t])}static checkKey(e){if(typeof e!="string"||e.length===0)throw new TypeError("key must be a non-empty string");if(Y1.includes(e))throw new TypeError("key is not allowed")}set(e,t){return Lt.checkKey(e),this.map.set(e,t),this}get(e){return Lt.checkKey(e),this.map.get(e)}has(e){return Lt.checkKey(e),this.map.has(e)}delete(e){return Lt.checkKey(e),this.map.delete(e)}get size(){return this.map.size}toJSON(){const e={};for(const[t,i]of this.map)e[t]=i;return e}static fromJSON(e){return new Lt(e)}}class ir extends Ce{constructor(e,t,i,u,r,s){super({versionBytesNum:e,prevBlockHashBuf:t,merkleRootBuf:i,time:u,bits:r,nonce:s})}fromJSON(e){return this.fromObject({versionBytesNum:e.versionBytesNum,prevBlockHashBuf:Buffer.from(e.prevBlockHashBuf,"hex"),merkleRootBuf:Buffer.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 ke),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 Dt extends Ce{constructor(e,t,i,u){super({hashBuf:e,buf:t,merkle1:i,merkle2:u})}hash(){if(this.hashBuf)return this.hashBuf;if(this.buf)return ae.sha256Sha256(this.buf);const e=this.merkle1.hash(),t=this.merkle2.hash();return this.buf=Buffer.concat([e,t]),ae.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 r=e[e.length-1],s=Math.pow(2,Math.ceil(t));for(let a=e.length;a<s;a++)e.push(r)}const i=e.slice(0,e.length/2),u=e.slice(e.length/2);return this.fromBufferArrays(i,u),this}static fromBuffers(e){return new this().fromBuffers(e)}fromBufferArrays(e,t){if(e.length===1)return this.merkle1=new Dt(void 0,e[0]),this.merkle2=new Dt(void 0,t[0]),this;const i=e.slice(0,e.length/2),u=e.slice(e.length/2);this.merkle1=new Dt().fromBufferArrays(i,u);const r=t.slice(0,t.length/2),s=t.slice(t.length/2);return this.merkle2=new Dt().fromBufferArrays(r,s),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 Ur extends Ce{constructor(e,t,i){super(),this.fromObject({prevoutsHashBuf:e,sequenceHashBuf:t,outputsHashBuf:i})}fromBuffer(e){return this.fromJSON(JSON.parse(e.toString()))}toBuffer(){return Buffer.from(JSON.stringify(this.toJSON()))}fromJSON(e){return this.prevoutsHashBuf=e.prevoutsHashBuf?Buffer.from(e.prevoutsHashBuf,"hex"):void 0,this.sequenceHashBuf=e.sequenceHashBuf?Buffer.from(e.sequenceHashBuf,"hex"):void 0,this.outputsHashBuf=e.outputsHashBuf?Buffer.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 De extends Ce{constructor(e){super({buf:e})}fromJSON(e){return this.fromObject({buf:Buffer.from(e,"hex")}),this}toJSON(){return this.buf.toString("hex")}fromBuffer(e,t=!1){return this.buf=e,t&&this.toNumberStrict(),this}fromBr(e){return e.strict?this.buf=new ke().writeVarIntNum(e.readVarIntNumStrict()).toBuffer():this.buf=e.readVarIntBuf(),this}toNumberStrict(){return new st(this.buf,!0).readVarIntNumStrict()}fromBn(e){return this.buf=new ke().writeVarIntBn(e).toBuffer(),this}static fromBn(e){return new this().fromBn(e)}fromNumber(e){return this.buf=new ke().writeVarIntNum(e).toBuffer(),this}static fromNumber(e){return new this().fromNumber(e)}toBuffer(){return this.buf}toBn(){return new st(this.buf).readVarIntBn()}toNumber(){return new st(this.buf).readVarIntNum()}}class He extends Ce{constructor(e,t,i,u,r=4294967295){super({txHashBuf:e,txOutNum:t,scriptVi:i,script:u,nSequence:r})}setScript(e){return this.scriptVi=De.fromNumber(e.toBuffer().length),this.script=e,this}fromProperties(e,t,i,u){return this.fromObject({txHashBuf:e,txOutNum:t,nSequence:u}),this.setScript(i),this}static fromProperties(e,t,i,u){return new this().fromProperties(e,t,i,u)}fromJSON(e){return this.fromObject({txHashBuf:typeof e.txHashBuf<"u"?Buffer.from(e.txHashBuf,"hex"):void 0,txOutNum:e.txOutNum,scriptVi:typeof e.scriptVi<"u"?De.fromJSON(e.scriptVi):void 0,script:typeof e.script<"u"?Ee.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=De.fromBuffer(e.readVarIntBuf()),this.script=Ee.fromBuffer(e.read(this.scriptVi.toNumber())),this.nSequence=e.readUInt32LE(),this}toBw(e){return e||(e=new ke),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,i,u){const r=new Ee;if(i.script.isPubKeyHashOut())r.writeOpCode(q.OP_0),u?r.writeBuffer(u.toBuffer()):r.writeOpCode(q.OP_0);else throw new Error("txOut must be of type pubKeyHash");return this.txHashBuf=e,this.txOutNum=t,this.setScript(r),this}hasNullInput(){return this.txHashBuf.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.txOutNum===4294967295}setNullInput(){this.txHashBuf=Buffer.alloc(32),this.txHashBuf.fill(0),this.txOutNum=4294967295}}He.LOCKTIME_VERIFY_SEQUENCE=1;He.SEQUENCE_FINAL=4294967295;He.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;He.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;He.SEQUENCE_LOCKTIME_MASK=65535;He.SEQUENCE_LOCKTIME_GRANULARITY=9;class yt extends Ce{constructor(e,t,i){super({valueBn:e,scriptVi:t,script:i})}setScript(e){return this.scriptVi=De.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 Z().fromJSON(e.valueBn),scriptVi:new De().fromJSON(e.scriptVi),script:new Ee().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=De.fromNumber(e.readVarIntNum()),this.script=new Ee().fromBuffer(e.read(this.scriptVi.toNumber())),this}toBw(e){return e||(e=new ke),e.writeUInt64LEBn(this.valueBn),e.write(this.scriptVi.buf),e.write(this.script.toBuffer()),e}}class Ne extends Ce{constructor(e=1,t=De.fromNumber(0),i=[],u=De.fromNumber(0),r=[],s=0){super({versionBytesNum:e,txInsVi:t,txIns:i,txOutsVi:u,txOuts:r,nLockTime:s})}fromJSON(e){const t=[];e.txIns.forEach(function(u){t.push(new He().fromJSON(u))});const i=[];return e.txOuts.forEach(function(u){i.push(new yt().fromJSON(u))}),this.fromObject({versionBytesNum:e.versionBytesNum,txInsVi:new De().fromJSON(e.txInsVi),txIns:t,txOutsVi:new De().fromJSON(e.txOutsVi),txOuts:i,nLockTime:e.nLockTime}),this}toJSON(){const e=[];this.txIns.forEach(function(i){e.push(i.toJSON())});const t=[];return this.txOuts.forEach(function(i){t.push(i.toJSON())}),{versionBytesNum:this.versionBytesNum,txInsVi:this.txInsVi.toJSON(),txIns:e,txOutsVi:this.txOutsVi.toJSON(),txOuts:t,nLockTime:this.nLockTime}}fromBuffer(e,t=!1){if(!Buffer.isBuffer(e))throw new Error("buf must be a buffer");const i=new st(e);return i.strict=t,this.fromBr(i)}fromBr(e){this.versionBytesNum=e.readUInt32LE(),this.txInsVi=e.strict?De.fromBr(e):new De(e.readVarIntBuf());const t=this.txInsVi.toNumber();this.txIns=[];for(let u=0;u<t;u++)this.txIns.push(new He().fromBr(e));this.txOutsVi=e.strict?De.fromBr(e):new De(e.readVarIntBuf());const i=this.txOutsVi.toNumber();this.txOuts=[];for(let u=0;u<i;u++)this.txOuts.push(new yt().fromBr(e));return this.nLockTime=e.readUInt32LE(),this}toBw(e){e||(e=new ke),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 ke;for(const t in this.txIns){const i=this.txIns[t];e.write(i.txHashBuf),e.writeUInt32LE(i.txOutNum)}return ae.sha256Sha256(e.toBuffer())}hashSequence(){const e=new ke;for(const t in this.txIns){const i=this.txIns[t];e.writeUInt32LE(i.nSequence)}return ae.sha256Sha256(e.toBuffer())}hashOutputs(){const e=new ke;for(const t in this.txOuts){const i=this.txOuts[t];e.write(i.toBuffer())}return ae.sha256Sha256(e.toBuffer())}sighash(e,t,i,u,r=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,s=new Ur){const a=this.sighashPreimage(e,t,i,u,r,s);return a.compare(Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"))===0?a:new st(ae.sha256Sha256(a)).readReverse()}async asyncSighash(e,t,i,u,r=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,s={}){return(await le.asyncObjectMethod(this,"sighash",[e,t,i,u,r,s])).resbuf}sighashPreimage(e,t,i,u,r=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,s=new Ur){if(u===void 0&&(u=new Z(0)),t>=this.txIns.length)return Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex");if(e&ce.SIGHASH_FORKID&&!(e&ce.SIGHASH_CHRONICLE)&&r&Ne.SCRIPT_ENABLE_SIGHASH_FORKID){let f=Buffer.alloc(32,0),n=Buffer.alloc(32,0),c=Buffer.alloc(32,0);e&ce.SIGHASH_ANYONECANPAY||(f=s.prevoutsHashBuf?s.prevoutsHashBuf:s.prevoutsHashBuf=this.hashPrevouts()),!(e&ce.SIGHASH_ANYONECANPAY)&&(e&31)!==ce.SIGHASH_SINGLE&&(e&31)!==ce.SIGHASH_NONE&&(n=s.sequenceHashBuf?s.sequenceHashBuf:s.sequenceHashBuf=this.hashSequence()),(e&31)!==ce.SIGHASH_SINGLE&&(e&31)!==ce.SIGHASH_NONE?c=s.outputsHashBuf?s.outputsHashBuf:s.outputsHashBuf=this.hashOutputs():(e&31)===ce.SIGHASH_SINGLE&&t<this.txOuts.length&&(c=ae.sha256Sha256(this.txOuts[t].toBuffer()));const h=new ke;return h.writeUInt32LE(this.versionBytesNum),h.write(f),h.write(n),h.write(this.txIns[t].txHashBuf),h.writeUInt32LE(this.txIns[t].txOutNum),h.writeVarIntNum(i.toBuffer().length),h.write(i.toBuffer()),h.writeUInt64LEBn(u),h.writeUInt32LE(this.txIns[t].nSequence),h.write(c),h.writeUInt32LE(this.nLockTime),h.writeUInt32LE(e>>>0),h.toBuffer()}const a=this.cloneByBuffer();i=new Ee().fromBuffer(i.toBuffer()),i.removeCodeseparators();for(let f=0;f<a.txIns.length;f++)a.txIns[f]=He.fromBuffer(a.txIns[f].toBuffer()).setScript(new Ee);if(a.txIns[t]=He.fromBuffer(a.txIns[t].toBuffer()).setScript(i),(e&31)===ce.SIGHASH_NONE){a.txOuts.length=0,a.txOutsVi=De.fromNumber(0);for(let f=0;f<a.txIns.length;f++)f!==t&&(a.txIns[f].nSequence=0)}else if((e&31)===ce.SIGHASH_SINGLE){if(t>a.txOuts.length-1)return Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex");a.txOuts.length=t+1,a.txOutsVi=De.fromNumber(t+1);for(let f=0;f<a.txOuts.length;f++)f<t&&(a.txOuts[f]=yt.fromProperties(new Z().fromBuffer(Buffer.from("ffffffffffffffff","hex")),new Ee));for(let f=0;f<a.txIns.length;f++)f!==t&&(a.txIns[f].nSequence=0)}return e&ce.SIGHASH_ANYONECANPAY&&(a.txIns[0]=a.txIns[t],a.txIns.length=1,a.txInsVi=De.fromNumber(1)),new ke().write(a.toBuffer()).writeUInt32LE(e>>>0).toBuffer()}async asyncSighashPreimage(e,t,i,u,r=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,s={}){return(await le.asyncObjectMethod(this,"sighashPreimage",[e,t,i,u,r,s])).resbuf}sign(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r,s=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,a={}){const o=this.sighash(t,i,u,r,s,a);return this.preImageBuf=o,ht.sign(o,e,"little").fromObject({nHashType:t})}async asyncSign(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r,s=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,a={}){const o=await le.asyncObjectMethod(this,"sign",[e,t,i,u,r,s,a]);return new ce().fromFastBuffer(o.resbuf)}verify(e,t,i,u,r=!1,s,a=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,o={}){const f=this.sighash(e.nHashType,i,u,s,a,o);return ht.verify(f,e,t,"little",r)}async asyncVerify(e,t,i,u,r=!1,s,a=Ne.SCRIPT_ENABLE_SIGHASH_FORKID,o={}){const f=await le.asyncObjectMethod(this,"verify",[e,t,i,u,r,s,a,o]);return JSON.parse(f.resbuf.toString())}hash(){return ae.sha256Sha256(this.toBuffer())}async asyncHash(){return(await le.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new st(this.hash()).readReverse().toString("hex")}async asyncId(){const e=await le.asyncObjectMethod(this,"id",[]);return JSON.parse(e.resbuf.toString())}addTxIn(e,t,i,u){let r;return e instanceof He?r=e:r=new He().fromObject({txHashBuf:e,txOutNum:t,nSequence:u}).setScript(i),this.txIns.push(r),this.txInsVi=De.fromNumber(this.txInsVi.toNumber()+1),this}addTxOut(e,t){let i;return e instanceof yt?i=e:i=new yt().fromObject({valueBn:e}).setScript(t),this.txOuts.push(i),this.txOutsVi=De.fromNumber(this.txOutsVi.toNumber()+1),this}isCoinbase(){return this.txIns.length===1&&this.txIns[0].hasNullInput()}sort(){return this.txIns.sort((e,t)=>new st(e.txHashBuf).readReverse().compare(new st(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}}Ne.MAX_MONEY=21e6*1e8;Ne.SCRIPT_ENABLE_SIGHASH_FORKID=65536;class Qr extends Ce{constructor(e,t,i){super({blockHeader:e,txsVi:t,txs:i})}fromJSON(e){const t=[];return e.txs.forEach(function(i){t.push(new Ne().fromJSON(i))}),this.fromObject({blockHeader:new ir().fromJSON(e.blockHeader),txsVi:new De().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 ir().fromBr(e),this.txsVi=new De(e.readVarIntBuf());const t=this.txsVi.toNumber();this.txs=[];for(let i=0;i<t;i++)this.txs.push(new Ne().fromBr(e));return this}toBw(e){e||(e=new ke),e.write(this.blockHeader.toBuffer()),e.write(this.txsVi.buf);const t=this.txsVi.toNumber();for(let i=0;i<t;i++)this.txs[i].toBw(e);return e}hash(){return ae.sha256Sha256(this.blockHeader.toBuffer())}async asyncHash(){return(await le.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new st(this.hash()).readReverse().toString("hex")}async asyncId(){const e=await le.asyncObjectMethod(this,"id",[]);return JSON.parse(e.resbuf.toString())}verifyMerkleRoot(){const e=this.txs.map(i=>i.toBuffer()),t=Dt.fromBuffers(e).hash();return Buffer.compare(t,this.blockHeader.merkleRootBuf)}static iterateTxs(e){const t=new st(e),i=new ir().fromBr(t),u=new De(t.readVarIntBuf()),r=u.toNumber();return{blockHeader:i,txsVi:u,txsNum:r,*[Symbol.iterator](){for(let s=0;s<r;s++)yield new Ne().fromBr(t)}}}}Qr.MAX_BLOCK_SIZE=1e6;class Dd extends Qr{constructor(e,t,i){super(e,t,i)}async mine(e,t=0,i=null){return new Promise(u=>{const r=Date.now(),s=e.toString("hex");let a=0;const o=this.blockHeader.toBuffer(),f=()=>{for(;;){if(t&&a>=t)return u(!1);a++;let n=o.readUInt32LE(76)+1;o.writeUInt32LE(n,76),a%1e5===0&&o.writeUInt32LE(Math.floor(Date.now()/1e3),68);const c=ae.sha256Sha256(o);if(c.toString("hex")<s)return this.blockHeader.fromBuffer(o),i?.({success:!0,nonce:n,iterations:a,hashrate:a/((Date.now()-r)/1e3),hash:c.toString("hex")}),u(!0);if(i&&a%5e5===0&&i({success:!1,iterations:a,hashrate:a/((Date.now()-r)/1e3)}),a%1e6===0)return setImmediate(f)}};f()})}mineSync(e,t=0){const i=e.toString("hex");let u=0;const r=this.blockHeader.toBuffer();for(;!t||u<t;){u++;let s=r.readUInt32LE(76)+1;r.writeUInt32LE(s,76);const a=ae.sha256Sha256(r);if(a.toString("hex")<i)return this.blockHeader.fromBuffer(r),{success:!0,nonce:s,iterations:u,hashrate:u/10,hash:a.toString("hex")}}return{success:!1,iterations:u,hashrate:u/10}}verifyProofOfWork(e){return this.hash().toString("hex")<e.toString("hex")}hash(){return ae.sha256Sha256(this.blockHeader.toBuffer())}id(){return new st(this.hash()).readReverse().toString("hex")}}class J1{static createBlock(e,t,i){const u=new ir({version:536870912,prevBlockHashBuf:t,merkleRootBuf:this.calcMerkleRoot(e),time:Math.floor(Date.now()/1e3),bits:i,nonce:0}),r=[this.createCoinbaseTx(),...e],s=new De().fromNumber(r.length);return new Dd(u,s,r)}static calcMerkleRoot(e){return Dt.fromBuffers(e.map(t=>t.hash())).hash()}static createCoinbaseTx(){return new Ne}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 X1=[q.OP_CAT,q.OP_SUBSTR,q.OP_LEFT,q.OP_RIGHT,q.OP_INVERT,q.OP_AND,q.OP_OR,q.OP_XOR,q.OP_2MUL,q.OP_2DIV,q.OP_MUL,q.OP_DIV,q.OP_MOD,q.OP_LSHIFT,q.OP_RSHIFT];function Xf(d){return d.length===0||(d[d.length-1]&127)!==0?d:d.length===1?[]:(d[d.length-2]&128)===0?Xf(d.slice(0,d.length-1)):d}class re extends Ce{constructor(e,t,i,u=[],r=[],s=0,a=0,o=0,f=[],n="",c=re.defaultFlags,h=new Z(0)){super({script:e,tx:t,nIn:i,stack:u,altStack:r,pc:s,pBeginCodeHash:a,nOpCount:o,ifStack:f,errStr:n,flags:c,valueBn:h})}initialize(){return this.script=new Ee,this.stack=[],this.altStack=[],this.pc=0,this.pBeginCodeHash=0,this.nOpCount=0,this.ifStack=[],this.elseStack=[],this.errStr="",this.flags=re.defaultFlags,this.setLimits(),this}setLimits(){return this.scriptLimit=this.isPreGenesis()?re.PREGENESIS_SCRIPT_LIMIT:1e7,this.stackLimit=this.isPreGenesis()?re.PREGENESIS_STACK_LIMIT:1e7,this}isPreGenesis(){return(this.flags&re.SCRIPT_VERIFY_PREGENESIS_LIMITS)!==0}isChronicle(){return(this.flags&re.SCRIPT_VERIFY_CHRONICLE)!==0||this.tx!==void 0&&this.tx.versionBytesNum>1}scriptNumMaxSize(){return this.isPreGenesis()?re.PREGENESIS_SCRIPT_NUM_LENGTH:this.isChronicle()?re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_CHRONICLE:re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS}maxScriptElementSize(){return this.isPreGenesis()?re.PREGENESIS_MAX_SCRIPT_ELEMENT_SIZE:re.MAX_SCRIPT_ELEMENT_SIZE}versionBuf(){const e=Buffer.alloc(4);return e.writeUInt32LE(this.tx?this.tx.versionBytesNum:0,0),e}buildSubScript(){let e=this.script.chunks.slice(this.pBeginCodeHash);return this.isUnlockingScript&&this.isChronicle()&&this.lockingScript&&(e=e.concat(this.lockingScript.chunks)),new Ee().fromObject({chunks:e})}stepChronicleOp(e,t){const i=e===q.OP_SUBSTR_CHRONICLE;if(this.stack.length<(i?3:2))return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let u,r=0,s,a;try{const c=this.stack[this.stack.length-1],h=new Z().fromScriptNumBuffer(c,t,this.scriptNumMaxSize());if(i||e===q.OP_LEFT_CHRONICLE||e===q.OP_RIGHT_CHRONICLE?u=h.toNumber():s=h.toNumber(),i){const l=this.stack[this.stack.length-2];r=new Z().fromScriptNumBuffer(l,t,this.scriptNumMaxSize()).toNumber()}else if(!i){const l=this.stack[this.stack.length-2];a=new Z().fromScriptNumBuffer(l,t,this.scriptNumMaxSize())}}catch(c){return this.errStr=c.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(i||e===q.OP_LEFT_CHRONICLE||e===q.OP_RIGHT_CHRONICLE){const c=this.stack.length-(i?3:2),h=this.stack[c],l=h.length;if(u<0||u>l||i&&(r<0||r>=l||u>l-r))return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;const b=i?r:e===q.OP_LEFT_CHRONICLE?0:l-u;return this.stack[c]=h.slice(b,b+u),this.stack.pop(),i&&this.stack.pop(),!0}if(s<0)return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;const o=a.negative,f=a.abs();let n;return e===q.OP_LSHIFTNUM?n=f.ushln(s):n=f.ushrn(s),o&&(n=n.ineg()),n.toBuffer().length>this.scriptNumMaxSize()?(this.errStr="SCRIPTNUM_OVERFLOW",!1):(this.stack.pop(),this.stack.pop(),this.stack.push(n.toScriptNumBuffer()),!0)}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&(re.SCRIPT_VERIFY_DERSIG|re.SCRIPT_VERIFY_LOW_S|re.SCRIPT_VERIFY_STRICTENC))!==0&&!ce.IsTxDer(e))return this.errStr="SCRIPT_ERR_SIG_DER",!1;if((this.flags&re.SCRIPT_VERIFY_LOW_S)!==0&&!this.isChronicle()&&!new ce().fromTxFormat(e).hasLowS())return this.errStr="SCRIPT_ERR_SIG_HIGH_S",!1;if((this.flags&re.SCRIPT_VERIFY_STRICTENC)!==0){const t=new ce().fromTxFormat(e);if(!t.hasDefinedHashType())return this.errStr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nHashType&ce.SIGHASH_FORKID)return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(t.isChronicle()&&!this.isChronicle())return this.errStr="SCRIPT_ERR_ILLEGAL_CHRONICLE",!1;if(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nHashType&ce.SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0}checkPubKeyEncoding(e){return(this.flags&re.SCRIPT_VERIFY_STRICTENC)!==0&&!Ue.isCompressedOrUncompressed(e)?(this.errStr="SCRIPT_ERR_PUBKEYTYPE",!1):!0}checkLockTime(e){return!(!(this.tx.nLockTime<re.LOCKTIME_THRESHOLD&&e<re.LOCKTIME_THRESHOLD||this.tx.nLockTime>=re.LOCKTIME_THRESHOLD&&e>=re.LOCKTIME_THRESHOLD)||e>this.tx.nLockTime||this.tx.txIns[this.nIn].nSequence===4294967295)}checkSequence(e){if(this.tx.versionBytesNum<2||(this.tx.txIns[this.nIn].nSequence&He.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)return!1;const t=He.SEQUENCE_LOCKTIME_TYPE_FLAG|He.SEQUENCE_LOCKTIME_MASK,i=this.tx.txIns[this.nIn].nSequence&t,u=e&t;return!(!(i<He.SEQUENCE_LOCKTIME_TYPE_FLAG&&u<He.SEQUENCE_LOCKTIME_TYPE_FLAG||i>=He.SEQUENCE_LOCKTIME_TYPE_FLAG&&u>=He.SEQUENCE_LOCKTIME_TYPE_FLAG)||u>i)}*step(){const e=(this.flags&re.SCRIPT_VERIFY_MINIMALDATA)!==0&&!this.isChronicle();if(this.pc>=this.script.chunks.length)return!0;const t=this.script.chunks[this.pc];this.pc++;const i=t.opCodeNum,u=this.ifStack.indexOf(!1)===-1;if(t.buf&&t.buf.length>this.maxScriptElementSize())return this.errStr="SCRIPT_ERR_PUSH_SIZE",!1;if(i>q.OP_16&&++this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;if((i===q.OP_2MUL||i===q.OP_2DIV)&&!this.isChronicle())return this.errStr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(u&&i>=0&&i<=q.OP_PUSHDATA4){if(e&&!this.script.checkMinimalPush(this.pc-1))return this.errStr="SCRIPT_ERR_MINIMALDATA",!1;if(!t.buf)this.stack.push(re.false);else{if(t.len!==t.buf.length)throw new Error("length of push value not equal to length of data");this.stack.push(t.buf)}}else if(u||q.OP_IF<=i&&i<=q.OP_ENDIF)switch(i){case q.OP_1NEGATE:case q.OP_1:case q.OP_2:case q.OP_3:case q.OP_4:case q.OP_5:case q.OP_6:case q.OP_7:case q.OP_8:case q.OP_9:case q.OP_10:case q.OP_11:case q.OP_12:case q.OP_13:case q.OP_14:case q.OP_15:case q.OP_16:{let r=i-(q.OP_1-1),s=new Z(r).toScriptNumBuffer();this.stack.push(s)}break;case q.OP_NOP:break;case q.OP_CHECKLOCKTIMEVERIFY:{if(!(this.flags&re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&re.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 r;try{const s=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(s,e,5).toNumber()}catch(s){return this.errStr=(s.message.includes("minimal"),"SCRIPT_ERR_UNKNOWN_ERROR"),s.message.includes("overflow")&&(this.errStr="SCRIPTNUM_OVERFLOW"),s.message.includes("minimal")&&(this.errStr="SCRIPT_ERR_MINIMALDATA"),!1}if(r<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(r))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case q.OP_CHECKSEQUENCEVERIFY:{if(!(this.flags&re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&re.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 r;try{const s=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(s,e,5).toNumber()}catch{return this.errStr="SCRIPTNUM_OVERFLOW",!1}if(r<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((r&He.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(r))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case q.OP_NOP1:case q.OP_NOP3:case q.OP_NOP4:case q.OP_NOP5:case q.OP_NOP6:case q.OP_NOP7:case q.OP_NOP8:case q.OP_NOP9:case q.OP_NOP10:if(this.isChronicle()&&(i===q.OP_SUBSTR_CHRONICLE||i===q.OP_LEFT_CHRONICLE||i===q.OP_RIGHT_CHRONICLE||i===q.OP_LSHIFTNUM||i===q.OP_RSHIFTNUM))return this.stepChronicleOp(i,e);if(this.flags&re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case q.OP_IF:case q.OP_NOTIF:case q.OP_VERIF:case q.OP_VERNOTIF:{if((i===q.OP_VERIF||i===q.OP_VERNOTIF)&&u&&!this.isChronicle())return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;let r=!1;if(u){if(this.stack.length<1)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;const s=this.stack.pop();if((i===q.OP_IF||i===q.OP_NOTIF)&&(this.flags&re.SCRIPT_VERIFY_MINIMALIF)!==0&&!this.isChronicle()&&(s.length>1||s.length===1&&s[0]!==1))return this.errStr="SCRIPT_ERR_MINIMALIF",!1;i===q.OP_VERIF||i===q.OP_VERNOTIF?r=s.length===4&&s.equals(this.versionBuf()):r=re.castToBool(s),(i===q.OP_NOTIF||i===q.OP_VERNOTIF)&&(r=!r)}this.ifStack.push(r),this.elseStack.push(!1)}break;case q.OP_ELSE:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(this.elseStack[this.elseStack.length-1]&&this.isChronicle())return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.elseStack[this.elseStack.length-1]=!0,this.ifStack[this.ifStack.length-1]=!this.ifStack[this.ifStack.length-1];break;case q.OP_ENDIF:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.ifStack.pop(),this.elseStack.pop();break;case q.OP_VER:{if(!this.isChronicle())return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;this.stack.push(this.versionBuf())}break;case q.OP_VERIFY:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];if(re.castToBool(r))this.stack.pop();else return this.errStr="SCRIPT_ERR_VERIFY",!1}break;case q.OP_RETURN:return this.isUnlockingScript&&this.isChronicle()?(this.pc=this.script.chunks.length,this.ifStack=[],!0):(this.errStr="SCRIPT_ERR_OP_RETURN",!1);case q.OP_TOALTSTACK:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altStack.push(this.stack.pop());break;case q.OP_FROMALTSTACK:if(this.altStack.length<1)return this.errStr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altStack.pop());break;case q.OP_2DROP:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case q.OP_2DUP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];this.stack.push(r),this.stack.push(s)}break;case q.OP_3DUP:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-3],s=this.stack[this.stack.length-2],a=this.stack[this.stack.length-1];this.stack.push(r),this.stack.push(s),this.stack.push(a)}break;case q.OP_2OVER:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-4],s=this.stack[this.stack.length-3];this.stack.push(r),this.stack.push(s)}break;case q.OP_2ROT:{if(this.stack.length<6)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack.splice(this.stack.length-6,2);this.stack.push(r[0]),this.stack.push(r[1])}break;case q.OP_2SWAP:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack.splice(this.stack.length-4,2);this.stack.push(r[0]),this.stack.push(r[1])}break;case q.OP_IFDUP:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];re.castToBool(r)&&this.stack.push(r)}break;case q.OP_DEPTH:{const r=new Z(this.stack.length).toScriptNumBuffer();this.stack.push(r)}break;case q.OP_DROP:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case q.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 q.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 q.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 q.OP_PICK:case q.OP_ROLL:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let r;try{const a=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(a,e,this.scriptNumMaxSize()).toNumber()}catch(a){return this.errStr=a.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(this.stack.pop(),r<0||r>=this.stack.length)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const s=this.stack[this.stack.length-r-1];i===q.OP_ROLL&&this.stack.splice(this.stack.length-r-1,1),this.stack.push(s)}break;case q.OP_ROT:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-3],s=this.stack[this.stack.length-2],a=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=s,this.stack[this.stack.length-2]=a,this.stack[this.stack.length-1]=r}break;case q.OP_SWAP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=s,this.stack[this.stack.length-1]=r}break;case q.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 q.OP_SIZE:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=new Z(this.stack[this.stack.length-1].length);this.stack.push(r.toScriptNumBuffer())}break;case q.OP_AND:case q.OP_OR:case q.OP_XOR:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];if(r.length!==s.length)return this.errStr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(i){case q.OP_AND:for(let a=0;a<r.length;a++)r[a]&=s[a];break;case q.OP_OR:for(let a=0;a<r.length;a++)r[a]|=s[a];break;case q.OP_XOR:for(let a=0;a<r.length;a++)r[a]^=s[a];break}this.stack.pop()}break;case q.OP_INVERT:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];for(let s=0;s<r.length;s++)r[s]=~r[s]}break;case q.OP_LSHIFT:case q.OP_RSHIFT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2];let s=new Z(r),a;try{const f=this.stack[this.stack.length-1];a=new Z().fromScriptNumBuffer(f,e,this.scriptNumMaxSize()).toNumber()}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(a<0)return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;if(this.stack.pop(),this.stack.pop(),a>=r.length*8){this.stack.push(Buffer.alloc(r.length));break}switch(i){case q.OP_LSHIFT:s=s.shln(a);break;case q.OP_RSHIFT:s=s.shrn(a);break}let o=s.toBuffer({endian:"big"});o.length>r.length?o=o.slice(o.length-r.length):o.length<r.length&&(o=Buffer.concat([Buffer.alloc(r.length-o.length),o])),this.stack.push(o)}break;case q.OP_EQUAL:case q.OP_EQUALVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1],a=kt(r,s);if(this.stack.pop(),this.stack.pop(),this.stack.push(a?re.true:re.false),i===q.OP_EQUALVERIFY)if(a)this.stack.pop();else return this.errStr="SCRIPT_ERR_EQUALVERIFY",!1}break;case q.OP_1ADD:case q.OP_1SUB:case q.OP_2MUL:case q.OP_2DIV:case q.OP_NEGATE:case q.OP_ABS:case q.OP_NOT:case q.OP_0NOTEQUAL:{if((i===q.OP_2MUL||i===q.OP_2DIV)&&!this.isChronicle())return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];let s;try{s=new Z().fromScriptNumBuffer(r,e,this.scriptNumMaxSize())}catch(a){return this.errStr=a.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}switch(i){case q.OP_1ADD:s=s.add(1);break;case q.OP_1SUB:s=s.sub(1);break;case q.OP_2MUL:s=s.add(s);break;case q.OP_2DIV:s=s.div(new Z(2));break;case q.OP_NEGATE:s=s.neg();break;case q.OP_ABS:s.lt(0)&&(s=s.neg());break;case q.OP_NOT:s=new Z(s.eq(0)?1:0);break;case q.OP_0NOTEQUAL:s=new Z(s.neq(0)?1:0);break}this.stack.pop(),this.stack.push(s.toScriptNumBuffer())}break;case q.OP_ADD:case q.OP_SUB:case q.OP_MUL:case q.OP_DIV:case q.OP_MOD:case q.OP_BOOLAND:case q.OP_BOOLOR:case q.OP_NUMEQUAL:case q.OP_NUMEQUALVERIFY:case q.OP_NUMNOTEQUAL:case q.OP_LESSTHAN:case q.OP_GREATERTHAN:case q.OP_LESSTHANOREQUAL:case q.OP_GREATERTHANOREQUAL:case q.OP_MIN:case q.OP_MAX:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let r,s;try{r=new Z().fromScriptNumBuffer(this.stack[this.stack.length-2],e,this.scriptNumMaxSize()),s=new Z().fromScriptNumBuffer(this.stack[this.stack.length-1],e,this.scriptNumMaxSize())}catch(o){return this.errStr=o.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}let a=new Z(0);switch(i){case q.OP_ADD:a=r.add(s);break;case q.OP_SUB:a=r.sub(s);break;case q.OP_MUL:a=r.mul(s);break;case q.OP_DIV:if(s.eq(0))return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;a=r.div(s);break;case q.OP_MOD:if(s.eq(0))return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;a=r.mod(s);break;case q.OP_BOOLAND:a=new Z(r.neq(0)&&s.neq(0)?1:0);break;case q.OP_BOOLOR:a=new Z(r.neq(0)||s.neq(0)?1:0);break;case q.OP_NUMEQUAL:a=new Z(r.eq(s)?1:0);break;case q.OP_NUMEQUALVERIFY:a=new Z(r.eq(s)?1:0);break;case q.OP_NUMNOTEQUAL:a=new Z(r.neq(s)?1:0);break;case q.OP_LESSTHAN:a=new Z(r.lt(s)?1:0);break;case q.OP_GREATERTHAN:a=new Z(r.gt(s)?1:0);break;case q.OP_LESSTHANOREQUAL:a=new Z(r.leq(s)?1:0);break;case q.OP_GREATERTHANOREQUAL:a=new Z(r.geq(s)?1:0);break;case q.OP_MIN:a=r.lt(s)?r:s;break;case q.OP_MAX:a=r.gt(s)?r:s;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(a.toScriptNumBuffer()),i===q.OP_NUMEQUALVERIFY)if(re.castToBool(this.stack[this.stack.length-1]))this.stack.pop();else return this.errStr="SCRIPT_ERR_NUMEQUALVERIFY",!1}break;case q.OP_WITHIN:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let r,s,a;try{r=new Z().fromScriptNumBuffer(this.stack[this.stack.length-3],e,this.scriptNumMaxSize()),s=new Z().fromScriptNumBuffer(this.stack[this.stack.length-2],e,this.scriptNumMaxSize()),a=new Z().fromScriptNumBuffer(this.stack[this.stack.length-1],e,this.scriptNumMaxSize())}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}const o=s.leq(r)&&r.lt(a);this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(o?re.true:re.false)}break;case q.OP_RIPEMD160:case q.OP_SHA1:case q.OP_SHA256:case q.OP_HASH160:case q.OP_HASH256:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];let s;i===q.OP_RIPEMD160?s=ae.ripemd160(r):i===q.OP_SHA1?s=ae.sha1(r):i===q.OP_SHA256?s=ae.sha256(r):i===q.OP_HASH160?s=ae.sha256Ripemd160(r):i===q.OP_HASH256&&(s=ae.sha256Sha256(r)),this.stack.pop(),this.stack.push(s)}break;case q.OP_CODESEPARATOR:this.pBeginCodeHash=this.pc;break;case q.OP_CHECKSIG:case q.OP_CHECKSIGVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];if(!this.checkSigEncoding(r)||!this.checkPubKeyEncoding(s))return!1;const a=this.buildSubScript();if((r.length>0?r.readUInt8(r.length-1):0)&ce.SIGHASH_FORKID){if(!(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else a.findAndDelete(new Ee().writeBuffer(r));let f;try{const n=new ce().fromTxFormat(r),c=new Ue().fromBuffer(s,!1);f=this.tx.verify(n,c,this.nIn,a,!!(this.flags&re.SCRIPT_VERIFY_LOW_S)&&!this.isChronicle(),this.valueBn,this.flags)}catch{f=!1}if(!f&&(this.flags&re.SCRIPT_VERIFY_NULLFAIL)!==0&&!this.isChronicle()&&r.length>0)return this.errStr="SCRIPT_ERR_SIG_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(f?re.true:re.false),i===q.OP_CHECKSIGVERIFY)if(f)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKSIGVERIFY",!1}break;case q.OP_CHECKMULTISIG:case q.OP_CHECKMULTISIGVERIFY:{let r=1;if(this.stack.length<r)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let s;try{const l=this.stack[this.stack.length-r];s=new Z().fromScriptNumBuffer(l,e).toNumber()}catch(l){return this.errStr=l.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(s<0||s>20)return this.errStr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=s,this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;let a=++r;if(r+=s,this.stack.length<r)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let o;try{const l=this.stack[this.stack.length-r];o=new Z().fromScriptNumBuffer(l,e).toNumber()}catch(l){return this.errStr=l.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(o<0||o>s)return this.errStr="SCRIPT_ERR_SIG_COUNT",!1;let f=++r;if(r+=o,this.stack.length<r)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const n=this.buildSubScript();for(let l=0;l<o;l++){const b=this.stack[this.stack.length-f-l];if((b.length>0?b.readUInt8(b.length-1):0)&ce.SIGHASH_FORKID){if(!(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else n.findAndDelete(new Ee().writeBuffer(b))}const c=o;let h=!0;for(;h&&o>0;){const l=this.stack[this.stack.length-f],b=this.stack[this.stack.length-a];if(!this.checkSigEncoding(l)||!this.checkPubKeyEncoding(b))return!1;let p;try{const y=new ce().fromTxFormat(l),v=new Ue().fromBuffer(b,!1);p=this.tx.verify(y,v,this.nIn,n,!!(this.flags&re.SCRIPT_VERIFY_LOW_S)&&!this.isChronicle(),this.valueBn,this.flags)}catch{p=!1}p&&(f++,o--),a++,s--,o>s&&(h=!1)}if(!h&&(this.flags&re.SCRIPT_VERIFY_NULLFAIL)!==0&&!this.isChronicle()){for(let l=0;l<c;l++)if(this.stack[this.stack.length-f-l].length>0)return this.errStr="SCRIPT_ERR_SIG_NULLFAIL",!1}for(;r-- >1;)this.stack.pop();if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&re.SCRIPT_VERIFY_NULLDUMMY&&!this.isChronicle()&&this.stack[this.stack.length-1].length)return this.errStr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(h?re.true:re.false),i===q.OP_CHECKMULTISIGVERIFY)if(h)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1}break;case q.OP_CAT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=Buffer.concat([r,s]),this.stack.pop()}break;case q.OP_SPLIT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2];let s;try{const f=this.stack[this.stack.length-1];s=new Z().fromScriptNumBuffer(f,e).toNumber()}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(s<0||s>r.length)return this.errStr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;const a=r.slice(0,s),o=r.slice(s);this.stack.pop(),this.stack.pop(),this.stack.push(a),this.stack.push(o)}break;case q.OP_NUM2BIN:{if(this.stack.length<2)return this.errStr="OP_NUM2BIN requires at least two items to be on the stack.",!1;let r;try{const f=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(f,e,this.scriptNumMaxSize()).toNumber()}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(r>this.maxScriptElementSize())return this.errStr=`It's not currently possible to push data larger than ${re.MAX_SCRIPT_ELEMENT_SIZE} bytes.`,!1;this.stack.pop();let s=this.stack[this.stack.length-1];if(s=Xf(s),s.length>r)return 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.",!1;if(s.length===r)break;let a=0;s.length>0&&(a=s[s.length-1]&128,s[s.length-1]&=127);const o=Buffer.alloc(r);s.copy(o),r>0&&(o[r-1]|=a),this.stack[this.stack.length-1]=o}break;case q.OP_BIN2NUM:{if(this.stack.length<1)return this.errStr="OP_BIN2NUM requires at least one item to be on the stack.",!1;const r=this.stack[this.stack.length-1],s=Xf(r);try{this.stack[this.stack.length-1]=new Z().fromScriptNumBuffer(s,e,this.scriptNumMaxSize()).toScriptNumBuffer()}catch(a){return this.errStr=a.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}}break;default:return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}fromJSON(e){return this.fromJSONNoTx(e),this.tx=e.tx?new Ne().fromJSON(e.tx):void 0,this}fromJSONNoTx(e){return this.fromObject({script:e.script!==void 0?new Ee().fromJSON(e.script):void 0,nIn:e.nIn}),this.stack=[],e.stack.forEach((function(t){this.stack.push(Buffer.from(t,"hex"))}).bind(this)),this.altStack=[],e.altStack.forEach((function(t){this.altStack.push(Buffer.from(t,"hex"))}).bind(this)),this.fromObject({pc:e.pc,pBeginCodeHash:e.pBeginCodeHash,nOpCount:e.nOpCount,ifStack:e.ifStack,elseStack:[],errStr:e.errStr,flags:e.flags}),this}fromBr(e){let t=e.readVarIntNum(),i=e.read(t);this.fromJSONNoTx(JSON.parse(i.toString()));let u=e.readVarIntNum();if(u>0){let r=e.read(u);this.tx=new Ne().fromFastBuffer(r)}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(i){e.push(i.toString("hex"))});let t=[];return this.altStack.forEach(function(i){t.push(i.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?.preImage?this.preImage.toString("hex"):"",hashBuf:this?.hashBuf?this.hashBuf.toString("hex"):""}}toBw(e){e||(e=new ke);let t=Buffer.from(JSON.stringify(this.toJSONNoTx()));if(e.writeVarIntNum(t.length),e.write(t),this.tx){let i=this.tx.toFastBuffer();e.writeVarIntNum(i.length),e.write(i)}else e.writeVarIntNum(0);return e}static getFlags(e){let t=0;return e.indexOf("NONE")!==-1&&(t=t|re.SCRIPT_VERIFY_NONE),e.indexOf("P2SH")!==-1&&(t=t|re.SCRIPT_VERIFY_P2SH),e.indexOf("STRICTENC")!==-1&&(t=t|re.SCRIPT_VERIFY_STRICTENC),e.indexOf("DERSIG")!==-1&&(t=t|re.SCRIPT_VERIFY_DERSIG),e.indexOf("LOW_S")!==-1&&(t=t|re.SCRIPT_VERIFY_LOW_S),e.indexOf("NULLDUMMY")!==-1&&(t=t|re.SCRIPT_VERIFY_NULLDUMMY),e.indexOf("SIGPUSHONLY")!==-1&&(t=t|re.SCRIPT_VERIFY_SIGPUSHONLY),e.indexOf("MINIMALDATA")!==-1&&(t=t|re.SCRIPT_VERIFY_MINIMALDATA),e.indexOf("DISCOURAGE_UPGRADABLE_NOPS")!==-1&&(t=t|re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS),e.indexOf("CLEANSTACK")!==-1&&(t=t|re.SCRIPT_VERIFY_CLEANSTACK),e.indexOf("CHECKLOCKTIMEVERIFY")!==-1&&(t=t|re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY),e.indexOf("CHECKSEQUENCEVERIFY")!==-1&&(t=t|re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY),e.indexOf("SIGHASH_FORKID")!==-1&&(t=t|re.SCRIPT_ENABLE_SIGHASH_FORKID),e.indexOf("MINIMALIF")!==-1&&(t=t|re.SCRIPT_VERIFY_MINIMALIF),e.indexOf("NULLFAIL")!==-1&&(t=t|re.SCRIPT_VERIFY_NULLFAIL),e.indexOf("CHRONICLE")!==-1&&(t=t|re.SCRIPT_VERIFY_CHRONICLE),e.indexOf("PREGENESIS_LIMITS")!==-1&&(t=t|re.SCRIPT_VERIFY_PREGENESIS_LIMITS),t}*eval(){if(this.isPreGenesis())for(const e of this.script.chunks)X1.includes(e.opCodeNum)&&(this.errStr="SCRIPT_ERR_DISABLED_OPCODE",yield!1);this.script.toBuffer().length>this.scriptLimit&&(this.errStr="SCRIPT_ERR_SCRIPT_SIZE",yield!1);try{for(;this.pc<this.script.chunks.length;){const e=yield*this.step();if(e)yield e;else{yield!1;return}}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}verify(e,t,i,u,r,s){const a=this.results(e,t,i,u,r,s);for(const o of a)if(!o)return!1;return!0}*results(e,t,i,u,r,s){let a;this.initialize(),this.fromObject({script:e,tx:i,nIn:u,flags:r,valueBn:s}),this.setLimits(),this.isUnlockingScript=!0,this.lockingScript=t,(r&re.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!this.isChronicle()&&!e.isPushOnly()&&(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1),yield*this.eval(),r&re.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());const o=this.stack;this.initialize(),this.fromObject({script:t,stack:o,tx:i,nIn:u,flags:r,valueBn:s}),this.setLimits(),this.isUnlockingScript=!1,yield*this.eval(),this.stack.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1);const f=this.stack[this.stack.length-1];if(re.castToBool(f)||(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),r&re.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){e.isPushOnly()||(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1);const n=this.stack;if(this.stack=a,a=n,this.stack.length===0)throw new Error("internal error - stack copy empty");const c=this.stack[this.stack.length-1],h=new Ee().fromBuffer(c);this.stack.pop();const l=this.stack;this.initialize(),this.fromObject({script:h,stack:l,tx:i,nIn:u,flags:r,valueBn:s}),this.setLimits(),yield*this.eval(),this.stack.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),re.castToBool(this.stack[this.stack.length-1])?yield!0:(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1)}if((r&re.SCRIPT_VERIFY_CLEANSTACK)!==0&&!this.isChronicle()){if(!(r&re.SCRIPT_VERIFY_P2SH))throw new Error("cannot use CLEANSTACK without P2SH");this.stack.length!==1&&(this.errStr=this.errStr||"SCRIPT_ERR_CLEANSTACK",yield!1)}yield!0}getDebugObject(){const 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&&this.script.chunks&&this.script.chunks[e]?q.fromNumber(this.script.chunks[e].opCodeNum).toString():"no script or chunk found"}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}re.true=Buffer.from([1]);re.false=Buffer.from([]);re.MAX_SCRIPT_ELEMENT_SIZE=500*1e3;re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS=10*1e3;re.LOCKTIME_THRESHOLD=5e8;re.SCRIPT_VERIFY_NONE=0;re.SCRIPT_VERIFY_P2SH=1;re.SCRIPT_VERIFY_STRICTENC=2;re.SCRIPT_VERIFY_DERSIG=4;re.SCRIPT_VERIFY_LOW_S=8;re.SCRIPT_VERIFY_NULLDUMMY=16;re.SCRIPT_VERIFY_SIGPUSHONLY=32;re.SCRIPT_VERIFY_MINIMALDATA=64;re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;re.SCRIPT_VERIFY_CLEANSTACK=256;re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;re.SCRIPT_VERIFY_MINIMALIF=8192;re.SCRIPT_VERIFY_NULLFAIL=16384;re.SCRIPT_ENABLE_SIGHASH_FORKID=65536;re.SCRIPT_VERIFY_PREGENESIS_LIMITS=1<<17;re.PREGENESIS_SCRIPT_NUM_LENGTH=4;re.PREGENESIS_MAX_SCRIPT_ELEMENT_SIZE=520;re.PREGENESIS_SCRIPT_LIMIT=1e4;re.PREGENESIS_STACK_LIMIT=1e3;re.SCRIPT_VERIFY_CHRONICLE=1<<18;re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_CHRONICLE=32*1024*1024;re.defaultFlags=re.SCRIPT_VERIFY_P2SH|re.SCRIPT_VERIFY_STRICTENC|re.SCRIPT_ENABLE_SIGHASH_FORKID|re.SCRIPT_VERIFY_LOW_S|re.SCRIPT_VERIFY_NULLDUMMY|re.SCRIPT_VERIFY_DERSIG|re.SCRIPT_VERIFY_MINIMALDATA|re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS|re.SCRIPT_VERIFY_CLEANSTACK|re.SCRIPT_VERIFY_SIGPUSHONLY|re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;class Q1{lock(e){let t;if(typeof e=="string"?t=new gt().fromString(e).hashBuf:t=e,!Buffer.isBuffer(t)||t.length!==20)throw new Error("pubKeyHash must be a 20-byte buffer or an address");return new Ee().writeOpCode(q.OP_DUP).writeOpCode(q.OP_HASH160).writeBuffer(t).writeOpCode(q.OP_EQUALVERIFY).writeOpCode(q.OP_CHECKSIG)}unlock(e,t){const i=e instanceof ce?e.toTxFormat():e,u=Buffer.isBuffer(t)?t:t.toDer(!0);return new Ee().writeBuffer(i).writeBuffer(u)}estimateLength(){return 108}}class Z1{lock(e){if(!Buffer.isBuffer(e)||e.length!==20)throw new Error("rHash must be a 20-byte buffer");return new Ee().writeOpCode(q.OP_OVER).writeOpCode(q.OP_3).writeOpCode(q.OP_SPLIT).writeOpCode(q.OP_NIP).writeOpCode(q.OP_TRUE).writeOpCode(q.OP_SPLIT).writeOpCode(q.OP_SWAP).writeOpCode(q.OP_SPLIT).writeOpCode(q.OP_DROP).writeOpCode(q.OP_HASH160).writeBuffer(e).writeOpCode(q.OP_EQUALVERIFY).writeOpCode(q.OP_CHECKSIG)}unlock(e,t){const i=e instanceof ce?e.toTxFormat():e,u=Buffer.isBuffer(t)?t:t.toDer(!0);return new Ee().writeBuffer(i).writeBuffer(u)}static hashR(e){const t=e instanceof ce?e.toTxFormat():e,i=t[3];return ae.sha256Ripemd160(t.slice(4,4+i))}}class eb{lock(e,t){const i=e.map(s=>Buffer.isBuffer(s)?s:Buffer.from(s)),u=new Ee;for(const s of i)u.writeBuffer(s);if(i.length===3)u.writeOpCode(q.OP_DROP).writeOpCode(q.OP_2DROP);else for(let s=0;s<i.length;s++)u.writeOpCode(q.OP_DROP);const r=Buffer.isBuffer(t)?t:t.toDer(!0);return u.writeBuffer(r).writeOpCode(q.OP_CHECKSIG)}unlock(e){const t=e instanceof ce?e.toTxFormat():e;return new Ee().writeBuffer(t)}}class Qf extends Ce{constructor(e=new Map){super({map:e})}toJSON(){const e={};return this.map.forEach((t,i)=>{e[i]=t.map(u=>({nScriptChunk:u.nScriptChunk,type:u.type,addressStr:u.addressStr,nHashType:u.nHashType,log:u.log}))}),e}fromJSON(e){return Object.keys(e).forEach(t=>{this.map.set(t,e[t].map(i=>({nScriptChunk:i.nScriptChunk,type:i.type,addressStr:i.addressStr,nHashType:i.nHashType,log:i.log})))}),this}setOne(e,t,i,u="sig",r,s=ce.SIGHASH_ALL|ce.SIGHASH_FORKID){const a=e.toString("hex")+":"+t,o={nScriptChunk:i,type:u,addressStr:r,nHashType:s};return this.map.set(a,[o]),this}setMany(e,t,i){const u=e.toString("hex")+":"+t;return i=i.map(r=>({type:r.type||"sig",nHashType:r.nHashType||ce.SIGHASH_ALL|ce.SIGHASH_FORKID,...r})),this.map.set(u,i),this}addOne(e,t,i,u="sig",r,s=ce.SIGHASH_ALL|ce.SIGHASH_FORKID){const a=this.get(e,t)||[];return a.push({nScriptChunk:i,type:u,addressStr:r,nHashType:s}),this.setMany(e,t,a),this}get(e,t){const i=e.toString("hex")+":"+t;return this.map.get(i)||[]}}const ar=function(d){if(!Number.isSafeInteger(d)||d<0)throw new RangeError("VarInt value must be a non-negative safe integer.");return d<=252?1:d<=65535?3:d<=4294967295?5:9},Fd=function(d){return 36+ar(d)+d+4},qd=function(d){return ar(d)+d+8},Ud=function(d){let e=4+ar(d.txIns.length);for(const t of d.txIns)e+=Fd(t.script?t.script.toBuffer().length:0);e+=ar(d.txOuts.length);for(const t of d.txOuts)e+=qd(t.script?t.script.toBuffer().length:0);return e+4};class Hd{computeFee(e){throw new Error("not implemented")}}class tb extends Hd{constructor(e=50){super(),this.satoshisPerKb=e}computeFee(e){const t=Ud(e),i=new Z(this.satoshisPerKb).mul(new Z(t)).add(new Z(999)).div(new Z(1e3));return i.lt(1)?new Z(1):i}}class Zf extends Ce{constructor(e=new Map){super({map:e})}toJSON(){const e={};return this.map.forEach((t,i)=>{e[i]=t.toHex()}),e}fromJSON(e){return Object.keys(e).forEach(t=>{this.map.set(t,yt.fromHex(e[t]))}),this}set(e,t,i){const u=e.toString("hex")+":"+t;return this.map.set(u,i),this}get(e,t){const i=e.toString("hex")+":"+t;return this.map.get(i)}setTx(e){const t=e.hash().toString("hex");return e.txOuts.forEach((i,u)=>{const r=t+":"+u;this.map.set(r,i)}),this}}const $f=Oe.Default.TxBuilder;class rb extends Ce{constructor(e=new Ne,t=[],i=[],u=new Zf,r=new Qf,s,a,o,f=$f.feePerKbNum,n=0,c=1,h=1,l=$f.dust,b=!1,p=new Ur){super({tx:e,txIns:t,txOuts:i,uTxOutMap:u,sigOperations:r,changeScript:s,changeAmountBn:a,feeAmountBn:o,feePerKbNum:f,nLockTime:n,versionBytesNum:c,sigsPerInput:h,dust:l,dustChangeToFees:b,hashCache:p})}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 Ne().fromHex(e.tx),this.txIns=e.txIns.map(t=>He.fromHex(t)),this.txOuts=e.txOuts.map(t=>yt.fromHex(t)),this.uTxOutMap=new Zf().fromJSON(e.uTxOutMap),this.sigOperations=new Qf().fromJSON(e.sigOperations),this.changeScript=e.changeScript?new Ee().fromHex(e.changeScript):void 0,this.changeAmountBn=e.changeAmountBn?new Z(e.changeAmountBn):void 0,this.feeAmountBn=e.feeAmountBn?new Z(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=Ur.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=$f.dust){return this.dust=e,this}sendDustChangeToFees(e=!1){return this.dustChangeToFees=e,this}importPartiallySignedTx(e,t=this.uTxOutMap,i=this.sigOperations){return this.tx=e,this.uTxOutMap=t,this.sigOperations=i,this}inputFromScript(e,t,i,u,r){if(!Buffer.isBuffer(e)||typeof t!="number"||!(i instanceof yt)||!(u instanceof Ee))throw new Error("invalid one of: txHashBuf, txOutNum, txOut, script");return this.txIns.push(He.fromProperties(e,t,u,r)),this.uTxOutMap.set(e,t,i),this}addSigOperation(e,t,i,u,r,s){return this.sigOperations.addOne(e,t,i,u,r,s),this}inputFromPubKeyHash(e,t,i,u,r,s){if(!Buffer.isBuffer(e)||typeof t!="number"||!(i instanceof yt))throw new Error("invalid one of: txHashBuf, txOutNum, txOut");this.txIns.push(new He().fromObject({nSequence:r}).fromPubKeyHashTxOut(e,t,i,u)),this.uTxOutMap.set(e,t,i);const a=gt.fromTxOutScript(i.script).toString();return this.addSigOperation(e,t,0,"sig",a,s),this.addSigOperation(e,t,1,"pubKey",a),this}outputToAddress(e,t){if(!(t instanceof gt)||!(e instanceof Z))throw new Error("addr must be an Address, and valueBn must be a Bn");const i=new Ee().fromPubKeyHash(t.hashBuf);return this.outputToScript(e,i),this}outputToScript(e,t){if(!(t instanceof Ee)||!(e instanceof Z))throw new Error("script must be a Script, and valueBn must be a Bn");const i=yt.fromProperties(e,t);return this.txOuts.push(i),this}buildOutputs(){let e=new Z(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 i=new Z(0);for(const u of this.txIns){const r=this.uTxOutMap.get(u.txHashBuf,u.txOutNum);if(i=i.add(r.valueBn),this.tx.addTxIn(u),i.geq(e)){if(t<=0)break;t--}}if(i.lt(e))throw new Error("not enough funds for outputs: inAmountBn "+i.toNumber()+" outAmountBn "+e.toNumber());return i}estimateSize(){let i=this.tx.toBuffer().length;return this.tx.txIns.forEach(u=>{const{txHashBuf:r,txOutNum:s}=u;this.sigOperations.get(r,s).forEach(o=>{const{nScriptChunk:f,type:n}=o,h=new Ee([u.script.chunks[f]]).toBuffer().length;if(i-=h,n==="sig")i+=72;else if(o.type==="pubKey")i+=35;else throw new Error("unsupported sig operations type")})}),i=i+1,Math.round(i)}estimateFee(e=new Z(0)){const t=Math.ceil(this.estimateSize()/1e3*this.feePerKbNum);return new Z(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 i=e.useAllInputs?this.txIns.length-1:0;i<this.txIns.length;i++){this.tx=new Ne;const u=this.buildOutputs(),r=yt.fromProperties(new Z(0),this.changeScript);this.tx.addTxOut(r);let s;try{s=this.buildInputs(u,i)}catch(a){throw a.message.includes("not enough funds for outputs")?new Error("unable to gather enough inputs for outputs and fee"):a}if(this.changeAmountBn=s.sub(u),r.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=De.fromNumber(this.tx.txOutsVi.toNumber()-1),this.feeAmountBn=this.feeAmountBn.add(this.changeAmountBn),this.changeAmountBn=new Z(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 i=0;for(let u=1;u<t.chunks.length-1;u++)t.chunks[u].buf&&i++;return i===e}static removeBlankSigs(e){e=new Ee(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,i){const u=this.tx.txIns[e];return u.script.chunks[t]=new Ee().writeBuffer(i.toTxFormat()).chunks[0],u.scriptVi=De.fromNumber(u.script.toBuffer().length),this}getSig(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r=Ne.SCRIPT_ENABLE_SIGHASH_FORKID){let s;if(t&ce.SIGHASH_FORKID&&r&Ne.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[i].txHashBuf,o=this.tx.txIns[i].txOutNum,f=this.uTxOutMap.get(a,o);if(!f)throw new Error("for SIGHASH_FORKID must provide UTXOs");s=f.valueBn}return this.tx.sign(e,t,i,u,s,r,this.hashCache)}asyncGetSig(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r=Ne.SCRIPT_ENABLE_SIGHASH_FORKID){let s;if(t&ce.SIGHASH_FORKID&&r&Ne.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[i].txHashBuf,o=this.tx.txIns[i].txOutNum,f=this.uTxOutMap.get(a,o);if(!f)throw new Error("for SIGHASH_FORKID must provide UTXOs");s=f.valueBn}return this.tx.asyncSign(e,t,i,u,s,r,this.hashCache)}signTxIn(e,t,i,u,r=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,s=Ne.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[e],o=a.script;if(u===void 0&&o.isPubKeyHashIn()&&(u=0),u===void 0)throw new Error("cannot sign unknown script type for input "+e);const f=a.txHashBuf,n=a.txOutNum;i||(i=this.uTxOutMap.get(f,n));const h=i.script,l=this.getSig(t,r,e,h,s,this.hashCache);return this.fillSig(e,u,l),this}async asyncSignTxIn(e,t,i,u,r=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,s=Ne.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[e],o=a.script;if(u===void 0&&o.isPubKeyHashIn()&&(u=0),u===void 0)throw new Error("cannot sign unknown script type for input "+e);const f=a.txHashBuf,n=a.txOutNum;i||(i=this.uTxOutMap.get(f,n));const h=i.script,l=await this.asyncGetSig(t,r,e,h,s,this.hashCache);return this.fillSig(e,u,l),this}signWithKeyPairs(e){const t={};for(const i of e){const u=gt.fromPubKey(i.pubKey).toString();t[u]=i}for(const i in this.tx.txIns){const u=this.tx.txIns[i],r=this.sigOperations.get(u.txHashBuf,u.txOutNum);for(const s of r){const{nScriptChunk:a,type:o,addressStr:f,nHashType:n}=s,c=t[f];if(!c){s.log=`cannot find keyPair for addressStr ${f}`;continue}const h=this.uTxOutMap.get(u.txHashBuf,u.txOutNum);if(o==="sig")this.signTxIn(i,c,h,a,n),s.log="successfully inserted signature";else if(o==="pubKey")u.script.chunks[a]=new Ee().writeBuffer(c.pubKey.toBuffer()).chunks[0],u.setScript(u.script),s.log="successfully inserted public key";else{s.log=`cannot perform operation of type ${o}`;continue}}}return this}}class Hr extends Ce{constructor(e,t,i,u){super({tx:e,txOutMap:t,errStr:i,interp:u})}verify(e=re.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,i){return new Hr(e,t).verify(i)}static asyncVerify(e,t,i){return new Hr(e,t).asyncVerify(i)}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>Qr.MAX_BLOCK_SIZE)return this.errStr="transaction over the maximum block size",this.errStr;let e=new Z(0);for(let i=0;i<this.tx.txOuts.length;i++){const u=this.tx.txOuts[i];if(u.valueBn.lt(0))return this.errStr="transaction txOut "+i+" negative",this.errStr;if(u.valueBn.gt(Ne.MAX_MONEY))return this.errStr="transaction txOut "+i+" greater than MAX_MONEY",this.errStr;if(e=e.add(u.valueBn),e.gt(Ne.MAX_MONEY))return this.errStr="transaction txOut "+i+" total output greater than MAX_MONEY",this.errStr}const t={};for(let i=0;i<this.tx.txIns.length;i++){const u=this.tx.txIns[i],r=u.txHashBuf.toString("hex")+":"+u.txOutNum;if(t[r]!==void 0)return this.errStr="transaction input "+i+" duplicate input",this.errStr;t[r]=!0}if(this.tx.isCoinbase()){const i=this.tx.txIns[0].script.toBuffer();if(i.length<2||i.length>100)return this.errStr="coinbase trasaction script size invalid",this.errStr}else for(let i=0;i<this.tx.txIns.length;i++)if(this.tx.txIns[i].hasNullInput())return this.errStr="transaction input "+i+" 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 i=this.tx.txIns[e],u=i.script,r=this.txOutMap.get(i.txHashBuf,i.txOutNum);if(!r)return console.log("output "+i.txOutNum+" not found"),!1;const s=r.script,a=r.valueBn;return this.interp=new re,this.interp.verify(u,s,this.tx,e,t,a)}async asyncVerifyNIn(e,t){const i=this.tx.txIns[e],u=i.script,r=this.txOutMap.get(i.txHashBuf,i.txOutNum);if(!r)return console.log("output "+i.txOutNum+" not found"),!1;const s=r.script,a=r.valueBn;this.interp=new re;const o=await le.asyncObjectMethod(this.interp,"verify",[u,s,this.tx,e,t,a]);return JSON.parse(o.resbuf.toString())}getDebugObject(){return{errStr:this.errStr,interpFailure:this.interp?this.interp.getDebugObject():void 0}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}class je{}je.encrypt=function(d,e){const t=je.buf2Words(e),i=je.buf2Words(d),r=new is(t).encrypt(i);return je.words2Buf(r)};je.decrypt=function(d,e){const t=je.buf2Words(d),i=je.buf2Words(e),r=new is(i).decrypt(t);return je.words2Buf(r)};je.buf2Words=function(d){if(d.length%4)throw new Error("buf length must be a multiple of 4");const e=[];for(let t=0;t<d.length/4;t++)e.push(d.readUInt32BE(t*4));return e};je.words2Buf=function(d){const e=Buffer.alloc(d.length*4);for(let t=0;t<d.length;t++)e.writeUInt32BE(d[t],t*4);return e};class qe{}qe.buf2BlocksBuf=function(d,e){const t=e/8,i=[];for(let u=0;u<=d.length/t;u++){let r=d.slice(u*t,u*t+t);r.length<e&&(r=qe.pkcs7Pad(r,e)),i.push(r)}return i};qe.blockBufs2Buf=function(d){let e=d[d.length-1];return e=qe.pkcs7Unpad(e),d[d.length-1]=e,Buffer.concat(d)};qe.encrypt=function(d,e,t,i){const u=e.length*8,r=qe.buf2BlocksBuf(d,u),s=qe.encryptBlocks(r,e,t,i);return Buffer.concat(s)};qe.decrypt=function(d,e,t,i){const u=e.length,r=[];for(let o=0;o<d.length/u;o++)r.push(d.slice(o*u,o*u+u));const s=qe.decryptBlocks(r,e,t,i);return qe.blockBufs2Buf(s)};qe.encryptBlock=function(d,e,t,i){const u=qe.xorBufs(d,e);return t.encrypt(u,i)};qe.decryptBlock=function(d,e,t,i){const u=t.decrypt(d,i);return qe.xorBufs(u,e)};qe.encryptBlocks=function(d,e,t,i){const u=[];for(let r=0;r<d.length;r++){const s=d[r],a=qe.encryptBlock(s,e,t,i);u.push(a),e=a}return u};qe.decryptBlocks=function(d,e,t,i){const u=[];for(let r=0;r<d.length;r++){const s=d[r],a=qe.decryptBlock(s,e,t,i);u.push(a),e=s}return u};qe.pkcs7Pad=function(d,e){const i=e/8-d.length,u=Buffer.alloc(i);return u.fill(i),Buffer.concat([d,u])};qe.pkcs7Unpad=function(d){const e=d[d.length-1],t=d.slice(d.length-e,d.length),i=Buffer.alloc(e);if(i.fill(e),!kt(t,i))throw new Error("invalid padding");return d.slice(0,d.length-e)};qe.xorBufs=function(d,e){if(d.length!==e.length)throw new Error("bufs must have the same length");const t=Buffer.alloc(d.length);for(let i=0;i<d.length;i++)t[i]=d[i]^e[i];return t};class At{}At.encrypt=function(d,e,t,i=!0){t=t||Rt.getRandomBuffer(128/8);const u=qe.encrypt(d,t,je,e);return i?Buffer.concat([t,u]):u};At.decrypt=function(d,e,t=!1){if(t){const i=d;return qe.decrypt(i,t,je,e)}else{const i=d.slice(0,16),u=d.slice(128/8);return qe.decrypt(u,i,je,e)}};class Ft{}Ft.encrypt=function(d,e,t){const i=At.encrypt(d,e,t),u=ae.sha256Hmac(i,e);return Buffer.concat([u,i])};Ft.asyncEncrypt=async function(d,e,t){t||(t=Rt.getRandomBuffer(128/8));const i=[d,e,t];return(await le.asyncClassMethod(Ft,"encrypt",i)).resbuf};Ft.decrypt=function(d,e){if(d.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=d.slice(0,256/8);d=d.slice(256/8,d.length);const i=ae.sha256Hmac(d,e);if(!kt(t,i))throw new Error("Message authentication failed - Hmacs are not equivalent");return At.decrypt(d,e)};Ft.asyncDecrypt=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(Ft,"decrypt",t)).resbuf};const ib=function(d,e){const t=Buffer.alloc(16);for(let i=0;i<16;i++)t[i]=d[i]^e[i];return t},nb=function(d,e){const t=je.buf2Words(d),i=je.buf2Words(e),u=[0,0,0,0];for(let r=0;r<128;r++){if((t[Math.floor(r/32)]&2147483648>>>r%32)!==0)for(let a=0;a<4;a++)u[a]^=i[a];const s=i[3]&1;i[3]=i[3]>>>1|(i[2]&1)<<31,i[2]=i[2]>>>1|(i[1]&1)<<31,i[1]=i[1]>>>1|(i[0]&1)<<31,i[0]=i[0]>>>1,s&&(i[0]^=3774873600)}return je.words2Buf(u.map(function(r){return r>>>0}))},Kt=function(d){const e=(16-d.length%16)%16;return e?Buffer.concat([d,Buffer.alloc(e)]):Buffer.from(d)},es=function(d,e){let t=Buffer.alloc(16);const i=Kt(e);for(let u=0;u<i.length;u+=16)t=nb(ib(t,i.slice(u,u+16)),d);return t},ts=function(d,e,t){d.writeUInt32BE(Math.floor(e/4294967296),t),d.writeUInt32BE(e>>>0,t+4)},ab=function(d){const e=Buffer.alloc(16);return ts(e,d,8),e},Mh=function(d,e){const t=Buffer.alloc(16);return ts(t,d,0),ts(t,e,8),t},rs=function(d){const e=Buffer.from(d);let t=1;for(let i=15;i>=12&&t;i--){const u=e[i]+t;e[i]=u&255,t=u>>8}return e},Cr=function(d,e,t){const i=Buffer.alloc(t.length);let u=Buffer.from(e);for(let r=0;r<t.length;r+=16){const s=je.encrypt(u,d),a=Math.min(16,t.length-r);for(let o=0;o<a;o++)i[r+o]=t[r+o]^s[o];u=rs(u)}return i},Ch=function(d,e){if(e.length===12)return Buffer.concat([e,Buffer.from([0,0,0,1])]);const t=je.encrypt(Buffer.alloc(16),d),i=Buffer.concat([Kt(e),Buffer.alloc(8),ab(e.length*8).slice(8)]);return es(t,i)};class Kr{static encrypt(e,t,i,u=Buffer.alloc(0)){const r=je.encrypt(Buffer.alloc(16),e),s=Ch(e,t),a=Cr(e,rs(s),i),o=es(r,Buffer.concat([Kt(u),Kt(a),Mh(u.length*8,a.length*8)]));return{ciphertext:a,tag:Cr(e,s,o).slice(0,16)}}static decrypt(e,t,i,u,r=Buffer.alloc(0)){const s=je.encrypt(Buffer.alloc(16),e),a=Ch(e,t),o=es(s,Buffer.concat([Kt(r),Kt(i),Mh(r.length*8,i.length*8)])),f=Cr(e,a,o).slice(0,16);if(!Buffer.from(u).equals(Buffer.from(f)))throw new Error("AES-GCM authentication failed");return Cr(e,rs(a),i)}static encryptBrc2(e,t){const i=Buffer.alloc(32);for(let r=0;r<i.length;r+=4)i.writeUInt32LE(Math.random()*4294967296>>>0,r);const u=Kr.encrypt(e,i,t);return Buffer.concat([i,u.ciphertext,u.tag])}static decryptBrc2(e,t){if(t.length<48)throw new Error("AES-GCM ciphertext is too short");const i=t.slice(0,32),u=t.slice(t.length-16),r=t.slice(32,t.length-16);return Kr.decrypt(e,i,r,u)}}class _t{}_t.ivkEkM=function(d,e){const t=d.bn,u=e.point.mul(t),s=new Ue(u).toBuffer(),a=ae.sha512(s);return{iv:a.slice(0,16),kE:a.slice(16,32),kM:a.slice(32,64)}};_t.electrumEncrypt=function(d,e,t,i=!1){if(!Buffer.isBuffer(d))throw new Error("messageBuf must be a buffer");let u;t===null&&(t=ct.fromRandom()),i||(u=t.pubKey.toDer(!0));const{iv:r,kE:s,kM:a}=_t.ivkEkM(t.privKey,e),o=At.encrypt(d,s,r,!1),f=Buffer.from("BIE1");let n;u?n=Buffer.concat([f,u,o]):n=Buffer.concat([f,o]);const c=ae.sha256Hmac(n,a);return Buffer.concat([n,c])};_t.electrumDecrypt=function(d,e,t=null){if(!Buffer.isBuffer(d))throw new Error("encBuf must be a buffer");const i=32;if(!d.slice(0,4).equals(Buffer.from("BIE1")))throw new Error("Invalid Magic");let r=4;if(t===null){const h=d.slice(4,37);t=Ue.fromDer(h),r=37}const{iv:s,kE:a,kM:o}=_t.ivkEkM(e,t),f=d.slice(r,d.length-i),n=d.slice(d.length-i,d.length),c=ae.sha256Hmac(d.slice(0,d.length-i),o);if(!n.equals(c))throw new Error("Invalid checksum");return At.decrypt(f,a,s)};_t.bitcoreEncrypt=function(d,e,t,i){t||(t=ct.fromRandom());const u=t.privKey.bn,s=t.pubKey.toDer(!0),n=e.point.mul(u).getX().toBuffer({size:32}),c=ae.sha512(n),h=c.slice(0,32),l=c.slice(32,64),b=At.encrypt(d,h,i),p=ae.sha256Hmac(b,l);return Buffer.concat([s,b,p])};_t.asyncBitcoreEncrypt=async function(d,e,t,i){t||(t=await ct.asyncFromRandom()),i||(i=Rt.getRandomBuffer(128/8));const u=[d,e,t,i];return(await le.asyncClassMethod(_t,"bitcoreEncrypt",u)).resbuf};_t.bitcoreDecrypt=function(d,e){const t=e.bn,r=Ue.fromDer(d.slice(0,33)).point.mul(t);if(r.eq(new Ae))throw new Error("P equals 0");const a=r.getX().toBuffer({size:32}),o=ae.sha512(a),f=o.slice(0,32),n=o.slice(32,64),c=d.slice(33,d.length-32),h=d.slice(d.length-32,d.length),l=ae.sha256Hmac(c,n);if(!kt(h,l))throw new Error("Invalid checksum");return At.decrypt(c,f)};_t.asyncBitcoreDecrypt=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(_t,"bitcoreDecrypt",t)).resbuf};const fb={aes:is,bnjs:ut,bs58:Wf,elliptic:Td,hashjs:mr,pbkdf2:Ld,Buffer:M1.Buffer},sb=T1.version;exports.Ach=Ft;exports.Address=gt;exports.Aes=je;exports.AesGcm=Kr;exports.Aescbc=At;exports.Base58=Vt;exports.Base58Check=Bt;exports.Bip32=nr;exports.Bip39=qr;exports.Block=Qr;exports.BlockHeader=ir;exports.Bn=Z;exports.Br=st;exports.Bsm=mt;exports.Bw=ke;exports.Cbc=qe;exports.Constants=Oe;exports.Ecdsa=ht;exports.Ecies=_t;exports.FeeModel=Hd;exports.Hash=ae;exports.Interp=re;exports.KeyPair=ct;exports.MinableBlock=Dd;exports.MiningUtils=J1;exports.OpCode=q;exports.P2PKH=Q1;exports.Point=Ae;exports.PrivKey=wt;exports.PubKey=Ue;exports.PushDrop=eb;exports.RPuzzle=Z1;exports.Random=Rt;exports.Reader=$1;exports.SafeRecord=Lt;exports.SatoshisPerKilobyte=tb;exports.Script=Ee;exports.Sig=ce;exports.SigOperations=Qf;exports.Struct=Ce;exports.Tx=Ne;exports.TxBuilder=rb;exports.TxIn=He;exports.TxOut=yt;exports.TxOutMap=Zf;exports.TxVerifier=Hr;exports.VarInt=De;exports.Workers=le;exports.WorkersResult=Jf;exports.Writer=W1;exports.cmp=kt;exports.deps=fb;exports.en=Lr;exports.es=Fr;exports.getConstants=j1;exports.jp=Dr;exports.transactionInputSize=Fd;exports.transactionOutputSize=qd;exports.transactionSize=Ud;exports.varUintSize=ar;exports.version=sb;
8
+ https://github.com/browserify/crypto-browserify`)},xe.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},xe}var Rh;function yr(){if(Rh)return _r.exports;Rh=1;var d;_r.exports=function(u){return d||(d=new e(null)),d.generate(u)};function e(i){this.rand=i}if(_r.exports.Rand=e,e.prototype.generate=function(u){return this._rand(u)},e.prototype._rand=function(u){if(this.rand.getBytes)return this.rand.getBytes(u);for(var r=new Uint8Array(u),s=0;s<r.length;s++)r[s]=this.rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(u){var r=new Uint8Array(u);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(u){var r=new Uint8Array(u);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var t=A1();if(typeof t.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(u){return t.randomBytes(u)}}catch{}return _r.exports}var qf={},Hf,Ah;function Dd(){if(Ah)return Hf;Ah=1;var d=Te(),e=qt(),t=e.getNAF,i=e.getJSF,u=e.assert;function r(a,o){this.type=a,this.p=new d(o.p,16),this.red=o.prime?d.red(o.prime):d.mont(this.p),this.zero=new d(0).toRed(this.red),this.one=new d(1).toRed(this.red),this.two=new d(2).toRed(this.red),this.n=o.n&&new d(o.n,16),this.g=o.g&&this.pointFromJSON(o.g,o.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))}Hf=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(o,f){u(o.precomputed);var n=o._getDoubles(),c=t(f,1,this._bitLength),h=(1<<n.step+1)-(n.step%2===0?2:1);h/=3;for(var l=[],p=0;p<c.length;p+=n.step){for(var b=0,f=p+n.step-1;f>=p;f--)b=(b<<1)+c[f];l.push(b)}for(var y=this.jpoint(null,null,null),v=this.jpoint(null,null,null),g=h;g>0;g--){for(var p=0;p<l.length;p++){var b=l[p];b===g?v=v.mixedAdd(n.points[p]):b===-g&&(v=v.mixedAdd(n.points[p].neg()))}y=y.add(v)}return y.toP()},r.prototype._wnafMul=function(o,f){var n=4,c=o._getNAFPoints(n);n=c.wnd;for(var h=c.points,l=t(f,n,this._bitLength),p=this.jpoint(null,null,null),b=l.length-1;b>=0;b--){for(var f=0;b>=0&&l[b]===0;b--)f++;if(b>=0&&f++,p=p.dblp(f),b<0)break;var y=l[b];u(y!==0),o.type==="affine"?y>0?p=p.mixedAdd(h[y-1>>1]):p=p.mixedAdd(h[-y-1>>1].neg()):y>0?p=p.add(h[y-1>>1]):p=p.add(h[-y-1>>1].neg())}return o.type==="affine"?p.toP():p},r.prototype._wnafMulAdd=function(o,f,n,c,h){for(var l=this._wnafT1,p=this._wnafT2,b=this._wnafT3,y=0,v=0;v<c;v++){var g=f[v],x=g._getNAFPoints(o);l[v]=x.wnd,p[v]=x.points}for(var v=c-1;v>=1;v-=2){var B=v-1,R=v;if(l[B]!==1||l[R]!==1){b[B]=t(n[B],l[B],this._bitLength),b[R]=t(n[R],l[R],this._bitLength),y=Math.max(b[B].length,y),y=Math.max(b[R].length,y);continue}var T=[f[B],null,null,f[R]];f[B].y.cmp(f[R].y)===0?(T[1]=f[B].add(f[R]),T[2]=f[B].toJ().mixedAdd(f[R].neg())):f[B].y.cmp(f[R].y.redNeg())===0?(T[1]=f[B].toJ().mixedAdd(f[R]),T[2]=f[B].add(f[R].neg())):(T[1]=f[B].toJ().mixedAdd(f[R]),T[2]=f[B].toJ().mixedAdd(f[R].neg()));var j=[-3,-1,-5,-7,0,7,5,1,3],G=i(n[B],n[R]);y=Math.max(G[0].length,y),b[B]=new Array(y),b[R]=new Array(y);for(var z=0;z<y;z++){var te=G[0][z]|0,ne=G[1][z]|0;b[B][z]=j[(te+1)*3+(ne+1)],b[R][z]=0,p[B]=T}}for(var $=this.jpoint(null,null,null),N=this._wnafT4,v=y;v>=0;v--){for(var m=0;v>=0;){for(var E=!0,z=0;z<c;z++)N[z]=b[z][v]|0,N[z]!==0&&(E=!1);if(!E)break;m++,v--}if(v>=0&&m++,$=$.dblp(m),v<0)break;for(var z=0;z<c;z++){var O=N[z],g;O!==0&&(O>0?g=p[z][O-1>>1]:O<0&&(g=p[z][-O-1>>1].neg()),g.type==="affine"?$=$.mixedAdd(g):$=$.add(g))}}for(var v=0;v<c;v++)p[v]=null;return h?$:$.toP()};function s(a,o){this.curve=a,this.type=o,this.precomputed=null}return r.BasePoint=s,s.prototype.eq=function(){throw new Error("Not implemented")},s.prototype.validate=function(){return this.curve.validate(this)},r.prototype.decodePoint=function(o,f){o=e.toArray(o,f);var n=this.p.byteLength();if((o[0]===4||o[0]===6||o[0]===7)&&o.length-1===2*n){o[0]===6?u(o[o.length-1]%2===0):o[0]===7&&u(o[o.length-1]%2===1);var c=this.point(o.slice(1,1+n),o.slice(1+n,1+2*n));return c}else if((o[0]===2||o[0]===3)&&o.length-1===n)return this.pointFromX(o.slice(1,1+n),o[0]===3);throw new Error("Unknown point format")},s.prototype.encodeCompressed=function(o){return this.encode(o,!0)},s.prototype._encode=function(o){var f=this.curve.p.byteLength(),n=this.getX().toArray("be",f);return o?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",f))},s.prototype.encode=function(o,f){return e.encode(this._encode(f),o)},s.prototype.precompute=function(o){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,o),f.beta=this._getBeta(),this.precomputed=f,this},s.prototype._hasDoubles=function(o){if(!this.precomputed)return!1;var f=this.precomputed.doubles;return f?f.points.length>=Math.ceil((o.bitLength()+1)/f.step):!1},s.prototype._getDoubles=function(o,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],c=this,h=0;h<f;h+=o){for(var l=0;l<o;l++)c=c.dbl();n.push(c)}return{step:o,points:n}},s.prototype._getNAFPoints=function(o){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var f=[this],n=(1<<o)-1,c=n===1?null:this.dbl(),h=1;h<n;h++)f[h]=f[h-1].add(c);return{wnd:o,points:f}},s.prototype._getBeta=function(){return null},s.prototype.dblp=function(o){for(var f=this,n=0;n<o;n++)f=f.dbl();return f},Hf}var Kf,Oh;function O1(){if(Oh)return Kf;Oh=1;var d=qt(),e=Te(),t=be(),i=Dd(),u=d.assert;function r(o){i.call(this,"short",o),this.a=new e(o.a,16).toRed(this.red),this.b=new e(o.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(o),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}t(r,i),Kf=r,r.prototype._getEndomorphism=function(f){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var n,c;if(f.beta)n=new e(f.beta,16).toRed(this.red);else{var h=this._getEndoRoots(this.p);n=h[0].cmp(h[1])<0?h[0]:h[1],n=n.toRed(this.red)}if(f.lambda)c=new e(f.lambda,16);else{var l=this._getEndoRoots(this.n);this.g.mul(l[0]).x.cmp(this.g.x.redMul(n))===0?c=l[0]:(c=l[1],u(this.g.mul(c).x.cmp(this.g.x.redMul(n))===0))}var p;return f.basis?p=f.basis.map(function(b){return{a:new e(b.a,16),b:new e(b.b,16)}}):p=this._getEndoBasis(c),{beta:n,lambda:c,basis:p}}},r.prototype._getEndoRoots=function(f){var n=f===this.p?this.red:e.mont(f),c=new e(2).toRed(n).redInvm(),h=c.redNeg(),l=new e(3).toRed(n).redNeg().redSqrt().redMul(c),p=h.redAdd(l).fromRed(),b=h.redSub(l).fromRed();return[p,b]},r.prototype._getEndoBasis=function(f){for(var n=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=f,h=this.n.clone(),l=new e(1),p=new e(0),b=new e(0),y=new e(1),v,g,x,B,R,T,j,G=0,z,te;c.cmpn(0)!==0;){var ne=h.div(c);z=h.sub(ne.mul(c)),te=b.sub(ne.mul(l));var $=y.sub(ne.mul(p));if(!x&&z.cmp(n)<0)v=j.neg(),g=l,x=z.neg(),B=te;else if(x&&++G===2)break;j=z,h=c,c=z,b=l,l=te,y=p,p=$}R=z.neg(),T=te;var N=x.sqr().add(B.sqr()),m=R.sqr().add(T.sqr());return m.cmp(N)>=0&&(R=v,T=g),x.negative&&(x=x.neg(),B=B.neg()),R.negative&&(R=R.neg(),T=T.neg()),[{a:x,b:B},{a:R,b:T}]},r.prototype._endoSplit=function(f){var n=this.endo.basis,c=n[0],h=n[1],l=h.b.mul(f).divRound(this.n),p=c.b.neg().mul(f).divRound(this.n),b=l.mul(c.a),y=p.mul(h.a),v=l.mul(c.b),g=p.mul(h.b),x=f.sub(b).sub(y),B=v.add(g).neg();return{k1:x,k2:B}},r.prototype.pointFromX=function(f,n){f=new e(f,16),f.red||(f=f.toRed(this.red));var c=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),h=c.redSqrt();if(h.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var l=h.fromRed().isOdd();return(n&&!l||!n&&l)&&(h=h.redNeg()),this.point(f,h)},r.prototype.validate=function(f){if(f.inf)return!0;var n=f.x,c=f.y,h=this.a.redMul(n),l=n.redSqr().redMul(n).redIAdd(h).redIAdd(this.b);return c.redSqr().redISub(l).cmpn(0)===0},r.prototype._endoWnafMulAdd=function(f,n,c){for(var h=this._endoWnafT1,l=this._endoWnafT2,p=0;p<f.length;p++){var b=this._endoSplit(n[p]),y=f[p],v=y._getBeta();b.k1.negative&&(b.k1.ineg(),y=y.neg(!0)),b.k2.negative&&(b.k2.ineg(),v=v.neg(!0)),h[p*2]=y,h[p*2+1]=v,l[p*2]=b.k1,l[p*2+1]=b.k2}for(var g=this._wnafMulAdd(1,h,l,p*2,c),x=0;x<p*2;x++)h[x]=null,l[x]=null;return g};function s(o,f,n,c){i.BasePoint.call(this,o,"affine"),f===null&&n===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(f,16),this.y=new e(n,16),c&&(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(s,i.BasePoint),r.prototype.point=function(f,n,c){return new s(this,f,n,c)},r.prototype.pointFromJSON=function(f,n){return s.fromJSON(this,f,n)},s.prototype._getBeta=function(){if(this.curve.endo){var f=this.precomputed;if(f&&f.beta)return f.beta;var n=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var c=this.curve,h=function(l){return c.point(l.x.redMul(c.endo.beta),l.y)};f.beta=n,n.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(h)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(h)}}}return n}},s.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]},s.fromJSON=function(f,n,c){typeof n=="string"&&(n=JSON.parse(n));var h=f.point(n[0],n[1],c);if(!n[2])return h;function l(b){return f.point(b[0],b[1],c)}var p=n[2];return h.precomputed={beta:null,doubles:p.doubles&&{step:p.doubles.step,points:[h].concat(p.doubles.points.map(l))},naf:p.naf&&{wnd:p.naf.wnd,points:[h].concat(p.naf.points.map(l))}},h},s.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)+">"},s.prototype.isInfinity=function(){return this.inf},s.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 n=this.y.redSub(f.y);n.cmpn(0)!==0&&(n=n.redMul(this.x.redSub(f.x).redInvm()));var c=n.redSqr().redISub(this.x).redISub(f.x),h=n.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,h)},s.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 n=this.curve.a,c=this.x.redSqr(),h=f.redInvm(),l=c.redAdd(c).redIAdd(c).redIAdd(n).redMul(h),p=l.redSqr().redISub(this.x.redAdd(this.x)),b=l.redMul(this.x.redSub(p)).redISub(this.y);return this.curve.point(p,b)},s.prototype.getX=function(){return this.x.fromRed()},s.prototype.getY=function(){return this.y.fromRed()},s.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)},s.prototype.mulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l):this.curve._wnafMulAdd(1,h,l,2)},s.prototype.jmulAdd=function(f,n,c){var h=[this,n],l=[f,c];return this.curve.endo?this.curve._endoWnafMulAdd(h,l,!0):this.curve._wnafMulAdd(1,h,l,2,!0)},s.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)},s.prototype.neg=function(f){if(this.inf)return this;var n=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var c=this.precomputed,h=function(l){return l.neg()};n.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(h)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(h)}}}return n},s.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 a(o,f,n,c){i.BasePoint.call(this,o,"jacobian"),f===null&&n===null&&c===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(n,16),this.z=new e(c,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(a,i.BasePoint),r.prototype.jpoint=function(f,n,c){return new a(this,f,n,c)},a.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),n=f.redSqr(),c=this.x.redMul(n),h=this.y.redMul(n).redMul(f);return this.curve.point(c,h)},a.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},a.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var n=f.z.redSqr(),c=this.z.redSqr(),h=this.x.redMul(n),l=f.x.redMul(c),p=this.y.redMul(n.redMul(f.z)),b=f.y.redMul(c.redMul(this.z)),y=h.redSub(l),v=p.redSub(b);if(y.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=y.redSqr(),x=g.redMul(y),B=h.redMul(g),R=v.redSqr().redIAdd(x).redISub(B).redISub(B),T=v.redMul(B.redISub(R)).redISub(p.redMul(x)),j=this.z.redMul(f.z).redMul(y);return this.curve.jpoint(R,T,j)},a.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var n=this.z.redSqr(),c=this.x,h=f.x.redMul(n),l=this.y,p=f.y.redMul(n).redMul(this.z),b=c.redSub(h),y=l.redSub(p);if(b.cmpn(0)===0)return y.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=b.redSqr(),g=v.redMul(b),x=c.redMul(v),B=y.redSqr().redIAdd(g).redISub(x).redISub(x),R=y.redMul(x.redISub(B)).redISub(l.redMul(g)),T=this.z.redMul(b);return this.curve.jpoint(B,R,T)},a.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 n=this,c=0;c<f;c++)n=n.dbl();return n}for(var h=this.curve.a,l=this.curve.tinv,p=this.x,b=this.y,y=this.z,v=y.redSqr().redSqr(),g=b.redAdd(b),c=0;c<f;c++){var x=p.redSqr(),B=g.redSqr(),R=B.redSqr(),T=x.redAdd(x).redIAdd(x).redIAdd(h.redMul(v)),j=p.redMul(B),G=T.redSqr().redISub(j.redAdd(j)),z=j.redISub(G),te=T.redMul(z);te=te.redIAdd(te).redISub(R);var ne=g.redMul(y);c+1<f&&(v=v.redMul(R)),p=G,y=ne,g=te}return this.curve.jpoint(p,g.redMul(l),y)},a.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},a.prototype._zeroDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),p=l.redSqr(),b=this.x.redAdd(l).redSqr().redISub(h).redISub(p);b=b.redIAdd(b);var y=h.redAdd(h).redIAdd(h),v=y.redSqr().redISub(b).redISub(b),g=p.redIAdd(p);g=g.redIAdd(g),g=g.redIAdd(g),f=v,n=y.redMul(b.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.x.redSqr(),B=this.y.redSqr(),R=B.redSqr(),T=this.x.redAdd(B).redSqr().redISub(x).redISub(R);T=T.redIAdd(T);var j=x.redAdd(x).redIAdd(x),G=j.redSqr(),z=R.redIAdd(R);z=z.redIAdd(z),z=z.redIAdd(z),f=G.redISub(T).redISub(T),n=j.redMul(T.redISub(f)).redISub(z),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(f,n,c)},a.prototype._threeDbl=function(){var f,n,c;if(this.zOne){var h=this.x.redSqr(),l=this.y.redSqr(),p=l.redSqr(),b=this.x.redAdd(l).redSqr().redISub(h).redISub(p);b=b.redIAdd(b);var y=h.redAdd(h).redIAdd(h).redIAdd(this.curve.a),v=y.redSqr().redISub(b).redISub(b);f=v;var g=p.redIAdd(p);g=g.redIAdd(g),g=g.redIAdd(g),n=y.redMul(b.redISub(v)).redISub(g),c=this.y.redAdd(this.y)}else{var x=this.z.redSqr(),B=this.y.redSqr(),R=this.x.redMul(B),T=this.x.redSub(x).redMul(this.x.redAdd(x));T=T.redAdd(T).redIAdd(T);var j=R.redIAdd(R);j=j.redIAdd(j);var G=j.redAdd(j);f=T.redSqr().redISub(G),c=this.y.redAdd(this.z).redSqr().redISub(B).redISub(x);var z=B.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),n=T.redMul(j.redISub(f)).redISub(z)}return this.curve.jpoint(f,n,c)},a.prototype._dbl=function(){var f=this.curve.a,n=this.x,c=this.y,h=this.z,l=h.redSqr().redSqr(),p=n.redSqr(),b=c.redSqr(),y=p.redAdd(p).redIAdd(p).redIAdd(f.redMul(l)),v=n.redAdd(n);v=v.redIAdd(v);var g=v.redMul(b),x=y.redSqr().redISub(g.redAdd(g)),B=g.redISub(x),R=b.redSqr();R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var T=y.redMul(B).redISub(R),j=c.redAdd(c).redMul(h);return this.curve.jpoint(x,T,j)},a.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),n=this.y.redSqr(),c=this.z.redSqr(),h=n.redSqr(),l=f.redAdd(f).redIAdd(f),p=l.redSqr(),b=this.x.redAdd(n).redSqr().redISub(f).redISub(h);b=b.redIAdd(b),b=b.redAdd(b).redIAdd(b),b=b.redISub(p);var y=b.redSqr(),v=h.redIAdd(h);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var g=l.redIAdd(b).redSqr().redISub(p).redISub(y).redISub(v),x=n.redMul(g);x=x.redIAdd(x),x=x.redIAdd(x);var B=this.x.redMul(y).redISub(x);B=B.redIAdd(B),B=B.redIAdd(B);var R=this.y.redMul(g.redMul(v.redISub(g)).redISub(b.redMul(y)));R=R.redIAdd(R),R=R.redIAdd(R),R=R.redIAdd(R);var T=this.z.redAdd(b).redSqr().redISub(c).redISub(y);return this.curve.jpoint(B,R,T)},a.prototype.mul=function(f,n){return f=new e(f,n),this.curve._wnafMul(this,f)},a.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var n=this.z.redSqr(),c=f.z.redSqr();if(this.x.redMul(c).redISub(f.x.redMul(n)).cmpn(0)!==0)return!1;var h=n.redMul(this.z),l=c.redMul(f.z);return this.y.redMul(l).redISub(f.y.redMul(h)).cmpn(0)===0},a.prototype.eqXToP=function(f){var n=this.z.redSqr(),c=f.toRed(this.curve.red).redMul(n);if(this.x.cmp(c)===0)return!0;for(var h=f.clone(),l=this.curve.redN.redMul(n);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(l),this.x.cmp(c)===0)return!0}},a.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)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Kf}var Ph;function Fd(){return Ph||(Ph=1,(function(d){var e=d;e.base=Dd(),e.short=O1()})(qf)),qf}var jf={},zf,Nh;function P1(){return Nh||(Nh=1,zf={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"]]}}),zf}var kh;function Ud(){return kh||(kh=1,(function(d){var e=d,t=vr(),i=Fd(),u=qt(),r=u.assert;function s(f){if(f.type!=="short")throw new Error("invalid curve type");this.curve=new i.short(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,r(this.g.validate(),"Invalid curve"),r(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=s;function a(f,n){Object.defineProperty(e,f,{configurable:!0,enumerable:!0,get:function(){var c=new s(n);return Object.defineProperty(e,f,{configurable:!0,enumerable:!0,value:c}),c}})}var o;try{o=P1()}catch{o=void 0}a("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",o]})})(jf)),jf}var Vf,Mh;function N1(){if(Mh)return Vf;Mh=1;var d=Te(),e=qt(),t=e.assert;function i(u,r){this.ec=u,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}return Vf=i,i.fromPublic=function(r,s,a){return s instanceof i?s:new i(r,{pub:s,pubEnc:a})},i.fromPrivate=function(r,s,a){return s instanceof i?s:new i(r,{priv:s,privEnc:a})},i.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.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"}},i.prototype.getPublic=function(r,s){return typeof r=="string"&&(s=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),s?this.pub.encode(s,r):this.pub},i.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(r,s){this.priv=new d(r,s||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(r,s){if(r.x||r.y){this.ec.curve.type==="mont"?t(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&t(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,s)},i.prototype.derive=function(r){return r.mul(this.priv).getX()},i.prototype.sign=function(r,s,a){return this.ec.sign(r,this,s,a)},i.prototype.verify=function(r,s){return this.ec.verify(r,s,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Vf}var Gf,Ch;function k1(){if(Ch)return Gf;Ch=1;var d=Te(),e=qt(),t=e.assert;function i(o,f){if(o instanceof i)return o;this._importDER(o,f)||(t(o.r&&o.s,"Signature without r or s"),this.r=new d(o.r,16),this.s=new d(o.s,16),o.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=o.recoveryParam)}Gf=i;function u(){this.place=0}function r(o,f){var n=o[f.place++];if(!(n&128))return n;for(var c=n&15,h=0,l=0,p=f.place;l<c;l++,p++)h<<=8,h|=o[p];return f.place=p,h}function s(o){for(var f=0,n=o.length-1;!o[f]&&!(o[f+1]&128)&&f<n;)f++;return f===0?o:o.slice(f)}i.prototype._importDER=function(f,n){f=e.toArray(f,n);var c=new u;if(f[c.place++]!==48)return!1;var h=r(f,c);if(h+c.place!==f.length||f[c.place++]!==2)return!1;var l=r(f,c),p=f.slice(c.place,l+c.place);if(c.place+=l,f[c.place++]!==2)return!1;var b=r(f,c);if(f.length!==b+c.place)return!1;var y=f.slice(c.place,b+c.place);return p[0]===0&&p[1]&128&&(p=p.slice(1)),y[0]===0&&y[1]&128&&(y=y.slice(1)),this.r=new d(p),this.s=new d(y),this.recoveryParam=null,!0};function a(o,f){if(f<128){o.push(f);return}var n=1+(Math.log(f)/Math.LN2>>>3);for(o.push(n|128);--n;)o.push(f>>>(n<<3)&255);o.push(f)}return i.prototype.toDER=function(f){var n=this.r.toArray(),c=this.s.toArray();for(n[0]&128&&(n=[0].concat(n)),c[0]&128&&(c=[0].concat(c)),n=s(n),c=s(c);!c[0]&&!(c[1]&128);)c=c.slice(1);var h=[2];a(h,n.length),h=h.concat(n),h.push(2),a(h,c.length);var l=h.concat(c),p=[48];return a(p,l.length),p=p.concat(l),e.encode(p,f)},Gf}var $f,Th;function M1(){if(Th)return $f;Th=1;var d=Te(),e=Od(),t=qt(),i=Ud(),u=yr(),r=t.assert,s=N1(),a=k1();function o(f){if(!(this instanceof o))return new o(f);typeof f=="string"&&(r(i.hasOwnProperty(f),"Unknown curve "+f),f=i[f]),f instanceof i.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 $f=o,o.prototype.keyPair=function(n){return new s(this,n)},o.prototype.keyFromPrivate=function(n,c){return s.fromPrivate(this,n,c)},o.prototype.keyFromPublic=function(n,c){return s.fromPublic(this,n,c)},o.prototype.genKeyPair=function(n){n||(n={});var c=new e({hash:this.hash,pers:n.pers,persEnc:n.persEnc||"utf8",entropy:n.entropy||u(this.hash.hmacStrength),entropyEnc:n.entropy&&n.entropyEnc||"utf8",nonce:this.n.toArray()}),h=this.n.byteLength(),l=this.n.sub(new d(2));do{var p=new d(c.generate(h));if(!(p.cmp(l)>0))return p.iaddn(1),this.keyFromPrivate(p)}while(!0)},o.prototype._truncateToN=function(n,c){var h=n.byteLength()*8-this.n.bitLength();return h>0&&(n=n.ushrn(h)),!c&&n.cmp(this.n)>=0?n.sub(this.n):n},o.prototype.sign=function(n,c,h,l){typeof h=="object"&&(l=h,h=null),l||(l={}),c=this.keyFromPrivate(c,h),n=this._truncateToN(new d(n,16));for(var p=this.n.byteLength(),b=c.getPrivate().toArray("be",p),y=n.toArray("be",p),v=new e({hash:this.hash,entropy:b,nonce:y,pers:l.pers,persEnc:l.persEnc||"utf8"}),g=this.n.sub(new d(1)),x=0;;x++){var B=l.k?l.k(x):new d(v.generate(this.n.byteLength()));if(B=this._truncateToN(B,!0),!(B.cmpn(1)<=0||B.cmp(g)>=0)){var R=this.g.mul(B);if(!R.isInfinity()){var T=R.getX(),j=T.umod(this.n);if(j.cmpn(0)!==0){var G=B.invm(this.n).mul(j.mul(c.getPrivate()).iadd(n));if(G=G.umod(this.n),G.cmpn(0)!==0){var z=(R.getY().isOdd()?1:0)|(T.cmp(j)!==0?2:0);return l.canonical&&G.cmp(this.nh)>0&&(G=this.n.sub(G),z^=1),new a({r:j,s:G,recoveryParam:z})}}}}}},o.prototype.verify=function(n,c,h,l){n=this._truncateToN(new d(n,16)),h=this.keyFromPublic(h,l),c=new a(c,"hex");var p=c.r,b=c.s;if(p.cmpn(1)<0||p.cmp(this.n)>=0||b.cmpn(1)<0||b.cmp(this.n)>=0)return!1;var y=b.invm(this.n),v=y.mul(n).umod(this.n),g=y.mul(p).umod(this.n);if(!this.curve._maxwellTrick){var x=this.g.mulAdd(v,h.getPublic(),g);return x.isInfinity()?!1:x.getX().umod(this.n).cmp(p)===0}var x=this.g.jmulAdd(v,h.getPublic(),g);return x.isInfinity()?!1:x.eqXToP(p)},o.prototype.recoverPubKey=function(f,n,c,h){r((3&c)===c,"The recovery param is more than two bits"),n=new a(n,h);var l=this.n,p=new d(f),b=n.r,y=n.s,v=c&1,g=c>>1;if(b.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?b=this.curve.pointFromX(b.add(this.curve.n),v):b=this.curve.pointFromX(b,v);var x=n.r.invm(l),B=l.sub(p).mul(x).umod(l),R=y.mul(x).umod(l);return this.g.mulAdd(B,b,R)},o.prototype.getKeyRecoveryParam=function(f,n,c,h){if(n=new a(n,h),n.recoveryParam!==null)return n.recoveryParam;for(var l=0;l<4;l++){var p;try{p=this.recoverPubKey(f,n,l)}catch{continue}if(p.eq(c))return l}throw new Error("Unable to find valid recovery factor")},$f}var Lh;function C1(){return Lh||(Lh=1,(function(d){var e=d;e.version=i0.version,e.utils=qt(),e.rand=yr(),e.curve=Fd(),e.curves=Ud(),e.ec=M1()})(_i)),_i}var T1=C1();const qd=$t(T1);var L1=vr();const gr=$t(L1);var D1=ps();const Hd=$t(D1);var F1=xt();const U1="2.5.0",q1={version:U1};function Z(d,e,t){if(!(this instanceof Z))return new Z(d,e,t);if(d&&(d instanceof ut||d.constructor.name==="BN"||d.constructor.name==="Bn")){ut.call(this,0),d.copy(this),this.negative=d.negative,this.length=d.length,this.red=d.red;return}ut.call(this,d,e,t)}Z.prototype=Object.create(ut.prototype);Z.prototype.constructor=Z;Object.keys(ut).forEach(function(d){Z[d]||(Z[d]=ut[d])});function Zr(d){const e=Buffer.alloc(d.length);for(let t=0;t<d.length;t++)e[t]=d[d.length-1-t];return e}Z.prototype.fromHex=function(d,e){return this.fromBuffer(Buffer.from(d,"hex"),e)};Z.prototype.toHex=function(d){return this.toBuffer(d).toString("hex")};Z.prototype.toJSON=function(){return this.toString()};Z.prototype.fromJSON=function(d){return new Z(d).copy(this),this};Z.prototype.fromNumber=function(d){return new Z(d).copy(this),this};Z.prototype.toNumber=function(){return parseInt(this.toString(10),10)};Z.prototype.fromString=function(d,e){return new Z(d,e).copy(this),this};Z.fromBuffer=function(d,e={endian:"big"}){e.endian==="little"&&(d=Zr(d));const t=d.toString("hex");return new Z(t,16)};Z.prototype.fromBuffer=function(d,e){return Z.fromBuffer(d,e).copy(this),this};Z.prototype.toBuffer=function(d={size:void 0,endian:"big"}){let e;if(d.size){const i=this.toString(16,2),u=i.length/2;if(e=Buffer.from(i,"hex"),u!==d.size){if(u>d.size)e=e.slice(u-e.length,e.length);else if(u<d.size){const r=Buffer.alloc(d.size);for(let s=0;s<e.length;s++)r[r.length-1-s]=e[e.length-1-s];for(let s=0;s<d.size-u;s++)r[s]=0;e=r}}}else{const i=this.toString(16,2);e=Buffer.from(i,"hex")}d.endian==="little"&&(e=Zr(e));const t=Buffer.from([0]);return Buffer.compare(e,t)===0?Buffer.from([]):e};Z.prototype.toFastBuffer=function(d){return this.toBuffer(d)};Z.fromFastBuffer=Z.fromBuffer;Z.prototype.fromFastBuffer=Z.prototype.fromBuffer;Z.prototype.fromSm=function(d,e={endian:"big"}){if(d.length===0)return this.fromBuffer(Buffer.from([0])),this.negative=0,this;let t=Buffer.from(d);return e.endian==="little"&&(t=Zr(t)),t[0]&128?(t[0]=t[0]&127,this.fromBuffer(t),this.ineg()):(this.fromBuffer(t),this.negative=0),this};Z.prototype.toSm=function(d={endian:"big"}){const e=d.endian;let t;return this.negative?(t=this.abs().toBuffer(),t.length>0&&t[0]&128?t=Buffer.concat([Buffer.from([128]),t]):t.length>0?t[0]=t[0]|128:t=Buffer.from([128])):(t=this.toBuffer(),t.length>0&&t[0]&128&&(t=Buffer.concat([Buffer.from([0]),t]))),t.length===1&&t[0]===0&&(t=Buffer.from([])),e==="little"&&(t=Zr(t)),t};Z.prototype.fromBits=function(d,e={strict:!1}){let t=Buffer.alloc(4);if(t.writeUInt32BE(d,0),d=t.readInt32BE(0),e.strict&&d&8388608)throw new Error("negative bit set");const i=d>>24,u=d&8388607;if(t=Buffer.alloc(4),t.writeInt32BE(u),i<=3)t=t.slice(1,i+1);else{const r=Buffer.alloc(i-3);r.fill(0),t=Buffer.concat([t,r])}return this.fromBuffer(t),d&8388608&&this.ineg(),this};Z.prototype.toBits=function(){const d=this.negative,t=this.abs().toBuffer();let i=t.length,u;if(i>3)u=Buffer.concat([Buffer.from([0]),t.slice(0,3)]).readUInt32BE(0);else if(i<=3){u=0;for(let a=0;a<i;a++)u|=t[a]<<8*(2-a)}u&8388608&&(u>>=8,i++),d&&(u|=8388608);const r=i<<24|u,s=Buffer.alloc(4);return s.writeInt32BE(r,0),s.readUInt32BE(0)};Z.prototype.fromScriptNumBuffer=function(d,e,t){if(t===void 0&&(t=4),d.length>t)throw new Error(`script number overflow nMaxNumSize: ${t}`);if(e&&d.length>0&&(d[d.length-1]&127)===0&&(d.length<=1||(d[d.length-2]&128)===0))throw new Error("non-minimally encoded script number");return this.fromSm(d,{endian:"little"})};Z.prototype.toScriptNumBuffer=function(){return this.toSm({endian:"little"})};const wr=function(d){return d&&(d instanceof ut||d.constructor.name==="BN"||d.constructor.name==="Bn")&&!(d instanceof Z)?new Z(d):d},H1=["add","sub","mul","div","mod","umod","invm","and","or","xor","redAdd","redSub","redMul","redPow","gcd","egcd","lcm"];H1.forEach(d=>{const e=ut.prototype[d];Z.prototype[d]=function(t,...i){return(typeof t=="string"||typeof t=="number")&&(t=new Z(t)),wr(e.call(this,t,...i))}});const K1=["ushln","ushrn","shln","shrn","testn","maskn","setn","clrn","bincn"];K1.forEach(d=>{const e=ut.prototype[d];Z.prototype[d]=function(t,...i){return t&&(t instanceof ut||t.constructor.name==="BN"||t.constructor.name==="Bn")&&(t=t.toNumber()),wr(e.call(this,t,...i))}});const j1=["sqr","neg","abs","not","redSqr","redSqrt","redNeg"];j1.forEach(d=>{const e=ut.prototype[d];Z.prototype[d]=function(){return wr(e.call(this))}});Z.prototype.toRed=function(d){return wr(ut.prototype.toRed.call(this,d))};Z.prototype.fromRed=function(){return wr(ut.prototype.fromRed.call(this))};const z1=["cmp","gt","geq","lt","leq","eq","neq"];z1.forEach(d=>{const e=ut.prototype.cmp;Z.prototype[d]=function(t){(typeof t=="string"||typeof t=="number")&&(t=new Z(t));const i=e.call(this,t);return d==="eq"?i===0:d==="neq"?i!==0:d==="gt"?i>0:d==="geq"?i>=0:d==="lt"?i<0:d==="leq"?i<=0:i}});class st{constructor(e,t=!1){this.strict=t,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 i=Buffer.alloc(t.length);for(let u=0;u<i.length;u++)i[u]=t[t.length-1-u];return i}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 Z().fromBuffer(e);return this.pos=this.pos+8,t}readUInt64LEBn(){const e=this.readReverse(8);return new Z().fromBuffer(e)}readVarIntNum(){if(this.strict)return this.readVarIntNumStrict();const e=this.readUInt8();let t,i;switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(t=this.readUInt64LEBn(),i=t.toNumber(),i<=Math.pow(2,53))return i;throw new Error("number too large to retain precision - use readVarIntBn");default:return e}}readVarIntNumStrict(){const e=this.readUInt8();if(e<253)return e;if(e===253){const i=this.readUInt16LE();if(i<253)throw new Error("non-canonical varInt");return i}if(e===254){const i=this.readUInt32LE();if(i<=65535)throw new Error("non-canonical varInt");return i}const t=this.readUInt64LEBn();if(t.lte(new Z(4294967295)))throw new Error("non-canonical varInt");if(t.abs().toString(16)==="ffffffffffffffff")return-1;if(t.gt(new Z(Number.MAX_SAFE_INTEGER)))throw new Error("number too large to retain precision - use readVarIntBn");return t.toNumber()}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 Z(this.readUInt16LE());case 254:return new Z(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new Z(e)}}}class ke{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 i=this.bufs[t];e=e+i.length}return e}toBuffer(){return Buffer.concat(this.bufs)}write(e){return this.bufs.push(e),this}writeReverse(e){const t=Buffer.alloc(e.length);for(let i=0;i<t.length;i++)t[i]=e[e.length-1-i];return this.bufs.push(t),this}writeUInt8(e){const t=Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this}writeInt8(e){const t=Buffer.alloc(1);return t.writeInt8(e,0),this.write(t),this}writeUInt16BE(e){const t=Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this}writeInt16BE(e){const t=Buffer.alloc(2);return t.writeInt16BE(e,0),this.write(t),this}writeUInt16LE(e){const t=Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this}writeInt16LE(e){const t=Buffer.alloc(2);return t.writeInt16LE(e,0),this.write(t),this}writeUInt32BE(e){const t=Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this}writeInt32BE(e){const t=Buffer.alloc(4);return t.writeInt32BE(e,0),this.write(t),this}writeUInt32LE(e){const t=Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this}writeInt32LE(e){const t=Buffer.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=ke.varIntBufNum(e);return this.write(t),this}writeVarIntBn(e){const t=ke.varIntBufBn(e);return this.write(t),this}static varIntBufNum(e){let t;return e<253?(t=Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=Buffer.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 i=e.toNumber();if(i<253)t=Buffer.alloc(1),t.writeUInt8(i,0);else if(i<65536)t=Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(i,1);else if(i<4294967296)t=Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(i,1);else{const u=new ke;u.writeUInt8(255),u.writeUInt64LEBn(e),t=u.toBuffer()}return t}}function V1(d){const e=typeof d=="string"?d.charCodeAt(0):d;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}const Wf=V1;class Ce{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 st?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 st?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 i=t;const u=new ke;let r=0;for(t&&(u.write(t),r+=t.length);r<e;)i=yield e-r,i&&(u.write(i),r+=i.length);i=u.toBuffer();const s=r-e,a=i.slice(i.length-s,i.length);return i=i.slice(0,i.length-s),{buf:i,remainderbuf:a}}fromBuffer(e,...t){if(!Buffer.isBuffer(e))throw new Error("buf must be a buffer");const i=new st(e);return this.fromBr(i,...t)}static fromBuffer(...e){return new this().fromBuffer(...e)}asyncFromBuffer(e,...t){if(!Buffer.isBuffer(e))throw new Error("buf must be a buffer");const i=new st(e);return this.asyncFromBr(i,...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?Buffer.alloc(0):this.toBuffer(...e)}fromHex(e,...t){if(!Wf(e))throw new Error("invalid hex string");const i=Buffer.from(e,"hex");return this.fromBuffer(i,...t)}static fromHex(e,...t){return new this().fromHex(e,...t)}asyncFromHex(e,...t){if(!Wf(e))throw new Error("invalid hex string");const i=Buffer.from(e,"hex");return this.asyncFromBuffer(i,...t)}static asyncFromHex(e,...t){return new this().asyncFromHex(e,...t)}fromFastHex(e,...t){if(!Wf(e))throw new Error("invalid hex string");const i=Buffer.from(e,"hex");return this.fromFastBuffer(i,...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 i=[];for(const u in this[t])typeof this[t][u].toJSON=="function"?i.push(this[t][u].toJSON()):i.push(JSON.stringify(this[t][u]));e[t]=i}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(Buffer.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 Gt extends Ce{constructor(e){super({buf:e})}fromHex(e){return this.fromBuffer(Buffer.from(e,"hex"))}toHex(){return this.toBuffer().toString("hex")}static encode(e){if(!Buffer.isBuffer(e))throw new Error("Input should be a buffer");return Jf.encode(e)}static decode(e){if(typeof e!="string")throw new Error("Input should be a string");return Buffer.from(Jf.decode(e))}fromBuffer(e){return this.buf=e,this}fromString(e){const t=Gt.decode(e);return this.buf=t,this}toBuffer(){return this.buf}toString(){return Gt.encode(this.buf)}}const Nt=(d,e)=>{if(!Buffer.isBuffer(d)||!Buffer.isBuffer(e))throw new Error("buf1 and buf2 must be buffers");if(d.length!==e.length)return!1;let t=0;for(let i=0;i<d.length;i++){const u=d[i],r=e[i];t|=u^r}return t===0};class Qf extends Ce{constructor(e,t,i){super({resbuf:e,isError:t,id:i})}fromResult(e,t){return e.toFastBuffer?this.resbuf=e.toFastBuffer():Buffer.isBuffer(e)?this.resbuf=e:this.resbuf=Buffer.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=Buffer.from(JSON.stringify(e.message)),this.isError=!0,this.id=t,this}toBw(e){return e||(e=new ke),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 Ot;class le{constructor(e=[],t=0,i=[],u=new Map){this.nativeWorkers=e,this.lastid=t,this.incompconsteRes=i,this.promisemap=u}asyncObjectMethod(e,t,i,u=this.lastid+1){if(!i)throw new Error("must specify args");const r=e[t](...i);return new Qf().fromResult(r,u)}static asyncObjectMethod(e,t,i,u){return Ot||(Ot=new le),Ot.asyncObjectMethod(e,t,i,u)}asyncClassMethod(e,t,i,u=this.lastid+1){if(!i)throw new Error("must specify args");const r=e[t](...i);return new Qf().fromResult(r,u)}static asyncClassMethod(e,t,i,u){return Ot||(Ot=new le),Ot.asyncClassMethod(e,t,i,u)}static endGlobalWorkers(){Ot&&!process.browser&&(Ot=void 0)}}class ae{}ae.sha1=function(d){if(!Buffer.isBuffer(d))throw new Error("sha1 hash must be of a buffer");const e=gr.sha1,t=new e().update(d).digest();return Buffer.from(t)};ae.sha1.blockSize=512;ae.asyncSha1=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha1",e)).resbuf};ae.sha256=function(d){if(!Buffer.isBuffer(d))throw new Error("sha256 hash must be of a buffer");const e=gr.sha256,t=new e().update(d).digest();return Buffer.from(t)};ae.sha256.blockSize=512;ae.asyncSha256=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha256",e)).resbuf};ae.sha256Sha256=function(d){try{return ae.sha256(ae.sha256(d))}catch(e){throw new Error("sha256Sha256 hash must be of a buffer: "+e)}};ae.asyncSha256Sha256=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha256Sha256",e)).resbuf};ae.ripemd160=function(d){if(!Buffer.isBuffer(d))throw new Error("ripemd160 hash must be of a buffer");const e=gr.ripemd160,t=new e().update(d).digest();return Buffer.from(t)};ae.asyncRipemd160=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"ripemd160",e)).resbuf};ae.sha256Ripemd160=function(d){try{return ae.ripemd160(ae.sha256(d))}catch(e){throw new Error("sha256Ripemd160 hash must be of a buffer: "+e)}};ae.asyncSha256Ripemd160=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha256Ripemd160",e)).resbuf};ae.sha512=function(d){if(!Buffer.isBuffer(d))throw new Error("sha512 hash must be of a buffer");const e=gr.sha512,t=new e().update(d).digest();return Buffer.from(t)};ae.asyncSha512=async function(d){const e=[d];return(await le.asyncClassMethod(ae,"sha512",e)).resbuf};ae.sha512.blockSize=1024;ae.hmac=function(d,e,t){if(d!=="sha1"&&d!=="sha256"&&d!=="sha512")throw new Error("invalid choice of hash function");const i=ae[d];if(!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new Error("data and key must be buffers");const u=i.blockSize/8;if(t.length>u&&(t=i(t)),t.length<u){const a=Buffer.alloc(u);a.fill(0,t.length),t.copy(a),t=a}const r=Buffer.alloc(u),s=Buffer.alloc(u);for(let a=0;a<u;a++)r[a]=92^t[a],s[a]=54^t[a];return i(Buffer.concat([r,i(Buffer.concat([s,e]))]))};ae.sha1Hmac=function(d,e){return ae.hmac("sha1",d,e)};ae.asyncSha1Hmac=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(ae,"sha1Hmac",t)).resbuf};ae.sha1Hmac.bitsize=160;ae.sha256Hmac=function(d,e){return ae.hmac("sha256",d,e)};ae.asyncSha256Hmac=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(ae,"sha256Hmac",t)).resbuf};ae.sha256Hmac.bitsize=256;ae.sha512Hmac=function(d,e){return ae.hmac("sha512",d,e)};ae.asyncSha512Hmac=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(ae,"sha512Hmac",t)).resbuf};ae.sha512Hmac.bitsize=512;class Bt extends Ce{constructor(e){super({buf:e})}fromHex(e){return this.fromBuffer(Buffer.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=Gt.decode(e);if(t.length<4)throw new Error("Input string too short");const i=t.slice(0,-4),u=t.slice(-4),s=ae.sha256Sha256(i).slice(0,4);if(!Nt(u,s))throw new Error("Checksum mismatch");return i}static encode(e){if(!Buffer.isBuffer(e))throw new Error("Input must be a buffer");const t=Buffer.alloc(e.length+4),i=ae.sha256Sha256(e);return e.copy(t),i.copy(t,e.length),Gt.encode(t)}fromBuffer(e){return this.buf=e,this}fromString(e){const t=Bt.decode(e);return this.buf=t,this}toBuffer(){return this.buf}toString(){return Bt.encode(this.buf)}}class G1{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 $1{constructor(){this.variables={}}build(){return new G1(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,i){if(i===void 0)throw new Error(`Failed to add "${e}" property. Default value cannot be undefined`);return this.addValue(e,t===void 0?i:t)}}const Zt=new $1().addValue("NETWORK","mainnet").build(),Oe={};Oe.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}};Oe.Testnet=Object.assign({},Oe.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}});Oe.Regtest=Object.assign({},Oe.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}});Oe.STN=Object.assign({},Oe.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}});if(Zt.get("NETWORK")==="testnet")Oe.Default=Object.assign({},Oe.Testnet);else if(Zt.get("NETWORK")==="mainnet")Oe.Default=Object.assign({},Oe.Mainnet);else if(Zt.get("NETWORK")==="regtest")Oe.Default=Object.assign({},Oe.Regtest);else if(Zt.get("NETWORK")==="stn")Oe.Default=Object.assign({},Oe.STN);else throw new Error(`must set network in environment variable - mainnet, testnet, regtest or stn?, received ${Zt.get("NETWORK")}`);const W1=d=>Oe.Mainnet.Msg.magicNum===d?Oe.Mainnet:Oe.Testnet.Msg.magicNum===d?Oe.Testnet:Oe.Regtest.Msg.magicNum===d?Oe.Regtest:Oe.STN.Msg.magicNum===d?Oe.STN:Oe.Default,er={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},tr={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 U extends Ce{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=tr[e];if(t===void 0)throw new Error("Invalid opCodeStr");return this.num=t,this}fromNoOpString(e){const t=er[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=U.str[this.num];return e===void 0?this.num>0&&this.num<U.OP_PUSHDATA1?this.num.toString():"OP_"+this.num.toNumber():e}toNoOpString(){const e=U.noopstr[this.num];return e===void 0?this.num>0&&this.num<U.OP_PUSHDATA1?this.num.toString():this.num.toNumber():e}}U.str={};U.noopstr={};for(const d in tr)U[d]=tr[d],Object.prototype.hasOwnProperty.call(tr,d)&&(U.str[tr[d]]=d);for(const d in er)U[d]=er[d],Object.prototype.hasOwnProperty.call(er,d)&&(U.noopstr[er[d]]=d);U.OP_SUBSTR_CHRONICLE=179;U.OP_LEFT_CHRONICLE=180;U.OP_RIGHT_CHRONICLE=181;U.OP_LSHIFTNUM=182;U.OP_RSHIFTNUM=183;const rr=qd.curves.secp256k1,Y1=rr.curve.point(),Tt=Y1.constructor;class Ae extends Tt{constructor(e,t,i){super(rr.curve,e,t,i)}static fromX(e,t){const i=rr.curve.pointFromX(t,e);return Object.create(Ae.prototype).copyFrom(i)}copyFrom(e){if(!(e instanceof Tt))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=Tt.prototype.add.call(this,e),Object.create(Ae.prototype).copyFrom(e)}mul(e){if(!e.lt(Ae.getN()))throw new Error("point mul out of range");const t=Tt.prototype.mul.call(this,e);return Object.create(Ae.prototype).copyFrom(t)}mulAdd(e,t,i){const u=Tt.prototype.mulAdd.call(this,e,t,i);return t=Object.create(Ae.prototype),t.copyFrom(u)}getX(){const e=Tt.prototype.getX.call(this),t=Object.create(Z.prototype);return e.copy(t),t}getY(){const e=Tt.prototype.getY.call(this),t=Object.create(Z.prototype);return e.copy(t),t}fromX(e,t){const i=Ae.fromX(e,t);return this.copyFrom(i)}toJSON(){return{x:this.getX().toString(),y:this.getY().toString()}}fromJSON(e){const t=new Z().fromString(e.x),i=new Z().fromString(e.y),u=new Ae(t,i);return this.copyFrom(u)}toString(){return JSON.stringify(this.toJSON())}fromString(e){const t=JSON.parse(e),i=new Ae().fromJSON(t);return this.copyFrom(i)}static getG(){const e=rr.curve.g;return Object.create(Ae.prototype).copyFrom(e)}static getN(){return new Z(rr.curve.n.toArray())}validate(){if(Ae.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(Ae.getN()))||!(this.getY().gt(-1)&&this.getY().lt(Ae.getN())))throw new Error("Point does not lie on the curve");return this}}class qe extends Ce{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:Ae.getG().mul(e.bn),compressed:e.compressed}),this}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){const t=await le.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 i=[e,t],u=await le.asyncObjectMethod(this,"fromBuffer",i);return this.fromFastBuffer(u.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 i=e.slice(1,33),u=e.slice(33,65);if(i.length!==32||u.length!==32||e.length!==65)throw new Error("LEngth of x and y must be 32 bytes");const r=new Z(i),s=new Z(u);this.point=new Ae(r,s),this.compressed=!1}else if(e[0]===3){const i=e.slice(1),u=new Z(i);this.fromX(!0,u),this.compressed=!0}else if(e[0]===2){const i=e.slice(1),u=new Z(i);this.fromX(!1,u),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(Buffer.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=Ae.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 Buffer.alloc(0);const e=new ke,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(),i=this.point.getY(),u=t.toBuffer({size:32}),r=i.toBuffer({size:32});let s;return e?(r[r.length-1]%2?s=Buffer.from([3]):s=Buffer.from([2]),Buffer.concat([s,u])):(s=Buffer.from([4]),Buffer.concat([s,u,r]))}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 Ae(new Z(0),new Z(0))))throw new Error("point: Point cannot be equal to 0, 0");return this.point.validate(),this}}var J1=Ht();const X1=$t(J1);class It{}It.getRandomBuffer=function(d){return Buffer.from(X1(d))};class wt extends Ce{constructor(e,t,i=null){super({bn:e,compressed:t}),i=i||Oe.Default.PrivKey,this.Constants=i}fromJSON(e){return this.fromHex(e),this}toJSON(){return this.toHex()}fromRandom(){let e,t,i;do e=It.getRandomBuffer(32),t=new Z().fromBuffer(e),i=t.lt(Ae.getN());while(!i);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 i;return e?i=Buffer.concat([Buffer.from([this.Constants.versionByteNum]),t,Buffer.from([1])]):i=Buffer.concat([Buffer.from([this.Constants.versionByteNum]),t]),i}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 Z().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(Ae.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 Bt.encode(this.toBuffer())}fromWif(e){return this.fromBuffer(Bt.decode(e))}static fromWif(e){return new this().fromWif(e)}toString(){return this.toWif()}fromString(e){return this.fromWif(e)}}wt.Mainnet=class extends wt{constructor(d,e){super(d,e,Oe.Mainnet.PrivKey)}};wt.Testnet=class extends wt{constructor(d,e){super(d,e,Oe.Testnet.PrivKey)}};class ce extends Ce{constructor(e,t,i,u,r){super({r:e,s:t,nHashType:i,recovery:u,compressed:r})}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,i=e.slice(0,1)[0]-27-4;if(i<0&&(t=!1,i=i+4),!(i===0||i===1||i===2||i===3))throw new Error("i must be 0, 1, 2, or 3");this.compressed=t,this.recovery=i;const u=e.slice(1);return this.fromRS(u),this}static fromCompact(e){return new this().fromCompact(e)}fromRS(e){const t=e.slice(0,32),i=e.slice(32,64);if(t.length!==32)throw new Error("r must be 32 bytes");if(i.length!==32||e.length>64)throw new Error("s must be 32 bytes");return this.r=new Z().fromBuffer(t),this.s=new Z().fromBuffer(i),this}static fromRS(e){return new this().fromRS(e)}fromDer(e,t){const i=ce.parseDer(e,t);return this.r=i.r,this.s=i.s,this}static fromDer(e,t){return new this().fromDer(e,t)}fromTxFormat(e){if(e.length===0)return this.r=new Z(1),this.s=new Z(1),this.nHashType=1,this;const t=e.readUInt8(e.length-1),i=e.slice(0,e.length-1);return this.fromDer(i,!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),!Buffer.isBuffer(e))throw new Error("DER formatted signature should be a buffer");const i=e[0];if(i!==48)throw new Error("Header byte should be 0x30");let u=e[1];const r=e.slice(2).length;if(t&&u!==r)throw new Error("LEngth byte should length of what follows");u=u<r?u:r;const s=e[2];if(s!==2)throw new Error("Integer byte for r should be 0x02");const a=e[3],o=e.slice(4,4+a),f=new Z().fromBuffer(o),n=e[4]===0;if(a!==o.length)throw new Error("LEngth of r incorrect");const c=e[4+a+0];if(c!==2)throw new Error("Integer byte for s should be 0x02");const h=e[4+a+1],l=e.slice(4+a+2,4+a+2+h),p=new Z().fromBuffer(l),b=e[4+a+2+2]===0;if(h!==l.length)throw new Error("LEngth of s incorrect");const y=4+a+2+h;if(u!==y-2)throw new Error("LEngth of signature incorrect");return{header:i,length:u,rheader:s,rlength:a,rneg:n,rbuf:o,r:f,sheader:c,slength:h,sneg:b,sbuf:l,s:p}}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 i=e[5+t];if(t+i+7!==e.length)return!1;const u=e.slice(4);if(e[2]!==2||t===0||u[0]&128||t>1&&u[0]===0&&!(u[1]&128))return!1;const r=e.slice(6+t);return!(e[6+t-2]!==2||i===0||r[0]&128||i>1&&r[0]===0&&!(r[1]&128))}hasLowS(){return!(this.s.lt(1)||this.s.gt(Z.fromBuffer(Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))))}isChronicle(){return(this.nHashType&ce.SIGHASH_CHRONICLE)!==0}hasDefinedHashType(){const e=this.nHashType&~(ce.SIGHASH_CHRONICLE|ce.SIGHASH_FORKID|ce.SIGHASH_ANYONECANPAY);return!(e<ce.SIGHASH_ALL||e>ce.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 i=e+27+4;t===!1&&(i=i-4);const u=Buffer.from([i]),r=this.r.toBuffer({size:32}),s=this.s.toBuffer({size:32});return Buffer.concat([u,r,s])}toRS(){return Buffer.concat([this.r.toBuffer({size:32}),this.s.toBuffer({size:32})])}toDer(){const e=this.r.toBuffer(),t=this.s.toBuffer(),i=e[0]&128,u=t[0]&128,r=i?Buffer.concat([Buffer.from([0]),e]):e,s=u?Buffer.concat([Buffer.from([0]),t]):t,a=2+r.length+2+s.length,o=r.length,f=s.length;return Buffer.concat([Buffer.from([48,a,2,o]),r,Buffer.from([2,f]),s])}toTxFormat(){const e=this.toDer(),t=Buffer.alloc(1);return t.writeUInt8(this.nHashType,0),Buffer.concat([e,t])}toString(){return this.toHex()}}ce.SIGHASH_ALL=1;ce.SIGHASH_NONE=2;ce.SIGHASH_SINGLE=3;ce.SIGHASH_CHRONICLE=32;ce.SIGHASH_FORKID=64;ce.SIGHASH_ANYONECANPAY=128;class Ee extends Ce{constructor(e=[]){super({chunks:e})}fromJSON(e){return this.fromString(e)}toJSON(){return this.toString()}fromBuffer(e){this.chunks=[];const t=new st(e);for(;!t.eof();){const i=t.readUInt8();let u=0,r=Buffer.from([]);if(i>0&&i<U.OP_PUSHDATA1)u=i,this.chunks.push({buf:t.read(u),len:u,opCodeNum:i});else if(i===U.OP_PUSHDATA1){try{u=t.readUInt8(),r=t.read(u)}catch{t.read()}this.chunks.push({buf:r,len:u,opCodeNum:i})}else if(i===U.OP_PUSHDATA2){try{u=t.readUInt16LE(),r=t.read(u)}catch{t.read()}this.chunks.push({buf:r,len:u,opCodeNum:i})}else if(i===U.OP_PUSHDATA4){try{u=t.readUInt32LE(),r=t.read(u)}catch{t.read()}this.chunks.push({buf:r,len:u,opCodeNum:i})}else this.chunks.push({opCodeNum:i})}return this}toBuffer(){const e=new ke;for(let t=0;t<this.chunks.length;t++){const i=this.chunks[t],u=i.opCodeNum;e.writeUInt8(u),i.buf&&(u<U.OP_PUSHDATA1?e.write(i.buf):u===U.OP_PUSHDATA1?(e.writeUInt8(i.len),e.write(i.buf)):u===U.OP_PUSHDATA2?(e.writeUInt16LE(i.len),e.write(i.buf)):u===U.OP_PUSHDATA4&&(e.writeUInt32LE(i.len),e.write(i.buf)))}return e.toBuffer()}fromString(e){if(this.chunks=[],e===""||e===void 0)return this;const t=e.split(" ");let i=0;for(;i<t.length;){const u=t[i];let r;try{r=new U().fromString(u).toNumber()}catch{}if(r===void 0)if(r=parseInt(u,10),r>0&&r<U.OP_PUSHDATA1)this.chunks.push({buf:Buffer.from(t[i+1].slice(2),"hex"),len:r,opCodeNum:r}),i=i+2;else if(r===0)this.chunks.push({opCodeNum:0}),i=i+1;else throw new Error("Invalid script");else if(r===U.OP_PUSHDATA1||r===U.OP_PUSHDATA2||r===U.OP_PUSHDATA4){if(t[i+2].slice(0,2)!=="0x")throw new Error("Pushdata data must start with 0x");this.chunks.push({buf:Buffer.from(t[i+2].slice(2),"hex"),len:parseInt(t[i+1],10),opCodeNum:r}),i=i+3}else this.chunks.push({opCodeNum:r}),i=i+1}return this}toString(e={noOp:!1}){let t="";for(let i=0;i<this.chunks.length;i++){const u=this.chunks[i],r=u.opCodeNum?.num?u.opCodeNum.num:u.opCodeNum;u.buf?((r===U.OP_PUSHDATA1||r===U.OP_PUSHDATA2||r===U.OP_PUSHDATA4)&&(t=e.noOp?t+" "+new U(r).toNoOpString():t+" "+new U(r).toString()),t=t+" "+u.len,t=t+" 0x"+u.buf.toString("hex")):U.str[r]!==void 0||U.noopstr[r]!==void 0?t=e.noOp?t+" "+new U(r).toNoOpString():t+" "+new U(r).toString():t=t+" 0x"+r.toString(16)}return t.substr(1)}fromBitcoindString(e){const t=new ke,i=e.split(" ");let u;for(u=0;u<i.length;u++){const s=i[u];if(s!=="")if(s[0]==="0"&&s[1]==="x"){const a=s.slice(2);t.write(Buffer.from(a,"hex"))}else if(s[0]==="'"){const a=s.slice(1,s.length-1),o=Buffer.from(a),f=new Ee().writeBuffer(o).toBuffer();t.write(f)}else if(U["OP_"+s]!==void 0){const a="OP_"+s,o=U[a];t.writeUInt8(o)}else if(typeof U[s]=="number"){const o=U[s];t.writeUInt8(o)}else{if(isNaN(parseInt(s,10)))throw new Error("Could not determine type of script value");{const a=new Z(s),f=new Ee().writeBn(a).toBuffer();t.write(f)}}}const r=t.toBuffer();return this.fromBuffer(r)}static fromBitcoindString(e){return new this().fromBitcoindString(e)}toBitcoindString(){let e="";for(let t=0;t<this.chunks.length;t++){const i=this.chunks[t];if(i.buf){const r=new Ee([i]).toBuffer().toString("hex");e=e+" 0x"+r}else if(U.str[i.opCodeNum]!==void 0){const u=new U(i.opCodeNum).toString();e=e+" "+u.slice(3)}else e=e+" 0x"+i.opCodeNum.toString(16)}return e.substr(1)}fromAsmString(e){this.chunks=[];const t=e.split(" ");let i=0;for(;i<t.length;){const u=t[i];let r,s;try{r=U.fromString(u),s=r.toNumber()}catch{r=void 0,s=void 0}if(u==="0")s=0,this.chunks.push({opCodeNum:s}),i=i+1;else if(u==="-1")s=U.OP_1NEGATE,this.chunks.push({opCodeNum:s}),i=i+1;else if(r===void 0){const a=t[i],o=Buffer.from(a,"hex");if(o.toString("hex")!==a)throw new Error("invalid hex string in script");const f=o.length;f>=0&&f<U.OP_PUSHDATA1?s=f:f<Math.pow(2,8)?s=U.OP_PUSHDATA1:f<Math.pow(2,16)?s=U.OP_PUSHDATA2:f<Math.pow(2,32)&&(s=U.OP_PUSHDATA4),this.chunks.push({buf:o,len:o.length,opCodeNum:s}),i=i+1}else this.chunks.push({opCodeNum:s}),i=i+1}return this}static fromAsmString(e){return new this().fromAsmString(e)}toAsmString(e={noOp:!1}){let t="";for(let i=0;i<this.chunks.length;i++){const u=this.chunks[i];t+=this._chunkToString(u,e)}return t.substr(1)}_chunkToString(e,t={noOp:!1}){const i=e.opCodeNum;let u="";if(e.buf)e.len>0&&(u=u+" "+e.buf.toString("hex"));else if(typeof U.str[i]<"u")i===0?u=u+" 0":i===79?u=u+" -1":u=t.noOp?u+" "+new U(i).toNoOpString():u+" "+new U(i).toString();else{let r=i.toString(16);r.length%2!==0&&(r="0"+r),u=u+" "+r}return u}fromOpReturnData(e){return this.writeOpCode(U.OP_RETURN),this.writeBuffer(e),this}static fromOpReturnData(e){return new this().fromOpReturnData(e)}fromSafeData(e){return this.writeOpCode(U.OP_FALSE),this.writeOpCode(U.OP_RETURN),this.writeBuffer(e),this}static fromSafeData(e){return new this().fromSafeData(e)}fromSafeDataArray(e){this.writeOpCode(U.OP_FALSE),this.writeOpCode(U.OP_RETURN);for(const t in e){const i=e[t];this.writeBuffer(i)}return this}static fromSafeDataArray(e){return new this().fromSafeDataArray(e)}getData(){if(this.isSafeDataOut())return this.chunks.slice(2).map(i=>i.buf);if(this.isOpReturn())return this.chunks.slice(1).map(i=>i.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(U.OP_DUP),this.writeOpCode(U.OP_HASH160),this.writeBuffer(e),this.writeOpCode(U.OP_EQUALVERIFY),this.writeOpCode(U.OP_CHECKSIG),this}static fromPubKeyHash(e){return new this().fromPubKeyHash(e)}static sortPubKeys(e){return e.slice().sort((t,i)=>{const u=t.toBuffer(),r=i.toBuffer(),s=Math.max(u.length,r.length);for(let a=0;a<s;a++){if(u[a]===void 0)return-1;if(r[a]===void 0)return 1;if(u[a]<r[a])return-1;if(u[a]>r[a])return 1}return 0})}fromPubKeys(e,t,i=!0){if(typeof e!="number")throw new Error("m must be a number");i===!0&&(t=Ee.sortPubKeys(t)),this.writeOpCode(e+U.OP_1-1);for(const u in t)this.writeBuffer(t[u].toBuffer());return this.writeOpCode(t.length+U.OP_1-1),this.writeOpCode(U.OP_CHECKMULTISIG),this}static fromPubKeys(e,t,i){return new this().fromPubKeys(e,t,i)}removeCodeseparators(){const e=[];for(let t=0;t<this.chunks.length;t++)this.chunks[t].opCodeNum!==U.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>U.OP_16)return!1;return!0}isNonSpendable(){const e=this.chunks[0]&&this.chunks[0].opCodeNum===U.OP_FALSE,t=this.chunks[1]&&this.chunks[1].opCodeNum===U.OP_RETURN;return!!e&&!!t}isOpReturn(){return!!(this.chunks[0]&&this.chunks[0].opCodeNum===U.OP_RETURN&&this.chunks.filter(e=>Buffer.isBuffer(e.buf)).length===this.chunks.slice(1).length)}isSafeDataOut(){if(this.chunks.length<2||this.chunks[0].opCodeNum!==U.OP_FALSE)return!1;const e=this.chunks.slice(1);return new Ee(e).isOpReturn()}isPubKeyHashOut(){return!!(this.chunks[0]&&this.chunks[0].opCodeNum===U.OP_DUP&&this.chunks[1]&&this.chunks[1].opCodeNum===U.OP_HASH160&&this.chunks[2].buf&&this.chunks[3]&&this.chunks[3].opCodeNum===U.OP_EQUALVERIFY&&this.chunks[4]&&this.chunks[4].opCodeNum===U.OP_CHECKSIG)}isPubKeyHashIn(){return!!(this.chunks.length===2&&(this.chunks[0].buf||this.chunks[0].opCodeNum===U.OP_0)&&(this.chunks[1].buf||this.chunks[1].opCodeNum===U.OP_0))}isScriptHashOut(){const e=this.toBuffer();return e.length===23&&e[0]===U.OP_HASH160&&e[1]===20&&e[22]===U.OP_EQUAL}isScriptHashIn(){if(!this.isPushOnly())return!1;const e=this.chunks[this.chunks.length-1];if(!e||!e.buf)return!1;try{new Ee().fromBuffer(e.buf)}catch{return!1}return!0}isMultiSigOut(){if(this.chunks.length<3)return!1;const e=this.chunks[0].opCodeNum-U.OP_1+1;if(!(e>=1&&e<=16)||!this.chunks.slice(1,this.chunks.length-2).every(u=>{try{const r=u.buf;return new qe().fromDer(r).validate(),!0}catch{return!1}}))return!1;const i=this.chunks[this.chunks.length-2].opCodeNum-U.OP_1+1;return!(!(i>=e&&i<=16)||!this.chunks[1+i+1]||this.chunks[1+i+1].opCodeNum!==U.OP_CHECKMULTISIG)}isMultiSigIn(){if(!this.chunks[0]||this.chunks[0].opCodeNum!==U.OP_0)return!1;const e=this.chunks.slice(1);return e.length<1?!1:e.every(t=>Buffer.isBuffer(t.buf)&&ce.IsTxDer(t.buf))}findAndDelete(e){const t=e.toBuffer();if(t.length===0)return this;let i=0;for(;i<this.chunks.length;){const u=new Ee([this.chunks[i]]);Nt(t,u.toBuffer())?this.chunks.splice(i,1):i++}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 Ee().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)===U.OP_0)this.chunks.push({opCodeNum:U.OP_0});else if(e.cmp(-1)===0)this.chunks.push({opCodeNum:U.OP_1NEGATE});else if(e.cmp(1)>=0&&e.cmp(16)<=0)this.chunks.push({opCodeNum:e.toNumber()+U.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 Z().fromNumber(e)),this}static writeNumber(e){return new this().writeNumber(e)}setChunkBn(e,t){return this.chunks[e]=new Ee().writeBn(t).chunks[0],this}writeBuffer(e){e=Buffer.from(e);let t;const i=e.length;if(e.length>0&&e.length<U.OP_PUSHDATA1)t=e.length;else if(e.length===0)t=U.OP_0;else if(e.length<Math.pow(2,8))t=U.OP_PUSHDATA1;else if(e.length<Math.pow(2,16))t=U.OP_PUSHDATA2;else if(e.length<Math.pow(2,32))t=U.OP_PUSHDATA4;else throw new Error("You can't push that much data");return this.chunks.push({buf:e,len:i,opCodeNum:t}),this}static writeBuffer(e){return new this().writeBuffer(e)}setChunkBuffer(e,t){return this.chunks[e]=new Ee().writeBuffer(t).chunks[0],this}checkMinimalPush(e){const t=this.chunks[e],i=t.buf,u=t.opCodeNum;return i?i.length===0?u===U.OP_0:i.length===1&&i[0]>=1&&i[0]<=16?u===U.OP_1+(i[0]-1):i.length===1&&i[0]===129?u===U.OP_1NEGATE:i.length<=75?u===i.length:i.length<=255?u===U.OP_PUSHDATA1:i.length<=65535?u===U.OP_PUSHDATA2:!0:!0}}class gt extends Ce{constructor(e,t,i=null){super({versionByteNum:e,hashBuf:t}),i=i||Oe.Default.Address,this.Constants=i}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=ae.sha256Ripemd160(e.toBuffer());return this.fromPubKeyHashBuf(t)}static fromPubKey(e){return new this().fromPubKey(e)}async asyncFromPubKey(e){const t=[e],i=await le.asyncObjectMethod(this,"fromPubKey",t);return this.fromFastBuffer(i.resbuf)}static asyncFromPubKey(e){return new this().asyncFromPubKey(e)}fromPrivKey(e){const t=new qe().fromPrivKey(e),i=ae.sha256Ripemd160(t.toBuffer());return this.fromPubKeyHashBuf(i)}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){const t=[e],i=await le.asyncObjectMethod(this,"fromPrivKey",t);return this.fromFastBuffer(i.resbuf)}static asyncFromPrivKey(e){return new this().fromPrivKey(e)}fromRandom(){const e=new wt().fromRandom();return this.fromPrivKey(e)}static fromRandom(){return new this().fromRandom()}async asyncFromRandom(){const e=[],t=await le.asyncObjectMethod(this,"fromRandom",e);return this.fromFastBuffer(t.resbuf)}static asyncFromRandom(){return new this().fromRandom()}fromString(e){const t=Bt.decode(e);return this.fromBuffer(t)}async asyncFromString(e){const t=[e],i=await le.asyncObjectMethod(this,"fromString",t);return this.fromFastBuffer(i.resbuf)}static asyncFromString(e){return new this().asyncFromString(e)}static isValid(e){let t;try{t=new gt().fromString(e)}catch{return!1}return t.isValid()}isValid(){try{return this.validate(),!0}catch{return!1}}toTxOutScript(){const e=new Ee;return e.writeOpCode(U.OP_DUP),e.writeOpCode(U.OP_HASH160),e.writeBuffer(this.hashBuf),e.writeOpCode(U.OP_EQUALVERIFY),e.writeOpCode(U.OP_CHECKSIG),e}fromTxInScript(e){const t=ae.sha256Ripemd160(e.chunks[1].buf||Buffer.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=Buffer.from([this.versionByteNum]);return Buffer.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=Buffer.from(e.hashBuf,"hex")),typeof e.versionByteNum<"u"&&(this.versionByteNum=e.versionByteNum),this}toString(){return Bt.encode(this.toBuffer())}async asyncToString(){const e=[],t=await le.asyncObjectMethod(this,"toString",e);return JSON.parse(t.resbuf.toString())}validate(){if(!Buffer.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}}gt.Mainnet=class extends gt{constructor(d,e){super(d,e,Oe.Mainnet.Address)}};gt.Testnet=class extends gt{constructor(d,e){super(d,e,Oe.Testnet.Address)}};class fr extends Ce{constructor(e,t,i,u,r,s,a,o=null,f=wt){super({versionBytesNum:e,depth:t,parentFingerPrint:i,childIndex:u,chainCode:r,privKey:s,pubKey:a}),o=o||Oe.Default.Bip32,this.Constants=o,this.PrivKey=f}fromRandom(){return this.versionBytesNum=this.Constants.privKey,this.depth=0,this.parentFingerPrint=Buffer.from([0,0,0,0]),this.childIndex=0,this.chainCode=It.getRandomBuffer(32),this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new qe().fromPrivKey(this.privKey),this}static fromRandom(){return new this().fromRandom()}fromString(e){return this.fromBuffer(Bt.decode(e))}async asyncFromString(e){const t=[e],i=await le.asyncObjectMethod(this,"fromString",t);return this.fromFastBuffer(i.resbuf)}fromSeed(e){if(!Buffer.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=ae.sha512Hmac(e,Buffer.from("Bitcoin seed"));return this.depth=0,this.parentFingerPrint=Buffer.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(Z().fromBuffer(t.slice(0,32))),this.pubKey=new qe().fromPrivKey(this.privKey),this}static fromSeed(e){return new this().fromSeed(e)}async asyncFromSeed(e){const t=await le.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),i=this.versionBytesNum===this.Constants.privKey,u=this.versionBytesNum===this.Constants.pubKey;if(i&&t[0]===0)this.privKey=new this.PrivKey().fromBn(Z().fromBuffer(t.slice(1,33))),this.pubKey=new qe().fromPrivKey(this.privKey);else if(u&&(t[0]===2||t[0]===3))this.pubKey=new qe().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),i=this.versionBytesNum===this.Constants.privKey,u=this.versionBytesNum===this.Constants.pubKey;if(i&&t[0]===0&&e.length===78)this.privKey=new this.PrivKey().fromBn(Z().fromBuffer(t.slice(1,33))),this.pubKey=new qe().fromPrivKey(this.privKey);else if(u&&e.length===111)this.pubKey=new qe().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 i=this;for(const u in t){const r=t[u];if(u==="0"){if(r!=="m")throw new Error("invalid path");continue}if(parseInt(r.replace("'",""),10).toString()!==r.replace("'",""))throw new Error("invalid path");const s=r.length>1&&r[r.length-1]==="'";let a=parseInt(s?r.slice(0,r.length-1):r,10)&2147483647;s&&(a+=2147483648),i=i.deriveChild(a)}return i}async asyncDerive(e){const t=await le.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=Buffer.from(t);const i=(e&2147483648)!==0,u=this.versionBytesNum===this.Constants.privKey;if(i&&(!this.privKey||!u))throw new Error("Cannot do private key derivation without private key");let r=null;if(this.privKey){let a=null;i?a=Buffer.concat([Buffer.from([0]),this.privKey.bn.toBuffer({size:32}),t]):a=Buffer.concat([this.pubKey.toBuffer({size:32}),t]);const o=ae.sha512Hmac(a,this.chainCode),f=Z().fromBuffer(o.slice(0,32),{size:32}),n=o.slice(32,64),c=f.add(this.privKey.bn).mod(Ae.getN());r=new this.constructor,r.chainCode=n,r.privKey=new this.PrivKey().fromBn(c),r.pubKey=new qe().fromPrivKey(r.privKey)}else{const a=Buffer.concat([this.pubKey.toBuffer(),t]),o=ae.sha512Hmac(a,this.chainCode),f=Z().fromBuffer(o.slice(0,32)),n=o.slice(32,64),c=Ae.getG().mul(f),h=this.pubKey.point,l=c.add(h),p=new qe;p.point=l,r=new this.constructor,r.chainCode=n,r.pubKey=p}r.childIndex=e;const s=ae.sha256Ripemd160(this.pubKey.toBuffer());return r.parentFingerPrint=s.slice(0,4),r.versionBytesNum=this.versionBytesNum,r.depth=this.depth+1,r}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 ke().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 ke().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 Buffer.alloc(0);const e=this.versionBytesNum===this.Constants.privKey,t=this.versionBytesNum===this.Constants.pubKey;if(e)return new ke().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 ke().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 Bt.encode(this.toBuffer())}async asyncToString(){const e=await le.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}}fr.Mainnet=class extends fr{constructor(d,e,t,i,u,r,s){super(d,e,t,i,u,r,s,Oe.Mainnet.Bip32,wt.Mainnet)}};fr.Testnet=class extends fr{constructor(d,e,t,i,u,r,s){super(d,e,t,i,u,r,s,Oe.Testnet.Bip32,wt.Testnet)}};const Fr=["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"];Fr.space=" ";const Ur=["あいこくしん","あいさつ","あいだ","あおぞら","あかちゃん","あきる","あけがた","あける","あこがれる","あさい","あさひ","あしあと","あじわう","あずかる","あずき","あそぶ","あたえる","あたためる","あたりまえ","あたる","あつい","あつかう","あっしゅく","あつまり","あつめる","あてな","あてはまる","あひる","あぶら","あぶる","あふれる","あまい","あまど","あまやかす","あまり","あみもの","あめりか","あやまる","あゆむ","あらいぐま","あらし","あらすじ","あらためる","あらゆる","あらわす","ありがとう","あわせる","あわてる","あんい","あんがい","あんこ","あんぜん","あんてい","あんない","あんまり","いいだす","いおん","いがい","いがく","いきおい","いきなり","いきもの","いきる","いくじ","いくぶん","いけばな","いけん","いこう","いこく","いこつ","いさましい","いさん","いしき","いじゅう","いじょう","いじわる","いずみ","いずれ","いせい","いせえび","いせかい","いせき","いぜん","いそうろう","いそがしい","いだい","いだく","いたずら","いたみ","いたりあ","いちおう","いちじ","いちど","いちば","いちぶ","いちりゅう","いつか","いっしゅん","いっせい","いっそう","いったん","いっち","いってい","いっぽう","いてざ","いてん","いどう","いとこ","いない","いなか","いねむり","いのち","いのる","いはつ","いばる","いはん","いびき","いひん","いふく","いへん","いほう","いみん","いもうと","いもたれ","いもり","いやがる","いやす","いよかん","いよく","いらい","いらすと","いりぐち","いりょう","いれい","いれもの","いれる","いろえんぴつ","いわい","いわう","いわかん","いわば","いわゆる","いんげんまめ","いんさつ","いんしょう","いんよう","うえき","うえる","うおざ","うがい","うかぶ","うかべる","うきわ","うくらいな","うくれれ","うけたまわる","うけつけ","うけとる","うけもつ","うける","うごかす","うごく","うこん","うさぎ","うしなう","うしろがみ","うすい","うすぎ","うすぐらい","うすめる","うせつ","うちあわせ","うちがわ","うちき","うちゅう","うっかり","うつくしい","うったえる","うつる","うどん","うなぎ","うなじ","うなずく","うなる","うねる","うのう","うぶげ","うぶごえ","うまれる","うめる","うもう","うやまう","うよく","うらがえす","うらぐち","うらない","うりあげ","うりきれ","うるさい","うれしい","うれゆき","うれる","うろこ","うわき","うわさ","うんこう","うんちん","うんてん","うんどう","えいえん","えいが","えいきょう","えいご","えいせい","えいぶん","えいよう","えいわ","えおり","えがお","えがく","えきたい","えくせる","えしゃく","えすて","えつらん","えのぐ","えほうまき","えほん","えまき","えもじ","えもの","えらい","えらぶ","えりあ","えんえん","えんかい","えんぎ","えんげき","えんしゅう","えんぜつ","えんそく","えんちょう","えんとつ","おいかける","おいこす","おいしい","おいつく","おうえん","おうさま","おうじ","おうせつ","おうたい","おうふく","おうべい","おうよう","おえる","おおい","おおう","おおどおり","おおや","おおよそ","おかえり","おかず","おがむ","おかわり","おぎなう","おきる","おくさま","おくじょう","おくりがな","おくる","おくれる","おこす","おこなう","おこる","おさえる","おさない","おさめる","おしいれ","おしえる","おじぎ","おじさん","おしゃれ","おそらく","おそわる","おたがい","おたく","おだやか","おちつく","おっと","おつり","おでかけ","おとしもの","おとなしい","おどり","おどろかす","おばさん","おまいり","おめでとう","おもいで","おもう","おもたい","おもちゃ","おやつ","おやゆび","およぼす","おらんだ","おろす","おんがく","おんけい","おんしゃ","おんせん","おんだん","おんちゅう","おんどけい","かあつ","かいが","がいき","がいけん","がいこう","かいさつ","かいしゃ","かいすいよく","かいぜん","かいぞうど","かいつう","かいてん","かいとう","かいふく","がいへき","かいほう","かいよう","がいらい","かいわ","かえる","かおり","かかえる","かがく","かがし","かがみ","かくご","かくとく","かざる","がぞう","かたい","かたち","がちょう","がっきゅう","がっこう","がっさん","がっしょう","かなざわし","かのう","がはく","かぶか","かほう","かほご","かまう","かまぼこ","かめれおん","かゆい","かようび","からい","かるい","かろう","かわく","かわら","がんか","かんけい","かんこう","かんしゃ","かんそう","かんたん","かんち","がんばる","きあい","きあつ","きいろ","ぎいん","きうい","きうん","きえる","きおう","きおく","きおち","きおん","きかい","きかく","きかんしゃ","ききて","きくばり","きくらげ","きけんせい","きこう","きこえる","きこく","きさい","きさく","きさま","きさらぎ","ぎじかがく","ぎしき","ぎじたいけん","ぎじにってい","ぎじゅつしゃ","きすう","きせい","きせき","きせつ","きそう","きぞく","きぞん","きたえる","きちょう","きつえん","ぎっちり","きつつき","きつね","きてい","きどう","きどく","きない","きなが","きなこ","きぬごし","きねん","きのう","きのした","きはく","きびしい","きひん","きふく","きぶん","きぼう","きほん","きまる","きみつ","きむずかしい","きめる","きもだめし","きもち","きもの","きゃく","きやく","ぎゅうにく","きよう","きょうりゅう","きらい","きらく","きりん","きれい","きれつ","きろく","ぎろん","きわめる","ぎんいろ","きんかくじ","きんじょ","きんようび","ぐあい","くいず","くうかん","くうき","くうぐん","くうこう","ぐうせい","くうそう","ぐうたら","くうふく","くうぼ","くかん","くきょう","くげん","ぐこう","くさい","くさき","くさばな","くさる","くしゃみ","くしょう","くすのき","くすりゆび","くせげ","くせん","ぐたいてき","くださる","くたびれる","くちこみ","くちさき","くつした","ぐっすり","くつろぐ","くとうてん","くどく","くなん","くねくね","くのう","くふう","くみあわせ","くみたてる","くめる","くやくしょ","くらす","くらべる","くるま","くれる","くろう","くわしい","ぐんかん","ぐんしょく","ぐんたい","ぐんて","けあな","けいかく","けいけん","けいこ","けいさつ","げいじゅつ","けいたい","げいのうじん","けいれき","けいろ","けおとす","けおりもの","げきか","げきげん","げきだん","げきちん","げきとつ","げきは","げきやく","げこう","げこくじょう","げざい","けさき","げざん","けしき","けしごむ","けしょう","げすと","けたば","けちゃっぷ","けちらす","けつあつ","けつい","けつえき","けっこん","けつじょ","けっせき","けってい","けつまつ","げつようび","げつれい","けつろん","げどく","けとばす","けとる","けなげ","けなす","けなみ","けぬき","げねつ","けねん","けはい","げひん","けぶかい","げぼく","けまり","けみかる","けむし","けむり","けもの","けらい","けろけろ","けわしい","けんい","けんえつ","けんお","けんか","げんき","けんげん","けんこう","けんさく","けんしゅう","けんすう","げんそう","けんちく","けんてい","けんとう","けんない","けんにん","げんぶつ","けんま","けんみん","けんめい","けんらん","けんり","こあくま","こいぬ","こいびと","ごうい","こうえん","こうおん","こうかん","ごうきゅう","ごうけい","こうこう","こうさい","こうじ","こうすい","ごうせい","こうそく","こうたい","こうちゃ","こうつう","こうてい","こうどう","こうない","こうはい","ごうほう","ごうまん","こうもく","こうりつ","こえる","こおり","ごかい","ごがつ","ごかん","こくご","こくさい","こくとう","こくない","こくはく","こぐま","こけい","こける","ここのか","こころ","こさめ","こしつ","こすう","こせい","こせき","こぜん","こそだて","こたい","こたえる","こたつ","こちょう","こっか","こつこつ","こつばん","こつぶ","こてい","こてん","ことがら","ことし","ことば","ことり","こなごな","こねこね","このまま","このみ","このよ","ごはん","こひつじ","こふう","こふん","こぼれる","ごまあぶら","こまかい","ごますり","こまつな","こまる","こむぎこ","こもじ","こもち","こもの","こもん","こやく","こやま","こゆう","こゆび","こよい","こよう","こりる","これくしょん","ころっけ","こわもて","こわれる","こんいん","こんかい","こんき","こんしゅう","こんすい","こんだて","こんとん","こんなん","こんびに","こんぽん","こんまけ","こんや","こんれい","こんわく","ざいえき","さいかい","さいきん","ざいげん","ざいこ","さいしょ","さいせい","ざいたく","ざいちゅう","さいてき","ざいりょう","さうな","さかいし","さがす","さかな","さかみち","さがる","さぎょう","さくし","さくひん","さくら","さこく","さこつ","さずかる","ざせき","さたん","さつえい","ざつおん","ざっか","ざつがく","さっきょく","ざっし","さつじん","ざっそう","さつたば","さつまいも","さてい","さといも","さとう","さとおや","さとし","さとる","さのう","さばく","さびしい","さべつ","さほう","さほど","さます","さみしい","さみだれ","さむけ","さめる","さやえんどう","さゆう","さよう","さよく","さらだ","ざるそば","さわやか","さわる","さんいん","さんか","さんきゃく","さんこう","さんさい","ざんしょ","さんすう","さんせい","さんそ","さんち","さんま","さんみ","さんらん","しあい","しあげ","しあさって","しあわせ","しいく","しいん","しうち","しえい","しおけ","しかい","しかく","じかん","しごと","しすう","じだい","したうけ","したぎ","したて","したみ","しちょう","しちりん","しっかり","しつじ","しつもん","してい","してき","してつ","じてん","じどう","しなぎれ","しなもの","しなん","しねま","しねん","しのぐ","しのぶ","しはい","しばかり","しはつ","しはらい","しはん","しひょう","しふく","じぶん","しへい","しほう","しほん","しまう","しまる","しみん","しむける","じむしょ","しめい","しめる","しもん","しゃいん","しゃうん","しゃおん","じゃがいも","しやくしょ","しゃくほう","しゃけん","しゃこ","しゃざい","しゃしん","しゃせん","しゃそう","しゃたい","しゃちょう","しゃっきん","じゃま","しゃりん","しゃれい","じゆう","じゅうしょ","しゅくはく","じゅしん","しゅっせき","しゅみ","しゅらば","じゅんばん","しょうかい","しょくたく","しょっけん","しょどう","しょもつ","しらせる","しらべる","しんか","しんこう","じんじゃ","しんせいじ","しんちく","しんりん","すあげ","すあし","すあな","ずあん","すいえい","すいか","すいとう","ずいぶん","すいようび","すうがく","すうじつ","すうせん","すおどり","すきま","すくう","すくない","すける","すごい","すこし","ずさん","すずしい","すすむ","すすめる","すっかり","ずっしり","ずっと","すてき","すてる","すねる","すのこ","すはだ","すばらしい","ずひょう","ずぶぬれ","すぶり","すふれ","すべて","すべる","ずほう","すぼん","すまい","すめし","すもう","すやき","すらすら","するめ","すれちがう","すろっと","すわる","すんぜん","すんぽう","せあぶら","せいかつ","せいげん","せいじ","せいよう","せおう","せかいかん","せきにん","せきむ","せきゆ","せきらんうん","せけん","せこう","せすじ","せたい","せたけ","せっかく","せっきゃく","ぜっく","せっけん","せっこつ","せっさたくま","せつぞく","せつだん","せつでん","せっぱん","せつび","せつぶん","せつめい","せつりつ","せなか","せのび","せはば","せびろ","せぼね","せまい","せまる","せめる","せもたれ","せりふ","ぜんあく","せんい","せんえい","せんか","せんきょ","せんく","せんげん","ぜんご","せんさい","せんしゅ","せんすい","せんせい","せんぞ","せんたく","せんちょう","せんてい","せんとう","せんぬき","せんねん","せんぱい","ぜんぶ","ぜんぽう","せんむ","せんめんじょ","せんもん","せんやく","せんゆう","せんよう","ぜんら","ぜんりゃく","せんれい","せんろ","そあく","そいとげる","そいね","そうがんきょう","そうき","そうご","そうしん","そうだん","そうなん","そうび","そうめん","そうり","そえもの","そえん","そがい","そげき","そこう","そこそこ","そざい","そしな","そせい","そせん","そそぐ","そだてる","そつう","そつえん","そっかん","そつぎょう","そっけつ","そっこう","そっせん","そっと","そとがわ","そとづら","そなえる","そなた","そふぼ","そぼく","そぼろ","そまつ","そまる","そむく","そむりえ","そめる","そもそも","そよかぜ","そらまめ","そろう","そんかい","そんけい","そんざい","そんしつ","そんぞく","そんちょう","ぞんび","ぞんぶん","そんみん","たあい","たいいん","たいうん","たいえき","たいおう","だいがく","たいき","たいぐう","たいけん","たいこ","たいざい","だいじょうぶ","だいすき","たいせつ","たいそう","だいたい","たいちょう","たいてい","だいどころ","たいない","たいねつ","たいのう","たいはん","だいひょう","たいふう","たいへん","たいほ","たいまつばな","たいみんぐ","たいむ","たいめん","たいやき","たいよう","たいら","たいりょく","たいる","たいわん","たうえ","たえる","たおす","たおる","たおれる","たかい","たかね","たきび","たくさん","たこく","たこやき","たさい","たしざん","だじゃれ","たすける","たずさわる","たそがれ","たたかう","たたく","ただしい","たたみ","たちばな","だっかい","だっきゃく","だっこ","だっしゅつ","だったい","たてる","たとえる","たなばた","たにん","たぬき","たのしみ","たはつ","たぶん","たべる","たぼう","たまご","たまる","だむる","ためいき","ためす","ためる","たもつ","たやすい","たよる","たらす","たりきほんがん","たりょう","たりる","たると","たれる","たれんと","たろっと","たわむれる","だんあつ","たんい","たんおん","たんか","たんき","たんけん","たんご","たんさん","たんじょうび","だんせい","たんそく","たんたい","だんち","たんてい","たんとう","だんな","たんにん","だんねつ","たんのう","たんぴん","だんぼう","たんまつ","たんめい","だんれつ","だんろ","だんわ","ちあい","ちあん","ちいき","ちいさい","ちえん","ちかい","ちから","ちきゅう","ちきん","ちけいず","ちけん","ちこく","ちさい","ちしき","ちしりょう","ちせい","ちそう","ちたい","ちたん","ちちおや","ちつじょ","ちてき","ちてん","ちぬき","ちぬり","ちのう","ちひょう","ちへいせん","ちほう","ちまた","ちみつ","ちみどろ","ちめいど","ちゃんこなべ","ちゅうい","ちゆりょく","ちょうし","ちょさくけん","ちらし","ちらみ","ちりがみ","ちりょう","ちるど","ちわわ","ちんたい","ちんもく","ついか","ついたち","つうか","つうじょう","つうはん","つうわ","つかう","つかれる","つくね","つくる","つけね","つける","つごう","つたえる","つづく","つつじ","つつむ","つとめる","つながる","つなみ","つねづね","つのる","つぶす","つまらない","つまる","つみき","つめたい","つもり","つもる","つよい","つるぼ","つるみく","つわもの","つわり","てあし","てあて","てあみ","ていおん","ていか","ていき","ていけい","ていこく","ていさつ","ていし","ていせい","ていたい","ていど","ていねい","ていひょう","ていへん","ていぼう","てうち","ておくれ","てきとう","てくび","でこぼこ","てさぎょう","てさげ","てすり","てそう","てちがい","てちょう","てつがく","てつづき","でっぱ","てつぼう","てつや","でぬかえ","てぬき","てぬぐい","てのひら","てはい","てぶくろ","てふだ","てほどき","てほん","てまえ","てまきずし","てみじか","てみやげ","てらす","てれび","てわけ","てわたし","でんあつ","てんいん","てんかい","てんき","てんぐ","てんけん","てんごく","てんさい","てんし","てんすう","でんち","てんてき","てんとう","てんない","てんぷら","てんぼうだい","てんめつ","てんらんかい","でんりょく","でんわ","どあい","といれ","どうかん","とうきゅう","どうぐ","とうし","とうむぎ","とおい","とおか","とおく","とおす","とおる","とかい","とかす","ときおり","ときどき","とくい","とくしゅう","とくてん","とくに","とくべつ","とけい","とける","とこや","とさか","としょかん","とそう","とたん","とちゅう","とっきゅう","とっくん","とつぜん","とつにゅう","とどける","ととのえる","とない","となえる","となり","とのさま","とばす","どぶがわ","とほう","とまる","とめる","ともだち","ともる","どようび","とらえる","とんかつ","どんぶり","ないかく","ないこう","ないしょ","ないす","ないせん","ないそう","なおす","ながい","なくす","なげる","なこうど","なさけ","なたでここ","なっとう","なつやすみ","ななおし","なにごと","なにもの","なにわ","なのか","なふだ","なまいき","なまえ","なまみ","なみだ","なめらか","なめる","なやむ","ならう","ならび","ならぶ","なれる","なわとび","なわばり","にあう","にいがた","にうけ","におい","にかい","にがて","にきび","にくしみ","にくまん","にげる","にさんかたんそ","にしき","にせもの","にちじょう","にちようび","にっか","にっき","にっけい","にっこう","にっさん","にっしょく","にっすう","にっせき","にってい","になう","にほん","にまめ","にもつ","にやり","にゅういん","にりんしゃ","にわとり","にんい","にんか","にんき","にんげん","にんしき","にんずう","にんそう","にんたい","にんち","にんてい","にんにく","にんぷ","にんまり","にんむ","にんめい","にんよう","ぬいくぎ","ぬかす","ぬぐいとる","ぬぐう","ぬくもり","ぬすむ","ぬまえび","ぬめり","ぬらす","ぬんちゃく","ねあげ","ねいき","ねいる","ねいろ","ねぐせ","ねくたい","ねくら","ねこぜ","ねこむ","ねさげ","ねすごす","ねそべる","ねだん","ねつい","ねっしん","ねつぞう","ねったいぎょ","ねぶそく","ねふだ","ねぼう","ねほりはほり","ねまき","ねまわし","ねみみ","ねむい","ねむたい","ねもと","ねらう","ねわざ","ねんいり","ねんおし","ねんかん","ねんきん","ねんぐ","ねんざ","ねんし","ねんちゃく","ねんど","ねんぴ","ねんぶつ","ねんまつ","ねんりょう","ねんれい","のいず","のおづま","のがす","のきなみ","のこぎり","のこす","のこる","のせる","のぞく","のぞむ","のたまう","のちほど","のっく","のばす","のはら","のべる","のぼる","のみもの","のやま","のらいぬ","のらねこ","のりもの","のりゆき","のれん","のんき","ばあい","はあく","ばあさん","ばいか","ばいく","はいけん","はいご","はいしん","はいすい","はいせん","はいそう","はいち","ばいばい","はいれつ","はえる","はおる","はかい","ばかり","はかる","はくしゅ","はけん","はこぶ","はさみ","はさん","はしご","ばしょ","はしる","はせる","ぱそこん","はそん","はたん","はちみつ","はつおん","はっかく","はづき","はっきり","はっくつ","はっけん","はっこう","はっさん","はっしん","はったつ","はっちゅう","はってん","はっぴょう","はっぽう","はなす","はなび","はにかむ","はぶらし","はみがき","はむかう","はめつ","はやい","はやし","はらう","はろうぃん","はわい","はんい","はんえい","はんおん","はんかく","はんきょう","ばんぐみ","はんこ","はんしゃ","はんすう","はんだん","ぱんち","ぱんつ","はんてい","はんとし","はんのう","はんぱ","はんぶん","はんぺん","はんぼうき","はんめい","はんらん","はんろん","ひいき","ひうん","ひえる","ひかく","ひかり","ひかる","ひかん","ひくい","ひけつ","ひこうき","ひこく","ひさい","ひさしぶり","ひさん","びじゅつかん","ひしょ","ひそか","ひそむ","ひたむき","ひだり","ひたる","ひつぎ","ひっこし","ひっし","ひつじゅひん","ひっす","ひつぜん","ぴったり","ぴっちり","ひつよう","ひてい","ひとごみ","ひなまつり","ひなん","ひねる","ひはん","ひびく","ひひょう","ひほう","ひまわり","ひまん","ひみつ","ひめい","ひめじし","ひやけ","ひやす","ひよう","びょうき","ひらがな","ひらく","ひりつ","ひりょう","ひるま","ひるやすみ","ひれい","ひろい","ひろう","ひろき","ひろゆき","ひんかく","ひんけつ","ひんこん","ひんしゅ","ひんそう","ぴんち","ひんぱん","びんぼう","ふあん","ふいうち","ふうけい","ふうせん","ぷうたろう","ふうとう","ふうふ","ふえる","ふおん","ふかい","ふきん","ふくざつ","ふくぶくろ","ふこう","ふさい","ふしぎ","ふじみ","ふすま","ふせい","ふせぐ","ふそく","ぶたにく","ふたん","ふちょう","ふつう","ふつか","ふっかつ","ふっき","ふっこく","ぶどう","ふとる","ふとん","ふのう","ふはい","ふひょう","ふへん","ふまん","ふみん","ふめつ","ふめん","ふよう","ふりこ","ふりる","ふるい","ふんいき","ぶんがく","ぶんぐ","ふんしつ","ぶんせき","ふんそう","ぶんぽう","へいあん","へいおん","へいがい","へいき","へいげん","へいこう","へいさ","へいしゃ","へいせつ","へいそ","へいたく","へいてん","へいねつ","へいわ","へきが","へこむ","べにいろ","べにしょうが","へらす","へんかん","べんきょう","べんごし","へんさい","へんたい","べんり","ほあん","ほいく","ぼうぎょ","ほうこく","ほうそう","ほうほう","ほうもん","ほうりつ","ほえる","ほおん","ほかん","ほきょう","ぼきん","ほくろ","ほけつ","ほけん","ほこう","ほこる","ほしい","ほしつ","ほしゅ","ほしょう","ほせい","ほそい","ほそく","ほたて","ほたる","ぽちぶくろ","ほっきょく","ほっさ","ほったん","ほとんど","ほめる","ほんい","ほんき","ほんけ","ほんしつ","ほんやく","まいにち","まかい","まかせる","まがる","まける","まこと","まさつ","まじめ","ますく","まぜる","まつり","まとめ","まなぶ","まぬけ","まねく","まほう","まもる","まゆげ","まよう","まろやか","まわす","まわり","まわる","まんが","まんきつ","まんぞく","まんなか","みいら","みうち","みえる","みがく","みかた","みかん","みけん","みこん","みじかい","みすい","みすえる","みせる","みっか","みつかる","みつける","みてい","みとめる","みなと","みなみかさい","みねらる","みのう","みのがす","みほん","みもと","みやげ","みらい","みりょく","みわく","みんか","みんぞく","むいか","むえき","むえん","むかい","むかう","むかえ","むかし","むぎちゃ","むける","むげん","むさぼる","むしあつい","むしば","むじゅん","むしろ","むすう","むすこ","むすぶ","むすめ","むせる","むせん","むちゅう","むなしい","むのう","むやみ","むよう","むらさき","むりょう","むろん","めいあん","めいうん","めいえん","めいかく","めいきょく","めいさい","めいし","めいそう","めいぶつ","めいれい","めいわく","めぐまれる","めざす","めした","めずらしい","めだつ","めまい","めやす","めんきょ","めんせき","めんどう","もうしあげる","もうどうけん","もえる","もくし","もくてき","もくようび","もちろん","もどる","もらう","もんく","もんだい","やおや","やける","やさい","やさしい","やすい","やすたろう","やすみ","やせる","やそう","やたい","やちん","やっと","やっぱり","やぶる","やめる","ややこしい","やよい","やわらかい","ゆうき","ゆうびんきょく","ゆうべ","ゆうめい","ゆけつ","ゆしゅつ","ゆせん","ゆそう","ゆたか","ゆちゃく","ゆでる","ゆにゅう","ゆびわ","ゆらい","ゆれる","ようい","ようか","ようきゅう","ようじ","ようす","ようちえん","よかぜ","よかん","よきん","よくせい","よくぼう","よけい","よごれる","よさん","よしゅう","よそう","よそく","よっか","よてい","よどがわく","よねつ","よやく","よゆう","よろこぶ","よろしい","らいう","らくがき","らくご","らくさつ","らくだ","らしんばん","らせん","らぞく","らたい","らっか","られつ","りえき","りかい","りきさく","りきせつ","りくぐん","りくつ","りけん","りこう","りせい","りそう","りそく","りてん","りねん","りゆう","りゅうがく","りよう","りょうり","りょかん","りょくちゃ","りょこう","りりく","りれき","りろん","りんご","るいけい","るいさい","るいじ","るいせき","るすばん","るりがわら","れいかん","れいぎ","れいせい","れいぞうこ","れいとう","れいぼう","れきし","れきだい","れんあい","れんけい","れんこん","れんさい","れんしゅう","れんぞく","れんらく","ろうか","ろうご","ろうじん","ろうそく","ろくが","ろこつ","ろじうら","ろしゅつ","ろせん","ろてん","ろめん","ろれつ","ろんぎ","ろんぱ","ろんぶん","ろんり","わかす","わかめ","わかやま","わかれる","わしつ","わじまし","わすれもの","わらう","われる"];Ur.space=" ";const qr=["á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"];qr.space=" ";class Hr extends Ce{constructor(e,t,i){super({mnemonic:e,seed:t,wordlist:i}),this.Wordlist=i||Fr,this.es=qr,this.jp=Ur}setLang(e){switch(e){case"es":this.Wordlist=qr;break;case"jp":this.Wordlist=Ur;break;default:this.Wordlist=Fr;break}}toBw(e){if(e||(e=new ke),this.mnemonic){const t=Buffer.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 i=e.readVarIntNum();return i>0&&(this.seed=e.read(i)),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");if(e>256)throw new Error("bits must be at most 256");const t=It.getRandomBuffer(e/8);return this.entropy2Mnemonic(t),this.mnemonic2Seed(),this}static fromRandom(e){return new this().fromRandom(e)}async asyncFromRandom(e){if(e||(e=128),e%32!==0||e<128||e>256)throw new Error("bits must be a multiple of 32 between 128 and 256");const t=It.getRandomBuffer(e/8);let i=await le.asyncObjectMethod(this,"entropy2Mnemonic",[t]);const u=new Hr().fromFastBuffer(i.resbuf);return i=await le.asyncObjectMethod(u,"mnemonic2Seed",[]),this.fromFastBuffer(i.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 le.asyncObjectMethod(this,"fromEntropy",[e]);return this.fromFastBuffer(t.resbuf)}static asyncFromEntropy(e){return new this().asyncFromEntropy(e)}fromString(e){return this.mnemonic=e,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 le.asyncObjectMethod(this,"toSeed",t)).resbuf}entropy2Mnemonic(e){if(!Buffer.isBuffer(e)||e.length<128/8)throw new Error("Entropy is less than 128 bits. It must be 128 bits or more.");const t=ae.sha256(e);let i="";const u=e.length*8;for(let a=0;a<e.length;a++)i=i+("00000000"+e[a].toString(2)).slice(-8);let r=t[0].toString(2);if(r=("00000000"+r).slice(-8).slice(0,u/32),i=i+r,i.length%11!==0)throw new Error("internal error - entropy not an even multiple of 11 bits - "+i.length);let s="";for(let a=0;a<i.length/11;a++){s!==""&&(s=s+this.Wordlist.space);const o=parseInt(i.slice(a*11,(a+1)*11),2);s=s+this.Wordlist[o]}return this.mnemonic=s,this}check(){const t=this.mnemonic.split(this.Wordlist.space);let i="";for(let n=0;n<t.length;n++){const c=this.Wordlist.indexOf(t[n]);if(c<0)return!1;i=i+("00000000000"+c.toString(2)).slice(-11)}if(i.length%11!==0)return!1;const u=i.length/33;if(!Number.isInteger(u))return!1;const r=i.slice(-u),s=i.slice(0,i.length-u),a=Buffer.alloc(s.length/8);for(let n=0;n<s.length/8;n++)a.writeUInt8(parseInt(i.slice(n*8,(n+1)*8),2),n);let f=ae.sha256(a)[0].toString(2);return f=("00000000"+f).slice(-8).slice(0,u),f===r}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 i=Buffer.from(t),u=Buffer.concat([Buffer.from("mnemonic"),Buffer.from(e)]);return this.seed=Buffer.from(Hd.pbkdf2Sync(i,u,2048,64,"sha512")),this}isValid(e=""){let t;try{t=!!this.mnemonic2Seed(e)}catch{t=!1}return t}static isValid(e,t=""){return new Hr(e).isValid(t)}}class _s{constructor(e=Buffer.alloc(0)){this.buf=Buffer.from(e),this.pos=0}get length(){return this.buf.length}eof(){return this.pos>=this.buf.length}read(e){if(e<0||this.pos+e>this.buf.length)throw new RangeError("read beyond end of buffer");const t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}readUInt8(){return this.read(1).readUInt8(0)}readUInt16LE(){return this.read(2).readUInt16LE(0)}readUInt32LE(){return this.read(4).readUInt32LE(0)}readUInt64LEBn(){return new Z().fromBuffer(this.read(8),{endian:"little"})}readVarIntBuf(){const e=this.pos;return this.readVarIntNum(),this.buf.slice(e,this.pos)}readVarIntNum(){const e=this.readUInt8();if(e<253)return e;if(e===253){const i=this.readUInt16LE();if(i<253)throw new Error("non-canonical varInt");return i}if(e===254){const i=this.readUInt32LE();if(i<=65535)throw new Error("non-canonical varInt");return i}const t=this.readUInt64LEBn();if(t.lte(new Z(4294967295)))throw new Error("non-canonical varInt");if(t.abs().toString(16)==="ffffffffffffffff")return-1;if(t.gt(new Z(Number.MAX_SAFE_INTEGER)))throw new Error("number too large to retain precision");return t.toNumber()}}class ct extends Ce{constructor(e,t,i=wt){super({privKey:e,pubKey:t}),this.PrivKey=i}fromJSON(e){return e.privKey&&(this.privKey=this.PrivKey.fromJSON(e.privKey)),e.pubKey&&(this.pubKey=qe.fromJSON(e.pubKey)),this}fromBr(e){const t=e.readUInt8();t>0&&(this.privKey=new this.PrivKey().fromFastBuffer(e.read(t)));const i=e.readUInt8();return i>0&&(this.pubKey=new qe().fromFastBuffer(e.read(i))),this}toBw(e){if(e||(e=new ke),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 ct().fromObject(this);return e.privKey=void 0,e}fromPrivKey(e){return this.privKey=e,this.pubKey=new qe().fromPrivKey(e),this}static fromPrivKey(e){return new this().fromPrivKey(e)}async asyncFromPrivKey(e){return this.privKey=e,this.pubKey=await new qe().asyncFromPrivKey(e),this}static asyncFromPrivKey(e){return new this().asyncFromPrivKey(e)}fromRandom(){return this.privKey=new this.PrivKey().fromRandom(),this.pubKey=new qe().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()}}ct.Mainnet=class extends ct{constructor(d,e){super(d,e,wt.Mainnet)}};ct.Testnet=class extends ct{constructor(d,e){super(d,e,wt.Testnet)}};class ht extends Ce{constructor(e,t,i,u,r,s){super({sig:e,keyPair:t,hashBuf:i,k:u,endian:r,verified:s})}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 ce().fromString(e.sig):void 0,this.keyPair=e.keyPair?new ct().fromBuffer(Buffer.from(e.keyPair,"hex")):void 0,this.hashBuf=e.hashBuf?Buffer.from(e.hashBuf,"hex"):void 0,this.k=e.k?new Z().fromString(e.k):void 0,this.endian=e.endian,this.verified=e.verified,this}toBuffer(){const e=JSON.stringify(this.toJSON());return Buffer.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 i=this.keyPair.pubKey.compressed;return this.sig.compressed=this.keyPair.pubKey.compressed===void 0?!0:i,this}}throw this.sig.recovery=void 0,new Error("Unable to find valid recovery factor")}async asyncCalcrecovery(){const e=await le.asyncObjectMethod(this,"calcrecovery",[]);return this.fromFastBuffer(e.resbuf)}static calcrecovery(e,t,i){return new ht().fromObject({sig:e,keyPair:new ct().fromObject({pubKey:t}),hashBuf:i}).calcrecovery().sig}static async asyncCalcrecovery(e,t,i){const u=await le.asyncClassMethod(ht,"calcrecovery",[e,t,i]);return new ce().fromFastBuffer(u.resbuf)}fromString(e){const t=JSON.parse(e);return t.hashBuf&&(this.hashBuf=Buffer.from(t.hashBuf,"hex")),t.keyPair&&(this.keyPair=new ct().fromString(t.keyPair)),t.sig&&(this.sig=new ce().fromString(t.sig)),t.k&&(this.k=new Z(t.k,10)),this}randomK(){const e=Ae.getN();let t;do t=new Z().fromBuffer(It.getRandomBuffer(32));while(!(t.lt(e)&&t.gt(0)));return this.k=t,this}deterministicK(e){let t=Buffer.alloc(32);t.fill(1);let i=Buffer.alloc(32);i.fill(0);const u=this.keyPair.privKey.bn.toBuffer({size:32});i=ae.sha256Hmac(Buffer.concat([t,Buffer.from([0]),u,this.hashBuf]),i),t=ae.sha256Hmac(t,i),i=ae.sha256Hmac(Buffer.concat([t,Buffer.from([1]),u,this.hashBuf]),i),t=ae.sha256Hmac(t,i),t=ae.sha256Hmac(t,i);let r=new Z().fromBuffer(t);const s=Ae.getN();e===void 0&&(e=0);for(let a=0;a<e||!(r.lt(s)&&r.gt(0));a++)i=ae.sha256Hmac(Buffer.concat([t,Buffer.from([0])]),i),t=ae.sha256Hmac(t,i),t=ae.sha256Hmac(t,i),r=new Z().fromBuffer(t);return this.k=r,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 Z().fromBuffer(this.hashBuf),i=this.sig.r,u=this.sig.s,r=e&1,s=e>>1,a=Ae.getN(),o=Ae.getG(),f=s?i.add(a):i,n=Ae.fromX(r,f);let c="";try{n.mul(a)}catch(y){c=y.message}if(c!=="point mul out of range")throw new Error("nR is not a valid curve point");const h=t.neg().umod(a),l=i.invm(a),p=n.mul(u).add(o.mul(h)).mul(l),b=new qe(p);return b.compressed=this.sig.compressed,b.validate(),b}async asyncSig2PubKey(){const e=await le.asyncObjectMethod(this,"sig2PubKey",[]);return qe.fromFastBuffer(e.resbuf)}static sig2PubKey(e,t){return new ht().fromObject({sig:e,hashBuf:t}).sig2PubKey()}static async asyncSig2PubKey(e,t){return await new ht().fromObject({sig:e,hashBuf:t}).asyncSig2PubKey()}verifyStr(e=!0){if(!Buffer.isBuffer(this.hashBuf)||this.hashBuf.length!==32)return"hashBuf must be a 32 byte buffer";try{this.keyPair.pubKey.validate()}catch(n){return"Invalid pubKey: "+n}const t=this.sig.r,i=this.sig.s;if(!(t.gt(0)&&t.lt(Ae.getN()))||!(i.gt(0)&&i.lt(Ae.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 u=new Z().fromBuffer(this.hashBuf,this.endian?{endian:this.endian}:void 0),r=Ae.getN(),s=i.invm(r),a=s.mul(u).mod(r),o=s.mul(t).mod(r),f=Ae.getG().mulAdd(a,this.keyPair.pubKey.point,o);return f.isInfinity()?"p is infinity":f.getX().mod(r).cmp(t)!==0?"Invalid signature":!1}sign(){const e=this.endian==="little"?new st(this.hashBuf).readReverse():this.hashBuf,t=this.keyPair.privKey,i=t.bn;if(!e||!t||!i)throw new Error("invalid parameters");if(!Buffer.isBuffer(e)||e.length!==32)throw new Error("hashBuf must be a 32 byte buffer");const u=Ae.getN(),r=Ae.getG(),s=new Z().fromBuffer(e);let a=0,o,f,n,c;do(!this.k||a>0)&&this.deterministicK(a),a++,o=this.k,f=r.mul(o),n=f.getX().mod(u),c=o.invm(u).mul(s.add(i.mul(n))).mod(u);while(n.cmp(0)<=0||c.cmp(0)<=0);return c.gt(new Z().fromBuffer(Buffer.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(c=Ae.getN().sub(c)),this.sig=ce.fromObject({r:n,s:c,compressed:this.keyPair.pubKey.compressed}),this}async asyncSign(){const e=await le.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 le.asyncObjectMethod(this,"verify",[e]);return this.fromFastBuffer(t.resbuf)}static sign(e,t,i){return new ht().fromObject({hashBuf:e,endian:i,keyPair:t}).sign().sig}static async asyncSign(e,t,i){const u=new ht().fromObject({hashBuf:e,endian:i,keyPair:t});return await u.asyncSign(),u.sig}static verify(e,t,i,u,r=!0){return new ht().fromObject({hashBuf:e,endian:u,sig:t,keyPair:new ct().fromObject({pubKey:i})}).verify(r).verified}static async asyncVerify(e,t,i,u,r=!0){const s=new ht().fromObject({hashBuf:e,endian:u,sig:t,keyPair:new ct().fromObject({pubKey:i})});return await s.asyncVerify(r),s.verified}}class mt extends Ce{constructor(e,t,i,u,r){super({messageBuf:e,keyPair:t,sig:i,address:u,verified:r})}static magicHash(e){if(!Buffer.isBuffer(e))throw new Error("messageBuf must be a buffer");const t=new ke;t.writeVarIntNum(mt.magicBytes.length),t.write(mt.magicBytes),t.writeVarIntNum(e.length),t.write(e);const i=t.toBuffer();return ae.sha256Sha256(i)}static async asyncMagicHash(e){const t=[e];return(await le.asyncClassMethod(mt,"magicHash",t)).resbuf}static sign(e,t){const i=new mt(e,t);return i.sign(),i.sig.toCompact().toString("base64")}static async asyncSign(e,t){const i=[e,t],u=await le.asyncClassMethod(mt,"sign",i);return JSON.parse(u.resbuf.toString())}static verify(e,t,i){const u=Buffer.from(t,"base64"),r=new mt;return r.messageBuf=e,r.sig=new ce().fromCompact(u),r.address=i,r.verify().verified}static async asyncVerify(e,t,i){const u=[e,t,i],r=await le.asyncClassMethod(mt,"verify",u);return JSON.parse(r.resbuf.toString())}sign(){const e=mt.magicHash(this.messageBuf),t=new ht().fromObject({hashBuf:e,keyPair:this.keyPair});return t.sign(),t.calcrecovery(),this.sig=t.sig,this}verify(){const e=mt.magicHash(this.messageBuf),t=new ht;if(t.hashBuf=e,t.sig=this.sig,t.keyPair=new ct,t.keyPair.pubKey=t.sig2PubKey(),!t.verify())return this.verified=!1,this;const i=new gt().fromPubKey(t.keyPair.pubKey,void 0,this.sig.compressed);return Nt(i.hashBuf,this.address.hashBuf)?this.verified=!0:this.verified=!1,this}}mt.magicBytes=Buffer.from(`Bitcoin Signed Message:
9
+ `);class Ss{constructor(){this.chunks=[]}write(e){return this.chunks.push(Buffer.from(e)),this}writeUInt8(e){const t=Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t)}writeUInt16LE(e){const t=Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t)}writeUInt32LE(e){const t=Buffer.alloc(4);return t.writeUInt32LE(e>>>0,0),this.write(t)}writeUInt64LE(e){const t=e instanceof Z?e:new Z(e);return this.write(t.toBuffer({size:8,endian:"little"}))}writeVarIntNum(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError("VarInt value must be a non-negative safe integer.");return e<253?this.writeUInt8(e):e<=65535?(this.writeUInt8(253),this.writeUInt16LE(e)):e<=4294967295?(this.writeUInt8(254),this.writeUInt32LE(e)):(this.writeUInt8(255),this.writeUInt64LE(e))}toBuffer(){return Buffer.concat(this.chunks)}toUint8Array(){return new Uint8Array(this.toBuffer())}}const Q1=["__proto__","prototype","constructor"];class Lt{constructor(e){if(this.map=new Map,e!==void 0)for(const t of Object.keys(e))this.set(t,e[t])}static checkKey(e){if(typeof e!="string"||e.length===0)throw new TypeError("key must be a non-empty string");if(Q1.includes(e))throw new TypeError("key is not allowed")}set(e,t){return Lt.checkKey(e),this.map.set(e,t),this}get(e){return Lt.checkKey(e),this.map.get(e)}has(e){return Lt.checkKey(e),this.map.has(e)}delete(e){return Lt.checkKey(e),this.map.delete(e)}get size(){return this.map.size}toJSON(){const e={};for(const[t,i]of this.map)e[t]=i;return e}static fromJSON(e){return new Lt(e)}}class nr extends Ce{constructor(e,t,i,u,r,s){super({versionBytesNum:e,prevBlockHashBuf:t,merkleRootBuf:i,time:u,bits:r,nonce:s})}fromJSON(e){return this.fromObject({versionBytesNum:e.versionBytesNum,prevBlockHashBuf:Buffer.from(e.prevBlockHashBuf,"hex"),merkleRootBuf:Buffer.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 ke),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 Dt extends Ce{constructor(e,t,i,u){super({hashBuf:e,buf:t,merkle1:i,merkle2:u})}hash(){if(this.hashBuf)return this.hashBuf;if(this.buf)return ae.sha256Sha256(this.buf);const e=this.merkle1.hash(),t=this.merkle2.hash();return this.buf=Buffer.concat([e,t]),ae.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 r=e[e.length-1],s=Math.pow(2,Math.ceil(t));for(let a=e.length;a<s;a++)e.push(r)}const i=e.slice(0,e.length/2),u=e.slice(e.length/2);return this.fromBufferArrays(i,u),this}static fromBuffers(e){return new this().fromBuffers(e)}fromBufferArrays(e,t){if(e.length===1)return this.merkle1=new Dt(void 0,e[0]),this.merkle2=new Dt(void 0,t[0]),this;const i=e.slice(0,e.length/2),u=e.slice(e.length/2);this.merkle1=new Dt().fromBufferArrays(i,u);const r=t.slice(0,t.length/2),s=t.slice(t.length/2);return this.merkle2=new Dt().fromBufferArrays(r,s),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 Kr extends Ce{constructor(e,t,i){super(),this.fromObject({prevoutsHashBuf:e,sequenceHashBuf:t,outputsHashBuf:i})}fromBuffer(e){return this.fromJSON(JSON.parse(e.toString()))}toBuffer(){return Buffer.from(JSON.stringify(this.toJSON()))}fromJSON(e){return this.prevoutsHashBuf=e.prevoutsHashBuf?Buffer.from(e.prevoutsHashBuf,"hex"):void 0,this.sequenceHashBuf=e.sequenceHashBuf?Buffer.from(e.sequenceHashBuf,"hex"):void 0,this.outputsHashBuf=e.outputsHashBuf?Buffer.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 De extends Ce{constructor(e){super({buf:e})}fromJSON(e){return this.fromObject({buf:Buffer.from(e,"hex")}),this}toJSON(){return this.buf.toString("hex")}fromBuffer(e,t=!1){return this.buf=e,t&&this.toNumberStrict(),this}fromBr(e){return e.strict?this.buf=new ke().writeVarIntNum(e.readVarIntNumStrict()).toBuffer():this.buf=e.readVarIntBuf(),this}toNumberStrict(){return new st(this.buf,!0).readVarIntNumStrict()}fromBn(e){return this.buf=new ke().writeVarIntBn(e).toBuffer(),this}static fromBn(e){return new this().fromBn(e)}fromNumber(e){return this.buf=new ke().writeVarIntNum(e).toBuffer(),this}static fromNumber(e){return new this().fromNumber(e)}toBuffer(){return this.buf}toBn(){return new st(this.buf).readVarIntBn()}toNumber(){return new st(this.buf).readVarIntNum()}}class He extends Ce{constructor(e,t,i,u,r=4294967295){super({txHashBuf:e,txOutNum:t,scriptVi:i,script:u,nSequence:r})}setScript(e){return this.scriptVi=De.fromNumber(e.toBuffer().length),this.script=e,this}fromProperties(e,t,i,u){return this.fromObject({txHashBuf:e,txOutNum:t,nSequence:u}),this.setScript(i),this}static fromProperties(e,t,i,u){return new this().fromProperties(e,t,i,u)}fromJSON(e){return this.fromObject({txHashBuf:typeof e.txHashBuf<"u"?Buffer.from(e.txHashBuf,"hex"):void 0,txOutNum:e.txOutNum,scriptVi:typeof e.scriptVi<"u"?De.fromJSON(e.scriptVi):void 0,script:typeof e.script<"u"?Ee.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=De.fromBuffer(e.readVarIntBuf()),this.script=Ee.fromBuffer(e.read(this.scriptVi.toNumber())),this.nSequence=e.readUInt32LE(),this}toBw(e){return e||(e=new ke),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,i,u){const r=new Ee;if(i.script.isPubKeyHashOut())r.writeOpCode(U.OP_0),u?r.writeBuffer(u.toBuffer()):r.writeOpCode(U.OP_0);else throw new Error("txOut must be of type pubKeyHash");return this.txHashBuf=e,this.txOutNum=t,this.setScript(r),this}hasNullInput(){return this.txHashBuf.toString("hex")==="0000000000000000000000000000000000000000000000000000000000000000"&&this.txOutNum===4294967295}setNullInput(){this.txHashBuf=Buffer.alloc(32),this.txHashBuf.fill(0),this.txOutNum=4294967295}}He.LOCKTIME_VERIFY_SEQUENCE=1;He.SEQUENCE_FINAL=4294967295;He.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31;He.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22;He.SEQUENCE_LOCKTIME_MASK=65535;He.SEQUENCE_LOCKTIME_GRANULARITY=9;class yt extends Ce{constructor(e,t,i){super({valueBn:e,scriptVi:t,script:i})}setScript(e){return this.scriptVi=De.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 Z().fromJSON(e.valueBn),scriptVi:new De().fromJSON(e.scriptVi),script:new Ee().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=De.fromNumber(e.readVarIntNum()),this.script=new Ee().fromBuffer(e.read(this.scriptVi.toNumber())),this}toBw(e){return e||(e=new ke),e.writeUInt64LEBn(this.valueBn),e.write(this.scriptVi.buf),e.write(this.script.toBuffer()),e}}class Pe extends Ce{constructor(e=1,t=De.fromNumber(0),i=[],u=De.fromNumber(0),r=[],s=0){super({versionBytesNum:e,txInsVi:t,txIns:i,txOutsVi:u,txOuts:r,nLockTime:s})}fromJSON(e){const t=[];e.txIns.forEach(function(u){t.push(new He().fromJSON(u))});const i=[];return e.txOuts.forEach(function(u){i.push(new yt().fromJSON(u))}),this.fromObject({versionBytesNum:e.versionBytesNum,txInsVi:new De().fromJSON(e.txInsVi),txIns:t,txOutsVi:new De().fromJSON(e.txOutsVi),txOuts:i,nLockTime:e.nLockTime}),this}toJSON(){const e=[];this.txIns.forEach(function(i){e.push(i.toJSON())});const t=[];return this.txOuts.forEach(function(i){t.push(i.toJSON())}),{versionBytesNum:this.versionBytesNum,txInsVi:this.txInsVi.toJSON(),txIns:e,txOutsVi:this.txOutsVi.toJSON(),txOuts:t,nLockTime:this.nLockTime}}fromBuffer(e,t=!1){if(!Buffer.isBuffer(e))throw new Error("buf must be a buffer");const i=new st(e);return i.strict=t,this.fromBr(i)}fromBr(e){this.versionBytesNum=e.readUInt32LE(),this.txInsVi=e.strict?De.fromBr(e):new De(e.readVarIntBuf());const t=this.txInsVi.toNumber();this.txIns=[];for(let u=0;u<t;u++)this.txIns.push(new He().fromBr(e));this.txOutsVi=e.strict?De.fromBr(e):new De(e.readVarIntBuf());const i=this.txOutsVi.toNumber();this.txOuts=[];for(let u=0;u<i;u++)this.txOuts.push(new yt().fromBr(e));return this.nLockTime=e.readUInt32LE(),this}toBw(e){e||(e=new ke),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 ke;for(const t in this.txIns){const i=this.txIns[t];e.write(i.txHashBuf),e.writeUInt32LE(i.txOutNum)}return ae.sha256Sha256(e.toBuffer())}hashSequence(){const e=new ke;for(const t in this.txIns){const i=this.txIns[t];e.writeUInt32LE(i.nSequence)}return ae.sha256Sha256(e.toBuffer())}hashOutputs(){const e=new ke;for(const t in this.txOuts){const i=this.txOuts[t];e.write(i.toBuffer())}return ae.sha256Sha256(e.toBuffer())}sighash(e,t,i,u,r=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,s=new Kr){const a=this.sighashPreimage(e,t,i,u,r,s);return a.compare(Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"))===0?a:new st(ae.sha256Sha256(a)).readReverse()}async asyncSighash(e,t,i,u,r=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,s={}){return(await le.asyncObjectMethod(this,"sighash",[e,t,i,u,r,s])).resbuf}sighashPreimage(e,t,i,u,r=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,s=new Kr){if(u===void 0&&(u=new Z(0)),t>=this.txIns.length)return Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex");if(e&ce.SIGHASH_FORKID&&!(e&ce.SIGHASH_CHRONICLE)&&r&Pe.SCRIPT_ENABLE_SIGHASH_FORKID){let f=Buffer.alloc(32,0),n=Buffer.alloc(32,0),c=Buffer.alloc(32,0);e&ce.SIGHASH_ANYONECANPAY||(f=s.prevoutsHashBuf?s.prevoutsHashBuf:s.prevoutsHashBuf=this.hashPrevouts()),!(e&ce.SIGHASH_ANYONECANPAY)&&(e&31)!==ce.SIGHASH_SINGLE&&(e&31)!==ce.SIGHASH_NONE&&(n=s.sequenceHashBuf?s.sequenceHashBuf:s.sequenceHashBuf=this.hashSequence()),(e&31)!==ce.SIGHASH_SINGLE&&(e&31)!==ce.SIGHASH_NONE?c=s.outputsHashBuf?s.outputsHashBuf:s.outputsHashBuf=this.hashOutputs():(e&31)===ce.SIGHASH_SINGLE&&t<this.txOuts.length&&(c=ae.sha256Sha256(this.txOuts[t].toBuffer()));const h=new ke;return h.writeUInt32LE(this.versionBytesNum),h.write(f),h.write(n),h.write(this.txIns[t].txHashBuf),h.writeUInt32LE(this.txIns[t].txOutNum),h.writeVarIntNum(i.toBuffer().length),h.write(i.toBuffer()),h.writeUInt64LEBn(u),h.writeUInt32LE(this.txIns[t].nSequence),h.write(c),h.writeUInt32LE(this.nLockTime),h.writeUInt32LE(e>>>0),h.toBuffer()}const a=this.cloneByBuffer();i=new Ee().fromBuffer(i.toBuffer()),i.removeCodeseparators();for(let f=0;f<a.txIns.length;f++)a.txIns[f]=He.fromBuffer(a.txIns[f].toBuffer()).setScript(new Ee);if(a.txIns[t]=He.fromBuffer(a.txIns[t].toBuffer()).setScript(i),(e&31)===ce.SIGHASH_NONE){a.txOuts.length=0,a.txOutsVi=De.fromNumber(0);for(let f=0;f<a.txIns.length;f++)f!==t&&(a.txIns[f].nSequence=0)}else if((e&31)===ce.SIGHASH_SINGLE){if(t>a.txOuts.length-1)return Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex");a.txOuts.length=t+1,a.txOutsVi=De.fromNumber(t+1);for(let f=0;f<a.txOuts.length;f++)f<t&&(a.txOuts[f]=yt.fromProperties(new Z().fromBuffer(Buffer.from("ffffffffffffffff","hex")),new Ee));for(let f=0;f<a.txIns.length;f++)f!==t&&(a.txIns[f].nSequence=0)}return e&ce.SIGHASH_ANYONECANPAY&&(a.txIns[0]=a.txIns[t],a.txIns.length=1,a.txInsVi=De.fromNumber(1)),new ke().write(a.toBuffer()).writeUInt32LE(e>>>0).toBuffer()}async asyncSighashPreimage(e,t,i,u,r=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,s={}){return(await le.asyncObjectMethod(this,"sighashPreimage",[e,t,i,u,r,s])).resbuf}sign(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r,s=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,a={}){const o=this.sighash(t,i,u,r,s,a);return this.preImageBuf=o,ht.sign(o,e,"little").fromObject({nHashType:t})}async asyncSign(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r,s=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,a={}){const o=await le.asyncObjectMethod(this,"sign",[e,t,i,u,r,s,a]);return new ce().fromFastBuffer(o.resbuf)}verify(e,t,i,u,r=!1,s,a=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,o={}){const f=this.sighash(e.nHashType,i,u,s,a,o);return ht.verify(f,e,t,"little",r)}async asyncVerify(e,t,i,u,r=!1,s,a=Pe.SCRIPT_ENABLE_SIGHASH_FORKID,o={}){const f=await le.asyncObjectMethod(this,"verify",[e,t,i,u,r,s,a,o]);return JSON.parse(f.resbuf.toString())}hash(){return ae.sha256Sha256(this.toBuffer())}async asyncHash(){return(await le.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new st(this.hash()).readReverse().toString("hex")}async asyncId(){const e=await le.asyncObjectMethod(this,"id",[]);return JSON.parse(e.resbuf.toString())}addTxIn(e,t,i,u){let r;return e instanceof He?r=e:r=new He().fromObject({txHashBuf:e,txOutNum:t,nSequence:u}).setScript(i),this.txIns.push(r),this.txInsVi=De.fromNumber(this.txInsVi.toNumber()+1),this}addTxOut(e,t){let i;return e instanceof yt?i=e:i=new yt().fromObject({valueBn:e}).setScript(t),this.txOuts.push(i),this.txOutsVi=De.fromNumber(this.txOutsVi.toNumber()+1),this}isCoinbase(){return this.txIns.length===1&&this.txIns[0].hasNullInput()}sort(){return this.txIns.sort((e,t)=>new st(e.txHashBuf).readReverse().compare(new st(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}}Pe.MAX_MONEY=21e6*1e8;Pe.SCRIPT_ENABLE_SIGHASH_FORKID=65536;class ei extends Ce{constructor(e,t,i){super({blockHeader:e,txsVi:t,txs:i})}fromJSON(e){const t=[];return e.txs.forEach(function(i){t.push(new Pe().fromJSON(i))}),this.fromObject({blockHeader:new nr().fromJSON(e.blockHeader),txsVi:new De().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 nr().fromBr(e),this.txsVi=new De(e.readVarIntBuf());const t=this.txsVi.toNumber();this.txs=[];for(let i=0;i<t;i++)this.txs.push(new Pe().fromBr(e));return this}toBw(e){e||(e=new ke),e.write(this.blockHeader.toBuffer()),e.write(this.txsVi.buf);const t=this.txsVi.toNumber();for(let i=0;i<t;i++)this.txs[i].toBw(e);return e}hash(){return ae.sha256Sha256(this.blockHeader.toBuffer())}async asyncHash(){return(await le.asyncObjectMethod(this,"hash",[])).resbuf}id(){return new st(this.hash()).readReverse().toString("hex")}async asyncId(){const e=await le.asyncObjectMethod(this,"id",[]);return JSON.parse(e.resbuf.toString())}verifyMerkleRoot(){const e=this.txs.map(i=>i.toBuffer()),t=Dt.fromBuffers(e).hash();return Buffer.compare(t,this.blockHeader.merkleRootBuf)}static iterateTxs(e){const t=new st(e),i=new nr().fromBr(t),u=new De(t.readVarIntBuf()),r=u.toNumber();return{blockHeader:i,txsVi:u,txsNum:r,*[Symbol.iterator](){for(let s=0;s<r;s++)yield new Pe().fromBr(t)}}}}ei.MAX_BLOCK_SIZE=1e6;class Kd extends ei{constructor(e,t,i){super(e,t,i)}async mine(e,t=0,i=null){return new Promise(u=>{const r=Date.now(),s=e.toString("hex");let a=0;const o=this.blockHeader.toBuffer(),f=()=>{for(;;){if(t&&a>=t)return u(!1);a++;let n=o.readUInt32LE(76)+1;o.writeUInt32LE(n,76),a%1e5===0&&o.writeUInt32LE(Math.floor(Date.now()/1e3),68);const c=ae.sha256Sha256(o);if(c.toString("hex")<s)return this.blockHeader.fromBuffer(o),i?.({success:!0,nonce:n,iterations:a,hashrate:a/((Date.now()-r)/1e3),hash:c.toString("hex")}),u(!0);if(i&&a%5e5===0&&i({success:!1,iterations:a,hashrate:a/((Date.now()-r)/1e3)}),a%1e6===0)return setImmediate(f)}};f()})}mineSync(e,t=0){const i=e.toString("hex");let u=0;const r=this.blockHeader.toBuffer();for(;!t||u<t;){u++;let s=r.readUInt32LE(76)+1;r.writeUInt32LE(s,76);const a=ae.sha256Sha256(r);if(a.toString("hex")<i)return this.blockHeader.fromBuffer(r),{success:!0,nonce:s,iterations:u,hashrate:u/10,hash:a.toString("hex")}}return{success:!1,iterations:u,hashrate:u/10}}verifyProofOfWork(e){return this.hash().toString("hex")<e.toString("hex")}hash(){return ae.sha256Sha256(this.blockHeader.toBuffer())}id(){return new st(this.hash()).readReverse().toString("hex")}}class Z1{static createBlock(e,t,i){const u=new nr({version:536870912,prevBlockHashBuf:t,merkleRootBuf:this.calcMerkleRoot(e),time:Math.floor(Date.now()/1e3),bits:i,nonce:0}),r=[this.createCoinbaseTx(),...e],s=new De().fromNumber(r.length);return new Kd(u,s,r)}static calcMerkleRoot(e){return Dt.fromBuffers(e.map(t=>t.hash())).hash()}static createCoinbaseTx(){return new Pe}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 ep=[U.OP_CAT,U.OP_SUBSTR,U.OP_LEFT,U.OP_RIGHT,U.OP_INVERT,U.OP_AND,U.OP_OR,U.OP_XOR,U.OP_2MUL,U.OP_2DIV,U.OP_MUL,U.OP_DIV,U.OP_MOD,U.OP_LSHIFT,U.OP_RSHIFT];function Zf(d){return d.length===0||(d[d.length-1]&127)!==0?d:d.length===1?[]:(d[d.length-2]&128)===0?Zf(d.slice(0,d.length-1)):d}class re extends Ce{constructor(e,t,i,u=[],r=[],s=0,a=0,o=0,f=[],n="",c=re.defaultFlags,h=new Z(0)){super({script:e,tx:t,nIn:i,stack:u,altStack:r,pc:s,pBeginCodeHash:a,nOpCount:o,ifStack:f,errStr:n,flags:c,valueBn:h})}initialize(){return this.script=new Ee,this.stack=[],this.altStack=[],this.pc=0,this.pBeginCodeHash=0,this.nOpCount=0,this.ifStack=[],this.elseStack=[],this.errStr="",this.flags=re.defaultFlags,this.setLimits(),this}setLimits(){return this.scriptLimit=this.isPreGenesis()?re.PREGENESIS_SCRIPT_LIMIT:1e7,this.stackLimit=this.isPreGenesis()?re.PREGENESIS_STACK_LIMIT:1e7,this}isPreGenesis(){return(this.flags&re.SCRIPT_VERIFY_PREGENESIS_LIMITS)!==0}isChronicle(){return(this.flags&re.SCRIPT_VERIFY_CHRONICLE)!==0||this.tx!==void 0&&this.tx.versionBytesNum>1}scriptNumMaxSize(){return this.isPreGenesis()?re.PREGENESIS_SCRIPT_NUM_LENGTH:this.isChronicle()?re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_CHRONICLE:re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS}maxScriptElementSize(){return this.isPreGenesis()?re.PREGENESIS_MAX_SCRIPT_ELEMENT_SIZE:re.MAX_SCRIPT_ELEMENT_SIZE}versionBuf(){const e=Buffer.alloc(4);return e.writeUInt32LE(this.tx?this.tx.versionBytesNum:0,0),e}buildSubScript(){let e=this.script.chunks.slice(this.pBeginCodeHash);return this.isUnlockingScript&&this.isChronicle()&&this.lockingScript&&(e=e.concat(this.lockingScript.chunks)),new Ee().fromObject({chunks:e})}stepChronicleOp(e,t){const i=e===U.OP_SUBSTR_CHRONICLE;if(this.stack.length<(i?3:2))return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let u,r=0,s,a;try{const c=this.stack[this.stack.length-1],h=new Z().fromScriptNumBuffer(c,t,this.scriptNumMaxSize());if(i||e===U.OP_LEFT_CHRONICLE||e===U.OP_RIGHT_CHRONICLE?u=h.toNumber():s=h.toNumber(),i){const l=this.stack[this.stack.length-2];r=new Z().fromScriptNumBuffer(l,t,this.scriptNumMaxSize()).toNumber()}else if(!i){const l=this.stack[this.stack.length-2];a=new Z().fromScriptNumBuffer(l,t,this.scriptNumMaxSize())}}catch(c){return this.errStr=c.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(i||e===U.OP_LEFT_CHRONICLE||e===U.OP_RIGHT_CHRONICLE){const c=this.stack.length-(i?3:2),h=this.stack[c],l=h.length;if(u<0||u>l||i&&(r<0||r>=l||u>l-r))return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;const p=i?r:e===U.OP_LEFT_CHRONICLE?0:l-u;return this.stack[c]=h.slice(p,p+u),this.stack.pop(),i&&this.stack.pop(),!0}if(s<0)return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;const o=a.negative,f=a.abs();let n;return e===U.OP_LSHIFTNUM?n=f.ushln(s):n=f.ushrn(s),o&&(n=n.ineg()),n.toBuffer().length>this.scriptNumMaxSize()?(this.errStr="SCRIPTNUM_OVERFLOW",!1):(this.stack.pop(),this.stack.pop(),this.stack.push(n.toScriptNumBuffer()),!0)}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&(re.SCRIPT_VERIFY_DERSIG|re.SCRIPT_VERIFY_LOW_S|re.SCRIPT_VERIFY_STRICTENC))!==0&&!ce.IsTxDer(e))return this.errStr="SCRIPT_ERR_SIG_DER",!1;if((this.flags&re.SCRIPT_VERIFY_LOW_S)!==0&&!this.isChronicle()&&!new ce().fromTxFormat(e).hasLowS())return this.errStr="SCRIPT_ERR_SIG_HIGH_S",!1;if((this.flags&re.SCRIPT_VERIFY_STRICTENC)!==0){const t=new ce().fromTxFormat(e);if(!t.hasDefinedHashType())return this.errStr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nHashType&ce.SIGHASH_FORKID)return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(t.isChronicle()&&!this.isChronicle())return this.errStr="SCRIPT_ERR_ILLEGAL_CHRONICLE",!1;if(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nHashType&ce.SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0}checkPubKeyEncoding(e){return(this.flags&re.SCRIPT_VERIFY_STRICTENC)!==0&&!qe.isCompressedOrUncompressed(e)?(this.errStr="SCRIPT_ERR_PUBKEYTYPE",!1):!0}checkLockTime(e){return!(!(this.tx.nLockTime<re.LOCKTIME_THRESHOLD&&e<re.LOCKTIME_THRESHOLD||this.tx.nLockTime>=re.LOCKTIME_THRESHOLD&&e>=re.LOCKTIME_THRESHOLD)||e>this.tx.nLockTime||this.tx.txIns[this.nIn].nSequence===4294967295)}checkSequence(e){if(this.tx.versionBytesNum<2||(this.tx.txIns[this.nIn].nSequence&He.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)return!1;const t=He.SEQUENCE_LOCKTIME_TYPE_FLAG|He.SEQUENCE_LOCKTIME_MASK,i=this.tx.txIns[this.nIn].nSequence&t,u=e&t;return!(!(i<He.SEQUENCE_LOCKTIME_TYPE_FLAG&&u<He.SEQUENCE_LOCKTIME_TYPE_FLAG||i>=He.SEQUENCE_LOCKTIME_TYPE_FLAG&&u>=He.SEQUENCE_LOCKTIME_TYPE_FLAG)||u>i)}*step(){const e=(this.flags&re.SCRIPT_VERIFY_MINIMALDATA)!==0&&!this.isChronicle();if(this.pc>=this.script.chunks.length)return!0;const t=this.script.chunks[this.pc];this.pc++;const i=t.opCodeNum,u=this.ifStack.indexOf(!1)===-1;if(t.buf&&t.buf.length>this.maxScriptElementSize())return this.errStr="SCRIPT_ERR_PUSH_SIZE",!1;if(i>U.OP_16&&++this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;if((i===U.OP_2MUL||i===U.OP_2DIV)&&!this.isChronicle())return this.errStr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(u&&i>=0&&i<=U.OP_PUSHDATA4){if(e&&!this.script.checkMinimalPush(this.pc-1))return this.errStr="SCRIPT_ERR_MINIMALDATA",!1;if(!t.buf)this.stack.push(re.false);else{if(t.len!==t.buf.length)throw new Error("length of push value not equal to length of data");this.stack.push(t.buf)}}else if(u||U.OP_IF<=i&&i<=U.OP_ENDIF)switch(i){case U.OP_1NEGATE:case U.OP_1:case U.OP_2:case U.OP_3:case U.OP_4:case U.OP_5:case U.OP_6:case U.OP_7:case U.OP_8:case U.OP_9:case U.OP_10:case U.OP_11:case U.OP_12:case U.OP_13:case U.OP_14:case U.OP_15:case U.OP_16:{let r=i-(U.OP_1-1),s=new Z(r).toScriptNumBuffer();this.stack.push(s)}break;case U.OP_NOP:break;case U.OP_CHECKLOCKTIMEVERIFY:{if(!(this.flags&re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&re.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 r;try{const s=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(s,e,5).toNumber()}catch(s){return this.errStr=(s.message.includes("minimal"),"SCRIPT_ERR_UNKNOWN_ERROR"),s.message.includes("overflow")&&(this.errStr="SCRIPTNUM_OVERFLOW"),s.message.includes("minimal")&&(this.errStr="SCRIPT_ERR_MINIMALDATA"),!1}if(r<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(r))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case U.OP_CHECKSEQUENCEVERIFY:{if(!(this.flags&re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&re.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 r;try{const s=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(s,e,5).toNumber()}catch{return this.errStr="SCRIPTNUM_OVERFLOW",!1}if(r<0)return this.errStr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if((r&He.SEQUENCE_LOCKTIME_DISABLE_FLAG)!==0)break;if(!this.checkSequence(r))return this.errStr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1}break;case U.OP_NOP1:case U.OP_NOP3:case U.OP_NOP4:case U.OP_NOP5:case U.OP_NOP6:case U.OP_NOP7:case U.OP_NOP8:case U.OP_NOP9:case U.OP_NOP10:if(this.isChronicle()&&(i===U.OP_SUBSTR_CHRONICLE||i===U.OP_LEFT_CHRONICLE||i===U.OP_RIGHT_CHRONICLE||i===U.OP_LSHIFTNUM||i===U.OP_RSHIFTNUM))return this.stepChronicleOp(i,e);if(this.flags&re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errStr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case U.OP_IF:case U.OP_NOTIF:case U.OP_VERIF:case U.OP_VERNOTIF:{if((i===U.OP_VERIF||i===U.OP_VERNOTIF)&&u&&!this.isChronicle())return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;let r=!1;if(u){if(this.stack.length<1)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;const s=this.stack.pop();if((i===U.OP_IF||i===U.OP_NOTIF)&&(this.flags&re.SCRIPT_VERIFY_MINIMALIF)!==0&&!this.isChronicle()&&(s.length>1||s.length===1&&s[0]!==1))return this.errStr="SCRIPT_ERR_MINIMALIF",!1;i===U.OP_VERIF||i===U.OP_VERNOTIF?r=s.length===4&&s.equals(this.versionBuf()):r=re.castToBool(s),(i===U.OP_NOTIF||i===U.OP_VERNOTIF)&&(r=!r)}this.ifStack.push(r),this.elseStack.push(!1)}break;case U.OP_ELSE:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(this.elseStack[this.elseStack.length-1]&&this.isChronicle())return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.elseStack[this.elseStack.length-1]=!0,this.ifStack[this.ifStack.length-1]=!this.ifStack[this.ifStack.length-1];break;case U.OP_ENDIF:if(this.ifStack.length===0)return this.errStr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.ifStack.pop(),this.elseStack.pop();break;case U.OP_VER:{if(!this.isChronicle())return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;this.stack.push(this.versionBuf())}break;case U.OP_VERIFY:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];if(re.castToBool(r))this.stack.pop();else return this.errStr="SCRIPT_ERR_VERIFY",!1}break;case U.OP_RETURN:return this.isUnlockingScript&&this.isChronicle()?(this.pc=this.script.chunks.length,this.ifStack=[],!0):(this.errStr="SCRIPT_ERR_OP_RETURN",!1);case U.OP_TOALTSTACK:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altStack.push(this.stack.pop());break;case U.OP_FROMALTSTACK:if(this.altStack.length<1)return this.errStr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altStack.pop());break;case U.OP_2DROP:if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case U.OP_2DUP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];this.stack.push(r),this.stack.push(s)}break;case U.OP_3DUP:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-3],s=this.stack[this.stack.length-2],a=this.stack[this.stack.length-1];this.stack.push(r),this.stack.push(s),this.stack.push(a)}break;case U.OP_2OVER:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-4],s=this.stack[this.stack.length-3];this.stack.push(r),this.stack.push(s)}break;case U.OP_2ROT:{if(this.stack.length<6)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack.splice(this.stack.length-6,2);this.stack.push(r[0]),this.stack.push(r[1])}break;case U.OP_2SWAP:{if(this.stack.length<4)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack.splice(this.stack.length-4,2);this.stack.push(r[0]),this.stack.push(r[1])}break;case U.OP_IFDUP:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];re.castToBool(r)&&this.stack.push(r)}break;case U.OP_DEPTH:{const r=new Z(this.stack.length).toScriptNumBuffer();this.stack.push(r)}break;case U.OP_DROP:if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case U.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 U.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 U.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 U.OP_PICK:case U.OP_ROLL:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let r;try{const a=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(a,e,this.scriptNumMaxSize()).toNumber()}catch(a){return this.errStr=a.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(this.stack.pop(),r<0||r>=this.stack.length)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const s=this.stack[this.stack.length-r-1];i===U.OP_ROLL&&this.stack.splice(this.stack.length-r-1,1),this.stack.push(s)}break;case U.OP_ROT:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-3],s=this.stack[this.stack.length-2],a=this.stack[this.stack.length-1];this.stack[this.stack.length-3]=s,this.stack[this.stack.length-2]=a,this.stack[this.stack.length-1]=r}break;case U.OP_SWAP:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=s,this.stack[this.stack.length-1]=r}break;case U.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 U.OP_SIZE:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=new Z(this.stack[this.stack.length-1].length);this.stack.push(r.toScriptNumBuffer())}break;case U.OP_AND:case U.OP_OR:case U.OP_XOR:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];if(r.length!==s.length)return this.errStr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(i){case U.OP_AND:for(let a=0;a<r.length;a++)r[a]&=s[a];break;case U.OP_OR:for(let a=0;a<r.length;a++)r[a]|=s[a];break;case U.OP_XOR:for(let a=0;a<r.length;a++)r[a]^=s[a];break}this.stack.pop()}break;case U.OP_INVERT:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];for(let s=0;s<r.length;s++)r[s]=~r[s]}break;case U.OP_LSHIFT:case U.OP_RSHIFT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2];let s=new Z(r),a;try{const f=this.stack[this.stack.length-1];a=new Z().fromScriptNumBuffer(f,e,this.scriptNumMaxSize()).toNumber()}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(a<0)return this.errStr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;if(this.stack.pop(),this.stack.pop(),a>=r.length*8){this.stack.push(Buffer.alloc(r.length));break}switch(i){case U.OP_LSHIFT:s=s.shln(a);break;case U.OP_RSHIFT:s=s.shrn(a);break}let o=s.toBuffer({endian:"big"});o.length>r.length?o=o.slice(o.length-r.length):o.length<r.length&&(o=Buffer.concat([Buffer.alloc(r.length-o.length),o])),this.stack.push(o)}break;case U.OP_EQUAL:case U.OP_EQUALVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1],a=Nt(r,s);if(this.stack.pop(),this.stack.pop(),this.stack.push(a?re.true:re.false),i===U.OP_EQUALVERIFY)if(a)this.stack.pop();else return this.errStr="SCRIPT_ERR_EQUALVERIFY",!1}break;case U.OP_1ADD:case U.OP_1SUB:case U.OP_2MUL:case U.OP_2DIV:case U.OP_NEGATE:case U.OP_ABS:case U.OP_NOT:case U.OP_0NOTEQUAL:{if((i===U.OP_2MUL||i===U.OP_2DIV)&&!this.isChronicle())return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1;if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];let s;try{s=new Z().fromScriptNumBuffer(r,e,this.scriptNumMaxSize())}catch(a){return this.errStr=a.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}switch(i){case U.OP_1ADD:s=s.add(1);break;case U.OP_1SUB:s=s.sub(1);break;case U.OP_2MUL:s=s.add(s);break;case U.OP_2DIV:s=s.div(new Z(2));break;case U.OP_NEGATE:s=s.neg();break;case U.OP_ABS:s.lt(0)&&(s=s.neg());break;case U.OP_NOT:s=new Z(s.eq(0)?1:0);break;case U.OP_0NOTEQUAL:s=new Z(s.neq(0)?1:0);break}this.stack.pop(),this.stack.push(s.toScriptNumBuffer())}break;case U.OP_ADD:case U.OP_SUB:case U.OP_MUL:case U.OP_DIV:case U.OP_MOD:case U.OP_BOOLAND:case U.OP_BOOLOR:case U.OP_NUMEQUAL:case U.OP_NUMEQUALVERIFY:case U.OP_NUMNOTEQUAL:case U.OP_LESSTHAN:case U.OP_GREATERTHAN:case U.OP_LESSTHANOREQUAL:case U.OP_GREATERTHANOREQUAL:case U.OP_MIN:case U.OP_MAX:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let r,s;try{r=new Z().fromScriptNumBuffer(this.stack[this.stack.length-2],e,this.scriptNumMaxSize()),s=new Z().fromScriptNumBuffer(this.stack[this.stack.length-1],e,this.scriptNumMaxSize())}catch(o){return this.errStr=o.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}let a=new Z(0);switch(i){case U.OP_ADD:a=r.add(s);break;case U.OP_SUB:a=r.sub(s);break;case U.OP_MUL:a=r.mul(s);break;case U.OP_DIV:if(s.eq(0))return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;a=r.div(s);break;case U.OP_MOD:if(s.eq(0))return this.errStr="SCRIPT_ERR_DIV_BY_ZERO",!1;a=r.mod(s);break;case U.OP_BOOLAND:a=new Z(r.neq(0)&&s.neq(0)?1:0);break;case U.OP_BOOLOR:a=new Z(r.neq(0)||s.neq(0)?1:0);break;case U.OP_NUMEQUAL:a=new Z(r.eq(s)?1:0);break;case U.OP_NUMEQUALVERIFY:a=new Z(r.eq(s)?1:0);break;case U.OP_NUMNOTEQUAL:a=new Z(r.neq(s)?1:0);break;case U.OP_LESSTHAN:a=new Z(r.lt(s)?1:0);break;case U.OP_GREATERTHAN:a=new Z(r.gt(s)?1:0);break;case U.OP_LESSTHANOREQUAL:a=new Z(r.leq(s)?1:0);break;case U.OP_GREATERTHANOREQUAL:a=new Z(r.geq(s)?1:0);break;case U.OP_MIN:a=r.lt(s)?r:s;break;case U.OP_MAX:a=r.gt(s)?r:s;break}if(this.stack.pop(),this.stack.pop(),this.stack.push(a.toScriptNumBuffer()),i===U.OP_NUMEQUALVERIFY)if(re.castToBool(this.stack[this.stack.length-1]))this.stack.pop();else return this.errStr="SCRIPT_ERR_NUMEQUALVERIFY",!1}break;case U.OP_WITHIN:{if(this.stack.length<3)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let r,s,a;try{r=new Z().fromScriptNumBuffer(this.stack[this.stack.length-3],e,this.scriptNumMaxSize()),s=new Z().fromScriptNumBuffer(this.stack[this.stack.length-2],e,this.scriptNumMaxSize()),a=new Z().fromScriptNumBuffer(this.stack[this.stack.length-1],e,this.scriptNumMaxSize())}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}const o=s.leq(r)&&r.lt(a);this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(o?re.true:re.false)}break;case U.OP_RIPEMD160:case U.OP_SHA1:case U.OP_SHA256:case U.OP_HASH160:case U.OP_HASH256:{if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-1];let s;i===U.OP_RIPEMD160?s=ae.ripemd160(r):i===U.OP_SHA1?s=ae.sha1(r):i===U.OP_SHA256?s=ae.sha256(r):i===U.OP_HASH160?s=ae.sha256Ripemd160(r):i===U.OP_HASH256&&(s=ae.sha256Sha256(r)),this.stack.pop(),this.stack.push(s)}break;case U.OP_CODESEPARATOR:this.pBeginCodeHash=this.pc;break;case U.OP_CHECKSIG:case U.OP_CHECKSIGVERIFY:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];if(!this.checkSigEncoding(r)||!this.checkPubKeyEncoding(s))return!1;const a=this.buildSubScript();if((r.length>0?r.readUInt8(r.length-1):0)&ce.SIGHASH_FORKID){if(!(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else a.findAndDelete(new Ee().writeBuffer(r));let f;try{const n=new ce().fromTxFormat(r),c=new qe().fromBuffer(s,!1);f=this.tx.verify(n,c,this.nIn,a,!!(this.flags&re.SCRIPT_VERIFY_LOW_S)&&!this.isChronicle(),this.valueBn,this.flags)}catch{f=!1}if(!f&&(this.flags&re.SCRIPT_VERIFY_NULLFAIL)!==0&&!this.isChronicle()&&r.length>0)return this.errStr="SCRIPT_ERR_SIG_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(f?re.true:re.false),i===U.OP_CHECKSIGVERIFY)if(f)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKSIGVERIFY",!1}break;case U.OP_CHECKMULTISIG:case U.OP_CHECKMULTISIGVERIFY:{let r=1;if(this.stack.length<r)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let s;try{const l=this.stack[this.stack.length-r];s=new Z().fromScriptNumBuffer(l,e).toNumber()}catch(l){return this.errStr=l.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(s<0||s>20)return this.errStr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=s,this.nOpCount>201)return this.errStr="SCRIPT_ERR_OP_COUNT",!1;let a=++r;if(r+=s,this.stack.length<r)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;let o;try{const l=this.stack[this.stack.length-r];o=new Z().fromScriptNumBuffer(l,e).toNumber()}catch(l){return this.errStr=l.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(o<0||o>s)return this.errStr="SCRIPT_ERR_SIG_COUNT",!1;let f=++r;if(r+=o,this.stack.length<r)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const n=this.buildSubScript();for(let l=0;l<o;l++){const p=this.stack[this.stack.length-f-l];if((p.length>0?p.readUInt8(p.length-1):0)&ce.SIGHASH_FORKID){if(!(this.flags&re.SCRIPT_ENABLE_SIGHASH_FORKID))return this.errStr="SCRIPT_ERR_ILLEGAL_FORKID",!1}else n.findAndDelete(new Ee().writeBuffer(p))}const c=o;let h=!0;for(;h&&o>0;){const l=this.stack[this.stack.length-f],p=this.stack[this.stack.length-a];if(!this.checkSigEncoding(l)||!this.checkPubKeyEncoding(p))return!1;let b;try{const y=new ce().fromTxFormat(l),v=new qe().fromBuffer(p,!1);b=this.tx.verify(y,v,this.nIn,n,!!(this.flags&re.SCRIPT_VERIFY_LOW_S)&&!this.isChronicle(),this.valueBn,this.flags)}catch{b=!1}b&&(f++,o--),a++,s--,o>s&&(h=!1)}if(!h&&(this.flags&re.SCRIPT_VERIFY_NULLFAIL)!==0&&!this.isChronicle()){for(let l=0;l<c;l++)if(this.stack[this.stack.length-f-l].length>0)return this.errStr="SCRIPT_ERR_SIG_NULLFAIL",!1}for(;r-- >1;)this.stack.pop();if(this.stack.length<1)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&re.SCRIPT_VERIFY_NULLDUMMY&&!this.isChronicle()&&this.stack[this.stack.length-1].length)return this.errStr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(h?re.true:re.false),i===U.OP_CHECKMULTISIGVERIFY)if(h)this.stack.pop();else return this.errStr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1}break;case U.OP_CAT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2],s=this.stack[this.stack.length-1];this.stack[this.stack.length-2]=Buffer.concat([r,s]),this.stack.pop()}break;case U.OP_SPLIT:{if(this.stack.length<2)return this.errStr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;const r=this.stack[this.stack.length-2];let s;try{const f=this.stack[this.stack.length-1];s=new Z().fromScriptNumBuffer(f,e).toNumber()}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(s<0||s>r.length)return this.errStr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;const a=r.slice(0,s),o=r.slice(s);this.stack.pop(),this.stack.pop(),this.stack.push(a),this.stack.push(o)}break;case U.OP_NUM2BIN:{if(this.stack.length<2)return this.errStr="OP_NUM2BIN requires at least two items to be on the stack.",!1;let r;try{const f=this.stack[this.stack.length-1];r=new Z().fromScriptNumBuffer(f,e,this.scriptNumMaxSize()).toNumber()}catch(f){return this.errStr=f.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}if(r>this.maxScriptElementSize())return this.errStr=`It's not currently possible to push data larger than ${re.MAX_SCRIPT_ELEMENT_SIZE} bytes.`,!1;this.stack.pop();let s=this.stack[this.stack.length-1];if(s=Zf(s),s.length>r)return 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.",!1;if(s.length===r)break;let a=0;s.length>0&&(a=s[s.length-1]&128,s[s.length-1]&=127);const o=Buffer.alloc(r);s.copy(o),r>0&&(o[r-1]|=a),this.stack[this.stack.length-1]=o}break;case U.OP_BIN2NUM:{if(this.stack.length<1)return this.errStr="OP_BIN2NUM requires at least one item to be on the stack.",!1;const r=this.stack[this.stack.length-1],s=Zf(r);try{this.stack[this.stack.length-1]=new Z().fromScriptNumBuffer(s,e,this.scriptNumMaxSize()).toScriptNumBuffer()}catch(a){return this.errStr=a.message.includes("overflow")?"SCRIPTNUM_OVERFLOW":"SCRIPT_ERR_UNKNOWN_ERROR",!1}}break;default:return this.errStr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}fromJSON(e){return this.fromJSONNoTx(e),this.tx=e.tx?new Pe().fromJSON(e.tx):void 0,this}fromJSONNoTx(e){return this.fromObject({script:e.script!==void 0?new Ee().fromJSON(e.script):void 0,nIn:e.nIn}),this.stack=[],e.stack.forEach((function(t){this.stack.push(Buffer.from(t,"hex"))}).bind(this)),this.altStack=[],e.altStack.forEach((function(t){this.altStack.push(Buffer.from(t,"hex"))}).bind(this)),this.fromObject({pc:e.pc,pBeginCodeHash:e.pBeginCodeHash,nOpCount:e.nOpCount,ifStack:e.ifStack,elseStack:[],errStr:e.errStr,flags:e.flags}),this}fromBr(e){let t=e.readVarIntNum(),i=e.read(t);this.fromJSONNoTx(JSON.parse(i.toString()));let u=e.readVarIntNum();if(u>0){let r=e.read(u);this.tx=new Pe().fromFastBuffer(r)}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(i){e.push(i.toString("hex"))});let t=[];return this.altStack.forEach(function(i){t.push(i.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?.preImage?this.preImage.toString("hex"):"",hashBuf:this?.hashBuf?this.hashBuf.toString("hex"):""}}toBw(e){e||(e=new ke);let t=Buffer.from(JSON.stringify(this.toJSONNoTx()));if(e.writeVarIntNum(t.length),e.write(t),this.tx){let i=this.tx.toFastBuffer();e.writeVarIntNum(i.length),e.write(i)}else e.writeVarIntNum(0);return e}static getFlags(e){let t=0;return e.indexOf("NONE")!==-1&&(t=t|re.SCRIPT_VERIFY_NONE),e.indexOf("P2SH")!==-1&&(t=t|re.SCRIPT_VERIFY_P2SH),e.indexOf("STRICTENC")!==-1&&(t=t|re.SCRIPT_VERIFY_STRICTENC),e.indexOf("DERSIG")!==-1&&(t=t|re.SCRIPT_VERIFY_DERSIG),e.indexOf("LOW_S")!==-1&&(t=t|re.SCRIPT_VERIFY_LOW_S),e.indexOf("NULLDUMMY")!==-1&&(t=t|re.SCRIPT_VERIFY_NULLDUMMY),e.indexOf("SIGPUSHONLY")!==-1&&(t=t|re.SCRIPT_VERIFY_SIGPUSHONLY),e.indexOf("MINIMALDATA")!==-1&&(t=t|re.SCRIPT_VERIFY_MINIMALDATA),e.indexOf("DISCOURAGE_UPGRADABLE_NOPS")!==-1&&(t=t|re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS),e.indexOf("CLEANSTACK")!==-1&&(t=t|re.SCRIPT_VERIFY_CLEANSTACK),e.indexOf("CHECKLOCKTIMEVERIFY")!==-1&&(t=t|re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY),e.indexOf("CHECKSEQUENCEVERIFY")!==-1&&(t=t|re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY),e.indexOf("SIGHASH_FORKID")!==-1&&(t=t|re.SCRIPT_ENABLE_SIGHASH_FORKID),e.indexOf("MINIMALIF")!==-1&&(t=t|re.SCRIPT_VERIFY_MINIMALIF),e.indexOf("NULLFAIL")!==-1&&(t=t|re.SCRIPT_VERIFY_NULLFAIL),e.indexOf("CHRONICLE")!==-1&&(t=t|re.SCRIPT_VERIFY_CHRONICLE),e.indexOf("PREGENESIS_LIMITS")!==-1&&(t=t|re.SCRIPT_VERIFY_PREGENESIS_LIMITS),t}*eval(){if(this.isPreGenesis())for(const e of this.script.chunks)ep.includes(e.opCodeNum)&&(this.errStr="SCRIPT_ERR_DISABLED_OPCODE",yield!1);this.script.toBuffer().length>this.scriptLimit&&(this.errStr="SCRIPT_ERR_SCRIPT_SIZE",yield!1);try{for(;this.pc<this.script.chunks.length;){const e=yield*this.step();if(e)yield e;else{yield!1;return}}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}verify(e,t,i,u,r,s){const a=this.results(e,t,i,u,r,s);for(const o of a)if(!o)return!1;return!0}*results(e,t,i,u,r,s){let a;this.initialize(),this.fromObject({script:e,tx:i,nIn:u,flags:r,valueBn:s}),this.setLimits(),this.isUnlockingScript=!0,this.lockingScript=t,(r&re.SCRIPT_VERIFY_SIGPUSHONLY)!==0&&!this.isChronicle()&&!e.isPushOnly()&&(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1),yield*this.eval(),r&re.SCRIPT_VERIFY_P2SH&&(a=this.stack.slice());const o=this.stack;this.initialize(),this.fromObject({script:t,stack:o,tx:i,nIn:u,flags:r,valueBn:s}),this.setLimits(),this.isUnlockingScript=!1,yield*this.eval(),this.stack.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1);const f=this.stack[this.stack.length-1];if(re.castToBool(f)||(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),r&re.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){e.isPushOnly()||(this.errStr=this.errStr||"SCRIPT_ERR_SIG_PUSHONLY",yield!1);const n=this.stack;if(this.stack=a,a=n,this.stack.length===0)throw new Error("internal error - stack copy empty");const c=this.stack[this.stack.length-1],h=new Ee().fromBuffer(c);this.stack.pop();const l=this.stack;this.initialize(),this.fromObject({script:h,stack:l,tx:i,nIn:u,flags:r,valueBn:s}),this.setLimits(),yield*this.eval(),this.stack.length===0&&(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1),re.castToBool(this.stack[this.stack.length-1])?yield!0:(this.errStr=this.errStr||"SCRIPT_ERR_EVAL_FALSE",yield!1)}if((r&re.SCRIPT_VERIFY_CLEANSTACK)!==0&&!this.isChronicle()){if(!(r&re.SCRIPT_VERIFY_P2SH))throw new Error("cannot use CLEANSTACK without P2SH");this.stack.length!==1&&(this.errStr=this.errStr||"SCRIPT_ERR_CLEANSTACK",yield!1)}yield!0}getDebugObject(){const 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&&this.script.chunks&&this.script.chunks[e]?U.fromNumber(this.script.chunks[e].opCodeNum).toString():"no script or chunk found"}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}re.true=Buffer.from([1]);re.false=Buffer.from([]);re.MAX_SCRIPT_ELEMENT_SIZE=500*1e3;re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS=10*1e3;re.LOCKTIME_THRESHOLD=5e8;re.SCRIPT_VERIFY_NONE=0;re.SCRIPT_VERIFY_P2SH=1;re.SCRIPT_VERIFY_STRICTENC=2;re.SCRIPT_VERIFY_DERSIG=4;re.SCRIPT_VERIFY_LOW_S=8;re.SCRIPT_VERIFY_NULLDUMMY=16;re.SCRIPT_VERIFY_SIGPUSHONLY=32;re.SCRIPT_VERIFY_MINIMALDATA=64;re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128;re.SCRIPT_VERIFY_CLEANSTACK=256;re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512;re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024;re.SCRIPT_VERIFY_MINIMALIF=8192;re.SCRIPT_VERIFY_NULLFAIL=16384;re.SCRIPT_ENABLE_SIGHASH_FORKID=65536;re.SCRIPT_VERIFY_PREGENESIS_LIMITS=1<<17;re.PREGENESIS_SCRIPT_NUM_LENGTH=4;re.PREGENESIS_MAX_SCRIPT_ELEMENT_SIZE=520;re.PREGENESIS_SCRIPT_LIMIT=1e4;re.PREGENESIS_STACK_LIMIT=1e3;re.SCRIPT_VERIFY_CHRONICLE=1<<18;re.DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_CHRONICLE=32*1024*1024;re.defaultFlags=re.SCRIPT_VERIFY_P2SH|re.SCRIPT_VERIFY_STRICTENC|re.SCRIPT_ENABLE_SIGHASH_FORKID|re.SCRIPT_VERIFY_LOW_S|re.SCRIPT_VERIFY_NULLDUMMY|re.SCRIPT_VERIFY_DERSIG|re.SCRIPT_VERIFY_MINIMALDATA|re.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS|re.SCRIPT_VERIFY_CLEANSTACK|re.SCRIPT_VERIFY_SIGPUSHONLY|re.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|re.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;class tp{lock(e){let t;if(typeof e=="string"?t=new gt().fromString(e).hashBuf:t=e,!Buffer.isBuffer(t)||t.length!==20)throw new Error("pubKeyHash must be a 20-byte buffer or an address");return new Ee().writeOpCode(U.OP_DUP).writeOpCode(U.OP_HASH160).writeBuffer(t).writeOpCode(U.OP_EQUALVERIFY).writeOpCode(U.OP_CHECKSIG)}unlock(e,t){const i=e instanceof ce?e.toTxFormat():e,u=Buffer.isBuffer(t)?t:t.toDer(!0);return new Ee().writeBuffer(i).writeBuffer(u)}estimateLength(){return 108}}class rp{lock(e){if(!Buffer.isBuffer(e)||e.length!==20)throw new Error("rHash must be a 20-byte buffer");return new Ee().writeOpCode(U.OP_OVER).writeOpCode(U.OP_3).writeOpCode(U.OP_SPLIT).writeOpCode(U.OP_NIP).writeOpCode(U.OP_TRUE).writeOpCode(U.OP_SPLIT).writeOpCode(U.OP_SWAP).writeOpCode(U.OP_SPLIT).writeOpCode(U.OP_DROP).writeOpCode(U.OP_HASH160).writeBuffer(e).writeOpCode(U.OP_EQUALVERIFY).writeOpCode(U.OP_CHECKSIG)}unlock(e,t){const i=e instanceof ce?e.toTxFormat():e,u=Buffer.isBuffer(t)?t:t.toDer(!0);return new Ee().writeBuffer(i).writeBuffer(u)}static hashR(e){const t=e instanceof ce?e.toTxFormat():e,i=t[3];return ae.sha256Ripemd160(t.slice(4,4+i))}}class ip{lock(e,t){const i=e.map(s=>Buffer.isBuffer(s)?s:Buffer.from(s)),u=new Ee;for(const s of i)u.writeBuffer(s);if(i.length===3)u.writeOpCode(U.OP_DROP).writeOpCode(U.OP_2DROP);else for(let s=0;s<i.length;s++)u.writeOpCode(U.OP_DROP);const r=Buffer.isBuffer(t)?t:t.toDer(!0);return u.writeBuffer(r).writeOpCode(U.OP_CHECKSIG)}unlock(e){const t=e instanceof ce?e.toTxFormat():e;return new Ee().writeBuffer(t)}}class es extends Ce{constructor(e=new Map){super({map:e})}toJSON(){const e={};return this.map.forEach((t,i)=>{e[i]=t.map(u=>({nScriptChunk:u.nScriptChunk,type:u.type,addressStr:u.addressStr,nHashType:u.nHashType,log:u.log}))}),e}fromJSON(e){return Object.keys(e).forEach(t=>{this.map.set(t,e[t].map(i=>({nScriptChunk:i.nScriptChunk,type:i.type,addressStr:i.addressStr,nHashType:i.nHashType,log:i.log})))}),this}setOne(e,t,i,u="sig",r,s=ce.SIGHASH_ALL|ce.SIGHASH_FORKID){const a=e.toString("hex")+":"+t,o={nScriptChunk:i,type:u,addressStr:r,nHashType:s};return this.map.set(a,[o]),this}setMany(e,t,i){const u=e.toString("hex")+":"+t;return i=i.map(r=>({type:r.type||"sig",nHashType:r.nHashType||ce.SIGHASH_ALL|ce.SIGHASH_FORKID,...r})),this.map.set(u,i),this}addOne(e,t,i,u="sig",r,s=ce.SIGHASH_ALL|ce.SIGHASH_FORKID){const a=this.get(e,t)||[];return a.push({nScriptChunk:i,type:u,addressStr:r,nHashType:s}),this.setMany(e,t,a),this}get(e,t){const i=e.toString("hex")+":"+t;return this.map.get(i)||[]}}class Ft{constructor(e=0,t=[]){this.blockHeight=e,this.path=t}fromBr(e){this.blockHeight=e.readVarIntNum(),this.treeHeight=e.readUInt8(),this.path=[];for(let t=0;t<this.treeHeight;t++){const i=[],u=e.readVarIntNum();for(let r=0;r<u;r++){const s=e.readVarIntNum(),a=e.readUInt8(),o=a===1?null:e.read(32);i.push({offset:s,flags:a,hash:o})}this.path.push(i)}return this}toBuffer(){const e=new Ss;e.writeVarIntNum(this.blockHeight),e.writeUInt8(this.treeHeight);for(const t of this.path){e.writeVarIntNum(t.length);for(const i of t)e.writeVarIntNum(i.offset),e.writeUInt8(i.flags),i.flags!==1&&e.write(i.hash)}return e.toBuffer()}static fromBr(e){return new Ft().fromBr(e)}fromBuffer(e){return this.fromBr(new _s(e))}static fromBuffer(e){return new Ft().fromBuffer(e)}toHex(){return this.toBuffer().toString("hex")}static fromHex(e){return Ft.fromBuffer(Buffer.from(e,"hex"))}toJSON(){return{raw:this.toHex(),blockHeight:this.blockHeight,path:this.path.map(e=>e.map(t=>({offset:t.offset,flags:t.flags,hash:t.hash?Buffer.from(t.hash).reverse().toString("hex"):void 0})))}}findLeaf(e,t){const u=(this.path[e]||[]).find(o=>o.offset===t);if(u)return u.flags===1?{offset:t,duplicate:!0}:{offset:t,hash:Buffer.from(u.hash)};if(e===0)return;const r=this.findLeaf(e-1,t*2);if(!r||!r.hash)return;const s=this.findLeaf(e-1,t*2+1);if(!s)return{offset:t,hash:ae.sha256Sha256(Buffer.concat([r.hash,r.hash]))};const a=s.duplicate?r.hash:s.hash;return{offset:t,hash:ae.sha256Sha256(Buffer.concat([r.hash,a]))}}computeRoot(e){const t=Buffer.from(e,"hex").reverse(),u=(this.path[0]||[]).find(s=>s.flags===2&&s.hash&&Buffer.from(s.hash).equals(t));if(!u)throw new Error("txid is not a client txid in this BUMP");let r=Buffer.from(t);for(let s=0;s<this.treeHeight;s++){const a=Math.floor(u.offset/Math.pow(2,s)),o=a%2===0?a+1:a-1,f=this.findLeaf(s,o);if(!f)throw new Error(`Missing hash for index ${u.offset} at height ${s}`);const n=f.duplicate?r:f.hash;r=o%2===1?ae.sha256Sha256(Buffer.concat([r,n])):ae.sha256Sha256(Buffer.concat([n,r]))}return Buffer.from(r).reverse().toString("hex")}}const Dh=4022206465;class ar{constructor(e=[],t=[]){this.bumps=e,this.transactions=t}fromBr(e){if(e.readUInt32LE()!==Dh)throw new Error("not a BEEF transaction");const i=e.readVarIntNum();this.bumps=[];for(let r=0;r<i;r++){const s=e.pos;this.bumps.push(Ft.fromBr(e)),this.bumps[r].raw=e.buf.slice(s,e.pos)}const u=e.readVarIntNum();this.transactions=[];for(let r=0;r<u;r++){const s=e.pos,a=new Pe().fromBr(e),o=e.buf.slice(s,e.pos),n=e.readUInt8()?e.readVarIntNum():void 0;this.transactions.push({tx:a,raw:o,bumpIndex:n})}return this}toBuffer(){const e=new Ss;e.writeUInt32LE(Dh),e.writeVarIntNum(this.bumps.length);for(const t of this.bumps)e.write(t.raw||t.toBuffer());e.writeVarIntNum(this.transactions.length);for(const t of this.transactions)e.write(t.raw||t.tx.toBuffer()),t.bumpIndex===void 0?e.writeUInt8(0):(e.writeUInt8(1),e.writeVarIntNum(t.bumpIndex));return e.toBuffer()}fromBuffer(e){return this.fromBr(new _s(e))}static fromBuffer(e){return new ar().fromBuffer(e)}toHex(){return this.toBuffer().toString("hex")}static fromHex(e){return ar.fromBuffer(Buffer.from(e,"hex"))}toJSON(){return{bumps:this.bumps.map(e=>e.toJSON()),transactions:this.transactions.map(e=>({tx:e.tx.toHex(),bumpIndex:e.bumpIndex}))}}static fromJSON(e){return new ar(e.bumps.map(t=>Ft.fromBuffer(Buffer.from(t.raw,"hex"))),e.transactions.map(t=>({tx:Pe.fromHex(t.tx),bumpIndex:t.bumpIndex})))}findTxid(e){return this.transactions.find(t=>t.tx.id()===e)}topologicalOrder(){const e=this.transactions.map(a=>a.tx.id()),t=new Map(e.map((a,o)=>[a,o])),i=this.transactions.map(()=>0),u=this.transactions.map(()=>[]);this.transactions.forEach((a,o)=>{for(const f of a.tx.txIns){const n=t.get(Buffer.from(f.txHashBuf).reverse().toString("hex"));n!==void 0&&(i[o]++,u[n].push(o))}});const r=[];for(let a=0;a<i.length;a++)i[a]===0&&r.push(a);const s=[];for(;r.length;){const a=r.shift();s.push(this.transactions[a]);for(const o of u[a])--i[o]===0&&r.push(o)}if(s.length!==this.transactions.length)throw new Error("BEEF transaction graph is not acyclic");return s}}const sr=function(d){if(!Number.isSafeInteger(d)||d<0)throw new RangeError("VarInt value must be a non-negative safe integer.");return d<=252?1:d<=65535?3:d<=4294967295?5:9},jd=function(d){return 36+sr(d)+d+4},zd=function(d){return sr(d)+d+8},Vd=function(d){let e=4+sr(d.txIns.length);for(const t of d.txIns)e+=jd(t.script?t.script.toBuffer().length:0);e+=sr(d.txOuts.length);for(const t of d.txOuts)e+=zd(t.script?t.script.toBuffer().length:0);return e+4};class Gd{computeFee(e){throw new Error("not implemented")}}class np extends Gd{constructor(e=50){super(),this.satoshisPerKb=e}computeFee(e){const t=Vd(e),i=new Z(this.satoshisPerKb).mul(new Z(t)).add(new Z(999)).div(new Z(1e3));return i.lt(1)?new Z(1):i}}class ts extends Ce{constructor(e=new Map){super({map:e})}toJSON(){const e={};return this.map.forEach((t,i)=>{e[i]=t.toHex()}),e}fromJSON(e){return Object.keys(e).forEach(t=>{this.map.set(t,yt.fromHex(e[t]))}),this}set(e,t,i){const u=e.toString("hex")+":"+t;return this.map.set(u,i),this}get(e,t){const i=e.toString("hex")+":"+t;return this.map.get(i)}setTx(e){const t=e.hash().toString("hex");return e.txOuts.forEach((i,u)=>{const r=t+":"+u;this.map.set(r,i)}),this}}const Yf=Oe.Default.TxBuilder;class ap extends Ce{constructor(e=new Pe,t=[],i=[],u=new ts,r=new es,s,a,o,f=Yf.feePerKbNum,n=0,c=1,h=1,l=Yf.dust,p=!1,b=new Kr){super({tx:e,txIns:t,txOuts:i,uTxOutMap:u,sigOperations:r,changeScript:s,changeAmountBn:a,feeAmountBn:o,feePerKbNum:f,nLockTime:n,versionBytesNum:c,sigsPerInput:h,dust:l,dustChangeToFees:p,hashCache:b})}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 Pe().fromHex(e.tx),this.txIns=e.txIns.map(t=>He.fromHex(t)),this.txOuts=e.txOuts.map(t=>yt.fromHex(t)),this.uTxOutMap=new ts().fromJSON(e.uTxOutMap),this.sigOperations=new es().fromJSON(e.sigOperations),this.changeScript=e.changeScript?new Ee().fromHex(e.changeScript):void 0,this.changeAmountBn=e.changeAmountBn?new Z(e.changeAmountBn):void 0,this.feeAmountBn=e.feeAmountBn?new Z(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=Kr.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=Yf.dust){return this.dust=e,this}sendDustChangeToFees(e=!1){return this.dustChangeToFees=e,this}importPartiallySignedTx(e,t=this.uTxOutMap,i=this.sigOperations){return this.tx=e,this.uTxOutMap=t,this.sigOperations=i,this}inputFromScript(e,t,i,u,r){if(!Buffer.isBuffer(e)||typeof t!="number"||!(i instanceof yt)||!(u instanceof Ee))throw new Error("invalid one of: txHashBuf, txOutNum, txOut, script");return this.txIns.push(He.fromProperties(e,t,u,r)),this.uTxOutMap.set(e,t,i),this}addSigOperation(e,t,i,u,r,s){return this.sigOperations.addOne(e,t,i,u,r,s),this}inputFromPubKeyHash(e,t,i,u,r,s){if(!Buffer.isBuffer(e)||typeof t!="number"||!(i instanceof yt))throw new Error("invalid one of: txHashBuf, txOutNum, txOut");this.txIns.push(new He().fromObject({nSequence:r}).fromPubKeyHashTxOut(e,t,i,u)),this.uTxOutMap.set(e,t,i);const a=gt.fromTxOutScript(i.script).toString();return this.addSigOperation(e,t,0,"sig",a,s),this.addSigOperation(e,t,1,"pubKey",a),this}outputToAddress(e,t){if(!(t instanceof gt)||!(e instanceof Z))throw new Error("addr must be an Address, and valueBn must be a Bn");const i=new Ee().fromPubKeyHash(t.hashBuf);return this.outputToScript(e,i),this}outputToScript(e,t){if(!(t instanceof Ee)||!(e instanceof Z))throw new Error("script must be a Script, and valueBn must be a Bn");const i=yt.fromProperties(e,t);return this.txOuts.push(i),this}buildOutputs(){let e=new Z(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 i=new Z(0);for(const u of this.txIns){const r=this.uTxOutMap.get(u.txHashBuf,u.txOutNum);if(i=i.add(r.valueBn),this.tx.addTxIn(u),i.geq(e)){if(t<=0)break;t--}}if(i.lt(e))throw new Error("not enough funds for outputs: inAmountBn "+i.toNumber()+" outAmountBn "+e.toNumber());return i}estimateSize(){let i=this.tx.toBuffer().length;return this.tx.txIns.forEach(u=>{const{txHashBuf:r,txOutNum:s}=u;this.sigOperations.get(r,s).forEach(o=>{const{nScriptChunk:f,type:n}=o,h=new Ee([u.script.chunks[f]]).toBuffer().length;if(i-=h,n==="sig")i+=72;else if(o.type==="pubKey")i+=35;else throw new Error("unsupported sig operations type")})}),i=i+1,Math.round(i)}estimateFee(e=new Z(0)){const t=Math.ceil(this.estimateSize()/1e3*this.feePerKbNum);return new Z(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 i=e.useAllInputs?this.txIns.length-1:0;i<this.txIns.length;i++){this.tx=new Pe;const u=this.buildOutputs(),r=yt.fromProperties(new Z(0),this.changeScript);this.tx.addTxOut(r);let s;try{s=this.buildInputs(u,i)}catch(a){throw a.message.includes("not enough funds for outputs")?new Error("unable to gather enough inputs for outputs and fee"):a}if(this.changeAmountBn=s.sub(u),r.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=De.fromNumber(this.tx.txOutsVi.toNumber()-1),this.feeAmountBn=this.feeAmountBn.add(this.changeAmountBn),this.changeAmountBn=new Z(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 i=0;for(let u=1;u<t.chunks.length-1;u++)t.chunks[u].buf&&i++;return i===e}static removeBlankSigs(e){e=new Ee(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,i){const u=this.tx.txIns[e];return u.script.chunks[t]=new Ee().writeBuffer(i.toTxFormat()).chunks[0],u.scriptVi=De.fromNumber(u.script.toBuffer().length),this}getSig(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r=Pe.SCRIPT_ENABLE_SIGHASH_FORKID){let s;if(t&ce.SIGHASH_FORKID&&r&Pe.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[i].txHashBuf,o=this.tx.txIns[i].txOutNum,f=this.uTxOutMap.get(a,o);if(!f)throw new Error("for SIGHASH_FORKID must provide UTXOs");s=f.valueBn}return this.tx.sign(e,t,i,u,s,r,this.hashCache)}asyncGetSig(e,t=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,i,u,r=Pe.SCRIPT_ENABLE_SIGHASH_FORKID){let s;if(t&ce.SIGHASH_FORKID&&r&Pe.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[i].txHashBuf,o=this.tx.txIns[i].txOutNum,f=this.uTxOutMap.get(a,o);if(!f)throw new Error("for SIGHASH_FORKID must provide UTXOs");s=f.valueBn}return this.tx.asyncSign(e,t,i,u,s,r,this.hashCache)}signTxIn(e,t,i,u,r=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,s=Pe.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[e],o=a.script;if(u===void 0&&o.isPubKeyHashIn()&&(u=0),u===void 0)throw new Error("cannot sign unknown script type for input "+e);const f=a.txHashBuf,n=a.txOutNum;i||(i=this.uTxOutMap.get(f,n));const h=i.script,l=this.getSig(t,r,e,h,s,this.hashCache);return this.fillSig(e,u,l),this}async asyncSignTxIn(e,t,i,u,r=ce.SIGHASH_ALL|ce.SIGHASH_FORKID,s=Pe.SCRIPT_ENABLE_SIGHASH_FORKID){const a=this.tx.txIns[e],o=a.script;if(u===void 0&&o.isPubKeyHashIn()&&(u=0),u===void 0)throw new Error("cannot sign unknown script type for input "+e);const f=a.txHashBuf,n=a.txOutNum;i||(i=this.uTxOutMap.get(f,n));const h=i.script,l=await this.asyncGetSig(t,r,e,h,s,this.hashCache);return this.fillSig(e,u,l),this}signWithKeyPairs(e){const t={};for(const i of e){const u=gt.fromPubKey(i.pubKey).toString();t[u]=i}for(const i in this.tx.txIns){const u=this.tx.txIns[i],r=this.sigOperations.get(u.txHashBuf,u.txOutNum);for(const s of r){const{nScriptChunk:a,type:o,addressStr:f,nHashType:n}=s,c=t[f];if(!c){s.log=`cannot find keyPair for addressStr ${f}`;continue}const h=this.uTxOutMap.get(u.txHashBuf,u.txOutNum);if(o==="sig")this.signTxIn(i,c,h,a,n),s.log="successfully inserted signature";else if(o==="pubKey")u.script.chunks[a]=new Ee().writeBuffer(c.pubKey.toBuffer()).chunks[0],u.setScript(u.script),s.log="successfully inserted public key";else{s.log=`cannot perform operation of type ${o}`;continue}}}return this}}class jr extends Ce{constructor(e,t,i,u){super({tx:e,txOutMap:t,errStr:i,interp:u})}verify(e=re.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,i){return new jr(e,t).verify(i)}static asyncVerify(e,t,i){return new jr(e,t).asyncVerify(i)}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>ei.MAX_BLOCK_SIZE)return this.errStr="transaction over the maximum block size",this.errStr;let e=new Z(0);for(let i=0;i<this.tx.txOuts.length;i++){const u=this.tx.txOuts[i];if(u.valueBn.lt(0))return this.errStr="transaction txOut "+i+" negative",this.errStr;if(u.valueBn.gt(Pe.MAX_MONEY))return this.errStr="transaction txOut "+i+" greater than MAX_MONEY",this.errStr;if(e=e.add(u.valueBn),e.gt(Pe.MAX_MONEY))return this.errStr="transaction txOut "+i+" total output greater than MAX_MONEY",this.errStr}const t={};for(let i=0;i<this.tx.txIns.length;i++){const u=this.tx.txIns[i],r=u.txHashBuf.toString("hex")+":"+u.txOutNum;if(t[r]!==void 0)return this.errStr="transaction input "+i+" duplicate input",this.errStr;t[r]=!0}if(this.tx.isCoinbase()){const i=this.tx.txIns[0].script.toBuffer();if(i.length<2||i.length>100)return this.errStr="coinbase trasaction script size invalid",this.errStr}else for(let i=0;i<this.tx.txIns.length;i++)if(this.tx.txIns[i].hasNullInput())return this.errStr="transaction input "+i+" 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 i=this.tx.txIns[e],u=i.script,r=this.txOutMap.get(i.txHashBuf,i.txOutNum);if(!r)return console.log("output "+i.txOutNum+" not found"),!1;const s=r.script,a=r.valueBn;return this.interp=new re,this.interp.verify(u,s,this.tx,e,t,a)}async asyncVerifyNIn(e,t){const i=this.tx.txIns[e],u=i.script,r=this.txOutMap.get(i.txHashBuf,i.txOutNum);if(!r)return console.log("output "+i.txOutNum+" not found"),!1;const s=r.script,a=r.valueBn;this.interp=new re;const o=await le.asyncObjectMethod(this.interp,"verify",[u,s,this.tx,e,t,a]);return JSON.parse(o.resbuf.toString())}getDebugObject(){return{errStr:this.errStr,interpFailure:this.interp?this.interp.getDebugObject():void 0}}getDebugString(){return JSON.stringify(this.getDebugObject(),null,2)}}class je{}je.encrypt=function(d,e){const t=je.buf2Words(e),i=je.buf2Words(d),r=new as(t).encrypt(i);return je.words2Buf(r)};je.decrypt=function(d,e){const t=je.buf2Words(d),i=je.buf2Words(e),r=new as(i).decrypt(t);return je.words2Buf(r)};je.buf2Words=function(d){if(d.length%4)throw new Error("buf length must be a multiple of 4");const e=[];for(let t=0;t<d.length/4;t++)e.push(d.readUInt32BE(t*4));return e};je.words2Buf=function(d){const e=Buffer.alloc(d.length*4);for(let t=0;t<d.length;t++)e.writeUInt32BE(d[t],t*4);return e};class Ue{}Ue.buf2BlocksBuf=function(d,e){const t=e/8,i=[];for(let u=0;u<=d.length/t;u++){let r=d.slice(u*t,u*t+t);r.length<e&&(r=Ue.pkcs7Pad(r,e)),i.push(r)}return i};Ue.blockBufs2Buf=function(d){let e=d[d.length-1];return e=Ue.pkcs7Unpad(e),d[d.length-1]=e,Buffer.concat(d)};Ue.encrypt=function(d,e,t,i){const u=e.length*8,r=Ue.buf2BlocksBuf(d,u),s=Ue.encryptBlocks(r,e,t,i);return Buffer.concat(s)};Ue.decrypt=function(d,e,t,i){const u=e.length,r=[];for(let o=0;o<d.length/u;o++)r.push(d.slice(o*u,o*u+u));const s=Ue.decryptBlocks(r,e,t,i);return Ue.blockBufs2Buf(s)};Ue.encryptBlock=function(d,e,t,i){const u=Ue.xorBufs(d,e);return t.encrypt(u,i)};Ue.decryptBlock=function(d,e,t,i){const u=t.decrypt(d,i);return Ue.xorBufs(u,e)};Ue.encryptBlocks=function(d,e,t,i){const u=[];for(let r=0;r<d.length;r++){const s=d[r],a=Ue.encryptBlock(s,e,t,i);u.push(a),e=a}return u};Ue.decryptBlocks=function(d,e,t,i){const u=[];for(let r=0;r<d.length;r++){const s=d[r],a=Ue.decryptBlock(s,e,t,i);u.push(a),e=s}return u};Ue.pkcs7Pad=function(d,e){const i=e/8-d.length,u=Buffer.alloc(i);return u.fill(i),Buffer.concat([d,u])};Ue.pkcs7Unpad=function(d){const e=d[d.length-1],t=d.slice(d.length-e,d.length),i=Buffer.alloc(e);if(i.fill(e),!Nt(t,i))throw new Error("invalid padding");return d.slice(0,d.length-e)};Ue.xorBufs=function(d,e){if(d.length!==e.length)throw new Error("bufs must have the same length");const t=Buffer.alloc(d.length);for(let i=0;i<d.length;i++)t[i]=d[i]^e[i];return t};class At{}At.encrypt=function(d,e,t,i=!0){t=t||It.getRandomBuffer(128/8);const u=Ue.encrypt(d,t,je,e);return i?Buffer.concat([t,u]):u};At.decrypt=function(d,e,t=!1){if(t){const i=d;return Ue.decrypt(i,t,je,e)}else{const i=d.slice(0,16),u=d.slice(128/8);return Ue.decrypt(u,i,je,e)}};class Ut{}Ut.encrypt=function(d,e,t){const i=At.encrypt(d,e,t),u=ae.sha256Hmac(i,e);return Buffer.concat([u,i])};Ut.asyncEncrypt=async function(d,e,t){t||(t=It.getRandomBuffer(128/8));const i=[d,e,t];return(await le.asyncClassMethod(Ut,"encrypt",i)).resbuf};Ut.decrypt=function(d,e){if(d.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=d.slice(0,256/8);d=d.slice(256/8,d.length);const i=ae.sha256Hmac(d,e);if(!Nt(t,i))throw new Error("Message authentication failed - Hmacs are not equivalent");return At.decrypt(d,e)};Ut.asyncDecrypt=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(Ut,"decrypt",t)).resbuf};const fp=function(d,e){const t=Buffer.alloc(16);for(let i=0;i<16;i++)t[i]=d[i]^e[i];return t},sp=function(d,e){const t=je.buf2Words(d),i=je.buf2Words(e),u=[0,0,0,0];for(let r=0;r<128;r++){if((t[Math.floor(r/32)]&2147483648>>>r%32)!==0)for(let a=0;a<4;a++)u[a]^=i[a];const s=i[3]&1;i[3]=i[3]>>>1|(i[2]&1)<<31,i[2]=i[2]>>>1|(i[1]&1)<<31,i[1]=i[1]>>>1|(i[0]&1)<<31,i[0]=i[0]>>>1,s&&(i[0]^=3774873600)}return je.words2Buf(u.map(function(r){return r>>>0}))},jt=function(d){const e=(16-d.length%16)%16;return e?Buffer.concat([d,Buffer.alloc(e)]):Buffer.from(d)},rs=function(d,e){let t=Buffer.alloc(16);const i=jt(e);for(let u=0;u<i.length;u+=16)t=sp(fp(t,i.slice(u,u+16)),d);return t},is=function(d,e,t){d.writeUInt32BE(Math.floor(e/4294967296),t),d.writeUInt32BE(e>>>0,t+4)},op=function(d){const e=Buffer.alloc(16);return is(e,d,8),e},Fh=function(d,e){const t=Buffer.alloc(16);return is(t,d,0),is(t,e,8),t},ns=function(d){const e=Buffer.from(d);let t=1;for(let i=15;i>=12&&t;i--){const u=e[i]+t;e[i]=u&255,t=u>>8}return e},Lr=function(d,e,t){const i=Buffer.alloc(t.length);let u=Buffer.from(e);for(let r=0;r<t.length;r+=16){const s=je.encrypt(u,d),a=Math.min(16,t.length-r);for(let o=0;o<a;o++)i[r+o]=t[r+o]^s[o];u=ns(u)}return i},Uh=function(d,e){if(e.length===12)return Buffer.concat([e,Buffer.from([0,0,0,1])]);const t=je.encrypt(Buffer.alloc(16),d),i=Buffer.concat([jt(e),Buffer.alloc(8),op(e.length*8).slice(8)]);return rs(t,i)};class zr{static encrypt(e,t,i,u=Buffer.alloc(0)){const r=je.encrypt(Buffer.alloc(16),e),s=Uh(e,t),a=Lr(e,ns(s),i),o=rs(r,Buffer.concat([jt(u),jt(a),Fh(u.length*8,a.length*8)]));return{ciphertext:a,tag:Lr(e,s,o).slice(0,16)}}static decrypt(e,t,i,u,r=Buffer.alloc(0)){const s=je.encrypt(Buffer.alloc(16),e),a=Uh(e,t),o=rs(s,Buffer.concat([jt(r),jt(i),Fh(r.length*8,i.length*8)])),f=Lr(e,a,o).slice(0,16);if(!Buffer.from(u).equals(Buffer.from(f)))throw new Error("AES-GCM authentication failed");return Lr(e,ns(a),i)}static encryptBrc2(e,t){const i=Buffer.alloc(32);for(let r=0;r<i.length;r+=4)i.writeUInt32LE(Math.random()*4294967296>>>0,r);const u=zr.encrypt(e,i,t);return Buffer.concat([i,u.ciphertext,u.tag])}static decryptBrc2(e,t){if(t.length<48)throw new Error("AES-GCM ciphertext is too short");const i=t.slice(0,32),u=t.slice(t.length-16),r=t.slice(32,t.length-16);return zr.decrypt(e,i,r,u)}}class _t{}_t.ivkEkM=function(d,e){const t=d.bn,u=e.point.mul(t),s=new qe(u).toBuffer(),a=ae.sha512(s);return{iv:a.slice(0,16),kE:a.slice(16,32),kM:a.slice(32,64)}};_t.electrumEncrypt=function(d,e,t,i=!1){if(!Buffer.isBuffer(d))throw new Error("messageBuf must be a buffer");let u;t===null&&(t=ct.fromRandom()),i||(u=t.pubKey.toDer(!0));const{iv:r,kE:s,kM:a}=_t.ivkEkM(t.privKey,e),o=At.encrypt(d,s,r,!1),f=Buffer.from("BIE1");let n;u?n=Buffer.concat([f,u,o]):n=Buffer.concat([f,o]);const c=ae.sha256Hmac(n,a);return Buffer.concat([n,c])};_t.electrumDecrypt=function(d,e,t=null){if(!Buffer.isBuffer(d))throw new Error("encBuf must be a buffer");const i=32;if(!d.slice(0,4).equals(Buffer.from("BIE1")))throw new Error("Invalid Magic");let r=4;if(t===null){const h=d.slice(4,37);t=qe.fromDer(h),r=37}const{iv:s,kE:a,kM:o}=_t.ivkEkM(e,t),f=d.slice(r,d.length-i),n=d.slice(d.length-i,d.length),c=ae.sha256Hmac(d.slice(0,d.length-i),o);if(!n.equals(c))throw new Error("Invalid checksum");return At.decrypt(f,a,s)};_t.bitcoreEncrypt=function(d,e,t,i){t||(t=ct.fromRandom());const u=t.privKey.bn,s=t.pubKey.toDer(!0),n=e.point.mul(u).getX().toBuffer({size:32}),c=ae.sha512(n),h=c.slice(0,32),l=c.slice(32,64),p=At.encrypt(d,h,i),b=ae.sha256Hmac(p,l);return Buffer.concat([s,p,b])};_t.asyncBitcoreEncrypt=async function(d,e,t,i){t||(t=await ct.asyncFromRandom()),i||(i=It.getRandomBuffer(128/8));const u=[d,e,t,i];return(await le.asyncClassMethod(_t,"bitcoreEncrypt",u)).resbuf};_t.bitcoreDecrypt=function(d,e){const t=e.bn,r=qe.fromDer(d.slice(0,33)).point.mul(t);if(r.eq(new Ae))throw new Error("P equals 0");const a=r.getX().toBuffer({size:32}),o=ae.sha512(a),f=o.slice(0,32),n=o.slice(32,64),c=d.slice(33,d.length-32),h=d.slice(d.length-32,d.length),l=ae.sha256Hmac(c,n);if(!Nt(h,l))throw new Error("Invalid checksum");return At.decrypt(c,f)};_t.asyncBitcoreDecrypt=async function(d,e){const t=[d,e];return(await le.asyncClassMethod(_t,"bitcoreDecrypt",t)).resbuf};const cp={aes:as,bnjs:ut,bs58:Jf,elliptic:qd,hashjs:gr,pbkdf2:Hd,Buffer:F1.Buffer},up=q1.version;exports.Ach=Ut;exports.Address=gt;exports.Aes=je;exports.AesGcm=zr;exports.Aescbc=At;exports.Base58=Gt;exports.Base58Check=Bt;exports.Beef=ar;exports.Bip32=fr;exports.Bip39=Hr;exports.Block=ei;exports.BlockHeader=nr;exports.Bn=Z;exports.Br=st;exports.Bsm=mt;exports.Bump=Ft;exports.Bw=ke;exports.Cbc=Ue;exports.Constants=Oe;exports.Ecdsa=ht;exports.Ecies=_t;exports.FeeModel=Gd;exports.Hash=ae;exports.Interp=re;exports.KeyPair=ct;exports.MinableBlock=Kd;exports.MiningUtils=Z1;exports.OpCode=U;exports.P2PKH=tp;exports.Point=Ae;exports.PrivKey=wt;exports.PubKey=qe;exports.PushDrop=ip;exports.RPuzzle=rp;exports.Random=It;exports.Reader=_s;exports.SafeRecord=Lt;exports.SatoshisPerKilobyte=np;exports.Script=Ee;exports.Sig=ce;exports.SigOperations=es;exports.Struct=Ce;exports.Tx=Pe;exports.TxBuilder=ap;exports.TxIn=He;exports.TxOut=yt;exports.TxOutMap=ts;exports.TxVerifier=jr;exports.VarInt=De;exports.Workers=le;exports.WorkersResult=Qf;exports.Writer=Ss;exports.cmp=Nt;exports.deps=cp;exports.en=Fr;exports.es=qr;exports.getConstants=W1;exports.jp=Ur;exports.transactionInputSize=jd;exports.transactionOutputSize=zd;exports.transactionSize=Vd;exports.varUintSize=sr;exports.version=up;
10
10
  //# sourceMappingURL=bsv2.cjs.map