@libp2p/bootstrap 8.0.0-f427cfc9 → 9.0.0-58421e11
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/package.json +6 -9
package/dist/index.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PBootstrap = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PBootstrap=(()=>{var ts=Object.create;var De=Object.defineProperty;var rs=Object.getOwnPropertyDescriptor;var ns=Object.getOwnPropertyNames;var os=Object.getPrototypeOf,ss=Object.prototype.hasOwnProperty;var is=(r,e,t)=>e in r?De(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var re=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),y=(r,e)=>{for(var t in e)De(r,t,{get:e[t],enumerable:!0})},en=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ns(e))!ss.call(r,o)&&o!==t&&De(r,o,{get:()=>e[o],enumerable:!(n=rs(e,o))||n.enumerable});return r};var Qe=(r,e,t)=>(t=r!=null?ts(os(r)):{},en(e||!r||!r.__esModule?De(t,"default",{value:r,enumerable:!0}):t,r)),as=r=>en(De({},"__esModule",{value:!0}),r);var He=(r,e,t)=>(is(r,typeof e!="symbol"?e+"":e,t),t);var nn=re((Gd,rn)=>{var de=1e3,pe=de*60,fe=pe*60,ne=fe*24,ds=ne*7,ps=ne*365.25;rn.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return fs(r);if(t==="number"&&isFinite(r))return e.long?hs(r):us(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function fs(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*ps;case"weeks":case"week":case"w":return t*ds;case"days":case"day":case"d":return t*ne;case"hours":case"hour":case"hrs":case"hr":case"h":return t*fe;case"minutes":case"minute":case"mins":case"min":case"m":return t*pe;case"seconds":case"second":case"secs":case"sec":case"s":return t*de;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function us(r){var e=Math.abs(r);return e>=ne?Math.round(r/ne)+"d":e>=fe?Math.round(r/fe)+"h":e>=pe?Math.round(r/pe)+"m":e>=de?Math.round(r/de)+"s":r+"ms"}function hs(r){var e=Math.abs(r);return e>=ne?Ze(r,e,ne,"day"):e>=fe?Ze(r,e,fe,"hour"):e>=pe?Ze(r,e,pe,"minute"):e>=de?Ze(r,e,de,"second"):r+" ms"}function Ze(r,e,t,n){var o=e>=t*1.5;return Math.round(r/t)+" "+n+(o?"s":"")}});var sn=re((_d,on)=>{function ls(r){t.debug=t,t.default=t,t.coerce=l,t.disable=s,t.enable=o,t.enabled=i,t.humanize=nn(),t.destroy=T,Object.keys(r).forEach(d=>{t[d]=r[d]}),t.names=[],t.skips=[],t.formatters={};function e(d){let f=0;for(let w=0;w<d.length;w++)f=(f<<5)-f+d.charCodeAt(w),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(d){let f,w=null,z,c;function u(...v){if(!u.enabled)return;let m=u,g=Number(new Date),C=g-(f||g);m.diff=C,m.prev=f,m.curr=g,f=g,v[0]=t.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let b=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(E,x)=>{if(E==="%%")return"%";b++;let A=t.formatters[x];if(typeof A=="function"){let O=v[b];E=A.call(m,O),v.splice(b,1),b--}return E}),t.formatArgs.call(m,v),(m.log||t.log).apply(m,v)}return u.namespace=d,u.useColors=t.useColors(),u.color=t.selectColor(d),u.extend=n,u.destroy=t.destroy,Object.defineProperty(u,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(z!==t.namespaces&&(z=t.namespaces,c=t.enabled(d)),c),set:v=>{w=v}}),typeof t.init=="function"&&t.init(u),u}function n(d,f){let w=t(this.namespace+(typeof f>"u"?":":f)+d);return w.log=this.log,w}function o(d){t.save(d),t.namespaces=d,t.names=[],t.skips=[];let f,w=(typeof d=="string"?d:"").split(/[\s,]+/),z=w.length;for(f=0;f<z;f++)w[f]&&(d=w[f].replace(/\*/g,".*?"),d[0]==="-"?t.skips.push(new RegExp("^"+d.slice(1)+"$")):t.names.push(new RegExp("^"+d+"$")))}function s(){let d=[...t.names.map(a),...t.skips.map(a).map(f=>"-"+f)].join(",");return t.enable(""),d}function i(d){if(d[d.length-1]==="*")return!0;let f,w;for(f=0,w=t.skips.length;f<w;f++)if(t.skips[f].test(d))return!1;for(f=0,w=t.names.length;f<w;f++)if(t.names[f].test(d))return!0;return!1}function a(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function l(d){return d instanceof Error?d.stack||d.message:d}function T(){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 t.enable(t.load()),t}on.exports=ls});var an=re((V,et)=>{V.formatArgs=bs;V.save=ws;V.load=gs;V.useColors=ms;V.storage=xs();V.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();V.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ms(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function bs(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+et.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(t++,o==="%c"&&(n=t))}),r.splice(n,0,e)}V.log=console.debug||console.log||(()=>{});function ws(r){try{r?V.storage.setItem("debug",r):V.storage.removeItem("debug")}catch{}}function gs(){let r;try{r=V.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function xs(){try{return localStorage}catch{}}et.exports=sn()(V);var{formatters:ys}=et.exports;ys.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var mo=re((Zf,lo)=>{lo.exports=Sr;var ho=128,yc=127,vc=~yc,Cc=Math.pow(2,31);function Sr(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Sr.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var n=t;r>=Cc;)e[t++]=r&255|ho,r/=128;for(;r&vc;)e[t++]=r&255|ho,r>>>=7;return e[t]=r|0,Sr.bytes=t-n+1,e}});var go=re((eu,wo)=>{wo.exports=Ar;var Sc=128,bo=127;function Ar(r,n){var t=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a||o>49)throw Ar.bytes=0,new RangeError("Could not decode varint");i=r[s++],t+=o<28?(i&bo)<<o:(i&bo)*Math.pow(2,o),o+=7}while(i>=Sc);return Ar.bytes=s-n,t}});var yo=re((tu,xo)=>{var Ac=Math.pow(2,7),Ec=Math.pow(2,14),Tc=Math.pow(2,21),Ic=Math.pow(2,28),Uc=Math.pow(2,35),Fc=Math.pow(2,42),Pc=Math.pow(2,49),Nc=Math.pow(2,56),Dc=Math.pow(2,63);xo.exports=function(r){return r<Ac?1:r<Ec?2:r<Tc?3:r<Ic?4:r<Uc?5:r<Fc?6:r<Pc?7:r<Nc?8:r<Dc?9:10}});var pt=re((ru,vo)=>{vo.exports={encode:mo(),decode:go(),encodingLength:yo()}});var $d={};y($d,{bootstrap:()=>Vd});var Ye=class extends EventTarget{#e=new Map;listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,n){super.addEventListener(e,t,n);let o=this.#e.get(e);o==null&&(o=[],this.#e.set(e,o)),o.push({callback:t,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,t,n){super.removeEventListener(e.toString(),t??null,n);let o=this.#e.get(e);o!=null&&(o=o.filter(({callback:s})=>s!==t),this.#e.set(e,o))}dispatchEvent(e){let t=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:o})=>!o),this.#e.set(e.type,n)),t}safeDispatchEvent(e,t){return this.dispatchEvent(new cs(e,t))}},St=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},cs=globalThis.CustomEvent??St;var tn=Symbol.for("@libp2p/peer-discovery");var $=Qe(an(),1);var Ut={};y(Ut,{base32:()=>H,base32hex:()=>Fs,base32hexpad:()=>Ns,base32hexpadupper:()=>Ds,base32hexupper:()=>Ps,base32pad:()=>Is,base32padupper:()=>Us,base32upper:()=>Ts,base32z:()=>zs});function vs(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var s=r.charAt(o),i=s.charCodeAt(0);if(t[i]!==255)throw new TypeError(s+" is ambiguous");t[i]=o}var a=r.length,l=r.charAt(0),T=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(c){if(c instanceof Uint8Array||(ArrayBuffer.isView(c)?c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength):Array.isArray(c)&&(c=Uint8Array.from(c))),!(c instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(c.length===0)return"";for(var u=0,v=0,m=0,g=c.length;m!==g&&c[m]===0;)m++,u++;for(var C=(g-m)*d+1>>>0,b=new Uint8Array(C);m!==g;){for(var S=c[m],E=0,x=C-1;(S!==0||E<v)&&x!==-1;x--,E++)S+=256*b[x]>>>0,b[x]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");v=E,m++}for(var A=C-v;A!==C&&b[A]===0;)A++;for(var O=l.repeat(u);A<C;++A)O+=r.charAt(b[A]);return O}function w(c){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;var u=0;if(c[u]!==" "){for(var v=0,m=0;c[u]===l;)v++,u++;for(var g=(c.length-u)*T+1>>>0,C=new Uint8Array(g);c[u];){var b=t[c.charCodeAt(u)];if(b===255)return;for(var S=0,E=g-1;(b!==0||S<m)&&E!==-1;E--,S++)b+=a*C[E]>>>0,C[E]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");m=S,u++}if(c[u]!==" "){for(var x=g-m;x!==g&&C[x]===0;)x++;for(var A=new Uint8Array(v+(g-x)),O=v;x!==g;)A[O++]=C[x++];return A}}}function z(c){var u=w(c);if(u)return u;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:w,decode:z}}var Cs=vs,Ss=Cs,cn=Ss;var Xd=new Uint8Array(0);var dn=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},J=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var pn=r=>new TextEncoder().encode(r),fn=r=>new TextDecoder().decode(r);var At=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Et=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),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 hn(this,e)}},Tt=class{constructor(e){this.decoders=e}or(e){return hn(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},hn=(r,e)=>new Tt({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),It=class{constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new At(e,t,n),this.decoder=new Et(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ue=({name:r,prefix:e,encode:t,decode:n})=>new It(r,e,t,n),Q=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:o}=cn(t,e);return ue({prefix:r,name:e,encode:n,decode:s=>J(o(s))})},As=(r,e,t,n)=>{let o={};for(let d=0;d<e.length;++d)o[e[d]]=d;let s=r.length;for(;r[s-1]==="=";)--s;let i=new Uint8Array(s*t/8|0),a=0,l=0,T=0;for(let d=0;d<s;++d){let f=o[r[d]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<t|f,a+=t,a>=8&&(a-=8,i[T++]=255&l>>a)}if(a>=t||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return i},Es=(r,e,t)=>{let n=e[e.length-1]==="=",o=(1<<t)-1,s="",i=0,a=0;for(let l=0;l<r.length;++l)for(a=a<<8|r[l],i+=8;i>t;)i-=t,s+=e[o&a>>i];if(i&&(s+=e[o&a<<t-i]),n)for(;s.length*t&7;)s+="=";return s},P=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>ue({prefix:e,name:r,encode(o){return Es(o,n,t)},decode(o){return As(o,n,t,r)}});var H=P({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ts=P({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Is=P({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Us=P({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Fs=P({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ps=P({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ns=P({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ds=P({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),zs=P({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ft={};y(Ft,{base58btc:()=>k,base58flickr:()=>Ms});var k=Q({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Ms=Q({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Nt={};y(Nt,{base64:()=>Pt,base64pad:()=>Bs,base64url:()=>Os,base64urlpad:()=>ks});var Pt=P({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Bs=P({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Os=P({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ks=P({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});$.default.formatters.b=r=>r==null?"undefined":k.baseEncode(r);$.default.formatters.t=r=>r==null?"undefined":H.baseEncode(r);$.default.formatters.m=r=>r==null?"undefined":Pt.baseEncode(r);$.default.formatters.p=r=>r==null?"undefined":r.toString();$.default.formatters.c=r=>r==null?"undefined":r.toString();$.default.formatters.k=r=>r==null?"undefined":r.toString();$.default.formatters.a=r=>r==null?"undefined":r.toString();function Ls(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function ln(r){let e=Ls(`${r}:trace`);return $.default.enabled(`${r}:trace`)&&$.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,$.default)(`${r}:trace`)),Object.assign((0,$.default)(r),{error:(0,$.default)(`${r}:error`),trace:e})}var mn=Symbol.for("@libp2p/peer-id");var Dt={};y(Dt,{identity:()=>Rs});var Rs=ue({prefix:"\0",name:"identity",encode:r=>fn(r),decode:r=>pn(r)});var zt={};y(zt,{base2:()=>Vs});var Vs=P({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Mt={};y(Mt,{base8:()=>$s});var $s=P({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Bt={};y(Bt,{base10:()=>js});var js=Q({prefix:"9",name:"base10",alphabet:"0123456789"});var Ot={};y(Ot,{base16:()=>qs,base16upper:()=>Js});var qs=P({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Js=P({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var kt={};y(kt,{base36:()=>Gs,base36upper:()=>_s});var Gs=Q({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),_s=Q({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Lt={};y(Lt,{base256emoji:()=>Hs});var bn=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}"),Ws=bn.reduce((r,e,t)=>(r[t]=e,r),[]),Xs=bn.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function Ks(r){return r.reduce((e,t)=>(e+=Ws[t],e),"")}function Qs(r){let e=[];for(let t of r){let n=Xs[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Hs=ue({prefix:"\u{1F680}",name:"base256emoji",encode:Ks,decode:Qs});var jt={};y(jt,{sha256:()=>rt,sha512:()=>bi});var Ys=xn,wn=128,Zs=127,ei=~Zs,ti=Math.pow(2,31);function xn(r,e,t){e=e||[],t=t||0;for(var n=t;r>=ti;)e[t++]=r&255|wn,r/=128;for(;r&ei;)e[t++]=r&255|wn,r>>>=7;return e[t]=r|0,xn.bytes=t-n+1,e}var ri=Rt,ni=128,gn=127;function Rt(r,n){var t=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw Rt.bytes=0,new RangeError("Could not decode varint");i=r[s++],t+=o<28?(i&gn)<<o:(i&gn)*Math.pow(2,o),o+=7}while(i>=ni);return Rt.bytes=s-n,t}var oi=Math.pow(2,7),si=Math.pow(2,14),ii=Math.pow(2,21),ai=Math.pow(2,28),ci=Math.pow(2,35),di=Math.pow(2,42),pi=Math.pow(2,49),fi=Math.pow(2,56),ui=Math.pow(2,63),hi=function(r){return r<oi?1:r<si?2:r<ii?3:r<ai?4:r<ci?5:r<di?6:r<pi?7:r<fi?8:r<ui?9:10},li={encode:Ys,decode:ri,encodingLength:hi},mi=li,ze=mi;var Me=(r,e=0)=>[ze.decode(r,e),ze.decode.bytes],he=(r,e,t=0)=>(ze.encode(r,e,t),e),le=r=>ze.encodingLength(r);var Y=(r,e)=>{let t=e.byteLength,n=le(r),o=n+le(t),s=new Uint8Array(o+t);return he(r,s,0),he(t,s,n),s.set(e,o),new me(r,t,e,s)},Be=r=>{let e=J(r),[t,n]=Me(e),[o,s]=Me(e.subarray(n)),i=e.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new me(t,o,i,e)},yn=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&dn(r.bytes,t.bytes)}},me=class{constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};var $t=({name:r,code:e,encode:t})=>new Vt(r,e,t),Vt=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Y(this.code,t):t.then(n=>Y(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Cn=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),rt=$t({name:"sha2-256",code:18,encode:Cn("SHA-256")}),bi=$t({name:"sha2-512",code:19,encode:Cn("SHA-512")});var qt={};y(qt,{identity:()=>nt});var Sn=0,wi="identity",An=J,gi=r=>Y(Sn,An(r)),nt={code:Sn,name:wi,encode:An,digest:gi};var Cp=new TextEncoder,Sp=new TextDecoder;var En=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return Ci(t,Jt(r),e||k.encoder);default:return Si(t,Jt(r),e||H.encoder)}};var Tn=new WeakMap,Jt=r=>{let e=Tn.get(r);if(e==null){let t=new Map;return Tn.set(r,t),t}return e},F=class{constructor(e,t,n,o){this.code=t,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}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:t}=this;if(e!==Oe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==Ai)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return F.createV0(t)}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:t}=this.multihash,n=Y(e,t);return F.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 F.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&yn(e.multihash,n.multihash)}toString(e){return En(this,e)}toJSON(){return{"/":En(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof F)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:s,bytes:i}=t;return new F(n,o,s,i||In(n,o,s.bytes))}else if(t[Ei]===!0){let{version:n,multihash:o,code:s}=t,i=Be(o);return F.create(n,s,i)}else return null}static create(e,t,n){if(typeof t!="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(t!==Oe)throw new Error(`Version 0 CID must use dag-pb (code: ${Oe}) block encoding`);return new F(e,t,n,n.bytes)}case 1:{let o=In(e,t,n.bytes);return new F(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return F.create(0,Oe,e)}static createV1(e,t){return F.create(1,e,t)}static decode(e){let[t,n]=F.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=F.inspectBytes(e),n=t.size-t.multihashSize,o=J(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=o.subarray(t.multihashSize-t.digestSize),i=new me(t.multihashCode,t.digestSize,s,o);return[t.version===0?F.createV0(i):F.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[f,w]=Me(e.subarray(t));return t+=w,f},o=n(),s=Oe;if(o===18?(o=0,t=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,a=n(),l=n(),T=t+l,d=T-i;return{version:o,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:T}}static parse(e,t){let[n,o]=vi(e,t),s=F.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Jt(s).set(n,e),s}},vi=(r,e)=>{switch(r[0]){case"Q":{let t=e||k;return[k.prefix,t.decode(`${k.prefix}${r}`)]}case k.prefix:{let t=e||k;return[k.prefix,t.decode(r)]}case H.prefix:{let t=e||H;return[H.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},Ci=(r,e,t)=>{let{prefix:n}=t;if(n!==k.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return o},Si=(r,e,t)=>{let{prefix:n}=t,o=e.get(n);if(o==null){let s=t.encode(r);return e.set(n,s),s}else return o},Oe=112,Ai=18,In=(r,e,t)=>{let n=le(r),o=n+le(e),s=new Uint8Array(o+t.byteLength);return he(r,s,0),he(e,s,n),s.set(t,o),s},Ei=Symbol.for("@ipld/js-cid/CID");var Gt={...Dt,...zt,...Mt,...Bt,...Ot,...Ut,...kt,...Ft,...Nt,...Lt},zp={...jt,...qt};function ke(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}var Ti=Symbol.for("nodejs.util.inspect.custom"),Un=Object.values(Gt).map(r=>r.decoder).reduce((r,e)=>r.or(e),Gt.identity.decoder),Fn=114,Pn=36,Nn=37,Le=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[mn]=!0;toString(){return this.string==null&&(this.string=k.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return F.createV1(Fn,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return ke(this.multihash.bytes,e);if(typeof e=="string")return _t(e).equals(this);if(e?.multihash?.bytes!=null)return ke(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[Ti](){return`PeerId(${this.toString()})`}},Re=class extends Le{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},Ve=class extends Le{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},$e=class extends Le{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function _t(r,e){if(e=e??Un,r.charAt(0)==="1"||r.charAt(0)==="Q"){let t=Be(k.decode(`z${r}`));return r.startsWith("12D")?new Ve({multihash:t}):r.startsWith("16U")?new $e({multihash:t}):new Re({multihash:t})}return Ii(Un.decode(r))}function Ii(r){try{let e=Be(r);if(e.code===nt.code){if(e.digest.length===Pn)return new Ve({multihash:e});if(e.digest.length===Nn)return new $e({multihash:e})}if(e.code===rt.code)return new Re({multihash:e})}catch{return Ui(F.decode(r))}throw new Error("Supplied PeerID CID is invalid")}function Ui(r){if(r==null||r.multihash==null||r.version==null||r.version===1&&r.code!==Fn)throw new Error("Supplied PeerID CID is invalid");let e=r.multihash;if(e.code===rt.code)return new Re({multihash:r.multihash});if(e.code===nt.code){if(e.digest.length===Pn)return new Ve({multihash:r.multihash});if(e.digest.length===Nn)return new $e({multihash:r.multihash})}throw new Error("Supplied PeerID CID is invalid")}var ot=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var Ht={};y(Ht,{base58btc:()=>L,base58flickr:()=>Mi});function Fi(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var s=r.charAt(o),i=s.charCodeAt(0);if(t[i]!==255)throw new TypeError(s+" is ambiguous");t[i]=o}var a=r.length,l=r.charAt(0),T=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(c){if(c instanceof Uint8Array||(ArrayBuffer.isView(c)?c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength):Array.isArray(c)&&(c=Uint8Array.from(c))),!(c instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(c.length===0)return"";for(var u=0,v=0,m=0,g=c.length;m!==g&&c[m]===0;)m++,u++;for(var C=(g-m)*d+1>>>0,b=new Uint8Array(C);m!==g;){for(var S=c[m],E=0,x=C-1;(S!==0||E<v)&&x!==-1;x--,E++)S+=256*b[x]>>>0,b[x]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");v=E,m++}for(var A=C-v;A!==C&&b[A]===0;)A++;for(var O=l.repeat(u);A<C;++A)O+=r.charAt(b[A]);return O}function w(c){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;var u=0;if(c[u]!==" "){for(var v=0,m=0;c[u]===l;)v++,u++;for(var g=(c.length-u)*T+1>>>0,C=new Uint8Array(g);c[u];){var b=t[c.charCodeAt(u)];if(b===255)return;for(var S=0,E=g-1;(b!==0||S<m)&&E!==-1;E--,S++)b+=a*C[E]>>>0,C[E]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");m=S,u++}if(c[u]!==" "){for(var x=g-m;x!==g&&C[x]===0;)x++;for(var A=new Uint8Array(v+(g-x)),O=v;x!==g;)A[O++]=C[x++];return A}}}function z(c){var u=w(c);if(u)return u;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:w,decode:z}}var Pi=Fi,Ni=Pi,Dn=Ni;var Kp=new Uint8Array(0);var zn=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},G=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var Mn=r=>new TextEncoder().encode(r),Bn=r=>new TextDecoder().decode(r);var Wt=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Xt=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),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 kn(this,e)}},Kt=class{constructor(e){this.decoders=e}or(e){return kn(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},kn=(r,e)=>new Kt({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),Qt=class{constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new Wt(e,t,n),this.decoder=new Xt(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},we=({name:r,prefix:e,encode:t,decode:n})=>new Qt(r,e,t,n),Z=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:o}=Dn(t,e);return we({prefix:r,name:e,encode:n,decode:s=>G(o(s))})},Di=(r,e,t,n)=>{let o={};for(let d=0;d<e.length;++d)o[e[d]]=d;let s=r.length;for(;r[s-1]==="=";)--s;let i=new Uint8Array(s*t/8|0),a=0,l=0,T=0;for(let d=0;d<s;++d){let f=o[r[d]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<t|f,a+=t,a>=8&&(a-=8,i[T++]=255&l>>a)}if(a>=t||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return i},zi=(r,e,t)=>{let n=e[e.length-1]==="=",o=(1<<t)-1,s="",i=0,a=0;for(let l=0;l<r.length;++l)for(a=a<<8|r[l],i+=8;i>t;)i-=t,s+=e[o&a>>i];if(i&&(s+=e[o&a<<t-i]),n)for(;s.length*t&7;)s+="=";return s},N=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>we({prefix:e,name:r,encode(o){return zi(o,n,t)},decode(o){return Di(o,n,t,r)}});var L=Z({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Mi=Z({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Bi=Vn,Ln=128,Oi=127,ki=~Oi,Li=Math.pow(2,31);function Vn(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Li;)e[t++]=r&255|Ln,r/=128;for(;r&ki;)e[t++]=r&255|Ln,r>>>=7;return e[t]=r|0,Vn.bytes=t-n+1,e}var Ri=Yt,Vi=128,Rn=127;function Yt(r,n){var t=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw Yt.bytes=0,new RangeError("Could not decode varint");i=r[s++],t+=o<28?(i&Rn)<<o:(i&Rn)*Math.pow(2,o),o+=7}while(i>=Vi);return Yt.bytes=s-n,t}var $i=Math.pow(2,7),ji=Math.pow(2,14),qi=Math.pow(2,21),Ji=Math.pow(2,28),Gi=Math.pow(2,35),_i=Math.pow(2,42),Wi=Math.pow(2,49),Xi=Math.pow(2,56),Ki=Math.pow(2,63),Qi=function(r){return r<$i?1:r<ji?2:r<qi?3:r<Ji?4:r<Gi?5:r<_i?6:r<Wi?7:r<Xi?8:r<Ki?9:10},Hi={encode:Bi,decode:Ri,encodingLength:Qi},Yi=Hi,je=Yi;var qe=(r,e=0)=>[je.decode(r,e),je.decode.bytes],ge=(r,e,t=0)=>(je.encode(r,e,t),e),xe=r=>je.encodingLength(r);var oe=(r,e)=>{let t=e.byteLength,n=xe(r),o=n+xe(t),s=new Uint8Array(o+t);return ge(r,s,0),ge(t,s,n),s.set(e,o),new ye(r,t,e,s)},it=r=>{let e=G(r),[t,n]=qe(e),[o,s]=qe(e.subarray(n)),i=e.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new ye(t,o,i,e)},$n=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&zn(r.bytes,t.bytes)}},ye=class{constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};var Zt={};y(Zt,{base32:()=>_,base32hex:()=>ra,base32hexpad:()=>oa,base32hexpadupper:()=>sa,base32hexupper:()=>na,base32pad:()=>ea,base32padupper:()=>ta,base32upper:()=>Zi,base32z:()=>ia});var _=N({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Zi=N({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ea=N({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ta=N({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ra=N({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),na=N({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),oa=N({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sa=N({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ia=N({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var jn=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return ca(t,er(r),e||L.encoder);default:return da(t,er(r),e||_.encoder)}};var qn=new WeakMap,er=r=>{let e=qn.get(r);if(e==null){let t=new Map;return qn.set(r,t),t}return e},U=class{constructor(e,t,n,o){this.code=t,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}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:t}=this;if(e!==Je)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==pa)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return U.createV0(t)}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:t}=this.multihash,n=oe(e,t);return U.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 U.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&$n(e.multihash,n.multihash)}toString(e){return jn(this,e)}toJSON(){return{"/":jn(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof U)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:s,bytes:i}=t;return new U(n,o,s,i||Jn(n,o,s.bytes))}else if(t[fa]===!0){let{version:n,multihash:o,code:s}=t,i=it(o);return U.create(n,s,i)}else return null}static create(e,t,n){if(typeof t!="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(t!==Je)throw new Error(`Version 0 CID must use dag-pb (code: ${Je}) block encoding`);return new U(e,t,n,n.bytes)}case 1:{let o=Jn(e,t,n.bytes);return new U(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return U.create(0,Je,e)}static createV1(e,t){return U.create(1,e,t)}static decode(e){let[t,n]=U.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=U.inspectBytes(e),n=t.size-t.multihashSize,o=G(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=o.subarray(t.multihashSize-t.digestSize),i=new ye(t.multihashCode,t.digestSize,s,o);return[t.version===0?U.createV0(i):U.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[f,w]=qe(e.subarray(t));return t+=w,f},o=n(),s=Je;if(o===18?(o=0,t=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,a=n(),l=n(),T=t+l,d=T-i;return{version:o,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:T}}static parse(e,t){let[n,o]=aa(e,t),s=U.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return er(s).set(n,e),s}},aa=(r,e)=>{switch(r[0]){case"Q":{let t=e||L;return[L.prefix,t.decode(`${L.prefix}${r}`)]}case L.prefix:{let t=e||L;return[L.prefix,t.decode(r)]}case _.prefix:{let t=e||_;return[_.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},ca=(r,e,t)=>{let{prefix:n}=t;if(n!==L.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return o},da=(r,e,t)=>{let{prefix:n}=t,o=e.get(n);if(o==null){let s=t.encode(r);return e.set(n,s),s}else return o},Je=112,pa=18,Jn=(r,e,t)=>{let n=xe(r),o=n+xe(e),s=new Uint8Array(o+t.byteLength);return ge(r,s,0),ge(e,s,n),s.set(t,o),s},fa=Symbol.for("@ipld/js-cid/CID");var sr={};y(sr,{identity:()=>wa});function ua(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var o=0;o<r.length;o++){var s=r.charAt(o),i=s.charCodeAt(0);if(t[i]!==255)throw new TypeError(s+" is ambiguous");t[i]=o}var a=r.length,l=r.charAt(0),T=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function f(c){if(c instanceof Uint8Array||(ArrayBuffer.isView(c)?c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength):Array.isArray(c)&&(c=Uint8Array.from(c))),!(c instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(c.length===0)return"";for(var u=0,v=0,m=0,g=c.length;m!==g&&c[m]===0;)m++,u++;for(var C=(g-m)*d+1>>>0,b=new Uint8Array(C);m!==g;){for(var S=c[m],E=0,x=C-1;(S!==0||E<v)&&x!==-1;x--,E++)S+=256*b[x]>>>0,b[x]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");v=E,m++}for(var A=C-v;A!==C&&b[A]===0;)A++;for(var O=l.repeat(u);A<C;++A)O+=r.charAt(b[A]);return O}function w(c){if(typeof c!="string")throw new TypeError("Expected String");if(c.length===0)return new Uint8Array;var u=0;if(c[u]!==" "){for(var v=0,m=0;c[u]===l;)v++,u++;for(var g=(c.length-u)*T+1>>>0,C=new Uint8Array(g);c[u];){var b=t[c.charCodeAt(u)];if(b===255)return;for(var S=0,E=g-1;(b!==0||S<m)&&E!==-1;E--,S++)b+=a*C[E]>>>0,C[E]=b%256>>>0,b=b/256>>>0;if(b!==0)throw new Error("Non-zero carry");m=S,u++}if(c[u]!==" "){for(var x=g-m;x!==g&&C[x]===0;)x++;for(var A=new Uint8Array(v+(g-x)),O=v;x!==g;)A[O++]=C[x++];return A}}}function z(c){var u=w(c);if(u)return u;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:w,decode:z}}var ha=ua,la=ha,Gn=la;var ff=new Uint8Array(0);var _n=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},W=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var Wn=r=>new TextEncoder().encode(r),Xn=r=>new TextDecoder().decode(r);var tr=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},rr=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),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 Qn(this,e)}},nr=class{constructor(e){this.decoders=e}or(e){return Qn(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Qn=(r,e)=>new nr({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),or=class{constructor(e,t,n,o){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=o,this.encoder=new tr(e,t,n),this.decoder=new rr(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Ce=({name:r,prefix:e,encode:t,decode:n})=>new or(r,e,t,n),ee=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:o}=Gn(t,e);return Ce({prefix:r,name:e,encode:n,decode:s=>W(o(s))})},ma=(r,e,t,n)=>{let o={};for(let d=0;d<e.length;++d)o[e[d]]=d;let s=r.length;for(;r[s-1]==="=";)--s;let i=new Uint8Array(s*t/8|0),a=0,l=0,T=0;for(let d=0;d<s;++d){let f=o[r[d]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<t|f,a+=t,a>=8&&(a-=8,i[T++]=255&l>>a)}if(a>=t||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return i},ba=(r,e,t)=>{let n=e[e.length-1]==="=",o=(1<<t)-1,s="",i=0,a=0;for(let l=0;l<r.length;++l)for(a=a<<8|r[l],i+=8;i>t;)i-=t,s+=e[o&a>>i];if(i&&(s+=e[o&a<<t-i]),n)for(;s.length*t&7;)s+="=";return s},D=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>Ce({prefix:e,name:r,encode(o){return ba(o,n,t)},decode(o){return ma(o,n,t,r)}});var wa=Ce({prefix:"\0",name:"identity",encode:r=>Xn(r),decode:r=>Wn(r)});var ir={};y(ir,{base2:()=>ga});var ga=D({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ar={};y(ar,{base8:()=>xa});var xa=D({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var cr={};y(cr,{base10:()=>ya});var ya=ee({prefix:"9",name:"base10",alphabet:"0123456789"});var dr={};y(dr,{base16:()=>va,base16upper:()=>Ca});var va=D({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ca=D({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var pr={};y(pr,{base32:()=>Se,base32hex:()=>Ta,base32hexpad:()=>Ua,base32hexpadupper:()=>Fa,base32hexupper:()=>Ia,base32pad:()=>Aa,base32padupper:()=>Ea,base32upper:()=>Sa,base32z:()=>Pa});var Se=D({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Sa=D({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Aa=D({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ea=D({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ta=D({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ia=D({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Ua=D({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Fa=D({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Pa=D({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var fr={};y(fr,{base36:()=>Na,base36upper:()=>Da});var Na=ee({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Da=ee({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ur={};y(ur,{base58btc:()=>j,base58flickr:()=>za});var j=ee({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),za=ee({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var hr={};y(hr,{base64:()=>Ma,base64pad:()=>Ba,base64url:()=>Oa,base64urlpad:()=>ka});var Ma=D({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ba=D({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Oa=D({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ka=D({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var lr={};y(lr,{base256emoji:()=>ja});var Hn=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}"),La=Hn.reduce((r,e,t)=>(r[t]=e,r),[]),Ra=Hn.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function Va(r){return r.reduce((e,t)=>(e+=La[t],e),"")}function $a(r){let e=[];for(let t of r){let n=Ra[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var ja=Ce({prefix:"\u{1F680}",name:"base256emoji",encode:Va,decode:$a});var gr={};y(gr,{sha256:()=>ac,sha512:()=>cc});var qa=eo,Yn=128,Ja=127,Ga=~Ja,_a=Math.pow(2,31);function eo(r,e,t){e=e||[],t=t||0;for(var n=t;r>=_a;)e[t++]=r&255|Yn,r/=128;for(;r&Ga;)e[t++]=r&255|Yn,r>>>=7;return e[t]=r|0,eo.bytes=t-n+1,e}var Wa=mr,Xa=128,Zn=127;function mr(r,n){var t=0,n=n||0,o=0,s=n,i,a=r.length;do{if(s>=a)throw mr.bytes=0,new RangeError("Could not decode varint");i=r[s++],t+=o<28?(i&Zn)<<o:(i&Zn)*Math.pow(2,o),o+=7}while(i>=Xa);return mr.bytes=s-n,t}var Ka=Math.pow(2,7),Qa=Math.pow(2,14),Ha=Math.pow(2,21),Ya=Math.pow(2,28),Za=Math.pow(2,35),ec=Math.pow(2,42),tc=Math.pow(2,49),rc=Math.pow(2,56),nc=Math.pow(2,63),oc=function(r){return r<Ka?1:r<Qa?2:r<Ha?3:r<Ya?4:r<Za?5:r<ec?6:r<tc?7:r<rc?8:r<nc?9:10},sc={encode:qa,decode:Wa,encodingLength:oc},ic=sc,Ge=ic;var _e=(r,e=0)=>[Ge.decode(r,e),Ge.decode.bytes],Ae=(r,e,t=0)=>(Ge.encode(r,e,t),e),Ee=r=>Ge.encodingLength(r);var se=(r,e)=>{let t=e.byteLength,n=Ee(r),o=n+Ee(t),s=new Uint8Array(o+t);return Ae(r,s,0),Ae(t,s,n),s.set(e,o),new Te(r,t,e,s)},to=r=>{let e=W(r),[t,n]=_e(e),[o,s]=_e(e.subarray(n)),i=e.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new Te(t,o,i,e)},ro=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&_n(r.bytes,t.bytes)}},Te=class{constructor(e,t,n,o){this.code=e,this.size=t,this.digest=n,this.bytes=o}};var wr=({name:r,code:e,encode:t})=>new br(r,e,t),br=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?se(this.code,t):t.then(n=>se(this.code,n))}else throw Error("Unknown type, must be binary type")}};var oo=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),ac=wr({name:"sha2-256",code:18,encode:oo("SHA-256")}),cc=wr({name:"sha2-512",code:19,encode:oo("SHA-512")});var xr={};y(xr,{identity:()=>fc});var so=0,dc="identity",io=W,pc=r=>se(so,io(r)),fc={code:so,name:dc,encode:io,digest:pc};var Df=new TextEncoder,zf=new TextDecoder;var ao=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return mc(t,yr(r),e||j.encoder);default:return bc(t,yr(r),e||Se.encoder)}};var co=new WeakMap,yr=r=>{let e=co.get(r);if(e==null){let t=new Map;return co.set(r,t),t}return e},B=class{constructor(e,t,n,o){this.code=t,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}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:t}=this;if(e!==Xe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==wc)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return B.createV0(t)}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:t}=this.multihash,n=se(e,t);return B.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 B.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&ro(e.multihash,n.multihash)}toString(e){return ao(this,e)}toJSON(){return{"/":ao(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof B)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:o,multihash:s,bytes:i}=t;return new B(n,o,s,i||po(n,o,s.bytes))}else if(t[gc]===!0){let{version:n,multihash:o,code:s}=t,i=to(o);return B.create(n,s,i)}else return null}static create(e,t,n){if(typeof t!="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(t!==Xe)throw new Error(`Version 0 CID must use dag-pb (code: ${Xe}) block encoding`);return new B(e,t,n,n.bytes)}case 1:{let o=po(e,t,n.bytes);return new B(e,t,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return B.create(0,Xe,e)}static createV1(e,t){return B.create(1,e,t)}static decode(e){let[t,n]=B.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=B.inspectBytes(e),n=t.size-t.multihashSize,o=W(e.subarray(n,n+t.multihashSize));if(o.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=o.subarray(t.multihashSize-t.digestSize),i=new Te(t.multihashCode,t.digestSize,s,o);return[t.version===0?B.createV0(i):B.createV1(t.codec,i),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[f,w]=_e(e.subarray(t));return t+=w,f},o=n(),s=Xe;if(o===18?(o=0,t=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=t,a=n(),l=n(),T=t+l,d=T-i;return{version:o,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:T}}static parse(e,t){let[n,o]=lc(e,t),s=B.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return yr(s).set(n,e),s}},lc=(r,e)=>{switch(r[0]){case"Q":{let t=e||j;return[j.prefix,t.decode(`${j.prefix}${r}`)]}case j.prefix:{let t=e||j;return[j.prefix,t.decode(r)]}case Se.prefix:{let t=e||Se;return[Se.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},mc=(r,e,t)=>{let{prefix:n}=t;if(n!==j.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let o=e.get(n);if(o==null){let s=t.encode(r).slice(1);return e.set(n,s),s}else return o},bc=(r,e,t)=>{let{prefix:n}=t,o=e.get(n);if(o==null){let s=t.encode(r);return e.set(n,s),s}else return o},Xe=112,wc=18,po=(r,e,t)=>{let n=Ee(r),o=n+Ee(e),s=new Uint8Array(o+t.byteLength);return Ae(r,s,0),Ae(e,s,n),s.set(t,o),s},gc=Symbol.for("@ipld/js-cid/CID");var vr={...sr,...ir,...ar,...cr,...dr,...pr,...fr,...ur,...hr,...lr},qf={...gr,...xr};function Ie(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function ct(r=0){return globalThis.Buffer?.allocUnsafe!=null?Ie(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function uo(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var fo=uo("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Cr=uo("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=ct(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),xc={utf8:fo,"utf-8":fo,hex:vr.base16,latin1:Cr,ascii:Cr,binary:Cr,...vr},dt=xc;function R(r,e="utf8"){let t=dt[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var Kr=Qe(pt(),1);function X(r,e){e==null&&(e=r.reduce((o,s)=>o+s.length,0));let t=ct(e),n=0;for(let o of r)t.set(o,n),n+=o.length;return Ie(t)}var Fe=Qe(pt(),1);var ft=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,n=e();return n===void 0&&(this.index=t),n}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,n){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,t,n,o){return this.readAtomically(()=>{let s=0,i=0,a=this.peekChar();if(a===void 0)return;let l=a==="0",T=2**(8*o)-1;for(;;){let d=this.readAtomically(()=>{let f=this.readChar();if(f===void 0)return;let w=Number.parseInt(f,e);if(!Number.isNaN(w))return w});if(d===void 0)break;if(s*=e,s+=d,s>T||(i+=1,t!==void 0&&i>t))return}if(i!==0)return!n&&l&&i>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;t<e.length;t++){let n=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[t]=n}return e})}readIPv6Addr(){let e=t=>{for(let n=0;n<t.length/2;n++){let o=n*2;if(n<t.length-3){let i=this.readSeparator(":",n,()=>this.readIPv4Addr());if(i!==void 0)return t[o]=i[0],t[o+1]=i[1],t[o+2]=i[2],t[o+3]=i[3],[o+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[o,!1];t[o]=s>>8,t[o+1]=s&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[n,o]=e(t);if(n===16)return t;if(o||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),i=16-(n+2),[a]=e(s.subarray(0,i));return t.set(s.subarray(0,a),16-a),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Co=45,zc=15,Ue=new ft;function Er(r){if(!(r.length>zc))return Ue.new(r).parseWith(()=>Ue.readIPv4Addr())}function Tr(r){if(!(r.length>Co))return Ue.new(r).parseWith(()=>Ue.readIPv6Addr())}function ut(r){if(!(r.length>Co))return Ue.new(r).parseWith(()=>Ue.readIPAddr())}var mu=parseInt("0xFFFF",16),bu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);var Ir={};y(Ir,{identity:()=>Lc});var Lc=we({prefix:"\0",name:"identity",encode:r=>Bn(r),decode:r=>Mn(r)});var Ur={};y(Ur,{base2:()=>Rc});var Rc=N({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Fr={};y(Fr,{base8:()=>Vc});var Vc=N({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Pr={};y(Pr,{base10:()=>$c});var $c=Z({prefix:"9",name:"base10",alphabet:"0123456789"});var Nr={};y(Nr,{base16:()=>jc,base16upper:()=>qc});var jc=N({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qc=N({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Dr={};y(Dr,{base36:()=>Jc,base36upper:()=>Gc});var Jc=Z({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Gc=Z({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var zr={};y(zr,{base64:()=>_c,base64pad:()=>Wc,base64url:()=>Xc,base64urlpad:()=>Kc});var _c=N({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Wc=N({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Xc=N({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Kc=N({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Mr={};y(Mr,{base256emoji:()=>ed});var Eo=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}"),Qc=Eo.reduce((r,e,t)=>(r[t]=e,r),[]),Hc=Eo.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function Yc(r){return r.reduce((e,t)=>(e+=Qc[t],e),"")}function Zc(r){let e=[];for(let t of r){let n=Hc[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var ed=we({prefix:"\u{1F680}",name:"base256emoji",encode:Yc,decode:Zc});var kr={};y(kr,{sha256:()=>td,sha512:()=>rd});var Or=({name:r,code:e,encode:t})=>new Br(r,e,t),Br=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?oe(this.code,t):t.then(n=>oe(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Io=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),td=Or({name:"sha2-256",code:18,encode:Io("SHA-256")}),rd=Or({name:"sha2-512",code:19,encode:Io("SHA-512")});var Lr={};y(Lr,{identity:()=>sd});var Uo=0,nd="identity",Fo=G,od=r=>oe(Uo,Fo(r)),sd={code:Uo,name:nd,encode:Fo,digest:od};var Qu=new TextEncoder,Hu=new TextDecoder;var Po={...Ir,...Ur,...Fr,...Pr,...Nr,...Zt,...Dr,...Ht,...zr,...Mr},rh={...kr,...Lr};function Rr(r,e="utf8"){let t=dt[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ie(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var q=Qe(pt(),1);function No(r){return!!Er(r)}function Do(r){return!!Tr(r)}function ht(r){return!!ut(r)}var zo=No,cd=Do,Vr=function(r){let e=0;if(r=r.toString().trim(),zo(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(cd(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let s=zo(t[n]),i;s&&(i=Vr(t[n]),t[n]=R(i.slice(0,2),"base16")),i!=null&&++n<8&&t.splice(n,0,R(i.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let s=[n,1];for(n=9-t.length;n>0;n--)s.push("0");t.splice.apply(t,s)}let o=new Uint8Array(e+16);for(n=0;n<t.length;n++){let s=parseInt(t[n],16);o[e++]=s>>8&255,o[e++]=s&255}return o}throw new Error("invalid ip address")},Mo=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let o=[];for(let s=0;s<t;s++)o.push(r[e+s]);return o.join(".")}if(t===16){let o=[];for(let s=0;s<t;s+=2)o.push(n.getUint16(e+s).toString(16));return o.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Ke={},$r={},pd=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];pd.forEach(r=>{let e=fd(...r);$r[e.code]=e,Ke[e.name]=e});function fd(r,e,t,n,o){return{code:r,size:e,name:t,resolvable:!!n,path:!!o}}function I(r){if(typeof r=="number"){if($r[r]!=null)return $r[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Ke[r]!=null)return Ke[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Ch=I("ip4"),Sh=I("ip6"),Ah=I("ipcidr");function Ro(r,e){switch(I(r).code){case 4:case 41:return hd(e);case 42:return ko(e);case 6:case 273:case 33:case 132:return $o(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ko(e);case 421:return wd(e);case 444:return Lo(e);case 445:return Lo(e);case 466:return bd(e);default:return R(e,"base16")}}function Vo(r,e){switch(I(r).code){case 4:return Bo(e);case 41:return Bo(e);case 42:return Oo(e);case 6:case 273:case 33:case 132:return qr(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Oo(e);case 421:return ld(e);case 444:return gd(e);case 445:return xd(e);case 466:return md(e);default:return Rr(e,"base16")}}var jr=Object.values(Po).map(r=>r.decoder),ud=function(){let r=jr[0].or(jr[1]);return jr.slice(2).forEach(e=>r=r.or(e)),r}();function Bo(r){if(!ht(r))throw new Error("invalid ip address");return Vr(r)}function hd(r){let e=Mo(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!ht(e))throw new Error("invalid ip address");return e}function qr(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function $o(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Oo(r){let e=Rr(r),t=Uint8Array.from(q.default.encode(e.length));return X([t,e],t.length+e.length)}function ko(r){let e=q.default.decode(r);if(r=r.slice(q.default.decode.bytes),r.length!==e)throw new Error("inconsistent lengths");return R(r)}function ld(r){let e;r[0]==="Q"||r[0]==="1"?e=it(L.decode(`z${r}`)).bytes:e=U.parse(r).multihash.bytes;let t=Uint8Array.from(q.default.encode(e.length));return X([t,e],t.length+e.length)}function md(r){let e=ud.decode(r),t=Uint8Array.from(q.default.encode(e.length));return X([t,e],t.length+e.length)}function bd(r){let e=q.default.decode(r),t=r.slice(q.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return"u"+R(t,"base64url")}function wd(r){let e=q.default.decode(r),t=r.slice(q.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return R(t,"base58btc")}function gd(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=_.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=qr(n);return X([t,o],t.length+o.length)}function xd(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=_.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=qr(n);return X([t,o],t.length+o.length)}function Lo(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=R(e,"base32"),o=$o(t);return`${n}:${o}`}function yd(r){let e=[],t=r.split("/").slice(1);if(t.length===1&&t[0]==="")return[];for(let n=0;n<t.length;n++){let o=t[n],s=I(o);if(s.size===0){e.push([o]);continue}if(n++,n>=t.length)throw qo("invalid address: "+r);if(s.path===!0){e.push([o,Xr(t.slice(n).join("/"))]);break}e.push([o,t[n]])}return e}function vd(r){let e=[];return r.map(t=>{let n=bt(t);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),Xr(e.join("/"))}function Cd(r){return r.map(e=>{Array.isArray(e)||(e=[e]);let t=bt(e);return e.length>1?[t.code,Vo(t.code,e[1])]:[t.code]})}function Jr(r){return r.map(e=>{let t=bt(e);return e[1]!=null?[t.code,Ro(t.code,e[1])]:[t.code]})}function Gr(r){return mt(X(r.map(e=>{let t=bt(e),n=Uint8Array.from(Fe.default.encode(t.code));return e.length>1&&e[1]!=null&&(n=X([n,e[1]])),n})))}function _r(r,e){return r.size>0?r.size/8:r.size===0?0:Fe.default.decode(e)+(Fe.default.decode.bytes??0)}function lt(r){let e=[],t=0;for(;t<r.length;){let n=Fe.default.decode(r,t),o=Fe.default.decode.bytes??0,s=I(n),i=_r(s,r.slice(t+o));if(i===0){e.push([n]),t+=o;continue}let a=r.slice(t+o,t+o+i);if(t+=i+o,t>r.length)throw qo("Invalid address Uint8Array: "+R(r,"base16"));e.push([n,a])}return e}function Wr(r){let e=lt(r),t=Jr(e);return vd(t)}function Sd(r){r=Xr(r);let e=yd(r),t=Cd(e);return Gr(t)}function jo(r){return Sd(r)}function mt(r){let e=Ad(r);if(e!=null)throw e;return Uint8Array.from(r)}function Ad(r){try{lt(r)}catch(e){return e}}function Xr(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function qo(r){return new Error("Error parsing address: "+r)}function bt(r){return I(r[0])}var Td=Symbol.for("nodejs.util.inspect.custom"),Id=[I("dns").code,I("dns4").code,I("dns6").code,I("dnsaddr").code],Ud=new Map,Jo=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Fd(r){return!!r?.[Jo]}var K=class{bytes;#e;#r;#n;#t;[Jo]=!0;constructor(e){if(e==null&&(e=""),e instanceof Uint8Array)this.bytes=mt(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=jo(e)}else if(Fd(e))this.bytes=mt(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return this.#e==null&&(this.#e=Wr(this.bytes)),this.#e}toJSON(){return this.toString()}toOptions(){let e,t,n,o,s="",i=I("tcp"),a=I("udp"),l=I("ip4"),T=I("ip6"),d=I("dns6"),f=I("ip6zone");for(let[z,c]of this.stringTuples())z===f.code&&(s=`%${c??""}`),Id.includes(z)&&(t=i.name,o=443,n=`${c??""}${s}`,e=z===d.code?6:4),(z===i.code||z===a.code)&&(t=I(z).name,o=parseInt(c??"")),(z===l.code||z===T.code)&&(t=I(z).name,n=`${c??""}${s}`,e=z===T.code?6:4);if(e==null||t==null||n==null||o==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:t,port:o}}protos(){return this.protoCodes().map(e=>Object.assign({},I(e)))}protoCodes(){let e=[],t=this.bytes,n=0;for(;n<t.length;){let o=Kr.default.decode(t,n),s=Kr.default.decode.bytes??0,i=I(o),a=_r(i,t.slice(n+s));n+=a+s,e.push(o)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return this.#r==null&&(this.#r=lt(this.bytes)),this.#r}stringTuples(){return this.#n==null&&(this.#n=Jr(this.tuples())),this.#n}encapsulate(e){return e=new K(e),new K(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),o=n.lastIndexOf(t);if(o<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new K(n.slice(0,o))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new K(Gr(t.slice(0,n)));return this}getPeerId(){try{let t=this.stringTuples().filter(n=>n[0]===Ke.ipfs.code).pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?R(L.decode(`z${n}`),"base58btc"):R(U.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){if(this.#t===void 0)try{this.#t=this.stringTuples().filter(e=>I(e[0]).path===!0)[0][1],this.#t==null&&(this.#t=null)}catch{this.#t=null}return this.#t}equals(e){return ke(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(s=>s.resolvable);if(t==null)return[this];let n=Ud.get(t.name);if(n==null)throw new ot(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(s=>new K(s))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[Td](){return`Multiaddr(${Wr(this.bytes)})`}};function Pe(r){return new K(r)}var Pd=p("dns4"),Nd=p("dns6"),Dd=p("dnsaddr"),ae=M(p("dns"),Dd,Pd,Nd),xt=M(p("ip4"),p("ip6")),Ne=M(h(xt,p("tcp")),h(ae,p("tcp"))),yt=h(xt,p("udp")),zd=h(yt,p("utp")),Md=h(yt,p("quic")),Bd=h(yt,p("quic-v1")),Qr=M(h(Ne,p("ws")),h(ae,p("ws"))),wt=M(h(Qr,p("p2p")),Qr),Hr=M(h(Ne,p("wss")),h(ae,p("wss")),h(Ne,p("tls"),p("ws")),h(ae,p("tls"),p("ws"))),gt=M(h(Hr,p("p2p")),Hr),Yr=M(h(Ne,p("http")),h(xt,p("http")),h(ae,p("http"))),Zr=M(h(Ne,p("https")),h(xt,p("https")),h(ae,p("https"))),Go=h(yt,p("webrtc-direct"),p("certhash")),Xo=M(h(Go,p("p2p")),Go),_o=h(Bd,p("webtransport"),p("certhash"),p("certhash")),Ko=M(h(_o,p("p2p")),_o),Qo=M(h(wt,p("p2p-webrtc-star"),p("p2p")),h(gt,p("p2p-webrtc-star"),p("p2p")),h(wt,p("p2p-webrtc-star")),h(gt,p("p2p-webrtc-star"))),Jh=M(h(wt,p("p2p-websocket-star"),p("p2p")),h(gt,p("p2p-websocket-star"),p("p2p")),h(wt,p("p2p-websocket-star")),h(gt,p("p2p-websocket-star"))),Ho=M(h(Yr,p("p2p-webrtc-direct"),p("p2p")),h(Zr,p("p2p-webrtc-direct"),p("p2p")),h(Yr,p("p2p-webrtc-direct")),h(Zr,p("p2p-webrtc-direct"))),ce=M(Qr,Hr,Yr,Zr,Qo,Ho,Ne,zd,Md,ae,Xo,Ko),Gh=M(h(ce,p("p2p-stardust"),p("p2p")),h(ce,p("p2p-stardust"))),te=M(h(ce,p("p2p")),Qo,Ho,Xo,Ko,p("p2p")),Wo=M(h(te,p("p2p-circuit"),te),h(te,p("p2p-circuit")),h(p("p2p-circuit"),te),h(ce,p("p2p-circuit")),h(p("p2p-circuit"),ce),p("p2p-circuit")),Yo=()=>M(h(Wo,Yo),Wo),ie=Yo(),Zo=M(h(ie,te,ie),h(te,ie),h(ie,te),ie,te);var _h=M(h(ie,p("webrtc"),p("p2p")),h(ie,p("webrtc")),h(ce,p("webrtc"),p("p2p")),h(ce,p("webrtc")),p("webrtc"));function es(r){function e(t){let n;try{n=Pe(t)}catch{return!1}let o=r(n.protoNames());return o===null?!1:o===!0||o===!1?o:o.length===0}return e}function h(...r){function e(t){if(t.length<r.length)return null;let n=t;return r.some(o=>(n=typeof o=="function"?o().partialMatch(t):o.partialMatch(t),Array.isArray(n)&&(t=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:es(e),partialMatch:e}}function M(...r){function e(n){let o=null;return r.some(s=>{let i=typeof s=="function"?s().partialMatch(n):s.partialMatch(n);return i!=null?(o=i,!0):!1}),o}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:es(e),partialMatch:e}}function p(r){let e=r;function t(o){let s;try{s=Pe(o)}catch{return!1}let i=s.protoNames();return i.length===1&&i[0]===e}function n(o){return o.length===0?null:o[0]===e?o.slice(1):null}return{toString:function(){return e},matches:t,partialMatch:n}}var vt=ln("libp2p:bootstrap"),Od="bootstrap",kd=50,Ld=12e4,Rd=1e3,Ct=class extends Ye{timer;list;timeout;components;_init;constructor(e,t={list:[]}){if(t.list==null||t.list.length===0)throw new Error("Bootstrap requires a list of peer addresses");super(),this.components=e,this.timeout=t.timeout??Rd,this.list=[];for(let n of t.list){if(!Zo.matches(n)){vt.error("Invalid multiaddr");continue}let o=Pe(n),s=o.getPeerId();if(s==null){vt.error("Invalid bootstrap multiaddr without peer id");continue}let i={id:_t(s),multiaddrs:[o],protocols:[]};this.list.push(i)}this._init=t}[tn]=this;[Symbol.toStringTag]="@libp2p/bootstrap";isStarted(){return!!this.timer}start(){this.isStarted()||(vt("Starting bootstrap node discovery, discovering peers after %s ms",this.timeout),this.timer=setTimeout(()=>{this._discoverBootstrapPeers().catch(e=>{vt.error(e)})},this.timeout))}async _discoverBootstrapPeers(){if(this.timer!=null)for(let e of this.list){if(await this.components.peerStore.merge(e.id,{tags:{[this._init.tagName??Od]:{value:this._init.tagValue??kd,ttl:this._init.tagTTL??Ld}}}),this.timer==null)return;this.safeDispatchEvent("peer",{detail:e})}}stop(){this.timer!=null&&clearTimeout(this.timer),this.timer=void 0}};He(Ct,"tag","bootstrap");function Vd(r){return e=>new Ct(e,r)}return as($d);})();
|
|
2
|
+
"use strict";var Libp2PBootstrap=(()=>{var jr=Object.create;var ye=Object.defineProperty;var qr=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Gr=Object.getPrototypeOf,Jr=Object.prototype.hasOwnProperty;var q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),F=(t,e)=>{for(var r in e)ye(t,r,{get:e[r],enumerable:!0})},Pt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Wr(e))!Jr.call(t,o)&&o!==r&&ye(t,o,{get:()=>e[o],enumerable:!(n=qr(e,o))||n.enumerable});return t};var Le=(t,e,r)=>(r=t!=null?jr(Gr(t)):{},Pt(e||!t||!t.__esModule?ye(r,"default",{value:t,enumerable:!0}):r,t)),Hr=t=>Pt(ye({},"__esModule",{value:!0}),t);var Nt=q((ms,Ut)=>{var Y=1e3,Z=Y*60,ee=Z*60,W=ee*24,Xr=W*7,Qr=W*365.25;Ut.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Yr(t);if(r==="number"&&isFinite(t))return e.long?en(t):Zr(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Yr(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Qr;case"weeks":case"week":case"w":return r*Xr;case"days":case"day":case"d":return r*W;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ee;case"minutes":case"minute":case"mins":case"min":case"m":return r*Z;case"seconds":case"second":case"secs":case"sec":case"s":return r*Y;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Zr(t){var e=Math.abs(t);return e>=W?Math.round(t/W)+"d":e>=ee?Math.round(t/ee)+"h":e>=Z?Math.round(t/Z)+"m":e>=Y?Math.round(t/Y)+"s":t+"ms"}function en(t){var e=Math.abs(t);return e>=W?ve(t,e,W,"day"):e>=ee?ve(t,e,ee,"hour"):e>=Z?ve(t,e,Z,"minute"):e>=Y?ve(t,e,Y,"second"):t+" ms"}function ve(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Mt=q((gs,kt)=>{function tn(t){r.debug=r,r.default=r,r.coerce=h,r.disable=s,r.enable=o,r.enabled=i,r.humanize=Nt(),r.destroy=S,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let d=0;for(let f=0;f<c.length;f++)d=(d<<5)-d+c.charCodeAt(f),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(c){let d,f=null,C,p;function g(...y){if(!g.enabled)return;let x=g,A=Number(new Date),U=A-(d||A);x.diff=U,x.prev=d,x.curr=A,d=A,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let E=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(N,T)=>{if(N==="%%")return"%";E++;let k=r.formatters[T];if(typeof k=="function"){let Q=y[E];N=k.call(x,Q),y.splice(E,1),E--}return N}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return g.namespace=c,g.useColors=r.useColors(),g.color=r.selectColor(c),g.extend=n,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(C!==r.namespaces&&(C=r.namespaces,p=r.enabled(c)),p),set:y=>{f=y}}),typeof r.init=="function"&&r.init(g),g}function n(c,d){let f=r(this.namespace+(typeof d>"u"?":":d)+c);return f.log=this.log,f}function o(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let d,f=(typeof c=="string"?c:"").split(/[\s,]+/),C=f.length;for(d=0;d<C;d++)f[d]&&(c=f[d].replace(/\*/g,".*?"),c[0]==="-"?r.skips.push(new RegExp("^"+c.slice(1)+"$")):r.names.push(new RegExp("^"+c+"$")))}function s(){let c=[...r.names.map(l),...r.skips.map(l).map(d=>"-"+d)].join(",");return r.enable(""),c}function i(c){if(c[c.length-1]==="*")return!0;let d,f;for(d=0,f=r.skips.length;d<f;d++)if(r.skips[d].test(c))return!1;for(d=0,f=r.names.length;d<f;d++)if(r.names[d].test(c))return!0;return!1}function l(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function h(c){return c instanceof Error?c.stack||c.message:c}function S(){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.enable(r.load()),r}kt.exports=tn});var Rt=q((P,Ce)=>{P.formatArgs=nn;P.save=on;P.load=sn;P.useColors=rn;P.storage=an();P.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();P.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function rn(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function nn(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Ce.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}P.log=console.debug||console.log||(()=>{});function on(t){try{t?P.storage.setItem("debug",t):P.storage.removeItem("debug")}catch{}}function sn(){let t;try{t=P.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function an(){try{return localStorage}catch{}}Ce.exports=Mt()(P);var{formatters:cn}=Ce.exports;cn.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var lr=q((Ti,ur)=>{ur.exports=ct;var cr=128,yo=127,xo=~yo,vo=Math.pow(2,31);function ct(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw ct.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=vo;)e[r++]=t&255|cr,t/=128;for(;t&xo;)e[r++]=t&255|cr,t>>>=7;return e[r]=t|0,ct.bytes=r-n+1,e}});var fr=q((Fi,pr)=>{pr.exports=ut;var Co=128,dr=127;function ut(t,n){var r=0,n=n||0,o=0,s=n,i,l=t.length;do{if(s>=l||o>49)throw ut.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=o<28?(i&dr)<<o:(i&dr)*Math.pow(2,o),o+=7}while(i>=Co);return ut.bytes=s-n,r}});var mr=q((Pi,hr)=>{var Eo=Math.pow(2,7),So=Math.pow(2,14),Ao=Math.pow(2,21),Io=Math.pow(2,28),To=Math.pow(2,35),Fo=Math.pow(2,42),Po=Math.pow(2,49),Do=Math.pow(2,56),Uo=Math.pow(2,63);hr.exports=function(t){return t<Eo?1:t<So?2:t<Ao?3:t<Io?4:t<To?5:t<Fo?6:t<Po?7:t<Do?8:t<Uo?9:10}});var lt=q((Di,gr)=>{gr.exports={encode:lr(),decode:fr(),encodingLength:mr()}});var ds={};F(ds,{bootstrap:()=>ls});var xe=class extends EventTarget{#e=new Map;listenerCount(e){let r=this.#e.get(e);return r==null?0:r.length}addEventListener(e,r,n){super.addEventListener(e,r,n);let o=this.#e.get(e);o==null&&(o=[],this.#e.set(e,o)),o.push({callback:r,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,r,n){super.removeEventListener(e.toString(),r??null,n);let o=this.#e.get(e);o!=null&&(o=o.filter(({callback:s})=>s!==r),this.#e.set(e,o))}dispatchEvent(e){let r=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:o})=>!o),this.#e.set(e.type,n)),r}safeDispatchEvent(e,r){return this.dispatchEvent(new Kr(e,r))}},Oe=class extends Event{detail;constructor(e,r){super(e,r),this.detail=r?.detail}},Kr=globalThis.CustomEvent??Oe;var Dt=Symbol.for("@libp2p/peer-discovery");var D=Le(Rt(),1);var je={};F(je,{base32:()=>R,base32hex:()=>bn,base32hexpad:()=>yn,base32hexpadupper:()=>xn,base32hexupper:()=>wn,base32pad:()=>mn,base32padupper:()=>gn,base32upper:()=>hn,base32z:()=>vn});function un(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<t.length;o++){var s=t.charAt(o),i=s.charCodeAt(0);if(r[i]!==255)throw new TypeError(s+" is ambiguous");r[i]=o}var l=t.length,h=t.charAt(0),S=Math.log(l)/Math.log(256),c=Math.log(256)/Math.log(l);function d(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var g=0,y=0,x=0,A=p.length;x!==A&&p[x]===0;)x++,g++;for(var U=(A-x)*c+1>>>0,E=new Uint8Array(U);x!==A;){for(var M=p[x],N=0,T=U-1;(M!==0||N<y)&&T!==-1;T--,N++)M+=256*E[T]>>>0,E[T]=M%l>>>0,M=M/l>>>0;if(M!==0)throw new Error("Non-zero carry");y=N,x++}for(var k=U-y;k!==U&&E[k]===0;)k++;for(var Q=h.repeat(g);k<U;++k)Q+=t.charAt(E[k]);return Q}function f(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;var g=0;if(p[g]!==" "){for(var y=0,x=0;p[g]===h;)y++,g++;for(var A=(p.length-g)*S+1>>>0,U=new Uint8Array(A);p[g];){var E=r[p.charCodeAt(g)];if(E===255)return;for(var M=0,N=A-1;(E!==0||M<x)&&N!==-1;N--,M++)E+=l*U[N]>>>0,U[N]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");x=M,g++}if(p[g]!==" "){for(var T=A-x;T!==A&&U[T]===0;)T++;for(var k=new Uint8Array(y+(A-T)),Q=y;T!==A;)k[Q++]=U[T++];return k}}}function C(p){var g=f(p);if(g)return g;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:f,decode:C}}var ln=un,dn=ln,Bt=dn;var ws=new Uint8Array(0);var Lt=(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},O=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")};var Ot=t=>new TextEncoder().encode(t),zt=t=>new TextDecoder().decode(t);var ze=class{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")}},$e=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),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 Vt(this,e)}},Ve=class{constructor(e){this.decoders=e}or(e){return Vt(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Vt=(t,e)=>new Ve({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),_e=class{constructor(e,r,n,o){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new ze(e,r,n),this.decoder=new $e(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},te=({name:t,prefix:e,encode:r,decode:n})=>new _e(t,e,r,n),$=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:o}=Bt(r,e);return te({prefix:t,name:e,encode:n,decode:s=>O(o(s))})},pn=(t,e,r,n)=>{let o={};for(let c=0;c<e.length;++c)o[e[c]]=c;let s=t.length;for(;t[s-1]==="=";)--s;let i=new Uint8Array(s*r/8|0),l=0,h=0,S=0;for(let c=0;c<s;++c){let d=o[t[c]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|d,l+=r,l>=8&&(l-=8,i[S++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return i},fn=(t,e,r)=>{let n=e[e.length-1]==="=",o=(1<<r)-1,s="",i=0,l=0;for(let h=0;h<t.length;++h)for(l=l<<8|t[h],i+=8;i>r;)i-=r,s+=e[o&l>>i];if(i&&(s+=e[o&l<<r-i]),n)for(;s.length*r&7;)s+="=";return s},b=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>te({prefix:e,name:t,encode(o){return fn(o,n,r)},decode(o){return pn(o,n,r,t)}});var R=b({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),hn=b({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),mn=b({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),gn=b({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bn=b({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),wn=b({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),yn=b({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),xn=b({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),vn=b({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var qe={};F(qe,{base58btc:()=>v,base58flickr:()=>Cn});var v=$({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Cn=$({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Ge={};F(Ge,{base64:()=>We,base64pad:()=>En,base64url:()=>Sn,base64urlpad:()=>An});var We=b({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),En=b({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Sn=b({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),An=b({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});D.default.formatters.b=t=>t==null?"undefined":v.baseEncode(t);D.default.formatters.t=t=>t==null?"undefined":R.baseEncode(t);D.default.formatters.m=t=>t==null?"undefined":We.baseEncode(t);D.default.formatters.p=t=>t==null?"undefined":t.toString();D.default.formatters.c=t=>t==null?"undefined":t.toString();D.default.formatters.k=t=>t==null?"undefined":t.toString();D.default.formatters.a=t=>t==null?"undefined":t.toString();function In(t){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=t,e.destroy=()=>!0,e.extend=()=>e,e}function _t(t){let e=In(`${t}:trace`);return D.default.enabled(`${t}:trace`)&&D.default.names.map(r=>r.toString()).find(r=>r.includes(":trace"))!=null&&(e=(0,D.default)(`${t}:trace`)),Object.assign((0,D.default)(t),{error:(0,D.default)(`${t}:error`),trace:e})}var jt=Symbol.for("@libp2p/peer-id");var Je={};F(Je,{identity:()=>Tn});var Tn=te({prefix:"\0",name:"identity",encode:t=>zt(t),decode:t=>Ot(t)});var He={};F(He,{base2:()=>Fn});var Fn=b({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ke={};F(Ke,{base8:()=>Pn});var Pn=b({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Xe={};F(Xe,{base10:()=>Dn});var Dn=$({prefix:"9",name:"base10",alphabet:"0123456789"});var Qe={};F(Qe,{base16:()=>Un,base16upper:()=>Nn});var Un=b({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Nn=b({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Ye={};F(Ye,{base36:()=>kn,base36upper:()=>Mn});var kn=$({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Mn=$({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ze={};F(Ze,{base256emoji:()=>zn});var qt=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}"),Rn=qt.reduce((t,e,r)=>(t[r]=e,t),[]),Bn=qt.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Ln(t){return t.reduce((e,r)=>(e+=Rn[r],e),"")}function On(t){let e=[];for(let r of t){let n=Bn[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var zn=te({prefix:"\u{1F680}",name:"base256emoji",encode:Ln,decode:On});var nt={};F(nt,{sha256:()=>Se,sha512:()=>oo});var $n=Jt,Wt=128,Vn=127,_n=~Vn,jn=Math.pow(2,31);function Jt(t,e,r){e=e||[],r=r||0;for(var n=r;t>=jn;)e[r++]=t&255|Wt,t/=128;for(;t&_n;)e[r++]=t&255|Wt,t>>>=7;return e[r]=t|0,Jt.bytes=r-n+1,e}var qn=et,Wn=128,Gt=127;function et(t,n){var r=0,n=n||0,o=0,s=n,i,l=t.length;do{if(s>=l)throw et.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=o<28?(i&Gt)<<o:(i&Gt)*Math.pow(2,o),o+=7}while(i>=Wn);return et.bytes=s-n,r}var Gn=Math.pow(2,7),Jn=Math.pow(2,14),Hn=Math.pow(2,21),Kn=Math.pow(2,28),Xn=Math.pow(2,35),Qn=Math.pow(2,42),Yn=Math.pow(2,49),Zn=Math.pow(2,56),eo=Math.pow(2,63),to=function(t){return t<Gn?1:t<Jn?2:t<Hn?3:t<Kn?4:t<Xn?5:t<Qn?6:t<Yn?7:t<Zn?8:t<eo?9:10},ro={encode:$n,decode:qn,encodingLength:to},no=ro,de=no;var pe=(t,e=0)=>[de.decode(t,e),de.decode.bytes],re=(t,e,r=0)=>(de.encode(t,e,r),e),ne=t=>de.encodingLength(t);var V=(t,e)=>{let r=e.byteLength,n=ne(t),o=n+ne(r),s=new Uint8Array(o+r);return re(t,s,0),re(r,s,n),s.set(e,o),new oe(t,r,e,s)},G=t=>{let e=O(t),[r,n]=pe(e),[o,s]=pe(e.subarray(n)),i=e.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new oe(r,o,i,e)},Ht=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&Lt(t.bytes,r.bytes)}},oe=class{constructor(e,r,n,o){this.code=e,this.size=r,this.digest=n,this.bytes=o}};var rt=({name:t,code:e,encode:r})=>new tt(t,e,r),tt=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?V(this.code,r):r.then(n=>V(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Xt=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Se=rt({name:"sha2-256",code:18,encode:Xt("SHA-256")}),oo=rt({name:"sha2-512",code:19,encode:Xt("SHA-512")});var ot={};F(ot,{identity:()=>Ae});var Qt=0,so="identity",Yt=O,io=t=>V(Qt,Yt(t)),Ae={code:Qt,name:so,encode:Yt,digest:io};var Ws=new TextEncoder,Gs=new TextDecoder;var Zt=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return lo(r,st(t),e||v.encoder);default:return po(r,st(t),e||R.encoder)}};var er=new WeakMap,st=t=>{let e=er.get(t);if(e==null){let r=new Map;return er.set(t,r),r}return e},B=class t{constructor(e,r,n,o){this.code=r,this.version=e,this.multihash=n,this.bytes=o,this["/"]=o}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!==fe)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==fo)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=V(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&&e.code===n.code&&e.version===n.version&&Ht(e.multihash,n.multihash)}toString(e){return Zt(this,e)}toJSON(){return{"/":Zt(this)}}link(){return this}get[Symbol.toStringTag](){return"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:o,multihash:s,bytes:i}=r;return new t(n,o,s,i||tr(n,o,s.bytes))}else if(r[ho]===!0){let{version:n,multihash:o,code:s}=r,i=G(o);return t.create(n,s,i)}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!==fe)throw new Error(`Version 0 CID must use dag-pb (code: ${fe}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let o=tr(e,r,n.bytes);return new t(e,r,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,fe,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,o=O(e.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=o.subarray(r.multihashSize-r.digestSize),i=new oe(r.multihashCode,r.digestSize,s,o);return[r.version===0?t.createV0(i):t.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[d,f]=pe(e.subarray(r));return r+=f,d},o=n(),s=fe;if(o===18?(o=0,r=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=r,l=n(),h=n(),S=r+h,c=S-i;return{version:o,codec:s,multihashCode:l,digestSize:h,multihashSize:c,size:S}}static parse(e,r){let[n,o]=uo(e,r),s=t.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return st(s).set(n,e),s}},uo=(t,e)=>{switch(t[0]){case"Q":{let r=e||v;return[v.prefix,r.decode(`${v.prefix}${t}`)]}case v.prefix:{let r=e||v;return[v.prefix,r.decode(t)]}case R.prefix:{let r=e||R;return[R.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},lo=(t,e,r)=>{let{prefix:n}=r;if(n!==v.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=e.get(n);if(o==null){let s=r.encode(t).slice(1);return e.set(n,s),s}else return o},po=(t,e,r)=>{let{prefix:n}=r,o=e.get(n);if(o==null){let s=r.encode(t);return e.set(n,s),s}else return o},fe=112,fo=18,tr=(t,e,r)=>{let n=ne(t),o=n+ne(e),s=new Uint8Array(o+r.byteLength);return re(t,s,0),re(e,s,n),s.set(r,o),s},ho=Symbol.for("@ipld/js-cid/CID");var _={...Je,...He,...Ke,...Xe,...Qe,...je,...Ye,...qe,...Ge,...Ze},ri={...nt,...ot};function he(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}var mo=Symbol.for("nodejs.util.inspect.custom"),rr=Object.values(_).map(t=>t.decoder).reduce((t,e)=>t.or(e),_.identity.decoder),nr=114,or=36,sr=37,me=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[jt]=!0;toString(){return this.string==null&&(this.string=v.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return B.createV1(nr,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return he(this.multihash.bytes,e);if(typeof e=="string")return it(e).equals(this);if(e?.multihash?.bytes!=null)return he(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[mo](){return`PeerId(${this.toString()})`}},ge=class extends me{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},be=class extends me{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},we=class extends me{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function it(t,e){if(e=e??rr,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=G(v.decode(`z${t}`));return t.startsWith("12D")?new be({multihash:r}):t.startsWith("16U")?new we({multihash:r}):new ge({multihash:r})}return go(rr.decode(t))}function go(t){try{let e=G(t);if(e.code===Ae.code){if(e.digest.length===or)return new be({multihash:e});if(e.digest.length===sr)return new we({multihash:e})}if(e.code===Se.code)return new ge({multihash:e})}catch{return bo(B.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function bo(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==nr)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Se.code)return new ge({multihash:t.multihash});if(e.code===Ae.code){if(e.digest.length===or)return new be({multihash:t.multihash});if(e.digest.length===sr)return new we({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}var Ie=class extends Error{code;props;constructor(e,r,n){super(e),this.code=r,this.name=n?.name??"CodeError",this.props=n??{}}};function se(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Te(t=0){return globalThis.Buffer?.allocUnsafe!=null?se(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function ar(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}var ir=ar("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),at=ar("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=Te(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),wo={utf8:ir,"utf-8":ir,hex:_.base16,latin1:at,ascii:at,binary:at,..._},Fe=wo;function I(t,e="utf8"){let r=Fe[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function z(t,e){e==null&&(e=t.reduce((o,s)=>o+s.length,0));let r=Te(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return se(r)}var ce=Le(lt(),1);var Pe=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let r=this.index,n=e();return n===void 0&&(this.index=r),n}parseWith(e){let r=e();if(this.index===this.input.length)return r}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let r=this.readChar();if(r===e)return r})}readSeparator(e,r,n){return this.readAtomically(()=>{if(!(r>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,r,n,o){return this.readAtomically(()=>{let s=0,i=0,l=this.peekChar();if(l===void 0)return;let h=l==="0",S=2**(8*o)-1;for(;;){let c=this.readAtomically(()=>{let d=this.readChar();if(d===void 0)return;let f=Number.parseInt(d,e);if(!Number.isNaN(f))return f});if(c===void 0)break;if(s*=e,s+=c,s>S||(i+=1,r!==void 0&&i>r))return}if(i!==0)return!n&&h&&i>1?void 0:s})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let r=0;r<e.length;r++){let n=this.readSeparator(".",r,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[r]=n}return e})}readIPv6Addr(){let e=r=>{for(let n=0;n<r.length/2;n++){let o=n*2;if(n<r.length-3){let i=this.readSeparator(":",n,()=>this.readIPv4Addr());if(i!==void 0)return r[o]=i[0],r[o+1]=i[1],r[o+2]=i[2],r[o+3]=i[3],[o+4,!0]}let s=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(s===void 0)return[o,!1];r[o]=s>>8,r[o+1]=s&255}return[r.length,!1]};return this.readAtomically(()=>{let r=new Uint8Array(16),[n,o]=e(r);if(n===16)return r;if(o||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let s=new Uint8Array(14),i=16-(n+2),[l]=e(s.subarray(0,i));return r.set(s.subarray(0,l),16-l),r})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var br=45,No=15,ie=new Pe;function dt(t){if(!(t.length>No))return ie.new(t).parseWith(()=>ie.readIPv4Addr())}function pt(t){if(!(t.length>br))return ie.new(t).parseWith(()=>ie.readIPv6Addr())}function De(t){if(!(t.length>br))return ie.new(t).parseWith(()=>ie.readIPAddr())}var $i=parseInt("0xFFFF",16),Vi=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function ft(t,e="utf8"){let r=Fe[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?se(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}var L=Le(lt(),1);function xr(t){return!!dt(t)}function vr(t){return!!pt(t)}function Ue(t){return!!De(t)}var Cr=xr,Lo=vr,ht=function(t){let e=0;if(t=t.toString().trim(),Cr(t)){let r=new Uint8Array(e+4);return t.split(/\./g).forEach(n=>{r[e++]=parseInt(n,10)&255}),r}if(Lo(t)){let r=t.split(":",8),n;for(n=0;n<r.length;n++){let s=Cr(r[n]),i;s&&(i=ht(r[n]),r[n]=I(i.slice(0,2),"base16")),i!=null&&++n<8&&r.splice(n,0,I(i.slice(2,4),"base16"))}if(r[0]==="")for(;r.length<8;)r.unshift("0");else if(r[r.length-1]==="")for(;r.length<8;)r.push("0");else if(r.length<8){for(n=0;n<r.length&&r[n]!=="";n++);let s=[n,1];for(n=9-r.length;n>0;n--)s.push("0");r.splice.apply(r,s)}let o=new Uint8Array(e+16);for(n=0;n<r.length;n++){let s=parseInt(r[n],16);o[e++]=s>>8&255,o[e++]=s&255}return o}throw new Error("invalid ip address")},Er=function(t,e=0,r){e=~~e,r=r??t.length-e;let n=new DataView(t.buffer);if(r===4){let o=[];for(let s=0;s<r;s++)o.push(t[e+s]);return o.join(".")}if(r===16){let o=[];for(let s=0;s<r;s+=2)o.push(n.getUint16(e+s).toString(16));return o.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var ae={},mt={},zo=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,-1,"ip6zone"],[43,8,"ipcidr"],[53,-1,"dns",!0],[54,-1,"dns4",!0],[55,-1,"dns6",!0],[56,-1,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,-1,"unix",!1,!0],[421,-1,"ipfs"],[421,-1,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,-1,"garlic64"],[448,0,"tls"],[449,-1,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,-1,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,-1,"memory"]];zo.forEach(t=>{let e=$o(...t);mt[e.code]=e,ae[e.name]=e});function $o(t,e,r,n,o){return{code:t,size:e,name:r,resolvable:!!n,path:!!o}}function m(t){if(typeof t=="number"){if(mt[t]!=null)return mt[t];throw new Error(`no protocol with code: ${t}`)}else if(typeof t=="string"){if(ae[t]!=null)return ae[t];throw new Error(`no protocol with name: ${t}`)}throw new Error(`invalid protocol id type: ${typeof t}`)}var Ta=m("ip4"),Fa=m("ip6"),Pa=m("ipcidr");function bt(t,e){switch(m(t).code){case 4:case 41:return _o(e);case 42:return Ir(e);case 6:case 273:case 33:case 132:return Fr(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Ir(e);case 421:return Go(e);case 444:return Tr(e);case 445:return Tr(e);case 466:return Wo(e);default:return I(e,"base16")}}function wt(t,e){switch(m(t).code){case 4:return Sr(e);case 41:return Sr(e);case 42:return Ar(e);case 6:case 273:case 33:case 132:return yt(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Ar(e);case 421:return jo(e);case 444:return Jo(e);case 445:return Ho(e);case 466:return qo(e);default:return ft(e,"base16")}}var gt=Object.values(_).map(t=>t.decoder),Vo=function(){let t=gt[0].or(gt[1]);return gt.slice(2).forEach(e=>t=t.or(e)),t}();function Sr(t){if(!Ue(t))throw new Error("invalid ip address");return ht(t)}function _o(t){let e=Er(t,0,t.length);if(e==null)throw new Error("ipBuff is required");if(!Ue(e))throw new Error("invalid ip address");return e}function yt(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function Fr(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function Ar(t){let e=ft(t),r=Uint8Array.from(L.default.encode(e.length));return z([r,e],r.length+e.length)}function Ir(t){let e=L.default.decode(t);if(t=t.slice(L.default.decode.bytes),t.length!==e)throw new Error("inconsistent lengths");return I(t)}function jo(t){let e;t[0]==="Q"||t[0]==="1"?e=G(v.decode(`z${t}`)).bytes:e=B.parse(t).multihash.bytes;let r=Uint8Array.from(L.default.encode(e.length));return z([r,e],r.length+e.length)}function qo(t){let e=Vo.decode(t),r=Uint8Array.from(L.default.encode(e.length));return z([r,e],r.length+e.length)}function Wo(t){let e=L.default.decode(t),r=t.slice(L.default.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return"u"+I(r,"base64url")}function Go(t){let e=L.default.decode(t),r=t.slice(L.default.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return I(r,"base58btc")}function Jo(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let r=R.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=yt(n);return z([r,o],r.length+o.length)}function Ho(t){let e=t.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let r=R.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let o=yt(n);return z([r,o],r.length+o.length)}function Tr(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=I(e,"base32"),o=Fr(r);return`${n}:${o}`}function Pr(t){t=xt(t);let e=[],r=[],n=null,o=t.split("/").slice(1);if(o.length===1&&o[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let s=0;s<o.length;s++){let i=o[s],l=m(i);if(l.size===0){e.push([l.code]),r.push([l.code]);continue}if(s++,s>=o.length)throw Ur("invalid address: "+t);if(l.path===!0){n=xt(o.slice(s).join("/")),e.push([l.code,wt(l.code,n)]),r.push([l.code,n]);break}let h=wt(l.code,o[s]);e.push([l.code,h]),r.push([l.code,bt(l.code,h)])}return{string:Dr(r),bytes:Ct(e),tuples:e,stringTuples:r,path:n}}function vt(t){let e=[],r=[],n=null,o=0;for(;o<t.length;){let s=ce.default.decode(t,o),i=ce.default.decode.bytes??0,l=m(s),h=Ko(l,t.slice(o+i));if(h===0){e.push([s]),r.push([s]),o+=i;continue}let S=t.slice(o+i,o+i+h);if(o+=h+i,o>t.length)throw Ur("Invalid address Uint8Array: "+I(t,"base16"));e.push([s,S]);let c=bt(s,S);if(r.push([s,c]),l.path===!0){n=c;break}}return{bytes:Uint8Array.from(t),string:Dr(r),tuples:e,stringTuples:r,path:n}}function Dr(t){let e=[];return t.map(r=>{let n=m(r[0]);return e.push(n.name),r.length>1&&r[1]!=null&&e.push(r[1]),null}),xt(e.join("/"))}function Ct(t){return z(t.map(e=>{let r=m(e[0]),n=Uint8Array.from(ce.default.encode(r.code));return e.length>1&&e[1]!=null&&(n=z([n,e[1]])),n}))}function Ko(t,e){return t.size>0?t.size/8:t.size===0?0:ce.default.decode(e)+(ce.default.decode.bytes??0)}function xt(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function Ur(t){return new Error("Error parsing address: "+t)}var Xo=Symbol.for("nodejs.util.inspect.custom"),Qo=[m("dns").code,m("dns4").code,m("dns6").code,m("dnsaddr").code],Yo=new Map,Nr=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Zo(t){return!!t?.[Nr]}var Et=class t{bytes;#e;#t;#r;#n;[Nr]=!0;constructor(e){e==null&&(e="");let r;if(e instanceof Uint8Array)r=vt(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);r=Pr(e)}else if(Zo(e))r=vt(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=r.bytes,this.#e=r.string,this.#t=r.tuples,this.#r=r.stringTuples,this.#n=r.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,r,n,o,s="",i=m("tcp"),l=m("udp"),h=m("ip4"),S=m("ip6"),c=m("dns6"),d=m("ip6zone");for(let[C,p]of this.stringTuples())C===d.code&&(s=`%${p??""}`),Qo.includes(C)&&(r=i.name,o=443,n=`${p??""}${s}`,e=C===c.code?6:4),(C===i.code||C===l.code)&&(r=m(C).name,o=parseInt(p??"")),(C===h.code||C===S.code)&&(r=m(C).name,n=`${p??""}${s}`,e=C===S.code?6:4);if(e==null||r==null||n==null||o==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:n,transport:r,port:o}}protos(){return this.#t.map(([e])=>Object.assign({},m(e)))}protoCodes(){return this.#t.map(([e])=>e)}protoNames(){return this.#t.map(([e])=>m(e).name)}tuples(){return this.#t}stringTuples(){return this.#r}encapsulate(e){return e=new t(e),new t(this.toString()+e.toString())}decapsulate(e){let r=e.toString(),n=this.toString(),o=n.lastIndexOf(r);if(o<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new t(n.slice(0,o))}decapsulateCode(e){let r=this.tuples();for(let n=r.length-1;n>=0;n--)if(r[n][0]===e)return new t(Ct(r.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,o])=>{n===ae.p2p.code&&e.push([n,o]),n===ae["p2p-circuit"].code&&(e=[])});let r=e.pop();if(r?.[1]!=null){let n=r[1];return n[0]==="Q"||n[0]==="1"?I(v.decode(`z${n}`),"base58btc"):I(B.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return he(this.bytes,e.bytes)}async resolve(e){let r=this.protos().find(s=>s.resolvable);if(r==null)return[this];let n=Yo.get(r.name);if(n==null)throw new Ie(`no available resolver for ${r.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(s=>new t(s))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let r=(e??this).protos();return!(r.length!==2||r[0].code!==4&&r[0].code!==41||r[1].code!==6&&r[1].code!==273)}[Xo](){return`Multiaddr(${this.#e})`}};function ue(t){return new Et(t)}var es=a("dns4"),ts=a("dns6"),rs=a("dnsaddr"),K=w(a("dns"),rs,es,ts),Me=w(a("ip4"),a("ip6")),le=w(u(Me,a("tcp")),u(K,a("tcp"))),Re=u(Me,a("udp")),ns=u(Re,a("utp")),os=u(Re,a("quic")),ss=u(Re,a("quic-v1")),St=w(u(le,a("ws")),u(K,a("ws"))),Ne=w(u(St,a("p2p")),St),At=w(u(le,a("wss")),u(K,a("wss")),u(le,a("tls"),a("ws")),u(K,a("tls"),a("ws"))),ke=w(u(At,a("p2p")),At),It=w(u(le,a("http")),u(Me,a("http")),u(K,a("http"))),Tt=w(u(le,a("https")),u(Me,a("https")),u(K,a("https"))),kr=u(Re,a("webrtc-direct"),a("certhash")),Br=w(u(kr,a("p2p")),kr),Mr=u(ss,a("webtransport"),a("certhash"),a("certhash")),Lr=w(u(Mr,a("p2p")),Mr),Or=w(u(Ne,a("p2p-webrtc-star"),a("p2p")),u(ke,a("p2p-webrtc-star"),a("p2p")),u(Ne,a("p2p-webrtc-star")),u(ke,a("p2p-webrtc-star"))),Qa=w(u(Ne,a("p2p-websocket-star"),a("p2p")),u(ke,a("p2p-websocket-star"),a("p2p")),u(Ne,a("p2p-websocket-star")),u(ke,a("p2p-websocket-star"))),zr=w(u(It,a("p2p-webrtc-direct"),a("p2p")),u(Tt,a("p2p-webrtc-direct"),a("p2p")),u(It,a("p2p-webrtc-direct")),u(Tt,a("p2p-webrtc-direct"))),X=w(St,At,It,Tt,Or,zr,le,ns,os,K,Br,Lr),Ya=w(u(X,a("p2p-stardust"),a("p2p")),u(X,a("p2p-stardust"))),j=w(u(X,a("p2p")),Or,zr,Br,Lr,a("p2p")),Rr=w(u(j,a("p2p-circuit"),j),u(j,a("p2p-circuit")),u(a("p2p-circuit"),j),u(X,a("p2p-circuit")),u(a("p2p-circuit"),X),a("p2p-circuit")),$r=()=>w(u(Rr,$r),Rr),H=$r(),Vr=w(u(H,j,H),u(j,H),u(H,j),H,j);var Za=w(u(H,a("webrtc"),a("p2p")),u(H,a("webrtc")),u(X,a("webrtc"),a("p2p")),u(X,a("webrtc")),a("webrtc"));function _r(t){function e(r){let n;try{n=ue(r)}catch{return!1}let o=t(n.protoNames());return o===null?!1:o===!0||o===!1?o:o.length===0}return e}function u(...t){function e(r){if(r.length<t.length)return null;let n=r;return t.some(o=>(n=typeof o=="function"?o().partialMatch(r):o.partialMatch(r),Array.isArray(n)&&(r=n),n===null)),n}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:_r(e),partialMatch:e}}function w(...t){function e(n){let o=null;return t.some(s=>{let i=typeof s=="function"?s().partialMatch(n):s.partialMatch(n);return i!=null?(o=i,!0):!1}),o}return{toString:function(){return"{ "+t.join(" ")+" }"},input:t,matches:_r(e),partialMatch:e}}function a(t){let e=t;function r(o){let s;try{s=ue(o)}catch{return!1}let i=s.protoNames();return i.length===1&&i[0]===e}function n(o){return o.length===0?null:o[0]===e?o.slice(1):null}return{toString:function(){return e},matches:r,partialMatch:n}}var Be=_t("libp2p:bootstrap"),is="bootstrap",as=50,cs=12e4,us=1e3,Ft=class extends xe{static tag="bootstrap";timer;list;timeout;components;_init;constructor(e,r={list:[]}){if(r.list==null||r.list.length===0)throw new Error("Bootstrap requires a list of peer addresses");super(),this.components=e,this.timeout=r.timeout??us,this.list=[];for(let n of r.list){if(!Vr.matches(n)){Be.error("Invalid multiaddr");continue}let o=ue(n),s=o.getPeerId();if(s==null){Be.error("Invalid bootstrap multiaddr without peer id");continue}let i={id:it(s),multiaddrs:[o],protocols:[]};this.list.push(i)}this._init=r}[Dt]=this;[Symbol.toStringTag]="@libp2p/bootstrap";isStarted(){return!!this.timer}start(){this.isStarted()||(Be("Starting bootstrap node discovery, discovering peers after %s ms",this.timeout),this.timer=setTimeout(()=>{this._discoverBootstrapPeers().catch(e=>{Be.error(e)})},this.timeout))}async _discoverBootstrapPeers(){if(this.timer!=null)for(let e of this.list){if(await this.components.peerStore.merge(e.id,{tags:{[this._init.tagName??is]:{value:this._init.tagValue??as,ttl:this._init.tagTTL??cs}}}),this.timer==null)return;this.safeDispatchEvent("peer",{detail:e})}}stop(){this.timer!=null&&clearTimeout(this.timer),this.timer=void 0}};function ls(t){return e=>new Ft(e,t)}return Hr(ds);})();
|
|
3
3
|
return Libp2PBootstrap}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/bootstrap",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-58421e11",
|
|
4
4
|
"description": "Peer discovery via a list of bootstrap peers",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/peer-discovery-bootstrap#readme",
|
|
@@ -48,18 +48,15 @@
|
|
|
48
48
|
"test:electron-main": "aegir test -t electron-main"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@libp2p/interface": "0.0
|
|
52
|
-
"@libp2p/logger": "
|
|
53
|
-
"@libp2p/peer-id": "
|
|
51
|
+
"@libp2p/interface": "0.1.0-58421e11",
|
|
52
|
+
"@libp2p/logger": "3.0.0-58421e11",
|
|
53
|
+
"@libp2p/peer-id": "3.0.0-58421e11",
|
|
54
54
|
"@multiformats/mafmt": "^12.1.2",
|
|
55
55
|
"@multiformats/multiaddr": "^12.1.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@libp2p/interface-compliance-tests": "
|
|
59
|
-
"aegir": "^
|
|
58
|
+
"@libp2p/interface-compliance-tests": "4.0.0-58421e11",
|
|
59
|
+
"aegir": "^40.0.1",
|
|
60
60
|
"sinon-ts": "^1.0.0"
|
|
61
|
-
},
|
|
62
|
-
"typedoc": {
|
|
63
|
-
"entryPoint": "./src/index.ts"
|
|
64
61
|
}
|
|
65
62
|
}
|