@firmer/mesh 0.0.8 → 0.0.9

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/mesh.js CHANGED
@@ -11449,6 +11449,9 @@ class Bm {
11449
11449
  get() {
11450
11450
  return this.value ?? (this.value = this.fn()), this.value;
11451
11451
  }
11452
+ reset(e) {
11453
+ this.value = e;
11454
+ }
11452
11455
  }
11453
11456
  const ss = class ss {
11454
11457
  static substring(e, t, n) {
package/dist/mesh.umd.cjs CHANGED
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * @author Feross Aboukhadijeh <https://feross.org>
18
18
  * @license MIT
19
- */var Ay;function Vl(){return Ay||(Ay=1,function(r){const e=ql(),t=zl(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=d,r.SlowBuffer=Y,r.INSPECT_MAX_BYTES=50;const s=2147483647;r.kMaxLength=s,d.TYPED_ARRAY_SUPPORT=i(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const y=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(y,p),y.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function a(y){if(y>s)throw new RangeError('The value "'+y+'" is invalid for option "size"');const p=new Uint8Array(y);return Object.setPrototypeOf(p,d.prototype),p}function d(y,p,f){if(typeof y=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(y)}return v(y,p,f)}d.poolSize=8192;function v(y,p,f){if(typeof y=="string")return D(y,p);if(ArrayBuffer.isView(y))return w(y);if(y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y);if(Yt(y,ArrayBuffer)||y&&Yt(y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Yt(y,SharedArrayBuffer)||y&&Yt(y.buffer,SharedArrayBuffer)))return M(y,p,f);if(typeof y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const m=y.valueOf&&y.valueOf();if(m!=null&&m!==y)return d.from(m,p,f);const _=A(y);if(_)return _;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof y[Symbol.toPrimitive]=="function")return d.from(y[Symbol.toPrimitive]("string"),p,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y)}d.from=function(y,p,f){return v(y,p,f)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function j(y){if(typeof y!="number")throw new TypeError('"size" argument must be of type number');if(y<0)throw new RangeError('The value "'+y+'" is invalid for option "size"')}function R(y,p,f){return j(y),y<=0?a(y):p!==void 0?typeof f=="string"?a(y).fill(p,f):a(y).fill(p):a(y)}d.alloc=function(y,p,f){return R(y,p,f)};function E(y){return j(y),a(y<0?0:X(y)|0)}d.allocUnsafe=function(y){return E(y)},d.allocUnsafeSlow=function(y){return E(y)};function D(y,p){if((typeof p!="string"||p==="")&&(p="utf8"),!d.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const f=ae(y,p)|0;let m=a(f);const _=m.write(y,p);return _!==f&&(m=m.slice(0,_)),m}function T(y){const p=y.length<0?0:X(y.length)|0,f=a(p);for(let m=0;m<p;m+=1)f[m]=y[m]&255;return f}function w(y){if(Yt(y,Uint8Array)){const p=new Uint8Array(y);return M(p.buffer,p.byteOffset,p.byteLength)}return T(y)}function M(y,p,f){if(p<0||y.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(y.byteLength<p+(f||0))throw new RangeError('"length" is outside of buffer bounds');let m;return p===void 0&&f===void 0?m=new Uint8Array(y):f===void 0?m=new Uint8Array(y,p):m=new Uint8Array(y,p,f),Object.setPrototypeOf(m,d.prototype),m}function A(y){if(d.isBuffer(y)){const p=X(y.length)|0,f=a(p);return f.length===0||y.copy(f,0,0,p),f}if(y.length!==void 0)return typeof y.length!="number"||co(y.length)?a(0):T(y);if(y.type==="Buffer"&&Array.isArray(y.data))return T(y.data)}function X(y){if(y>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return y|0}function Y(y){return+y!=y&&(y=0),d.alloc(+y)}d.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==d.prototype},d.compare=function(p,f){if(Yt(p,Uint8Array)&&(p=d.from(p,p.offset,p.byteLength)),Yt(f,Uint8Array)&&(f=d.from(f,f.offset,f.byteLength)),!d.isBuffer(p)||!d.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===f)return 0;let m=p.length,_=f.length;for(let l=0,g=Math.min(m,_);l<g;++l)if(p[l]!==f[l]){m=p[l],_=f[l];break}return m<_?-1:_<m?1:0},d.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(p,f){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return d.alloc(0);let m;if(f===void 0)for(f=0,m=0;m<p.length;++m)f+=p[m].length;const _=d.allocUnsafe(f);let l=0;for(m=0;m<p.length;++m){let g=p[m];if(Yt(g,Uint8Array))l+g.length>_.length?(d.isBuffer(g)||(g=d.from(g)),g.copy(_,l)):Uint8Array.prototype.set.call(_,g,l);else if(d.isBuffer(g))g.copy(_,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=g.length}return _};function ae(y,p){if(d.isBuffer(y))return y.length;if(ArrayBuffer.isView(y)||Yt(y,ArrayBuffer))return y.byteLength;if(typeof y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof y);const f=y.length,m=arguments.length>2&&arguments[2]===!0;if(!m&&f===0)return 0;let _=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Pi(y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return so(y).length;default:if(_)return m?-1:Pi(y).length;p=(""+p).toLowerCase(),_=!0}}d.byteLength=ae;function ot(y,p,f){let m=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,p>>>=0,f<=p))return"";for(y||(y="utf8");;)switch(y){case"hex":return Vo(this,p,f);case"utf8":case"utf-8":return Ho(this,p,f);case"ascii":return qo(this,p,f);case"latin1":case"binary":return zo(this,p,f);case"base64":return Cs(this,p,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Go(this,p,f);default:if(m)throw new TypeError("Unknown encoding: "+y);y=(y+"").toLowerCase(),m=!0}}d.prototype._isBuffer=!0;function de(y,p,f){const m=y[p];y[p]=y[f],y[f]=m}d.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<p;f+=2)de(this,f,f+1);return this},d.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<p;f+=4)de(this,f,f+3),de(this,f+1,f+2);return this},d.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<p;f+=8)de(this,f,f+7),de(this,f+1,f+6),de(this,f+2,f+5),de(this,f+3,f+4);return this},d.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?Ho(this,0,p):ot.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(p){if(!d.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:d.compare(this,p)===0},d.prototype.inspect=function(){let p="";const f=r.INSPECT_MAX_BYTES;return p=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(p+=" ... "),"<Buffer "+p+">"},n&&(d.prototype[n]=d.prototype.inspect),d.prototype.compare=function(p,f,m,_,l){if(Yt(p,Uint8Array)&&(p=d.from(p,p.offset,p.byteLength)),!d.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(f===void 0&&(f=0),m===void 0&&(m=p?p.length:0),_===void 0&&(_=0),l===void 0&&(l=this.length),f<0||m>p.length||_<0||l>this.length)throw new RangeError("out of range index");if(_>=l&&f>=m)return 0;if(_>=l)return-1;if(f>=m)return 1;if(f>>>=0,m>>>=0,_>>>=0,l>>>=0,this===p)return 0;let g=l-_,O=m-f;const N=Math.min(g,O),I=this.slice(_,l),ee=p.slice(f,m);for(let J=0;J<N;++J)if(I[J]!==ee[J]){g=I[J],O=ee[J];break}return g<O?-1:O<g?1:0};function tn(y,p,f,m,_){if(y.length===0)return-1;if(typeof f=="string"?(m=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,co(f)&&(f=_?0:y.length-1),f<0&&(f=y.length+f),f>=y.length){if(_)return-1;f=y.length-1}else if(f<0)if(_)f=0;else return-1;if(typeof p=="string"&&(p=d.from(p,m)),d.isBuffer(p))return p.length===0?-1:yn(y,p,f,m,_);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(y,p,f):Uint8Array.prototype.lastIndexOf.call(y,p,f):yn(y,[p],f,m,_);throw new TypeError("val must be string, number or Buffer")}function yn(y,p,f,m,_){let l=1,g=y.length,O=p.length;if(m!==void 0&&(m=String(m).toLowerCase(),m==="ucs2"||m==="ucs-2"||m==="utf16le"||m==="utf-16le")){if(y.length<2||p.length<2)return-1;l=2,g/=2,O/=2,f/=2}function N(ee,J){return l===1?ee[J]:ee.readUInt16BE(J*l)}let I;if(_){let ee=-1;for(I=f;I<g;I++)if(N(y,I)===N(p,ee===-1?0:I-ee)){if(ee===-1&&(ee=I),I-ee+1===O)return ee*l}else ee!==-1&&(I-=I-ee),ee=-1}else for(f+O>g&&(f=g-O),I=f;I>=0;I--){let ee=!0;for(let J=0;J<O;J++)if(N(y,I+J)!==N(p,J)){ee=!1;break}if(ee)return I}return-1}d.prototype.includes=function(p,f,m){return this.indexOf(p,f,m)!==-1},d.prototype.indexOf=function(p,f,m){return tn(this,p,f,m,!0)},d.prototype.lastIndexOf=function(p,f,m){return tn(this,p,f,m,!1)};function Nr(y,p,f,m){f=Number(f)||0;const _=y.length-f;m?(m=Number(m),m>_&&(m=_)):m=_;const l=p.length;m>l/2&&(m=l/2);let g;for(g=0;g<m;++g){const O=parseInt(p.substr(g*2,2),16);if(co(O))return g;y[f+g]=O}return g}function Oi(y,p,f,m){return zr(Pi(p,y.length-f),y,f,m)}function Is(y,p,f,m){return zr(Xo(p),y,f,m)}function $s(y,p,f,m){return zr(so(p),y,f,m)}function Us(y,p,f,m){return zr(Yo(p,y.length-f),y,f,m)}d.prototype.write=function(p,f,m,_){if(f===void 0)_="utf8",m=this.length,f=0;else if(m===void 0&&typeof f=="string")_=f,m=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(m)?(m=m>>>0,_===void 0&&(_="utf8")):(_=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const l=this.length-f;if((m===void 0||m>l)&&(m=l),p.length>0&&(m<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");let g=!1;for(;;)switch(_){case"hex":return Nr(this,p,f,m);case"utf8":case"utf-8":return Oi(this,p,f,m);case"ascii":case"latin1":case"binary":return Is(this,p,f,m);case"base64":return $s(this,p,f,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Us(this,p,f,m);default:if(g)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),g=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Cs(y,p,f){return p===0&&f===y.length?e.fromByteArray(y):e.fromByteArray(y.slice(p,f))}function Ho(y,p,f){f=Math.min(y.length,f);const m=[];let _=p;for(;_<f;){const l=y[_];let g=null,O=l>239?4:l>223?3:l>191?2:1;if(_+O<=f){let N,I,ee,J;switch(O){case 1:l<128&&(g=l);break;case 2:N=y[_+1],(N&192)===128&&(J=(l&31)<<6|N&63,J>127&&(g=J));break;case 3:N=y[_+1],I=y[_+2],(N&192)===128&&(I&192)===128&&(J=(l&15)<<12|(N&63)<<6|I&63,J>2047&&(J<55296||J>57343)&&(g=J));break;case 4:N=y[_+1],I=y[_+2],ee=y[_+3],(N&192)===128&&(I&192)===128&&(ee&192)===128&&(J=(l&15)<<18|(N&63)<<12|(I&63)<<6|ee&63,J>65535&&J<1114112&&(g=J))}}g===null?(g=65533,O=1):g>65535&&(g-=65536,m.push(g>>>10&1023|55296),g=56320|g&1023),m.push(g),_+=O}return ro(m)}const no=4096;function ro(y){const p=y.length;if(p<=no)return String.fromCharCode.apply(String,y);let f="",m=0;for(;m<p;)f+=String.fromCharCode.apply(String,y.slice(m,m+=no));return f}function qo(y,p,f){let m="";f=Math.min(y.length,f);for(let _=p;_<f;++_)m+=String.fromCharCode(y[_]&127);return m}function zo(y,p,f){let m="";f=Math.min(y.length,f);for(let _=p;_<f;++_)m+=String.fromCharCode(y[_]);return m}function Vo(y,p,f){const m=y.length;(!p||p<0)&&(p=0),(!f||f<0||f>m)&&(f=m);let _="";for(let l=p;l<f;++l)_+=Ds[y[l]];return _}function Go(y,p,f){const m=y.slice(p,f);let _="";for(let l=0;l<m.length-1;l+=2)_+=String.fromCharCode(m[l]+m[l+1]*256);return _}d.prototype.slice=function(p,f){const m=this.length;p=~~p,f=f===void 0?m:~~f,p<0?(p+=m,p<0&&(p=0)):p>m&&(p=m),f<0?(f+=m,f<0&&(f=0)):f>m&&(f=m),f<p&&(f=p);const _=this.subarray(p,f);return Object.setPrototypeOf(_,d.prototype),_};function Qe(y,p,f){if(y%1!==0||y<0)throw new RangeError("offset is not uint");if(y+p>f)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=this[p],l=1,g=0;for(;++g<f&&(l*=256);)_+=this[p+g]*l;return _},d.prototype.readUintBE=d.prototype.readUIntBE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=this[p+--f],l=1;for(;f>0&&(l*=256);)_+=this[p+--f]*l;return _},d.prototype.readUint8=d.prototype.readUInt8=function(p,f){return p=p>>>0,f||Qe(p,1,this.length),this[p]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(p,f){return p=p>>>0,f||Qe(p,2,this.length),this[p]|this[p+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(p,f){return p=p>>>0,f||Qe(p,2,this.length),this[p]<<8|this[p+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},d.prototype.readBigUInt64LE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=f+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,l=this[++p]+this[++p]*2**8+this[++p]*2**16+m*2**24;return BigInt(_)+(BigInt(l)<<BigInt(32))}),d.prototype.readBigUInt64BE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=f*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],l=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+m;return(BigInt(_)<<BigInt(32))+BigInt(l)}),d.prototype.readIntLE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=this[p],l=1,g=0;for(;++g<f&&(l*=256);)_+=this[p+g]*l;return l*=128,_>=l&&(_-=Math.pow(2,8*f)),_},d.prototype.readIntBE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=f,l=1,g=this[p+--_];for(;_>0&&(l*=256);)g+=this[p+--_]*l;return l*=128,g>=l&&(g-=Math.pow(2,8*f)),g},d.prototype.readInt8=function(p,f){return p=p>>>0,f||Qe(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},d.prototype.readInt16LE=function(p,f){p=p>>>0,f||Qe(p,2,this.length);const m=this[p]|this[p+1]<<8;return m&32768?m|4294901760:m},d.prototype.readInt16BE=function(p,f){p=p>>>0,f||Qe(p,2,this.length);const m=this[p+1]|this[p]<<8;return m&32768?m|4294901760:m},d.prototype.readInt32LE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},d.prototype.readInt32BE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},d.prototype.readBigInt64LE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(m<<24);return(BigInt(_)<<BigInt(32))+BigInt(f+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),d.prototype.readBigInt64BE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=(f<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(_)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+m)}),d.prototype.readFloatLE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),t.read(this,p,!0,23,4)},d.prototype.readFloatBE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),t.read(this,p,!1,23,4)},d.prototype.readDoubleLE=function(p,f){return p=p>>>0,f||Qe(p,8,this.length),t.read(this,p,!0,52,8)},d.prototype.readDoubleBE=function(p,f){return p=p>>>0,f||Qe(p,8,this.length),t.read(this,p,!1,52,8)};function ft(y,p,f,m,_,l){if(!d.isBuffer(y))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>_||p<l)throw new RangeError('"value" argument is out of bounds');if(f+m>y.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(p,f,m,_){if(p=+p,f=f>>>0,m=m>>>0,!_){const O=Math.pow(2,8*m)-1;ft(this,p,f,m,O,0)}let l=1,g=0;for(this[f]=p&255;++g<m&&(l*=256);)this[f+g]=p/l&255;return f+m},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(p,f,m,_){if(p=+p,f=f>>>0,m=m>>>0,!_){const O=Math.pow(2,8*m)-1;ft(this,p,f,m,O,0)}let l=m-1,g=1;for(this[f+l]=p&255;--l>=0&&(g*=256);)this[f+l]=p/g&255;return f+m},d.prototype.writeUint8=d.prototype.writeUInt8=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,1,255,0),this[f]=p&255,f+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,65535,0),this[f]=p&255,this[f+1]=p>>>8,f+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,65535,0),this[f]=p>>>8,this[f+1]=p&255,f+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,4294967295,0),this[f+3]=p>>>24,this[f+2]=p>>>16,this[f+1]=p>>>8,this[f]=p&255,f+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,4294967295,0),this[f]=p>>>24,this[f+1]=p>>>16,this[f+2]=p>>>8,this[f+3]=p&255,f+4};function G(y,p,f,m,_){io(p,m,_,y,f,7);let l=Number(p&BigInt(4294967295));y[f++]=l,l=l>>8,y[f++]=l,l=l>>8,y[f++]=l,l=l>>8,y[f++]=l;let g=Number(p>>BigInt(32)&BigInt(4294967295));return y[f++]=g,g=g>>8,y[f++]=g,g=g>>8,y[f++]=g,g=g>>8,y[f++]=g,f}function ir(y,p,f,m,_){io(p,m,_,y,f,7);let l=Number(p&BigInt(4294967295));y[f+7]=l,l=l>>8,y[f+6]=l,l=l>>8,y[f+5]=l,l=l>>8,y[f+4]=l;let g=Number(p>>BigInt(32)&BigInt(4294967295));return y[f+3]=g,g=g>>8,y[f+2]=g,g=g>>8,y[f+1]=g,g=g>>8,y[f]=g,f+8}d.prototype.writeBigUInt64LE=xn(function(p,f=0){return G(this,p,f,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=xn(function(p,f=0){return ir(this,p,f,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(p,f,m,_){if(p=+p,f=f>>>0,!_){const N=Math.pow(2,8*m-1);ft(this,p,f,m,N-1,-N)}let l=0,g=1,O=0;for(this[f]=p&255;++l<m&&(g*=256);)p<0&&O===0&&this[f+l-1]!==0&&(O=1),this[f+l]=(p/g>>0)-O&255;return f+m},d.prototype.writeIntBE=function(p,f,m,_){if(p=+p,f=f>>>0,!_){const N=Math.pow(2,8*m-1);ft(this,p,f,m,N-1,-N)}let l=m-1,g=1,O=0;for(this[f+l]=p&255;--l>=0&&(g*=256);)p<0&&O===0&&this[f+l+1]!==0&&(O=1),this[f+l]=(p/g>>0)-O&255;return f+m},d.prototype.writeInt8=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,1,127,-128),p<0&&(p=255+p+1),this[f]=p&255,f+1},d.prototype.writeInt16LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,32767,-32768),this[f]=p&255,this[f+1]=p>>>8,f+2},d.prototype.writeInt16BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,32767,-32768),this[f]=p>>>8,this[f+1]=p&255,f+2},d.prototype.writeInt32LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,2147483647,-2147483648),this[f]=p&255,this[f+1]=p>>>8,this[f+2]=p>>>16,this[f+3]=p>>>24,f+4},d.prototype.writeInt32BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[f]=p>>>24,this[f+1]=p>>>16,this[f+2]=p>>>8,this[f+3]=p&255,f+4},d.prototype.writeBigInt64LE=xn(function(p,f=0){return G(this,p,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=xn(function(p,f=0){return ir(this,p,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Wo(y,p,f,m,_,l){if(f+m>y.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Ve(y,p,f,m,_){return p=+p,f=f>>>0,_||Wo(y,p,f,4),t.write(y,p,f,m,23,4),f+4}d.prototype.writeFloatLE=function(p,f,m){return Ve(this,p,f,!0,m)},d.prototype.writeFloatBE=function(p,f,m){return Ve(this,p,f,!1,m)};function Ko(y,p,f,m,_){return p=+p,f=f>>>0,_||Wo(y,p,f,8),t.write(y,p,f,m,52,8),f+8}d.prototype.writeDoubleLE=function(p,f,m){return Ko(this,p,f,!0,m)},d.prototype.writeDoubleBE=function(p,f,m){return Ko(this,p,f,!1,m)},d.prototype.copy=function(p,f,m,_){if(!d.isBuffer(p))throw new TypeError("argument should be a Buffer");if(m||(m=0),!_&&_!==0&&(_=this.length),f>=p.length&&(f=p.length),f||(f=0),_>0&&_<m&&(_=m),_===m||p.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),p.length-f<_-m&&(_=p.length-f+m);const l=_-m;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,m,_):Uint8Array.prototype.set.call(p,this.subarray(m,_),f),l},d.prototype.fill=function(p,f,m,_){if(typeof p=="string"){if(typeof f=="string"?(_=f,f=0,m=this.length):typeof m=="string"&&(_=m,m=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!d.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(p.length===1){const g=p.charCodeAt(0);(_==="utf8"&&g<128||_==="latin1")&&(p=g)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(f<0||this.length<f||this.length<m)throw new RangeError("Out of range index");if(m<=f)return this;f=f>>>0,m=m===void 0?this.length:m>>>0,p||(p=0);let l;if(typeof p=="number")for(l=f;l<m;++l)this[l]=p;else{const g=d.isBuffer(p)?p:d.from(p,_),O=g.length;if(O===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(l=0;l<m-f;++l)this[l+f]=g[l%O]}return this};const Tr={};function Ri(y,p,f){Tr[y]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${y}]`,this.stack,delete this.name}get code(){return y}set code(_){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:_,writable:!0})}toString(){return`${this.name} [${y}]: ${this.message}`}}}Ri("ERR_BUFFER_OUT_OF_BOUNDS",function(y){return y?`${y} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ri("ERR_INVALID_ARG_TYPE",function(y,p){return`The "${y}" argument must be of type number. Received type ${typeof p}`},TypeError),Ri("ERR_OUT_OF_RANGE",function(y,p,f){let m=`The value of "${y}" is out of range.`,_=f;return Number.isInteger(f)&&Math.abs(f)>2**32?_=Jo(String(f)):typeof f=="bigint"&&(_=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(_=Jo(_)),_+="n"),m+=` It must be ${p}. Received ${_}`,m},RangeError);function Jo(y){let p="",f=y.length;const m=y[0]==="-"?1:0;for(;f>=m+4;f-=3)p=`_${y.slice(f-3,f)}${p}`;return`${y.slice(0,f)}${p}`}function ln(y,p,f){Sn(p,"offset"),(y[p]===void 0||y[p+f]===void 0)&&Ar(p,y.length-(f+1))}function io(y,p,f,m,_,l){if(y>f||y<p){const g=typeof p=="bigint"?"n":"";let O;throw p===0||p===BigInt(0)?O=`>= 0${g} and < 2${g} ** ${(l+1)*8}${g}`:O=`>= -(2${g} ** ${(l+1)*8-1}${g}) and < 2 ** ${(l+1)*8-1}${g}`,new Tr.ERR_OUT_OF_RANGE("value",O,y)}ln(m,_,l)}function Sn(y,p){if(typeof y!="number")throw new Tr.ERR_INVALID_ARG_TYPE(p,"number",y)}function Ar(y,p,f){throw Math.floor(y)!==y?(Sn(y,f),new Tr.ERR_OUT_OF_RANGE("offset","an integer",y)):p<0?new Tr.ERR_BUFFER_OUT_OF_BOUNDS:new Tr.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,y)}const Fs=/[^+/0-9A-Za-z-_]/g;function oo(y){if(y=y.split("=")[0],y=y.trim().replace(Fs,""),y.length<2)return"";for(;y.length%4!==0;)y=y+"=";return y}function Pi(y,p){p=p||1/0;let f;const m=y.length;let _=null;const l=[];for(let g=0;g<m;++g){if(f=y.charCodeAt(g),f>55295&&f<57344){if(!_){if(f>56319){(p-=3)>-1&&l.push(239,191,189);continue}else if(g+1===m){(p-=3)>-1&&l.push(239,191,189);continue}_=f;continue}if(f<56320){(p-=3)>-1&&l.push(239,191,189),_=f;continue}f=(_-55296<<10|f-56320)+65536}else _&&(p-=3)>-1&&l.push(239,191,189);if(_=null,f<128){if((p-=1)<0)break;l.push(f)}else if(f<2048){if((p-=2)<0)break;l.push(f>>6|192,f&63|128)}else if(f<65536){if((p-=3)<0)break;l.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((p-=4)<0)break;l.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return l}function Xo(y){const p=[];for(let f=0;f<y.length;++f)p.push(y.charCodeAt(f)&255);return p}function Yo(y,p){let f,m,_;const l=[];for(let g=0;g<y.length&&!((p-=2)<0);++g)f=y.charCodeAt(g),m=f>>8,_=f%256,l.push(_),l.push(m);return l}function so(y){return e.toByteArray(oo(y))}function zr(y,p,f,m){let _;for(_=0;_<m&&!(_+f>=p.length||_>=y.length);++_)p[_+f]=y[_];return _}function Yt(y,p){return y instanceof p||y!=null&&y.constructor!=null&&y.constructor.name!=null&&y.constructor.name===p.name}function co(y){return y!==y}const Ds=function(){const y="0123456789abcdef",p=new Array(256);for(let f=0;f<16;++f){const m=f*16;for(let _=0;_<16;++_)p[m+_]=y[f]+y[_]}return p}();function xn(y){return typeof BigInt>"u"?ks:y}function ks(){throw new Error("BigInt not supported")}}(ys)),ys}var My=Vl(),Gl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.JSONCodec=class extends u.Codec{constructor(){super(...arguments);o(this,"encoder",new TextEncoder);o(this,"decoder",new TextDecoder)}decode(t,n){const s=this.decoder.decode(t);if(!n||!n.constructor)return JSON.parse(s);const i=JSON.parse(s);if(typeof i!="object"&&typeof i!="function"||i==null)return i;switch(n.name){case"Object":return i}return this.decorateAny(n,i)}decorateAny(t,n){const s=t instanceof or,i=s?t.raw:t;if(!i)return n;switch(i){case Map:{if(n==null)return{};if(!s||t.parameters.length<1)return n;const a={};for(const d of Object.keys(n))a[this.decorateAny(t.parameters[0],d)]=this.decorateAny(t.parameters[1],n[d]);return a}case Array:return n==null?[]:!s||t.parameters.length<1?n:n.map(a=>this.decorateAny(t.parameters[0],a));case Oe:{if(n==null)return null;const a=new i;if(!s||t.parameters.length<1)return Object.assign(a,n);Object.assign(a,n);const d=[];for(let v of a.data||[])d.push(this.decorateAny(t.parameters[0],v));return a.data=d,a}case String:case Number:case Boolean:case Object:return n;case Date:return n==null||n<1?null:new Date(n);case Uint8Array:return n==null?null:n instanceof Uint8Array?n:My.Buffer.from(n,"base64");default:{if(n==null)return null;const a=new i;for(const d of Object.keys(a)){const v=$e.metadata(sr,i,d);if(!v){Reflect.set(a,d,n[d]);continue}const j=n[d]??n[v.name];Reflect.set(a,d,this.decorateAny(v.kind,j))}return a}}}encode(t){return this.encoder.encode(JSON.stringify(t,(n,s)=>{if(s==null||Array.isArray(s))return s;if(!$e.annotated(s.constructor))return this.encodeAny(s);const i=new Map;for(let d in s){const v=$e.metadata(sr,s.constructor,d);v!=null&&v.name&&v.name.length>0&&v.name!=d&&i.set(d,v.name),((v==null?void 0:v.kind)==Uint8Array||(v==null?void 0:v.kind)==Date||(v==null?void 0:v.kind)==Map)&&Reflect.set(s,d,this.encodeAny(Reflect.get(s,d)))}if(i.size<1)return this.encodeAny(s);const a={};for(let d in s)a[i.get(d)??d]=s[d];return this.encodeAny(a)}))}encodeAny(t){return t instanceof Uint8Array?My.Buffer.from(t).toString("base64"):t instanceof Date?t.getTime():t instanceof Map?Object.fromEntries(t):t}uint8ify(t){return this.encoder.encode(t)}stringify(t){return this.decoder.decode(t)}},u.JSONCodec=Gl([B(u.Codec.JSON)],u.JSONCodec);var Br=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i},Xi=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ro;u.Compiler=class{},u.Compiler=Br([B("mesh")],u.Compiler);function Wl(r){return{}}u.TSCompiler=(Er=class extends u.Compiler{compile(e,t){}intype(e){return Ro.parameters.computeIfy(e,t=>{var n;class s{constructor(){o(this,"attachments",new Map)}getAttachments(){return this.attachments}map(){return Object.assign(new Map,this)}setAttachments(a){(a||{}).forEach((d,v)=>this.attachments.set(v,d))}getArguments(){return t.getParameters().map(a=>{var d;return(d=Object.getOwnPropertyDescriptor(this,a.name))==null?void 0:d.value})}setArguments(a){const d=tt.load(u.Codec).getDefault();t.getParameters().forEach((v,j)=>{if(a&&a.length>v.index&&!(a[v.index]instanceof fo)){const R=a[v.index];if(R==null)return;if(R instanceof v.kind&&!(v.kind instanceof or)){Reflect.set(this,v.name,R);return}switch(v.kind){case Map:case Array:case String:case Number:case Boolean:case Object:case Date:case Uint8Array:Reflect.set(this,v.name,R);break;default:const E=d.encode(R),D=d.decode(E,v.kind);Reflect.set(this,v.name,D)}}})}}return Br([c(-1,"attachments",Map),Xi("design:type",typeof(n=typeof Map<"u"&&Map)=="function"?n:Object)],s.prototype,"attachments",void 0),s})}retype(e){return Ro.returns.computeIfy(e,t=>{class n{constructor(){o(this,"code","");o(this,"message","");o(this,"content");o(this,"cause")}getCause(){return this.cause}getCode(){return this.code}getContent(){return this.content}getMessage(){return this.message}setCause(i){this.cause=i}setCode(i){this.code=i}setContent(i){this.content=i}setMessage(i){this.message=i}}return Br([c(0),Xi("design:type",String)],n.prototype,"code",void 0),Br([c(5),Xi("design:type",String)],n.prototype,"message",void 0),Br([c(10,"content",t.getReturnType()),Xi("design:type",Object)],n.prototype,"content",void 0),Br([c(15,"cause",xt),Xi("design:type",Object)],n.prototype,"cause",void 0),n})}},Ro=Er,o(Er,"parameters",new q),o(Er,"returns",new q),Er),u.TSCompiler=Ro=Br([B("mesh")],u.TSCompiler);var Kl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.Consumer=(vi=class{},o(vi,"HTTP","http"),o(vi,"GRPC","grpc"),o(vi,"TCP","tcp"),o(vi,"MQTT","mqtt"),vi),u.Consumer=Kl([B(u.Consumer.HTTP)],u.Consumer);class Po{constructor(e){o(this,"servers",new vt);o(this,"availableAddrs",new vt);o(this,"relativePath",!1);for(const t of(e||"").split(","))t&&t.trim().length>0&&!this.availableAddrs.includes(t)&&(this.servers.push(new Iy(!0,t)),this.availableAddrs.push(t))}any(){if(this.relativePath)return"";const e=this.availableAddrs;return!e||e.length<1?"":e[Math.floor(Math.random()*e.length)]}relative(e){this.relativePath=e}}class Iy{constructor(e,t){o(this,"available");o(this,"address");this.available=e,this.address=t}}class Jl{constructor(e){o(this,"value");o(this,"fn");this.fn=e}get(){return this.value??(this.value=this.fn()),this.value}}const Lo=class Lo{static substring(e,t,n){return!e||e.length>t+n?"":e.substring(t,t+n)}static repeat(e,t){const n=[];for(let s=0;s<t;++s)n.push(e);return n.join("")}static anyone(...e){for(let t of e)if(t&&t.length>0)return t;return""}static traceId(){return""}static spanId(e,t){return""}static newEntity(e){if(!e)return new De;const t=tt.load(u.Codec),n=new De;return n.codec=t.defaultName(),n.schema="",n.buffer=t.getDefault().encode(e),n}static newCacheEntity(e,t,n){const s=Lo.newEntity(t),i=new jt;return i.version="1.0.0",i.entity=s,i.timestamp=Date.now(),i.duration=n,i.key=e,i}static readObject(e,t){return!e.buffer||e.buffer.length<1?null:tt.load(u.Codec).get(e.codec??u.Codec.JSON).decode(e.buffer,t)}static compareVersion(e,t){if(!e)return-1;if(!t)return 1;const n=e.split("."),s=t.split(".");for(let i=0;i<n.length;i++){if(s.length<=i)return 0;if(s[i]=="*")continue;const a=n[i].localeCompare(s[i]);if(a!=0)return a}return 0}static ofError(e){return new xt}static ofCause(e,t,n){throw new Error}static hexString(e){const t=new TextEncoder().encode(e),n="0123456789abcdef";let s="";for(const i of t){const a=i;s+=n[a>>4],s+=n[a&15]}return s}};o(Lo,"MESH_ADDRESS",new Jl(()=>typeof process<"u"&&process.env.MESH_ADDRESS?new Po(process.env.MESH_ADDRESS):globalThis.window!==void 0?new Po(`${globalThis.location.origin}/`):new Po("http://127.0.0.1:443/")));let _e=Lo;var Xl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class Yi extends fo{constructor(){super(...arguments);o(this,"traceId","");o(this,"spanId","");o(this,"timestamp",0);o(this,"runMode",0);o(this,"urn","");o(this,"consumer",new yr);o(this,"calls",0);o(this,"attachments",new Map);o(this,"attributes",new Map);o(this,"principals",new Vs)}static create(){const t=new Yi;return t.traceId=_e.traceId(),t.spanId=_e.spanId("",0),t.timestamp=new Date().getTime(),t.runMode=0,t.urn="",t.consumer=new yr,t}getAttachments(){return this.attachments}getAttribute(t){return this.attributes.get(t.name)}getAttributes(){return this.attributes}getConsumer(t){return this.consumer}getPrincipals(){return this.principals}getProvider(t){return new yr}getRunMode(){return this.runMode}getSpanId(){return this.spanId}getTimestamp(){return this.timestamp}getTraceId(){return this.traceId}getUrn(){return this.urn}setAttribute(t,n){this.attributes.set(t.name,n)}resume(){this.calls++;const t=new Yi;return t.traceId=this.getTraceId(),t.spanId=_e.spanId(this.getSpanId(),this.calls),t.timestamp=this.getTimestamp(),t.runMode=this.getRunMode(),t.urn=this.getUrn(),t.consumer=this.getConsumer(this),this.getAttachments()&&this.getAttachments().forEach((n,s)=>t.attachments.set(n,s)),this.getAttributes()&&this.getAttributes().forEach((n,s)=>t.attributes.set(n,s)),this.getPrincipals()&&this.getPrincipals().forEach(n=>t.principals.push(n)),t}rewriteContext(t){t.getTraceId()&&(this.traceId=t.getTraceId()),t.getSpanId()&&(this.spanId=t.getSpanId()),t.getTimestamp()&&t.getTimestamp()>0&&(this.timestamp=t.getTimestamp()),t.getRunMode()&&t.getRunMode()>0&&(this.runMode=t.getRunMode()),t.getUrn()&&(this.urn=t.getUrn()),t.getConsumer(this)&&(this.consumer=t.getConsumer(this)),this.getAttachments()&&this.getAttachments().forEach((n,s)=>this.attachments.set(n,s)),this.getAttributes()&&this.getAttributes().forEach((n,s)=>this.attributes.set(n,s)),this.getPrincipals()&&this.getPrincipals().forEach(n=>this.principals.push(n))}rewriteURN(t){this.urn=t}}u.MeshContextProvider=class extends u.ContextProvider{context(){return Yi.create()}},u.MeshContextProvider=Xl([B("mesh")],u.MeshContextProvider);var Yl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.Eden=class{},u.Eden=Yl([B("mesh")],u.Eden);class et{}o(et,"REMOTE",new cr("mesh.mpc.address")),o(et,"REMOTE_NAME",new cr("mesh.mpc.remote.name")),o(et,"INVOCATION",new cr("mesh.invocation")),o(et,"UNAME",new cr("mesh.mpc.uname")),o(et,"CONSUMER",new cr("mesh.mpc.consumer")),o(et,"CODEC",new cr("mesh.mpc.codec")),o(et,"TIMEOUT",new cr("mesh.mpc.timeout"));class tr{constructor(e,t){o(this,"code");o(this,"name");this.code=e,this.name=t}}const Re=class Re{static ofProto(e){for(let t of Re.PROTO)if(t.code==e)return t;return Re.HTTP}static ofCodec(e){for(let t of Re.CODEC)if(t.code==e)return t;return Re.JSON}static ofName(e){for(let t of Re.PROTO)if(t.name==e)return t;for(let t of Re.CODEC)if(t.name==e)return t;return Re.HTTP}};o(Re,"HTTP",new tr("00",u.Consumer.HTTP)),o(Re,"GRPC",new tr("01",u.Consumer.GRPC)),o(Re,"MQTT",new tr("02",u.Consumer.MQTT)),o(Re,"TCP",new tr("03",u.Consumer.TCP)),o(Re,"JSON",new tr("00",u.Codec.JSON)),o(Re,"PROTOBUF",new tr("01",u.Codec.PROTOBUF)),o(Re,"XML",new tr("02",u.Codec.XML)),o(Re,"THRIFT",new tr("03",u.Codec.THRIFT)),o(Re,"YAML",new tr("04",u.Codec.YAML)),o(Re,"PROTO",[Re.HTTP,Re.GRPC,Re.MQTT,Re.TCP]),o(Re,"CODEC",[Re.JSON,Re.PROTOBUF,Re.XML,Re.THRIFT,Re.YAML]);let Dn=Re;const Ql=r=>{const e=b();return e.setAttribute(et.CONSUMER,tt.load(u.Consumer).get(r)),e},Zl=r=>{const e=b();return e.setAttribute(et.CODEC,tt.load(u.Codec).get(r)),e};class $y{constructor(e,t){o(this,"inspector");o(this,"reference");o(this,"service");this.reference=new Nn,this.reference.urn=t.toString(),this.reference.namespace="",this.reference.name=t.name,this.reference.version=t.flag.version,this.reference.proto=Dn.ofProto(t.flag.proto).name,this.reference.codec=Dn.ofCodec(t.flag.codec).name,this.reference.flags=0,this.reference.timeout=parseInt(yo.MESH_TIMEOUT.get(e))||1e4,this.reference.retries=3,this.reference.mdc=t.mdc,this.reference.zone=t.flag.zone,this.reference.cluster=t.flag.cluster,this.reference.cell=t.flag.cell,this.reference.group=t.flag.group,this.reference.address=t.flag.address,this.service=new Ht,this.inspector=new Uy(t)}inflect(e){return new ls}inspect(e){return this.inspector}intype(e){return ls}reflect(e){return new ms}retype(e){return ms}schema(e){return this.reference}}class Uy{constructor(e){o(this,"urn");this.urn=e}getType(){return Object}getAnnotation(e){}getName(){return this.urn.name}getParameters(){return[]}getReturnType(){return new or(Map)}getExecutable(){return()=>{}}getSymbol(){return this.urn.name}invoke(e,t){}}class ls extends Map{map(){return this}getArguments(){const e=[];return super.forEach((t,n)=>{n!="attachments"&&e.push(t)}),e}getAttachments(){var s;const e=((s=Object.getOwnPropertyDescriptor(this,"attachments"))==null?void 0:s.value)||new Map;if(e instanceof Map)return e;const t=tt.load(u.Codec).get(u.Codec.JSON),n=t.decode(t.encode(e),Map);return this.setAttachments(n),n}setArguments(e){}setAttachments(e){Object.assign(this,{attachments:xt})}}class ms extends Map{getCause(){var n;const e=(n=Object.getOwnPropertyDescriptor(this,"cause"))==null?void 0:n.value;if(!e||e instanceof xt)return e;const t=tt.load(u.Codec).get(u.Codec.JSON);return t.decode(t.encode(e),xt)}getCode(){var e;return(e=Object.getOwnPropertyDescriptor(this,"code"))==null?void 0:e.value}getContent(){var e;return(e=Object.getOwnPropertyDescriptor(this,"content"))==null?void 0:e.value}getMessage(){var e;return((e=Object.getOwnPropertyDescriptor(this,"message"))==null?void 0:e.value)||""}setCause(e){Object.assign(this,{cause:e})}setCode(e){Object.assign(this,{code:e})}setContent(e){Object.assign(this,{content:e})}setMessage(e){Object.assign(this,{message:e})}}var em=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};const Cy="PROVIDER",jo="CONSUMER";u.Filter=class{},u.Filter=em([B("*")],u.Filter);function gs(r,e){const t=tt.load(u.Filter).list().filter(n=>{const s=$e.metadata(mn,n==null?void 0:n.constructor,n==null?void 0:n.constructor);return!s||s.pattern==""||(s==null?void 0:s.pattern)==e}).sort((n,s)=>{var d,v;const i=((d=$e.metadata(mn,n==null?void 0:n.constructor,n==null?void 0:n.constructor))==null?void 0:d.priority)||0,a=((v=$e.metadata(mn,s==null?void 0:s.constructor,s==null?void 0:s.constructor))==null?void 0:v.priority)||0;return i==a?0:i<a?-1:1});return tm(r,t)}function tm(r,e){let t=r;for(let n=e.length-1;n>=0;n--){let s=e[n],i=t;t=new class{run(a,d){return s.invoke(a,i,d)}}}return t}var nm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class rm{constructor(){o(this,"beforeHooks",new q);o(this,"successHooks",new q);o(this,"failureHooks",new q)}}const bi=()=>{const r=Vr();return r.Mesh??(r.Mesh=new rm),r.Mesh};class im{onBefore(e,t){bi().beforeHooks.set(e,t)}onSuccess(e,t){bi().successHooks.set(e,t)}onFailure(e,t){bi().failureHooks.set(e,t)}before(){return bi().beforeHooks}success(){return bi().successHooks}failure(){return bi().failureHooks}}const wo=new im;u.HookFilter=class extends u.Filter{async invoke(e,t,n){try{for(const[i,a]of wo.before())await a(e,n);const s=await t.run(e,n);for(const[i,a]of wo.success())await a(e,n,s);return s}catch(s){for(const[i,a]of wo.failure())zs(s)?await a(e,n,s):await a(e,n,h.SYSTEM_ERROR);throw s}}},u.HookFilter=nm([B("hook",jo)],u.HookFilter);class Fy{constructor(e,t,n,s){o(this,"proxy");o(this,"inspector");o(this,"parameters");o(this,"execution");this.proxy=e,this.inspector=t,this.parameters=n,this.execution=s}getArguments(e){return this.parameters.getArguments()}getAttachments(e){return this.parameters.getAttachments()}getExecution(e){return this.execution}getInspector(e){return this.inspector}getParameters(e){return this.parameters}getProxy(e){return this.proxy}isAsync(e){return!1}}const rr=class rr{constructor(){o(this,"domain","");o(this,"mdc","");o(this,"flag",new Pr);o(this,"name","")}static from(e){const t=new rr;if(!e)return console.log(`Unresolved urn ${e}`),t;const n=t.asArray(e);return n.length<5?(console.log(`Unresolved urn ${e}`),t):(n.reverse(),t.domain=`${n.splice(1,1).join("")}.${n.splice(0,1).join("")}`,t.mdc=n.splice(0,1).join(""),t.flag=Pr.from(n.splice(0,1).join("")),t.name=n.join("."),t)}static urn(e){const t=new rr;return t.mdc=this.LocalMDC,t.flag=Pr.from("0001000000000000000000000000000000000"),t.name=e,t.domain=this.MESH_DOMAIN,t}proto(e){return this.flag.proto=e,this}codec(e){return this.flag.codec=e,this}toString(){const e=[],t=this.asArray(this.name);return t.reverse(),t.filter(n=>n).forEach(n=>e.push(n)),e.push(this.flag.toString()),e.push(this.mdc),e.push(_e.anyone(this.domain,rr.MESH_DOMAIN)),e.join(".")}asArray(e){const t=e.split("."),n=[],s=[];for(let i of t){if(i.startsWith("${")){s.push(i),s.push(".");continue}if(i.endsWith("}")){s.push(i),n.push(s.join("")),s.splice(0,s.length);continue}n.push(i)}return n}matchName(e){return e?e.endsWith(".*")&&e.startsWith(e.replace(".*","")):!1}resetFlag(e,t){return this.flag.proto=e,this.flag.codec=t,this}};o(rr,"CN","firmer"),o(rr,"MESH_DOMAIN",rr.CN+".tech"),o(rr,"LocalMDC","XX00000000000000");let nr=rr;class Pr{constructor(){o(this,"v","00");o(this,"proto","00");o(this,"codec","00");o(this,"version","000000");o(this,"zone","00");o(this,"cluster","00");o(this,"cell","00");o(this,"group","00");o(this,"address","000000000000");o(this,"port","00000")}static from(e){if(!e)return new Pr;const t=new Pr;return t.v=_e.substring(e,0,2),t.proto=_e.substring(e,2,2),t.codec=_e.substring(e,4,2),t.version=this.reduce(_e.substring(e,6,6),2),t.zone=_e.substring(e,12,2),t.cluster=_e.substring(e,14,2),t.cell=_e.substring(e,16,2),t.group=_e.substring(e,18,2),t.address=this.reduce(_e.substring(e,20,12),3),t.port=this.reduce(_e.substring(e,32,5),5),t}toString(){const e=this.padding(_e.anyone(this.v,""),2),t=this.padding(_e.anyone(this.proto,""),2),n=this.padding(_e.anyone(this.codec,""),2),s=this.paddingChain(_e.anyone(this.version,""),2,3),i=this.padding(_e.anyone(this.zone,""),2),a=this.padding(_e.anyone(this.cluster,""),2),d=this.padding(_e.anyone(this.cell,""),2),v=this.padding(_e.anyone(this.group,""),2),j=this.paddingChain(_e.anyone(this.address,""),3,4),R=this.padding(_e.anyone(this.port,""),5);return`${e}${t}${n}${s}${i}${a}${d}${v}${j}${R}`}padding(e,t){const n=e.replace(".","");return n.length==t?n:n.length<t?_e.repeat("0",t-e.length)+n:e.substring(0,t)}paddingChain(e,t,n){const s=e.split("[.*]"),i=s.map(a=>parseInt(a)?a:"");if(i.length==n)return i.map(a=>this.padding(a,t)).join("");if(i.length<n){for(let a=0;a<n-s.length;a++)i.push("");return i.map(a=>this.padding(a,t)).join("")}return i.slice(0,n).map(a=>this.padding(a,t)).join("")}static reduce(e,t){if(!e)return e;const n=[];for(let s=0;s<e.length;s+=t){let i=!0;for(let a=s;a<s+t;a++)e.charAt(a)!="0"&&(i=!1),i||n.push(e.charAt(a));i&&n.push("0"),n.push(".")}return n.slice(0,n.length-1).join("")}}class Dy{constructor(e){o(this,"placeholder","${mesh.name}");o(this,"macro");o(this,"invoker");this.macro=e,this.invoker=gs(this,jo)}context(e){if(!e||e.length<1)return b();for(let t of e)if(t instanceof fo)return t;return b()}invoke(e,t,n){return new Promise(async(s,i)=>{try{const a=this.context(n),d=this.referExecution(a,t),v=this.rewriteURN(a,d);a.rewriteURN(v),a.setAttribute(et.REMOTE,this.rewriteAddress(a,v));const j=d.inflect(a);j.setArguments(n),j.setAttachments(new Map);const R=new Fy(this,t,j,d);a.setAttribute(et.INVOCATION,R),s(await this.invoker.run(a,R))}catch(a){i(Ni.errorf(a))}})}async run(e,t){const n=this.referExecution(e,t.getInspector(e)),s=tt.load(u.Consumer),i=e.getAttribute(et.CONSUMER)??s.getDefault(),a=_e.anyone(e.getAttribute(et.REMOTE),_e.MESH_ADDRESS.get().any()),d=n.schema(e).codec||Dn.JSON.name,v=tt.load(u.Codec),j=e.getAttribute(et.CODEC)??v.get(d),R=j.encode(t.getParameters(e)),E=Dn.ofName(s.defaultName()).code,D=Dn.ofName(v.defaultName()).code,T=nr.from(e.getUrn()).resetFlag(E,D).toString(),w=await i.consume(e,a,T,n,R);return await this.deserialize(e,n,j,w)}deserialize(e,t,n,s){return new Promise((i,a)=>{try{const d=t.retype(e),v=n.decode(s,d);if(v.getCause()){a(Ni.errorf(v.getCause()));return}if(h.SUCCESS.getCode()!=v.getCode()){a(new oe(v.getCode(),v.getMessage()));return}i(v.getContent())}catch(d){a(Ni.errorf(d))}})}referExecution(e,t){const s=tt.load(u.Eden).getDefault().refer(e,t.getAnnotation(Ge),t.getType(),t);if(s)return s;throw new Error(`Method ${t.getName()} cant be compatible`)}rewriteURN(e,t){var d;const n=(d=e.getPrincipals().peek())==null?void 0:d.id,s=e.getAttribute(et.UNAME),i=e.getAttribute(et.REMOTE_NAME);if(!n&&!s&&!i&&!t.schema(e).urn.includes(this.placeholder))return t.schema(e).urn;const a=nr.from(t.schema(e).urn);return n&&n!=""&&(a.mdc=n),s&&s!=""&&(a.name=s),i&&i!=""&&(a.name=a.name.replace(this.placeholder,i)),a.name.includes(this.placeholder)&&(a.name=a.name.replace(this.placeholder,"mesh")),a.toString()}rewriteAddress(e,t){const n=e.getAttribute(et.REMOTE);return n&&n!=""?n:_e.MESH_ADDRESS.get().any()}}var om=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i},hs;u.ServiceProxy=hs=class extends u.MethodProxy{proxy(e){return hs.proxy(e)}static proxy(e){return this.doProxy(e,S(""))}static doProxy(e,t){return wi.newProxyInstance(e,new Dy(t))}},u.ServiceProxy=hs=om([B("mesh")],u.ServiceProxy);class sm{constructor(e){o(this,"service");this.service=e}run(e,t){return new Promise((n,s)=>{try{const i=[e,...t.getArguments(e)],a=t.getInspector(e).invoke(this.service,i);if(a instanceof Promise){a.then(d=>n(d)).catch(d=>s(d));return}n(a)}catch(i){s(i)}})}}class ky{constructor(e){o(this,"invoker");this.invoker=gs(new sm(e),Cy)}run(e,t){return this.invoker.run(e,t)}}var cm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class am{constructor(e,t,n){o(this,"making");o(this,"kind");o(this,"service");this.making=e,this.kind=t,this.service=n}}class dm{constructor(e,t){o(this,"metadata");o(this,"reference");o(this,"proxy");this.metadata=e,this.reference=t,this.proxy=u.ServiceProxy.doProxy(t,e)}}class um{constructor(e,t,n,s,i){o(this,"urn");o(this,"kind");o(this,"method");o(this,"target");o(this,"resource");o(this,"inspector");o(this,"invoker");o(this,"__intype");o(this,"__retype");this.urn=e,this.kind=t,this.method=n,this.target=s,this.resource=i,this.inspector=n,this.invoker=new ky(s),this.__intype=tt.load(u.Compiler).getDefault().intype(n),this.__retype=tt.load(u.Compiler).getDefault().retype(n)}inflect(e){return new this.__intype}inspect(e){return this.inspector}intype(e){return this.__intype}reflect(e){return new this.__retype}retype(e){return this.__retype}schema(e){return this.resource}}u.MeshEden=class extends u.Eden{constructor(){super(...arguments);o(this,"providers",new q);o(this,"consumers",new q);o(this,"indies",new q);o(this,"services",new q);o(this,"references",new q)}define(t,n,s){return this.makeConsumer(t,n,s).proxy}store(t,n,s){this.providers.set(n,new am(!1,n,s))}infer(t,n){const s=nr.from(n),i=this.makeServiceExecution(this.getEnviron(t)),a=i==null?void 0:i.get(s.name);if(a)return a;for(let d of i.entries())if(s.matchName(d[0]))return d[1];return new $y(t,s)}refer(t,n,s,i){const a=this.makeConsumer(t,n,s),d=this.getEnviron(t),v=this.indies.computeIfy(s,j=>new q).computeIfy(n,j=>{const R=new q;return this.getMethods(t,s).forEach((E,D)=>E.forEach(T=>{const w=this.makeMethodAsReference(d,n,D,T),M=new um(w.urn,s,T,a.proxy,w);this.references.set(w.urn,M),R.set(T,M)})),R}).get(i);if(v)return v;throw new Error(`Method ${i.getName()} cant be compatible`)}inferTypes(t){const n=[];for(let s of this.providers)n.push(s[1].kind);return n}referTypes(t){const n=[];for(let s of this.consumers.keys())n.push(s);return n}makeConsumer(t,n,s){return this.consumers.computeIfy(s,i=>new q).computeIfy(n,i=>new dm(n,s))}makeMethodAsReference(t,n,s,i){var d,v,j,R,E,D,T,w,M,A,X,Y,ae;const a=new Nn;return a.namespace=s.name,a.name=i.getName(),a.version=((d=i.getAnnotation(Ge))==null?void 0:d.version)||"",a.proto=((v=i.getAnnotation(Ge))==null?void 0:v.proto)||"",a.codec=((j=i.getAnnotation(Ge))==null?void 0:j.codec)||"",a.flags=((R=i.getAnnotation(Ge))==null?void 0:R.flags)||0,a.timeout=((E=i.getAnnotation(Ge))==null?void 0:E.timeout)||12e3,a.retries=((D=i.getAnnotation(Ge))==null?void 0:D.retries)||0,a.mdc=((T=i.getAnnotation(Ge))==null?void 0:T.mdc)||"",a.zone=((w=i.getAnnotation(Ge))==null?void 0:w.zone)||"",a.cluster=((M=i.getAnnotation(Ge))==null?void 0:M.cluster)||"",a.cell=((A=i.getAnnotation(Ge))==null?void 0:A.cell)||"",a.group=((X=i.getAnnotation(Ge))==null?void 0:X.group)||"",a.address=((Y=i.getAnnotation(Ge))==null?void 0:Y.address)||"",a.urn=this.getURN(((ae=i.getAnnotation(Ge))==null?void 0:ae.name)||"",Ht,t),a}getURN(t,n,s){const i=new nr;return i.domain=nr.MESH_DOMAIN,i.mdc=_e.anyone(n.mdc,s.mdc),i.name=t,i.flag=this.getURNFlag(n),i.toString()}getURNFlag(t){const n=(t.address||"").split(":"),s=new Pr;return s.v="00",s.proto=Dn.ofName(t.proto).code,s.codec=Dn.ofName(t.codec).code,s.version=t.version,s.zone=t.zone,s.cluster=t.cluster,s.cell=t.cell,s.group=t.group,s.address=n.length>0?n[0]:"",s.port=n.length>1?n[1]:"",s}getMethods(t,n){const s=wi.getMethods(n),i=new q;return i.set(n,s),i}getEnviron(t){const n=new Ke;return n.mdc=nr.LocalMDC,n}makeServiceExecution(t){for(let n of this.providers)n[1].making;return this.services}},u.MeshEden=cm([B("mesh")],u.MeshEden);var pm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};const bs="mock";u.MockFilter=class extends u.Filter{async invoke(e,t,n){if(!po.Mock.matches(e.getRunMode())&&!ao.Mock.enable())return await t.run(e,n);const s=tt.load(n.getInspector(e).getType()).want(bs);if(!s)return await t.run(e,n);const i=s[n.getInspector(e).getName()];return!i||typeof i!="function"?await t.run(e,n):await i(n.getArguments(e))}},u.MockFilter=pm([B(bs,jo)],u.MockFilter);var fm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.Provider=class{},u.Provider=fm([B(u.Consumer.GRPC)],u.Provider);var ym=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.GRPCConsumer=class extends u.Consumer{start(){}close(){}consume(e,t,n,s,i){return Promise.reject(h.URN_NOT_PERMIT)}},u.GRPCConsumer=ym([B(u.Consumer.GRPC)],u.GRPCConsumer);var lm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.GRPCProvider=class extends u.Provider{start(){}close(){}},u.GRPCProvider=lm([B(u.Consumer.GRPC)],u.GRPCProvider);function xy(r,e){return function(){return r.apply(e,arguments)}}const{toString:mm}=Object.prototype,{getPrototypeOf:_s}=Object,{iterator:Eo,toStringTag:By}=Symbol,No=(r=>e=>{const t=mm.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),_n=r=>(r=r.toLowerCase(),e=>No(e)===r),To=r=>e=>typeof e===r,{isArray:_i}=Array,Qi=To("undefined");function gm(r){return r!==null&&!Qi(r)&&r.constructor!==null&&!Qi(r.constructor)&&Kt(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Ly=_n("ArrayBuffer");function hm(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Ly(r.buffer),e}const bm=To("string"),Kt=To("function"),Hy=To("number"),Ao=r=>r!==null&&typeof r=="object",_m=r=>r===!0||r===!1,Mo=r=>{if(No(r)!=="object")return!1;const e=_s(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(By in r)&&!(Eo in r)},Sm=_n("Date"),vm=_n("File"),Om=_n("Blob"),Rm=_n("FileList"),Pm=r=>Ao(r)&&Kt(r.pipe),jm=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Kt(r.append)&&((e=No(r))==="formdata"||e==="object"&&Kt(r.toString)&&r.toString()==="[object FormData]"))},wm=_n("URLSearchParams"),[Em,Nm,Tm,Am]=["ReadableStream","Request","Response","Headers"].map(_n),Mm=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zi(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,s;if(typeof r!="object"&&(r=[r]),_i(r))for(n=0,s=r.length;n<s;n++)e.call(null,r[n],n,r);else{const i=t?Object.getOwnPropertyNames(r):Object.keys(r),a=i.length;let d;for(n=0;n<a;n++)d=i[n],e.call(null,r[d],d,r)}}function qy(r,e){e=e.toLowerCase();const t=Object.keys(r);let n=t.length,s;for(;n-- >0;)if(s=t[n],e===s.toLowerCase())return s;return null}const Lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zy=r=>!Qi(r)&&r!==Lr;function Ss(){const{caseless:r}=zy(this)&&this||{},e={},t=(n,s)=>{const i=r&&qy(e,s)||s;Mo(e[i])&&Mo(n)?e[i]=Ss(e[i],n):Mo(n)?e[i]=Ss({},n):_i(n)?e[i]=n.slice():e[i]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&Zi(arguments[n],t);return e}const Im=(r,e,t,{allOwnKeys:n}={})=>(Zi(e,(s,i)=>{t&&Kt(s)?r[i]=xy(s,t):r[i]=s},{allOwnKeys:n}),r),$m=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Um=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},Cm=(r,e,t,n)=>{let s,i,a;const d={};if(e=e||{},r==null)return e;do{for(s=Object.getOwnPropertyNames(r),i=s.length;i-- >0;)a=s[i],(!n||n(a,r,e))&&!d[a]&&(e[a]=r[a],d[a]=!0);r=t!==!1&&_s(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},Fm=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},Dm=r=>{if(!r)return null;if(_i(r))return r;let e=r.length;if(!Hy(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},km=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&_s(Uint8Array)),xm=(r,e)=>{const n=(r&&r[Eo]).call(r);let s;for(;(s=n.next())&&!s.done;){const i=s.value;e.call(r,i[0],i[1])}},Bm=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},Lm=_n("HTMLFormElement"),Hm=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,s){return n.toUpperCase()+s}),Vy=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),qm=_n("RegExp"),Gy=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};Zi(t,(s,i)=>{let a;(a=e(s,i,r))!==!1&&(n[i]=a||s)}),Object.defineProperties(r,n)},zm=r=>{Gy(r,(e,t)=>{if(Kt(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(Kt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Vm=(r,e)=>{const t={},n=s=>{s.forEach(i=>{t[i]=!0})};return _i(r)?n(r):n(String(r).split(e)),t},Gm=()=>{},Wm=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function Km(r){return!!(r&&Kt(r.append)&&r[By]==="FormData"&&r[Eo])}const Jm=r=>{const e=new Array(10),t=(n,s)=>{if(Ao(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[s]=n;const i=_i(n)?[]:{};return Zi(n,(a,d)=>{const v=t(a,s+1);!Qi(v)&&(i[d]=v)}),e[s]=void 0,i}}return n};return t(r,0)},Xm=_n("AsyncFunction"),Ym=r=>r&&(Ao(r)||Kt(r))&&Kt(r.then)&&Kt(r.catch),Wy=((r,e)=>r?setImmediate:e?((t,n)=>(Lr.addEventListener("message",({source:s,data:i})=>{s===Lr&&i===t&&n.length&&n.shift()()},!1),s=>{n.push(s),Lr.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Kt(Lr.postMessage)),Qm=typeof queueMicrotask<"u"?queueMicrotask.bind(Lr):typeof process<"u"&&process.nextTick||Wy,P={isArray:_i,isArrayBuffer:Ly,isBuffer:gm,isFormData:jm,isArrayBufferView:hm,isString:bm,isNumber:Hy,isBoolean:_m,isObject:Ao,isPlainObject:Mo,isReadableStream:Em,isRequest:Nm,isResponse:Tm,isHeaders:Am,isUndefined:Qi,isDate:Sm,isFile:vm,isBlob:Om,isRegExp:qm,isFunction:Kt,isStream:Pm,isURLSearchParams:wm,isTypedArray:km,isFileList:Rm,forEach:Zi,merge:Ss,extend:Im,trim:Mm,stripBOM:$m,inherits:Um,toFlatObject:Cm,kindOf:No,kindOfTest:_n,endsWith:Fm,toArray:Dm,forEachEntry:xm,matchAll:Bm,isHTMLForm:Lm,hasOwnProperty:Vy,hasOwnProp:Vy,reduceDescriptors:Gy,freezeMethods:zm,toObjectSet:Vm,toCamelCase:Hm,noop:Gm,toFiniteNumber:Wm,findKey:qy,global:Lr,isContextDefined:zy,isSpecCompliantForm:Km,toJSONObject:Jm,isAsyncFn:Xm,isThenable:Ym,setImmediate:Wy,asap:Qm,isIterable:r=>r!=null&&Kt(r[Eo])};function ie(r,e,t,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}P.inherits(ie,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.status}}});const Ky=ie.prototype,Jy={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Jy[r]={value:r}}),Object.defineProperties(ie,Jy),Object.defineProperty(Ky,"isAxiosError",{value:!0}),ie.from=(r,e,t,n,s,i)=>{const a=Object.create(Ky);return P.toFlatObject(r,a,function(v){return v!==Error.prototype},d=>d!=="isAxiosError"),ie.call(a,r.message,e,t,n,s),a.cause=r,a.name=r.name,i&&Object.assign(a,i),a};const Zm=null;function vs(r){return P.isPlainObject(r)||P.isArray(r)}function Xy(r){return P.endsWith(r,"[]")?r.slice(0,-2):r}function Yy(r,e,t){return r?r.concat(e).map(function(s,i){return s=Xy(s),!t&&i?"["+s+"]":s}).join(t?".":""):e}function eg(r){return P.isArray(r)&&!r.some(vs)}const tg=P.toFlatObject(P,{},null,function(e){return/^is[A-Z]/.test(e)});function Io(r,e,t){if(!P.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=P.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(M,A){return!P.isUndefined(A[M])});const n=t.metaTokens,s=t.visitor||R,i=t.dots,a=t.indexes,v=(t.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(e);if(!P.isFunction(s))throw new TypeError("visitor must be a function");function j(w){if(w===null)return"";if(P.isDate(w))return w.toISOString();if(!v&&P.isBlob(w))throw new ie("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(w)||P.isTypedArray(w)?v&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function R(w,M,A){let X=w;if(w&&!A&&typeof w=="object"){if(P.endsWith(M,"{}"))M=n?M:M.slice(0,-2),w=JSON.stringify(w);else if(P.isArray(w)&&eg(w)||(P.isFileList(w)||P.endsWith(M,"[]"))&&(X=P.toArray(w)))return M=Xy(M),X.forEach(function(ae,ot){!(P.isUndefined(ae)||ae===null)&&e.append(a===!0?Yy([M],ot,i):a===null?M:M+"[]",j(ae))}),!1}return vs(w)?!0:(e.append(Yy(A,M,i),j(w)),!1)}const E=[],D=Object.assign(tg,{defaultVisitor:R,convertValue:j,isVisitable:vs});function T(w,M){if(!P.isUndefined(w)){if(E.indexOf(w)!==-1)throw Error("Circular reference detected in "+M.join("."));E.push(w),P.forEach(w,function(X,Y){(!(P.isUndefined(X)||X===null)&&s.call(e,X,P.isString(Y)?Y.trim():Y,M,D))===!0&&T(X,M?M.concat(Y):[Y])}),E.pop()}}if(!P.isObject(r))throw new TypeError("data must be an object");return T(r),e}function Qy(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Os(r,e){this._pairs=[],r&&Io(r,this,e)}const Zy=Os.prototype;Zy.append=function(e,t){this._pairs.push([e,t])},Zy.toString=function(e){const t=e?function(n){return e.call(this,n,Qy)}:Qy;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function ng(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function el(r,e,t){if(!e)return r;const n=t&&t.encode||ng;P.isFunction(t)&&(t={serialize:t});const s=t&&t.serialize;let i;if(s?i=s(e,t):i=P.isURLSearchParams(e)?e.toString():new Os(e,t).toString(n),i){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+i}return r}class tl{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){P.forEach(this.handlers,function(n){n!==null&&e(n)})}}const nl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rg={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Os,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Rs=typeof window<"u"&&typeof document<"u",Ps=typeof navigator=="object"&&navigator||void 0,ig=Rs&&(!Ps||["ReactNative","NativeScript","NS"].indexOf(Ps.product)<0),og=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",sg=Rs&&window.location.href||"http://localhost",St={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rs,hasStandardBrowserEnv:ig,hasStandardBrowserWebWorkerEnv:og,navigator:Ps,origin:sg},Symbol.toStringTag,{value:"Module"})),...rg};function cg(r,e){return Io(r,new St.classes.URLSearchParams,Object.assign({visitor:function(t,n,s,i){return St.isNode&&P.isBuffer(t)?(this.append(n,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function ag(r){return P.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function dg(r){const e={},t=Object.keys(r);let n;const s=t.length;let i;for(n=0;n<s;n++)i=t[n],e[i]=r[i];return e}function rl(r){function e(t,n,s,i){let a=t[i++];if(a==="__proto__")return!0;const d=Number.isFinite(+a),v=i>=t.length;return a=!a&&P.isArray(s)?s.length:a,v?(P.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!d):((!s[a]||!P.isObject(s[a]))&&(s[a]=[]),e(t,n,s[a],i)&&P.isArray(s[a])&&(s[a]=dg(s[a])),!d)}if(P.isFormData(r)&&P.isFunction(r.entries)){const t={};return P.forEachEntry(r,(n,s)=>{e(ag(n),s,t,0)}),t}return null}function ug(r,e,t){if(P.isString(r))try{return(e||JSON.parse)(r),P.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const eo={transitional:nl,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=P.isObject(e);if(i&&P.isHTMLForm(e)&&(e=new FormData(e)),P.isFormData(e))return s?JSON.stringify(rl(e)):e;if(P.isArrayBuffer(e)||P.isBuffer(e)||P.isStream(e)||P.isFile(e)||P.isBlob(e)||P.isReadableStream(e))return e;if(P.isArrayBufferView(e))return e.buffer;if(P.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return cg(e,this.formSerializer).toString();if((d=P.isFileList(e))||n.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return Io(d?{"files[]":e}:e,v&&new v,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),ug(e)):e}],transformResponse:[function(e){const t=this.transitional||eo.transitional,n=t&&t.forcedJSONParsing,s=this.responseType==="json";if(P.isResponse(e)||P.isReadableStream(e))return e;if(e&&P.isString(e)&&(n&&!this.responseType||s)){const a=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(d){if(a)throw d.name==="SyntaxError"?ie.from(d,ie.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:St.classes.FormData,Blob:St.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],r=>{eo.headers[r]={}});const pg=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fg=r=>{const e={};let t,n,s;return r&&r.split(`
19
+ */var Ay;function Vl(){return Ay||(Ay=1,function(r){const e=ql(),t=zl(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=d,r.SlowBuffer=Y,r.INSPECT_MAX_BYTES=50;const s=2147483647;r.kMaxLength=s,d.TYPED_ARRAY_SUPPORT=i(),!d.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{const y=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(y,p),y.foo()===42}catch{return!1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function a(y){if(y>s)throw new RangeError('The value "'+y+'" is invalid for option "size"');const p=new Uint8Array(y);return Object.setPrototypeOf(p,d.prototype),p}function d(y,p,f){if(typeof y=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(y)}return v(y,p,f)}d.poolSize=8192;function v(y,p,f){if(typeof y=="string")return D(y,p);if(ArrayBuffer.isView(y))return w(y);if(y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y);if(Yt(y,ArrayBuffer)||y&&Yt(y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Yt(y,SharedArrayBuffer)||y&&Yt(y.buffer,SharedArrayBuffer)))return M(y,p,f);if(typeof y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const m=y.valueOf&&y.valueOf();if(m!=null&&m!==y)return d.from(m,p,f);const _=A(y);if(_)return _;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof y[Symbol.toPrimitive]=="function")return d.from(y[Symbol.toPrimitive]("string"),p,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y)}d.from=function(y,p,f){return v(y,p,f)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array);function j(y){if(typeof y!="number")throw new TypeError('"size" argument must be of type number');if(y<0)throw new RangeError('The value "'+y+'" is invalid for option "size"')}function R(y,p,f){return j(y),y<=0?a(y):p!==void 0?typeof f=="string"?a(y).fill(p,f):a(y).fill(p):a(y)}d.alloc=function(y,p,f){return R(y,p,f)};function E(y){return j(y),a(y<0?0:X(y)|0)}d.allocUnsafe=function(y){return E(y)},d.allocUnsafeSlow=function(y){return E(y)};function D(y,p){if((typeof p!="string"||p==="")&&(p="utf8"),!d.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const f=ae(y,p)|0;let m=a(f);const _=m.write(y,p);return _!==f&&(m=m.slice(0,_)),m}function T(y){const p=y.length<0?0:X(y.length)|0,f=a(p);for(let m=0;m<p;m+=1)f[m]=y[m]&255;return f}function w(y){if(Yt(y,Uint8Array)){const p=new Uint8Array(y);return M(p.buffer,p.byteOffset,p.byteLength)}return T(y)}function M(y,p,f){if(p<0||y.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(y.byteLength<p+(f||0))throw new RangeError('"length" is outside of buffer bounds');let m;return p===void 0&&f===void 0?m=new Uint8Array(y):f===void 0?m=new Uint8Array(y,p):m=new Uint8Array(y,p,f),Object.setPrototypeOf(m,d.prototype),m}function A(y){if(d.isBuffer(y)){const p=X(y.length)|0,f=a(p);return f.length===0||y.copy(f,0,0,p),f}if(y.length!==void 0)return typeof y.length!="number"||co(y.length)?a(0):T(y);if(y.type==="Buffer"&&Array.isArray(y.data))return T(y.data)}function X(y){if(y>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return y|0}function Y(y){return+y!=y&&(y=0),d.alloc(+y)}d.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==d.prototype},d.compare=function(p,f){if(Yt(p,Uint8Array)&&(p=d.from(p,p.offset,p.byteLength)),Yt(f,Uint8Array)&&(f=d.from(f,f.offset,f.byteLength)),!d.isBuffer(p)||!d.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===f)return 0;let m=p.length,_=f.length;for(let l=0,g=Math.min(m,_);l<g;++l)if(p[l]!==f[l]){m=p[l],_=f[l];break}return m<_?-1:_<m?1:0},d.isEncoding=function(p){switch(String(p).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(p,f){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return d.alloc(0);let m;if(f===void 0)for(f=0,m=0;m<p.length;++m)f+=p[m].length;const _=d.allocUnsafe(f);let l=0;for(m=0;m<p.length;++m){let g=p[m];if(Yt(g,Uint8Array))l+g.length>_.length?(d.isBuffer(g)||(g=d.from(g)),g.copy(_,l)):Uint8Array.prototype.set.call(_,g,l);else if(d.isBuffer(g))g.copy(_,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=g.length}return _};function ae(y,p){if(d.isBuffer(y))return y.length;if(ArrayBuffer.isView(y)||Yt(y,ArrayBuffer))return y.byteLength;if(typeof y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof y);const f=y.length,m=arguments.length>2&&arguments[2]===!0;if(!m&&f===0)return 0;let _=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Pi(y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return so(y).length;default:if(_)return m?-1:Pi(y).length;p=(""+p).toLowerCase(),_=!0}}d.byteLength=ae;function ot(y,p,f){let m=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,p>>>=0,f<=p))return"";for(y||(y="utf8");;)switch(y){case"hex":return Vo(this,p,f);case"utf8":case"utf-8":return Ho(this,p,f);case"ascii":return qo(this,p,f);case"latin1":case"binary":return zo(this,p,f);case"base64":return Cs(this,p,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Go(this,p,f);default:if(m)throw new TypeError("Unknown encoding: "+y);y=(y+"").toLowerCase(),m=!0}}d.prototype._isBuffer=!0;function de(y,p,f){const m=y[p];y[p]=y[f],y[f]=m}d.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<p;f+=2)de(this,f,f+1);return this},d.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<p;f+=4)de(this,f,f+3),de(this,f+1,f+2);return this},d.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<p;f+=8)de(this,f,f+7),de(this,f+1,f+6),de(this,f+2,f+5),de(this,f+3,f+4);return this},d.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?Ho(this,0,p):ot.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(p){if(!d.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:d.compare(this,p)===0},d.prototype.inspect=function(){let p="";const f=r.INSPECT_MAX_BYTES;return p=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(p+=" ... "),"<Buffer "+p+">"},n&&(d.prototype[n]=d.prototype.inspect),d.prototype.compare=function(p,f,m,_,l){if(Yt(p,Uint8Array)&&(p=d.from(p,p.offset,p.byteLength)),!d.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(f===void 0&&(f=0),m===void 0&&(m=p?p.length:0),_===void 0&&(_=0),l===void 0&&(l=this.length),f<0||m>p.length||_<0||l>this.length)throw new RangeError("out of range index");if(_>=l&&f>=m)return 0;if(_>=l)return-1;if(f>=m)return 1;if(f>>>=0,m>>>=0,_>>>=0,l>>>=0,this===p)return 0;let g=l-_,O=m-f;const N=Math.min(g,O),I=this.slice(_,l),ee=p.slice(f,m);for(let J=0;J<N;++J)if(I[J]!==ee[J]){g=I[J],O=ee[J];break}return g<O?-1:O<g?1:0};function tn(y,p,f,m,_){if(y.length===0)return-1;if(typeof f=="string"?(m=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,co(f)&&(f=_?0:y.length-1),f<0&&(f=y.length+f),f>=y.length){if(_)return-1;f=y.length-1}else if(f<0)if(_)f=0;else return-1;if(typeof p=="string"&&(p=d.from(p,m)),d.isBuffer(p))return p.length===0?-1:yn(y,p,f,m,_);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(y,p,f):Uint8Array.prototype.lastIndexOf.call(y,p,f):yn(y,[p],f,m,_);throw new TypeError("val must be string, number or Buffer")}function yn(y,p,f,m,_){let l=1,g=y.length,O=p.length;if(m!==void 0&&(m=String(m).toLowerCase(),m==="ucs2"||m==="ucs-2"||m==="utf16le"||m==="utf-16le")){if(y.length<2||p.length<2)return-1;l=2,g/=2,O/=2,f/=2}function N(ee,J){return l===1?ee[J]:ee.readUInt16BE(J*l)}let I;if(_){let ee=-1;for(I=f;I<g;I++)if(N(y,I)===N(p,ee===-1?0:I-ee)){if(ee===-1&&(ee=I),I-ee+1===O)return ee*l}else ee!==-1&&(I-=I-ee),ee=-1}else for(f+O>g&&(f=g-O),I=f;I>=0;I--){let ee=!0;for(let J=0;J<O;J++)if(N(y,I+J)!==N(p,J)){ee=!1;break}if(ee)return I}return-1}d.prototype.includes=function(p,f,m){return this.indexOf(p,f,m)!==-1},d.prototype.indexOf=function(p,f,m){return tn(this,p,f,m,!0)},d.prototype.lastIndexOf=function(p,f,m){return tn(this,p,f,m,!1)};function Nr(y,p,f,m){f=Number(f)||0;const _=y.length-f;m?(m=Number(m),m>_&&(m=_)):m=_;const l=p.length;m>l/2&&(m=l/2);let g;for(g=0;g<m;++g){const O=parseInt(p.substr(g*2,2),16);if(co(O))return g;y[f+g]=O}return g}function Oi(y,p,f,m){return zr(Pi(p,y.length-f),y,f,m)}function Is(y,p,f,m){return zr(Xo(p),y,f,m)}function $s(y,p,f,m){return zr(so(p),y,f,m)}function Us(y,p,f,m){return zr(Yo(p,y.length-f),y,f,m)}d.prototype.write=function(p,f,m,_){if(f===void 0)_="utf8",m=this.length,f=0;else if(m===void 0&&typeof f=="string")_=f,m=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(m)?(m=m>>>0,_===void 0&&(_="utf8")):(_=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const l=this.length-f;if((m===void 0||m>l)&&(m=l),p.length>0&&(m<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");let g=!1;for(;;)switch(_){case"hex":return Nr(this,p,f,m);case"utf8":case"utf-8":return Oi(this,p,f,m);case"ascii":case"latin1":case"binary":return Is(this,p,f,m);case"base64":return $s(this,p,f,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Us(this,p,f,m);default:if(g)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),g=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Cs(y,p,f){return p===0&&f===y.length?e.fromByteArray(y):e.fromByteArray(y.slice(p,f))}function Ho(y,p,f){f=Math.min(y.length,f);const m=[];let _=p;for(;_<f;){const l=y[_];let g=null,O=l>239?4:l>223?3:l>191?2:1;if(_+O<=f){let N,I,ee,J;switch(O){case 1:l<128&&(g=l);break;case 2:N=y[_+1],(N&192)===128&&(J=(l&31)<<6|N&63,J>127&&(g=J));break;case 3:N=y[_+1],I=y[_+2],(N&192)===128&&(I&192)===128&&(J=(l&15)<<12|(N&63)<<6|I&63,J>2047&&(J<55296||J>57343)&&(g=J));break;case 4:N=y[_+1],I=y[_+2],ee=y[_+3],(N&192)===128&&(I&192)===128&&(ee&192)===128&&(J=(l&15)<<18|(N&63)<<12|(I&63)<<6|ee&63,J>65535&&J<1114112&&(g=J))}}g===null?(g=65533,O=1):g>65535&&(g-=65536,m.push(g>>>10&1023|55296),g=56320|g&1023),m.push(g),_+=O}return ro(m)}const no=4096;function ro(y){const p=y.length;if(p<=no)return String.fromCharCode.apply(String,y);let f="",m=0;for(;m<p;)f+=String.fromCharCode.apply(String,y.slice(m,m+=no));return f}function qo(y,p,f){let m="";f=Math.min(y.length,f);for(let _=p;_<f;++_)m+=String.fromCharCode(y[_]&127);return m}function zo(y,p,f){let m="";f=Math.min(y.length,f);for(let _=p;_<f;++_)m+=String.fromCharCode(y[_]);return m}function Vo(y,p,f){const m=y.length;(!p||p<0)&&(p=0),(!f||f<0||f>m)&&(f=m);let _="";for(let l=p;l<f;++l)_+=Ds[y[l]];return _}function Go(y,p,f){const m=y.slice(p,f);let _="";for(let l=0;l<m.length-1;l+=2)_+=String.fromCharCode(m[l]+m[l+1]*256);return _}d.prototype.slice=function(p,f){const m=this.length;p=~~p,f=f===void 0?m:~~f,p<0?(p+=m,p<0&&(p=0)):p>m&&(p=m),f<0?(f+=m,f<0&&(f=0)):f>m&&(f=m),f<p&&(f=p);const _=this.subarray(p,f);return Object.setPrototypeOf(_,d.prototype),_};function Qe(y,p,f){if(y%1!==0||y<0)throw new RangeError("offset is not uint");if(y+p>f)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=this[p],l=1,g=0;for(;++g<f&&(l*=256);)_+=this[p+g]*l;return _},d.prototype.readUintBE=d.prototype.readUIntBE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=this[p+--f],l=1;for(;f>0&&(l*=256);)_+=this[p+--f]*l;return _},d.prototype.readUint8=d.prototype.readUInt8=function(p,f){return p=p>>>0,f||Qe(p,1,this.length),this[p]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(p,f){return p=p>>>0,f||Qe(p,2,this.length),this[p]|this[p+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(p,f){return p=p>>>0,f||Qe(p,2,this.length),this[p]<<8|this[p+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},d.prototype.readBigUInt64LE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=f+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,l=this[++p]+this[++p]*2**8+this[++p]*2**16+m*2**24;return BigInt(_)+(BigInt(l)<<BigInt(32))}),d.prototype.readBigUInt64BE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=f*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],l=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+m;return(BigInt(_)<<BigInt(32))+BigInt(l)}),d.prototype.readIntLE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=this[p],l=1,g=0;for(;++g<f&&(l*=256);)_+=this[p+g]*l;return l*=128,_>=l&&(_-=Math.pow(2,8*f)),_},d.prototype.readIntBE=function(p,f,m){p=p>>>0,f=f>>>0,m||Qe(p,f,this.length);let _=f,l=1,g=this[p+--_];for(;_>0&&(l*=256);)g+=this[p+--_]*l;return l*=128,g>=l&&(g-=Math.pow(2,8*f)),g},d.prototype.readInt8=function(p,f){return p=p>>>0,f||Qe(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},d.prototype.readInt16LE=function(p,f){p=p>>>0,f||Qe(p,2,this.length);const m=this[p]|this[p+1]<<8;return m&32768?m|4294901760:m},d.prototype.readInt16BE=function(p,f){p=p>>>0,f||Qe(p,2,this.length);const m=this[p+1]|this[p]<<8;return m&32768?m|4294901760:m},d.prototype.readInt32LE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},d.prototype.readInt32BE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},d.prototype.readBigInt64LE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(m<<24);return(BigInt(_)<<BigInt(32))+BigInt(f+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),d.prototype.readBigInt64BE=xn(function(p){p=p>>>0,Sn(p,"offset");const f=this[p],m=this[p+7];(f===void 0||m===void 0)&&Ar(p,this.length-8);const _=(f<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(_)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+m)}),d.prototype.readFloatLE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),t.read(this,p,!0,23,4)},d.prototype.readFloatBE=function(p,f){return p=p>>>0,f||Qe(p,4,this.length),t.read(this,p,!1,23,4)},d.prototype.readDoubleLE=function(p,f){return p=p>>>0,f||Qe(p,8,this.length),t.read(this,p,!0,52,8)},d.prototype.readDoubleBE=function(p,f){return p=p>>>0,f||Qe(p,8,this.length),t.read(this,p,!1,52,8)};function ft(y,p,f,m,_,l){if(!d.isBuffer(y))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>_||p<l)throw new RangeError('"value" argument is out of bounds');if(f+m>y.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(p,f,m,_){if(p=+p,f=f>>>0,m=m>>>0,!_){const O=Math.pow(2,8*m)-1;ft(this,p,f,m,O,0)}let l=1,g=0;for(this[f]=p&255;++g<m&&(l*=256);)this[f+g]=p/l&255;return f+m},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(p,f,m,_){if(p=+p,f=f>>>0,m=m>>>0,!_){const O=Math.pow(2,8*m)-1;ft(this,p,f,m,O,0)}let l=m-1,g=1;for(this[f+l]=p&255;--l>=0&&(g*=256);)this[f+l]=p/g&255;return f+m},d.prototype.writeUint8=d.prototype.writeUInt8=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,1,255,0),this[f]=p&255,f+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,65535,0),this[f]=p&255,this[f+1]=p>>>8,f+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,65535,0),this[f]=p>>>8,this[f+1]=p&255,f+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,4294967295,0),this[f+3]=p>>>24,this[f+2]=p>>>16,this[f+1]=p>>>8,this[f]=p&255,f+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,4294967295,0),this[f]=p>>>24,this[f+1]=p>>>16,this[f+2]=p>>>8,this[f+3]=p&255,f+4};function G(y,p,f,m,_){io(p,m,_,y,f,7);let l=Number(p&BigInt(4294967295));y[f++]=l,l=l>>8,y[f++]=l,l=l>>8,y[f++]=l,l=l>>8,y[f++]=l;let g=Number(p>>BigInt(32)&BigInt(4294967295));return y[f++]=g,g=g>>8,y[f++]=g,g=g>>8,y[f++]=g,g=g>>8,y[f++]=g,f}function ir(y,p,f,m,_){io(p,m,_,y,f,7);let l=Number(p&BigInt(4294967295));y[f+7]=l,l=l>>8,y[f+6]=l,l=l>>8,y[f+5]=l,l=l>>8,y[f+4]=l;let g=Number(p>>BigInt(32)&BigInt(4294967295));return y[f+3]=g,g=g>>8,y[f+2]=g,g=g>>8,y[f+1]=g,g=g>>8,y[f]=g,f+8}d.prototype.writeBigUInt64LE=xn(function(p,f=0){return G(this,p,f,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=xn(function(p,f=0){return ir(this,p,f,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(p,f,m,_){if(p=+p,f=f>>>0,!_){const N=Math.pow(2,8*m-1);ft(this,p,f,m,N-1,-N)}let l=0,g=1,O=0;for(this[f]=p&255;++l<m&&(g*=256);)p<0&&O===0&&this[f+l-1]!==0&&(O=1),this[f+l]=(p/g>>0)-O&255;return f+m},d.prototype.writeIntBE=function(p,f,m,_){if(p=+p,f=f>>>0,!_){const N=Math.pow(2,8*m-1);ft(this,p,f,m,N-1,-N)}let l=m-1,g=1,O=0;for(this[f+l]=p&255;--l>=0&&(g*=256);)p<0&&O===0&&this[f+l+1]!==0&&(O=1),this[f+l]=(p/g>>0)-O&255;return f+m},d.prototype.writeInt8=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,1,127,-128),p<0&&(p=255+p+1),this[f]=p&255,f+1},d.prototype.writeInt16LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,32767,-32768),this[f]=p&255,this[f+1]=p>>>8,f+2},d.prototype.writeInt16BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,2,32767,-32768),this[f]=p>>>8,this[f+1]=p&255,f+2},d.prototype.writeInt32LE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,2147483647,-2147483648),this[f]=p&255,this[f+1]=p>>>8,this[f+2]=p>>>16,this[f+3]=p>>>24,f+4},d.prototype.writeInt32BE=function(p,f,m){return p=+p,f=f>>>0,m||ft(this,p,f,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[f]=p>>>24,this[f+1]=p>>>16,this[f+2]=p>>>8,this[f+3]=p&255,f+4},d.prototype.writeBigInt64LE=xn(function(p,f=0){return G(this,p,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=xn(function(p,f=0){return ir(this,p,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Wo(y,p,f,m,_,l){if(f+m>y.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Ve(y,p,f,m,_){return p=+p,f=f>>>0,_||Wo(y,p,f,4),t.write(y,p,f,m,23,4),f+4}d.prototype.writeFloatLE=function(p,f,m){return Ve(this,p,f,!0,m)},d.prototype.writeFloatBE=function(p,f,m){return Ve(this,p,f,!1,m)};function Ko(y,p,f,m,_){return p=+p,f=f>>>0,_||Wo(y,p,f,8),t.write(y,p,f,m,52,8),f+8}d.prototype.writeDoubleLE=function(p,f,m){return Ko(this,p,f,!0,m)},d.prototype.writeDoubleBE=function(p,f,m){return Ko(this,p,f,!1,m)},d.prototype.copy=function(p,f,m,_){if(!d.isBuffer(p))throw new TypeError("argument should be a Buffer");if(m||(m=0),!_&&_!==0&&(_=this.length),f>=p.length&&(f=p.length),f||(f=0),_>0&&_<m&&(_=m),_===m||p.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),p.length-f<_-m&&(_=p.length-f+m);const l=_-m;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,m,_):Uint8Array.prototype.set.call(p,this.subarray(m,_),f),l},d.prototype.fill=function(p,f,m,_){if(typeof p=="string"){if(typeof f=="string"?(_=f,f=0,m=this.length):typeof m=="string"&&(_=m,m=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!d.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(p.length===1){const g=p.charCodeAt(0);(_==="utf8"&&g<128||_==="latin1")&&(p=g)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(f<0||this.length<f||this.length<m)throw new RangeError("Out of range index");if(m<=f)return this;f=f>>>0,m=m===void 0?this.length:m>>>0,p||(p=0);let l;if(typeof p=="number")for(l=f;l<m;++l)this[l]=p;else{const g=d.isBuffer(p)?p:d.from(p,_),O=g.length;if(O===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(l=0;l<m-f;++l)this[l+f]=g[l%O]}return this};const Tr={};function Ri(y,p,f){Tr[y]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${y}]`,this.stack,delete this.name}get code(){return y}set code(_){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:_,writable:!0})}toString(){return`${this.name} [${y}]: ${this.message}`}}}Ri("ERR_BUFFER_OUT_OF_BOUNDS",function(y){return y?`${y} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ri("ERR_INVALID_ARG_TYPE",function(y,p){return`The "${y}" argument must be of type number. Received type ${typeof p}`},TypeError),Ri("ERR_OUT_OF_RANGE",function(y,p,f){let m=`The value of "${y}" is out of range.`,_=f;return Number.isInteger(f)&&Math.abs(f)>2**32?_=Jo(String(f)):typeof f=="bigint"&&(_=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(_=Jo(_)),_+="n"),m+=` It must be ${p}. Received ${_}`,m},RangeError);function Jo(y){let p="",f=y.length;const m=y[0]==="-"?1:0;for(;f>=m+4;f-=3)p=`_${y.slice(f-3,f)}${p}`;return`${y.slice(0,f)}${p}`}function ln(y,p,f){Sn(p,"offset"),(y[p]===void 0||y[p+f]===void 0)&&Ar(p,y.length-(f+1))}function io(y,p,f,m,_,l){if(y>f||y<p){const g=typeof p=="bigint"?"n":"";let O;throw p===0||p===BigInt(0)?O=`>= 0${g} and < 2${g} ** ${(l+1)*8}${g}`:O=`>= -(2${g} ** ${(l+1)*8-1}${g}) and < 2 ** ${(l+1)*8-1}${g}`,new Tr.ERR_OUT_OF_RANGE("value",O,y)}ln(m,_,l)}function Sn(y,p){if(typeof y!="number")throw new Tr.ERR_INVALID_ARG_TYPE(p,"number",y)}function Ar(y,p,f){throw Math.floor(y)!==y?(Sn(y,f),new Tr.ERR_OUT_OF_RANGE("offset","an integer",y)):p<0?new Tr.ERR_BUFFER_OUT_OF_BOUNDS:new Tr.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,y)}const Fs=/[^+/0-9A-Za-z-_]/g;function oo(y){if(y=y.split("=")[0],y=y.trim().replace(Fs,""),y.length<2)return"";for(;y.length%4!==0;)y=y+"=";return y}function Pi(y,p){p=p||1/0;let f;const m=y.length;let _=null;const l=[];for(let g=0;g<m;++g){if(f=y.charCodeAt(g),f>55295&&f<57344){if(!_){if(f>56319){(p-=3)>-1&&l.push(239,191,189);continue}else if(g+1===m){(p-=3)>-1&&l.push(239,191,189);continue}_=f;continue}if(f<56320){(p-=3)>-1&&l.push(239,191,189),_=f;continue}f=(_-55296<<10|f-56320)+65536}else _&&(p-=3)>-1&&l.push(239,191,189);if(_=null,f<128){if((p-=1)<0)break;l.push(f)}else if(f<2048){if((p-=2)<0)break;l.push(f>>6|192,f&63|128)}else if(f<65536){if((p-=3)<0)break;l.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((p-=4)<0)break;l.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return l}function Xo(y){const p=[];for(let f=0;f<y.length;++f)p.push(y.charCodeAt(f)&255);return p}function Yo(y,p){let f,m,_;const l=[];for(let g=0;g<y.length&&!((p-=2)<0);++g)f=y.charCodeAt(g),m=f>>8,_=f%256,l.push(_),l.push(m);return l}function so(y){return e.toByteArray(oo(y))}function zr(y,p,f,m){let _;for(_=0;_<m&&!(_+f>=p.length||_>=y.length);++_)p[_+f]=y[_];return _}function Yt(y,p){return y instanceof p||y!=null&&y.constructor!=null&&y.constructor.name!=null&&y.constructor.name===p.name}function co(y){return y!==y}const Ds=function(){const y="0123456789abcdef",p=new Array(256);for(let f=0;f<16;++f){const m=f*16;for(let _=0;_<16;++_)p[m+_]=y[f]+y[_]}return p}();function xn(y){return typeof BigInt>"u"?ks:y}function ks(){throw new Error("BigInt not supported")}}(ys)),ys}var My=Vl(),Gl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.JSONCodec=class extends u.Codec{constructor(){super(...arguments);o(this,"encoder",new TextEncoder);o(this,"decoder",new TextDecoder)}decode(t,n){const s=this.decoder.decode(t);if(!n||!n.constructor)return JSON.parse(s);const i=JSON.parse(s);if(typeof i!="object"&&typeof i!="function"||i==null)return i;switch(n.name){case"Object":return i}return this.decorateAny(n,i)}decorateAny(t,n){const s=t instanceof or,i=s?t.raw:t;if(!i)return n;switch(i){case Map:{if(n==null)return{};if(!s||t.parameters.length<1)return n;const a={};for(const d of Object.keys(n))a[this.decorateAny(t.parameters[0],d)]=this.decorateAny(t.parameters[1],n[d]);return a}case Array:return n==null?[]:!s||t.parameters.length<1?n:n.map(a=>this.decorateAny(t.parameters[0],a));case Oe:{if(n==null)return null;const a=new i;if(!s||t.parameters.length<1)return Object.assign(a,n);Object.assign(a,n);const d=[];for(let v of a.data||[])d.push(this.decorateAny(t.parameters[0],v));return a.data=d,a}case String:case Number:case Boolean:case Object:return n;case Date:return n==null||n<1?null:new Date(n);case Uint8Array:return n==null?null:n instanceof Uint8Array?n:My.Buffer.from(n,"base64");default:{if(n==null)return null;const a=new i;for(const d of Object.keys(a)){const v=$e.metadata(sr,i,d);if(!v){Reflect.set(a,d,n[d]);continue}const j=n[d]??n[v.name];Reflect.set(a,d,this.decorateAny(v.kind,j))}return a}}}encode(t){return this.encoder.encode(JSON.stringify(t,(n,s)=>{if(s==null||Array.isArray(s))return s;if(!$e.annotated(s.constructor))return this.encodeAny(s);const i=new Map;for(let d in s){const v=$e.metadata(sr,s.constructor,d);v!=null&&v.name&&v.name.length>0&&v.name!=d&&i.set(d,v.name),((v==null?void 0:v.kind)==Uint8Array||(v==null?void 0:v.kind)==Date||(v==null?void 0:v.kind)==Map)&&Reflect.set(s,d,this.encodeAny(Reflect.get(s,d)))}if(i.size<1)return this.encodeAny(s);const a={};for(let d in s)a[i.get(d)??d]=s[d];return this.encodeAny(a)}))}encodeAny(t){return t instanceof Uint8Array?My.Buffer.from(t).toString("base64"):t instanceof Date?t.getTime():t instanceof Map?Object.fromEntries(t):t}uint8ify(t){return this.encoder.encode(t)}stringify(t){return this.decoder.decode(t)}},u.JSONCodec=Gl([B(u.Codec.JSON)],u.JSONCodec);var Br=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i},Xi=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ro;u.Compiler=class{},u.Compiler=Br([B("mesh")],u.Compiler);function Wl(r){return{}}u.TSCompiler=(Er=class extends u.Compiler{compile(e,t){}intype(e){return Ro.parameters.computeIfy(e,t=>{var n;class s{constructor(){o(this,"attachments",new Map)}getAttachments(){return this.attachments}map(){return Object.assign(new Map,this)}setAttachments(a){(a||{}).forEach((d,v)=>this.attachments.set(v,d))}getArguments(){return t.getParameters().map(a=>{var d;return(d=Object.getOwnPropertyDescriptor(this,a.name))==null?void 0:d.value})}setArguments(a){const d=tt.load(u.Codec).getDefault();t.getParameters().forEach((v,j)=>{if(a&&a.length>v.index&&!(a[v.index]instanceof fo)){const R=a[v.index];if(R==null)return;if(R instanceof v.kind&&!(v.kind instanceof or)){Reflect.set(this,v.name,R);return}switch(v.kind){case Map:case Array:case String:case Number:case Boolean:case Object:case Date:case Uint8Array:Reflect.set(this,v.name,R);break;default:const E=d.encode(R),D=d.decode(E,v.kind);Reflect.set(this,v.name,D)}}})}}return Br([c(-1,"attachments",Map),Xi("design:type",typeof(n=typeof Map<"u"&&Map)=="function"?n:Object)],s.prototype,"attachments",void 0),s})}retype(e){return Ro.returns.computeIfy(e,t=>{class n{constructor(){o(this,"code","");o(this,"message","");o(this,"content");o(this,"cause")}getCause(){return this.cause}getCode(){return this.code}getContent(){return this.content}getMessage(){return this.message}setCause(i){this.cause=i}setCode(i){this.code=i}setContent(i){this.content=i}setMessage(i){this.message=i}}return Br([c(0),Xi("design:type",String)],n.prototype,"code",void 0),Br([c(5),Xi("design:type",String)],n.prototype,"message",void 0),Br([c(10,"content",t.getReturnType()),Xi("design:type",Object)],n.prototype,"content",void 0),Br([c(15,"cause",xt),Xi("design:type",Object)],n.prototype,"cause",void 0),n})}},Ro=Er,o(Er,"parameters",new q),o(Er,"returns",new q),Er),u.TSCompiler=Ro=Br([B("mesh")],u.TSCompiler);var Kl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.Consumer=(vi=class{},o(vi,"HTTP","http"),o(vi,"GRPC","grpc"),o(vi,"TCP","tcp"),o(vi,"MQTT","mqtt"),vi),u.Consumer=Kl([B(u.Consumer.HTTP)],u.Consumer);class Po{constructor(e){o(this,"servers",new vt);o(this,"availableAddrs",new vt);o(this,"relativePath",!1);for(const t of(e||"").split(","))t&&t.trim().length>0&&!this.availableAddrs.includes(t)&&(this.servers.push(new Iy(!0,t)),this.availableAddrs.push(t))}any(){if(this.relativePath)return"";const e=this.availableAddrs;return!e||e.length<1?"":e[Math.floor(Math.random()*e.length)]}relative(e){this.relativePath=e}}class Iy{constructor(e,t){o(this,"available");o(this,"address");this.available=e,this.address=t}}class Jl{constructor(e){o(this,"value");o(this,"fn");this.fn=e}get(){return this.value??(this.value=this.fn()),this.value}reset(e){this.value=e}}const Lo=class Lo{static substring(e,t,n){return!e||e.length>t+n?"":e.substring(t,t+n)}static repeat(e,t){const n=[];for(let s=0;s<t;++s)n.push(e);return n.join("")}static anyone(...e){for(let t of e)if(t&&t.length>0)return t;return""}static traceId(){return""}static spanId(e,t){return""}static newEntity(e){if(!e)return new De;const t=tt.load(u.Codec),n=new De;return n.codec=t.defaultName(),n.schema="",n.buffer=t.getDefault().encode(e),n}static newCacheEntity(e,t,n){const s=Lo.newEntity(t),i=new jt;return i.version="1.0.0",i.entity=s,i.timestamp=Date.now(),i.duration=n,i.key=e,i}static readObject(e,t){return!e.buffer||e.buffer.length<1?null:tt.load(u.Codec).get(e.codec??u.Codec.JSON).decode(e.buffer,t)}static compareVersion(e,t){if(!e)return-1;if(!t)return 1;const n=e.split("."),s=t.split(".");for(let i=0;i<n.length;i++){if(s.length<=i)return 0;if(s[i]=="*")continue;const a=n[i].localeCompare(s[i]);if(a!=0)return a}return 0}static ofError(e){return new xt}static ofCause(e,t,n){throw new Error}static hexString(e){const t=new TextEncoder().encode(e),n="0123456789abcdef";let s="";for(const i of t){const a=i;s+=n[a>>4],s+=n[a&15]}return s}};o(Lo,"MESH_ADDRESS",new Jl(()=>typeof process<"u"&&process.env.MESH_ADDRESS?new Po(process.env.MESH_ADDRESS):globalThis.window!==void 0?new Po(`${globalThis.location.origin}/`):new Po("http://127.0.0.1:443/")));let _e=Lo;var Xl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class Yi extends fo{constructor(){super(...arguments);o(this,"traceId","");o(this,"spanId","");o(this,"timestamp",0);o(this,"runMode",0);o(this,"urn","");o(this,"consumer",new yr);o(this,"calls",0);o(this,"attachments",new Map);o(this,"attributes",new Map);o(this,"principals",new Vs)}static create(){const t=new Yi;return t.traceId=_e.traceId(),t.spanId=_e.spanId("",0),t.timestamp=new Date().getTime(),t.runMode=0,t.urn="",t.consumer=new yr,t}getAttachments(){return this.attachments}getAttribute(t){return this.attributes.get(t.name)}getAttributes(){return this.attributes}getConsumer(t){return this.consumer}getPrincipals(){return this.principals}getProvider(t){return new yr}getRunMode(){return this.runMode}getSpanId(){return this.spanId}getTimestamp(){return this.timestamp}getTraceId(){return this.traceId}getUrn(){return this.urn}setAttribute(t,n){this.attributes.set(t.name,n)}resume(){this.calls++;const t=new Yi;return t.traceId=this.getTraceId(),t.spanId=_e.spanId(this.getSpanId(),this.calls),t.timestamp=this.getTimestamp(),t.runMode=this.getRunMode(),t.urn=this.getUrn(),t.consumer=this.getConsumer(this),this.getAttachments()&&this.getAttachments().forEach((n,s)=>t.attachments.set(n,s)),this.getAttributes()&&this.getAttributes().forEach((n,s)=>t.attributes.set(n,s)),this.getPrincipals()&&this.getPrincipals().forEach(n=>t.principals.push(n)),t}rewriteContext(t){t.getTraceId()&&(this.traceId=t.getTraceId()),t.getSpanId()&&(this.spanId=t.getSpanId()),t.getTimestamp()&&t.getTimestamp()>0&&(this.timestamp=t.getTimestamp()),t.getRunMode()&&t.getRunMode()>0&&(this.runMode=t.getRunMode()),t.getUrn()&&(this.urn=t.getUrn()),t.getConsumer(this)&&(this.consumer=t.getConsumer(this)),this.getAttachments()&&this.getAttachments().forEach((n,s)=>this.attachments.set(n,s)),this.getAttributes()&&this.getAttributes().forEach((n,s)=>this.attributes.set(n,s)),this.getPrincipals()&&this.getPrincipals().forEach(n=>this.principals.push(n))}rewriteURN(t){this.urn=t}}u.MeshContextProvider=class extends u.ContextProvider{context(){return Yi.create()}},u.MeshContextProvider=Xl([B("mesh")],u.MeshContextProvider);var Yl=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.Eden=class{},u.Eden=Yl([B("mesh")],u.Eden);class et{}o(et,"REMOTE",new cr("mesh.mpc.address")),o(et,"REMOTE_NAME",new cr("mesh.mpc.remote.name")),o(et,"INVOCATION",new cr("mesh.invocation")),o(et,"UNAME",new cr("mesh.mpc.uname")),o(et,"CONSUMER",new cr("mesh.mpc.consumer")),o(et,"CODEC",new cr("mesh.mpc.codec")),o(et,"TIMEOUT",new cr("mesh.mpc.timeout"));class tr{constructor(e,t){o(this,"code");o(this,"name");this.code=e,this.name=t}}const Re=class Re{static ofProto(e){for(let t of Re.PROTO)if(t.code==e)return t;return Re.HTTP}static ofCodec(e){for(let t of Re.CODEC)if(t.code==e)return t;return Re.JSON}static ofName(e){for(let t of Re.PROTO)if(t.name==e)return t;for(let t of Re.CODEC)if(t.name==e)return t;return Re.HTTP}};o(Re,"HTTP",new tr("00",u.Consumer.HTTP)),o(Re,"GRPC",new tr("01",u.Consumer.GRPC)),o(Re,"MQTT",new tr("02",u.Consumer.MQTT)),o(Re,"TCP",new tr("03",u.Consumer.TCP)),o(Re,"JSON",new tr("00",u.Codec.JSON)),o(Re,"PROTOBUF",new tr("01",u.Codec.PROTOBUF)),o(Re,"XML",new tr("02",u.Codec.XML)),o(Re,"THRIFT",new tr("03",u.Codec.THRIFT)),o(Re,"YAML",new tr("04",u.Codec.YAML)),o(Re,"PROTO",[Re.HTTP,Re.GRPC,Re.MQTT,Re.TCP]),o(Re,"CODEC",[Re.JSON,Re.PROTOBUF,Re.XML,Re.THRIFT,Re.YAML]);let Dn=Re;const Ql=r=>{const e=b();return e.setAttribute(et.CONSUMER,tt.load(u.Consumer).get(r)),e},Zl=r=>{const e=b();return e.setAttribute(et.CODEC,tt.load(u.Codec).get(r)),e};class $y{constructor(e,t){o(this,"inspector");o(this,"reference");o(this,"service");this.reference=new Nn,this.reference.urn=t.toString(),this.reference.namespace="",this.reference.name=t.name,this.reference.version=t.flag.version,this.reference.proto=Dn.ofProto(t.flag.proto).name,this.reference.codec=Dn.ofCodec(t.flag.codec).name,this.reference.flags=0,this.reference.timeout=parseInt(yo.MESH_TIMEOUT.get(e))||1e4,this.reference.retries=3,this.reference.mdc=t.mdc,this.reference.zone=t.flag.zone,this.reference.cluster=t.flag.cluster,this.reference.cell=t.flag.cell,this.reference.group=t.flag.group,this.reference.address=t.flag.address,this.service=new Ht,this.inspector=new Uy(t)}inflect(e){return new ls}inspect(e){return this.inspector}intype(e){return ls}reflect(e){return new ms}retype(e){return ms}schema(e){return this.reference}}class Uy{constructor(e){o(this,"urn");this.urn=e}getType(){return Object}getAnnotation(e){}getName(){return this.urn.name}getParameters(){return[]}getReturnType(){return new or(Map)}getExecutable(){return()=>{}}getSymbol(){return this.urn.name}invoke(e,t){}}class ls extends Map{map(){return this}getArguments(){const e=[];return super.forEach((t,n)=>{n!="attachments"&&e.push(t)}),e}getAttachments(){var s;const e=((s=Object.getOwnPropertyDescriptor(this,"attachments"))==null?void 0:s.value)||new Map;if(e instanceof Map)return e;const t=tt.load(u.Codec).get(u.Codec.JSON),n=t.decode(t.encode(e),Map);return this.setAttachments(n),n}setArguments(e){}setAttachments(e){Object.assign(this,{attachments:xt})}}class ms extends Map{getCause(){var n;const e=(n=Object.getOwnPropertyDescriptor(this,"cause"))==null?void 0:n.value;if(!e||e instanceof xt)return e;const t=tt.load(u.Codec).get(u.Codec.JSON);return t.decode(t.encode(e),xt)}getCode(){var e;return(e=Object.getOwnPropertyDescriptor(this,"code"))==null?void 0:e.value}getContent(){var e;return(e=Object.getOwnPropertyDescriptor(this,"content"))==null?void 0:e.value}getMessage(){var e;return((e=Object.getOwnPropertyDescriptor(this,"message"))==null?void 0:e.value)||""}setCause(e){Object.assign(this,{cause:e})}setCode(e){Object.assign(this,{code:e})}setContent(e){Object.assign(this,{content:e})}setMessage(e){Object.assign(this,{message:e})}}var em=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};const Cy="PROVIDER",jo="CONSUMER";u.Filter=class{},u.Filter=em([B("*")],u.Filter);function gs(r,e){const t=tt.load(u.Filter).list().filter(n=>{const s=$e.metadata(mn,n==null?void 0:n.constructor,n==null?void 0:n.constructor);return!s||s.pattern==""||(s==null?void 0:s.pattern)==e}).sort((n,s)=>{var d,v;const i=((d=$e.metadata(mn,n==null?void 0:n.constructor,n==null?void 0:n.constructor))==null?void 0:d.priority)||0,a=((v=$e.metadata(mn,s==null?void 0:s.constructor,s==null?void 0:s.constructor))==null?void 0:v.priority)||0;return i==a?0:i<a?-1:1});return tm(r,t)}function tm(r,e){let t=r;for(let n=e.length-1;n>=0;n--){let s=e[n],i=t;t=new class{run(a,d){return s.invoke(a,i,d)}}}return t}var nm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class rm{constructor(){o(this,"beforeHooks",new q);o(this,"successHooks",new q);o(this,"failureHooks",new q)}}const bi=()=>{const r=Vr();return r.Mesh??(r.Mesh=new rm),r.Mesh};class im{onBefore(e,t){bi().beforeHooks.set(e,t)}onSuccess(e,t){bi().successHooks.set(e,t)}onFailure(e,t){bi().failureHooks.set(e,t)}before(){return bi().beforeHooks}success(){return bi().successHooks}failure(){return bi().failureHooks}}const wo=new im;u.HookFilter=class extends u.Filter{async invoke(e,t,n){try{for(const[i,a]of wo.before())await a(e,n);const s=await t.run(e,n);for(const[i,a]of wo.success())await a(e,n,s);return s}catch(s){for(const[i,a]of wo.failure())zs(s)?await a(e,n,s):await a(e,n,h.SYSTEM_ERROR);throw s}}},u.HookFilter=nm([B("hook",jo)],u.HookFilter);class Fy{constructor(e,t,n,s){o(this,"proxy");o(this,"inspector");o(this,"parameters");o(this,"execution");this.proxy=e,this.inspector=t,this.parameters=n,this.execution=s}getArguments(e){return this.parameters.getArguments()}getAttachments(e){return this.parameters.getAttachments()}getExecution(e){return this.execution}getInspector(e){return this.inspector}getParameters(e){return this.parameters}getProxy(e){return this.proxy}isAsync(e){return!1}}const rr=class rr{constructor(){o(this,"domain","");o(this,"mdc","");o(this,"flag",new Pr);o(this,"name","")}static from(e){const t=new rr;if(!e)return console.log(`Unresolved urn ${e}`),t;const n=t.asArray(e);return n.length<5?(console.log(`Unresolved urn ${e}`),t):(n.reverse(),t.domain=`${n.splice(1,1).join("")}.${n.splice(0,1).join("")}`,t.mdc=n.splice(0,1).join(""),t.flag=Pr.from(n.splice(0,1).join("")),t.name=n.join("."),t)}static urn(e){const t=new rr;return t.mdc=this.LocalMDC,t.flag=Pr.from("0001000000000000000000000000000000000"),t.name=e,t.domain=this.MESH_DOMAIN,t}proto(e){return this.flag.proto=e,this}codec(e){return this.flag.codec=e,this}toString(){const e=[],t=this.asArray(this.name);return t.reverse(),t.filter(n=>n).forEach(n=>e.push(n)),e.push(this.flag.toString()),e.push(this.mdc),e.push(_e.anyone(this.domain,rr.MESH_DOMAIN)),e.join(".")}asArray(e){const t=e.split("."),n=[],s=[];for(let i of t){if(i.startsWith("${")){s.push(i),s.push(".");continue}if(i.endsWith("}")){s.push(i),n.push(s.join("")),s.splice(0,s.length);continue}n.push(i)}return n}matchName(e){return e?e.endsWith(".*")&&e.startsWith(e.replace(".*","")):!1}resetFlag(e,t){return this.flag.proto=e,this.flag.codec=t,this}};o(rr,"CN","firmer"),o(rr,"MESH_DOMAIN",rr.CN+".tech"),o(rr,"LocalMDC","XX00000000000000");let nr=rr;class Pr{constructor(){o(this,"v","00");o(this,"proto","00");o(this,"codec","00");o(this,"version","000000");o(this,"zone","00");o(this,"cluster","00");o(this,"cell","00");o(this,"group","00");o(this,"address","000000000000");o(this,"port","00000")}static from(e){if(!e)return new Pr;const t=new Pr;return t.v=_e.substring(e,0,2),t.proto=_e.substring(e,2,2),t.codec=_e.substring(e,4,2),t.version=this.reduce(_e.substring(e,6,6),2),t.zone=_e.substring(e,12,2),t.cluster=_e.substring(e,14,2),t.cell=_e.substring(e,16,2),t.group=_e.substring(e,18,2),t.address=this.reduce(_e.substring(e,20,12),3),t.port=this.reduce(_e.substring(e,32,5),5),t}toString(){const e=this.padding(_e.anyone(this.v,""),2),t=this.padding(_e.anyone(this.proto,""),2),n=this.padding(_e.anyone(this.codec,""),2),s=this.paddingChain(_e.anyone(this.version,""),2,3),i=this.padding(_e.anyone(this.zone,""),2),a=this.padding(_e.anyone(this.cluster,""),2),d=this.padding(_e.anyone(this.cell,""),2),v=this.padding(_e.anyone(this.group,""),2),j=this.paddingChain(_e.anyone(this.address,""),3,4),R=this.padding(_e.anyone(this.port,""),5);return`${e}${t}${n}${s}${i}${a}${d}${v}${j}${R}`}padding(e,t){const n=e.replace(".","");return n.length==t?n:n.length<t?_e.repeat("0",t-e.length)+n:e.substring(0,t)}paddingChain(e,t,n){const s=e.split("[.*]"),i=s.map(a=>parseInt(a)?a:"");if(i.length==n)return i.map(a=>this.padding(a,t)).join("");if(i.length<n){for(let a=0;a<n-s.length;a++)i.push("");return i.map(a=>this.padding(a,t)).join("")}return i.slice(0,n).map(a=>this.padding(a,t)).join("")}static reduce(e,t){if(!e)return e;const n=[];for(let s=0;s<e.length;s+=t){let i=!0;for(let a=s;a<s+t;a++)e.charAt(a)!="0"&&(i=!1),i||n.push(e.charAt(a));i&&n.push("0"),n.push(".")}return n.slice(0,n.length-1).join("")}}class Dy{constructor(e){o(this,"placeholder","${mesh.name}");o(this,"macro");o(this,"invoker");this.macro=e,this.invoker=gs(this,jo)}context(e){if(!e||e.length<1)return b();for(let t of e)if(t instanceof fo)return t;return b()}invoke(e,t,n){return new Promise(async(s,i)=>{try{const a=this.context(n),d=this.referExecution(a,t),v=this.rewriteURN(a,d);a.rewriteURN(v),a.setAttribute(et.REMOTE,this.rewriteAddress(a,v));const j=d.inflect(a);j.setArguments(n),j.setAttachments(new Map);const R=new Fy(this,t,j,d);a.setAttribute(et.INVOCATION,R),s(await this.invoker.run(a,R))}catch(a){i(Ni.errorf(a))}})}async run(e,t){const n=this.referExecution(e,t.getInspector(e)),s=tt.load(u.Consumer),i=e.getAttribute(et.CONSUMER)??s.getDefault(),a=_e.anyone(e.getAttribute(et.REMOTE),_e.MESH_ADDRESS.get().any()),d=n.schema(e).codec||Dn.JSON.name,v=tt.load(u.Codec),j=e.getAttribute(et.CODEC)??v.get(d),R=j.encode(t.getParameters(e)),E=Dn.ofName(s.defaultName()).code,D=Dn.ofName(v.defaultName()).code,T=nr.from(e.getUrn()).resetFlag(E,D).toString(),w=await i.consume(e,a,T,n,R);return await this.deserialize(e,n,j,w)}deserialize(e,t,n,s){return new Promise((i,a)=>{try{const d=t.retype(e),v=n.decode(s,d);if(v.getCause()){a(Ni.errorf(v.getCause()));return}if(h.SUCCESS.getCode()!=v.getCode()){a(new oe(v.getCode(),v.getMessage()));return}i(v.getContent())}catch(d){a(Ni.errorf(d))}})}referExecution(e,t){const s=tt.load(u.Eden).getDefault().refer(e,t.getAnnotation(Ge),t.getType(),t);if(s)return s;throw new Error(`Method ${t.getName()} cant be compatible`)}rewriteURN(e,t){var d;const n=(d=e.getPrincipals().peek())==null?void 0:d.id,s=e.getAttribute(et.UNAME),i=e.getAttribute(et.REMOTE_NAME);if(!n&&!s&&!i&&!t.schema(e).urn.includes(this.placeholder))return t.schema(e).urn;const a=nr.from(t.schema(e).urn);return n&&n!=""&&(a.mdc=n),s&&s!=""&&(a.name=s),i&&i!=""&&(a.name=a.name.replace(this.placeholder,i)),a.name.includes(this.placeholder)&&(a.name=a.name.replace(this.placeholder,"mesh")),a.toString()}rewriteAddress(e,t){const n=e.getAttribute(et.REMOTE);return n&&n!=""?n:_e.MESH_ADDRESS.get().any()}}var om=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i},hs;u.ServiceProxy=hs=class extends u.MethodProxy{proxy(e){return hs.proxy(e)}static proxy(e){return this.doProxy(e,S(""))}static doProxy(e,t){return wi.newProxyInstance(e,new Dy(t))}},u.ServiceProxy=hs=om([B("mesh")],u.ServiceProxy);class sm{constructor(e){o(this,"service");this.service=e}run(e,t){return new Promise((n,s)=>{try{const i=[e,...t.getArguments(e)],a=t.getInspector(e).invoke(this.service,i);if(a instanceof Promise){a.then(d=>n(d)).catch(d=>s(d));return}n(a)}catch(i){s(i)}})}}class ky{constructor(e){o(this,"invoker");this.invoker=gs(new sm(e),Cy)}run(e,t){return this.invoker.run(e,t)}}var cm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};class am{constructor(e,t,n){o(this,"making");o(this,"kind");o(this,"service");this.making=e,this.kind=t,this.service=n}}class dm{constructor(e,t){o(this,"metadata");o(this,"reference");o(this,"proxy");this.metadata=e,this.reference=t,this.proxy=u.ServiceProxy.doProxy(t,e)}}class um{constructor(e,t,n,s,i){o(this,"urn");o(this,"kind");o(this,"method");o(this,"target");o(this,"resource");o(this,"inspector");o(this,"invoker");o(this,"__intype");o(this,"__retype");this.urn=e,this.kind=t,this.method=n,this.target=s,this.resource=i,this.inspector=n,this.invoker=new ky(s),this.__intype=tt.load(u.Compiler).getDefault().intype(n),this.__retype=tt.load(u.Compiler).getDefault().retype(n)}inflect(e){return new this.__intype}inspect(e){return this.inspector}intype(e){return this.__intype}reflect(e){return new this.__retype}retype(e){return this.__retype}schema(e){return this.resource}}u.MeshEden=class extends u.Eden{constructor(){super(...arguments);o(this,"providers",new q);o(this,"consumers",new q);o(this,"indies",new q);o(this,"services",new q);o(this,"references",new q)}define(t,n,s){return this.makeConsumer(t,n,s).proxy}store(t,n,s){this.providers.set(n,new am(!1,n,s))}infer(t,n){const s=nr.from(n),i=this.makeServiceExecution(this.getEnviron(t)),a=i==null?void 0:i.get(s.name);if(a)return a;for(let d of i.entries())if(s.matchName(d[0]))return d[1];return new $y(t,s)}refer(t,n,s,i){const a=this.makeConsumer(t,n,s),d=this.getEnviron(t),v=this.indies.computeIfy(s,j=>new q).computeIfy(n,j=>{const R=new q;return this.getMethods(t,s).forEach((E,D)=>E.forEach(T=>{const w=this.makeMethodAsReference(d,n,D,T),M=new um(w.urn,s,T,a.proxy,w);this.references.set(w.urn,M),R.set(T,M)})),R}).get(i);if(v)return v;throw new Error(`Method ${i.getName()} cant be compatible`)}inferTypes(t){const n=[];for(let s of this.providers)n.push(s[1].kind);return n}referTypes(t){const n=[];for(let s of this.consumers.keys())n.push(s);return n}makeConsumer(t,n,s){return this.consumers.computeIfy(s,i=>new q).computeIfy(n,i=>new dm(n,s))}makeMethodAsReference(t,n,s,i){var d,v,j,R,E,D,T,w,M,A,X,Y,ae;const a=new Nn;return a.namespace=s.name,a.name=i.getName(),a.version=((d=i.getAnnotation(Ge))==null?void 0:d.version)||"",a.proto=((v=i.getAnnotation(Ge))==null?void 0:v.proto)||"",a.codec=((j=i.getAnnotation(Ge))==null?void 0:j.codec)||"",a.flags=((R=i.getAnnotation(Ge))==null?void 0:R.flags)||0,a.timeout=((E=i.getAnnotation(Ge))==null?void 0:E.timeout)||12e3,a.retries=((D=i.getAnnotation(Ge))==null?void 0:D.retries)||0,a.mdc=((T=i.getAnnotation(Ge))==null?void 0:T.mdc)||"",a.zone=((w=i.getAnnotation(Ge))==null?void 0:w.zone)||"",a.cluster=((M=i.getAnnotation(Ge))==null?void 0:M.cluster)||"",a.cell=((A=i.getAnnotation(Ge))==null?void 0:A.cell)||"",a.group=((X=i.getAnnotation(Ge))==null?void 0:X.group)||"",a.address=((Y=i.getAnnotation(Ge))==null?void 0:Y.address)||"",a.urn=this.getURN(((ae=i.getAnnotation(Ge))==null?void 0:ae.name)||"",Ht,t),a}getURN(t,n,s){const i=new nr;return i.domain=nr.MESH_DOMAIN,i.mdc=_e.anyone(n.mdc,s.mdc),i.name=t,i.flag=this.getURNFlag(n),i.toString()}getURNFlag(t){const n=(t.address||"").split(":"),s=new Pr;return s.v="00",s.proto=Dn.ofName(t.proto).code,s.codec=Dn.ofName(t.codec).code,s.version=t.version,s.zone=t.zone,s.cluster=t.cluster,s.cell=t.cell,s.group=t.group,s.address=n.length>0?n[0]:"",s.port=n.length>1?n[1]:"",s}getMethods(t,n){const s=wi.getMethods(n),i=new q;return i.set(n,s),i}getEnviron(t){const n=new Ke;return n.mdc=nr.LocalMDC,n}makeServiceExecution(t){for(let n of this.providers)n[1].making;return this.services}},u.MeshEden=cm([B("mesh")],u.MeshEden);var pm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};const bs="mock";u.MockFilter=class extends u.Filter{async invoke(e,t,n){if(!po.Mock.matches(e.getRunMode())&&!ao.Mock.enable())return await t.run(e,n);const s=tt.load(n.getInspector(e).getType()).want(bs);if(!s)return await t.run(e,n);const i=s[n.getInspector(e).getName()];return!i||typeof i!="function"?await t.run(e,n):await i(n.getArguments(e))}},u.MockFilter=pm([B(bs,jo)],u.MockFilter);var fm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.Provider=class{},u.Provider=fm([B(u.Consumer.GRPC)],u.Provider);var ym=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.GRPCConsumer=class extends u.Consumer{start(){}close(){}consume(e,t,n,s,i){return Promise.reject(h.URN_NOT_PERMIT)}},u.GRPCConsumer=ym([B(u.Consumer.GRPC)],u.GRPCConsumer);var lm=function(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var d=r.length-1;d>=0;d--)(a=r[d])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};u.GRPCProvider=class extends u.Provider{start(){}close(){}},u.GRPCProvider=lm([B(u.Consumer.GRPC)],u.GRPCProvider);function xy(r,e){return function(){return r.apply(e,arguments)}}const{toString:mm}=Object.prototype,{getPrototypeOf:_s}=Object,{iterator:Eo,toStringTag:By}=Symbol,No=(r=>e=>{const t=mm.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),_n=r=>(r=r.toLowerCase(),e=>No(e)===r),To=r=>e=>typeof e===r,{isArray:_i}=Array,Qi=To("undefined");function gm(r){return r!==null&&!Qi(r)&&r.constructor!==null&&!Qi(r.constructor)&&Kt(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Ly=_n("ArrayBuffer");function hm(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Ly(r.buffer),e}const bm=To("string"),Kt=To("function"),Hy=To("number"),Ao=r=>r!==null&&typeof r=="object",_m=r=>r===!0||r===!1,Mo=r=>{if(No(r)!=="object")return!1;const e=_s(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(By in r)&&!(Eo in r)},Sm=_n("Date"),vm=_n("File"),Om=_n("Blob"),Rm=_n("FileList"),Pm=r=>Ao(r)&&Kt(r.pipe),jm=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||Kt(r.append)&&((e=No(r))==="formdata"||e==="object"&&Kt(r.toString)&&r.toString()==="[object FormData]"))},wm=_n("URLSearchParams"),[Em,Nm,Tm,Am]=["ReadableStream","Request","Response","Headers"].map(_n),Mm=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zi(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,s;if(typeof r!="object"&&(r=[r]),_i(r))for(n=0,s=r.length;n<s;n++)e.call(null,r[n],n,r);else{const i=t?Object.getOwnPropertyNames(r):Object.keys(r),a=i.length;let d;for(n=0;n<a;n++)d=i[n],e.call(null,r[d],d,r)}}function qy(r,e){e=e.toLowerCase();const t=Object.keys(r);let n=t.length,s;for(;n-- >0;)if(s=t[n],e===s.toLowerCase())return s;return null}const Lr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zy=r=>!Qi(r)&&r!==Lr;function Ss(){const{caseless:r}=zy(this)&&this||{},e={},t=(n,s)=>{const i=r&&qy(e,s)||s;Mo(e[i])&&Mo(n)?e[i]=Ss(e[i],n):Mo(n)?e[i]=Ss({},n):_i(n)?e[i]=n.slice():e[i]=n};for(let n=0,s=arguments.length;n<s;n++)arguments[n]&&Zi(arguments[n],t);return e}const Im=(r,e,t,{allOwnKeys:n}={})=>(Zi(e,(s,i)=>{t&&Kt(s)?r[i]=xy(s,t):r[i]=s},{allOwnKeys:n}),r),$m=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Um=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},Cm=(r,e,t,n)=>{let s,i,a;const d={};if(e=e||{},r==null)return e;do{for(s=Object.getOwnPropertyNames(r),i=s.length;i-- >0;)a=s[i],(!n||n(a,r,e))&&!d[a]&&(e[a]=r[a],d[a]=!0);r=t!==!1&&_s(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},Fm=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},Dm=r=>{if(!r)return null;if(_i(r))return r;let e=r.length;if(!Hy(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},km=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&_s(Uint8Array)),xm=(r,e)=>{const n=(r&&r[Eo]).call(r);let s;for(;(s=n.next())&&!s.done;){const i=s.value;e.call(r,i[0],i[1])}},Bm=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},Lm=_n("HTMLFormElement"),Hm=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,s){return n.toUpperCase()+s}),Vy=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),qm=_n("RegExp"),Gy=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};Zi(t,(s,i)=>{let a;(a=e(s,i,r))!==!1&&(n[i]=a||s)}),Object.defineProperties(r,n)},zm=r=>{Gy(r,(e,t)=>{if(Kt(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(Kt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Vm=(r,e)=>{const t={},n=s=>{s.forEach(i=>{t[i]=!0})};return _i(r)?n(r):n(String(r).split(e)),t},Gm=()=>{},Wm=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function Km(r){return!!(r&&Kt(r.append)&&r[By]==="FormData"&&r[Eo])}const Jm=r=>{const e=new Array(10),t=(n,s)=>{if(Ao(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[s]=n;const i=_i(n)?[]:{};return Zi(n,(a,d)=>{const v=t(a,s+1);!Qi(v)&&(i[d]=v)}),e[s]=void 0,i}}return n};return t(r,0)},Xm=_n("AsyncFunction"),Ym=r=>r&&(Ao(r)||Kt(r))&&Kt(r.then)&&Kt(r.catch),Wy=((r,e)=>r?setImmediate:e?((t,n)=>(Lr.addEventListener("message",({source:s,data:i})=>{s===Lr&&i===t&&n.length&&n.shift()()},!1),s=>{n.push(s),Lr.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Kt(Lr.postMessage)),Qm=typeof queueMicrotask<"u"?queueMicrotask.bind(Lr):typeof process<"u"&&process.nextTick||Wy,P={isArray:_i,isArrayBuffer:Ly,isBuffer:gm,isFormData:jm,isArrayBufferView:hm,isString:bm,isNumber:Hy,isBoolean:_m,isObject:Ao,isPlainObject:Mo,isReadableStream:Em,isRequest:Nm,isResponse:Tm,isHeaders:Am,isUndefined:Qi,isDate:Sm,isFile:vm,isBlob:Om,isRegExp:qm,isFunction:Kt,isStream:Pm,isURLSearchParams:wm,isTypedArray:km,isFileList:Rm,forEach:Zi,merge:Ss,extend:Im,trim:Mm,stripBOM:$m,inherits:Um,toFlatObject:Cm,kindOf:No,kindOfTest:_n,endsWith:Fm,toArray:Dm,forEachEntry:xm,matchAll:Bm,isHTMLForm:Lm,hasOwnProperty:Vy,hasOwnProp:Vy,reduceDescriptors:Gy,freezeMethods:zm,toObjectSet:Vm,toCamelCase:Hm,noop:Gm,toFiniteNumber:Wm,findKey:qy,global:Lr,isContextDefined:zy,isSpecCompliantForm:Km,toJSONObject:Jm,isAsyncFn:Xm,isThenable:Ym,setImmediate:Wy,asap:Qm,isIterable:r=>r!=null&&Kt(r[Eo])};function ie(r,e,t,n,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}P.inherits(ie,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.status}}});const Ky=ie.prototype,Jy={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Jy[r]={value:r}}),Object.defineProperties(ie,Jy),Object.defineProperty(Ky,"isAxiosError",{value:!0}),ie.from=(r,e,t,n,s,i)=>{const a=Object.create(Ky);return P.toFlatObject(r,a,function(v){return v!==Error.prototype},d=>d!=="isAxiosError"),ie.call(a,r.message,e,t,n,s),a.cause=r,a.name=r.name,i&&Object.assign(a,i),a};const Zm=null;function vs(r){return P.isPlainObject(r)||P.isArray(r)}function Xy(r){return P.endsWith(r,"[]")?r.slice(0,-2):r}function Yy(r,e,t){return r?r.concat(e).map(function(s,i){return s=Xy(s),!t&&i?"["+s+"]":s}).join(t?".":""):e}function eg(r){return P.isArray(r)&&!r.some(vs)}const tg=P.toFlatObject(P,{},null,function(e){return/^is[A-Z]/.test(e)});function Io(r,e,t){if(!P.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=P.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(M,A){return!P.isUndefined(A[M])});const n=t.metaTokens,s=t.visitor||R,i=t.dots,a=t.indexes,v=(t.Blob||typeof Blob<"u"&&Blob)&&P.isSpecCompliantForm(e);if(!P.isFunction(s))throw new TypeError("visitor must be a function");function j(w){if(w===null)return"";if(P.isDate(w))return w.toISOString();if(!v&&P.isBlob(w))throw new ie("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(w)||P.isTypedArray(w)?v&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function R(w,M,A){let X=w;if(w&&!A&&typeof w=="object"){if(P.endsWith(M,"{}"))M=n?M:M.slice(0,-2),w=JSON.stringify(w);else if(P.isArray(w)&&eg(w)||(P.isFileList(w)||P.endsWith(M,"[]"))&&(X=P.toArray(w)))return M=Xy(M),X.forEach(function(ae,ot){!(P.isUndefined(ae)||ae===null)&&e.append(a===!0?Yy([M],ot,i):a===null?M:M+"[]",j(ae))}),!1}return vs(w)?!0:(e.append(Yy(A,M,i),j(w)),!1)}const E=[],D=Object.assign(tg,{defaultVisitor:R,convertValue:j,isVisitable:vs});function T(w,M){if(!P.isUndefined(w)){if(E.indexOf(w)!==-1)throw Error("Circular reference detected in "+M.join("."));E.push(w),P.forEach(w,function(X,Y){(!(P.isUndefined(X)||X===null)&&s.call(e,X,P.isString(Y)?Y.trim():Y,M,D))===!0&&T(X,M?M.concat(Y):[Y])}),E.pop()}}if(!P.isObject(r))throw new TypeError("data must be an object");return T(r),e}function Qy(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Os(r,e){this._pairs=[],r&&Io(r,this,e)}const Zy=Os.prototype;Zy.append=function(e,t){this._pairs.push([e,t])},Zy.toString=function(e){const t=e?function(n){return e.call(this,n,Qy)}:Qy;return this._pairs.map(function(s){return t(s[0])+"="+t(s[1])},"").join("&")};function ng(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function el(r,e,t){if(!e)return r;const n=t&&t.encode||ng;P.isFunction(t)&&(t={serialize:t});const s=t&&t.serialize;let i;if(s?i=s(e,t):i=P.isURLSearchParams(e)?e.toString():new Os(e,t).toString(n),i){const a=r.indexOf("#");a!==-1&&(r=r.slice(0,a)),r+=(r.indexOf("?")===-1?"?":"&")+i}return r}class tl{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){P.forEach(this.handlers,function(n){n!==null&&e(n)})}}const nl={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rg={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Os,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Rs=typeof window<"u"&&typeof document<"u",Ps=typeof navigator=="object"&&navigator||void 0,ig=Rs&&(!Ps||["ReactNative","NativeScript","NS"].indexOf(Ps.product)<0),og=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",sg=Rs&&window.location.href||"http://localhost",St={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rs,hasStandardBrowserEnv:ig,hasStandardBrowserWebWorkerEnv:og,navigator:Ps,origin:sg},Symbol.toStringTag,{value:"Module"})),...rg};function cg(r,e){return Io(r,new St.classes.URLSearchParams,Object.assign({visitor:function(t,n,s,i){return St.isNode&&P.isBuffer(t)?(this.append(n,t.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function ag(r){return P.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function dg(r){const e={},t=Object.keys(r);let n;const s=t.length;let i;for(n=0;n<s;n++)i=t[n],e[i]=r[i];return e}function rl(r){function e(t,n,s,i){let a=t[i++];if(a==="__proto__")return!0;const d=Number.isFinite(+a),v=i>=t.length;return a=!a&&P.isArray(s)?s.length:a,v?(P.hasOwnProp(s,a)?s[a]=[s[a],n]:s[a]=n,!d):((!s[a]||!P.isObject(s[a]))&&(s[a]=[]),e(t,n,s[a],i)&&P.isArray(s[a])&&(s[a]=dg(s[a])),!d)}if(P.isFormData(r)&&P.isFunction(r.entries)){const t={};return P.forEachEntry(r,(n,s)=>{e(ag(n),s,t,0)}),t}return null}function ug(r,e,t){if(P.isString(r))try{return(e||JSON.parse)(r),P.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const eo={transitional:nl,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",s=n.indexOf("application/json")>-1,i=P.isObject(e);if(i&&P.isHTMLForm(e)&&(e=new FormData(e)),P.isFormData(e))return s?JSON.stringify(rl(e)):e;if(P.isArrayBuffer(e)||P.isBuffer(e)||P.isStream(e)||P.isFile(e)||P.isBlob(e)||P.isReadableStream(e))return e;if(P.isArrayBufferView(e))return e.buffer;if(P.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return cg(e,this.formSerializer).toString();if((d=P.isFileList(e))||n.indexOf("multipart/form-data")>-1){const v=this.env&&this.env.FormData;return Io(d?{"files[]":e}:e,v&&new v,this.formSerializer)}}return i||s?(t.setContentType("application/json",!1),ug(e)):e}],transformResponse:[function(e){const t=this.transitional||eo.transitional,n=t&&t.forcedJSONParsing,s=this.responseType==="json";if(P.isResponse(e)||P.isReadableStream(e))return e;if(e&&P.isString(e)&&(n&&!this.responseType||s)){const a=!(t&&t.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(d){if(a)throw d.name==="SyntaxError"?ie.from(d,ie.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:St.classes.FormData,Blob:St.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],r=>{eo.headers[r]={}});const pg=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fg=r=>{const e={};let t,n,s;return r&&r.split(`
20
20
  `).forEach(function(a){s=a.indexOf(":"),t=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!t||e[t]&&pg[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},il=Symbol("internals");function to(r){return r&&String(r).trim().toLowerCase()}function $o(r){return r===!1||r==null?r:P.isArray(r)?r.map($o):String(r)}function yg(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}const lg=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function js(r,e,t,n,s){if(P.isFunction(n))return n.call(this,e,t);if(s&&(e=t),!!P.isString(e)){if(P.isString(n))return e.indexOf(n)!==-1;if(P.isRegExp(n))return n.test(e)}}function mg(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function gg(r,e){const t=P.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(s,i,a){return this[n].call(this,e,s,i,a)},configurable:!0})})}let Jt=class{constructor(e){e&&this.set(e)}set(e,t,n){const s=this;function i(d,v,j){const R=to(v);if(!R)throw new Error("header name must be a non-empty string");const E=P.findKey(s,R);(!E||s[E]===void 0||j===!0||j===void 0&&s[E]!==!1)&&(s[E||v]=$o(d))}const a=(d,v)=>P.forEach(d,(j,R)=>i(j,R,v));if(P.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(P.isString(e)&&(e=e.trim())&&!lg(e))a(fg(e),t);else if(P.isObject(e)&&P.isIterable(e)){let d={},v,j;for(const R of e){if(!P.isArray(R))throw TypeError("Object iterator must return a key-value pair");d[j=R[0]]=(v=d[j])?P.isArray(v)?[...v,R[1]]:[v,R[1]]:R[1]}a(d,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=to(e),e){const n=P.findKey(this,e);if(n){const s=this[n];if(!t)return s;if(t===!0)return yg(s);if(P.isFunction(t))return t.call(this,s,n);if(P.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=to(e),e){const n=P.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||js(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let s=!1;function i(a){if(a=to(a),a){const d=P.findKey(n,a);d&&(!t||js(n,n[d],d,t))&&(delete n[d],s=!0)}}return P.isArray(e)?e.forEach(i):i(e),s}clear(e){const t=Object.keys(this);let n=t.length,s=!1;for(;n--;){const i=t[n];(!e||js(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const t=this,n={};return P.forEach(this,(s,i)=>{const a=P.findKey(n,i);if(a){t[a]=$o(s),delete t[i];return}const d=e?mg(i):String(i).trim();d!==i&&delete t[i],t[d]=$o(s),n[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return P.forEach(this,(n,s)=>{n!=null&&n!==!1&&(t[s]=e&&P.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
21
21
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[il]=this[il]={accessors:{}}).accessors,s=this.prototype;function i(a){const d=to(a);n[d]||(gg(s,a),n[d]=!0)}return P.isArray(e)?e.forEach(i):i(e),this}};Jt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(Jt.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}}),P.freezeMethods(Jt);function ws(r,e){const t=this||eo,n=e||t,s=Jt.from(n.headers);let i=n.data;return P.forEach(r,function(d){i=d.call(t,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function ol(r){return!!(r&&r.__CANCEL__)}function Si(r,e,t){ie.call(this,r??"canceled",ie.ERR_CANCELED,e,t),this.name="CanceledError"}P.inherits(Si,ie,{__CANCEL__:!0});function sl(r,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new ie("Request failed with status code "+t.status,[ie.ERR_BAD_REQUEST,ie.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function hg(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function bg(r,e){r=r||10;const t=new Array(r),n=new Array(r);let s=0,i=0,a;return e=e!==void 0?e:1e3,function(v){const j=Date.now(),R=n[i];a||(a=j),t[s]=v,n[s]=j;let E=i,D=0;for(;E!==s;)D+=t[E++],E=E%r;if(s=(s+1)%r,s===i&&(i=(i+1)%r),j-a<e)return;const T=R&&j-R;return T?Math.round(D*1e3/T):void 0}}function _g(r,e){let t=0,n=1e3/e,s,i;const a=(j,R=Date.now())=>{t=R,s=null,i&&(clearTimeout(i),i=null),r.apply(null,j)};return[(...j)=>{const R=Date.now(),E=R-t;E>=n?a(j,R):(s=j,i||(i=setTimeout(()=>{i=null,a(s)},n-E)))},()=>s&&a(s)]}const Uo=(r,e,t=3)=>{let n=0;const s=bg(50,250);return _g(i=>{const a=i.loaded,d=i.lengthComputable?i.total:void 0,v=a-n,j=s(v),R=a<=d;n=a;const E={loaded:a,total:d,progress:d?a/d:void 0,bytes:v,rate:j||void 0,estimated:j&&d&&R?(d-a)/j:void 0,event:i,lengthComputable:d!=null,[e?"download":"upload"]:!0};r(E)},t)},cl=(r,e)=>{const t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},al=r=>(...e)=>P.asap(()=>r(...e)),Sg=St.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,St.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(St.origin),St.navigator&&/(msie|trident)/i.test(St.navigator.userAgent)):()=>!0,vg=St.hasStandardBrowserEnv?{write(r,e,t,n,s,i){const a=[r+"="+encodeURIComponent(e)];P.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),P.isString(n)&&a.push("path="+n),P.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Og(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function Rg(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function dl(r,e,t){let n=!Og(e);return r&&(n||t==!1)?Rg(r,e):e}const ul=r=>r instanceof Jt?{...r}:r;function Hr(r,e){e=e||{};const t={};function n(j,R,E,D){return P.isPlainObject(j)&&P.isPlainObject(R)?P.merge.call({caseless:D},j,R):P.isPlainObject(R)?P.merge({},R):P.isArray(R)?R.slice():R}function s(j,R,E,D){if(P.isUndefined(R)){if(!P.isUndefined(j))return n(void 0,j,E,D)}else return n(j,R,E,D)}function i(j,R){if(!P.isUndefined(R))return n(void 0,R)}function a(j,R){if(P.isUndefined(R)){if(!P.isUndefined(j))return n(void 0,j)}else return n(void 0,R)}function d(j,R,E){if(E in e)return n(j,R);if(E in r)return n(void 0,j)}const v={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:d,headers:(j,R,E)=>s(ul(j),ul(R),E,!0)};return P.forEach(Object.keys(Object.assign({},r,e)),function(R){const E=v[R]||s,D=E(r[R],e[R],R);P.isUndefined(D)&&E!==d||(t[R]=D)}),t}const pl=r=>{const e=Hr({},r);let{data:t,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:d}=e;e.headers=a=Jt.from(a),e.url=el(dl(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),d&&a.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let v;if(P.isFormData(t)){if(St.hasStandardBrowserEnv||St.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((v=a.getContentType())!==!1){const[j,...R]=v?v.split(";").map(E=>E.trim()).filter(Boolean):[];a.setContentType([j||"multipart/form-data",...R].join("; "))}}if(St.hasStandardBrowserEnv&&(n&&P.isFunction(n)&&(n=n(e)),n||n!==!1&&Sg(e.url))){const j=s&&i&&vg.read(i);j&&a.set(s,j)}return e},Pg=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(t,n){const s=pl(r);let i=s.data;const a=Jt.from(s.headers).normalize();let{responseType:d,onUploadProgress:v,onDownloadProgress:j}=s,R,E,D,T,w;function M(){T&&T(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(R),s.signal&&s.signal.removeEventListener("abort",R)}let A=new XMLHttpRequest;A.open(s.method.toUpperCase(),s.url,!0),A.timeout=s.timeout;function X(){if(!A)return;const ae=Jt.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),de={data:!d||d==="text"||d==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:ae,config:r,request:A};sl(function(yn){t(yn),M()},function(yn){n(yn),M()},de),A=null}"onloadend"in A?A.onloadend=X:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(X)},A.onabort=function(){A&&(n(new ie("Request aborted",ie.ECONNABORTED,r,A)),A=null)},A.onerror=function(){n(new ie("Network Error",ie.ERR_NETWORK,r,A)),A=null},A.ontimeout=function(){let ot=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const de=s.transitional||nl;s.timeoutErrorMessage&&(ot=s.timeoutErrorMessage),n(new ie(ot,de.clarifyTimeoutError?ie.ETIMEDOUT:ie.ECONNABORTED,r,A)),A=null},i===void 0&&a.setContentType(null),"setRequestHeader"in A&&P.forEach(a.toJSON(),function(ot,de){A.setRequestHeader(de,ot)}),P.isUndefined(s.withCredentials)||(A.withCredentials=!!s.withCredentials),d&&d!=="json"&&(A.responseType=s.responseType),j&&([D,w]=Uo(j,!0),A.addEventListener("progress",D)),v&&A.upload&&([E,T]=Uo(v),A.upload.addEventListener("progress",E),A.upload.addEventListener("loadend",T)),(s.cancelToken||s.signal)&&(R=ae=>{A&&(n(!ae||ae.type?new Si(null,r,A):ae),A.abort(),A=null)},s.cancelToken&&s.cancelToken.subscribe(R),s.signal&&(s.signal.aborted?R():s.signal.addEventListener("abort",R)));const Y=hg(s.url);if(Y&&St.protocols.indexOf(Y)===-1){n(new ie("Unsupported protocol "+Y+":",ie.ERR_BAD_REQUEST,r));return}A.send(i||null)})},jg=(r,e)=>{const{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,s;const i=function(j){if(!s){s=!0,d();const R=j instanceof Error?j:this.reason;n.abort(R instanceof ie?R:new Si(R instanceof Error?R.message:R))}};let a=e&&setTimeout(()=>{a=null,i(new ie(`timeout ${e} of ms exceeded`,ie.ETIMEDOUT))},e);const d=()=>{r&&(a&&clearTimeout(a),a=null,r.forEach(j=>{j.unsubscribe?j.unsubscribe(i):j.removeEventListener("abort",i)}),r=null)};r.forEach(j=>j.addEventListener("abort",i));const{signal:v}=n;return v.unsubscribe=()=>P.asap(d),v}},wg=function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let n=0,s;for(;n<t;)s=n+e,yield r.slice(n,s),n=s},Eg=async function*(r,e){for await(const t of Ng(r))yield*wg(t,e)},Ng=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},fl=(r,e,t,n)=>{const s=Eg(r,e);let i=0,a,d=v=>{a||(a=!0,n&&n(v))};return new ReadableStream({async pull(v){try{const{done:j,value:R}=await s.next();if(j){d(),v.close();return}let E=R.byteLength;if(t){let D=i+=E;t(D)}v.enqueue(new Uint8Array(R))}catch(j){throw d(j),j}},cancel(v){return d(v),s.return()}},{highWaterMark:2})},Co=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",yl=Co&&typeof ReadableStream=="function",Tg=Co&&(typeof TextEncoder=="function"?(r=>e=>r.encode(e))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),ll=(r,...e)=>{try{return!!r(...e)}catch{return!1}},Ag=yl&&ll(()=>{let r=!1;const e=new Request(St.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!e}),ml=64*1024,Es=yl&&ll(()=>P.isReadableStream(new Response("").body)),Fo={stream:Es&&(r=>r.body)};Co&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Fo[e]&&(Fo[e]=P.isFunction(r[e])?t=>t[e]():(t,n)=>{throw new ie(`Response type '${e}' is not supported`,ie.ERR_NOT_SUPPORT,n)})})})(new Response);const Mg=async r=>{if(r==null)return 0;if(P.isBlob(r))return r.size;if(P.isSpecCompliantForm(r))return(await new Request(St.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(P.isArrayBufferView(r)||P.isArrayBuffer(r))return r.byteLength;if(P.isURLSearchParams(r)&&(r=r+""),P.isString(r))return(await Tg(r)).byteLength},Ig=async(r,e)=>{const t=P.toFiniteNumber(r.getContentLength());return t??Mg(e)},Ns={http:Zm,xhr:Pg,fetch:Co&&(async r=>{let{url:e,method:t,data:n,signal:s,cancelToken:i,timeout:a,onDownloadProgress:d,onUploadProgress:v,responseType:j,headers:R,withCredentials:E="same-origin",fetchOptions:D}=pl(r);j=j?(j+"").toLowerCase():"text";let T=jg([s,i&&i.toAbortSignal()],a),w;const M=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let A;try{if(v&&Ag&&t!=="get"&&t!=="head"&&(A=await Ig(R,n))!==0){let de=new Request(e,{method:"POST",body:n,duplex:"half"}),tn;if(P.isFormData(n)&&(tn=de.headers.get("content-type"))&&R.setContentType(tn),de.body){const[yn,Nr]=cl(A,Uo(al(v)));n=fl(de.body,ml,yn,Nr)}}P.isString(E)||(E=E?"include":"omit");const X="credentials"in Request.prototype;w=new Request(e,{...D,signal:T,method:t.toUpperCase(),headers:R.normalize().toJSON(),body:n,duplex:"half",credentials:X?E:void 0});let Y=await fetch(w);const ae=Es&&(j==="stream"||j==="response");if(Es&&(d||ae&&M)){const de={};["status","statusText","headers"].forEach(Oi=>{de[Oi]=Y[Oi]});const tn=P.toFiniteNumber(Y.headers.get("content-length")),[yn,Nr]=d&&cl(tn,Uo(al(d),!0))||[];Y=new Response(fl(Y.body,ml,yn,()=>{Nr&&Nr(),M&&M()}),de)}j=j||"text";let ot=await Fo[P.findKey(Fo,j)||"text"](Y,r);return!ae&&M&&M(),await new Promise((de,tn)=>{sl(de,tn,{data:ot,headers:Jt.from(Y.headers),status:Y.status,statusText:Y.statusText,config:r,request:w})})}catch(X){throw M&&M(),X&&X.name==="TypeError"&&/Load failed|fetch/i.test(X.message)?Object.assign(new ie("Network Error",ie.ERR_NETWORK,r,w),{cause:X.cause||X}):ie.from(X,X&&X.code,r,w)}})};P.forEach(Ns,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const gl=r=>`- ${r}`,$g=r=>P.isFunction(r)||r===null||r===!1,hl={getAdapter:r=>{r=P.isArray(r)?r:[r];const{length:e}=r;let t,n;const s={};for(let i=0;i<e;i++){t=r[i];let a;if(n=t,!$g(t)&&(n=Ns[(a=String(t)).toLowerCase()],n===void 0))throw new ie(`Unknown adapter '${a}'`);if(n)break;s[a||"#"+i]=n}if(!n){const i=Object.entries(s).map(([d,v])=>`adapter ${d} `+(v===!1?"is not supported by the environment":"is not available in the build"));let a=e?i.length>1?`since :
22
22
  `+i.map(gl).join(`
@@ -6,6 +6,7 @@ declare class Once<T> {
6
6
  private readonly fn;
7
7
  constructor(fn: () => T);
8
8
  get(): T;
9
+ reset(v: T): void;
9
10
  }
10
11
  export declare class Tool {
11
12
  static substring(v: string, begin: number, length: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firmer/mesh",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Mesh: A lightweight, distributed, relational network architecture for MPC",
5
5
  "homepage": "mesh",
6
6
  "repository": "git.firmer.tech/firmer/mesh",