@libp2p/tcp 6.1.3 → 6.1.4
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 +4 -4
- package/package.json +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PTcp = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PTcp=(()=>{var sa=Object.create;var We=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var ia=Object.getOwnPropertyNames;var ca=Object.getPrototypeOf,aa=Object.prototype.hasOwnProperty;var Ct=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var V=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ct=(r,t)=>{for(var e in t)We(r,e,{get:t[e],enumerable:!0})},fs=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ia(t))!aa.call(r,s)&&s!==e&&We(r,s,{get:()=>t[s],enumerable:!(n=oa(t,s))||n.enumerable});return r};var _=(r,t,e)=>(e=r!=null?sa(ca(r)):{},fs(t||!r||!r.__esModule?We(e,"default",{value:r,enumerable:!0}):e,r)),ua=r=>fs(We({},"__esModule",{value:!0}),r);var $s=V(($f,Fs)=>{Fs.exports=Kr;var Ps=128,xu=127,Tu=~xu,Su=Math.pow(2,31);function Kr(r,t,e){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Kr.bytes=0,new RangeError("Could not encode varint");t=t||[],e=e||0;for(var n=e;r>=Su;)t[e++]=r&255|Ps,r/=128;for(;r&Tu;)t[e++]=r&255|Ps,r>>>=7;return t[e]=r|0,Kr.bytes=e-n+1,t}});var Us=V((kf,Ns)=>{Ns.exports=tn;var Eu=128,ks=127;function tn(r,n){var e=0,n=n||0,s=0,a=n,l,h=r.length;do{if(a>=h||s>49)throw tn.bytes=0,new RangeError("Could not decode varint");l=r[a++],e+=s<28?(l&ks)<<s:(l&ks)*Math.pow(2,s),s+=7}while(l>=Eu);return tn.bytes=a-n,e}});var Ls=V((Nf,zs)=>{var Cu=Math.pow(2,7),Au=Math.pow(2,14),Bu=Math.pow(2,21),Iu=Math.pow(2,28),Mu=Math.pow(2,35),Ru=Math.pow(2,42),Du=Math.pow(2,49),_u=Math.pow(2,56),Ou=Math.pow(2,63);zs.exports=function(r){return r<Cu?1:r<Au?2:r<Bu?3:r<Iu?4:r<Mu?5:r<Ru?6:r<Du?7:r<_u?8:r<Ou?9:10}});var yt=V((Uf,Vs)=>{Vs.exports={encode:$s(),decode:Us(),encodingLength:Ls()}});var Ae=V((oh,Ks)=>{"use strict";function Ys(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function Hu(r,t,e){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");e||(e={}),typeof t=="object"&&(e=t,t=""),t&&(e.code=t);try{return Ys(r,e)}catch{e.message=r.message,e.stack=r.stack;let s=function(){};return s.prototype=Object.create(Object.getPrototypeOf(r)),Ys(new s,e)}}Ks.exports=Hu});var po=V((bh,lo)=>{var ce=1e3,ae=ce*60,ue=ae*60,Ht=ue*24,ol=Ht*7,il=Ht*365.25;lo.exports=function(r,t){t=t||{};var e=typeof r;if(e==="string"&&r.length>0)return cl(r);if(e==="number"&&isFinite(r))return t.long?ul(r):al(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function cl(r){if(r=String(r),!(r.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(t){var e=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return e*il;case"weeks":case"week":case"w":return e*ol;case"days":case"day":case"d":return e*Ht;case"hours":case"hour":case"hrs":case"hr":case"h":return e*ue;case"minutes":case"minute":case"mins":case"min":case"m":return e*ae;case"seconds":case"second":case"secs":case"sec":case"s":return e*ce;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function al(r){var t=Math.abs(r);return t>=Ht?Math.round(r/Ht)+"d":t>=ue?Math.round(r/ue)+"h":t>=ae?Math.round(r/ae)+"m":t>=ce?Math.round(r/ce)+"s":r+"ms"}function ul(r){var t=Math.abs(r);return t>=Ht?tr(r,t,Ht,"day"):t>=ue?tr(r,t,ue,"hour"):t>=ae?tr(r,t,ae,"minute"):t>=ce?tr(r,t,ce,"second"):r+" ms"}function tr(r,t,e,n){var s=t>=e*1.5;return Math.round(r/e)+" "+n+(s?"s":"")}});var mn=V((wh,fo)=>{function ll(r){e.debug=e,e.default=e,e.coerce=b,e.disable=a,e.enable=s,e.enabled=l,e.humanize=po(),e.destroy=E,Object.keys(r).forEach(p=>{e[p]=r[p]}),e.names=[],e.skips=[],e.formatters={};function t(p){let y=0;for(let x=0;x<p.length;x++)y=(y<<5)-y+p.charCodeAt(x),y|=0;return e.colors[Math.abs(y)%e.colors.length]}e.selectColor=t;function e(p){let y,x=null,g,d;function B(...R){if(!B.enabled)return;let A=B,I=Number(new Date),L=I-(y||I);A.diff=L,A.prev=y,A.curr=I,y=I,R[0]=e.coerce(R[0]),typeof R[0]!="string"&&R.unshift("%O");let j=0;R[0]=R[0].replace(/%([a-zA-Z%])/g,(rt,tt)=>{if(rt==="%%")return"%";j++;let nt=e.formatters[tt];if(typeof nt=="function"){let ht=R[j];rt=nt.call(A,ht),R.splice(j,1),j--}return rt}),e.formatArgs.call(A,R),(A.log||e.log).apply(A,R)}return B.namespace=p,B.useColors=e.useColors(),B.color=e.selectColor(p),B.extend=n,B.destroy=e.destroy,Object.defineProperty(B,"enabled",{enumerable:!0,configurable:!1,get:()=>x!==null?x:(g!==e.namespaces&&(g=e.namespaces,d=e.enabled(p)),d),set:R=>{x=R}}),typeof e.init=="function"&&e.init(B),B}function n(p,y){let x=e(this.namespace+(typeof y>"u"?":":y)+p);return x.log=this.log,x}function s(p){e.save(p),e.namespaces=p,e.names=[],e.skips=[];let y,x=(typeof p=="string"?p:"").split(/[\s,]+/),g=x.length;for(y=0;y<g;y++)x[y]&&(p=x[y].replace(/\*/g,".*?"),p[0]==="-"?e.skips.push(new RegExp("^"+p.slice(1)+"$")):e.names.push(new RegExp("^"+p+"$")))}function a(){let p=[...e.names.map(h),...e.skips.map(h).map(y=>"-"+y)].join(",");return e.enable(""),p}function l(p){if(p[p.length-1]==="*")return!0;let y,x;for(y=0,x=e.skips.length;y<x;y++)if(e.skips[y].test(p))return!1;for(y=0,x=e.names.length;y<x;y++)if(e.names[y].test(p))return!0;return!1}function h(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function b(p){return p instanceof Error?p.stack||p.message:p}function E(){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 e.enable(e.load()),e}fo.exports=ll});var ho=V((at,er)=>{at.formatArgs=fl;at.save=hl;at.load=dl;at.useColors=pl;at.storage=ml();at.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();at.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 pl(){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 fl(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+er.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;r.splice(1,0,t,"color: inherit");let e=0,n=0;r[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(e++,s==="%c"&&(n=e))}),r.splice(n,0,t)}at.log=console.debug||console.log||(()=>{});function hl(r){try{r?at.storage.setItem("debug",r):at.storage.removeItem("debug")}catch{}}function dl(){let r;try{r=at.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function ml(){try{return localStorage}catch{}}er.exports=mn()(at);var{formatters:gl}=er.exports;gl.j=function(r){try{return JSON.stringify(r)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var go=V((yh,mo)=>{"use strict";mo.exports=(r,t)=>{t=t||process.argv;let e=r.startsWith("-")?"":r.length===1?"-":"--",n=t.indexOf(e+r),s=t.indexOf("--");return n!==-1&&(s===-1?!0:n<s)}});var wo=V((vh,bo)=>{"use strict";var bl=Ct("os"),bt=go(),X=process.env,le;bt("no-color")||bt("no-colors")||bt("color=false")?le=!1:(bt("color")||bt("colors")||bt("color=true")||bt("color=always"))&&(le=!0);"FORCE_COLOR"in X&&(le=X.FORCE_COLOR.length===0||parseInt(X.FORCE_COLOR,10)!==0);function wl(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function yl(r){if(le===!1)return 0;if(bt("color=16m")||bt("color=full")||bt("color=truecolor"))return 3;if(bt("color=256"))return 2;if(r&&!r.isTTY&&le!==!0)return 0;let t=le?1:0;if(process.platform==="win32"){let e=bl.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in X)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in X)||X.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in X)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(X.TEAMCITY_VERSION)?1:0;if(X.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in X){let e=parseInt((X.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(X.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(X.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(X.TERM)||"COLORTERM"in X?1:(X.TERM==="dumb",t)}function gn(r){let t=yl(r);return wl(t)}bo.exports={supportsColor:gn,stdout:gn(process.stdout),stderr:gn(process.stderr)}});var vo=V((H,nr)=>{var vl=Ct("tty"),rr=Ct("util");H.init=Bl;H.log=El;H.formatArgs=Tl;H.save=Cl;H.load=Al;H.useColors=xl;H.destroy=rr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");H.colors=[6,2,3,4,5,1];try{let r=wo();r&&(r.stderr||r).level>=2&&(H.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}H.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,t)=>{let e=t.substring(6).toLowerCase().replace(/_([a-z])/g,(s,a)=>a.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[e]=n,r},{});function xl(){return"colors"in H.inspectOpts?!!H.inspectOpts.colors:vl.isatty(process.stderr.fd)}function Tl(r){let{namespace:t,useColors:e}=this;if(e){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),a=` ${s};1m${t} \x1B[0m`;r[0]=a+r[0].split(`
|
|
2
|
+
"use strict";var Libp2PTcp=(()=>{var Fi=Object.create;var Se=Object.defineProperty;var ki=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Li=Object.getPrototypeOf,$i=Object.prototype.hasOwnProperty;var yt=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var k=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),rt=(r,t)=>{for(var e in t)Se(r,e,{get:t[e],enumerable:!0})},gn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ni(t))!$i.call(r,i)&&i!==e&&Se(r,i,{get:()=>t[i],enumerable:!(n=ki(t,i))||n.enumerable});return r};var j=(r,t,e)=>(e=r!=null?Fi(Li(r)):{},gn(t||!r||!r.__esModule?Se(e,"default",{value:r,enumerable:!0}):e,r)),Ui=r=>gn(Se({},"__esModule",{value:!0}),r);var Un=k((Sf,$n)=>{$n.exports=Cr;var Ln=128,Ka=127,Qa=~Ka,tc=Math.pow(2,31);function Cr(r,t,e){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Cr.bytes=0,new RangeError("Could not encode varint");t=t||[],e=e||0;for(var n=e;r>=tc;)t[e++]=r&255|Ln,r/=128;for(;r&Qa;)t[e++]=r&255|Ln,r>>>=7;return t[e]=r|0,Cr.bytes=e-n+1,t}});var zn=k((Ef,Vn)=>{Vn.exports=Ar;var ec=128,jn=127;function Ar(r,n){var e=0,n=n||0,i=0,u=n,l,m=r.length;do{if(u>=m||i>49)throw Ar.bytes=0,new RangeError("Could not decode varint");l=r[u++],e+=i<28?(l&jn)<<i:(l&jn)*Math.pow(2,i),i+=7}while(l>=ec);return Ar.bytes=u-n,e}});var Gn=k((Cf,qn)=>{var rc=Math.pow(2,7),nc=Math.pow(2,14),sc=Math.pow(2,21),oc=Math.pow(2,28),ic=Math.pow(2,35),ac=Math.pow(2,42),cc=Math.pow(2,49),uc=Math.pow(2,56),fc=Math.pow(2,63);qn.exports=function(r){return r<rc?1:r<nc?2:r<sc?3:r<oc?4:r<ic?5:r<ac?6:r<cc?7:r<uc?8:r<fc?9:10}});var Re=k((Af,Zn)=>{Zn.exports={encode:Un(),decode:zn(),encodingLength:Gn()}});var ss=k((Zf,ns)=>{"use strict";function rs(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function Cc(r,t,e){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");e||(e={}),typeof t=="object"&&(e=t,t=""),t&&(e.code=t);try{return rs(r,e)}catch{e.message=r.message,e.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),rs(new i,e)}}ns.exports=Cc});var bs=k((ol,gs)=>{var Kt=1e3,Qt=Kt*60,te=Qt*60,Nt=te*24,kc=Nt*7,Nc=Nt*365.25;gs.exports=function(r,t){t=t||{};var e=typeof r;if(e==="string"&&r.length>0)return Lc(r);if(e==="number"&&isFinite(r))return t.long?Uc(r):$c(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Lc(r){if(r=String(r),!(r.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(t){var e=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return e*Nc;case"weeks":case"week":case"w":return e*kc;case"days":case"day":case"d":return e*Nt;case"hours":case"hour":case"hrs":case"hr":case"h":return e*te;case"minutes":case"minute":case"mins":case"min":case"m":return e*Qt;case"seconds":case"second":case"secs":case"sec":case"s":return e*Kt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function $c(r){var t=Math.abs(r);return t>=Nt?Math.round(r/Nt)+"d":t>=te?Math.round(r/te)+"h":t>=Qt?Math.round(r/Qt)+"m":t>=Kt?Math.round(r/Kt)+"s":r+"ms"}function Uc(r){var t=Math.abs(r);return t>=Nt?Pe(r,t,Nt,"day"):t>=te?Pe(r,t,te,"hour"):t>=Qt?Pe(r,t,Qt,"minute"):t>=Kt?Pe(r,t,Kt,"second"):r+" ms"}function Pe(r,t,e,n){var i=t>=e*1.5;return Math.round(r/e)+" "+n+(i?"s":"")}});var Ur=k((il,ys)=>{function jc(r){e.debug=e,e.default=e,e.coerce=b,e.disable=u,e.enable=i,e.enabled=l,e.humanize=bs(),e.destroy=A,Object.keys(r).forEach(f=>{e[f]=r[f]}),e.names=[],e.skips=[],e.formatters={};function t(f){let w=0;for(let v=0;v<f.length;v++)w=(w<<5)-w+f.charCodeAt(v),w|=0;return e.colors[Math.abs(w)%e.colors.length]}e.selectColor=t;function e(f){let w,v=null,T,d;function C(...I){if(!C.enabled)return;let E=C,B=Number(new Date),F=B-(w||B);E.diff=F,E.prev=w,E.curr=B,w=B,I[0]=e.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let N=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(X,W)=>{if(X==="%%")return"%";N++;let Y=e.formatters[W];if(typeof Y=="function"){let ct=I[N];X=Y.call(E,ct),I.splice(N,1),N--}return X}),e.formatArgs.call(E,I),(E.log||e.log).apply(E,I)}return C.namespace=f,C.useColors=e.useColors(),C.color=e.selectColor(f),C.extend=n,C.destroy=e.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(T!==e.namespaces&&(T=e.namespaces,d=e.enabled(f)),d),set:I=>{v=I}}),typeof e.init=="function"&&e.init(C),C}function n(f,w){let v=e(this.namespace+(typeof w>"u"?":":w)+f);return v.log=this.log,v}function i(f){e.save(f),e.namespaces=f,e.names=[],e.skips=[];let w,v=(typeof f=="string"?f:"").split(/[\s,]+/),T=v.length;for(w=0;w<T;w++)v[w]&&(f=v[w].replace(/\*/g,".*?"),f[0]==="-"?e.skips.push(new RegExp("^"+f.slice(1)+"$")):e.names.push(new RegExp("^"+f+"$")))}function u(){let f=[...e.names.map(m),...e.skips.map(m).map(w=>"-"+w)].join(",");return e.enable(""),f}function l(f){if(f[f.length-1]==="*")return!0;let w,v;for(w=0,v=e.skips.length;w<v;w++)if(e.skips[w].test(f))return!1;for(w=0,v=e.names.length;w<v;w++)if(e.names[w].test(f))return!0;return!1}function m(f){return f.toString().substring(2,f.toString().length-2).replace(/\.\*\?$/,"*")}function b(f){return f instanceof Error?f.stack||f.message:f}function A(){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 e.enable(e.load()),e}ys.exports=jc});var ws=k((nt,Fe)=>{nt.formatArgs=zc;nt.save=qc;nt.load=Gc;nt.useColors=Vc;nt.storage=Zc();nt.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();nt.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 Vc(){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 zc(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Fe.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;r.splice(1,0,t,"color: inherit");let e=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(e++,i==="%c"&&(n=e))}),r.splice(n,0,t)}nt.log=console.debug||console.log||(()=>{});function qc(r){try{r?nt.storage.setItem("debug",r):nt.storage.removeItem("debug")}catch{}}function Gc(){let r;try{r=nt.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function Zc(){try{return localStorage}catch{}}Fe.exports=Ur()(nt);var{formatters:Hc}=Fe.exports;Hc.j=function(r){try{return JSON.stringify(r)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var xs=k((al,vs)=>{"use strict";vs.exports=(r,t)=>{t=t||process.argv;let e=r.startsWith("-")?"":r.length===1?"-":"--",n=t.indexOf(e+r),i=t.indexOf("--");return n!==-1&&(i===-1?!0:n<i)}});var Ss=k((cl,Ts)=>{"use strict";var Wc=yt("os"),ht=xs(),q=process.env,ee;ht("no-color")||ht("no-colors")||ht("color=false")?ee=!1:(ht("color")||ht("colors")||ht("color=true")||ht("color=always"))&&(ee=!0);"FORCE_COLOR"in q&&(ee=q.FORCE_COLOR.length===0||parseInt(q.FORCE_COLOR,10)!==0);function Jc(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Xc(r){if(ee===!1)return 0;if(ht("color=16m")||ht("color=full")||ht("color=truecolor"))return 3;if(ht("color=256"))return 2;if(r&&!r.isTTY&&ee!==!0)return 0;let t=ee?1:0;if(process.platform==="win32"){let e=Wc.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in q)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in q)||q.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in q)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(q.TEAMCITY_VERSION)?1:0;if(q.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in q){let e=parseInt((q.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(q.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(q.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(q.TERM)||"COLORTERM"in q?1:(q.TERM==="dumb",t)}function jr(r){let t=Xc(r);return Jc(t)}Ts.exports={supportsColor:jr,stdout:jr(process.stdout),stderr:jr(process.stderr)}});var Cs=k((V,Ne)=>{var Yc=yt("tty"),ke=yt("util");V.init=su;V.log=eu;V.formatArgs=Qc;V.save=ru;V.load=nu;V.useColors=Kc;V.destroy=ke.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");V.colors=[6,2,3,4,5,1];try{let r=Ss();r&&(r.stderr||r).level>=2&&(V.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}V.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,t)=>{let e=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,u)=>u.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[e]=n,r},{});function Kc(){return"colors"in V.inspectOpts?!!V.inspectOpts.colors:Yc.isatty(process.stderr.fd)}function Qc(r){let{namespace:t,useColors:e}=this;if(e){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),u=` ${i};1m${t} \x1B[0m`;r[0]=u+r[0].split(`
|
|
3
3
|
`).join(`
|
|
4
|
-
`+
|
|
5
|
-
`)}function
|
|
6
|
-
`).map(t=>t.trim()).join(" ")};yo.O=function(r){return this.inspectOpts.colors=this.useColors,rr.inspect(r,this.inspectOpts)}});var xo=V((xh,bn)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?bn.exports=ho():bn.exports=vo()});var sr=V((Ah,To)=>{To.exports=r=>{if(r[Symbol.asyncIterator])return r;if(r.getReader)return async function*(){let t=r.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}();throw new Error("unknown stream")}});var Eo=V((Bh,So)=>{So.exports=function(t){if(t){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}});var wn=V((Ih,Co)=>{var Il=Eo();Co.exports=r=>async t=>{t=Il(t);let e=A=>{typeof A.return=="function"&&A.return()},n=null,s=null,a=A=>{n=A,s&&s(A),e(t)},l=null,h=!1,b=()=>{h=!0,l&&l()},E=null,p=!1,y=()=>{p=!0,E&&E()},x=null,g=()=>{x&&x()},d=()=>new Promise((A,I)=>{l=x=A,s=I,r.once("drain",g)}),B=()=>(e(t),new Promise((A,I)=>{if(h||p||n)return A();E=l=A,s=I})),R=()=>{r.removeListener("error",a),r.removeListener("close",b),r.removeListener("finish",y),r.removeListener("drain",g)};r.once("error",a),r.once("close",b),r.once("finish",y);try{for await(let A of t){if(!r.writable||r.destroyed||n)break;r.write(A)===!1&&await d()}}catch(A){n||r.destroy(),n=A}try{if(r.writable&&r.end(),await B(),n)throw n}finally{R()}}});var yn=V((Mh,Ao)=>{var Ml=wn(),Rl=sr();Ao.exports=r=>({sink:Ml(r),source:Rl(r)})});var Io=V((Rh,Bo)=>{var Dl=yn();Bo.exports=r=>async function*(t){let e=Dl(r),n;if(e.sink(t).catch(s=>{n=s}),yield*e.source,n)throw n}});var Mo=V((Dh,pe)=>{pe.exports=sr();pe.exports.source=sr();pe.exports.sink=wn();pe.exports.transform=Io();pe.exports.duplex=yn()});var _n=V((pr,Wo)=>{(function(){var r,t=0xdeadbeefcafe,e=(t&16777215)==15715070;function n(o,i,c){o!=null&&(typeof o=="number"?this.fromNumber(o,i,c):i==null&&typeof o!="string"?this.fromString(o,256):this.fromString(o,i))}function s(){return new n(null)}function a(o,i,c,u,f,m){for(;--m>=0;){var w=i*this[o++]+c[u]+f;f=Math.floor(w/67108864),c[u++]=w&67108863}return f}function l(o,i,c,u,f,m){for(var w=i&32767,v=i>>15;--m>=0;){var O=this[o]&32767,G=this[o++]>>15,lt=v*O+G*w;O=w*O+((lt&32767)<<15)+c[u]+(f&1073741823),f=(O>>>30)+(lt>>>15)+v*G+(f>>>30),c[u++]=O&1073741823}return f}function h(o,i,c,u,f,m){for(var w=i&16383,v=i>>14;--m>=0;){var O=this[o]&16383,G=this[o++]>>14,lt=v*O+G*w;O=w*O+((lt&16383)<<14)+c[u]+f,f=(O>>28)+(lt>>14)+v*G,c[u++]=O&268435455}return f}var b=typeof navigator<"u";b&&e&&navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=l,r=30):b&&e&&navigator.appName!="Netscape"?(n.prototype.am=a,r=26):(n.prototype.am=h,r=28),n.prototype.DB=r,n.prototype.DM=(1<<r)-1,n.prototype.DV=1<<r;var E=52;n.prototype.FV=Math.pow(2,E),n.prototype.F1=E-r,n.prototype.F2=2*r-E;var p="0123456789abcdefghijklmnopqrstuvwxyz",y=new Array,x,g;for(x="0".charCodeAt(0),g=0;g<=9;++g)y[x++]=g;for(x="a".charCodeAt(0),g=10;g<36;++g)y[x++]=g;for(x="A".charCodeAt(0),g=10;g<36;++g)y[x++]=g;function d(o){return p.charAt(o)}function B(o,i){var c=y[o.charCodeAt(i)];return c??-1}function R(o){for(var i=this.t-1;i>=0;--i)o[i]=this[i];o.t=this.t,o.s=this.s}function A(o){this.t=1,this.s=o<0?-1:0,o>0?this[0]=o:o<-1?this[0]=o+this.DV:this.t=0}function I(o){var i=s();return i.fromInt(o),i}function L(o,i){var c;if(i==16)c=4;else if(i==8)c=3;else if(i==256)c=8;else if(i==2)c=1;else if(i==32)c=5;else if(i==4)c=2;else{this.fromRadix(o,i);return}this.t=0,this.s=0;for(var u=o.length,f=!1,m=0;--u>=0;){var w=c==8?o[u]&255:B(o,u);if(w<0){o.charAt(u)=="-"&&(f=!0);continue}f=!1,m==0?this[this.t++]=w:m+c>this.DB?(this[this.t-1]|=(w&(1<<this.DB-m)-1)<<m,this[this.t++]=w>>this.DB-m):this[this.t-1]|=w<<m,m+=c,m>=this.DB&&(m-=this.DB)}c==8&&o[0]&128&&(this.s=-1,m>0&&(this[this.t-1]|=(1<<this.DB-m)-1<<m)),this.clamp(),f&&n.ZERO.subTo(this,this)}function j(){for(var o=this.s&this.DM;this.t>0&&this[this.t-1]==o;)--this.t}function st(o){if(this.s<0)return"-"+this.negate().toString(o);var i;if(o==16)i=4;else if(o==8)i=3;else if(o==2)i=1;else if(o==32)i=5;else if(o==4)i=2;else return this.toRadix(o);var c=(1<<i)-1,u,f=!1,m="",w=this.t,v=this.DB-w*this.DB%i;if(w-- >0)for(v<this.DB&&(u=this[w]>>v)>0&&(f=!0,m=d(u));w>=0;)v<i?(u=(this[w]&(1<<v)-1)<<i-v,u|=this[--w]>>(v+=this.DB-i)):(u=this[w]>>(v-=i)&c,v<=0&&(v+=this.DB,--w)),u>0&&(f=!0),f&&(m+=d(u));return f?m:"0"}function rt(){var o=s();return n.ZERO.subTo(this,o),o}function tt(){return this.s<0?this.negate():this}function nt(o){var i=this.s-o.s;if(i!=0)return i;var c=this.t;if(i=c-o.t,i!=0)return this.s<0?-i:i;for(;--c>=0;)if((i=this[c]-o[c])!=0)return i;return 0}function ht(o){var i=1,c;return(c=o>>>16)!=0&&(o=c,i+=16),(c=o>>8)!=0&&(o=c,i+=8),(c=o>>4)!=0&&(o=c,i+=4),(c=o>>2)!=0&&(o=c,i+=2),(c=o>>1)!=0&&(o=c,i+=1),i}function Ei(){return this.t<=0?0:this.DB*(this.t-1)+ht(this[this.t-1]^this.s&this.DM)}function Ci(o,i){var c;for(c=this.t-1;c>=0;--c)i[c+o]=this[c];for(c=o-1;c>=0;--c)i[c]=0;i.t=this.t+o,i.s=this.s}function Ai(o,i){for(var c=o;c<this.t;++c)i[c-o]=this[c];i.t=Math.max(this.t-o,0),i.s=this.s}function Bi(o,i){var c=o%this.DB,u=this.DB-c,f=(1<<u)-1,m=Math.floor(o/this.DB),w=this.s<<c&this.DM,v;for(v=this.t-1;v>=0;--v)i[v+m+1]=this[v]>>u|w,w=(this[v]&f)<<c;for(v=m-1;v>=0;--v)i[v]=0;i[m]=w,i.t=this.t+m+1,i.s=this.s,i.clamp()}function Ii(o,i){i.s=this.s;var c=Math.floor(o/this.DB);if(c>=this.t){i.t=0;return}var u=o%this.DB,f=this.DB-u,m=(1<<u)-1;i[0]=this[c]>>u;for(var w=c+1;w<this.t;++w)i[w-c-1]|=(this[w]&m)<<f,i[w-c]=this[w]>>u;u>0&&(i[this.t-c-1]|=(this.s&m)<<f),i.t=this.t-c,i.clamp()}function Mi(o,i){for(var c=0,u=0,f=Math.min(o.t,this.t);c<f;)u+=this[c]-o[c],i[c++]=u&this.DM,u>>=this.DB;if(o.t<this.t){for(u-=o.s;c<this.t;)u+=this[c],i[c++]=u&this.DM,u>>=this.DB;u+=this.s}else{for(u+=this.s;c<o.t;)u-=o[c],i[c++]=u&this.DM,u>>=this.DB;u-=o.s}i.s=u<0?-1:0,u<-1?i[c++]=this.DV+u:u>0&&(i[c++]=u),i.t=c,i.clamp()}function Ri(o,i){var c=this.abs(),u=o.abs(),f=c.t;for(i.t=f+u.t;--f>=0;)i[f]=0;for(f=0;f<u.t;++f)i[f+c.t]=c.am(0,u[f],i,f,0,c.t);i.s=0,i.clamp(),this.s!=o.s&&n.ZERO.subTo(i,i)}function Di(o){for(var i=this.abs(),c=o.t=2*i.t;--c>=0;)o[c]=0;for(c=0;c<i.t-1;++c){var u=i.am(c,i[c],o,2*c,0,1);(o[c+i.t]+=i.am(c+1,2*i[c],o,2*c+1,u,i.t-c-1))>=i.DV&&(o[c+i.t]-=i.DV,o[c+i.t+1]=1)}o.t>0&&(o[o.t-1]+=i.am(c,i[c],o,2*c,0,1)),o.s=0,o.clamp()}function _i(o,i,c){var u=o.abs();if(!(u.t<=0)){var f=this.abs();if(f.t<u.t){i?.fromInt(0),c!=null&&this.copyTo(c);return}c==null&&(c=s());var m=s(),w=this.s,v=o.s,O=this.DB-ht(u[u.t-1]);O>0?(u.lShiftTo(O,m),f.lShiftTo(O,c)):(u.copyTo(m),f.copyTo(c));var G=m.t,lt=m[G-1];if(lt!=0){var it=lt*(1<<this.F1)+(G>1?m[G-2]>>this.F2:0),Et=this.FV/it,qe=(1<<this.F1)/it,mt=1<<this.F2,gt=c.t,Ge=gt-G,Ft=i??s();for(m.dlShiftTo(Ge,Ft),c.compareTo(Ft)>=0&&(c[c.t++]=1,c.subTo(Ft,c)),n.ONE.dlShiftTo(G,Ft),Ft.subTo(m,m);m.t<G;)m[m.t++]=0;for(;--Ge>=0;){var Br=c[--gt]==lt?this.DM:Math.floor(c[gt]*Et+(c[gt-1]+mt)*qe);if((c[gt]+=m.am(0,Br,c,Ge,0,G))<Br)for(m.dlShiftTo(Ge,Ft),c.subTo(Ft,c);c[gt]<--Br;)c.subTo(Ft,c)}i!=null&&(c.drShiftTo(G,i),w!=v&&n.ZERO.subTo(i,i)),c.t=G,c.clamp(),O>0&&c.rShiftTo(O,c),w<0&&n.ZERO.subTo(c,c)}}}function Oi(o){var i=s();return this.abs().divRemTo(o,null,i),this.s<0&&i.compareTo(n.ZERO)>0&&o.subTo(i,i),i}function jt(o){this.m=o}function Pi(o){return o.s<0||o.compareTo(this.m)>=0?o.mod(this.m):o}function Fi(o){return o}function $i(o){o.divRemTo(this.m,null,o)}function ki(o,i,c){o.multiplyTo(i,c),this.reduce(c)}function Ni(o,i){o.squareTo(i),this.reduce(i)}jt.prototype.convert=Pi,jt.prototype.revert=Fi,jt.prototype.reduce=$i,jt.prototype.mulTo=ki,jt.prototype.sqrTo=Ni;function Ui(){if(this.t<1)return 0;var o=this[0];if(!(o&1))return 0;var i=o&3;return i=i*(2-(o&15)*i)&15,i=i*(2-(o&255)*i)&255,i=i*(2-((o&65535)*i&65535))&65535,i=i*(2-o*i%this.DV)%this.DV,i>0?this.DV-i:-i}function qt(o){this.m=o,this.mp=o.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<o.DB-15)-1,this.mt2=2*o.t}function zi(o){var i=s();return o.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),o.s<0&&i.compareTo(n.ZERO)>0&&this.m.subTo(i,i),i}function Li(o){var i=s();return o.copyTo(i),this.reduce(i),i}function Vi(o){for(;o.t<=this.mt2;)o[o.t++]=0;for(var i=0;i<this.m.t;++i){var c=o[i]&32767,u=c*this.mpl+((c*this.mph+(o[i]>>15)*this.mpl&this.um)<<15)&o.DM;for(c=i+this.m.t,o[c]+=this.m.am(0,u,o,i,0,this.m.t);o[c]>=o.DV;)o[c]-=o.DV,o[++c]++}o.clamp(),o.drShiftTo(this.m.t,o),o.compareTo(this.m)>=0&&o.subTo(this.m,o)}function ji(o,i){o.squareTo(i),this.reduce(i)}function qi(o,i,c){o.multiplyTo(i,c),this.reduce(c)}qt.prototype.convert=zi,qt.prototype.revert=Li,qt.prototype.reduce=Vi,qt.prototype.mulTo=qi,qt.prototype.sqrTo=ji;function Gi(){return(this.t>0?this[0]&1:this.s)==0}function Wi(o,i){if(o>4294967295||o<1)return n.ONE;var c=s(),u=s(),f=i.convert(this),m=ht(o)-1;for(f.copyTo(c);--m>=0;)if(i.sqrTo(c,u),(o&1<<m)>0)i.mulTo(u,f,c);else{var w=c;c=u,u=w}return i.revert(c)}function Zi(o,i){var c;return o<256||i.isEven()?c=new jt(i):c=new qt(i),this.exp(o,c)}n.prototype.copyTo=R,n.prototype.fromInt=A,n.prototype.fromString=L,n.prototype.clamp=j,n.prototype.dlShiftTo=Ci,n.prototype.drShiftTo=Ai,n.prototype.lShiftTo=Bi,n.prototype.rShiftTo=Ii,n.prototype.subTo=Mi,n.prototype.multiplyTo=Ri,n.prototype.squareTo=Di,n.prototype.divRemTo=_i,n.prototype.invDigit=Ui,n.prototype.isEven=Gi,n.prototype.exp=Wi,n.prototype.toString=st,n.prototype.negate=rt,n.prototype.abs=tt,n.prototype.compareTo=nt,n.prototype.bitLength=Ei,n.prototype.mod=Oi,n.prototype.modPowInt=Zi,n.ZERO=I(0),n.ONE=I(1);function Hi(){var o=s();return this.copyTo(o),o}function Ji(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Xi(){return this.t==0?this.s:this[0]<<24>>24}function Qi(){return this.t==0?this.s:this[0]<<16>>16}function Yi(o){return Math.floor(Math.LN2*this.DB/Math.log(o))}function Ki(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function tc(o){if(o==null&&(o=10),this.signum()==0||o<2||o>36)return"0";var i=this.chunkSize(o),c=Math.pow(o,i),u=I(c),f=s(),m=s(),w="";for(this.divRemTo(u,f,m);f.signum()>0;)w=(c+m.intValue()).toString(o).substr(1)+w,f.divRemTo(u,f,m);return m.intValue().toString(o)+w}function ec(o,i){this.fromInt(0),i==null&&(i=10);for(var c=this.chunkSize(i),u=Math.pow(i,c),f=!1,m=0,w=0,v=0;v<o.length;++v){var O=B(o,v);if(O<0){o.charAt(v)=="-"&&this.signum()==0&&(f=!0);continue}w=i*w+O,++m>=c&&(this.dMultiply(u),this.dAddOffset(w,0),m=0,w=0)}m>0&&(this.dMultiply(Math.pow(i,m)),this.dAddOffset(w,0)),f&&n.ZERO.subTo(this,this)}function rc(o,i,c){if(typeof i=="number")if(o<2)this.fromInt(1);else for(this.fromNumber(o,c),this.testBit(o-1)||this.bitwiseTo(n.ONE.shiftLeft(o-1),Sr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>o&&this.subTo(n.ONE.shiftLeft(o-1),this);else{var u=new Array,f=o&7;u.length=(o>>3)+1,i.nextBytes(u),f>0?u[0]&=(1<<f)-1:u[0]=0,this.fromString(u,256)}}function nc(){var o=this.t,i=new Array;i[0]=this.s;var c=this.DB-o*this.DB%8,u,f=0;if(o-- >0)for(c<this.DB&&(u=this[o]>>c)!=(this.s&this.DM)>>c&&(i[f++]=u|this.s<<this.DB-c);o>=0;)c<8?(u=(this[o]&(1<<c)-1)<<8-c,u|=this[--o]>>(c+=this.DB-8)):(u=this[o]>>(c-=8)&255,c<=0&&(c+=this.DB,--o)),u&128&&(u|=-256),f==0&&(this.s&128)!=(u&128)&&++f,(f>0||u!=this.s)&&(i[f++]=u);return i}function sc(o){return this.compareTo(o)==0}function oc(o){return this.compareTo(o)<0?this:o}function ic(o){return this.compareTo(o)>0?this:o}function cc(o,i,c){var u,f,m=Math.min(o.t,this.t);for(u=0;u<m;++u)c[u]=i(this[u],o[u]);if(o.t<this.t){for(f=o.s&this.DM,u=m;u<this.t;++u)c[u]=i(this[u],f);c.t=this.t}else{for(f=this.s&this.DM,u=m;u<o.t;++u)c[u]=i(f,o[u]);c.t=o.t}c.s=i(this.s,o.s),c.clamp()}function ac(o,i){return o&i}function uc(o){var i=s();return this.bitwiseTo(o,ac,i),i}function Sr(o,i){return o|i}function lc(o){var i=s();return this.bitwiseTo(o,Sr,i),i}function is(o,i){return o^i}function pc(o){var i=s();return this.bitwiseTo(o,is,i),i}function cs(o,i){return o&~i}function fc(o){var i=s();return this.bitwiseTo(o,cs,i),i}function hc(){for(var o=s(),i=0;i<this.t;++i)o[i]=this.DM&~this[i];return o.t=this.t,o.s=~this.s,o}function dc(o){var i=s();return o<0?this.rShiftTo(-o,i):this.lShiftTo(o,i),i}function mc(o){var i=s();return o<0?this.lShiftTo(-o,i):this.rShiftTo(o,i),i}function gc(o){if(o==0)return-1;var i=0;return o&65535||(o>>=16,i+=16),o&255||(o>>=8,i+=8),o&15||(o>>=4,i+=4),o&3||(o>>=2,i+=2),o&1||++i,i}function bc(){for(var o=0;o<this.t;++o)if(this[o]!=0)return o*this.DB+gc(this[o]);return this.s<0?this.t*this.DB:-1}function wc(o){for(var i=0;o!=0;)o&=o-1,++i;return i}function yc(){for(var o=0,i=this.s&this.DM,c=0;c<this.t;++c)o+=wc(this[c]^i);return o}function vc(o){var i=Math.floor(o/this.DB);return i>=this.t?this.s!=0:(this[i]&1<<o%this.DB)!=0}function xc(o,i){var c=n.ONE.shiftLeft(o);return this.bitwiseTo(c,i,c),c}function Tc(o){return this.changeBit(o,Sr)}function Sc(o){return this.changeBit(o,cs)}function Ec(o){return this.changeBit(o,is)}function Cc(o,i){for(var c=0,u=0,f=Math.min(o.t,this.t);c<f;)u+=this[c]+o[c],i[c++]=u&this.DM,u>>=this.DB;if(o.t<this.t){for(u+=o.s;c<this.t;)u+=this[c],i[c++]=u&this.DM,u>>=this.DB;u+=this.s}else{for(u+=this.s;c<o.t;)u+=o[c],i[c++]=u&this.DM,u>>=this.DB;u+=o.s}i.s=u<0?-1:0,u>0?i[c++]=u:u<-1&&(i[c++]=this.DV+u),i.t=c,i.clamp()}function Ac(o){var i=s();return this.addTo(o,i),i}function Bc(o){var i=s();return this.subTo(o,i),i}function Ic(o){var i=s();return this.multiplyTo(o,i),i}function Mc(){var o=s();return this.squareTo(o),o}function Rc(o){var i=s();return this.divRemTo(o,i,null),i}function Dc(o){var i=s();return this.divRemTo(o,null,i),i}function _c(o){var i=s(),c=s();return this.divRemTo(o,i,c),new Array(i,c)}function Oc(o){this[this.t]=this.am(0,o-1,this,0,0,this.t),++this.t,this.clamp()}function Pc(o,i){if(o!=0){for(;this.t<=i;)this[this.t++]=0;for(this[i]+=o;this[i]>=this.DV;)this[i]-=this.DV,++i>=this.t&&(this[this.t++]=0),++this[i]}}function xe(){}function as(o){return o}function Fc(o,i,c){o.multiplyTo(i,c)}function $c(o,i){o.squareTo(i)}xe.prototype.convert=as,xe.prototype.revert=as,xe.prototype.mulTo=Fc,xe.prototype.sqrTo=$c;function kc(o){return this.exp(o,new xe)}function Nc(o,i,c){var u=Math.min(this.t+o.t,i);for(c.s=0,c.t=u;u>0;)c[--u]=0;var f;for(f=c.t-this.t;u<f;++u)c[u+this.t]=this.am(0,o[u],c,u,0,this.t);for(f=Math.min(o.t,i);u<f;++u)this.am(0,o[u],c,u,0,i-u);c.clamp()}function Uc(o,i,c){--i;var u=c.t=this.t+o.t-i;for(c.s=0;--u>=0;)c[u]=0;for(u=Math.max(i-this.t,0);u<o.t;++u)c[this.t+u-i]=this.am(i-u,o[u],c,0,0,this.t+u-i);c.clamp(),c.drShiftTo(1,c)}function Gt(o){this.r2=s(),this.q3=s(),n.ONE.dlShiftTo(2*o.t,this.r2),this.mu=this.r2.divide(o),this.m=o}function zc(o){if(o.s<0||o.t>2*this.m.t)return o.mod(this.m);if(o.compareTo(this.m)<0)return o;var i=s();return o.copyTo(i),this.reduce(i),i}function Lc(o){return o}function Vc(o){for(o.drShiftTo(this.m.t-1,this.r2),o.t>this.m.t+1&&(o.t=this.m.t+1,o.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);o.compareTo(this.r2)<0;)o.dAddOffset(1,this.m.t+1);for(o.subTo(this.r2,o);o.compareTo(this.m)>=0;)o.subTo(this.m,o)}function jc(o,i){o.squareTo(i),this.reduce(i)}function qc(o,i,c){o.multiplyTo(i,c),this.reduce(c)}Gt.prototype.convert=zc,Gt.prototype.revert=Lc,Gt.prototype.reduce=Vc,Gt.prototype.mulTo=qc,Gt.prototype.sqrTo=jc;function Gc(o,i){var c=o.bitLength(),u,f=I(1),m;if(c<=0)return f;c<18?u=1:c<48?u=3:c<144?u=4:c<768?u=5:u=6,c<8?m=new jt(i):i.isEven()?m=new Gt(i):m=new qt(i);var w=new Array,v=3,O=u-1,G=(1<<u)-1;if(w[1]=m.convert(this),u>1){var lt=s();for(m.sqrTo(w[1],lt);v<=G;)w[v]=s(),m.mulTo(lt,w[v-2],w[v]),v+=2}var it=o.t-1,Et,qe=!0,mt=s(),gt;for(c=ht(o[it])-1;it>=0;){for(c>=O?Et=o[it]>>c-O&G:(Et=(o[it]&(1<<c+1)-1)<<O-c,it>0&&(Et|=o[it-1]>>this.DB+c-O)),v=u;!(Et&1);)Et>>=1,--v;if((c-=v)<0&&(c+=this.DB,--it),qe)w[Et].copyTo(f),qe=!1;else{for(;v>1;)m.sqrTo(f,mt),m.sqrTo(mt,f),v-=2;v>0?m.sqrTo(f,mt):(gt=f,f=mt,mt=gt),m.mulTo(mt,w[Et],f)}for(;it>=0&&!(o[it]&1<<c);)m.sqrTo(f,mt),gt=f,f=mt,mt=gt,--c<0&&(c=this.DB-1,--it)}return m.revert(f)}function Wc(o){var i=this.s<0?this.negate():this.clone(),c=o.s<0?o.negate():o.clone();if(i.compareTo(c)<0){var u=i;i=c,c=u}var f=i.getLowestSetBit(),m=c.getLowestSetBit();if(m<0)return i;for(f<m&&(m=f),m>0&&(i.rShiftTo(m,i),c.rShiftTo(m,c));i.signum()>0;)(f=i.getLowestSetBit())>0&&i.rShiftTo(f,i),(f=c.getLowestSetBit())>0&&c.rShiftTo(f,c),i.compareTo(c)>=0?(i.subTo(c,i),i.rShiftTo(1,i)):(c.subTo(i,c),c.rShiftTo(1,c));return m>0&&c.lShiftTo(m,c),c}function Zc(o){if(o<=0)return 0;var i=this.DV%o,c=this.s<0?o-1:0;if(this.t>0)if(i==0)c=this[0]%o;else for(var u=this.t-1;u>=0;--u)c=(i*c+this[u])%o;return c}function Hc(o){var i=o.isEven();if(this.isEven()&&i||o.signum()==0)return n.ZERO;for(var c=o.clone(),u=this.clone(),f=I(1),m=I(0),w=I(0),v=I(1);c.signum()!=0;){for(;c.isEven();)c.rShiftTo(1,c),i?((!f.isEven()||!m.isEven())&&(f.addTo(this,f),m.subTo(o,m)),f.rShiftTo(1,f)):m.isEven()||m.subTo(o,m),m.rShiftTo(1,m);for(;u.isEven();)u.rShiftTo(1,u),i?((!w.isEven()||!v.isEven())&&(w.addTo(this,w),v.subTo(o,v)),w.rShiftTo(1,w)):v.isEven()||v.subTo(o,v),v.rShiftTo(1,v);c.compareTo(u)>=0?(c.subTo(u,c),i&&f.subTo(w,f),m.subTo(v,m)):(u.subTo(c,u),i&&w.subTo(f,w),v.subTo(m,v))}if(u.compareTo(n.ONE)!=0)return n.ZERO;if(v.compareTo(o)>=0)return v.subtract(o);if(v.signum()<0)v.addTo(o,v);else return v;return v.signum()<0?v.add(o):v}var et=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Jc=(1<<26)/et[et.length-1];function Xc(o){var i,c=this.abs();if(c.t==1&&c[0]<=et[et.length-1]){for(i=0;i<et.length;++i)if(c[0]==et[i])return!0;return!1}if(c.isEven())return!1;for(i=1;i<et.length;){for(var u=et[i],f=i+1;f<et.length&&u<Jc;)u*=et[f++];for(u=c.modInt(u);i<f;)if(u%et[i++]==0)return!1}return c.millerRabin(o)}function Qc(o){var i=this.subtract(n.ONE),c=i.getLowestSetBit();if(c<=0)return!1;var u=i.shiftRight(c);o=o+1>>1,o>et.length&&(o=et.length);for(var f=s(),m=0;m<o;++m){f.fromInt(et[Math.floor(Math.random()*et.length)]);var w=f.modPow(u,this);if(w.compareTo(n.ONE)!=0&&w.compareTo(i)!=0){for(var v=1;v++<c&&w.compareTo(i)!=0;)if(w=w.modPowInt(2,this),w.compareTo(n.ONE)==0)return!1;if(w.compareTo(i)!=0)return!1}}return!0}n.prototype.chunkSize=Yi,n.prototype.toRadix=tc,n.prototype.fromRadix=ec,n.prototype.fromNumber=rc,n.prototype.bitwiseTo=cc,n.prototype.changeBit=xc,n.prototype.addTo=Cc,n.prototype.dMultiply=Oc,n.prototype.dAddOffset=Pc,n.prototype.multiplyLowerTo=Nc,n.prototype.multiplyUpperTo=Uc,n.prototype.modInt=Zc,n.prototype.millerRabin=Qc,n.prototype.clone=Hi,n.prototype.intValue=Ji,n.prototype.byteValue=Xi,n.prototype.shortValue=Qi,n.prototype.signum=Ki,n.prototype.toByteArray=nc,n.prototype.equals=sc,n.prototype.min=oc,n.prototype.max=ic,n.prototype.and=uc,n.prototype.or=lc,n.prototype.xor=pc,n.prototype.andNot=fc,n.prototype.not=hc,n.prototype.shiftLeft=dc,n.prototype.shiftRight=mc,n.prototype.getLowestSetBit=bc,n.prototype.bitCount=yc,n.prototype.testBit=vc,n.prototype.setBit=Tc,n.prototype.clearBit=Sc,n.prototype.flipBit=Ec,n.prototype.add=Ac,n.prototype.subtract=Bc,n.prototype.multiply=Ic,n.prototype.divide=Rc,n.prototype.remainder=Dc,n.prototype.divideAndRemainder=_c,n.prototype.modPow=Gc,n.prototype.modInverse=Hc,n.prototype.pow=kc,n.prototype.gcd=Wc,n.prototype.isProbablePrime=Xc,n.prototype.square=Mc,n.prototype.Barrett=Gt;var je,ot,q;function Yc(o){ot[q++]^=o&255,ot[q++]^=o>>8&255,ot[q++]^=o>>16&255,ot[q++]^=o>>24&255,q>=Ar&&(q-=Ar)}function us(){Yc(new Date().getTime())}if(ot==null){ot=new Array,q=0;var dt;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var ls=new Uint8Array(32);for(window.crypto.getRandomValues(ls),dt=0;dt<32;++dt)ot[q++]=ls[dt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var ps=window.crypto.random(32);for(dt=0;dt<ps.length;++dt)ot[q++]=ps.charCodeAt(dt)&255}}for(;q<Ar;)dt=Math.floor(65536*Math.random()),ot[q++]=dt>>>8,ot[q++]=dt&255;q=0,us()}function Kc(){if(je==null){for(us(),je=na(),je.init(ot),q=0;q<ot.length;++q)ot[q]=0;q=0}return je.next()}function ta(o){var i;for(i=0;i<o.length;++i)o[i]=Kc()}function Er(){}Er.prototype.nextBytes=ta;function Cr(){this.i=0,this.j=0,this.S=new Array}function ea(o){var i,c,u;for(i=0;i<256;++i)this.S[i]=i;for(c=0,i=0;i<256;++i)c=c+this.S[i]+o[i%o.length]&255,u=this.S[i],this.S[i]=this.S[c],this.S[c]=u;this.i=0,this.j=0}function ra(){var o;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,o=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=o,this.S[o+this.S[this.i]&255]}Cr.prototype.init=ea,Cr.prototype.next=ra;function na(){return new Cr}var Ar=256;typeof pr<"u"?pr=Wo.exports={default:n,BigInteger:n,SecureRandom:Er}:this.jsbn={BigInteger:n,SecureRandom:Er}}).call(pr)});var Ne=V(fr=>{(function(){"use strict";var r={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(l){return n(a(l),arguments)}function e(l,h){return t.apply(null,[l].concat(h||[]))}function n(l,h){var b=1,E=l.length,p,y="",x,g,d,B,R,A,I,L;for(x=0;x<E;x++)if(typeof l[x]=="string")y+=l[x];else if(typeof l[x]=="object"){if(d=l[x],d.keys)for(p=h[b],g=0;g<d.keys.length;g++){if(p==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',d.keys[g],d.keys[g-1]));p=p[d.keys[g]]}else d.param_no?p=h[d.param_no]:p=h[b++];if(r.not_type.test(d.type)&&r.not_primitive.test(d.type)&&p instanceof Function&&(p=p()),r.numeric_arg.test(d.type)&&typeof p!="number"&&isNaN(p))throw new TypeError(t("[sprintf] expecting number but found %T",p));switch(r.number.test(d.type)&&(I=p>=0),d.type){case"b":p=parseInt(p,10).toString(2);break;case"c":p=String.fromCharCode(parseInt(p,10));break;case"d":case"i":p=parseInt(p,10);break;case"j":p=JSON.stringify(p,null,d.width?parseInt(d.width):0);break;case"e":p=d.precision?parseFloat(p).toExponential(d.precision):parseFloat(p).toExponential();break;case"f":p=d.precision?parseFloat(p).toFixed(d.precision):parseFloat(p);break;case"g":p=d.precision?String(Number(p.toPrecision(d.precision))):parseFloat(p);break;case"o":p=(parseInt(p,10)>>>0).toString(8);break;case"s":p=String(p),p=d.precision?p.substring(0,d.precision):p;break;case"t":p=String(!!p),p=d.precision?p.substring(0,d.precision):p;break;case"T":p=Object.prototype.toString.call(p).slice(8,-1).toLowerCase(),p=d.precision?p.substring(0,d.precision):p;break;case"u":p=parseInt(p,10)>>>0;break;case"v":p=p.valueOf(),p=d.precision?p.substring(0,d.precision):p;break;case"x":p=(parseInt(p,10)>>>0).toString(16);break;case"X":p=(parseInt(p,10)>>>0).toString(16).toUpperCase();break}r.json.test(d.type)?y+=p:(r.number.test(d.type)&&(!I||d.sign)?(L=I?"+":"-",p=p.toString().replace(r.sign,"")):L="",R=d.pad_char?d.pad_char==="0"?"0":d.pad_char.charAt(1):" ",A=d.width-(L+p).length,B=d.width&&A>0?R.repeat(A):"",y+=d.align?L+p+B:R==="0"?L+B+p:B+L+p)}return y}var s=Object.create(null);function a(l){if(s[l])return s[l];for(var h=l,b,E=[],p=0;h;){if((b=r.text.exec(h))!==null)E.push(b[0]);else if((b=r.modulo.exec(h))!==null)E.push("%");else if((b=r.placeholder.exec(h))!==null){if(b[2]){p|=1;var y=[],x=b[2],g=[];if((g=r.key.exec(x))!==null)for(y.push(g[1]);(x=x.substring(g[0].length))!=="";)if((g=r.key_access.exec(x))!==null)y.push(g[1]);else if((g=r.index_access.exec(x))!==null)y.push(g[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");b[2]=y}else p|=2;if(p===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");E.push({placeholder:b[0],param_no:b[1],keys:b[2],sign:b[3],pad_char:b[4],align:b[5],width:b[6],precision:b[7],type:b[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");h=h.substring(b[0].length)}return s[l]=E}typeof fr<"u"&&(fr.sprintf=t,fr.vsprintf=e),typeof window<"u"&&(window.sprintf=t,window.vsprintf=e,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:e}}))})()});var Np={};ct(Np,{tcp:()=>kp});var Si=_(Ct("net"),1);var J=Ct("node:net");function pt(r){return!!(0,J.isIP)(r)}var _r={};ct(_r,{identity:()=>ma});function la(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var s=0;s<r.length;s++){var a=r.charAt(s),l=a.charCodeAt(0);if(e[l]!==255)throw new TypeError(a+" is ambiguous");e[l]=s}var h=r.length,b=r.charAt(0),E=Math.log(h)/Math.log(256),p=Math.log(256)/Math.log(h);function y(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var B=0,R=0,A=0,I=d.length;A!==I&&d[A]===0;)A++,B++;for(var L=(I-A)*p+1>>>0,j=new Uint8Array(L);A!==I;){for(var st=d[A],rt=0,tt=L-1;(st!==0||rt<R)&&tt!==-1;tt--,rt++)st+=256*j[tt]>>>0,j[tt]=st%h>>>0,st=st/h>>>0;if(st!==0)throw new Error("Non-zero carry");R=rt,A++}for(var nt=L-R;nt!==L&&j[nt]===0;)nt++;for(var ht=b.repeat(B);nt<L;++nt)ht+=r.charAt(j[nt]);return ht}function x(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var B=0;if(d[B]!==" "){for(var R=0,A=0;d[B]===b;)R++,B++;for(var I=(d.length-B)*E+1>>>0,L=new Uint8Array(I);d[B];){var j=e[d.charCodeAt(B)];if(j===255)return;for(var st=0,rt=I-1;(j!==0||st<A)&&rt!==-1;rt--,st++)j+=h*L[rt]>>>0,L[rt]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");A=st,B++}if(d[B]!==" "){for(var tt=I-A;tt!==I&&L[tt]===0;)tt++;for(var nt=new Uint8Array(R+(I-tt)),ht=R;tt!==I;)nt[ht++]=L[tt++];return nt}}}function g(d){var B=x(d);if(B)return B;throw new Error(`Non-${t} character`)}return{encode:y,decodeUnsafe:x,decode:g}}var pa=la,fa=pa,hs=fa;var Vp=new Uint8Array(0);var ds=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},ft=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var ms=r=>new TextEncoder().encode(r),gs=r=>new TextDecoder().decode(r);var Ir=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},Mr=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return ws(this,t)}},Rr=class{constructor(t){this.decoders=t}or(t){return ws(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},ws=(r,t)=>new Rr({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),Dr=class{constructor(t,e,n,s){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=s,this.encoder=new Ir(t,e,n),this.decoder=new Mr(t,e,s)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Kt=({name:r,prefix:t,encode:e,decode:n})=>new Dr(r,t,e,n),$t=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:s}=hs(e,t);return Kt({prefix:r,name:t,encode:n,decode:a=>ft(s(a))})},ha=(r,t,e,n)=>{let s={};for(let p=0;p<t.length;++p)s[t[p]]=p;let a=r.length;for(;r[a-1]==="=";)--a;let l=new Uint8Array(a*e/8|0),h=0,b=0,E=0;for(let p=0;p<a;++p){let y=s[r[p]];if(y===void 0)throw new SyntaxError(`Non-${n} character`);b=b<<e|y,h+=e,h>=8&&(h-=8,l[E++]=255&b>>h)}if(h>=e||255&b<<8-h)throw new SyntaxError("Unexpected end of data");return l},da=(r,t,e)=>{let n=t[t.length-1]==="=",s=(1<<e)-1,a="",l=0,h=0;for(let b=0;b<r.length;++b)for(h=h<<8|r[b],l+=8;l>e;)l-=e,a+=t[s&h>>l];if(l&&(a+=t[s&h<<e-l]),n)for(;a.length*e&7;)a+="=";return a},U=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>Kt({prefix:t,name:r,encode(s){return da(s,n,e)},decode(s){return ha(s,n,e,r)}});var ma=Kt({prefix:"\0",name:"identity",encode:r=>gs(r),decode:r=>ms(r)});var Or={};ct(Or,{base2:()=>ga});var ga=U({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Pr={};ct(Pr,{base8:()=>ba});var ba=U({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Fr={};ct(Fr,{base10:()=>wa});var wa=$t({prefix:"9",name:"base10",alphabet:"0123456789"});var $r={};ct($r,{base16:()=>ya,base16upper:()=>va});var ya=U({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),va=U({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var kr={};ct(kr,{base32:()=>W,base32hex:()=>Ea,base32hexpad:()=>Aa,base32hexpadupper:()=>Ba,base32hexupper:()=>Ca,base32pad:()=>Ta,base32padupper:()=>Sa,base32upper:()=>xa,base32z:()=>Ia});var W=U({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),xa=U({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ta=U({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Sa=U({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ea=U({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Ca=U({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Aa=U({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Ba=U({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ia=U({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Nr={};ct(Nr,{base36:()=>Ma,base36upper:()=>Ra});var Ma=$t({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ra=$t({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Ur={};ct(Ur,{base58btc:()=>P,base58flickr:()=>Da});var P=$t({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Da=$t({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Lr={};ct(Lr,{base64:()=>zr,base64pad:()=>_a,base64url:()=>Oa,base64urlpad:()=>Pa});var zr=U({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),_a=U({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Oa=U({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Pa=U({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Vr={};ct(Vr,{base256emoji:()=>Ua});var ys=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}"),Fa=ys.reduce((r,t,e)=>(r[e]=t,r),[]),$a=ys.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function ka(r){return r.reduce((t,e)=>(t+=Fa[e],t),"")}function Na(r){let t=[];for(let e of r){let n=$a[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var Ua=Kt({prefix:"\u{1F680}",name:"base256emoji",encode:ka,decode:Na});var Zr={};ct(Zr,{sha256:()=>su,sha512:()=>ou});var Wr=_(Ct("crypto"),1);var za=Ts,vs=128,La=127,Va=~La,ja=Math.pow(2,31);function Ts(r,t,e){t=t||[],e=e||0;for(var n=e;r>=ja;)t[e++]=r&255|vs,r/=128;for(;r&Va;)t[e++]=r&255|vs,r>>>=7;return t[e]=r|0,Ts.bytes=e-n+1,t}var qa=jr,Ga=128,xs=127;function jr(r,n){var e=0,n=n||0,s=0,a=n,l,h=r.length;do{if(a>=h)throw jr.bytes=0,new RangeError("Could not decode varint");l=r[a++],e+=s<28?(l&xs)<<s:(l&xs)*Math.pow(2,s),s+=7}while(l>=Ga);return jr.bytes=a-n,e}var Wa=Math.pow(2,7),Za=Math.pow(2,14),Ha=Math.pow(2,21),Ja=Math.pow(2,28),Xa=Math.pow(2,35),Qa=Math.pow(2,42),Ya=Math.pow(2,49),Ka=Math.pow(2,56),tu=Math.pow(2,63),eu=function(r){return r<Wa?1:r<Za?2:r<Ha?3:r<Ja?4:r<Xa?5:r<Qa?6:r<Ya?7:r<Ka?8:r<tu?9:10},ru={encode:za,decode:qa,encodingLength:eu},nu=ru,Te=nu;var Se=(r,t=0)=>[Te.decode(r,t),Te.decode.bytes],te=(r,t,e=0)=>(Te.encode(r,t,e),t),ee=r=>Te.encodingLength(r);var Wt=(r,t)=>{let e=t.byteLength,n=ee(r),s=n+ee(e),a=new Uint8Array(s+e);return te(r,a,0),te(e,a,n),a.set(t,s),new re(r,e,t,a)},kt=r=>{let t=ft(r),[e,n]=Se(t),[s,a]=Se(t.subarray(n)),l=t.subarray(n+a);if(l.byteLength!==s)throw new Error("Incorrect length");return new re(e,s,l,t)},Ss=(r,t)=>{if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&ds(r.bytes,e.bytes)}},re=class{constructor(t,e,n,s){this.code=t,this.size=e,this.digest=n,this.bytes=s}};var Gr=({name:r,code:t,encode:e})=>new qr(r,t,e),qr=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Wt(this.code,e):e.then(n=>Wt(this.code,n))}else throw Error("Unknown type, must be binary type")}};var su=Gr({name:"sha2-256",code:18,encode:r=>ft(Wr.default.createHash("sha256").update(r).digest())}),ou=Gr({name:"sha2-512",code:19,encode:r=>ft(Wr.default.createHash("sha512").update(r).digest())});var Hr={};ct(Hr,{identity:()=>au});var Cs=0,iu="identity",As=ft,cu=r=>Wt(Cs,As(r)),au={code:Cs,name:iu,encode:As,digest:cu};var pf=new TextEncoder,ff=new TextDecoder;var Bs=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return fu(e,Jr(r),t||P.encoder);default:return hu(e,Jr(r),t||W.encoder)}};var Is=new WeakMap,Jr=r=>{let t=Is.get(r);if(t==null){let e=new Map;return Is.set(r,e),e}return t},M=class{constructor(t,e,n,s){this.code=e,this.version=t,this.multihash=n,this.bytes=s,this["/"]=s}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:t,multihash:e}=this;if(t!==Ee)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==du)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return M.createV0(e)}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:t,digest:e}=this.multihash,n=Wt(t,e);return M.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(t){return M.equals(this,t)}static equals(t,e){let n=e;return n&&t.code===n.code&&t.version===n.version&&Ss(t.multihash,n.multihash)}toString(t){return Bs(this,t)}toJSON(){return{"/":Bs(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof M)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:s,multihash:a,bytes:l}=e;return new M(n,s,a,l||Ms(n,s,a.bytes))}else if(e[mu]===!0){let{version:n,multihash:s,code:a}=e,l=kt(s);return M.create(n,a,l)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==Ee)throw new Error(`Version 0 CID must use dag-pb (code: ${Ee}) block encoding`);return new M(t,e,n,n.bytes)}case 1:{let s=Ms(t,e,n.bytes);return new M(t,e,n,s)}default:throw new Error("Invalid version")}}static createV0(t){return M.create(0,Ee,t)}static createV1(t,e){return M.create(1,t,e)}static decode(t){let[e,n]=M.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=M.inspectBytes(t),n=e.size-e.multihashSize,s=ft(t.subarray(n,n+e.multihashSize));if(s.byteLength!==e.multihashSize)throw new Error("Incorrect length");let a=s.subarray(e.multihashSize-e.digestSize),l=new re(e.multihashCode,e.digestSize,a,s);return[e.version===0?M.createV0(l):M.createV1(e.codec,l),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[y,x]=Se(t.subarray(e));return e+=x,y},s=n(),a=Ee;if(s===18?(s=0,e=0):a=n(),s!==0&&s!==1)throw new RangeError(`Invalid CID version ${s}`);let l=e,h=n(),b=n(),E=e+b,p=E-l;return{version:s,codec:a,multihashCode:h,digestSize:b,multihashSize:p,size:E}}static parse(t,e){let[n,s]=pu(t,e),a=M.decode(s);if(a.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Jr(a).set(n,t),a}},pu=(r,t)=>{switch(r[0]){case"Q":{let e=t||P;return[P.prefix,e.decode(`${P.prefix}${r}`)]}case P.prefix:{let e=t||P;return[P.prefix,e.decode(r)]}case W.prefix:{let e=t||W;return[W.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},fu=(r,t,e)=>{let{prefix:n}=e;if(n!==P.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let s=t.get(n);if(s==null){let a=e.encode(r).slice(1);return t.set(n,a),a}else return s},hu=(r,t,e)=>{let{prefix:n}=e,s=t.get(n);if(s==null){let a=e.encode(r);return t.set(n,a),a}else return s},Ee=112,du=18,Ms=(r,t,e)=>{let n=ee(r),s=n+ee(t),a=new Uint8Array(s+e.byteLength);return te(r,a,0),te(t,a,n),a.set(e,s),a},mu=Symbol.for("@ipld/js-cid/CID");var At={..._r,...Or,...Pr,...Fr,...$r,...kr,...Nr,...Ur,...Lr,...Vr},Tf={...Zr,...Hr};function ne(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function He(r=0){return globalThis.Buffer?.allocUnsafe!=null?ne(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Ds(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Rs=Ds("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Xr=Ds("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=He(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),gu={utf8:Rs,"utf-8":Rs,hex:At.base16,latin1:Xr,ascii:Xr,binary:Xr,...At},Je=gu;function C(r,t="utf8"){let e=Je[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):e.encoder.encode(r).substring(1)}var _s=J.isIPv4,bu=J.isIPv6,Qr=function(r){let t=0;if(r=r.toString().trim(),_s(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(bu(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let a=_s(e[n]),l;a&&(l=Qr(e[n]),e[n]=C(l.slice(0,2),"base16")),l!=null&&++n<8&&e.splice(n,0,C(l.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let a=[n,1];for(n=9-e.length;n>0;n--)a.push("0");e.splice.apply(e,a)}let s=new Uint8Array(t+16);for(n=0;n<e.length;n++){let a=parseInt(e[n],16);s[t++]=a>>8&255,s[t++]=a&255}return s}throw new Error("invalid ip address")},Os=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let s=[];for(let a=0;a<e;a++)s.push(r[t+a]);return s.join(".")}if(e===16){let s=[];for(let a=0;a<e;a+=2)s.push(n.getUint16(t+a).toString(16));return s.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Ce={},Yr={},yu=[[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"]];yu.forEach(r=>{let t=vu(...r);Yr[t.code]=t,Ce[t.name]=t});function vu(r,t,e,n,s){return{code:r,size:t,name:e,resolvable:!!n,path:!!s}}function $(r){if(typeof r=="number"){if(Yr[r]!=null)return Yr[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Ce[r]!=null)return Ce[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var vt=_(yt(),1);function Bt(r,t="utf8"){let e=Je[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ne(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}function D(r,t){t==null&&(t=r.reduce((s,a)=>s+a.length,0));let e=He(t),n=0;for(let s of r)e.set(s,n),n+=s.length;return ne(e)}function Zs(r,t){switch($(r).code){case 4:case 41:return Fu(t);case 42:return Gs(t);case 6:case 273:case 33:case 132:return Js(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Gs(t);case 421:return Uu(t);case 444:return Ws(t);case 445:return Ws(t);case 466:return Nu(t);default:return C(t,"base16")}}function Hs(r,t){switch($(r).code){case 4:return js(t);case 41:return js(t);case 42:return qs(t);case 6:case 273:case 33:case 132:return rn(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return qs(t);case 421:return $u(t);case 444:return zu(t);case 445:return Lu(t);case 466:return ku(t);default:return Bt(t,"base16")}}var en=Object.values(At).map(r=>r.decoder),Pu=function(){let r=en[0].or(en[1]);return en.slice(2).forEach(t=>r=r.or(t)),r}();function js(r){if(!pt(r))throw new Error("invalid ip address");return Qr(r)}function Fu(r){let t=Os(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!pt(t))throw new Error("invalid ip address");return t}function rn(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function Js(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function qs(r){let t=Bt(r),e=Uint8Array.from(vt.default.encode(t.length));return D([e,t],e.length+t.length)}function Gs(r){let t=vt.default.decode(r);if(r=r.slice(vt.default.decode.bytes),r.length!==t)throw new Error("inconsistent lengths");return C(r)}function $u(r){let t;r[0]==="Q"||r[0]==="1"?t=kt(P.decode(`z${r}`)).bytes:t=M.parse(r).multihash.bytes;let e=Uint8Array.from(vt.default.encode(t.length));return D([e,t],e.length+t.length)}function ku(r){let t=Pu.decode(r),e=Uint8Array.from(vt.default.encode(t.length));return D([e,t],e.length+t.length)}function Nu(r){let t=vt.default.decode(r),e=r.slice(vt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return"u"+C(e,"base64url")}function Uu(r){let t=vt.default.decode(r),e=r.slice(vt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return C(e,"base58btc")}function zu(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=W.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=rn(n);return D([e,s],e.length+s.length)}function Lu(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=W.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=rn(n);return D([e,s],e.length+s.length)}function Ws(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=C(t,"base32"),s=Js(e);return`${n}:${s}`}var se=_(yt(),1);function Vu(r){let t=[],e=r.split("/").slice(1);if(e.length===1&&e[0]==="")return[];for(let n=0;n<e.length;n++){let s=e[n],a=$(s);if(a.size===0){t.push([s]);continue}if(n++,n>=e.length)throw Qs("invalid address: "+r);if(a.path===!0){t.push([s,an(e.slice(n).join("/"))]);break}t.push([s,e[n]])}return t}function ju(r){let t=[];return r.map(e=>{let n=Ye(e);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),an(t.join("/"))}function qu(r){return r.map(t=>{Array.isArray(t)||(t=[t]);let e=Ye(t);return t.length>1?[e.code,Hs(e.code,t[1])]:[e.code]})}function nn(r){return r.map(t=>{let e=Ye(t);return t[1]!=null?[e.code,Zs(e.code,t[1])]:[e.code]})}function sn(r){return Qe(D(r.map(t=>{let e=Ye(t),n=Uint8Array.from(se.default.encode(e.code));return t.length>1&&t[1]!=null&&(n=D([n,t[1]])),n})))}function on(r,t){return r.size>0?r.size/8:r.size===0?0:se.default.decode(t)+(se.default.decode.bytes??0)}function Xe(r){let t=[],e=0;for(;e<r.length;){let n=se.default.decode(r,e),s=se.default.decode.bytes??0,a=$(n),l=on(a,r.slice(e+s));if(l===0){t.push([n]),e+=s;continue}let h=r.slice(e+s,e+s+l);if(e+=l+s,e>r.length)throw Qs("Invalid address Uint8Array: "+C(r,"base16"));t.push([n,h])}return t}function cn(r){let t=Xe(r),e=nn(t);return ju(e)}function Gu(r){r=an(r);let t=Vu(r),e=qu(t);return sn(e)}function Xs(r){return Gu(r)}function Qe(r){let t=Wu(r);if(t!=null)throw t;return Uint8Array.from(r)}function Wu(r){try{Xe(r)}catch(t){return t}}function an(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function Qs(r){return new Error("Error parsing address: "+r)}function Ye(r){return $(r[0])}var ln=_(yt(),1);var eo=_(Ae(),1);function oe(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}var ie=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},un=function(r,t,e,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!s:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,e):s?s.value=e:t.set(r,e),e},Be,Ie,Me,to,Ju=Symbol.for("nodejs.util.inspect.custom"),Xu=[$("dns").code,$("dns4").code,$("dns6").code,$("dnsaddr").code],Qu=new Map,ro=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Yu(r){return!!r?.[ro]}var It=class{constructor(t){if(Be.set(this,void 0),Ie.set(this,void 0),Me.set(this,void 0),this[to]=!0,t==null&&(t=""),t instanceof Uint8Array)this.bytes=Qe(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);this.bytes=Xs(t)}else if(Yu(t))this.bytes=Qe(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return ie(this,Be,"f")==null&&un(this,Be,cn(this.bytes),"f"),ie(this,Be,"f")}toJSON(){return this.toString()}toOptions(){let t,e,n,s,a="",l=$("tcp"),h=$("udp"),b=$("ip4"),E=$("ip6"),p=$("dns6"),y=$("ip6zone");for(let[g,d]of this.stringTuples())g===y.code&&(a=`%${d??""}`),Xu.includes(g)&&(e=l.name,s=443,n=`${d??""}${a}`,t=g===p.code?6:4),(g===l.code||g===h.code)&&(e=$(g).name,s=parseInt(d??"")),(g===b.code||g===E.code)&&(e=$(g).name,n=`${d??""}${a}`,t=g===E.code?6:4);if(t==null||e==null||n==null||s==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:s}}protos(){return this.protoCodes().map(t=>Object.assign({},$(t)))}protoCodes(){let t=[],e=this.bytes,n=0;for(;n<e.length;){let s=ln.default.decode(e,n),a=ln.default.decode.bytes??0,l=$(s),h=on(l,e.slice(n+a));n+=h+a,t.push(s)}return t}protoNames(){return this.protos().map(t=>t.name)}tuples(){return ie(this,Ie,"f")==null&&un(this,Ie,Xe(this.bytes),"f"),ie(this,Ie,"f")}stringTuples(){return ie(this,Me,"f")==null&&un(this,Me,nn(this.tuples()),"f"),ie(this,Me,"f")}encapsulate(t){return t=new It(t),new It(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),s=n.lastIndexOf(e);if(s<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new It(n.slice(0,s))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new It(sn(e.slice(0,n)));return this}getPeerId(){try{let e=this.stringTuples().filter(n=>n[0]===Ce.ipfs.code).pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?C(P.decode(`z${n}`),"base58btc"):C(M.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let t=null;try{t=this.stringTuples().filter(e=>$(e[0]).path===!0)[0][1],t==null&&(t=null)}catch{t=null}return t}equals(t){return oe(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(a=>a.resolvable);if(e==null)return[this];let n=Qu.get(e.name);if(n==null)throw(0,eo.default)(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(a=>new It(a))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[(Be=new WeakMap,Ie=new WeakMap,Me=new WeakMap,to=ro,Ju)](){return`Multiaddr(${cn(this.bytes)})`}};function pn(r){return new It(r)}var Ku=T("dns4"),tl=T("dns6"),el=T("dnsaddr"),Zt=Z(T("dns"),el,Ku,tl),Ke=Z(T("ip4"),T("ip6")),zt=Z(S(Ke,T("tcp")),S(Zt,T("tcp"))),dn=S(Ke,T("udp")),rl=S(dn,T("utp")),nl=S(dn,T("quic")),De=Z(S(zt,T("ws")),S(Zt,T("ws"))),_e=Z(S(zt,T("wss")),S(Zt,T("wss")),S(zt,T("tls"),T("ws")),S(Zt,T("tls"),T("ws"))),fn=Z(S(zt,T("http")),S(Ke,T("http")),S(Zt,T("http"))),hn=Z(S(zt,T("https")),S(Ke,T("https")),S(Zt,T("https"))),no=S(dn,T("webrtc"),T("certhash")),oo=Z(S(no,T("p2p")),no),io=Z(S(De,T("p2p-webrtc-star"),T("p2p")),S(_e,T("p2p-webrtc-star"),T("p2p")),S(De,T("p2p-webrtc-star")),S(_e,T("p2p-webrtc-star"))),dh=Z(S(De,T("p2p-websocket-star"),T("p2p")),S(_e,T("p2p-websocket-star"),T("p2p")),S(De,T("p2p-websocket-star")),S(_e,T("p2p-websocket-star"))),co=Z(S(fn,T("p2p-webrtc-direct"),T("p2p")),S(hn,T("p2p-webrtc-direct"),T("p2p")),S(fn,T("p2p-webrtc-direct")),S(hn,T("p2p-webrtc-direct"))),Oe=Z(De,_e,fn,hn,io,co,zt,rl,nl,Zt,oo),mh=Z(S(Oe,T("p2p-stardust"),T("p2p")),S(Oe,T("p2p-stardust"))),Ut=Z(S(Oe,T("p2p")),io,co,oo,T("p2p")),so=Z(S(Ut,T("p2p-circuit"),Ut),S(Ut,T("p2p-circuit")),S(T("p2p-circuit"),Ut),S(Oe,T("p2p-circuit")),S(T("p2p-circuit"),Oe),T("p2p-circuit")),ao=()=>Z(S(so,ao),so),Re=ao(),gh=Z(S(Re,Ut,Re),S(Ut,Re),S(Re,Ut),Re,Ut);function uo(r){function t(e){let n;try{n=pn(e)}catch{return!1}let s=r(n.protoNames());return s===null?!1:s===!0||s===!1?s:s.length===0}return t}function S(...r){function t(e){if(e.length<r.length)return null;let n=e;return r.some(s=>(n=typeof s=="function"?s().partialMatch(e):s.partialMatch(e),Array.isArray(n)&&(e=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:uo(t),partialMatch:t}}function Z(...r){function t(n){let s=null;return r.some(a=>{let l=typeof a=="function"?a().partialMatch(n):a.partialMatch(n);return l!=null?(s=l,!0):!1}),s}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:uo(t),partialMatch:t}}function T(r){let t=r;function e(s){let a;try{a=pn(s)}catch{return!1}let l=a.protoNames();return l.length===1&&l[0]===t}function n(s){return s.length===0?null:s[0]===t?s.slice(1):null}return{toString:function(){return t},matches:e,partialMatch:n}}var xt=_(xo(),1);xt.default.formatters.b=r=>r==null?"undefined":P.baseEncode(r);xt.default.formatters.t=r=>r==null?"undefined":W.baseEncode(r);xt.default.formatters.m=r=>r==null?"undefined":zr.baseEncode(r);xt.default.formatters.p=r=>r==null?"undefined":r.toString();xt.default.formatters.c=r=>r==null?"undefined":r.toString();xt.default.formatters.k=r=>r==null?"undefined":r.toString();function Lt(r){return Object.assign((0,xt.default)(r),{error:(0,xt.default)(`${r}:error`),trace:(0,xt.default)(`${r}:trace`)})}var yi=_(Mo(),1);var Ro=J.isIPv4,_l=J.isIPv6,vn=function(r){let t=0;if(r=r.toString().trim(),Ro(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(_l(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let a=Ro(e[n]),l;a&&(l=vn(e[n]),e[n]=C(l.slice(0,2),"base16")),l!=null&&++n<8&&e.splice(n,0,C(l.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let a=[n,1];for(n=9-e.length;n>0;n--)a.push("0");e.splice.apply(e,a)}let s=new Uint8Array(t+16);for(n=0;n<e.length;n++){let a=parseInt(e[n],16);s[t++]=a>>8&255,s[t++]=a&255}return s}throw new Error("invalid ip address")},Do=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let s=[];for(let a=0;a<e;a++)s.push(r[t+a]);return s.join(".")}if(e===16){let s=[];for(let a=0;a<e;a+=2)s.push(n.getUint16(t+a).toString(16));return s.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Pe={},xn={},Pl=[[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"]];Pl.forEach(r=>{let t=Fl(...r);xn[t.code]=t,Pe[t.name]=t});function Fl(r,t,e,n,s){return{code:r,size:t,name:e,resolvable:!!n,path:!!s}}function k(r){if(typeof r=="number"){if(xn[r]!=null)return xn[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Pe[r]!=null)return Pe[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Tt=_(yt(),1);function $o(r,t){switch(k(r).code){case 4:case 41:return kl(t);case 42:return Po(t);case 6:case 273:case 33:case 132:return No(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Po(t);case 421:return Ll(t);case 444:return Fo(t);case 445:return Fo(t);case 466:return zl(t);default:return C(t,"base16")}}function ko(r,t){switch(k(r).code){case 4:return _o(t);case 41:return _o(t);case 42:return Oo(t);case 6:case 273:case 33:case 132:return Sn(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Oo(t);case 421:return Nl(t);case 444:return Vl(t);case 445:return jl(t);case 466:return Ul(t);default:return Bt(t,"base16")}}var Tn=Object.values(At).map(r=>r.decoder),$l=function(){let r=Tn[0].or(Tn[1]);return Tn.slice(2).forEach(t=>r=r.or(t)),r}();function _o(r){if(!pt(r))throw new Error("invalid ip address");return vn(r)}function kl(r){let t=Do(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!pt(t))throw new Error("invalid ip address");return t}function Sn(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function No(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Oo(r){let t=Bt(r),e=Uint8Array.from(Tt.default.encode(t.length));return D([e,t],e.length+t.length)}function Po(r){let t=Tt.default.decode(r);if(r=r.slice(Tt.default.decode.bytes),r.length!==t)throw new Error("inconsistent lengths");return C(r)}function Nl(r){let t;r[0]==="Q"||r[0]==="1"?t=kt(P.decode(`z${r}`)).bytes:t=M.parse(r).multihash.bytes;let e=Uint8Array.from(Tt.default.encode(t.length));return D([e,t],e.length+t.length)}function Ul(r){let t=$l.decode(r),e=Uint8Array.from(Tt.default.encode(t.length));return D([e,t],e.length+t.length)}function zl(r){let t=Tt.default.decode(r),e=r.slice(Tt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return"u"+C(e,"base64url")}function Ll(r){let t=Tt.default.decode(r),e=r.slice(Tt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return C(e,"base58btc")}function Vl(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=W.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=Sn(n);return D([e,s],e.length+s.length)}function jl(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=W.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=Sn(n);return D([e,s],e.length+s.length)}function Fo(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=C(t,"base32"),s=No(e);return`${n}:${s}`}var fe=_(yt(),1);function ql(r){let t=[],e=r.split("/").slice(1);if(e.length===1&&e[0]==="")return[];for(let n=0;n<e.length;n++){let s=e[n],a=k(s);if(a.size===0){t.push([s]);continue}if(n++,n>=e.length)throw zo("invalid address: "+r);if(a.path===!0){t.push([s,In(e.slice(n).join("/"))]);break}t.push([s,e[n]])}return t}function Gl(r){let t=[];return r.map(e=>{let n=cr(e);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),In(t.join("/"))}function Wl(r){return r.map(t=>{Array.isArray(t)||(t=[t]);let e=cr(t);return t.length>1?[e.code,ko(e.code,t[1])]:[e.code]})}function En(r){return r.map(t=>{let e=cr(t);return t[1]!=null?[e.code,$o(e.code,t[1])]:[e.code]})}function Cn(r){return ir(D(r.map(t=>{let e=cr(t),n=Uint8Array.from(fe.default.encode(e.code));return t.length>1&&t[1]!=null&&(n=D([n,t[1]])),n})))}function An(r,t){return r.size>0?r.size/8:r.size===0?0:fe.default.decode(t)+(fe.default.decode.bytes??0)}function or(r){let t=[],e=0;for(;e<r.length;){let n=fe.default.decode(r,e),s=fe.default.decode.bytes??0,a=k(n),l=An(a,r.slice(e+s));if(l===0){t.push([n]),e+=s;continue}let h=r.slice(e+s,e+s+l);if(e+=l+s,e>r.length)throw zo("Invalid address Uint8Array: "+C(r,"base16"));t.push([n,h])}return t}function Bn(r){let t=or(r),e=En(t);return Gl(e)}function Zl(r){r=In(r);let t=ql(r),e=Wl(t);return Cn(e)}function Uo(r){return Zl(r)}function ir(r){let t=Hl(r);if(t!=null)throw t;return Uint8Array.from(r)}function Hl(r){try{or(r)}catch(t){return t}}function In(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function zo(r){return new Error("Error parsing address: "+r)}function cr(r){return k(r[0])}var Rn=_(yt(),1);var Vo=_(Ae(),1);var he=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},Mn=function(r,t,e,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!s:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,e):s?s.value=e:t.set(r,e),e},Fe,$e,ke,Lo,Xl=Symbol.for("nodejs.util.inspect.custom"),Ql=[k("dns").code,k("dns4").code,k("dns6").code,k("dnsaddr").code],Yl=new Map,jo=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Kl(r){return!!r?.[jo]}var Mt=class{constructor(t){if(Fe.set(this,void 0),$e.set(this,void 0),ke.set(this,void 0),this[Lo]=!0,t==null&&(t=""),t instanceof Uint8Array)this.bytes=ir(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);this.bytes=Uo(t)}else if(Kl(t))this.bytes=ir(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return he(this,Fe,"f")==null&&Mn(this,Fe,Bn(this.bytes),"f"),he(this,Fe,"f")}toJSON(){return this.toString()}toOptions(){let t,e,n,s,a="",l=k("tcp"),h=k("udp"),b=k("ip4"),E=k("ip6"),p=k("dns6"),y=k("ip6zone");for(let[g,d]of this.stringTuples())g===y.code&&(a=`%${d??""}`),Ql.includes(g)&&(e=l.name,s=443,n=`${d??""}${a}`,t=g===p.code?6:4),(g===l.code||g===h.code)&&(e=k(g).name,s=parseInt(d??"")),(g===b.code||g===E.code)&&(e=k(g).name,n=`${d??""}${a}`,t=g===E.code?6:4);if(t==null||e==null||n==null||s==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:s}}protos(){return this.protoCodes().map(t=>Object.assign({},k(t)))}protoCodes(){let t=[],e=this.bytes,n=0;for(;n<e.length;){let s=Rn.default.decode(e,n),a=Rn.default.decode.bytes??0,l=k(s),h=An(l,e.slice(n+a));n+=h+a,t.push(s)}return t}protoNames(){return this.protos().map(t=>t.name)}tuples(){return he(this,$e,"f")==null&&Mn(this,$e,or(this.bytes),"f"),he(this,$e,"f")}stringTuples(){return he(this,ke,"f")==null&&Mn(this,ke,En(this.tuples()),"f"),he(this,ke,"f")}encapsulate(t){return t=new Mt(t),new Mt(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),s=n.lastIndexOf(e);if(s<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new Mt(n.slice(0,s))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new Mt(Cn(e.slice(0,n)));return this}getPeerId(){try{let e=this.stringTuples().filter(n=>n[0]===Pe.ipfs.code).pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?C(P.decode(`z${n}`),"base58btc"):C(M.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let t=null;try{t=this.stringTuples().filter(e=>k(e[0]).path===!0)[0][1],t==null&&(t=null)}catch{t=null}return t}equals(t){return oe(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(a=>a.resolvable);if(e==null)return[this];let n=Yl.get(e.name);if(n==null)throw(0,Vo.default)(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(a=>new Mt(a))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[(Fe=new WeakMap,$e=new WeakMap,ke=new WeakMap,Lo=jo,Xl)](){return`Multiaddr(${Bn(this.bytes)})`}};function ar(r){return new Mt(r)}var gr=_(Ae(),1);function ur(r){return this.subnetMask<r.subnetMask?!1:this.mask(r.subnetMask)===r.mask()}function lr(r){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===r&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}var de=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,Dn=/\/\d{1,2}$/;var Q=class extends Error{constructor(t,e){super(t),this.name="AddressError",e!==null&&(this.parseMessage=e)}};var me=_(_n(),1),Jt=_(Ne(),1),F=class{constructor(t){this.groups=4,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=lr(32),this.isInSubnet=ur,this.address=t;let e=Dn.exec(t);if(e){if(this.parsedSubnet=e[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>32)throw new Q("Invalid subnet mask.");t=t.replace(Dn,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}static isValid(t){try{return new F(t),!0}catch{return!1}}parse(t){let e=t.split(".");if(!t.match(de))throw new Q("Invalid IPv4 address.");return e}correctForm(){return this.parsedAddress.map(t=>parseInt(t,10)).join(".")}static fromHex(t){let e=t.replace(/:/g,"").padStart(8,"0"),n=[],s;for(s=0;s<8;s+=2){let a=e.slice(s,s+2);n.push(parseInt(a,16))}return new F(n.join("."))}static fromInteger(t){return F.fromHex(t.toString(16))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new F(n)}toHex(){return this.parsedAddress.map(t=>(0,Jt.sprintf)("%02x",parseInt(t,10))).join(":")}toArray(){return this.parsedAddress.map(t=>parseInt(t,10))}toGroup6(){let t=[],e;for(e=0;e<4;e+=2){let n=(0,Jt.sprintf)("%02x%02x",parseInt(this.parsedAddress[e],10),parseInt(this.parsedAddress[e+1],10));t.push((0,Jt.sprintf)("%x",parseInt(n,16)))}return t.join(":")}bigInteger(){return new me.BigInteger(this.parsedAddress.map(t=>(0,Jt.sprintf)("%02x",parseInt(t,10))).join(""),16)}_startAddress(){return new me.BigInteger(this.mask()+"0".repeat(32-this.subnetMask),2)}startAddress(){return F.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new me.BigInteger("1");return F.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new me.BigInteger(this.mask()+"1".repeat(32-this.subnetMask),2)}endAddress(){return F.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new me.BigInteger("1");return F.fromBigInteger(this._endAddress().subtract(t))}static fromBigInteger(t){return F.fromInteger(parseInt(t.toString(),10))}mask(t){return t===void 0&&(t=this.subnetMask),this.getBitsBase2(0,t)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}reverseForm(t){t||(t={});let e=this.correctForm().split(".").reverse().join(".");return t.omitSuffix?e:(0,Jt.sprintf)("%s.in-addr.arpa.",e)}isMulticast(){return this.isInSubnet(new F("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(32,"0")}groupForV6(){let t=this.parsedAddress;return this.address.replace(de,(0,Jt.sprintf)('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',t.slice(0,2).join("."),t.slice(2,4).join(".")))}};var Ho={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},On={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},Pn=/([^0-9a-f:/%])/gi,Fn=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,$n=/\/\d{1,3}(?=%|$)/,kn=/%.*$/,Jo=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),Xo=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/);var Yo=_(Ne(),1);function tp(r){return r.replace(/^(0+)/,'<span class="zero">$1</span>')}function hr(r,t=0){return r.split(":").map((n,s)=>/group-v4/.test(n)?n:(0,Yo.sprintf)('<span class="hover-group group-%d">%s</span>',s+t,tp(n)))}var Qt=_(Ne(),1);function Un(r){return(0,Qt.sprintf)("(%s)",r.join("|"))}function Nn(r){return r.length<4?(0,Qt.sprintf)("0{0,%d}%s",4-r.length,r):r}var zn="[^A-Fa-f0-9:]";function dr(r){let t=[];r.forEach((n,s)=>{parseInt(n,16)===0&&t.push(s)});let e=t.map(n=>r.map((s,a)=>{if(a===n){let l=a===0||a===8-1?":":"";return Un([Nn(s),l])}return Nn(s)}).join(":"));return e.push(r.map(Nn).join(":")),Un(e)}function Ln(r,t,e){let n=t?"":":",s=e?"":":",a=[];!t&&!e&&a.push("::"),t&&e&&a.push(""),(e&&!t||!e&&t)&&a.push(":"),a.push((0,Qt.sprintf)("%s(:0{1,4}){1,%d}",n,r-1)),a.push((0,Qt.sprintf)("(0{1,4}:){1,%d}%s",r-1,s)),a.push((0,Qt.sprintf)("(0{1,4}:){%d}0{1,4}",r-1));for(let l=1;l<r-1;l++)for(let h=1;h<r-l;h++)a.push((0,Qt.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",h,r-h-l-1));return Un(a)}var Y=_(_n(),1),K=_(Ne(),1);function mr(r){if(!r)throw new Error("Assertion failed.")}function ep(r){let t=/(\d+)(\d{3})/;for(;t.test(r);)r=r.replace(t,"$1,$2");return r}function rp(r){return r=r.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),r=r.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),r}function np(r,t){let e=[],n=[],s;for(s=0;s<r.length;s++)s<t[0]?e.push(r[s]):s>t[1]&&n.push(r[s]);return e.concat(["compact"]).concat(n)}function ti(r){return(0,K.sprintf)("%04x",parseInt(r,16))}function ei(r){return r&255}var z=class{constructor(t,e){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=ur,this.isCorrect=lr(128),e===void 0?this.groups=8:this.groups=e,this.address=t;let n=$n.exec(t);if(n){if(this.parsedSubnet=n[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>128)throw new Q("Invalid subnet mask.");t=t.replace($n,"")}else if(/\//.test(t))throw new Q("Invalid subnet mask.");let s=kn.exec(t);s&&(this.zone=s[0],t=t.replace(kn,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new z(t),!0}catch{return!1}}static fromBigInteger(t){let e=t.toString(16).padStart(32,"0"),n=[],s;for(s=0;s<8;s++)n.push(e.slice(s*4,(s+1)*4));return new z(n.join(":"))}static fromURL(t){let e,n=null,s;if(t.indexOf("[")!==-1&&t.indexOf("]:")!==-1){if(s=Xo.exec(t),s===null)return{error:"failed to parse address with port",address:null,port:null};e=s[1],n=s[2]}else if(t.indexOf("/")!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,""),s=Jo.exec(t),s===null)return{error:"failed to parse address from URL",address:null,port:null};e=s[1]}else e=t;return n?(n=parseInt(n,10),(n<0||n>65536)&&(n=null)):n=null,{address:new z(e),port:n}}static fromAddress4(t){let e=new F(t),n=128-(32-e.subnetMask);return new z(`::ffff:${e.correctForm()}/${n}`)}static fromArpa(t){let e=t.replace(/(\.ip6\.arpa)?\.$/,""),n=7;if(e.length!==63)throw new Q("Invalid 'ip6.arpa' form.");let s=e.split(".").reverse();for(let a=n;a>0;a--){let l=a*4;s.splice(l,0,":")}return e=s.join(""),new z(e)}microsoftTranscription(){return(0,K.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(t=this.subnetMask){return this.getBitsBase2(0,t)}possibleSubnets(t=128){let e=128-this.subnetMask,n=Math.abs(t-128),s=e-n;return s<0?"0":ep(new Y.BigInteger("2",10).pow(s).toString(10))}_startAddress(){return new Y.BigInteger(this.mask()+"0".repeat(128-this.subnetMask),2)}startAddress(){return z.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new Y.BigInteger("1");return z.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new Y.BigInteger(this.mask()+"1".repeat(128-this.subnetMask),2)}endAddress(){return z.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new Y.BigInteger("1");return z.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=Ho[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&t!=="Link local"&&(t="Global"),t||"Unknown"}getType(){for(let t of Object.keys(On))if(this.isInSubnet(new z(t)))return On[t];return"Global unicast"}getBits(t,e){return new Y.BigInteger(this.getBitsBase2(t,e),2)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}getBitsBase16(t,e){let n=e-t;if(n%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(t,e).toString(16).padStart(n/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,128)}reverseForm(t){t||(t={});let e=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,"").split("").slice(0,e).reverse().join(".");return e>0?t.omitSuffix?n:(0,K.sprintf)("%s.ip6.arpa.",n):t.omitSuffix?"":"ip6.arpa."}correctForm(){let t,e=[],n=0,s=[];for(t=0;t<this.parsedAddress.length;t++){let h=parseInt(this.parsedAddress[t],16);h===0&&n++,h!==0&&n>0&&(n>1&&s.push([t-n,t-1]),n=0)}n>1&&s.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let a=s.map(h=>h[1]-h[0]+1);if(s.length>0){let h=a.indexOf(Math.max(...a));e=np(this.parsedAddress,s[h])}else e=this.parsedAddress;for(t=0;t<e.length;t++)e[t]!=="compact"&&(e[t]=parseInt(e[t],16).toString(16));let l=e.join(":");return l=l.replace(/^compact$/,"::"),l=l.replace(/^compact|compact$/,":"),l=l.replace(/compact/,""),l}binaryZeroPad(){return this.bigInteger().toString(2).padStart(128,"0")}parse4in6(t){let e=t.split(":"),s=e.slice(-1)[0].match(de);if(s){this.parsedAddress4=s[0],this.address4=new F(this.parsedAddress4);for(let a=0;a<this.address4.groups;a++)if(/^0[0-9]+/.test(this.address4.parsedAddress[a]))throw new Q("IPv4 addresses can't have leading zeroes.",t.replace(de,this.address4.parsedAddress.map(rp).join(".")));this.v4=!0,e[e.length-1]=this.address4.toGroup6(),t=e.join(":")}return t}parse(t){t=this.parse4in6(t);let e=t.match(Pn);if(e)throw new Q((0,K.sprintf)("Bad character%s detected in address: %s",e.length>1?"s":"",e.join("")),t.replace(Pn,'<span class="parse-error">$1</span>'));let n=t.match(Fn);if(n)throw new Q((0,K.sprintf)("Address failed regex: %s",n.join("")),t.replace(Fn,'<span class="parse-error">$1</span>'));let s=[],a=t.split("::");if(a.length===2){let l=a[0].split(":"),h=a[1].split(":");l.length===1&&l[0]===""&&(l=[]),h.length===1&&h[0]===""&&(h=[]);let b=this.groups-(l.length+h.length);if(!b)throw new Q("Error parsing groups");this.elidedGroups=b,this.elisionBegin=l.length,this.elisionEnd=l.length+this.elidedGroups,s=s.concat(l);for(let E=0;E<b;E++)s.push("0");s=s.concat(h)}else if(a.length===1)s=t.split(":"),this.elidedGroups=0;else throw new Q("Too many :: groups found");if(s=s.map(l=>(0,K.sprintf)("%x",parseInt(l,16))),s.length!==this.groups)throw new Q("Incorrect number of groups found");return s}canonicalForm(){return this.parsedAddress.map(ti).join(":")}decimal(){return this.parsedAddress.map(t=>(0,K.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new Y.BigInteger(this.parsedAddress.map(ti).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return F.fromHex(new Y.BigInteger(t.slice(96,128).join(""),2).toString(16))}to4in6(){let t=this.to4(),n=new z(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),s="";return/:$/.test(n)||(s=":"),n+s+t.address}inspectTeredo(){let t=this.getBitsBase16(0,32),e=this.getBits(80,96).xor(new Y.BigInteger("ffff",16)).toString(),n=F.fromHex(this.getBitsBase16(32,64)),s=F.fromHex(this.getBits(96,128).xor(new Y.BigInteger("ffffffff",16)).toString(16)),a=this.getBits(64,80),l=this.getBitsBase2(64,80),h=a.testBit(15),b=a.testBit(14),E=a.testBit(8),p=a.testBit(9),y=new Y.BigInteger(l.slice(2,6)+l.slice(8,16),2).toString(10);return{prefix:(0,K.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:s.address,flags:l,coneNat:h,microsoft:{reserved:b,universalLocal:p,groupIndividual:E,nonce:y},udpPort:e}}inspect6to4(){let t=this.getBitsBase16(0,16),e=F.fromHex(this.getBitsBase16(16,48));return{prefix:(0,K.sprintf)("%s",t.slice(0,4)),gateway:e.address}}to6to4(){if(!this.is4())return null;let t=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new z(t)}toByteArray(){let t=this.bigInteger().toByteArray();return t.length===17&&t[0]===0?t.slice(1):t}toUnsignedByteArray(){return this.toByteArray().map(ei)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(ei))}static fromUnsignedByteArray(t){let e=new Y.BigInteger("256",10),n=new Y.BigInteger("0",10),s=new Y.BigInteger("1",10);for(let a=t.length-1;a>=0;a--)n=n.add(s.multiply(new Y.BigInteger(t[a].toString(10),10))),s=s.multiply(e);return z.fromBigInteger(n)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new z("2001::/32"))}is6to4(){return this.isInSubnet(new z("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(t){return t===void 0?t="":t=(0,K.sprintf)(":%s",t),(0,K.sprintf)("http://[%s]%s/",this.correctForm(),t)}link(t){t||(t={}),t.className===void 0&&(t.className=""),t.prefix===void 0&&(t.prefix="/#address="),t.v4===void 0&&(t.v4=!1);let e=this.correctForm;return t.v4&&(e=this.to4in6),t.className?(0,K.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,e.call(this),t.className):(0,K.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,e.call(this))}group(){if(this.elidedGroups===0)return hr(this.address).join(":");mr(typeof this.elidedGroups=="number"),mr(typeof this.elisionBegin=="number");let t=[],[e,n]=this.address.split("::");e.length?t.push(...hr(e)):t.push("");let s=["hover-group"];for(let a=this.elisionBegin;a<this.elisionBegin+this.elidedGroups;a++)s.push((0,K.sprintf)("group-%d",a));return t.push((0,K.sprintf)('<span class="%s"></span>',s.join(" "))),n.length?t.push(...hr(n,this.elisionEnd)):t.push(""),this.is4()&&(mr(this.address4 instanceof F),t.pop(),t.push(this.address4.groupForV6())),t.join(":")}regularExpressionString(t=!1){let e=[],n=new z(this.correctForm());if(n.elidedGroups===0)e.push(dr(n.parsedAddress));else if(n.elidedGroups===8)e.push(Ln(8));else{let s=n.address.split("::");s[0].length&&e.push(dr(s[0].split(":"))),mr(typeof n.elidedGroups=="number"),e.push(Ln(n.elidedGroups,s[0].length!==0,s[1].length!==0)),s[1].length&&e.push(dr(s[1].split(":"))),e=[e.join(":")]}return t||(e=["(?=^|",zn,"|[^\\w\\:])(",...e,")(?=[^\\w\\:]|",zn,"|$)"]),e.join("")}regularExpression(t=!1){return new RegExp(this.regularExpressionString(t),"i")}};var sp=Lt("libp2p:ip-port-to-multiaddr"),Vn={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function ri(r,t){if(typeof r!="string")throw(0,gr.default)(new Error(`invalid ip provided: ${r}`),Vn.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw(0,gr.default)(new Error(`invalid port provided: ${t}`),Vn.ERR_INVALID_PORT_PARAMETER);try{return new F(r),ar(`/ip4/${r}/tcp/${t}`)}catch{}try{let e=new z(r);return e.is4()?ar(`/ip4/${e.to4().correctForm()}/tcp/${t}`):ar(`/ip6/${r}/tcp/${t}`)}catch{let n=`invalid ip:port for creating a multiaddr: ${r}:${t}`;throw sp.error(n),(0,gr.default)(new Error(n),Vn.ERR_INVALID_IP)}}var ni=J.isIPv4,op=J.isIPv6,jn=function(r){let t=0;if(r=r.toString().trim(),ni(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(op(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let a=ni(e[n]),l;a&&(l=jn(e[n]),e[n]=C(l.slice(0,2),"base16")),l!=null&&++n<8&&e.splice(n,0,C(l.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let a=[n,1];for(n=9-e.length;n>0;n--)a.push("0");e.splice.apply(e,a)}let s=new Uint8Array(t+16);for(n=0;n<e.length;n++){let a=parseInt(e[n],16);s[t++]=a>>8&255,s[t++]=a&255}return s}throw new Error("invalid ip address")},si=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let s=[];for(let a=0;a<e;a++)s.push(r[t+a]);return s.join(".")}if(e===16){let s=[];for(let a=0;a<e;a+=2)s.push(n.getUint16(t+a).toString(16));return s.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Ue={},qn={},cp=[[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"]];cp.forEach(r=>{let t=ap(...r);qn[t.code]=t,Ue[t.name]=t});function ap(r,t,e,n,s){return{code:r,size:t,name:e,resolvable:!!n,path:!!s}}function N(r){if(typeof r=="number"){if(qn[r]!=null)return qn[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Ue[r]!=null)return Ue[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var St=_(yt(),1);function ui(r,t){switch(N(r).code){case 4:case 41:return lp(t);case 42:return ci(t);case 6:case 273:case 33:case 132:return pi(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ci(t);case 421:return dp(t);case 444:return ai(t);case 445:return ai(t);case 466:return hp(t);default:return C(t,"base16")}}function li(r,t){switch(N(r).code){case 4:return oi(t);case 41:return oi(t);case 42:return ii(t);case 6:case 273:case 33:case 132:return Wn(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return ii(t);case 421:return pp(t);case 444:return mp(t);case 445:return gp(t);case 466:return fp(t);default:return Bt(t,"base16")}}var Gn=Object.values(At).map(r=>r.decoder),up=function(){let r=Gn[0].or(Gn[1]);return Gn.slice(2).forEach(t=>r=r.or(t)),r}();function oi(r){if(!pt(r))throw new Error("invalid ip address");return jn(r)}function lp(r){let t=si(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!pt(t))throw new Error("invalid ip address");return t}function Wn(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function pi(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function ii(r){let t=Bt(r),e=Uint8Array.from(St.default.encode(t.length));return D([e,t],e.length+t.length)}function ci(r){let t=St.default.decode(r);if(r=r.slice(St.default.decode.bytes),r.length!==t)throw new Error("inconsistent lengths");return C(r)}function pp(r){let t;r[0]==="Q"||r[0]==="1"?t=kt(P.decode(`z${r}`)).bytes:t=M.parse(r).multihash.bytes;let e=Uint8Array.from(St.default.encode(t.length));return D([e,t],e.length+t.length)}function fp(r){let t=up.decode(r),e=Uint8Array.from(St.default.encode(t.length));return D([e,t],e.length+t.length)}function hp(r){let t=St.default.decode(r),e=r.slice(St.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return"u"+C(e,"base64url")}function dp(r){let t=St.default.decode(r),e=r.slice(St.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return C(e,"base58btc")}function mp(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=W.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=Wn(n);return D([e,s],e.length+s.length)}function gp(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=W.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let s=Wn(n);return D([e,s],e.length+s.length)}function ai(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=C(t,"base32"),s=pi(e);return`${n}:${s}`}var be=_(yt(),1);function bp(r){let t=[],e=r.split("/").slice(1);if(e.length===1&&e[0]==="")return[];for(let n=0;n<e.length;n++){let s=e[n],a=N(s);if(a.size===0){t.push([s]);continue}if(n++,n>=e.length)throw hi("invalid address: "+r);if(a.path===!0){t.push([s,Qn(e.slice(n).join("/"))]);break}t.push([s,e[n]])}return t}function wp(r){let t=[];return r.map(e=>{let n=yr(e);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),Qn(t.join("/"))}function yp(r){return r.map(t=>{Array.isArray(t)||(t=[t]);let e=yr(t);return t.length>1?[e.code,li(e.code,t[1])]:[e.code]})}function Zn(r){return r.map(t=>{let e=yr(t);return t[1]!=null?[e.code,ui(e.code,t[1])]:[e.code]})}function Hn(r){return wr(D(r.map(t=>{let e=yr(t),n=Uint8Array.from(be.default.encode(e.code));return t.length>1&&t[1]!=null&&(n=D([n,t[1]])),n})))}function Jn(r,t){return r.size>0?r.size/8:r.size===0?0:be.default.decode(t)+(be.default.decode.bytes??0)}function br(r){let t=[],e=0;for(;e<r.length;){let n=be.default.decode(r,e),s=be.default.decode.bytes??0,a=N(n),l=Jn(a,r.slice(e+s));if(l===0){t.push([n]),e+=s;continue}let h=r.slice(e+s,e+s+l);if(e+=l+s,e>r.length)throw hi("Invalid address Uint8Array: "+C(r,"base16"));t.push([n,h])}return t}function Xn(r){let t=br(r),e=Zn(t);return wp(e)}function vp(r){r=Qn(r);let t=bp(r),e=yp(t);return Hn(e)}function fi(r){return vp(r)}function wr(r){let t=xp(r);if(t!=null)throw t;return Uint8Array.from(r)}function xp(r){try{br(r)}catch(t){return t}}function Qn(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function hi(r){return new Error("Error parsing address: "+r)}function yr(r){return N(r[0])}var Kn=_(yt(),1);var mi=_(Ae(),1);var we=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},Yn=function(r,t,e,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!s:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,e):s?s.value=e:t.set(r,e),e},ze,Le,Ve,di,Sp=Symbol.for("nodejs.util.inspect.custom"),Ep=[N("dns").code,N("dns4").code,N("dns6").code,N("dnsaddr").code],Cp=new Map,gi=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Ap(r){return!!r?.[gi]}var Dt=class{constructor(t){if(ze.set(this,void 0),Le.set(this,void 0),Ve.set(this,void 0),this[di]=!0,t==null&&(t=""),t instanceof Uint8Array)this.bytes=wr(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);this.bytes=fi(t)}else if(Ap(t))this.bytes=wr(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return we(this,ze,"f")==null&&Yn(this,ze,Xn(this.bytes),"f"),we(this,ze,"f")}toJSON(){return this.toString()}toOptions(){let t,e,n,s,a="",l=N("tcp"),h=N("udp"),b=N("ip4"),E=N("ip6"),p=N("dns6"),y=N("ip6zone");for(let[g,d]of this.stringTuples())g===y.code&&(a=`%${d??""}`),Ep.includes(g)&&(e=l.name,s=443,n=`${d??""}${a}`,t=g===p.code?6:4),(g===l.code||g===h.code)&&(e=N(g).name,s=parseInt(d??"")),(g===b.code||g===E.code)&&(e=N(g).name,n=`${d??""}${a}`,t=g===E.code?6:4);if(t==null||e==null||n==null||s==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:s}}protos(){return this.protoCodes().map(t=>Object.assign({},N(t)))}protoCodes(){let t=[],e=this.bytes,n=0;for(;n<e.length;){let s=Kn.default.decode(e,n),a=Kn.default.decode.bytes??0,l=N(s),h=Jn(l,e.slice(n+a));n+=h+a,t.push(s)}return t}protoNames(){return this.protos().map(t=>t.name)}tuples(){return we(this,Le,"f")==null&&Yn(this,Le,br(this.bytes),"f"),we(this,Le,"f")}stringTuples(){return we(this,Ve,"f")==null&&Yn(this,Ve,Zn(this.tuples()),"f"),we(this,Ve,"f")}encapsulate(t){return t=new Dt(t),new Dt(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),s=n.lastIndexOf(e);if(s<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new Dt(n.slice(0,s))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new Dt(Hn(e.slice(0,n)));return this}getPeerId(){try{let e=this.stringTuples().filter(n=>n[0]===Ue.ipfs.code).pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?C(P.decode(`z${n}`),"base58btc"):C(M.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let t=null;try{t=this.stringTuples().filter(e=>N(e[0]).path===!0)[0][1],t==null&&(t=null)}catch{t=null}return t}equals(t){return oe(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(a=>a.resolvable);if(e==null)return[this];let n=Cp.get(e.name);if(n==null)throw(0,mi.default)(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(a=>new Dt(a))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[(ze=new WeakMap,Le=new WeakMap,Ve=new WeakMap,di=gi,Sp)](){return`Multiaddr(${Xn(this.bytes)})`}};function bi(r){return new Dt(r)}var ts=_(Ct("os"),1),wi=_(Ct("path"),1),Bp={ip4:"IPv4",ip6:"IPv6"};function ye(r){let t=r.getPath();return t!=null?ts.default.platform()==="win32"?{path:wi.default.join("\\\\.\\pipe\\",t)}:{path:t}:r.toOptions()}function es(r,t,e){let n=s=>bi(`/${r}/${s}/tcp/${e}`);return(Ip(t)?Rp(Bp[r]):[t]).map(n)}function Ip(r){return["0.0.0.0","::"].includes(r)}var Mp=ts.default.networkInterfaces();function Rp(r){let t=[];for(let[,e]of Object.entries(Mp))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var _t=class extends Error{constructor(t="The operation was aborted"){super(t),this.code=_t.code,this.type=_t.type}static get code(){return"ABORT_ERR"}static get type(){return"aborted"}},Vt=class extends Error{constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};var wt=Lt("libp2p:tcp:socket"),vr=(r,t)=>{let e=t.metrics,n=t.metricPrefix??"",s=t.socketInactivityTimeout??3e5,a=t.socketCloseTimeout??2e3;t.listeningAddr?.getPath()!=null&&(t.remoteAddr=t.listeningAddr),t.remoteAddr?.getPath()!=null&&(t.localAddr=t.remoteAddr);let l;if(t.remoteAddr!=null)l=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new Vt("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");l=ri(r.remoteAddress,r.remotePort)}let h=ye(l),b=h.path??`${h.host??""}:${h.port??""}`,{sink:E,source:p}=yi.default.duplex(r);r.setTimeout(s,()=>{wt("%s socket read timeout",b),e?.increment({[`${n}timeout`]:!0});let x;r.readable&&(x=new Vt("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(x)}),r.once("close",()=>{wt("%s socket close",b),e?.increment({[`${n}close`]:!0}),y.timeline.close==null&&(y.timeline.close=Date.now())}),r.once("end",()=>{wt("%s socket end",b),e?.increment({[`${n}end`]:!0})});let y={async sink(x){try{await E(x)}catch(g){g.type!=="aborted"&&wt(g)}r.end()},source:p,remoteAddr:l,timeline:{open:Date.now()},async close(){if(r.destroyed){wt("%s socket was already destroyed when trying to close",b);return}wt("%s closing socket",b),await new Promise((x,g)=>{let d=Date.now(),B=setTimeout(()=>{r.destroyed?(wt("%s is already destroyed",b),x()):(wt("%s socket close timeout after %dms, destroying it manually",b,Date.now()-d),r.destroy(new Vt("Socket close timeout","ERR_SOCKET_CLOSE_TIMEOUT")))},a).unref();r.once("close",()=>{wt("%s socket closed",b),clearTimeout(B),x()}),r.once("error",R=>{wt("%s socket error",b,R),y.timeline.close==null&&(y.timeline.close=Date.now()),r.destroyed&&clearTimeout(B),g(R)}),r.setTimeout(a),r.end(),r.writableLength>0?r.once("drain",()=>{wt("%s socket drained",b),r.destroy()}):r.destroy()})}};return y};var vi=_(Ct("net"),1);var Yt=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},Ot,xr=class extends EventTarget{constructor(){super(...arguments),Ot.set(this,new Map)}listenerCount(t){let e=Yt(this,Ot,"f").get(t);return e==null?0:e.length}addEventListener(t,e,n){super.addEventListener(t,e,n);let s=Yt(this,Ot,"f").get(t);s==null&&(s=[],Yt(this,Ot,"f").set(t,s)),s.push({callback:e,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(t,e,n){super.removeEventListener(t.toString(),e??null,n);let s=Yt(this,Ot,"f").get(t);s!=null&&(s=s.filter(({callback:a})=>a!==e),Yt(this,Ot,"f").set(t,s))}dispatchEvent(t){let e=super.dispatchEvent(t),n=Yt(this,Ot,"f").get(t.type);return n==null||(n=n.filter(({once:s})=>!s),Yt(this,Ot,"f").set(t.type,n)),e}safeDispatchEvent(t,e){return this.dispatchEvent(new ve(t,e))}};Ot=new WeakMap;var rs=class extends Event{constructor(t,e){super(t,e),this.detail=e?.detail}},ve=globalThis.CustomEvent??rs;var ut=Lt("libp2p:tcp:listener");async function ns(r){try{await r.close()}catch(t){ut.error("an error occurred closing the connection",t)}}var Op=1,Pp=0,Tr=class extends xr{constructor(t){if(super(),this.context=t,this.connections=new Set,this.status={started:!1},t.keepAlive=t.keepAlive??!0,this.addr="unknown",this.server=vi.default.createServer(t,this.onSocket.bind(this)),t.maxConnections!==void 0&&(this.server.maxConnections=t.maxConnections),t.closeServerOnMaxConnections!=null&&t.closeServerOnMaxConnections.closeAbove<t.closeServerOnMaxConnections.listenBelow)throw Error("closeAbove must be >= listenBelow");this.server.on("listening",()=>{if(t.metrics!=null){let e=this.server.address();e==null?this.addr="unknown":typeof e=="string"?this.addr=e:this.addr=`${e.address}:${e.port}`,t.metrics?.registerMetricGroup("libp2p_tcp_inbound_connections_total",{label:"address",help:"Current active connections in TCP listener",calculate:()=>({[this.addr]:this.connections.size})}),this.metrics={status:t.metrics.registerMetricGroup("libp2p_tcp_listener_status_info",{label:"address",help:"Current status of the TCP listener socket"}),errors:t.metrics.registerMetricGroup("libp2p_tcp_listener_errors_total",{label:"address",help:"Total count of TCP listener errors by type"}),events:t.metrics.registerMetricGroup("libp2p_tcp_listener_events_total",{label:"address",help:"Total count of TCP listener events by type"})},this.metrics?.status.update({[this.addr]:Op})}this.dispatchEvent(new ve("listening"))}).on("error",e=>{this.metrics?.errors.increment({[`${this.addr} listen_error`]:!0}),this.dispatchEvent(new ve("error",{detail:e}))}).on("close",()=>{this.metrics?.status.update({[this.addr]:Pp}),this.dispatchEvent(new ve("close"))})}onSocket(t){t.on("error",n=>{ut("socket error",n),this.metrics?.events.increment({[`${this.addr} error`]:!0})});let e;try{e=vr(t,{listeningAddr:this.status.started?this.status.listeningAddr:void 0,socketInactivityTimeout:this.context.socketInactivityTimeout,socketCloseTimeout:this.context.socketCloseTimeout,metrics:this.metrics?.events,metricPrefix:`${this.addr} `})}catch(n){ut.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_to_connection`]:!0});return}ut("new inbound connection %s",e.remoteAddr);try{this.context.upgrader.upgradeInbound(e).then(n=>{ut("inbound connection upgraded %s",e.remoteAddr),this.connections.add(e),t.once("close",()=>{this.connections.delete(e),this.context.closeServerOnMaxConnections!=null&&this.connections.size<this.context.closeServerOnMaxConnections.listenBelow&&this.netListen().catch(s=>{ut.error("error attempting to listen server once connection count under limit",s),this.context.closeServerOnMaxConnections?.onListenError?.(s)})}),this.context.handler!=null&&this.context.handler(n),this.context.closeServerOnMaxConnections!=null&&this.connections.size>=this.context.closeServerOnMaxConnections.closeAbove&&this.netClose(),this.dispatchEvent(new ve("connection",{detail:n}))}).catch(async n=>{ut.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_upgrade`]:!0}),await ns(e)}).catch(n=>{ut.error("closing inbound connection failed",n)})}catch(n){ut.error("inbound connection failed",n),ns(e).catch(s=>{ut.error("closing inbound connection failed",s),this.metrics?.errors.increment({[`${this.addr} inbound_closing_failed`]:!0})})}}getAddrs(){if(!this.status.started)return[];let t=[],e=this.server.address(),{listeningAddr:n,peerId:s}=this.status;if(e==null)return[];if(typeof e=="string")t=[n];else try{n.toString().startsWith("/ip4")?t=t.concat(es("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(es("ip6",e.address,e.port)))}catch(a){ut.error("could not turn %s:%s into multiaddr",e.address,e.port,a)}return t.map(a=>s!=null?a.encapsulate(`/p2p/${s}`):a)}async listen(t){if(this.status.started)throw Error("server is already listening");let e=t.getPeerId(),n=e==null?t.decapsulateCode(421):t;this.status={started:!0,listeningAddr:n,peerId:e,netConfig:ye(n)},await this.netListen()}async close(){await Promise.all(Array.from(this.connections.values()).map(async t=>{await ns(t)})),this.netClose()}async netListen(){if(!this.status.started||this.server.listening)return;let t=this.status.netConfig;await new Promise((e,n)=>{this.server.once("error",n),this.server.listen(t,e)}),ut("Listening on %s",this.server.address())}netClose(){!this.status.started||!this.server.listening||(ut("Closing server on %s",this.server.address()),this.server.close())}};var Ti=Symbol.for("@libp2p/transport");var xi;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(xi||(xi={}));var Pt=Lt("libp2p:tcp"),os=class{constructor(t,e={}){this.opts=e,this.components=t,t.metrics!=null&&(this.metrics={dialerEvents:t.metrics.registerCounterGroup("libp2p_tcp_dialer_events_total",{label:"event",help:"Total count of TCP dialer events by type"})})}get[Ti](){return!0}get[Symbol.toStringTag](){return"@libp2p/tcp"}async dial(t,e){e.keepAlive=e.keepAlive??!0;let n=await this._connect(t,e);n.on("error",h=>{Pt("socket error",h)});let s=vr(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents}),a=()=>{s.close().catch(h=>{Pt.error("Error closing maConn after abort",h)})};e.signal?.addEventListener("abort",a,{once:!0}),Pt("new outbound connection %s",s.remoteAddr);let l=await e.upgrader.upgradeOutbound(s);if(Pt("outbound connection %s upgraded",s.remoteAddr),e.signal?.removeEventListener("abort",a),e.signal?.aborted===!0)throw l.close().catch(h=>{Pt.error("Error closing conn after abort",h)}),new _t;return l}async _connect(t,e){if(e.signal?.aborted===!0)throw new _t;return await new Promise((n,s)=>{let a=Date.now(),l=ye(t),h=l.path??`${l.host??""}:${l.port}`;Pt("dialing %j",l);let b=Si.default.connect(l),E=d=>{d.message=`connection error ${h}: ${d.message}`,this.metrics?.dialerEvents.increment({error:!0}),g(d)},p=()=>{Pt("connection timeout %s",h),this.metrics?.dialerEvents.increment({timeout:!0});let d=new Vt(`connection timeout after ${Date.now()-a}ms`,"ERR_CONNECT_TIMEOUT");b.emit("error",d)},y=()=>{Pt("connection opened %j",l),this.metrics?.dialerEvents.increment({connect:!0}),g()},x=()=>{Pt("connection aborted %j",l),this.metrics?.dialerEvents.increment({abort:!0}),b.destroy(),g(new _t)},g=d=>{if(b.removeListener("error",E),b.removeListener("timeout",p),b.removeListener("connect",y),e.signal!=null&&e.signal.removeEventListener("abort",x),d!=null){s(d);return}n(b)};b.on("error",E),b.on("timeout",p),b.on("connect",y),e.signal!=null&&e.signal.addEventListener("abort",x)})}createListener(t){return new Tr({...t,maxConnections:this.opts.maxConnections,closeServerOnMaxConnections:this.opts.closeServerOnMaxConnections,socketInactivityTimeout:this.opts.inboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.components.metrics})}filter(t){return t=Array.isArray(t)?t:[t],t.filter(e=>e.protoCodes().includes(290)?!1:e.protoCodes().includes(400)?!0:zt.matches(e.decapsulateCode(421)))}};function kp(r={}){return(t={})=>new os(t,r)}return ua(Np);})();
|
|
4
|
+
`+u),r.push(i+"m+"+Ne.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=tu()+t+" "+r[0]}function tu(){return V.inspectOpts.hideDate?"":new Date().toISOString()+" "}function eu(...r){return process.stderr.write(ke.format(...r)+`
|
|
5
|
+
`)}function ru(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function nu(){return process.env.DEBUG}function su(r){r.inspectOpts={};let t=Object.keys(V.inspectOpts);for(let e=0;e<t.length;e++)r.inspectOpts[t[e]]=V.inspectOpts[t[e]]}Ne.exports=Ur()(V);var{formatters:Es}=Ne.exports;Es.o=function(r){return this.inspectOpts.colors=this.useColors,ke.inspect(r,this.inspectOpts).split(`
|
|
6
|
+
`).map(t=>t.trim()).join(" ")};Es.O=function(r){return this.inspectOpts.colors=this.useColors,ke.inspect(r,this.inspectOpts)}});var As=k((ul,Vr)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Vr.exports=ws():Vr.exports=Cs()});var Le=k((dl,Bs)=>{Bs.exports=r=>{if(r[Symbol.asyncIterator])return r;if(r.getReader)return async function*(){let t=r.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)return;yield n}}finally{t.releaseLock()}}();throw new Error("unknown stream")}});var Rs=k((ml,Is)=>{Is.exports=function(t){if(t){if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]();if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t.next=="function")return t}throw new Error("argument is not an iterator or iterable")}});var zr=k((gl,Ms)=>{var ou=Rs();Ms.exports=r=>async t=>{t=ou(t);let e=E=>{typeof E.return=="function"&&E.return()},n=null,i=null,u=E=>{n=E,i&&i(E),e(t)},l=null,m=!1,b=()=>{m=!0,l&&l()},A=null,f=!1,w=()=>{f=!0,A&&A()},v=null,T=()=>{v&&v()},d=()=>new Promise((E,B)=>{l=v=E,i=B,r.once("drain",T)}),C=()=>(e(t),new Promise((E,B)=>{if(m||f||n)return E();A=l=E,i=B})),I=()=>{r.removeListener("error",u),r.removeListener("close",b),r.removeListener("finish",w),r.removeListener("drain",T)};r.once("error",u),r.once("close",b),r.once("finish",w);try{for await(let E of t){if(!r.writable||r.destroyed||n)break;r.write(E)===!1&&await d()}}catch(E){n||r.destroy(),n=E}try{if(r.writable&&r.end(),await C(),n)throw n}finally{I()}}});var qr=k((bl,Ds)=>{var iu=zr(),au=Le();Ds.exports=r=>({sink:iu(r),source:au(r)})});var _s=k((yl,Os)=>{var cu=qr();Os.exports=r=>async function*(t){let e=cu(r),n;if(e.sink(t).catch(i=>{n=i}),yield*e.source,n)throw n}});var Ps=k((wl,re)=>{re.exports=Le();re.exports.source=Le();re.exports.sink=zr();re.exports.transform=_s();re.exports.duplex=qr()});var Zr=k((je,Ns)=>{(function(){var r,t=0xdeadbeefcafe,e=(t&16777215)==15715070;function n(s,o,a){s!=null&&(typeof s=="number"?this.fromNumber(s,o,a):o==null&&typeof s!="string"?this.fromString(s,256):this.fromString(s,o))}function i(){return new n(null)}function u(s,o,a,c,p,h){for(;--h>=0;){var g=o*this[s++]+a[c]+p;p=Math.floor(g/67108864),a[c++]=g&67108863}return p}function l(s,o,a,c,p,h){for(var g=o&32767,y=o>>15;--h>=0;){var R=this[s]&32767,$=this[s++]>>15,ot=y*R+$*g;R=g*R+((ot&32767)<<15)+a[c]+(p&1073741823),p=(R>>>30)+(ot>>>15)+y*$+(p>>>30),a[c++]=R&1073741823}return p}function m(s,o,a,c,p,h){for(var g=o&16383,y=o>>14;--h>=0;){var R=this[s]&16383,$=this[s++]>>14,ot=y*R+$*g;R=g*R+((ot&16383)<<14)+a[c]+p,p=(R>>28)+(ot>>14)+y*$,a[c++]=R&268435455}return p}var b=typeof navigator<"u";b&&e&&navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=l,r=30):b&&e&&navigator.appName!="Netscape"?(n.prototype.am=u,r=26):(n.prototype.am=m,r=28),n.prototype.DB=r,n.prototype.DM=(1<<r)-1,n.prototype.DV=1<<r;var A=52;n.prototype.FV=Math.pow(2,A),n.prototype.F1=A-r,n.prototype.F2=2*r-A;var f="0123456789abcdefghijklmnopqrstuvwxyz",w=new Array,v,T;for(v="0".charCodeAt(0),T=0;T<=9;++T)w[v++]=T;for(v="a".charCodeAt(0),T=10;T<36;++T)w[v++]=T;for(v="A".charCodeAt(0),T=10;T<36;++T)w[v++]=T;function d(s){return f.charAt(s)}function C(s,o){var a=w[s.charCodeAt(o)];return a??-1}function I(s){for(var o=this.t-1;o>=0;--o)s[o]=this[o];s.t=this.t,s.s=this.s}function E(s){this.t=1,this.s=s<0?-1:0,s>0?this[0]=s:s<-1?this[0]=s+this.DV:this.t=0}function B(s){var o=i();return o.fromInt(s),o}function F(s,o){var a;if(o==16)a=4;else if(o==8)a=3;else if(o==256)a=8;else if(o==2)a=1;else if(o==32)a=5;else if(o==4)a=2;else{this.fromRadix(s,o);return}this.t=0,this.s=0;for(var c=s.length,p=!1,h=0;--c>=0;){var g=a==8?s[c]&255:C(s,c);if(g<0){s.charAt(c)=="-"&&(p=!0);continue}p=!1,h==0?this[this.t++]=g:h+a>this.DB?(this[this.t-1]|=(g&(1<<this.DB-h)-1)<<h,this[this.t++]=g>>this.DB-h):this[this.t-1]|=g<<h,h+=a,h>=this.DB&&(h-=this.DB)}a==8&&s[0]&128&&(this.s=-1,h>0&&(this[this.t-1]|=(1<<this.DB-h)-1<<h)),this.clamp(),p&&n.ZERO.subTo(this,this)}function N(){for(var s=this.s&this.DM;this.t>0&&this[this.t-1]==s;)--this.t}function Q(s){if(this.s<0)return"-"+this.negate().toString(s);var o;if(s==16)o=4;else if(s==8)o=3;else if(s==2)o=1;else if(s==32)o=5;else if(s==4)o=2;else return this.toRadix(s);var a=(1<<o)-1,c,p=!1,h="",g=this.t,y=this.DB-g*this.DB%o;if(g-- >0)for(y<this.DB&&(c=this[g]>>y)>0&&(p=!0,h=d(c));g>=0;)y<o?(c=(this[g]&(1<<y)-1)<<o-y,c|=this[--g]>>(y+=this.DB-o)):(c=this[g]>>(y-=o)&a,y<=0&&(y+=this.DB,--g)),c>0&&(p=!0),p&&(h+=d(c));return p?h:"0"}function X(){var s=i();return n.ZERO.subTo(this,s),s}function W(){return this.s<0?this.negate():this}function Y(s){var o=this.s-s.s;if(o!=0)return o;var a=this.t;if(o=a-s.t,o!=0)return this.s<0?-o:o;for(;--a>=0;)if((o=this[a]-s[a])!=0)return o;return 0}function ct(s){var o=1,a;return(a=s>>>16)!=0&&(s=a,o+=16),(a=s>>8)!=0&&(s=a,o+=8),(a=s>>4)!=0&&(s=a,o+=4),(a=s>>2)!=0&&(s=a,o+=2),(a=s>>1)!=0&&(s=a,o+=1),o}function to(){return this.t<=0?0:this.DB*(this.t-1)+ct(this[this.t-1]^this.s&this.DM)}function eo(s,o){var a;for(a=this.t-1;a>=0;--a)o[a+s]=this[a];for(a=s-1;a>=0;--a)o[a]=0;o.t=this.t+s,o.s=this.s}function ro(s,o){for(var a=s;a<this.t;++a)o[a-s]=this[a];o.t=Math.max(this.t-s,0),o.s=this.s}function no(s,o){var a=s%this.DB,c=this.DB-a,p=(1<<c)-1,h=Math.floor(s/this.DB),g=this.s<<a&this.DM,y;for(y=this.t-1;y>=0;--y)o[y+h+1]=this[y]>>c|g,g=(this[y]&p)<<a;for(y=h-1;y>=0;--y)o[y]=0;o[h]=g,o.t=this.t+h+1,o.s=this.s,o.clamp()}function so(s,o){o.s=this.s;var a=Math.floor(s/this.DB);if(a>=this.t){o.t=0;return}var c=s%this.DB,p=this.DB-c,h=(1<<c)-1;o[0]=this[a]>>c;for(var g=a+1;g<this.t;++g)o[g-a-1]|=(this[g]&h)<<p,o[g-a]=this[g]>>c;c>0&&(o[this.t-a-1]|=(this.s&h)<<p),o.t=this.t-a,o.clamp()}function oo(s,o){for(var a=0,c=0,p=Math.min(s.t,this.t);a<p;)c+=this[a]-s[a],o[a++]=c&this.DM,c>>=this.DB;if(s.t<this.t){for(c-=s.s;a<this.t;)c+=this[a],o[a++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;a<s.t;)c-=s[a],o[a++]=c&this.DM,c>>=this.DB;c-=s.s}o.s=c<0?-1:0,c<-1?o[a++]=this.DV+c:c>0&&(o[a++]=c),o.t=a,o.clamp()}function io(s,o){var a=this.abs(),c=s.abs(),p=a.t;for(o.t=p+c.t;--p>=0;)o[p]=0;for(p=0;p<c.t;++p)o[p+a.t]=a.am(0,c[p],o,p,0,a.t);o.s=0,o.clamp(),this.s!=s.s&&n.ZERO.subTo(o,o)}function ao(s){for(var o=this.abs(),a=s.t=2*o.t;--a>=0;)s[a]=0;for(a=0;a<o.t-1;++a){var c=o.am(a,o[a],s,2*a,0,1);(s[a+o.t]+=o.am(a+1,2*o[a],s,2*a+1,c,o.t-a-1))>=o.DV&&(s[a+o.t]-=o.DV,s[a+o.t+1]=1)}s.t>0&&(s[s.t-1]+=o.am(a,o[a],s,2*a,0,1)),s.s=0,s.clamp()}function co(s,o,a){var c=s.abs();if(!(c.t<=0)){var p=this.abs();if(p.t<c.t){o?.fromInt(0),a!=null&&this.copyTo(a);return}a==null&&(a=i());var h=i(),g=this.s,y=s.s,R=this.DB-ct(c[c.t-1]);R>0?(c.lShiftTo(R,h),p.lShiftTo(R,a)):(c.copyTo(h),p.copyTo(a));var $=h.t,ot=h[$-1];if(ot!=0){var et=ot*(1<<this.F1)+($>1?h[$-2]>>this.F2:0),bt=this.FV/et,xe=(1<<this.F1)/et,ft=1<<this.F2,lt=a.t,Te=lt-$,At=o??i();for(h.dlShiftTo(Te,At),a.compareTo(At)>=0&&(a[a.t++]=1,a.subTo(At,a)),n.ONE.dlShiftTo($,At),At.subTo(h,h);h.t<$;)h[h.t++]=0;for(;--Te>=0;){var Qe=a[--lt]==ot?this.DM:Math.floor(a[lt]*bt+(a[lt-1]+ft)*xe);if((a[lt]+=h.am(0,Qe,a,Te,0,$))<Qe)for(h.dlShiftTo(Te,At),a.subTo(At,a);a[lt]<--Qe;)a.subTo(At,a)}o!=null&&(a.drShiftTo($,o),g!=y&&n.ZERO.subTo(o,o)),a.t=$,a.clamp(),R>0&&a.rShiftTo(R,a),g<0&&n.ZERO.subTo(a,a)}}}function uo(s){var o=i();return this.abs().divRemTo(s,null,o),this.s<0&&o.compareTo(n.ZERO)>0&&s.subTo(o,o),o}function Ot(s){this.m=s}function fo(s){return s.s<0||s.compareTo(this.m)>=0?s.mod(this.m):s}function lo(s){return s}function po(s){s.divRemTo(this.m,null,s)}function ho(s,o,a){s.multiplyTo(o,a),this.reduce(a)}function mo(s,o){s.squareTo(o),this.reduce(o)}Ot.prototype.convert=fo,Ot.prototype.revert=lo,Ot.prototype.reduce=po,Ot.prototype.mulTo=ho,Ot.prototype.sqrTo=mo;function go(){if(this.t<1)return 0;var s=this[0];if(!(s&1))return 0;var o=s&3;return o=o*(2-(s&15)*o)&15,o=o*(2-(s&255)*o)&255,o=o*(2-((s&65535)*o&65535))&65535,o=o*(2-s*o%this.DV)%this.DV,o>0?this.DV-o:-o}function _t(s){this.m=s,this.mp=s.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<s.DB-15)-1,this.mt2=2*s.t}function bo(s){var o=i();return s.abs().dlShiftTo(this.m.t,o),o.divRemTo(this.m,null,o),s.s<0&&o.compareTo(n.ZERO)>0&&this.m.subTo(o,o),o}function yo(s){var o=i();return s.copyTo(o),this.reduce(o),o}function wo(s){for(;s.t<=this.mt2;)s[s.t++]=0;for(var o=0;o<this.m.t;++o){var a=s[o]&32767,c=a*this.mpl+((a*this.mph+(s[o]>>15)*this.mpl&this.um)<<15)&s.DM;for(a=o+this.m.t,s[a]+=this.m.am(0,c,s,o,0,this.m.t);s[a]>=s.DV;)s[a]-=s.DV,s[++a]++}s.clamp(),s.drShiftTo(this.m.t,s),s.compareTo(this.m)>=0&&s.subTo(this.m,s)}function vo(s,o){s.squareTo(o),this.reduce(o)}function xo(s,o,a){s.multiplyTo(o,a),this.reduce(a)}_t.prototype.convert=bo,_t.prototype.revert=yo,_t.prototype.reduce=wo,_t.prototype.mulTo=xo,_t.prototype.sqrTo=vo;function To(){return(this.t>0?this[0]&1:this.s)==0}function So(s,o){if(s>4294967295||s<1)return n.ONE;var a=i(),c=i(),p=o.convert(this),h=ct(s)-1;for(p.copyTo(a);--h>=0;)if(o.sqrTo(a,c),(s&1<<h)>0)o.mulTo(c,p,a);else{var g=a;a=c,c=g}return o.revert(a)}function Eo(s,o){var a;return s<256||o.isEven()?a=new Ot(o):a=new _t(o),this.exp(s,a)}n.prototype.copyTo=I,n.prototype.fromInt=E,n.prototype.fromString=F,n.prototype.clamp=N,n.prototype.dlShiftTo=eo,n.prototype.drShiftTo=ro,n.prototype.lShiftTo=no,n.prototype.rShiftTo=so,n.prototype.subTo=oo,n.prototype.multiplyTo=io,n.prototype.squareTo=ao,n.prototype.divRemTo=co,n.prototype.invDigit=go,n.prototype.isEven=To,n.prototype.exp=So,n.prototype.toString=Q,n.prototype.negate=X,n.prototype.abs=W,n.prototype.compareTo=Y,n.prototype.bitLength=to,n.prototype.mod=uo,n.prototype.modPowInt=Eo,n.ZERO=B(0),n.ONE=B(1);function Co(){var s=i();return this.copyTo(s),s}function Ao(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function Bo(){return this.t==0?this.s:this[0]<<24>>24}function Io(){return this.t==0?this.s:this[0]<<16>>16}function Ro(s){return Math.floor(Math.LN2*this.DB/Math.log(s))}function Mo(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Do(s){if(s==null&&(s=10),this.signum()==0||s<2||s>36)return"0";var o=this.chunkSize(s),a=Math.pow(s,o),c=B(a),p=i(),h=i(),g="";for(this.divRemTo(c,p,h);p.signum()>0;)g=(a+h.intValue()).toString(s).substr(1)+g,p.divRemTo(c,p,h);return h.intValue().toString(s)+g}function Oo(s,o){this.fromInt(0),o==null&&(o=10);for(var a=this.chunkSize(o),c=Math.pow(o,a),p=!1,h=0,g=0,y=0;y<s.length;++y){var R=C(s,y);if(R<0){s.charAt(y)=="-"&&this.signum()==0&&(p=!0);continue}g=o*g+R,++h>=a&&(this.dMultiply(c),this.dAddOffset(g,0),h=0,g=0)}h>0&&(this.dMultiply(Math.pow(o,h)),this.dAddOffset(g,0)),p&&n.ZERO.subTo(this,this)}function _o(s,o,a){if(typeof o=="number")if(s<2)this.fromInt(1);else for(this.fromNumber(s,a),this.testBit(s-1)||this.bitwiseTo(n.ONE.shiftLeft(s-1),Je,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(o);)this.dAddOffset(2,0),this.bitLength()>s&&this.subTo(n.ONE.shiftLeft(s-1),this);else{var c=new Array,p=s&7;c.length=(s>>3)+1,o.nextBytes(c),p>0?c[0]&=(1<<p)-1:c[0]=0,this.fromString(c,256)}}function Po(){var s=this.t,o=new Array;o[0]=this.s;var a=this.DB-s*this.DB%8,c,p=0;if(s-- >0)for(a<this.DB&&(c=this[s]>>a)!=(this.s&this.DM)>>a&&(o[p++]=c|this.s<<this.DB-a);s>=0;)a<8?(c=(this[s]&(1<<a)-1)<<8-a,c|=this[--s]>>(a+=this.DB-8)):(c=this[s]>>(a-=8)&255,a<=0&&(a+=this.DB,--s)),c&128&&(c|=-256),p==0&&(this.s&128)!=(c&128)&&++p,(p>0||c!=this.s)&&(o[p++]=c);return o}function Fo(s){return this.compareTo(s)==0}function ko(s){return this.compareTo(s)<0?this:s}function No(s){return this.compareTo(s)>0?this:s}function Lo(s,o,a){var c,p,h=Math.min(s.t,this.t);for(c=0;c<h;++c)a[c]=o(this[c],s[c]);if(s.t<this.t){for(p=s.s&this.DM,c=h;c<this.t;++c)a[c]=o(this[c],p);a.t=this.t}else{for(p=this.s&this.DM,c=h;c<s.t;++c)a[c]=o(p,s[c]);a.t=s.t}a.s=o(this.s,s.s),a.clamp()}function $o(s,o){return s&o}function Uo(s){var o=i();return this.bitwiseTo(s,$o,o),o}function Je(s,o){return s|o}function jo(s){var o=i();return this.bitwiseTo(s,Je,o),o}function fn(s,o){return s^o}function Vo(s){var o=i();return this.bitwiseTo(s,fn,o),o}function ln(s,o){return s&~o}function zo(s){var o=i();return this.bitwiseTo(s,ln,o),o}function qo(){for(var s=i(),o=0;o<this.t;++o)s[o]=this.DM&~this[o];return s.t=this.t,s.s=~this.s,s}function Go(s){var o=i();return s<0?this.rShiftTo(-s,o):this.lShiftTo(s,o),o}function Zo(s){var o=i();return s<0?this.lShiftTo(-s,o):this.rShiftTo(s,o),o}function Ho(s){if(s==0)return-1;var o=0;return s&65535||(s>>=16,o+=16),s&255||(s>>=8,o+=8),s&15||(s>>=4,o+=4),s&3||(s>>=2,o+=2),s&1||++o,o}function Wo(){for(var s=0;s<this.t;++s)if(this[s]!=0)return s*this.DB+Ho(this[s]);return this.s<0?this.t*this.DB:-1}function Jo(s){for(var o=0;s!=0;)s&=s-1,++o;return o}function Xo(){for(var s=0,o=this.s&this.DM,a=0;a<this.t;++a)s+=Jo(this[a]^o);return s}function Yo(s){var o=Math.floor(s/this.DB);return o>=this.t?this.s!=0:(this[o]&1<<s%this.DB)!=0}function Ko(s,o){var a=n.ONE.shiftLeft(s);return this.bitwiseTo(a,o,a),a}function Qo(s){return this.changeBit(s,Je)}function ti(s){return this.changeBit(s,ln)}function ei(s){return this.changeBit(s,fn)}function ri(s,o){for(var a=0,c=0,p=Math.min(s.t,this.t);a<p;)c+=this[a]+s[a],o[a++]=c&this.DM,c>>=this.DB;if(s.t<this.t){for(c+=s.s;a<this.t;)c+=this[a],o[a++]=c&this.DM,c>>=this.DB;c+=this.s}else{for(c+=this.s;a<s.t;)c+=s[a],o[a++]=c&this.DM,c>>=this.DB;c+=s.s}o.s=c<0?-1:0,c>0?o[a++]=c:c<-1&&(o[a++]=this.DV+c),o.t=a,o.clamp()}function ni(s){var o=i();return this.addTo(s,o),o}function si(s){var o=i();return this.subTo(s,o),o}function oi(s){var o=i();return this.multiplyTo(s,o),o}function ii(){var s=i();return this.squareTo(s),s}function ai(s){var o=i();return this.divRemTo(s,o,null),o}function ci(s){var o=i();return this.divRemTo(s,null,o),o}function ui(s){var o=i(),a=i();return this.divRemTo(s,o,a),new Array(o,a)}function fi(s){this[this.t]=this.am(0,s-1,this,0,0,this.t),++this.t,this.clamp()}function li(s,o){if(s!=0){for(;this.t<=o;)this[this.t++]=0;for(this[o]+=s;this[o]>=this.DV;)this[o]-=this.DV,++o>=this.t&&(this[this.t++]=0),++this[o]}}function ce(){}function pn(s){return s}function pi(s,o,a){s.multiplyTo(o,a)}function hi(s,o){s.squareTo(o)}ce.prototype.convert=pn,ce.prototype.revert=pn,ce.prototype.mulTo=pi,ce.prototype.sqrTo=hi;function di(s){return this.exp(s,new ce)}function mi(s,o,a){var c=Math.min(this.t+s.t,o);for(a.s=0,a.t=c;c>0;)a[--c]=0;var p;for(p=a.t-this.t;c<p;++c)a[c+this.t]=this.am(0,s[c],a,c,0,this.t);for(p=Math.min(s.t,o);c<p;++c)this.am(0,s[c],a,c,0,o-c);a.clamp()}function gi(s,o,a){--o;var c=a.t=this.t+s.t-o;for(a.s=0;--c>=0;)a[c]=0;for(c=Math.max(o-this.t,0);c<s.t;++c)a[this.t+c-o]=this.am(o-c,s[c],a,0,0,this.t+c-o);a.clamp(),a.drShiftTo(1,a)}function Pt(s){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*s.t,this.r2),this.mu=this.r2.divide(s),this.m=s}function bi(s){if(s.s<0||s.t>2*this.m.t)return s.mod(this.m);if(s.compareTo(this.m)<0)return s;var o=i();return s.copyTo(o),this.reduce(o),o}function yi(s){return s}function wi(s){for(s.drShiftTo(this.m.t-1,this.r2),s.t>this.m.t+1&&(s.t=this.m.t+1,s.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);s.compareTo(this.r2)<0;)s.dAddOffset(1,this.m.t+1);for(s.subTo(this.r2,s);s.compareTo(this.m)>=0;)s.subTo(this.m,s)}function vi(s,o){s.squareTo(o),this.reduce(o)}function xi(s,o,a){s.multiplyTo(o,a),this.reduce(a)}Pt.prototype.convert=bi,Pt.prototype.revert=yi,Pt.prototype.reduce=wi,Pt.prototype.mulTo=xi,Pt.prototype.sqrTo=vi;function Ti(s,o){var a=s.bitLength(),c,p=B(1),h;if(a<=0)return p;a<18?c=1:a<48?c=3:a<144?c=4:a<768?c=5:c=6,a<8?h=new Ot(o):o.isEven()?h=new Pt(o):h=new _t(o);var g=new Array,y=3,R=c-1,$=(1<<c)-1;if(g[1]=h.convert(this),c>1){var ot=i();for(h.sqrTo(g[1],ot);y<=$;)g[y]=i(),h.mulTo(ot,g[y-2],g[y]),y+=2}var et=s.t-1,bt,xe=!0,ft=i(),lt;for(a=ct(s[et])-1;et>=0;){for(a>=R?bt=s[et]>>a-R&$:(bt=(s[et]&(1<<a+1)-1)<<R-a,et>0&&(bt|=s[et-1]>>this.DB+a-R)),y=c;!(bt&1);)bt>>=1,--y;if((a-=y)<0&&(a+=this.DB,--et),xe)g[bt].copyTo(p),xe=!1;else{for(;y>1;)h.sqrTo(p,ft),h.sqrTo(ft,p),y-=2;y>0?h.sqrTo(p,ft):(lt=p,p=ft,ft=lt),h.mulTo(ft,g[bt],p)}for(;et>=0&&!(s[et]&1<<a);)h.sqrTo(p,ft),lt=p,p=ft,ft=lt,--a<0&&(a=this.DB-1,--et)}return h.revert(p)}function Si(s){var o=this.s<0?this.negate():this.clone(),a=s.s<0?s.negate():s.clone();if(o.compareTo(a)<0){var c=o;o=a,a=c}var p=o.getLowestSetBit(),h=a.getLowestSetBit();if(h<0)return o;for(p<h&&(h=p),h>0&&(o.rShiftTo(h,o),a.rShiftTo(h,a));o.signum()>0;)(p=o.getLowestSetBit())>0&&o.rShiftTo(p,o),(p=a.getLowestSetBit())>0&&a.rShiftTo(p,a),o.compareTo(a)>=0?(o.subTo(a,o),o.rShiftTo(1,o)):(a.subTo(o,a),a.rShiftTo(1,a));return h>0&&a.lShiftTo(h,a),a}function Ei(s){if(s<=0)return 0;var o=this.DV%s,a=this.s<0?s-1:0;if(this.t>0)if(o==0)a=this[0]%s;else for(var c=this.t-1;c>=0;--c)a=(o*a+this[c])%s;return a}function Ci(s){var o=s.isEven();if(this.isEven()&&o||s.signum()==0)return n.ZERO;for(var a=s.clone(),c=this.clone(),p=B(1),h=B(0),g=B(0),y=B(1);a.signum()!=0;){for(;a.isEven();)a.rShiftTo(1,a),o?((!p.isEven()||!h.isEven())&&(p.addTo(this,p),h.subTo(s,h)),p.rShiftTo(1,p)):h.isEven()||h.subTo(s,h),h.rShiftTo(1,h);for(;c.isEven();)c.rShiftTo(1,c),o?((!g.isEven()||!y.isEven())&&(g.addTo(this,g),y.subTo(s,y)),g.rShiftTo(1,g)):y.isEven()||y.subTo(s,y),y.rShiftTo(1,y);a.compareTo(c)>=0?(a.subTo(c,a),o&&p.subTo(g,p),h.subTo(y,h)):(c.subTo(a,c),o&&g.subTo(p,g),y.subTo(h,y))}if(c.compareTo(n.ONE)!=0)return n.ZERO;if(y.compareTo(s)>=0)return y.subtract(s);if(y.signum()<0)y.addTo(s,y);else return y;return y.signum()<0?y.add(s):y}var J=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ai=(1<<26)/J[J.length-1];function Bi(s){var o,a=this.abs();if(a.t==1&&a[0]<=J[J.length-1]){for(o=0;o<J.length;++o)if(a[0]==J[o])return!0;return!1}if(a.isEven())return!1;for(o=1;o<J.length;){for(var c=J[o],p=o+1;p<J.length&&c<Ai;)c*=J[p++];for(c=a.modInt(c);o<p;)if(c%J[o++]==0)return!1}return a.millerRabin(s)}function Ii(s){var o=this.subtract(n.ONE),a=o.getLowestSetBit();if(a<=0)return!1;var c=o.shiftRight(a);s=s+1>>1,s>J.length&&(s=J.length);for(var p=i(),h=0;h<s;++h){p.fromInt(J[Math.floor(Math.random()*J.length)]);var g=p.modPow(c,this);if(g.compareTo(n.ONE)!=0&&g.compareTo(o)!=0){for(var y=1;y++<a&&g.compareTo(o)!=0;)if(g=g.modPowInt(2,this),g.compareTo(n.ONE)==0)return!1;if(g.compareTo(o)!=0)return!1}}return!0}n.prototype.chunkSize=Ro,n.prototype.toRadix=Do,n.prototype.fromRadix=Oo,n.prototype.fromNumber=_o,n.prototype.bitwiseTo=Lo,n.prototype.changeBit=Ko,n.prototype.addTo=ri,n.prototype.dMultiply=fi,n.prototype.dAddOffset=li,n.prototype.multiplyLowerTo=mi,n.prototype.multiplyUpperTo=gi,n.prototype.modInt=Ei,n.prototype.millerRabin=Ii,n.prototype.clone=Co,n.prototype.intValue=Ao,n.prototype.byteValue=Bo,n.prototype.shortValue=Io,n.prototype.signum=Mo,n.prototype.toByteArray=Po,n.prototype.equals=Fo,n.prototype.min=ko,n.prototype.max=No,n.prototype.and=Uo,n.prototype.or=jo,n.prototype.xor=Vo,n.prototype.andNot=zo,n.prototype.not=qo,n.prototype.shiftLeft=Go,n.prototype.shiftRight=Zo,n.prototype.getLowestSetBit=Wo,n.prototype.bitCount=Xo,n.prototype.testBit=Yo,n.prototype.setBit=Qo,n.prototype.clearBit=ti,n.prototype.flipBit=ei,n.prototype.add=ni,n.prototype.subtract=si,n.prototype.multiply=oi,n.prototype.divide=ai,n.prototype.remainder=ci,n.prototype.divideAndRemainder=ui,n.prototype.modPow=Ti,n.prototype.modInverse=Ci,n.prototype.pow=di,n.prototype.gcd=Si,n.prototype.isProbablePrime=Bi,n.prototype.square=ii,n.prototype.Barrett=Pt;var ve,tt,L;function Ri(s){tt[L++]^=s&255,tt[L++]^=s>>8&255,tt[L++]^=s>>16&255,tt[L++]^=s>>24&255,L>=Ke&&(L-=Ke)}function hn(){Ri(new Date().getTime())}if(tt==null){tt=new Array,L=0;var ut;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var dn=new Uint8Array(32);for(window.crypto.getRandomValues(dn),ut=0;ut<32;++ut)tt[L++]=dn[ut]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var mn=window.crypto.random(32);for(ut=0;ut<mn.length;++ut)tt[L++]=mn.charCodeAt(ut)&255}}for(;L<Ke;)ut=Math.floor(65536*Math.random()),tt[L++]=ut>>>8,tt[L++]=ut&255;L=0,hn()}function Mi(){if(ve==null){for(hn(),ve=Pi(),ve.init(tt),L=0;L<tt.length;++L)tt[L]=0;L=0}return ve.next()}function Di(s){var o;for(o=0;o<s.length;++o)s[o]=Mi()}function Xe(){}Xe.prototype.nextBytes=Di;function Ye(){this.i=0,this.j=0,this.S=new Array}function Oi(s){var o,a,c;for(o=0;o<256;++o)this.S[o]=o;for(a=0,o=0;o<256;++o)a=a+this.S[o]+s[o%s.length]&255,c=this.S[o],this.S[o]=this.S[a],this.S[a]=c;this.i=0,this.j=0}function _i(){var s;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,s=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=s,this.S[s+this.S[this.i]&255]}Ye.prototype.init=Oi,Ye.prototype.next=_i;function Pi(){return new Ye}var Ke=256;typeof je<"u"?je=Ns.exports={default:n,BigInteger:n,SecureRandom:Xe}:this.jsbn={BigInteger:n,SecureRandom:Xe}}).call(je)});var we=k(Ve=>{(function(){"use strict";var r={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function t(l){return n(u(l),arguments)}function e(l,m){return t.apply(null,[l].concat(m||[]))}function n(l,m){var b=1,A=l.length,f,w="",v,T,d,C,I,E,B,F;for(v=0;v<A;v++)if(typeof l[v]=="string")w+=l[v];else if(typeof l[v]=="object"){if(d=l[v],d.keys)for(f=m[b],T=0;T<d.keys.length;T++){if(f==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',d.keys[T],d.keys[T-1]));f=f[d.keys[T]]}else d.param_no?f=m[d.param_no]:f=m[b++];if(r.not_type.test(d.type)&&r.not_primitive.test(d.type)&&f instanceof Function&&(f=f()),r.numeric_arg.test(d.type)&&typeof f!="number"&&isNaN(f))throw new TypeError(t("[sprintf] expecting number but found %T",f));switch(r.number.test(d.type)&&(B=f>=0),d.type){case"b":f=parseInt(f,10).toString(2);break;case"c":f=String.fromCharCode(parseInt(f,10));break;case"d":case"i":f=parseInt(f,10);break;case"j":f=JSON.stringify(f,null,d.width?parseInt(d.width):0);break;case"e":f=d.precision?parseFloat(f).toExponential(d.precision):parseFloat(f).toExponential();break;case"f":f=d.precision?parseFloat(f).toFixed(d.precision):parseFloat(f);break;case"g":f=d.precision?String(Number(f.toPrecision(d.precision))):parseFloat(f);break;case"o":f=(parseInt(f,10)>>>0).toString(8);break;case"s":f=String(f),f=d.precision?f.substring(0,d.precision):f;break;case"t":f=String(!!f),f=d.precision?f.substring(0,d.precision):f;break;case"T":f=Object.prototype.toString.call(f).slice(8,-1).toLowerCase(),f=d.precision?f.substring(0,d.precision):f;break;case"u":f=parseInt(f,10)>>>0;break;case"v":f=f.valueOf(),f=d.precision?f.substring(0,d.precision):f;break;case"x":f=(parseInt(f,10)>>>0).toString(16);break;case"X":f=(parseInt(f,10)>>>0).toString(16).toUpperCase();break}r.json.test(d.type)?w+=f:(r.number.test(d.type)&&(!B||d.sign)?(F=B?"+":"-",f=f.toString().replace(r.sign,"")):F="",I=d.pad_char?d.pad_char==="0"?"0":d.pad_char.charAt(1):" ",E=d.width-(F+f).length,C=d.width&&E>0?I.repeat(E):"",w+=d.align?F+f+C:I==="0"?F+C+f:C+F+f)}return w}var i=Object.create(null);function u(l){if(i[l])return i[l];for(var m=l,b,A=[],f=0;m;){if((b=r.text.exec(m))!==null)A.push(b[0]);else if((b=r.modulo.exec(m))!==null)A.push("%");else if((b=r.placeholder.exec(m))!==null){if(b[2]){f|=1;var w=[],v=b[2],T=[];if((T=r.key.exec(v))!==null)for(w.push(T[1]);(v=v.substring(T[0].length))!=="";)if((T=r.key_access.exec(v))!==null)w.push(T[1]);else if((T=r.index_access.exec(v))!==null)w.push(T[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");b[2]=w}else f|=2;if(f===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");A.push({placeholder:b[0],param_no:b[1],keys:b[2],sign:b[3],pad_char:b[4],align:b[5],width:b[6],precision:b[7],type:b[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");m=m.substring(b[0].length)}return i[l]=A}typeof Ve<"u"&&(Ve.sprintf=t,Ve.vsprintf=e),typeof window<"u"&&(window.sprintf=t,window.vsprintf=e,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:e}}))})()});var Cu={};rt(Cu,{tcp:()=>Eu});var Qs=j(yt("net"),1);var Bt=yt("node:net");function Ee(r){return!!(0,Bt.isIP)(r)}var sr={};rt(sr,{identity:()=>Zi});function ji(r,t){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<r.length;i++){var u=r.charAt(i),l=u.charCodeAt(0);if(e[l]!==255)throw new TypeError(u+" is ambiguous");e[l]=i}var m=r.length,b=r.charAt(0),A=Math.log(m)/Math.log(256),f=Math.log(256)/Math.log(m);function w(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var C=0,I=0,E=0,B=d.length;E!==B&&d[E]===0;)E++,C++;for(var F=(B-E)*f+1>>>0,N=new Uint8Array(F);E!==B;){for(var Q=d[E],X=0,W=F-1;(Q!==0||X<I)&&W!==-1;W--,X++)Q+=256*N[W]>>>0,N[W]=Q%m>>>0,Q=Q/m>>>0;if(Q!==0)throw new Error("Non-zero carry");I=X,E++}for(var Y=F-I;Y!==F&&N[Y]===0;)Y++;for(var ct=b.repeat(C);Y<F;++Y)ct+=r.charAt(N[Y]);return ct}function v(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;var C=0;if(d[C]!==" "){for(var I=0,E=0;d[C]===b;)I++,C++;for(var B=(d.length-C)*A+1>>>0,F=new Uint8Array(B);d[C];){var N=e[d.charCodeAt(C)];if(N===255)return;for(var Q=0,X=B-1;(N!==0||Q<E)&&X!==-1;X--,Q++)N+=m*F[X]>>>0,F[X]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");E=Q,C++}if(d[C]!==" "){for(var W=B-E;W!==B&&F[W]===0;)W++;for(var Y=new Uint8Array(I+(B-W)),ct=I;W!==B;)Y[ct++]=F[W++];return Y}}}function T(d){var C=v(d);if(C)return C;throw new Error(`Non-${t} character`)}return{encode:w,decodeUnsafe:v,decode:T}}var Vi=ji,zi=Vi,bn=zi;var Ru=new Uint8Array(0);var yn=(r,t)=>{if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0},it=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")};var wn=r=>new TextEncoder().encode(r),vn=r=>new TextDecoder().decode(r);var tr=class{constructor(t,e,n){this.name=t,this.prefix=e,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},er=class{constructor(t,e,n){if(this.name=t,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return Tn(this,t)}},rr=class{constructor(t){this.decoders=t}or(t){return Tn(this,t)}decode(t){let e=t[0],n=this.decoders[e];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Tn=(r,t)=>new rr({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),nr=class{constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new tr(t,e,n),this.decoder=new er(t,e,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},Vt=({name:r,prefix:t,encode:e,decode:n})=>new nr(r,t,e,n),It=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:i}=bn(e,t);return Vt({prefix:r,name:t,encode:n,decode:u=>it(i(u))})},qi=(r,t,e,n)=>{let i={};for(let f=0;f<t.length;++f)i[t[f]]=f;let u=r.length;for(;r[u-1]==="=";)--u;let l=new Uint8Array(u*e/8|0),m=0,b=0,A=0;for(let f=0;f<u;++f){let w=i[r[f]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);b=b<<e|w,m+=e,m>=8&&(m-=8,l[A++]=255&b>>m)}if(m>=e||255&b<<8-m)throw new SyntaxError("Unexpected end of data");return l},Gi=(r,t,e)=>{let n=t[t.length-1]==="=",i=(1<<e)-1,u="",l=0,m=0;for(let b=0;b<r.length;++b)for(m=m<<8|r[b],l+=8;l>e;)l-=e,u+=t[i&m>>l];if(l&&(u+=t[i&m<<e-l]),n)for(;u.length*e&7;)u+="=";return u},_=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>Vt({prefix:t,name:r,encode(i){return Gi(i,n,e)},decode(i){return qi(i,n,e,r)}});var Zi=Vt({prefix:"\0",name:"identity",encode:r=>vn(r),decode:r=>wn(r)});var or={};rt(or,{base2:()=>Hi});var Hi=_({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ir={};rt(ir,{base8:()=>Wi});var Wi=_({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var ar={};rt(ar,{base10:()=>Ji});var Ji=It({prefix:"9",name:"base10",alphabet:"0123456789"});var cr={};rt(cr,{base16:()=>Xi,base16upper:()=>Yi});var Xi=_({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yi=_({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ur={};rt(ur,{base32:()=>pt,base32hex:()=>ea,base32hexpad:()=>na,base32hexpadupper:()=>sa,base32hexupper:()=>ra,base32pad:()=>Qi,base32padupper:()=>ta,base32upper:()=>Ki,base32z:()=>oa});var pt=_({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ki=_({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Qi=_({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),ta=_({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ea=_({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ra=_({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),na=_({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sa=_({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),oa=_({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var fr={};rt(fr,{base36:()=>ia,base36upper:()=>aa});var ia=It({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),aa=It({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lr={};rt(lr,{base58btc:()=>z,base58flickr:()=>ca});var z=It({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ca=It({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var hr={};rt(hr,{base64:()=>pr,base64pad:()=>ua,base64url:()=>fa,base64urlpad:()=>la});var pr=_({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ua=_({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),fa=_({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),la=_({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var dr={};rt(dr,{base256emoji:()=>ga});var Sn=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}"),pa=Sn.reduce((r,t,e)=>(r[e]=t,r),[]),ha=Sn.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function da(r){return r.reduce((t,e)=>(t+=pa[e],t),"")}function ma(r){let t=[];for(let e of r){let n=ha[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var ga=Vt({prefix:"\u{1F680}",name:"base256emoji",encode:da,decode:ma});var wr={};rt(wr,{sha256:()=>Fa,sha512:()=>ka});var yr=j(yt("crypto"),1);var ba=An,En=128,ya=127,wa=~ya,va=Math.pow(2,31);function An(r,t,e){t=t||[],e=e||0;for(var n=e;r>=va;)t[e++]=r&255|En,r/=128;for(;r&wa;)t[e++]=r&255|En,r>>>=7;return t[e]=r|0,An.bytes=e-n+1,t}var xa=mr,Ta=128,Cn=127;function mr(r,n){var e=0,n=n||0,i=0,u=n,l,m=r.length;do{if(u>=m)throw mr.bytes=0,new RangeError("Could not decode varint");l=r[u++],e+=i<28?(l&Cn)<<i:(l&Cn)*Math.pow(2,i),i+=7}while(l>=Ta);return mr.bytes=u-n,e}var Sa=Math.pow(2,7),Ea=Math.pow(2,14),Ca=Math.pow(2,21),Aa=Math.pow(2,28),Ba=Math.pow(2,35),Ia=Math.pow(2,42),Ra=Math.pow(2,49),Ma=Math.pow(2,56),Da=Math.pow(2,63),Oa=function(r){return r<Sa?1:r<Ea?2:r<Ca?3:r<Aa?4:r<Ba?5:r<Ia?6:r<Ra?7:r<Ma?8:r<Da?9:10},_a={encode:ba,decode:xa,encodingLength:Oa},Pa=_a,ue=Pa;var fe=(r,t=0)=>[ue.decode(r,t),ue.decode.bytes],zt=(r,t,e=0)=>(ue.encode(r,t,e),t),qt=r=>ue.encodingLength(r);var Ft=(r,t)=>{let e=t.byteLength,n=qt(r),i=n+qt(e),u=new Uint8Array(i+e);return zt(r,u,0),zt(e,u,n),u.set(t,i),new Gt(r,e,t,u)},Ae=r=>{let t=it(r),[e,n]=fe(t),[i,u]=fe(t.subarray(n)),l=t.subarray(n+u);if(l.byteLength!==i)throw new Error("Incorrect length");return new Gt(e,i,l,t)},Bn=(r,t)=>{if(r===t)return!0;{let e=t;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&yn(r.bytes,e.bytes)}},Gt=class{constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var br=({name:r,code:t,encode:e})=>new gr(r,t,e),gr=class{constructor(t,e,n){this.name=t,this.code=e,this.encode=n}digest(t){if(t instanceof Uint8Array){let e=this.encode(t);return e instanceof Uint8Array?Ft(this.code,e):e.then(n=>Ft(this.code,n))}else throw Error("Unknown type, must be binary type")}};var Fa=br({name:"sha2-256",code:18,encode:r=>it(yr.default.createHash("sha256").update(r).digest())}),ka=br({name:"sha2-512",code:19,encode:r=>it(yr.default.createHash("sha512").update(r).digest())});var vr={};rt(vr,{identity:()=>$a});var Rn=0,Na="identity",Mn=it,La=r=>Ft(Rn,Mn(r)),$a={code:Rn,name:Na,encode:Mn,digest:La};var Yu=new TextEncoder,Ku=new TextDecoder;var Dn=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return za(e,xr(r),t||z.encoder);default:return qa(e,xr(r),t||pt.encoder)}};var On=new WeakMap,xr=r=>{let t=On.get(r);if(t==null){let e=new Map;return On.set(r,e),e}return t},M=class{constructor(t,e,n,i){this.code=e,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}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:t,multihash:e}=this;if(t!==le)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==Ga)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return M.createV0(e)}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:t,digest:e}=this.multihash,n=Ft(t,e);return M.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(t){return M.equals(this,t)}static equals(t,e){let n=e;return n&&t.code===n.code&&t.version===n.version&&Bn(t.multihash,n.multihash)}toString(t){return Dn(this,t)}toJSON(){return{"/":Dn(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let e=t;if(e instanceof M)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:u,bytes:l}=e;return new M(n,i,u,l||_n(n,i,u.bytes))}else if(e[Za]===!0){let{version:n,multihash:i,code:u}=e,l=Ae(i);return M.create(n,u,l)}else return null}static create(t,e,n){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(e!==le)throw new Error(`Version 0 CID must use dag-pb (code: ${le}) block encoding`);return new M(t,e,n,n.bytes)}case 1:{let i=_n(t,e,n.bytes);return new M(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return M.create(0,le,t)}static createV1(t,e){return M.create(1,t,e)}static decode(t){let[e,n]=M.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=M.inspectBytes(t),n=e.size-e.multihashSize,i=it(t.subarray(n,n+e.multihashSize));if(i.byteLength!==e.multihashSize)throw new Error("Incorrect length");let u=i.subarray(e.multihashSize-e.digestSize),l=new Gt(e.multihashCode,e.digestSize,u,i);return[e.version===0?M.createV0(l):M.createV1(e.codec,l),t.subarray(e.size)]}static inspectBytes(t){let e=0,n=()=>{let[w,v]=fe(t.subarray(e));return e+=v,w},i=n(),u=le;if(i===18?(i=0,e=0):u=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let l=e,m=n(),b=n(),A=e+b,f=A-l;return{version:i,codec:u,multihashCode:m,digestSize:b,multihashSize:f,size:A}}static parse(t,e){let[n,i]=Va(t,e),u=M.decode(i);if(u.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return xr(u).set(n,t),u}},Va=(r,t)=>{switch(r[0]){case"Q":{let e=t||z;return[z.prefix,e.decode(`${z.prefix}${r}`)]}case z.prefix:{let e=t||z;return[z.prefix,e.decode(r)]}case pt.prefix:{let e=t||pt;return[pt.prefix,e.decode(r)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],t.decode(r)]}}},za=(r,t,e)=>{let{prefix:n}=e;if(n!==z.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let i=t.get(n);if(i==null){let u=e.encode(r).slice(1);return t.set(n,u),u}else return i},qa=(r,t,e)=>{let{prefix:n}=e,i=t.get(n);if(i==null){let u=e.encode(r);return t.set(n,u),u}else return i},le=112,Ga=18,_n=(r,t,e)=>{let n=qt(r),i=n+qt(t),u=new Uint8Array(i+e.byteLength);return zt(r,u,0),zt(t,u,n),u.set(e,i),u},Za=Symbol.for("@ipld/js-cid/CID");var pe={...sr,...or,...ir,...ar,...cr,...ur,...fr,...lr,...hr,...dr},uf={...wr,...vr};function Ht(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function Be(r=0){return globalThis.Buffer?.allocUnsafe!=null?Ht(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Fn(r,t,e,n){return{name:r,prefix:t,encoder:{name:r,prefix:t,encode:e},decoder:{decode:n}}}var Pn=Fn("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Tr=Fn("ascii","a",r=>{let t="a";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return t},r=>{r=r.substring(1);let t=Be(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),Ha={utf8:Pn,"utf-8":Pn,hex:pe.base16,latin1:Tr,ascii:Tr,binary:Tr,...pe},Ie=Ha;function K(r,t="utf8"){let e=Ie[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):e.encoder.encode(r).substring(1)}var kn=Bt.isIPv4,Wa=Bt.isIPv6,Sr=function(r){let t=0;if(r=r.toString().trim(),kn(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(Wa(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let u=kn(e[n]),l;u&&(l=Sr(e[n]),e[n]=K(l.slice(0,2),"base16")),l!=null&&++n<8&&e.splice(n,0,K(l.slice(2,4),"base16"))}if(e[0]==="")for(;e.length<8;)e.unshift("0");else if(e[e.length-1]==="")for(;e.length<8;)e.push("0");else if(e.length<8){for(n=0;n<e.length&&e[n]!=="";n++);let u=[n,1];for(n=9-e.length;n>0;n--)u.push("0");e.splice.apply(e,u)}let i=new Uint8Array(t+16);for(n=0;n<e.length;n++){let u=parseInt(e[n],16);i[t++]=u>>8&255,i[t++]=u&255}return i}throw new Error("invalid ip address")},Nn=function(r,t=0,e){t=~~t,e=e??r.length-t;let n=new DataView(r.buffer);if(e===4){let i=[];for(let u=0;u<e;u++)i.push(r[t+u]);return i.join(".")}if(e===16){let i=[];for(let u=0;u<e;u+=2)i.push(n.getUint16(t+u).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var he={},Er={},Xa=[[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"]];Xa.forEach(r=>{let t=Ya(...r);Er[t.code]=t,he[t.name]=t});function Ya(r,t,e,n,i){return{code:r,size:t,name:e,resolvable:!!n,path:!!i}}function O(r){if(typeof r=="number"){if(Er[r]!=null)return Er[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(he[r]!=null)return he[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var mt=j(Re(),1);function Br(r,t="utf8"){let e=Ie[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ht(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}function wt(r,t){t==null&&(t=r.reduce((i,u)=>i+u.length,0));let e=Be(t),n=0;for(let i of r)e.set(i,n),n+=i.length;return Ht(e)}function Yn(r,t){switch(O(r).code){case 4:case 41:return pc(t);case 42:return Jn(t);case 6:case 273:case 33:case 132:return Qn(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Jn(t);case 421:return gc(t);case 444:return Xn(t);case 445:return Xn(t);case 466:return mc(t);default:return K(t,"base16")}}function Kn(r,t){switch(O(r).code){case 4:return Hn(t);case 41:return Hn(t);case 42:return Wn(t);case 6:case 273:case 33:case 132:return Rr(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Wn(t);case 421:return hc(t);case 444:return bc(t);case 445:return yc(t);case 466:return dc(t);default:return Br(t,"base16")}}var Ir=Object.values(pe).map(r=>r.decoder),lc=function(){let r=Ir[0].or(Ir[1]);return Ir.slice(2).forEach(t=>r=r.or(t)),r}();function Hn(r){if(!Ee(r))throw new Error("invalid ip address");return Sr(r)}function pc(r){let t=Nn(r,0,r.length);if(t==null)throw new Error("ipBuff is required");if(!Ee(t))throw new Error("invalid ip address");return t}function Rr(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function Qn(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Wn(r){let t=Br(r),e=Uint8Array.from(mt.default.encode(t.length));return wt([e,t],e.length+t.length)}function Jn(r){let t=mt.default.decode(r);if(r=r.slice(mt.default.decode.bytes),r.length!==t)throw new Error("inconsistent lengths");return K(r)}function hc(r){let t;r[0]==="Q"||r[0]==="1"?t=Ae(z.decode(`z${r}`)).bytes:t=M.parse(r).multihash.bytes;let e=Uint8Array.from(mt.default.encode(t.length));return wt([e,t],e.length+t.length)}function dc(r){let t=lc.decode(r),e=Uint8Array.from(mt.default.encode(t.length));return wt([e,t],e.length+t.length)}function mc(r){let t=mt.default.decode(r),e=r.slice(mt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return"u"+K(e,"base64url")}function gc(r){let t=mt.default.decode(r),e=r.slice(mt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return K(e,"base58btc")}function bc(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==16)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion address.`);let e=pt.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Rr(n);return wt([e,i],e.length+i.length)}function yc(r){let t=r.split(":");if(t.length!==2)throw new Error(`failed to parse onion addr: ["'${t.join('", "')}'"]' does not contain a port number`);if(t[0].length!==56)throw new Error(`failed to parse onion addr: ${t[0]} not a Tor onion3 address.`);let e=pt.decode(`b${t[0]}`),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=Rr(n);return wt([e,i],e.length+i.length)}function Xn(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=K(t,"base32"),i=Qn(e);return`${n}:${i}`}var Wt=j(Re(),1);function wc(r){let t=[],e=r.split("/").slice(1);if(e.length===1&&e[0]==="")return[];for(let n=0;n<e.length;n++){let i=e[n],u=O(i);if(u.size===0){t.push([i]);continue}if(n++,n>=e.length)throw es("invalid address: "+r);if(u.path===!0){t.push([i,Pr(e.slice(n).join("/"))]);break}t.push([i,e[n]])}return t}function vc(r){let t=[];return r.map(e=>{let n=Oe(e);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),Pr(t.join("/"))}function xc(r){return r.map(t=>{Array.isArray(t)||(t=[t]);let e=Oe(t);return t.length>1?[e.code,Kn(e.code,t[1])]:[e.code]})}function Mr(r){return r.map(t=>{let e=Oe(t);return t[1]!=null?[e.code,Yn(e.code,t[1])]:[e.code]})}function Dr(r){return De(wt(r.map(t=>{let e=Oe(t),n=Uint8Array.from(Wt.default.encode(e.code));return t.length>1&&t[1]!=null&&(n=wt([n,t[1]])),n})))}function Or(r,t){return r.size>0?r.size/8:r.size===0?0:Wt.default.decode(t)+(Wt.default.decode.bytes??0)}function Me(r){let t=[],e=0;for(;e<r.length;){let n=Wt.default.decode(r,e),i=Wt.default.decode.bytes??0,u=O(n),l=Or(u,r.slice(e+i));if(l===0){t.push([n]),e+=i;continue}let m=r.slice(e+i,e+i+l);if(e+=l+i,e>r.length)throw es("Invalid address Uint8Array: "+K(r,"base16"));t.push([n,m])}return t}function _r(r){let t=Me(r),e=Mr(t);return vc(e)}function Tc(r){r=Pr(r);let t=wc(r),e=xc(t);return Dr(e)}function ts(r){return Tc(r)}function De(r){let t=Sc(r);if(t!=null)throw t;return Uint8Array.from(r)}function Sc(r){try{Me(r)}catch(t){return t}}function Pr(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function es(r){return new Error("Error parsing address: "+r)}function Oe(r){return O(r[0])}var kr=j(Re(),1);var as=j(ss(),1);function os(r,t){if(r===t)return!0;if(r.byteLength!==t.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==t[e])return!1;return!0}var Jt=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},Fr=function(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e},de,me,ge,is,Ac=Symbol.for("nodejs.util.inspect.custom"),Bc=[O("dns").code,O("dns4").code,O("dns6").code,O("dnsaddr").code],Ic=new Map,cs=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Rc(r){return!!r?.[cs]}var vt=class{constructor(t){if(de.set(this,void 0),me.set(this,void 0),ge.set(this,void 0),this[is]=!0,t==null&&(t=""),t instanceof Uint8Array)this.bytes=De(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);this.bytes=ts(t)}else if(Rc(t))this.bytes=De(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return Jt(this,de,"f")==null&&Fr(this,de,_r(this.bytes),"f"),Jt(this,de,"f")}toJSON(){return this.toString()}toOptions(){let t,e,n,i,u="",l=O("tcp"),m=O("udp"),b=O("ip4"),A=O("ip6"),f=O("dns6"),w=O("ip6zone");for(let[T,d]of this.stringTuples())T===w.code&&(u=`%${d??""}`),Bc.includes(T)&&(e=l.name,i=443,n=`${d??""}${u}`,t=T===f.code?6:4),(T===l.code||T===m.code)&&(e=O(T).name,i=parseInt(d??"")),(T===b.code||T===A.code)&&(e=O(T).name,n=`${d??""}${u}`,t=T===A.code?6:4);if(t==null||e==null||n==null||i==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:t,host:n,transport:e,port:i}}protos(){return this.protoCodes().map(t=>Object.assign({},O(t)))}protoCodes(){let t=[],e=this.bytes,n=0;for(;n<e.length;){let i=kr.default.decode(e,n),u=kr.default.decode.bytes??0,l=O(i),m=Or(l,e.slice(n+u));n+=m+u,t.push(i)}return t}protoNames(){return this.protos().map(t=>t.name)}tuples(){return Jt(this,me,"f")==null&&Fr(this,me,Me(this.bytes),"f"),Jt(this,me,"f")}stringTuples(){return Jt(this,ge,"f")==null&&Fr(this,ge,Mr(this.tuples()),"f"),Jt(this,ge,"f")}encapsulate(t){return t=new vt(t),new vt(this.toString()+t.toString())}decapsulate(t){let e=t.toString(),n=this.toString(),i=n.lastIndexOf(e);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${t.toString()}`);return new vt(n.slice(0,i))}decapsulateCode(t){let e=this.tuples();for(let n=e.length-1;n>=0;n--)if(e[n][0]===t)return new vt(Dr(e.slice(0,n)));return this}getPeerId(){try{let e=this.stringTuples().filter(n=>n[0]===he.ipfs.code).pop();if(e?.[1]!=null){let n=e[1];return n[0]==="Q"||n[0]==="1"?K(z.decode(`z${n}`),"base58btc"):K(M.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let t=null;try{t=this.stringTuples().filter(e=>O(e[0]).path===!0)[0][1],t==null&&(t=null)}catch{t=null}return t}equals(t){return os(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(u=>u.resolvable);if(e==null)return[this];let n=Ic.get(e.name);if(n==null)throw(0,as.default)(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(u=>new vt(u))}nodeAddress(){let t=this.toOptions();if(t.transport!=="tcp"&&t.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${t.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:t.family,address:t.host,port:t.port}}isThinWaistAddress(t){let e=(t??this).protos();return!(e.length!==2||e[0].code!==4&&e[0].code!==41||e[1].code!==6&&e[1].code!==273)}[(de=new WeakMap,me=new WeakMap,ge=new WeakMap,is=cs,Ac)](){return`Multiaddr(${_r(this.bytes)})`}};function xt(r){return new vt(r)}var Mc=x("dns4"),Dc=x("dns6"),Oc=x("dnsaddr"),kt=U(x("dns"),Oc,Mc,Dc),_e=U(x("ip4"),x("ip6")),Mt=U(S(_e,x("tcp")),S(kt,x("tcp"))),$r=S(_e,x("udp")),_c=S($r,x("utp")),Pc=S($r,x("quic")),be=U(S(Mt,x("ws")),S(kt,x("ws"))),ye=U(S(Mt,x("wss")),S(kt,x("wss")),S(Mt,x("tls"),x("ws")),S(kt,x("tls"),x("ws"))),Nr=U(S(Mt,x("http")),S(_e,x("http")),S(kt,x("http"))),Lr=U(S(Mt,x("https")),S(_e,x("https")),S(kt,x("https"))),us=S($r,x("webrtc-direct"),x("certhash")),ls=U(S(us,x("p2p")),us),ps=U(S(be,x("p2p-webrtc-star"),x("p2p")),S(ye,x("p2p-webrtc-star"),x("p2p")),S(be,x("p2p-webrtc-star")),S(ye,x("p2p-webrtc-star"))),el=U(S(be,x("p2p-websocket-star"),x("p2p")),S(ye,x("p2p-websocket-star"),x("p2p")),S(be,x("p2p-websocket-star")),S(ye,x("p2p-websocket-star"))),hs=U(S(Nr,x("p2p-webrtc-direct"),x("p2p")),S(Lr,x("p2p-webrtc-direct"),x("p2p")),S(Nr,x("p2p-webrtc-direct")),S(Lr,x("p2p-webrtc-direct"))),Yt=U(be,ye,Nr,Lr,ps,hs,Mt,_c,Pc,kt,ls),rl=U(S(Yt,x("p2p-stardust"),x("p2p")),S(Yt,x("p2p-stardust"))),Rt=U(S(Yt,x("p2p")),ps,hs,ls,x("p2p")),fs=U(S(Rt,x("p2p-circuit"),Rt),S(Rt,x("p2p-circuit")),S(x("p2p-circuit"),Rt),S(Yt,x("p2p-circuit")),S(x("p2p-circuit"),Yt),x("p2p-circuit")),ds=()=>U(S(fs,ds),fs),Xt=ds(),nl=U(S(Xt,Rt,Xt),S(Rt,Xt),S(Xt,Rt),Xt,Rt);var sl=U(S(Xt,x("webrtc")),S(Yt,x("webrtc")),x("webrtc"));function ms(r){function t(e){let n;try{n=xt(e)}catch{return!1}let i=r(n.protoNames());return i===null?!1:i===!0||i===!1?i:i.length===0}return t}function S(...r){function t(e){if(e.length<r.length)return null;let n=e;return r.some(i=>(n=typeof i=="function"?i().partialMatch(e):i.partialMatch(e),Array.isArray(n)&&(e=n),n===null)),n}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:ms(t),partialMatch:t}}function U(...r){function t(n){let i=null;return r.some(u=>{let l=typeof u=="function"?u().partialMatch(n):u.partialMatch(n);return l!=null?(i=l,!0):!1}),i}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:ms(t),partialMatch:t}}function x(r){let t=r;function e(i){let u;try{u=xt(i)}catch{return!1}let l=u.protoNames();return l.length===1&&l[0]===t}function n(i){return i.length===0?null:i[0]===t?i.slice(1):null}return{toString:function(){return t},matches:e,partialMatch:n}}var gt=j(As(),1);gt.default.formatters.b=r=>r==null?"undefined":z.baseEncode(r);gt.default.formatters.t=r=>r==null?"undefined":pt.baseEncode(r);gt.default.formatters.m=r=>r==null?"undefined":pr.baseEncode(r);gt.default.formatters.p=r=>r==null?"undefined":r.toString();gt.default.formatters.c=r=>r==null?"undefined":r.toString();gt.default.formatters.k=r=>r==null?"undefined":r.toString();function Dt(r){return Object.assign((0,gt.default)(r),{error:(0,gt.default)(`${r}:error`),trace:(0,gt.default)(`${r}:trace`)})}var Js=j(Ps(),1);var Tt=class extends Error{constructor(t="The operation was aborted"){super(t),this.code=Tt.code,this.type=Tt.type}static get code(){return"ABORT_ERR"}static get type(){return"aborted"}},at=class extends Error{constructor(t,e,n){super(t),this.code=e,this.name=n?.name??"CodeError",this.props=n??{}}};function $e(r){return this.subnetMask<r.subnetMask?!1:this.mask(r.subnetMask)===r.mask()}function Ue(r){return function(){return this.addressMinusSuffix!==this.correctForm()?!1:this.subnetMask===r&&!this.parsedSubnet?!0:this.parsedSubnet===String(this.subnetMask)}}var ne=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,Gr=/\/\d{1,2}$/;var G=class extends Error{constructor(t,e){super(t),this.name="AddressError",e!==null&&(this.parseMessage=e)}};var se=j(Zr(),1),Lt=j(we(),1),D=class{constructor(t){this.groups=4,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=Ue(32),this.isInSubnet=$e,this.address=t;let e=Gr.exec(t);if(e){if(this.parsedSubnet=e[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,this.subnetMask<0||this.subnetMask>32)throw new G("Invalid subnet mask.");t=t.replace(Gr,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}static isValid(t){try{return new D(t),!0}catch{return!1}}parse(t){let e=t.split(".");if(!t.match(ne))throw new G("Invalid IPv4 address.");return e}correctForm(){return this.parsedAddress.map(t=>parseInt(t,10)).join(".")}static fromHex(t){let e=t.replace(/:/g,"").padStart(8,"0"),n=[],i;for(i=0;i<8;i+=2){let u=e.slice(i,i+2);n.push(parseInt(u,16))}return new D(n.join("."))}static fromInteger(t){return D.fromHex(t.toString(16))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new D(n)}toHex(){return this.parsedAddress.map(t=>(0,Lt.sprintf)("%02x",parseInt(t,10))).join(":")}toArray(){return this.parsedAddress.map(t=>parseInt(t,10))}toGroup6(){let t=[],e;for(e=0;e<4;e+=2){let n=(0,Lt.sprintf)("%02x%02x",parseInt(this.parsedAddress[e],10),parseInt(this.parsedAddress[e+1],10));t.push((0,Lt.sprintf)("%x",parseInt(n,16)))}return t.join(":")}bigInteger(){return new se.BigInteger(this.parsedAddress.map(t=>(0,Lt.sprintf)("%02x",parseInt(t,10))).join(""),16)}_startAddress(){return new se.BigInteger(this.mask()+"0".repeat(32-this.subnetMask),2)}startAddress(){return D.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new se.BigInteger("1");return D.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new se.BigInteger(this.mask()+"1".repeat(32-this.subnetMask),2)}endAddress(){return D.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new se.BigInteger("1");return D.fromBigInteger(this._endAddress().subtract(t))}static fromBigInteger(t){return D.fromInteger(parseInt(t.toString(),10))}mask(t){return t===void 0&&(t=this.subnetMask),this.getBitsBase2(0,t)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}reverseForm(t){t||(t={});let e=this.correctForm().split(".").reverse().join(".");return t.omitSuffix?e:(0,Lt.sprintf)("%s.in-addr.arpa.",e)}isMulticast(){return this.isInSubnet(new D("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(32,"0")}groupForV6(){let t=this.parsedAddress;return this.address.replace(ne,(0,Lt.sprintf)('<span class="hover-group group-v4 group-6">%s</span>.<span class="hover-group group-v4 group-7">%s</span>',t.slice(0,2).join("."),t.slice(2,4).join(".")))}};var $s={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},Hr={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},Wr=/([^0-9a-f:/%])/gi,Jr=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,Xr=/\/\d{1,3}(?=%|$)/,Yr=/%.*$/,Us=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),js=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/);var zs=j(we(),1);function uu(r){return r.replace(/^(0+)/,'<span class="zero">$1</span>')}function ze(r,t=0){return r.split(":").map((n,i)=>/group-v4/.test(n)?n:(0,zs.sprintf)('<span class="hover-group group-%d">%s</span>',i+t,uu(n)))}var Ut=j(we(),1);function Qr(r){return(0,Ut.sprintf)("(%s)",r.join("|"))}function Kr(r){return r.length<4?(0,Ut.sprintf)("0{0,%d}%s",4-r.length,r):r}var tn="[^A-Fa-f0-9:]";function qe(r){let t=[];r.forEach((n,i)=>{parseInt(n,16)===0&&t.push(i)});let e=t.map(n=>r.map((i,u)=>{if(u===n){let l=u===0||u===8-1?":":"";return Qr([Kr(i),l])}return Kr(i)}).join(":"));return e.push(r.map(Kr).join(":")),Qr(e)}function en(r,t,e){let n=t?"":":",i=e?"":":",u=[];!t&&!e&&u.push("::"),t&&e&&u.push(""),(e&&!t||!e&&t)&&u.push(":"),u.push((0,Ut.sprintf)("%s(:0{1,4}){1,%d}",n,r-1)),u.push((0,Ut.sprintf)("(0{1,4}:){1,%d}%s",r-1,i)),u.push((0,Ut.sprintf)("(0{1,4}:){%d}0{1,4}",r-1));for(let l=1;l<r-1;l++)for(let m=1;m<r-l;m++)u.push((0,Ut.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",m,r-m-l-1));return Qr(u)}var Z=j(Zr(),1),H=j(we(),1);function Ge(r){if(!r)throw new Error("Assertion failed.")}function fu(r){let t=/(\d+)(\d{3})/;for(;t.test(r);)r=r.replace(t,"$1,$2");return r}function lu(r){return r=r.replace(/^(0{1,})([1-9]+)$/,'<span class="parse-error">$1</span>$2'),r=r.replace(/^(0{1,})(0)$/,'<span class="parse-error">$1</span>$2'),r}function pu(r,t){let e=[],n=[],i;for(i=0;i<r.length;i++)i<t[0]?e.push(r[i]):i>t[1]&&n.push(r[i]);return e.concat(["compact"]).concat(n)}function Gs(r){return(0,H.sprintf)("%04x",parseInt(r,16))}function Zs(r){return r&255}var P=class{constructor(t,e){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=$e,this.isCorrect=Ue(128),e===void 0?this.groups=8:this.groups=e,this.address=t;let n=Xr.exec(t);if(n){if(this.parsedSubnet=n[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>128)throw new G("Invalid subnet mask.");t=t.replace(Xr,"")}else if(/\//.test(t))throw new G("Invalid subnet mask.");let i=Yr.exec(t);i&&(this.zone=i[0],t=t.replace(Yr,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new P(t),!0}catch{return!1}}static fromBigInteger(t){let e=t.toString(16).padStart(32,"0"),n=[],i;for(i=0;i<8;i++)n.push(e.slice(i*4,(i+1)*4));return new P(n.join(":"))}static fromURL(t){let e,n=null,i;if(t.indexOf("[")!==-1&&t.indexOf("]:")!==-1){if(i=js.exec(t),i===null)return{error:"failed to parse address with port",address:null,port:null};e=i[1],n=i[2]}else if(t.indexOf("/")!==-1){if(t=t.replace(/^[a-z0-9]+:\/\//,""),i=Us.exec(t),i===null)return{error:"failed to parse address from URL",address:null,port:null};e=i[1]}else e=t;return n?(n=parseInt(n,10),(n<0||n>65536)&&(n=null)):n=null,{address:new P(e),port:n}}static fromAddress4(t){let e=new D(t),n=128-(32-e.subnetMask);return new P(`::ffff:${e.correctForm()}/${n}`)}static fromArpa(t){let e=t.replace(/(\.ip6\.arpa)?\.$/,""),n=7;if(e.length!==63)throw new G("Invalid 'ip6.arpa' form.");let i=e.split(".").reverse();for(let u=n;u>0;u--){let l=u*4;i.splice(l,0,":")}return e=i.join(""),new P(e)}microsoftTranscription(){return(0,H.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(t=this.subnetMask){return this.getBitsBase2(0,t)}possibleSubnets(t=128){let e=128-this.subnetMask,n=Math.abs(t-128),i=e-n;return i<0?"0":fu(new Z.BigInteger("2",10).pow(i).toString(10))}_startAddress(){return new Z.BigInteger(this.mask()+"0".repeat(128-this.subnetMask),2)}startAddress(){return P.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new Z.BigInteger("1");return P.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new Z.BigInteger(this.mask()+"1".repeat(128-this.subnetMask),2)}endAddress(){return P.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new Z.BigInteger("1");return P.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=$s[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&t!=="Link local"&&(t="Global"),t||"Unknown"}getType(){for(let t of Object.keys(Hr))if(this.isInSubnet(new P(t)))return Hr[t];return"Global unicast"}getBits(t,e){return new Z.BigInteger(this.getBitsBase2(t,e),2)}getBitsBase2(t,e){return this.binaryZeroPad().slice(t,e)}getBitsBase16(t,e){let n=e-t;if(n%4!==0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(t,e).toString(16).padStart(n/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,128)}reverseForm(t){t||(t={});let e=Math.floor(this.subnetMask/4),n=this.canonicalForm().replace(/:/g,"").split("").slice(0,e).reverse().join(".");return e>0?t.omitSuffix?n:(0,H.sprintf)("%s.ip6.arpa.",n):t.omitSuffix?"":"ip6.arpa."}correctForm(){let t,e=[],n=0,i=[];for(t=0;t<this.parsedAddress.length;t++){let m=parseInt(this.parsedAddress[t],16);m===0&&n++,m!==0&&n>0&&(n>1&&i.push([t-n,t-1]),n=0)}n>1&&i.push([this.parsedAddress.length-n,this.parsedAddress.length-1]);let u=i.map(m=>m[1]-m[0]+1);if(i.length>0){let m=u.indexOf(Math.max(...u));e=pu(this.parsedAddress,i[m])}else e=this.parsedAddress;for(t=0;t<e.length;t++)e[t]!=="compact"&&(e[t]=parseInt(e[t],16).toString(16));let l=e.join(":");return l=l.replace(/^compact$/,"::"),l=l.replace(/^compact|compact$/,":"),l=l.replace(/compact/,""),l}binaryZeroPad(){return this.bigInteger().toString(2).padStart(128,"0")}parse4in6(t){let e=t.split(":"),i=e.slice(-1)[0].match(ne);if(i){this.parsedAddress4=i[0],this.address4=new D(this.parsedAddress4);for(let u=0;u<this.address4.groups;u++)if(/^0[0-9]+/.test(this.address4.parsedAddress[u]))throw new G("IPv4 addresses can't have leading zeroes.",t.replace(ne,this.address4.parsedAddress.map(lu).join(".")));this.v4=!0,e[e.length-1]=this.address4.toGroup6(),t=e.join(":")}return t}parse(t){t=this.parse4in6(t);let e=t.match(Wr);if(e)throw new G((0,H.sprintf)("Bad character%s detected in address: %s",e.length>1?"s":"",e.join("")),t.replace(Wr,'<span class="parse-error">$1</span>'));let n=t.match(Jr);if(n)throw new G((0,H.sprintf)("Address failed regex: %s",n.join("")),t.replace(Jr,'<span class="parse-error">$1</span>'));let i=[],u=t.split("::");if(u.length===2){let l=u[0].split(":"),m=u[1].split(":");l.length===1&&l[0]===""&&(l=[]),m.length===1&&m[0]===""&&(m=[]);let b=this.groups-(l.length+m.length);if(!b)throw new G("Error parsing groups");this.elidedGroups=b,this.elisionBegin=l.length,this.elisionEnd=l.length+this.elidedGroups,i=i.concat(l);for(let A=0;A<b;A++)i.push("0");i=i.concat(m)}else if(u.length===1)i=t.split(":"),this.elidedGroups=0;else throw new G("Too many :: groups found");if(i=i.map(l=>(0,H.sprintf)("%x",parseInt(l,16))),i.length!==this.groups)throw new G("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(Gs).join(":")}decimal(){return this.parsedAddress.map(t=>(0,H.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new Z.BigInteger(this.parsedAddress.map(Gs).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return D.fromHex(new Z.BigInteger(t.slice(96,128).join(""),2).toString(16))}to4in6(){let t=this.to4(),n=new P(this.parsedAddress.slice(0,6).join(":"),6).correctForm(),i="";return/:$/.test(n)||(i=":"),n+i+t.address}inspectTeredo(){let t=this.getBitsBase16(0,32),e=this.getBits(80,96).xor(new Z.BigInteger("ffff",16)).toString(),n=D.fromHex(this.getBitsBase16(32,64)),i=D.fromHex(this.getBits(96,128).xor(new Z.BigInteger("ffffffff",16)).toString(16)),u=this.getBits(64,80),l=this.getBitsBase2(64,80),m=u.testBit(15),b=u.testBit(14),A=u.testBit(8),f=u.testBit(9),w=new Z.BigInteger(l.slice(2,6)+l.slice(8,16),2).toString(10);return{prefix:(0,H.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:i.address,flags:l,coneNat:m,microsoft:{reserved:b,universalLocal:f,groupIndividual:A,nonce:w},udpPort:e}}inspect6to4(){let t=this.getBitsBase16(0,16),e=D.fromHex(this.getBitsBase16(16,48));return{prefix:(0,H.sprintf)("%s",t.slice(0,4)),gateway:e.address}}to6to4(){if(!this.is4())return null;let t=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new P(t)}toByteArray(){let t=this.bigInteger().toByteArray();return t.length===17&&t[0]===0?t.slice(1):t}toUnsignedByteArray(){return this.toByteArray().map(Zs)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(Zs))}static fromUnsignedByteArray(t){let e=new Z.BigInteger("256",10),n=new Z.BigInteger("0",10),i=new Z.BigInteger("1",10);for(let u=t.length-1;u>=0;u--)n=n.add(i.multiply(new Z.BigInteger(t[u].toString(10),10))),i=i.multiply(e);return P.fromBigInteger(n)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return this.getBitsBase2(0,64)==="1111111010000000000000000000000000000000000000000000000000000000"}isMulticast(){return this.getType()==="Multicast"}is4(){return this.v4}isTeredo(){return this.isInSubnet(new P("2001::/32"))}is6to4(){return this.isInSubnet(new P("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(t){return t===void 0?t="":t=(0,H.sprintf)(":%s",t),(0,H.sprintf)("http://[%s]%s/",this.correctForm(),t)}link(t){t||(t={}),t.className===void 0&&(t.className=""),t.prefix===void 0&&(t.prefix="/#address="),t.v4===void 0&&(t.v4=!1);let e=this.correctForm;return t.v4&&(e=this.to4in6),t.className?(0,H.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,e.call(this),t.className):(0,H.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,e.call(this))}group(){if(this.elidedGroups===0)return ze(this.address).join(":");Ge(typeof this.elidedGroups=="number"),Ge(typeof this.elisionBegin=="number");let t=[],[e,n]=this.address.split("::");e.length?t.push(...ze(e)):t.push("");let i=["hover-group"];for(let u=this.elisionBegin;u<this.elisionBegin+this.elidedGroups;u++)i.push((0,H.sprintf)("group-%d",u));return t.push((0,H.sprintf)('<span class="%s"></span>',i.join(" "))),n.length?t.push(...ze(n,this.elisionEnd)):t.push(""),this.is4()&&(Ge(this.address4 instanceof D),t.pop(),t.push(this.address4.groupForV6())),t.join(":")}regularExpressionString(t=!1){let e=[],n=new P(this.correctForm());if(n.elidedGroups===0)e.push(qe(n.parsedAddress));else if(n.elidedGroups===8)e.push(en(8));else{let i=n.address.split("::");i[0].length&&e.push(qe(i[0].split(":"))),Ge(typeof n.elidedGroups=="number"),e.push(en(n.elidedGroups,i[0].length!==0,i[1].length!==0)),i[1].length&&e.push(qe(i[1].split(":"))),e=[e.join(":")]}return t||(e=["(?=^|",tn,"|[^\\w\\:])(",...e,")(?=[^\\w\\:]|",tn,"|$)"]),e.join("")}regularExpression(t=!1){return new RegExp(this.regularExpressionString(t),"i")}};var hu=Dt("libp2p:ip-port-to-multiaddr"),rn={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function Hs(r,t){if(typeof r!="string")throw new at(`invalid ip provided: ${r}`,rn.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw new at(`invalid port provided: ${t}`,rn.ERR_INVALID_PORT_PARAMETER);try{return new D(r),xt(`/ip4/${r}/tcp/${t}`)}catch{}try{let e=new P(r);return e.is4()?xt(`/ip4/${e.to4().correctForm()}/tcp/${t}`):xt(`/ip6/${r}/tcp/${t}`)}catch{let n=`invalid ip:port for creating a multiaddr: ${r}:${t}`;throw hu.error(n),new at(n,rn.ERR_INVALID_IP)}}var nn=j(yt("os"),1),Ws=j(yt("path"),1),du={ip4:"IPv4",ip6:"IPv6"};function ie(r){let t=r.getPath();return t!=null?nn.default.platform()==="win32"?{path:Ws.default.join("\\\\.\\pipe\\",t)}:{path:t}:r.toOptions()}function sn(r,t,e){let n=i=>xt(`/${r}/${i}/tcp/${e}`);return(mu(t)?bu(du[r]):[t]).map(n)}function mu(r){return["0.0.0.0","::"].includes(r)}var gu=nn.default.networkInterfaces();function bu(r){let t=[];for(let[,e]of Object.entries(gu))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var dt=Dt("libp2p:tcp:socket"),Ze=(r,t)=>{let e=t.metrics,n=t.metricPrefix??"",i=t.socketInactivityTimeout??3e5,u=t.socketCloseTimeout??2e3;t.listeningAddr?.getPath()!=null&&(t.remoteAddr=t.listeningAddr),t.remoteAddr?.getPath()!=null&&(t.localAddr=t.remoteAddr);let l;if(t.remoteAddr!=null)l=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new at("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");l=Hs(r.remoteAddress,r.remotePort)}let m=ie(l),b=m.path??`${m.host??""}:${m.port??""}`,{sink:A,source:f}=Js.default.duplex(r);r.setTimeout(i,()=>{dt("%s socket read timeout",b),e?.increment({[`${n}timeout`]:!0});let v;r.readable&&(v=new at("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(v)}),r.once("close",()=>{dt("%s socket close",b),e?.increment({[`${n}close`]:!0}),w.timeline.close==null&&(w.timeline.close=Date.now())}),r.once("end",()=>{dt("%s socket end",b),e?.increment({[`${n}end`]:!0})});let w={async sink(v){try{await A(v)}catch(T){T.type!=="aborted"&&dt(T)}r.end()},source:f,remoteAddr:l,timeline:{open:Date.now()},async close(){if(r.destroyed){dt("%s socket was already destroyed when trying to close",b);return}dt("%s closing socket",b),await new Promise((v,T)=>{let d=Date.now(),C=setTimeout(()=>{r.destroyed?(dt("%s is already destroyed",b),v()):(dt("%s socket close timeout after %dms, destroying it manually",b,Date.now()-d),r.destroy(new at("Socket close timeout","ERR_SOCKET_CLOSE_TIMEOUT")))},u).unref();r.once("close",()=>{dt("%s socket closed",b),clearTimeout(C),v()}),r.once("error",I=>{dt("%s socket error",b,I),w.timeline.close==null&&(w.timeline.close=Date.now()),r.destroyed&&clearTimeout(C),T(I)}),r.setTimeout(u),r.end(),r.writableLength>0?r.once("drain",()=>{dt("%s socket drained",b),r.destroy()}):r.destroy()})}};return w};var Xs=j(yt("net"),1);var jt=function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},Et,He=class extends EventTarget{constructor(){super(...arguments),Et.set(this,new Map)}listenerCount(t){let e=jt(this,Et,"f").get(t);return e==null?0:e.length}addEventListener(t,e,n){super.addEventListener(t,e,n);let i=jt(this,Et,"f").get(t);i==null&&(i=[],jt(this,Et,"f").set(t,i)),i.push({callback:e,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(t,e,n){super.removeEventListener(t.toString(),e??null,n);let i=jt(this,Et,"f").get(t);i!=null&&(i=i.filter(({callback:u})=>u!==e),jt(this,Et,"f").set(t,i))}dispatchEvent(t){let e=super.dispatchEvent(t),n=jt(this,Et,"f").get(t.type);return n==null||(n=n.filter(({once:i})=>!i),jt(this,Et,"f").set(t.type,n)),e}safeDispatchEvent(t,e){return this.dispatchEvent(new ae(t,e))}};Et=new WeakMap;var on=class extends Event{constructor(t,e){super(t,e),this.detail=e?.detail}},ae=globalThis.CustomEvent??on;var st=Dt("libp2p:tcp:listener");async function an(r){try{await r.close()}catch(t){st.error("an error occurred closing the connection",t)}}var vu=1,xu=0,We=class extends He{constructor(t){if(super(),this.context=t,this.connections=new Set,this.status={started:!1},t.keepAlive=t.keepAlive??!0,this.addr="unknown",this.server=Xs.default.createServer(t,this.onSocket.bind(this)),t.maxConnections!==void 0&&(this.server.maxConnections=t.maxConnections),t.closeServerOnMaxConnections!=null&&t.closeServerOnMaxConnections.closeAbove<t.closeServerOnMaxConnections.listenBelow)throw Error("closeAbove must be >= listenBelow");this.server.on("listening",()=>{if(t.metrics!=null){let e=this.server.address();e==null?this.addr="unknown":typeof e=="string"?this.addr=e:this.addr=`${e.address}:${e.port}`,t.metrics?.registerMetricGroup("libp2p_tcp_inbound_connections_total",{label:"address",help:"Current active connections in TCP listener",calculate:()=>({[this.addr]:this.connections.size})}),this.metrics={status:t.metrics.registerMetricGroup("libp2p_tcp_listener_status_info",{label:"address",help:"Current status of the TCP listener socket"}),errors:t.metrics.registerMetricGroup("libp2p_tcp_listener_errors_total",{label:"address",help:"Total count of TCP listener errors by type"}),events:t.metrics.registerMetricGroup("libp2p_tcp_listener_events_total",{label:"address",help:"Total count of TCP listener events by type"})},this.metrics?.status.update({[this.addr]:vu})}this.dispatchEvent(new ae("listening"))}).on("error",e=>{this.metrics?.errors.increment({[`${this.addr} listen_error`]:!0}),this.dispatchEvent(new ae("error",{detail:e}))}).on("close",()=>{this.metrics?.status.update({[this.addr]:xu}),this.dispatchEvent(new ae("close"))})}onSocket(t){t.on("error",n=>{st("socket error",n),this.metrics?.events.increment({[`${this.addr} error`]:!0})});let e;try{e=Ze(t,{listeningAddr:this.status.started?this.status.listeningAddr:void 0,socketInactivityTimeout:this.context.socketInactivityTimeout,socketCloseTimeout:this.context.socketCloseTimeout,metrics:this.metrics?.events,metricPrefix:`${this.addr} `})}catch(n){st.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_to_connection`]:!0});return}st("new inbound connection %s",e.remoteAddr);try{this.context.upgrader.upgradeInbound(e).then(n=>{st("inbound connection upgraded %s",e.remoteAddr),this.connections.add(e),t.once("close",()=>{this.connections.delete(e),this.context.closeServerOnMaxConnections!=null&&this.connections.size<this.context.closeServerOnMaxConnections.listenBelow&&this.netListen().catch(i=>{st.error("error attempting to listen server once connection count under limit",i),this.context.closeServerOnMaxConnections?.onListenError?.(i)})}),this.context.handler!=null&&this.context.handler(n),this.context.closeServerOnMaxConnections!=null&&this.connections.size>=this.context.closeServerOnMaxConnections.closeAbove&&this.netClose(),this.dispatchEvent(new ae("connection",{detail:n}))}).catch(async n=>{st.error("inbound connection failed",n),this.metrics?.errors.increment({[`${this.addr} inbound_upgrade`]:!0}),await an(e)}).catch(n=>{st.error("closing inbound connection failed",n)})}catch(n){st.error("inbound connection failed",n),an(e).catch(i=>{st.error("closing inbound connection failed",i),this.metrics?.errors.increment({[`${this.addr} inbound_closing_failed`]:!0})})}}getAddrs(){if(!this.status.started)return[];let t=[],e=this.server.address(),{listeningAddr:n,peerId:i}=this.status;if(e==null)return[];if(typeof e=="string")t=[n];else try{n.toString().startsWith("/ip4")?t=t.concat(sn("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(sn("ip6",e.address,e.port)))}catch(u){st.error("could not turn %s:%s into multiaddr",e.address,e.port,u)}return t.map(u=>i!=null?u.encapsulate(`/p2p/${i}`):u)}async listen(t){if(this.status.started)throw Error("server is already listening");let e=t.getPeerId(),n=e==null?t.decapsulateCode(421):t;this.status={started:!0,listeningAddr:n,peerId:e,netConfig:ie(n)},await this.netListen()}async close(){await Promise.all(Array.from(this.connections.values()).map(async t=>{await an(t)})),this.netClose()}async netListen(){if(!this.status.started||this.server.listening)return;let t=this.status.netConfig;await new Promise((e,n)=>{this.server.once("error",n),this.server.listen(t,e)}),st("Listening on %s",this.server.address())}netClose(){!this.status.started||!this.server.listening||(st("Closing server on %s",this.server.address()),this.server.close())}};var Ks=Symbol.for("@libp2p/transport");var Ys;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(Ys||(Ys={}));var Ct=Dt("libp2p:tcp"),un=class{constructor(t,e={}){this.opts=e,this.components=t,t.metrics!=null&&(this.metrics={dialerEvents:t.metrics.registerCounterGroup("libp2p_tcp_dialer_events_total",{label:"event",help:"Total count of TCP dialer events by type"})})}get[Ks](){return!0}get[Symbol.toStringTag](){return"@libp2p/tcp"}async dial(t,e){e.keepAlive=e.keepAlive??!0;let n=await this._connect(t,e);n.on("error",m=>{Ct("socket error",m)});let i=Ze(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents}),u=()=>{i.close().catch(m=>{Ct.error("Error closing maConn after abort",m)})};e.signal?.addEventListener("abort",u,{once:!0}),Ct("new outbound connection %s",i.remoteAddr);let l=await e.upgrader.upgradeOutbound(i);if(Ct("outbound connection %s upgraded",i.remoteAddr),e.signal?.removeEventListener("abort",u),e.signal?.aborted===!0)throw l.close().catch(m=>{Ct.error("Error closing conn after abort",m)}),new Tt;return l}async _connect(t,e){if(e.signal?.aborted===!0)throw new Tt;return await new Promise((n,i)=>{let u=Date.now(),l=ie(t),m=l.path??`${l.host??""}:${l.port}`;Ct("dialing %j",l);let b=Qs.default.connect(l),A=d=>{d.message=`connection error ${m}: ${d.message}`,this.metrics?.dialerEvents.increment({error:!0}),T(d)},f=()=>{Ct("connection timeout %s",m),this.metrics?.dialerEvents.increment({timeout:!0});let d=new at(`connection timeout after ${Date.now()-u}ms`,"ERR_CONNECT_TIMEOUT");b.emit("error",d)},w=()=>{Ct("connection opened %j",l),this.metrics?.dialerEvents.increment({connect:!0}),T()},v=()=>{Ct("connection aborted %j",l),this.metrics?.dialerEvents.increment({abort:!0}),b.destroy(),T(new Tt)},T=d=>{if(b.removeListener("error",A),b.removeListener("timeout",f),b.removeListener("connect",w),e.signal!=null&&e.signal.removeEventListener("abort",v),d!=null){i(d);return}n(b)};b.on("error",A),b.on("timeout",f),b.on("connect",w),e.signal!=null&&e.signal.addEventListener("abort",v)})}createListener(t){return new We({...t,maxConnections:this.opts.maxConnections,closeServerOnMaxConnections:this.opts.closeServerOnMaxConnections,socketInactivityTimeout:this.opts.inboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.components.metrics})}filter(t){return t=Array.isArray(t)?t:[t],t.filter(e=>e.protoCodes().includes(290)?!1:e.protoCodes().includes(400)?!0:Mt.matches(e.decapsulateCode(421)))}};function Eu(r={}){return(t={})=>new un(t,r)}return Ui(Cu);})();
|
|
7
7
|
return Libp2PTcp}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/tcp",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.4",
|
|
4
4
|
"description": "A TCP transport for libp2p",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p-tcp#readme",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"@libp2p/interfaces": "^3.2.0",
|
|
148
148
|
"@libp2p/logger": "^2.0.0",
|
|
149
149
|
"@libp2p/utils": "^3.0.2",
|
|
150
|
-
"@multiformats/mafmt": "^
|
|
150
|
+
"@multiformats/mafmt": "^12.0.0",
|
|
151
151
|
"@multiformats/multiaddr": "^12.0.0",
|
|
152
152
|
"stream-to-it": "^0.2.2"
|
|
153
153
|
},
|