@libp2p/tcp 6.1.4 → 6.1.5
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 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(`
|
|
2
|
+
"use strict";var Libp2PTcp=(()=>{var Li=Object.create;var Te=Object.defineProperty;var Ui=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames;var ji=Object.getPrototypeOf,Vi=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 F=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),rt=(r,t)=>{for(var e in t)Te(r,e,{get:t[e],enumerable:!0})},bn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $i(t))!Vi.call(r,i)&&i!==e&&Te(r,i,{get:()=>t[i],enumerable:!(n=Ui(t,i))||n.enumerable});return r};var j=(r,t,e)=>(e=r!=null?Li(ji(r)):{},bn(t||!r||!r.__esModule?Te(e,"default",{value:r,enumerable:!0}):e,r)),zi=r=>bn(Te({},"__esModule",{value:!0}),r);var jn=F((Pf,$n)=>{$n.exports=Ar;var Un=128,ec=127,rc=~ec,nc=Math.pow(2,31);function Ar(r,t,e){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Ar.bytes=0,new RangeError("Could not encode varint");t=t||[],e=e||0;for(var n=e;r>=nc;)t[e++]=r&255|Un,r/=128;for(;r&rc;)t[e++]=r&255|Un,r>>>=7;return t[e]=r|0,Ar.bytes=e-n+1,t}});var Gn=F((kf,zn)=>{zn.exports=Ir;var sc=128,Vn=127;function Ir(r,n){var e=0,n=n||0,i=0,u=n,f,d=r.length;do{if(u>=d||i>49)throw Ir.bytes=0,new RangeError("Could not decode varint");f=r[u++],e+=i<28?(f&Vn)<<i:(f&Vn)*Math.pow(2,i),i+=7}while(f>=sc);return Ir.bytes=u-n,e}});var Hn=F((Of,qn)=>{var oc=Math.pow(2,7),ic=Math.pow(2,14),ac=Math.pow(2,21),cc=Math.pow(2,28),uc=Math.pow(2,35),fc=Math.pow(2,42),lc=Math.pow(2,49),pc=Math.pow(2,56),hc=Math.pow(2,63);qn.exports=function(r){return r<oc?1:r<ic?2:r<ac?3:r<cc?4:r<uc?5:r<fc?6:r<lc?7:r<pc?8:r<hc?9:10}});var Re=F((_f,Zn)=>{Zn.exports={encode:jn(),decode:Gn(),encodingLength:Hn()}});var as=F(($l,is)=>{"use strict";function os(r,t){for(let e in t)Object.defineProperty(r,e,{value:t[e],enumerable:!0,configurable:!0});return r}function kc(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 os(r,e)}catch{e.message=r.message,e.stack=r.stack;let i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(r)),os(new i,e)}}is.exports=kc});var vs=F((op,ys)=>{var Kt=1e3,Qt=Kt*60,te=Qt*60,Nt=te*24,Gc=Nt*7,qc=Nt*365.25;ys.exports=function(r,t){t=t||{};var e=typeof r;if(e==="string"&&r.length>0)return Hc(r);if(e==="number"&&isFinite(r))return t.long?Wc(r):Zc(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Hc(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*qc;case"weeks":case"week":case"w":return e*Gc;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 Zc(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 Wc(r){var t=Math.abs(r);return t>=Nt?_e(r,t,Nt,"day"):t>=te?_e(r,t,te,"hour"):t>=Qt?_e(r,t,Qt,"minute"):t>=Kt?_e(r,t,Kt,"second"):r+" ms"}function _e(r,t,e,n){var i=t>=e*1.5;return Math.round(r/e)+" "+n+(i?"s":"")}});var jr=F((ip,xs)=>{function Xc(r){e.debug=e,e.default=e,e.coerce=g,e.disable=u,e.enable=i,e.enabled=f,e.humanize=vs(),e.destroy=C,Object.keys(r).forEach(l=>{e[l]=r[l]}),e.names=[],e.skips=[],e.formatters={};function t(l){let w=0;for(let v=0;v<l.length;v++)w=(w<<5)-w+l.charCodeAt(v),w|=0;return e.colors[Math.abs(w)%e.colors.length]}e.selectColor=t;function e(l){let w,v=null,S,m;function A(...B){if(!A.enabled)return;let E=A,I=Number(new Date),_=I-(w||I);E.diff=_,E.prev=w,E.curr=I,w=I,B[0]=e.coerce(B[0]),typeof B[0]!="string"&&B.unshift("%O");let N=0;B[0]=B[0].replace(/%([a-zA-Z%])/g,(J,W)=>{if(J==="%%")return"%";N++;let Y=e.formatters[W];if(typeof Y=="function"){let ut=B[N];J=Y.call(E,ut),B.splice(N,1),N--}return J}),e.formatArgs.call(E,B),(E.log||e.log).apply(E,B)}return A.namespace=l,A.useColors=e.useColors(),A.color=e.selectColor(l),A.extend=n,A.destroy=e.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(S!==e.namespaces&&(S=e.namespaces,m=e.enabled(l)),m),set:B=>{v=B}}),typeof e.init=="function"&&e.init(A),A}function n(l,w){let v=e(this.namespace+(typeof w>"u"?":":w)+l);return v.log=this.log,v}function i(l){e.save(l),e.namespaces=l,e.names=[],e.skips=[];let w,v=(typeof l=="string"?l:"").split(/[\s,]+/),S=v.length;for(w=0;w<S;w++)v[w]&&(l=v[w].replace(/\*/g,".*?"),l[0]==="-"?e.skips.push(new RegExp("^"+l.slice(1)+"$")):e.names.push(new RegExp("^"+l+"$")))}function u(){let l=[...e.names.map(d),...e.skips.map(d).map(w=>"-"+w)].join(",");return e.enable(""),l}function f(l){if(l[l.length-1]==="*")return!0;let w,v;for(w=0,v=e.skips.length;w<v;w++)if(e.skips[w].test(l))return!1;for(w=0,v=e.names.length;w<v;w++)if(e.names[w].test(l))return!0;return!1}function d(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function g(l){return l instanceof Error?l.stack||l.message:l}function C(){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}xs.exports=Xc});var Ss=F((nt,Fe)=>{nt.formatArgs=Yc;nt.save=Kc;nt.load=Qc;nt.useColors=Jc;nt.storage=tu();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 Jc(){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 Yc(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 Kc(r){try{r?nt.storage.setItem("debug",r):nt.storage.removeItem("debug")}catch{}}function Qc(){let r;try{r=nt.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function tu(){try{return localStorage}catch{}}Fe.exports=jr()(nt);var{formatters:eu}=Fe.exports;eu.j=function(r){try{return JSON.stringify(r)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Es=F((ap,Ts)=>{"use strict";Ts.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 As=F((cp,Cs)=>{"use strict";var ru=yt("os"),dt=Es(),G=process.env,ee;dt("no-color")||dt("no-colors")||dt("color=false")?ee=!1:(dt("color")||dt("colors")||dt("color=true")||dt("color=always"))&&(ee=!0);"FORCE_COLOR"in G&&(ee=G.FORCE_COLOR.length===0||parseInt(G.FORCE_COLOR,10)!==0);function nu(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function su(r){if(ee===!1)return 0;if(dt("color=16m")||dt("color=full")||dt("color=truecolor"))return 3;if(dt("color=256"))return 2;if(r&&!r.isTTY&&ee!==!0)return 0;let t=ee?1:0;if(process.platform==="win32"){let e=ru.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 G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in G)||G.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let e=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:(G.TERM==="dumb",t)}function Vr(r){let t=su(r);return nu(t)}Cs.exports={supportsColor:Vr,stdout:Vr(process.stdout),stderr:Vr(process.stderr)}});var Bs=F((V,Le)=>{var ou=yt("tty"),Ne=yt("util");V.init=pu;V.log=uu;V.formatArgs=au;V.save=fu;V.load=lu;V.useColors=iu;V.destroy=Ne.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=As();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 iu(){return"colors"in V.inspectOpts?!!V.inspectOpts.colors:ou.isatty(process.stderr.fd)}function au(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
|
-
`+u),r.push(i+"m+"+
|
|
5
|
-
`)}function
|
|
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);})();
|
|
4
|
+
`+u),r.push(i+"m+"+Le.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=cu()+t+" "+r[0]}function cu(){return V.inspectOpts.hideDate?"":new Date().toISOString()+" "}function uu(...r){return process.stderr.write(Ne.format(...r)+`
|
|
5
|
+
`)}function fu(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function lu(){return process.env.DEBUG}function pu(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]]}Le.exports=jr()(V);var{formatters:Is}=Le.exports;Is.o=function(r){return this.inspectOpts.colors=this.useColors,Ne.inspect(r,this.inspectOpts).split(`
|
|
6
|
+
`).map(t=>t.trim()).join(" ")};Is.O=function(r){return this.inspectOpts.colors=this.useColors,Ne.inspect(r,this.inspectOpts)}});var Rs=F((up,zr)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?zr.exports=Ss():zr.exports=Bs()});var Ue=F((dp,Ms)=>{Ms.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 Ps=F((mp,Ds)=>{Ds.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 Gr=F((gp,ks)=>{var du=Ps();ks.exports=r=>async t=>{t=du(t);let e=E=>{typeof E.return=="function"&&E.return()},n=null,i=null,u=E=>{n=E,i&&i(E),e(t)},f=null,d=!1,g=()=>{d=!0,f&&f()},C=null,l=!1,w=()=>{l=!0,C&&C()},v=null,S=()=>{v&&v()},m=()=>new Promise((E,I)=>{f=v=E,i=I,r.once("drain",S)}),A=()=>(e(t),new Promise((E,I)=>{if(d||l||n)return E();C=f=E,i=I})),B=()=>{r.removeListener("error",u),r.removeListener("close",g),r.removeListener("finish",w),r.removeListener("drain",S)};r.once("error",u),r.once("close",g),r.once("finish",w);try{for await(let E of t){if(!r.writable||r.destroyed||n)break;r.write(E)===!1&&await m()}}catch(E){n||r.destroy(),n=E}try{if(r.writable&&r.end(),await A(),n)throw n}finally{B()}}});var qr=F((bp,Os)=>{var mu=Gr(),gu=Ue();Os.exports=r=>({sink:mu(r),source:gu(r)})});var Fs=F((wp,_s)=>{var bu=qr();_s.exports=r=>async function*(t){let e=bu(r),n;if(e.sink(t).catch(i=>{n=i}),yield*e.source,n)throw n}});var Ns=F((yp,re)=>{re.exports=Ue();re.exports.source=Ue();re.exports.sink=Gr();re.exports.transform=Fs();re.exports.duplex=qr()});var Zr=F((Ve,$s)=>{(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 b=o*this[s++]+a[c]+p;p=Math.floor(b/67108864),a[c++]=b&67108863}return p}function f(s,o,a,c,p,h){for(var b=o&32767,y=o>>15;--h>=0;){var M=this[s]&32767,U=this[s++]>>15,ot=y*M+U*b;M=b*M+((ot&32767)<<15)+a[c]+(p&1073741823),p=(M>>>30)+(ot>>>15)+y*U+(p>>>30),a[c++]=M&1073741823}return p}function d(s,o,a,c,p,h){for(var b=o&16383,y=o>>14;--h>=0;){var M=this[s]&16383,U=this[s++]>>14,ot=y*M+U*b;M=b*M+((ot&16383)<<14)+a[c]+p,p=(M>>28)+(ot>>14)+y*U,a[c++]=M&268435455}return p}var g=typeof navigator<"u";g&&e&&navigator.appName=="Microsoft Internet Explorer"?(n.prototype.am=f,r=30):g&&e&&navigator.appName!="Netscape"?(n.prototype.am=u,r=26):(n.prototype.am=d,r=28),n.prototype.DB=r,n.prototype.DM=(1<<r)-1,n.prototype.DV=1<<r;var C=52;n.prototype.FV=Math.pow(2,C),n.prototype.F1=C-r,n.prototype.F2=2*r-C;var l="0123456789abcdefghijklmnopqrstuvwxyz",w=new Array,v,S;for(v="0".charCodeAt(0),S=0;S<=9;++S)w[v++]=S;for(v="a".charCodeAt(0),S=10;S<36;++S)w[v++]=S;for(v="A".charCodeAt(0),S=10;S<36;++S)w[v++]=S;function m(s){return l.charAt(s)}function A(s,o){var a=w[s.charCodeAt(o)];return a??-1}function B(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 I(s){var o=i();return o.fromInt(s),o}function _(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 b=a==8?s[c]&255:A(s,c);if(b<0){s.charAt(c)=="-"&&(p=!0);continue}p=!1,h==0?this[this.t++]=b:h+a>this.DB?(this[this.t-1]|=(b&(1<<this.DB-h)-1)<<h,this[this.t++]=b>>this.DB-h):this[this.t-1]|=b<<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="",b=this.t,y=this.DB-b*this.DB%o;if(b-- >0)for(y<this.DB&&(c=this[b]>>y)>0&&(p=!0,h=m(c));b>=0;)y<o?(c=(this[b]&(1<<y)-1)<<o-y,c|=this[--b]>>(y+=this.DB-o)):(c=this[b]>>(y-=o)&a,y<=0&&(y+=this.DB,--b)),c>0&&(p=!0),p&&(h+=m(c));return p?h:"0"}function J(){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 ut(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 no(){return this.t<=0?0:this.DB*(this.t-1)+ut(this[this.t-1]^this.s&this.DM)}function so(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 oo(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 io(s,o){var a=s%this.DB,c=this.DB-a,p=(1<<c)-1,h=Math.floor(s/this.DB),b=this.s<<a&this.DM,y;for(y=this.t-1;y>=0;--y)o[y+h+1]=this[y]>>c|b,b=(this[y]&p)<<a;for(y=h-1;y>=0;--y)o[y]=0;o[h]=b,o.t=this.t+h+1,o.s=this.s,o.clamp()}function ao(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 b=a+1;b<this.t;++b)o[b-a-1]|=(this[b]&h)<<p,o[b-a]=this[b]>>c;c>0&&(o[this.t-a-1]|=(this.s&h)<<p),o.t=this.t-a,o.clamp()}function co(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 uo(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 fo(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 lo(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(),b=this.s,y=s.s,M=this.DB-ut(c[c.t-1]);M>0?(c.lShiftTo(M,h),p.lShiftTo(M,a)):(c.copyTo(h),p.copyTo(a));var U=h.t,ot=h[U-1];if(ot!=0){var et=ot*(1<<this.F1)+(U>1?h[U-2]>>this.F2:0),wt=this.FV/et,xe=(1<<this.F1)/et,lt=1<<this.F2,pt=a.t,Se=pt-U,At=o??i();for(h.dlShiftTo(Se,At),a.compareTo(At)>=0&&(a[a.t++]=1,a.subTo(At,a)),n.ONE.dlShiftTo(U,At),At.subTo(h,h);h.t<U;)h[h.t++]=0;for(;--Se>=0;){var tr=a[--pt]==ot?this.DM:Math.floor(a[pt]*wt+(a[pt-1]+lt)*xe);if((a[pt]+=h.am(0,tr,a,Se,0,U))<tr)for(h.dlShiftTo(Se,At),a.subTo(At,a);a[pt]<--tr;)a.subTo(At,a)}o!=null&&(a.drShiftTo(U,o),b!=y&&n.ZERO.subTo(o,o)),a.t=U,a.clamp(),M>0&&a.rShiftTo(M,a),b<0&&n.ZERO.subTo(a,a)}}}function po(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 Pt(s){this.m=s}function ho(s){return s.s<0||s.compareTo(this.m)>=0?s.mod(this.m):s}function mo(s){return s}function go(s){s.divRemTo(this.m,null,s)}function bo(s,o,a){s.multiplyTo(o,a),this.reduce(a)}function wo(s,o){s.squareTo(o),this.reduce(o)}Pt.prototype.convert=ho,Pt.prototype.revert=mo,Pt.prototype.reduce=go,Pt.prototype.mulTo=bo,Pt.prototype.sqrTo=wo;function yo(){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 kt(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 vo(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 xo(s){var o=i();return s.copyTo(o),this.reduce(o),o}function So(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 To(s,o){s.squareTo(o),this.reduce(o)}function Eo(s,o,a){s.multiplyTo(o,a),this.reduce(a)}kt.prototype.convert=vo,kt.prototype.revert=xo,kt.prototype.reduce=So,kt.prototype.mulTo=Eo,kt.prototype.sqrTo=To;function Co(){return(this.t>0?this[0]&1:this.s)==0}function Ao(s,o){if(s>4294967295||s<1)return n.ONE;var a=i(),c=i(),p=o.convert(this),h=ut(s)-1;for(p.copyTo(a);--h>=0;)if(o.sqrTo(a,c),(s&1<<h)>0)o.mulTo(c,p,a);else{var b=a;a=c,c=b}return o.revert(a)}function Io(s,o){var a;return s<256||o.isEven()?a=new Pt(o):a=new kt(o),this.exp(s,a)}n.prototype.copyTo=B,n.prototype.fromInt=E,n.prototype.fromString=_,n.prototype.clamp=N,n.prototype.dlShiftTo=so,n.prototype.drShiftTo=oo,n.prototype.lShiftTo=io,n.prototype.rShiftTo=ao,n.prototype.subTo=co,n.prototype.multiplyTo=uo,n.prototype.squareTo=fo,n.prototype.divRemTo=lo,n.prototype.invDigit=yo,n.prototype.isEven=Co,n.prototype.exp=Ao,n.prototype.toString=Q,n.prototype.negate=J,n.prototype.abs=W,n.prototype.compareTo=Y,n.prototype.bitLength=no,n.prototype.mod=po,n.prototype.modPowInt=Io,n.ZERO=I(0),n.ONE=I(1);function Bo(){var s=i();return this.copyTo(s),s}function Ro(){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 Mo(){return this.t==0?this.s:this[0]<<24>>24}function Do(){return this.t==0?this.s:this[0]<<16>>16}function Po(s){return Math.floor(Math.LN2*this.DB/Math.log(s))}function ko(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Oo(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=I(a),p=i(),h=i(),b="";for(this.divRemTo(c,p,h);p.signum()>0;)b=(a+h.intValue()).toString(s).substr(1)+b,p.divRemTo(c,p,h);return h.intValue().toString(s)+b}function _o(s,o){this.fromInt(0),o==null&&(o=10);for(var a=this.chunkSize(o),c=Math.pow(o,a),p=!1,h=0,b=0,y=0;y<s.length;++y){var M=A(s,y);if(M<0){s.charAt(y)=="-"&&this.signum()==0&&(p=!0);continue}b=o*b+M,++h>=a&&(this.dMultiply(c),this.dAddOffset(b,0),h=0,b=0)}h>0&&(this.dMultiply(Math.pow(o,h)),this.dAddOffset(b,0)),p&&n.ZERO.subTo(this,this)}function Fo(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 No(){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 Lo(s){return this.compareTo(s)==0}function Uo(s){return this.compareTo(s)<0?this:s}function $o(s){return this.compareTo(s)>0?this:s}function jo(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 Vo(s,o){return s&o}function zo(s){var o=i();return this.bitwiseTo(s,Vo,o),o}function Je(s,o){return s|o}function Go(s){var o=i();return this.bitwiseTo(s,Je,o),o}function ln(s,o){return s^o}function qo(s){var o=i();return this.bitwiseTo(s,ln,o),o}function pn(s,o){return s&~o}function Ho(s){var o=i();return this.bitwiseTo(s,pn,o),o}function Zo(){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 Wo(s){var o=i();return s<0?this.rShiftTo(-s,o):this.lShiftTo(s,o),o}function Xo(s){var o=i();return s<0?this.lShiftTo(-s,o):this.rShiftTo(s,o),o}function Jo(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 Yo(){for(var s=0;s<this.t;++s)if(this[s]!=0)return s*this.DB+Jo(this[s]);return this.s<0?this.t*this.DB:-1}function Ko(s){for(var o=0;s!=0;)s&=s-1,++o;return o}function Qo(){for(var s=0,o=this.s&this.DM,a=0;a<this.t;++a)s+=Ko(this[a]^o);return s}function ti(s){var o=Math.floor(s/this.DB);return o>=this.t?this.s!=0:(this[o]&1<<s%this.DB)!=0}function ei(s,o){var a=n.ONE.shiftLeft(s);return this.bitwiseTo(a,o,a),a}function ri(s){return this.changeBit(s,Je)}function ni(s){return this.changeBit(s,pn)}function si(s){return this.changeBit(s,ln)}function oi(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 ii(s){var o=i();return this.addTo(s,o),o}function ai(s){var o=i();return this.subTo(s,o),o}function ci(s){var o=i();return this.multiplyTo(s,o),o}function ui(){var s=i();return this.squareTo(s),s}function fi(s){var o=i();return this.divRemTo(s,o,null),o}function li(s){var o=i();return this.divRemTo(s,null,o),o}function pi(s){var o=i(),a=i();return this.divRemTo(s,o,a),new Array(o,a)}function hi(s){this[this.t]=this.am(0,s-1,this,0,0,this.t),++this.t,this.clamp()}function di(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 hn(s){return s}function mi(s,o,a){s.multiplyTo(o,a)}function gi(s,o){s.squareTo(o)}ce.prototype.convert=hn,ce.prototype.revert=hn,ce.prototype.mulTo=mi,ce.prototype.sqrTo=gi;function bi(s){return this.exp(s,new ce)}function wi(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 yi(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 Ot(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 vi(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 xi(s){return s}function Si(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 Ti(s,o){s.squareTo(o),this.reduce(o)}function Ei(s,o,a){s.multiplyTo(o,a),this.reduce(a)}Ot.prototype.convert=vi,Ot.prototype.revert=xi,Ot.prototype.reduce=Si,Ot.prototype.mulTo=Ei,Ot.prototype.sqrTo=Ti;function Ci(s,o){var a=s.bitLength(),c,p=I(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 Pt(o):o.isEven()?h=new Ot(o):h=new kt(o);var b=new Array,y=3,M=c-1,U=(1<<c)-1;if(b[1]=h.convert(this),c>1){var ot=i();for(h.sqrTo(b[1],ot);y<=U;)b[y]=i(),h.mulTo(ot,b[y-2],b[y]),y+=2}var et=s.t-1,wt,xe=!0,lt=i(),pt;for(a=ut(s[et])-1;et>=0;){for(a>=M?wt=s[et]>>a-M&U:(wt=(s[et]&(1<<a+1)-1)<<M-a,et>0&&(wt|=s[et-1]>>this.DB+a-M)),y=c;!(wt&1);)wt>>=1,--y;if((a-=y)<0&&(a+=this.DB,--et),xe)b[wt].copyTo(p),xe=!1;else{for(;y>1;)h.sqrTo(p,lt),h.sqrTo(lt,p),y-=2;y>0?h.sqrTo(p,lt):(pt=p,p=lt,lt=pt),h.mulTo(lt,b[wt],p)}for(;et>=0&&!(s[et]&1<<a);)h.sqrTo(p,lt),pt=p,p=lt,lt=pt,--a<0&&(a=this.DB-1,--et)}return h.revert(p)}function Ai(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 Ii(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 Bi(s){var o=s.isEven();if(this.isEven()&&o||s.signum()==0)return n.ZERO;for(var a=s.clone(),c=this.clone(),p=I(1),h=I(0),b=I(0),y=I(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?((!b.isEven()||!y.isEven())&&(b.addTo(this,b),y.subTo(s,y)),b.rShiftTo(1,b)):y.isEven()||y.subTo(s,y),y.rShiftTo(1,y);a.compareTo(c)>=0?(a.subTo(c,a),o&&p.subTo(b,p),h.subTo(y,h)):(c.subTo(a,c),o&&b.subTo(p,b),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 X=[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],Ri=(1<<26)/X[X.length-1];function Mi(s){var o,a=this.abs();if(a.t==1&&a[0]<=X[X.length-1]){for(o=0;o<X.length;++o)if(a[0]==X[o])return!0;return!1}if(a.isEven())return!1;for(o=1;o<X.length;){for(var c=X[o],p=o+1;p<X.length&&c<Ri;)c*=X[p++];for(c=a.modInt(c);o<p;)if(c%X[o++]==0)return!1}return a.millerRabin(s)}function Di(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>X.length&&(s=X.length);for(var p=i(),h=0;h<s;++h){p.fromInt(X[Math.floor(Math.random()*X.length)]);var b=p.modPow(c,this);if(b.compareTo(n.ONE)!=0&&b.compareTo(o)!=0){for(var y=1;y++<a&&b.compareTo(o)!=0;)if(b=b.modPowInt(2,this),b.compareTo(n.ONE)==0)return!1;if(b.compareTo(o)!=0)return!1}}return!0}n.prototype.chunkSize=Po,n.prototype.toRadix=Oo,n.prototype.fromRadix=_o,n.prototype.fromNumber=Fo,n.prototype.bitwiseTo=jo,n.prototype.changeBit=ei,n.prototype.addTo=oi,n.prototype.dMultiply=hi,n.prototype.dAddOffset=di,n.prototype.multiplyLowerTo=wi,n.prototype.multiplyUpperTo=yi,n.prototype.modInt=Ii,n.prototype.millerRabin=Di,n.prototype.clone=Bo,n.prototype.intValue=Ro,n.prototype.byteValue=Mo,n.prototype.shortValue=Do,n.prototype.signum=ko,n.prototype.toByteArray=No,n.prototype.equals=Lo,n.prototype.min=Uo,n.prototype.max=$o,n.prototype.and=zo,n.prototype.or=Go,n.prototype.xor=qo,n.prototype.andNot=Ho,n.prototype.not=Zo,n.prototype.shiftLeft=Wo,n.prototype.shiftRight=Xo,n.prototype.getLowestSetBit=Yo,n.prototype.bitCount=Qo,n.prototype.testBit=ti,n.prototype.setBit=ri,n.prototype.clearBit=ni,n.prototype.flipBit=si,n.prototype.add=ii,n.prototype.subtract=ai,n.prototype.multiply=ci,n.prototype.divide=fi,n.prototype.remainder=li,n.prototype.divideAndRemainder=pi,n.prototype.modPow=Ci,n.prototype.modInverse=Bi,n.prototype.pow=bi,n.prototype.gcd=Ai,n.prototype.isProbablePrime=Mi,n.prototype.square=ui,n.prototype.Barrett=Ot;var ve,tt,L;function Pi(s){tt[L++]^=s&255,tt[L++]^=s>>8&255,tt[L++]^=s>>16&255,tt[L++]^=s>>24&255,L>=Qe&&(L-=Qe)}function dn(){Pi(new Date().getTime())}if(tt==null){tt=new Array,L=0;var ft;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var mn=new Uint8Array(32);for(window.crypto.getRandomValues(mn),ft=0;ft<32;++ft)tt[L++]=mn[ft]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var gn=window.crypto.random(32);for(ft=0;ft<gn.length;++ft)tt[L++]=gn.charCodeAt(ft)&255}}for(;L<Qe;)ft=Math.floor(65536*Math.random()),tt[L++]=ft>>>8,tt[L++]=ft&255;L=0,dn()}function ki(){if(ve==null){for(dn(),ve=Ni(),ve.init(tt),L=0;L<tt.length;++L)tt[L]=0;L=0}return ve.next()}function Oi(s){var o;for(o=0;o<s.length;++o)s[o]=ki()}function Ye(){}Ye.prototype.nextBytes=Oi;function Ke(){this.i=0,this.j=0,this.S=new Array}function _i(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 Fi(){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]}Ke.prototype.init=_i,Ke.prototype.next=Fi;function Ni(){return new Ke}var Qe=256;typeof Ve<"u"?Ve=$s.exports={default:n,BigInteger:n,SecureRandom:Ye}:this.jsbn={BigInteger:n,SecureRandom:Ye}}).call(Ve)});var ye=F(ze=>{(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(f){return n(u(f),arguments)}function e(f,d){return t.apply(null,[f].concat(d||[]))}function n(f,d){var g=1,C=f.length,l,w="",v,S,m,A,B,E,I,_;for(v=0;v<C;v++)if(typeof f[v]=="string")w+=f[v];else if(typeof f[v]=="object"){if(m=f[v],m.keys)for(l=d[g],S=0;S<m.keys.length;S++){if(l==null)throw new Error(t('[sprintf] Cannot access property "%s" of undefined value "%s"',m.keys[S],m.keys[S-1]));l=l[m.keys[S]]}else m.param_no?l=d[m.param_no]:l=d[g++];if(r.not_type.test(m.type)&&r.not_primitive.test(m.type)&&l instanceof Function&&(l=l()),r.numeric_arg.test(m.type)&&typeof l!="number"&&isNaN(l))throw new TypeError(t("[sprintf] expecting number but found %T",l));switch(r.number.test(m.type)&&(I=l>=0),m.type){case"b":l=parseInt(l,10).toString(2);break;case"c":l=String.fromCharCode(parseInt(l,10));break;case"d":case"i":l=parseInt(l,10);break;case"j":l=JSON.stringify(l,null,m.width?parseInt(m.width):0);break;case"e":l=m.precision?parseFloat(l).toExponential(m.precision):parseFloat(l).toExponential();break;case"f":l=m.precision?parseFloat(l).toFixed(m.precision):parseFloat(l);break;case"g":l=m.precision?String(Number(l.toPrecision(m.precision))):parseFloat(l);break;case"o":l=(parseInt(l,10)>>>0).toString(8);break;case"s":l=String(l),l=m.precision?l.substring(0,m.precision):l;break;case"t":l=String(!!l),l=m.precision?l.substring(0,m.precision):l;break;case"T":l=Object.prototype.toString.call(l).slice(8,-1).toLowerCase(),l=m.precision?l.substring(0,m.precision):l;break;case"u":l=parseInt(l,10)>>>0;break;case"v":l=l.valueOf(),l=m.precision?l.substring(0,m.precision):l;break;case"x":l=(parseInt(l,10)>>>0).toString(16);break;case"X":l=(parseInt(l,10)>>>0).toString(16).toUpperCase();break}r.json.test(m.type)?w+=l:(r.number.test(m.type)&&(!I||m.sign)?(_=I?"+":"-",l=l.toString().replace(r.sign,"")):_="",B=m.pad_char?m.pad_char==="0"?"0":m.pad_char.charAt(1):" ",E=m.width-(_+l).length,A=m.width&&E>0?B.repeat(E):"",w+=m.align?_+l+A:B==="0"?_+A+l:A+_+l)}return w}var i=Object.create(null);function u(f){if(i[f])return i[f];for(var d=f,g,C=[],l=0;d;){if((g=r.text.exec(d))!==null)C.push(g[0]);else if((g=r.modulo.exec(d))!==null)C.push("%");else if((g=r.placeholder.exec(d))!==null){if(g[2]){l|=1;var w=[],v=g[2],S=[];if((S=r.key.exec(v))!==null)for(w.push(S[1]);(v=v.substring(S[0].length))!=="";)if((S=r.key_access.exec(v))!==null)w.push(S[1]);else if((S=r.index_access.exec(v))!==null)w.push(S[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");g[2]=w}else l|=2;if(l===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");C.push({placeholder:g[0],param_no:g[1],keys:g[2],sign:g[3],pad_char:g[4],align:g[5],width:g[6],precision:g[7],type:g[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(g[0].length)}return i[f]=C}typeof ze<"u"&&(ze.sprintf=t,ze.vsprintf=e),typeof window<"u"&&(window.sprintf=t,window.vsprintf=e,typeof define=="function"&&define.amd&&define(function(){return{sprintf:t,vsprintf:e}}))})()});var Ou={};rt(Ou,{tcp:()=>ku});var ro=j(yt("net"),1);var It=yt("node:net");function Ee(r){return!!(0,It.isIP)(r)}var or={};rt(or,{identity:()=>Xi});function Gi(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),f=u.charCodeAt(0);if(e[f]!==255)throw new TypeError(u+" is ambiguous");e[f]=i}var d=r.length,g=r.charAt(0),C=Math.log(d)/Math.log(256),l=Math.log(256)/Math.log(d);function w(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var A=0,B=0,E=0,I=m.length;E!==I&&m[E]===0;)E++,A++;for(var _=(I-E)*l+1>>>0,N=new Uint8Array(_);E!==I;){for(var Q=m[E],J=0,W=_-1;(Q!==0||J<B)&&W!==-1;W--,J++)Q+=256*N[W]>>>0,N[W]=Q%d>>>0,Q=Q/d>>>0;if(Q!==0)throw new Error("Non-zero carry");B=J,E++}for(var Y=_-B;Y!==_&&N[Y]===0;)Y++;for(var ut=g.repeat(A);Y<_;++Y)ut+=r.charAt(N[Y]);return ut}function v(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var A=0;if(m[A]!==" "){for(var B=0,E=0;m[A]===g;)B++,A++;for(var I=(m.length-A)*C+1>>>0,_=new Uint8Array(I);m[A];){var N=e[m.charCodeAt(A)];if(N===255)return;for(var Q=0,J=I-1;(N!==0||Q<E)&&J!==-1;J--,Q++)N+=d*_[J]>>>0,_[J]=N%256>>>0,N=N/256>>>0;if(N!==0)throw new Error("Non-zero carry");E=Q,A++}if(m[A]!==" "){for(var W=I-E;W!==I&&_[W]===0;)W++;for(var Y=new Uint8Array(B+(I-W)),ut=B;W!==I;)Y[ut++]=_[W++];return Y}}}function S(m){var A=v(m);if(A)return A;throw new Error(`Non-${t} character`)}return{encode:w,decodeUnsafe:v,decode:S}}var qi=Gi,Hi=qi,wn=Hi;var Lu=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 vn=r=>new TextEncoder().encode(r),xn=r=>new TextDecoder().decode(r);var er=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")}},rr=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)}},nr=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 nr({...r.decoders||{[r.prefix]:r},...t.decoders||{[t.prefix]:t}}),sr=class{constructor(t,e,n,i){this.name=t,this.prefix=e,this.baseEncode=n,this.baseDecode=i,this.encoder=new er(t,e,n),this.decoder=new rr(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 sr(r,t,e,n),Bt=({prefix:r,name:t,alphabet:e})=>{let{encode:n,decode:i}=wn(e,t);return Vt({prefix:r,name:t,encode:n,decode:u=>it(i(u))})},Zi=(r,t,e,n)=>{let i={};for(let l=0;l<t.length;++l)i[t[l]]=l;let u=r.length;for(;r[u-1]==="=";)--u;let f=new Uint8Array(u*e/8|0),d=0,g=0,C=0;for(let l=0;l<u;++l){let w=i[r[l]];if(w===void 0)throw new SyntaxError(`Non-${n} character`);g=g<<e|w,d+=e,d>=8&&(d-=8,f[C++]=255&g>>d)}if(d>=e||255&g<<8-d)throw new SyntaxError("Unexpected end of data");return f},Wi=(r,t,e)=>{let n=t[t.length-1]==="=",i=(1<<e)-1,u="",f=0,d=0;for(let g=0;g<r.length;++g)for(d=d<<8|r[g],f+=8;f>e;)f-=e,u+=t[i&d>>f];if(f&&(u+=t[i&d<<e-f]),n)for(;u.length*e&7;)u+="=";return u},k=({name:r,prefix:t,bitsPerChar:e,alphabet:n})=>Vt({prefix:t,name:r,encode(i){return Wi(i,n,e)},decode(i){return Zi(i,n,e,r)}});var Xi=Vt({prefix:"\0",name:"identity",encode:r=>xn(r),decode:r=>vn(r)});var ir={};rt(ir,{base2:()=>Ji});var Ji=k({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ar={};rt(ar,{base8:()=>Yi});var Yi=k({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var cr={};rt(cr,{base10:()=>Ki});var Ki=Bt({prefix:"9",name:"base10",alphabet:"0123456789"});var ur={};rt(ur,{base16:()=>Qi,base16upper:()=>ta});var Qi=k({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ta=k({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var fr={};rt(fr,{base32:()=>ht,base32hex:()=>sa,base32hexpad:()=>ia,base32hexpadupper:()=>aa,base32hexupper:()=>oa,base32pad:()=>ra,base32padupper:()=>na,base32upper:()=>ea,base32z:()=>ca});var ht=k({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ea=k({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ra=k({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),na=k({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),sa=k({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),oa=k({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ia=k({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),aa=k({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ca=k({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var lr={};rt(lr,{base36:()=>ua,base36upper:()=>fa});var ua=Bt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),fa=Bt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var pr={};rt(pr,{base58btc:()=>z,base58flickr:()=>la});var z=Bt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),la=Bt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var dr={};rt(dr,{base64:()=>hr,base64pad:()=>pa,base64url:()=>ha,base64urlpad:()=>da});var hr=k({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pa=k({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ha=k({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),da=k({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var mr={};rt(mr,{base256emoji:()=>ya});var En=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}"),ma=En.reduce((r,t,e)=>(r[e]=t,r),[]),ga=En.reduce((r,t,e)=>(r[t.codePointAt(0)]=e,r),[]);function ba(r){return r.reduce((t,e)=>(t+=ma[e],t),"")}function wa(r){let t=[];for(let e of r){let n=ga[e.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${e}`);t.push(n)}return new Uint8Array(t)}var ya=Vt({prefix:"\u{1F680}",name:"base256emoji",encode:ba,decode:wa});var vr={};rt(vr,{sha256:()=>La,sha512:()=>Ua});var yr=j(yt("crypto"),1);var va=In,Cn=128,xa=127,Sa=~xa,Ta=Math.pow(2,31);function In(r,t,e){t=t||[],e=e||0;for(var n=e;r>=Ta;)t[e++]=r&255|Cn,r/=128;for(;r&Sa;)t[e++]=r&255|Cn,r>>>=7;return t[e]=r|0,In.bytes=e-n+1,t}var Ea=gr,Ca=128,An=127;function gr(r,n){var e=0,n=n||0,i=0,u=n,f,d=r.length;do{if(u>=d)throw gr.bytes=0,new RangeError("Could not decode varint");f=r[u++],e+=i<28?(f&An)<<i:(f&An)*Math.pow(2,i),i+=7}while(f>=Ca);return gr.bytes=u-n,e}var Aa=Math.pow(2,7),Ia=Math.pow(2,14),Ba=Math.pow(2,21),Ra=Math.pow(2,28),Ma=Math.pow(2,35),Da=Math.pow(2,42),Pa=Math.pow(2,49),ka=Math.pow(2,56),Oa=Math.pow(2,63),_a=function(r){return r<Aa?1:r<Ia?2:r<Ba?3:r<Ra?4:r<Ma?5:r<Da?6:r<Pa?7:r<ka?8:r<Oa?9:10},Fa={encode:va,decode:Ea,encodingLength:_a},Na=Fa,ue=Na;var fe=(r,t=0)=>[ue.decode(r,t),ue.decode.bytes],zt=(r,t,e=0)=>(ue.encode(r,t,e),t),Gt=r=>ue.encodingLength(r);var _t=(r,t)=>{let e=t.byteLength,n=Gt(r),i=n+Gt(e),u=new Uint8Array(i+e);return zt(r,u,0),zt(e,u,n),u.set(t,i),new qt(r,e,t,u)},Ae=r=>{let t=it(r),[e,n]=fe(t),[i,u]=fe(t.subarray(n)),f=t.subarray(n+u);if(f.byteLength!==i)throw new Error("Incorrect length");return new qt(e,i,f,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)}},qt=class{constructor(t,e,n,i){this.code=t,this.size=e,this.digest=n,this.bytes=i}};var wr=({name:r,code:t,encode:e})=>new br(r,t,e),br=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?_t(this.code,e):e.then(n=>_t(this.code,n))}else throw Error("Unknown type, must be binary type")}};var La=wr({name:"sha2-256",code:18,encode:r=>it(yr.default.createHash("sha256").update(r).digest())}),Ua=wr({name:"sha2-512",code:19,encode:r=>it(yr.default.createHash("sha512").update(r).digest())});var xr={};rt(xr,{identity:()=>Va});var Mn=0,$a="identity",Dn=it,ja=r=>_t(Mn,Dn(r)),Va={code:Mn,name:$a,encode:Dn,digest:ja};var af=new TextEncoder,cf=new TextDecoder;var Pn=(r,t)=>{let{bytes:e,version:n}=r;switch(n){case 0:return Ha(e,Sr(r),t||z.encoder);default:return Za(e,Sr(r),t||ht.encoder)}};var kn=new WeakMap,Sr=r=>{let t=kn.get(r);if(t==null){let e=new Map;return kn.set(r,e),e}return t},D=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!==Wa)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return D.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=_t(t,e);return D.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 D.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 Pn(this,t)}toJSON(){return{"/":Pn(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 D)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:n,code:i,multihash:u,bytes:f}=e;return new D(n,i,u,f||On(n,i,u.bytes))}else if(e[Xa]===!0){let{version:n,multihash:i,code:u}=e,f=Ae(i);return D.create(n,u,f)}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 D(t,e,n,n.bytes)}case 1:{let i=On(t,e,n.bytes);return new D(t,e,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return D.create(0,le,t)}static createV1(t,e){return D.create(1,t,e)}static decode(t){let[e,n]=D.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return e}static decodeFirst(t){let e=D.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),f=new qt(e.multihashCode,e.digestSize,u,i);return[e.version===0?D.createV0(f):D.createV1(e.codec,f),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 f=e,d=n(),g=n(),C=e+g,l=C-f;return{version:i,codec:u,multihashCode:d,digestSize:g,multihashSize:l,size:C}}static parse(t,e){let[n,i]=qa(t,e),u=D.decode(i);if(u.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Sr(u).set(n,t),u}},qa=(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 ht.prefix:{let e=t||ht;return[ht.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)]}}},Ha=(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},Za=(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,Wa=18,On=(r,t,e)=>{let n=Gt(r),i=n+Gt(t),u=new Uint8Array(i+e.byteLength);return zt(r,u,0),zt(t,u,n),u.set(e,i),u},Xa=Symbol.for("@ipld/js-cid/CID");var pe={...or,...ir,...ar,...cr,...ur,...fr,...lr,...pr,...dr,...mr},wf={...vr,...xr};function Zt(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function Ie(r=0){return globalThis.Buffer?.allocUnsafe!=null?Zt(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 _n=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=Ie(r.length);for(let e=0;e<r.length;e++)t[e]=r.charCodeAt(e);return t}),Ja={utf8:_n,"utf-8":_n,hex:pe.base16,latin1:Tr,ascii:Tr,binary:Tr,...pe},Be=Ja;function K(r,t="utf8"){let e=Be[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 Nn=It.isIPv4,Ya=It.isIPv6,Er=function(r){let t=0;if(r=r.toString().trim(),Nn(r)){let e=new Uint8Array(t+4);return r.split(/\./g).forEach(n=>{e[t++]=parseInt(n,10)&255}),e}if(Ya(r)){let e=r.split(":",8),n;for(n=0;n<e.length;n++){let u=Nn(e[n]),f;u&&(f=Er(e[n]),e[n]=K(f.slice(0,2),"base16")),f!=null&&++n<8&&e.splice(n,0,K(f.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")},Ln=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={},Cr={},Qa=[[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"]];Qa.forEach(r=>{let t=tc(...r);Cr[t.code]=t,he[t.name]=t});function tc(r,t,e,n,i){return{code:r,size:t,name:e,resolvable:!!n,path:!!i}}function R(r){if(typeof r=="number"){if(Cr[r]!=null)return Cr[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 gt=j(Re(),1);function Br(r,t="utf8"){let e=Be[t];if(e==null)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Zt(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}function vt(r,t){t==null&&(t=r.reduce((i,u)=>i+u.length,0));let e=Ie(t),n=0;for(let i of r)e.set(i,n),n+=i.length;return Zt(e)}var Me=class{index=0;input="";new(t){return this.index=0,this.input=t,this}readAtomically(t){let e=this.index,n=t();return n===void 0&&(this.index=e),n}parseWith(t){let e=t();if(this.index===this.input.length)return e}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(t){return this.readAtomically(()=>{let e=this.readChar();if(e===t)return e})}readSeparator(t,e,n){return this.readAtomically(()=>{if(!(e>0&&this.readGivenChar(t)===void 0))return n()})}readNumber(t,e,n,i){return this.readAtomically(()=>{let u=0,f=0,d=this.peekChar();if(d===void 0)return;let g=d==="0",C=2**(8*i)-1;for(;;){let l=this.readAtomically(()=>{let w=this.readChar();if(w===void 0)return;let v=Number.parseInt(w,t);if(!Number.isNaN(v))return v});if(l===void 0)break;if(u*=t,u+=l,u>C||(f+=1,e!==void 0&&f>e))return}if(f!==0)return!n&&g&&f>1?void 0:u})}readIPv4Addr(){return this.readAtomically(()=>{let t=new Uint8Array(4);for(let e=0;e<t.length;e++){let n=this.readSeparator(".",e,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;t[e]=n}return t})}readIPv6Addr(){let t=e=>{for(let n=0;n<e.length/2;n++){let i=n*2;if(n<e.length-3){let f=this.readSeparator(":",n,()=>this.readIPv4Addr());if(f!==void 0)return e[i]=f[0],e[i+1]=f[1],e[i+2]=f[2],e[i+3]=f[3],[i+4,!0]}let u=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(u===void 0)return[i,!1];e[i]=u>>8,e[i+1]=u&255}return[e.length,!1]};return this.readAtomically(()=>{let e=new Uint8Array(16),[n,i]=t(e);if(n===16)return e;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let u=new Uint8Array(14),f=16-(n+2),[d]=t(u.subarray(0,f));return e.set(u.subarray(0,d),16-d),e})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Gf=new Me;var Kf=parseInt("0xFFFF",16),Qf=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);var Pl=R("ip4"),kl=R("ip6"),Ol=R("ipcidr");function ts(r,t){switch(R(r).code){case 4:case 41:return vc(t);case 42:return Kn(t);case 6:case 273:case 33:case 132:return rs(t).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Kn(t);case 421:return Ec(t);case 444:return Qn(t);case 445:return Qn(t);case 466:return Tc(t);default:return K(t,"base16")}}function es(r,t){switch(R(r).code){case 4:return Jn(t);case 41:return Jn(t);case 42:return Yn(t);case 6:case 273:case 33:case 132:return Mr(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Yn(t);case 421:return xc(t);case 444:return Cc(t);case 445:return Ac(t);case 466:return Sc(t);default:return Br(t,"base16")}}var Rr=Object.values(pe).map(r=>r.decoder),yc=function(){let r=Rr[0].or(Rr[1]);return Rr.slice(2).forEach(t=>r=r.or(t)),r}();function Jn(r){if(!Ee(r))throw new Error("invalid ip address");return Er(r)}function vc(r){let t=Ln(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 Mr(r){let t=new ArrayBuffer(2);return new DataView(t).setUint16(0,r),new Uint8Array(t)}function rs(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Yn(r){let t=Br(r),e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function Kn(r){let t=gt.default.decode(r);if(r=r.slice(gt.default.decode.bytes),r.length!==t)throw new Error("inconsistent lengths");return K(r)}function xc(r){let t;r[0]==="Q"||r[0]==="1"?t=Ae(z.decode(`z${r}`)).bytes:t=D.parse(r).multihash.bytes;let e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function Sc(r){let t=yc.decode(r),e=Uint8Array.from(gt.default.encode(t.length));return vt([e,t],e.length+t.length)}function Tc(r){let t=gt.default.decode(r),e=r.slice(gt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return"u"+K(e,"base64url")}function Ec(r){let t=gt.default.decode(r),e=r.slice(gt.default.decode.bytes);if(e.length!==t)throw new Error("inconsistent lengths");return K(e,"base58btc")}function Cc(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=ht.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=Mr(n);return vt([e,i],e.length+i.length)}function Ac(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=ht.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=Mr(n);return vt([e,i],e.length+i.length)}function Qn(r){let t=r.slice(0,r.length-2),e=r.slice(r.length-2),n=K(t,"base32"),i=rs(e);return`${n}:${i}`}var Wt=j(Re(),1);function Ic(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=R(i);if(u.size===0){t.push([i]);continue}if(n++,n>=e.length)throw ss("invalid address: "+r);if(u.path===!0){t.push([i,_r(e.slice(n).join("/"))]);break}t.push([i,e[n]])}return t}function Bc(r){let t=[];return r.map(e=>{let n=ke(e);return t.push(n.name),e.length>1&&e[1]!=null&&t.push(e[1]),null}),_r(t.join("/"))}function Rc(r){return r.map(t=>{Array.isArray(t)||(t=[t]);let e=ke(t);return t.length>1?[e.code,es(e.code,t[1])]:[e.code]})}function Dr(r){return r.map(t=>{let e=ke(t);return t[1]!=null?[e.code,ts(e.code,t[1])]:[e.code]})}function Pr(r){return Pe(vt(r.map(t=>{let e=ke(t),n=Uint8Array.from(Wt.default.encode(e.code));return t.length>1&&t[1]!=null&&(n=vt([n,t[1]])),n})))}function kr(r,t){return r.size>0?r.size/8:r.size===0?0:Wt.default.decode(t)+(Wt.default.decode.bytes??0)}function De(r){let t=[],e=0;for(;e<r.length;){let n=Wt.default.decode(r,e),i=Wt.default.decode.bytes??0,u=R(n),f=kr(u,r.slice(e+i));if(f===0){t.push([n]),e+=i;continue}let d=r.slice(e+i,e+i+f);if(e+=f+i,e>r.length)throw ss("Invalid address Uint8Array: "+K(r,"base16"));t.push([n,d])}return t}function Or(r){let t=De(r),e=Dr(t);return Bc(e)}function Mc(r){r=_r(r);let t=Ic(r),e=Rc(t);return Pr(e)}function ns(r){return Mc(r)}function Pe(r){let t=Dc(r);if(t!=null)throw t;return Uint8Array.from(r)}function Dc(r){try{De(r)}catch(t){return t}}function _r(r){return"/"+r.trim().split("/").filter(t=>t).join("/")}function ss(r){return new Error("Error parsing address: "+r)}function ke(r){return R(r[0])}var Nr=j(Re(),1);var fs=j(as(),1);function cs(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 Xt=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,us,Oc=Symbol.for("nodejs.util.inspect.custom"),_c=[R("dns").code,R("dns4").code,R("dns6").code,R("dnsaddr").code],Fc=new Map,ls=Symbol.for("@multiformats/js-multiaddr/multiaddr");function Nc(r){return!!r?.[ls]}var xt=class{constructor(t){if(de.set(this,void 0),me.set(this,void 0),ge.set(this,void 0),this[us]=!0,t==null&&(t=""),t instanceof Uint8Array)this.bytes=Pe(t);else if(typeof t=="string"){if(t.length>0&&t.charAt(0)!=="/")throw new Error(`multiaddr "${t}" must start with a "/"`);this.bytes=ns(t)}else if(Nc(t))this.bytes=Pe(t.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return Xt(this,de,"f")==null&&Fr(this,de,Or(this.bytes),"f"),Xt(this,de,"f")}toJSON(){return this.toString()}toOptions(){let t,e,n,i,u="",f=R("tcp"),d=R("udp"),g=R("ip4"),C=R("ip6"),l=R("dns6"),w=R("ip6zone");for(let[S,m]of this.stringTuples())S===w.code&&(u=`%${m??""}`),_c.includes(S)&&(e=f.name,i=443,n=`${m??""}${u}`,t=S===l.code?6:4),(S===f.code||S===d.code)&&(e=R(S).name,i=parseInt(m??"")),(S===g.code||S===C.code)&&(e=R(S).name,n=`${m??""}${u}`,t=S===C.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({},R(t)))}protoCodes(){let t=[],e=this.bytes,n=0;for(;n<e.length;){let i=Nr.default.decode(e,n),u=Nr.default.decode.bytes??0,f=R(i),d=kr(f,e.slice(n+u));n+=d+u,t.push(i)}return t}protoNames(){return this.protos().map(t=>t.name)}tuples(){return Xt(this,me,"f")==null&&Fr(this,me,De(this.bytes),"f"),Xt(this,me,"f")}stringTuples(){return Xt(this,ge,"f")==null&&Fr(this,ge,Dr(this.tuples()),"f"),Xt(this,ge,"f")}encapsulate(t){return t=new xt(t),new xt(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 xt(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 xt(Pr(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(D.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let t=null;try{t=this.stringTuples().filter(e=>R(e[0]).path===!0)[0][1],t==null&&(t=null)}catch{t=null}return t}equals(t){return cs(this.bytes,t.bytes)}async resolve(t){let e=this.protos().find(u=>u.resolvable);if(e==null)return[this];let n=Fc.get(e.name);if(n==null)throw(0,fs.default)(new Error(`no available resolver for ${e.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,t)).map(u=>new xt(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,us=ls,Oc)](){return`Multiaddr(${Or(this.bytes)})`}};function bt(r){return new xt(r)}var Lc=x("dns4"),Uc=x("dns6"),$c=x("dnsaddr"),Ft=$(x("dns"),$c,Lc,Uc),Oe=$(x("ip4"),x("ip6")),Mt=$(T(Oe,x("tcp")),T(Ft,x("tcp"))),$r=T(Oe,x("udp")),jc=T($r,x("utp")),Vc=T($r,x("quic")),be=$(T(Mt,x("ws")),T(Ft,x("ws"))),we=$(T(Mt,x("wss")),T(Ft,x("wss")),T(Mt,x("tls"),x("ws")),T(Ft,x("tls"),x("ws"))),Lr=$(T(Mt,x("http")),T(Oe,x("http")),T(Ft,x("http"))),Ur=$(T(Mt,x("https")),T(Oe,x("https")),T(Ft,x("https"))),ps=T($r,x("webrtc-direct"),x("certhash")),ds=$(T(ps,x("p2p")),ps),ms=$(T(be,x("p2p-webrtc-star"),x("p2p")),T(we,x("p2p-webrtc-star"),x("p2p")),T(be,x("p2p-webrtc-star")),T(we,x("p2p-webrtc-star"))),ep=$(T(be,x("p2p-websocket-star"),x("p2p")),T(we,x("p2p-websocket-star"),x("p2p")),T(be,x("p2p-websocket-star")),T(we,x("p2p-websocket-star"))),gs=$(T(Lr,x("p2p-webrtc-direct"),x("p2p")),T(Ur,x("p2p-webrtc-direct"),x("p2p")),T(Lr,x("p2p-webrtc-direct")),T(Ur,x("p2p-webrtc-direct"))),Yt=$(be,we,Lr,Ur,ms,gs,Mt,jc,Vc,Ft,ds),rp=$(T(Yt,x("p2p-stardust"),x("p2p")),T(Yt,x("p2p-stardust"))),Rt=$(T(Yt,x("p2p")),ms,gs,ds,x("p2p")),hs=$(T(Rt,x("p2p-circuit"),Rt),T(Rt,x("p2p-circuit")),T(x("p2p-circuit"),Rt),T(Yt,x("p2p-circuit")),T(x("p2p-circuit"),Yt),x("p2p-circuit")),bs=()=>$(T(hs,bs),hs),Jt=bs(),np=$(T(Jt,Rt,Jt),T(Rt,Jt),T(Jt,Rt),Jt,Rt);var sp=$(T(Jt,x("webrtc")),T(Yt,x("webrtc")),x("webrtc"));function ws(r){function t(e){let n;try{n=bt(e)}catch{return!1}let i=r(n.protoNames());return i===null?!1:i===!0||i===!1?i:i.length===0}return t}function T(...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:ws(t),partialMatch:t}}function $(...r){function t(n){let i=null;return r.some(u=>{let f=typeof u=="function"?u().partialMatch(n):u.partialMatch(n);return f!=null?(i=f,!0):!1}),i}return{toString:function(){return"{ "+r.join(" ")+" }"},input:r,matches:ws(t),partialMatch:t}}function x(r){let t=r;function e(i){let u;try{u=bt(i)}catch{return!1}let f=u.protoNames();return f.length===1&&f[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 at=j(Rs(),1);at.default.formatters.b=r=>r==null?"undefined":z.baseEncode(r);at.default.formatters.t=r=>r==null?"undefined":ht.baseEncode(r);at.default.formatters.m=r=>r==null?"undefined":hr.baseEncode(r);at.default.formatters.p=r=>r==null?"undefined":r.toString();at.default.formatters.c=r=>r==null?"undefined":r.toString();at.default.formatters.k=r=>r==null?"undefined":r.toString();function hu(r){let t=()=>{};return t.enabled=!1,t.color="",t.diff=0,t.log=()=>{},t.namespace=r,t.destroy=()=>!0,t.extend=()=>t,t}function Dt(r){let t=hu(`${r}:trace`);return at.default.enabled(`${r}:trace`)&&at.default.names.map(e=>e.toString()).find(e=>e.includes(":trace"))!=null&&(t=(0,at.default)(`${r}:trace`)),Object.assign((0,at.default)(r),{error:(0,at.default)(`${r}:error`),trace:t})}var Ks=j(Ns(),1);var St=class extends Error{constructor(t="The operation was aborted"){super(t),this.code=St.code,this.type=St.type}static get code(){return"ABORT_ERR"}static get type(){return"aborted"}},ct=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 je(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,Hr=/\/\d{1,2}$/;var q=class extends Error{constructor(t,e){super(t),this.name="AddressError",e!==null&&(this.parseMessage=e)}};var se=j(Zr(),1),Lt=j(ye(),1),P=class{constructor(t){this.groups=4,this.parsedAddress=[],this.parsedSubnet="",this.subnet="/32",this.subnetMask=32,this.v4=!0,this.isCorrect=je(32),this.isInSubnet=$e,this.address=t;let e=Hr.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(Hr,"")}this.addressMinusSuffix=t,this.parsedAddress=this.parse(t)}static isValid(t){try{return new P(t),!0}catch{return!1}}parse(t){let e=t.split(".");if(!t.match(ne))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=[],i;for(i=0;i<8;i+=2){let u=e.slice(i,i+2);n.push(parseInt(u,16))}return new P(n.join("."))}static fromInteger(t){return P.fromHex(t.toString(16))}static fromArpa(t){let n=t.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new P(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 P.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new se.BigInteger("1");return P.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new se.BigInteger(this.mask()+"1".repeat(32-this.subnetMask),2)}endAddress(){return P.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new se.BigInteger("1");return P.fromBigInteger(this._endAddress().subtract(t))}static fromBigInteger(t){return P.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 P("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 Vs={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},Wr={"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"},Xr=/([^0-9a-f:/%])/gi,Jr=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,Yr=/\/\d{1,3}(?=%|$)/,Kr=/%.*$/,zs=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),Gs=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/);var Hs=j(ye(),1);function wu(r){return r.replace(/^(0+)/,'<span class="zero">$1</span>')}function Ge(r,t=0){return r.split(":").map((n,i)=>/group-v4/.test(n)?n:(0,Hs.sprintf)('<span class="hover-group group-%d">%s</span>',i+t,wu(n)))}var $t=j(ye(),1);function tn(r){return(0,$t.sprintf)("(%s)",r.join("|"))}function Qr(r){return r.length<4?(0,$t.sprintf)("0{0,%d}%s",4-r.length,r):r}var en="[^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 f=u===0||u===8-1?":":"";return tn([Qr(i),f])}return Qr(i)}).join(":"));return e.push(r.map(Qr).join(":")),tn(e)}function rn(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,$t.sprintf)("%s(:0{1,4}){1,%d}",n,r-1)),u.push((0,$t.sprintf)("(0{1,4}:){1,%d}%s",r-1,i)),u.push((0,$t.sprintf)("(0{1,4}:){%d}0{1,4}",r-1));for(let f=1;f<r-1;f++)for(let d=1;d<r-f;d++)u.push((0,$t.sprintf)("(0{1,4}:){%d}:(0{1,4}:){%d}0{1,4}",d,r-d-f-1));return tn(u)}var H=j(Zr(),1),Z=j(ye(),1);function He(r){if(!r)throw new Error("Assertion failed.")}function yu(r){let t=/(\d+)(\d{3})/;for(;t.test(r);)r=r.replace(t,"$1,$2");return r}function vu(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 xu(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 Ws(r){return(0,Z.sprintf)("%04x",parseInt(r,16))}function Xs(r){return r&255}var O=class{constructor(t,e){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=$e,this.isCorrect=je(128),e===void 0?this.groups=8:this.groups=e,this.address=t;let n=Yr.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(Yr,"")}else if(/\//.test(t))throw new q("Invalid subnet mask.");let i=Kr.exec(t);i&&(this.zone=i[0],t=t.replace(Kr,"")),this.addressMinusSuffix=t,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(t){try{return new O(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 O(n.join(":"))}static fromURL(t){let e,n=null,i;if(t.indexOf("[")!==-1&&t.indexOf("]:")!==-1){if(i=Gs.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=zs.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 O(e),port:n}}static fromAddress4(t){let e=new P(t),n=128-(32-e.subnetMask);return new O(`::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 i=e.split(".").reverse();for(let u=n;u>0;u--){let f=u*4;i.splice(f,0,":")}return e=i.join(""),new O(e)}microsoftTranscription(){return(0,Z.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":yu(new H.BigInteger("2",10).pow(i).toString(10))}_startAddress(){return new H.BigInteger(this.mask()+"0".repeat(128-this.subnetMask),2)}startAddress(){return O.fromBigInteger(this._startAddress())}startAddressExclusive(){let t=new H.BigInteger("1");return O.fromBigInteger(this._startAddress().add(t))}_endAddress(){return new H.BigInteger(this.mask()+"1".repeat(128-this.subnetMask),2)}endAddress(){return O.fromBigInteger(this._endAddress())}endAddressExclusive(){let t=new H.BigInteger("1");return O.fromBigInteger(this._endAddress().subtract(t))}getScope(){let t=Vs[this.getBits(12,16).intValue()];return this.getType()==="Global unicast"&&t!=="Link local"&&(t="Global"),t||"Unknown"}getType(){for(let t of Object.keys(Wr))if(this.isInSubnet(new O(t)))return Wr[t];return"Global unicast"}getBits(t,e){return new H.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,Z.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 d=parseInt(this.parsedAddress[t],16);d===0&&n++,d!==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(d=>d[1]-d[0]+1);if(i.length>0){let d=u.indexOf(Math.max(...u));e=xu(this.parsedAddress,i[d])}else e=this.parsedAddress;for(t=0;t<e.length;t++)e[t]!=="compact"&&(e[t]=parseInt(e[t],16).toString(16));let f=e.join(":");return f=f.replace(/^compact$/,"::"),f=f.replace(/^compact|compact$/,":"),f=f.replace(/compact/,""),f}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 P(this.parsedAddress4);for(let u=0;u<this.address4.groups;u++)if(/^0[0-9]+/.test(this.address4.parsedAddress[u]))throw new q("IPv4 addresses can't have leading zeroes.",t.replace(ne,this.address4.parsedAddress.map(vu).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(Xr);if(e)throw new q((0,Z.sprintf)("Bad character%s detected in address: %s",e.length>1?"s":"",e.join("")),t.replace(Xr,'<span class="parse-error">$1</span>'));let n=t.match(Jr);if(n)throw new q((0,Z.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 f=u[0].split(":"),d=u[1].split(":");f.length===1&&f[0]===""&&(f=[]),d.length===1&&d[0]===""&&(d=[]);let g=this.groups-(f.length+d.length);if(!g)throw new q("Error parsing groups");this.elidedGroups=g,this.elisionBegin=f.length,this.elisionEnd=f.length+this.elidedGroups,i=i.concat(f);for(let C=0;C<g;C++)i.push("0");i=i.concat(d)}else if(u.length===1)i=t.split(":"),this.elidedGroups=0;else throw new q("Too many :: groups found");if(i=i.map(f=>(0,Z.sprintf)("%x",parseInt(f,16))),i.length!==this.groups)throw new q("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(Ws).join(":")}decimal(){return this.parsedAddress.map(t=>(0,Z.sprintf)("%05d",parseInt(t,16))).join(":")}bigInteger(){return new H.BigInteger(this.parsedAddress.map(Ws).join(""),16)}to4(){let t=this.binaryZeroPad().split("");return P.fromHex(new H.BigInteger(t.slice(96,128).join(""),2).toString(16))}to4in6(){let t=this.to4(),n=new O(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 H.BigInteger("ffff",16)).toString(),n=P.fromHex(this.getBitsBase16(32,64)),i=P.fromHex(this.getBits(96,128).xor(new H.BigInteger("ffffffff",16)).toString(16)),u=this.getBits(64,80),f=this.getBitsBase2(64,80),d=u.testBit(15),g=u.testBit(14),C=u.testBit(8),l=u.testBit(9),w=new H.BigInteger(f.slice(2,6)+f.slice(8,16),2).toString(10);return{prefix:(0,Z.sprintf)("%s:%s",t.slice(0,4),t.slice(4,8)),server4:n.address,client4:i.address,flags:f,coneNat:d,microsoft:{reserved:g,universalLocal:l,groupIndividual:C,nonce:w},udpPort:e}}inspect6to4(){let t=this.getBitsBase16(0,16),e=P.fromHex(this.getBitsBase16(16,48));return{prefix:(0,Z.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 O(t)}toByteArray(){let t=this.bigInteger().toByteArray();return t.length===17&&t[0]===0?t.slice(1):t}toUnsignedByteArray(){return this.toByteArray().map(Xs)}static fromByteArray(t){return this.fromUnsignedByteArray(t.map(Xs))}static fromUnsignedByteArray(t){let e=new H.BigInteger("256",10),n=new H.BigInteger("0",10),i=new H.BigInteger("1",10);for(let u=t.length-1;u>=0;u--)n=n.add(i.multiply(new H.BigInteger(t[u].toString(10),10))),i=i.multiply(e);return O.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 O("2001::/32"))}is6to4(){return this.isInSubnet(new O("2002::/16"))}isLoopback(){return this.getType()==="Loopback"}href(t){return t===void 0?t="":t=(0,Z.sprintf)(":%s",t),(0,Z.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,Z.sprintf)('<a href="%1$s%2$s" class="%3$s">%2$s</a>',t.prefix,e.call(this),t.className):(0,Z.sprintf)('<a href="%1$s%2$s">%2$s</a>',t.prefix,e.call(this))}group(){if(this.elidedGroups===0)return Ge(this.address).join(":");He(typeof this.elidedGroups=="number"),He(typeof this.elisionBegin=="number");let t=[],[e,n]=this.address.split("::");e.length?t.push(...Ge(e)):t.push("");let i=["hover-group"];for(let u=this.elisionBegin;u<this.elisionBegin+this.elidedGroups;u++)i.push((0,Z.sprintf)("group-%d",u));return t.push((0,Z.sprintf)('<span class="%s"></span>',i.join(" "))),n.length?t.push(...Ge(n,this.elisionEnd)):t.push(""),this.is4()&&(He(this.address4 instanceof P),t.pop(),t.push(this.address4.groupForV6())),t.join(":")}regularExpressionString(t=!1){let e=[],n=new O(this.correctForm());if(n.elidedGroups===0)e.push(qe(n.parsedAddress));else if(n.elidedGroups===8)e.push(rn(8));else{let i=n.address.split("::");i[0].length&&e.push(qe(i[0].split(":"))),He(typeof n.elidedGroups=="number"),e.push(rn(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=["(?=^|",en,"|[^\\w\\:])(",...e,")(?=[^\\w\\:]|",en,"|$)"]),e.join("")}regularExpression(t=!1){return new RegExp(this.regularExpressionString(t),"i")}};var Su=Dt("libp2p:ip-port-to-multiaddr"),nn={ERR_INVALID_IP_PARAMETER:"ERR_INVALID_IP_PARAMETER",ERR_INVALID_PORT_PARAMETER:"ERR_INVALID_PORT_PARAMETER",ERR_INVALID_IP:"ERR_INVALID_IP"};function Js(r,t){if(typeof r!="string")throw new ct(`invalid ip provided: ${r}`,nn.ERR_INVALID_IP_PARAMETER);if(typeof t=="string"&&(t=parseInt(t)),isNaN(t))throw new ct(`invalid port provided: ${t}`,nn.ERR_INVALID_PORT_PARAMETER);try{return new P(r),bt(`/ip4/${r}/tcp/${t}`)}catch{}try{let e=new O(r);return e.is4()?bt(`/ip4/${e.to4().correctForm()}/tcp/${t}`):bt(`/ip6/${r}/tcp/${t}`)}catch{let n=`invalid ip:port for creating a multiaddr: ${r}:${t}`;throw Su.error(n),new ct(n,nn.ERR_INVALID_IP)}}var sn=j(yt("os"),1),Ys=j(yt("path"),1),Tu={ip4:"IPv4",ip6:"IPv6"};function ie(r){let t=r.getPath();return t!=null?sn.default.platform()==="win32"?{path:Ys.default.join("\\\\.\\pipe\\",t)}:{path:t}:r.toOptions()}function on(r,t,e){let n=i=>bt(`/${r}/${i}/tcp/${e}`);return(Eu(t)?Au(Tu[r]):[t]).map(n)}function Eu(r){return["0.0.0.0","::"].includes(r)}var Cu=sn.default.networkInterfaces();function Au(r){let t=[];for(let[,e]of Object.entries(Cu))if(e!=null)for(let n of e)n.family===r&&t.push(n.address);return t}var mt=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 f;if(t.remoteAddr!=null)f=t.remoteAddr;else{if(r.remoteAddress==null||r.remotePort==null)throw new ct("Could not determine remote address or port","ERR_NO_REMOTE_ADDRESS");f=Js(r.remoteAddress,r.remotePort)}let d=ie(f),g=d.path??`${d.host??""}:${d.port??""}`,{sink:C,source:l}=Ks.default.duplex(r);r.setTimeout(i,()=>{mt("%s socket read timeout",g),e?.increment({[`${n}timeout`]:!0});let v;r.readable&&(v=new ct("Socket read timeout","ERR_SOCKET_READ_TIMEOUT")),r.destroy(v)}),r.once("close",()=>{mt("%s socket close",g),e?.increment({[`${n}close`]:!0}),w.timeline.close==null&&(w.timeline.close=Date.now())}),r.once("end",()=>{mt("%s socket end",g),e?.increment({[`${n}end`]:!0})});let w={async sink(v){try{await C(v)}catch(S){S.type!=="aborted"&&mt(S)}r.end()},source:l,remoteAddr:f,timeline:{open:Date.now()},async close(){if(r.destroyed){mt("%s socket was already destroyed when trying to close",g);return}mt("%s closing socket",g),await new Promise((v,S)=>{let m=Date.now(),A=setTimeout(()=>{r.destroyed?(mt("%s is already destroyed",g),v()):(mt("%s socket close timeout after %dms, destroying it manually",g,Date.now()-m),r.destroy(new ct("Socket close timeout","ERR_SOCKET_CLOSE_TIMEOUT")))},u).unref();r.once("close",()=>{mt("%s socket closed",g),clearTimeout(A),v()}),r.once("error",B=>{mt("%s socket error",g,B),w.timeline.close==null&&(w.timeline.close=Date.now()),r.destroyed&&clearTimeout(A),S(B)}),r.setTimeout(u),r.end(),r.writableLength>0?r.once("drain",()=>{mt("%s socket drained",g),r.destroy()}):r.destroy()})}};return w};var Qs=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,We=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 an=class extends Event{constructor(t,e){super(t,e),this.detail=e?.detail}},ae=globalThis.CustomEvent??an;var st=Dt("libp2p:tcp:listener");async function cn(r){try{await r.close()}catch(t){st.error("an error occurred closing the connection",t)}}var Ru=1,Mu=0,Xe=class extends We{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=Qs.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]:Ru})}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]:Mu}),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 cn(e)}).catch(n=>{st.error("closing inbound connection failed",n)})}catch(n){st.error("inbound connection failed",n),cn(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(on("ip4",e.address,e.port)):e.family==="IPv6"&&(t=t.concat(on("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 cn(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 eo=Symbol.for("@libp2p/transport");var to;(function(r){r[r.FATAL_ALL=0]="FATAL_ALL",r[r.NO_FATAL=1]="NO_FATAL"})(to||(to={}));var Ct=Dt("libp2p:tcp"),fn=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[eo](){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",d=>{Ct("socket error",d)});let i=Ze(n,{remoteAddr:t,socketInactivityTimeout:this.opts.outboundSocketInactivityTimeout,socketCloseTimeout:this.opts.socketCloseTimeout,metrics:this.metrics?.dialerEvents}),u=()=>{i.close().catch(d=>{Ct.error("Error closing maConn after abort",d)})};e.signal?.addEventListener("abort",u,{once:!0}),Ct("new outbound connection %s",i.remoteAddr);let f=await e.upgrader.upgradeOutbound(i);if(Ct("outbound connection %s upgraded",i.remoteAddr),e.signal?.removeEventListener("abort",u),e.signal?.aborted===!0)throw f.close().catch(d=>{Ct.error("Error closing conn after abort",d)}),new St;return f}async _connect(t,e){if(e.signal?.aborted===!0)throw new St;return await new Promise((n,i)=>{let u=Date.now(),f=ie(t),d=f.path??`${f.host??""}:${f.port}`;Ct("dialing %j",f);let g=ro.default.connect(f),C=m=>{m.message=`connection error ${d}: ${m.message}`,this.metrics?.dialerEvents.increment({error:!0}),S(m)},l=()=>{Ct("connection timeout %s",d),this.metrics?.dialerEvents.increment({timeout:!0});let m=new ct(`connection timeout after ${Date.now()-u}ms`,"ERR_CONNECT_TIMEOUT");g.emit("error",m)},w=()=>{Ct("connection opened %j",f),this.metrics?.dialerEvents.increment({connect:!0}),S()},v=()=>{Ct("connection aborted %j",f),this.metrics?.dialerEvents.increment({abort:!0}),g.destroy(),S(new St)},S=m=>{if(g.removeListener("error",C),g.removeListener("timeout",l),g.removeListener("connect",w),e.signal!=null&&e.signal.removeEventListener("abort",v),m!=null){i(m);return}n(g)};g.on("error",C),g.on("timeout",l),g.on("connect",w),e.signal!=null&&e.signal.addEventListener("abort",v)})}createListener(t){return new Xe({...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 ku(r={}){return(t={})=>new fn(t,r)}return zi(Ou);})();
|
|
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.5",
|
|
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",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
-
"types": "./src/index.d.ts",
|
|
37
|
+
"types": "./dist/src/index.d.ts",
|
|
38
38
|
"import": "./dist/src/index.js"
|
|
39
39
|
}
|
|
40
40
|
},
|