@libp2p/mdns 9.0.13 → 9.0.14
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 +8 -8
package/dist/index.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PMdns = factory()}(typeof self !== 'undefined' ? self : this, function () {
|
|
2
|
-
"use strict";var Libp2PMdns=(()=>{var di=Object.create;var dr=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var ue=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),q=(r,e)=>{for(var t in e)dr(r,t,{get:e[t],enumerable:!0})},
|
|
2
|
+
"use strict";var Libp2PMdns=(()=>{var di=Object.create;var dr=Object.defineProperty;var li=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var hi=Object.getPrototypeOf,pi=Object.prototype.hasOwnProperty;var ue=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var R=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),q=(r,e)=>{for(var t in e)dr(r,t,{get:e[t],enumerable:!0})},Ft=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ui(e))!pi.call(r,i)&&i!==t&&dr(r,i,{get:()=>e[i],enumerable:!(n=li(e,i))||n.enumerable});return r};var Qe=(r,e,t)=>(t=r!=null?di(hi(r)):{},Ft(e||!r||!r.__esModule?dr(t,"default",{value:r,enumerable:!0}):t,r)),gi=r=>Ft(dr({},"__esModule",{value:!0}),r);var Dt=R((ec,Tt)=>{var Ne=1e3,$e=Ne*60,ke=$e*60,Le=ke*24,mi=Le*7,yi=Le*365.25;Tt.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return wi(r);if(t==="number"&&isFinite(r))return e.long?Ei(r):Ii(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function wi(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*yi;case"weeks":case"week":case"w":return t*mi;case"days":case"day":case"d":return t*Le;case"hours":case"hour":case"hrs":case"hr":case"h":return t*ke;case"minutes":case"minute":case"mins":case"min":case"m":return t*$e;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ne;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Ii(r){var e=Math.abs(r);return e>=Le?Math.round(r/Le)+"d":e>=ke?Math.round(r/ke)+"h":e>=$e?Math.round(r/$e)+"m":e>=Ne?Math.round(r/Ne)+"s":r+"ms"}function Ei(r){var e=Math.abs(r);return e>=Le?ur(r,e,Le,"day"):e>=ke?ur(r,e,ke,"hour"):e>=$e?ur(r,e,$e,"minute"):e>=Ne?ur(r,e,Ne,"second"):r+" ms"}function ur(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Or=R((rc,Bt)=>{function xi(r){t.debug=t,t.default=t,t.coerce=m,t.disable=c,t.enable=i,t.enabled=h,t.humanize=Dt(),t.destroy=p,Object.keys(r).forEach(w=>{t[w]=r[w]}),t.names=[],t.skips=[],t.formatters={};function e(w){let u=0;for(let a=0;a<w.length;a++)u=(u<<5)-u+w.charCodeAt(a),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(w){let u,a=null,o,s;function d(...l){if(!d.enabled)return;let y=d,I=Number(new Date),C=I-(u||I);y.diff=C,y.prev=u,y.curr=I,u=I,l[0]=t.coerce(l[0]),typeof l[0]!="string"&&l.unshift("%O");let U=0;l[0]=l[0].replace(/%([a-zA-Z%])/g,(f,z)=>{if(f==="%%")return"%";U++;let Y=t.formatters[z];if(typeof Y=="function"){let Be=l[U];f=Y.call(y,Be),l.splice(U,1),U--}return f}),t.formatArgs.call(y,l),(y.log||t.log).apply(y,l)}return d.namespace=w,d.useColors=t.useColors(),d.color=t.selectColor(w),d.extend=n,d.destroy=t.destroy,Object.defineProperty(d,"enabled",{enumerable:!0,configurable:!1,get:()=>a!==null?a:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(w)),s),set:l=>{a=l}}),typeof t.init=="function"&&t.init(d),d}function n(w,u){let a=t(this.namespace+(typeof u>"u"?":":u)+w);return a.log=this.log,a}function i(w){t.save(w),t.namespaces=w,t.names=[],t.skips=[];let u,a=(typeof w=="string"?w:"").split(/[\s,]+/),o=a.length;for(u=0;u<o;u++)a[u]&&(w=a[u].replace(/\*/g,".*?"),w[0]==="-"?t.skips.push(new RegExp("^"+w.slice(1)+"$")):t.names.push(new RegExp("^"+w+"$")))}function c(){let w=[...t.names.map(g),...t.skips.map(g).map(u=>"-"+u)].join(",");return t.enable(""),w}function h(w){if(w[w.length-1]==="*")return!0;let u,a;for(u=0,a=t.skips.length;u<a;u++)if(t.skips[u].test(w))return!1;for(u=0,a=t.names.length;u<a;u++)if(t.names[u].test(w))return!0;return!1}function g(w){return w.toString().substring(2,w.toString().length-2).replace(/\.\*\?$/,"*")}function m(w){return w instanceof Error?w.stack||w.message:w}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Bt.exports=xi});var Nt=R((V,hr)=>{V.formatArgs=Ci;V.save=Ai;V.load=bi;V.useColors=vi;V.storage=Si();V.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();V.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function vi(){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 Ci(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+hr.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}V.log=console.debug||console.log||(()=>{});function Ai(r){try{r?V.storage.setItem("debug",r):V.storage.removeItem("debug")}catch{}}function bi(){let r;try{r=V.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function Si(){try{return localStorage}catch{}}hr.exports=Or()(V);var{formatters:fi}=hr.exports;fi.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var kt=R((tc,$t)=>{"use strict";$t.exports=(r,e)=>{e=e||process.argv;let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1?!0:n<i)}});var _t=R((nc,Mt)=>{"use strict";var Ui=ue("os"),W=kt(),N=process.env,Me;W("no-color")||W("no-colors")||W("color=false")?Me=!1:(W("color")||W("colors")||W("color=true")||W("color=always"))&&(Me=!0);"FORCE_COLOR"in N&&(Me=N.FORCE_COLOR.length===0||parseInt(N.FORCE_COLOR,10)!==0);function Oi(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Li(r){if(Me===!1)return 0;if(W("color=16m")||W("color=full")||W("color=truecolor"))return 3;if(W("color=256"))return 2;if(r&&!r.isTTY&&Me!==!0)return 0;let e=Me?1:0;if(process.platform==="win32"){let t=Ui.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in N)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in N)||N.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in N)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(N.TEAMCITY_VERSION)?1:0;if(N.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in N){let t=parseInt((N.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(N.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(N.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(N.TERM)||"COLORTERM"in N?1:(N.TERM==="dumb",e)}function Lr(r){let e=Li(r);return Oi(e)}Mt.exports={supportsColor:Lr,stdout:Lr(process.stdout),stderr:Lr(process.stderr)}});var qt=R((D,gr)=>{var Pi=ue("tty"),pr=ue("util");D.init=$i;D.log=Di;D.formatArgs=Ri;D.save=Bi;D.load=Ni;D.useColors=Fi;D.destroy=pr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");D.colors=[6,2,3,4,5,1];try{let r=_t();r&&(r.stderr||r).level>=2&&(D.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{}D.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,c)=>c.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[t]=n,r},{});function Fi(){return"colors"in D.inspectOpts?!!D.inspectOpts.colors:Pi.isatty(process.stderr.fd)}function Ri(r){let{namespace:e,useColors:t}=this;if(t){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),c=` ${i};1m${e} \x1B[0m`;r[0]=c+r[0].split(`
|
|
3
3
|
`).join(`
|
|
4
4
|
`+c),r.push(i+"m+"+gr.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=Ti()+e+" "+r[0]}function Ti(){return D.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Di(...r){return process.stderr.write(pr.format(...r)+`
|
|
5
|
-
`)}function Bi(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ni(){return process.env.DEBUG}function
|
|
6
|
-
`).map(e=>e.trim()).join(" ")};zt.O=function(r){return this.inspectOpts.colors=this.useColors,pr.inspect(r,this.inspectOpts)}});var Vt=R((ic,Pr)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Pr.exports=Nt():Pr.exports=qt()});var Wt=R(Mr=>{"use strict";Mr.toString=function(r){switch(r){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+r};Mr.toType=function(r){switch(r.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return r.toUpperCase().startsWith("UNKNOWN_")?parseInt(r.slice(8)):0}});var Qt=R(_r=>{"use strict";_r.toString=function(r){switch(r){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+r};_r.toRcode=function(r){switch(r.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var Jt=R(zr=>{"use strict";zr.toString=function(r){switch(r){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+r};zr.toOpcode=function(r){switch(r.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var Zt=R(qr=>{"use strict";qr.toString=function(r){switch(r){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+r};qr.toClass=function(r){switch(r.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var en=R(Vr=>{"use strict";Vr.toString=function(r){switch(r){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return r<0?null:`OPTION_${r}`};Vr.toCode=function(r){if(typeof r=="number")return r;if(!r)return-1;switch(r.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let e=r.match(/_(\d+)$/);return e?parseInt(e[1],10):-1}});var nn=R((tn,jr)=>{var rn=function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decode=u,r.encode=w,r.familyOf=p,r.name=void 0,r.sizeOf=m,r.v6=r.v4=void 0;let e=/^(\d{1,3}\.){3,3}\d{1,3}$/,t=4,n=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,i=16,c={name:"v4",size:t,isFormat:a=>e.test(a),encode(a,o,s){s=~~s,o=o||new Uint8Array(s+t);let d=a.length,l=0;for(let y=0;y<d;){let I=a.charCodeAt(y++);I===46?(o[s++]=l,l=0):l=l*10+(I-48)}return o[s]=l,o},decode(a,o){return o=~~o,`${a[o++]}.${a[o++]}.${a[o++]}.${a[o]}`}};r.v4=c;let h={name:"v6",size:i,isFormat:a=>a.length>0&&n.test(a),encode(a,o,s){s=~~s;let d=s+i,l=-1,y=0,I=0,C=!0,U=!1;o=o||new Uint8Array(s+i);for(let O=0;O<a.length;O++){let f=a.charCodeAt(O);f===58?(C?l!==-1?(s<d&&(o[s]=0),s<d-1&&(o[s+1]=0),s+=2):s<d&&(l=s):(U===!0?(s<d&&(o[s]=I),s++):(s<d&&(o[s]=y>>8),s<d-1&&(o[s+1]=y&255),s+=2),y=0,I=0),C=!0,U=!1):f===46?(s<d&&(o[s]=I),s++,I=0,y=0,C=!1,U=!0):(C=!1,f>=97?f-=87:f>=65?f-=55:(f-=48,I=I*10+f),y=(y<<4)+f)}if(C===!1)U===!0?(s<d&&(o[s]=I),s++):(s<d&&(o[s]=y>>8),s<d-1&&(o[s+1]=y&255),s+=2);else if(l===0)s<d&&(o[s]=0),s<d-1&&(o[s+1]=0),s+=2;else if(l!==-1){s+=2;for(let O=Math.min(s-1,d-1);O>=l+2;O--)o[O]=o[O-2];o[l]=0,o[l+1]=0,l=s}if(l!==s&&l!==-1)for(s>d-2&&(s=d-2);d>l;)o[--d]=s<d&&s>l?o[--s]:0;else for(;s<d;)o[s++]=0;return o},decode(a,o){o=~~o;let s="";for(let d=0;d<i;d+=2)d!==0&&(s+=":"),s+=(a[o+d]<<8|a[o+d+1]).toString(16);return s.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};r.v6=h;let g="ip";r.name=g;function m(a){if(c.isFormat(a))return c.size;if(h.isFormat(a))return h.size;throw Error(`Invalid ip address: ${a}`)}function p(a){return m(a)===c.size?1:2}function w(a,o,s){s=~~s;let d=m(a);return typeof o=="function"&&(o=o(s+d)),d===c.size?c.encode(a,o,s):h.encode(a,o,s)}function u(a,o,s){if(o=~~o,s=s||a.length-o,s===c.size)return c.decode(a,o,s);if(s===h.size)return h.decode(a,o,s);throw Error(`Invalid buffer size needs to be ${c.size} for v4 or ${h.size} for v6.`)}return"default"in r?r.default:r}({});typeof define=="function"&&define.amd?define([],function(){return rn}):typeof jr=="object"&&typeof tn=="object"&&(jr.exports=rn)});var cn=R(x=>{"use strict";var v=ue("buffer").Buffer,ve=Wt(),to=Qt(),no=Jt(),wr=Zt(),Kr=en(),Pe=nn(),io=0,on=32768,Gr=32768,oo=~Gr,sn=32768,so=~sn,E=x.name={};E.encode=function(r,e,t,{mail:n=!1}={}){e||(e=v.alloc(E.encodingLength(r))),t||(t=0);let i=t,c=r.replace(/^\.|\.$/gm,"");if(c.length){let h=[];if(n){let g="";c.split(".").forEach(m=>{m.endsWith("\\")?g+=(g.length?".":"")+m.slice(0,-1):h.length===0&&g.length?h.push(g+"."+m):h.push(m)})}else h=c.split(".");for(let g=0;g<h.length;g++){let m=e.write(h[g],t+1);e[t]=m,t+=m+1}}return e[t++]=0,E.encode.bytes=t-i,e};E.encode.bytes=0;E.decode=function(r,e,{mail:t=!1}={}){e||(e=0);let n=[],i=e,c=0,h=0,g=!1;for(;;){if(e>=r.length)throw new Error("Cannot decode name (buffer overflow)");let m=r[e++];if(h+=g?0:1,m===0)break;if(m&192)if((m&192)===192){if(e+1>r.length)throw new Error("Cannot decode name (buffer overflow)");let p=r.readUInt16BE(e-1)-49152;if(p>=i)throw new Error("Cannot decode name (bad pointer)");e=p,i=p,h+=g?0:1,g=!0}else throw new Error("Cannot decode name (bad label)");else{if(e+m>r.length)throw new Error("Cannot decode name (buffer overflow)");if(c+=m+1,c>254)throw new Error("Cannot decode name (name too long)");let p=r.toString("utf-8",e,e+m);t&&(p=p.replace(/\./g,"\\.")),n.push(p),e+=m,h+=g?0:m}}return E.decode.bytes=h,n.length===0?".":n.join(".")};E.decode.bytes=0;E.encodingLength=function(r){return r==="."||r===".."?1:v.byteLength(r.replace(/^\.|\.$/gm,""))+2};var A={};A.encode=function(r,e,t){e||(e=v.alloc(A.encodingLength(r))),t||(t=0);let n=e.write(r,t+1);return e[t]=n,A.encode.bytes=n+1,e};A.encode.bytes=0;A.decode=function(r,e){e||(e=0);let t=r[e],n=r.toString("utf-8",e+1,e+1+t);return A.decode.bytes=t+1,n};A.decode.bytes=0;A.encodingLength=function(r){return v.byteLength(r)+1};var ee={};ee.encode=function(r,e,t){e||(e=ee.encodingLength(r)),t||(t=0);let n=(r.flags||0)&32767,i=r.type==="response"?on:io;return e.writeUInt16BE(r.id||0,t),e.writeUInt16BE(n|i,t+2),e.writeUInt16BE(r.questions.length,t+4),e.writeUInt16BE(r.answers.length,t+6),e.writeUInt16BE(r.authorities.length,t+8),e.writeUInt16BE(r.additionals.length,t+10),e};ee.encode.bytes=12;ee.decode=function(r,e){if(e||(e=0),r.length<12)throw new Error("Header must be 12 bytes");let t=r.readUInt16BE(e+2);return{id:r.readUInt16BE(e),type:t&on?"response":"query",flags:t&32767,flag_qr:(t>>15&1)===1,opcode:no.toString(t>>11&15),flag_aa:(t>>10&1)===1,flag_tc:(t>>9&1)===1,flag_rd:(t>>8&1)===1,flag_ra:(t>>7&1)===1,flag_z:(t>>6&1)===1,flag_ad:(t>>5&1)===1,flag_cd:(t>>4&1)===1,rcode:to.toString(t&15),questions:new Array(r.readUInt16BE(e+4)),answers:new Array(r.readUInt16BE(e+6)),authorities:new Array(r.readUInt16BE(e+8)),additionals:new Array(r.readUInt16BE(e+10))}};ee.decode.bytes=12;ee.encodingLength=function(){return 12};var he=x.unknown={};he.encode=function(r,e,t){return e||(e=v.alloc(he.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.length,t),r.copy(e,t+2),he.encode.bytes=r.length+2,e};he.encode.bytes=0;he.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=r.slice(e+2,e+2+t);return he.decode.bytes=t+2,n};he.decode.bytes=0;he.encodingLength=function(r){return r.length+2};var pe=x.ns={};pe.encode=function(r,e,t){return e||(e=v.alloc(pe.encodingLength(r))),t||(t=0),E.encode(r,e,t+2),e.writeUInt16BE(E.encode.bytes,t),pe.encode.bytes=E.encode.bytes+2,e};pe.encode.bytes=0;pe.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=E.decode(r,e+2);return pe.decode.bytes=t+2,n};pe.decode.bytes=0;pe.encodingLength=function(r){return E.encodingLength(r)+2};var ge=x.soa={};ge.encode=function(r,e,t){e||(e=v.alloc(ge.encodingLength(r))),t||(t=0);let n=t;return t+=2,E.encode(r.mname,e,t),t+=E.encode.bytes,E.encode(r.rname,e,t,{mail:!0}),t+=E.encode.bytes,e.writeUInt32BE(r.serial||0,t),t+=4,e.writeUInt32BE(r.refresh||0,t),t+=4,e.writeUInt32BE(r.retry||0,t),t+=4,e.writeUInt32BE(r.expire||0,t),t+=4,e.writeUInt32BE(r.minimum||0,t),t+=4,e.writeUInt16BE(t-n-2,n),ge.encode.bytes=t-n,e};ge.encode.bytes=0;ge.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mname=E.decode(r,e),e+=E.decode.bytes,n.rname=E.decode(r,e,{mail:!0}),e+=E.decode.bytes,n.serial=r.readUInt32BE(e),e+=4,n.refresh=r.readUInt32BE(e),e+=4,n.retry=r.readUInt32BE(e),e+=4,n.expire=r.readUInt32BE(e),e+=4,n.minimum=r.readUInt32BE(e),e+=4,ge.decode.bytes=e-t,n};ge.decode.bytes=0;ge.encodingLength=function(r){return 22+E.encodingLength(r.mname)+E.encodingLength(r.rname)};var me=x.txt={};me.encode=function(r,e,t){Array.isArray(r)||(r=[r]);for(let i=0;i<r.length;i++)if(typeof r[i]=="string"&&(r[i]=v.from(r[i])),!v.isBuffer(r[i]))throw new Error("Must be a Buffer");e||(e=v.alloc(me.encodingLength(r))),t||(t=0);let n=t;return t+=2,r.forEach(function(i){e[t++]=i.length,i.copy(e,t,0,i.length),t+=i.length}),e.writeUInt16BE(t-n-2,n),me.encode.bytes=t-n,e};me.encode.bytes=0;me.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=[];for(;n>0;){let c=r[e++];if(--n,n<c)throw new Error("Buffer overflow");i.push(r.slice(e,e+c)),e+=c,n-=c}return me.decode.bytes=e-t,i};me.decode.bytes=0;me.encodingLength=function(r){Array.isArray(r)||(r=[r]);let e=2;return r.forEach(function(t){typeof t=="string"?e+=v.byteLength(t)+1:e+=t.length+1}),e};var ye=x.null={};ye.encode=function(r,e,t){e||(e=v.alloc(ye.encodingLength(r))),t||(t=0),typeof r=="string"&&(r=v.from(r)),r||(r=v.alloc(0));let n=t;t+=2;let i=r.length;return r.copy(e,t,0,i),t+=i,e.writeUInt16BE(t-n-2,n),ye.encode.bytes=t-n,e};ye.encode.bytes=0;ye.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=r.slice(e,e+n);return e+=n,ye.decode.bytes=e-t,i};ye.decode.bytes=0;ye.encodingLength=function(r){return r?(v.isBuffer(r)?r.length:v.byteLength(r))+2:2};var we=x.hinfo={};we.encode=function(r,e,t){e||(e=v.alloc(we.encodingLength(r))),t||(t=0);let n=t;return t+=2,A.encode(r.cpu,e,t),t+=A.encode.bytes,A.encode(r.os,e,t),t+=A.encode.bytes,e.writeUInt16BE(t-n-2,n),we.encode.bytes=t-n,e};we.encode.bytes=0;we.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.cpu=A.decode(r,e),e+=A.decode.bytes,n.os=A.decode(r,e),e+=A.decode.bytes,we.decode.bytes=e-t,n};we.decode.bytes=0;we.encodingLength=function(r){return A.encodingLength(r.cpu)+A.encodingLength(r.os)+2};var J=x.ptr={},co=x.cname=J,ao=x.dname=J;J.encode=function(r,e,t){return e||(e=v.alloc(J.encodingLength(r))),t||(t=0),E.encode(r,e,t+2),e.writeUInt16BE(E.encode.bytes,t),J.encode.bytes=E.encode.bytes+2,e};J.encode.bytes=0;J.decode=function(r,e){e||(e=0);let t=E.decode(r,e+2);return J.decode.bytes=E.decode.bytes+2,t};J.decode.bytes=0;J.encodingLength=function(r){return E.encodingLength(r)+2};var Ie=x.srv={};Ie.encode=function(r,e,t){e||(e=v.alloc(Ie.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.priority||0,t+2),e.writeUInt16BE(r.weight||0,t+4),e.writeUInt16BE(r.port||0,t+6),E.encode(r.target,e,t+8);let n=E.encode.bytes+6;return e.writeUInt16BE(n,t),Ie.encode.bytes=n+2,e};Ie.encode.bytes=0;Ie.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n={};return n.priority=r.readUInt16BE(e+2),n.weight=r.readUInt16BE(e+4),n.port=r.readUInt16BE(e+6),n.target=E.decode(r,e+8),Ie.decode.bytes=t+2,n};Ie.decode.bytes=0;Ie.encodingLength=function(r){return 8+E.encodingLength(r.target)};var K=x.caa={};K.ISSUER_CRITICAL=128;K.encode=function(r,e,t){let n=K.encodingLength(r);return e||(e=v.alloc(K.encodingLength(r))),t||(t=0),r.issuerCritical&&(r.flags=K.ISSUER_CRITICAL),e.writeUInt16BE(n-2,t),t+=2,e.writeUInt8(r.flags||0,t),t+=1,A.encode(r.tag,e,t),t+=A.encode.bytes,e.write(r.value,t),t+=v.byteLength(r.value),K.encode.bytes=n,e};K.encode.bytes=0;K.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e);e+=2;let n=e,i={};return i.flags=r.readUInt8(e),e+=1,i.tag=A.decode(r,e),e+=A.decode.bytes,i.value=r.toString("utf-8",e,n+t),i.issuerCritical=!!(i.flags&K.ISSUER_CRITICAL),K.decode.bytes=t+2,i};K.decode.bytes=0;K.encodingLength=function(r){return A.encodingLength(r.tag)+A.encodingLength(r.value)+2};var be=x.mx={};be.encode=function(r,e,t){e||(e=v.alloc(be.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,E.encode(r.exchange,e,t),t+=E.encode.bytes,e.writeUInt16BE(t-n-2,n),be.encode.bytes=t-n,e};be.encode.bytes=0;be.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.preference=r.readUInt16BE(e),e+=2,n.exchange=E.decode(r,e),e+=E.decode.bytes,be.decode.bytes=e-t,n};be.encodingLength=function(r){return 4+E.encodingLength(r.exchange)};var Ee=x.a={};Ee.encode=function(r,e,t){return e||(e=v.alloc(Ee.encodingLength(r))),t||(t=0),e.writeUInt16BE(4,t),t+=2,Pe.v4.encode(r,e,t),Ee.encode.bytes=6,e};Ee.encode.bytes=0;Ee.decode=function(r,e){e||(e=0),e+=2;let t=Pe.v4.decode(r,e);return Ee.decode.bytes=6,t};Ee.decode.bytes=0;Ee.encodingLength=function(){return 6};var xe=x.aaaa={};xe.encode=function(r,e,t){return e||(e=v.alloc(xe.encodingLength(r))),t||(t=0),e.writeUInt16BE(16,t),t+=2,Pe.v6.encode(r,e,t),xe.encode.bytes=18,e};xe.encode.bytes=0;xe.decode=function(r,e){e||(e=0),e+=2;let t=Pe.v6.decode(r,e);return xe.decode.bytes=18,t};xe.decode.bytes=0;xe.encodingLength=function(){return 18};var M=x.option={};M.encode=function(r,e,t){e||(e=v.alloc(M.encodingLength(r))),t||(t=0);let n=t,i=Kr.toCode(r.code);if(e.writeUInt16BE(i,t),t+=2,r.data)e.writeUInt16BE(r.data.length,t),t+=2,r.data.copy(e,t),t+=r.data.length;else switch(i){case 8:let c=r.sourcePrefixLength||0,h=r.family||Pe.familyOf(r.ip),g=Pe.encode(r.ip,v.alloc),m=Math.ceil(c/8);e.writeUInt16BE(m+4,t),t+=2,e.writeUInt16BE(h,t),t+=2,e.writeUInt8(c,t++),e.writeUInt8(r.scopePrefixLength||0,t++),g.copy(e,t,0,m),t+=m;break;case 11:r.timeout?(e.writeUInt16BE(2,t),t+=2,e.writeUInt16BE(r.timeout,t),t+=2):(e.writeUInt16BE(0,t),t+=2);break;case 12:let p=r.length||0;e.writeUInt16BE(p,t),t+=2,e.fill(0,t,t+p),t+=p;break;case 14:let w=r.tags.length*2;e.writeUInt16BE(w,t),t+=2;for(let u of r.tags)e.writeUInt16BE(u,t),t+=2;break;default:throw new Error(`Unknown roption code: ${r.code}`)}return M.encode.bytes=t-n,e};M.encode.bytes=0;M.decode=function(r,e){e||(e=0);let t={};t.code=r.readUInt16BE(e),t.type=Kr.toString(t.code),e+=2;let n=r.readUInt16BE(e);switch(e+=2,t.data=r.slice(e,e+n),t.code){case 8:t.family=r.readUInt16BE(e),e+=2,t.sourcePrefixLength=r.readUInt8(e++),t.scopePrefixLength=r.readUInt8(e++);let i=v.alloc(t.family===1?4:16);r.copy(i,0,e,e+n-4),t.ip=Pe.decode(i);break;case 11:n>0&&(t.timeout=r.readUInt16BE(e),e+=2);break;case 14:t.tags=[];for(let c=0;c<n;c+=2)t.tags.push(r.readUInt16BE(e)),e+=2}return M.decode.bytes=n+4,t};M.decode.bytes=0;M.encodingLength=function(r){if(r.data)return r.data.length+4;switch(Kr.toCode(r.code)){case 8:let t=r.sourcePrefixLength||0;return Math.ceil(t/8)+8;case 11:return typeof r.timeout=="number"?6:4;case 12:return r.length+4;case 14:return 4+r.tags.length*2}throw new Error(`Unknown roption code: ${r.code}`)};var H=x.opt={};H.encode=function(r,e,t){e||(e=v.alloc(H.encodingLength(r))),t||(t=0);let n=t,i=ze(r,M);return e.writeUInt16BE(i,t),t=Je(r,M,e,t+2),H.encode.bytes=t-n,e};H.encode.bytes=0;H.decode=function(r,e){e||(e=0);let t=e,n=[],i=r.readUInt16BE(e);e+=2;let c=0;for(;i>0;)n[c++]=M.decode(r,e),e+=M.decode.bytes,i-=M.decode.bytes;return H.decode.bytes=e-t,n};H.decode.bytes=0;H.encodingLength=function(r){return 2+ze(r||[],M)};var $=x.dnskey={};$.PROTOCOL_DNSSEC=3;$.ZONE_KEY=128;$.SECURE_ENTRYPOINT=32768;$.encode=function(r,e,t){e||(e=v.alloc($.encodingLength(r))),t||(t=0);let n=t,i=r.key;if(!v.isBuffer(i))throw new Error("Key must be a Buffer");return t+=2,e.writeUInt16BE(r.flags,t),t+=2,e.writeUInt8($.PROTOCOL_DNSSEC,t),t+=1,e.writeUInt8(r.algorithm,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,$.encode.bytes=t-n,e.writeUInt16BE($.encode.bytes-2,n),e};$.encode.bytes=0;$.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);if(e+=2,n.flags=r.readUInt16BE(e),e+=2,r.readUInt8(e)!==$.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return e+=1,n.algorithm=r.readUInt8(e),e+=1,n.key=r.slice(e,t+i+2),e+=n.key.length,$.decode.bytes=e-t,n};$.decode.bytes=0;$.encodingLength=function(r){return 6+v.byteLength(r.key)};var ne=x.rrsig={};ne.encode=function(r,e,t){e||(e=v.alloc(ne.encodingLength(r))),t||(t=0);let n=t,i=r.signature;if(!v.isBuffer(i))throw new Error("Signature must be a Buffer");return t+=2,e.writeUInt16BE(ve.toType(r.typeCovered),t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.labels,t),t+=1,e.writeUInt32BE(r.originalTTL,t),t+=4,e.writeUInt32BE(r.expiration,t),t+=4,e.writeUInt32BE(r.inception,t),t+=4,e.writeUInt16BE(r.keyTag,t),t+=2,E.encode(r.signersName,e,t),t+=E.encode.bytes,i.copy(e,t,0,i.length),t+=i.length,ne.encode.bytes=t-n,e.writeUInt16BE(ne.encode.bytes-2,n),e};ne.encode.bytes=0;ne.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.typeCovered=ve.toString(r.readUInt16BE(e)),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.labels=r.readUInt8(e),e+=1,n.originalTTL=r.readUInt32BE(e),e+=4,n.expiration=r.readUInt32BE(e),e+=4,n.inception=r.readUInt32BE(e),e+=4,n.keyTag=r.readUInt16BE(e),e+=2,n.signersName=E.decode(r,e),e+=E.decode.bytes,n.signature=r.slice(e,t+i+2),e+=n.signature.length,ne.decode.bytes=e-t,n};ne.decode.bytes=0;ne.encodingLength=function(r){return 20+E.encodingLength(r.signersName)+v.byteLength(r.signature)};var ie=x.rp={};ie.encode=function(r,e,t){e||(e=v.alloc(ie.encodingLength(r))),t||(t=0);let n=t;return t+=2,E.encode(r.mbox||".",e,t,{mail:!0}),t+=E.encode.bytes,E.encode(r.txt||".",e,t),t+=E.encode.bytes,ie.encode.bytes=t-n,e.writeUInt16BE(ie.encode.bytes-2,n),e};ie.encode.bytes=0;ie.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mbox=E.decode(r,e,{mail:!0})||".",e+=E.decode.bytes,n.txt=E.decode(r,e)||".",e+=E.decode.bytes,ie.decode.bytes=e-t,n};ie.decode.bytes=0;ie.encodingLength=function(r){return 2+E.encodingLength(r.mbox||".")+E.encodingLength(r.txt||".")};var T={};T.encode=function(r,e,t){e||(e=v.alloc(T.encodingLength(r))),t||(t=0);let n=t;for(var i=[],c=0;c<r.length;c++){var h=ve.toType(r[c]);i[h>>8]===void 0&&(i[h>>8]=[]),i[h>>8][h>>3&31]|=1<<7-(h&7)}for(c=0;c<i.length;c++)if(i[c]!==void 0){var g=v.from(i[c]);e.writeUInt8(c,t),t+=1,e.writeUInt8(g.length,t),t+=1,g.copy(e,t),t+=g.length}return T.encode.bytes=t-n,e};T.encode.bytes=0;T.decode=function(r,e,t){e||(e=0);let n=e;for(var i=[];e-n<t;){var c=r.readUInt8(e);e+=1;var h=r.readUInt8(e);e+=1;for(var g=0;g<h;g++)for(var m=r.readUInt8(e+g),p=0;p<8;p++)if(m&1<<7-p){var w=ve.toString(c<<8|g<<3|p);i.push(w)}e+=h}return T.decode.bytes=e-n,i};T.decode.bytes=0;T.encodingLength=function(r){for(var e=[],t=0;t<r.length;t++){var n=ve.toType(r[t]);e[n>>8]=Math.max(e[n>>8]||0,n&255)}var i=0;for(t=0;t<e.length;t++)e[t]!==void 0&&(i+=2+Math.ceil((e[t]+1)/8));return i};var oe=x.nsec={};oe.encode=function(r,e,t){e||(e=v.alloc(oe.encodingLength(r))),t||(t=0);let n=t;return t+=2,E.encode(r.nextDomain,e,t),t+=E.encode.bytes,T.encode(r.rrtypes,e,t),t+=T.encode.bytes,oe.encode.bytes=t-n,e.writeUInt16BE(oe.encode.bytes-2,n),e};oe.encode.bytes=0;oe.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.nextDomain=E.decode(r,e),e+=E.decode.bytes,n.rrtypes=T.decode(r,e,i-(e-t)),e+=T.decode.bytes,oe.decode.bytes=e-t,n};oe.decode.bytes=0;oe.encodingLength=function(r){return 2+E.encodingLength(r.nextDomain)+T.encodingLength(r.rrtypes)};var se=x.nsec3={};se.encode=function(r,e,t){e||(e=v.alloc(se.encodingLength(r))),t||(t=0);let n=t,i=r.salt;if(!v.isBuffer(i))throw new Error("salt must be a Buffer");let c=r.nextDomain;if(!v.isBuffer(c))throw new Error("nextDomain must be a Buffer");return t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.flags,t),t+=1,e.writeUInt16BE(r.iterations,t),t+=2,e.writeUInt8(i.length,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,e.writeUInt8(c.length,t),t+=1,c.copy(e,t,0,c.length),t+=c.length,T.encode(r.rrtypes,e,t),t+=T.encode.bytes,se.encode.bytes=t-n,e.writeUInt16BE(se.encode.bytes-2,n),e};se.encode.bytes=0;se.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);e+=2,n.algorithm=r.readUInt8(e),e+=1,n.flags=r.readUInt8(e),e+=1,n.iterations=r.readUInt16BE(e),e+=2;let c=r.readUInt8(e);e+=1,n.salt=r.slice(e,e+c),e+=c;let h=r.readUInt8(e);return e+=1,n.nextDomain=r.slice(e,e+h),e+=h,n.rrtypes=T.decode(r,e,i-(e-t)),e+=T.decode.bytes,se.decode.bytes=e-t,n};se.decode.bytes=0;se.encodingLength=function(r){return 8+r.salt.length+r.nextDomain.length+T.encodingLength(r.rrtypes)};var ce=x.ds={};ce.encode=function(r,e,t){e||(e=v.alloc(ce.encodingLength(r))),t||(t=0);let n=t,i=r.digest;if(!v.isBuffer(i))throw new Error("Digest must be a Buffer");return t+=2,e.writeUInt16BE(r.keyTag,t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.digestType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,ce.encode.bytes=t-n,e.writeUInt16BE(ce.encode.bytes-2,n),e};ce.encode.bytes=0;ce.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.keyTag=r.readUInt16BE(e),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.digestType=r.readUInt8(e),e+=1,n.digest=r.slice(e,t+i+2),e+=n.digest.length,ce.decode.bytes=e-t,n};ce.decode.bytes=0;ce.encodingLength=function(r){return 6+v.byteLength(r.digest)};var G=x.sshfp={};G.getFingerprintLengthForHashType=function(e){switch(e){case 1:return 20;case 2:return 32}};G.encode=function(e,t,n){t||(t=v.alloc(G.encodingLength(e))),n||(n=0);let i=n;n+=2,t[n]=e.algorithm,n+=1,t[n]=e.hash,n+=1;let c=v.from(e.fingerprint.toUpperCase(),"hex");if(c.length!==G.getFingerprintLengthForHashType(e.hash))throw new Error("Invalid fingerprint length");return c.copy(t,n),n+=c.byteLength,G.encode.bytes=n-i,t.writeUInt16BE(G.encode.bytes-2,i),t};G.encode.bytes=0;G.decode=function(e,t){t||(t=0);let n=t,i={};t+=2,i.algorithm=e[t],t+=1,i.hash=e[t],t+=1;let c=G.getFingerprintLengthForHashType(i.hash);return i.fingerprint=e.slice(t,t+c).toString("hex").toUpperCase(),t+=c,G.decode.bytes=t-n,i};G.decode.bytes=0;G.encodingLength=function(r){return 4+v.from(r.fingerprint,"hex").byteLength};var ae=x.naptr={};ae.encode=function(r,e,t){e||(e=v.alloc(ae.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.order||0,t),t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,A.encode(r.flags,e,t),t+=A.encode.bytes,A.encode(r.services,e,t),t+=A.encode.bytes,A.encode(r.regexp,e,t),t+=A.encode.bytes,E.encode(r.replacement,e,t),t+=E.encode.bytes,ae.encode.bytes=t-n,e.writeUInt16BE(ae.encode.bytes-2,n),e};ae.encode.bytes=0;ae.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.order=r.readUInt16BE(e),e+=2,n.preference=r.readUInt16BE(e),e+=2,n.flags=A.decode(r,e),e+=A.decode.bytes,n.services=A.decode(r,e),e+=A.decode.bytes,n.regexp=A.decode(r,e),e+=A.decode.bytes,n.replacement=E.decode(r,e),e+=E.decode.bytes,ae.decode.bytes=e-t,n};ae.decode.bytes=0;ae.encodingLength=function(r){return A.encodingLength(r.flags)+A.encodingLength(r.services)+A.encodingLength(r.regexp)+E.encodingLength(r.replacement)+6};var de=x.tlsa={};de.encode=function(r,e,t){e||(e=v.alloc(de.encodingLength(r))),t||(t=0);let n=t,i=r.certificate;if(!v.isBuffer(i))throw new Error("Certificate must be a Buffer");return t+=2,e.writeUInt8(r.usage,t),t+=1,e.writeUInt8(r.selector,t),t+=1,e.writeUInt8(r.matchingType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,de.encode.bytes=t-n,e.writeUInt16BE(de.encode.bytes-2,n),e};de.encode.bytes=0;de.decode=function(r,e){e||(e=0);let t=e,n={},i=r.readUInt16BE(e);return e+=2,n.usage=r.readUInt8(e),e+=1,n.selector=r.readUInt8(e),e+=1,n.matchingType=r.readUInt8(e),e+=1,n.certificate=r.slice(e,t+i+2),e+=n.certificate.length,de.decode.bytes=e-t,n};de.decode.bytes=0;de.encodingLength=function(r){return 5+v.byteLength(r.certificate)};var Hr=x.record=function(r){switch(r.toUpperCase()){case"A":return Ee;case"PTR":return J;case"CNAME":return co;case"DNAME":return ao;case"TXT":return me;case"NULL":return ye;case"AAAA":return xe;case"SRV":return Ie;case"HINFO":return we;case"CAA":return K;case"NS":return pe;case"SOA":return ge;case"MX":return be;case"OPT":return H;case"DNSKEY":return $;case"RRSIG":return ne;case"RP":return ie;case"NSEC":return oe;case"NSEC3":return se;case"SSHFP":return G;case"DS":return ce;case"NAPTR":return ae;case"TLSA":return de}return he},B=x.answer={};B.encode=function(r,e,t){e||(e=v.alloc(B.encodingLength(r))),t||(t=0);let n=t;if(E.encode(r.name,e,t),t+=E.encode.bytes,e.writeUInt16BE(ve.toType(r.type),t),r.type.toUpperCase()==="OPT"){if(r.name!==".")throw new Error("OPT name must be root.");e.writeUInt16BE(r.udpPayloadSize||4096,t+2),e.writeUInt8(r.extendedRcode||0,t+4),e.writeUInt8(r.ednsVersion||0,t+5),e.writeUInt16BE(r.flags||0,t+6),t+=8,H.encode(r.options||[],e,t),t+=H.encode.bytes}else{let i=wr.toClass(r.class===void 0?"IN":r.class);r.flush&&(i|=Gr),e.writeUInt16BE(i,t+2),e.writeUInt32BE(r.ttl||0,t+4),t+=8;let c=Hr(r.type);c.encode(r.data,e,t),t+=c.encode.bytes}return B.encode.bytes=t-n,e};B.encode.bytes=0;B.decode=function(r,e){e||(e=0);let t={},n=e;if(t.name=E.decode(r,e),e+=E.decode.bytes,t.type=ve.toString(r.readUInt16BE(e)),t.type==="OPT")t.udpPayloadSize=r.readUInt16BE(e+2),t.extendedRcode=r.readUInt8(e+4),t.ednsVersion=r.readUInt8(e+5),t.flags=r.readUInt16BE(e+6),t.flag_do=(t.flags>>15&1)===1,t.options=H.decode(r,e+8),e+=8+H.decode.bytes;else{let i=r.readUInt16BE(e+2);t.ttl=r.readUInt32BE(e+4),t.class=wr.toString(i&oo),t.flush=!!(i&Gr);let c=Hr(t.type);t.data=c.decode(r,e+8),e+=8+c.decode.bytes}return B.decode.bytes=e-n,t};B.decode.bytes=0;B.encodingLength=function(r){let e=r.data!==null&&r.data!==void 0?r.data:r.options;return E.encodingLength(r.name)+8+Hr(r.type).encodingLength(e)};var Z=x.question={};Z.encode=function(r,e,t){e||(e=v.alloc(Z.encodingLength(r))),t||(t=0);let n=t;return E.encode(r.name,e,t),t+=E.encode.bytes,e.writeUInt16BE(ve.toType(r.type),t),t+=2,e.writeUInt16BE(wr.toClass(r.class===void 0?"IN":r.class),t),t+=2,Z.encode.bytes=t-n,r};Z.encode.bytes=0;Z.decode=function(r,e){e||(e=0);let t=e,n={};return n.name=E.decode(r,e),e+=E.decode.bytes,n.type=ve.toString(r.readUInt16BE(e)),e+=2,n.class=wr.toString(r.readUInt16BE(e)),e+=2,!!(n.class&sn)&&(n.class&=so),Z.decode.bytes=e-t,n};Z.decode.bytes=0;Z.encodingLength=function(r){return E.encodingLength(r.name)+4};x.AUTHORITATIVE_ANSWER=1024;x.TRUNCATED_RESPONSE=512;x.RECURSION_DESIRED=256;x.RECURSION_AVAILABLE=128;x.AUTHENTIC_DATA=32;x.CHECKING_DISABLED=16;x.DNSSEC_OK=32768;x.encode=function(r,e,t){let n=!e;n&&(e=v.alloc(x.encodingLength(r))),t||(t=0);let i=t;return r.questions||(r.questions=[]),r.answers||(r.answers=[]),r.authorities||(r.authorities=[]),r.additionals||(r.additionals=[]),ee.encode(r,e,t),t+=ee.encode.bytes,t=Je(r.questions,Z,e,t),t=Je(r.answers,B,e,t),t=Je(r.authorities,B,e,t),t=Je(r.additionals,B,e,t),x.encode.bytes=t-i,n&&x.encode.bytes!==e.length?e.slice(0,x.encode.bytes):e};x.encode.bytes=0;x.decode=function(r,e){e||(e=0);let t=e,n=ee.decode(r,e);return e+=ee.decode.bytes,e=yr(n.questions,Z,r,e),e=yr(n.answers,B,r,e),e=yr(n.authorities,B,r,e),e=yr(n.additionals,B,r,e),x.decode.bytes=e-t,n};x.decode.bytes=0;x.encodingLength=function(r){return ee.encodingLength(r)+ze(r.questions||[],Z)+ze(r.answers||[],B)+ze(r.authorities||[],B)+ze(r.additionals||[],B)};x.streamEncode=function(r){let e=x.encode(r),t=v.alloc(2);t.writeUInt16BE(e.byteLength);let n=v.concat([t,e]);return x.streamEncode.bytes=n.byteLength,n};x.streamEncode.bytes=0;x.streamDecode=function(r){let e=r.readUInt16BE(0);if(r.byteLength<e+2)return null;let t=x.decode(r.slice(2));return x.streamDecode.bytes=x.decode.bytes,t};x.streamDecode.bytes=0;function ze(r,e){let t=0;for(let n=0;n<r.length;n++)t+=e.encodingLength(r[n]);return t}function Je(r,e,t,n){for(let i=0;i<r.length;i++)e.encode(r[i],t,n),n+=e.encode.bytes;return n}function yr(r,e,t,n){for(let i=0;i<r.length;i++)r[i]=e.decode(t,n),n+=e.decode.bytes;return n}});var ln=R((Ac,dn)=>{"use strict";var an=mo;process.nextTick(go,42);dn.exports=lo;function lo(r){var e=n;return t;function t(i){e(i||ho)}function n(i){var c=[i];e=h,r(g);function h(m){c.push(m)}function g(m){var p=arguments;for(e=uo(m)?n:w;c.length;)w(c.shift());function w(u){an(po,u,p)}}}}function uo(r){return Object.prototype.toString.call(r)==="[object Error]"}function ho(){}function po(r,e){r.apply(null,e)}function go(r){r===42&&(an=process.nextTick)}function mo(r,e,t){process.nextTick(function(){r(e,t)})}});var pn=R((bc,hn)=>{var Yr=cn(),yo=ue("dgram"),wo=ln(),Io=ue("events"),Wr=ue("os"),Xr=function(){};hn.exports=function(r){r||(r={});var e=new Io.EventEmitter,t=typeof r.port=="number"?r.port:5353,n=r.type||"udp4",i=r.ip||r.host||(n==="udp4"?"224.0.0.251":null),c={address:i,port:t},h={},g=!1,m=null;if(n==="udp6"&&(!i||!r.interface))throw new Error("For IPv6 multicast you must specify `ip` and `interface`");var p=r.socket||yo.createSocket({type:n,reuseAddr:r.reuseAddr!==!1,toString:function(){return n}});p.on("error",function(u){u.code==="EACCES"||u.code==="EADDRINUSE"?e.emit("error",u):e.emit("warning",u)}),p.on("message",function(u,a){try{u=Yr.decode(u)}catch(o){e.emit("warning",o);return}e.emit("packet",u,a),u.type==="query"&&e.emit("query",u,a),u.type==="response"&&e.emit("response",u,a)}),p.on("listening",function(){t||(t=c.port=p.address().port),r.multicast!==!1&&(e.update(),m=setInterval(e.update,5e3),p.setMulticastTTL(r.ttl||255),p.setMulticastLoopback(r.loopback!==!1))});var w=wo(function(u){if(!t||r.bind===!1)return u(null);p.once("error",u),p.bind(t,r.bind||r.interface,function(){p.removeListener("error",u),u(null)})});return w(function(u){if(u)return e.emit("error",u);e.emit("ready")}),e.send=function(u,a,o){if(typeof a=="function")return e.send(u,null,a);o||(o=Xr),a?!a.host&&!a.address&&(a.address=c.address):a=c,w(s);function s(d){if(g)return o();if(d)return o(d);var l=Yr.encode(u);p.send(l,0,l.length,a.port,a.address||a.host,o)}},e.response=e.respond=function(u,a,o){Array.isArray(u)&&(u={answers:u}),u.type="response",u.flags=(u.flags||0)|Yr.AUTHORITATIVE_ANSWER,e.send(u,a,o)},e.query=function(u,a,o,s){if(typeof a=="function")return e.query(u,null,null,a);if(typeof a=="object"&&a&&a.port)return e.query(u,null,a,o);if(typeof o=="function")return e.query(u,a,null,o);s||(s=Xr),typeof u=="string"&&(u=[{name:u,type:a||"ANY"}]),Array.isArray(u)&&(u={type:"query",questions:u}),u.type="query",e.send(u,o,s)},e.destroy=function(u){if(u||(u=Xr),g)return process.nextTick(u);g=!0,clearInterval(m);for(var a in h)try{p.dropMembership(i,a)}catch{}h={},p.close(u)},e.update=function(){for(var u=r.interface?[].concat(r.interface):xo(),a=!1,o=0;o<u.length;o++){var s=u[o];if(!h[s])try{p.addMembership(i,s),h[s]=!0,a=!0}catch(d){e.emit("warning",d)}}if(a){if(p.setMulticastInterface)try{p.setMulticastInterface(r.interface||Eo())}catch(d){e.emit("warning",d)}e.emit("networkInterface")}},e};function Eo(){for(var r=Wr.networkInterfaces(),e=Object.keys(r),t=0;t<e.length;t++)for(var n=r[e[t]],i=0;i<n.length;i++){var c=n[i];if(un(c.family)&&!c.internal)return Wr.platform()==="darwin"&&e[t]==="en0"?c.address:"0.0.0.0"}return"127.0.0.1"}function xo(){for(var r=Wr.networkInterfaces(),e=Object.keys(r),t=[],n=0;n<e.length;n++)for(var i=r[e[n]],c=0;c<i.length;c++){var h=i[c];if(un(h.family)){t.push(h.address);break}}return t}function un(r){return r===4||r==="IPv4"}});var Pn=R(ar=>{(function(){var r,e,t,n,i,c,h,g;g=function(m){var p,w,u,a;return p=(m&255<<24)>>>24,w=(m&255<<16)>>>16,u=(m&65280)>>>8,a=m&255,[p,w,u,a].join(".")},h=function(m){var p,w,u,a,o,s;for(p=[],u=a=0;a<=3&&m.length!==0;u=++a){if(u>0){if(m[0]!==".")throw new Error("Invalid IP");m=m.substring(1)}s=e(m),o=s[0],w=s[1],m=m.substring(w),p.push(o)}if(m.length!==0)throw new Error("Invalid IP");switch(p.length){case 1:if(p[0]>4294967295)throw new Error("Invalid IP");return p[0]>>>0;case 2:if(p[0]>255||p[1]>16777215)throw new Error("Invalid IP");return(p[0]<<24|p[1])>>>0;case 3:if(p[0]>255||p[1]>255||p[2]>65535)throw new Error("Invalid IP");return(p[0]<<24|p[1]<<16|p[2])>>>0;case 4:if(p[0]>255||p[1]>255||p[2]>255||p[3]>255)throw new Error("Invalid IP");return(p[0]<<24|p[1]<<16|p[2]<<8|p[3])>>>0;default:throw new Error("Invalid IP")}},t=function(m){return m.charCodeAt(0)},n=t("0"),c=t("a"),i=t("A"),e=function(m){var p,w,u,a,o;for(a=0,p=10,w="9",u=0,m.length>1&&m[u]==="0"&&(m[u+1]==="x"||m[u+1]==="X"?(u+=2,p=16):"0"<=m[u+1]&&m[u+1]<="9"&&(u++,p=8,w="7")),o=u;u<m.length;){if("0"<=m[u]&&m[u]<=w)a=a*p+(t(m[u])-n)>>>0;else if(p===16)if("a"<=m[u]&&m[u]<="f")a=a*p+(10+t(m[u])-c)>>>0;else if("A"<=m[u]&&m[u]<="F")a=a*p+(10+t(m[u])-i)>>>0;else break;else break;if(a>4294967295)throw new Error("too large");u++}if(u===o)throw new Error("empty octet");return[a,u]},r=function(){function m(p,w){var u,a,o,s;if(typeof p!="string")throw new Error("Missing `net' parameter");if(w||(s=p.split("/",2),p=s[0],w=s[1]),w||(w=32),typeof w=="string"&&w.indexOf(".")>-1){try{this.maskLong=h(w)}catch(d){throw u=d,new Error("Invalid mask: "+w)}for(a=o=32;o>=0;a=--o)if(this.maskLong===4294967295<<32-a>>>0){this.bitmask=a;break}}else if(w||w===0)this.bitmask=parseInt(w,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(h(p)&this.maskLong)>>>0}catch(d){throw u=d,new Error("Invalid net address: "+p)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+w);this.size=Math.pow(2,32-this.bitmask),this.base=g(this.netLong),this.mask=g(this.maskLong),this.hostmask=g(~this.maskLong),this.first=this.bitmask<=30?g(this.netLong+1):this.base,this.last=this.bitmask<=30?g(this.netLong+this.size-2):g(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?g(this.netLong+this.size-1):void 0}return m.prototype.contains=function(p){return typeof p=="string"&&(p.indexOf("/")>0||p.split(".").length!==4)&&(p=new m(p)),p instanceof m?this.contains(p.base)&&this.contains(p.broadcast||p.last):(h(p)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},m.prototype.next=function(p){return p==null&&(p=1),new m(g(this.netLong+this.size*p),this.mask)},m.prototype.forEach=function(p){var w,u,a;for(a=h(this.first),u=h(this.last),w=0;a<=u;)p(g(a),a,w),w++,a++},m.prototype.toString=function(){return this.base+"/"+this.bitmask},m}(),ar.ip2long=h,ar.long2ip=g,ar.Netmask=r}).call(ar)});var Dn=R((Tn,Cr)=>{(function(r){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",t={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",h="(?:[0-9a-f]+::?)+",g={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${h})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${h})|(?:::)(?:${h})?)${e}\\.${e}\\.${e}\\.${e}(${c})?$`,"i")};function m(o,s){if(o.indexOf("::")!==o.lastIndexOf("::"))return null;let d=0,l=-1,y=(o.match(g.zoneIndex)||[])[0],I,C;for(y&&(y=y.substring(1),o=o.replace(/%.+$/,""));(l=o.indexOf(":",l+1))>=0;)d++;if(o.substr(0,2)==="::"&&d--,o.substr(-2,2)==="::"&&d--,d>s)return null;for(C=s-d,I=":";C--;)I+="0:";return o=o.replace("::",I),o[0]===":"&&(o=o.slice(1)),o[o.length-1]===":"&&(o=o.slice(0,-1)),s=function(){let U=o.split(":"),O=[];for(let f=0;f<U.length;f++)O.push(parseInt(U[f],16));return O}(),{parts:s,zoneId:y}}function p(o,s,d,l){if(o.length!==s.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let y=0,I;for(;l>0;){if(I=d-l,I<0&&(I=0),o[y]>>I!==s[y]>>I)return!1;l-=d,y+=1}return!0}function w(o){if(i.test(o))return parseInt(o,16);if(o[0]==="0"&&!isNaN(parseInt(o[1],10))){if(n.test(o))return parseInt(o,8);throw new Error(`ipaddr: cannot parse ${o} as octal`)}return parseInt(o,10)}function u(o,s){for(;o.length<s;)o=`0${o}`;return o}let a={};a.IPv4=function(){function o(s){if(s.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let d,l;for(d=0;d<s.length;d++)if(l=s[d],!(0<=l&&l<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=s}return o.prototype.SpecialRanges={unspecified:[[new o([0,0,0,0]),8]],broadcast:[[new o([255,255,255,255]),32]],multicast:[[new o([224,0,0,0]),4]],linkLocal:[[new o([169,254,0,0]),16]],loopback:[[new o([127,0,0,0]),8]],carrierGradeNat:[[new o([100,64,0,0]),10]],private:[[new o([10,0,0,0]),8],[new o([172,16,0,0]),12],[new o([192,168,0,0]),16]],reserved:[[new o([192,0,0,0]),24],[new o([192,0,2,0]),24],[new o([192,88,99,0]),24],[new o([198,18,0,0]),15],[new o([198,51,100,0]),24],[new o([203,0,113,0]),24],[new o([240,0,0,0]),4]]},o.prototype.kind=function(){return"ipv4"},o.prototype.match=function(s,d){let l;if(d===void 0&&(l=s,s=l[0],d=l[1]),s.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,s.octets,8,d)},o.prototype.prefixLengthFromSubnetMask=function(){let s=0,d=!1,l={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},y,I,C;for(y=3;y>=0;y-=1)if(I=this.octets[y],I in l){if(C=l[I],d&&C!==0)return null;C!==8&&(d=!0),s+=C}else return null;return 32-s},o.prototype.range=function(){return a.subnetMatch(this,this.SpecialRanges)},o.prototype.toByteArray=function(){return this.octets.slice(0)},o.prototype.toIPv4MappedAddress=function(){return a.IPv6.parse(`::ffff:${this.toString()}`)},o.prototype.toNormalizedString=function(){return this.toString()},o.prototype.toString=function(){return this.octets.join(".")},o}(),a.IPv4.broadcastAddressFromCIDR=function(o){try{let s=this.parseCIDR(o),d=s[0].toByteArray(),l=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],I=0;for(;I<4;)y.push(parseInt(d[I],10)|parseInt(l[I],10)^255),I++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},a.IPv4.isIPv4=function(o){return this.parser(o)!==null},a.IPv4.isValid=function(o){try{return new this(this.parser(o)),!0}catch{return!1}},a.IPv4.isValidFourPartDecimal=function(o){return!!(a.IPv4.isValid(o)&&o.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},a.IPv4.networkAddressFromCIDR=function(o){let s,d,l,y,I;try{for(s=this.parseCIDR(o),l=s[0].toByteArray(),I=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],d=0;d<4;)y.push(parseInt(l[d],10)&parseInt(I[d],10)),d++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},a.IPv4.parse=function(o){let s=this.parser(o);if(s===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(s)},a.IPv4.parseCIDR=function(o){let s;if(s=o.match(/^(.+)\/(\d+)$/)){let d=parseInt(s[2]);if(d>=0&&d<=32){let l=[this.parse(s[1]),d];return Object.defineProperty(l,"toString",{value:function(){return this.join("/")}}),l}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},a.IPv4.parser=function(o){let s,d,l;if(s=o.match(t.fourOctet))return function(){let y=s.slice(1,6),I=[];for(let C=0;C<y.length;C++)d=y[C],I.push(w(d));return I}();if(s=o.match(t.longValue)){if(l=w(s[1]),l>4294967295||l<0)throw new Error("ipaddr: address outside defined range");return function(){let y=[],I;for(I=0;I<=24;I+=8)y.push(l>>I&255);return y}().reverse()}else return(s=o.match(t.twoOctet))?function(){let y=s.slice(1,4),I=[];if(l=w(y[1]),l>16777215||l<0)throw new Error("ipaddr: address outside defined range");return I.push(w(y[0])),I.push(l>>16&255),I.push(l>>8&255),I.push(l&255),I}():(s=o.match(t.threeOctet))?function(){let y=s.slice(1,5),I=[];if(l=w(y[2]),l>65535||l<0)throw new Error("ipaddr: address outside defined range");return I.push(w(y[0])),I.push(w(y[1])),I.push(l>>8&255),I.push(l&255),I}():null},a.IPv4.subnetMaskFromPrefixLength=function(o){if(o=parseInt(o),o<0||o>32)throw new Error("ipaddr: invalid IPv4 prefix length");let s=[0,0,0,0],d=0,l=Math.floor(o/8);for(;d<l;)s[d]=255,d++;return l<4&&(s[l]=Math.pow(2,o%8)-1<<8-o%8),new this(s)},a.IPv6=function(){function o(s,d){let l,y;if(s.length===16)for(this.parts=[],l=0;l<=14;l+=2)this.parts.push(s[l]<<8|s[l+1]);else if(s.length===8)this.parts=s;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(l=0;l<this.parts.length;l++)if(y=this.parts[l],!(0<=y&&y<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");d&&(this.zoneId=d)}return o.prototype.SpecialRanges={unspecified:[new o([0,0,0,0,0,0,0,0]),128],linkLocal:[new o([65152,0,0,0,0,0,0,0]),10],multicast:[new o([65280,0,0,0,0,0,0,0]),8],loopback:[new o([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new o([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new o([0,0,0,0,0,65535,0,0]),96],rfc6145:[new o([0,0,0,0,65535,0,0,0]),96],rfc6052:[new o([100,65435,0,0,0,0,0,0]),96],"6to4":[new o([8194,0,0,0,0,0,0,0]),16],teredo:[new o([8193,0,0,0,0,0,0,0]),32],reserved:[[new o([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new o([8193,2,0,0,0,0,0,0]),48],amt:[new o([8193,3,0,0,0,0,0,0]),32],as112v6:[new o([8193,4,274,0,0,0,0,0]),48],deprecated:[new o([8193,16,0,0,0,0,0,0]),28],orchid2:[new o([8193,32,0,0,0,0,0,0]),28]},o.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},o.prototype.kind=function(){return"ipv6"},o.prototype.match=function(s,d){let l;if(d===void 0&&(l=s,s=l[0],d=l[1]),s.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,s.parts,16,d)},o.prototype.prefixLengthFromSubnetMask=function(){let s=0,d=!1,l={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},y,I;for(let C=7;C>=0;C-=1)if(y=this.parts[C],y in l){if(I=l[y],d&&I!==0)return null;I!==16&&(d=!0),s+=I}else return null;return 128-s},o.prototype.range=function(){return a.subnetMatch(this,this.SpecialRanges)},o.prototype.toByteArray=function(){let s,d=[],l=this.parts;for(let y=0;y<l.length;y++)s=l[y],d.push(s>>8),d.push(s&255);return d},o.prototype.toFixedLengthString=function(){let s=function(){let l=[];for(let y=0;y<this.parts.length;y++)l.push(u(this.parts[y].toString(16),4));return l}.call(this).join(":"),d="";return this.zoneId&&(d=`%${this.zoneId}`),s+d},o.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let s=this.parts.slice(-2),d=s[0],l=s[1];return new a.IPv4([d>>8,d&255,l>>8,l&255])},o.prototype.toNormalizedString=function(){let s=function(){let l=[];for(let y=0;y<this.parts.length;y++)l.push(this.parts[y].toString(16));return l}.call(this).join(":"),d="";return this.zoneId&&(d=`%${this.zoneId}`),s+d},o.prototype.toRFC5952String=function(){let s=/((^|:)(0(:|$)){2,})/g,d=this.toNormalizedString(),l=0,y=-1,I;for(;I=s.exec(d);)I[0].length>y&&(l=I.index,y=I[0].length);return y<0?d:`${d.substring(0,l)}::${d.substring(l+y)}`},o.prototype.toString=function(){return this.toRFC5952String()},o}(),a.IPv6.broadcastAddressFromCIDR=function(o){try{let s=this.parseCIDR(o),d=s[0].toByteArray(),l=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],I=0;for(;I<16;)y.push(parseInt(d[I],10)|parseInt(l[I],10)^255),I++;return new this(y)}catch(s){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${s})`)}},a.IPv6.isIPv6=function(o){return this.parser(o)!==null},a.IPv6.isValid=function(o){if(typeof o=="string"&&o.indexOf(":")===-1)return!1;try{let s=this.parser(o);return new this(s.parts,s.zoneId),!0}catch{return!1}},a.IPv6.networkAddressFromCIDR=function(o){let s,d,l,y,I;try{for(s=this.parseCIDR(o),l=s[0].toByteArray(),I=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],d=0;d<16;)y.push(parseInt(l[d],10)&parseInt(I[d],10)),d++;return new this(y)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},a.IPv6.parse=function(o){let s=this.parser(o);if(s.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(s.parts,s.zoneId)},a.IPv6.parseCIDR=function(o){let s,d,l;if((d=o.match(/^(.+)\/(\d+)$/))&&(s=parseInt(d[2]),s>=0&&s<=128))return l=[this.parse(d[1]),s],Object.defineProperty(l,"toString",{value:function(){return this.join("/")}}),l;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},a.IPv6.parser=function(o){let s,d,l,y,I,C;if(l=o.match(g.deprecatedTransitional))return this.parser(`::ffff:${l[1]}`);if(g.native.test(o))return m(o,8);if((l=o.match(g.transitional))&&(C=l[6]||"",s=m(l[1].slice(0,-1)+C,6),s.parts)){for(I=[parseInt(l[2]),parseInt(l[3]),parseInt(l[4]),parseInt(l[5])],d=0;d<I.length;d++)if(y=I[d],!(0<=y&&y<=255))return null;return s.parts.push(I[0]<<8|I[1]),s.parts.push(I[2]<<8|I[3]),{parts:s.parts,zoneId:s.zoneId}}return null},a.IPv6.subnetMaskFromPrefixLength=function(o){if(o=parseInt(o),o<0||o>128)throw new Error("ipaddr: invalid IPv6 prefix length");let s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=0,l=Math.floor(o/8);for(;d<l;)s[d]=255,d++;return l<16&&(s[l]=Math.pow(2,o%8)-1<<8-o%8),new this(s)},a.fromByteArray=function(o){let s=o.length;if(s===4)return new a.IPv4(o);if(s===16)return new a.IPv6(o);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},a.isValid=function(o){return a.IPv6.isValid(o)||a.IPv4.isValid(o)},a.parse=function(o){if(a.IPv6.isValid(o))return a.IPv6.parse(o);if(a.IPv4.isValid(o))return a.IPv4.parse(o);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},a.parseCIDR=function(o){try{return a.IPv6.parseCIDR(o)}catch{try{return a.IPv4.parseCIDR(o)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},a.process=function(o){let s=this.parse(o);return s.kind()==="ipv6"&&s.isIPv4MappedAddress()?s.toIPv4Address():s},a.subnetMatch=function(o,s,d){let l,y,I,C;d==null&&(d="unicast");for(y in s)if(Object.prototype.hasOwnProperty.call(s,y)){for(I=s[y],I[0]&&!(I[0]instanceof Array)&&(I=[I]),l=0;l<I.length;l++)if(C=I[l],o.kind()===C[0].kind()&&o.match.apply(o,C))return y}return d},typeof Cr<"u"&&Cr.exports?Cr.exports=a:r.ipaddr=a})(Tn)});var Ws={};q(Ws,{mdns:()=>Xs});var lr=class extends EventTarget{#e=new Map;listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,n){super.addEventListener(e,t,n);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:t,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,t,n){super.removeEventListener(e.toString(),t??null,n);let i=this.#e.get(e);i!=null&&(i=i.filter(({callback:c})=>c!==t),this.#e.set(e,i))}dispatchEvent(e){let t=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:i})=>!i),this.#e.set(e.type,n)),t}safeDispatchEvent(e,t){return this.dispatchEvent(new Ur(e,t))}},fr=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},Ur=globalThis.CustomEvent??fr;var Rt=Symbol.for("@libp2p/peer-discovery");var j=Qe(Vt(),1);var Br={};q(Br,{base32:()=>Q,base32hex:()=>Gi,base32hexpad:()=>Yi,base32hexpadupper:()=>Xi,base32hexupper:()=>Hi,base32pad:()=>ji,base32padupper:()=>Ki,base32upper:()=>Vi,base32z:()=>Wi});function $i(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var c=r.charAt(i),h=c.charCodeAt(0);if(t[h]!==255)throw new TypeError(c+" is ambiguous");t[h]=i}var g=r.length,m=r.charAt(0),p=Math.log(g)/Math.log(256),w=Math.log(256)/Math.log(g);function u(s){if(s instanceof Uint8Array||(ArrayBuffer.isView(s)?s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength):Array.isArray(s)&&(s=Uint8Array.from(s))),!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(s.length===0)return"";for(var d=0,l=0,y=0,I=s.length;y!==I&&s[y]===0;)y++,d++;for(var C=(I-y)*w+1>>>0,U=new Uint8Array(C);y!==I;){for(var O=s[y],f=0,z=C-1;(O!==0||f<l)&&z!==-1;z--,f++)O+=256*U[z]>>>0,U[z]=O%g>>>0,O=O/g>>>0;if(O!==0)throw new Error("Non-zero carry");l=f,y++}for(var Y=C-l;Y!==C&&U[Y]===0;)Y++;for(var Be=m.repeat(d);Y<C;++Y)Be+=r.charAt(U[Y]);return Be}function a(s){if(typeof s!="string")throw new TypeError("Expected String");if(s.length===0)return new Uint8Array;var d=0;if(s[d]!==" "){for(var l=0,y=0;s[d]===m;)l++,d++;for(var I=(s.length-d)*p+1>>>0,C=new Uint8Array(I);s[d];){var U=t[s.charCodeAt(d)];if(U===255)return;for(var O=0,f=I-1;(U!==0||O<y)&&f!==-1;f--,O++)U+=g*C[f]>>>0,C[f]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");y=O,d++}if(s[d]!==" "){for(var z=I-y;z!==I&&C[z]===0;)z++;for(var Y=new Uint8Array(l+(I-z)),Be=l;z!==I;)Y[Be++]=C[z++];return Y}}}function o(s){var d=a(s);if(d)return d;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:a,decode:o}}var Mi=$i,_i=Mi,jt=_i;var sc=new Uint8Array(0);var Kt=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},X=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 Gt=r=>new TextEncoder().encode(r),Ht=r=>new TextDecoder().decode(r);var Lr=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Rr=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Xt(this,e)}},Tr=class{constructor(e){this.decoders=e}or(e){return Xt(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Xt=(r,e)=>new Tr({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),Dr=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Lr(e,t,n),this.decoder=new Rr(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},_e=({name:r,prefix:e,encode:t,decode:n})=>new Dr(r,e,t,n),Ae=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=jt(t,e);return _e({prefix:r,name:e,encode:n,decode:c=>X(i(c))})},zi=(r,e,t,n)=>{let i={};for(let w=0;w<e.length;++w)i[e[w]]=w;let c=r.length;for(;r[c-1]==="=";)--c;let h=new Uint8Array(c*t/8|0),g=0,m=0,p=0;for(let w=0;w<c;++w){let u=i[r[w]];if(u===void 0)throw new SyntaxError(`Non-${n} character`);m=m<<t|u,g+=t,g>=8&&(g-=8,h[p++]=255&m>>g)}if(g>=t||255&m<<8-g)throw new SyntaxError("Unexpected end of data");return h},qi=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,c="",h=0,g=0;for(let m=0;m<r.length;++m)for(g=g<<8|r[m],h+=8;h>t;)h-=t,c+=e[i&g>>h];if(h&&(c+=e[i&g<<t-h]),n)for(;c.length*t&7;)c+="=";return c},F=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>_e({prefix:e,name:r,encode(i){return qi(i,n,t)},decode(i){return zi(i,n,t,r)}});var Q=F({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vi=F({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ji=F({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ki=F({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gi=F({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Hi=F({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yi=F({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xi=F({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Wi=F({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Nr={};q(Nr,{base58btc:()=>L,base58flickr:()=>Qi});var L=Ae({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Qi=Ae({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var $r={};q($r,{base64:()=>kr,base64pad:()=>Ji,base64url:()=>Zi,base64urlpad:()=>eo});var kr=F({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ji=F({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zi=F({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),eo=F({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});j.default.formatters.b=r=>r==null?"undefined":L.baseEncode(r);j.default.formatters.t=r=>r==null?"undefined":Q.baseEncode(r);j.default.formatters.m=r=>r==null?"undefined":kr.baseEncode(r);j.default.formatters.p=r=>r==null?"undefined":r.toString();j.default.formatters.c=r=>r==null?"undefined":r.toString();j.default.formatters.k=r=>r==null?"undefined":r.toString();j.default.formatters.a=r=>r==null?"undefined":r.toString();function ro(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function mr(r){let e=ro(`${r}:trace`);return j.default.enabled(`${r}:trace`)&&j.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,j.default)(`${r}:trace`)),Object.assign((0,j.default)(r),{error:(0,j.default)(`${r}:error`),trace:e})}var ai=Qe(pn(),1);var Ze=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var gn=Symbol.for("@libp2p/peer-id");var Qr={};q(Qr,{base10:()=>vo});var vo=Ae({prefix:"9",name:"base10",alphabet:"0123456789"});var Jr={};q(Jr,{base16:()=>Co,base16upper:()=>Ao});var Co=F({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ao=F({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Zr={};q(Zr,{base2:()=>bo});var bo=F({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var et={};q(et,{base256emoji:()=>Fo});var mn=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}"),So=mn.reduce((r,e,t)=>(r[t]=e,r),[]),fo=mn.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function Uo(r){return r.reduce((e,t)=>(e+=So[t],e),"")}function Oo(r){let e=[];for(let t of r){let n=fo[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Fo=_e({prefix:"\u{1F680}",name:"base256emoji",encode:Uo,decode:Oo});var rt={};q(rt,{base36:()=>Po,base36upper:()=>Lo});var Po=Ae({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Lo=Ae({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var tt={};q(tt,{base8:()=>Ro});var Ro=F({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var nt={};q(nt,{identity:()=>To});var To=_e({prefix:"\0",name:"identity",encode:r=>Ht(r),decode:r=>Gt(r)});var Bc=new TextEncoder,Nc=new TextDecoder;var ot={};q(ot,{identity:()=>Er});var No=In,yn=128,ko=127,$o=~ko,Mo=Math.pow(2,31);function In(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Mo;)e[t++]=r&255|yn,r/=128;for(;r&$o;)e[t++]=r&255|yn,r>>>=7;return e[t]=r|0,In.bytes=t-n+1,e}var _o=it,zo=128,wn=127;function it(r,n){var t=0,n=n||0,i=0,c=n,h,g=r.length;do{if(c>=g)throw it.bytes=0,new RangeError("Could not decode varint");h=r[c++],t+=i<28?(h&wn)<<i:(h&wn)*Math.pow(2,i),i+=7}while(h>=zo);return it.bytes=c-n,t}var qo=Math.pow(2,7),Vo=Math.pow(2,14),jo=Math.pow(2,21),Ko=Math.pow(2,28),Go=Math.pow(2,35),Ho=Math.pow(2,42),Yo=Math.pow(2,49),Xo=Math.pow(2,56),Wo=Math.pow(2,63),Qo=function(r){return r<qo?1:r<Vo?2:r<jo?3:r<Ko?4:r<Go?5:r<Ho?6:r<Yo?7:r<Xo?8:r<Wo?9:10},Jo={encode:No,decode:_o,encodingLength:Qo},Zo=Jo,er=Zo;var rr=(r,e=0)=>[er.decode(r,e),er.decode.bytes],qe=(r,e,t=0)=>(er.encode(r,e,t),e),Ve=r=>er.encodingLength(r);var Se=(r,e)=>{let t=e.byteLength,n=Ve(r),i=n+Ve(t),c=new Uint8Array(i+t);return qe(r,c,0),qe(t,c,n),c.set(e,i),new je(r,t,e,c)},Le=r=>{let e=X(r),[t,n]=rr(e),[i,c]=rr(e.subarray(n)),h=e.subarray(n+c);if(h.byteLength!==i)throw new Error("Incorrect length");return new je(t,i,h,e)},En=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Kt(r.bytes,t.bytes)}},je=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var xn=0,es="identity",vn=X,rs=r=>Se(xn,vn(r)),Er={code:xn,name:es,encode:vn,digest:rs};var dt={};q(dt,{sha256:()=>xr,sha512:()=>ts});var at=Qe(ue("crypto"),1);var ct=({name:r,code:e,encode:t})=>new st(r,e,t),st=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Se(this.code,t):t.then(n=>Se(this.code,n))}else throw Error("Unknown type, must be binary type")}};var xr=ct({name:"sha2-256",code:18,encode:r=>X(at.default.createHash("sha256").update(r).digest())}),ts=ct({name:"sha2-512",code:19,encode:r=>X(at.default.createHash("sha512").update(r).digest())});var An=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return is(t,lt(r),e||L.encoder);default:return os(t,lt(r),e||Q.encoder)}};var bn=new WeakMap,lt=r=>{let e=bn.get(r);if(e==null){let t=new Map;return bn.set(r,t),t}return e},re=class r{constructor(e,t,n,i){this.code=t,this.version=e,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:e,multihash:t}=this;if(e!==tr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ss)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Se(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&En(e.multihash,n.multihash)}toString(e){return An(this,e)}toJSON(){return{"/":An(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:c,bytes:h}=t;return new r(n,i,c,h||Sn(n,i,c.bytes))}else if(t[cs]===!0){let{version:n,multihash:i,code:c}=t,h=Le(i);return r.create(n,c,h)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==tr)throw new Error(`Version 0 CID must use dag-pb (code: ${tr}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=Sn(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,tr,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=X(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let c=i.subarray(t.multihashSize-t.digestSize),h=new je(t.multihashCode,t.digestSize,c,i);return[t.version===0?r.createV0(h):r.createV1(t.codec,h),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[u,a]=rr(e.subarray(t));return t+=a,u},i=n(),c=tr;if(i===18?(i=0,t=0):c=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let h=t,g=n(),m=n(),p=t+m,w=p-h;return{version:i,codec:c,multihashCode:g,digestSize:m,multihashSize:w,size:p}}static parse(e,t){let[n,i]=ns(e,t),c=r.decode(i);if(c.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return lt(c).set(n,e),c}},ns=(r,e)=>{switch(r[0]){case"Q":{let t=e||L;return[L.prefix,t.decode(`${L.prefix}${r}`)]}case L.prefix:{let t=e||L;return[L.prefix,t.decode(r)]}case Q.prefix:{let t=e||Q;return[Q.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},is=(r,e,t)=>{let{prefix:n}=t;if(n!==L.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let c=t.encode(r).slice(1);return e.set(n,c),c}else return i},os=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let c=t.encode(r);return e.set(n,c),c}else return i},tr=112,ss=18,Sn=(r,e,t)=>{let n=Ve(r),i=n+Ve(e),c=new Uint8Array(i+t.byteLength);return qe(r,c,0),qe(e,c,n),c.set(t,i),c},cs=Symbol.for("@ipld/js-cid/CID");var fe={...nt,...Zr,...tt,...Qr,...Jr,...Br,...rt,...Nr,...$r,...et},Zc={...dt,...ot};function nr(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}var as=Symbol.for("nodejs.util.inspect.custom"),fn=Object.values(fe).map(r=>r.decoder).reduce((r,e)=>r.or(e),fe.identity.decoder),Un=114,On=36,Fn=37,ir=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[gn]=!0;toString(){return this.string==null&&(this.string=L.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return re.createV1(Un,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return nr(this.multihash.bytes,e);if(typeof e=="string")return ut(e).equals(this);if(e?.multihash?.bytes!=null)return nr(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[as](){return`PeerId(${this.toString()})`}},or=class extends ir{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},sr=class extends ir{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},cr=class extends ir{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function ut(r,e){if(e=e??fn,r.charAt(0)==="1"||r.charAt(0)==="Q"){let t=Le(L.decode(`z${r}`));return r.startsWith("12D")?new sr({multihash:t}):r.startsWith("16U")?new cr({multihash:t}):new or({multihash:t})}return ds(fn.decode(r))}function ds(r){try{let e=Le(r);if(e.code===Er.code){if(e.digest.length===On)return new sr({multihash:e});if(e.digest.length===Fn)return new cr({multihash:e})}if(e.code===xr.code)return new or({multihash:e})}catch{return ls(re.decode(r))}throw new Error("Supplied PeerID CID is invalid")}function ls(r){if(r==null||r.multihash==null||r.version==null||r.version===1&&r.code!==Un)throw new Error("Supplied PeerID CID is invalid");let e=r.multihash;if(e.code===xr.code)return new or({multihash:r.multihash});if(e.code===Er.code){if(e.digest.length===On)return new sr({multihash:r.multihash});if(e.digest.length===Fn)return new cr({multihash:r.multihash})}throw new Error("Supplied PeerID CID is invalid")}var Nn=Qe(Pn(),1);var Ln="[a-fA-F\\d:]",Ue=r=>r&&r.includeBoundaries?`(?:(?<=\\s|^)(?=${Ln})|(?<=${Ln})(?=\\s|$))`:"",te="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",P="[a-fA-F\\d]{1,4}",vr=`
|
|
5
|
+
`)}function Bi(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function Ni(){return process.env.DEBUG}function $i(r){r.inspectOpts={};let e=Object.keys(D.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=D.inspectOpts[e[t]]}gr.exports=Or()(D);var{formatters:zt}=gr.exports;zt.o=function(r){return this.inspectOpts.colors=this.useColors,pr.inspect(r,this.inspectOpts).split(`
|
|
6
|
+
`).map(e=>e.trim()).join(" ")};zt.O=function(r){return this.inspectOpts.colors=this.useColors,pr.inspect(r,this.inspectOpts)}});var Vt=R((ic,Pr)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Pr.exports=Nt():Pr.exports=qt()});var Wt=R(Mr=>{"use strict";Mr.toString=function(r){switch(r){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+r};Mr.toType=function(r){switch(r.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}return r.toUpperCase().startsWith("UNKNOWN_")?parseInt(r.slice(8)):0}});var Qt=R(_r=>{"use strict";_r.toString=function(r){switch(r){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+r};_r.toRcode=function(r){switch(r.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var Jt=R(zr=>{"use strict";zr.toString=function(r){switch(r){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+r};zr.toOpcode=function(r){switch(r.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var Zt=R(qr=>{"use strict";qr.toString=function(r){switch(r){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+r};qr.toClass=function(r){switch(r.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var en=R(Vr=>{"use strict";Vr.toString=function(r){switch(r){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}return r<0?null:`OPTION_${r}`};Vr.toCode=function(r){if(typeof r=="number")return r;if(!r)return-1;switch(r.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let e=r.match(/_(\d+)$/);return e?parseInt(e[1],10):-1}});var nn=R((tn,jr)=>{var rn=function(r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decode=u,r.encode=w,r.familyOf=p,r.name=void 0,r.sizeOf=m,r.v6=r.v4=void 0;let e=/^(\d{1,3}\.){3,3}\d{1,3}$/,t=4,n=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,i=16,c={name:"v4",size:t,isFormat:a=>e.test(a),encode(a,o,s){s=~~s,o=o||new Uint8Array(s+t);let d=a.length,l=0;for(let y=0;y<d;){let I=a.charCodeAt(y++);I===46?(o[s++]=l,l=0):l=l*10+(I-48)}return o[s]=l,o},decode(a,o){return o=~~o,`${a[o++]}.${a[o++]}.${a[o++]}.${a[o]}`}};r.v4=c;let h={name:"v6",size:i,isFormat:a=>a.length>0&&n.test(a),encode(a,o,s){s=~~s;let d=s+i,l=-1,y=0,I=0,C=!0,U=!1;o=o||new Uint8Array(s+i);for(let O=0;O<a.length;O++){let f=a.charCodeAt(O);f===58?(C?l!==-1?(s<d&&(o[s]=0),s<d-1&&(o[s+1]=0),s+=2):s<d&&(l=s):(U===!0?(s<d&&(o[s]=I),s++):(s<d&&(o[s]=y>>8),s<d-1&&(o[s+1]=y&255),s+=2),y=0,I=0),C=!0,U=!1):f===46?(s<d&&(o[s]=I),s++,I=0,y=0,C=!1,U=!0):(C=!1,f>=97?f-=87:f>=65?f-=55:(f-=48,I=I*10+f),y=(y<<4)+f)}if(C===!1)U===!0?(s<d&&(o[s]=I),s++):(s<d&&(o[s]=y>>8),s<d-1&&(o[s+1]=y&255),s+=2);else if(l===0)s<d&&(o[s]=0),s<d-1&&(o[s+1]=0),s+=2;else if(l!==-1){s+=2;for(let O=Math.min(s-1,d-1);O>=l+2;O--)o[O]=o[O-2];o[l]=0,o[l+1]=0,l=s}if(l!==s&&l!==-1)for(s>d-2&&(s=d-2);d>l;)o[--d]=s<d&&s>l?o[--s]:0;else for(;s<d;)o[s++]=0;return o},decode(a,o){o=~~o;let s="";for(let d=0;d<i;d+=2)d!==0&&(s+=":"),s+=(a[o+d]<<8|a[o+d+1]).toString(16);return s.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};r.v6=h;let g="ip";r.name=g;function m(a){if(c.isFormat(a))return c.size;if(h.isFormat(a))return h.size;throw Error(`Invalid ip address: ${a}`)}function p(a){return m(a)===c.size?1:2}function w(a,o,s){s=~~s;let d=m(a);return typeof o=="function"&&(o=o(s+d)),d===c.size?c.encode(a,o,s):h.encode(a,o,s)}function u(a,o,s){if(o=~~o,s=s||a.length-o,s===c.size)return c.decode(a,o,s);if(s===h.size)return h.decode(a,o,s);throw Error(`Invalid buffer size needs to be ${c.size} for v4 or ${h.size} for v6.`)}return"default"in r?r.default:r}({});typeof define=="function"&&define.amd?define([],function(){return rn}):typeof jr=="object"&&typeof tn=="object"&&(jr.exports=rn)});var cn=R(x=>{"use strict";var v=ue("buffer").Buffer,ve=Wt(),to=Qt(),no=Jt(),wr=Zt(),Kr=en(),Pe=nn(),io=0,on=32768,Gr=32768,oo=~Gr,sn=32768,so=~sn,E=x.name={};E.encode=function(r,e,t,{mail:n=!1}={}){e||(e=v.alloc(E.encodingLength(r))),t||(t=0);let i=t,c=r.replace(/^\.|\.$/gm,"");if(c.length){let h=[];if(n){let g="";c.split(".").forEach(m=>{m.endsWith("\\")?g+=(g.length?".":"")+m.slice(0,-1):h.length===0&&g.length?h.push(g+"."+m):h.push(m)})}else h=c.split(".");for(let g=0;g<h.length;g++){let m=e.write(h[g],t+1);e[t]=m,t+=m+1}}return e[t++]=0,E.encode.bytes=t-i,e};E.encode.bytes=0;E.decode=function(r,e,{mail:t=!1}={}){e||(e=0);let n=[],i=e,c=0,h=0,g=!1;for(;;){if(e>=r.length)throw new Error("Cannot decode name (buffer overflow)");let m=r[e++];if(h+=g?0:1,m===0)break;if(m&192)if((m&192)===192){if(e+1>r.length)throw new Error("Cannot decode name (buffer overflow)");let p=r.readUInt16BE(e-1)-49152;if(p>=i)throw new Error("Cannot decode name (bad pointer)");e=p,i=p,h+=g?0:1,g=!0}else throw new Error("Cannot decode name (bad label)");else{if(e+m>r.length)throw new Error("Cannot decode name (buffer overflow)");if(c+=m+1,c>254)throw new Error("Cannot decode name (name too long)");let p=r.toString("utf-8",e,e+m);t&&(p=p.replace(/\./g,"\\.")),n.push(p),e+=m,h+=g?0:m}}return E.decode.bytes=h,n.length===0?".":n.join(".")};E.decode.bytes=0;E.encodingLength=function(r){return r==="."||r===".."?1:v.byteLength(r.replace(/^\.|\.$/gm,""))+2};var A={};A.encode=function(r,e,t){e||(e=v.alloc(A.encodingLength(r))),t||(t=0);let n=e.write(r,t+1);return e[t]=n,A.encode.bytes=n+1,e};A.encode.bytes=0;A.decode=function(r,e){e||(e=0);let t=r[e],n=r.toString("utf-8",e+1,e+1+t);return A.decode.bytes=t+1,n};A.decode.bytes=0;A.encodingLength=function(r){return v.byteLength(r)+1};var ee={};ee.encode=function(r,e,t){e||(e=ee.encodingLength(r)),t||(t=0);let n=(r.flags||0)&32767,i=r.type==="response"?on:io;return e.writeUInt16BE(r.id||0,t),e.writeUInt16BE(n|i,t+2),e.writeUInt16BE(r.questions.length,t+4),e.writeUInt16BE(r.answers.length,t+6),e.writeUInt16BE(r.authorities.length,t+8),e.writeUInt16BE(r.additionals.length,t+10),e};ee.encode.bytes=12;ee.decode=function(r,e){if(e||(e=0),r.length<12)throw new Error("Header must be 12 bytes");let t=r.readUInt16BE(e+2);return{id:r.readUInt16BE(e),type:t&on?"response":"query",flags:t&32767,flag_qr:(t>>15&1)===1,opcode:no.toString(t>>11&15),flag_aa:(t>>10&1)===1,flag_tc:(t>>9&1)===1,flag_rd:(t>>8&1)===1,flag_ra:(t>>7&1)===1,flag_z:(t>>6&1)===1,flag_ad:(t>>5&1)===1,flag_cd:(t>>4&1)===1,rcode:to.toString(t&15),questions:new Array(r.readUInt16BE(e+4)),answers:new Array(r.readUInt16BE(e+6)),authorities:new Array(r.readUInt16BE(e+8)),additionals:new Array(r.readUInt16BE(e+10))}};ee.decode.bytes=12;ee.encodingLength=function(){return 12};var he=x.unknown={};he.encode=function(r,e,t){return e||(e=v.alloc(he.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.length,t),r.copy(e,t+2),he.encode.bytes=r.length+2,e};he.encode.bytes=0;he.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=r.slice(e+2,e+2+t);return he.decode.bytes=t+2,n};he.decode.bytes=0;he.encodingLength=function(r){return r.length+2};var pe=x.ns={};pe.encode=function(r,e,t){return e||(e=v.alloc(pe.encodingLength(r))),t||(t=0),E.encode(r,e,t+2),e.writeUInt16BE(E.encode.bytes,t),pe.encode.bytes=E.encode.bytes+2,e};pe.encode.bytes=0;pe.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n=E.decode(r,e+2);return pe.decode.bytes=t+2,n};pe.decode.bytes=0;pe.encodingLength=function(r){return E.encodingLength(r)+2};var ge=x.soa={};ge.encode=function(r,e,t){e||(e=v.alloc(ge.encodingLength(r))),t||(t=0);let n=t;return t+=2,E.encode(r.mname,e,t),t+=E.encode.bytes,E.encode(r.rname,e,t,{mail:!0}),t+=E.encode.bytes,e.writeUInt32BE(r.serial||0,t),t+=4,e.writeUInt32BE(r.refresh||0,t),t+=4,e.writeUInt32BE(r.retry||0,t),t+=4,e.writeUInt32BE(r.expire||0,t),t+=4,e.writeUInt32BE(r.minimum||0,t),t+=4,e.writeUInt16BE(t-n-2,n),ge.encode.bytes=t-n,e};ge.encode.bytes=0;ge.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mname=E.decode(r,e),e+=E.decode.bytes,n.rname=E.decode(r,e,{mail:!0}),e+=E.decode.bytes,n.serial=r.readUInt32BE(e),e+=4,n.refresh=r.readUInt32BE(e),e+=4,n.retry=r.readUInt32BE(e),e+=4,n.expire=r.readUInt32BE(e),e+=4,n.minimum=r.readUInt32BE(e),e+=4,ge.decode.bytes=e-t,n};ge.decode.bytes=0;ge.encodingLength=function(r){return 22+E.encodingLength(r.mname)+E.encodingLength(r.rname)};var me=x.txt={};me.encode=function(r,e,t){Array.isArray(r)||(r=[r]);for(let i=0;i<r.length;i++)if(typeof r[i]=="string"&&(r[i]=v.from(r[i])),!v.isBuffer(r[i]))throw new Error("Must be a Buffer");e||(e=v.alloc(me.encodingLength(r))),t||(t=0);let n=t;return t+=2,r.forEach(function(i){e[t++]=i.length,i.copy(e,t,0,i.length),t+=i.length}),e.writeUInt16BE(t-n-2,n),me.encode.bytes=t-n,e};me.encode.bytes=0;me.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=[];for(;n>0;){let c=r[e++];if(--n,n<c)throw new Error("Buffer overflow");i.push(r.slice(e,e+c)),e+=c,n-=c}return me.decode.bytes=e-t,i};me.decode.bytes=0;me.encodingLength=function(r){Array.isArray(r)||(r=[r]);let e=2;return r.forEach(function(t){typeof t=="string"?e+=v.byteLength(t)+1:e+=t.length+1}),e};var ye=x.null={};ye.encode=function(r,e,t){e||(e=v.alloc(ye.encodingLength(r))),t||(t=0),typeof r=="string"&&(r=v.from(r)),r||(r=v.alloc(0));let n=t;t+=2;let i=r.length;return r.copy(e,t,0,i),t+=i,e.writeUInt16BE(t-n-2,n),ye.encode.bytes=t-n,e};ye.encode.bytes=0;ye.decode=function(r,e){e||(e=0);let t=e,n=r.readUInt16BE(e);e+=2;let i=r.slice(e,e+n);return e+=n,ye.decode.bytes=e-t,i};ye.decode.bytes=0;ye.encodingLength=function(r){return r?(v.isBuffer(r)?r.length:v.byteLength(r))+2:2};var we=x.hinfo={};we.encode=function(r,e,t){e||(e=v.alloc(we.encodingLength(r))),t||(t=0);let n=t;return t+=2,A.encode(r.cpu,e,t),t+=A.encode.bytes,A.encode(r.os,e,t),t+=A.encode.bytes,e.writeUInt16BE(t-n-2,n),we.encode.bytes=t-n,e};we.encode.bytes=0;we.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.cpu=A.decode(r,e),e+=A.decode.bytes,n.os=A.decode(r,e),e+=A.decode.bytes,we.decode.bytes=e-t,n};we.decode.bytes=0;we.encodingLength=function(r){return A.encodingLength(r.cpu)+A.encodingLength(r.os)+2};var J=x.ptr={},co=x.cname=J,ao=x.dname=J;J.encode=function(r,e,t){return e||(e=v.alloc(J.encodingLength(r))),t||(t=0),E.encode(r,e,t+2),e.writeUInt16BE(E.encode.bytes,t),J.encode.bytes=E.encode.bytes+2,e};J.encode.bytes=0;J.decode=function(r,e){e||(e=0);let t=E.decode(r,e+2);return J.decode.bytes=E.decode.bytes+2,t};J.decode.bytes=0;J.encodingLength=function(r){return E.encodingLength(r)+2};var Ie=x.srv={};Ie.encode=function(r,e,t){e||(e=v.alloc(Ie.encodingLength(r))),t||(t=0),e.writeUInt16BE(r.priority||0,t+2),e.writeUInt16BE(r.weight||0,t+4),e.writeUInt16BE(r.port||0,t+6),E.encode(r.target,e,t+8);let n=E.encode.bytes+6;return e.writeUInt16BE(n,t),Ie.encode.bytes=n+2,e};Ie.encode.bytes=0;Ie.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e),n={};return n.priority=r.readUInt16BE(e+2),n.weight=r.readUInt16BE(e+4),n.port=r.readUInt16BE(e+6),n.target=E.decode(r,e+8),Ie.decode.bytes=t+2,n};Ie.decode.bytes=0;Ie.encodingLength=function(r){return 8+E.encodingLength(r.target)};var K=x.caa={};K.ISSUER_CRITICAL=128;K.encode=function(r,e,t){let n=K.encodingLength(r);return e||(e=v.alloc(K.encodingLength(r))),t||(t=0),r.issuerCritical&&(r.flags=K.ISSUER_CRITICAL),e.writeUInt16BE(n-2,t),t+=2,e.writeUInt8(r.flags||0,t),t+=1,A.encode(r.tag,e,t),t+=A.encode.bytes,e.write(r.value,t),t+=v.byteLength(r.value),K.encode.bytes=n,e};K.encode.bytes=0;K.decode=function(r,e){e||(e=0);let t=r.readUInt16BE(e);e+=2;let n=e,i={};return i.flags=r.readUInt8(e),e+=1,i.tag=A.decode(r,e),e+=A.decode.bytes,i.value=r.toString("utf-8",e,n+t),i.issuerCritical=!!(i.flags&K.ISSUER_CRITICAL),K.decode.bytes=t+2,i};K.decode.bytes=0;K.encodingLength=function(r){return A.encodingLength(r.tag)+A.encodingLength(r.value)+2};var be=x.mx={};be.encode=function(r,e,t){e||(e=v.alloc(be.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,E.encode(r.exchange,e,t),t+=E.encode.bytes,e.writeUInt16BE(t-n-2,n),be.encode.bytes=t-n,e};be.encode.bytes=0;be.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.preference=r.readUInt16BE(e),e+=2,n.exchange=E.decode(r,e),e+=E.decode.bytes,be.decode.bytes=e-t,n};be.encodingLength=function(r){return 4+E.encodingLength(r.exchange)};var Ee=x.a={};Ee.encode=function(r,e,t){return e||(e=v.alloc(Ee.encodingLength(r))),t||(t=0),e.writeUInt16BE(4,t),t+=2,Pe.v4.encode(r,e,t),Ee.encode.bytes=6,e};Ee.encode.bytes=0;Ee.decode=function(r,e){e||(e=0),e+=2;let t=Pe.v4.decode(r,e);return Ee.decode.bytes=6,t};Ee.decode.bytes=0;Ee.encodingLength=function(){return 6};var xe=x.aaaa={};xe.encode=function(r,e,t){return e||(e=v.alloc(xe.encodingLength(r))),t||(t=0),e.writeUInt16BE(16,t),t+=2,Pe.v6.encode(r,e,t),xe.encode.bytes=18,e};xe.encode.bytes=0;xe.decode=function(r,e){e||(e=0),e+=2;let t=Pe.v6.decode(r,e);return xe.decode.bytes=18,t};xe.decode.bytes=0;xe.encodingLength=function(){return 18};var M=x.option={};M.encode=function(r,e,t){e||(e=v.alloc(M.encodingLength(r))),t||(t=0);let n=t,i=Kr.toCode(r.code);if(e.writeUInt16BE(i,t),t+=2,r.data)e.writeUInt16BE(r.data.length,t),t+=2,r.data.copy(e,t),t+=r.data.length;else switch(i){case 8:let c=r.sourcePrefixLength||0,h=r.family||Pe.familyOf(r.ip),g=Pe.encode(r.ip,v.alloc),m=Math.ceil(c/8);e.writeUInt16BE(m+4,t),t+=2,e.writeUInt16BE(h,t),t+=2,e.writeUInt8(c,t++),e.writeUInt8(r.scopePrefixLength||0,t++),g.copy(e,t,0,m),t+=m;break;case 11:r.timeout?(e.writeUInt16BE(2,t),t+=2,e.writeUInt16BE(r.timeout,t),t+=2):(e.writeUInt16BE(0,t),t+=2);break;case 12:let p=r.length||0;e.writeUInt16BE(p,t),t+=2,e.fill(0,t,t+p),t+=p;break;case 14:let w=r.tags.length*2;e.writeUInt16BE(w,t),t+=2;for(let u of r.tags)e.writeUInt16BE(u,t),t+=2;break;default:throw new Error(`Unknown roption code: ${r.code}`)}return M.encode.bytes=t-n,e};M.encode.bytes=0;M.decode=function(r,e){e||(e=0);let t={};t.code=r.readUInt16BE(e),t.type=Kr.toString(t.code),e+=2;let n=r.readUInt16BE(e);switch(e+=2,t.data=r.slice(e,e+n),t.code){case 8:t.family=r.readUInt16BE(e),e+=2,t.sourcePrefixLength=r.readUInt8(e++),t.scopePrefixLength=r.readUInt8(e++);let i=v.alloc(t.family===1?4:16);r.copy(i,0,e,e+n-4),t.ip=Pe.decode(i);break;case 11:n>0&&(t.timeout=r.readUInt16BE(e),e+=2);break;case 14:t.tags=[];for(let c=0;c<n;c+=2)t.tags.push(r.readUInt16BE(e)),e+=2}return M.decode.bytes=n+4,t};M.decode.bytes=0;M.encodingLength=function(r){if(r.data)return r.data.length+4;switch(Kr.toCode(r.code)){case 8:let t=r.sourcePrefixLength||0;return Math.ceil(t/8)+8;case 11:return typeof r.timeout=="number"?6:4;case 12:return r.length+4;case 14:return 4+r.tags.length*2}throw new Error(`Unknown roption code: ${r.code}`)};var H=x.opt={};H.encode=function(r,e,t){e||(e=v.alloc(H.encodingLength(r))),t||(t=0);let n=t,i=ze(r,M);return e.writeUInt16BE(i,t),t=Je(r,M,e,t+2),H.encode.bytes=t-n,e};H.encode.bytes=0;H.decode=function(r,e){e||(e=0);let t=e,n=[],i=r.readUInt16BE(e);e+=2;let c=0;for(;i>0;)n[c++]=M.decode(r,e),e+=M.decode.bytes,i-=M.decode.bytes;return H.decode.bytes=e-t,n};H.decode.bytes=0;H.encodingLength=function(r){return 2+ze(r||[],M)};var k=x.dnskey={};k.PROTOCOL_DNSSEC=3;k.ZONE_KEY=128;k.SECURE_ENTRYPOINT=32768;k.encode=function(r,e,t){e||(e=v.alloc(k.encodingLength(r))),t||(t=0);let n=t,i=r.key;if(!v.isBuffer(i))throw new Error("Key must be a Buffer");return t+=2,e.writeUInt16BE(r.flags,t),t+=2,e.writeUInt8(k.PROTOCOL_DNSSEC,t),t+=1,e.writeUInt8(r.algorithm,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,k.encode.bytes=t-n,e.writeUInt16BE(k.encode.bytes-2,n),e};k.encode.bytes=0;k.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);if(e+=2,n.flags=r.readUInt16BE(e),e+=2,r.readUInt8(e)!==k.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return e+=1,n.algorithm=r.readUInt8(e),e+=1,n.key=r.slice(e,t+i+2),e+=n.key.length,k.decode.bytes=e-t,n};k.decode.bytes=0;k.encodingLength=function(r){return 6+v.byteLength(r.key)};var ne=x.rrsig={};ne.encode=function(r,e,t){e||(e=v.alloc(ne.encodingLength(r))),t||(t=0);let n=t,i=r.signature;if(!v.isBuffer(i))throw new Error("Signature must be a Buffer");return t+=2,e.writeUInt16BE(ve.toType(r.typeCovered),t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.labels,t),t+=1,e.writeUInt32BE(r.originalTTL,t),t+=4,e.writeUInt32BE(r.expiration,t),t+=4,e.writeUInt32BE(r.inception,t),t+=4,e.writeUInt16BE(r.keyTag,t),t+=2,E.encode(r.signersName,e,t),t+=E.encode.bytes,i.copy(e,t,0,i.length),t+=i.length,ne.encode.bytes=t-n,e.writeUInt16BE(ne.encode.bytes-2,n),e};ne.encode.bytes=0;ne.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.typeCovered=ve.toString(r.readUInt16BE(e)),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.labels=r.readUInt8(e),e+=1,n.originalTTL=r.readUInt32BE(e),e+=4,n.expiration=r.readUInt32BE(e),e+=4,n.inception=r.readUInt32BE(e),e+=4,n.keyTag=r.readUInt16BE(e),e+=2,n.signersName=E.decode(r,e),e+=E.decode.bytes,n.signature=r.slice(e,t+i+2),e+=n.signature.length,ne.decode.bytes=e-t,n};ne.decode.bytes=0;ne.encodingLength=function(r){return 20+E.encodingLength(r.signersName)+v.byteLength(r.signature)};var ie=x.rp={};ie.encode=function(r,e,t){e||(e=v.alloc(ie.encodingLength(r))),t||(t=0);let n=t;return t+=2,E.encode(r.mbox||".",e,t,{mail:!0}),t+=E.encode.bytes,E.encode(r.txt||".",e,t),t+=E.encode.bytes,ie.encode.bytes=t-n,e.writeUInt16BE(ie.encode.bytes-2,n),e};ie.encode.bytes=0;ie.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.mbox=E.decode(r,e,{mail:!0})||".",e+=E.decode.bytes,n.txt=E.decode(r,e)||".",e+=E.decode.bytes,ie.decode.bytes=e-t,n};ie.decode.bytes=0;ie.encodingLength=function(r){return 2+E.encodingLength(r.mbox||".")+E.encodingLength(r.txt||".")};var T={};T.encode=function(r,e,t){e||(e=v.alloc(T.encodingLength(r))),t||(t=0);let n=t;for(var i=[],c=0;c<r.length;c++){var h=ve.toType(r[c]);i[h>>8]===void 0&&(i[h>>8]=[]),i[h>>8][h>>3&31]|=1<<7-(h&7)}for(c=0;c<i.length;c++)if(i[c]!==void 0){var g=v.from(i[c]);e.writeUInt8(c,t),t+=1,e.writeUInt8(g.length,t),t+=1,g.copy(e,t),t+=g.length}return T.encode.bytes=t-n,e};T.encode.bytes=0;T.decode=function(r,e,t){e||(e=0);let n=e;for(var i=[];e-n<t;){var c=r.readUInt8(e);e+=1;var h=r.readUInt8(e);e+=1;for(var g=0;g<h;g++)for(var m=r.readUInt8(e+g),p=0;p<8;p++)if(m&1<<7-p){var w=ve.toString(c<<8|g<<3|p);i.push(w)}e+=h}return T.decode.bytes=e-n,i};T.decode.bytes=0;T.encodingLength=function(r){for(var e=[],t=0;t<r.length;t++){var n=ve.toType(r[t]);e[n>>8]=Math.max(e[n>>8]||0,n&255)}var i=0;for(t=0;t<e.length;t++)e[t]!==void 0&&(i+=2+Math.ceil((e[t]+1)/8));return i};var oe=x.nsec={};oe.encode=function(r,e,t){e||(e=v.alloc(oe.encodingLength(r))),t||(t=0);let n=t;return t+=2,E.encode(r.nextDomain,e,t),t+=E.encode.bytes,T.encode(r.rrtypes,e,t),t+=T.encode.bytes,oe.encode.bytes=t-n,e.writeUInt16BE(oe.encode.bytes-2,n),e};oe.encode.bytes=0;oe.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.nextDomain=E.decode(r,e),e+=E.decode.bytes,n.rrtypes=T.decode(r,e,i-(e-t)),e+=T.decode.bytes,oe.decode.bytes=e-t,n};oe.decode.bytes=0;oe.encodingLength=function(r){return 2+E.encodingLength(r.nextDomain)+T.encodingLength(r.rrtypes)};var se=x.nsec3={};se.encode=function(r,e,t){e||(e=v.alloc(se.encodingLength(r))),t||(t=0);let n=t,i=r.salt;if(!v.isBuffer(i))throw new Error("salt must be a Buffer");let c=r.nextDomain;if(!v.isBuffer(c))throw new Error("nextDomain must be a Buffer");return t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.flags,t),t+=1,e.writeUInt16BE(r.iterations,t),t+=2,e.writeUInt8(i.length,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,e.writeUInt8(c.length,t),t+=1,c.copy(e,t,0,c.length),t+=c.length,T.encode(r.rrtypes,e,t),t+=T.encode.bytes,se.encode.bytes=t-n,e.writeUInt16BE(se.encode.bytes-2,n),e};se.encode.bytes=0;se.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);e+=2,n.algorithm=r.readUInt8(e),e+=1,n.flags=r.readUInt8(e),e+=1,n.iterations=r.readUInt16BE(e),e+=2;let c=r.readUInt8(e);e+=1,n.salt=r.slice(e,e+c),e+=c;let h=r.readUInt8(e);return e+=1,n.nextDomain=r.slice(e,e+h),e+=h,n.rrtypes=T.decode(r,e,i-(e-t)),e+=T.decode.bytes,se.decode.bytes=e-t,n};se.decode.bytes=0;se.encodingLength=function(r){return 8+r.salt.length+r.nextDomain.length+T.encodingLength(r.rrtypes)};var ce=x.ds={};ce.encode=function(r,e,t){e||(e=v.alloc(ce.encodingLength(r))),t||(t=0);let n=t,i=r.digest;if(!v.isBuffer(i))throw new Error("Digest must be a Buffer");return t+=2,e.writeUInt16BE(r.keyTag,t),t+=2,e.writeUInt8(r.algorithm,t),t+=1,e.writeUInt8(r.digestType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,ce.encode.bytes=t-n,e.writeUInt16BE(ce.encode.bytes-2,n),e};ce.encode.bytes=0;ce.decode=function(r,e){e||(e=0);let t=e;var n={},i=r.readUInt16BE(e);return e+=2,n.keyTag=r.readUInt16BE(e),e+=2,n.algorithm=r.readUInt8(e),e+=1,n.digestType=r.readUInt8(e),e+=1,n.digest=r.slice(e,t+i+2),e+=n.digest.length,ce.decode.bytes=e-t,n};ce.decode.bytes=0;ce.encodingLength=function(r){return 6+v.byteLength(r.digest)};var G=x.sshfp={};G.getFingerprintLengthForHashType=function(e){switch(e){case 1:return 20;case 2:return 32}};G.encode=function(e,t,n){t||(t=v.alloc(G.encodingLength(e))),n||(n=0);let i=n;n+=2,t[n]=e.algorithm,n+=1,t[n]=e.hash,n+=1;let c=v.from(e.fingerprint.toUpperCase(),"hex");if(c.length!==G.getFingerprintLengthForHashType(e.hash))throw new Error("Invalid fingerprint length");return c.copy(t,n),n+=c.byteLength,G.encode.bytes=n-i,t.writeUInt16BE(G.encode.bytes-2,i),t};G.encode.bytes=0;G.decode=function(e,t){t||(t=0);let n=t,i={};t+=2,i.algorithm=e[t],t+=1,i.hash=e[t],t+=1;let c=G.getFingerprintLengthForHashType(i.hash);return i.fingerprint=e.slice(t,t+c).toString("hex").toUpperCase(),t+=c,G.decode.bytes=t-n,i};G.decode.bytes=0;G.encodingLength=function(r){return 4+v.from(r.fingerprint,"hex").byteLength};var ae=x.naptr={};ae.encode=function(r,e,t){e||(e=v.alloc(ae.encodingLength(r))),t||(t=0);let n=t;return t+=2,e.writeUInt16BE(r.order||0,t),t+=2,e.writeUInt16BE(r.preference||0,t),t+=2,A.encode(r.flags,e,t),t+=A.encode.bytes,A.encode(r.services,e,t),t+=A.encode.bytes,A.encode(r.regexp,e,t),t+=A.encode.bytes,E.encode(r.replacement,e,t),t+=E.encode.bytes,ae.encode.bytes=t-n,e.writeUInt16BE(ae.encode.bytes-2,n),e};ae.encode.bytes=0;ae.decode=function(r,e){e||(e=0);let t=e,n={};return e+=2,n.order=r.readUInt16BE(e),e+=2,n.preference=r.readUInt16BE(e),e+=2,n.flags=A.decode(r,e),e+=A.decode.bytes,n.services=A.decode(r,e),e+=A.decode.bytes,n.regexp=A.decode(r,e),e+=A.decode.bytes,n.replacement=E.decode(r,e),e+=E.decode.bytes,ae.decode.bytes=e-t,n};ae.decode.bytes=0;ae.encodingLength=function(r){return A.encodingLength(r.flags)+A.encodingLength(r.services)+A.encodingLength(r.regexp)+E.encodingLength(r.replacement)+6};var de=x.tlsa={};de.encode=function(r,e,t){e||(e=v.alloc(de.encodingLength(r))),t||(t=0);let n=t,i=r.certificate;if(!v.isBuffer(i))throw new Error("Certificate must be a Buffer");return t+=2,e.writeUInt8(r.usage,t),t+=1,e.writeUInt8(r.selector,t),t+=1,e.writeUInt8(r.matchingType,t),t+=1,i.copy(e,t,0,i.length),t+=i.length,de.encode.bytes=t-n,e.writeUInt16BE(de.encode.bytes-2,n),e};de.encode.bytes=0;de.decode=function(r,e){e||(e=0);let t=e,n={},i=r.readUInt16BE(e);return e+=2,n.usage=r.readUInt8(e),e+=1,n.selector=r.readUInt8(e),e+=1,n.matchingType=r.readUInt8(e),e+=1,n.certificate=r.slice(e,t+i+2),e+=n.certificate.length,de.decode.bytes=e-t,n};de.decode.bytes=0;de.encodingLength=function(r){return 5+v.byteLength(r.certificate)};var Hr=x.record=function(r){switch(r.toUpperCase()){case"A":return Ee;case"PTR":return J;case"CNAME":return co;case"DNAME":return ao;case"TXT":return me;case"NULL":return ye;case"AAAA":return xe;case"SRV":return Ie;case"HINFO":return we;case"CAA":return K;case"NS":return pe;case"SOA":return ge;case"MX":return be;case"OPT":return H;case"DNSKEY":return k;case"RRSIG":return ne;case"RP":return ie;case"NSEC":return oe;case"NSEC3":return se;case"SSHFP":return G;case"DS":return ce;case"NAPTR":return ae;case"TLSA":return de}return he},B=x.answer={};B.encode=function(r,e,t){e||(e=v.alloc(B.encodingLength(r))),t||(t=0);let n=t;if(E.encode(r.name,e,t),t+=E.encode.bytes,e.writeUInt16BE(ve.toType(r.type),t),r.type.toUpperCase()==="OPT"){if(r.name!==".")throw new Error("OPT name must be root.");e.writeUInt16BE(r.udpPayloadSize||4096,t+2),e.writeUInt8(r.extendedRcode||0,t+4),e.writeUInt8(r.ednsVersion||0,t+5),e.writeUInt16BE(r.flags||0,t+6),t+=8,H.encode(r.options||[],e,t),t+=H.encode.bytes}else{let i=wr.toClass(r.class===void 0?"IN":r.class);r.flush&&(i|=Gr),e.writeUInt16BE(i,t+2),e.writeUInt32BE(r.ttl||0,t+4),t+=8;let c=Hr(r.type);c.encode(r.data,e,t),t+=c.encode.bytes}return B.encode.bytes=t-n,e};B.encode.bytes=0;B.decode=function(r,e){e||(e=0);let t={},n=e;if(t.name=E.decode(r,e),e+=E.decode.bytes,t.type=ve.toString(r.readUInt16BE(e)),t.type==="OPT")t.udpPayloadSize=r.readUInt16BE(e+2),t.extendedRcode=r.readUInt8(e+4),t.ednsVersion=r.readUInt8(e+5),t.flags=r.readUInt16BE(e+6),t.flag_do=(t.flags>>15&1)===1,t.options=H.decode(r,e+8),e+=8+H.decode.bytes;else{let i=r.readUInt16BE(e+2);t.ttl=r.readUInt32BE(e+4),t.class=wr.toString(i&oo),t.flush=!!(i&Gr);let c=Hr(t.type);t.data=c.decode(r,e+8),e+=8+c.decode.bytes}return B.decode.bytes=e-n,t};B.decode.bytes=0;B.encodingLength=function(r){let e=r.data!==null&&r.data!==void 0?r.data:r.options;return E.encodingLength(r.name)+8+Hr(r.type).encodingLength(e)};var Z=x.question={};Z.encode=function(r,e,t){e||(e=v.alloc(Z.encodingLength(r))),t||(t=0);let n=t;return E.encode(r.name,e,t),t+=E.encode.bytes,e.writeUInt16BE(ve.toType(r.type),t),t+=2,e.writeUInt16BE(wr.toClass(r.class===void 0?"IN":r.class),t),t+=2,Z.encode.bytes=t-n,r};Z.encode.bytes=0;Z.decode=function(r,e){e||(e=0);let t=e,n={};return n.name=E.decode(r,e),e+=E.decode.bytes,n.type=ve.toString(r.readUInt16BE(e)),e+=2,n.class=wr.toString(r.readUInt16BE(e)),e+=2,!!(n.class&sn)&&(n.class&=so),Z.decode.bytes=e-t,n};Z.decode.bytes=0;Z.encodingLength=function(r){return E.encodingLength(r.name)+4};x.AUTHORITATIVE_ANSWER=1024;x.TRUNCATED_RESPONSE=512;x.RECURSION_DESIRED=256;x.RECURSION_AVAILABLE=128;x.AUTHENTIC_DATA=32;x.CHECKING_DISABLED=16;x.DNSSEC_OK=32768;x.encode=function(r,e,t){let n=!e;n&&(e=v.alloc(x.encodingLength(r))),t||(t=0);let i=t;return r.questions||(r.questions=[]),r.answers||(r.answers=[]),r.authorities||(r.authorities=[]),r.additionals||(r.additionals=[]),ee.encode(r,e,t),t+=ee.encode.bytes,t=Je(r.questions,Z,e,t),t=Je(r.answers,B,e,t),t=Je(r.authorities,B,e,t),t=Je(r.additionals,B,e,t),x.encode.bytes=t-i,n&&x.encode.bytes!==e.length?e.slice(0,x.encode.bytes):e};x.encode.bytes=0;x.decode=function(r,e){e||(e=0);let t=e,n=ee.decode(r,e);return e+=ee.decode.bytes,e=yr(n.questions,Z,r,e),e=yr(n.answers,B,r,e),e=yr(n.authorities,B,r,e),e=yr(n.additionals,B,r,e),x.decode.bytes=e-t,n};x.decode.bytes=0;x.encodingLength=function(r){return ee.encodingLength(r)+ze(r.questions||[],Z)+ze(r.answers||[],B)+ze(r.authorities||[],B)+ze(r.additionals||[],B)};x.streamEncode=function(r){let e=x.encode(r),t=v.alloc(2);t.writeUInt16BE(e.byteLength);let n=v.concat([t,e]);return x.streamEncode.bytes=n.byteLength,n};x.streamEncode.bytes=0;x.streamDecode=function(r){let e=r.readUInt16BE(0);if(r.byteLength<e+2)return null;let t=x.decode(r.slice(2));return x.streamDecode.bytes=x.decode.bytes,t};x.streamDecode.bytes=0;function ze(r,e){let t=0;for(let n=0;n<r.length;n++)t+=e.encodingLength(r[n]);return t}function Je(r,e,t,n){for(let i=0;i<r.length;i++)e.encode(r[i],t,n),n+=e.encode.bytes;return n}function yr(r,e,t,n){for(let i=0;i<r.length;i++)r[i]=e.decode(t,n),n+=e.decode.bytes;return n}});var ln=R((fc,dn)=>{"use strict";var an=mo;process.nextTick(go,42);dn.exports=lo;function lo(r){var e=n;return t;function t(i){e(i||ho)}function n(i){var c=[i];e=h,r(g);function h(m){c.push(m)}function g(m){var p=arguments;for(e=uo(m)?n:w;c.length;)w(c.shift());function w(u){an(po,u,p)}}}}function uo(r){return Object.prototype.toString.call(r)==="[object Error]"}function ho(){}function po(r,e){r.apply(null,e)}function go(r){r===42&&(an=process.nextTick)}function mo(r,e,t){process.nextTick(function(){r(e,t)})}});var pn=R((Uc,hn)=>{var Yr=cn(),yo=ue("dgram"),wo=ln(),Io=ue("events"),Wr=ue("os"),Xr=function(){};hn.exports=function(r){r||(r={});var e=new Io.EventEmitter,t=typeof r.port=="number"?r.port:5353,n=r.type||"udp4",i=r.ip||r.host||(n==="udp4"?"224.0.0.251":null),c={address:i,port:t},h={},g=!1,m=null;if(n==="udp6"&&(!i||!r.interface))throw new Error("For IPv6 multicast you must specify `ip` and `interface`");var p=r.socket||yo.createSocket({type:n,reuseAddr:r.reuseAddr!==!1,toString:function(){return n}});p.on("error",function(u){u.code==="EACCES"||u.code==="EADDRINUSE"?e.emit("error",u):e.emit("warning",u)}),p.on("message",function(u,a){try{u=Yr.decode(u)}catch(o){e.emit("warning",o);return}e.emit("packet",u,a),u.type==="query"&&e.emit("query",u,a),u.type==="response"&&e.emit("response",u,a)}),p.on("listening",function(){t||(t=c.port=p.address().port),r.multicast!==!1&&(e.update(),m=setInterval(e.update,5e3),p.setMulticastTTL(r.ttl||255),p.setMulticastLoopback(r.loopback!==!1))});var w=wo(function(u){if(!t||r.bind===!1)return u(null);p.once("error",u),p.bind(t,r.bind||r.interface,function(){p.removeListener("error",u),u(null)})});return w(function(u){if(u)return e.emit("error",u);e.emit("ready")}),e.send=function(u,a,o){if(typeof a=="function")return e.send(u,null,a);o||(o=Xr),a?!a.host&&!a.address&&(a.address=c.address):a=c,w(s);function s(d){if(g)return o();if(d)return o(d);var l=Yr.encode(u);p.send(l,0,l.length,a.port,a.address||a.host,o)}},e.response=e.respond=function(u,a,o){Array.isArray(u)&&(u={answers:u}),u.type="response",u.flags=(u.flags||0)|Yr.AUTHORITATIVE_ANSWER,e.send(u,a,o)},e.query=function(u,a,o,s){if(typeof a=="function")return e.query(u,null,null,a);if(typeof a=="object"&&a&&a.port)return e.query(u,null,a,o);if(typeof o=="function")return e.query(u,a,null,o);s||(s=Xr),typeof u=="string"&&(u=[{name:u,type:a||"ANY"}]),Array.isArray(u)&&(u={type:"query",questions:u}),u.type="query",e.send(u,o,s)},e.destroy=function(u){if(u||(u=Xr),g)return process.nextTick(u);g=!0,clearInterval(m);for(var a in h)try{p.dropMembership(i,a)}catch{}h={},p.close(u)},e.update=function(){for(var u=r.interface?[].concat(r.interface):xo(),a=!1,o=0;o<u.length;o++){var s=u[o];if(!h[s])try{p.addMembership(i,s),h[s]=!0,a=!0}catch(d){e.emit("warning",d)}}if(a){if(p.setMulticastInterface)try{p.setMulticastInterface(r.interface||Eo())}catch(d){e.emit("warning",d)}e.emit("networkInterface")}},e};function Eo(){for(var r=Wr.networkInterfaces(),e=Object.keys(r),t=0;t<e.length;t++)for(var n=r[e[t]],i=0;i<n.length;i++){var c=n[i];if(un(c.family)&&!c.internal)return Wr.platform()==="darwin"&&e[t]==="en0"?c.address:"0.0.0.0"}return"127.0.0.1"}function xo(){for(var r=Wr.networkInterfaces(),e=Object.keys(r),t=[],n=0;n<e.length;n++)for(var i=r[e[n]],c=0;c<i.length;c++){var h=i[c];if(un(h.family)){t.push(h.address);break}}return t}function un(r){return r===4||r==="IPv4"}});var Pn=R(ar=>{(function(){var r,e,t,n,i,c,h,g;g=function(m){var p,w,u,a;return p=(m&255<<24)>>>24,w=(m&255<<16)>>>16,u=(m&65280)>>>8,a=m&255,[p,w,u,a].join(".")},h=function(m){var p,w,u,a,o,s;for(p=[],u=a=0;a<=3&&m.length!==0;u=++a){if(u>0){if(m[0]!==".")throw new Error("Invalid IP");m=m.substring(1)}s=e(m),o=s[0],w=s[1],m=m.substring(w),p.push(o)}if(m.length!==0)throw new Error("Invalid IP");switch(p.length){case 1:if(p[0]>4294967295)throw new Error("Invalid IP");return p[0]>>>0;case 2:if(p[0]>255||p[1]>16777215)throw new Error("Invalid IP");return(p[0]<<24|p[1])>>>0;case 3:if(p[0]>255||p[1]>255||p[2]>65535)throw new Error("Invalid IP");return(p[0]<<24|p[1]<<16|p[2])>>>0;case 4:if(p[0]>255||p[1]>255||p[2]>255||p[3]>255)throw new Error("Invalid IP");return(p[0]<<24|p[1]<<16|p[2]<<8|p[3])>>>0;default:throw new Error("Invalid IP")}},t=function(m){return m.charCodeAt(0)},n=t("0"),c=t("a"),i=t("A"),e=function(m){var p,w,u,a,o;for(a=0,p=10,w="9",u=0,m.length>1&&m[u]==="0"&&(m[u+1]==="x"||m[u+1]==="X"?(u+=2,p=16):"0"<=m[u+1]&&m[u+1]<="9"&&(u++,p=8,w="7")),o=u;u<m.length;){if("0"<=m[u]&&m[u]<=w)a=a*p+(t(m[u])-n)>>>0;else if(p===16)if("a"<=m[u]&&m[u]<="f")a=a*p+(10+t(m[u])-c)>>>0;else if("A"<=m[u]&&m[u]<="F")a=a*p+(10+t(m[u])-i)>>>0;else break;else break;if(a>4294967295)throw new Error("too large");u++}if(u===o)throw new Error("empty octet");return[a,u]},r=function(){function m(p,w){var u,a,o,s;if(typeof p!="string")throw new Error("Missing `net' parameter");if(w||(s=p.split("/",2),p=s[0],w=s[1]),w||(w=32),typeof w=="string"&&w.indexOf(".")>-1){try{this.maskLong=h(w)}catch(d){throw u=d,new Error("Invalid mask: "+w)}for(a=o=32;o>=0;a=--o)if(this.maskLong===4294967295<<32-a>>>0){this.bitmask=a;break}}else if(w||w===0)this.bitmask=parseInt(w,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(h(p)&this.maskLong)>>>0}catch(d){throw u=d,new Error("Invalid net address: "+p)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+w);this.size=Math.pow(2,32-this.bitmask),this.base=g(this.netLong),this.mask=g(this.maskLong),this.hostmask=g(~this.maskLong),this.first=this.bitmask<=30?g(this.netLong+1):this.base,this.last=this.bitmask<=30?g(this.netLong+this.size-2):g(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?g(this.netLong+this.size-1):void 0}return m.prototype.contains=function(p){return typeof p=="string"&&(p.indexOf("/")>0||p.split(".").length!==4)&&(p=new m(p)),p instanceof m?this.contains(p.base)&&this.contains(p.broadcast||p.last):(h(p)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},m.prototype.next=function(p){return p==null&&(p=1),new m(g(this.netLong+this.size*p),this.mask)},m.prototype.forEach=function(p){var w,u,a;for(a=h(this.first),u=h(this.last),w=0;a<=u;)p(g(a),a,w),w++,a++},m.prototype.toString=function(){return this.base+"/"+this.bitmask},m}(),ar.ip2long=h,ar.long2ip=g,ar.Netmask=r}).call(ar)});var Dn=R((Tn,Cr)=>{(function(r){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",t={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),c="%[0-9a-z]{1,}",h="(?:[0-9a-f]+::?)+",g={zoneIndex:new RegExp(c,"i"),native:new RegExp(`^(::)?(${h})?([0-9a-f]+)?(::)?(${c})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${c})?)$`,"i"),transitional:new RegExp(`^((?:${h})|(?:::)(?:${h})?)${e}\\.${e}\\.${e}\\.${e}(${c})?$`,"i")};function m(o,s){if(o.indexOf("::")!==o.lastIndexOf("::"))return null;let d=0,l=-1,y=(o.match(g.zoneIndex)||[])[0],I,C;for(y&&(y=y.substring(1),o=o.replace(/%.+$/,""));(l=o.indexOf(":",l+1))>=0;)d++;if(o.substr(0,2)==="::"&&d--,o.substr(-2,2)==="::"&&d--,d>s)return null;for(C=s-d,I=":";C--;)I+="0:";return o=o.replace("::",I),o[0]===":"&&(o=o.slice(1)),o[o.length-1]===":"&&(o=o.slice(0,-1)),s=function(){let U=o.split(":"),O=[];for(let f=0;f<U.length;f++)O.push(parseInt(U[f],16));return O}(),{parts:s,zoneId:y}}function p(o,s,d,l){if(o.length!==s.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let y=0,I;for(;l>0;){if(I=d-l,I<0&&(I=0),o[y]>>I!==s[y]>>I)return!1;l-=d,y+=1}return!0}function w(o){if(i.test(o))return parseInt(o,16);if(o[0]==="0"&&!isNaN(parseInt(o[1],10))){if(n.test(o))return parseInt(o,8);throw new Error(`ipaddr: cannot parse ${o} as octal`)}return parseInt(o,10)}function u(o,s){for(;o.length<s;)o=`0${o}`;return o}let a={};a.IPv4=function(){function o(s){if(s.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let d,l;for(d=0;d<s.length;d++)if(l=s[d],!(0<=l&&l<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=s}return o.prototype.SpecialRanges={unspecified:[[new o([0,0,0,0]),8]],broadcast:[[new o([255,255,255,255]),32]],multicast:[[new o([224,0,0,0]),4]],linkLocal:[[new o([169,254,0,0]),16]],loopback:[[new o([127,0,0,0]),8]],carrierGradeNat:[[new o([100,64,0,0]),10]],private:[[new o([10,0,0,0]),8],[new o([172,16,0,0]),12],[new o([192,168,0,0]),16]],reserved:[[new o([192,0,0,0]),24],[new o([192,0,2,0]),24],[new o([192,88,99,0]),24],[new o([198,18,0,0]),15],[new o([198,51,100,0]),24],[new o([203,0,113,0]),24],[new o([240,0,0,0]),4]]},o.prototype.kind=function(){return"ipv4"},o.prototype.match=function(s,d){let l;if(d===void 0&&(l=s,s=l[0],d=l[1]),s.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,s.octets,8,d)},o.prototype.prefixLengthFromSubnetMask=function(){let s=0,d=!1,l={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},y,I,C;for(y=3;y>=0;y-=1)if(I=this.octets[y],I in l){if(C=l[I],d&&C!==0)return null;C!==8&&(d=!0),s+=C}else return null;return 32-s},o.prototype.range=function(){return a.subnetMatch(this,this.SpecialRanges)},o.prototype.toByteArray=function(){return this.octets.slice(0)},o.prototype.toIPv4MappedAddress=function(){return a.IPv6.parse(`::ffff:${this.toString()}`)},o.prototype.toNormalizedString=function(){return this.toString()},o.prototype.toString=function(){return this.octets.join(".")},o}(),a.IPv4.broadcastAddressFromCIDR=function(o){try{let s=this.parseCIDR(o),d=s[0].toByteArray(),l=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],I=0;for(;I<4;)y.push(parseInt(d[I],10)|parseInt(l[I],10)^255),I++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},a.IPv4.isIPv4=function(o){return this.parser(o)!==null},a.IPv4.isValid=function(o){try{return new this(this.parser(o)),!0}catch{return!1}},a.IPv4.isValidFourPartDecimal=function(o){return!!(a.IPv4.isValid(o)&&o.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},a.IPv4.networkAddressFromCIDR=function(o){let s,d,l,y,I;try{for(s=this.parseCIDR(o),l=s[0].toByteArray(),I=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],d=0;d<4;)y.push(parseInt(l[d],10)&parseInt(I[d],10)),d++;return new this(y)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},a.IPv4.parse=function(o){let s=this.parser(o);if(s===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(s)},a.IPv4.parseCIDR=function(o){let s;if(s=o.match(/^(.+)\/(\d+)$/)){let d=parseInt(s[2]);if(d>=0&&d<=32){let l=[this.parse(s[1]),d];return Object.defineProperty(l,"toString",{value:function(){return this.join("/")}}),l}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},a.IPv4.parser=function(o){let s,d,l;if(s=o.match(t.fourOctet))return function(){let y=s.slice(1,6),I=[];for(let C=0;C<y.length;C++)d=y[C],I.push(w(d));return I}();if(s=o.match(t.longValue)){if(l=w(s[1]),l>4294967295||l<0)throw new Error("ipaddr: address outside defined range");return function(){let y=[],I;for(I=0;I<=24;I+=8)y.push(l>>I&255);return y}().reverse()}else return(s=o.match(t.twoOctet))?function(){let y=s.slice(1,4),I=[];if(l=w(y[1]),l>16777215||l<0)throw new Error("ipaddr: address outside defined range");return I.push(w(y[0])),I.push(l>>16&255),I.push(l>>8&255),I.push(l&255),I}():(s=o.match(t.threeOctet))?function(){let y=s.slice(1,5),I=[];if(l=w(y[2]),l>65535||l<0)throw new Error("ipaddr: address outside defined range");return I.push(w(y[0])),I.push(w(y[1])),I.push(l>>8&255),I.push(l&255),I}():null},a.IPv4.subnetMaskFromPrefixLength=function(o){if(o=parseInt(o),o<0||o>32)throw new Error("ipaddr: invalid IPv4 prefix length");let s=[0,0,0,0],d=0,l=Math.floor(o/8);for(;d<l;)s[d]=255,d++;return l<4&&(s[l]=Math.pow(2,o%8)-1<<8-o%8),new this(s)},a.IPv6=function(){function o(s,d){let l,y;if(s.length===16)for(this.parts=[],l=0;l<=14;l+=2)this.parts.push(s[l]<<8|s[l+1]);else if(s.length===8)this.parts=s;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(l=0;l<this.parts.length;l++)if(y=this.parts[l],!(0<=y&&y<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");d&&(this.zoneId=d)}return o.prototype.SpecialRanges={unspecified:[new o([0,0,0,0,0,0,0,0]),128],linkLocal:[new o([65152,0,0,0,0,0,0,0]),10],multicast:[new o([65280,0,0,0,0,0,0,0]),8],loopback:[new o([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new o([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new o([0,0,0,0,0,65535,0,0]),96],rfc6145:[new o([0,0,0,0,65535,0,0,0]),96],rfc6052:[new o([100,65435,0,0,0,0,0,0]),96],"6to4":[new o([8194,0,0,0,0,0,0,0]),16],teredo:[new o([8193,0,0,0,0,0,0,0]),32],reserved:[[new o([8193,3512,0,0,0,0,0,0]),32]],benchmarking:[new o([8193,2,0,0,0,0,0,0]),48],amt:[new o([8193,3,0,0,0,0,0,0]),32],as112v6:[new o([8193,4,274,0,0,0,0,0]),48],deprecated:[new o([8193,16,0,0,0,0,0,0]),28],orchid2:[new o([8193,32,0,0,0,0,0,0]),28]},o.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},o.prototype.kind=function(){return"ipv6"},o.prototype.match=function(s,d){let l;if(d===void 0&&(l=s,s=l[0],d=l[1]),s.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,s.parts,16,d)},o.prototype.prefixLengthFromSubnetMask=function(){let s=0,d=!1,l={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},y,I;for(let C=7;C>=0;C-=1)if(y=this.parts[C],y in l){if(I=l[y],d&&I!==0)return null;I!==16&&(d=!0),s+=I}else return null;return 128-s},o.prototype.range=function(){return a.subnetMatch(this,this.SpecialRanges)},o.prototype.toByteArray=function(){let s,d=[],l=this.parts;for(let y=0;y<l.length;y++)s=l[y],d.push(s>>8),d.push(s&255);return d},o.prototype.toFixedLengthString=function(){let s=function(){let l=[];for(let y=0;y<this.parts.length;y++)l.push(u(this.parts[y].toString(16),4));return l}.call(this).join(":"),d="";return this.zoneId&&(d=`%${this.zoneId}`),s+d},o.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let s=this.parts.slice(-2),d=s[0],l=s[1];return new a.IPv4([d>>8,d&255,l>>8,l&255])},o.prototype.toNormalizedString=function(){let s=function(){let l=[];for(let y=0;y<this.parts.length;y++)l.push(this.parts[y].toString(16));return l}.call(this).join(":"),d="";return this.zoneId&&(d=`%${this.zoneId}`),s+d},o.prototype.toRFC5952String=function(){let s=/((^|:)(0(:|$)){2,})/g,d=this.toNormalizedString(),l=0,y=-1,I;for(;I=s.exec(d);)I[0].length>y&&(l=I.index,y=I[0].length);return y<0?d:`${d.substring(0,l)}::${d.substring(l+y)}`},o.prototype.toString=function(){return this.toRFC5952String()},o}(),a.IPv6.broadcastAddressFromCIDR=function(o){try{let s=this.parseCIDR(o),d=s[0].toByteArray(),l=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],I=0;for(;I<16;)y.push(parseInt(d[I],10)|parseInt(l[I],10)^255),I++;return new this(y)}catch(s){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${s})`)}},a.IPv6.isIPv6=function(o){return this.parser(o)!==null},a.IPv6.isValid=function(o){if(typeof o=="string"&&o.indexOf(":")===-1)return!1;try{let s=this.parser(o);return new this(s.parts,s.zoneId),!0}catch{return!1}},a.IPv6.networkAddressFromCIDR=function(o){let s,d,l,y,I;try{for(s=this.parseCIDR(o),l=s[0].toByteArray(),I=this.subnetMaskFromPrefixLength(s[1]).toByteArray(),y=[],d=0;d<16;)y.push(parseInt(l[d],10)&parseInt(I[d],10)),d++;return new this(y)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},a.IPv6.parse=function(o){let s=this.parser(o);if(s.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(s.parts,s.zoneId)},a.IPv6.parseCIDR=function(o){let s,d,l;if((d=o.match(/^(.+)\/(\d+)$/))&&(s=parseInt(d[2]),s>=0&&s<=128))return l=[this.parse(d[1]),s],Object.defineProperty(l,"toString",{value:function(){return this.join("/")}}),l;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},a.IPv6.parser=function(o){let s,d,l,y,I,C;if(l=o.match(g.deprecatedTransitional))return this.parser(`::ffff:${l[1]}`);if(g.native.test(o))return m(o,8);if((l=o.match(g.transitional))&&(C=l[6]||"",s=m(l[1].slice(0,-1)+C,6),s.parts)){for(I=[parseInt(l[2]),parseInt(l[3]),parseInt(l[4]),parseInt(l[5])],d=0;d<I.length;d++)if(y=I[d],!(0<=y&&y<=255))return null;return s.parts.push(I[0]<<8|I[1]),s.parts.push(I[2]<<8|I[3]),{parts:s.parts,zoneId:s.zoneId}}return null},a.IPv6.subnetMaskFromPrefixLength=function(o){if(o=parseInt(o),o<0||o>128)throw new Error("ipaddr: invalid IPv6 prefix length");let s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=0,l=Math.floor(o/8);for(;d<l;)s[d]=255,d++;return l<16&&(s[l]=Math.pow(2,o%8)-1<<8-o%8),new this(s)},a.fromByteArray=function(o){let s=o.length;if(s===4)return new a.IPv4(o);if(s===16)return new a.IPv6(o);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},a.isValid=function(o){return a.IPv6.isValid(o)||a.IPv4.isValid(o)},a.parse=function(o){if(a.IPv6.isValid(o))return a.IPv6.parse(o);if(a.IPv4.isValid(o))return a.IPv4.parse(o);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},a.parseCIDR=function(o){try{return a.IPv6.parseCIDR(o)}catch{try{return a.IPv4.parseCIDR(o)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},a.process=function(o){let s=this.parse(o);return s.kind()==="ipv6"&&s.isIPv4MappedAddress()?s.toIPv4Address():s},a.subnetMatch=function(o,s,d){let l,y,I,C;d==null&&(d="unicast");for(y in s)if(Object.prototype.hasOwnProperty.call(s,y)){for(I=s[y],I[0]&&!(I[0]instanceof Array)&&(I=[I]),l=0;l<I.length;l++)if(C=I[l],o.kind()===C[0].kind()&&o.match.apply(o,C))return y}return d},typeof Cr<"u"&&Cr.exports?Cr.exports=a:r.ipaddr=a})(Tn)});var Ws={};q(Ws,{mdns:()=>Xs});var lr=class extends EventTarget{#e=new Map;listenerCount(e){let t=this.#e.get(e);return t==null?0:t.length}addEventListener(e,t,n){super.addEventListener(e,t,n);let i=this.#e.get(e);i==null&&(i=[],this.#e.set(e,i)),i.push({callback:t,once:(n!==!0&&n!==!1&&n?.once)??!1})}removeEventListener(e,t,n){super.removeEventListener(e.toString(),t??null,n);let i=this.#e.get(e);i!=null&&(i=i.filter(({callback:c})=>c!==t),this.#e.set(e,i))}dispatchEvent(e){let t=super.dispatchEvent(e),n=this.#e.get(e.type);return n==null||(n=n.filter(({once:i})=>!i),this.#e.set(e.type,n)),t}safeDispatchEvent(e,t){return this.dispatchEvent(new Ur(e,t))}},fr=class extends Event{detail;constructor(e,t){super(e,t),this.detail=t?.detail}},Ur=globalThis.CustomEvent??fr;var Rt=Symbol.for("@libp2p/peer-discovery");var j=Qe(Vt(),1);var Br={};q(Br,{base32:()=>Q,base32hex:()=>Gi,base32hexpad:()=>Yi,base32hexpadupper:()=>Xi,base32hexupper:()=>Hi,base32pad:()=>ji,base32padupper:()=>Ki,base32upper:()=>Vi,base32z:()=>Wi});function ki(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),n=0;n<t.length;n++)t[n]=255;for(var i=0;i<r.length;i++){var c=r.charAt(i),h=c.charCodeAt(0);if(t[h]!==255)throw new TypeError(c+" is ambiguous");t[h]=i}var g=r.length,m=r.charAt(0),p=Math.log(g)/Math.log(256),w=Math.log(256)/Math.log(g);function u(s){if(s instanceof Uint8Array||(ArrayBuffer.isView(s)?s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength):Array.isArray(s)&&(s=Uint8Array.from(s))),!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(s.length===0)return"";for(var d=0,l=0,y=0,I=s.length;y!==I&&s[y]===0;)y++,d++;for(var C=(I-y)*w+1>>>0,U=new Uint8Array(C);y!==I;){for(var O=s[y],f=0,z=C-1;(O!==0||f<l)&&z!==-1;z--,f++)O+=256*U[z]>>>0,U[z]=O%g>>>0,O=O/g>>>0;if(O!==0)throw new Error("Non-zero carry");l=f,y++}for(var Y=C-l;Y!==C&&U[Y]===0;)Y++;for(var Be=m.repeat(d);Y<C;++Y)Be+=r.charAt(U[Y]);return Be}function a(s){if(typeof s!="string")throw new TypeError("Expected String");if(s.length===0)return new Uint8Array;var d=0;if(s[d]!==" "){for(var l=0,y=0;s[d]===m;)l++,d++;for(var I=(s.length-d)*p+1>>>0,C=new Uint8Array(I);s[d];){var U=t[s.charCodeAt(d)];if(U===255)return;for(var O=0,f=I-1;(U!==0||O<y)&&f!==-1;f--,O++)U+=g*C[f]>>>0,C[f]=U%256>>>0,U=U/256>>>0;if(U!==0)throw new Error("Non-zero carry");y=O,d++}if(s[d]!==" "){for(var z=I-y;z!==I&&C[z]===0;)z++;for(var Y=new Uint8Array(l+(I-z)),Be=l;z!==I;)Y[Be++]=C[z++];return Y}}}function o(s){var d=a(s);if(d)return d;throw new Error(`Non-${e} character`)}return{encode:u,decodeUnsafe:a,decode:o}}var Mi=ki,_i=Mi,jt=_i;var sc=new Uint8Array(0);var Kt=(r,e)=>{if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0},X=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 Gt=r=>new TextEncoder().encode(r),Ht=r=>new TextDecoder().decode(r);var Fr=class{constructor(e,t,n){this.name=e,this.prefix=t,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},Rr=class{constructor(e,t,n){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Xt(this,e)}},Tr=class{constructor(e){this.decoders=e}or(e){return Xt(this,e)}decode(e){let t=e[0],n=this.decoders[t];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Xt=(r,e)=>new Tr({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),Dr=class{constructor(e,t,n,i){this.name=e,this.prefix=t,this.baseEncode=n,this.baseDecode=i,this.encoder=new Fr(e,t,n),this.decoder=new Rr(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},_e=({name:r,prefix:e,encode:t,decode:n})=>new Dr(r,e,t,n),Ae=({prefix:r,name:e,alphabet:t})=>{let{encode:n,decode:i}=jt(t,e);return _e({prefix:r,name:e,encode:n,decode:c=>X(i(c))})},zi=(r,e,t,n)=>{let i={};for(let w=0;w<e.length;++w)i[e[w]]=w;let c=r.length;for(;r[c-1]==="=";)--c;let h=new Uint8Array(c*t/8|0),g=0,m=0,p=0;for(let w=0;w<c;++w){let u=i[r[w]];if(u===void 0)throw new SyntaxError(`Non-${n} character`);m=m<<t|u,g+=t,g>=8&&(g-=8,h[p++]=255&m>>g)}if(g>=t||255&m<<8-g)throw new SyntaxError("Unexpected end of data");return h},qi=(r,e,t)=>{let n=e[e.length-1]==="=",i=(1<<t)-1,c="",h=0,g=0;for(let m=0;m<r.length;++m)for(g=g<<8|r[m],h+=8;h>t;)h-=t,c+=e[i&g>>h];if(h&&(c+=e[i&g<<t-h]),n)for(;c.length*t&7;)c+="=";return c},L=({name:r,prefix:e,bitsPerChar:t,alphabet:n})=>_e({prefix:e,name:r,encode(i){return qi(i,n,t)},decode(i){return zi(i,n,t,r)}});var Q=L({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vi=L({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ji=L({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ki=L({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Gi=L({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Hi=L({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yi=L({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xi=L({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Wi=L({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Nr={};q(Nr,{base58btc:()=>F,base58flickr:()=>Qi});var F=Ae({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Qi=Ae({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var kr={};q(kr,{base64:()=>$r,base64pad:()=>Ji,base64url:()=>Zi,base64urlpad:()=>eo});var $r=L({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ji=L({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zi=L({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),eo=L({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});j.default.formatters.b=r=>r==null?"undefined":F.baseEncode(r);j.default.formatters.t=r=>r==null?"undefined":Q.baseEncode(r);j.default.formatters.m=r=>r==null?"undefined":$r.baseEncode(r);j.default.formatters.p=r=>r==null?"undefined":r.toString();j.default.formatters.c=r=>r==null?"undefined":r.toString();j.default.formatters.k=r=>r==null?"undefined":r.toString();j.default.formatters.a=r=>r==null?"undefined":r.toString();function ro(r){let e=()=>{};return e.enabled=!1,e.color="",e.diff=0,e.log=()=>{},e.namespace=r,e.destroy=()=>!0,e.extend=()=>e,e}function mr(r){let e=ro(`${r}:trace`);return j.default.enabled(`${r}:trace`)&&j.default.names.map(t=>t.toString()).find(t=>t.includes(":trace"))!=null&&(e=(0,j.default)(`${r}:trace`)),Object.assign((0,j.default)(r),{error:(0,j.default)(`${r}:error`),trace:e})}var ai=Qe(pn(),1);var Ze=class extends Error{code;props;constructor(e,t,n){super(e),this.code=t,this.name=n?.name??"CodeError",this.props=n??{}}};var gn=Symbol.for("@libp2p/peer-id");var Qr={};q(Qr,{base10:()=>vo});var vo=Ae({prefix:"9",name:"base10",alphabet:"0123456789"});var Jr={};q(Jr,{base16:()=>Co,base16upper:()=>Ao});var Co=L({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ao=L({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Zr={};q(Zr,{base2:()=>bo});var bo=L({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var et={};q(et,{base256emoji:()=>Lo});var mn=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}"),So=mn.reduce((r,e,t)=>(r[t]=e,r),[]),fo=mn.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function Uo(r){return r.reduce((e,t)=>(e+=So[t],e),"")}function Oo(r){let e=[];for(let t of r){let n=fo[t.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(n)}return new Uint8Array(e)}var Lo=_e({prefix:"\u{1F680}",name:"base256emoji",encode:Uo,decode:Oo});var rt={};q(rt,{base36:()=>Po,base36upper:()=>Fo});var Po=Ae({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Fo=Ae({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var tt={};q(tt,{base8:()=>Ro});var Ro=L({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var nt={};q(nt,{identity:()=>To});var To=_e({prefix:"\0",name:"identity",encode:r=>Ht(r),decode:r=>Gt(r)});var kc=new TextEncoder,Mc=new TextDecoder;var ot={};q(ot,{identity:()=>Er});var No=In,yn=128,$o=127,ko=~$o,Mo=Math.pow(2,31);function In(r,e,t){e=e||[],t=t||0;for(var n=t;r>=Mo;)e[t++]=r&255|yn,r/=128;for(;r&ko;)e[t++]=r&255|yn,r>>>=7;return e[t]=r|0,In.bytes=t-n+1,e}var _o=it,zo=128,wn=127;function it(r,n){var t=0,n=n||0,i=0,c=n,h,g=r.length;do{if(c>=g)throw it.bytes=0,new RangeError("Could not decode varint");h=r[c++],t+=i<28?(h&wn)<<i:(h&wn)*Math.pow(2,i),i+=7}while(h>=zo);return it.bytes=c-n,t}var qo=Math.pow(2,7),Vo=Math.pow(2,14),jo=Math.pow(2,21),Ko=Math.pow(2,28),Go=Math.pow(2,35),Ho=Math.pow(2,42),Yo=Math.pow(2,49),Xo=Math.pow(2,56),Wo=Math.pow(2,63),Qo=function(r){return r<qo?1:r<Vo?2:r<jo?3:r<Ko?4:r<Go?5:r<Ho?6:r<Yo?7:r<Xo?8:r<Wo?9:10},Jo={encode:No,decode:_o,encodingLength:Qo},Zo=Jo,er=Zo;var rr=(r,e=0)=>[er.decode(r,e),er.decode.bytes],qe=(r,e,t=0)=>(er.encode(r,e,t),e),Ve=r=>er.encodingLength(r);var Se=(r,e)=>{let t=e.byteLength,n=Ve(r),i=n+Ve(t),c=new Uint8Array(i+t);return qe(r,c,0),qe(t,c,n),c.set(e,i),new je(r,t,e,c)},Fe=r=>{let e=X(r),[t,n]=rr(e),[i,c]=rr(e.subarray(n)),h=e.subarray(n+c);if(h.byteLength!==i)throw new Error("Incorrect length");return new je(t,i,h,e)},En=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Kt(r.bytes,t.bytes)}},je=class{constructor(e,t,n,i){this.code=e,this.size=t,this.digest=n,this.bytes=i}};var xn=0,es="identity",vn=X,rs=r=>Se(xn,vn(r)),Er={code:xn,name:es,encode:vn,digest:rs};var dt={};q(dt,{sha256:()=>xr,sha512:()=>ts});var at=Qe(ue("crypto"),1);var ct=({name:r,code:e,encode:t})=>new st(r,e,t),st=class{constructor(e,t,n){this.name=e,this.code=t,this.encode=n}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Se(this.code,t):t.then(n=>Se(this.code,n))}else throw Error("Unknown type, must be binary type")}};var xr=ct({name:"sha2-256",code:18,encode:r=>X(at.default.createHash("sha256").update(r).digest())}),ts=ct({name:"sha2-512",code:19,encode:r=>X(at.default.createHash("sha512").update(r).digest())});var An=(r,e)=>{let{bytes:t,version:n}=r;switch(n){case 0:return is(t,lt(r),e||F.encoder);default:return os(t,lt(r),e||Q.encoder)}};var bn=new WeakMap,lt=r=>{let e=bn.get(r);if(e==null){let t=new Map;return bn.set(r,t),t}return e},re=class r{constructor(e,t,n,i){this.code=t,this.version=e,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:e,multihash:t}=this;if(e!==tr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ss)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,n=Se(e,t);return r.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(e){return r.equals(this,e)}static equals(e,t){let n=t;return n&&e.code===n.code&&e.version===n.version&&En(e.multihash,n.multihash)}toString(e){return An(this,e)}toJSON(){return{"/":An(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(e){if(e==null)return null;let t=e;if(t instanceof r)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:n,code:i,multihash:c,bytes:h}=t;return new r(n,i,c,h||Sn(n,i,c.bytes))}else if(t[cs]===!0){let{version:n,multihash:i,code:c}=t,h=Fe(i);return r.create(n,c,h)}else return null}static create(e,t,n){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==tr)throw new Error(`Version 0 CID must use dag-pb (code: ${tr}) block encoding`);return new r(e,t,n,n.bytes)}case 1:{let i=Sn(e,t,n.bytes);return new r(e,t,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return r.create(0,tr,e)}static createV1(e,t){return r.create(1,e,t)}static decode(e){let[t,n]=r.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=r.inspectBytes(e),n=t.size-t.multihashSize,i=X(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");let c=i.subarray(t.multihashSize-t.digestSize),h=new je(t.multihashCode,t.digestSize,c,i);return[t.version===0?r.createV0(h):r.createV1(t.codec,h),e.subarray(t.size)]}static inspectBytes(e){let t=0,n=()=>{let[u,a]=rr(e.subarray(t));return t+=a,u},i=n(),c=tr;if(i===18?(i=0,t=0):c=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let h=t,g=n(),m=n(),p=t+m,w=p-h;return{version:i,codec:c,multihashCode:g,digestSize:m,multihashSize:w,size:p}}static parse(e,t){let[n,i]=ns(e,t),c=r.decode(i);if(c.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return lt(c).set(n,e),c}},ns=(r,e)=>{switch(r[0]){case"Q":{let t=e||F;return[F.prefix,t.decode(`${F.prefix}${r}`)]}case F.prefix:{let t=e||F;return[F.prefix,t.decode(r)]}case Q.prefix:{let t=e||Q;return[Q.prefix,t.decode(r)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],e.decode(r)]}}},is=(r,e,t)=>{let{prefix:n}=t;if(n!==F.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let i=e.get(n);if(i==null){let c=t.encode(r).slice(1);return e.set(n,c),c}else return i},os=(r,e,t)=>{let{prefix:n}=t,i=e.get(n);if(i==null){let c=t.encode(r);return e.set(n,c),c}else return i},tr=112,ss=18,Sn=(r,e,t)=>{let n=Ve(r),i=n+Ve(e),c=new Uint8Array(i+t.byteLength);return qe(r,c,0),qe(e,c,n),c.set(t,i),c},cs=Symbol.for("@ipld/js-cid/CID");var fe={...nt,...Zr,...tt,...Qr,...Jr,...Br,...rt,...Nr,...kr,...et},ta={...dt,...ot};function nr(r,e){if(r===e)return!0;if(r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}var as=Symbol.for("nodejs.util.inspect.custom"),fn=Object.values(fe).map(r=>r.decoder).reduce((r,e)=>r.or(e),fe.identity.decoder),Un=114,On=36,Ln=37,ir=class{type;multihash;privateKey;publicKey;string;constructor(e){this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}[gn]=!0;toString(){return this.string==null&&(this.string=F.encode(this.multihash.bytes).slice(1)),this.string}toCID(){return re.createV1(Un,this.multihash)}toBytes(){return this.multihash.bytes}toJSON(){return this.toString()}equals(e){if(e instanceof Uint8Array)return nr(this.multihash.bytes,e);if(typeof e=="string")return ut(e).equals(this);if(e?.multihash?.bytes!=null)return nr(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}[as](){return`PeerId(${this.toString()})`}},or=class extends ir{type="RSA";publicKey;constructor(e){super({...e,type:"RSA"}),this.publicKey=e.publicKey}},sr=class extends ir{type="Ed25519";publicKey;constructor(e){super({...e,type:"Ed25519"}),this.publicKey=e.multihash.digest}},cr=class extends ir{type="secp256k1";publicKey;constructor(e){super({...e,type:"secp256k1"}),this.publicKey=e.multihash.digest}};function ut(r,e){if(e=e??fn,r.charAt(0)==="1"||r.charAt(0)==="Q"){let t=Fe(F.decode(`z${r}`));return r.startsWith("12D")?new sr({multihash:t}):r.startsWith("16U")?new cr({multihash:t}):new or({multihash:t})}return ds(fn.decode(r))}function ds(r){try{let e=Fe(r);if(e.code===Er.code){if(e.digest.length===On)return new sr({multihash:e});if(e.digest.length===Ln)return new cr({multihash:e})}if(e.code===xr.code)return new or({multihash:e})}catch{return ls(re.decode(r))}throw new Error("Supplied PeerID CID is invalid")}function ls(r){if(r==null||r.multihash==null||r.version==null||r.version===1&&r.code!==Un)throw new Error("Supplied PeerID CID is invalid");let e=r.multihash;if(e.code===xr.code)return new or({multihash:r.multihash});if(e.code===Er.code){if(e.digest.length===On)return new sr({multihash:r.multihash});if(e.digest.length===Ln)return new cr({multihash:r.multihash})}throw new Error("Supplied PeerID CID is invalid")}var Nn=Qe(Pn(),1);var Fn="[a-fA-F\\d:]",Ue=r=>r&&r.includeBoundaries?`(?:(?<=\\s|^)(?=${Fn})|(?<=${Fn})(?=\\s|$))`:"",te="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",P="[a-fA-F\\d]{1,4}",vr=`
|
|
7
7
|
(?:
|
|
8
8
|
(?:${P}:){7}(?:${P}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
9
9
|
(?:${P}:){6}(?:${te}|:${P}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
(?:${P}:){1}(?:(?::${P}){0,4}:${te}|(?::${P}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
15
15
|
(?::(?:(?::${P}){0,5}:${te}|(?::${P}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
16
16
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
17
|
-
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),us=new RegExp(`(?:^${te}$)|(?:^${vr}$)`),hs=new RegExp(`^${te}$`),ps=new RegExp(`^${vr}$`),ht=r=>r&&r.exact?us:new RegExp(`(?:${Ue(r)}${te}${Ue(r)})|(?:${Ue(r)}${vr}${Ue(r)})`,"g");ht.v4=r=>r&&r.exact?hs:new RegExp(`${Ue(r)}${te}${Ue(r)}`,"g");ht.v6=r=>r&&r.exact?ps:new RegExp(`${Ue(r)}${vr}${Ue(r)}`,"g");var Rn=ht;var Oe=ue("node:net");function Ke(r){return!!(0,Oe.isIP)(r)}var kn=Qe(Dn(),1),{isValid:gs,parse:ms}=kn.default,ys=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],ws=ys.map(r=>new Nn.Netmask(r));function Is(r){for(let e of ws)if(e.contains(r))return!0;return!1}function Bn(r){return/^::$/.test(r)||/^::1$/.test(r)||/^::f{4}:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(r)||/^::f{4}:0.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(r)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(r)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(r)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(r)||/^ff([0-9a-fA-F]{2,2}):/i.test(r)}var $n=r=>{if(gs(r)){let e=ms(r);if(e.kind()==="ipv4")return Is(e.toNormalizedString());if(e.kind()==="ipv6")return Bn(r)}else if(Ke(r)&&Rn.v6().test(r))return Bn(r)};var Mn=$n;function _n(r){try{let{address:e}=r.nodeAddress();return!!Mn(e)}catch{return!0}}function Ge(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function He(r=0){return globalThis.Buffer?.allocUnsafe!=null?Ge(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function qn(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var zn=qn("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),pt=qn("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=He(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Es={utf8:zn,"utf-8":zn,hex:fe.base16,latin1:pt,ascii:pt,binary:pt,...fe},Ar=Es;function _(r,e="utf8"){let t=Ar[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var xs=Math.pow(2,7),vs=Math.pow(2,14),Cs=Math.pow(2,21),gt=Math.pow(2,28),mt=Math.pow(2,35),yt=Math.pow(2,42),wt=Math.pow(2,49),b=128,k=127;function le(r){if(r<xs)return 1;if(r<vs)return 2;if(r<Cs)return 3;if(r<gt)return 4;if(r<mt)return 5;if(r<yt)return 6;if(r<wt)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function As(r,e,t=0){switch(le(r)){case 8:e[t++]=r&255|b,r/=128;case 7:e[t++]=r&255|b,r/=128;case 6:e[t++]=r&255|b,r/=128;case 5:e[t++]=r&255|b,r/=128;case 4:e[t++]=r&255|b,r>>>=7;case 3:e[t++]=r&255|b,r>>>=7;case 2:e[t++]=r&255|b,r>>>=7;case 1:{e[t++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return e}function bs(r,e,t=0){switch(le(r)){case 8:e.set(t++,r&255|b),r/=128;case 7:e.set(t++,r&255|b),r/=128;case 6:e.set(t++,r&255|b),r/=128;case 5:e.set(t++,r&255|b),r/=128;case 4:e.set(t++,r&255|b),r>>>=7;case 3:e.set(t++,r&255|b),r>>>=7;case 2:e.set(t++,r&255|b),r>>>=7;case 1:{e.set(t++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return e}function Ss(r,e){let t=r[e],n=0;if(n+=t&k,t<b||(t=r[e+1],n+=(t&k)<<7,t<b)||(t=r[e+2],n+=(t&k)<<14,t<b)||(t=r[e+3],n+=(t&k)<<21,t<b)||(t=r[e+4],n+=(t&k)*gt,t<b)||(t=r[e+5],n+=(t&k)*mt,t<b)||(t=r[e+6],n+=(t&k)*yt,t<b)||(t=r[e+7],n+=(t&k)*wt,t<b))return n;throw new RangeError("Could not decode varint")}function fs(r,e){let t=r.get(e),n=0;if(n+=t&k,t<b||(t=r.get(e+1),n+=(t&k)<<7,t<b)||(t=r.get(e+2),n+=(t&k)<<14,t<b)||(t=r.get(e+3),n+=(t&k)<<21,t<b)||(t=r.get(e+4),n+=(t&k)*gt,t<b)||(t=r.get(e+5),n+=(t&k)*mt,t<b)||(t=r.get(e+6),n+=(t&k)*yt,t<b)||(t=r.get(e+7),n+=(t&k)*wt,t<b))return n;throw new RangeError("Could not decode varint")}function Ye(r,e,t=0){return e==null&&(e=He(le(r))),e instanceof Uint8Array?As(r,e,t):bs(r,e,t)}function Te(r,e=0){return r instanceof Uint8Array?Ss(r,e):fs(r,e)}function Ce(r,e){e==null&&(e=r.reduce((i,c)=>i+c.length,0));let t=He(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ge(t)}var br=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,n=e();return n===void 0&&(this.index=t),n}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,n){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,t,n,i){return this.readAtomically(()=>{let c=0,h=0,g=this.peekChar();if(g===void 0)return;let m=g==="0",p=2**(8*i)-1;for(;;){let w=this.readAtomically(()=>{let u=this.readChar();if(u===void 0)return;let a=Number.parseInt(u,e);if(!Number.isNaN(a))return a});if(w===void 0)break;if(c*=e,c+=w,c>p||(h+=1,t!==void 0&&h>t))return}if(h!==0)return!n&&m&&h>1?void 0:c})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;t<e.length;t++){let n=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[t]=n}return e})}readIPv6Addr(){let e=t=>{for(let n=0;n<t.length/2;n++){let i=n*2;if(n<t.length-3){let h=this.readSeparator(":",n,()=>this.readIPv4Addr());if(h!==void 0)return t[i]=h[0],t[i+1]=h[1],t[i+2]=h[2],t[i+3]=h[3],[i+4,!0]}let c=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(c===void 0)return[i,!1];t[i]=c>>8,t[i+1]=c&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[n,i]=e(t);if(n===16)return t;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let c=new Uint8Array(14),h=16-(n+2),[g]=e(c.subarray(0,h));return t.set(c.subarray(0,g),16-g),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var Ba=new br;var Va=parseInt("0xFFFF",16),ja=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function It(r,e="utf8"){let t=Ar[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ge(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var Gn=Oe.isIPv4,Rs=Oe.isIPv6,Et=function(r){let e=0;if(r=r.toString().trim(),Gn(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(Rs(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let c=Gn(t[n]),h;c&&(h=Et(t[n]),t[n]=_(h.slice(0,2),"base16")),h!=null&&++n<8&&t.splice(n,0,_(h.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let c=[n,1];for(n=9-t.length;n>0;n--)c.push("0");t.splice.apply(t,c)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let c=parseInt(t[n],16);i[e++]=c>>8&255,i[e++]=c&255}return i}throw new Error("invalid ip address")},Hn=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let c=0;c<t;c++)i.push(r[e+c]);return i.join(".")}if(t===16){let i=[];for(let c=0;c<t;c+=2)i.push(n.getUint16(e+c).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Xe={},xt={},Ds=[[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"]];Ds.forEach(r=>{let e=Bs(...r);xt[e.code]=e,Xe[e.name]=e});function Bs(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function S(r){if(typeof r=="number"){if(xt[r]!=null)return xt[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Xe[r]!=null)return Xe[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Pd=S("ip4"),Ld=S("ip6"),Rd=S("ipcidr");function Ct(r,e){switch(S(r).code){case 4:case 41:return ks(e);case 42:return Wn(e);case 6:case 273:case 33:case 132:return Jn(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Wn(e);case 421:return zs(e);case 444:return Qn(e);case 445:return Qn(e);case 466:return _s(e);default:return _(e,"base16")}}function At(r,e){switch(S(r).code){case 4:return Yn(e);case 41:return Yn(e);case 42:return Xn(e);case 6:case 273:case 33:case 132:return bt(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Xn(e);case 421:return $s(e);case 444:return qs(e);case 445:return Vs(e);case 466:return Ms(e);default:return It(e,"base16")}}var vt=Object.values(fe).map(r=>r.decoder),Ns=function(){let r=vt[0].or(vt[1]);return vt.slice(2).forEach(e=>r=r.or(e)),r}();function Yn(r){if(!Ke(r))throw new Error("invalid ip address");return Et(r)}function ks(r){let e=Hn(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!Ke(e))throw new Error("invalid ip address");return e}function bt(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function Jn(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Xn(r){let e=It(r),t=Uint8Array.from(Ye(e.length));return Ce([t,e],t.length+e.length)}function Wn(r){let e=Te(r);if(r=r.slice(le(e)),r.length!==e)throw new Error("inconsistent lengths");return _(r)}function $s(r){let e;r[0]==="Q"||r[0]==="1"?e=Le(L.decode(`z${r}`)).bytes:e=re.parse(r).multihash.bytes;let t=Uint8Array.from(Ye(e.length));return Ce([t,e],t.length+e.length)}function Ms(r){let e=Ns.decode(r),t=Uint8Array.from(Ye(e.length));return Ce([t,e],t.length+e.length)}function _s(r){let e=Te(r),t=r.slice(le(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+_(t,"base64url")}function zs(r){let e=Te(r),t=r.slice(le(e));if(t.length!==e)throw new Error("inconsistent lengths");return _(t,"base58btc")}function qs(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=Q.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=bt(n);return Ce([t,i],t.length+i.length)}function Vs(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=Q.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=bt(n);return Ce([t,i],t.length+i.length)}function Qn(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=_(e,"base32"),i=Jn(t);return`${n}:${i}`}function Zn(r){r=St(r);let e=[],t=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let c=0;c<i.length;c++){let h=i[c],g=S(h);if(g.size===0){e.push([g.code]),t.push([g.code]);continue}if(c++,c>=i.length)throw ri("invalid address: "+r);if(g.path===!0){n=St(i.slice(c).join("/")),e.push([g.code,At(g.code,n)]),t.push([g.code,n]);break}let m=At(g.code,i[c]);e.push([g.code,m]),t.push([g.code,Ct(g.code,m)])}return{string:ei(t),bytes:Ut(e),tuples:e,stringTuples:t,path:n}}function ft(r){let e=[],t=[],n=null,i=0;for(;i<r.length;){let c=Te(r,i),h=le(c),g=S(c),m=js(g,r.slice(i+h));if(m===0){e.push([c]),t.push([c]),i+=h;continue}let p=r.slice(i+h,i+h+m);if(i+=m+h,i>r.length)throw ri("Invalid address Uint8Array: "+_(r,"base16"));e.push([c,p]);let w=Ct(c,p);if(t.push([c,w]),g.path===!0){n=w;break}}return{bytes:Uint8Array.from(r),string:ei(t),tuples:e,stringTuples:t,path:n}}function ei(r){let e=[];return r.map(t=>{let n=S(t[0]);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),St(e.join("/"))}function Ut(r){return Ce(r.map(e=>{let t=S(e[0]),n=Uint8Array.from(Ye(t.code));return e.length>1&&e[1]!=null&&(n=Ce([n,e[1]])),n}))}function js(r,e){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let t=Te(e instanceof Uint8Array?e:Uint8Array.from(e));return t+le(t)}}function St(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function ri(r){return new Error("Error parsing address: "+r)}var Ks=Symbol.for("nodejs.util.inspect.custom"),Ot=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Gs=[S("dns").code,S("dns4").code,S("dns6").code,S("dnsaddr").code],Sr=class r{bytes;#e;#r;#t;#n;[Ot]=!0;constructor(e){e==null&&(e="");let t;if(e instanceof Uint8Array)t=ft(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);t=Zn(e)}else if(ni(e))t=ft(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=t.bytes,this.#e=t.string,this.#r=t.tuples,this.#t=t.stringTuples,this.#n=t.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,t,n,i,c="",h=S("tcp"),g=S("udp"),m=S("ip4"),p=S("ip6"),w=S("dns6"),u=S("ip6zone");for(let[o,s]of this.stringTuples())o===u.code&&(c=`%${s??""}`),Gs.includes(o)&&(t=h.name,i=443,n=`${s??""}${c}`,e=o===w.code?6:4),(o===h.code||o===g.code)&&(t=S(o).name,i=parseInt(s??"")),(o===m.code||o===p.code)&&(t=S(o).name,n=`${s??""}${c}`,e=o===p.code?6:4);if(e==null||t==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:e,host:n,transport:t,port:i}}protos(){return this.#r.map(([e])=>Object.assign({},S(e)))}protoCodes(){return this.#r.map(([e])=>e)}protoNames(){return this.#r.map(([e])=>S(e).name)}tuples(){return this.#r}stringTuples(){return this.#t}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(Ut(t.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Xe.p2p.code&&e.push([n,i]),n===Xe["p2p-circuit"].code&&(e=[])});let t=e.pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?_(L.decode(`z${n}`),"base58btc"):_(re.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return nr(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(c=>c.resolvable);if(t==null)return[this];let n=ti.get(t.name);if(n==null)throw new Ze(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(c=>new r(c))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[Ks](){return`Multiaddr(${this.#e})`}};var ti=new Map;function ni(r){return!!r?.[Ot]}function Ft(r){return new Sr(r)}var De=mr("libp2p:mdns:query");function ii(r,e,t){let n=()=>{De.trace("query",e),r.query({questions:[{name:e,type:"PTR"}]})};return n(),setInterval(n,t)}function oi(r,e,t){if(r.answers==null)return;let n,i=[];if(r.answers.forEach(c=>{switch(c.type){case"PTR":n=c;break;case"TXT":i.push(c);break;default:break}}),r.additionals.forEach(c=>{switch(c.type){case"TXT":i.push(c);break;default:break}}),!(n==null||n?.name!==t||i.length===0||n.data.startsWith(e)))try{let c=i.flatMap(g=>g.data).filter(g=>g.toString().startsWith("dnsaddr=")).map(g=>Ft(g.toString().substring(8))),h=c[0].getPeerId();if(h==null)throw new Error("Multiaddr doesn't contain PeerId");return De("peer found %p",h),{id:ut(h),multiaddrs:c.map(g=>g.decapsulateCode(S("p2p").code)),protocols:[]}}catch(c){De.error("failed to parse mdns response",c)}}function si(r,e,t,n,i,c){if(!c){De("not responding to mDNS query as broadcast mode is false");return}if(n.length!==0&&r.questions[0]!=null&&r.questions[0].name===i){let h=[];h.push({name:i,type:"PTR",class:"IN",ttl:120,data:t+"."+i}),n.filter(Hs).forEach(g=>{let m="dnsaddr="+g.toString();if(m.length>255){De("multiaddr %a is too long to use in mDNS query response",g);return}if(g.getPeerId()==null){De("multiaddr %a did not have a peer ID so cannot be used in mDNS query response",g);return}h.push({name:t+"."+i,type:"TXT",class:"IN",ttl:120,data:m})}),De.trace("responding to query"),e.respond(h)}}function Hs(r){return!!_n(r)}function ci(r){let e="",t="abcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n<r;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}var We=mr("libp2p:mdns"),Pt=class extends lr{mdns;broadcast;interval;serviceTag;peerName;port;ip;_queryInterval;components;constructor(e,t={}){if(super(),this.broadcast=t.broadcast!==!1,this.interval=t.interval??1e3*10,this.serviceTag=t.serviceTag??"_p2p._udp.local",this.ip=t.ip??"224.0.0.251",this.peerName=t.peerName??ci(63),this.peerName.length>=64)throw new Error("Peer name should be less than 64 chars long");this.port=t.port??5353,this.components=e,this._queryInterval=null,this._onMdnsQuery=this._onMdnsQuery.bind(this),this._onMdnsResponse=this._onMdnsResponse.bind(this),this._onMdnsWarning=this._onMdnsWarning.bind(this),this._onMdnsError=this._onMdnsError.bind(this)}[Rt]=this;[Symbol.toStringTag]="@libp2p/mdns";isStarted(){return!!this.mdns}async start(){this.mdns==null&&(this.mdns=(0,ai.default)({port:this.port,ip:this.ip}),this.mdns.on("query",this._onMdnsQuery),this.mdns.on("response",this._onMdnsResponse),this.mdns.on("warning",this._onMdnsWarning),this.mdns.on("error",this._onMdnsError),this._queryInterval=ii(this.mdns,this.serviceTag,this.interval))}_onMdnsQuery(e){this.mdns!=null&&(We.trace("received incoming mDNS query"),si(e,this.mdns,this.peerName,this.components.addressManager.getAddresses(),this.serviceTag,this.broadcast))}_onMdnsResponse(e){We.trace("received mDNS query response");try{let t=oi(e,this.peerName,this.serviceTag);t!=null&&(We("discovered peer in mDNS query response %p",t.id),this.dispatchEvent(new Ur("peer",{detail:t})))}catch(t){We.error("Error processing peer response",t)}}_onMdnsWarning(e){We.error("mdns warning",e)}_onMdnsError(e){We.error("mdns error",e)}async stop(){this.mdns!=null&&(this.mdns.removeListener("query",this._onMdnsQuery),this.mdns.removeListener("response",this._onMdnsResponse),this.mdns.removeListener("warning",this._onMdnsWarning),this.mdns.removeListener("error",this._onMdnsError),this._queryInterval!=null&&(clearInterval(this._queryInterval),this._queryInterval=null),await new Promise(e=>{this.mdns!=null?this.mdns.destroy(e):e()}),this.mdns=void 0)}};function Xs(r={}){return e=>new Pt(e,r)}return gi(Ws);})();
|
|
17
|
+
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),us=new RegExp(`(?:^${te}$)|(?:^${vr}$)`),hs=new RegExp(`^${te}$`),ps=new RegExp(`^${vr}$`),ht=r=>r&&r.exact?us:new RegExp(`(?:${Ue(r)}${te}${Ue(r)})|(?:${Ue(r)}${vr}${Ue(r)})`,"g");ht.v4=r=>r&&r.exact?hs:new RegExp(`${Ue(r)}${te}${Ue(r)}`,"g");ht.v6=r=>r&&r.exact?ps:new RegExp(`${Ue(r)}${vr}${Ue(r)}`,"g");var Rn=ht;var Oe=ue("node:net");function Ke(r){return!!(0,Oe.isIP)(r)}var $n=Qe(Dn(),1),{isValid:gs,parse:ms}=$n.default,ys=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],ws=ys.map(r=>new Nn.Netmask(r));function Is(r){for(let e of ws)if(e.contains(r))return!0;return!1}function Bn(r){return/^::$/.test(r)||/^::1$/.test(r)||/^::f{4}:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(r)||/^::f{4}:0.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(r)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(r)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(r)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(r)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(r)||/^ff([0-9a-fA-F]{2,2}):/i.test(r)}var kn=r=>{if(gs(r)){let e=ms(r);if(e.kind()==="ipv4")return Is(e.toNormalizedString());if(e.kind()==="ipv6")return Bn(r)}else if(Ke(r)&&Rn.v6().test(r))return Bn(r)};var Mn=kn;function _n(r){try{let{address:e}=r.nodeAddress();return!!Mn(e)}catch{return!0}}function Ge(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function He(r=0){return globalThis.Buffer?.allocUnsafe!=null?Ge(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function qn(r,e,t,n){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:n}}}var zn=qn("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),pt=qn("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);let e=He(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Es={utf8:zn,"utf-8":zn,hex:fe.base16,latin1:pt,ascii:pt,binary:pt,...fe},Ar=Es;function _(r,e="utf8"){let t=Ar[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var xs=Math.pow(2,7),vs=Math.pow(2,14),Cs=Math.pow(2,21),gt=Math.pow(2,28),mt=Math.pow(2,35),yt=Math.pow(2,42),wt=Math.pow(2,49),b=128,$=127;function le(r){if(r<xs)return 1;if(r<vs)return 2;if(r<Cs)return 3;if(r<gt)return 4;if(r<mt)return 5;if(r<yt)return 6;if(r<wt)return 7;if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function As(r,e,t=0){switch(le(r)){case 8:e[t++]=r&255|b,r/=128;case 7:e[t++]=r&255|b,r/=128;case 6:e[t++]=r&255|b,r/=128;case 5:e[t++]=r&255|b,r/=128;case 4:e[t++]=r&255|b,r>>>=7;case 3:e[t++]=r&255|b,r>>>=7;case 2:e[t++]=r&255|b,r>>>=7;case 1:{e[t++]=r&255,r>>>=7;break}default:throw new Error("unreachable")}return e}function bs(r,e,t=0){switch(le(r)){case 8:e.set(t++,r&255|b),r/=128;case 7:e.set(t++,r&255|b),r/=128;case 6:e.set(t++,r&255|b),r/=128;case 5:e.set(t++,r&255|b),r/=128;case 4:e.set(t++,r&255|b),r>>>=7;case 3:e.set(t++,r&255|b),r>>>=7;case 2:e.set(t++,r&255|b),r>>>=7;case 1:{e.set(t++,r&255),r>>>=7;break}default:throw new Error("unreachable")}return e}function Ss(r,e){let t=r[e],n=0;if(n+=t&$,t<b||(t=r[e+1],n+=(t&$)<<7,t<b)||(t=r[e+2],n+=(t&$)<<14,t<b)||(t=r[e+3],n+=(t&$)<<21,t<b)||(t=r[e+4],n+=(t&$)*gt,t<b)||(t=r[e+5],n+=(t&$)*mt,t<b)||(t=r[e+6],n+=(t&$)*yt,t<b)||(t=r[e+7],n+=(t&$)*wt,t<b))return n;throw new RangeError("Could not decode varint")}function fs(r,e){let t=r.get(e),n=0;if(n+=t&$,t<b||(t=r.get(e+1),n+=(t&$)<<7,t<b)||(t=r.get(e+2),n+=(t&$)<<14,t<b)||(t=r.get(e+3),n+=(t&$)<<21,t<b)||(t=r.get(e+4),n+=(t&$)*gt,t<b)||(t=r.get(e+5),n+=(t&$)*mt,t<b)||(t=r.get(e+6),n+=(t&$)*yt,t<b)||(t=r.get(e+7),n+=(t&$)*wt,t<b))return n;throw new RangeError("Could not decode varint")}function Ye(r,e,t=0){return e==null&&(e=He(le(r))),e instanceof Uint8Array?As(r,e,t):bs(r,e,t)}function Te(r,e=0){return r instanceof Uint8Array?Ss(r,e):fs(r,e)}function Ce(r,e){e==null&&(e=r.reduce((i,c)=>i+c.length,0));let t=He(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return Ge(t)}var br=class{index=0;input="";new(e){return this.index=0,this.input=e,this}readAtomically(e){let t=this.index,n=e();return n===void 0&&(this.index=t),n}parseWith(e){let t=e();if(this.index===this.input.length)return t}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(e){return this.readAtomically(()=>{let t=this.readChar();if(t===e)return t})}readSeparator(e,t,n){return this.readAtomically(()=>{if(!(t>0&&this.readGivenChar(e)===void 0))return n()})}readNumber(e,t,n,i){return this.readAtomically(()=>{let c=0,h=0,g=this.peekChar();if(g===void 0)return;let m=g==="0",p=2**(8*i)-1;for(;;){let w=this.readAtomically(()=>{let u=this.readChar();if(u===void 0)return;let a=Number.parseInt(u,e);if(!Number.isNaN(a))return a});if(w===void 0)break;if(c*=e,c+=w,c>p||(h+=1,t!==void 0&&h>t))return}if(h!==0)return!n&&m&&h>1?void 0:c})}readIPv4Addr(){return this.readAtomically(()=>{let e=new Uint8Array(4);for(let t=0;t<e.length;t++){let n=this.readSeparator(".",t,()=>this.readNumber(10,3,!1,1));if(n===void 0)return;e[t]=n}return e})}readIPv6Addr(){let e=t=>{for(let n=0;n<t.length/2;n++){let i=n*2;if(n<t.length-3){let h=this.readSeparator(":",n,()=>this.readIPv4Addr());if(h!==void 0)return t[i]=h[0],t[i+1]=h[1],t[i+2]=h[2],t[i+3]=h[3],[i+4,!0]}let c=this.readSeparator(":",n,()=>this.readNumber(16,4,!0,2));if(c===void 0)return[i,!1];t[i]=c>>8,t[i+1]=c&255}return[t.length,!1]};return this.readAtomically(()=>{let t=new Uint8Array(16),[n,i]=e(t);if(n===16)return t;if(i||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;let c=new Uint8Array(14),h=16-(n+2),[g]=e(c.subarray(0,h));return t.set(c.subarray(0,g),16-g),t})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}};var ka=new br;var Ga=parseInt("0xFFFF",16),Ha=new Uint8Array([0,0,0,0,0,0,0,0,0,0,255,255]);function It(r,e="utf8"){let t=Ar[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ge(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}var Gn=Oe.isIPv4,Rs=Oe.isIPv6,Et=function(r){let e=0;if(r=r.toString().trim(),Gn(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(n=>{t[e++]=parseInt(n,10)&255}),t}if(Rs(r)){let t=r.split(":",8),n;for(n=0;n<t.length;n++){let c=Gn(t[n]),h;c&&(h=Et(t[n]),t[n]=_(h.slice(0,2),"base16")),h!=null&&++n<8&&t.splice(n,0,_(h.slice(2,4),"base16"))}if(t[0]==="")for(;t.length<8;)t.unshift("0");else if(t[t.length-1]==="")for(;t.length<8;)t.push("0");else if(t.length<8){for(n=0;n<t.length&&t[n]!=="";n++);let c=[n,1];for(n=9-t.length;n>0;n--)c.push("0");t.splice.apply(t,c)}let i=new Uint8Array(e+16);for(n=0;n<t.length;n++){let c=parseInt(t[n],16);i[e++]=c>>8&255,i[e++]=c&255}return i}throw new Error("invalid ip address")},Hn=function(r,e=0,t){e=~~e,t=t??r.length-e;let n=new DataView(r.buffer);if(t===4){let i=[];for(let c=0;c<t;c++)i.push(r[e+c]);return i.join(".")}if(t===16){let i=[];for(let c=0;c<t;c+=2)i.push(n.getUint16(e+c).toString(16));return i.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Xe={},xt={},Ds=[[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"]];Ds.forEach(r=>{let e=Bs(...r);xt[e.code]=e,Xe[e.name]=e});function Bs(r,e,t,n,i){return{code:r,size:e,name:t,resolvable:!!n,path:!!i}}function S(r){if(typeof r=="number"){if(xt[r]!=null)return xt[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Xe[r]!=null)return Xe[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var Td=S("ip4"),Dd=S("ip6"),Bd=S("ipcidr");function Ct(r,e){switch(S(r).code){case 4:case 41:return $s(e);case 42:return Wn(e);case 6:case 273:case 33:case 132:return Jn(e).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Wn(e);case 421:return zs(e);case 444:return Qn(e);case 445:return Qn(e);case 466:return _s(e);default:return _(e,"base16")}}function At(r,e){switch(S(r).code){case 4:return Yn(e);case 41:return Yn(e);case 42:return Xn(e);case 6:case 273:case 33:case 132:return bt(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Xn(e);case 421:return ks(e);case 444:return qs(e);case 445:return Vs(e);case 466:return Ms(e);default:return It(e,"base16")}}var vt=Object.values(fe).map(r=>r.decoder),Ns=function(){let r=vt[0].or(vt[1]);return vt.slice(2).forEach(e=>r=r.or(e)),r}();function Yn(r){if(!Ke(r))throw new Error("invalid ip address");return Et(r)}function $s(r){let e=Hn(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!Ke(e))throw new Error("invalid ip address");return e}function bt(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function Jn(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Xn(r){let e=It(r),t=Uint8Array.from(Ye(e.length));return Ce([t,e],t.length+e.length)}function Wn(r){let e=Te(r);if(r=r.slice(le(e)),r.length!==e)throw new Error("inconsistent lengths");return _(r)}function ks(r){let e;r[0]==="Q"||r[0]==="1"?e=Fe(F.decode(`z${r}`)).bytes:e=re.parse(r).multihash.bytes;let t=Uint8Array.from(Ye(e.length));return Ce([t,e],t.length+e.length)}function Ms(r){let e=Ns.decode(r),t=Uint8Array.from(Ye(e.length));return Ce([t,e],t.length+e.length)}function _s(r){let e=Te(r),t=r.slice(le(e));if(t.length!==e)throw new Error("inconsistent lengths");return"u"+_(t,"base64url")}function zs(r){let e=Te(r),t=r.slice(le(e));if(t.length!==e)throw new Error("inconsistent lengths");return _(t,"base58btc")}function qs(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==16)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion address.`);let t=Q.decode("b"+e[0]),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=bt(n);return Ce([t,i],t.length+i.length)}function Vs(r){let e=r.split(":");if(e.length!==2)throw new Error(`failed to parse onion addr: ["'${e.join('", "')}'"]' does not contain a port number`);if(e[0].length!==56)throw new Error(`failed to parse onion addr: ${e[0]} not a Tor onion3 address.`);let t=Q.decode(`b${e[0]}`),n=parseInt(e[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");let i=bt(n);return Ce([t,i],t.length+i.length)}function Qn(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),n=_(e,"base32"),i=Jn(t);return`${n}:${i}`}function Zn(r){r=St(r);let e=[],t=[],n=null,i=r.split("/").slice(1);if(i.length===1&&i[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let c=0;c<i.length;c++){let h=i[c],g=S(h);if(g.size===0){e.push([g.code]),t.push([g.code]);continue}if(c++,c>=i.length)throw ri("invalid address: "+r);if(g.path===!0){n=St(i.slice(c).join("/")),e.push([g.code,At(g.code,n)]),t.push([g.code,n]);break}let m=At(g.code,i[c]);e.push([g.code,m]),t.push([g.code,Ct(g.code,m)])}return{string:ei(t),bytes:Ut(e),tuples:e,stringTuples:t,path:n}}function ft(r){let e=[],t=[],n=null,i=0;for(;i<r.length;){let c=Te(r,i),h=le(c),g=S(c),m=js(g,r.slice(i+h));if(m===0){e.push([c]),t.push([c]),i+=h;continue}let p=r.slice(i+h,i+h+m);if(i+=m+h,i>r.length)throw ri("Invalid address Uint8Array: "+_(r,"base16"));e.push([c,p]);let w=Ct(c,p);if(t.push([c,w]),g.path===!0){n=w;break}}return{bytes:Uint8Array.from(r),string:ei(t),tuples:e,stringTuples:t,path:n}}function ei(r){let e=[];return r.map(t=>{let n=S(t[0]);return e.push(n.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),St(e.join("/"))}function Ut(r){return Ce(r.map(e=>{let t=S(e[0]),n=Uint8Array.from(Ye(t.code));return e.length>1&&e[1]!=null&&(n=Ce([n,e[1]])),n}))}function js(r,e){if(r.size>0)return r.size/8;if(r.size===0)return 0;{let t=Te(e instanceof Uint8Array?e:Uint8Array.from(e));return t+le(t)}}function St(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function ri(r){return new Error("Error parsing address: "+r)}var Ks=Symbol.for("nodejs.util.inspect.custom"),Ot=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Gs=[S("dns").code,S("dns4").code,S("dns6").code,S("dnsaddr").code],Sr=class r{bytes;#e;#r;#t;#n;[Ot]=!0;constructor(e){e==null&&(e="");let t;if(e instanceof Uint8Array)t=ft(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);t=Zn(e)}else if(ni(e))t=ft(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=t.bytes,this.#e=t.string,this.#r=t.tuples,this.#t=t.stringTuples,this.#n=t.path}toString(){return this.#e}toJSON(){return this.toString()}toOptions(){let e,t,n,i,c="",h=S("tcp"),g=S("udp"),m=S("ip4"),p=S("ip6"),w=S("dns6"),u=S("ip6zone");for(let[o,s]of this.stringTuples())o===u.code&&(c=`%${s??""}`),Gs.includes(o)&&(t=h.name,i=443,n=`${s??""}${c}`,e=o===w.code?6:4),(o===h.code||o===g.code)&&(t=S(o).name,i=parseInt(s??"")),(o===m.code||o===p.code)&&(t=S(o).name,n=`${s??""}${c}`,e=o===p.code?6:4);if(e==null||t==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:e,host:n,transport:t,port:i}}protos(){return this.#r.map(([e])=>Object.assign({},S(e)))}protoCodes(){return this.#r.map(([e])=>e)}protoNames(){return this.#r.map(([e])=>S(e).name)}tuples(){return this.#r}stringTuples(){return this.#t}encapsulate(e){return e=new r(e),new r(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),n=this.toString(),i=n.lastIndexOf(t);if(i<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new r(n.slice(0,i))}decapsulateCode(e){let t=this.tuples();for(let n=t.length-1;n>=0;n--)if(t[n][0]===e)return new r(Ut(t.slice(0,n)));return this}getPeerId(){try{let e=[];this.stringTuples().forEach(([n,i])=>{n===Xe.p2p.code&&e.push([n,i]),n===Xe["p2p-circuit"].code&&(e=[])});let t=e.pop();if(t?.[1]!=null){let n=t[1];return n[0]==="Q"||n[0]==="1"?_(F.decode(`z${n}`),"base58btc"):_(re.parse(n).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(e){return nr(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(c=>c.resolvable);if(t==null)return[this];let n=ti.get(t.name);if(n==null)throw new Ze(`no available resolver for ${t.name}`,"ERR_NO_AVAILABLE_RESOLVER");return(await n(this,e)).map(c=>new r(c))}nodeAddress(){let e=this.toOptions();if(e.transport!=="tcp"&&e.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${e.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:e.family,address:e.host,port:e.port}}isThinWaistAddress(e){let t=(e??this).protos();return!(t.length!==2||t[0].code!==4&&t[0].code!==41||t[1].code!==6&&t[1].code!==273)}[Ks](){return`Multiaddr(${this.#e})`}};var ti=new Map;function ni(r){return!!r?.[Ot]}function Lt(r){return new Sr(r)}var De=mr("libp2p:mdns:query");function ii(r,e,t){let n=()=>{De.trace("query",e),r.query({questions:[{name:e,type:"PTR"}]})};return n(),setInterval(n,t)}function oi(r,e,t){if(r.answers==null)return;let n,i=[];if(r.answers.forEach(c=>{switch(c.type){case"PTR":n=c;break;case"TXT":i.push(c);break;default:break}}),r.additionals.forEach(c=>{switch(c.type){case"TXT":i.push(c);break;default:break}}),!(n==null||n?.name!==t||i.length===0||n.data.startsWith(e)))try{let c=i.flatMap(g=>g.data).filter(g=>g.toString().startsWith("dnsaddr=")).map(g=>Lt(g.toString().substring(8))),h=c[0].getPeerId();if(h==null)throw new Error("Multiaddr doesn't contain PeerId");return De("peer found %p",h),{id:ut(h),multiaddrs:c.map(g=>g.decapsulateCode(S("p2p").code)),protocols:[]}}catch(c){De.error("failed to parse mdns response",c)}}function si(r,e,t,n,i,c){if(!c){De("not responding to mDNS query as broadcast mode is false");return}if(n.length!==0&&r.questions[0]!=null&&r.questions[0].name===i){let h=[];h.push({name:i,type:"PTR",class:"IN",ttl:120,data:t+"."+i}),n.filter(Hs).forEach(g=>{let m="dnsaddr="+g.toString();if(m.length>255){De("multiaddr %a is too long to use in mDNS query response",g);return}if(g.getPeerId()==null){De("multiaddr %a did not have a peer ID so cannot be used in mDNS query response",g);return}h.push({name:t+"."+i,type:"TXT",class:"IN",ttl:120,data:m})}),De.trace("responding to query"),e.respond(h)}}function Hs(r){return!!_n(r)}function ci(r){let e="",t="abcdefghijklmnopqrstuvwxyz0123456789";for(let n=0;n<r;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e}var We=mr("libp2p:mdns"),Pt=class extends lr{mdns;broadcast;interval;serviceTag;peerName;port;ip;_queryInterval;components;constructor(e,t={}){if(super(),this.broadcast=t.broadcast!==!1,this.interval=t.interval??1e3*10,this.serviceTag=t.serviceTag??"_p2p._udp.local",this.ip=t.ip??"224.0.0.251",this.peerName=t.peerName??ci(63),this.peerName.length>=64)throw new Error("Peer name should be less than 64 chars long");this.port=t.port??5353,this.components=e,this._queryInterval=null,this._onMdnsQuery=this._onMdnsQuery.bind(this),this._onMdnsResponse=this._onMdnsResponse.bind(this),this._onMdnsWarning=this._onMdnsWarning.bind(this),this._onMdnsError=this._onMdnsError.bind(this)}[Rt]=this;[Symbol.toStringTag]="@libp2p/mdns";isStarted(){return!!this.mdns}async start(){this.mdns==null&&(this.mdns=(0,ai.default)({port:this.port,ip:this.ip}),this.mdns.on("query",this._onMdnsQuery),this.mdns.on("response",this._onMdnsResponse),this.mdns.on("warning",this._onMdnsWarning),this.mdns.on("error",this._onMdnsError),this._queryInterval=ii(this.mdns,this.serviceTag,this.interval))}_onMdnsQuery(e){this.mdns!=null&&(We.trace("received incoming mDNS query"),si(e,this.mdns,this.peerName,this.components.addressManager.getAddresses(),this.serviceTag,this.broadcast))}_onMdnsResponse(e){We.trace("received mDNS query response");try{let t=oi(e,this.peerName,this.serviceTag);t!=null&&(We("discovered peer in mDNS query response %p",t.id),this.dispatchEvent(new Ur("peer",{detail:t})))}catch(t){We.error("Error processing peer response",t)}}_onMdnsWarning(e){We.error("mdns warning",e)}_onMdnsError(e){We.error("mdns error",e)}async stop(){this.mdns!=null&&(this.mdns.removeListener("query",this._onMdnsQuery),this.mdns.removeListener("response",this._onMdnsResponse),this.mdns.removeListener("warning",this._onMdnsWarning),this.mdns.removeListener("error",this._onMdnsError),this._queryInterval!=null&&(clearInterval(this._queryInterval),this._queryInterval=null),await new Promise(e=>{this.mdns!=null?this.mdns.destroy(e):e()}),this.mdns=void 0)}};function Xs(r={}){return e=>new Pt(e,r)}return gi(Ws);})();
|
|
18
18
|
return Libp2PMdns}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/mdns",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.14",
|
|
4
4
|
"description": "Node.js libp2p mDNS discovery implementation for peer discovery",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/peer-discovery-mdns#readme",
|
|
@@ -45,19 +45,19 @@
|
|
|
45
45
|
"test:electron-main": "aegir test -t electron-main"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@libp2p/interface": "^0.1.
|
|
49
|
-
"@libp2p/logger": "^3.0
|
|
50
|
-
"@libp2p/peer-id": "^3.0.
|
|
51
|
-
"@libp2p/utils": "^4.0.
|
|
48
|
+
"@libp2p/interface": "^0.1.6",
|
|
49
|
+
"@libp2p/logger": "^3.1.0",
|
|
50
|
+
"@libp2p/peer-id": "^3.0.6",
|
|
51
|
+
"@libp2p/utils": "^4.0.7",
|
|
52
52
|
"@multiformats/multiaddr": "^12.1.5",
|
|
53
53
|
"@types/multicast-dns": "^7.2.1",
|
|
54
54
|
"dns-packet": "^5.4.0",
|
|
55
55
|
"multicast-dns": "^7.2.5"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@libp2p/interface-compliance-tests": "^4.1.
|
|
59
|
-
"@libp2p/interface-internal": "^0.1.
|
|
60
|
-
"@libp2p/peer-id-factory": "^3.0.
|
|
58
|
+
"@libp2p/interface-compliance-tests": "^4.1.5",
|
|
59
|
+
"@libp2p/interface-internal": "^0.1.9",
|
|
60
|
+
"@libp2p/peer-id-factory": "^3.0.8",
|
|
61
61
|
"aegir": "^41.0.2",
|
|
62
62
|
"p-wait-for": "^5.0.2",
|
|
63
63
|
"ts-sinon": "^2.0.2"
|