>>0,isFinite(p)?(p=p>>>0,A===void 0&&(A="utf8")):(A=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const S=this.length-m;if((p===void 0||p>S)&&(p=S),d.length>0&&(p<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");A||(A="utf8");let j=!1;for(;;)switch(A){case"hex":return re(this,d,m,p);case"utf8":case"utf-8":return w(this,d,m,p);case"ascii":case"latin1":case"binary":return z(this,d,m,p);case"base64":return W(this,d,m,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,d,m,p);default:if(j)throw new TypeError("Unknown encoding: "+A);A=(""+A).toLowerCase(),j=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Q(d,m,p){return m===0&&p===d.length?u.fromByteArray(d):u.fromByteArray(d.slice(m,p))}function ce(d,m,p){p=Math.min(d.length,p);const A=[];let S=m;for(;S239?4:j>223?3:j>191?2:1;if(S+Ye<=p){let pu,We,nu,hu;switch(Ye){case 1:j<128&&(se=j);break;case 2:pu=d[S+1],(pu&192)===128&&(hu=(j&31)<<6|pu&63,hu>127&&(se=hu));break;case 3:pu=d[S+1],We=d[S+2],(pu&192)===128&&(We&192)===128&&(hu=(j&15)<<12|(pu&63)<<6|We&63,hu>2047&&(hu<55296||hu>57343)&&(se=hu));break;case 4:pu=d[S+1],We=d[S+2],nu=d[S+3],(pu&192)===128&&(We&192)===128&&(nu&192)===128&&(hu=(j&15)<<18|(pu&63)<<12|(We&63)<<6|nu&63,hu>65535&&hu<1114112&&(se=hu))}}se===null?(se=65533,Ye=1):se>65535&&(se-=65536,A.push(se>>>10&1023|55296),se=56320|se&1023),A.push(se),S+=Ye}return Se(A)}const Ee=4096;function Se(d){const m=d.length;if(m<=Ee)return String.fromCharCode.apply(String,d);let p="",A=0;for(;AA)&&(p=A);let S="";for(let j=m;jp&&(d=p),m<0?(m+=p,m<0&&(m=0)):m>p&&(m=p),mp)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(d,m,p){d=d>>>0,m=m>>>0,p||Ke(d,m,this.length);let A=this[d],S=1,j=0;for(;++j>>0,m=m>>>0,p||Ke(d,m,this.length);let A=this[d+--m],S=1;for(;m>0&&(S*=256);)A+=this[d+--m]*S;return A},a.prototype.readUint8=a.prototype.readUInt8=function(d,m){return d=d>>>0,m||Ke(d,1,this.length),this[d]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(d,m){return d=d>>>0,m||Ke(d,2,this.length),this[d]|this[d+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(d,m){return d=d>>>0,m||Ke(d,2,this.length),this[d]<<8|this[d+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(d,m){return d=d>>>0,m||Ke(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(d,m){return d=d>>>0,m||Ke(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},a.prototype.readBigUInt64LE=Qe(function(d){d=d>>>0,G(d,"offset");const m=this[d],p=this[d+7];(m===void 0||p===void 0)&&le(d,this.length-8);const A=m+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,S=this[++d]+this[++d]*2**8+this[++d]*2**16+p*2**24;return BigInt(A)+(BigInt(S)<>>0,G(d,"offset");const m=this[d],p=this[d+7];(m===void 0||p===void 0)&&le(d,this.length-8);const A=m*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],S=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+p;return(BigInt(A)<>>0,m=m>>>0,p||Ke(d,m,this.length);let A=this[d],S=1,j=0;for(;++j=S&&(A-=Math.pow(2,8*m)),A},a.prototype.readIntBE=function(d,m,p){d=d>>>0,m=m>>>0,p||Ke(d,m,this.length);let A=m,S=1,j=this[d+--A];for(;A>0&&(S*=256);)j+=this[d+--A]*S;return S*=128,j>=S&&(j-=Math.pow(2,8*m)),j},a.prototype.readInt8=function(d,m){return d=d>>>0,m||Ke(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},a.prototype.readInt16LE=function(d,m){d=d>>>0,m||Ke(d,2,this.length);const p=this[d]|this[d+1]<<8;return p&32768?p|4294901760:p},a.prototype.readInt16BE=function(d,m){d=d>>>0,m||Ke(d,2,this.length);const p=this[d+1]|this[d]<<8;return p&32768?p|4294901760:p},a.prototype.readInt32LE=function(d,m){return d=d>>>0,m||Ke(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},a.prototype.readInt32BE=function(d,m){return d=d>>>0,m||Ke(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},a.prototype.readBigInt64LE=Qe(function(d){d=d>>>0,G(d,"offset");const m=this[d],p=this[d+7];(m===void 0||p===void 0)&&le(d,this.length-8);const A=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(p<<24);return(BigInt(A)<>>0,G(d,"offset");const m=this[d],p=this[d+7];(m===void 0||p===void 0)&&le(d,this.length-8);const A=(m<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(A)<>>0,m||Ke(d,4,this.length),t.read(this,d,!0,23,4)},a.prototype.readFloatBE=function(d,m){return d=d>>>0,m||Ke(d,4,this.length),t.read(this,d,!1,23,4)},a.prototype.readDoubleLE=function(d,m){return d=d>>>0,m||Ke(d,8,this.length),t.read(this,d,!0,52,8)},a.prototype.readDoubleBE=function(d,m){return d=d>>>0,m||Ke(d,8,this.length),t.read(this,d,!1,52,8)};function Re(d,m,p,A,S,j){if(!a.isBuffer(d))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>S||md.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(d,m,p,A){if(d=+d,m=m>>>0,p=p>>>0,!A){const se=Math.pow(2,8*p)-1;Re(this,d,m,p,se,0)}let S=1,j=0;for(this[m]=d&255;++j>>0,p=p>>>0,!A){const se=Math.pow(2,8*p)-1;Re(this,d,m,p,se,0)}let S=p-1,j=1;for(this[m+S]=d&255;--S>=0&&(j*=256);)this[m+S]=d/j&255;return m+p},a.prototype.writeUint8=a.prototype.writeUInt8=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,1,255,0),this[m]=d&255,m+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,2,65535,0),this[m]=d&255,this[m+1]=d>>>8,m+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,2,65535,0),this[m]=d>>>8,this[m+1]=d&255,m+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,4,4294967295,0),this[m+3]=d>>>24,this[m+2]=d>>>16,this[m+1]=d>>>8,this[m]=d&255,m+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,4,4294967295,0),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4};function Tu(d,m,p,A,S){V(m,A,S,d,p,7);let j=Number(m&BigInt(4294967295));d[p++]=j,j=j>>8,d[p++]=j,j=j>>8,d[p++]=j,j=j>>8,d[p++]=j;let se=Number(m>>BigInt(32)&BigInt(4294967295));return d[p++]=se,se=se>>8,d[p++]=se,se=se>>8,d[p++]=se,se=se>>8,d[p++]=se,p}function Cu(d,m,p,A,S){V(m,A,S,d,p,7);let j=Number(m&BigInt(4294967295));d[p+7]=j,j=j>>8,d[p+6]=j,j=j>>8,d[p+5]=j,j=j>>8,d[p+4]=j;let se=Number(m>>BigInt(32)&BigInt(4294967295));return d[p+3]=se,se=se>>8,d[p+2]=se,se=se>>8,d[p+1]=se,se=se>>8,d[p]=se,p+8}a.prototype.writeBigUInt64LE=Qe(function(d,m=0){return Tu(this,d,m,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Qe(function(d,m=0){return Cu(this,d,m,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(d,m,p,A){if(d=+d,m=m>>>0,!A){const Ye=Math.pow(2,8*p-1);Re(this,d,m,p,Ye-1,-Ye)}let S=0,j=1,se=0;for(this[m]=d&255;++S
>0)-se&255;return m+p},a.prototype.writeIntBE=function(d,m,p,A){if(d=+d,m=m>>>0,!A){const Ye=Math.pow(2,8*p-1);Re(this,d,m,p,Ye-1,-Ye)}let S=p-1,j=1,se=0;for(this[m+S]=d&255;--S>=0&&(j*=256);)d<0&&se===0&&this[m+S+1]!==0&&(se=1),this[m+S]=(d/j>>0)-se&255;return m+p},a.prototype.writeInt8=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,1,127,-128),d<0&&(d=255+d+1),this[m]=d&255,m+1},a.prototype.writeInt16LE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,2,32767,-32768),this[m]=d&255,this[m+1]=d>>>8,m+2},a.prototype.writeInt16BE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,2,32767,-32768),this[m]=d>>>8,this[m+1]=d&255,m+2},a.prototype.writeInt32LE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,4,2147483647,-2147483648),this[m]=d&255,this[m+1]=d>>>8,this[m+2]=d>>>16,this[m+3]=d>>>24,m+4},a.prototype.writeInt32BE=function(d,m,p){return d=+d,m=m>>>0,p||Re(this,d,m,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[m]=d>>>24,this[m+1]=d>>>16,this[m+2]=d>>>8,this[m+3]=d&255,m+4},a.prototype.writeBigInt64LE=Qe(function(d,m=0){return Tu(this,d,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Qe(function(d,m=0){return Cu(this,d,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ge(d,m,p,A,S,j){if(p+A>d.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function zu(d,m,p,A,S){return m=+m,p=p>>>0,S||Ge(d,m,p,4),t.write(d,m,p,A,23,4),p+4}a.prototype.writeFloatLE=function(d,m,p){return zu(this,d,m,!0,p)},a.prototype.writeFloatBE=function(d,m,p){return zu(this,d,m,!1,p)};function $u(d,m,p,A,S){return m=+m,p=p>>>0,S||Ge(d,m,p,8),t.write(d,m,p,A,52,8),p+8}a.prototype.writeDoubleLE=function(d,m,p){return $u(this,d,m,!0,p)},a.prototype.writeDoubleBE=function(d,m,p){return $u(this,d,m,!1,p)},a.prototype.copy=function(d,m,p,A){if(!a.isBuffer(d))throw new TypeError("argument should be a Buffer");if(p||(p=0),!A&&A!==0&&(A=this.length),m>=d.length&&(m=d.length),m||(m=0),A>0&&A
=this.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("sourceEnd out of bounds");A>this.length&&(A=this.length),d.length-m>>0,p=p===void 0?this.length:p>>>0,d||(d=0);let S;if(typeof d=="number")for(S=m;S