@signumjs/crypto
Version:
Cryptographic functions for building Signum Network apps.
1 lines • 119 kB
JavaScript
"use strict";var sig$crypto=(()=>{var ia=Object.create;var mt=Object.defineProperty;var na=Object.getOwnPropertyDescriptor;var aa=Object.getOwnPropertyNames;var oa=Object.getPrototypeOf,la=Object.prototype.hasOwnProperty;var fa=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Z=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),sa=(e,r)=>{for(var t in r)mt(e,t,{get:r[t],enumerable:!0})},Zr=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of aa(r))!la.call(e,n)&&n!==t&&mt(e,n,{get:()=>r[n],enumerable:!(i=na(r,n))||i.enumerable});return e};var vt=(e,r,t)=>(t=e!=null?ia(oa(e)):{},Zr(r||!e||!e.__esModule?mt(t,"default",{value:e,enumerable:!0}):t,e)),ha=e=>Zr(mt({},"__esModule",{value:!0}),e);var ve=Z($=>{"use strict";var ua=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function ca(e,r){return Object.prototype.hasOwnProperty.call(e,r)}$.assign=function(e){for(var r=Array.prototype.slice.call(arguments,1);r.length;){var t=r.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(var i in t)ca(t,i)&&(e[i]=t[i])}}return e};$.shrinkBuf=function(e,r){return e.length===r?e:e.subarray?e.subarray(0,r):(e.length=r,e)};var da={arraySet:function(e,r,t,i,n){if(r.subarray&&e.subarray){e.set(r.subarray(t,t+i),n);return}for(var a=0;a<i;a++)e[n+a]=r[t+a]},flattenChunks:function(e){var r,t,i,n,a,o;for(i=0,r=0,t=e.length;r<t;r++)i+=e[r].length;for(o=new Uint8Array(i),n=0,r=0,t=e.length;r<t;r++)a=e[r],o.set(a,n),n+=a.length;return o}},pa={arraySet:function(e,r,t,i,n){for(var a=0;a<i;a++)e[n+a]=r[t+a]},flattenChunks:function(e){return[].concat.apply([],e)}};$.setTyped=function(e){e?($.Buf8=Uint8Array,$.Buf16=Uint16Array,$.Buf32=Int32Array,$.assign($,da)):($.Buf8=Array,$.Buf16=Array,$.Buf32=Array,$.assign($,pa))};$.setTyped(ua)});var Yt=Z((Go,qr)=>{"use strict";function xa(e,r,t,i){for(var n=e&65535|0,a=e>>>16&65535|0,o=0;t!==0;){o=t>2e3?2e3:t,t-=o;do n=n+r[i++]|0,a=a+n|0;while(--o);n%=65521,a%=65521}return n|a<<16|0}qr.exports=xa});var $t=Z((Vo,Pr)=>{"use strict";function ga(){for(var e,r=[],t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;r[t]=e}return r}var ya=ga();function wa(e,r,t,i){var n=ya,a=i+t;e^=-1;for(var o=i;o<a;o++)e=e>>>8^n[(e^r[o])&255];return e^-1}Pr.exports=wa});var Kr=Z((Xo,Hr)=>{"use strict";var bt=30,_a=12;Hr.exports=function(r,t){var i,n,a,o,l,h,s,f,p,g,u,F,b,S,k,v,U,R,A,c,w,_,y,B,x;i=r.state,n=r.next_in,B=r.input,a=n+(r.avail_in-5),o=r.next_out,x=r.output,l=o-(t-r.avail_out),h=o+(r.avail_out-257),s=i.dmax,f=i.wsize,p=i.whave,g=i.wnext,u=i.window,F=i.hold,b=i.bits,S=i.lencode,k=i.distcode,v=(1<<i.lenbits)-1,U=(1<<i.distbits)-1;e:do{b<15&&(F+=B[n++]<<b,b+=8,F+=B[n++]<<b,b+=8),R=S[F&v];t:for(;;){if(A=R>>>24,F>>>=A,b-=A,A=R>>>16&255,A===0)x[o++]=R&65535;else if(A&16){c=R&65535,A&=15,A&&(b<A&&(F+=B[n++]<<b,b+=8),c+=F&(1<<A)-1,F>>>=A,b-=A),b<15&&(F+=B[n++]<<b,b+=8,F+=B[n++]<<b,b+=8),R=k[F&U];r:for(;;){if(A=R>>>24,F>>>=A,b-=A,A=R>>>16&255,A&16){if(w=R&65535,A&=15,b<A&&(F+=B[n++]<<b,b+=8,b<A&&(F+=B[n++]<<b,b+=8)),w+=F&(1<<A)-1,w>s){r.msg="invalid distance too far back",i.mode=bt;break e}if(F>>>=A,b-=A,A=o-l,w>A){if(A=w-A,A>p&&i.sane){r.msg="invalid distance too far back",i.mode=bt;break e}if(_=0,y=u,g===0){if(_+=f-A,A<c){c-=A;do x[o++]=u[_++];while(--A);_=o-w,y=x}}else if(g<A){if(_+=f+g-A,A-=g,A<c){c-=A;do x[o++]=u[_++];while(--A);if(_=0,g<c){A=g,c-=A;do x[o++]=u[_++];while(--A);_=o-w,y=x}}}else if(_+=g-A,A<c){c-=A;do x[o++]=u[_++];while(--A);_=o-w,y=x}for(;c>2;)x[o++]=y[_++],x[o++]=y[_++],x[o++]=y[_++],c-=3;c&&(x[o++]=y[_++],c>1&&(x[o++]=y[_++]))}else{_=o-w;do x[o++]=x[_++],x[o++]=x[_++],x[o++]=x[_++],c-=3;while(c>2);c&&(x[o++]=x[_++],c>1&&(x[o++]=x[_++]))}}else if(A&64){r.msg="invalid distance code",i.mode=bt;break e}else{R=k[(R&65535)+(F&(1<<A)-1)];continue r}break}}else if(A&64)if(A&32){i.mode=_a;break e}else{r.msg="invalid literal/length code",i.mode=bt;break e}else{R=S[(R&65535)+(F&(1<<A)-1)];continue t}break}}while(n<a&&o<h);c=b>>3,n-=c,b-=c<<3,F&=(1<<b)-1,r.next_in=n,r.next_out=o,r.avail_in=n<a?5+(a-n):5-(n-a),r.avail_out=o<h?257+(h-o):257-(o-h),i.hold=F,i.bits=b}});var Xr=Z((Jo,Vr)=>{"use strict";var jr=ve(),Ze=15,Yr=852,$r=592,Wr=0,Wt=1,Gr=2,ma=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],va=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],ba=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Fa=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];Vr.exports=function(r,t,i,n,a,o,l,h){var s=h.bits,f=0,p=0,g=0,u=0,F=0,b=0,S=0,k=0,v=0,U=0,R,A,c,w,_,y=null,B=0,x,I=new jr.Buf16(Ze+1),m=new jr.Buf16(Ze+1),C=null,N=0,Y,H,J;for(f=0;f<=Ze;f++)I[f]=0;for(p=0;p<n;p++)I[t[i+p]]++;for(F=s,u=Ze;u>=1&&I[u]===0;u--);if(F>u&&(F=u),u===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,h.bits=1,0;for(g=1;g<u&&I[g]===0;g++);for(F<g&&(F=g),k=1,f=1;f<=Ze;f++)if(k<<=1,k-=I[f],k<0)return-1;if(k>0&&(r===Wr||u!==1))return-1;for(m[1]=0,f=1;f<Ze;f++)m[f+1]=m[f]+I[f];for(p=0;p<n;p++)t[i+p]!==0&&(l[m[t[i+p]]++]=p);if(r===Wr?(y=C=l,x=19):r===Wt?(y=ma,B-=257,C=va,N-=257,x=256):(y=ba,C=Fa,x=-1),U=0,p=0,f=g,_=o,b=F,S=0,c=-1,v=1<<F,w=v-1,r===Wt&&v>Yr||r===Gr&&v>$r)return 1;for(;;){Y=f-S,l[p]<x?(H=0,J=l[p]):l[p]>x?(H=C[N+l[p]],J=y[B+l[p]]):(H=96,J=0),R=1<<f-S,A=1<<b,g=A;do A-=R,a[_+(U>>S)+A]=Y<<24|H<<16|J|0;while(A!==0);for(R=1<<f-1;U&R;)R>>=1;if(R!==0?(U&=R-1,U+=R):U=0,p++,--I[f]===0){if(f===u)break;f=t[i+l[p]]}if(f>F&&(U&w)!==c){for(S===0&&(S=F),_+=g,b=f-S,k=1<<b;b+S<u&&(k-=I[b+S],!(k<=0));)b++,k<<=1;if(v+=1<<b,r===Wt&&v>Yr||r===Gr&&v>$r)return 1;c=U&w,a[c]=F<<24|b<<16|_-o|0}}return U!==0&&(a[_+U]=f-S<<24|64<<16|0),h.bits=F,0}});var Ci=Z(ae=>{"use strict";var Q=ve(),er=Yt(),fe=$t(),ka=Kr(),tt=Xr(),Ea=0,Fi=1,ki=2,Jr=4,Aa=5,Ft=6,Ie=0,Ba=1,Sa=2,ee=-2,Ei=-3,tr=-4,Ua=-5,Qr=8,Ai=1,ei=2,ti=3,ri=4,ii=5,ni=6,ai=7,oi=8,li=9,fi=10,At=11,xe=12,Gt=13,si=14,Vt=15,hi=16,ui=17,ci=18,di=19,kt=20,Et=21,pi=22,xi=23,gi=24,yi=25,wi=26,Xt=27,_i=28,mi=29,O=30,rr=31,Ia=32,Ra=852,Ca=592,Ta=15,za=Ta;function vi(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Da(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Q.Buf16(320),this.work=new Q.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Bi(e){var r;return!e||!e.state?ee:(r=e.state,e.total_in=e.total_out=r.total=0,e.msg="",r.wrap&&(e.adler=r.wrap&1),r.mode=Ai,r.last=0,r.havedict=0,r.dmax=32768,r.head=null,r.hold=0,r.bits=0,r.lencode=r.lendyn=new Q.Buf32(Ra),r.distcode=r.distdyn=new Q.Buf32(Ca),r.sane=1,r.back=-1,Ie)}function Si(e){var r;return!e||!e.state?ee:(r=e.state,r.wsize=0,r.whave=0,r.wnext=0,Bi(e))}function Ui(e,r){var t,i;return!e||!e.state||(i=e.state,r<0?(t=0,r=-r):(t=(r>>4)+1,r<48&&(r&=15)),r&&(r<8||r>15))?ee:(i.window!==null&&i.wbits!==r&&(i.window=null),i.wrap=t,i.wbits=r,Si(e))}function Ii(e,r){var t,i;return e?(i=new Da,e.state=i,i.window=null,t=Ui(e,r),t!==Ie&&(e.state=null),t):ee}function Na(e){return Ii(e,za)}var bi=!0,Jt,Qt;function Oa(e){if(bi){var r;for(Jt=new Q.Buf32(512),Qt=new Q.Buf32(32),r=0;r<144;)e.lens[r++]=8;for(;r<256;)e.lens[r++]=9;for(;r<280;)e.lens[r++]=7;for(;r<288;)e.lens[r++]=8;for(tt(Fi,e.lens,0,288,Jt,0,e.work,{bits:9}),r=0;r<32;)e.lens[r++]=5;tt(ki,e.lens,0,32,Qt,0,e.work,{bits:5}),bi=!1}e.lencode=Jt,e.lenbits=9,e.distcode=Qt,e.distbits=5}function Ri(e,r,t,i){var n,a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Q.Buf8(a.wsize)),i>=a.wsize?(Q.arraySet(a.window,r,t-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),Q.arraySet(a.window,r,t-i,n,a.wnext),i-=n,i?(Q.arraySet(a.window,r,t-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}function La(e,r){var t,i,n,a,o,l,h,s,f,p,g,u,F,b,S=0,k,v,U,R,A,c,w,_,y=new Q.Buf8(4),B,x,I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return ee;t=e.state,t.mode===xe&&(t.mode=Gt),o=e.next_out,n=e.output,h=e.avail_out,a=e.next_in,i=e.input,l=e.avail_in,s=t.hold,f=t.bits,p=l,g=h,_=Ie;e:for(;;)switch(t.mode){case Ai:if(t.wrap===0){t.mode=Gt;break}for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(t.wrap&2&&s===35615){t.check=0,y[0]=s&255,y[1]=s>>>8&255,t.check=fe(t.check,y,2,0),s=0,f=0,t.mode=ei;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((s&255)<<8)+(s>>8))%31){e.msg="incorrect header check",t.mode=O;break}if((s&15)!==Qr){e.msg="unknown compression method",t.mode=O;break}if(s>>>=4,f-=4,w=(s&15)+8,t.wbits===0)t.wbits=w;else if(w>t.wbits){e.msg="invalid window size",t.mode=O;break}t.dmax=1<<w,e.adler=t.check=1,t.mode=s&512?fi:xe,s=0,f=0;break;case ei:for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(t.flags=s,(t.flags&255)!==Qr){e.msg="unknown compression method",t.mode=O;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=O;break}t.head&&(t.head.text=s>>8&1),t.flags&512&&(y[0]=s&255,y[1]=s>>>8&255,t.check=fe(t.check,y,2,0)),s=0,f=0,t.mode=ti;case ti:for(;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}t.head&&(t.head.time=s),t.flags&512&&(y[0]=s&255,y[1]=s>>>8&255,y[2]=s>>>16&255,y[3]=s>>>24&255,t.check=fe(t.check,y,4,0)),s=0,f=0,t.mode=ri;case ri:for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}t.head&&(t.head.xflags=s&255,t.head.os=s>>8),t.flags&512&&(y[0]=s&255,y[1]=s>>>8&255,t.check=fe(t.check,y,2,0)),s=0,f=0,t.mode=ii;case ii:if(t.flags&1024){for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}t.length=s,t.head&&(t.head.extra_len=s),t.flags&512&&(y[0]=s&255,y[1]=s>>>8&255,t.check=fe(t.check,y,2,0)),s=0,f=0}else t.head&&(t.head.extra=null);t.mode=ni;case ni:if(t.flags&1024&&(u=t.length,u>l&&(u=l),u&&(t.head&&(w=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),Q.arraySet(t.head.extra,i,a,u,w)),t.flags&512&&(t.check=fe(t.check,i,u,a)),l-=u,a+=u,t.length-=u),t.length))break e;t.length=0,t.mode=ai;case ai:if(t.flags&2048){if(l===0)break e;u=0;do w=i[a+u++],t.head&&w&&t.length<65536&&(t.head.name+=String.fromCharCode(w));while(w&&u<l);if(t.flags&512&&(t.check=fe(t.check,i,u,a)),l-=u,a+=u,w)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=oi;case oi:if(t.flags&4096){if(l===0)break e;u=0;do w=i[a+u++],t.head&&w&&t.length<65536&&(t.head.comment+=String.fromCharCode(w));while(w&&u<l);if(t.flags&512&&(t.check=fe(t.check,i,u,a)),l-=u,a+=u,w)break e}else t.head&&(t.head.comment=null);t.mode=li;case li:if(t.flags&512){for(;f<16;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(s!==(t.check&65535)){e.msg="header crc mismatch",t.mode=O;break}s=0,f=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=xe;break;case fi:for(;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}e.adler=t.check=vi(s),s=0,f=0,t.mode=At;case At:if(t.havedict===0)return e.next_out=o,e.avail_out=h,e.next_in=a,e.avail_in=l,t.hold=s,t.bits=f,Sa;e.adler=t.check=1,t.mode=xe;case xe:if(r===Aa||r===Ft)break e;case Gt:if(t.last){s>>>=f&7,f-=f&7,t.mode=Xt;break}for(;f<3;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}switch(t.last=s&1,s>>>=1,f-=1,s&3){case 0:t.mode=si;break;case 1:if(Oa(t),t.mode=kt,r===Ft){s>>>=2,f-=2;break e}break;case 2:t.mode=ui;break;case 3:e.msg="invalid block type",t.mode=O}s>>>=2,f-=2;break;case si:for(s>>>=f&7,f-=f&7;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if((s&65535)!==(s>>>16^65535)){e.msg="invalid stored block lengths",t.mode=O;break}if(t.length=s&65535,s=0,f=0,t.mode=Vt,r===Ft)break e;case Vt:t.mode=hi;case hi:if(u=t.length,u){if(u>l&&(u=l),u>h&&(u=h),u===0)break e;Q.arraySet(n,i,a,u,o),l-=u,a+=u,h-=u,o+=u,t.length-=u;break}t.mode=xe;break;case ui:for(;f<14;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(t.nlen=(s&31)+257,s>>>=5,f-=5,t.ndist=(s&31)+1,s>>>=5,f-=5,t.ncode=(s&15)+4,s>>>=4,f-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=O;break}t.have=0,t.mode=ci;case ci:for(;t.have<t.ncode;){for(;f<3;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}t.lens[I[t.have++]]=s&7,s>>>=3,f-=3}for(;t.have<19;)t.lens[I[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,B={bits:t.lenbits},_=tt(Ea,t.lens,0,19,t.lencode,0,t.work,B),t.lenbits=B.bits,_){e.msg="invalid code lengths set",t.mode=O;break}t.have=0,t.mode=di;case di:for(;t.have<t.nlen+t.ndist;){for(;S=t.lencode[s&(1<<t.lenbits)-1],k=S>>>24,v=S>>>16&255,U=S&65535,!(k<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(U<16)s>>>=k,f-=k,t.lens[t.have++]=U;else{if(U===16){for(x=k+2;f<x;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(s>>>=k,f-=k,t.have===0){e.msg="invalid bit length repeat",t.mode=O;break}w=t.lens[t.have-1],u=3+(s&3),s>>>=2,f-=2}else if(U===17){for(x=k+3;f<x;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}s>>>=k,f-=k,w=0,u=3+(s&7),s>>>=3,f-=3}else{for(x=k+7;f<x;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}s>>>=k,f-=k,w=0,u=11+(s&127),s>>>=7,f-=7}if(t.have+u>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=O;break}for(;u--;)t.lens[t.have++]=w}}if(t.mode===O)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=O;break}if(t.lenbits=9,B={bits:t.lenbits},_=tt(Fi,t.lens,0,t.nlen,t.lencode,0,t.work,B),t.lenbits=B.bits,_){e.msg="invalid literal/lengths set",t.mode=O;break}if(t.distbits=6,t.distcode=t.distdyn,B={bits:t.distbits},_=tt(ki,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,B),t.distbits=B.bits,_){e.msg="invalid distances set",t.mode=O;break}if(t.mode=kt,r===Ft)break e;case kt:t.mode=Et;case Et:if(l>=6&&h>=258){e.next_out=o,e.avail_out=h,e.next_in=a,e.avail_in=l,t.hold=s,t.bits=f,ka(e,g),o=e.next_out,n=e.output,h=e.avail_out,a=e.next_in,i=e.input,l=e.avail_in,s=t.hold,f=t.bits,t.mode===xe&&(t.back=-1);break}for(t.back=0;S=t.lencode[s&(1<<t.lenbits)-1],k=S>>>24,v=S>>>16&255,U=S&65535,!(k<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(v&&!(v&240)){for(R=k,A=v,c=U;S=t.lencode[c+((s&(1<<R+A)-1)>>R)],k=S>>>24,v=S>>>16&255,U=S&65535,!(R+k<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}s>>>=R,f-=R,t.back+=R}if(s>>>=k,f-=k,t.back+=k,t.length=U,v===0){t.mode=wi;break}if(v&32){t.back=-1,t.mode=xe;break}if(v&64){e.msg="invalid literal/length code",t.mode=O;break}t.extra=v&15,t.mode=pi;case pi:if(t.extra){for(x=t.extra;f<x;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}t.length+=s&(1<<t.extra)-1,s>>>=t.extra,f-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=xi;case xi:for(;S=t.distcode[s&(1<<t.distbits)-1],k=S>>>24,v=S>>>16&255,U=S&65535,!(k<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(!(v&240)){for(R=k,A=v,c=U;S=t.distcode[c+((s&(1<<R+A)-1)>>R)],k=S>>>24,v=S>>>16&255,U=S&65535,!(R+k<=f);){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}s>>>=R,f-=R,t.back+=R}if(s>>>=k,f-=k,t.back+=k,v&64){e.msg="invalid distance code",t.mode=O;break}t.offset=U,t.extra=v&15,t.mode=gi;case gi:if(t.extra){for(x=t.extra;f<x;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}t.offset+=s&(1<<t.extra)-1,s>>>=t.extra,f-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=O;break}t.mode=yi;case yi:if(h===0)break e;if(u=g-h,t.offset>u){if(u=t.offset-u,u>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=O;break}u>t.wnext?(u-=t.wnext,F=t.wsize-u):F=t.wnext-u,u>t.length&&(u=t.length),b=t.window}else b=n,F=o-t.offset,u=t.length;u>h&&(u=h),h-=u,t.length-=u;do n[o++]=b[F++];while(--u);t.length===0&&(t.mode=Et);break;case wi:if(h===0)break e;n[o++]=t.length,h--,t.mode=Et;break;case Xt:if(t.wrap){for(;f<32;){if(l===0)break e;l--,s|=i[a++]<<f,f+=8}if(g-=h,e.total_out+=g,t.total+=g,g&&(e.adler=t.check=t.flags?fe(t.check,n,g,o-g):er(t.check,n,g,o-g)),g=h,(t.flags?s:vi(s))!==t.check){e.msg="incorrect data check",t.mode=O;break}s=0,f=0}t.mode=_i;case _i:if(t.wrap&&t.flags){for(;f<32;){if(l===0)break e;l--,s+=i[a++]<<f,f+=8}if(s!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=O;break}s=0,f=0}t.mode=mi;case mi:_=Ba;break e;case O:_=Ei;break e;case rr:return tr;case Ia:default:return ee}return e.next_out=o,e.avail_out=h,e.next_in=a,e.avail_in=l,t.hold=s,t.bits=f,(t.wsize||g!==e.avail_out&&t.mode<O&&(t.mode<Xt||r!==Jr))&&Ri(e,e.output,e.next_out,g-e.avail_out)?(t.mode=rr,tr):(p-=e.avail_in,g-=e.avail_out,e.total_in+=p,e.total_out+=g,t.total+=g,t.wrap&&g&&(e.adler=t.check=t.flags?fe(t.check,n,g,e.next_out-g):er(t.check,n,g,e.next_out-g)),e.data_type=t.bits+(t.last?64:0)+(t.mode===xe?128:0)+(t.mode===kt||t.mode===Vt?256:0),(p===0&&g===0||r===Jr)&&_===Ie&&(_=Ua),_)}function Ma(e){if(!e||!e.state)return ee;var r=e.state;return r.window&&(r.window=null),e.state=null,Ie}function Za(e,r){var t;return!e||!e.state||(t=e.state,!(t.wrap&2))?ee:(t.head=r,r.done=!1,Ie)}function qa(e,r){var t=r.length,i,n,a;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==At)?ee:i.mode===At&&(n=1,n=er(n,r,t,0),n!==i.check)?Ei:(a=Ri(e,r,t,t),a?(i.mode=rr,tr):(i.havedict=1,Ie))}ae.inflateReset=Si;ae.inflateReset2=Ui;ae.inflateResetKeep=Bi;ae.inflateInit=Na;ae.inflateInit2=Ii;ae.inflate=La;ae.inflateEnd=Ma;ae.inflateGetHeader=Za;ae.inflateSetDictionary=qa;ae.inflateInfo="pako inflate (from Nodeca project)"});var ir=Z(qe=>{"use strict";var Bt=ve(),Ti=!0,zi=!0;try{String.fromCharCode.apply(null,[0])}catch{Ti=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{zi=!1}var rt=new Bt.Buf8(256);for(ge=0;ge<256;ge++)rt[ge]=ge>=252?6:ge>=248?5:ge>=240?4:ge>=224?3:ge>=192?2:1;var ge;rt[254]=rt[254]=1;qe.string2buf=function(e){var r,t,i,n,a,o=e.length,l=0;for(n=0;n<o;n++)t=e.charCodeAt(n),(t&64512)===55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),n++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(r=new Bt.Buf8(l),a=0,n=0;a<l;n++)t=e.charCodeAt(n),(t&64512)===55296&&n+1<o&&(i=e.charCodeAt(n+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),n++)),t<128?r[a++]=t:t<2048?(r[a++]=192|t>>>6,r[a++]=128|t&63):t<65536?(r[a++]=224|t>>>12,r[a++]=128|t>>>6&63,r[a++]=128|t&63):(r[a++]=240|t>>>18,r[a++]=128|t>>>12&63,r[a++]=128|t>>>6&63,r[a++]=128|t&63);return r};function Di(e,r){if(r<65534&&(e.subarray&&zi||!e.subarray&&Ti))return String.fromCharCode.apply(null,Bt.shrinkBuf(e,r));for(var t="",i=0;i<r;i++)t+=String.fromCharCode(e[i]);return t}qe.buf2binstring=function(e){return Di(e,e.length)};qe.binstring2buf=function(e){for(var r=new Bt.Buf8(e.length),t=0,i=r.length;t<i;t++)r[t]=e.charCodeAt(t);return r};qe.buf2string=function(e,r){var t,i,n,a,o=r||e.length,l=new Array(o*2);for(i=0,t=0;t<o;){if(n=e[t++],n<128){l[i++]=n;continue}if(a=rt[n],a>4){l[i++]=65533,t+=a-1;continue}for(n&=a===2?31:a===3?15:7;a>1&&t<o;)n=n<<6|e[t++]&63,a--;if(a>1){l[i++]=65533;continue}n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|n&1023)}return Di(l,i)};qe.utf8border=function(e,r){var t;for(r=r||e.length,r>e.length&&(r=e.length),t=r-1;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?r:t+rt[e[t]]>r?t:r}});var Oi=Z((tl,Ni)=>{"use strict";Ni.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var St=Z((rl,Li)=>{"use strict";Li.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var nr=Z((il,Mi)=>{"use strict";function Pa(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Mi.exports=Pa});var qi=Z((nl,Zi)=>{"use strict";function Ha(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Zi.exports=Ha});var Hi=Z(nt=>{"use strict";var Pe=Ci(),it=ve(),Ut=ir(),L=Oi(),ar=St(),Ka=nr(),ja=qi(),Pi=Object.prototype.toString;function Re(e){if(!(this instanceof Re))return new Re(e);this.options=it.assign({chunkSize:16384,windowBits:0,to:""},e||{});var r=this.options;r.raw&&r.windowBits>=0&&r.windowBits<16&&(r.windowBits=-r.windowBits,r.windowBits===0&&(r.windowBits=-15)),r.windowBits>=0&&r.windowBits<16&&!(e&&e.windowBits)&&(r.windowBits+=32),r.windowBits>15&&r.windowBits<48&&(r.windowBits&15||(r.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ka,this.strm.avail_out=0;var t=Pe.inflateInit2(this.strm,r.windowBits);if(t!==L.Z_OK)throw new Error(ar[t]);if(this.header=new ja,Pe.inflateGetHeader(this.strm,this.header),r.dictionary&&(typeof r.dictionary=="string"?r.dictionary=Ut.string2buf(r.dictionary):Pi.call(r.dictionary)==="[object ArrayBuffer]"&&(r.dictionary=new Uint8Array(r.dictionary)),r.raw&&(t=Pe.inflateSetDictionary(this.strm,r.dictionary),t!==L.Z_OK)))throw new Error(ar[t])}Re.prototype.push=function(e,r){var t=this.strm,i=this.options.chunkSize,n=this.options.dictionary,a,o,l,h,s,f=!1;if(this.ended)return!1;o=r===~~r?r:r===!0?L.Z_FINISH:L.Z_NO_FLUSH,typeof e=="string"?t.input=Ut.binstring2buf(e):Pi.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new it.Buf8(i),t.next_out=0,t.avail_out=i),a=Pe.inflate(t,L.Z_NO_FLUSH),a===L.Z_NEED_DICT&&n&&(a=Pe.inflateSetDictionary(this.strm,n)),a===L.Z_BUF_ERROR&&f===!0&&(a=L.Z_OK,f=!1),a!==L.Z_STREAM_END&&a!==L.Z_OK)return this.onEnd(a),this.ended=!0,!1;t.next_out&&(t.avail_out===0||a===L.Z_STREAM_END||t.avail_in===0&&(o===L.Z_FINISH||o===L.Z_SYNC_FLUSH))&&(this.options.to==="string"?(l=Ut.utf8border(t.output,t.next_out),h=t.next_out-l,s=Ut.buf2string(t.output,l),t.next_out=h,t.avail_out=i-h,h&&it.arraySet(t.output,t.output,l,h,0),this.onData(s)):this.onData(it.shrinkBuf(t.output,t.next_out))),t.avail_in===0&&t.avail_out===0&&(f=!0)}while((t.avail_in>0||t.avail_out===0)&&a!==L.Z_STREAM_END);return a===L.Z_STREAM_END&&(o=L.Z_FINISH),o===L.Z_FINISH?(a=Pe.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===L.Z_OK):(o===L.Z_SYNC_FLUSH&&(this.onEnd(L.Z_OK),t.avail_out=0),!0)};Re.prototype.onData=function(e){this.chunks.push(e)};Re.prototype.onEnd=function(e){e===L.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=it.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function or(e,r){var t=new Re(r);if(t.push(e,!0),t.err)throw t.msg||ar[t.err];return t.result}function Ya(e,r){return r=r||{},r.raw=!0,or(e,r)}nt.Inflate=Re;nt.inflate=or;nt.inflateRaw=Ya;nt.ungzip=or});var Yi=Z(It=>{"use strict";It.byteLength=Wa;It.toByteArray=Va;It.fromByteArray=Qa;var se=[],te=[],$a=typeof Uint8Array<"u"?Uint8Array:Array,lr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ce=0,Ki=lr.length;Ce<Ki;++Ce)se[Ce]=lr[Ce],te[lr.charCodeAt(Ce)]=Ce;var Ce,Ki;te[45]=62;te[95]=63;function ji(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Wa(e){var r=ji(e),t=r[0],i=r[1];return(t+i)*3/4-i}function Ga(e,r,t){return(r+t)*3/4-t}function Va(e){var r,t=ji(e),i=t[0],n=t[1],a=new $a(Ga(e,i,n)),o=0,l=n>0?i-4:i,h;for(h=0;h<l;h+=4)r=te[e.charCodeAt(h)]<<18|te[e.charCodeAt(h+1)]<<12|te[e.charCodeAt(h+2)]<<6|te[e.charCodeAt(h+3)],a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=r&255;return n===2&&(r=te[e.charCodeAt(h)]<<2|te[e.charCodeAt(h+1)]>>4,a[o++]=r&255),n===1&&(r=te[e.charCodeAt(h)]<<10|te[e.charCodeAt(h+1)]<<4|te[e.charCodeAt(h+2)]>>2,a[o++]=r>>8&255,a[o++]=r&255),a}function Xa(e){return se[e>>18&63]+se[e>>12&63]+se[e>>6&63]+se[e&63]}function Ja(e,r,t){for(var i,n=[],a=r;a<t;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),n.push(Xa(i));return n.join("")}function Qa(e){for(var r,t=e.length,i=t%3,n=[],a=16383,o=0,l=t-i;o<l;o+=a)n.push(Ja(e,o,o+a>l?l:o+a));return i===1?(r=e[t-1],n.push(se[r>>2]+se[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(se[r>>10]+se[r>>4&63]+se[r<<2&63]+"=")),n.join("")}});var $i=Z(fr=>{fr.read=function(e,r,t,i,n){var a,o,l=n*8-i-1,h=(1<<l)-1,s=h>>1,f=-7,p=t?n-1:0,g=t?-1:1,u=e[r+p];for(p+=g,a=u&(1<<-f)-1,u>>=-f,f+=l;f>0;a=a*256+e[r+p],p+=g,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=i;f>0;o=o*256+e[r+p],p+=g,f-=8);if(a===0)a=1-s;else{if(a===h)return o?NaN:(u?-1:1)*(1/0);o=o+Math.pow(2,i),a=a-s}return(u?-1:1)*o*Math.pow(2,a-i)};fr.write=function(e,r,t,i,n,a){var o,l,h,s=a*8-n-1,f=(1<<s)-1,p=f>>1,g=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,u=i?0:a-1,F=i?1:-1,b=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-o))<1&&(o--,h*=2),o+p>=1?r+=g/h:r+=g*Math.pow(2,1-p),r*h>=2&&(o++,h/=2),o+p>=f?(l=0,o=f):o+p>=1?(l=(r*h-1)*Math.pow(2,n),o=o+p):(l=r*Math.pow(2,p-1)*Math.pow(2,n),o=0));n>=8;e[t+u]=l&255,u+=F,l/=256,n-=8);for(o=o<<n|l,s+=n;s>0;e[t+u]=o&255,u+=F,o/=256,s-=8);e[t+u-F]|=b*128}});var un=Z(Ye=>{"use strict";var sr=Yi(),Ke=$i(),Wi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ye.Buffer=d;Ye.SlowBuffer=a0;Ye.INSPECT_MAX_BYTES=50;var Rt=2147483647;Ye.kMaxLength=Rt;d.TYPED_ARRAY_SUPPORT=e0();!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function e0(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function ye(e){if(e>Rt)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,d.prototype),r}function d(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return dr(e)}return Ji(e,r,t)}d.poolSize=8192;function Ji(e,r,t){if(typeof e=="string")return r0(e,r);if(ArrayBuffer.isView(e))return i0(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(he(e,ArrayBuffer)||e&&he(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(he(e,SharedArrayBuffer)||e&&he(e.buffer,SharedArrayBuffer)))return ur(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return d.from(i,r,t);let n=n0(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return d.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}d.from=function(e,r,t){return Ji(e,r,t)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Qi(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function t0(e,r,t){return Qi(e),e<=0?ye(e):r!==void 0?typeof t=="string"?ye(e).fill(r,t):ye(e).fill(r):ye(e)}d.alloc=function(e,r,t){return t0(e,r,t)};function dr(e){return Qi(e),ye(e<0?0:pr(e)|0)}d.allocUnsafe=function(e){return dr(e)};d.allocUnsafeSlow=function(e){return dr(e)};function r0(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!d.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=en(e,r)|0,i=ye(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function hr(e){let r=e.length<0?0:pr(e.length)|0,t=ye(r);for(let i=0;i<r;i+=1)t[i]=e[i]&255;return t}function i0(e){if(he(e,Uint8Array)){let r=new Uint8Array(e);return ur(r.buffer,r.byteOffset,r.byteLength)}return hr(e)}function ur(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return r===void 0&&t===void 0?i=new Uint8Array(e):t===void 0?i=new Uint8Array(e,r):i=new Uint8Array(e,r,t),Object.setPrototypeOf(i,d.prototype),i}function n0(e){if(d.isBuffer(e)){let r=pr(e.length)|0,t=ye(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||gr(e.length)?ye(0):hr(e);if(e.type==="Buffer"&&Array.isArray(e.data))return hr(e.data)}function pr(e){if(e>=Rt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Rt.toString(16)+" bytes");return e|0}function a0(e){return+e!=e&&(e=0),d.alloc(+e)}d.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==d.prototype};d.compare=function(r,t){if(he(r,Uint8Array)&&(r=d.from(r,r.offset,r.byteLength)),he(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(r)||!d.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let i=r.length,n=t.length;for(let a=0,o=Math.min(i,n);a<o;++a)if(r[a]!==t[a]){i=r[a],n=t[a];break}return i<n?-1:n<i?1:0};d.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};d.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return d.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;let n=d.allocUnsafe(t),a=0;for(i=0;i<r.length;++i){let o=r[i];if(he(o,Uint8Array))a+o.length>n.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(n,a)):Uint8Array.prototype.set.call(n,o,a);else if(d.isBuffer(o))o.copy(n,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=o.length}return n};function en(e,r){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||he(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return cr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return hn(e).length;default:if(n)return i?-1:cr(e).length;r=(""+r).toLowerCase(),n=!0}}d.byteLength=en;function o0(e,r,t){let i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return g0(this,r,t);case"utf8":case"utf-8":return rn(this,r,t);case"ascii":return p0(this,r,t);case"latin1":case"binary":return x0(this,r,t);case"base64":return c0(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y0(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}d.prototype._isBuffer=!0;function Te(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}d.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)Te(this,t,t+1);return this};d.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)Te(this,t,t+3),Te(this,t+1,t+2);return this};d.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)Te(this,t,t+7),Te(this,t+1,t+6),Te(this,t+2,t+5),Te(this,t+3,t+4);return this};d.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?rn(this,0,r):o0.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(r){if(!d.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:d.compare(this,r)===0};d.prototype.inspect=function(){let r="",t=Ye.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};Wi&&(d.prototype[Wi]=d.prototype.inspect);d.prototype.compare=function(r,t,i,n,a){if(he(r,Uint8Array)&&(r=d.from(r,r.offset,r.byteLength)),!d.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),a===void 0&&(a=this.length),t<0||i>r.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=i)return 0;if(n>=a)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,a>>>=0,this===r)return 0;let o=a-n,l=i-t,h=Math.min(o,l),s=this.slice(n,a),f=r.slice(t,i);for(let p=0;p<h;++p)if(s[p]!==f[p]){o=s[p],l=f[p];break}return o<l?-1:l<o?1:0};function tn(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,gr(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=d.from(r,i)),d.isBuffer(r))return r.length===0?-1:Gi(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Gi(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function Gi(e,r,t,i,n){let a=1,o=e.length,l=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;a=2,o/=2,l/=2,t/=2}function h(f,p){return a===1?f[p]:f.readUInt16BE(p*a)}let s;if(n){let f=-1;for(s=t;s<o;s++)if(h(e,s)===h(r,f===-1?0:s-f)){if(f===-1&&(f=s),s-f+1===l)return f*a}else f!==-1&&(s-=s-f),f=-1}else for(t+l>o&&(t=o-l),s=t;s>=0;s--){let f=!0;for(let p=0;p<l;p++)if(h(e,s+p)!==h(r,p)){f=!1;break}if(f)return s}return-1}d.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};d.prototype.indexOf=function(r,t,i){return tn(this,r,t,i,!0)};d.prototype.lastIndexOf=function(r,t,i){return tn(this,r,t,i,!1)};function l0(e,r,t,i){t=Number(t)||0;let n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;let a=r.length;i>a/2&&(i=a/2);let o;for(o=0;o<i;++o){let l=parseInt(r.substr(o*2,2),16);if(gr(l))return o;e[t+o]=l}return o}function f0(e,r,t,i){return Ct(cr(r,e.length-t),e,t,i)}function s0(e,r,t,i){return Ct(v0(r),e,t,i)}function h0(e,r,t,i){return Ct(hn(r),e,t,i)}function u0(e,r,t,i){return Ct(b0(r,e.length-t),e,t,i)}d.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-t;if((i===void 0||i>a)&&(i=a),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return l0(this,r,t,i);case"utf8":case"utf-8":return f0(this,r,t,i);case"ascii":case"latin1":case"binary":return s0(this,r,t,i);case"base64":return h0(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u0(this,r,t,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function c0(e,r,t){return r===0&&t===e.length?sr.fromByteArray(e):sr.fromByteArray(e.slice(r,t))}function rn(e,r,t){t=Math.min(e.length,t);let i=[],n=r;for(;n<t;){let a=e[n],o=null,l=a>239?4:a>223?3:a>191?2:1;if(n+l<=t){let h,s,f,p;switch(l){case 1:a<128&&(o=a);break;case 2:h=e[n+1],(h&192)===128&&(p=(a&31)<<6|h&63,p>127&&(o=p));break;case 3:h=e[n+1],s=e[n+2],(h&192)===128&&(s&192)===128&&(p=(a&15)<<12|(h&63)<<6|s&63,p>2047&&(p<55296||p>57343)&&(o=p));break;case 4:h=e[n+1],s=e[n+2],f=e[n+3],(h&192)===128&&(s&192)===128&&(f&192)===128&&(p=(a&15)<<18|(h&63)<<12|(s&63)<<6|f&63,p>65535&&p<1114112&&(o=p))}}o===null?(o=65533,l=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=l}return d0(i)}var Vi=4096;function d0(e){let r=e.length;if(r<=Vi)return String.fromCharCode.apply(String,e);let t="",i=0;for(;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=Vi));return t}function p0(e,r,t){let i="";t=Math.min(e.length,t);for(let n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function x0(e,r,t){let i="";t=Math.min(e.length,t);for(let n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function g0(e,r,t){let i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);let n="";for(let a=r;a<t;++a)n+=F0[e[a]];return n}function y0(e,r,t){let i=e.slice(r,t),n="";for(let a=0;a<i.length-1;a+=2)n+=String.fromCharCode(i[a]+i[a+1]*256);return n}d.prototype.slice=function(r,t){let i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);let n=this.subarray(r,t);return Object.setPrototypeOf(n,d.prototype),n};function K(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||K(r,t,this.length);let n=this[r],a=1,o=0;for(;++o<t&&(a*=256);)n+=this[r+o]*a;return n};d.prototype.readUintBE=d.prototype.readUIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||K(r,t,this.length);let n=this[r+--t],a=1;for(;t>0&&(a*=256);)n+=this[r+--t]*a;return n};d.prototype.readUint8=d.prototype.readUInt8=function(r,t){return r=r>>>0,t||K(r,1,this.length),this[r]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||K(r,2,this.length),this[r]|this[r+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||K(r,2,this.length),this[r]<<8|this[r+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||K(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||K(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};d.prototype.readBigUInt64LE=be(function(r){r=r>>>0,je(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&at(r,this.length-8);let n=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,a=this[++r]+this[++r]*2**8+this[++r]*2**16+i*2**24;return BigInt(n)+(BigInt(a)<<BigInt(32))});d.prototype.readBigUInt64BE=be(function(r){r=r>>>0,je(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&at(r,this.length-8);let n=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],a=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(a)});d.prototype.readIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||K(r,t,this.length);let n=this[r],a=1,o=0;for(;++o<t&&(a*=256);)n+=this[r+o]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*t)),n};d.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||K(r,t,this.length);let n=t,a=1,o=this[r+--n];for(;n>0&&(a*=256);)o+=this[r+--n]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o};d.prototype.readInt8=function(r,t){return r=r>>>0,t||K(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};d.prototype.readInt16LE=function(r,t){r=r>>>0,t||K(r,2,this.length);let i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};d.prototype.readInt16BE=function(r,t){r=r>>>0,t||K(r,2,this.length);let i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};d.prototype.readInt32LE=function(r,t){return r=r>>>0,t||K(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};d.prototype.readInt32BE=function(r,t){return r=r>>>0,t||K(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};d.prototype.readBigInt64LE=be(function(r){r=r>>>0,je(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&at(r,this.length-8);let n=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)});d.prototype.readBigInt64BE=be(function(r){r=r>>>0,je(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&at(r,this.length-8);let n=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(n)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i)});d.prototype.readFloatLE=function(r,t){return r=r>>>0,t||K(r,4,this.length),Ke.read(this,r,!0,23,4)};d.prototype.readFloatBE=function(r,t){return r=r>>>0,t||K(r,4,this.length),Ke.read(this,r,!1,23,4)};d.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||K(r,8,this.length),Ke.read(this,r,!0,52,8)};d.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||K(r,8,this.length),Ke.read(this,r,!1,52,8)};function G(e,r,t,i,n,a){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<a)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;G(this,r,t,i,l,0)}let a=1,o=0;for(this[t]=r&255;++o<i&&(a*=256);)this[t+o]=r/a&255;return t+i};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;G(this,r,t,i,l,0)}let a=i-1,o=1;for(this[t+a]=r&255;--a>=0&&(o*=256);)this[t+a]=r/o&255;return t+i};d.prototype.writeUint8=d.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,1,255,0),this[t]=r&255,t+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function nn(e,r,t,i,n){sn(r,i,n,e,t,7);let a=Number(r&BigInt(4294967295));e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a;let o=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,t}function an(e,r,t,i,n){sn(r,i,n,e,t,7);let a=Number(r&BigInt(4294967295));e[t+7]=a,a=a>>8,e[t+6]=a,a=a>>8,e[t+5]=a,a=a>>8,e[t+4]=a;let o=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=o,o=o>>8,e[t+2]=o,o=o>>8,e[t+1]=o,o=o>>8,e[t]=o,t+8}d.prototype.writeBigUInt64LE=be(function(r,t=0){return nn(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});d.prototype.writeBigUInt64BE=be(function(r,t=0){return an(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});d.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let h=Math.pow(2,8*i-1);G(this,r,t,i,h-1,-h)}let a=0,o=1,l=0;for(this[t]=r&255;++a<i&&(o*=256);)r<0&&l===0&&this[t+a-1]!==0&&(l=1),this[t+a]=(r/o>>0)-l&255;return t+i};d.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let h=Math.pow(2,8*i-1);G(this,r,t,i,h-1,-h)}let a=i-1,o=1,l=0;for(this[t+a]=r&255;--a>=0&&(o*=256);)r<0&&l===0&&this[t+a+1]!==0&&(l=1),this[t+a]=(r/o>>0)-l&255;return t+i};d.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};d.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};d.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};d.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};d.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||G(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};d.prototype.writeBigInt64LE=be(function(r,t=0){return nn(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});d.prototype.writeBigInt64BE=be(function(r,t=0){return an(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function on(e,r,t,i,n,a){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function ln(e,r,t,i,n){return r=+r,t=t>>>0,n||on(e,r,t,4,34028234663852886e22,-34028234663852886e22),Ke.write(e,r,t,i,23,4),t+4}d.prototype.writeFloatLE=function(r,t,i){return ln(this,r,t,!0,i)};d.prototype.writeFloatBE=function(r,t,i){return ln(this,r,t,!1,i)};function fn(e,r,t,i,n){return r=+r,t=t>>>0,n||on(e,r,t,8,17976931348623157e292,-17976931348623157e292),Ke.write(e,r,t,i,52,8),t+8}d.prototype.writeDoubleLE=function(r,t,i){return fn(this,r,t,!0,i)};d.prototype.writeDoubleBE=function(r,t,i){return fn(this,r,t,!1,i)};d.prototype.copy=function(r,t,i,n){if(!d.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);let a=n-i;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(r,this.subarray(i,n),t),a};d.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!d.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){let o=r.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(r=o)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);let a;if(typeof r=="number")for(a=t;a<i;++a)this[a]=r;else{let o=d.isBuffer(r)?r:d.from(r,n),l=o.length;if(l===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(a=0;a<i-t;++a)this[a+t]=o[a%l]}return this};var He={};function xr(e,r,t){He[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}xr("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);xr("ERR_INVALID_ARG_TYPE",function(e,r){return`The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError);xr("ERR_OUT_OF_RANGE",function(e,r,t){let i=`The value of "${e}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=Xi(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=Xi(n)),n+="n"),i+=` It must be ${r}. Received ${n}`,i},RangeError);function Xi(e){let r="",t=e.length,i=e[0]==="-"?1:0;for(;t>=i+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function w0(e,r,t){je(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&at(r,e.length-(t+1))}function sn(e,r,t,i,n,a){if(e>t||e<r){let o=typeof r=="bigint"?"n":"",l;throw a>3?r===0||r===BigInt(0)?l=`>= 0${o} and < 2${o} ** ${(a+1)*8}${o}`:l=`>= -(2${o} ** ${(a+1)*8-1}${o}) and < 2 ** ${(a+1)*8-1}${o}`:l=`>= ${r}${o} and <= ${t}${o}`,new He.ERR_OUT_OF_RANGE("value",l,e)}w0(i,n,a)}function je(e,r){if(typeof e!="number")throw new He.ERR_INVALID_ARG_TYPE(r,"number",e)}function at(e,r,t){throw Math.floor(e)!==e?(je(e,t),new He.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new He.ERR_BUFFER_OUT_OF_BOUNDS:new He.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var _0=/[^+/0-9A-Za-z-_]/g;function m0(e){if(e=e.split("=")[0],e=e.trim().replace(_0,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function cr(e,r){r=r||1/0;let t,i=e.length,n=null,a=[];for(let o=0;o<i;++o){if(t=e.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&a.push(239,191,189);continue}else if(o+1===i){(r-=3)>-1&&a.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&a.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&a.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;a.push(t)}else if(t<2048){if((r-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}ret