@libp2p/daemon-client 10.0.43-ff95dc546 → 10.0.44-67732803f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +2 -2
- package/package.json +10 -10
package/dist/index.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PDaemonClient = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PDaemonClient=(()=>{var Eu=Object.create;var Qr=Object.defineProperty;var vu=Object.getOwnPropertyDescriptor;var Su=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Au=Object.prototype.hasOwnProperty;var le=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ke=(t,e)=>{for(var r in e)Qr(t,r,{get:e[r],enumerable:!0})},Ns=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Su(e))!Au.call(t,s)&&s!==r&&Qr(t,s,{get:()=>e[s],enumerable:!(n=vu(e,s))||n.enumerable});return t};var _e=(t,e,r)=>(r=t!=null?Eu(Tu(t)):{},Ns(e||!t||!t.__esModule?Qr(r,"default",{value:t,enumerable:!0}):r,t)),Du=t=>Ns(Qr({},"__esModule",{value:!0}),t);var wh={};ke(wh,{OperationFailedError:()=>z,createClient:()=>gh});var Oo=le("node:buffer");function ht(t){if(t.buffer instanceof ArrayBuffer)return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=t.slice();return new Uint8Array(e.buffer,0,e.byteLength)}function fe(t=0){return ht(Oo.Buffer.alloc(t))}function Ce(t=0){return ht(Oo.Buffer.allocUnsafe(t))}var Iu=Math.pow(2,7),Cu=Math.pow(2,14),Bu=Math.pow(2,21),ko=Math.pow(2,28),_o=Math.pow(2,35),Po=Math.pow(2,42),Ro=Math.pow(2,49),U=128,Ee=127;function Be(t){if(t<Iu)return 1;if(t<Cu)return 2;if(t<Bu)return 3;if(t<ko)return 4;if(t<_o)return 5;if(t<Po)return 6;if(t<Ro)return 7;if(Number.MAX_SAFE_INTEGER!=null&&t>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Ut(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|U,t/=128;case 7:e[r++]=t&255|U,t/=128;case 6:e[r++]=t&255|U,t/=128;case 5:e[r++]=t&255|U,t/=128;case 4:e[r++]=t&255|U,t>>>=7;case 3:e[r++]=t&255|U,t>>>=7;case 2:e[r++]=t&255|U,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Lu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|U),t/=128;case 7:e.set(r++,t&255|U),t/=128;case 6:e.set(r++,t&255|U),t/=128;case 5:e.set(r++,t&255|U),t/=128;case 4:e.set(r++,t&255|U),t>>>=7;case 3:e.set(r++,t&255|U),t>>>=7;case 2:e.set(r++,t&255|U),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function No(t,e){let r=t[e],n=0;if(n+=r&Ee,r<U||(r=t[e+1],n+=(r&Ee)<<7,r<U)||(r=t[e+2],n+=(r&Ee)<<14,r<U)||(r=t[e+3],n+=(r&Ee)<<21,r<U)||(r=t[e+4],n+=(r&Ee)*ko,r<U)||(r=t[e+5],n+=(r&Ee)*_o,r<U)||(r=t[e+6],n+=(r&Ee)*Po,r<U)||(r=t[e+7],n+=(r&Ee)*Ro,r<U))return n;throw new RangeError("Could not decode varint")}function Ou(t,e){let r=t.get(e),n=0;if(n+=r&Ee,r<U||(r=t.get(e+1),n+=(r&Ee)<<7,r<U)||(r=t.get(e+2),n+=(r&Ee)<<14,r<U)||(r=t.get(e+3),n+=(r&Ee)<<21,r<U)||(r=t.get(e+4),n+=(r&Ee)*ko,r<U)||(r=t.get(e+5),n+=(r&Ee)*_o,r<U)||(r=t.get(e+6),n+=(r&Ee)*Po,r<U)||(r=t.get(e+7),n+=(r&Ee)*Ro,r<U))return n;throw new RangeError("Could not decode varint")}function Us(t,e,r=0){return e==null&&(e=Ce(Be(t))),e instanceof Uint8Array?Ut(t,e,r):Lu(t,e,r)}function fr(t,e=0){return t instanceof Uint8Array?No(t,e):Ou(t,e)}function ku(t){return t.buffer instanceof ArrayBuffer}function pt(t){return ku(t)?t:t.slice()}var Uo=new Float32Array([-0]),mt=new Uint8Array(Uo.buffer);function Fs(t,e,r){Uo[0]=t,e[r]=mt[0],e[r+1]=mt[1],e[r+2]=mt[2],e[r+3]=mt[3]}function Ks(t,e){return mt[0]=t[e],mt[1]=t[e+1],mt[2]=t[e+2],mt[3]=t[e+3],Uo[0]}var Mo=new Float64Array([-0]),ve=new Uint8Array(Mo.buffer);function $s(t,e,r){Mo[0]=t,e[r]=ve[0],e[r+1]=ve[1],e[r+2]=ve[2],e[r+3]=ve[3],e[r+4]=ve[4],e[r+5]=ve[5],e[r+6]=ve[6],e[r+7]=ve[7]}function Hs(t,e){return ve[0]=t[e],ve[1]=t[e+1],ve[2]=t[e+2],ve[3]=t[e+3],ve[4]=t[e+4],ve[5]=t[e+5],ve[6]=t[e+6],ve[7]=t[e+7],Mo[0]}var _u=BigInt(Number.MAX_SAFE_INTEGER),Pu=BigInt(Number.MIN_SAFE_INTEGER),Pe=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return At;if(e<_u&&e>Pu)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,s=e-(n<<32n);return r&&(n=~n|0n,s=~s|0n,++s>zs&&(s=0n,++n>zs&&(n=0n))),new t(Number(s),Number(n))}static fromNumber(e){if(e===0)return At;let r=e<0;r&&(e=-e);let n=e>>>0,s=(e-n)/4294967296>>>0;return r&&(s=~s>>>0,n=~n>>>0,++n>4294967295&&(n=0,++s>4294967295&&(s=0))),new t(n,s)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):At}},At=new Pe(0,0);At.toBigInt=function(){return 0n};At.zzEncode=At.zzDecode=function(){return this};At.length=function(){return 1};var zs=4294967296n;function Vs(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function Gs(t,e,r){if(r-e<1)return"";let s,o=[],c=0,i;for(;e<r;)i=t[e++],i<128?o[c++]=i:i>191&&i<224?o[c++]=(i&31)<<6|t[e++]&63:i>239&&i<365?(i=((i&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,o[c++]=55296+(i>>10),o[c++]=56320+(i&1023)):o[c++]=(i&15)<<12|(t[e++]&63)<<6|t[e++]&63,c>8191&&((s??(s=[])).push(String.fromCharCode.apply(String,o)),c=0);return s!=null?(c>0&&s.push(String.fromCharCode.apply(String,o.slice(0,c))),s.join("")):String.fromCharCode.apply(String,o.slice(0,c))}function Fo(t,e,r){let n=r,s,o;for(let c=0;c<t.length;++c)s=t.charCodeAt(c),s<128?e[r++]=s:s<2048?(e[r++]=s>>6|192,e[r++]=s&63|128):(s&64512)===55296&&((o=t.charCodeAt(c+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++c,e[r++]=s>>18|240,e[r++]=s>>12&63|128,e[r++]=s>>6&63|128,e[r++]=s&63|128):(e[r++]=s>>12|224,e[r++]=s>>6&63|128,e[r++]=s&63|128);return r-n}function Ve(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Jr(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Ko=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=pt(e),this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Ve(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Ve(this,4);return Jr(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Ve(this,4);return Jr(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Ve(this,4);let e=Ks(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Ve(this,4);let e=Hs(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw Ve(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return Gs(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Ve(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Ve(this);while((this.buf[this.pos++]&128)!==0);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Pe(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Ve(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw Ve(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Ve(this,8);let e=Jr(this.buf,this.pos+=4),r=Jr(this.buf,this.pos+=4);return new Pe(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=No(this.buf,this.pos);return this.pos+=Be(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function dr(t){return new Ko(t instanceof Uint8Array?t:t.subarray())}function Q(t,e,r){let n=dr(t);return e.decode(n,void 0,r)}var pc=le("node:buffer");var Go={};ke(Go,{base10:()=>Hu});var Rh=new Uint8Array(0);function qs(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function Te(t){if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return Dt(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return Dt(new Uint8Array(t.buffer,t.byteOffset,t.byteLength));throw new Error("Unknown type, must be binary type")}function Zs(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var Ys=4096;function js(t){let e=t.length;if(e<=Ys)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.subarray(n,n+=Ys));return r}function Ru(t){return t?.buffer instanceof ArrayBuffer}function Dt(t){return Ru(t)?t:t.slice()}function Nu(t,e,r){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),s=0;s<n.length;s++)n[s]=255;for(var o=0;o<t.length;o++){var c=t.charAt(o),i=c.charCodeAt(0);if(n[i]!==255)throw new TypeError(c+" is ambiguous");if(n[i]=o,r){var a=c.toLowerCase().charCodeAt(0),u=c.toUpperCase().charCodeAt(0);a!==i&&(n[a]=o),u!==i&&(n[u]=o)}}var l=t.length,f=t.charAt(0),d=Math.log(l)/Math.log(256),p=Math.log(256)/Math.log(l);function x(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var T=0,P=0,_=0,M=y.length;_!==M&&y[_]===0;)_++,T++;for(var X=(M-_)*p+1>>>0,ie=new Uint8Array(X);_!==M;){for(var re=y[_],we=0,V=X-1;(re!==0||we<P)&&V!==-1;V--,we++)re+=256*ie[V]>>>0,ie[V]=re%l>>>0,re=re/l>>>0;if(re!==0)throw new Error("Non-zero carry");P=we,_++}for(var me=X-P;me!==X&&ie[me]===0;)me++;for(var Oe=f.repeat(T);me<X;++me)Oe+=t.charAt(ie[me]);return Oe}function D(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;var T=0;if(y[T]!==" "){for(var P=0,_=0;y[T]===f;)P++,T++;for(var M=(y.length-T)*d+1>>>0,X=new Uint8Array(M);y[T];){var ie=y.charCodeAt(T);if(ie>255)return;var re=n[ie];if(re===255)return;for(var we=0,V=M-1;(re!==0||we<_)&&V!==-1;V--,we++)re+=l*X[V]>>>0,X[V]=re%256>>>0,re=re/256>>>0;if(re!==0)throw new Error("Non-zero carry");_=we,T++}if(y[T]!==" "){for(var me=M-_;me!==M&&X[me]===0;)me++;for(var Oe=new Uint8Array(P+(M-me)),ft=P;me!==M;)Oe[ft++]=X[me++];return Oe}}}function b(y){var T=D(y);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:D,decode:b}}var Uu=Nu,Mu=Uu,Qs=Mu;var $o=class{name;prefix;baseEncode;constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ho=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,n){this.name=e,this.prefix=r;let s=r.codePointAt(0);if(s===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Js(this,e)}},zo=class{decoders;constructor(e){this.decoders=e}or(e){return Js(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Js(t,e){return new zo({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var Vo=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,n,s){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=s,this.encoder=new $o(e,r,n),this.decoder=new Ho(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Mt({name:t,prefix:e,encode:r,decode:n}){return new Vo(t,e,r,n)}function yt({name:t,prefix:e,alphabet:r,caseInsensitive:n=!1}){let{encode:s,decode:o}=Qs(r,t,n);return Mt({prefix:e,name:t,encode:s,decode:c=>Te(o(c))})}function Fu(t,e,r,n){let s=t.length;for(;t[s-1]==="=";)--s;let o=new Uint8Array(s*r/8|0),c=0,i=0,a=0;for(let u=0;u<s;++u){let l=e[t[u]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);i=i<<r|l,c+=r,c>=8&&(c-=8,o[a++]=255&i>>c)}if(c>=r||(255&i<<8-c)!==0)throw new SyntaxError("Unexpected end of data");return o}function Ku(t,e,r){let n=e[e.length-1]==="=",s=(1<<r)-1,o="",c=0,i=0;for(let a=0;a<t.length;++a)for(i=i<<8|t[a],c+=8;c>r;)c-=r,o+=e[s&i>>c];if(c!==0&&(o+=e[s&i<<r-c]),n)for(;(o.length*r&7)!==0;)o+="=";return o}function $u(t,e){let r={};for(let n=0;n<t.length;++n)if(r[t[n]]=n,e){let s=t[n].toLowerCase(),o=t[n].toUpperCase();s!==t[n]&&(r[s]=n),o!==t[n]&&(r[o]=n)}return r}function ne({name:t,prefix:e,bitsPerChar:r,alphabet:n,caseInsensitive:s=!1}){let o=$u(n,s);return Mt({prefix:e,name:t,encode(c){return Ku(c,n,r)},decode(c){return Fu(c,o,r,t)}})}var Hu=yt({prefix:"9",name:"base10",alphabet:"0123456789"});var Wo={};ke(Wo,{base16:()=>zu,base16upper:()=>Vu});var zu=ne({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4,caseInsensitive:!0}),Vu=ne({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4,caseInsensitive:!0});var Yo={};ke(Yo,{base2:()=>Gu});var Gu=ne({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var qo={};ke(qo,{base256emoji:()=>ju});var ec=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Wu=ec.reduce((t,e,r)=>(t[r]=e,t),[]),Yu=ec.reduce((t,e,r)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return t[n]=r,t},[]);function qu(t){return t.reduce((e,r)=>(e+=Wu[r],e),"")}function Zu(t){let e=[];for(let r of t){let n=r.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${r}`);let s=Yu[n];if(s==null)throw new Error(`Non-base256emoji character: ${r}`);e.push(s)}return new Uint8Array(e)}var ju=Mt({prefix:"\u{1F680}",name:"base256emoji",encode:qu,decode:Zu});var Zo={};ke(Zo,{base32:()=>je,base32hex:()=>el,base32hexpad:()=>rl,base32hexpadupper:()=>nl,base32hexupper:()=>tl,base32pad:()=>Qu,base32padupper:()=>Ju,base32upper:()=>Xu,base32z:()=>ol});var je=ne({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5,caseInsensitive:!0}),Xu=ne({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5,caseInsensitive:!0}),Qu=ne({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5,caseInsensitive:!0}),Ju=ne({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5,caseInsensitive:!0}),el=ne({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5,caseInsensitive:!0}),tl=ne({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5,caseInsensitive:!0}),rl=ne({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5,caseInsensitive:!0}),nl=ne({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5,caseInsensitive:!0}),ol=ne({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var jo={};ke(jo,{base36:()=>hr,base36upper:()=>il});var hr=yt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz",caseInsensitive:!0}),il=yt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",caseInsensitive:!0});var Xo={};ke(Xo,{base58btc:()=>ae,base58flickr:()=>sl});var ae=yt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sl=yt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var ei={};ke(ei,{base64:()=>Qo,base64pad:()=>cl,base64url:()=>Jo,base64urlpad:()=>al});var Qo=ne({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cl=ne({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Jo=ne({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),al=ne({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ti={};ke(ti,{base8:()=>ul});var ul=ne({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ri={};ke(ri,{identity:()=>ll});var ll=Mt({prefix:"\0",name:"identity",encode:t=>js(Te(t)),decode:t=>Te(Zs(t))});var Xh=new TextEncoder,Qh=new TextDecoder;var oi={};ke(oi,{identity:()=>Ge});var hl=nc,tc=128,pl=127,ml=~pl,yl=Math.pow(2,31);function nc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=yl;)e[r++]=t&255|tc,t/=128;for(;t&ml;)e[r++]=t&255|tc,t>>>=7;return e[r]=t|0,nc.bytes=r-n+1,e}var bl=ni,gl=128,rc=127;function ni(t,n){var r=0,n=n||0,s=0,o=n,c,i=t.length;do{if(o>=i)throw ni.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=s<28?(c&rc)<<s:(c&rc)*Math.pow(2,s),s+=7}while(c>=gl);return ni.bytes=o-n,r}var wl=Math.pow(2,7),xl=Math.pow(2,14),El=Math.pow(2,21),vl=Math.pow(2,28),Sl=Math.pow(2,35),Tl=Math.pow(2,42),Al=Math.pow(2,49),Dl=Math.pow(2,56),Il=Math.pow(2,63),Cl=function(t){return t<wl?1:t<xl?2:t<El?3:t<vl?4:t<Sl?5:t<Tl?6:t<Al?7:t<Dl?8:t<Il?9:10},Bl={encode:hl,decode:bl,encodingLength:Cl},Ll=Bl,pr=Ll;function mr(t,e=0){let r=pr.decode(t,e),n=pr.decode.bytes;if(n>9)throw new RangeError("Invalid varint: too long");if(n>1&&t[e+n-1]===0)throw new RangeError("Invalid varint: not minimally encoded");return[r,n]}function Ft(t,e,r=0){return pr.encode(t,e,r),e}function Kt(t){return pr.encodingLength(t)}function Ht(t,e){let r=e.byteLength,n=Kt(t),s=n+Kt(r),o=new Uint8Array(s+r);return Ft(t,o,0),Ft(r,o,n),o.set(e,s),new $t(t,r,e,o)}function $e(t){let e=Te(t),[r,n]=mr(e),[s,o]=mr(e.subarray(n)),c=e.subarray(n+o);if(c.byteLength!==s)throw new Error("Incorrect length");return new $t(r,s,c,e)}function oc(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&qs(t.bytes,r.bytes)}}var $t=class{code;size;digest;bytes;constructor(e,r,n,s){this.code=e,this.size=r,this.digest=Dt(n),this.bytes=Dt(s)}};var ic=0,Ol="identity",sc=Te;function kl(t,e){if(e?.truncate!=null&&e.truncate!==t.byteLength){if(e.truncate<0||e.truncate>t.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${t.byteLength}`);t=t.subarray(0,e.truncate)}return Ht(ic,sc(t))}var Ge={code:ic,name:Ol,encode:sc,digest:kl};var ui={};ke(ui,{sha256:()=>ai,sha512:()=>Pl});var ci=_e(le("node:crypto"),1);var _l=20;function si({name:t,code:e,encode:r,minDigestLength:n,maxDigestLength:s}){return new ii(t,e,r,n,s)}var ii=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,r,n,s,o){this.name=e,this.code=r,this.encode=n,this.minDigestLength=s??_l,this.maxDigestLength=o}digest(e,r){if(r?.truncate!=null){if(r.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&r.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?cc(n,this.code,r?.truncate):n.then(s=>cc(s,this.code,r?.truncate))}else throw Error("Unknown type, must be binary type")}};function cc(t,e,r){if(r!=null&&r!==t.byteLength){if(r>t.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${t.byteLength}`);t=t.subarray(0,r)}return Ht(e,t)}var ai=si({name:"sha2-256",code:18,encode:t=>Te(ci.default.createHash("sha256").update(t).digest())}),Pl=si({name:"sha2-512",code:19,encode:t=>Te(ci.default.createHash("sha512").update(t).digest())});function uc(t,e){let{bytes:r,version:n}=t;return n===0?Nl(r,li(t),e??ae.encoder):Ul(r,li(t),e??je.encoder)}var lc=new WeakMap;function li(t){let e=lc.get(t);if(e==null){let r=new Map;return lc.set(t,r),r}return e}var de=class t{code;version;multihash;bytes;"/";constructor(e,r,n,s){this.code=r,this.version=e,this.multihash=n,this.bytes=Dt(s),this["/"]=this.bytes}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==yr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ml)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Ht(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n!=null&&e.code===n.code&&e.version===n.version&&oc(e.multihash,n.multihash)}toString(e){return uc(this,e)}toJSON(){return{"/":uc(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:s,multihash:o,bytes:c}=r;return new t(n,s,o,c??fc(n,s,o.bytes))}else if(r[Fl]===!0){let{version:n,multihash:s,code:o}=r,c=$e(s);return t.create(n,o,c)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==yr)throw new Error(`Version 0 CID must use dag-pb (code: ${yr}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let s=fc(e,r,n.bytes);return new t(e,r,n,s)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,yr,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,s=Te(e.subarray(n,n+r.multihashSize));if(s.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=s.subarray(r.multihashSize-r.digestSize),c=new $t(r.multihashCode,r.digestSize,o,s);return[r.version===0?t.createV0(c):t.createV1(r.codec,c),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,d]=mr(e.subarray(r));return r+=d,f},s=n(),o=yr;if(s===18)s=0,r=0;else if(s===1)o=n();else throw s===0?new RangeError("Invalid CID version, v0 is always implicit"):new RangeError(`Invalid CID version ${s}`);let c=r,i=n(),a=n(),u=r+a,l=u-c;return{version:s,codec:o,multihashCode:i,digestSize:a,multihashSize:l,size:u}}static parse(e,r){let[n,s]=Rl(e,r),o=t.decode(s);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return li(o).set(n,e),o}};function Rl(t,e){switch(t[0]){case"Q":{let r=e??ae;return[ae.prefix,r.decode(`${ae.prefix}${t}`)]}case ae.prefix:{let r=e??ae;return[ae.prefix,r.decode(t)]}case je.prefix:{let r=e??je;return[je.prefix,r.decode(t)]}case hr.prefix:{let r=e??hr;return[hr.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function Nl(t,e,r){let{prefix:n}=r;if(n!==ae.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let s=e.get(n);if(s==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return s}function Ul(t,e,r){let{prefix:n}=r,s=e.get(n);if(s==null){let o=r.encode(t);return e.set(n,o),o}else return s}var yr=112,Ml=18;function fc(t,e,r){let n=Kt(t),s=n+Kt(e),o=new Uint8Array(s+r.byteLength);return Ft(t,o,0),Ft(e,o,n),o.set(r,s),o}var Fl=Symbol.for("@ipld/js-cid/CID");var br={...ri,...Yo,...ti,...Go,...Wo,...Zo,...jo,...Xo,...ei,...qo},Ep={...ui,...oi};function hc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var dc=hc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fi=hc("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Ce(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Kl={utf8:dc,"utf-8":dc,hex:br.base16,latin1:fi,ascii:fi,binary:fi,...br},tn=Kl;function Ae(t,e="utf8"){let r=tn[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return e==="utf8"||e==="utf-8"?ht(pc.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function di(t){let e=t??8192,r=e>>>1,n,s=e;return function(c){if(c<1||c>r)return Ce(c);s+c>e&&(n=Ce(e),s=0);let i=n.subarray(s,s+=c);return(s&7)!==0&&(s=(s|7)+1),i}}var It=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function hi(){}var mi=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},$l=di();function Hl(t){return globalThis.Buffer!=null?Ce(t):$l(t)}var wr=class{len;head;tail;states;constructor(){this.len=0,this.head=new It(hi,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new It(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new yi((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(rn,10,Pe.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Pe.fromBigInt(e);return this._push(rn,r.length(),r)}uint64Number(e){return this._push(Ut,Be(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Pe.fromBigInt(e).zzEncode();return this._push(rn,r.length(),r)}sint64Number(e){let r=Pe.fromNumber(e).zzEncode();return this._push(rn,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(pi,1,e?1:0)}fixed32(e){return this._push(gr,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Pe.fromBigInt(e);return this._push(gr,4,r.lo)._push(gr,4,r.hi)}fixed64Number(e){let r=Pe.fromNumber(e);return this._push(gr,4,r.lo)._push(gr,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(Fs,4,e)}double(e){return this._push($s,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(pi,1,0):this.uint32(r)._push(Vl,r,e)}string(e){let r=Vs(e);return r!==0?this.uint32(r)._push(Fo,r,e):this._push(pi,1,0)}fork(){return this.states=new mi(this),this.head=this.tail=new It(hi,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new It(hi,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Hl(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function pi(t,e,r){e[r]=t&255}function zl(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var yi=class extends It{next;constructor(e,r){super(zl,e,r),this.next=void 0}};function rn(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function gr(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Vl(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(wr.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Gl,e,t),this},wr.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Wl,e,t),this});function Gl(t,e,r){e.set(t,r)}function Wl(t,e,r){t.length<40?Fo(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Ae(t),r)}function bi(){return new wr}function J(t,e){let r=bi();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}function*ee(t,e,r){let n=dr(t);yield*e.stream(n,void 0,".",r)}var nn={VARINT:0,BIT64:1,LENGTH_DELIMITED:2,START_GROUP:3,END_GROUP:4,BIT32:5};function on(t,e,r,n,s){return{name:t,type:e,encode:r,decode:n,stream:s}}function We(t){function e(o){if(t[o.toString()]==null)throw new Error("Invalid enum value");return t[o]}let r=function(c,i){let a=e(c);i.int32(a)},n=function(c){let i=c.int32();return e(i)},s=function*(c,i){};return on("enum",nn.VARINT,r,n,s)}function te(t,e,r){return on("message",nn.LENGTH_DELIMITED,t,e,r)}var G=class extends Error{code="ERR_MAX_LENGTH";name="MaxLengthError"};var H;(function(t){let e;(function(i){i.IDENTIFY="IDENTIFY",i.CONNECT="CONNECT",i.STREAM_OPEN="STREAM_OPEN",i.STREAM_HANDLER="STREAM_HANDLER",i.DHT="DHT",i.LIST_PEERS="LIST_PEERS",i.CONNMANAGER="CONNMANAGER",i.DISCONNECT="DISCONNECT",i.PUBSUB="PUBSUB",i.PEERSTORE="PEERSTORE"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.IDENTIFY=0]="IDENTIFY",i[i.CONNECT=1]="CONNECT",i[i.STREAM_OPEN=2]="STREAM_OPEN",i[i.STREAM_HANDLER=3]="STREAM_HANDLER",i[i.DHT=4]="DHT",i[i.LIST_PEERS=5]="LIST_PEERS",i[i.CONNMANAGER=6]="CONNMANAGER",i[i.DISCONNECT=7]="DISCONNECT",i[i.PUBSUB=8]="PUBSUB",i[i.PEERSTORE=9]="PEERSTORE"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.connect!=null&&(a.uint32(18),Er.codec().encode(i.connect,a)),i.streamOpen!=null&&(a.uint32(26),vr.codec().encode(i.streamOpen,a)),i.streamHandler!=null&&(a.uint32(34),Sr.codec().encode(i.streamHandler,a)),i.dht!=null&&(a.uint32(42),Re.codec().encode(i.dht,a)),i.connManager!=null&&(a.uint32(50),Ar.codec().encode(i.connManager,a)),i.disconnect!=null&&(a.uint32(58),Dr.codec().encode(i.disconnect,a)),i.pubsub!=null&&(a.uint32(66),Xe.codec().encode(i.pubsub,a)),i.peerStore!=null&&(a.uint32(74),Cr.codec().encode(i.peerStore,a)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.connect=Er.codec().decode(i,i.uint32(),{limits:u.limits?.connect});break}case 3:{l.streamOpen=vr.codec().decode(i,i.uint32(),{limits:u.limits?.streamOpen});break}case 4:{l.streamHandler=Sr.codec().decode(i,i.uint32(),{limits:u.limits?.streamHandler});break}case 5:{l.dht=Re.codec().decode(i,i.uint32(),{limits:u.limits?.dht});break}case 6:{l.connManager=Ar.codec().decode(i,i.uint32(),{limits:u.limits?.connManager});break}case 7:{l.disconnect=Dr.codec().decode(i,i.uint32(),{limits:u.limits?.disconnect});break}case 8:{l.pubsub=Xe.codec().decode(i,i.uint32(),{limits:u.limits?.pubsub});break}case 9:{l.peerStore=Cr.codec().decode(i,i.uint32(),{limits:u.limits?.peerStore});break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield*Er.codec().stream(i,i.uint32(),`${u}.connect`,{limits:l.limits?.connect});break}case 3:{yield*vr.codec().stream(i,i.uint32(),`${u}.streamOpen`,{limits:l.limits?.streamOpen});break}case 4:{yield*Sr.codec().stream(i,i.uint32(),`${u}.streamHandler`,{limits:l.limits?.streamHandler});break}case 5:{yield*Re.codec().stream(i,i.uint32(),`${u}.dht`,{limits:l.limits?.dht});break}case 6:{yield*Ar.codec().stream(i,i.uint32(),`${u}.connManager`,{limits:l.limits?.connManager});break}case 7:{yield*Dr.codec().stream(i,i.uint32(),`${u}.disconnect`,{limits:l.limits?.disconnect});break}case 8:{yield*Xe.codec().stream(i,i.uint32(),`${u}.pubsub`,{limits:l.limits?.pubsub});break}case 9:{yield*Cr.codec().stream(i,i.uint32(),`${u}.peerStore`,{limits:l.limits?.peerStore});break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(H||(H={}));var L;(function(t){let e;(function(i){i.OK="OK",i.ERROR="ERROR"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.OK=0]="OK",i[i.ERROR=1]="ERROR"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{if(u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.error!=null&&(a.uint32(18),Tr.codec().encode(i.error,a)),i.streamInfo!=null&&(a.uint32(26),Ct.codec().encode(i.streamInfo,a)),i.identify!=null&&(a.uint32(34),xr.codec().encode(i.identify,a)),i.dht!=null&&(a.uint32(42),He.codec().encode(i.dht,a)),i.peers!=null&&i.peers.length>0)for(let l of i.peers)a.uint32(50),Ye.codec().encode(l,a);i.pubsub!=null&&(a.uint32(58),Ir.codec().encode(i.pubsub,a)),i.peerStore!=null&&(a.uint32(66),Br.codec().encode(i.peerStore,a)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={peers:[]},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.error=Tr.codec().decode(i,i.uint32(),{limits:u.limits?.error});break}case 3:{l.streamInfo=Ct.codec().decode(i,i.uint32(),{limits:u.limits?.streamInfo});break}case 4:{l.identify=xr.codec().decode(i,i.uint32(),{limits:u.limits?.identify});break}case 5:{l.dht=He.codec().decode(i,i.uint32(),{limits:u.limits?.dht});break}case 6:{if(u.limits?.peers!=null&&l.peers.length===u.limits.peers)throw new G('Decode error - repeated field "peers" had too many elements');l.peers.push(Ye.codec().decode(i,i.uint32(),{limits:u.limits?.peers$}));break}case 7:{l.pubsub=Ir.codec().decode(i,i.uint32(),{limits:u.limits?.pubsub});break}case 8:{l.peerStore=Br.codec().decode(i,i.uint32(),{limits:u.limits?.peerStore});break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f={peers:0},d=a==null?i.len:i.pos+a;for(;i.pos<d;){let p=i.uint32();switch(p>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield*Tr.codec().stream(i,i.uint32(),`${u}.error`,{limits:l.limits?.error});break}case 3:{yield*Ct.codec().stream(i,i.uint32(),`${u}.streamInfo`,{limits:l.limits?.streamInfo});break}case 4:{yield*xr.codec().stream(i,i.uint32(),`${u}.identify`,{limits:l.limits?.identify});break}case 5:{yield*He.codec().stream(i,i.uint32(),`${u}.dht`,{limits:l.limits?.dht});break}case 6:{if(l.limits?.peers!=null&&f.peers===l.limits.peers)throw new G('Streaming decode error - repeated field "peers" had too many elements');for(let x of Ye.codec().stream(i,i.uint32(),`${u}.peers[]`,{limits:l.limits?.peers$}))yield{...x,index:f.peers};f.peers++;break}case 7:{yield*Ir.codec().stream(i,i.uint32(),`${u}.pubsub`,{limits:l.limits?.pubsub});break}case 8:{yield*Br.codec().stream(i,i.uint32(),`${u}.peerStore`,{limits:l.limits?.peerStore});break}default:{i.skipType(p&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(L||(L={}));var xr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.id!=null&&o.id.byteLength>0&&(c.uint32(10),c.bytes(o.id)),o.addrs!=null&&o.addrs.length>0)for(let a of o.addrs)c.uint32(18),c.bytes(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={id:fe(0),addrs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.id=o.bytes();break}case 2:{if(i.limits?.addrs!=null&&a.addrs.length===i.limits.addrs)throw new G('Decode error - repeated field "addrs" had too many elements');a.addrs.push(o.bytes());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={addrs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.id`,value:o.bytes()};break}case 2:{if(a.limits?.addrs!=null&&u.addrs===a.limits.addrs)throw new G('Streaming decode error - repeated field "addrs" had too many elements');yield{field:`${i}.addrs[]`,index:u.addrs,value:o.bytes()},u.addrs++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(xr||(xr={}));var Er;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),o.addrs!=null&&o.addrs.length>0)for(let a of o.addrs)c.uint32(18),c.bytes(a);o.timeout!=null&&(c.uint32(24),c.int64(o.timeout)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0),addrs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=o.bytes();break}case 2:{if(i.limits?.addrs!=null&&a.addrs.length===i.limits.addrs)throw new G('Decode error - repeated field "addrs" had too many elements');a.addrs.push(o.bytes());break}case 3:{a.timeout=o.int64();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={addrs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.peer`,value:o.bytes()};break}case 2:{if(a.limits?.addrs!=null&&u.addrs===a.limits.addrs)throw new G('Streaming decode error - repeated field "addrs" had too many elements');yield{field:`${i}.addrs[]`,index:u.addrs,value:o.bytes()},u.addrs++;break}case 3:{yield{field:`${i}.timeout`,value:o.int64()};break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Er||(Er={}));var vr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),o.proto!=null&&o.proto.length>0)for(let a of o.proto)c.uint32(18),c.string(a);o.timeout!=null&&(c.uint32(24),c.int64(o.timeout)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0),proto:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=o.bytes();break}case 2:{if(i.limits?.proto!=null&&a.proto.length===i.limits.proto)throw new G('Decode error - repeated field "proto" had too many elements');a.proto.push(o.string());break}case 3:{a.timeout=o.int64();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={proto:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.peer`,value:o.bytes()};break}case 2:{if(a.limits?.proto!=null&&u.proto===a.limits.proto)throw new G('Streaming decode error - repeated field "proto" had too many elements');yield{field:`${i}.proto[]`,index:u.proto,value:o.string()},u.proto++;break}case 3:{yield{field:`${i}.timeout`,value:o.int64()};break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(vr||(vr={}));var Sr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.addr!=null&&o.addr.byteLength>0&&(c.uint32(10),c.bytes(o.addr)),o.proto!=null&&o.proto.length>0)for(let a of o.proto)c.uint32(18),c.string(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={addr:fe(0),proto:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.addr=o.bytes();break}case 2:{if(i.limits?.proto!=null&&a.proto.length===i.limits.proto)throw new G('Decode error - repeated field "proto" had too many elements');a.proto.push(o.string());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={proto:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.addr`,value:o.bytes()};break}case 2:{if(a.limits?.proto!=null&&u.proto===a.limits.proto)throw new G('Streaming decode error - repeated field "proto" had too many elements');yield{field:`${i}.proto[]`,index:u.proto,value:o.string()},u.proto++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Sr||(Sr={}));var Tr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{i.lengthDelimited!==!1&&c.fork(),o.msg!=null&&o.msg!==""&&(c.uint32(10),c.string(o.msg)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={msg:""},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?a.msg=o.string():o.skipType(l&7)}return a},function*(o,c,i,a={}){let u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?yield{field:`${i}.msg`,value:o.string()}:o.skipType(l&7)}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Tr||(Tr={}));var Ct;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),o.addr!=null&&o.addr.byteLength>0&&(c.uint32(18),c.bytes(o.addr)),o.proto!=null&&o.proto!==""&&(c.uint32(26),c.string(o.proto)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0),addr:fe(0),proto:""},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=o.bytes();break}case 2:{a.addr=o.bytes();break}case 3:{a.proto=o.string();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{yield{field:`${i}.peer`,value:o.bytes()};break}case 2:{yield{field:`${i}.addr`,value:o.bytes()};break}case 3:{yield{field:`${i}.proto`,value:o.string()};break}default:{o.skipType(l&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Ct||(Ct={}));var Re;(function(t){let e;(function(i){i.FIND_PEER="FIND_PEER",i.FIND_PEERS_CONNECTED_TO_PEER="FIND_PEERS_CONNECTED_TO_PEER",i.FIND_PROVIDERS="FIND_PROVIDERS",i.GET_CLOSEST_PEERS="GET_CLOSEST_PEERS",i.GET_PUBLIC_KEY="GET_PUBLIC_KEY",i.GET_VALUE="GET_VALUE",i.SEARCH_VALUE="SEARCH_VALUE",i.PUT_VALUE="PUT_VALUE",i.PROVIDE="PROVIDE"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.FIND_PEER=0]="FIND_PEER",i[i.FIND_PEERS_CONNECTED_TO_PEER=1]="FIND_PEERS_CONNECTED_TO_PEER",i[i.FIND_PROVIDERS=2]="FIND_PROVIDERS",i[i.GET_CLOSEST_PEERS=3]="GET_CLOSEST_PEERS",i[i.GET_PUBLIC_KEY=4]="GET_PUBLIC_KEY",i[i.GET_VALUE=5]="GET_VALUE",i[i.SEARCH_VALUE=6]="SEARCH_VALUE",i[i.PUT_VALUE=7]="PUT_VALUE",i[i.PROVIDE=8]="PROVIDE"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.peer!=null&&(a.uint32(18),a.bytes(i.peer)),i.cid!=null&&(a.uint32(26),a.bytes(i.cid)),i.key!=null&&(a.uint32(34),a.bytes(i.key)),i.value!=null&&(a.uint32(42),a.bytes(i.value)),i.count!=null&&(a.uint32(48),a.int32(i.count)),i.timeout!=null&&(a.uint32(56),a.int64(i.timeout)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.peer=i.bytes();break}case 3:{l.cid=i.bytes();break}case 4:{l.key=i.bytes();break}case 5:{l.value=i.bytes();break}case 6:{l.count=i.int32();break}case 7:{l.timeout=i.int64();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.peer`,value:i.bytes()};break}case 3:{yield{field:`${u}.cid`,value:i.bytes()};break}case 4:{yield{field:`${u}.key`,value:i.bytes()};break}case 5:{yield{field:`${u}.value`,value:i.bytes()};break}case 6:{yield{field:`${u}.count`,value:i.int32()};break}case 7:{yield{field:`${u}.timeout`,value:i.int64()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Re||(Re={}));var He;(function(t){let e;(function(i){i.BEGIN="BEGIN",i.VALUE="VALUE",i.END="END"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.BEGIN=0]="BEGIN",i[i.VALUE=1]="VALUE",i[i.END=2]="END"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.peer!=null&&(a.uint32(18),Ye.codec().encode(i.peer,a)),i.value!=null&&(a.uint32(26),a.bytes(i.value)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.peer=Ye.codec().decode(i,i.uint32(),{limits:u.limits?.peer});break}case 3:{l.value=i.bytes();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield*Ye.codec().stream(i,i.uint32(),`${u}.peer`,{limits:l.limits?.peer});break}case 3:{yield{field:`${u}.value`,value:i.bytes()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(He||(He={}));var Ye;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.id!=null&&o.id.byteLength>0&&(c.uint32(10),c.bytes(o.id)),o.addrs!=null&&o.addrs.length>0)for(let a of o.addrs)c.uint32(18),c.bytes(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={id:fe(0),addrs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.id=o.bytes();break}case 2:{if(i.limits?.addrs!=null&&a.addrs.length===i.limits.addrs)throw new G('Decode error - repeated field "addrs" had too many elements');a.addrs.push(o.bytes());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={addrs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.id`,value:o.bytes()};break}case 2:{if(a.limits?.addrs!=null&&u.addrs===a.limits.addrs)throw new G('Streaming decode error - repeated field "addrs" had too many elements');yield{field:`${i}.addrs[]`,index:u.addrs,value:o.bytes()},u.addrs++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Ye||(Ye={}));var Ar;(function(t){let e;(function(i){i.TAG_PEER="TAG_PEER",i.UNTAG_PEER="UNTAG_PEER",i.TRIM="TRIM"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.TAG_PEER=0]="TAG_PEER",i[i.UNTAG_PEER=1]="UNTAG_PEER",i[i.TRIM=2]="TRIM"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.peer!=null&&(a.uint32(18),a.bytes(i.peer)),i.tag!=null&&(a.uint32(26),a.string(i.tag)),i.weight!=null&&(a.uint32(32),a.int64(i.weight)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.peer=i.bytes();break}case 3:{l.tag=i.string();break}case 4:{l.weight=i.int64();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.peer`,value:i.bytes()};break}case 3:{yield{field:`${u}.tag`,value:i.string()};break}case 4:{yield{field:`${u}.weight`,value:i.int64()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Ar||(Ar={}));var Dr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0)},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?a.peer=o.bytes():o.skipType(l&7)}return a},function*(o,c,i,a={}){let u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?yield{field:`${i}.peer`,value:o.bytes()}:o.skipType(l&7)}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Dr||(Dr={}));var Xe;(function(t){let e;(function(i){i.GET_TOPICS="GET_TOPICS",i.LIST_PEERS="LIST_PEERS",i.PUBLISH="PUBLISH",i.SUBSCRIBE="SUBSCRIBE"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.GET_TOPICS=0]="GET_TOPICS",i[i.LIST_PEERS=1]="LIST_PEERS",i[i.PUBLISH=2]="PUBLISH",i[i.SUBSCRIBE=3]="SUBSCRIBE"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.topic!=null&&(a.uint32(18),a.string(i.topic)),i.data!=null&&(a.uint32(26),a.bytes(i.data)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.topic=i.string();break}case 3:{l.data=i.bytes();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.topic`,value:i.string()};break}case 3:{yield{field:`${u}.data`,value:i.bytes()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Xe||(Xe={}));var sn;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.from!=null&&(c.uint32(10),c.bytes(o.from)),o.data!=null&&(c.uint32(18),c.bytes(o.data)),o.seqno!=null&&(c.uint32(26),c.bytes(o.seqno)),o.topicIDs!=null&&o.topicIDs.length>0)for(let a of o.topicIDs)c.uint32(34),c.string(a);o.signature!=null&&(c.uint32(42),c.bytes(o.signature)),o.key!=null&&(c.uint32(50),c.bytes(o.key)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={topicIDs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.from=o.bytes();break}case 2:{a.data=o.bytes();break}case 3:{a.seqno=o.bytes();break}case 4:{if(i.limits?.topicIDs!=null&&a.topicIDs.length===i.limits.topicIDs)throw new G('Decode error - repeated field "topicIDs" had too many elements');a.topicIDs.push(o.string());break}case 5:{a.signature=o.bytes();break}case 6:{a.key=o.bytes();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={topicIDs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.from`,value:o.bytes()};break}case 2:{yield{field:`${i}.data`,value:o.bytes()};break}case 3:{yield{field:`${i}.seqno`,value:o.bytes()};break}case 4:{if(a.limits?.topicIDs!=null&&u.topicIDs===a.limits.topicIDs)throw new G('Streaming decode error - repeated field "topicIDs" had too many elements');yield{field:`${i}.topicIDs[]`,index:u.topicIDs,value:o.string()},u.topicIDs++;break}case 5:{yield{field:`${i}.signature`,value:o.bytes()};break}case 6:{yield{field:`${i}.key`,value:o.bytes()};break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(sn||(sn={}));var Ir;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.topics!=null&&o.topics.length>0)for(let a of o.topics)c.uint32(10),c.string(a);if(o.peerIDs!=null&&o.peerIDs.length>0)for(let a of o.peerIDs)c.uint32(18),c.bytes(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={topics:[],peerIDs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{if(i.limits?.topics!=null&&a.topics.length===i.limits.topics)throw new G('Decode error - repeated field "topics" had too many elements');a.topics.push(o.string());break}case 2:{if(i.limits?.peerIDs!=null&&a.peerIDs.length===i.limits.peerIDs)throw new G('Decode error - repeated field "peerIDs" had too many elements');a.peerIDs.push(o.bytes());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={topics:0,peerIDs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{if(a.limits?.topics!=null&&u.topics===a.limits.topics)throw new G('Streaming decode error - repeated field "topics" had too many elements');yield{field:`${i}.topics[]`,index:u.topics,value:o.string()},u.topics++;break}case 2:{if(a.limits?.peerIDs!=null&&u.peerIDs===a.limits.peerIDs)throw new G('Streaming decode error - repeated field "peerIDs" had too many elements');yield{field:`${i}.peerIDs[]`,index:u.peerIDs,value:o.bytes()},u.peerIDs++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Ir||(Ir={}));var Cr;(function(t){let e;(function(i){i.UNSPECIFIED="UNSPECIFIED",i.GET_PROTOCOLS="GET_PROTOCOLS",i.GET_PEER_INFO="GET_PEER_INFO"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.UNSPECIFIED=0]="UNSPECIFIED",i[i.GET_PROTOCOLS=1]="GET_PROTOCOLS",i[i.GET_PEER_INFO=2]="GET_PEER_INFO"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{if(u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.id!=null&&(a.uint32(18),a.bytes(i.id)),i.protos!=null&&i.protos.length>0)for(let l of i.protos)a.uint32(26),a.string(l);u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={protos:[]},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.id=i.bytes();break}case 3:{if(u.limits?.protos!=null&&l.protos.length===u.limits.protos)throw new G('Decode error - repeated field "protos" had too many elements');l.protos.push(i.string());break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f={protos:0},d=a==null?i.len:i.pos+a;for(;i.pos<d;){let p=i.uint32();switch(p>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.id`,value:i.bytes()};break}case 3:{if(l.limits?.protos!=null&&f.protos===l.limits.protos)throw new G('Streaming decode error - repeated field "protos" had too many elements');yield{field:`${u}.protos[]`,index:f.protos,value:i.string()},f.protos++;break}default:{i.skipType(p&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Cr||(Cr={}));var Br;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&(c.uint32(10),Ye.codec().encode(o.peer,c)),o.protos!=null&&o.protos.length>0)for(let a of o.protos)c.uint32(18),c.string(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={protos:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=Ye.codec().decode(o,o.uint32(),{limits:i.limits?.peer});break}case 2:{if(i.limits?.protos!=null&&a.protos.length===i.limits.protos)throw new G('Decode error - repeated field "protos" had too many elements');a.protos.push(o.string());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={protos:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield*Ye.codec().stream(o,o.uint32(),`${i}.peer`,{limits:a.limits?.peer});break}case 2:{if(a.limits?.protos!=null&&u.protos===a.limits.protos)throw new G('Streaming decode error - repeated field "protos" had too many elements');yield{field:`${i}.protos[]`,index:u.protos,value:o.string()},u.protos++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Br||(Br={}));function mc(t){let e=new globalThis.AbortController;function r(){let o=t.filter(c=>c?.aborted===!0).map(c=>c?.reason).pop();e.abort(o);for(let c of t)c?.removeEventListener!=null&&c.removeEventListener("abort",r)}for(let o of t){if(o?.aborted===!0){r();break}o?.addEventListener!=null&&o.addEventListener("abort",r)}function n(){for(let o of t)o?.removeEventListener!=null&&o.removeEventListener("abort",r)}let s=e.signal;return s.clear=n,s}var Lr=class{onConnection;constructor(e){this.onConnection=e}async upgradeInbound(e){this.onConnection?.(e)}async upgradeOutbound(e){return e}createInboundAbortSignal(e){return mc([e])}getStreamMuxers(){return new Map}getConnectionEncrypters(){return new Map}};var cn=class extends Error{static name="AbortError";constructor(e="The operation was aborted"){super(e),this.name="AbortError"}};var B=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},Or=class extends Error{static name="InvalidPublicKeyError";constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var an=class extends Error{static name="StreamResetError";constructor(e="The stream has been reset"){super(e),this.name="StreamResetError"}};var bt=class extends Error{static name="StreamStateError";constructor(e="The stream is in an invalid state"){super(e),this.name="StreamStateError"}},Bt=class extends Error{static name="StreamBufferError";constructor(e="The stream buffer was full"){super(e),this.name="StreamBufferError"}};var un=class extends Error{static name="InvalidMultihashError";constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var kr=class extends Error{static name="InvalidMessageError";constructor(e="Invalid message"){super(e),this.name="InvalidMessageError"}},_r=class extends Error{static name="ProtocolError";constructor(e="Protocol error"){super(e),this.name="ProtocolError"}},zt=class extends Error{static name="TimeoutError";constructor(e="Timed out"){super(e),this.name="TimeoutError"}},ln=class extends Error{static name="NotStartedError";constructor(e="Not started"){super(e),this.name="NotStartedError"}},fn=class extends Error{static name="AlreadyStartedError";constructor(e="Already started"){super(e),this.name="AlreadyStartedError"}};var Pr=class extends Error{static name="UnsupportedKeyTypeError";constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};var dn=class extends Event{data;constructor(e,r){super("message",r),this.data=e}},Vt=class extends Event{error;local;constructor(e,r,n){super("close",n),this.error=r,this.local=e}},hn=class extends Vt{constructor(e,r){super(!0,e,r)}},pn=class extends Vt{constructor(e,r){super(!1,e,r)}};var mn=Symbol.for("@libp2p/peer-id");function Gt(t){return!!t?.[mn]}var bc=Symbol.for("@libp2p/transport");var yc;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(yc||(yc={}));var gc=le("node:events"),yn=(t,...e)=>{try{(0,gc.setMaxListeners)(t,...e)}catch{}};function Yl(t){return typeof t?.handleEvent=="function"}function ql(t){return t===!0||t===!1}function Zl(t){return ql(t)?t:t?.capture??!1}function gi(t){let e={capture:Zl(t),once:!!t?.once};return t?.passive!=null&&(e.passive=t?.passive),t?.signal!=null&&(e.signal=t?.signal),e}function wc(t,e){return gi(t).capture===gi(e).capture}var Wt=class extends EventTarget{#e=new Map;constructor(){super(),yn(1/0,this)}listenerCount(e){let r=this.#e.get(e);return r==null?0:r.length}addEventListener(e,r,n){let s=gi(n);if(s?.signal?.aborted===!0)return;let o=u=>{s.once&&this.removeEventListener(e,r,s),Yl(r)?r.handleEvent(u):r(u)},c=this.#e.get(e);if(c==null&&(c=[],this.#e.set(e,c)),c.some(u=>u.callback!==r?!1:wc(u.options,s)))return;super.addEventListener(e,o,s);let a=()=>{this.removeEventListener(e,r,s)};s.signal?.addEventListener("abort",a),c.push({callback:r,wrapper:o,options:s,onAbort:a})}removeEventListener(e,r,n){let s=this.#e.get(e);if(s==null){super.removeEventListener(e,r??null,n);return}this.#e.set(e,s.filter(o=>o.callback===r&&wc(o.options,n)?(super.removeEventListener(e,o.wrapper,n),o.options?.signal?.removeEventListener("abort",o.onAbort),!1):!0))}safeDispatchEvent(e,r={}){return this.dispatchEvent(new CustomEvent(e,r))}};var xc=Symbol.for("@libp2p/service-capabilities");var Sc=_e(le("node:tty"),1),En=_e(le("node:util"),1);function bn(t,e){if(typeof t=="string")return jl(t);if(typeof t=="number")return Jl(t,e);throw new Error(`Value provided to ms() must be a string or number. value=${JSON.stringify(t)}`)}function jl(t){if(typeof t!="string"||t.length===0||t.length>100)throw new Error(`Value provided to ms.parse() must be a string with length between 1 and 99. value=${JSON.stringify(t)}`);let e=/^(?<value>-?\d*\.?\d+) *(?<unit>milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|months?|mo|years?|yrs?|y)?$/i.exec(t);if(!e?.groups)return NaN;let{value:r,unit:n="ms"}=e.groups,s=parseFloat(r),o=n.toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return s*315576e5;case"months":case"month":case"mo":return s*26298e5;case"weeks":case"week":case"w":return s*6048e5;case"days":case"day":case"d":return s*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return s*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return s*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return s*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:throw new Error(`Unknown unit "${o}" provided to ms.parse(). value=${JSON.stringify(t)}`)}}function Xl(t){let e=Math.abs(t);return e>=315576e5?`${Math.round(t/315576e5)}y`:e>=26298e5?`${Math.round(t/26298e5)}mo`:e>=6048e5?`${Math.round(t/6048e5)}w`:e>=864e5?`${Math.round(t/864e5)}d`:e>=36e5?`${Math.round(t/36e5)}h`:e>=6e4?`${Math.round(t/6e4)}m`:e>=1e3?`${Math.round(t/1e3)}s`:`${t}ms`}function Ql(t){let e=Math.abs(t);return e>=315576e5?Lt(t,e,315576e5,"year"):e>=26298e5?Lt(t,e,26298e5,"month"):e>=6048e5?Lt(t,e,6048e5,"week"):e>=864e5?Lt(t,e,864e5,"day"):e>=36e5?Lt(t,e,36e5,"hour"):e>=6e4?Lt(t,e,6e4,"minute"):e>=1e3?Lt(t,e,1e3,"second"):`${t} ms`}function Jl(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new Error("Value provided to ms.format() must be of type number.");return e?.long?Ql(t):Xl(t)}function Lt(t,e,r,n){let s=e>=r*1.5;return`${Math.round(t/r)} ${n}${s?"s":""}`}var wn=_e(le("node:process"),1),vc=_e(le("node:os"),1),wi=_e(le("node:tty"),1);function ze(t,e=globalThis.Deno?globalThis.Deno.args:wn.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}var{env:j}=wn.default,gn;ze("no-color")||ze("no-colors")||ze("color=false")||ze("color=never")?gn=0:(ze("color")||ze("colors")||ze("color=true")||ze("color=always"))&&(gn=1);function ef(){if(!("FORCE_COLOR"in j))return;if(j.FORCE_COLOR==="true")return 1;if(j.FORCE_COLOR==="false")return 0;if(j.FORCE_COLOR.length===0)return 1;let t=Math.min(Number.parseInt(j.FORCE_COLOR,10),3);if([0,1,2,3].includes(t))return t}function tf(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function rf(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=ef();n!==void 0&&(gn=n);let s=r?gn:n;if(s===0)return 0;if(r){if(ze("color=16m")||ze("color=full")||ze("color=truecolor"))return 3;if(ze("color=256"))return 2}if("TF_BUILD"in j&&"AGENT_NAME"in j)return 1;if(t&&!e&&s===void 0)return 0;let o=s||0;if(j.TERM==="dumb")return o;if(wn.default.platform==="win32"){let c=vc.default.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in j)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(c=>c in j)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(c=>c in j)||j.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in j)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(j.TEAMCITY_VERSION)?1:0;if(j.COLORTERM==="truecolor"||j.TERM==="xterm-kitty"||j.TERM==="xterm-ghostty"||j.TERM==="wezterm")return 3;if("TERM_PROGRAM"in j){let c=Number.parseInt((j.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(j.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(j.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(j.TERM)||"COLORTERM"in j?1:o}function Ec(t,e={}){let r=rf(t,{streamIsTTY:t&&t.isTTY,...e});return tf(r)}var nf={stdout:Ec({isTTY:wi.default.isatty(1)}),stderr:Ec({isTTY:wi.default.isatty(2)})},xn=nf;function xi(t){r.debug=r,r.default=r,r.coerce=a,r.disable=o,r.enable=s,r.enabled=c,r.humanize=bn,r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l,f){let d,p=null,x,D;function b(...y){if(!b.enabled)return;let T=b,P=Number(new Date),_=P-(d||P);T.diff=_,T.prev=d,T.curr=P,d=P,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let M=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(ie,re)=>{if(ie==="%%")return"%";M++;let we=r.formatters[re];if(typeof we=="function"){let V=y[M];ie=we.call(T,V),y.splice(M,1),M--}return ie}),r.formatArgs.call(T,y),f?.onLog!=null&&f.onLog(...y),(T.log||r.log).apply(T,y)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(x!==r.namespaces&&(x=r.namespaces,D=r.enabled(l)),D),set:y=>{p=y}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function s(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,d=(typeof l=="string"?l:"").split(/[\s,]+/),p=d.length;for(f=0;f<p;f++)d[f]&&(l=d[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.substr(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(i),...r.skips.map(i).map(f=>"-"+f)].join(",");return r.enable(""),l}function c(l){if(l[l.length-1]==="*")return!0;let f,d;for(f=0,d=r.skips.length;f<d;f++)if(r.skips[f].test(l))return!1;for(f=0,d=r.names.length;f<d;f++)if(r.names[f].test(l))return!0;return!1}function i(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function a(l){return l instanceof Error?l.stack??l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.setupFormatters(r.formatters),r.enable(r.load()),r}var Tc=[6,2,3,4,5,1];xn.stderr!==!1&&(xn.stderr??xn).level>=2&&(Tc=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]);var Yt=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function of(){return"colors"in Yt?!!Yt.colors:Sc.default.isatty(process.stderr.fd)}function sf(t){let{namespace:e,useColors:r}=this;if(r===!0){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${s};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
|
|
2
|
+
"use strict";var Libp2PDaemonClient=(()=>{var Eu=Object.create;var Qr=Object.defineProperty;var vu=Object.getOwnPropertyDescriptor;var Su=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Au=Object.prototype.hasOwnProperty;var le=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ke=(t,e)=>{for(var r in e)Qr(t,r,{get:e[r],enumerable:!0})},Ns=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Su(e))!Au.call(t,s)&&s!==r&&Qr(t,s,{get:()=>e[s],enumerable:!(n=vu(e,s))||n.enumerable});return t};var _e=(t,e,r)=>(r=t!=null?Eu(Tu(t)):{},Ns(e||!t||!t.__esModule?Qr(r,"default",{value:t,enumerable:!0}):r,t)),Du=t=>Ns(Qr({},"__esModule",{value:!0}),t);var wh={};ke(wh,{OperationFailedError:()=>z,createClient:()=>gh});var Oo=le("node:buffer");function ht(t){if(t.buffer instanceof ArrayBuffer)return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let e=t.slice();return new Uint8Array(e.buffer,0,e.byteLength)}function fe(t=0){return ht(Oo.Buffer.alloc(t))}function Ce(t=0){return ht(Oo.Buffer.allocUnsafe(t))}var Iu=Math.pow(2,7),Cu=Math.pow(2,14),Bu=Math.pow(2,21),ko=Math.pow(2,28),_o=Math.pow(2,35),Po=Math.pow(2,42),Ro=Math.pow(2,49),U=128,Ee=127;function Be(t){if(t<Iu)return 1;if(t<Cu)return 2;if(t<Bu)return 3;if(t<ko)return 4;if(t<_o)return 5;if(t<Po)return 6;if(t<Ro)return 7;if(Number.MAX_SAFE_INTEGER!=null&&t>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function Ut(t,e,r=0){switch(Be(t)){case 8:e[r++]=t&255|U,t/=128;case 7:e[r++]=t&255|U,t/=128;case 6:e[r++]=t&255|U,t/=128;case 5:e[r++]=t&255|U,t/=128;case 4:e[r++]=t&255|U,t>>>=7;case 3:e[r++]=t&255|U,t>>>=7;case 2:e[r++]=t&255|U,t>>>=7;case 1:{e[r++]=t&255,t>>>=7;break}default:throw new Error("unreachable")}return e}function Lu(t,e,r=0){switch(Be(t)){case 8:e.set(r++,t&255|U),t/=128;case 7:e.set(r++,t&255|U),t/=128;case 6:e.set(r++,t&255|U),t/=128;case 5:e.set(r++,t&255|U),t/=128;case 4:e.set(r++,t&255|U),t>>>=7;case 3:e.set(r++,t&255|U),t>>>=7;case 2:e.set(r++,t&255|U),t>>>=7;case 1:{e.set(r++,t&255),t>>>=7;break}default:throw new Error("unreachable")}return e}function No(t,e){let r=t[e],n=0;if(n+=r&Ee,r<U||(r=t[e+1],n+=(r&Ee)<<7,r<U)||(r=t[e+2],n+=(r&Ee)<<14,r<U)||(r=t[e+3],n+=(r&Ee)<<21,r<U)||(r=t[e+4],n+=(r&Ee)*ko,r<U)||(r=t[e+5],n+=(r&Ee)*_o,r<U)||(r=t[e+6],n+=(r&Ee)*Po,r<U)||(r=t[e+7],n+=(r&Ee)*Ro,r<U))return n;throw new RangeError("Could not decode varint")}function Ou(t,e){let r=t.get(e),n=0;if(n+=r&Ee,r<U||(r=t.get(e+1),n+=(r&Ee)<<7,r<U)||(r=t.get(e+2),n+=(r&Ee)<<14,r<U)||(r=t.get(e+3),n+=(r&Ee)<<21,r<U)||(r=t.get(e+4),n+=(r&Ee)*ko,r<U)||(r=t.get(e+5),n+=(r&Ee)*_o,r<U)||(r=t.get(e+6),n+=(r&Ee)*Po,r<U)||(r=t.get(e+7),n+=(r&Ee)*Ro,r<U))return n;throw new RangeError("Could not decode varint")}function Us(t,e,r=0){return e==null&&(e=Ce(Be(t))),e instanceof Uint8Array?Ut(t,e,r):Lu(t,e,r)}function fr(t,e=0){return t instanceof Uint8Array?No(t,e):Ou(t,e)}function ku(t){return t.buffer instanceof ArrayBuffer}function pt(t){return ku(t)?t:t.slice()}var Uo=new Float32Array([-0]),mt=new Uint8Array(Uo.buffer);function Fs(t,e,r){Uo[0]=t,e[r]=mt[0],e[r+1]=mt[1],e[r+2]=mt[2],e[r+3]=mt[3]}function Ks(t,e){return mt[0]=t[e],mt[1]=t[e+1],mt[2]=t[e+2],mt[3]=t[e+3],Uo[0]}var Mo=new Float64Array([-0]),ve=new Uint8Array(Mo.buffer);function $s(t,e,r){Mo[0]=t,e[r]=ve[0],e[r+1]=ve[1],e[r+2]=ve[2],e[r+3]=ve[3],e[r+4]=ve[4],e[r+5]=ve[5],e[r+6]=ve[6],e[r+7]=ve[7]}function Hs(t,e){return ve[0]=t[e],ve[1]=t[e+1],ve[2]=t[e+2],ve[3]=t[e+3],ve[4]=t[e+4],ve[5]=t[e+5],ve[6]=t[e+6],ve[7]=t[e+7],Mo[0]}var _u=BigInt(Number.MAX_SAFE_INTEGER),Pu=BigInt(Number.MIN_SAFE_INTEGER),Pe=class t{lo;hi;constructor(e,r){this.lo=e|0,this.hi=r|0}toNumber(e=!1){if(!e&&this.hi>>>31>0){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296}toBigInt(e=!1){if(e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let r=~this.lo+1>>>0,n=~this.hi>>>0;return r===0&&(n=n+1>>>0),-(BigInt(r)+(BigInt(n)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(e=!1){return this.toBigInt(e).toString()}zzEncode(){let e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this}zzDecode(){let e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this}length(){let e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}static fromBigInt(e){if(e===0n)return At;if(e<_u&&e>Pu)return this.fromNumber(Number(e));let r=e<0n;r&&(e=-e);let n=e>>32n,s=e-(n<<32n);return r&&(n=~n|0n,s=~s|0n,++s>zs&&(s=0n,++n>zs&&(n=0n))),new t(Number(s),Number(n))}static fromNumber(e){if(e===0)return At;let r=e<0;r&&(e=-e);let n=e>>>0,s=(e-n)/4294967296>>>0;return r&&(s=~s>>>0,n=~n>>>0,++n>4294967295&&(n=0,++s>4294967295&&(s=0))),new t(n,s)}static from(e){return typeof e=="number"?t.fromNumber(e):typeof e=="bigint"?t.fromBigInt(e):typeof e=="string"?t.fromBigInt(BigInt(e)):e.low!=null||e.high!=null?new t(e.low>>>0,e.high>>>0):At}},At=new Pe(0,0);At.toBigInt=function(){return 0n};At.zzEncode=At.zzDecode=function(){return this};At.length=function(){return 1};var zs=4294967296n;function Vs(t){let e=0,r=0;for(let n=0;n<t.length;++n)r=t.charCodeAt(n),r<128?e+=1:r<2048?e+=2:(r&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320?(++n,e+=4):e+=3;return e}function Gs(t,e,r){if(r-e<1)return"";let s,o=[],c=0,i;for(;e<r;)i=t[e++],i<128?o[c++]=i:i>191&&i<224?o[c++]=(i&31)<<6|t[e++]&63:i>239&&i<365?(i=((i&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,o[c++]=55296+(i>>10),o[c++]=56320+(i&1023)):o[c++]=(i&15)<<12|(t[e++]&63)<<6|t[e++]&63,c>8191&&((s??(s=[])).push(String.fromCharCode.apply(String,o)),c=0);return s!=null?(c>0&&s.push(String.fromCharCode.apply(String,o.slice(0,c))),s.join("")):String.fromCharCode.apply(String,o.slice(0,c))}function Fo(t,e,r){let n=r,s,o;for(let c=0;c<t.length;++c)s=t.charCodeAt(c),s<128?e[r++]=s:s<2048?(e[r++]=s>>6|192,e[r++]=s&63|128):(s&64512)===55296&&((o=t.charCodeAt(c+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++c,e[r++]=s>>18|240,e[r++]=s>>12&63|128,e[r++]=s>>6&63|128,e[r++]=s&63|128):(e[r++]=s>>12|224,e[r++]=s>>6&63|128,e[r++]=s&63|128);return r-n}function Ve(t,e){return RangeError(`index out of range: ${t.pos} + ${e??1} > ${t.len}`)}function Jr(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}var Ko=class{buf;pos;len;_slice=Uint8Array.prototype.subarray;constructor(e){this.buf=pt(e),this.pos=0,this.len=e.length}uint32(){let e=4294967295;if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Ve(this,10);return e}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw Ve(this,4);return Jr(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw Ve(this,4);return Jr(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw Ve(this,4);let e=Ks(this.buf,this.pos);return this.pos+=4,e}double(){if(this.pos+8>this.len)throw Ve(this,4);let e=Hs(this.buf,this.pos);return this.pos+=8,e}bytes(){let e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw Ve(this,e);return this.pos+=e,r===n?new Uint8Array(0):this.buf.subarray(r,n)}string(){let e=this.bytes();return Gs(e,0,e.length)}skip(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Ve(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Ve(this);while((this.buf[this.pos++]&128)!==0);return this}skipType(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(e=this.uint32()&7)!==4;)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${e} at offset ${this.pos}`)}return this}readLongVarint(){let e=new Pe(0,0),r=0;if(this.len-this.pos>4){for(;r<4;++r)if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(this.buf[this.pos]&127)<<28)>>>0,e.hi=(e.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return e;r=0}else{for(;r<3;++r){if(this.pos>=this.len)throw Ve(this);if(e.lo=(e.lo|(this.buf[this.pos]&127)<<r*7)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(this.buf[this.pos++]&127)<<r*7)>>>0,e}if(this.len-this.pos>4){for(;r<5;++r)if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}else for(;r<5;++r){if(this.pos>=this.len)throw Ve(this);if(e.hi=(e.hi|(this.buf[this.pos]&127)<<r*7+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw Ve(this,8);let e=Jr(this.buf,this.pos+=4),r=Jr(this.buf,this.pos+=4);return new Pe(e,r)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){let e=No(this.buf,this.pos);return this.pos+=Be(e),e}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}};function dr(t){return new Ko(t instanceof Uint8Array?t:t.subarray())}function Q(t,e,r){let n=dr(t);return e.decode(n,void 0,r)}var pc=le("node:buffer");var Go={};ke(Go,{base10:()=>Hu});var Rh=new Uint8Array(0);function qs(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}function Te(t){if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return Dt(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return Dt(new Uint8Array(t.buffer,t.byteOffset,t.byteLength));throw new Error("Unknown type, must be binary type")}function Zs(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var Ys=4096;function js(t){let e=t.length;if(e<=Ys)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.subarray(n,n+=Ys));return r}function Ru(t){return t?.buffer instanceof ArrayBuffer}function Dt(t){return Ru(t)?t:t.slice()}function Nu(t,e,r){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),s=0;s<n.length;s++)n[s]=255;for(var o=0;o<t.length;o++){var c=t.charAt(o),i=c.charCodeAt(0);if(n[i]!==255)throw new TypeError(c+" is ambiguous");if(n[i]=o,r){var a=c.toLowerCase().charCodeAt(0),u=c.toUpperCase().charCodeAt(0);a!==i&&(n[a]=o),u!==i&&(n[u]=o)}}var l=t.length,f=t.charAt(0),d=Math.log(l)/Math.log(256),p=Math.log(256)/Math.log(l);function x(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var T=0,P=0,_=0,M=y.length;_!==M&&y[_]===0;)_++,T++;for(var X=(M-_)*p+1>>>0,ie=new Uint8Array(X);_!==M;){for(var re=y[_],we=0,V=X-1;(re!==0||we<P)&&V!==-1;V--,we++)re+=256*ie[V]>>>0,ie[V]=re%l>>>0,re=re/l>>>0;if(re!==0)throw new Error("Non-zero carry");P=we,_++}for(var me=X-P;me!==X&&ie[me]===0;)me++;for(var Oe=f.repeat(T);me<X;++me)Oe+=t.charAt(ie[me]);return Oe}function D(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;var T=0;if(y[T]!==" "){for(var P=0,_=0;y[T]===f;)P++,T++;for(var M=(y.length-T)*d+1>>>0,X=new Uint8Array(M);y[T];){var ie=y.charCodeAt(T);if(ie>255)return;var re=n[ie];if(re===255)return;for(var we=0,V=M-1;(re!==0||we<_)&&V!==-1;V--,we++)re+=l*X[V]>>>0,X[V]=re%256>>>0,re=re/256>>>0;if(re!==0)throw new Error("Non-zero carry");_=we,T++}if(y[T]!==" "){for(var me=M-_;me!==M&&X[me]===0;)me++;for(var Oe=new Uint8Array(P+(M-me)),ft=P;me!==M;)Oe[ft++]=X[me++];return Oe}}}function b(y){var T=D(y);if(T)return T;throw new Error(`Non-${e} character`)}return{encode:x,decodeUnsafe:D,decode:b}}var Uu=Nu,Mu=Uu,Qs=Mu;var $o=class{name;prefix;baseEncode;constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Ho=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,r,n){this.name=e,this.prefix=r;let s=r.codePointAt(0);if(s===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=s,this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Js(this,e)}},zo=class{decoders;constructor(e){this.decoders=e}or(e){return Js(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n!=null)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Js(t,e){return new zo({...t.decoders??{[t.prefix]:t},...e.decoders??{[e.prefix]:e}})}var Vo=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,r,n,s){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=s,this.encoder=new $o(e,r,n),this.decoder=new Ho(e,r,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Mt({name:t,prefix:e,encode:r,decode:n}){return new Vo(t,e,r,n)}function yt({name:t,prefix:e,alphabet:r,caseInsensitive:n=!1}){let{encode:s,decode:o}=Qs(r,t,n);return Mt({prefix:e,name:t,encode:s,decode:c=>Te(o(c))})}function Fu(t,e,r,n){let s=t.length;for(;t[s-1]==="=";)--s;let o=new Uint8Array(s*r/8|0),c=0,i=0,a=0;for(let u=0;u<s;++u){let l=e[t[u]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);i=i<<r|l,c+=r,c>=8&&(c-=8,o[a++]=255&i>>c)}if(c>=r||(255&i<<8-c)!==0)throw new SyntaxError("Unexpected end of data");return o}function Ku(t,e,r){let n=e[e.length-1]==="=",s=(1<<r)-1,o="",c=0,i=0;for(let a=0;a<t.length;++a)for(i=i<<8|t[a],c+=8;c>r;)c-=r,o+=e[s&i>>c];if(c!==0&&(o+=e[s&i<<r-c]),n)for(;(o.length*r&7)!==0;)o+="=";return o}function $u(t,e){let r={};for(let n=0;n<t.length;++n)if(t[n]!=="="&&(r[t[n]]=n,e)){let s=t[n].toLowerCase(),o=t[n].toUpperCase();s!==t[n]&&(r[s]=n),o!==t[n]&&(r[o]=n)}return r}function ne({name:t,prefix:e,bitsPerChar:r,alphabet:n,caseInsensitive:s=!1}){let o=$u(n,s);return Mt({prefix:e,name:t,encode(c){return Ku(c,n,r)},decode(c){return Fu(c,o,r,t)}})}var Hu=yt({prefix:"9",name:"base10",alphabet:"0123456789"});var Wo={};ke(Wo,{base16:()=>zu,base16upper:()=>Vu});var zu=ne({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4,caseInsensitive:!0}),Vu=ne({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4,caseInsensitive:!0});var Yo={};ke(Yo,{base2:()=>Gu});var Gu=ne({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var qo={};ke(qo,{base256emoji:()=>ju});var ec=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Wu=ec.reduce((t,e,r)=>(t[r]=e,t),[]),Yu=ec.reduce((t,e,r)=>{let n=e.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${e}`);return t[n]=r,t},[]);function qu(t){return t.reduce((e,r)=>(e+=Wu[r],e),"")}function Zu(t){let e=[];for(let r of t){let n=r.codePointAt(0);if(n==null)throw new Error(`Invalid character: ${r}`);let s=Yu[n];if(s==null)throw new Error(`Non-base256emoji character: ${r}`);e.push(s)}return new Uint8Array(e)}var ju=Mt({prefix:"\u{1F680}",name:"base256emoji",encode:qu,decode:Zu});var Zo={};ke(Zo,{base32:()=>je,base32hex:()=>el,base32hexpad:()=>rl,base32hexpadupper:()=>nl,base32hexupper:()=>tl,base32pad:()=>Qu,base32padupper:()=>Ju,base32upper:()=>Xu,base32z:()=>ol});var je=ne({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5,caseInsensitive:!0}),Xu=ne({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5,caseInsensitive:!0}),Qu=ne({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5,caseInsensitive:!0}),Ju=ne({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5,caseInsensitive:!0}),el=ne({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5,caseInsensitive:!0}),tl=ne({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5,caseInsensitive:!0}),rl=ne({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5,caseInsensitive:!0}),nl=ne({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5,caseInsensitive:!0}),ol=ne({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var jo={};ke(jo,{base36:()=>hr,base36upper:()=>il});var hr=yt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz",caseInsensitive:!0}),il=yt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",caseInsensitive:!0});var Xo={};ke(Xo,{base58btc:()=>ae,base58flickr:()=>sl});var ae=yt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sl=yt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var ei={};ke(ei,{base64:()=>Qo,base64pad:()=>cl,base64url:()=>Jo,base64urlpad:()=>al});var Qo=ne({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cl=ne({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Jo=ne({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),al=ne({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var ti={};ke(ti,{base8:()=>ul});var ul=ne({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ri={};ke(ri,{identity:()=>ll});var ll=Mt({prefix:"\0",name:"identity",encode:t=>js(Te(t)),decode:t=>Te(Zs(t))});var Xh=new TextEncoder,Qh=new TextDecoder;var oi={};ke(oi,{identity:()=>Ge});var hl=nc,tc=128,pl=127,ml=~pl,yl=Math.pow(2,31);function nc(t,e,r){e=e||[],r=r||0;for(var n=r;t>=yl;)e[r++]=t&255|tc,t/=128;for(;t&ml;)e[r++]=t&255|tc,t>>>=7;return e[r]=t|0,nc.bytes=r-n+1,e}var bl=ni,gl=128,rc=127;function ni(t,n){var r=0,n=n||0,s=0,o=n,c,i=t.length;do{if(o>=i)throw ni.bytes=0,new RangeError("Could not decode varint");c=t[o++],r+=s<28?(c&rc)<<s:(c&rc)*Math.pow(2,s),s+=7}while(c>=gl);return ni.bytes=o-n,r}var wl=Math.pow(2,7),xl=Math.pow(2,14),El=Math.pow(2,21),vl=Math.pow(2,28),Sl=Math.pow(2,35),Tl=Math.pow(2,42),Al=Math.pow(2,49),Dl=Math.pow(2,56),Il=Math.pow(2,63),Cl=function(t){return t<wl?1:t<xl?2:t<El?3:t<vl?4:t<Sl?5:t<Tl?6:t<Al?7:t<Dl?8:t<Il?9:10},Bl={encode:hl,decode:bl,encodingLength:Cl},Ll=Bl,pr=Ll;function mr(t,e=0){let r=pr.decode(t,e),n=pr.decode.bytes;if(n>9)throw new RangeError("Invalid varint: too long");if(n>1&&t[e+n-1]===0)throw new RangeError("Invalid varint: not minimally encoded");return[r,n]}function Ft(t,e,r=0){return pr.encode(t,e,r),e}function Kt(t){return pr.encodingLength(t)}function Ht(t,e){let r=e.byteLength,n=Kt(t),s=n+Kt(r),o=new Uint8Array(s+r);return Ft(t,o,0),Ft(r,o,n),o.set(e,s),new $t(t,r,e,o)}function $e(t){let e=Te(t),[r,n]=mr(e),[s,o]=mr(e.subarray(n)),c=e.subarray(n+o);if(c.byteLength!==s)throw new Error("Incorrect length");return new $t(r,s,c,e)}function oc(t,e){if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&qs(t.bytes,r.bytes)}}var $t=class{code;size;digest;bytes;constructor(e,r,n,s){this.code=e,this.size=r,this.digest=Dt(n),this.bytes=Dt(s)}};var ic=0,Ol="identity",sc=Te;function kl(t,e){if(e?.truncate!=null&&e.truncate!==t.byteLength){if(e.truncate<0||e.truncate>t.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${t.byteLength}`);t=t.subarray(0,e.truncate)}return Ht(ic,sc(t))}var Ge={code:ic,name:Ol,encode:sc,digest:kl};var ui={};ke(ui,{sha256:()=>ai,sha512:()=>Pl});var ci=_e(le("node:crypto"),1);var _l=20;function si({name:t,code:e,encode:r,minDigestLength:n,maxDigestLength:s}){return new ii(t,e,r,n,s)}var ii=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,r,n,s,o){this.name=e,this.code=r,this.encode=n,this.minDigestLength=s??_l,this.maxDigestLength=o}digest(e,r){if(r?.truncate!=null){if(r.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&r.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let n=this.encode(e);return n instanceof Uint8Array?cc(n,this.code,r?.truncate):n.then(s=>cc(s,this.code,r?.truncate))}else throw Error("Unknown type, must be binary type")}};function cc(t,e,r){if(r!=null&&r!==t.byteLength){if(r>t.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${t.byteLength}`);t=t.subarray(0,r)}return Ht(e,t)}var ai=si({name:"sha2-256",code:18,encode:t=>Te(ci.default.createHash("sha256").update(t).digest())}),Pl=si({name:"sha2-512",code:19,encode:t=>Te(ci.default.createHash("sha512").update(t).digest())});function uc(t,e){let{bytes:r,version:n}=t;return n===0?Nl(r,li(t),e??ae.encoder):Ul(r,li(t),e??je.encoder)}var lc=new WeakMap;function li(t){let e=lc.get(t);if(e==null){let r=new Map;return lc.set(t,r),r}return e}var de=class t{code;version;multihash;bytes;"/";constructor(e,r,n,s){this.code=r,this.version=e,this.multihash=n,this.bytes=Dt(s),this["/"]=this.bytes}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:e,multihash:r}=this;if(e!==yr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==Ml)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Ht(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return t.equals(this,e)}static equals(e,r){let n=r;return n!=null&&e.code===n.code&&e.version===n.version&&oc(e.multihash,n.multihash)}toString(e){return uc(this,e)}toJSON(){return{"/":uc(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let r=e;if(r instanceof t)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:s,multihash:o,bytes:c}=r;return new t(n,s,o,c??fc(n,s,o.bytes))}else if(r[Fl]===!0){let{version:n,multihash:s,code:o}=r,c=$e(s);return t.create(n,o,c)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(r!==yr)throw new Error(`Version 0 CID must use dag-pb (code: ${yr}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let s=fc(e,r,n.bytes);return new t(e,r,n,s)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,yr,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,s=Te(e.subarray(n,n+r.multihashSize));if(s.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=s.subarray(r.multihashSize-r.digestSize),c=new $t(r.multihashCode,r.digestSize,o,s);return[r.version===0?t.createV0(c):t.createV1(r.codec,c),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[f,d]=mr(e.subarray(r));return r+=d,f},s=n(),o=yr;if(s===18)s=0,r=0;else if(s===1)o=n();else throw s===0?new RangeError("Invalid CID version, v0 is always implicit"):new RangeError(`Invalid CID version ${s}`);let c=r,i=n(),a=n(),u=r+a,l=u-c;return{version:s,codec:o,multihashCode:i,digestSize:a,multihashSize:l,size:u}}static parse(e,r){let[n,s]=Rl(e,r),o=t.decode(s);if(o.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return li(o).set(n,e),o}};function Rl(t,e){switch(t[0]){case"Q":{let r=e??ae;return[ae.prefix,r.decode(`${ae.prefix}${t}`)]}case ae.prefix:{let r=e??ae;return[ae.prefix,r.decode(t)]}case je.prefix:{let r=e??je;return[je.prefix,r.decode(t)]}case hr.prefix:{let r=e??hr;return[hr.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}}function Nl(t,e,r){let{prefix:n}=r;if(n!==ae.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let s=e.get(n);if(s==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return s}function Ul(t,e,r){let{prefix:n}=r,s=e.get(n);if(s==null){let o=r.encode(t);return e.set(n,o),o}else return s}var yr=112,Ml=18;function fc(t,e,r){let n=Kt(t),s=n+Kt(e),o=new Uint8Array(s+r.byteLength);return Ft(t,o,0),Ft(e,o,n),o.set(r,s),o}var Fl=Symbol.for("@ipld/js-cid/CID");var br={...ri,...Yo,...ti,...Go,...Wo,...Zo,...jo,...Xo,...ei,...qo},Ep={...ui,...oi};function hc(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var dc=hc("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),fi=hc("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);let e=Ce(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Kl={utf8:dc,"utf-8":dc,hex:br.base16,latin1:fi,ascii:fi,binary:fi,...br},tn=Kl;function Ae(t,e="utf8"){let r=tn[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return e==="utf8"||e==="utf-8"?ht(pc.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function di(t){let e=t??8192,r=e>>>1,n,s=e;return function(c){if(c<1||c>r)return Ce(c);s+c>e&&(n=Ce(e),s=0);let i=n.subarray(s,s+=c);return(s&7)!==0&&(s=(s|7)+1),i}}var It=class{fn;len;next;val;constructor(e,r,n){this.fn=e,this.len=r,this.next=void 0,this.val=n}};function hi(){}var mi=class{head;tail;len;next;constructor(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}},$l=di();function Hl(t){return globalThis.Buffer!=null?Ce(t):$l(t)}var wr=class{len;head;tail;states;constructor(){this.len=0,this.head=new It(hi,0,0),this.tail=this.head,this.states=null}_push(e,r,n){return this.tail=this.tail.next=new It(e,r,n),this.len+=r,this}uint32(e){return this.len+=(this.tail=this.tail.next=new yi((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this}int32(e){return e<0?this._push(rn,10,Pe.fromNumber(e)):this.uint32(e)}sint32(e){return this.uint32((e<<1^e>>31)>>>0)}uint64(e){let r=Pe.fromBigInt(e);return this._push(rn,r.length(),r)}uint64Number(e){return this._push(Ut,Be(e),e)}uint64String(e){return this.uint64(BigInt(e))}int64(e){return this.uint64(e)}int64Number(e){return this.uint64Number(e)}int64String(e){return this.uint64String(e)}sint64(e){let r=Pe.fromBigInt(e).zzEncode();return this._push(rn,r.length(),r)}sint64Number(e){let r=Pe.fromNumber(e).zzEncode();return this._push(rn,r.length(),r)}sint64String(e){return this.sint64(BigInt(e))}bool(e){return this._push(pi,1,e?1:0)}fixed32(e){return this._push(gr,4,e>>>0)}sfixed32(e){return this.fixed32(e)}fixed64(e){let r=Pe.fromBigInt(e);return this._push(gr,4,r.lo)._push(gr,4,r.hi)}fixed64Number(e){let r=Pe.fromNumber(e);return this._push(gr,4,r.lo)._push(gr,4,r.hi)}fixed64String(e){return this.fixed64(BigInt(e))}sfixed64(e){return this.fixed64(e)}sfixed64Number(e){return this.fixed64Number(e)}sfixed64String(e){return this.fixed64String(e)}float(e){return this._push(Fs,4,e)}double(e){return this._push($s,8,e)}bytes(e){let r=e.length>>>0;return r===0?this._push(pi,1,0):this.uint32(r)._push(Vl,r,e)}string(e){let r=Vs(e);return r!==0?this.uint32(r)._push(Fo,r,e):this._push(pi,1,0)}fork(){return this.states=new mi(this),this.head=this.tail=new It(hi,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new It(hi,0,0),this.len=0),this}ldelim(){let e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n!==0&&(this.tail.next=e.next,this.tail=r,this.len+=n),this}finish(){let e=this.head.next,r=Hl(this.len),n=0;for(;e!=null;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r}};function pi(t,e,r){e[r]=t&255}function zl(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}var yi=class extends It{next;constructor(e,r){super(zl,e,r),this.next=void 0}};function rn(t,e,r){for(;t.hi!==0;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}function gr(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Vl(t,e,r){e.set(t,r)}globalThis.Buffer!=null&&(wr.prototype.bytes=function(t){let e=t.length>>>0;return this.uint32(e),e>0&&this._push(Gl,e,t),this},wr.prototype.string=function(t){let e=globalThis.Buffer.byteLength(t);return this.uint32(e),e>0&&this._push(Wl,e,t),this});function Gl(t,e,r){e.set(t,r)}function Wl(t,e,r){t.length<40?Fo(t,e,r):e.utf8Write!=null?e.utf8Write(t,r):e.set(Ae(t),r)}function bi(){return new wr}function J(t,e){let r=bi();return e.encode(t,r,{lengthDelimited:!1}),r.finish()}function*ee(t,e,r){let n=dr(t);yield*e.stream(n,void 0,".",r)}var nn={VARINT:0,BIT64:1,LENGTH_DELIMITED:2,START_GROUP:3,END_GROUP:4,BIT32:5};function on(t,e,r,n,s){return{name:t,type:e,encode:r,decode:n,stream:s}}function We(t){function e(o){if(t[o.toString()]==null)throw new Error("Invalid enum value");return t[o]}let r=function(c,i){let a=e(c);i.int32(a)},n=function(c){let i=c.int32();return e(i)},s=function*(c,i){};return on("enum",nn.VARINT,r,n,s)}function te(t,e,r){return on("message",nn.LENGTH_DELIMITED,t,e,r)}var G=class extends Error{code="ERR_MAX_LENGTH";name="MaxLengthError"};var H;(function(t){let e;(function(i){i.IDENTIFY="IDENTIFY",i.CONNECT="CONNECT",i.STREAM_OPEN="STREAM_OPEN",i.STREAM_HANDLER="STREAM_HANDLER",i.DHT="DHT",i.LIST_PEERS="LIST_PEERS",i.CONNMANAGER="CONNMANAGER",i.DISCONNECT="DISCONNECT",i.PUBSUB="PUBSUB",i.PEERSTORE="PEERSTORE"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.IDENTIFY=0]="IDENTIFY",i[i.CONNECT=1]="CONNECT",i[i.STREAM_OPEN=2]="STREAM_OPEN",i[i.STREAM_HANDLER=3]="STREAM_HANDLER",i[i.DHT=4]="DHT",i[i.LIST_PEERS=5]="LIST_PEERS",i[i.CONNMANAGER=6]="CONNMANAGER",i[i.DISCONNECT=7]="DISCONNECT",i[i.PUBSUB=8]="PUBSUB",i[i.PEERSTORE=9]="PEERSTORE"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.connect!=null&&(a.uint32(18),Er.codec().encode(i.connect,a)),i.streamOpen!=null&&(a.uint32(26),vr.codec().encode(i.streamOpen,a)),i.streamHandler!=null&&(a.uint32(34),Sr.codec().encode(i.streamHandler,a)),i.dht!=null&&(a.uint32(42),Re.codec().encode(i.dht,a)),i.connManager!=null&&(a.uint32(50),Ar.codec().encode(i.connManager,a)),i.disconnect!=null&&(a.uint32(58),Dr.codec().encode(i.disconnect,a)),i.pubsub!=null&&(a.uint32(66),Xe.codec().encode(i.pubsub,a)),i.peerStore!=null&&(a.uint32(74),Cr.codec().encode(i.peerStore,a)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.connect=Er.codec().decode(i,i.uint32(),{limits:u.limits?.connect});break}case 3:{l.streamOpen=vr.codec().decode(i,i.uint32(),{limits:u.limits?.streamOpen});break}case 4:{l.streamHandler=Sr.codec().decode(i,i.uint32(),{limits:u.limits?.streamHandler});break}case 5:{l.dht=Re.codec().decode(i,i.uint32(),{limits:u.limits?.dht});break}case 6:{l.connManager=Ar.codec().decode(i,i.uint32(),{limits:u.limits?.connManager});break}case 7:{l.disconnect=Dr.codec().decode(i,i.uint32(),{limits:u.limits?.disconnect});break}case 8:{l.pubsub=Xe.codec().decode(i,i.uint32(),{limits:u.limits?.pubsub});break}case 9:{l.peerStore=Cr.codec().decode(i,i.uint32(),{limits:u.limits?.peerStore});break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield*Er.codec().stream(i,i.uint32(),`${u}.connect`,{limits:l.limits?.connect});break}case 3:{yield*vr.codec().stream(i,i.uint32(),`${u}.streamOpen`,{limits:l.limits?.streamOpen});break}case 4:{yield*Sr.codec().stream(i,i.uint32(),`${u}.streamHandler`,{limits:l.limits?.streamHandler});break}case 5:{yield*Re.codec().stream(i,i.uint32(),`${u}.dht`,{limits:l.limits?.dht});break}case 6:{yield*Ar.codec().stream(i,i.uint32(),`${u}.connManager`,{limits:l.limits?.connManager});break}case 7:{yield*Dr.codec().stream(i,i.uint32(),`${u}.disconnect`,{limits:l.limits?.disconnect});break}case 8:{yield*Xe.codec().stream(i,i.uint32(),`${u}.pubsub`,{limits:l.limits?.pubsub});break}case 9:{yield*Cr.codec().stream(i,i.uint32(),`${u}.peerStore`,{limits:l.limits?.peerStore});break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(H||(H={}));var L;(function(t){let e;(function(i){i.OK="OK",i.ERROR="ERROR"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.OK=0]="OK",i[i.ERROR=1]="ERROR"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{if(u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.error!=null&&(a.uint32(18),Tr.codec().encode(i.error,a)),i.streamInfo!=null&&(a.uint32(26),Ct.codec().encode(i.streamInfo,a)),i.identify!=null&&(a.uint32(34),xr.codec().encode(i.identify,a)),i.dht!=null&&(a.uint32(42),He.codec().encode(i.dht,a)),i.peers!=null&&i.peers.length>0)for(let l of i.peers)a.uint32(50),Ye.codec().encode(l,a);i.pubsub!=null&&(a.uint32(58),Ir.codec().encode(i.pubsub,a)),i.peerStore!=null&&(a.uint32(66),Br.codec().encode(i.peerStore,a)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={peers:[]},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.error=Tr.codec().decode(i,i.uint32(),{limits:u.limits?.error});break}case 3:{l.streamInfo=Ct.codec().decode(i,i.uint32(),{limits:u.limits?.streamInfo});break}case 4:{l.identify=xr.codec().decode(i,i.uint32(),{limits:u.limits?.identify});break}case 5:{l.dht=He.codec().decode(i,i.uint32(),{limits:u.limits?.dht});break}case 6:{if(u.limits?.peers!=null&&l.peers.length===u.limits.peers)throw new G('Decode error - repeated field "peers" had too many elements');l.peers.push(Ye.codec().decode(i,i.uint32(),{limits:u.limits?.peers$}));break}case 7:{l.pubsub=Ir.codec().decode(i,i.uint32(),{limits:u.limits?.pubsub});break}case 8:{l.peerStore=Br.codec().decode(i,i.uint32(),{limits:u.limits?.peerStore});break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f={peers:0},d=a==null?i.len:i.pos+a;for(;i.pos<d;){let p=i.uint32();switch(p>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield*Tr.codec().stream(i,i.uint32(),`${u}.error`,{limits:l.limits?.error});break}case 3:{yield*Ct.codec().stream(i,i.uint32(),`${u}.streamInfo`,{limits:l.limits?.streamInfo});break}case 4:{yield*xr.codec().stream(i,i.uint32(),`${u}.identify`,{limits:l.limits?.identify});break}case 5:{yield*He.codec().stream(i,i.uint32(),`${u}.dht`,{limits:l.limits?.dht});break}case 6:{if(l.limits?.peers!=null&&f.peers===l.limits.peers)throw new G('Streaming decode error - repeated field "peers" had too many elements');for(let x of Ye.codec().stream(i,i.uint32(),`${u}.peers[]`,{limits:l.limits?.peers$}))yield{...x,index:f.peers};f.peers++;break}case 7:{yield*Ir.codec().stream(i,i.uint32(),`${u}.pubsub`,{limits:l.limits?.pubsub});break}case 8:{yield*Br.codec().stream(i,i.uint32(),`${u}.peerStore`,{limits:l.limits?.peerStore});break}default:{i.skipType(p&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(L||(L={}));var xr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.id!=null&&o.id.byteLength>0&&(c.uint32(10),c.bytes(o.id)),o.addrs!=null&&o.addrs.length>0)for(let a of o.addrs)c.uint32(18),c.bytes(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={id:fe(0),addrs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.id=o.bytes();break}case 2:{if(i.limits?.addrs!=null&&a.addrs.length===i.limits.addrs)throw new G('Decode error - repeated field "addrs" had too many elements');a.addrs.push(o.bytes());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={addrs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.id`,value:o.bytes()};break}case 2:{if(a.limits?.addrs!=null&&u.addrs===a.limits.addrs)throw new G('Streaming decode error - repeated field "addrs" had too many elements');yield{field:`${i}.addrs[]`,index:u.addrs,value:o.bytes()},u.addrs++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(xr||(xr={}));var Er;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),o.addrs!=null&&o.addrs.length>0)for(let a of o.addrs)c.uint32(18),c.bytes(a);o.timeout!=null&&(c.uint32(24),c.int64(o.timeout)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0),addrs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=o.bytes();break}case 2:{if(i.limits?.addrs!=null&&a.addrs.length===i.limits.addrs)throw new G('Decode error - repeated field "addrs" had too many elements');a.addrs.push(o.bytes());break}case 3:{a.timeout=o.int64();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={addrs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.peer`,value:o.bytes()};break}case 2:{if(a.limits?.addrs!=null&&u.addrs===a.limits.addrs)throw new G('Streaming decode error - repeated field "addrs" had too many elements');yield{field:`${i}.addrs[]`,index:u.addrs,value:o.bytes()},u.addrs++;break}case 3:{yield{field:`${i}.timeout`,value:o.int64()};break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Er||(Er={}));var vr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),o.proto!=null&&o.proto.length>0)for(let a of o.proto)c.uint32(18),c.string(a);o.timeout!=null&&(c.uint32(24),c.int64(o.timeout)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0),proto:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=o.bytes();break}case 2:{if(i.limits?.proto!=null&&a.proto.length===i.limits.proto)throw new G('Decode error - repeated field "proto" had too many elements');a.proto.push(o.string());break}case 3:{a.timeout=o.int64();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={proto:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.peer`,value:o.bytes()};break}case 2:{if(a.limits?.proto!=null&&u.proto===a.limits.proto)throw new G('Streaming decode error - repeated field "proto" had too many elements');yield{field:`${i}.proto[]`,index:u.proto,value:o.string()},u.proto++;break}case 3:{yield{field:`${i}.timeout`,value:o.int64()};break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(vr||(vr={}));var Sr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.addr!=null&&o.addr.byteLength>0&&(c.uint32(10),c.bytes(o.addr)),o.proto!=null&&o.proto.length>0)for(let a of o.proto)c.uint32(18),c.string(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={addr:fe(0),proto:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.addr=o.bytes();break}case 2:{if(i.limits?.proto!=null&&a.proto.length===i.limits.proto)throw new G('Decode error - repeated field "proto" had too many elements');a.proto.push(o.string());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={proto:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.addr`,value:o.bytes()};break}case 2:{if(a.limits?.proto!=null&&u.proto===a.limits.proto)throw new G('Streaming decode error - repeated field "proto" had too many elements');yield{field:`${i}.proto[]`,index:u.proto,value:o.string()},u.proto++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Sr||(Sr={}));var Tr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{i.lengthDelimited!==!1&&c.fork(),o.msg!=null&&o.msg!==""&&(c.uint32(10),c.string(o.msg)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={msg:""},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?a.msg=o.string():o.skipType(l&7)}return a},function*(o,c,i,a={}){let u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?yield{field:`${i}.msg`,value:o.string()}:o.skipType(l&7)}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Tr||(Tr={}));var Ct;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),o.addr!=null&&o.addr.byteLength>0&&(c.uint32(18),c.bytes(o.addr)),o.proto!=null&&o.proto!==""&&(c.uint32(26),c.string(o.proto)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0),addr:fe(0),proto:""},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=o.bytes();break}case 2:{a.addr=o.bytes();break}case 3:{a.proto=o.string();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{yield{field:`${i}.peer`,value:o.bytes()};break}case 2:{yield{field:`${i}.addr`,value:o.bytes()};break}case 3:{yield{field:`${i}.proto`,value:o.string()};break}default:{o.skipType(l&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Ct||(Ct={}));var Re;(function(t){let e;(function(i){i.FIND_PEER="FIND_PEER",i.FIND_PEERS_CONNECTED_TO_PEER="FIND_PEERS_CONNECTED_TO_PEER",i.FIND_PROVIDERS="FIND_PROVIDERS",i.GET_CLOSEST_PEERS="GET_CLOSEST_PEERS",i.GET_PUBLIC_KEY="GET_PUBLIC_KEY",i.GET_VALUE="GET_VALUE",i.SEARCH_VALUE="SEARCH_VALUE",i.PUT_VALUE="PUT_VALUE",i.PROVIDE="PROVIDE"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.FIND_PEER=0]="FIND_PEER",i[i.FIND_PEERS_CONNECTED_TO_PEER=1]="FIND_PEERS_CONNECTED_TO_PEER",i[i.FIND_PROVIDERS=2]="FIND_PROVIDERS",i[i.GET_CLOSEST_PEERS=3]="GET_CLOSEST_PEERS",i[i.GET_PUBLIC_KEY=4]="GET_PUBLIC_KEY",i[i.GET_VALUE=5]="GET_VALUE",i[i.SEARCH_VALUE=6]="SEARCH_VALUE",i[i.PUT_VALUE=7]="PUT_VALUE",i[i.PROVIDE=8]="PROVIDE"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.peer!=null&&(a.uint32(18),a.bytes(i.peer)),i.cid!=null&&(a.uint32(26),a.bytes(i.cid)),i.key!=null&&(a.uint32(34),a.bytes(i.key)),i.value!=null&&(a.uint32(42),a.bytes(i.value)),i.count!=null&&(a.uint32(48),a.int32(i.count)),i.timeout!=null&&(a.uint32(56),a.int64(i.timeout)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.peer=i.bytes();break}case 3:{l.cid=i.bytes();break}case 4:{l.key=i.bytes();break}case 5:{l.value=i.bytes();break}case 6:{l.count=i.int32();break}case 7:{l.timeout=i.int64();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.peer`,value:i.bytes()};break}case 3:{yield{field:`${u}.cid`,value:i.bytes()};break}case 4:{yield{field:`${u}.key`,value:i.bytes()};break}case 5:{yield{field:`${u}.value`,value:i.bytes()};break}case 6:{yield{field:`${u}.count`,value:i.int32()};break}case 7:{yield{field:`${u}.timeout`,value:i.int64()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Re||(Re={}));var He;(function(t){let e;(function(i){i.BEGIN="BEGIN",i.VALUE="VALUE",i.END="END"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.BEGIN=0]="BEGIN",i[i.VALUE=1]="VALUE",i[i.END=2]="END"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.peer!=null&&(a.uint32(18),Ye.codec().encode(i.peer,a)),i.value!=null&&(a.uint32(26),a.bytes(i.value)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.peer=Ye.codec().decode(i,i.uint32(),{limits:u.limits?.peer});break}case 3:{l.value=i.bytes();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield*Ye.codec().stream(i,i.uint32(),`${u}.peer`,{limits:l.limits?.peer});break}case 3:{yield{field:`${u}.value`,value:i.bytes()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(He||(He={}));var Ye;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.id!=null&&o.id.byteLength>0&&(c.uint32(10),c.bytes(o.id)),o.addrs!=null&&o.addrs.length>0)for(let a of o.addrs)c.uint32(18),c.bytes(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={id:fe(0),addrs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.id=o.bytes();break}case 2:{if(i.limits?.addrs!=null&&a.addrs.length===i.limits.addrs)throw new G('Decode error - repeated field "addrs" had too many elements');a.addrs.push(o.bytes());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={addrs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.id`,value:o.bytes()};break}case 2:{if(a.limits?.addrs!=null&&u.addrs===a.limits.addrs)throw new G('Streaming decode error - repeated field "addrs" had too many elements');yield{field:`${i}.addrs[]`,index:u.addrs,value:o.bytes()},u.addrs++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Ye||(Ye={}));var Ar;(function(t){let e;(function(i){i.TAG_PEER="TAG_PEER",i.UNTAG_PEER="UNTAG_PEER",i.TRIM="TRIM"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.TAG_PEER=0]="TAG_PEER",i[i.UNTAG_PEER=1]="UNTAG_PEER",i[i.TRIM=2]="TRIM"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.peer!=null&&(a.uint32(18),a.bytes(i.peer)),i.tag!=null&&(a.uint32(26),a.string(i.tag)),i.weight!=null&&(a.uint32(32),a.int64(i.weight)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.peer=i.bytes();break}case 3:{l.tag=i.string();break}case 4:{l.weight=i.int64();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.peer`,value:i.bytes()};break}case 3:{yield{field:`${u}.tag`,value:i.string()};break}case 4:{yield{field:`${u}.weight`,value:i.int64()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Ar||(Ar={}));var Dr;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&o.peer.byteLength>0&&(c.uint32(10),c.bytes(o.peer)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={peer:fe(0)},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?a.peer=o.bytes():o.skipType(l&7)}return a},function*(o,c,i,a={}){let u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();l>>>3===1?yield{field:`${i}.peer`,value:o.bytes()}:o.skipType(l&7)}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Dr||(Dr={}));var Xe;(function(t){let e;(function(i){i.GET_TOPICS="GET_TOPICS",i.LIST_PEERS="LIST_PEERS",i.PUBLISH="PUBLISH",i.SUBSCRIBE="SUBSCRIBE"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.GET_TOPICS=0]="GET_TOPICS",i[i.LIST_PEERS=1]="LIST_PEERS",i[i.PUBLISH=2]="PUBLISH",i[i.SUBSCRIBE=3]="SUBSCRIBE"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.topic!=null&&(a.uint32(18),a.string(i.topic)),i.data!=null&&(a.uint32(26),a.bytes(i.data)),u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.topic=i.string();break}case 3:{l.data=i.bytes();break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.topic`,value:i.string()};break}case 3:{yield{field:`${u}.data`,value:i.bytes()};break}default:{i.skipType(d&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Xe||(Xe={}));var sn;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.from!=null&&(c.uint32(10),c.bytes(o.from)),o.data!=null&&(c.uint32(18),c.bytes(o.data)),o.seqno!=null&&(c.uint32(26),c.bytes(o.seqno)),o.topicIDs!=null&&o.topicIDs.length>0)for(let a of o.topicIDs)c.uint32(34),c.string(a);o.signature!=null&&(c.uint32(42),c.bytes(o.signature)),o.key!=null&&(c.uint32(50),c.bytes(o.key)),i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={topicIDs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.from=o.bytes();break}case 2:{a.data=o.bytes();break}case 3:{a.seqno=o.bytes();break}case 4:{if(i.limits?.topicIDs!=null&&a.topicIDs.length===i.limits.topicIDs)throw new G('Decode error - repeated field "topicIDs" had too many elements');a.topicIDs.push(o.string());break}case 5:{a.signature=o.bytes();break}case 6:{a.key=o.bytes();break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={topicIDs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield{field:`${i}.from`,value:o.bytes()};break}case 2:{yield{field:`${i}.data`,value:o.bytes()};break}case 3:{yield{field:`${i}.seqno`,value:o.bytes()};break}case 4:{if(a.limits?.topicIDs!=null&&u.topicIDs===a.limits.topicIDs)throw new G('Streaming decode error - repeated field "topicIDs" had too many elements');yield{field:`${i}.topicIDs[]`,index:u.topicIDs,value:o.string()},u.topicIDs++;break}case 5:{yield{field:`${i}.signature`,value:o.bytes()};break}case 6:{yield{field:`${i}.key`,value:o.bytes()};break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(sn||(sn={}));var Ir;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.topics!=null&&o.topics.length>0)for(let a of o.topics)c.uint32(10),c.string(a);if(o.peerIDs!=null&&o.peerIDs.length>0)for(let a of o.peerIDs)c.uint32(18),c.bytes(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={topics:[],peerIDs:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{if(i.limits?.topics!=null&&a.topics.length===i.limits.topics)throw new G('Decode error - repeated field "topics" had too many elements');a.topics.push(o.string());break}case 2:{if(i.limits?.peerIDs!=null&&a.peerIDs.length===i.limits.peerIDs)throw new G('Decode error - repeated field "peerIDs" had too many elements');a.peerIDs.push(o.bytes());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={topics:0,peerIDs:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{if(a.limits?.topics!=null&&u.topics===a.limits.topics)throw new G('Streaming decode error - repeated field "topics" had too many elements');yield{field:`${i}.topics[]`,index:u.topics,value:o.string()},u.topics++;break}case 2:{if(a.limits?.peerIDs!=null&&u.peerIDs===a.limits.peerIDs)throw new G('Streaming decode error - repeated field "peerIDs" had too many elements');yield{field:`${i}.peerIDs[]`,index:u.peerIDs,value:o.bytes()},u.peerIDs++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Ir||(Ir={}));var Cr;(function(t){let e;(function(i){i.UNSPECIFIED="UNSPECIFIED",i.GET_PROTOCOLS="GET_PROTOCOLS",i.GET_PEER_INFO="GET_PEER_INFO"})(e=t.Type||(t.Type={}));let r;(function(i){i[i.UNSPECIFIED=0]="UNSPECIFIED",i[i.GET_PROTOCOLS=1]="GET_PROTOCOLS",i[i.GET_PEER_INFO=2]="GET_PEER_INFO"})(r||(r={})),(function(i){i.codec=()=>We(r)})(e=t.Type||(t.Type={}));let n;t.codec=()=>(n==null&&(n=te((i,a,u={})=>{if(u.lengthDelimited!==!1&&a.fork(),i.type!=null&&(a.uint32(8),t.Type.codec().encode(i.type,a)),i.id!=null&&(a.uint32(18),a.bytes(i.id)),i.protos!=null&&i.protos.length>0)for(let l of i.protos)a.uint32(26),a.string(l);u.lengthDelimited!==!1&&a.ldelim()},(i,a,u={})=>{let l={protos:[]},f=a==null?i.len:i.pos+a;for(;i.pos<f;){let d=i.uint32();switch(d>>>3){case 1:{l.type=t.Type.codec().decode(i);break}case 2:{l.id=i.bytes();break}case 3:{if(u.limits?.protos!=null&&l.protos.length===u.limits.protos)throw new G('Decode error - repeated field "protos" had too many elements');l.protos.push(i.string());break}default:{i.skipType(d&7);break}}}return l},function*(i,a,u,l={}){let f={protos:0},d=a==null?i.len:i.pos+a;for(;i.pos<d;){let p=i.uint32();switch(p>>>3){case 1:{yield{field:`${u}.type`,value:t.Type.codec().decode(i)};break}case 2:{yield{field:`${u}.id`,value:i.bytes()};break}case 3:{if(l.limits?.protos!=null&&f.protos===l.limits.protos)throw new G('Streaming decode error - repeated field "protos" had too many elements');yield{field:`${u}.protos[]`,index:f.protos,value:i.string()},f.protos++;break}default:{i.skipType(p&7);break}}}})),n);function s(i){return J(i,t.codec())}t.encode=s;function o(i,a){return Q(i,t.codec(),a)}t.decode=o;function c(i,a){return ee(i,t.codec(),a)}t.stream=c})(Cr||(Cr={}));var Br;(function(t){let e;t.codec=()=>(e==null&&(e=te((o,c,i={})=>{if(i.lengthDelimited!==!1&&c.fork(),o.peer!=null&&(c.uint32(10),Ye.codec().encode(o.peer,c)),o.protos!=null&&o.protos.length>0)for(let a of o.protos)c.uint32(18),c.string(a);i.lengthDelimited!==!1&&c.ldelim()},(o,c,i={})=>{let a={protos:[]},u=c==null?o.len:o.pos+c;for(;o.pos<u;){let l=o.uint32();switch(l>>>3){case 1:{a.peer=Ye.codec().decode(o,o.uint32(),{limits:i.limits?.peer});break}case 2:{if(i.limits?.protos!=null&&a.protos.length===i.limits.protos)throw new G('Decode error - repeated field "protos" had too many elements');a.protos.push(o.string());break}default:{o.skipType(l&7);break}}}return a},function*(o,c,i,a={}){let u={protos:0},l=c==null?o.len:o.pos+c;for(;o.pos<l;){let f=o.uint32();switch(f>>>3){case 1:{yield*Ye.codec().stream(o,o.uint32(),`${i}.peer`,{limits:a.limits?.peer});break}case 2:{if(a.limits?.protos!=null&&u.protos===a.limits.protos)throw new G('Streaming decode error - repeated field "protos" had too many elements');yield{field:`${i}.protos[]`,index:u.protos,value:o.string()},u.protos++;break}default:{o.skipType(f&7);break}}}})),e);function r(o){return J(o,t.codec())}t.encode=r;function n(o,c){return Q(o,t.codec(),c)}t.decode=n;function s(o,c){return ee(o,t.codec(),c)}t.stream=s})(Br||(Br={}));function mc(t){let e=new globalThis.AbortController;function r(){let o=t.filter(c=>c?.aborted===!0).map(c=>c?.reason).pop();e.abort(o);for(let c of t)c?.removeEventListener!=null&&c.removeEventListener("abort",r)}for(let o of t){if(o?.aborted===!0){r();break}o?.addEventListener!=null&&o.addEventListener("abort",r)}function n(){for(let o of t)o?.removeEventListener!=null&&o.removeEventListener("abort",r)}let s=e.signal;return s.clear=n,s}var Lr=class{onConnection;constructor(e){this.onConnection=e}async upgradeInbound(e){this.onConnection?.(e)}async upgradeOutbound(e){return e}createInboundAbortSignal(e){return mc([e])}getStreamMuxers(){return new Map}getConnectionEncrypters(){return new Map}};var cn=class extends Error{static name="AbortError";constructor(e="The operation was aborted"){super(e),this.name="AbortError"}};var B=class extends Error{static name="InvalidParametersError";constructor(e="Invalid parameters"){super(e),this.name="InvalidParametersError"}},Or=class extends Error{static name="InvalidPublicKeyError";constructor(e="Invalid public key"){super(e),this.name="InvalidPublicKeyError"}};var an=class extends Error{static name="StreamResetError";constructor(e="The stream has been reset"){super(e),this.name="StreamResetError"}};var bt=class extends Error{static name="StreamStateError";constructor(e="The stream is in an invalid state"){super(e),this.name="StreamStateError"}},Bt=class extends Error{static name="StreamBufferError";constructor(e="The stream buffer was full"){super(e),this.name="StreamBufferError"}};var un=class extends Error{static name="InvalidMultihashError";constructor(e="Invalid Multihash"){super(e),this.name="InvalidMultihashError"}};var kr=class extends Error{static name="InvalidMessageError";constructor(e="Invalid message"){super(e),this.name="InvalidMessageError"}},_r=class extends Error{static name="ProtocolError";constructor(e="Protocol error"){super(e),this.name="ProtocolError"}},zt=class extends Error{static name="TimeoutError";constructor(e="Timed out"){super(e),this.name="TimeoutError"}},ln=class extends Error{static name="NotStartedError";constructor(e="Not started"){super(e),this.name="NotStartedError"}},fn=class extends Error{static name="AlreadyStartedError";constructor(e="Already started"){super(e),this.name="AlreadyStartedError"}};var Pr=class extends Error{static name="UnsupportedKeyTypeError";constructor(e="Unsupported key type"){super(e),this.name="UnsupportedKeyTypeError"}};var dn=class extends Event{data;constructor(e,r){super("message",r),this.data=e}},Vt=class extends Event{error;local;constructor(e,r,n){super("close",n),this.error=r,this.local=e}},hn=class extends Vt{constructor(e,r){super(!0,e,r)}},pn=class extends Vt{constructor(e,r){super(!1,e,r)}};var mn=Symbol.for("@libp2p/peer-id");function Gt(t){return!!t?.[mn]}var bc=Symbol.for("@libp2p/transport");var yc;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(yc||(yc={}));var gc=le("node:events"),yn=(t,...e)=>{try{(0,gc.setMaxListeners)(t,...e)}catch{}};function Yl(t){return typeof t?.handleEvent=="function"}function ql(t){return t===!0||t===!1}function Zl(t){return ql(t)?t:t?.capture??!1}function gi(t){let e={capture:Zl(t),once:!!t?.once};return t?.passive!=null&&(e.passive=t?.passive),t?.signal!=null&&(e.signal=t?.signal),e}function wc(t,e){return gi(t).capture===gi(e).capture}var Wt=class extends EventTarget{#e=new Map;constructor(){super(),yn(1/0,this)}listenerCount(e){let r=this.#e.get(e);return r==null?0:r.length}addEventListener(e,r,n){let s=gi(n);if(s?.signal?.aborted===!0)return;let o=u=>{s.once&&this.removeEventListener(e,r,s),Yl(r)?r.handleEvent(u):r(u)},c=this.#e.get(e);if(c==null&&(c=[],this.#e.set(e,c)),c.some(u=>u.callback!==r?!1:wc(u.options,s)))return;super.addEventListener(e,o,s);let a=()=>{this.removeEventListener(e,r,s)};s.signal?.addEventListener("abort",a),c.push({callback:r,wrapper:o,options:s,onAbort:a})}removeEventListener(e,r,n){let s=this.#e.get(e);if(s==null){super.removeEventListener(e,r??null,n);return}this.#e.set(e,s.filter(o=>o.callback===r&&wc(o.options,n)?(super.removeEventListener(e,o.wrapper,n),o.options?.signal?.removeEventListener("abort",o.onAbort),!1):!0))}safeDispatchEvent(e,r={}){return this.dispatchEvent(new CustomEvent(e,r))}};var xc=Symbol.for("@libp2p/service-capabilities");var Sc=_e(le("node:tty"),1),En=_e(le("node:util"),1);function bn(t,e){if(typeof t=="string")return jl(t);if(typeof t=="number")return Jl(t,e);throw new Error(`Value provided to ms() must be a string or number. value=${JSON.stringify(t)}`)}function jl(t){if(typeof t!="string"||t.length===0||t.length>100)throw new Error(`Value provided to ms.parse() must be a string with length between 1 and 99. value=${JSON.stringify(t)}`);let e=/^(?<value>-?\d*\.?\d+) *(?<unit>milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|months?|mo|years?|yrs?|y)?$/i.exec(t);if(!e?.groups)return NaN;let{value:r,unit:n="ms"}=e.groups,s=parseFloat(r),o=n.toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return s*315576e5;case"months":case"month":case"mo":return s*26298e5;case"weeks":case"week":case"w":return s*6048e5;case"days":case"day":case"d":return s*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return s*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return s*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return s*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:throw new Error(`Unknown unit "${o}" provided to ms.parse(). value=${JSON.stringify(t)}`)}}function Xl(t){let e=Math.abs(t);return e>=315576e5?`${Math.round(t/315576e5)}y`:e>=26298e5?`${Math.round(t/26298e5)}mo`:e>=6048e5?`${Math.round(t/6048e5)}w`:e>=864e5?`${Math.round(t/864e5)}d`:e>=36e5?`${Math.round(t/36e5)}h`:e>=6e4?`${Math.round(t/6e4)}m`:e>=1e3?`${Math.round(t/1e3)}s`:`${t}ms`}function Ql(t){let e=Math.abs(t);return e>=315576e5?Lt(t,e,315576e5,"year"):e>=26298e5?Lt(t,e,26298e5,"month"):e>=6048e5?Lt(t,e,6048e5,"week"):e>=864e5?Lt(t,e,864e5,"day"):e>=36e5?Lt(t,e,36e5,"hour"):e>=6e4?Lt(t,e,6e4,"minute"):e>=1e3?Lt(t,e,1e3,"second"):`${t} ms`}function Jl(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new Error("Value provided to ms.format() must be of type number.");return e?.long?Ql(t):Xl(t)}function Lt(t,e,r,n){let s=e>=r*1.5;return`${Math.round(t/r)} ${n}${s?"s":""}`}var wn=_e(le("node:process"),1),vc=_e(le("node:os"),1),wi=_e(le("node:tty"),1);function ze(t,e=globalThis.Deno?globalThis.Deno.args:wn.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),s=e.indexOf("--");return n!==-1&&(s===-1||n<s)}var{env:j}=wn.default,gn;ze("no-color")||ze("no-colors")||ze("color=false")||ze("color=never")?gn=0:(ze("color")||ze("colors")||ze("color=true")||ze("color=always"))&&(gn=1);function ef(){if(!("FORCE_COLOR"in j))return;if(j.FORCE_COLOR==="true")return 1;if(j.FORCE_COLOR==="false")return 0;if(j.FORCE_COLOR.length===0)return 1;let t=Math.min(Number.parseInt(j.FORCE_COLOR,10),3);if([0,1,2,3].includes(t))return t}function tf(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function rf(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=ef();n!==void 0&&(gn=n);let s=r?gn:n;if(s===0)return 0;if(r){if(ze("color=16m")||ze("color=full")||ze("color=truecolor"))return 3;if(ze("color=256"))return 2}if("TF_BUILD"in j&&"AGENT_NAME"in j)return 1;if(t&&!e&&s===void 0)return 0;let o=s||0;if(j.TERM==="dumb")return o;if(wn.default.platform==="win32"){let c=vc.default.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in j)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(c=>c in j)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(c=>c in j)||j.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in j)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(j.TEAMCITY_VERSION)?1:0;if(j.COLORTERM==="truecolor"||j.TERM==="xterm-kitty"||j.TERM==="xterm-ghostty"||j.TERM==="wezterm")return 3;if("TERM_PROGRAM"in j){let c=Number.parseInt((j.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(j.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(j.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(j.TERM)||"COLORTERM"in j?1:o}function Ec(t,e={}){let r=rf(t,{streamIsTTY:t&&t.isTTY,...e});return tf(r)}var nf={stdout:Ec({isTTY:wi.default.isatty(1)}),stderr:Ec({isTTY:wi.default.isatty(2)})},xn=nf;function xi(t){r.debug=r,r.default=r,r.coerce=a,r.disable=o,r.enable=s,r.enabled=c,r.humanize=bn,r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l,f){let d,p=null,x,D;function b(...y){if(!b.enabled)return;let T=b,P=Number(new Date),_=P-(d||P);T.diff=_,T.prev=d,T.curr=P,d=P,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let M=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(ie,re)=>{if(ie==="%%")return"%";M++;let we=r.formatters[re];if(typeof we=="function"){let V=y[M];ie=we.call(T,V),y.splice(M,1),M--}return ie}),r.formatArgs.call(T,y),f?.onLog!=null&&f.onLog(...y),(T.log||r.log).apply(T,y)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(x!==r.namespaces&&(x=r.namespaces,D=r.enabled(l)),D),set:y=>{p=y}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function s(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,d=(typeof l=="string"?l:"").split(/[\s,]+/),p=d.length;for(f=0;f<p;f++)d[f]&&(l=d[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.substr(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(i),...r.skips.map(i).map(f=>"-"+f)].join(",");return r.enable(""),l}function c(l){if(l[l.length-1]==="*")return!0;let f,d;for(f=0,d=r.skips.length;f<d;f++)if(r.skips[f].test(l))return!1;for(f=0,d=r.names.length;f<d;f++)if(r.names[f].test(l))return!0;return!1}function i(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function a(l){return l instanceof Error?l.stack??l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.setupFormatters(r.formatters),r.enable(r.load()),r}var Tc=[6,2,3,4,5,1];xn.stderr!==!1&&(xn.stderr??xn).level>=2&&(Tc=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]);var Yt=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function of(){return"colors"in Yt?!!Yt.colors:Sc.default.isatty(process.stderr.fd)}function sf(t){let{namespace:e,useColors:r}=this;if(r===!0){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${s};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
|
|
3
3
|
`).join(`
|
|
4
4
|
`+o),t.push(s+"m+"+bn(this.diff)+"\x1B[0m")}else t[0]=cf()+e+" "+t[0]}function cf(){return Yt.hideDate!=null?"":new Date().toISOString()+" "}function af(...t){return process.stderr.write(En.default.format(...t)+`
|
|
5
5
|
`)}function uf(t){t!=null?process.env.DEBUG=t:delete process.env.DEBUG}function lf(){return process.env.DEBUG}function ff(t){t.inspectOpts={};let e=Object.keys(Yt);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=Yt[e[r]]}function df(t){t.o=function(e){return this.inspectOpts.colors=this.useColors,En.default.inspect(e,this.inspectOpts).split(`
|