@libp2p/bootstrap 6.0.1 → 6.0.3

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 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 en=Object.create;var Ie=Object.defineProperty;var tn=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,on=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),I=(t,e)=>{for(var r in e)Ie(t,r,{get:e[r],enumerable:!0})},Ot=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rn(e))!on.call(t,o)&&o!==r&&Ie(t,o,{get:()=>e[o],enumerable:!(n=tn(e,o))||n.enumerable});return t};var de=(t,e,r)=>(r=t!=null?en(nn(t)):{},Ot(e||!t||!t.__esModule?Ie(r,"default",{value:t,enumerable:!0}):r,t)),sn=t=>Ot(Ie({},"__esModule",{value:!0}),t);var fr=k((vi,dr)=>{dr.exports=gt;var lr=128,wo=127,yo=~wo,xo=Math.pow(2,31);function gt(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw gt.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=xo;)e[r++]=t&255|lr,t/=128;for(;t&yo;)e[r++]=t&255|lr,t>>>=7;return e[r]=t|0,gt.bytes=r-n+1,e}});var mr=k((Ci,hr)=>{hr.exports=wt;var vo=128,pr=127;function wt(t,n){var r=0,n=n||0,o=0,s=n,i,d=t.length;do{if(s>=d||o>49)throw wt.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=o<28?(i&pr)<<o:(i&pr)*Math.pow(2,o),o+=7}while(i>=vo);return wt.bytes=s-n,r}});var gr=k((Ei,br)=>{var Co=Math.pow(2,7),Eo=Math.pow(2,14),So=Math.pow(2,21),Ao=Math.pow(2,28),To=Math.pow(2,35),Fo=Math.pow(2,42),Po=Math.pow(2,49),Io=Math.pow(2,56),Uo=Math.pow(2,63);br.exports=function(t){return t<Co?1:t<Eo?2:t<So?3:t<Ao?4:t<To?5:t<Fo?6:t<Po?7:t<Io?8:t<Uo?9:10}});var Le=k((Si,wr)=>{wr.exports={encode:fr(),decode:mr(),encodingLength:gr()}});var Ur=k((qi,Ir)=>{"use strict";function Pr(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Go(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Pr(t,r)}catch{r.message=t.message,r.stack=t.stack;let o=function(){};return o.prototype=Object.create(Object.getPrototypeOf(t)),Pr(new o,r)}}Ir.exports=Go});var jr=k((na,kr)=>{var ce=1e3,ue=ce*60,le=ue*60,K=le*24,ts=K*7,rs=K*365.25;kr.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return ns(t);if(r==="number"&&isFinite(t))return e.long?ss(t):os(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function ns(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*rs;case"weeks":case"week":case"w":return r*ts;case"days":case"day":case"d":return r*K;case"hours":case"hour":case"hrs":case"hr":case"h":return r*le;case"minutes":case"minute":case"mins":case"min":case"m":return r*ue;case"seconds":case"second":case"secs":case"sec":case"s":return r*ce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function os(t){var e=Math.abs(t);return e>=K?Math.round(t/K)+"d":e>=le?Math.round(t/le)+"h":e>=ue?Math.round(t/ue)+"m":e>=ce?Math.round(t/ce)+"s":t+"ms"}function ss(t){var e=Math.abs(t);return e>=K?je(t,e,K,"day"):e>=le?je(t,e,le,"hour"):e>=ue?je(t,e,ue,"minute"):e>=ce?je(t,e,ce,"second"):t+" ms"}function je(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Gr=k((oa,qr)=>{function is(t){r.debug=r,r.default=r,r.coerce=w,r.disable=s,r.enable=o,r.enabled=i,r.humanize=jr(),r.destroy=F,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let l=0;for(let p=0;p<c.length;p++)l=(l<<5)-l+c.charCodeAt(p),l|=0;return r.colors[Math.abs(l)%r.colors.length]}r.selectColor=e;function r(c){let l,p=null,C,f;function m(...y){if(!m.enabled)return;let x=m,A=Number(new Date),B=A-(l||A);x.diff=B,x.prev=l,x.curr=A,l=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,(M,P)=>{if(M==="%%")return"%";E++;let D=r.formatters[P];if(typeof D=="function"){let Y=y[E];M=D.call(x,Y),y.splice(E,1),E--}return M}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return m.namespace=c,m.useColors=r.useColors(),m.color=r.selectColor(c),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(C!==r.namespaces&&(C=r.namespaces,f=r.enabled(c)),f),set:y=>{p=y}}),typeof r.init=="function"&&r.init(m),m}function n(c,l){let p=r(this.namespace+(typeof l>"u"?":":l)+c);return p.log=this.log,p}function o(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let l,p=(typeof c=="string"?c:"").split(/[\s,]+/),C=p.length;for(l=0;l<C;l++)p[l]&&(c=p[l].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(d),...r.skips.map(d).map(l=>"-"+l)].join(",");return r.enable(""),c}function i(c){if(c[c.length-1]==="*")return!0;let l,p;for(l=0,p=r.skips.length;l<p;l++)if(r.skips[l].test(c))return!1;for(l=0,p=r.names.length;l<p;l++)if(r.names[l].test(c))return!0;return!1}function d(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function w(c){return c instanceof Error?c.stack||c.message:c}function F(){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}qr.exports=is});var Wr=k((U,qe)=>{U.formatArgs=cs;U.save=us;U.load=ls;U.useColors=as;U.storage=ds();U.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`."))}})();U.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 as(){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 cs(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+qe.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)}U.log=console.debug||console.log||(()=>{});function us(t){try{t?U.storage.setItem("debug",t):U.storage.removeItem("debug")}catch{}}function ls(){let t;try{t=U.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function ds(){try{return localStorage}catch{}}qe.exports=Gr()(U);var{formatters:fs}=qe.exports;fs.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var vs={};I(vs,{bootstrap:()=>xs});var Ue=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,d=this.peekChar();if(d===void 0)return;let w=d==="0",F=2**(8*o)-1;for(;;){let c=this.readAtomically(()=>{let l=this.readChar();if(l===void 0)return;let p=Number.parseInt(l,e);if(!Number.isNaN(p))return p});if(c===void 0)break;if(s*=e,s+=c,s>F||(i+=1,r!==void 0&&i>r))return}if(i!==0)return!n&&w&&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),[d]=e(s.subarray(0,i));return r.set(s.subarray(0,d),16-d),r})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var zt=45,an=15,Z=new Ue;function Lt(t){if(!(t.length>an))return Z.new(t).parseWith(()=>Z.readIPv4Addr())}function _t(t){if(!(t.length>zt))return Z.new(t).parseWith(()=>Z.readIPv6Addr())}function Rt(t){if(!(t.length>zt))return Z.new(t).parseWith(()=>Z.readIPAddr())}function $t(t){return!!Lt(t)}function Vt(t){return!!_t(t)}function Be(t){return!!Rt(t)}var Ke={};I(Ke,{identity:()=>pn});function cn(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 d=t.length,w=t.charAt(0),F=Math.log(d)/Math.log(256),c=Math.log(256)/Math.log(d);function l(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var m=0,y=0,x=0,A=f.length;x!==A&&f[x]===0;)x++,m++;for(var B=(A-x)*c+1>>>0,E=new Uint8Array(B);x!==A;){for(var N=f[x],M=0,P=B-1;(N!==0||M<y)&&P!==-1;P--,M++)N+=256*E[P]>>>0,E[P]=N%d>>>0,N=N/d>>>0;if(N!==0)throw new Error("Non-zero carry");y=M,x++}for(var D=B-y;D!==B&&E[D]===0;)D++;for(var Y=w.repeat(m);D<B;++D)Y+=t.charAt(E[D]);return Y}function p(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var m=0;if(f[m]!==" "){for(var y=0,x=0;f[m]===w;)y++,m++;for(var A=(f.length-m)*F+1>>>0,B=new Uint8Array(A);f[m];){var E=r[f.charCodeAt(m)];if(E===255)return;for(var N=0,M=A-1;(E!==0||N<x)&&M!==-1;M--,N++)E+=d*B[M]>>>0,B[M]=E%256>>>0,E=E/256>>>0;if(E!==0)throw new Error("Non-zero carry");x=N,m++}if(f[m]!==" "){for(var P=A-x;P!==A&&B[P]===0;)P++;for(var D=new Uint8Array(y+(A-P)),Y=y;P!==A;)D[Y++]=B[P++];return D}}}function C(f){var m=p(f);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:l,decodeUnsafe:p,decode:C}}var un=cn,ln=un,kt=ln;var Is=new Uint8Array(0);var jt=(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},_=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 qt=t=>new TextEncoder().encode(t),Gt=t=>new TextDecoder().decode(t);var Je=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")}},He=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 Jt(this,e)}},Xe=class{constructor(e){this.decoders=e}or(e){return Jt(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`)}},Jt=(t,e)=>new Xe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Qe=class{constructor(e,r,n,o){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new Je(e,r,n),this.decoder=new He(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ee=({name:t,prefix:e,encode:r,decode:n})=>new Qe(t,e,r,n),j=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:o}=kt(r,e);return ee({prefix:t,name:e,encode:n,decode:s=>_(o(s))})},dn=(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),d=0,w=0,F=0;for(let c=0;c<s;++c){let l=o[t[c]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);w=w<<r|l,d+=r,d>=8&&(d-=8,i[F++]=255&w>>d)}if(d>=r||255&w<<8-d)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,d=0;for(let w=0;w<t.length;++w)for(d=d<<8|t[w],i+=8;i>r;)i-=r,s+=e[o&d>>i];if(i&&(s+=e[o&d<<r-i]),n)for(;s.length*r&7;)s+="=";return s},g=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ee({prefix:e,name:t,encode(o){return fn(o,n,r)},decode(o){return dn(o,n,r,t)}});var pn=ee({prefix:"\0",name:"identity",encode:t=>Gt(t),decode:t=>qt(t)});var Ye={};I(Ye,{base2:()=>hn});var hn=g({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ze={};I(Ze,{base8:()=>mn});var mn=g({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var et={};I(et,{base10:()=>bn});var bn=j({prefix:"9",name:"base10",alphabet:"0123456789"});var tt={};I(tt,{base16:()=>gn,base16upper:()=>wn});var gn=g({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),wn=g({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var rt={};I(rt,{base32:()=>O,base32hex:()=>Cn,base32hexpad:()=>Sn,base32hexpadupper:()=>An,base32hexupper:()=>En,base32pad:()=>xn,base32padupper:()=>vn,base32upper:()=>yn,base32z:()=>Tn});var O=g({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),yn=g({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),xn=g({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vn=g({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Cn=g({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),En=g({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Sn=g({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),An=g({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Tn=g({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var nt={};I(nt,{base36:()=>Fn,base36upper:()=>Pn});var Fn=j({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Pn=j({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ot={};I(ot,{base58btc:()=>v,base58flickr:()=>In});var v=j({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),In=j({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var it={};I(it,{base64:()=>st,base64pad:()=>Un,base64url:()=>Bn,base64urlpad:()=>Mn});var st=g({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Un=g({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Bn=g({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Mn=g({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var at={};I(at,{base256emoji:()=>Ln});var Ht=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}"),Dn=Ht.reduce((t,e,r)=>(t[r]=e,t),[]),Nn=Ht.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function On(t){return t.reduce((e,r)=>(e+=Dn[r],e),"")}function zn(t){let e=[];for(let r of t){let n=Nn[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Ln=ee({prefix:"\u{1F680}",name:"base256emoji",encode:On,decode:zn});var dt={};I(dt,{sha256:()=>De,sha512:()=>ro});var _n=Kt,Xt=128,Rn=127,$n=~Rn,Vn=Math.pow(2,31);function Kt(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Vn;)e[r++]=t&255|Xt,t/=128;for(;t&$n;)e[r++]=t&255|Xt,t>>>=7;return e[r]=t|0,Kt.bytes=r-n+1,e}var kn=ct,jn=128,Qt=127;function ct(t,n){var r=0,n=n||0,o=0,s=n,i,d=t.length;do{if(s>=d)throw ct.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=o<28?(i&Qt)<<o:(i&Qt)*Math.pow(2,o),o+=7}while(i>=jn);return ct.bytes=s-n,r}var qn=Math.pow(2,7),Gn=Math.pow(2,14),Wn=Math.pow(2,21),Jn=Math.pow(2,28),Hn=Math.pow(2,35),Xn=Math.pow(2,42),Qn=Math.pow(2,49),Kn=Math.pow(2,56),Yn=Math.pow(2,63),Zn=function(t){return t<qn?1:t<Gn?2:t<Wn?3:t<Jn?4:t<Hn?5:t<Xn?6:t<Qn?7:t<Kn?8:t<Yn?9:10},eo={encode:_n,decode:kn,encodingLength:Zn},to=eo,fe=to;var pe=(t,e=0)=>[fe.decode(t,e),fe.decode.bytes],te=(t,e,r=0)=>(fe.encode(t,e,r),e),re=t=>fe.encodingLength(t);var q=(t,e)=>{let r=e.byteLength,n=re(t),o=n+re(r),s=new Uint8Array(o+r);return te(t,s,0),te(r,s,n),s.set(e,o),new ne(t,r,e,s)},J=t=>{let e=_(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 ne(r,o,i,e)},Yt=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&jt(t.bytes,r.bytes)}},ne=class{constructor(e,r,n,o){this.code=e,this.size=r,this.digest=n,this.bytes=o}};var lt=({name:t,code:e,encode:r})=>new ut(t,e,r),ut=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?q(this.code,r):r.then(n=>q(this.code,n))}else throw Error("Unknown type, must be binary type")}};var er=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),De=lt({name:"sha2-256",code:18,encode:er("SHA-256")}),ro=lt({name:"sha2-512",code:19,encode:er("SHA-512")});var ft={};I(ft,{identity:()=>Ne});var tr=0,no="identity",rr=_,oo=t=>q(tr,rr(t)),Ne={code:tr,name:no,encode:rr,digest:oo};var Qs=new TextEncoder,Ks=new TextDecoder;var nr=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return co(r,pt(t),e||v.encoder);default:return uo(r,pt(t),e||O.encoder)}};var or=new WeakMap,pt=t=>{let e=or.get(t);if(e==null){let r=new Map;return or.set(t,r),r}return e},h=class{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!==he)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==lo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return h.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=q(e,r);return h.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 h.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&Yt(e.multihash,n.multihash)}toString(e){return nr(this,e)}toJSON(){return{"/":nr(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 h)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:s,bytes:i}=r;return new h(n,o,s,i||sr(n,o,s.bytes))}else if(r[fo]===!0){let{version:n,multihash:o,code:s}=r,i=J(o);return h.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!==he)throw new Error(`Version 0 CID must use dag-pb (code: ${he}) block encoding`);return new h(e,r,n,n.bytes)}case 1:{let o=sr(e,r,n.bytes);return new h(e,r,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return h.create(0,he,e)}static createV1(e,r){return h.create(1,e,r)}static decode(e){let[r,n]=h.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=h.inspectBytes(e),n=r.size-r.multihashSize,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 ne(r.multihashCode,r.digestSize,s,o);return[r.version===0?h.createV0(i):h.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[l,p]=pe(e.subarray(r));return r+=p,l},o=n(),s=he;if(o===18?(o=0,r=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=r,d=n(),w=n(),F=r+w,c=F-i;return{version:o,codec:s,multihashCode:d,digestSize:w,multihashSize:c,size:F}}static parse(e,r){let[n,o]=ao(e,r),s=h.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return pt(s).set(n,e),s}},ao=(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 O.prefix:{let r=e||O;return[O.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)]}}},co=(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},uo=(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},he=112,lo=18,sr=(t,e,r)=>{let n=re(t),o=n+re(e),s=new Uint8Array(o+r.byteLength);return te(t,s,0),te(e,s,n),s.set(r,o),s},fo=Symbol.for("@ipld/js-cid/CID");var G={...Ke,...Ye,...Ze,...et,...tt,...rt,...nt,...ot,...it,...at},ai={...dt,...ft};function oe(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Oe(t=0){return globalThis.Buffer?.allocUnsafe!=null?oe(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))),ht=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=Oe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),po={utf8:ir,"utf-8":ir,hex:G.base16,latin1:ht,ascii:ht,binary:ht,...G},ze=po;function T(t,e="utf8"){let r=ze[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)}var cr=$t,ho=Vt,mt=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(ho(t)){let r=t.split(":",8),n;for(n=0;n<r.length;n++){let s=cr(r[n]),i;s&&(i=mt(r[n]),r[n]=T(i.slice(0,2),"base16")),i!=null&&++n<8&&r.splice(n,0,T(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")},ur=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 me={},bt={},bo=[[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"],[281,0,"webrtc-w3c"],[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"]];bo.forEach(t=>{let e=go(...t);bt[e.code]=e,me[e.name]=e});function go(t,e,r,n,o){return{code:t,size:e,name:r,resolvable:!!n,path:!!o}}function b(t){if(typeof t=="number"){if(bt[t]!=null)return bt[t];throw new Error(`no protocol with code: ${t}`)}else if(typeof t=="string"){if(me[t]!=null)return me[t];throw new Error(`no protocol with name: ${t}`)}throw new Error(`invalid protocol id type: ${typeof t}`)}var z=de(Le(),1);function yt(t,e="utf8"){let r=ze[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?oe(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function R(t,e){e==null&&(e=t.reduce((o,s)=>o+s.length,0));let r=Oe(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return oe(r)}function Er(t,e){switch(b(t).code){case 4:case 41:return Mo(e);case 42:return vr(e);case 6:case 273:case 33:case 132:return Ar(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return vr(e);case 421:return zo(e);case 444:return Cr(e);case 445:return Cr(e);case 466:return Oo(e);default:return T(e,"base16")}}function Sr(t,e){switch(b(t).code){case 4:return yr(e);case 41:return yr(e);case 42:return xr(e);case 6:case 273:case 33:case 132:return vt(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return xr(e);case 421:return Do(e);case 444:return Lo(e);case 445:return _o(e);case 466:return No(e);default:return yt(e,"base16")}}var xt=Object.values(G).map(t=>t.decoder),Bo=function(){let t=xt[0].or(xt[1]);return xt.slice(2).forEach(e=>t=t.or(e)),t}();function yr(t){if(!Be(t))throw new Error("invalid ip address");return mt(t)}function Mo(t){let e=ur(t,0,t.length);if(e==null)throw new Error("ipBuff is required");if(!Be(e))throw new Error("invalid ip address");return e}function vt(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function Ar(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function xr(t){let e=yt(t),r=Uint8Array.from(z.default.encode(e.length));return R([r,e],r.length+e.length)}function vr(t){let e=z.default.decode(t);if(t=t.slice(z.default.decode.bytes),t.length!==e)throw new Error("inconsistent lengths");return T(t)}function Do(t){let e;t[0]==="Q"||t[0]==="1"?e=J(v.decode(`z${t}`)).bytes:e=h.parse(t).multihash.bytes;let r=Uint8Array.from(z.default.encode(e.length));return R([r,e],r.length+e.length)}function No(t){let e=Bo.decode(t),r=Uint8Array.from(z.default.encode(e.length));return R([r,e],r.length+e.length)}function Oo(t){let e=z.default.decode(t),r=t.slice(z.default.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return"u"+T(r,"base64url")}function zo(t){let e=z.default.decode(t),r=t.slice(z.default.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return T(r,"base58btc")}function Lo(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=O.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=vt(n);return R([r,o],r.length+o.length)}function _o(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=O.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=vt(n);return R([r,o],r.length+o.length)}function Cr(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=T(e,"base32"),o=Ar(r);return`${n}:${o}`}var se=de(Le(),1);function Ro(t){let e=[],r=t.split("/").slice(1);if(r.length===1&&r[0]==="")return[];for(let n=0;n<r.length;n++){let o=r[n],s=b(o);if(s.size===0){e.push([o]);continue}if(n++,n>=r.length)throw Fr("invalid address: "+t);if(s.path===!0){e.push([o,Tt(r.slice(n).join("/"))]);break}e.push([o,r[n]])}return e}function $o(t){let e=[];return t.map(r=>{let n=$e(r);return e.push(n.name),r.length>1&&r[1]!=null&&e.push(r[1]),null}),Tt(e.join("/"))}function Vo(t){return t.map(e=>{Array.isArray(e)||(e=[e]);let r=$e(e);return e.length>1?[r.code,Sr(r.code,e[1])]:[r.code]})}function Ct(t){return t.map(e=>{let r=$e(e);return e[1]!=null?[r.code,Er(r.code,e[1])]:[r.code]})}function Et(t){return Re(R(t.map(e=>{let r=$e(e),n=Uint8Array.from(se.default.encode(r.code));return e.length>1&&e[1]!=null&&(n=R([n,e[1]])),n})))}function St(t,e){return t.size>0?t.size/8:t.size===0?0:se.default.decode(e)+(se.default.decode.bytes??0)}function _e(t){let e=[],r=0;for(;r<t.length;){let n=se.default.decode(t,r),o=se.default.decode.bytes??0,s=b(n),i=St(s,t.slice(r+o));if(i===0){e.push([n]),r+=o;continue}let d=t.slice(r+o,r+o+i);if(r+=i+o,r>t.length)throw Fr("Invalid address Uint8Array: "+T(t,"base16"));e.push([n,d])}return e}function At(t){let e=_e(t),r=Ct(e);return $o(r)}function ko(t){t=Tt(t);let e=Ro(t),r=Vo(e);return Et(r)}function Tr(t){return ko(t)}function Re(t){let e=jo(t);if(e!=null)throw e;return Uint8Array.from(t)}function jo(t){try{_e(t)}catch(e){return e}}function Tt(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function Fr(t){return new Error("Error parsing address: "+t)}function $e(t){return b(t[0])}var Pt=de(Le(),1);var Mr=de(Ur(),1);function be(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 ie=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ft=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},ge,we,ye,Br,Wo=Symbol.for("nodejs.util.inspect.custom"),Jo=[b("dns").code,b("dns4").code,b("dns6").code,b("dnsaddr").code],Ho=new Map,Dr=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Xo(t){return!!t?.[Dr]}var $=class{constructor(e){if(ge.set(this,void 0),we.set(this,void 0),ye.set(this,void 0),this[Br]=!0,e==null&&(e=""),e instanceof Uint8Array)this.bytes=Re(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=Tr(e)}else if(Xo(e))this.bytes=Re(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return ie(this,ge,"f")==null&&Ft(this,ge,At(this.bytes),"f"),ie(this,ge,"f")}toJSON(){return this.toString()}toOptions(){let e,r,n,o,s="",i=b("tcp"),d=b("udp"),w=b("ip4"),F=b("ip6"),c=b("dns6"),l=b("ip6zone");for(let[C,f]of this.stringTuples())C===l.code&&(s=`%${f??""}`),Jo.includes(C)&&(r=i.name,o=443,n=`${f??""}${s}`,e=C===c.code?6:4),(C===i.code||C===d.code)&&(r=b(C).name,o=parseInt(f??"")),(C===w.code||C===F.code)&&(r=b(C).name,n=`${f??""}${s}`,e=C===F.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.protoCodes().map(e=>Object.assign({},b(e)))}protoCodes(){let e=[],r=this.bytes,n=0;for(;n<r.length;){let o=Pt.default.decode(r,n),s=Pt.default.decode.bytes??0,i=b(o),d=St(i,r.slice(n+s));n+=d+s,e.push(o)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return ie(this,we,"f")==null&&Ft(this,we,_e(this.bytes),"f"),ie(this,we,"f")}stringTuples(){return ie(this,ye,"f")==null&&Ft(this,ye,Ct(this.tuples()),"f"),ie(this,ye,"f")}encapsulate(e){return e=new $(e),new $(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 $(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 $(Et(r.slice(0,n)));return this}getPeerId(){try{let r=this.stringTuples().filter(n=>n[0]===me.ipfs.code).pop();if(r?.[1]!=null){let n=r[1];return n[0]==="Q"||n[0]==="1"?T(v.decode(`z${n}`),"base58btc"):T(h.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let e=null;try{e=this.stringTuples().filter(r=>b(r[0]).path===!0)[0][1],e==null&&(e=null)}catch{e=null}return e}equals(e){return be(this.bytes,e.bytes)}async resolve(e){let r=this.protos().find(s=>s.resolvable);if(r==null)return[this];let n=Ho.get(r.name);if(n==null)throw(0,Mr.default)(new Error(`no available resolver for ${r.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(s=>new $(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)}[(ge=new WeakMap,we=new WeakMap,ye=new WeakMap,Br=Dr,Wo)](){return`Multiaddr(${At(this.bytes)})`}};function xe(t){return new $(t)}var Qo=a("dns4"),Ko=a("dns6"),Yo=a("dnsaddr"),X=S(a("dns"),Yo,Qo,Ko),Ve=S(a("ip4"),a("ip6")),ae=S(u(Ve,a("tcp")),u(X,a("tcp"))),Bt=u(Ve,a("udp")),Zo=u(Bt,a("utp")),es=u(Bt,a("quic")),Ce=S(u(ae,a("ws")),u(X,a("ws"))),Ee=S(u(ae,a("wss")),u(X,a("wss")),u(ae,a("tls"),a("ws")),u(X,a("tls"),a("ws"))),It=S(u(ae,a("http")),u(Ve,a("http")),u(X,a("http"))),Ut=S(u(ae,a("https")),u(Ve,a("https")),u(X,a("https"))),Nr=u(Bt,a("webrtc"),a("certhash")),zr=S(u(Nr,a("p2p")),Nr),Lr=S(u(Ce,a("p2p-webrtc-star"),a("p2p")),u(Ee,a("p2p-webrtc-star"),a("p2p")),u(Ce,a("p2p-webrtc-star")),u(Ee,a("p2p-webrtc-star"))),Zi=S(u(Ce,a("p2p-websocket-star"),a("p2p")),u(Ee,a("p2p-websocket-star"),a("p2p")),u(Ce,a("p2p-websocket-star")),u(Ee,a("p2p-websocket-star"))),_r=S(u(It,a("p2p-webrtc-direct"),a("p2p")),u(Ut,a("p2p-webrtc-direct"),a("p2p")),u(It,a("p2p-webrtc-direct")),u(Ut,a("p2p-webrtc-direct"))),Se=S(Ce,Ee,It,Ut,Lr,_r,ae,Zo,es,X,zr),ea=S(u(Se,a("p2p-stardust"),a("p2p")),u(Se,a("p2p-stardust"))),W=S(u(Se,a("p2p")),Lr,_r,zr,a("p2p")),Or=S(u(W,a("p2p-circuit"),W),u(W,a("p2p-circuit")),u(a("p2p-circuit"),W),u(Se,a("p2p-circuit")),u(a("p2p-circuit"),Se),a("p2p-circuit")),Rr=()=>S(u(Or,Rr),Or),ve=Rr(),$r=S(u(ve,W,ve),u(W,ve),u(ve,W),ve,W);function Vr(t){function e(r){let n;try{n=xe(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:Vr(e),partialMatch:e}}function S(...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:Vr(e),partialMatch:e}}function a(t){let e=t;function r(o){let s;try{s=xe(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 Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},V,ke=class extends EventTarget{constructor(){super(...arguments),V.set(this,new Map)}listenerCount(e){let r=Q(this,V,"f").get(e);return r==null?0:r.length}addEventListener(e,r,n){super.addEventListener(e,r,n);let o=Q(this,V,"f").get(e);o==null&&(o=[],Q(this,V,"f").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=Q(this,V,"f").get(e);o!=null&&(o=o.filter(({callback:s})=>s!==r),Q(this,V,"f").set(e,o))}dispatchEvent(e){let r=super.dispatchEvent(e),n=Q(this,V,"f").get(e.type);return n==null||(n=n.filter(({once:o})=>!o),Q(this,V,"f").set(e.type,n)),r}safeDispatchEvent(e,r){return this.dispatchEvent(new Dt(e,r))}};V=new WeakMap;var Mt=class extends Event{constructor(e,r){super(e,r),this.detail=r?.detail}},Dt=globalThis.CustomEvent??Mt;var L=de(Wr(),1);L.default.formatters.b=t=>t==null?"undefined":v.baseEncode(t);L.default.formatters.t=t=>t==null?"undefined":O.baseEncode(t);L.default.formatters.m=t=>t==null?"undefined":st.baseEncode(t);L.default.formatters.p=t=>t==null?"undefined":t.toString();L.default.formatters.c=t=>t==null?"undefined":t.toString();L.default.formatters.k=t=>t==null?"undefined":t.toString();function Jr(t){return Object.assign((0,L.default)(t),{error:(0,L.default)(`${t}:error`),trace:(0,L.default)(`${t}:trace`)})}var Hr=Symbol.for("@libp2p/peer-id");var ps=Symbol.for("nodejs.util.inspect.custom"),Xr=Object.values(G).map(t=>t.decoder).reduce((t,e)=>t.or(e),G.identity.decoder),Qr=114,Kr=36,Yr=37,Ae=class{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()})`}get[Hr](){return!0}toString(){return this.string==null&&(this.string=v.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return h.createV1(Qr,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return be(this.multihash.bytes,e);if(typeof e=="string")return Nt(e).equals(this);if(e?.multihash?.bytes!=null)return be(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[ps](){return`PeerId(${this.toString()})`}},Te=class extends Ae{constructor(e){super({...e,type:"RSA"}),this.type="RSA",this.publicKey=e.publicKey}},Fe=class extends Ae{constructor(e){super({...e,type:"Ed25519"}),this.type="Ed25519",this.publicKey=e.multihash.digest}},Pe=class extends Ae{constructor(e){super({...e,type:"secp256k1"}),this.type="secp256k1",this.publicKey=e.multihash.digest}};function Nt(t,e){if(e=e??Xr,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=J(v.decode(`z${t}`));return t.startsWith("12D")?new Fe({multihash:r}):t.startsWith("16U")?new Pe({multihash:r}):new Te({multihash:r})}return hs(Xr.decode(t))}function hs(t){try{let e=J(t);if(e.code===Ne.code){if(e.digest.length===Kr)return new Fe({multihash:e});if(e.digest.length===Yr)return new Pe({multihash:e})}if(e.code===De.code)return new Te({multihash:e})}catch{return ms(h.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function ms(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Qr)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===De.code)return new Te({multihash:t.multihash});if(e.code===Ne.code){if(e.digest.length===Kr)return new Fe({multihash:t.multihash});if(e.digest.length===Yr)return new Pe({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}var Zr=Symbol.for("@libp2p/peer-discovery");var Ge=Jr("libp2p:bootstrap"),bs="bootstrap",gs=50,ws=12e4,ys=1e3,We=class extends ke{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??ys,this.list=[];for(let n of r.list){if(!$r.matches(n)){Ge.error("Invalid multiaddr");continue}let o=xe(n),s=o.getPeerId();if(s==null){Ge.error("Invalid bootstrap multiaddr without peer id");continue}let i={id:Nt(s),multiaddrs:[o],protocols:[]};this.list.push(i)}this._init=r}get[Zr](){return!0}get[Symbol.toStringTag](){return"@libp2p/bootstrap"}isStarted(){return!!this.timer}start(){this.isStarted()||(Ge("Starting bootstrap node discovery, discovering peers after %s ms",this.timeout),this.timer=setTimeout(()=>{this._discoverBootstrapPeers().catch(e=>{Ge.error(e)})},this.timeout))}async _discoverBootstrapPeers(){if(this.timer!=null)for(let e of this.list){if(await this.components.peerStore.tagPeer(e.id,this._init.tagName??bs,{value:this._init.tagValue??gs,ttl:this._init.tagTTL??ws}),this.timer==null)return;this.dispatchEvent(new Dt("peer",{detail:e}))}}stop(){this.timer!=null&&clearTimeout(this.timer),this.timer=void 0}};We.tag="bootstrap";function xs(t){return e=>new We(e,t)}return sn(vs);})();
2
+ "use strict";var Libp2PBootstrap=(()=>{var en=Object.create;var Ie=Object.defineProperty;var tn=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,on=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),I=(t,e)=>{for(var r in e)Ie(t,r,{get:e[r],enumerable:!0})},Ot=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of rn(e))!on.call(t,o)&&o!==r&&Ie(t,o,{get:()=>e[o],enumerable:!(n=tn(e,o))||n.enumerable});return t};var pe=(t,e,r)=>(r=t!=null?en(nn(t)):{},Ot(e||!t||!t.__esModule?Ie(r,"default",{value:t,enumerable:!0}):r,t)),sn=t=>Ot(Ie({},"__esModule",{value:!0}),t);var fr=k((vi,dr)=>{dr.exports=gt;var lr=128,wo=127,yo=~wo,xo=Math.pow(2,31);function gt(t,e,r){if(Number.MAX_SAFE_INTEGER&&t>Number.MAX_SAFE_INTEGER)throw gt.bytes=0,new RangeError("Could not encode varint");e=e||[],r=r||0;for(var n=r;t>=xo;)e[r++]=t&255|lr,t/=128;for(;t&yo;)e[r++]=t&255|lr,t>>>=7;return e[r]=t|0,gt.bytes=r-n+1,e}});var mr=k((Ci,hr)=>{hr.exports=wt;var vo=128,pr=127;function wt(t,n){var r=0,n=n||0,o=0,s=n,i,d=t.length;do{if(s>=d||o>49)throw wt.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=o<28?(i&pr)<<o:(i&pr)*Math.pow(2,o),o+=7}while(i>=vo);return wt.bytes=s-n,r}});var gr=k((Ei,br)=>{var Co=Math.pow(2,7),Eo=Math.pow(2,14),So=Math.pow(2,21),Ao=Math.pow(2,28),To=Math.pow(2,35),Fo=Math.pow(2,42),Po=Math.pow(2,49),Io=Math.pow(2,56),Uo=Math.pow(2,63);br.exports=function(t){return t<Co?1:t<Eo?2:t<So?3:t<Ao?4:t<To?5:t<Fo?6:t<Po?7:t<Io?8:t<Uo?9:10}});var Le=k((Si,wr)=>{wr.exports={encode:fr(),decode:mr(),encodingLength:gr()}});var Ur=k((qi,Ir)=>{"use strict";function Pr(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function Go(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Pr(t,r)}catch{r.message=t.message,r.stack=t.stack;let o=function(){};return o.prototype=Object.create(Object.getPrototypeOf(t)),Pr(new o,r)}}Ir.exports=Go});var jr=k((oa,kr)=>{var le=1e3,de=le*60,fe=de*60,K=fe*24,ts=K*7,rs=K*365.25;kr.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return ns(t);if(r==="number"&&isFinite(t))return e.long?ss(t):os(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function ns(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*rs;case"weeks":case"week":case"w":return r*ts;case"days":case"day":case"d":return r*K;case"hours":case"hour":case"hrs":case"hr":case"h":return r*fe;case"minutes":case"minute":case"mins":case"min":case"m":return r*de;case"seconds":case"second":case"secs":case"sec":case"s":return r*le;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function os(t){var e=Math.abs(t);return e>=K?Math.round(t/K)+"d":e>=fe?Math.round(t/fe)+"h":e>=de?Math.round(t/de)+"m":e>=le?Math.round(t/le)+"s":t+"ms"}function ss(t){var e=Math.abs(t);return e>=K?je(t,e,K,"day"):e>=fe?je(t,e,fe,"hour"):e>=de?je(t,e,de,"minute"):e>=le?je(t,e,le,"second"):t+" ms"}function je(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Gr=k((sa,qr)=>{function is(t){r.debug=r,r.default=r,r.coerce=w,r.disable=s,r.enable=o,r.enabled=i,r.humanize=jr(),r.destroy=F,Object.keys(t).forEach(c=>{r[c]=t[c]}),r.names=[],r.skips=[],r.formatters={};function e(c){let l=0;for(let p=0;p<c.length;p++)l=(l<<5)-l+c.charCodeAt(p),l|=0;return r.colors[Math.abs(l)%r.colors.length]}r.selectColor=e;function r(c){let l,p=null,E,f;function m(...y){if(!m.enabled)return;let x=m,A=Number(new Date),B=A-(l||A);x.diff=B,x.prev=l,x.curr=A,l=A,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let S=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(D,P)=>{if(D==="%%")return"%";S++;let M=r.formatters[P];if(typeof M=="function"){let Y=y[S];D=M.call(x,Y),y.splice(S,1),S--}return D}),r.formatArgs.call(x,y),(x.log||r.log).apply(x,y)}return m.namespace=c,m.useColors=r.useColors(),m.color=r.selectColor(c),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(E!==r.namespaces&&(E=r.namespaces,f=r.enabled(c)),f),set:y=>{p=y}}),typeof r.init=="function"&&r.init(m),m}function n(c,l){let p=r(this.namespace+(typeof l>"u"?":":l)+c);return p.log=this.log,p}function o(c){r.save(c),r.namespaces=c,r.names=[],r.skips=[];let l,p=(typeof c=="string"?c:"").split(/[\s,]+/),E=p.length;for(l=0;l<E;l++)p[l]&&(c=p[l].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(d),...r.skips.map(d).map(l=>"-"+l)].join(",");return r.enable(""),c}function i(c){if(c[c.length-1]==="*")return!0;let l,p;for(l=0,p=r.skips.length;l<p;l++)if(r.skips[l].test(c))return!1;for(l=0,p=r.names.length;l<p;l++)if(r.names[l].test(c))return!0;return!1}function d(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function w(c){return c instanceof Error?c.stack||c.message:c}function F(){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}qr.exports=is});var Wr=k((U,qe)=>{U.formatArgs=cs;U.save=us;U.load=ls;U.useColors=as;U.storage=ds();U.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`."))}})();U.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 as(){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 cs(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+qe.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)}U.log=console.debug||console.log||(()=>{});function us(t){try{t?U.storage.setItem("debug",t):U.storage.removeItem("debug")}catch{}}function ls(){let t;try{t=U.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function ds(){try{return localStorage}catch{}}qe.exports=Gr()(U);var{formatters:fs}=qe.exports;fs.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var vs={};I(vs,{bootstrap:()=>xs});var Ue=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,d=this.peekChar();if(d===void 0)return;let w=d==="0",F=2**(8*o)-1;for(;;){let c=this.readAtomically(()=>{let l=this.readChar();if(l===void 0)return;let p=Number.parseInt(l,e);if(!Number.isNaN(p))return p});if(c===void 0)break;if(s*=e,s+=c,s>F||(i+=1,r!==void 0&&i>r))return}if(i!==0)return!n&&w&&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),[d]=e(s.subarray(0,i));return r.set(s.subarray(0,d),16-d),r})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var zt=45,an=15,Z=new Ue;function Lt(t){if(!(t.length>an))return Z.new(t).parseWith(()=>Z.readIPv4Addr())}function _t(t){if(!(t.length>zt))return Z.new(t).parseWith(()=>Z.readIPv6Addr())}function Rt(t){if(!(t.length>zt))return Z.new(t).parseWith(()=>Z.readIPAddr())}function $t(t){return!!Lt(t)}function Vt(t){return!!_t(t)}function Be(t){return!!Rt(t)}var Ke={};I(Ke,{identity:()=>pn});function cn(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 d=t.length,w=t.charAt(0),F=Math.log(d)/Math.log(256),c=Math.log(256)/Math.log(d);function l(f){if(f instanceof Uint8Array||(ArrayBuffer.isView(f)?f=new Uint8Array(f.buffer,f.byteOffset,f.byteLength):Array.isArray(f)&&(f=Uint8Array.from(f))),!(f instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(f.length===0)return"";for(var m=0,y=0,x=0,A=f.length;x!==A&&f[x]===0;)x++,m++;for(var B=(A-x)*c+1>>>0,S=new Uint8Array(B);x!==A;){for(var N=f[x],D=0,P=B-1;(N!==0||D<y)&&P!==-1;P--,D++)N+=256*S[P]>>>0,S[P]=N%d>>>0,N=N/d>>>0;if(N!==0)throw new Error("Non-zero carry");y=D,x++}for(var M=B-y;M!==B&&S[M]===0;)M++;for(var Y=w.repeat(m);M<B;++M)Y+=t.charAt(S[M]);return Y}function p(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return new Uint8Array;var m=0;if(f[m]!==" "){for(var y=0,x=0;f[m]===w;)y++,m++;for(var A=(f.length-m)*F+1>>>0,B=new Uint8Array(A);f[m];){var S=r[f.charCodeAt(m)];if(S===255)return;for(var N=0,D=A-1;(S!==0||N<x)&&D!==-1;D--,N++)S+=d*B[D]>>>0,B[D]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");x=N,m++}if(f[m]!==" "){for(var P=A-x;P!==A&&B[P]===0;)P++;for(var M=new Uint8Array(y+(A-P)),Y=y;P!==A;)M[Y++]=B[P++];return M}}}function E(f){var m=p(f);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:l,decodeUnsafe:p,decode:E}}var un=cn,ln=un,kt=ln;var Is=new Uint8Array(0);var jt=(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},_=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 qt=t=>new TextEncoder().encode(t),Gt=t=>new TextDecoder().decode(t);var Je=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")}},He=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 Jt(this,e)}},Xe=class{constructor(e){this.decoders=e}or(e){return Jt(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`)}},Jt=(t,e)=>new Xe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),Qe=class{constructor(e,r,n,o){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new Je(e,r,n),this.decoder=new He(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},ee=({name:t,prefix:e,encode:r,decode:n})=>new Qe(t,e,r,n),j=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:o}=kt(r,e);return ee({prefix:t,name:e,encode:n,decode:s=>_(o(s))})},dn=(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),d=0,w=0,F=0;for(let c=0;c<s;++c){let l=o[t[c]];if(l===void 0)throw new SyntaxError(`Non-${n} character`);w=w<<r|l,d+=r,d>=8&&(d-=8,i[F++]=255&w>>d)}if(d>=r||255&w<<8-d)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,d=0;for(let w=0;w<t.length;++w)for(d=d<<8|t[w],i+=8;i>r;)i-=r,s+=e[o&d>>i];if(i&&(s+=e[o&d<<r-i]),n)for(;s.length*r&7;)s+="=";return s},g=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>ee({prefix:e,name:t,encode(o){return fn(o,n,r)},decode(o){return dn(o,n,r,t)}});var pn=ee({prefix:"\0",name:"identity",encode:t=>Gt(t),decode:t=>qt(t)});var Ye={};I(Ye,{base2:()=>hn});var hn=g({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Ze={};I(Ze,{base8:()=>mn});var mn=g({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var et={};I(et,{base10:()=>bn});var bn=j({prefix:"9",name:"base10",alphabet:"0123456789"});var tt={};I(tt,{base16:()=>gn,base16upper:()=>wn});var gn=g({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),wn=g({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var rt={};I(rt,{base32:()=>O,base32hex:()=>Cn,base32hexpad:()=>Sn,base32hexpadupper:()=>An,base32hexupper:()=>En,base32pad:()=>xn,base32padupper:()=>vn,base32upper:()=>yn,base32z:()=>Tn});var O=g({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),yn=g({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),xn=g({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),vn=g({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Cn=g({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),En=g({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Sn=g({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),An=g({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Tn=g({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var nt={};I(nt,{base36:()=>Fn,base36upper:()=>Pn});var Fn=j({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Pn=j({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var ot={};I(ot,{base58btc:()=>v,base58flickr:()=>In});var v=j({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),In=j({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var it={};I(it,{base64:()=>st,base64pad:()=>Un,base64url:()=>Bn,base64urlpad:()=>Dn});var st=g({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Un=g({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Bn=g({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Dn=g({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var at={};I(at,{base256emoji:()=>Ln});var Ht=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}"),Mn=Ht.reduce((t,e,r)=>(t[r]=e,t),[]),Nn=Ht.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function On(t){return t.reduce((e,r)=>(e+=Mn[r],e),"")}function zn(t){let e=[];for(let r of t){let n=Nn[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var Ln=ee({prefix:"\u{1F680}",name:"base256emoji",encode:On,decode:zn});var dt={};I(dt,{sha256:()=>Me,sha512:()=>ro});var _n=Kt,Xt=128,Rn=127,$n=~Rn,Vn=Math.pow(2,31);function Kt(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Vn;)e[r++]=t&255|Xt,t/=128;for(;t&$n;)e[r++]=t&255|Xt,t>>>=7;return e[r]=t|0,Kt.bytes=r-n+1,e}var kn=ct,jn=128,Qt=127;function ct(t,n){var r=0,n=n||0,o=0,s=n,i,d=t.length;do{if(s>=d)throw ct.bytes=0,new RangeError("Could not decode varint");i=t[s++],r+=o<28?(i&Qt)<<o:(i&Qt)*Math.pow(2,o),o+=7}while(i>=jn);return ct.bytes=s-n,r}var qn=Math.pow(2,7),Gn=Math.pow(2,14),Wn=Math.pow(2,21),Jn=Math.pow(2,28),Hn=Math.pow(2,35),Xn=Math.pow(2,42),Qn=Math.pow(2,49),Kn=Math.pow(2,56),Yn=Math.pow(2,63),Zn=function(t){return t<qn?1:t<Gn?2:t<Wn?3:t<Jn?4:t<Hn?5:t<Xn?6:t<Qn?7:t<Kn?8:t<Yn?9:10},eo={encode:_n,decode:kn,encodingLength:Zn},to=eo,he=to;var me=(t,e=0)=>[he.decode(t,e),he.decode.bytes],te=(t,e,r=0)=>(he.encode(t,e,r),e),re=t=>he.encodingLength(t);var q=(t,e)=>{let r=e.byteLength,n=re(t),o=n+re(r),s=new Uint8Array(o+r);return te(t,s,0),te(r,s,n),s.set(e,o),new ne(t,r,e,s)},J=t=>{let e=_(t),[r,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 ne(r,o,i,e)},Yt=(t,e)=>{if(t===e)return!0;{let r=e;return t.code===r.code&&t.size===r.size&&r.bytes instanceof Uint8Array&&jt(t.bytes,r.bytes)}},ne=class{constructor(e,r,n,o){this.code=e,this.size=r,this.digest=n,this.bytes=o}};var lt=({name:t,code:e,encode:r})=>new ut(t,e,r),ut=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?q(this.code,r):r.then(n=>q(this.code,n))}else throw Error("Unknown type, must be binary type")}};var er=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Me=lt({name:"sha2-256",code:18,encode:er("SHA-256")}),ro=lt({name:"sha2-512",code:19,encode:er("SHA-512")});var ft={};I(ft,{identity:()=>Ne});var tr=0,no="identity",rr=_,oo=t=>q(tr,rr(t)),Ne={code:tr,name:no,encode:rr,digest:oo};var Qs=new TextEncoder,Ks=new TextDecoder;var nr=(t,e)=>{let{bytes:r,version:n}=t;switch(n){case 0:return co(r,pt(t),e||v.encoder);default:return uo(r,pt(t),e||O.encoder)}};var or=new WeakMap,pt=t=>{let e=or.get(t);if(e==null){let r=new Map;return or.set(t,r),r}return e},h=class{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!==be)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==lo)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return h.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=q(e,r);return h.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 h.equals(this,e)}static equals(e,r){let n=r;return n&&e.code===n.code&&e.version===n.version&&Yt(e.multihash,n.multihash)}toString(e){return nr(this,e)}toJSON(){return{"/":nr(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 h)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:o,multihash:s,bytes:i}=r;return new h(n,o,s,i||sr(n,o,s.bytes))}else if(r[fo]===!0){let{version:n,multihash:o,code:s}=r,i=J(o);return h.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!==be)throw new Error(`Version 0 CID must use dag-pb (code: ${be}) block encoding`);return new h(e,r,n,n.bytes)}case 1:{let o=sr(e,r,n.bytes);return new h(e,r,n,o)}default:throw new Error("Invalid version")}}static createV0(e){return h.create(0,be,e)}static createV1(e,r){return h.create(1,e,r)}static decode(e){let[r,n]=h.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=h.inspectBytes(e),n=r.size-r.multihashSize,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 ne(r.multihashCode,r.digestSize,s,o);return[r.version===0?h.createV0(i):h.createV1(r.codec,i),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[l,p]=me(e.subarray(r));return r+=p,l},o=n(),s=be;if(o===18?(o=0,r=0):s=n(),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=r,d=n(),w=n(),F=r+w,c=F-i;return{version:o,codec:s,multihashCode:d,digestSize:w,multihashSize:c,size:F}}static parse(e,r){let[n,o]=ao(e,r),s=h.decode(o);if(s.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return pt(s).set(n,e),s}},ao=(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 O.prefix:{let r=e||O;return[O.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)]}}},co=(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},uo=(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},be=112,lo=18,sr=(t,e,r)=>{let n=re(t),o=n+re(e),s=new Uint8Array(o+r.byteLength);return te(t,s,0),te(e,s,n),s.set(r,o),s},fo=Symbol.for("@ipld/js-cid/CID");var G={...Ke,...Ye,...Ze,...et,...tt,...rt,...nt,...ot,...it,...at},ai={...dt,...ft};function oe(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Oe(t=0){return globalThis.Buffer?.allocUnsafe!=null?oe(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))),ht=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=Oe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),po={utf8:ir,"utf-8":ir,hex:G.base16,latin1:ht,ascii:ht,binary:ht,...G},ze=po;function T(t,e="utf8"){let r=ze[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)}var cr=$t,ho=Vt,mt=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(ho(t)){let r=t.split(":",8),n;for(n=0;n<r.length;n++){let s=cr(r[n]),i;s&&(i=mt(r[n]),r[n]=T(i.slice(0,2),"base16")),i!=null&&++n<8&&r.splice(n,0,T(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")},ur=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 ge={},bt={},bo=[[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"]];bo.forEach(t=>{let e=go(...t);bt[e.code]=e,ge[e.name]=e});function go(t,e,r,n,o){return{code:t,size:e,name:r,resolvable:!!n,path:!!o}}function b(t){if(typeof t=="number"){if(bt[t]!=null)return bt[t];throw new Error(`no protocol with code: ${t}`)}else if(typeof t=="string"){if(ge[t]!=null)return ge[t];throw new Error(`no protocol with name: ${t}`)}throw new Error(`invalid protocol id type: ${typeof t}`)}var z=pe(Le(),1);function yt(t,e="utf8"){let r=ze[e];if(r==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?oe(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function R(t,e){e==null&&(e=t.reduce((o,s)=>o+s.length,0));let r=Oe(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return oe(r)}function Er(t,e){switch(b(t).code){case 4:case 41:return Do(e);case 42:return vr(e);case 6:case 273:case 33:case 132:return Ar(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return vr(e);case 421:return zo(e);case 444:return Cr(e);case 445:return Cr(e);case 466:return Oo(e);default:return T(e,"base16")}}function Sr(t,e){switch(b(t).code){case 4:return yr(e);case 41:return yr(e);case 42:return xr(e);case 6:case 273:case 33:case 132:return vt(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return xr(e);case 421:return Mo(e);case 444:return Lo(e);case 445:return _o(e);case 466:return No(e);default:return yt(e,"base16")}}var xt=Object.values(G).map(t=>t.decoder),Bo=function(){let t=xt[0].or(xt[1]);return xt.slice(2).forEach(e=>t=t.or(e)),t}();function yr(t){if(!Be(t))throw new Error("invalid ip address");return mt(t)}function Do(t){let e=ur(t,0,t.length);if(e==null)throw new Error("ipBuff is required");if(!Be(e))throw new Error("invalid ip address");return e}function vt(t){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,t),new Uint8Array(e)}function Ar(t){return new DataView(t.buffer).getUint16(t.byteOffset)}function xr(t){let e=yt(t),r=Uint8Array.from(z.default.encode(e.length));return R([r,e],r.length+e.length)}function vr(t){let e=z.default.decode(t);if(t=t.slice(z.default.decode.bytes),t.length!==e)throw new Error("inconsistent lengths");return T(t)}function Mo(t){let e;t[0]==="Q"||t[0]==="1"?e=J(v.decode(`z${t}`)).bytes:e=h.parse(t).multihash.bytes;let r=Uint8Array.from(z.default.encode(e.length));return R([r,e],r.length+e.length)}function No(t){let e=Bo.decode(t),r=Uint8Array.from(z.default.encode(e.length));return R([r,e],r.length+e.length)}function Oo(t){let e=z.default.decode(t),r=t.slice(z.default.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return"u"+T(r,"base64url")}function zo(t){let e=z.default.decode(t),r=t.slice(z.default.decode.bytes);if(r.length!==e)throw new Error("inconsistent lengths");return T(r,"base58btc")}function Lo(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=O.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=vt(n);return R([r,o],r.length+o.length)}function _o(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=O.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=vt(n);return R([r,o],r.length+o.length)}function Cr(t){let e=t.slice(0,t.length-2),r=t.slice(t.length-2),n=T(e,"base32"),o=Ar(r);return`${n}:${o}`}var se=pe(Le(),1);function Ro(t){let e=[],r=t.split("/").slice(1);if(r.length===1&&r[0]==="")return[];for(let n=0;n<r.length;n++){let o=r[n],s=b(o);if(s.size===0){e.push([o]);continue}if(n++,n>=r.length)throw Fr("invalid address: "+t);if(s.path===!0){e.push([o,Tt(r.slice(n).join("/"))]);break}e.push([o,r[n]])}return e}function $o(t){let e=[];return t.map(r=>{let n=$e(r);return e.push(n.name),r.length>1&&r[1]!=null&&e.push(r[1]),null}),Tt(e.join("/"))}function Vo(t){return t.map(e=>{Array.isArray(e)||(e=[e]);let r=$e(e);return e.length>1?[r.code,Sr(r.code,e[1])]:[r.code]})}function Ct(t){return t.map(e=>{let r=$e(e);return e[1]!=null?[r.code,Er(r.code,e[1])]:[r.code]})}function Et(t){return Re(R(t.map(e=>{let r=$e(e),n=Uint8Array.from(se.default.encode(r.code));return e.length>1&&e[1]!=null&&(n=R([n,e[1]])),n})))}function St(t,e){return t.size>0?t.size/8:t.size===0?0:se.default.decode(e)+(se.default.decode.bytes??0)}function _e(t){let e=[],r=0;for(;r<t.length;){let n=se.default.decode(t,r),o=se.default.decode.bytes??0,s=b(n),i=St(s,t.slice(r+o));if(i===0){e.push([n]),r+=o;continue}let d=t.slice(r+o,r+o+i);if(r+=i+o,r>t.length)throw Fr("Invalid address Uint8Array: "+T(t,"base16"));e.push([n,d])}return e}function At(t){let e=_e(t),r=Ct(e);return $o(r)}function ko(t){t=Tt(t);let e=Ro(t),r=Vo(e);return Et(r)}function Tr(t){return ko(t)}function Re(t){let e=jo(t);if(e!=null)throw e;return Uint8Array.from(t)}function jo(t){try{_e(t)}catch(e){return e}}function Tt(t){return"/"+t.trim().split("/").filter(e=>e).join("/")}function Fr(t){return new Error("Error parsing address: "+t)}function $e(t){return b(t[0])}var Pt=pe(Le(),1);var Dr=pe(Ur(),1);function we(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 ie=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ft=function(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r},ye,xe,ve,Br,Wo=Symbol.for("nodejs.util.inspect.custom"),Jo=[b("dns").code,b("dns4").code,b("dns6").code,b("dnsaddr").code],Ho=new Map,Mr=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Xo(t){return!!t?.[Mr]}var $=class{constructor(e){if(ye.set(this,void 0),xe.set(this,void 0),ve.set(this,void 0),this[Br]=!0,e==null&&(e=""),e instanceof Uint8Array)this.bytes=Re(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=Tr(e)}else if(Xo(e))this.bytes=Re(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return ie(this,ye,"f")==null&&Ft(this,ye,At(this.bytes),"f"),ie(this,ye,"f")}toJSON(){return this.toString()}toOptions(){let e,r,n,o,s="",i=b("tcp"),d=b("udp"),w=b("ip4"),F=b("ip6"),c=b("dns6"),l=b("ip6zone");for(let[E,f]of this.stringTuples())E===l.code&&(s=`%${f??""}`),Jo.includes(E)&&(r=i.name,o=443,n=`${f??""}${s}`,e=E===c.code?6:4),(E===i.code||E===d.code)&&(r=b(E).name,o=parseInt(f??"")),(E===w.code||E===F.code)&&(r=b(E).name,n=`${f??""}${s}`,e=E===F.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.protoCodes().map(e=>Object.assign({},b(e)))}protoCodes(){let e=[],r=this.bytes,n=0;for(;n<r.length;){let o=Pt.default.decode(r,n),s=Pt.default.decode.bytes??0,i=b(o),d=St(i,r.slice(n+s));n+=d+s,e.push(o)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return ie(this,xe,"f")==null&&Ft(this,xe,_e(this.bytes),"f"),ie(this,xe,"f")}stringTuples(){return ie(this,ve,"f")==null&&Ft(this,ve,Ct(this.tuples()),"f"),ie(this,ve,"f")}encapsulate(e){return e=new $(e),new $(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 $(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 $(Et(r.slice(0,n)));return this}getPeerId(){try{let r=this.stringTuples().filter(n=>n[0]===ge.ipfs.code).pop();if(r?.[1]!=null){let n=r[1];return n[0]==="Q"||n[0]==="1"?T(v.decode(`z${n}`),"base58btc"):T(h.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let e=null;try{e=this.stringTuples().filter(r=>b(r[0]).path===!0)[0][1],e==null&&(e=null)}catch{e=null}return e}equals(e){return we(this.bytes,e.bytes)}async resolve(e){let r=this.protos().find(s=>s.resolvable);if(r==null)return[this];let n=Ho.get(r.name);if(n==null)throw(0,Dr.default)(new Error(`no available resolver for ${r.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(s=>new $(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)}[(ye=new WeakMap,xe=new WeakMap,ve=new WeakMap,Br=Mr,Wo)](){return`Multiaddr(${At(this.bytes)})`}};function Ce(t){return new $(t)}var Qo=a("dns4"),Ko=a("dns6"),Yo=a("dnsaddr"),X=C(a("dns"),Yo,Qo,Ko),Ve=C(a("ip4"),a("ip6")),ce=C(u(Ve,a("tcp")),u(X,a("tcp"))),Bt=u(Ve,a("udp")),Zo=u(Bt,a("utp")),es=u(Bt,a("quic")),Ee=C(u(ce,a("ws")),u(X,a("ws"))),Se=C(u(ce,a("wss")),u(X,a("wss")),u(ce,a("tls"),a("ws")),u(X,a("tls"),a("ws"))),It=C(u(ce,a("http")),u(Ve,a("http")),u(X,a("http"))),Ut=C(u(ce,a("https")),u(Ve,a("https")),u(X,a("https"))),Nr=u(Bt,a("webrtc-direct"),a("certhash")),zr=C(u(Nr,a("p2p")),Nr),Lr=C(u(Ee,a("p2p-webrtc-star"),a("p2p")),u(Se,a("p2p-webrtc-star"),a("p2p")),u(Ee,a("p2p-webrtc-star")),u(Se,a("p2p-webrtc-star"))),Zi=C(u(Ee,a("p2p-websocket-star"),a("p2p")),u(Se,a("p2p-websocket-star"),a("p2p")),u(Ee,a("p2p-websocket-star")),u(Se,a("p2p-websocket-star"))),_r=C(u(It,a("p2p-webrtc-direct"),a("p2p")),u(Ut,a("p2p-webrtc-direct"),a("p2p")),u(It,a("p2p-webrtc-direct")),u(Ut,a("p2p-webrtc-direct"))),ue=C(Ee,Se,It,Ut,Lr,_r,ce,Zo,es,X,zr),ea=C(u(ue,a("p2p-stardust"),a("p2p")),u(ue,a("p2p-stardust"))),W=C(u(ue,a("p2p")),Lr,_r,zr,a("p2p")),Or=C(u(W,a("p2p-circuit"),W),u(W,a("p2p-circuit")),u(a("p2p-circuit"),W),u(ue,a("p2p-circuit")),u(a("p2p-circuit"),ue),a("p2p-circuit")),Rr=()=>C(u(Or,Rr),Or),ae=Rr(),$r=C(u(ae,W,ae),u(W,ae),u(ae,W),ae,W);var ta=C(u(ae,a("webrtc")),u(ue,a("webrtc")),a("webrtc"));function Vr(t){function e(r){let n;try{n=Ce(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:Vr(e),partialMatch:e}}function C(...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:Vr(e),partialMatch:e}}function a(t){let e=t;function r(o){let s;try{s=Ce(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 Q=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},V,ke=class extends EventTarget{constructor(){super(...arguments),V.set(this,new Map)}listenerCount(e){let r=Q(this,V,"f").get(e);return r==null?0:r.length}addEventListener(e,r,n){super.addEventListener(e,r,n);let o=Q(this,V,"f").get(e);o==null&&(o=[],Q(this,V,"f").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=Q(this,V,"f").get(e);o!=null&&(o=o.filter(({callback:s})=>s!==r),Q(this,V,"f").set(e,o))}dispatchEvent(e){let r=super.dispatchEvent(e),n=Q(this,V,"f").get(e.type);return n==null||(n=n.filter(({once:o})=>!o),Q(this,V,"f").set(e.type,n)),r}safeDispatchEvent(e,r){return this.dispatchEvent(new Mt(e,r))}};V=new WeakMap;var Dt=class extends Event{constructor(e,r){super(e,r),this.detail=r?.detail}},Mt=globalThis.CustomEvent??Dt;var L=pe(Wr(),1);L.default.formatters.b=t=>t==null?"undefined":v.baseEncode(t);L.default.formatters.t=t=>t==null?"undefined":O.baseEncode(t);L.default.formatters.m=t=>t==null?"undefined":st.baseEncode(t);L.default.formatters.p=t=>t==null?"undefined":t.toString();L.default.formatters.c=t=>t==null?"undefined":t.toString();L.default.formatters.k=t=>t==null?"undefined":t.toString();function Jr(t){return Object.assign((0,L.default)(t),{error:(0,L.default)(`${t}:error`),trace:(0,L.default)(`${t}:trace`)})}var Hr=Symbol.for("@libp2p/peer-id");var ps=Symbol.for("nodejs.util.inspect.custom"),Xr=Object.values(G).map(t=>t.decoder).reduce((t,e)=>t.or(e),G.identity.decoder),Qr=114,Kr=36,Yr=37,Ae=class{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()})`}get[Hr](){return!0}toString(){return this.string==null&&(this.string=v.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return h.createV1(Qr,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return we(this.multihash.bytes,e);if(typeof e=="string")return Nt(e).equals(this);if(e?.multihash?.bytes!=null)return we(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[ps](){return`PeerId(${this.toString()})`}},Te=class extends Ae{constructor(e){super({...e,type:"RSA"}),this.type="RSA",this.publicKey=e.publicKey}},Fe=class extends Ae{constructor(e){super({...e,type:"Ed25519"}),this.type="Ed25519",this.publicKey=e.multihash.digest}},Pe=class extends Ae{constructor(e){super({...e,type:"secp256k1"}),this.type="secp256k1",this.publicKey=e.multihash.digest}};function Nt(t,e){if(e=e??Xr,t.charAt(0)==="1"||t.charAt(0)==="Q"){let r=J(v.decode(`z${t}`));return t.startsWith("12D")?new Fe({multihash:r}):t.startsWith("16U")?new Pe({multihash:r}):new Te({multihash:r})}return hs(Xr.decode(t))}function hs(t){try{let e=J(t);if(e.code===Ne.code){if(e.digest.length===Kr)return new Fe({multihash:e});if(e.digest.length===Yr)return new Pe({multihash:e})}if(e.code===Me.code)return new Te({multihash:e})}catch{return ms(h.decode(t))}throw new Error("Supplied PeerID CID is invalid")}function ms(t){if(t==null||t.multihash==null||t.version==null||t.version===1&&t.code!==Qr)throw new Error("Supplied PeerID CID is invalid");let e=t.multihash;if(e.code===Me.code)return new Te({multihash:t.multihash});if(e.code===Ne.code){if(e.digest.length===Kr)return new Fe({multihash:t.multihash});if(e.digest.length===Yr)return new Pe({multihash:t.multihash})}throw new Error("Supplied PeerID CID is invalid")}var Zr=Symbol.for("@libp2p/peer-discovery");var Ge=Jr("libp2p:bootstrap"),bs="bootstrap",gs=50,ws=12e4,ys=1e3,We=class extends ke{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??ys,this.list=[];for(let n of r.list){if(!$r.matches(n)){Ge.error("Invalid multiaddr");continue}let o=Ce(n),s=o.getPeerId();if(s==null){Ge.error("Invalid bootstrap multiaddr without peer id");continue}let i={id:Nt(s),multiaddrs:[o],protocols:[]};this.list.push(i)}this._init=r}get[Zr](){return!0}get[Symbol.toStringTag](){return"@libp2p/bootstrap"}isStarted(){return!!this.timer}start(){this.isStarted()||(Ge("Starting bootstrap node discovery, discovering peers after %s ms",this.timeout),this.timer=setTimeout(()=>{this._discoverBootstrapPeers().catch(e=>{Ge.error(e)})},this.timeout))}async _discoverBootstrapPeers(){if(this.timer!=null)for(let e of this.list){if(await this.components.peerStore.tagPeer(e.id,this._init.tagName??bs,{value:this._init.tagValue??gs,ttl:this._init.tagTTL??ws}),this.timer==null)return;this.dispatchEvent(new Mt("peer",{detail:e}))}}stop(){this.timer!=null&&clearTimeout(this.timer),this.timer=void 0}};We.tag="bootstrap";function xs(t){return e=>new We(e,t)}return sn(vs);})();
3
3
  return Libp2PBootstrap}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/bootstrap",
3
- "version": "6.0.1",
3
+ "version": "6.0.3",
4
4
  "description": "Node.js IPFS Implementation of the railing process of a Node through a bootstrap peer list",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p-bootstrap#readme",
@@ -145,8 +145,8 @@
145
145
  "@libp2p/interfaces": "^3.0.3",
146
146
  "@libp2p/logger": "^2.0.1",
147
147
  "@libp2p/peer-id": "^2.0.0",
148
- "@multiformats/mafmt": "^11.0.3",
149
- "@multiformats/multiaddr": "^11.0.0"
148
+ "@multiformats/mafmt": "^12.0.0",
149
+ "@multiformats/multiaddr": "^12.0.0"
150
150
  },
151
151
  "devDependencies": {
152
152
  "@libp2p/interface-peer-discovery-compliance-tests": "^2.0.0",