@gardenfi/core 0.2.0-beta.30 → 0.2.0-beta.31
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/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
26
26
|
* @license MIT
|
|
27
27
|
*/(function(e){const t=Wt,r=Or,a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=M,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=s(),!u.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 s(){try{const f=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(f,n),f.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function c(f){if(f>o)throw new RangeError('The value "'+f+'" is invalid for option "size"');const n=new Uint8Array(f);return Object.setPrototypeOf(n,u.prototype),n}function u(f,n,i){if(typeof f=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return v(f)}return p(f,n,i)}u.poolSize=8192;function p(f,n,i){if(typeof f=="string")return T(f,n);if(ArrayBuffer.isView(f))return R(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(Be(f,ArrayBuffer)||f&&Be(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Be(f,SharedArrayBuffer)||f&&Be(f.buffer,SharedArrayBuffer)))return k(f,n,i);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const l=f.valueOf&&f.valueOf();if(l!=null&&l!==f)return u.from(l,n,i);const b=A(f);if(b)return b;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return u.from(f[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}u.from=function(f,n,i){return p(f,n,i)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function w(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function m(f,n,i){return w(f),f<=0?c(f):n!==void 0?typeof i=="string"?c(f).fill(n,i):c(f).fill(n):c(f)}u.alloc=function(f,n,i){return m(f,n,i)};function v(f){return w(f),c(f<0?0:I(f)|0)}u.allocUnsafe=function(f){return v(f)},u.allocUnsafeSlow=function(f){return v(f)};function T(f,n){if((typeof n!="string"||n==="")&&(n="utf8"),!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const i=P(f,n)|0;let l=c(i);const b=l.write(f,n);return b!==i&&(l=l.slice(0,b)),l}function C(f){const n=f.length<0?0:I(f.length)|0,i=c(n);for(let l=0;l<n;l+=1)i[l]=f[l]&255;return i}function R(f){if(Be(f,Uint8Array)){const n=new Uint8Array(f);return k(n.buffer,n.byteOffset,n.byteLength)}return C(f)}function k(f,n,i){if(n<0||f.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');let l;return n===void 0&&i===void 0?l=new Uint8Array(f):i===void 0?l=new Uint8Array(f,n):l=new Uint8Array(f,n,i),Object.setPrototypeOf(l,u.prototype),l}function A(f){if(u.isBuffer(f)){const n=I(f.length)|0,i=c(n);return i.length===0||f.copy(i,0,0,n),i}if(f.length!==void 0)return typeof f.length!="number"||Je(f.length)?c(0):C(f);if(f.type==="Buffer"&&Array.isArray(f.data))return C(f.data)}function I(f){if(f>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return f|0}function M(f){return+f!=f&&(f=0),u.alloc(+f)}u.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==u.prototype},u.compare=function(n,i){if(Be(n,Uint8Array)&&(n=u.from(n,n.offset,n.byteLength)),Be(i,Uint8Array)&&(i=u.from(i,i.offset,i.byteLength)),!u.isBuffer(n)||!u.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;let l=n.length,b=i.length;for(let g=0,x=Math.min(l,b);g<x;++g)if(n[g]!==i[g]){l=n[g],b=i[g];break}return l<b?-1:b<l?1:0},u.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return u.alloc(0);let l;if(i===void 0)for(i=0,l=0;l<n.length;++l)i+=n[l].length;const b=u.allocUnsafe(i);let g=0;for(l=0;l<n.length;++l){let x=n[l];if(Be(x,Uint8Array))g+x.length>b.length?(u.isBuffer(x)||(x=u.from(x)),x.copy(b,g)):Uint8Array.prototype.set.call(b,x,g);else if(u.isBuffer(x))x.copy(b,g);else throw new TypeError('"list" argument must be an Array of Buffers');g+=x.length}return b};function P(f,n){if(u.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||Be(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);const i=f.length,l=arguments.length>2&&arguments[2]===!0;if(!l&&i===0)return 0;let b=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return G(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return pt(f).length;default:if(b)return l?-1:G(f).length;n=(""+n).toLowerCase(),b=!0}}u.byteLength=P;function L(f,n,i){let l=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(f||(f="utf8");;)switch(f){case"hex":return ke(this,n,i);case"utf8":case"utf-8":return me(this,n,i);case"ascii":return Ie(this,n,i);case"latin1":case"binary":return He(this,n,i);case"base64":return oe(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return je(this,n,i);default:if(l)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),l=!0}}u.prototype._isBuffer=!0;function N(f,n,i){const l=f[n];f[n]=f[i],f[i]=l}u.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<n;i+=2)N(this,i,i+1);return this},u.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<n;i+=4)N(this,i,i+3),N(this,i+1,i+2);return this},u.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<n;i+=8)N(this,i,i+7),N(this,i+1,i+6),N(this,i+2,i+5),N(this,i+3,i+4);return this},u.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?me(this,0,n):L.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(n){if(!u.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:u.compare(this,n)===0},u.prototype.inspect=function(){let n="";const i=e.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(n,i,l,b,g){if(Be(n,Uint8Array)&&(n=u.from(n,n.offset,n.byteLength)),!u.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(i===void 0&&(i=0),l===void 0&&(l=n?n.length:0),b===void 0&&(b=0),g===void 0&&(g=this.length),i<0||l>n.length||b<0||g>this.length)throw new RangeError("out of range index");if(b>=g&&i>=l)return 0;if(b>=g)return-1;if(i>=l)return 1;if(i>>>=0,l>>>=0,b>>>=0,g>>>=0,this===n)return 0;let x=g-b,K=l-i;const te=Math.min(x,K),Z=this.slice(b,g),re=n.slice(i,l);for(let z=0;z<te;++z)if(Z[z]!==re[z]){x=Z[z],K=re[z];break}return x<K?-1:K<x?1:0};function E(f,n,i,l,b){if(f.length===0)return-1;if(typeof i=="string"?(l=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Je(i)&&(i=b?0:f.length-1),i<0&&(i=f.length+i),i>=f.length){if(b)return-1;i=f.length-1}else if(i<0)if(b)i=0;else return-1;if(typeof n=="string"&&(n=u.from(n,l)),u.isBuffer(n))return n.length===0?-1:j(f,n,i,l,b);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?b?Uint8Array.prototype.indexOf.call(f,n,i):Uint8Array.prototype.lastIndexOf.call(f,n,i):j(f,[n],i,l,b);throw new TypeError("val must be string, number or Buffer")}function j(f,n,i,l,b){let g=1,x=f.length,K=n.length;if(l!==void 0&&(l=String(l).toLowerCase(),l==="ucs2"||l==="ucs-2"||l==="utf16le"||l==="utf-16le")){if(f.length<2||n.length<2)return-1;g=2,x/=2,K/=2,i/=2}function te(re,z){return g===1?re[z]:re.readUInt16BE(z*g)}let Z;if(b){let re=-1;for(Z=i;Z<x;Z++)if(te(f,Z)===te(n,re===-1?0:Z-re)){if(re===-1&&(re=Z),Z-re+1===K)return re*g}else re!==-1&&(Z-=Z-re),re=-1}else for(i+K>x&&(i=x-K),Z=i;Z>=0;Z--){let re=!0;for(let z=0;z<K;z++)if(te(f,Z+z)!==te(n,z)){re=!1;break}if(re)return Z}return-1}u.prototype.includes=function(n,i,l){return this.indexOf(n,i,l)!==-1},u.prototype.indexOf=function(n,i,l){return E(this,n,i,l,!0)},u.prototype.lastIndexOf=function(n,i,l){return E(this,n,i,l,!1)};function U(f,n,i,l){i=Number(i)||0;const b=f.length-i;l?(l=Number(l),l>b&&(l=b)):l=b;const g=n.length;l>g/2&&(l=g/2);let x;for(x=0;x<l;++x){const K=parseInt(n.substr(x*2,2),16);if(Je(K))return x;f[i+x]=K}return x}function $(f,n,i,l){return rt(G(n,f.length-i),f,i,l)}function ne(f,n,i,l){return rt(We(n),f,i,l)}function Te(f,n,i,l){return rt(pt(n),f,i,l)}function $e(f,n,i,l){return rt(tt(n,f.length-i),f,i,l)}u.prototype.write=function(n,i,l,b){if(i===void 0)b="utf8",l=this.length,i=0;else if(l===void 0&&typeof i=="string")b=i,l=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(l)?(l=l>>>0,b===void 0&&(b="utf8")):(b=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const g=this.length-i;if((l===void 0||l>g)&&(l=g),n.length>0&&(l<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");b||(b="utf8");let x=!1;for(;;)switch(b){case"hex":return U(this,n,i,l);case"utf8":case"utf-8":return $(this,n,i,l);case"ascii":case"latin1":case"binary":return ne(this,n,i,l);case"base64":return Te(this,n,i,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $e(this,n,i,l);default:if(x)throw new TypeError("Unknown encoding: "+b);b=(""+b).toLowerCase(),x=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function oe(f,n,i){return n===0&&i===f.length?t.fromByteArray(f):t.fromByteArray(f.slice(n,i))}function me(f,n,i){i=Math.min(f.length,i);const l=[];let b=n;for(;b<i;){const g=f[b];let x=null,K=g>239?4:g>223?3:g>191?2:1;if(b+K<=i){let te,Z,re,z;switch(K){case 1:g<128&&(x=g);break;case 2:te=f[b+1],(te&192)===128&&(z=(g&31)<<6|te&63,z>127&&(x=z));break;case 3:te=f[b+1],Z=f[b+2],(te&192)===128&&(Z&192)===128&&(z=(g&15)<<12|(te&63)<<6|Z&63,z>2047&&(z<55296||z>57343)&&(x=z));break;case 4:te=f[b+1],Z=f[b+2],re=f[b+3],(te&192)===128&&(Z&192)===128&&(re&192)===128&&(z=(g&15)<<18|(te&63)<<12|(Z&63)<<6|re&63,z>65535&&z<1114112&&(x=z))}}x===null?(x=65533,K=1):x>65535&&(x-=65536,l.push(x>>>10&1023|55296),x=56320|x&1023),l.push(x),b+=K}return ze(l)}const ve=4096;function ze(f){const n=f.length;if(n<=ve)return String.fromCharCode.apply(String,f);let i="",l=0;for(;l<n;)i+=String.fromCharCode.apply(String,f.slice(l,l+=ve));return i}function Ie(f,n,i){let l="";i=Math.min(f.length,i);for(let b=n;b<i;++b)l+=String.fromCharCode(f[b]&127);return l}function He(f,n,i){let l="";i=Math.min(f.length,i);for(let b=n;b<i;++b)l+=String.fromCharCode(f[b]);return l}function ke(f,n,i){const l=f.length;(!n||n<0)&&(n=0),(!i||i<0||i>l)&&(i=l);let b="";for(let g=n;g<i;++g)b+=bt[f[g]];return b}function je(f,n,i){const l=f.slice(n,i);let b="";for(let g=0;g<l.length-1;g+=2)b+=String.fromCharCode(l[g]+l[g+1]*256);return b}u.prototype.slice=function(n,i){const l=this.length;n=~~n,i=i===void 0?l:~~i,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),i<0?(i+=l,i<0&&(i=0)):i>l&&(i=l),i<n&&(i=n);const b=this.subarray(n,i);return Object.setPrototypeOf(b,u.prototype),b};function X(f,n,i){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+n>i)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(n,i,l){n=n>>>0,i=i>>>0,l||X(n,i,this.length);let b=this[n],g=1,x=0;for(;++x<i&&(g*=256);)b+=this[n+x]*g;return b},u.prototype.readUintBE=u.prototype.readUIntBE=function(n,i,l){n=n>>>0,i=i>>>0,l||X(n,i,this.length);let b=this[n+--i],g=1;for(;i>0&&(g*=256);)b+=this[n+--i]*g;return b},u.prototype.readUint8=u.prototype.readUInt8=function(n,i){return n=n>>>0,i||X(n,1,this.length),this[n]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||X(n,2,this.length),this[n]|this[n+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||X(n,2,this.length),this[n]<<8|this[n+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||X(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||X(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},u.prototype.readBigUInt64LE=Re(function(n){n=n>>>0,B(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&F(n,this.length-8);const b=i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,g=this[++n]+this[++n]*2**8+this[++n]*2**16+l*2**24;return BigInt(b)+(BigInt(g)<<BigInt(32))}),u.prototype.readBigUInt64BE=Re(function(n){n=n>>>0,B(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&F(n,this.length-8);const b=i*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],g=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l;return(BigInt(b)<<BigInt(32))+BigInt(g)}),u.prototype.readIntLE=function(n,i,l){n=n>>>0,i=i>>>0,l||X(n,i,this.length);let b=this[n],g=1,x=0;for(;++x<i&&(g*=256);)b+=this[n+x]*g;return g*=128,b>=g&&(b-=Math.pow(2,8*i)),b},u.prototype.readIntBE=function(n,i,l){n=n>>>0,i=i>>>0,l||X(n,i,this.length);let b=i,g=1,x=this[n+--b];for(;b>0&&(g*=256);)x+=this[n+--b]*g;return g*=128,x>=g&&(x-=Math.pow(2,8*i)),x},u.prototype.readInt8=function(n,i){return n=n>>>0,i||X(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},u.prototype.readInt16LE=function(n,i){n=n>>>0,i||X(n,2,this.length);const l=this[n]|this[n+1]<<8;return l&32768?l|4294901760:l},u.prototype.readInt16BE=function(n,i){n=n>>>0,i||X(n,2,this.length);const l=this[n+1]|this[n]<<8;return l&32768?l|4294901760:l},u.prototype.readInt32LE=function(n,i){return n=n>>>0,i||X(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},u.prototype.readInt32BE=function(n,i){return n=n>>>0,i||X(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},u.prototype.readBigInt64LE=Re(function(n){n=n>>>0,B(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&F(n,this.length-8);const b=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(l<<24);return(BigInt(b)<<BigInt(32))+BigInt(i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),u.prototype.readBigInt64BE=Re(function(n){n=n>>>0,B(n,"offset");const i=this[n],l=this[n+7];(i===void 0||l===void 0)&&F(n,this.length-8);const b=(i<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(b)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+l)}),u.prototype.readFloatLE=function(n,i){return n=n>>>0,i||X(n,4,this.length),r.read(this,n,!0,23,4)},u.prototype.readFloatBE=function(n,i){return n=n>>>0,i||X(n,4,this.length),r.read(this,n,!1,23,4)},u.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||X(n,8,this.length),r.read(this,n,!0,52,8)},u.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||X(n,8,this.length),r.read(this,n,!1,52,8)};function ie(f,n,i,l,b,g){if(!u.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>b||n<g)throw new RangeError('"value" argument is out of bounds');if(i+l>f.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(n,i,l,b){if(n=+n,i=i>>>0,l=l>>>0,!b){const K=Math.pow(2,8*l)-1;ie(this,n,i,l,K,0)}let g=1,x=0;for(this[i]=n&255;++x<l&&(g*=256);)this[i+x]=n/g&255;return i+l},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(n,i,l,b){if(n=+n,i=i>>>0,l=l>>>0,!b){const K=Math.pow(2,8*l)-1;ie(this,n,i,l,K,0)}let g=l-1,x=1;for(this[i+g]=n&255;--g>=0&&(x*=256);)this[i+g]=n/x&255;return i+l},u.prototype.writeUint8=u.prototype.writeUInt8=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,1,255,0),this[i]=n&255,i+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function Ee(f,n,i,l,b){d(n,l,b,f,i,7);let g=Number(n&BigInt(4294967295));f[i++]=g,g=g>>8,f[i++]=g,g=g>>8,f[i++]=g,g=g>>8,f[i++]=g;let x=Number(n>>BigInt(32)&BigInt(4294967295));return f[i++]=x,x=x>>8,f[i++]=x,x=x>>8,f[i++]=x,x=x>>8,f[i++]=x,i}function qe(f,n,i,l,b){d(n,l,b,f,i,7);let g=Number(n&BigInt(4294967295));f[i+7]=g,g=g>>8,f[i+6]=g,g=g>>8,f[i+5]=g,g=g>>8,f[i+4]=g;let x=Number(n>>BigInt(32)&BigInt(4294967295));return f[i+3]=x,x=x>>8,f[i+2]=x,x=x>>8,f[i+1]=x,x=x>>8,f[i]=x,i+8}u.prototype.writeBigUInt64LE=Re(function(n,i=0){return Ee(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Re(function(n,i=0){return qe(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(n,i,l,b){if(n=+n,i=i>>>0,!b){const te=Math.pow(2,8*l-1);ie(this,n,i,l,te-1,-te)}let g=0,x=1,K=0;for(this[i]=n&255;++g<l&&(x*=256);)n<0&&K===0&&this[i+g-1]!==0&&(K=1),this[i+g]=(n/x>>0)-K&255;return i+l},u.prototype.writeIntBE=function(n,i,l,b){if(n=+n,i=i>>>0,!b){const te=Math.pow(2,8*l-1);ie(this,n,i,l,te-1,-te)}let g=l-1,x=1,K=0;for(this[i+g]=n&255;--g>=0&&(x*=256);)n<0&&K===0&&this[i+g+1]!==0&&(K=1),this[i+g]=(n/x>>0)-K&255;return i+l},u.prototype.writeInt8=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},u.prototype.writeInt16LE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},u.prototype.writeInt16BE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},u.prototype.writeInt32LE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},u.prototype.writeInt32BE=function(n,i,l){return n=+n,i=i>>>0,l||ie(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},u.prototype.writeBigInt64LE=Re(function(n,i=0){return Ee(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Re(function(n,i=0){return qe(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Me(f,n,i,l,b,g){if(i+l>f.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function _(f,n,i,l,b){return n=+n,i=i>>>0,b||Me(f,n,i,4),r.write(f,n,i,l,23,4),i+4}u.prototype.writeFloatLE=function(n,i,l){return _(this,n,i,!0,l)},u.prototype.writeFloatBE=function(n,i,l){return _(this,n,i,!1,l)};function y(f,n,i,l,b){return n=+n,i=i>>>0,b||Me(f,n,i,8),r.write(f,n,i,l,52,8),i+8}u.prototype.writeDoubleLE=function(n,i,l){return y(this,n,i,!0,l)},u.prototype.writeDoubleBE=function(n,i,l){return y(this,n,i,!1,l)},u.prototype.copy=function(n,i,l,b){if(!u.isBuffer(n))throw new TypeError("argument should be a Buffer");if(l||(l=0),!b&&b!==0&&(b=this.length),i>=n.length&&(i=n.length),i||(i=0),b>0&&b<l&&(b=l),b===l||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(b<0)throw new RangeError("sourceEnd out of bounds");b>this.length&&(b=this.length),n.length-i<b-l&&(b=n.length-i+l);const g=b-l;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,l,b):Uint8Array.prototype.set.call(n,this.subarray(l,b),i),g},u.prototype.fill=function(n,i,l,b){if(typeof n=="string"){if(typeof i=="string"?(b=i,i=0,l=this.length):typeof l=="string"&&(b=l,l=this.length),b!==void 0&&typeof b!="string")throw new TypeError("encoding must be a string");if(typeof b=="string"&&!u.isEncoding(b))throw new TypeError("Unknown encoding: "+b);if(n.length===1){const x=n.charCodeAt(0);(b==="utf8"&&x<128||b==="latin1")&&(n=x)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<l)throw new RangeError("Out of range index");if(l<=i)return this;i=i>>>0,l=l===void 0?this.length:l>>>0,n||(n=0);let g;if(typeof n=="number")for(g=i;g<l;++g)this[g]=n;else{const x=u.isBuffer(n)?n:u.from(n,b),K=x.length;if(K===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(g=0;g<l-i;++g)this[g+i]=x[g%K]}return this};const S={};function D(f,n,i){S[f]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(b){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:b,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(f,n){return`The "${f}" argument must be of type number. Received type ${typeof n}`},TypeError),D("ERR_OUT_OF_RANGE",function(f,n,i){let l=`The value of "${f}" is out of range.`,b=i;return Number.isInteger(i)&&Math.abs(i)>2**32?b=q(String(i)):typeof i=="bigint"&&(b=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(b=q(b)),b+="n"),l+=` It must be ${n}. Received ${b}`,l},RangeError);function q(f){let n="",i=f.length;const l=f[0]==="-"?1:0;for(;i>=l+4;i-=3)n=`_${f.slice(i-3,i)}${n}`;return`${f.slice(0,i)}${n}`}function h(f,n,i){B(n,"offset"),(f[n]===void 0||f[n+i]===void 0)&&F(n,f.length-(i+1))}function d(f,n,i,l,b,g){if(f>i||f<n){const x=typeof n=="bigint"?"n":"";let K;throw n===0||n===BigInt(0)?K=`>= 0${x} and < 2${x} ** ${(g+1)*8}${x}`:K=`>= -(2${x} ** ${(g+1)*8-1}${x}) and < 2 ** ${(g+1)*8-1}${x}`,new S.ERR_OUT_OF_RANGE("value",K,f)}h(l,b,g)}function B(f,n){if(typeof f!="number")throw new S.ERR_INVALID_ARG_TYPE(n,"number",f)}function F(f,n,i){throw Math.floor(f)!==f?(B(f,i),new S.ERR_OUT_OF_RANGE("offset","an integer",f)):n<0?new S.ERR_BUFFER_OUT_OF_BOUNDS:new S.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${n}`,f)}const Q=/[^+/0-9A-Za-z-_]/g;function W(f){if(f=f.split("=")[0],f=f.trim().replace(Q,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function G(f,n){n=n||1/0;let i;const l=f.length;let b=null;const g=[];for(let x=0;x<l;++x){if(i=f.charCodeAt(x),i>55295&&i<57344){if(!b){if(i>56319){(n-=3)>-1&&g.push(239,191,189);continue}else if(x+1===l){(n-=3)>-1&&g.push(239,191,189);continue}b=i;continue}if(i<56320){(n-=3)>-1&&g.push(239,191,189),b=i;continue}i=(b-55296<<10|i-56320)+65536}else b&&(n-=3)>-1&&g.push(239,191,189);if(b=null,i<128){if((n-=1)<0)break;g.push(i)}else if(i<2048){if((n-=2)<0)break;g.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;g.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;g.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return g}function We(f){const n=[];for(let i=0;i<f.length;++i)n.push(f.charCodeAt(i)&255);return n}function tt(f,n){let i,l,b;const g=[];for(let x=0;x<f.length&&!((n-=2)<0);++x)i=f.charCodeAt(x),l=i>>8,b=i%256,g.push(b),g.push(l);return g}function pt(f){return t.toByteArray(W(f))}function rt(f,n,i,l){let b;for(b=0;b<l&&!(b+i>=n.length||b>=f.length);++b)n[b+i]=f[b];return b}function Be(f,n){return f instanceof n||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===n.name}function Je(f){return f!==f}const bt=function(){const f="0123456789abcdef",n=new Array(256);for(let i=0;i<16;++i){const l=i*16;for(let b=0;b<16;++b)n[l+b]=f[i]+f[b]}return n}();function Re(f){return typeof BigInt>"u"?Ye:f}function Ye(){throw new Error("BigInt not supported")}})(ht);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=ht,a=r.Buffer;function o(c,u){for(var p in c)u[p]=c[p]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=s);function s(c,u,p){return a(c,u,p)}s.prototype=Object.create(a.prototype),o(a,s),s.from=function(c,u,p){if(typeof c=="number")throw new TypeError("Argument must not be a number");return a(c,u,p)},s.alloc=function(c,u,p){if(typeof c!="number")throw new TypeError("Argument must be a number");var w=a(c);return u!==void 0?typeof p=="string"?w.fill(u,p):w.fill(u):w.fill(0),w},s.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return a(c)},s.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(vr,vr.exports);var xe=vr.exports,ar=65536,Yi=4294967295;function Xi(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
28
|
-
Use Chrome, Firefox or Internet Explorer 11`)}var Qi=xe.Buffer,Dt=Ge.crypto||Ge.msCrypto;Dt&&Dt.getRandomValues?mr.exports=Zi:mr.exports=Xi;function Zi(e,t){if(e>Yi)throw new RangeError("requested too many random bytes");var r=Qi.allocUnsafe(e);if(e>0)if(e>ar)for(var a=0;a<e;a+=ar)Dt.getRandomValues(r.slice(a,a+ar));else Dt.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}var ea=mr.exports,xr={exports:{}};typeof Object.create=="function"?xr.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:xr.exports=function(t,r){if(r){t.super_=r;var a=function(){};a.prototype=r.prototype,t.prototype=new a,t.prototype.constructor=t}};var be=xr.exports,Er={exports:{}},Lr={exports:{}},st=typeof Reflect=="object"?Reflect:null,Wr=st&&typeof st.apply=="function"?st.apply:function(t,r,a){return Function.prototype.apply.call(t,r,a)},Mt;st&&typeof st.ownKeys=="function"?Mt=st.ownKeys:Object.getOwnPropertySymbols?Mt=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Mt=function(t){return Object.getOwnPropertyNames(t)};function ta(e){console&&console.warn&&console.warn(e)}var kn=Number.isNaN||function(t){return t!==t};function V(){V.init.call(this)}Lr.exports=V;Lr.exports.once=aa;V.EventEmitter=V;V.prototype._events=void 0;V.prototype._eventsCount=0;V.prototype._maxListeners=void 0;var Kr=10;function Kt(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(V,"defaultMaxListeners",{enumerable:!0,get:function(){return Kr},set:function(e){if(typeof e!="number"||e<0||kn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Kr=e}});V.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};V.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||kn(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Cn(e){return e._maxListeners===void 0?V.defaultMaxListeners:e._maxListeners}V.prototype.getMaxListeners=function(){return Cn(this)};V.prototype.emit=function(t){for(var r=[],a=1;a<arguments.length;a++)r.push(arguments[a]);var o=t==="error",s=this._events;if(s!==void 0)o=o&&s.error===void 0;else if(!o)return!1;if(o){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var u=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw u.context=c,u}var p=s[t];if(p===void 0)return!1;if(typeof p=="function")Wr(p,this,r);else for(var w=p.length,m=Fn(p,w),a=0;a<w;++a)Wr(m[a],this,r);return!0};function On(e,t,r,a){var o,s,c;if(Kt(r),s=e._events,s===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),c=s[t]),c===void 0)c=s[t]=r,++e._eventsCount;else if(typeof c=="function"?c=s[t]=a?[r,c]:[c,r]:a?c.unshift(r):c.push(r),o=Cn(e),o>0&&c.length>o&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=c.length,ta(u)}return e}V.prototype.addListener=function(t,r){return On(this,t,r,!1)};V.prototype.on=V.prototype.addListener;V.prototype.prependListener=function(t,r){return On(this,t,r,!0)};function ra(){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 Ln(e,t,r){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=ra.bind(a);return o.listener=r,a.wrapFn=o,o}V.prototype.once=function(t,r){return Kt(r),this.on(t,Ln(this,t,r)),this};V.prototype.prependOnceListener=function(t,r){return Kt(r),this.prependListener(t,Ln(this,t,r)),this};V.prototype.removeListener=function(t,r){var a,o,s,c,u;if(Kt(r),o=this._events,o===void 0)return this;if(a=o[t],a===void 0)return this;if(a===r||a.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,a.listener||r));else if(typeof a!="function"){for(s=-1,c=a.length-1;c>=0;c--)if(a[c]===r||a[c].listener===r){u=a[c].listener,s=c;break}if(s<0)return this;s===0?a.shift():na(a,s),a.length===1&&(o[t]=a[0]),o.removeListener!==void 0&&this.emit("removeListener",t,u||r)}return this};V.prototype.off=V.prototype.removeListener;V.prototype.removeAllListeners=function(t){var r,a,o;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[t]),this;if(arguments.length===0){var s=Object.keys(a),c;for(o=0;o<s.length;++o)c=s[o],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=a[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(o=r.length-1;o>=0;o--)this.removeListener(t,r[o]);return this};function Mn(e,t,r){var a=e._events;if(a===void 0)return[];var o=a[t];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?ia(o):Fn(o,o.length)}V.prototype.listeners=function(t){return Mn(this,t,!0)};V.prototype.rawListeners=function(t){return Mn(this,t,!1)};V.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Pn.call(e,t)};V.prototype.listenerCount=Pn;function Pn(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}V.prototype.eventNames=function(){return this._eventsCount>0?Mt(this._events):[]};function Fn(e,t){for(var r=new Array(t),a=0;a<t;++a)r[a]=e[a];return r}function na(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function ia(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function aa(e,t){return new Promise(function(r,a){function o(c){e.removeListener(t,s),a(c)}function s(){typeof e.removeListener=="function"&&e.removeListener("error",o),r([].slice.call(arguments))}Nn(e,t,s,{once:!0}),t!=="error"&&oa(e,o,{once:!0})})}function oa(e,t,r){typeof e.on=="function"&&Nn(e,"error",t,r)}function Nn(e,t,r,a){if(typeof e.on=="function")a.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function o(s){a.once&&e.removeEventListener(t,o),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var Un=Lr.exports,Dn=Un.EventEmitter;const sa={},fa=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"})),Mr=Mi(fa);var or,Gr;function ua(){if(Gr)return or;Gr=1;function e(R,k){var A=Object.keys(R);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(R);k&&(I=I.filter(function(M){return Object.getOwnPropertyDescriptor(R,M).enumerable})),A.push.apply(A,I)}return A}function t(R){for(var k=1;k<arguments.length;k++){var A=arguments[k]!=null?arguments[k]:{};k%2?e(Object(A),!0).forEach(function(I){r(R,I,A[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(A)):e(Object(A)).forEach(function(I){Object.defineProperty(R,I,Object.getOwnPropertyDescriptor(A,I))})}return R}function r(R,k,A){return k=c(k),k in R?Object.defineProperty(R,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):R[k]=A,R}function a(R,k){if(!(R instanceof k))throw new TypeError("Cannot call a class as a function")}function o(R,k){for(var A=0;A<k.length;A++){var I=k[A];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(R,c(I.key),I)}}function s(R,k,A){return k&&o(R.prototype,k),Object.defineProperty(R,"prototype",{writable:!1}),R}function c(R){var k=u(R,"string");return typeof k=="symbol"?k:String(k)}function u(R,k){if(typeof R!="object"||R===null)return R;var A=R[Symbol.toPrimitive];if(A!==void 0){var I=A.call(R,k||"default");if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(R)}var p=ht,w=p.Buffer,m=Mr,v=m.inspect,T=v&&v.custom||"inspect";function C(R,k,A){w.prototype.copy.call(R,k,A)}return or=function(){function R(){a(this,R),this.head=null,this.tail=null,this.length=0}return s(R,[{key:"push",value:function(A){var I={data:A,next:null};this.length>0?this.tail.next=I:this.head=I,this.tail=I,++this.length}},{key:"unshift",value:function(A){var I={data:A,next:this.head};this.length===0&&(this.tail=I),this.head=I,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(A){if(this.length===0)return"";for(var I=this.head,M=""+I.data;I=I.next;)M+=A+I.data;return M}},{key:"concat",value:function(A){if(this.length===0)return w.alloc(0);for(var I=w.allocUnsafe(A>>>0),M=this.head,P=0;M;)C(M.data,I,P),P+=M.data.length,M=M.next;return I}},{key:"consume",value:function(A,I){var M;return A<this.head.data.length?(M=this.head.data.slice(0,A),this.head.data=this.head.data.slice(A)):A===this.head.data.length?M=this.shift():M=I?this._getString(A):this._getBuffer(A),M}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(A){var I=this.head,M=1,P=I.data;for(A-=P.length;I=I.next;){var L=I.data,N=A>L.length?L.length:A;if(N===L.length?P+=L:P+=L.slice(0,A),A-=N,A===0){N===L.length?(++M,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=L.slice(N));break}++M}return this.length-=M,P}},{key:"_getBuffer",value:function(A){var I=w.allocUnsafe(A),M=this.head,P=1;for(M.data.copy(I),A-=M.data.length;M=M.next;){var L=M.data,N=A>L.length?L.length:A;if(L.copy(I,I.length-A,0,N),A-=N,A===0){N===L.length?(++P,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=L.slice(N));break}++P}return this.length-=P,I}},{key:T,value:function(A,I){return v(this,t(t({},I),{},{depth:0,customInspect:!1}))}}]),R}(),or}function ca(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Br,this,e)):process.nextTick(Br,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Pt,r):(r._writableState.errorEmitted=!0,process.nextTick(Vr,r,s)):process.nextTick(Vr,r,s):t?(process.nextTick(Pt,r),t(s)):process.nextTick(Pt,r)}),this)}function Vr(e,t){Br(e,t),Pt(e)}function Pt(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function la(){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 Br(e,t){e.emit("error",t)}function ha(e,t){var r=e._readableState,a=e._writableState;r&&r.autoDestroy||a&&a.autoDestroy?e.destroy(t):e.emit("error",t)}var $n={destroy:ca,undestroy:la,errorOrDestroy:ha},Ze={};function da(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Hn={};function Ae(e,t,r){r||(r=Error);function a(s,c,u){return typeof t=="string"?t:t(s,c,u)}var o=function(s){da(c,s);function c(u,p,w){return s.call(this,a(u,p,w))||this}return c}(r);o.prototype.name=r.name,o.prototype.code=e,Hn[e]=o}function zr(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(a){return String(a)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function pa(e,t,r){return e.substr(0,t.length)===t}function ba(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function ya(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ae("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ae("ERR_INVALID_ARG_TYPE",function(e,t,r){var a;typeof t=="string"&&pa(t,"not ")?(a="must not be",t=t.replace(/^not /,"")):a="must be";var o;if(ba(e," argument"))o="The ".concat(e," ").concat(a," ").concat(zr(t,"type"));else{var s=ya(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(a," ").concat(zr(t,"type"))}return o+=". Received type ".concat(typeof r),o},TypeError);Ae("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ae("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ae("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ae("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ae("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ae("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ae("ERR_STREAM_WRITE_AFTER_END","write after end");Ae("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ae("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ae("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Ze.codes=Hn;var _a=Ze.codes.ERR_INVALID_OPT_VALUE;function ga(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function wa(e,t,r,a){var o=ga(t,a,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var s=a?r:"highWaterMark";throw new _a(s,o)}return Math.floor(o)}return e.objectMode?16:16*1024}var jn={getHighWaterMark:wa},ma=va;function va(e,t){if(sr("noDeprecation"))return e;var r=!1;function a(){if(!r){if(sr("throwDeprecation"))throw new Error(t);sr("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return a}function sr(e){try{if(!Ge.localStorage)return!1}catch{return!1}var t=Ge.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var fr,Jr;function qn(){if(Jr)return fr;Jr=1,fr=U;function e(_){var y=this;this.next=null,this.entry=null,this.finish=function(){Me(y,_)}}var t;U.WritableState=E;var r={deprecate:ma},a=Dn,o=ht.Buffer,s=(typeof Ge<"u"?Ge:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(_){return o.from(_)}function u(_){return o.isBuffer(_)||_ instanceof s}var p=$n,w=jn,m=w.getHighWaterMark,v=Ze.codes,T=v.ERR_INVALID_ARG_TYPE,C=v.ERR_METHOD_NOT_IMPLEMENTED,R=v.ERR_MULTIPLE_CALLBACK,k=v.ERR_STREAM_CANNOT_PIPE,A=v.ERR_STREAM_DESTROYED,I=v.ERR_STREAM_NULL_VALUES,M=v.ERR_STREAM_WRITE_AFTER_END,P=v.ERR_UNKNOWN_ENCODING,L=p.errorOrDestroy;be(U,a);function N(){}function E(_,y,S){t=t||lt(),_=_||{},typeof S!="boolean"&&(S=y instanceof t),this.objectMode=!!_.objectMode,S&&(this.objectMode=this.objectMode||!!_.writableObjectMode),this.highWaterMark=m(this,_,"writableHighWaterMark",S),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var D=_.decodeStrings===!1;this.decodeStrings=!D,this.defaultEncoding=_.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){ze(y,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=_.emitClose!==!1,this.autoDestroy=!!_.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}E.prototype.getBuffer=function(){for(var y=this.bufferedRequest,S=[];y;)S.push(y),y=y.next;return S},function(){try{Object.defineProperty(E.prototype,"buffer",{get:r.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(U,Symbol.hasInstance,{value:function(y){return j.call(this,y)?!0:this!==U?!1:y&&y._writableState instanceof E}})):j=function(y){return y instanceof this};function U(_){t=t||lt();var y=this instanceof t;if(!y&&!j.call(U,this))return new U(_);this._writableState=new E(_,this,y),this.writable=!0,_&&(typeof _.write=="function"&&(this._write=_.write),typeof _.writev=="function"&&(this._writev=_.writev),typeof _.destroy=="function"&&(this._destroy=_.destroy),typeof _.final=="function"&&(this._final=_.final)),a.call(this)}U.prototype.pipe=function(){L(this,new k)};function $(_,y){var S=new M;L(_,S),process.nextTick(y,S)}function ne(_,y,S,D){var q;return S===null?q=new I:typeof S!="string"&&!y.objectMode&&(q=new T("chunk",["string","Buffer"],S)),q?(L(_,q),process.nextTick(D,q),!1):!0}U.prototype.write=function(_,y,S){var D=this._writableState,q=!1,h=!D.objectMode&&u(_);return h&&!o.isBuffer(_)&&(_=c(_)),typeof y=="function"&&(S=y,y=null),h?y="buffer":y||(y=D.defaultEncoding),typeof S!="function"&&(S=N),D.ending?$(this,S):(h||ne(this,D,_,S))&&(D.pendingcb++,q=$e(this,D,h,_,y,S)),q},U.prototype.cork=function(){this._writableState.corked++},U.prototype.uncork=function(){var _=this._writableState;_.corked&&(_.corked--,!_.writing&&!_.corked&&!_.bufferProcessing&&_.bufferedRequest&&ke(this,_))},U.prototype.setDefaultEncoding=function(y){if(typeof y=="string"&&(y=y.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((y+"").toLowerCase())>-1))throw new P(y);return this._writableState.defaultEncoding=y,this},Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Te(_,y,S){return!_.objectMode&&_.decodeStrings!==!1&&typeof y=="string"&&(y=o.from(y,S)),y}Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $e(_,y,S,D,q,h){if(!S){var d=Te(y,D,q);D!==d&&(S=!0,q="buffer",D=d)}var B=y.objectMode?1:D.length;y.length+=B;var F=y.length<y.highWaterMark;if(F||(y.needDrain=!0),y.writing||y.corked){var Q=y.lastBufferedRequest;y.lastBufferedRequest={chunk:D,encoding:q,isBuf:S,callback:h,next:null},Q?Q.next=y.lastBufferedRequest:y.bufferedRequest=y.lastBufferedRequest,y.bufferedRequestCount+=1}else oe(_,y,!1,B,D,q,h);return F}function oe(_,y,S,D,q,h,d){y.writelen=D,y.writecb=d,y.writing=!0,y.sync=!0,y.destroyed?y.onwrite(new A("write")):S?_._writev(q,y.onwrite):_._write(q,h,y.onwrite),y.sync=!1}function me(_,y,S,D,q){--y.pendingcb,S?(process.nextTick(q,D),process.nextTick(Ee,_,y),_._writableState.errorEmitted=!0,L(_,D)):(q(D),_._writableState.errorEmitted=!0,L(_,D),Ee(_,y))}function ve(_){_.writing=!1,_.writecb=null,_.length-=_.writelen,_.writelen=0}function ze(_,y){var S=_._writableState,D=S.sync,q=S.writecb;if(typeof q!="function")throw new R;if(ve(S),y)me(_,S,D,y,q);else{var h=je(S)||_.destroyed;!h&&!S.corked&&!S.bufferProcessing&&S.bufferedRequest&&ke(_,S),D?process.nextTick(Ie,_,S,h,q):Ie(_,S,h,q)}}function Ie(_,y,S,D){S||He(_,y),y.pendingcb--,D(),Ee(_,y)}function He(_,y){y.length===0&&y.needDrain&&(y.needDrain=!1,_.emit("drain"))}function ke(_,y){y.bufferProcessing=!0;var S=y.bufferedRequest;if(_._writev&&S&&S.next){var D=y.bufferedRequestCount,q=new Array(D),h=y.corkedRequestsFree;h.entry=S;for(var d=0,B=!0;S;)q[d]=S,S.isBuf||(B=!1),S=S.next,d+=1;q.allBuffers=B,oe(_,y,!0,y.length,q,"",h.finish),y.pendingcb++,y.lastBufferedRequest=null,h.next?(y.corkedRequestsFree=h.next,h.next=null):y.corkedRequestsFree=new e(y),y.bufferedRequestCount=0}else{for(;S;){var F=S.chunk,Q=S.encoding,W=S.callback,G=y.objectMode?1:F.length;if(oe(_,y,!1,G,F,Q,W),S=S.next,y.bufferedRequestCount--,y.writing)break}S===null&&(y.lastBufferedRequest=null)}y.bufferedRequest=S,y.bufferProcessing=!1}U.prototype._write=function(_,y,S){S(new C("_write()"))},U.prototype._writev=null,U.prototype.end=function(_,y,S){var D=this._writableState;return typeof _=="function"?(S=_,_=null,y=null):typeof y=="function"&&(S=y,y=null),_!=null&&this.write(_,y),D.corked&&(D.corked=1,this.uncork()),D.ending||qe(this,D,S),this},Object.defineProperty(U.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function je(_){return _.ending&&_.length===0&&_.bufferedRequest===null&&!_.finished&&!_.writing}function X(_,y){_._final(function(S){y.pendingcb--,S&&L(_,S),y.prefinished=!0,_.emit("prefinish"),Ee(_,y)})}function ie(_,y){!y.prefinished&&!y.finalCalled&&(typeof _._final=="function"&&!y.destroyed?(y.pendingcb++,y.finalCalled=!0,process.nextTick(X,_,y)):(y.prefinished=!0,_.emit("prefinish")))}function Ee(_,y){var S=je(y);if(S&&(ie(_,y),y.pendingcb===0&&(y.finished=!0,_.emit("finish"),y.autoDestroy))){var D=_._readableState;(!D||D.autoDestroy&&D.endEmitted)&&_.destroy()}return S}function qe(_,y,S){y.ending=!0,Ee(_,y),S&&(y.finished?process.nextTick(S):_.once("finish",S)),y.ended=!0,_.writable=!1}function Me(_,y,S){var D=_.entry;for(_.entry=null;D;){var q=D.callback;y.pendingcb--,q(S),D=D.next}y.corkedRequestsFree.next=_}return Object.defineProperty(U.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(y){this._writableState&&(this._writableState.destroyed=y)}}),U.prototype.destroy=p.destroy,U.prototype._undestroy=p.undestroy,U.prototype._destroy=function(_,y){y(_)},fr}var ur,Yr;function lt(){if(Yr)return ur;Yr=1;var e=Object.keys||function(w){var m=[];for(var v in w)m.push(v);return m};ur=c;var t=Kn(),r=qn();be(c,t);for(var a=e(r.prototype),o=0;o<a.length;o++){var s=a[o];c.prototype[s]||(c.prototype[s]=r.prototype[s])}function c(w){if(!(this instanceof c))return new c(w);t.call(this,w),r.call(this,w),this.allowHalfOpen=!0,w&&(w.readable===!1&&(this.readable=!1),w.writable===!1&&(this.writable=!1),w.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u(){this._writableState.ended||process.nextTick(p,this)}function p(w){w.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(m){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=m,this._writableState.destroyed=m)}}),ur}var $t={},Pr=xe.Buffer,Xr=Pr.isEncoding||function(e){switch(e=""+e,e&&e.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 xa(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Ea(e){var t=xa(e);if(typeof t!="string"&&(Pr.isEncoding===Xr||!Xr(e)))throw new Error("Unknown encoding: "+e);return t||e}$t.StringDecoder=At;function At(e){this.encoding=Ea(e);var t;switch(this.encoding){case"utf16le":this.text=Ia,this.end=ka,t=4;break;case"utf8":this.fillLast=Sa,t=4;break;case"base64":this.text=Ca,this.end=Oa,t=3;break;default:this.write=La,this.end=Ma;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Pr.allocUnsafe(t)}At.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};At.prototype.end=Ta;At.prototype.text=Aa;At.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function cr(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Ba(e,t,r){var a=t.length-1;if(a<r)return 0;var o=cr(t[a]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--a<r||o===-2?0:(o=cr(t[a]),o>=0?(o>0&&(e.lastNeed=o-2),o):--a<r||o===-2?0:(o=cr(t[a]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}function Ra(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function Sa(e){var t=this.lastTotal-this.lastNeed,r=Ra(this,e);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Aa(e,t){var r=Ba(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)}function Ta(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function Ia(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function ka(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Ca(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Oa(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function La(e){return e.toString(this.encoding)}function Ma(e){return e&&e.length?this.write(e):""}var Qr=Ze.codes.ERR_STREAM_PREMATURE_CLOSE;function Pa(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];e.apply(this,a)}}}function Fa(){}function Na(e){return e.setHeader&&typeof e.abort=="function"}function Wn(e,t,r){if(typeof t=="function")return Wn(e,null,t);t||(t={}),r=Pa(r||Fa);var a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){o=!1,c=!0,a||r.call(e)},p=e._readableState&&e._readableState.endEmitted,w=function(){a=!1,p=!0,o||r.call(e)},m=function(R){r.call(e,R)},v=function(){var R;if(a&&!p)return(!e._readableState||!e._readableState.ended)&&(R=new Qr),r.call(e,R);if(o&&!c)return(!e._writableState||!e._writableState.ended)&&(R=new Qr),r.call(e,R)},T=function(){e.req.on("finish",u)};return Na(e)?(e.on("complete",u),e.on("abort",v),e.req?T():e.on("request",T)):o&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",w),e.on("finish",u),t.error!==!1&&e.on("error",m),e.on("close",v),function(){e.removeListener("complete",u),e.removeListener("abort",v),e.removeListener("request",T),e.req&&e.req.removeListener("finish",u),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",u),e.removeListener("end",w),e.removeListener("error",m),e.removeListener("close",v)}}var Fr=Wn,lr,Zr;function Ua(){if(Zr)return lr;Zr=1;var e;function t(P,L,N){return L=r(L),L in P?Object.defineProperty(P,L,{value:N,enumerable:!0,configurable:!0,writable:!0}):P[L]=N,P}function r(P){var L=a(P,"string");return typeof L=="symbol"?L:String(L)}function a(P,L){if(typeof P!="object"||P===null)return P;var N=P[Symbol.toPrimitive];if(N!==void 0){var E=N.call(P,L||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(L==="string"?String:Number)(P)}var o=Fr,s=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),p=Symbol("ended"),w=Symbol("lastPromise"),m=Symbol("handlePromise"),v=Symbol("stream");function T(P,L){return{value:P,done:L}}function C(P){var L=P[s];if(L!==null){var N=P[v].read();N!==null&&(P[w]=null,P[s]=null,P[c]=null,L(T(N,!1)))}}function R(P){process.nextTick(C,P)}function k(P,L){return function(N,E){P.then(function(){if(L[p]){N(T(void 0,!0));return}L[m](N,E)},E)}}var A=Object.getPrototypeOf(function(){}),I=Object.setPrototypeOf((e={get stream(){return this[v]},next:function(){var L=this,N=this[u];if(N!==null)return Promise.reject(N);if(this[p])return Promise.resolve(T(void 0,!0));if(this[v].destroyed)return new Promise(function($,ne){process.nextTick(function(){L[u]?ne(L[u]):$(T(void 0,!0))})});var E=this[w],j;if(E)j=new Promise(k(E,this));else{var U=this[v].read();if(U!==null)return Promise.resolve(T(U,!1));j=new Promise(this[m])}return this[w]=j,j}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var L=this;return new Promise(function(N,E){L[v].destroy(null,function(j){if(j){E(j);return}N(T(void 0,!0))})})}),e),A),M=function(L){var N,E=Object.create(I,(N={},t(N,v,{value:L,writable:!0}),t(N,s,{value:null,writable:!0}),t(N,c,{value:null,writable:!0}),t(N,u,{value:null,writable:!0}),t(N,p,{value:L._readableState.endEmitted,writable:!0}),t(N,m,{value:function(U,$){var ne=E[v].read();ne?(E[w]=null,E[s]=null,E[c]=null,U(T(ne,!1))):(E[s]=U,E[c]=$)},writable:!0}),N));return E[w]=null,o(L,function(j){if(j&&j.code!=="ERR_STREAM_PREMATURE_CLOSE"){var U=E[c];U!==null&&(E[w]=null,E[s]=null,E[c]=null,U(j)),E[u]=j;return}var $=E[s];$!==null&&(E[w]=null,E[s]=null,E[c]=null,$(T(void 0,!0))),E[p]=!0}),L.on("readable",R.bind(null,E)),E};return lr=M,lr}var hr,en;function Da(){return en||(en=1,hr=function(){throw new Error("Readable.from is not available in the browser")}),hr}var dr,tn;function Kn(){if(tn)return dr;tn=1,dr=$;var e;$.ReadableState=U,Un.EventEmitter;var t=function(d,B){return d.listeners(B).length},r=Dn,a=ht.Buffer,o=(typeof Ge<"u"?Ge:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(h){return a.from(h)}function c(h){return a.isBuffer(h)||h instanceof o}var u=Mr,p;u&&u.debuglog?p=u.debuglog("stream"):p=function(){};var w=ua(),m=$n,v=jn,T=v.getHighWaterMark,C=Ze.codes,R=C.ERR_INVALID_ARG_TYPE,k=C.ERR_STREAM_PUSH_AFTER_EOF,A=C.ERR_METHOD_NOT_IMPLEMENTED,I=C.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,M,P,L;be($,r);var N=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function j(h,d,B){if(typeof h.prependListener=="function")return h.prependListener(d,B);!h._events||!h._events[d]?h.on(d,B):Array.isArray(h._events[d])?h._events[d].unshift(B):h._events[d]=[B,h._events[d]]}function U(h,d,B){e=e||lt(),h=h||{},typeof B!="boolean"&&(B=d instanceof e),this.objectMode=!!h.objectMode,B&&(this.objectMode=this.objectMode||!!h.readableObjectMode),this.highWaterMark=T(this,h,"readableHighWaterMark",B),this.buffer=new w,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=h.emitClose!==!1,this.autoDestroy=!!h.autoDestroy,this.destroyed=!1,this.defaultEncoding=h.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,h.encoding&&(M||(M=$t.StringDecoder),this.decoder=new M(h.encoding),this.encoding=h.encoding)}function $(h){if(e=e||lt(),!(this instanceof $))return new $(h);var d=this instanceof e;this._readableState=new U(h,this,d),this.readable=!0,h&&(typeof h.read=="function"&&(this._read=h.read),typeof h.destroy=="function"&&(this._destroy=h.destroy)),r.call(this)}Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(d){this._readableState&&(this._readableState.destroyed=d)}}),$.prototype.destroy=m.destroy,$.prototype._undestroy=m.undestroy,$.prototype._destroy=function(h,d){d(h)},$.prototype.push=function(h,d){var B=this._readableState,F;return B.objectMode?F=!0:typeof h=="string"&&(d=d||B.defaultEncoding,d!==B.encoding&&(h=a.from(h,d),d=""),F=!0),ne(this,h,d,!1,F)},$.prototype.unshift=function(h){return ne(this,h,null,!0,!1)};function ne(h,d,B,F,Q){p("readableAddChunk",d);var W=h._readableState;if(d===null)W.reading=!1,ze(h,W);else{var G;if(Q||(G=$e(W,d)),G)N(h,G);else if(W.objectMode||d&&d.length>0)if(typeof d!="string"&&!W.objectMode&&Object.getPrototypeOf(d)!==a.prototype&&(d=s(d)),F)W.endEmitted?N(h,new I):Te(h,W,d,!0);else if(W.ended)N(h,new k);else{if(W.destroyed)return!1;W.reading=!1,W.decoder&&!B?(d=W.decoder.write(d),W.objectMode||d.length!==0?Te(h,W,d,!1):ke(h,W)):Te(h,W,d,!1)}else F||(W.reading=!1,ke(h,W))}return!W.ended&&(W.length<W.highWaterMark||W.length===0)}function Te(h,d,B,F){d.flowing&&d.length===0&&!d.sync?(d.awaitDrain=0,h.emit("data",B)):(d.length+=d.objectMode?1:B.length,F?d.buffer.unshift(B):d.buffer.push(B),d.needReadable&&Ie(h)),ke(h,d)}function $e(h,d){var B;return!c(d)&&typeof d!="string"&&d!==void 0&&!h.objectMode&&(B=new R("chunk",["string","Buffer","Uint8Array"],d)),B}$.prototype.isPaused=function(){return this._readableState.flowing===!1},$.prototype.setEncoding=function(h){M||(M=$t.StringDecoder);var d=new M(h);this._readableState.decoder=d,this._readableState.encoding=this._readableState.decoder.encoding;for(var B=this._readableState.buffer.head,F="";B!==null;)F+=d.write(B.data),B=B.next;return this._readableState.buffer.clear(),F!==""&&this._readableState.buffer.push(F),this._readableState.length=F.length,this};var oe=1073741824;function me(h){return h>=oe?h=oe:(h--,h|=h>>>1,h|=h>>>2,h|=h>>>4,h|=h>>>8,h|=h>>>16,h++),h}function ve(h,d){return h<=0||d.length===0&&d.ended?0:d.objectMode?1:h!==h?d.flowing&&d.length?d.buffer.head.data.length:d.length:(h>d.highWaterMark&&(d.highWaterMark=me(h)),h<=d.length?h:d.ended?d.length:(d.needReadable=!0,0))}$.prototype.read=function(h){p("read",h),h=parseInt(h,10);var d=this._readableState,B=h;if(h!==0&&(d.emittedReadable=!1),h===0&&d.needReadable&&((d.highWaterMark!==0?d.length>=d.highWaterMark:d.length>0)||d.ended))return p("read: emitReadable",d.length,d.ended),d.length===0&&d.ended?S(this):Ie(this),null;if(h=ve(h,d),h===0&&d.ended)return d.length===0&&S(this),null;var F=d.needReadable;p("need readable",F),(d.length===0||d.length-h<d.highWaterMark)&&(F=!0,p("length less than watermark",F)),d.ended||d.reading?(F=!1,p("reading or ended",F)):F&&(p("do read"),d.reading=!0,d.sync=!0,d.length===0&&(d.needReadable=!0),this._read(d.highWaterMark),d.sync=!1,d.reading||(h=ve(B,d)));var Q;return h>0?Q=y(h,d):Q=null,Q===null?(d.needReadable=d.length<=d.highWaterMark,h=0):(d.length-=h,d.awaitDrain=0),d.length===0&&(d.ended||(d.needReadable=!0),B!==h&&d.ended&&S(this)),Q!==null&&this.emit("data",Q),Q};function ze(h,d){if(p("onEofChunk"),!d.ended){if(d.decoder){var B=d.decoder.end();B&&B.length&&(d.buffer.push(B),d.length+=d.objectMode?1:B.length)}d.ended=!0,d.sync?Ie(h):(d.needReadable=!1,d.emittedReadable||(d.emittedReadable=!0,He(h)))}}function Ie(h){var d=h._readableState;p("emitReadable",d.needReadable,d.emittedReadable),d.needReadable=!1,d.emittedReadable||(p("emitReadable",d.flowing),d.emittedReadable=!0,process.nextTick(He,h))}function He(h){var d=h._readableState;p("emitReadable_",d.destroyed,d.length,d.ended),!d.destroyed&&(d.length||d.ended)&&(h.emit("readable"),d.emittedReadable=!1),d.needReadable=!d.flowing&&!d.ended&&d.length<=d.highWaterMark,_(h)}function ke(h,d){d.readingMore||(d.readingMore=!0,process.nextTick(je,h,d))}function je(h,d){for(;!d.reading&&!d.ended&&(d.length<d.highWaterMark||d.flowing&&d.length===0);){var B=d.length;if(p("maybeReadMore read 0"),h.read(0),B===d.length)break}d.readingMore=!1}$.prototype._read=function(h){N(this,new A("_read()"))},$.prototype.pipe=function(h,d){var B=this,F=this._readableState;switch(F.pipesCount){case 0:F.pipes=h;break;case 1:F.pipes=[F.pipes,h];break;default:F.pipes.push(h);break}F.pipesCount+=1,p("pipe count=%d opts=%j",F.pipesCount,d);var Q=(!d||d.end!==!1)&&h!==process.stdout&&h!==process.stderr,W=Q?We:Ye;F.endEmitted?process.nextTick(W):B.once("end",W),h.on("unpipe",G);function G(f,n){p("onunpipe"),f===B&&n&&n.hasUnpiped===!1&&(n.hasUnpiped=!0,rt())}function We(){p("onend"),h.end()}var tt=X(B);h.on("drain",tt);var pt=!1;function rt(){p("cleanup"),h.removeListener("close",bt),h.removeListener("finish",Re),h.removeListener("drain",tt),h.removeListener("error",Je),h.removeListener("unpipe",G),B.removeListener("end",We),B.removeListener("end",Ye),B.removeListener("data",Be),pt=!0,F.awaitDrain&&(!h._writableState||h._writableState.needDrain)&&tt()}B.on("data",Be);function Be(f){p("ondata");var n=h.write(f);p("dest.write",n),n===!1&&((F.pipesCount===1&&F.pipes===h||F.pipesCount>1&&q(F.pipes,h)!==-1)&&!pt&&(p("false write response, pause",F.awaitDrain),F.awaitDrain++),B.pause())}function Je(f){p("onerror",f),Ye(),h.removeListener("error",Je),t(h,"error")===0&&N(h,f)}j(h,"error",Je);function bt(){h.removeListener("finish",Re),Ye()}h.once("close",bt);function Re(){p("onfinish"),h.removeListener("close",bt),Ye()}h.once("finish",Re);function Ye(){p("unpipe"),B.unpipe(h)}return h.emit("pipe",B),F.flowing||(p("pipe resume"),B.resume()),h};function X(h){return function(){var B=h._readableState;p("pipeOnDrain",B.awaitDrain),B.awaitDrain&&B.awaitDrain--,B.awaitDrain===0&&t(h,"data")&&(B.flowing=!0,_(h))}}$.prototype.unpipe=function(h){var d=this._readableState,B={hasUnpiped:!1};if(d.pipesCount===0)return this;if(d.pipesCount===1)return h&&h!==d.pipes?this:(h||(h=d.pipes),d.pipes=null,d.pipesCount=0,d.flowing=!1,h&&h.emit("unpipe",this,B),this);if(!h){var F=d.pipes,Q=d.pipesCount;d.pipes=null,d.pipesCount=0,d.flowing=!1;for(var W=0;W<Q;W++)F[W].emit("unpipe",this,{hasUnpiped:!1});return this}var G=q(d.pipes,h);return G===-1?this:(d.pipes.splice(G,1),d.pipesCount-=1,d.pipesCount===1&&(d.pipes=d.pipes[0]),h.emit("unpipe",this,B),this)},$.prototype.on=function(h,d){var B=r.prototype.on.call(this,h,d),F=this._readableState;return h==="data"?(F.readableListening=this.listenerCount("readable")>0,F.flowing!==!1&&this.resume()):h==="readable"&&!F.endEmitted&&!F.readableListening&&(F.readableListening=F.needReadable=!0,F.flowing=!1,F.emittedReadable=!1,p("on readable",F.length,F.reading),F.length?Ie(this):F.reading||process.nextTick(Ee,this)),B},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(h,d){var B=r.prototype.removeListener.call(this,h,d);return h==="readable"&&process.nextTick(ie,this),B},$.prototype.removeAllListeners=function(h){var d=r.prototype.removeAllListeners.apply(this,arguments);return(h==="readable"||h===void 0)&&process.nextTick(ie,this),d};function ie(h){var d=h._readableState;d.readableListening=h.listenerCount("readable")>0,d.resumeScheduled&&!d.paused?d.flowing=!0:h.listenerCount("data")>0&&h.resume()}function Ee(h){p("readable nexttick read 0"),h.read(0)}$.prototype.resume=function(){var h=this._readableState;return h.flowing||(p("resume"),h.flowing=!h.readableListening,qe(this,h)),h.paused=!1,this};function qe(h,d){d.resumeScheduled||(d.resumeScheduled=!0,process.nextTick(Me,h,d))}function Me(h,d){p("resume",d.reading),d.reading||h.read(0),d.resumeScheduled=!1,h.emit("resume"),_(h),d.flowing&&!d.reading&&h.read(0)}$.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _(h){var d=h._readableState;for(p("flow",d.flowing);d.flowing&&h.read()!==null;);}$.prototype.wrap=function(h){var d=this,B=this._readableState,F=!1;h.on("end",function(){if(p("wrapped end"),B.decoder&&!B.ended){var G=B.decoder.end();G&&G.length&&d.push(G)}d.push(null)}),h.on("data",function(G){if(p("wrapped data"),B.decoder&&(G=B.decoder.write(G)),!(B.objectMode&&G==null)&&!(!B.objectMode&&(!G||!G.length))){var We=d.push(G);We||(F=!0,h.pause())}});for(var Q in h)this[Q]===void 0&&typeof h[Q]=="function"&&(this[Q]=function(We){return function(){return h[We].apply(h,arguments)}}(Q));for(var W=0;W<E.length;W++)h.on(E[W],this.emit.bind(this,E[W]));return this._read=function(G){p("wrapped _read",G),F&&(F=!1,h.resume())},this},typeof Symbol=="function"&&($.prototype[Symbol.asyncIterator]=function(){return P===void 0&&(P=Ua()),P(this)}),Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty($.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty($.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(d){this._readableState&&(this._readableState.flowing=d)}}),$._fromList=y,Object.defineProperty($.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function y(h,d){if(d.length===0)return null;var B;return d.objectMode?B=d.buffer.shift():!h||h>=d.length?(d.decoder?B=d.buffer.join(""):d.buffer.length===1?B=d.buffer.first():B=d.buffer.concat(d.length),d.buffer.clear()):B=d.buffer.consume(h,d.decoder),B}function S(h){var d=h._readableState;p("endReadable",d.endEmitted),d.endEmitted||(d.ended=!0,process.nextTick(D,d,h))}function D(h,d){if(p("endReadableNT",h.endEmitted,h.length),!h.endEmitted&&h.length===0&&(h.endEmitted=!0,d.readable=!1,d.emit("end"),h.autoDestroy)){var B=d._writableState;(!B||B.autoDestroy&&B.finished)&&d.destroy()}}typeof Symbol=="function"&&($.from=function(h,d){return L===void 0&&(L=Da()),L($,h,d)});function q(h,d){for(var B=0,F=h.length;B<F;B++)if(h[B]===d)return B;return-1}return dr}var Gn=De,Gt=Ze.codes,$a=Gt.ERR_METHOD_NOT_IMPLEMENTED,Ha=Gt.ERR_MULTIPLE_CALLBACK,ja=Gt.ERR_TRANSFORM_ALREADY_TRANSFORMING,qa=Gt.ERR_TRANSFORM_WITH_LENGTH_0,Vt=lt();be(De,Vt);function Wa(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(a===null)return this.emit("error",new Ha);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),a(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function De(e){if(!(this instanceof De))return new De(e);Vt.call(this,e),this._transformState={afterTransform:Wa.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Ka)}function Ka(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){rn(e,t,r)}):rn(this,null,null)}De.prototype.push=function(e,t){return this._transformState.needTransform=!1,Vt.prototype.push.call(this,e,t)};De.prototype._transform=function(e,t,r){r(new $a("_transform()"))};De.prototype._write=function(e,t,r){var a=this._transformState;if(a.writecb=r,a.writechunk=e,a.writeencoding=t,!a.transforming){var o=this._readableState;(a.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};De.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};De.prototype._destroy=function(e,t){Vt.prototype._destroy.call(this,e,function(r){t(r)})};function rn(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new qa;if(e._transformState.transforming)throw new ja;return e.push(null)}var Ga=Rt,Vn=Gn;be(Rt,Vn);function Rt(e){if(!(this instanceof Rt))return new Rt(e);Vn.call(this,e)}Rt.prototype._transform=function(e,t,r){r(null,e)};var pr;function Va(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var zn=Ze.codes,za=zn.ERR_MISSING_ARGS,Ja=zn.ERR_STREAM_DESTROYED;function nn(e){if(e)throw e}function Ya(e){return e.setHeader&&typeof e.abort=="function"}function Xa(e,t,r,a){a=Va(a);var o=!1;e.on("close",function(){o=!0}),pr===void 0&&(pr=Fr),pr(e,{readable:t,writable:r},function(c){if(c)return a(c);o=!0,a()});var s=!1;return function(c){if(!o&&!s){if(s=!0,Ya(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();a(c||new Ja("pipe"))}}}function an(e){e()}function Qa(e,t){return e.pipe(t)}function Za(e){return!e.length||typeof e[e.length-1]!="function"?nn:e.pop()}function eo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=Za(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new za("streams");var o,s=t.map(function(c,u){var p=u<t.length-1,w=u>0;return Xa(c,p,w,function(m){o||(o=m),m&&s.forEach(an),!p&&(s.forEach(an),a(o))})});return t.reduce(Qa)}var to=eo;(function(e,t){t=e.exports=Kn(),t.Stream=t,t.Readable=t,t.Writable=qn(),t.Duplex=lt(),t.Transform=Gn,t.PassThrough=Ga,t.finished=Fr,t.pipeline=to})(Er,Er.exports);var ro=Er.exports,Ht=xe.Buffer,Jn=ro.Transform,no=be;function io(e,t){if(!Ht.isBuffer(e)&&typeof e!="string")throw new TypeError(t+" must be a string or a buffer")}function Ve(e){Jn.call(this),this._block=Ht.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}no(Ve,Jn);Ve.prototype._transform=function(e,t,r){var a=null;try{this.update(e,t)}catch(o){a=o}r(a)};Ve.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};Ve.prototype.update=function(e,t){if(io(e,"Data"),this._finalized)throw new Error("Digest already called");Ht.isBuffer(e)||(e=Ht.from(e,t));for(var r=this._block,a=0;this._blockOffset+e.length-a>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[a++];this._update(),this._blockOffset=0}for(;a<e.length;)r[this._blockOffset++]=e[a++];for(var s=0,c=e.length*8;c>0;++s)this._length[s]+=c,c=this._length[s]/4294967296|0,c>0&&(this._length[s]-=4294967296*c);return this};Ve.prototype._update=function(){throw new Error("_update is not implemented")};Ve.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};Ve.prototype._digest=function(){throw new Error("_digest is not implemented")};var Yn=Ve,ao=be,Xn=Yn,oo=xe.Buffer,so=new Array(16);function zt(){Xn.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}ao(zt,Xn);zt.prototype._update=function(){for(var e=so,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,a=this._b,o=this._c,s=this._d;r=ue(r,a,o,s,e[0],3614090360,7),s=ue(s,r,a,o,e[1],3905402710,12),o=ue(o,s,r,a,e[2],606105819,17),a=ue(a,o,s,r,e[3],3250441966,22),r=ue(r,a,o,s,e[4],4118548399,7),s=ue(s,r,a,o,e[5],1200080426,12),o=ue(o,s,r,a,e[6],2821735955,17),a=ue(a,o,s,r,e[7],4249261313,22),r=ue(r,a,o,s,e[8],1770035416,7),s=ue(s,r,a,o,e[9],2336552879,12),o=ue(o,s,r,a,e[10],4294925233,17),a=ue(a,o,s,r,e[11],2304563134,22),r=ue(r,a,o,s,e[12],1804603682,7),s=ue(s,r,a,o,e[13],4254626195,12),o=ue(o,s,r,a,e[14],2792965006,17),a=ue(a,o,s,r,e[15],1236535329,22),r=ce(r,a,o,s,e[1],4129170786,5),s=ce(s,r,a,o,e[6],3225465664,9),o=ce(o,s,r,a,e[11],643717713,14),a=ce(a,o,s,r,e[0],3921069994,20),r=ce(r,a,o,s,e[5],3593408605,5),s=ce(s,r,a,o,e[10],38016083,9),o=ce(o,s,r,a,e[15],3634488961,14),a=ce(a,o,s,r,e[4],3889429448,20),r=ce(r,a,o,s,e[9],568446438,5),s=ce(s,r,a,o,e[14],3275163606,9),o=ce(o,s,r,a,e[3],4107603335,14),a=ce(a,o,s,r,e[8],1163531501,20),r=ce(r,a,o,s,e[13],2850285829,5),s=ce(s,r,a,o,e[2],4243563512,9),o=ce(o,s,r,a,e[7],1735328473,14),a=ce(a,o,s,r,e[12],2368359562,20),r=le(r,a,o,s,e[5],4294588738,4),s=le(s,r,a,o,e[8],2272392833,11),o=le(o,s,r,a,e[11],1839030562,16),a=le(a,o,s,r,e[14],4259657740,23),r=le(r,a,o,s,e[1],2763975236,4),s=le(s,r,a,o,e[4],1272893353,11),o=le(o,s,r,a,e[7],4139469664,16),a=le(a,o,s,r,e[10],3200236656,23),r=le(r,a,o,s,e[13],681279174,4),s=le(s,r,a,o,e[0],3936430074,11),o=le(o,s,r,a,e[3],3572445317,16),a=le(a,o,s,r,e[6],76029189,23),r=le(r,a,o,s,e[9],3654602809,4),s=le(s,r,a,o,e[12],3873151461,11),o=le(o,s,r,a,e[15],530742520,16),a=le(a,o,s,r,e[2],3299628645,23),r=he(r,a,o,s,e[0],4096336452,6),s=he(s,r,a,o,e[7],1126891415,10),o=he(o,s,r,a,e[14],2878612391,15),a=he(a,o,s,r,e[5],4237533241,21),r=he(r,a,o,s,e[12],1700485571,6),s=he(s,r,a,o,e[3],2399980690,10),o=he(o,s,r,a,e[10],4293915773,15),a=he(a,o,s,r,e[1],2240044497,21),r=he(r,a,o,s,e[8],1873313359,6),s=he(s,r,a,o,e[15],4264355552,10),o=he(o,s,r,a,e[6],2734768916,15),a=he(a,o,s,r,e[13],1309151649,21),r=he(r,a,o,s,e[4],4149444226,6),s=he(s,r,a,o,e[11],3174756917,10),o=he(o,s,r,a,e[2],718787259,15),a=he(a,o,s,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+a|0,this._c=this._c+o|0,this._d=this._d+s|0};zt.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 e=oo.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function Jt(e,t){return e<<t|e>>>32-t}function ue(e,t,r,a,o,s,c){return Jt(e+(t&r|~t&a)+o+s|0,c)+t|0}function ce(e,t,r,a,o,s,c){return Jt(e+(t&a|r&~a)+o+s|0,c)+t|0}function le(e,t,r,a,o,s,c){return Jt(e+(t^r^a)+o+s|0,c)+t|0}function he(e,t,r,a,o,s,c){return Jt(e+(r^(t|~a))+o+s|0,c)+t|0}var fo=zt,br=ht.Buffer,uo=be,Qn=Yn,co=new Array(16),gt=[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],wt=[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],mt=[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],vt=[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],xt=[0,1518500249,1859775393,2400959708,2840853838],Et=[1352829926,1548603684,1836072691,2053994217,0];function Yt(){Qn.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}uo(Yt,Qn);Yt.prototype._update=function(){for(var e=co,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=this._a|0,p=this._b|0,w=this._c|0,m=this._d|0,v=this._e|0,T=0;T<80;T+=1){var C,R;T<16?(C=on(r,a,o,s,c,e[gt[T]],xt[0],mt[T]),R=cn(u,p,w,m,v,e[wt[T]],Et[0],vt[T])):T<32?(C=sn(r,a,o,s,c,e[gt[T]],xt[1],mt[T]),R=un(u,p,w,m,v,e[wt[T]],Et[1],vt[T])):T<48?(C=fn(r,a,o,s,c,e[gt[T]],xt[2],mt[T]),R=fn(u,p,w,m,v,e[wt[T]],Et[2],vt[T])):T<64?(C=un(r,a,o,s,c,e[gt[T]],xt[3],mt[T]),R=sn(u,p,w,m,v,e[wt[T]],Et[3],vt[T])):(C=cn(r,a,o,s,c,e[gt[T]],xt[4],mt[T]),R=on(u,p,w,m,v,e[wt[T]],Et[4],vt[T])),r=c,c=s,s=Qe(o,10),o=a,a=C,u=v,v=m,m=Qe(w,10),w=p,p=R}var k=this._b+o+m|0;this._b=this._c+s+v|0,this._c=this._d+c+u|0,this._d=this._e+r+p|0,this._e=this._a+a+w|0,this._a=k};Yt.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 e=br.alloc?br.alloc(20):new br(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};function Qe(e,t){return e<<t|e>>>32-t}function on(e,t,r,a,o,s,c,u){return Qe(e+(t^r^a)+s+c|0,u)+o|0}function sn(e,t,r,a,o,s,c,u){return Qe(e+(t&r|~t&a)+s+c|0,u)+o|0}function fn(e,t,r,a,o,s,c,u){return Qe(e+((t|~r)^a)+s+c|0,u)+o|0}function un(e,t,r,a,o,s,c,u){return Qe(e+(t&a|r&~a)+s+c|0,u)+o|0}function cn(e,t,r,a,o,s,c,u){return Qe(e+(t^(r|~a))+s+c|0,u)+o|0}var lo=Yt,Zn={exports:{}},ei=xe.Buffer;function Xt(e,t){this._block=ei.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Xt.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=ei.from(e,t));for(var r=this._block,a=this._blockSize,o=e.length,s=this._len,c=0;c<o;){for(var u=s%a,p=Math.min(o-c,a-u),w=0;w<p;w++)r[u+w]=e[c+w];s+=p,c+=p,s%a===0&&this._update(r)}return this._len+=o,this};Xt.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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 a=(r&4294967295)>>>0,o=(r-a)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(a,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};Xt.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var dt=Xt,ho=be,ti=dt,po=xe.Buffer,bo=[1518500249,1859775393,-1894007588,-899497514],yo=new Array(80);function Tt(){this.init(),this._w=yo,ti.call(this,64,56)}ho(Tt,ti);Tt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function _o(e){return e<<5|e>>>27}function go(e){return e<<30|e>>>2}function wo(e,t,r,a){return e===0?t&r|~t&a:e===2?t&r|t&a|r&a:t^r^a}Tt.prototype._update=function(e){for(var t=this._w,r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var p=0;p<80;++p){var w=~~(p/20),m=_o(r)+wo(w,a,o,s)+c+t[p]+bo[w]|0;c=s,s=o,o=go(a),a=r,r=m}this._a=r+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};Tt.prototype._hash=function(){var e=po.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var mo=Tt,vo=be,ri=dt,xo=xe.Buffer,Eo=[1518500249,1859775393,-1894007588,-899497514],Bo=new Array(80);function It(){this.init(),this._w=Bo,ri.call(this,64,56)}vo(It,ri);It.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Ro(e){return e<<1|e>>>31}function So(e){return e<<5|e>>>27}function Ao(e){return e<<30|e>>>2}function To(e,t,r,a){return e===0?t&r|~t&a:e===2?t&r|t&a|r&a:t^r^a}It.prototype._update=function(e){for(var t=this._w,r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=Ro(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var p=0;p<80;++p){var w=~~(p/20),m=So(r)+To(w,a,o,s)+c+t[p]+Eo[w]|0;c=s,s=o,o=Ao(a),a=r,r=m}this._a=r+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};It.prototype._hash=function(){var e=xo.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Io=It,ko=be,ni=dt,Co=xe.Buffer,Oo=[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],Lo=new Array(64);function kt(){this.init(),this._w=Lo,ni.call(this,64,56)}ko(kt,ni);kt.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 Mo(e,t,r){return r^e&(t^r)}function Po(e,t,r){return e&t|r&(e|t)}function Fo(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function No(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Uo(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Do(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}kt.prototype._update=function(e){for(var t=this._w,r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=this._f|0,p=this._g|0,w=this._h|0,m=0;m<16;++m)t[m]=e.readInt32BE(m*4);for(;m<64;++m)t[m]=Do(t[m-2])+t[m-7]+Uo(t[m-15])+t[m-16]|0;for(var v=0;v<64;++v){var T=w+No(c)+Mo(c,u,p)+Oo[v]+t[v]|0,C=Fo(r)+Po(r,a,o)|0;w=p,p=u,u=c,c=s+T|0,s=o,o=a,a=r,r=T+C|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=u+this._f|0,this._g=p+this._g|0,this._h=w+this._h|0};kt.prototype._hash=function(){var e=Co.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var ii=kt,$o=be,Ho=ii,jo=dt,qo=xe.Buffer,Wo=new Array(64);function Qt(){this.init(),this._w=Wo,jo.call(this,64,56)}$o(Qt,Ho);Qt.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};Qt.prototype._hash=function(){var e=qo.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Ko=Qt,Go=be,ai=dt,Vo=xe.Buffer,ln=[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],zo=new Array(160);function Ct(){this.init(),this._w=zo,ai.call(this,128,112)}Go(Ct,ai);Ct.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 hn(e,t,r){return r^e&(t^r)}function dn(e,t,r){return e&t|r&(e|t)}function pn(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function bn(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Jo(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Yo(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Xo(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Qo(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function se(e,t){return e>>>0<t>>>0?1:0}Ct.prototype._update=function(e){for(var t=this._w,r=this._ah|0,a=this._bh|0,o=this._ch|0,s=this._dh|0,c=this._eh|0,u=this._fh|0,p=this._gh|0,w=this._hh|0,m=this._al|0,v=this._bl|0,T=this._cl|0,C=this._dl|0,R=this._el|0,k=this._fl|0,A=this._gl|0,I=this._hl|0,M=0;M<32;M+=2)t[M]=e.readInt32BE(M*4),t[M+1]=e.readInt32BE(M*4+4);for(;M<160;M+=2){var P=t[M-30],L=t[M-15*2+1],N=Jo(P,L),E=Yo(L,P);P=t[M-2*2],L=t[M-2*2+1];var j=Xo(P,L),U=Qo(L,P),$=t[M-7*2],ne=t[M-7*2+1],Te=t[M-16*2],$e=t[M-16*2+1],oe=E+ne|0,me=N+$+se(oe,E)|0;oe=oe+U|0,me=me+j+se(oe,U)|0,oe=oe+$e|0,me=me+Te+se(oe,$e)|0,t[M]=me,t[M+1]=oe}for(var ve=0;ve<160;ve+=2){me=t[ve],oe=t[ve+1];var ze=dn(r,a,o),Ie=dn(m,v,T),He=pn(r,m),ke=pn(m,r),je=bn(c,R),X=bn(R,c),ie=ln[ve],Ee=ln[ve+1],qe=hn(c,u,p),Me=hn(R,k,A),_=I+X|0,y=w+je+se(_,I)|0;_=_+Me|0,y=y+qe+se(_,Me)|0,_=_+Ee|0,y=y+ie+se(_,Ee)|0,_=_+oe|0,y=y+me+se(_,oe)|0;var S=ke+Ie|0,D=He+ze+se(S,ke)|0;w=p,I=A,p=u,A=k,u=c,k=R,R=C+_|0,c=s+y+se(R,C)|0,s=o,C=T,o=a,T=v,a=r,v=m,m=_+S|0,r=y+D+se(m,_)|0}this._al=this._al+m|0,this._bl=this._bl+v|0,this._cl=this._cl+T|0,this._dl=this._dl+C|0,this._el=this._el+R|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+I|0,this._ah=this._ah+r+se(this._al,m)|0,this._bh=this._bh+a+se(this._bl,v)|0,this._ch=this._ch+o+se(this._cl,T)|0,this._dh=this._dh+s+se(this._dl,C)|0,this._eh=this._eh+c+se(this._el,R)|0,this._fh=this._fh+u+se(this._fl,k)|0,this._gh=this._gh+p+se(this._gl,A)|0,this._hh=this._hh+w+se(this._hl,I)|0};Ct.prototype._hash=function(){var e=Vo.allocUnsafe(64);function t(r,a,o){e.writeInt32BE(r,o),e.writeInt32BE(a,o+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var oi=Ct,Zo=be,es=oi,ts=dt,rs=xe.Buffer,ns=new Array(160);function Zt(){this.init(),this._w=ns,ts.call(this,128,112)}Zo(Zt,es);Zt.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};Zt.prototype._hash=function(){var e=rs.allocUnsafe(48);function t(r,a,o){e.writeInt32BE(r,o),e.writeInt32BE(a,o+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var is=Zt,et=Zn.exports=function(t){t=t.toLowerCase();var r=et[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};et.sha=mo;et.sha1=Io;et.sha224=Ko;et.sha256=ii;et.sha384=is;et.sha512=oi;var as=Zn.exports,si=xe.Buffer,fi=Mr.Transform,os=$t.StringDecoder,ss=be;function Ce(e){fi.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}ss(Ce,fi);Ce.prototype.update=function(e,t,r){typeof e=="string"&&(e=si.from(e,t));var a=this._update(e);return this.hashMode?this:(r&&(a=this._toString(a,r)),a)};Ce.prototype.setAutoPadding=function(){};Ce.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};Ce.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};Ce.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};Ce.prototype._transform=function(e,t,r){var a;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(o){a=o}finally{r(a)}};Ce.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};Ce.prototype._finalOrDigest=function(e){var t=this.__final()||si.alloc(0);return e&&(t=this._toString(t,e,!0)),t};Ce.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new os(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var a=this._decoder.write(e);return r&&(a+=this._decoder.end()),a};var fs=Ce,us=be,cs=fo,ls=lo,hs=as,ui=fs;function er(e){ui.call(this,"digest"),this._hash=e}us(er,ui);er.prototype._update=function(e){this._hash.update(e)};er.prototype._final=function(){return this._hash.digest()};var ds=function(t){return t=t.toLowerCase(),t==="md5"?new cs:t==="rmd160"||t==="ripemd160"?new ls:new er(hs(t))},Lt=xe.Buffer;function ps(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var a=0;a<e.length;a++){var o=e.charAt(a),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=a}var c=e.length,u=e.charAt(0),p=Math.log(c)/Math.log(256),w=Math.log(256)/Math.log(c);function m(C){if((Array.isArray(C)||C instanceof Uint8Array)&&(C=Lt.from(C)),!Lt.isBuffer(C))throw new TypeError("Expected Buffer");if(C.length===0)return"";for(var R=0,k=0,A=0,I=C.length;A!==I&&C[A]===0;)A++,R++;for(var M=(I-A)*w+1>>>0,P=new Uint8Array(M);A!==I;){for(var L=C[A],N=0,E=M-1;(L!==0||N<k)&&E!==-1;E--,N++)L+=256*P[E]>>>0,P[E]=L%c>>>0,L=L/c>>>0;if(L!==0)throw new Error("Non-zero carry");k=N,A++}for(var j=M-k;j!==M&&P[j]===0;)j++;for(var U=u.repeat(R);j<M;++j)U+=e.charAt(P[j]);return U}function v(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return Lt.alloc(0);for(var R=0,k=0,A=0;C[R]===u;)k++,R++;for(var I=(C.length-R)*p+1>>>0,M=new Uint8Array(I);R<C.length;){var P=t[C.charCodeAt(R)];if(P===255)return;for(var L=0,N=I-1;(P!==0||L<A)&&N!==-1;N--,L++)P+=c*M[N]>>>0,M[N]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");A=L,R++}for(var E=I-A;E!==I&&M[E]===0;)E++;var j=Lt.allocUnsafe(k+(I-E));j.fill(0,0,k);for(var U=k;E!==I;)j[U++]=M[E++];return j}function T(C){var R=v(C);if(R)return R;throw new Error("Non-base"+c+" character")}return{encode:m,decodeUnsafe:v,decode:T}}var bs=ps,ys=bs,_s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",gs=ys(_s),yr=gs,ws=xe.Buffer,ms=function(e){function t(s){var c=e(s);return yr.encode(ws.concat([s,c],s.length+4))}function r(s){var c=s.slice(0,-4),u=s.slice(-4),p=e(c);if(!(u[0]^p[0]|u[1]^p[1]|u[2]^p[2]|u[3]^p[3]))return c}function a(s){var c=yr.decodeUnsafe(s);if(c)return r(c)}function o(s){var c=yr.decode(s),u=r(c);if(!u)throw new Error("Invalid checksum");return u}return{encode:t,decode:o,decodeUnsafe:a}},yn=ds,vs=ms;function xs(e){var t=yn("sha256").update(e).digest();return yn("sha256").update(t).digest()}var Es=vs(xs),Rr=Es;function ci(e,t){if(t!==void 0&&e[0]!==t)throw new Error("Invalid network version");if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw new Error("Invalid WIF length");if(e[33]!==1)throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function Sr(e,t,r){var a=new Buffer(r?34:33);return a.writeUInt8(e,0),t.copy(a,1),r&&(a[33]=1),a}function Bs(e,t){return ci(Rr.decode(e),t)}function Rs(e,t,r){return typeof e=="number"?Rr.encode(Sr(e,t,r)):Rr.encode(Sr(e.version,e.privateKey,e.compressed))}var Ss={decode:Bs,decodeRaw:ci,encode:Rs,encodeRaw:Sr},tr={};Object.defineProperty(tr,"__esModule",{value:!0});tr.testEcc=void 0;const H=e=>Buffer.from(e,"hex");function As(e){Y(e.isPoint(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(!e.isPoint(H("030000000000000000000000000000000000000000000000000000000000000005"))),Y(e.isPrivate(H("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(e.isPrivate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),Y(!e.isPrivate(H("0000000000000000000000000000000000000000000000000000000000000000"))),Y(!e.isPrivate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),Y(!e.isPrivate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),Y(Buffer.from(e.privateAdd(H("0000000000000000000000000000000000000000000000000000000000000001"),H("0000000000000000000000000000000000000000000000000000000000000000"))).equals(H("0000000000000000000000000000000000000000000000000000000000000001"))),Y(e.privateAdd(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),H("0000000000000000000000000000000000000000000000000000000000000003"))===null),Y(Buffer.from(e.privateAdd(H("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),H("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665"))).equals(H("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24"))),Y(Buffer.from(e.privateNegate(H("0000000000000000000000000000000000000000000000000000000000000001"))).equals(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),Y(Buffer.from(e.privateNegate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(H("0000000000000000000000000000000000000000000000000000000000000003"))),Y(Buffer.from(e.privateNegate(H("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(H("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792"))),Y(Buffer.from(e.pointCompress(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!0)).equals(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(Buffer.from(e.pointCompress(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!1)).equals(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),Y(Buffer.from(e.pointCompress(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!0)).equals(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(Buffer.from(e.pointCompress(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!1)).equals(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),Y(Buffer.from(e.pointFromScalar(H("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(H("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),Y(e.xOnlyPointAddTweak(H("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))===null);let t=e.xOnlyPointAddTweak(H("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),H("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));Y(Buffer.from(t.xOnlyPubkey).equals(H("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&t.parity===1),t=e.xOnlyPointAddTweak(H("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),H("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")),Y(Buffer.from(t.xOnlyPubkey).equals(H("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"))&&t.parity===0),Y(Buffer.from(e.sign(H("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(H("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),Y(e.verify(H("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),H("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),H("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),e.signSchnorr&&Y(Buffer.from(e.signSchnorr(H("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),H("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),H("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(H("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),e.verifySchnorr&&Y(e.verifySchnorr(H("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),H("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),H("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}tr.testEcc=As;function Y(e){if(!e)throw new Error("ecc library invalid")}Object.defineProperty(ut,"__esModule",{value:!0});ut.ECPairFactory=ut.networks=void 0;const Ar=ct;ut.networks=Ar;const _e=En,Ts=ea,_n=Ss,Is=tr,_r=_e.typeforce.maybe(_e.typeforce.compile({compressed:_e.maybe(_e.Boolean),network:_e.maybe(_e.Network)})),ks=e=>e.length===32?e:e.slice(1,33);function Cs(e){(0,Is.testEcc)(e);function t(u){return e.isPoint(u)}function r(u,p){if(_e.typeforce(_e.Buffer256bit,u),!e.isPrivate(u))throw new TypeError("Private key not in range [1, n)");return _e.typeforce(_r,p),new c(u,void 0,p)}function a(u,p){return _e.typeforce(e.isPoint,u),_e.typeforce(_r,p),new c(void 0,u,p)}function o(u,p){const w=_n.decode(u),m=w.version;if(_e.Array(p)){if(p=p.filter(v=>m===v.wif).pop(),!p)throw new Error("Unknown network version")}else if(p=p||Ar.bitcoin,m!==p.wif)throw new Error("Invalid network version");return r(w.privateKey,{compressed:w.compressed,network:p})}function s(u){_e.typeforce(_r,u),u===void 0&&(u={});const p=u.rng||Ts;let w;do w=p(32),_e.typeforce(_e.Buffer256bit,w);while(!e.isPrivate(w));return r(w,u)}class c{constructor(p,w,m){nt(this,"__D");nt(this,"__Q");nt(this,"compressed");nt(this,"network");nt(this,"lowR");this.__D=p,this.__Q=w,this.lowR=!1,m===void 0&&(m={}),this.compressed=m.compressed===void 0?!0:m.compressed,this.network=m.network||Ar.bitcoin,w!==void 0&&(this.__Q=Buffer.from(e.pointCompress(w,this.compressed)))}get privateKey(){return this.__D}get publicKey(){if(!this.__Q){const p=e.pointFromScalar(this.__D,this.compressed);this.__Q=Buffer.from(p)}return this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return _n.encode(this.network.wif,this.__D,this.compressed)}tweak(p){return this.privateKey?this.tweakFromPrivateKey(p):this.tweakFromPublicKey(p)}sign(p,w){if(!this.__D)throw new Error("Missing private key");if(w===void 0&&(w=this.lowR),w===!1)return Buffer.from(e.sign(p,this.__D));{let m=e.sign(p,this.__D);const v=Buffer.alloc(32,0);let T=0;for(;m[0]>127;)T++,v.writeUIntLE(T,0,6),m=e.sign(p,this.__D,v);return Buffer.from(m)}}signSchnorr(p){if(!this.privateKey)throw new Error("Missing private key");if(!e.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return Buffer.from(e.signSchnorr(p,this.privateKey))}verify(p,w){return e.verify(p,this.publicKey,w)}verifySchnorr(p,w){if(!e.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return e.verifySchnorr(p,this.publicKey.subarray(1,33),w)}tweakFromPublicKey(p){const w=ks(this.publicKey),m=e.xOnlyPointAddTweak(w,p);if(!m||m.xOnlyPubkey===null)throw new Error("Cannot tweak public key!");const v=Buffer.from([m.parity===0?2:3]);return a(Buffer.concat([v,m.xOnlyPubkey]),{network:this.network,compressed:this.compressed})}tweakFromPrivateKey(p){const m=this.publicKey[0]===3||this.publicKey[0]===4&&(this.publicKey[64]&1)===1?e.privateNegate(this.privateKey):this.privateKey,v=e.privateAdd(m,p);if(!v)throw new Error("Invalid tweaked private key!");return r(Buffer.from(v),{network:this.network,compressed:this.compressed})}}return{isPoint:t,fromPrivateKey:r,fromPublicKey:a,fromWIF:o,makeRandom:s}}ut.ECPairFactory=Cs;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.networks=e.ECPairFactory=e.default=void 0;var t=ut;Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.ECPairFactory}}),Object.defineProperty(e,"ECPairFactory",{enumerable:!0,get:function(){return t.ECPairFactory}}),Object.defineProperty(e,"networks",{enumerable:!0,get:function(){return t.networks}})})(xn);class jt{constructor(t){this.privKey=t}static fromPrivKey(t){return new jt(O.trim0x(t))}static async fromWalletClient(t){if(!t.account)return O.Err("No account found");try{const r=await t.signTypedData({account:t.account,types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"}],Data:[{name:"Message",type:"string"},{name:"Version",type:"string"},{name:"Nonce",type:"uint256"}]},domain:{name:"WBTC GARDEN",version:"1"},primaryType:"Data",message:{Message:"Initialize your swap",Version:"1.0.1",Nonce:1n}});return O.Ok(new jt(O.trim0x(Ne.sha256(r))))}catch(r){return O.Err("Failed to initialize: "+r)}}getMasterPrivKey(){return this.privKey}generateSecret(t){const r=this.signMessage(t),a=Ne.sha256(ge.with0x(r)),o=Ne.sha256(a);return O.Ok({secret:a,secretHash:o})}signMessage(t){const r=xn.ECPairFactory(ft),a="Garden.fi"+t.toString(),o=Buffer.from(a,"utf8"),s=Ne.sha256(o),c=Buffer.from(O.trim0x(this.privKey),"hex");if(c.length!==32)throw new Error("Invalid private key length. Expected 32 bytes.");return r.fromPrivateKey(c).sign(Buffer.from(O.trim0x(s),"hex")).toString("hex")}}class Os{constructor(t){this.quoteUrl=new ge.Url("/quote",t)}async getQuote(t,r,a=!1){try{const o=this.quoteUrl.addSearchParams({order_pair:t,amount:r.toString(),exact_out:a.toString()}),s=await O.Fetcher.get(o);return s.error?O.Err(s.error):s.result?O.Ok(s.result):O.Err("GetQuote: Unexpected error, result is undefined")}catch(o){return O.Err("GetQuote:",String(o))}}async getAttestedQuote(t){try{const r=await O.Fetcher.post(this.quoteUrl.endpoint("/attested").toString(),{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}});return r.error?O.Err(r.error):r.result?O.Ok(r.result):O.Err("GetAttestedQuote: Unexpected error, result is undefined")}catch(r){return console.log("error :",r),O.Err("GetAttestedQuote:",String(r))}}}exports.EvmRelay=vn;exports.Garden=Li;exports.ParseOrderStatus=wn;exports.ParseSwapStatus=Ft;exports.Quote=Os;exports.SecretManager=jt;exports.parseAction=mn;exports.switchOrAddNetwork=Bi;
|
|
28
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var Qi=xe.Buffer,Dt=Ge.crypto||Ge.msCrypto;Dt&&Dt.getRandomValues?mr.exports=Zi:mr.exports=Xi;function Zi(e,t){if(e>Yi)throw new RangeError("requested too many random bytes");var r=Qi.allocUnsafe(e);if(e>0)if(e>ar)for(var a=0;a<e;a+=ar)Dt.getRandomValues(r.slice(a,a+ar));else Dt.getRandomValues(r);return typeof t=="function"?process.nextTick(function(){t(null,r)}):r}var ea=mr.exports,xr={exports:{}};typeof Object.create=="function"?xr.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:xr.exports=function(t,r){if(r){t.super_=r;var a=function(){};a.prototype=r.prototype,t.prototype=new a,t.prototype.constructor=t}};var be=xr.exports,Er={exports:{}},Lr={exports:{}},st=typeof Reflect=="object"?Reflect:null,Wr=st&&typeof st.apply=="function"?st.apply:function(t,r,a){return Function.prototype.apply.call(t,r,a)},Mt;st&&typeof st.ownKeys=="function"?Mt=st.ownKeys:Object.getOwnPropertySymbols?Mt=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Mt=function(t){return Object.getOwnPropertyNames(t)};function ta(e){console&&console.warn&&console.warn(e)}var kn=Number.isNaN||function(t){return t!==t};function V(){V.init.call(this)}Lr.exports=V;Lr.exports.once=aa;V.EventEmitter=V;V.prototype._events=void 0;V.prototype._eventsCount=0;V.prototype._maxListeners=void 0;var Kr=10;function Kt(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(V,"defaultMaxListeners",{enumerable:!0,get:function(){return Kr},set:function(e){if(typeof e!="number"||e<0||kn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Kr=e}});V.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};V.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||kn(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Cn(e){return e._maxListeners===void 0?V.defaultMaxListeners:e._maxListeners}V.prototype.getMaxListeners=function(){return Cn(this)};V.prototype.emit=function(t){for(var r=[],a=1;a<arguments.length;a++)r.push(arguments[a]);var o=t==="error",s=this._events;if(s!==void 0)o=o&&s.error===void 0;else if(!o)return!1;if(o){var c;if(r.length>0&&(c=r[0]),c instanceof Error)throw c;var u=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw u.context=c,u}var p=s[t];if(p===void 0)return!1;if(typeof p=="function")Wr(p,this,r);else for(var w=p.length,m=Fn(p,w),a=0;a<w;++a)Wr(m[a],this,r);return!0};function On(e,t,r,a){var o,s,c;if(Kt(r),s=e._events,s===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),c=s[t]),c===void 0)c=s[t]=r,++e._eventsCount;else if(typeof c=="function"?c=s[t]=a?[r,c]:[c,r]:a?c.unshift(r):c.push(r),o=Cn(e),o>0&&c.length>o&&!c.warned){c.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=c.length,ta(u)}return e}V.prototype.addListener=function(t,r){return On(this,t,r,!1)};V.prototype.on=V.prototype.addListener;V.prototype.prependListener=function(t,r){return On(this,t,r,!0)};function ra(){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 Ln(e,t,r){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=ra.bind(a);return o.listener=r,a.wrapFn=o,o}V.prototype.once=function(t,r){return Kt(r),this.on(t,Ln(this,t,r)),this};V.prototype.prependOnceListener=function(t,r){return Kt(r),this.prependListener(t,Ln(this,t,r)),this};V.prototype.removeListener=function(t,r){var a,o,s,c,u;if(Kt(r),o=this._events,o===void 0)return this;if(a=o[t],a===void 0)return this;if(a===r||a.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,a.listener||r));else if(typeof a!="function"){for(s=-1,c=a.length-1;c>=0;c--)if(a[c]===r||a[c].listener===r){u=a[c].listener,s=c;break}if(s<0)return this;s===0?a.shift():na(a,s),a.length===1&&(o[t]=a[0]),o.removeListener!==void 0&&this.emit("removeListener",t,u||r)}return this};V.prototype.off=V.prototype.removeListener;V.prototype.removeAllListeners=function(t){var r,a,o;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[t]),this;if(arguments.length===0){var s=Object.keys(a),c;for(o=0;o<s.length;++o)c=s[o],c!=="removeListener"&&this.removeAllListeners(c);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=a[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(o=r.length-1;o>=0;o--)this.removeListener(t,r[o]);return this};function Mn(e,t,r){var a=e._events;if(a===void 0)return[];var o=a[t];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?ia(o):Fn(o,o.length)}V.prototype.listeners=function(t){return Mn(this,t,!0)};V.prototype.rawListeners=function(t){return Mn(this,t,!1)};V.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Pn.call(e,t)};V.prototype.listenerCount=Pn;function Pn(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}V.prototype.eventNames=function(){return this._eventsCount>0?Mt(this._events):[]};function Fn(e,t){for(var r=new Array(t),a=0;a<t;++a)r[a]=e[a];return r}function na(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function ia(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function aa(e,t){return new Promise(function(r,a){function o(c){e.removeListener(t,s),a(c)}function s(){typeof e.removeListener=="function"&&e.removeListener("error",o),r([].slice.call(arguments))}Nn(e,t,s,{once:!0}),t!=="error"&&oa(e,o,{once:!0})})}function oa(e,t,r){typeof e.on=="function"&&Nn(e,"error",t,r)}function Nn(e,t,r,a){if(typeof e.on=="function")a.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function o(s){a.once&&e.removeEventListener(t,o),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var Un=Lr.exports,Dn=Un.EventEmitter;const sa={},fa=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"})),Mr=Mi(fa);var or,Gr;function ua(){if(Gr)return or;Gr=1;function e(R,k){var A=Object.keys(R);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(R);k&&(I=I.filter(function(M){return Object.getOwnPropertyDescriptor(R,M).enumerable})),A.push.apply(A,I)}return A}function t(R){for(var k=1;k<arguments.length;k++){var A=arguments[k]!=null?arguments[k]:{};k%2?e(Object(A),!0).forEach(function(I){r(R,I,A[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(A)):e(Object(A)).forEach(function(I){Object.defineProperty(R,I,Object.getOwnPropertyDescriptor(A,I))})}return R}function r(R,k,A){return k=c(k),k in R?Object.defineProperty(R,k,{value:A,enumerable:!0,configurable:!0,writable:!0}):R[k]=A,R}function a(R,k){if(!(R instanceof k))throw new TypeError("Cannot call a class as a function")}function o(R,k){for(var A=0;A<k.length;A++){var I=k[A];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(R,c(I.key),I)}}function s(R,k,A){return k&&o(R.prototype,k),Object.defineProperty(R,"prototype",{writable:!1}),R}function c(R){var k=u(R,"string");return typeof k=="symbol"?k:String(k)}function u(R,k){if(typeof R!="object"||R===null)return R;var A=R[Symbol.toPrimitive];if(A!==void 0){var I=A.call(R,k||"default");if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(k==="string"?String:Number)(R)}var p=ht,w=p.Buffer,m=Mr,v=m.inspect,T=v&&v.custom||"inspect";function C(R,k,A){w.prototype.copy.call(R,k,A)}return or=function(){function R(){a(this,R),this.head=null,this.tail=null,this.length=0}return s(R,[{key:"push",value:function(A){var I={data:A,next:null};this.length>0?this.tail.next=I:this.head=I,this.tail=I,++this.length}},{key:"unshift",value:function(A){var I={data:A,next:this.head};this.length===0&&(this.tail=I),this.head=I,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(A){if(this.length===0)return"";for(var I=this.head,M=""+I.data;I=I.next;)M+=A+I.data;return M}},{key:"concat",value:function(A){if(this.length===0)return w.alloc(0);for(var I=w.allocUnsafe(A>>>0),M=this.head,P=0;M;)C(M.data,I,P),P+=M.data.length,M=M.next;return I}},{key:"consume",value:function(A,I){var M;return A<this.head.data.length?(M=this.head.data.slice(0,A),this.head.data=this.head.data.slice(A)):A===this.head.data.length?M=this.shift():M=I?this._getString(A):this._getBuffer(A),M}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(A){var I=this.head,M=1,P=I.data;for(A-=P.length;I=I.next;){var L=I.data,N=A>L.length?L.length:A;if(N===L.length?P+=L:P+=L.slice(0,A),A-=N,A===0){N===L.length?(++M,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=L.slice(N));break}++M}return this.length-=M,P}},{key:"_getBuffer",value:function(A){var I=w.allocUnsafe(A),M=this.head,P=1;for(M.data.copy(I),A-=M.data.length;M=M.next;){var L=M.data,N=A>L.length?L.length:A;if(L.copy(I,I.length-A,0,N),A-=N,A===0){N===L.length?(++P,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=L.slice(N));break}++P}return this.length-=P,I}},{key:T,value:function(A,I){return v(this,t(t({},I),{},{depth:0,customInspect:!1}))}}]),R}(),or}function ca(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Br,this,e)):process.nextTick(Br,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Pt,r):(r._writableState.errorEmitted=!0,process.nextTick(Vr,r,s)):process.nextTick(Vr,r,s):t?(process.nextTick(Pt,r),t(s)):process.nextTick(Pt,r)}),this)}function Vr(e,t){Br(e,t),Pt(e)}function Pt(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function la(){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 Br(e,t){e.emit("error",t)}function ha(e,t){var r=e._readableState,a=e._writableState;r&&r.autoDestroy||a&&a.autoDestroy?e.destroy(t):e.emit("error",t)}var $n={destroy:ca,undestroy:la,errorOrDestroy:ha},Ze={};function da(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Hn={};function Ae(e,t,r){r||(r=Error);function a(s,c,u){return typeof t=="string"?t:t(s,c,u)}var o=function(s){da(c,s);function c(u,p,w){return s.call(this,a(u,p,w))||this}return c}(r);o.prototype.name=r.name,o.prototype.code=e,Hn[e]=o}function zr(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(a){return String(a)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function pa(e,t,r){return e.substr(0,t.length)===t}function ba(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function ya(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ae("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ae("ERR_INVALID_ARG_TYPE",function(e,t,r){var a;typeof t=="string"&&pa(t,"not ")?(a="must not be",t=t.replace(/^not /,"")):a="must be";var o;if(ba(e," argument"))o="The ".concat(e," ").concat(a," ").concat(zr(t,"type"));else{var s=ya(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(a," ").concat(zr(t,"type"))}return o+=". Received type ".concat(typeof r),o},TypeError);Ae("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ae("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ae("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ae("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ae("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ae("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ae("ERR_STREAM_WRITE_AFTER_END","write after end");Ae("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ae("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ae("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Ze.codes=Hn;var _a=Ze.codes.ERR_INVALID_OPT_VALUE;function ga(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function wa(e,t,r,a){var o=ga(t,a,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var s=a?r:"highWaterMark";throw new _a(s,o)}return Math.floor(o)}return e.objectMode?16:16*1024}var jn={getHighWaterMark:wa},ma=va;function va(e,t){if(sr("noDeprecation"))return e;var r=!1;function a(){if(!r){if(sr("throwDeprecation"))throw new Error(t);sr("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return a}function sr(e){try{if(!Ge.localStorage)return!1}catch{return!1}var t=Ge.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var fr,Jr;function qn(){if(Jr)return fr;Jr=1,fr=U;function e(_){var y=this;this.next=null,this.entry=null,this.finish=function(){Me(y,_)}}var t;U.WritableState=E;var r={deprecate:ma},a=Dn,o=ht.Buffer,s=(typeof Ge<"u"?Ge:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(_){return o.from(_)}function u(_){return o.isBuffer(_)||_ instanceof s}var p=$n,w=jn,m=w.getHighWaterMark,v=Ze.codes,T=v.ERR_INVALID_ARG_TYPE,C=v.ERR_METHOD_NOT_IMPLEMENTED,R=v.ERR_MULTIPLE_CALLBACK,k=v.ERR_STREAM_CANNOT_PIPE,A=v.ERR_STREAM_DESTROYED,I=v.ERR_STREAM_NULL_VALUES,M=v.ERR_STREAM_WRITE_AFTER_END,P=v.ERR_UNKNOWN_ENCODING,L=p.errorOrDestroy;be(U,a);function N(){}function E(_,y,S){t=t||lt(),_=_||{},typeof S!="boolean"&&(S=y instanceof t),this.objectMode=!!_.objectMode,S&&(this.objectMode=this.objectMode||!!_.writableObjectMode),this.highWaterMark=m(this,_,"writableHighWaterMark",S),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var D=_.decodeStrings===!1;this.decodeStrings=!D,this.defaultEncoding=_.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(q){ze(y,q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=_.emitClose!==!1,this.autoDestroy=!!_.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}E.prototype.getBuffer=function(){for(var y=this.bufferedRequest,S=[];y;)S.push(y),y=y.next;return S},function(){try{Object.defineProperty(E.prototype,"buffer",{get:r.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(U,Symbol.hasInstance,{value:function(y){return j.call(this,y)?!0:this!==U?!1:y&&y._writableState instanceof E}})):j=function(y){return y instanceof this};function U(_){t=t||lt();var y=this instanceof t;if(!y&&!j.call(U,this))return new U(_);this._writableState=new E(_,this,y),this.writable=!0,_&&(typeof _.write=="function"&&(this._write=_.write),typeof _.writev=="function"&&(this._writev=_.writev),typeof _.destroy=="function"&&(this._destroy=_.destroy),typeof _.final=="function"&&(this._final=_.final)),a.call(this)}U.prototype.pipe=function(){L(this,new k)};function $(_,y){var S=new M;L(_,S),process.nextTick(y,S)}function ne(_,y,S,D){var q;return S===null?q=new I:typeof S!="string"&&!y.objectMode&&(q=new T("chunk",["string","Buffer"],S)),q?(L(_,q),process.nextTick(D,q),!1):!0}U.prototype.write=function(_,y,S){var D=this._writableState,q=!1,h=!D.objectMode&&u(_);return h&&!o.isBuffer(_)&&(_=c(_)),typeof y=="function"&&(S=y,y=null),h?y="buffer":y||(y=D.defaultEncoding),typeof S!="function"&&(S=N),D.ending?$(this,S):(h||ne(this,D,_,S))&&(D.pendingcb++,q=$e(this,D,h,_,y,S)),q},U.prototype.cork=function(){this._writableState.corked++},U.prototype.uncork=function(){var _=this._writableState;_.corked&&(_.corked--,!_.writing&&!_.corked&&!_.bufferProcessing&&_.bufferedRequest&&ke(this,_))},U.prototype.setDefaultEncoding=function(y){if(typeof y=="string"&&(y=y.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((y+"").toLowerCase())>-1))throw new P(y);return this._writableState.defaultEncoding=y,this},Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Te(_,y,S){return!_.objectMode&&_.decodeStrings!==!1&&typeof y=="string"&&(y=o.from(y,S)),y}Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $e(_,y,S,D,q,h){if(!S){var d=Te(y,D,q);D!==d&&(S=!0,q="buffer",D=d)}var B=y.objectMode?1:D.length;y.length+=B;var F=y.length<y.highWaterMark;if(F||(y.needDrain=!0),y.writing||y.corked){var Q=y.lastBufferedRequest;y.lastBufferedRequest={chunk:D,encoding:q,isBuf:S,callback:h,next:null},Q?Q.next=y.lastBufferedRequest:y.bufferedRequest=y.lastBufferedRequest,y.bufferedRequestCount+=1}else oe(_,y,!1,B,D,q,h);return F}function oe(_,y,S,D,q,h,d){y.writelen=D,y.writecb=d,y.writing=!0,y.sync=!0,y.destroyed?y.onwrite(new A("write")):S?_._writev(q,y.onwrite):_._write(q,h,y.onwrite),y.sync=!1}function me(_,y,S,D,q){--y.pendingcb,S?(process.nextTick(q,D),process.nextTick(Ee,_,y),_._writableState.errorEmitted=!0,L(_,D)):(q(D),_._writableState.errorEmitted=!0,L(_,D),Ee(_,y))}function ve(_){_.writing=!1,_.writecb=null,_.length-=_.writelen,_.writelen=0}function ze(_,y){var S=_._writableState,D=S.sync,q=S.writecb;if(typeof q!="function")throw new R;if(ve(S),y)me(_,S,D,y,q);else{var h=je(S)||_.destroyed;!h&&!S.corked&&!S.bufferProcessing&&S.bufferedRequest&&ke(_,S),D?process.nextTick(Ie,_,S,h,q):Ie(_,S,h,q)}}function Ie(_,y,S,D){S||He(_,y),y.pendingcb--,D(),Ee(_,y)}function He(_,y){y.length===0&&y.needDrain&&(y.needDrain=!1,_.emit("drain"))}function ke(_,y){y.bufferProcessing=!0;var S=y.bufferedRequest;if(_._writev&&S&&S.next){var D=y.bufferedRequestCount,q=new Array(D),h=y.corkedRequestsFree;h.entry=S;for(var d=0,B=!0;S;)q[d]=S,S.isBuf||(B=!1),S=S.next,d+=1;q.allBuffers=B,oe(_,y,!0,y.length,q,"",h.finish),y.pendingcb++,y.lastBufferedRequest=null,h.next?(y.corkedRequestsFree=h.next,h.next=null):y.corkedRequestsFree=new e(y),y.bufferedRequestCount=0}else{for(;S;){var F=S.chunk,Q=S.encoding,W=S.callback,G=y.objectMode?1:F.length;if(oe(_,y,!1,G,F,Q,W),S=S.next,y.bufferedRequestCount--,y.writing)break}S===null&&(y.lastBufferedRequest=null)}y.bufferedRequest=S,y.bufferProcessing=!1}U.prototype._write=function(_,y,S){S(new C("_write()"))},U.prototype._writev=null,U.prototype.end=function(_,y,S){var D=this._writableState;return typeof _=="function"?(S=_,_=null,y=null):typeof y=="function"&&(S=y,y=null),_!=null&&this.write(_,y),D.corked&&(D.corked=1,this.uncork()),D.ending||qe(this,D,S),this},Object.defineProperty(U.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function je(_){return _.ending&&_.length===0&&_.bufferedRequest===null&&!_.finished&&!_.writing}function X(_,y){_._final(function(S){y.pendingcb--,S&&L(_,S),y.prefinished=!0,_.emit("prefinish"),Ee(_,y)})}function ie(_,y){!y.prefinished&&!y.finalCalled&&(typeof _._final=="function"&&!y.destroyed?(y.pendingcb++,y.finalCalled=!0,process.nextTick(X,_,y)):(y.prefinished=!0,_.emit("prefinish")))}function Ee(_,y){var S=je(y);if(S&&(ie(_,y),y.pendingcb===0&&(y.finished=!0,_.emit("finish"),y.autoDestroy))){var D=_._readableState;(!D||D.autoDestroy&&D.endEmitted)&&_.destroy()}return S}function qe(_,y,S){y.ending=!0,Ee(_,y),S&&(y.finished?process.nextTick(S):_.once("finish",S)),y.ended=!0,_.writable=!1}function Me(_,y,S){var D=_.entry;for(_.entry=null;D;){var q=D.callback;y.pendingcb--,q(S),D=D.next}y.corkedRequestsFree.next=_}return Object.defineProperty(U.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(y){this._writableState&&(this._writableState.destroyed=y)}}),U.prototype.destroy=p.destroy,U.prototype._undestroy=p.undestroy,U.prototype._destroy=function(_,y){y(_)},fr}var ur,Yr;function lt(){if(Yr)return ur;Yr=1;var e=Object.keys||function(w){var m=[];for(var v in w)m.push(v);return m};ur=c;var t=Kn(),r=qn();be(c,t);for(var a=e(r.prototype),o=0;o<a.length;o++){var s=a[o];c.prototype[s]||(c.prototype[s]=r.prototype[s])}function c(w){if(!(this instanceof c))return new c(w);t.call(this,w),r.call(this,w),this.allowHalfOpen=!0,w&&(w.readable===!1&&(this.readable=!1),w.writable===!1&&(this.writable=!1),w.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u(){this._writableState.ended||process.nextTick(p,this)}function p(w){w.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(m){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=m,this._writableState.destroyed=m)}}),ur}var $t={},Pr=xe.Buffer,Xr=Pr.isEncoding||function(e){switch(e=""+e,e&&e.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 xa(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Ea(e){var t=xa(e);if(typeof t!="string"&&(Pr.isEncoding===Xr||!Xr(e)))throw new Error("Unknown encoding: "+e);return t||e}$t.StringDecoder=At;function At(e){this.encoding=Ea(e);var t;switch(this.encoding){case"utf16le":this.text=Ia,this.end=ka,t=4;break;case"utf8":this.fillLast=Sa,t=4;break;case"base64":this.text=Ca,this.end=Oa,t=3;break;default:this.write=La,this.end=Ma;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Pr.allocUnsafe(t)}At.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};At.prototype.end=Ta;At.prototype.text=Aa;At.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function cr(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Ba(e,t,r){var a=t.length-1;if(a<r)return 0;var o=cr(t[a]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--a<r||o===-2?0:(o=cr(t[a]),o>=0?(o>0&&(e.lastNeed=o-2),o):--a<r||o===-2?0:(o=cr(t[a]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}function Ra(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"�"}}function Sa(e){var t=this.lastTotal-this.lastNeed,r=Ra(this,e);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Aa(e,t){var r=Ba(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)}function Ta(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function Ia(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function ka(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Ca(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function Oa(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function La(e){return e.toString(this.encoding)}function Ma(e){return e&&e.length?this.write(e):""}var Qr=Ze.codes.ERR_STREAM_PREMATURE_CLOSE;function Pa(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];e.apply(this,a)}}}function Fa(){}function Na(e){return e.setHeader&&typeof e.abort=="function"}function Wn(e,t,r){if(typeof t=="function")return Wn(e,null,t);t||(t={}),r=Pa(r||Fa);var a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){o=!1,c=!0,a||r.call(e)},p=e._readableState&&e._readableState.endEmitted,w=function(){a=!1,p=!0,o||r.call(e)},m=function(R){r.call(e,R)},v=function(){var R;if(a&&!p)return(!e._readableState||!e._readableState.ended)&&(R=new Qr),r.call(e,R);if(o&&!c)return(!e._writableState||!e._writableState.ended)&&(R=new Qr),r.call(e,R)},T=function(){e.req.on("finish",u)};return Na(e)?(e.on("complete",u),e.on("abort",v),e.req?T():e.on("request",T)):o&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",w),e.on("finish",u),t.error!==!1&&e.on("error",m),e.on("close",v),function(){e.removeListener("complete",u),e.removeListener("abort",v),e.removeListener("request",T),e.req&&e.req.removeListener("finish",u),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",u),e.removeListener("end",w),e.removeListener("error",m),e.removeListener("close",v)}}var Fr=Wn,lr,Zr;function Ua(){if(Zr)return lr;Zr=1;var e;function t(P,L,N){return L=r(L),L in P?Object.defineProperty(P,L,{value:N,enumerable:!0,configurable:!0,writable:!0}):P[L]=N,P}function r(P){var L=a(P,"string");return typeof L=="symbol"?L:String(L)}function a(P,L){if(typeof P!="object"||P===null)return P;var N=P[Symbol.toPrimitive];if(N!==void 0){var E=N.call(P,L||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(L==="string"?String:Number)(P)}var o=Fr,s=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),p=Symbol("ended"),w=Symbol("lastPromise"),m=Symbol("handlePromise"),v=Symbol("stream");function T(P,L){return{value:P,done:L}}function C(P){var L=P[s];if(L!==null){var N=P[v].read();N!==null&&(P[w]=null,P[s]=null,P[c]=null,L(T(N,!1)))}}function R(P){process.nextTick(C,P)}function k(P,L){return function(N,E){P.then(function(){if(L[p]){N(T(void 0,!0));return}L[m](N,E)},E)}}var A=Object.getPrototypeOf(function(){}),I=Object.setPrototypeOf((e={get stream(){return this[v]},next:function(){var L=this,N=this[u];if(N!==null)return Promise.reject(N);if(this[p])return Promise.resolve(T(void 0,!0));if(this[v].destroyed)return new Promise(function($,ne){process.nextTick(function(){L[u]?ne(L[u]):$(T(void 0,!0))})});var E=this[w],j;if(E)j=new Promise(k(E,this));else{var U=this[v].read();if(U!==null)return Promise.resolve(T(U,!1));j=new Promise(this[m])}return this[w]=j,j}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var L=this;return new Promise(function(N,E){L[v].destroy(null,function(j){if(j){E(j);return}N(T(void 0,!0))})})}),e),A),M=function(L){var N,E=Object.create(I,(N={},t(N,v,{value:L,writable:!0}),t(N,s,{value:null,writable:!0}),t(N,c,{value:null,writable:!0}),t(N,u,{value:null,writable:!0}),t(N,p,{value:L._readableState.endEmitted,writable:!0}),t(N,m,{value:function(U,$){var ne=E[v].read();ne?(E[w]=null,E[s]=null,E[c]=null,U(T(ne,!1))):(E[s]=U,E[c]=$)},writable:!0}),N));return E[w]=null,o(L,function(j){if(j&&j.code!=="ERR_STREAM_PREMATURE_CLOSE"){var U=E[c];U!==null&&(E[w]=null,E[s]=null,E[c]=null,U(j)),E[u]=j;return}var $=E[s];$!==null&&(E[w]=null,E[s]=null,E[c]=null,$(T(void 0,!0))),E[p]=!0}),L.on("readable",R.bind(null,E)),E};return lr=M,lr}var hr,en;function Da(){return en||(en=1,hr=function(){throw new Error("Readable.from is not available in the browser")}),hr}var dr,tn;function Kn(){if(tn)return dr;tn=1,dr=$;var e;$.ReadableState=U,Un.EventEmitter;var t=function(d,B){return d.listeners(B).length},r=Dn,a=ht.Buffer,o=(typeof Ge<"u"?Ge:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(h){return a.from(h)}function c(h){return a.isBuffer(h)||h instanceof o}var u=Mr,p;u&&u.debuglog?p=u.debuglog("stream"):p=function(){};var w=ua(),m=$n,v=jn,T=v.getHighWaterMark,C=Ze.codes,R=C.ERR_INVALID_ARG_TYPE,k=C.ERR_STREAM_PUSH_AFTER_EOF,A=C.ERR_METHOD_NOT_IMPLEMENTED,I=C.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,M,P,L;be($,r);var N=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function j(h,d,B){if(typeof h.prependListener=="function")return h.prependListener(d,B);!h._events||!h._events[d]?h.on(d,B):Array.isArray(h._events[d])?h._events[d].unshift(B):h._events[d]=[B,h._events[d]]}function U(h,d,B){e=e||lt(),h=h||{},typeof B!="boolean"&&(B=d instanceof e),this.objectMode=!!h.objectMode,B&&(this.objectMode=this.objectMode||!!h.readableObjectMode),this.highWaterMark=T(this,h,"readableHighWaterMark",B),this.buffer=new w,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=h.emitClose!==!1,this.autoDestroy=!!h.autoDestroy,this.destroyed=!1,this.defaultEncoding=h.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,h.encoding&&(M||(M=$t.StringDecoder),this.decoder=new M(h.encoding),this.encoding=h.encoding)}function $(h){if(e=e||lt(),!(this instanceof $))return new $(h);var d=this instanceof e;this._readableState=new U(h,this,d),this.readable=!0,h&&(typeof h.read=="function"&&(this._read=h.read),typeof h.destroy=="function"&&(this._destroy=h.destroy)),r.call(this)}Object.defineProperty($.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(d){this._readableState&&(this._readableState.destroyed=d)}}),$.prototype.destroy=m.destroy,$.prototype._undestroy=m.undestroy,$.prototype._destroy=function(h,d){d(h)},$.prototype.push=function(h,d){var B=this._readableState,F;return B.objectMode?F=!0:typeof h=="string"&&(d=d||B.defaultEncoding,d!==B.encoding&&(h=a.from(h,d),d=""),F=!0),ne(this,h,d,!1,F)},$.prototype.unshift=function(h){return ne(this,h,null,!0,!1)};function ne(h,d,B,F,Q){p("readableAddChunk",d);var W=h._readableState;if(d===null)W.reading=!1,ze(h,W);else{var G;if(Q||(G=$e(W,d)),G)N(h,G);else if(W.objectMode||d&&d.length>0)if(typeof d!="string"&&!W.objectMode&&Object.getPrototypeOf(d)!==a.prototype&&(d=s(d)),F)W.endEmitted?N(h,new I):Te(h,W,d,!0);else if(W.ended)N(h,new k);else{if(W.destroyed)return!1;W.reading=!1,W.decoder&&!B?(d=W.decoder.write(d),W.objectMode||d.length!==0?Te(h,W,d,!1):ke(h,W)):Te(h,W,d,!1)}else F||(W.reading=!1,ke(h,W))}return!W.ended&&(W.length<W.highWaterMark||W.length===0)}function Te(h,d,B,F){d.flowing&&d.length===0&&!d.sync?(d.awaitDrain=0,h.emit("data",B)):(d.length+=d.objectMode?1:B.length,F?d.buffer.unshift(B):d.buffer.push(B),d.needReadable&&Ie(h)),ke(h,d)}function $e(h,d){var B;return!c(d)&&typeof d!="string"&&d!==void 0&&!h.objectMode&&(B=new R("chunk",["string","Buffer","Uint8Array"],d)),B}$.prototype.isPaused=function(){return this._readableState.flowing===!1},$.prototype.setEncoding=function(h){M||(M=$t.StringDecoder);var d=new M(h);this._readableState.decoder=d,this._readableState.encoding=this._readableState.decoder.encoding;for(var B=this._readableState.buffer.head,F="";B!==null;)F+=d.write(B.data),B=B.next;return this._readableState.buffer.clear(),F!==""&&this._readableState.buffer.push(F),this._readableState.length=F.length,this};var oe=1073741824;function me(h){return h>=oe?h=oe:(h--,h|=h>>>1,h|=h>>>2,h|=h>>>4,h|=h>>>8,h|=h>>>16,h++),h}function ve(h,d){return h<=0||d.length===0&&d.ended?0:d.objectMode?1:h!==h?d.flowing&&d.length?d.buffer.head.data.length:d.length:(h>d.highWaterMark&&(d.highWaterMark=me(h)),h<=d.length?h:d.ended?d.length:(d.needReadable=!0,0))}$.prototype.read=function(h){p("read",h),h=parseInt(h,10);var d=this._readableState,B=h;if(h!==0&&(d.emittedReadable=!1),h===0&&d.needReadable&&((d.highWaterMark!==0?d.length>=d.highWaterMark:d.length>0)||d.ended))return p("read: emitReadable",d.length,d.ended),d.length===0&&d.ended?S(this):Ie(this),null;if(h=ve(h,d),h===0&&d.ended)return d.length===0&&S(this),null;var F=d.needReadable;p("need readable",F),(d.length===0||d.length-h<d.highWaterMark)&&(F=!0,p("length less than watermark",F)),d.ended||d.reading?(F=!1,p("reading or ended",F)):F&&(p("do read"),d.reading=!0,d.sync=!0,d.length===0&&(d.needReadable=!0),this._read(d.highWaterMark),d.sync=!1,d.reading||(h=ve(B,d)));var Q;return h>0?Q=y(h,d):Q=null,Q===null?(d.needReadable=d.length<=d.highWaterMark,h=0):(d.length-=h,d.awaitDrain=0),d.length===0&&(d.ended||(d.needReadable=!0),B!==h&&d.ended&&S(this)),Q!==null&&this.emit("data",Q),Q};function ze(h,d){if(p("onEofChunk"),!d.ended){if(d.decoder){var B=d.decoder.end();B&&B.length&&(d.buffer.push(B),d.length+=d.objectMode?1:B.length)}d.ended=!0,d.sync?Ie(h):(d.needReadable=!1,d.emittedReadable||(d.emittedReadable=!0,He(h)))}}function Ie(h){var d=h._readableState;p("emitReadable",d.needReadable,d.emittedReadable),d.needReadable=!1,d.emittedReadable||(p("emitReadable",d.flowing),d.emittedReadable=!0,process.nextTick(He,h))}function He(h){var d=h._readableState;p("emitReadable_",d.destroyed,d.length,d.ended),!d.destroyed&&(d.length||d.ended)&&(h.emit("readable"),d.emittedReadable=!1),d.needReadable=!d.flowing&&!d.ended&&d.length<=d.highWaterMark,_(h)}function ke(h,d){d.readingMore||(d.readingMore=!0,process.nextTick(je,h,d))}function je(h,d){for(;!d.reading&&!d.ended&&(d.length<d.highWaterMark||d.flowing&&d.length===0);){var B=d.length;if(p("maybeReadMore read 0"),h.read(0),B===d.length)break}d.readingMore=!1}$.prototype._read=function(h){N(this,new A("_read()"))},$.prototype.pipe=function(h,d){var B=this,F=this._readableState;switch(F.pipesCount){case 0:F.pipes=h;break;case 1:F.pipes=[F.pipes,h];break;default:F.pipes.push(h);break}F.pipesCount+=1,p("pipe count=%d opts=%j",F.pipesCount,d);var Q=(!d||d.end!==!1)&&h!==process.stdout&&h!==process.stderr,W=Q?We:Ye;F.endEmitted?process.nextTick(W):B.once("end",W),h.on("unpipe",G);function G(f,n){p("onunpipe"),f===B&&n&&n.hasUnpiped===!1&&(n.hasUnpiped=!0,rt())}function We(){p("onend"),h.end()}var tt=X(B);h.on("drain",tt);var pt=!1;function rt(){p("cleanup"),h.removeListener("close",bt),h.removeListener("finish",Re),h.removeListener("drain",tt),h.removeListener("error",Je),h.removeListener("unpipe",G),B.removeListener("end",We),B.removeListener("end",Ye),B.removeListener("data",Be),pt=!0,F.awaitDrain&&(!h._writableState||h._writableState.needDrain)&&tt()}B.on("data",Be);function Be(f){p("ondata");var n=h.write(f);p("dest.write",n),n===!1&&((F.pipesCount===1&&F.pipes===h||F.pipesCount>1&&q(F.pipes,h)!==-1)&&!pt&&(p("false write response, pause",F.awaitDrain),F.awaitDrain++),B.pause())}function Je(f){p("onerror",f),Ye(),h.removeListener("error",Je),t(h,"error")===0&&N(h,f)}j(h,"error",Je);function bt(){h.removeListener("finish",Re),Ye()}h.once("close",bt);function Re(){p("onfinish"),h.removeListener("close",bt),Ye()}h.once("finish",Re);function Ye(){p("unpipe"),B.unpipe(h)}return h.emit("pipe",B),F.flowing||(p("pipe resume"),B.resume()),h};function X(h){return function(){var B=h._readableState;p("pipeOnDrain",B.awaitDrain),B.awaitDrain&&B.awaitDrain--,B.awaitDrain===0&&t(h,"data")&&(B.flowing=!0,_(h))}}$.prototype.unpipe=function(h){var d=this._readableState,B={hasUnpiped:!1};if(d.pipesCount===0)return this;if(d.pipesCount===1)return h&&h!==d.pipes?this:(h||(h=d.pipes),d.pipes=null,d.pipesCount=0,d.flowing=!1,h&&h.emit("unpipe",this,B),this);if(!h){var F=d.pipes,Q=d.pipesCount;d.pipes=null,d.pipesCount=0,d.flowing=!1;for(var W=0;W<Q;W++)F[W].emit("unpipe",this,{hasUnpiped:!1});return this}var G=q(d.pipes,h);return G===-1?this:(d.pipes.splice(G,1),d.pipesCount-=1,d.pipesCount===1&&(d.pipes=d.pipes[0]),h.emit("unpipe",this,B),this)},$.prototype.on=function(h,d){var B=r.prototype.on.call(this,h,d),F=this._readableState;return h==="data"?(F.readableListening=this.listenerCount("readable")>0,F.flowing!==!1&&this.resume()):h==="readable"&&!F.endEmitted&&!F.readableListening&&(F.readableListening=F.needReadable=!0,F.flowing=!1,F.emittedReadable=!1,p("on readable",F.length,F.reading),F.length?Ie(this):F.reading||process.nextTick(Ee,this)),B},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(h,d){var B=r.prototype.removeListener.call(this,h,d);return h==="readable"&&process.nextTick(ie,this),B},$.prototype.removeAllListeners=function(h){var d=r.prototype.removeAllListeners.apply(this,arguments);return(h==="readable"||h===void 0)&&process.nextTick(ie,this),d};function ie(h){var d=h._readableState;d.readableListening=h.listenerCount("readable")>0,d.resumeScheduled&&!d.paused?d.flowing=!0:h.listenerCount("data")>0&&h.resume()}function Ee(h){p("readable nexttick read 0"),h.read(0)}$.prototype.resume=function(){var h=this._readableState;return h.flowing||(p("resume"),h.flowing=!h.readableListening,qe(this,h)),h.paused=!1,this};function qe(h,d){d.resumeScheduled||(d.resumeScheduled=!0,process.nextTick(Me,h,d))}function Me(h,d){p("resume",d.reading),d.reading||h.read(0),d.resumeScheduled=!1,h.emit("resume"),_(h),d.flowing&&!d.reading&&h.read(0)}$.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _(h){var d=h._readableState;for(p("flow",d.flowing);d.flowing&&h.read()!==null;);}$.prototype.wrap=function(h){var d=this,B=this._readableState,F=!1;h.on("end",function(){if(p("wrapped end"),B.decoder&&!B.ended){var G=B.decoder.end();G&&G.length&&d.push(G)}d.push(null)}),h.on("data",function(G){if(p("wrapped data"),B.decoder&&(G=B.decoder.write(G)),!(B.objectMode&&G==null)&&!(!B.objectMode&&(!G||!G.length))){var We=d.push(G);We||(F=!0,h.pause())}});for(var Q in h)this[Q]===void 0&&typeof h[Q]=="function"&&(this[Q]=function(We){return function(){return h[We].apply(h,arguments)}}(Q));for(var W=0;W<E.length;W++)h.on(E[W],this.emit.bind(this,E[W]));return this._read=function(G){p("wrapped _read",G),F&&(F=!1,h.resume())},this},typeof Symbol=="function"&&($.prototype[Symbol.asyncIterator]=function(){return P===void 0&&(P=Ua()),P(this)}),Object.defineProperty($.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty($.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty($.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(d){this._readableState&&(this._readableState.flowing=d)}}),$._fromList=y,Object.defineProperty($.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function y(h,d){if(d.length===0)return null;var B;return d.objectMode?B=d.buffer.shift():!h||h>=d.length?(d.decoder?B=d.buffer.join(""):d.buffer.length===1?B=d.buffer.first():B=d.buffer.concat(d.length),d.buffer.clear()):B=d.buffer.consume(h,d.decoder),B}function S(h){var d=h._readableState;p("endReadable",d.endEmitted),d.endEmitted||(d.ended=!0,process.nextTick(D,d,h))}function D(h,d){if(p("endReadableNT",h.endEmitted,h.length),!h.endEmitted&&h.length===0&&(h.endEmitted=!0,d.readable=!1,d.emit("end"),h.autoDestroy)){var B=d._writableState;(!B||B.autoDestroy&&B.finished)&&d.destroy()}}typeof Symbol=="function"&&($.from=function(h,d){return L===void 0&&(L=Da()),L($,h,d)});function q(h,d){for(var B=0,F=h.length;B<F;B++)if(h[B]===d)return B;return-1}return dr}var Gn=De,Gt=Ze.codes,$a=Gt.ERR_METHOD_NOT_IMPLEMENTED,Ha=Gt.ERR_MULTIPLE_CALLBACK,ja=Gt.ERR_TRANSFORM_ALREADY_TRANSFORMING,qa=Gt.ERR_TRANSFORM_WITH_LENGTH_0,Vt=lt();be(De,Vt);function Wa(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(a===null)return this.emit("error",new Ha);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),a(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function De(e){if(!(this instanceof De))return new De(e);Vt.call(this,e),this._transformState={afterTransform:Wa.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Ka)}function Ka(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){rn(e,t,r)}):rn(this,null,null)}De.prototype.push=function(e,t){return this._transformState.needTransform=!1,Vt.prototype.push.call(this,e,t)};De.prototype._transform=function(e,t,r){r(new $a("_transform()"))};De.prototype._write=function(e,t,r){var a=this._transformState;if(a.writecb=r,a.writechunk=e,a.writeencoding=t,!a.transforming){var o=this._readableState;(a.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};De.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};De.prototype._destroy=function(e,t){Vt.prototype._destroy.call(this,e,function(r){t(r)})};function rn(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new qa;if(e._transformState.transforming)throw new ja;return e.push(null)}var Ga=Rt,Vn=Gn;be(Rt,Vn);function Rt(e){if(!(this instanceof Rt))return new Rt(e);Vn.call(this,e)}Rt.prototype._transform=function(e,t,r){r(null,e)};var pr;function Va(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var zn=Ze.codes,za=zn.ERR_MISSING_ARGS,Ja=zn.ERR_STREAM_DESTROYED;function nn(e){if(e)throw e}function Ya(e){return e.setHeader&&typeof e.abort=="function"}function Xa(e,t,r,a){a=Va(a);var o=!1;e.on("close",function(){o=!0}),pr===void 0&&(pr=Fr),pr(e,{readable:t,writable:r},function(c){if(c)return a(c);o=!0,a()});var s=!1;return function(c){if(!o&&!s){if(s=!0,Ya(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();a(c||new Ja("pipe"))}}}function an(e){e()}function Qa(e,t){return e.pipe(t)}function Za(e){return!e.length||typeof e[e.length-1]!="function"?nn:e.pop()}function eo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=Za(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new za("streams");var o,s=t.map(function(c,u){var p=u<t.length-1,w=u>0;return Xa(c,p,w,function(m){o||(o=m),m&&s.forEach(an),!p&&(s.forEach(an),a(o))})});return t.reduce(Qa)}var to=eo;(function(e,t){t=e.exports=Kn(),t.Stream=t,t.Readable=t,t.Writable=qn(),t.Duplex=lt(),t.Transform=Gn,t.PassThrough=Ga,t.finished=Fr,t.pipeline=to})(Er,Er.exports);var ro=Er.exports,Ht=xe.Buffer,Jn=ro.Transform,no=be;function io(e,t){if(!Ht.isBuffer(e)&&typeof e!="string")throw new TypeError(t+" must be a string or a buffer")}function Ve(e){Jn.call(this),this._block=Ht.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}no(Ve,Jn);Ve.prototype._transform=function(e,t,r){var a=null;try{this.update(e,t)}catch(o){a=o}r(a)};Ve.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)};Ve.prototype.update=function(e,t){if(io(e,"Data"),this._finalized)throw new Error("Digest already called");Ht.isBuffer(e)||(e=Ht.from(e,t));for(var r=this._block,a=0;this._blockOffset+e.length-a>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[a++];this._update(),this._blockOffset=0}for(;a<e.length;)r[this._blockOffset++]=e[a++];for(var s=0,c=e.length*8;c>0;++s)this._length[s]+=c,c=this._length[s]/4294967296|0,c>0&&(this._length[s]-=4294967296*c);return this};Ve.prototype._update=function(){throw new Error("_update is not implemented")};Ve.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();e!==void 0&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};Ve.prototype._digest=function(){throw new Error("_digest is not implemented")};var Yn=Ve,ao=be,Xn=Yn,oo=xe.Buffer,so=new Array(16);function zt(){Xn.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}ao(zt,Xn);zt.prototype._update=function(){for(var e=so,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a,a=this._b,o=this._c,s=this._d;r=ue(r,a,o,s,e[0],3614090360,7),s=ue(s,r,a,o,e[1],3905402710,12),o=ue(o,s,r,a,e[2],606105819,17),a=ue(a,o,s,r,e[3],3250441966,22),r=ue(r,a,o,s,e[4],4118548399,7),s=ue(s,r,a,o,e[5],1200080426,12),o=ue(o,s,r,a,e[6],2821735955,17),a=ue(a,o,s,r,e[7],4249261313,22),r=ue(r,a,o,s,e[8],1770035416,7),s=ue(s,r,a,o,e[9],2336552879,12),o=ue(o,s,r,a,e[10],4294925233,17),a=ue(a,o,s,r,e[11],2304563134,22),r=ue(r,a,o,s,e[12],1804603682,7),s=ue(s,r,a,o,e[13],4254626195,12),o=ue(o,s,r,a,e[14],2792965006,17),a=ue(a,o,s,r,e[15],1236535329,22),r=ce(r,a,o,s,e[1],4129170786,5),s=ce(s,r,a,o,e[6],3225465664,9),o=ce(o,s,r,a,e[11],643717713,14),a=ce(a,o,s,r,e[0],3921069994,20),r=ce(r,a,o,s,e[5],3593408605,5),s=ce(s,r,a,o,e[10],38016083,9),o=ce(o,s,r,a,e[15],3634488961,14),a=ce(a,o,s,r,e[4],3889429448,20),r=ce(r,a,o,s,e[9],568446438,5),s=ce(s,r,a,o,e[14],3275163606,9),o=ce(o,s,r,a,e[3],4107603335,14),a=ce(a,o,s,r,e[8],1163531501,20),r=ce(r,a,o,s,e[13],2850285829,5),s=ce(s,r,a,o,e[2],4243563512,9),o=ce(o,s,r,a,e[7],1735328473,14),a=ce(a,o,s,r,e[12],2368359562,20),r=le(r,a,o,s,e[5],4294588738,4),s=le(s,r,a,o,e[8],2272392833,11),o=le(o,s,r,a,e[11],1839030562,16),a=le(a,o,s,r,e[14],4259657740,23),r=le(r,a,o,s,e[1],2763975236,4),s=le(s,r,a,o,e[4],1272893353,11),o=le(o,s,r,a,e[7],4139469664,16),a=le(a,o,s,r,e[10],3200236656,23),r=le(r,a,o,s,e[13],681279174,4),s=le(s,r,a,o,e[0],3936430074,11),o=le(o,s,r,a,e[3],3572445317,16),a=le(a,o,s,r,e[6],76029189,23),r=le(r,a,o,s,e[9],3654602809,4),s=le(s,r,a,o,e[12],3873151461,11),o=le(o,s,r,a,e[15],530742520,16),a=le(a,o,s,r,e[2],3299628645,23),r=he(r,a,o,s,e[0],4096336452,6),s=he(s,r,a,o,e[7],1126891415,10),o=he(o,s,r,a,e[14],2878612391,15),a=he(a,o,s,r,e[5],4237533241,21),r=he(r,a,o,s,e[12],1700485571,6),s=he(s,r,a,o,e[3],2399980690,10),o=he(o,s,r,a,e[10],4293915773,15),a=he(a,o,s,r,e[1],2240044497,21),r=he(r,a,o,s,e[8],1873313359,6),s=he(s,r,a,o,e[15],4264355552,10),o=he(o,s,r,a,e[6],2734768916,15),a=he(a,o,s,r,e[13],1309151649,21),r=he(r,a,o,s,e[4],4149444226,6),s=he(s,r,a,o,e[11],3174756917,10),o=he(o,s,r,a,e[2],718787259,15),a=he(a,o,s,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+a|0,this._c=this._c+o|0,this._d=this._d+s|0};zt.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 e=oo.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function Jt(e,t){return e<<t|e>>>32-t}function ue(e,t,r,a,o,s,c){return Jt(e+(t&r|~t&a)+o+s|0,c)+t|0}function ce(e,t,r,a,o,s,c){return Jt(e+(t&a|r&~a)+o+s|0,c)+t|0}function le(e,t,r,a,o,s,c){return Jt(e+(t^r^a)+o+s|0,c)+t|0}function he(e,t,r,a,o,s,c){return Jt(e+(r^(t|~a))+o+s|0,c)+t|0}var fo=zt,br=ht.Buffer,uo=be,Qn=Yn,co=new Array(16),gt=[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],wt=[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],mt=[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],vt=[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],xt=[0,1518500249,1859775393,2400959708,2840853838],Et=[1352829926,1548603684,1836072691,2053994217,0];function Yt(){Qn.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}uo(Yt,Qn);Yt.prototype._update=function(){for(var e=co,t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);for(var r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=this._a|0,p=this._b|0,w=this._c|0,m=this._d|0,v=this._e|0,T=0;T<80;T+=1){var C,R;T<16?(C=on(r,a,o,s,c,e[gt[T]],xt[0],mt[T]),R=cn(u,p,w,m,v,e[wt[T]],Et[0],vt[T])):T<32?(C=sn(r,a,o,s,c,e[gt[T]],xt[1],mt[T]),R=un(u,p,w,m,v,e[wt[T]],Et[1],vt[T])):T<48?(C=fn(r,a,o,s,c,e[gt[T]],xt[2],mt[T]),R=fn(u,p,w,m,v,e[wt[T]],Et[2],vt[T])):T<64?(C=un(r,a,o,s,c,e[gt[T]],xt[3],mt[T]),R=sn(u,p,w,m,v,e[wt[T]],Et[3],vt[T])):(C=cn(r,a,o,s,c,e[gt[T]],xt[4],mt[T]),R=on(u,p,w,m,v,e[wt[T]],Et[4],vt[T])),r=c,c=s,s=Qe(o,10),o=a,a=C,u=v,v=m,m=Qe(w,10),w=p,p=R}var k=this._b+o+m|0;this._b=this._c+s+v|0,this._c=this._d+c+u|0,this._d=this._e+r+p|0,this._e=this._a+a+w|0,this._a=k};Yt.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 e=br.alloc?br.alloc(20):new br(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};function Qe(e,t){return e<<t|e>>>32-t}function on(e,t,r,a,o,s,c,u){return Qe(e+(t^r^a)+s+c|0,u)+o|0}function sn(e,t,r,a,o,s,c,u){return Qe(e+(t&r|~t&a)+s+c|0,u)+o|0}function fn(e,t,r,a,o,s,c,u){return Qe(e+((t|~r)^a)+s+c|0,u)+o|0}function un(e,t,r,a,o,s,c,u){return Qe(e+(t&a|r&~a)+s+c|0,u)+o|0}function cn(e,t,r,a,o,s,c,u){return Qe(e+(t^(r|~a))+s+c|0,u)+o|0}var lo=Yt,Zn={exports:{}},ei=xe.Buffer;function Xt(e,t){this._block=ei.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Xt.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=ei.from(e,t));for(var r=this._block,a=this._blockSize,o=e.length,s=this._len,c=0;c<o;){for(var u=s%a,p=Math.min(o-c,a-u),w=0;w<p;w++)r[u+w]=e[c+w];s+=p,c+=p,s%a===0&&this._update(r)}return this._len+=o,this};Xt.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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 a=(r&4294967295)>>>0,o=(r-a)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(a,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};Xt.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var dt=Xt,ho=be,ti=dt,po=xe.Buffer,bo=[1518500249,1859775393,-1894007588,-899497514],yo=new Array(80);function Tt(){this.init(),this._w=yo,ti.call(this,64,56)}ho(Tt,ti);Tt.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function _o(e){return e<<5|e>>>27}function go(e){return e<<30|e>>>2}function wo(e,t,r,a){return e===0?t&r|~t&a:e===2?t&r|t&a|r&a:t^r^a}Tt.prototype._update=function(e){for(var t=this._w,r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var p=0;p<80;++p){var w=~~(p/20),m=_o(r)+wo(w,a,o,s)+c+t[p]+bo[w]|0;c=s,s=o,o=go(a),a=r,r=m}this._a=r+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};Tt.prototype._hash=function(){var e=po.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var mo=Tt,vo=be,ri=dt,xo=xe.Buffer,Eo=[1518500249,1859775393,-1894007588,-899497514],Bo=new Array(80);function It(){this.init(),this._w=Bo,ri.call(this,64,56)}vo(It,ri);It.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Ro(e){return e<<1|e>>>31}function So(e){return e<<5|e>>>27}function Ao(e){return e<<30|e>>>2}function To(e,t,r,a){return e===0?t&r|~t&a:e===2?t&r|t&a|r&a:t^r^a}It.prototype._update=function(e){for(var t=this._w,r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=Ro(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var p=0;p<80;++p){var w=~~(p/20),m=So(r)+To(w,a,o,s)+c+t[p]+Eo[w]|0;c=s,s=o,o=Ao(a),a=r,r=m}this._a=r+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};It.prototype._hash=function(){var e=xo.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Io=It,ko=be,ni=dt,Co=xe.Buffer,Oo=[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],Lo=new Array(64);function kt(){this.init(),this._w=Lo,ni.call(this,64,56)}ko(kt,ni);kt.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 Mo(e,t,r){return r^e&(t^r)}function Po(e,t,r){return e&t|r&(e|t)}function Fo(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function No(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Uo(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Do(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}kt.prototype._update=function(e){for(var t=this._w,r=this._a|0,a=this._b|0,o=this._c|0,s=this._d|0,c=this._e|0,u=this._f|0,p=this._g|0,w=this._h|0,m=0;m<16;++m)t[m]=e.readInt32BE(m*4);for(;m<64;++m)t[m]=Do(t[m-2])+t[m-7]+Uo(t[m-15])+t[m-16]|0;for(var v=0;v<64;++v){var T=w+No(c)+Mo(c,u,p)+Oo[v]+t[v]|0,C=Fo(r)+Po(r,a,o)|0;w=p,p=u,u=c,c=s+T|0,s=o,o=a,a=r,r=T+C|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=u+this._f|0,this._g=p+this._g|0,this._h=w+this._h|0};kt.prototype._hash=function(){var e=Co.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var ii=kt,$o=be,Ho=ii,jo=dt,qo=xe.Buffer,Wo=new Array(64);function Qt(){this.init(),this._w=Wo,jo.call(this,64,56)}$o(Qt,Ho);Qt.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};Qt.prototype._hash=function(){var e=qo.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Ko=Qt,Go=be,ai=dt,Vo=xe.Buffer,ln=[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],zo=new Array(160);function Ct(){this.init(),this._w=zo,ai.call(this,128,112)}Go(Ct,ai);Ct.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 hn(e,t,r){return r^e&(t^r)}function dn(e,t,r){return e&t|r&(e|t)}function pn(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function bn(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Jo(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Yo(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Xo(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Qo(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function se(e,t){return e>>>0<t>>>0?1:0}Ct.prototype._update=function(e){for(var t=this._w,r=this._ah|0,a=this._bh|0,o=this._ch|0,s=this._dh|0,c=this._eh|0,u=this._fh|0,p=this._gh|0,w=this._hh|0,m=this._al|0,v=this._bl|0,T=this._cl|0,C=this._dl|0,R=this._el|0,k=this._fl|0,A=this._gl|0,I=this._hl|0,M=0;M<32;M+=2)t[M]=e.readInt32BE(M*4),t[M+1]=e.readInt32BE(M*4+4);for(;M<160;M+=2){var P=t[M-30],L=t[M-15*2+1],N=Jo(P,L),E=Yo(L,P);P=t[M-2*2],L=t[M-2*2+1];var j=Xo(P,L),U=Qo(L,P),$=t[M-7*2],ne=t[M-7*2+1],Te=t[M-16*2],$e=t[M-16*2+1],oe=E+ne|0,me=N+$+se(oe,E)|0;oe=oe+U|0,me=me+j+se(oe,U)|0,oe=oe+$e|0,me=me+Te+se(oe,$e)|0,t[M]=me,t[M+1]=oe}for(var ve=0;ve<160;ve+=2){me=t[ve],oe=t[ve+1];var ze=dn(r,a,o),Ie=dn(m,v,T),He=pn(r,m),ke=pn(m,r),je=bn(c,R),X=bn(R,c),ie=ln[ve],Ee=ln[ve+1],qe=hn(c,u,p),Me=hn(R,k,A),_=I+X|0,y=w+je+se(_,I)|0;_=_+Me|0,y=y+qe+se(_,Me)|0,_=_+Ee|0,y=y+ie+se(_,Ee)|0,_=_+oe|0,y=y+me+se(_,oe)|0;var S=ke+Ie|0,D=He+ze+se(S,ke)|0;w=p,I=A,p=u,A=k,u=c,k=R,R=C+_|0,c=s+y+se(R,C)|0,s=o,C=T,o=a,T=v,a=r,v=m,m=_+S|0,r=y+D+se(m,_)|0}this._al=this._al+m|0,this._bl=this._bl+v|0,this._cl=this._cl+T|0,this._dl=this._dl+C|0,this._el=this._el+R|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+I|0,this._ah=this._ah+r+se(this._al,m)|0,this._bh=this._bh+a+se(this._bl,v)|0,this._ch=this._ch+o+se(this._cl,T)|0,this._dh=this._dh+s+se(this._dl,C)|0,this._eh=this._eh+c+se(this._el,R)|0,this._fh=this._fh+u+se(this._fl,k)|0,this._gh=this._gh+p+se(this._gl,A)|0,this._hh=this._hh+w+se(this._hl,I)|0};Ct.prototype._hash=function(){var e=Vo.allocUnsafe(64);function t(r,a,o){e.writeInt32BE(r,o),e.writeInt32BE(a,o+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var oi=Ct,Zo=be,es=oi,ts=dt,rs=xe.Buffer,ns=new Array(160);function Zt(){this.init(),this._w=ns,ts.call(this,128,112)}Zo(Zt,es);Zt.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};Zt.prototype._hash=function(){var e=rs.allocUnsafe(48);function t(r,a,o){e.writeInt32BE(r,o),e.writeInt32BE(a,o+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var is=Zt,et=Zn.exports=function(t){t=t.toLowerCase();var r=et[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};et.sha=mo;et.sha1=Io;et.sha224=Ko;et.sha256=ii;et.sha384=is;et.sha512=oi;var as=Zn.exports,si=xe.Buffer,fi=Mr.Transform,os=$t.StringDecoder,ss=be;function Ce(e){fi.call(this),this.hashMode=typeof e=="string",this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}ss(Ce,fi);Ce.prototype.update=function(e,t,r){typeof e=="string"&&(e=si.from(e,t));var a=this._update(e);return this.hashMode?this:(r&&(a=this._toString(a,r)),a)};Ce.prototype.setAutoPadding=function(){};Ce.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};Ce.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};Ce.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};Ce.prototype._transform=function(e,t,r){var a;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(o){a=o}finally{r(a)}};Ce.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)};Ce.prototype._finalOrDigest=function(e){var t=this.__final()||si.alloc(0);return e&&(t=this._toString(t,e,!0)),t};Ce.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new os(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var a=this._decoder.write(e);return r&&(a+=this._decoder.end()),a};var fs=Ce,us=be,cs=fo,ls=lo,hs=as,ui=fs;function er(e){ui.call(this,"digest"),this._hash=e}us(er,ui);er.prototype._update=function(e){this._hash.update(e)};er.prototype._final=function(){return this._hash.digest()};var ds=function(t){return t=t.toLowerCase(),t==="md5"?new cs:t==="rmd160"||t==="ripemd160"?new ls:new er(hs(t))},Lt=xe.Buffer;function ps(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var a=0;a<e.length;a++){var o=e.charAt(a),s=o.charCodeAt(0);if(t[s]!==255)throw new TypeError(o+" is ambiguous");t[s]=a}var c=e.length,u=e.charAt(0),p=Math.log(c)/Math.log(256),w=Math.log(256)/Math.log(c);function m(C){if((Array.isArray(C)||C instanceof Uint8Array)&&(C=Lt.from(C)),!Lt.isBuffer(C))throw new TypeError("Expected Buffer");if(C.length===0)return"";for(var R=0,k=0,A=0,I=C.length;A!==I&&C[A]===0;)A++,R++;for(var M=(I-A)*w+1>>>0,P=new Uint8Array(M);A!==I;){for(var L=C[A],N=0,E=M-1;(L!==0||N<k)&&E!==-1;E--,N++)L+=256*P[E]>>>0,P[E]=L%c>>>0,L=L/c>>>0;if(L!==0)throw new Error("Non-zero carry");k=N,A++}for(var j=M-k;j!==M&&P[j]===0;)j++;for(var U=u.repeat(R);j<M;++j)U+=e.charAt(P[j]);return U}function v(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return Lt.alloc(0);for(var R=0,k=0,A=0;C[R]===u;)k++,R++;for(var I=(C.length-R)*p+1>>>0,M=new Uint8Array(I);R<C.length;){var P=t[C.charCodeAt(R)];if(P===255)return;for(var L=0,N=I-1;(P!==0||L<A)&&N!==-1;N--,L++)P+=c*M[N]>>>0,M[N]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");A=L,R++}for(var E=I-A;E!==I&&M[E]===0;)E++;var j=Lt.allocUnsafe(k+(I-E));j.fill(0,0,k);for(var U=k;E!==I;)j[U++]=M[E++];return j}function T(C){var R=v(C);if(R)return R;throw new Error("Non-base"+c+" character")}return{encode:m,decodeUnsafe:v,decode:T}}var bs=ps,ys=bs,_s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",gs=ys(_s),yr=gs,ws=xe.Buffer,ms=function(e){function t(s){var c=e(s);return yr.encode(ws.concat([s,c],s.length+4))}function r(s){var c=s.slice(0,-4),u=s.slice(-4),p=e(c);if(!(u[0]^p[0]|u[1]^p[1]|u[2]^p[2]|u[3]^p[3]))return c}function a(s){var c=yr.decodeUnsafe(s);if(c)return r(c)}function o(s){var c=yr.decode(s),u=r(c);if(!u)throw new Error("Invalid checksum");return u}return{encode:t,decode:o,decodeUnsafe:a}},yn=ds,vs=ms;function xs(e){var t=yn("sha256").update(e).digest();return yn("sha256").update(t).digest()}var Es=vs(xs),Rr=Es;function ci(e,t){if(t!==void 0&&e[0]!==t)throw new Error("Invalid network version");if(e.length===33)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(e.length!==34)throw new Error("Invalid WIF length");if(e[33]!==1)throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function Sr(e,t,r){var a=new Buffer(r?34:33);return a.writeUInt8(e,0),t.copy(a,1),r&&(a[33]=1),a}function Bs(e,t){return ci(Rr.decode(e),t)}function Rs(e,t,r){return typeof e=="number"?Rr.encode(Sr(e,t,r)):Rr.encode(Sr(e.version,e.privateKey,e.compressed))}var Ss={decode:Bs,decodeRaw:ci,encode:Rs,encodeRaw:Sr},tr={};Object.defineProperty(tr,"__esModule",{value:!0});tr.testEcc=void 0;const H=e=>Buffer.from(e,"hex");function As(e){Y(e.isPoint(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(!e.isPoint(H("030000000000000000000000000000000000000000000000000000000000000005"))),Y(e.isPrivate(H("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(e.isPrivate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),Y(!e.isPrivate(H("0000000000000000000000000000000000000000000000000000000000000000"))),Y(!e.isPrivate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"))),Y(!e.isPrivate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142"))),Y(Buffer.from(e.privateAdd(H("0000000000000000000000000000000000000000000000000000000000000001"),H("0000000000000000000000000000000000000000000000000000000000000000"))).equals(H("0000000000000000000000000000000000000000000000000000000000000001"))),Y(e.privateAdd(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"),H("0000000000000000000000000000000000000000000000000000000000000003"))===null),Y(Buffer.from(e.privateAdd(H("e211078564db65c3ce7704f08262b1f38f1ef412ad15b5ac2d76657a63b2c500"),H("b51fbb69051255d1becbd683de5848242a89c229348dd72896a87ada94ae8665"))).equals(H("9730c2ee69edbb958d42db7460bafa18fef9d955325aec99044c81c8282b0a24"))),Y(Buffer.from(e.privateNegate(H("0000000000000000000000000000000000000000000000000000000000000001"))).equals(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))),Y(Buffer.from(e.privateNegate(H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413e"))).equals(H("0000000000000000000000000000000000000000000000000000000000000003"))),Y(Buffer.from(e.privateNegate(H("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(H("4eede1bf775995d70a494f0a7bb6bc11e0b8cccd41cce8009ab1132c8b0a3792"))),Y(Buffer.from(e.pointCompress(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!0)).equals(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(Buffer.from(e.pointCompress(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"),!1)).equals(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),Y(Buffer.from(e.pointCompress(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!0)).equals(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"))),Y(Buffer.from(e.pointCompress(H("0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),!1)).equals(H("0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"))),Y(Buffer.from(e.pointFromScalar(H("b1121e4088a66a28f5b6b0f5844943ecd9f610196d7bb83b25214b60452c09af"))).equals(H("02b07ba9dca9523b7ef4bd97703d43d20399eb698e194704791a25ce77a400df99"))),Y(e.xOnlyPointAddTweak(H("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))===null);let t=e.xOnlyPointAddTweak(H("1617d38ed8d8657da4d4761e8057bc396ea9e4b9d29776d4be096016dbd2509b"),H("a8397a935f0dfceba6ba9618f6451ef4d80637abf4e6af2669fbc9de6a8fd2ac"));Y(Buffer.from(t.xOnlyPubkey).equals(H("e478f99dab91052ab39a33ea35fd5e6e4933f4d28023cd597c9a1f6760346adf"))&&t.parity===1),t=e.xOnlyPointAddTweak(H("2c0b7cf95324a07d05398b240174dc0c2be444d96b159aa6c7f7b1e668680991"),H("823c3cd2142744b075a87eade7e1b8678ba308d566226a0056ca2b7a76f86b47")),Y(Buffer.from(t.xOnlyPubkey).equals(H("9534f8dc8c6deda2dc007655981c78b49c5d96c778fbf363462a11ec9dfd948c"))&&t.parity===0),Y(Buffer.from(e.sign(H("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),H("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"))).equals(H("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),Y(e.verify(H("5e9f0a0d593efdcf78ac923bc3313e4e7d408d574354ee2b3288c0da9fbba6ed"),H("0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),H("54c4a33c6423d689378f160a7ff8b61330444abb58fb470f96ea16d99d4a2fed07082304410efa6b2943111b6a4e0aaa7b7db55a07e9861d1fb3cb1f421044a5"))),e.signSchnorr&&Y(Buffer.from(e.signSchnorr(H("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),H("c90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b14e5c9"),H("c87aa53824b4d7ae2eb035a2b5bbbccc080e76cdc6d1692c4b0b62d798e6d906"))).equals(H("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7"))),e.verifySchnorr&&Y(e.verifySchnorr(H("7e2d58d8b3bcdf1abadec7829054f90dda9805aab56c77333024b9d0a508b75c"),H("dd308afec5777e13121fa72b9cc1b7cc0139715309b086c960e18fd969774eb8"),H("5831aaeed7b44bb74e5eab94ba9d4294c49bcf2a60728d8b4c200f50dd313c1bab745879a5ad954a72c45a91c3a51d3c7adea98d82f8481e0e1e03674a6f3fb7")))}tr.testEcc=As;function Y(e){if(!e)throw new Error("ecc library invalid")}Object.defineProperty(ut,"__esModule",{value:!0});ut.ECPairFactory=ut.networks=void 0;const Ar=ct;ut.networks=Ar;const _e=En,Ts=ea,_n=Ss,Is=tr,_r=_e.typeforce.maybe(_e.typeforce.compile({compressed:_e.maybe(_e.Boolean),network:_e.maybe(_e.Network)})),ks=e=>e.length===32?e:e.slice(1,33);function Cs(e){(0,Is.testEcc)(e);function t(u){return e.isPoint(u)}function r(u,p){if(_e.typeforce(_e.Buffer256bit,u),!e.isPrivate(u))throw new TypeError("Private key not in range [1, n)");return _e.typeforce(_r,p),new c(u,void 0,p)}function a(u,p){return _e.typeforce(e.isPoint,u),_e.typeforce(_r,p),new c(void 0,u,p)}function o(u,p){const w=_n.decode(u),m=w.version;if(_e.Array(p)){if(p=p.filter(v=>m===v.wif).pop(),!p)throw new Error("Unknown network version")}else if(p=p||Ar.bitcoin,m!==p.wif)throw new Error("Invalid network version");return r(w.privateKey,{compressed:w.compressed,network:p})}function s(u){_e.typeforce(_r,u),u===void 0&&(u={});const p=u.rng||Ts;let w;do w=p(32),_e.typeforce(_e.Buffer256bit,w);while(!e.isPrivate(w));return r(w,u)}class c{constructor(p,w,m){nt(this,"__D");nt(this,"__Q");nt(this,"compressed");nt(this,"network");nt(this,"lowR");this.__D=p,this.__Q=w,this.lowR=!1,m===void 0&&(m={}),this.compressed=m.compressed===void 0?!0:m.compressed,this.network=m.network||Ar.bitcoin,w!==void 0&&(this.__Q=Buffer.from(e.pointCompress(w,this.compressed)))}get privateKey(){return this.__D}get publicKey(){if(!this.__Q){const p=e.pointFromScalar(this.__D,this.compressed);this.__Q=Buffer.from(p)}return this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return _n.encode(this.network.wif,this.__D,this.compressed)}tweak(p){return this.privateKey?this.tweakFromPrivateKey(p):this.tweakFromPublicKey(p)}sign(p,w){if(!this.__D)throw new Error("Missing private key");if(w===void 0&&(w=this.lowR),w===!1)return Buffer.from(e.sign(p,this.__D));{let m=e.sign(p,this.__D);const v=Buffer.alloc(32,0);let T=0;for(;m[0]>127;)T++,v.writeUIntLE(T,0,6),m=e.sign(p,this.__D,v);return Buffer.from(m)}}signSchnorr(p){if(!this.privateKey)throw new Error("Missing private key");if(!e.signSchnorr)throw new Error("signSchnorr not supported by ecc library");return Buffer.from(e.signSchnorr(p,this.privateKey))}verify(p,w){return e.verify(p,this.publicKey,w)}verifySchnorr(p,w){if(!e.verifySchnorr)throw new Error("verifySchnorr not supported by ecc library");return e.verifySchnorr(p,this.publicKey.subarray(1,33),w)}tweakFromPublicKey(p){const w=ks(this.publicKey),m=e.xOnlyPointAddTweak(w,p);if(!m||m.xOnlyPubkey===null)throw new Error("Cannot tweak public key!");const v=Buffer.from([m.parity===0?2:3]);return a(Buffer.concat([v,m.xOnlyPubkey]),{network:this.network,compressed:this.compressed})}tweakFromPrivateKey(p){const m=this.publicKey[0]===3||this.publicKey[0]===4&&(this.publicKey[64]&1)===1?e.privateNegate(this.privateKey):this.privateKey,v=e.privateAdd(m,p);if(!v)throw new Error("Invalid tweaked private key!");return r(Buffer.from(v),{network:this.network,compressed:this.compressed})}}return{isPoint:t,fromPrivateKey:r,fromPublicKey:a,fromWIF:o,makeRandom:s}}ut.ECPairFactory=Cs;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.networks=e.ECPairFactory=e.default=void 0;var t=ut;Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.ECPairFactory}}),Object.defineProperty(e,"ECPairFactory",{enumerable:!0,get:function(){return t.ECPairFactory}}),Object.defineProperty(e,"networks",{enumerable:!0,get:function(){return t.networks}})})(xn);class jt{constructor(t){this.privKey=t}static fromPrivKey(t){return new jt(O.trim0x(t))}static async fromWalletClient(t){if(!t.account)return O.Err("No account found");try{const r=await t.signTypedData({account:t.account,types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"}],Data:[{name:"Message",type:"string"},{name:"Version",type:"string"},{name:"Nonce",type:"uint256"}]},domain:{name:"WBTC GARDEN",version:"1"},primaryType:"Data",message:{Message:"Initialize your swap",Version:"1.0.2",Nonce:1n}});return O.Ok(new jt(O.trim0x(Ne.sha256(r))))}catch(r){return O.Err("Failed to initialize: "+r)}}getMasterPrivKey(){return this.privKey}generateSecret(t){const r=this.signMessage(t),a=Ne.sha256(ge.with0x(r)),o=Ne.sha256(a);return O.Ok({secret:a,secretHash:o})}signMessage(t){const r=xn.ECPairFactory(ft),a="Garden.fi"+t.toString(),o=Buffer.from(a,"utf8"),s=Ne.sha256(o),c=Buffer.from(O.trim0x(this.privKey),"hex");if(c.length!==32)throw new Error("Invalid private key length. Expected 32 bytes.");return r.fromPrivateKey(c).sign(Buffer.from(O.trim0x(s),"hex")).toString("hex")}}class Os{constructor(t){this.quoteUrl=new ge.Url("/quote",t)}async getQuote(t,r,a=!1){try{const o=this.quoteUrl.addSearchParams({order_pair:t,amount:r.toString(),exact_out:a.toString()}),s=await O.Fetcher.get(o);return s.error?O.Err(s.error):s.result?O.Ok(s.result):O.Err("GetQuote: Unexpected error, result is undefined")}catch(o){return O.Err("GetQuote:",String(o))}}async getAttestedQuote(t){try{const r=await O.Fetcher.post(this.quoteUrl.endpoint("/attested").toString(),{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}});return r.error?O.Err(r.error):r.result?O.Ok(r.result):O.Err("GetAttestedQuote: Unexpected error, result is undefined")}catch(r){return console.log("error :",r),O.Err("GetAttestedQuote:",String(r))}}}exports.EvmRelay=vn;exports.Garden=Li;exports.ParseOrderStatus=wn;exports.ParseSwapStatus=Ft;exports.Quote=Os;exports.SecretManager=jt;exports.parseAction=mn;exports.switchOrAddNetwork=Bi;
|
package/dist/index.js
CHANGED