@libp2p/interop 6.0.0 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1,10 +1,10 @@
1
1
  (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterop = factory()}(typeof self !== 'undefined' ? self : this, function () {
2
- "use strict";var Libp2PInterop=(()=>{var Uc=Object.create;var lr=Object.defineProperty;var Rc=Object.getOwnPropertyDescriptor;var zc=Object.getOwnPropertyNames;var Fc=Object.getPrototypeOf,Vc=Object.prototype.hasOwnProperty;var ke=(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 new Error('Dynamic require of "'+r+'" is not supported')});var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),be=(r,e)=>{for(var t in e)lr(r,t,{get:e[t],enumerable:!0})},No=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of zc(e))!Vc.call(r,n)&&n!==t&&lr(r,n,{get:()=>e[n],enumerable:!(o=Rc(e,n))||o.enumerable});return r};var oe=(r,e,t)=>(t=r!=null?Uc(Fc(r)):{},No(e||!r||!r.__esModule?lr(t,"default",{value:r,enumerable:!0}):t,r)),$c=r=>No(lr({},"__esModule",{value:!0}),r);var Vr=O((Bh,Oo)=>{function Po(){var r=[].slice.call(arguments);function e(t,o){Object.keys(o).forEach(function(n){~r.indexOf(n)||(t[n]=o[n])})}return function(){for(var o=[].slice.call(arguments),n=0,i={};n<o.length;n++)e(i,o[n]);return i}}Oo.exports=rt;function rt(r,e,t){var o=Po("name","message","stack","constructor","toJSON"),n=o(e||{});this.message=r||"Unspecified AssertionError",this.showDiff=!1;for(var i in n)this[i]=n[i];if(t=t||rt,Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(s){this.stack=s.stack}}rt.prototype=Object.create(Error.prototype);rt.prototype.name="AssertionError";rt.prototype.constructor=rt;rt.prototype.toJSON=function(r){var e=Po("constructor","toJSON","stack"),t=e({name:this.name},this);return r!==!1&&this.stack&&(t.stack=this.stack),t}});var jo=O((kh,Co)=>{"use strict";function Io(r,e){return typeof r>"u"||r===null?!1:e in Object(r)}function Do(r){var e=r.replace(/([^\\])\[/g,"$1.["),t=e.match(/(\\\.|[^.]+?)+/g);return t.map(function(n){if(n==="constructor"||n==="__proto__"||n==="prototype")return{};var i=/^\[(\d+)\]$/,s=i.exec(n),a=null;return s?a={i:parseFloat(s[1])}:a={p:n.replace(/\\([.[\]])/g,"$1")},a})}function Mo(r,e,t){var o=r,n=null;t=typeof t>"u"?e.length:t;for(var i=0;i<t;i++){var s=e[i];o&&(typeof s.p>"u"?o=o[s.i]:o=o[s.p],i===t-1&&(n=o))}return n}function Wc(r,e,t){for(var o=r,n=t.length,i=null,s=0;s<n;s++){var a=null,c=null;if(i=t[s],s===n-1)a=typeof i.p>"u"?i.i:i.p,o[a]=e;else if(typeof i.p<"u"&&o[i.p])o=o[i.p];else if(typeof i.i<"u"&&o[i.i])o=o[i.i];else{var u=t[s+1];a=typeof i.p>"u"?i.i:i.p,c=typeof u.p>"u"?[]:{},o[a]=c,o=o[a]}}}function _o(r,e){var t=Do(e),o=t[t.length-1],n={parent:t.length>1?Mo(r,t,t.length-1):r,name:o.p||o.i,value:Mo(r,t)};return n.exists=Io(n.parent,n.name),n}function Gc(r,e){var t=_o(r,e);return t.value}function Kc(r,e,t){var o=Do(e);return Wc(r,t,o),r}Co.exports={hasProperty:Io,getPathInfo:_o,getPathValue:Gc,setPathValue:Kc}});var Ae=O((Lh,qo)=>{qo.exports=function(e,t,o){var n=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)n[t]=o;else return n[t]}});var ko=O((Uh,Bo)=>{var Jc=Ae();Bo.exports=function(e,t){var o=Jc(e,"negate"),n=t[0];return o?!n:n}});var Lt=O(($r,Wr)=>{(function(r,e){typeof $r=="object"&&typeof Wr<"u"?Wr.exports=e():typeof define=="function"&&define.amd?define(e):r.typeDetect=e()})($r,function(){"use strict";var r=typeof Promise=="function",e=typeof self=="object"?self:globalThis,t=typeof Symbol<"u",o=typeof Map<"u",n=typeof Set<"u",i=typeof WeakMap<"u",s=typeof WeakSet<"u",a=typeof DataView<"u",c=t&&typeof Symbol.iterator<"u",u=t&&typeof Symbol.toStringTag<"u",d=n&&typeof Set.prototype.entries=="function",E=o&&typeof Map.prototype.entries=="function",B=d&&Object.getPrototypeOf(new Set().entries()),k=E&&Object.getPrototypeOf(new Map().entries()),N=c&&typeof Array.prototype[Symbol.iterator]=="function",x=N&&Object.getPrototypeOf([][Symbol.iterator]()),I=c&&typeof String.prototype[Symbol.iterator]=="function",q=I&&Object.getPrototypeOf(""[Symbol.iterator]()),$=8,Q=-1;function te(y){var S=typeof y;if(S!=="object")return S;if(y===null)return"null";if(y===e)return"global";if(Array.isArray(y)&&(u===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var C=u&&y[Symbol.toStringTag];if(typeof C=="string")return C;var U=Object.getPrototypeOf(y);return U===RegExp.prototype?"RegExp":U===Date.prototype?"Date":r&&U===Promise.prototype?"Promise":n&&U===Set.prototype?"Set":o&&U===Map.prototype?"Map":s&&U===WeakSet.prototype?"WeakSet":i&&U===WeakMap.prototype?"WeakMap":a&&U===DataView.prototype?"DataView":o&&U===k?"Map Iterator":n&&U===B?"Set Iterator":N&&U===x?"Array Iterator":I&&U===q?"String Iterator":U===null?"Object":Object.prototype.toString.call(y).slice($,Q)}return te})});var Uo=O((Rh,Lo)=>{var Xc=Vr(),Gr=Ae(),Qc=Lt();Lo.exports=function(e,t){var o=Gr(e,"message"),n=Gr(e,"ssfi");o=o?o+": ":"",e=Gr(e,"object"),t=t.map(function(a){return a.toLowerCase()}),t.sort();var i=t.map(function(a,c){var u=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an":"a",d=t.length>1&&c===t.length-1?"or ":"";return d+u+" "+a}).join(", "),s=Qc(e).toLowerCase();if(!t.some(function(a){return s===a}))throw new Xc(o+"object tested must be "+i+", but "+s+" given",void 0,n)}});var Kr=O((zh,Ro)=>{Ro.exports=function(e,t){return t.length>4?t[4]:e._obj}});var Jr=O((Fh,zo)=>{"use strict";var Zc=Function.prototype.toString,Yc=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function Hc(r){if(typeof r!="function")return null;var e="";if(typeof Function.prototype.name>"u"&&typeof r.name>"u"){var t=Zc.call(r).match(Yc);t&&(e=t[1])}else e=r.name;return e}zo.exports=Hc});var Vo=O((hr,Fo)=>{(function(r,e){typeof hr=="object"&&typeof Fo<"u"?e(hr):typeof define=="function"&&define.amd?define(["exports"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.loupe={}))})(hr,function(r){"use strict";function e(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(h){return typeof h}:e=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},e(l)}function t(l,h){return o(l)||n(l,h)||i(l,h)||a()}function o(l){if(Array.isArray(l))return l}function n(l,h){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(l)))){var b=[],P=!0,D=!1,R=void 0;try{for(var K=l[Symbol.iterator](),Y;!(P=(Y=K.next()).done)&&(b.push(Y.value),!(h&&b.length===h));P=!0);}catch(he){D=!0,R=he}finally{try{!P&&K.return!=null&&K.return()}finally{if(D)throw R}}return b}}function i(l,h){if(l){if(typeof l=="string")return s(l,h);var b=Object.prototype.toString.call(l).slice(8,-1);if(b==="Object"&&l.constructor&&(b=l.constructor.name),b==="Map"||b==="Set")return Array.from(l);if(b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b))return s(l,h)}}function s(l,h){(h==null||h>l.length)&&(h=l.length);for(var b=0,P=new Array(h);b<h;b++)P[b]=l[b];return P}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},u={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},d="\u2026";function E(l,h){var b=c[u[h]]||c[h];return b?"\x1B[".concat(b[0],"m").concat(String(l),"\x1B[").concat(b[1],"m"):String(l)}function B(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=l.showHidden,b=h===void 0?!1:h,P=l.depth,D=P===void 0?2:P,R=l.colors,K=R===void 0?!1:R,Y=l.customInspect,he=Y===void 0?!0:Y,ue=l.showProxy,Ee=ue===void 0?!1:ue,tt=l.maxArrayLength,zr=tt===void 0?1/0:tt,Bt=l.breakLength,bt=Bt===void 0?1/0:Bt,kt=l.seen,Bc=kt===void 0?[]:kt,So=l.truncate,kc=So===void 0?1/0:So,To=l.stylize,Lc=To===void 0?String:To,Fr={showHidden:Boolean(b),depth:Number(D),colors:Boolean(K),customInspect:Boolean(he),showProxy:Boolean(Ee),maxArrayLength:Number(zr),breakLength:Number(bt),truncate:Number(kc),seen:Bc,stylize:Lc};return Fr.colors&&(Fr.stylize=E),Fr}function k(l,h){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d;l=String(l);var P=b.length,D=l.length;return P>h&&D>P?b:D>h&&D>P?"".concat(l.slice(0,h-P)).concat(b):l}function N(l,h,b){var P=arguments.length>3&&arguments[3]!==void 0?arguments[3]:", ";b=b||h.inspect;var D=l.length;if(D===0)return"";for(var R=h.truncate,K="",Y="",he="",ue=0;ue<D;ue+=1){var Ee=ue+1===l.length,tt=ue+2===l.length;he="".concat(d,"(").concat(l.length-ue,")");var zr=l[ue];h.truncate=R-K.length-(Ee?0:P.length);var Bt=Y||b(zr,h)+(Ee?"":P),bt=K.length+Bt.length,kt=bt+he.length;if(Ee&&bt>R&&K.length+he.length<=R||!Ee&&!tt&&kt>R||(Y=Ee?"":b(l[ue+1],h)+(tt?"":P),!Ee&&tt&&kt>R&&bt+Y.length>R))break;if(K+=Bt,!Ee&&!tt&&bt+Y.length>=R){he="".concat(d,"(").concat(l.length-ue-1,")");break}he=""}return"".concat(K).concat(he)}function x(l){return l.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?l:JSON.stringify(l).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}function I(l,h){var b=t(l,2),P=b[0],D=b[1];return h.truncate-=2,typeof P=="string"?P=x(P):typeof P!="number"&&(P="[".concat(h.inspect(P,h),"]")),h.truncate-=P.length,D=h.inspect(D,h),"".concat(P,": ").concat(D)}function q(l,h){var b=Object.keys(l).slice(l.length);if(!l.length&&!b.length)return"[]";h.truncate-=4;var P=N(l,h);h.truncate-=P.length;var D="";return b.length&&(D=N(b.map(function(R){return[R,l[R]]}),h,I)),"[ ".concat(P).concat(D?", ".concat(D):""," ]")}var $=Function.prototype.toString,Q=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function te(l){if(typeof l!="function")return null;var h="";if(typeof Function.prototype.name>"u"&&typeof l.name>"u"){var b=$.call(l).match(Q);b&&(h=b[1])}else h=l.name;return h}var y=te,S=function(h){return typeof Buffer=="function"&&h instanceof Buffer?"Buffer":h[Symbol.toStringTag]?h[Symbol.toStringTag]:y(h.constructor)};function C(l,h){var b=S(l);h.truncate-=b.length+4;var P=Object.keys(l).slice(l.length);if(!l.length&&!P.length)return"".concat(b,"[]");for(var D="",R=0;R<l.length;R++){var K="".concat(h.stylize(k(l[R],h.truncate),"number")).concat(R===l.length-1?"":", ");if(h.truncate-=K.length,l[R]!==l.length&&h.truncate<=3){D+="".concat(d,"(").concat(l.length-l[R]+1,")");break}D+=K}var Y="";return P.length&&(Y=N(P.map(function(he){return[he,l[he]]}),h,I)),"".concat(b,"[ ").concat(D).concat(Y?", ".concat(Y):""," ]")}function U(l,h){var b=l.toJSON();if(b===null)return"Invalid Date";var P=b.split("T"),D=P[0];return h.stylize("".concat(D,"T").concat(k(P[1],h.truncate-D.length-1)),"date")}function re(l,h){var b=y(l);return b?h.stylize("[Function ".concat(k(b,h.truncate-11),"]"),"special"):h.stylize("[Function]","special")}function De(l,h){var b=t(l,2),P=b[0],D=b[1];return h.truncate-=4,P=h.inspect(P,h),h.truncate-=P.length,D=h.inspect(D,h),"".concat(P," => ").concat(D)}function fe(l){var h=[];return l.forEach(function(b,P){h.push([P,b])}),h}function mt(l,h){var b=l.size-1;return b<=0?"Map{}":(h.truncate-=7,"Map{ ".concat(N(fe(l),h,De)," }"))}var ge=Number.isNaN||function(l){return l!==l};function Oe(l,h){return ge(l)?h.stylize("NaN","number"):l===1/0?h.stylize("Infinity","number"):l===-1/0?h.stylize("-Infinity","number"):l===0?h.stylize(1/l===1/0?"+0":"-0","number"):h.stylize(k(l,h.truncate),"number")}function xe(l,h){var b=k(l.toString(),h.truncate-1);return b!==d&&(b+="n"),h.stylize(b,"bigint")}function et(l,h){var b=l.toString().split("/")[2],P=h.truncate-(2+b.length),D=l.source;return h.stylize("/".concat(k(D,P),"/").concat(b),"regexp")}function sr(l){var h=[];return l.forEach(function(b){h.push(b)}),h}function Ur(l,h){return l.size===0?"Set{}":(h.truncate-=7,"Set{ ".concat(N(sr(l),h)," }"))}var f=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),p={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},g=16,w=4;function A(l){return p[l]||"\\u".concat("0000".concat(l.charCodeAt(0).toString(g)).slice(-w))}function T(l,h){return f.test(l)&&(l=l.replace(f,A)),h.stylize("'".concat(k(l,h.truncate-2),"'"),"string")}function v(l){return"description"in Symbol.prototype?l.description?"Symbol(".concat(l.description,")"):"Symbol()":l.toString()}var m=function(){return"Promise{\u2026}"};try{var M=process.binding("util"),j=M.getPromiseDetails,F=M.kPending,X=M.kRejected;Array.isArray(j(Promise.resolve()))&&(m=function(h,b){var P=j(h),D=t(P,2),R=D[0],K=D[1];return R===F?"Promise{<pending>}":"Promise".concat(R===X?"!":"","{").concat(b.inspect(K,b),"}")})}catch{}var z=m;function L(l,h){var b=Object.getOwnPropertyNames(l),P=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l):[];if(b.length===0&&P.length===0)return"{}";if(h.truncate-=4,h.seen=h.seen||[],h.seen.indexOf(l)>=0)return"[Circular]";h.seen.push(l);var D=N(b.map(function(Y){return[Y,l[Y]]}),h,I),R=N(P.map(function(Y){return[Y,l[Y]]}),h,I);h.seen.pop();var K="";return D&&R&&(K=", "),"{ ".concat(D).concat(K).concat(R," }")}var G=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function ie(l,h){var b="";return G&&G in l&&(b=l[G]),b=b||y(l.constructor),(!b||b==="_class")&&(b="<Anonymous Class>"),h.truncate-=b.length,"".concat(b).concat(L(l,h))}function le(l,h){return l.length===0?"Arguments[]":(h.truncate-=13,"Arguments[ ".concat(N(l,h)," ]"))}var ce=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description"];function Be(l,h){var b=Object.getOwnPropertyNames(l).filter(function(K){return ce.indexOf(K)===-1}),P=l.name;h.truncate-=P.length;var D="";typeof l.message=="string"?D=k(l.message,h.truncate):b.unshift("message"),D=D?": ".concat(D):"",h.truncate-=D.length+5;var R=N(b.map(function(K){return[K,l[K]]}),h,I);return"".concat(P).concat(D).concat(R?" { ".concat(R," }"):"")}function Mc(l,h){var b=t(l,2),P=b[0],D=b[1];return h.truncate-=3,D?"".concat(h.stylize(P,"yellow"),"=").concat(h.stylize('"'.concat(D,'"'),"string")):"".concat(h.stylize(P,"yellow"))}function Rr(l,h){return N(l,h,vo,`
4
- `)}function vo(l,h){var b=l.getAttributeNames(),P=l.tagName.toLowerCase(),D=h.stylize("<".concat(P),"special"),R=h.stylize(">","special"),K=h.stylize("</".concat(P,">"),"special");h.truncate-=P.length*2+5;var Y="";b.length>0&&(Y+=" ",Y+=N(b.map(function(Ee){return[Ee,l.getAttribute(Ee)]}),h,Mc," ")),h.truncate-=Y.length;var he=h.truncate,ue=Rr(l.children,h);return ue&&ue.length>he&&(ue="".concat(d,"(").concat(l.children.length,")")),"".concat(D).concat(Y).concat(R).concat(ue).concat(K)}var Ic=typeof Symbol=="function"&&typeof Symbol.for=="function",ar=Ic?Symbol.for("chai/inspect"):"@@chai/inspect",gt=!1;try{var xo=ke("util");gt=xo.inspect?xo.inspect.custom:!1}catch{gt=!1}function Eo(){this.key="chai/loupe__"+Math.random()+Date.now()}Eo.prototype={get:function(h){return h[this.key]},has:function(h){return this.key in h},set:function(h,b){Object.isExtensible(h)&&Object.defineProperty(h,this.key,{value:b,configurable:!0})}};var cr=new(typeof WeakMap=="function"?WeakMap:Eo),ur={},Ao={undefined:function(h,b){return b.stylize("undefined","undefined")},null:function(h,b){return b.stylize(null,"null")},boolean:function(h,b){return b.stylize(h,"boolean")},Boolean:function(h,b){return b.stylize(h,"boolean")},number:Oe,Number:Oe,bigint:xe,BigInt:xe,string:T,String:T,function:re,Function:re,symbol:v,Symbol:v,Array:q,Date:U,Map:mt,Set:Ur,RegExp:et,Promise:z,WeakSet:function(h,b){return b.stylize("WeakSet{\u2026}","special")},WeakMap:function(h,b){return b.stylize("WeakMap{\u2026}","special")},Arguments:le,Int8Array:C,Uint8Array:C,Uint8ClampedArray:C,Int16Array:C,Uint16Array:C,Int32Array:C,Uint32Array:C,Float32Array:C,Float64Array:C,Generator:function(){return""},DataView:function(){return""},ArrayBuffer:function(){return""},Error:Be,HTMLCollection:Rr,NodeList:Rr},Dc=function(h,b,P){return ar in h&&typeof h[ar]=="function"?h[ar](b):gt&&gt in h&&typeof h[gt]=="function"?h[gt](b.depth,b):"inspect"in h&&typeof h.inspect=="function"?h.inspect(b.depth,b):"constructor"in h&&cr.has(h.constructor)?cr.get(h.constructor)(h,b):ur[P]?ur[P](h,b):""},_c=Object.prototype.toString;function fr(l,h){h=B(h),h.inspect=fr;var b=h,P=b.customInspect,D=l===null?"null":e(l);if(D==="object"&&(D=_c.call(l).slice(8,-1)),Ao[D])return Ao[D](l,h);if(P&&l){var R=Dc(l,h,D);if(R)return typeof R=="string"?R:fr(R,h)}var K=l?Object.getPrototypeOf(l):!1;return K===Object.prototype||K===null?L(l,h):l&&typeof HTMLElement=="function"&&l instanceof HTMLElement?vo(l,h):"constructor"in l?l.constructor!==Object?ie(l,h):L(l,h):l===Object(l)?L(l,h):h.stylize(String(l),D)}function Cc(l,h){return cr.has(l)?!1:(cr.set(l,h),!0)}function jc(l,h){return l in ur?!1:(ur[l]=h,!0)}var qc=ar;r.custom=qc,r.default=fr,r.inspect=fr,r.registerConstructor=Cc,r.registerStringTag=jc,Object.defineProperty(r,"__esModule",{value:!0})})});var nt=O((Vh,$o)=>{$o.exports={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"]}});var dr=O((Wh,Go)=>{var $h=Jr(),eu=Vo(),Wo=nt();Go.exports=tu;function tu(r,e,t,o){var n={colors:o,depth:typeof t>"u"?2:t,showHidden:e,truncate:Wo.truncateThreshold?Wo.truncateThreshold:1/0};return eu.inspect(r,n)}});var Xr=O((Gh,Jo)=>{var ru=dr(),Ko=nt();Jo.exports=function(e){var t=ru(e),o=Object.prototype.toString.call(e);if(Ko.truncateThreshold&&t.length>=Ko.truncateThreshold){if(o==="[object Function]")return!e.name||e.name===""?"[Function]":"[Function: "+e.name+"]";if(o==="[object Array]")return"[ Array("+e.length+") ]";if(o==="[object Object]"){var n=Object.keys(e),i=n.length>2?n.splice(0,2).join(", ")+", ...":n.join(", ");return"{ Object ("+i+") }"}else return t}else return t}});var Qo=O((Kh,Xo)=>{var Qr=Ae(),nu=Kr(),Zr=Xr();Xo.exports=function(e,t){var o=Qr(e,"negate"),n=Qr(e,"object"),i=t[3],s=nu(e,t),a=o?t[2]:t[1],c=Qr(e,"message");return typeof a=="function"&&(a=a()),a=a||"",a=a.replace(/#\{this\}/g,function(){return Zr(n)}).replace(/#\{act\}/g,function(){return Zr(s)}).replace(/#\{exp\}/g,function(){return Zr(i)}),c?c+": "+a:a}});var Ve=O((Jh,Zo)=>{Zo.exports=function(e,t,o){var n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),o=arguments.length===3?o:!0;for(var i in n)(o||i!=="object"&&i!=="ssfi"&&i!=="lockSsfi"&&i!="message")&&(t.__flags[i]=n[i])}});var ui=O((Xh,en)=>{"use strict";var Yo=Lt();function si(){this._key="chai/deep-eql__"+Math.random()+Date.now()}si.prototype={get:function(e){return e[this._key]},set:function(e,t){Object.isExtensible(e)&&Object.defineProperty(e,this._key,{value:t,configurable:!0})}};var Hr=typeof WeakMap=="function"?WeakMap:si;function Ho(r,e,t){if(!t||wt(r)||wt(e))return null;var o=t.get(r);if(o){var n=o.get(e);if(typeof n=="boolean")return n}return null}function pr(r,e,t,o){if(!(!t||wt(r)||wt(e))){var n=t.get(r);n?n.set(e,o):(n=new Hr,n.set(e,o),t.set(r,n))}}en.exports=yr;en.exports.MemoizeMap=Hr;function yr(r,e,t){if(t&&t.comparator)return ei(r,e,t);var o=ai(r,e);return o!==null?o:ei(r,e,t)}function ai(r,e){return r===e?r!==0||1/r===1/e:r!==r&&e!==e?!0:wt(r)||wt(e)?!1:null}function ei(r,e,t){t=t||{},t.memoize=t.memoize===!1?!1:t.memoize||new Hr;var o=t&&t.comparator,n=Ho(r,e,t.memoize);if(n!==null)return n;var i=Ho(e,r,t.memoize);if(i!==null)return i;if(o){var s=o(r,e);if(s===!1||s===!0)return pr(r,e,t.memoize,s),s;var a=ai(r,e);if(a!==null)return a}var c=Yo(r);if(c!==Yo(e))return pr(r,e,t.memoize,!1),!1;pr(r,e,t.memoize,!0);var u=ou(r,e,c,t);return pr(r,e,t.memoize,u),u}function ou(r,e,t,o){switch(t){case"String":case"Number":case"Boolean":case"Date":return yr(r.valueOf(),e.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return r===e;case"Error":return ci(r,e,["name","message","code"],o);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return ot(r,e,o);case"RegExp":return iu(r,e);case"Generator":return su(r,e,o);case"DataView":return ot(new Uint8Array(r.buffer),new Uint8Array(e.buffer),o);case"ArrayBuffer":return ot(new Uint8Array(r),new Uint8Array(e),o);case"Set":return ti(r,e,o);case"Map":return ti(r,e,o);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return r.equals(e);case"Temporal.Duration":return r.total("nanoseconds")===e.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return r.toString()===e.toString();default:return cu(r,e,o)}}function iu(r,e){return r.toString()===e.toString()}function ti(r,e,t){if(r.size!==e.size)return!1;if(r.size===0)return!0;var o=[],n=[];return r.forEach(function(s,a){o.push([s,a])}),e.forEach(function(s,a){n.push([s,a])}),ot(o.sort(),n.sort(),t)}function ot(r,e,t){var o=r.length;if(o!==e.length)return!1;if(o===0)return!0;for(var n=-1;++n<o;)if(yr(r[n],e[n],t)===!1)return!1;return!0}function su(r,e,t){return ot(Yr(r),Yr(e),t)}function au(r){return typeof Symbol<"u"&&typeof r=="object"&&typeof Symbol.iterator<"u"&&typeof r[Symbol.iterator]=="function"}function ri(r){if(au(r))try{return Yr(r[Symbol.iterator]())}catch{return[]}return[]}function Yr(r){for(var e=r.next(),t=[e.value];e.done===!1;)e=r.next(),t.push(e.value);return t}function ni(r){var e=[];for(var t in r)e.push(t);return e}function oi(r){for(var e=[],t=Object.getOwnPropertySymbols(r),o=0;o<t.length;o+=1){var n=t[o];Object.getOwnPropertyDescriptor(r,n).enumerable&&e.push(n)}return e}function ci(r,e,t,o){var n=t.length;if(n===0)return!0;for(var i=0;i<n;i+=1)if(yr(r[t[i]],e[t[i]],o)===!1)return!1;return!0}function cu(r,e,t){var o=ni(r),n=ni(e),i=oi(r),s=oi(e);if(o=o.concat(i),n=n.concat(s),o.length&&o.length===n.length)return ot(ii(o).sort(),ii(n).sort())===!1?!1:ci(r,e,o,t);var a=ri(r),c=ri(e);return a.length&&a.length===c.length?(a.sort(),c.sort(),ot(a,c,t)):o.length===0&&a.length===0&&n.length===0&&c.length===0}function wt(r){return r===null||typeof r!="object"}function ii(r){return r.map(function(t){return typeof t=="symbol"?t.toString():t})}});var Ut=O((Qh,fi)=>{var uu=nt();fi.exports=function(){return uu.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}});var di=O((Zh,hi)=>{var fu=$e(),li=Ae(),lu=Ut(),hu=Ve();hi.exports=function(e,t,o){o=o===void 0?function(){}:o,Object.defineProperty(e,t,{get:function n(){!lu()&&!li(this,"lockSsfi")&&li(this,"ssfi",n);var i=o.call(this);if(i!==void 0)return i;var s=new fu.Assertion;return hu(this,s),s},configurable:!0})}});var Rt=O((Yh,pi)=>{var du=Object.getOwnPropertyDescriptor(function(){},"length");pi.exports=function(e,t,o){return du.configurable&&Object.defineProperty(e,"length",{get:function(){throw Error(o?"Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.':"Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')}}),e}});var mi=O((Hh,yi)=>{yi.exports=function(e){var t=Object.getOwnPropertyNames(e);function o(i){t.indexOf(i)===-1&&t.push(i)}for(var n=Object.getPrototypeOf(e);n!==null;)Object.getOwnPropertyNames(n).forEach(o),n=Object.getPrototypeOf(n);return t}});var zt=O((ed,wi)=>{var pu=nt(),gi=Ae(),yu=mi(),mu=Ut();var bi=["__flags","__methods","_obj","assert"];wi.exports=function(e,t){return mu()?new Proxy(e,{get:function o(n,i){if(typeof i=="string"&&pu.proxyExcludedKeys.indexOf(i)===-1&&!Reflect.has(n,i)){if(t)throw Error("Invalid Chai property: "+t+"."+i+'. See docs for proper usage of "'+t+'".');var s=null,a=4;throw yu(n).forEach(function(c){if(!Object.prototype.hasOwnProperty(c)&&bi.indexOf(c)===-1){var u=gu(i,c,a);u<a&&(s=c,a=u)}}),Error(s!==null?"Invalid Chai property: "+i+'. Did you mean "'+s+'"?':"Invalid Chai property: "+i)}return bi.indexOf(i)===-1&&!gi(n,"lockSsfi")&&gi(n,"ssfi",o),Reflect.get(n,i)}}):e};function gu(r,e,t){if(Math.abs(r.length-e.length)>=t)return t;for(var o=[],n=0;n<=r.length;n++)o[n]=Array(e.length+1).fill(0),o[n][0]=n;for(var i=0;i<e.length;i++)o[0][i]=i;for(var n=1;n<=r.length;n++)for(var s=r.charCodeAt(n-1),i=1;i<=e.length;i++){if(Math.abs(n-i)>=t){o[n][i]=t;continue}o[n][i]=Math.min(o[n-1][i]+1,o[n][i-1]+1,o[n-1][i-1]+(s===e.charCodeAt(i-1)?0:1))}return o[r.length][e.length]}});var Ei=O((td,xi)=>{var bu=Rt(),wu=$e(),vi=Ae(),vu=zt(),xu=Ve();xi.exports=function(e,t,o){var n=function(){vi(this,"lockSsfi")||vi(this,"ssfi",n);var i=o.apply(this,arguments);if(i!==void 0)return i;var s=new wu.Assertion;return xu(this,s),s};bu(n,t,!1),e[t]=vu(n,t)}});var Si=O((rd,Ai)=>{var Eu=$e(),Ft=Ae(),Au=Ut(),Su=Ve();Ai.exports=function(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t),i=function(){};n&&typeof n.get=="function"&&(i=n.get),Object.defineProperty(e,t,{get:function s(){!Au()&&!Ft(this,"lockSsfi")&&Ft(this,"ssfi",s);var a=Ft(this,"lockSsfi");Ft(this,"lockSsfi",!0);var c=o(i).call(this);if(Ft(this,"lockSsfi",a),c!==void 0)return c;var u=new Eu.Assertion;return Su(this,u),u},configurable:!0})}});var Ni=O((nd,Ti)=>{var Tu=Rt(),Nu=$e(),Vt=Ae(),Pu=zt(),Ou=Ve();Ti.exports=function(e,t,o){var n=e[t],i=function(){throw new Error(t+" is not a function")};n&&typeof n=="function"&&(i=n);var s=function(){Vt(this,"lockSsfi")||Vt(this,"ssfi",s);var a=Vt(this,"lockSsfi");Vt(this,"lockSsfi",!0);var c=o(i).apply(this,arguments);if(Vt(this,"lockSsfi",a),c!==void 0)return c;var u=new Nu.Assertion;return Ou(this,u),u};Tu(s,t,!1),e[t]=Pu(s,t)}});var Di=O((od,Ii)=>{var Mu=Rt(),Iu=$e(),Pi=Ae(),Du=zt(),Oi=Ve();var _u=typeof Object.setPrototypeOf=="function",Mi=function(){},Cu=Object.getOwnPropertyNames(Mi).filter(function(r){var e=Object.getOwnPropertyDescriptor(Mi,r);return typeof e!="object"?!0:!e.configurable}),ju=Function.prototype.call,qu=Function.prototype.apply;Ii.exports=function(e,t,o,n){typeof n!="function"&&(n=function(){});var i={method:o,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=i,Object.defineProperty(e,t,{get:function(){i.chainingBehavior.call(this);var a=function(){Pi(this,"lockSsfi")||Pi(this,"ssfi",a);var d=i.method.apply(this,arguments);if(d!==void 0)return d;var E=new Iu.Assertion;return Oi(this,E),E};if(Mu(a,t,!0),_u){var c=Object.create(this);c.call=ju,c.apply=qu,Object.setPrototypeOf(a,c)}else{var u=Object.getOwnPropertyNames(e);u.forEach(function(d){if(Cu.indexOf(d)===-1){var E=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(a,d,E)}})}return Oi(this,a),Du(a)},configurable:!0})}});var qi=O((id,ji)=>{var _i=$e(),Ci=Ve();ji.exports=function(e,t,o,n){var i=e.__methods[t],s=i.chainingBehavior;i.chainingBehavior=function(){var u=n(s).call(this);if(u!==void 0)return u;var d=new _i.Assertion;return Ci(this,d),d};var a=i.method;i.method=function(){var u=o(a).apply(this,arguments);if(u!==void 0)return u;var d=new _i.Assertion;return Ci(this,d),d}}});var Li=O((sd,ki)=>{var Bi=dr();ki.exports=function(e,t){return Bi(e)<Bi(t)?-1:1}});var tn=O((ad,Ui)=>{Ui.exports=function(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}});var zi=O((cd,Ri)=>{var Bu=tn();Ri.exports=function(e){return Object.keys(e).concat(Bu(e))}});var nn=O((ud,Fi)=>{"use strict";function ku(r,e){return e instanceof Error&&r===e}function Lu(r,e){return e instanceof Error?r.constructor===e.constructor||r instanceof e.constructor:e.prototype instanceof Error||e===Error?r.constructor===e||r instanceof e:!1}function Uu(r,e){var t=typeof r=="string"?r:r.message;return e instanceof RegExp?e.test(t):typeof e=="string"?t.indexOf(e)!==-1:!1}var Ru=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/;function rn(r){var e="";if(typeof r.name>"u"){var t=String(r).match(Ru);t&&(e=t[1])}else e=r.name;return e}function zu(r){var e=r;return r instanceof Error?e=rn(r.constructor):typeof r=="function"&&(e=rn(r).trim()||rn(new r)),e}function Fu(r){var e="";return r&&r.message?e=r.message:typeof r=="string"&&(e=r),e}Fi.exports={compatibleInstance:ku,compatibleConstructor:Lu,compatibleMessage:Uu,getMessage:Fu,getConstructorName:zu}});var $i=O((fd,Vi)=>{function Vu(r){return r!==r}Vi.exports=Number.isNaN||Vu});var Ki=O((ld,Gi)=>{var $u=Lt(),Wi=Ae();function Wu(r){var e=$u(r),t=["Array","Object","function"];return t.indexOf(e)!==-1}Gi.exports=function(e,t){var o=Wi(e,"operator"),n=Wi(e,"negate"),i=t[3],s=n?t[2]:t[1];if(o)return o;if(typeof s=="function"&&(s=s()),s=s||"",!!s&&!/\shave\s/.test(s)){var a=Wu(i);return/\snot\s/.test(s)?a?"notDeepStrictEqual":"notStrictEqual":a?"deepStrictEqual":"strictEqual"}}});var Xi=O(J=>{var Ji=jo();J.test=ko();J.type=Lt();J.expectTypes=Uo();J.getMessage=Qo();J.getActual=Kr();J.inspect=dr();J.objDisplay=Xr();J.flag=Ae();J.transferFlags=Ve();J.eql=ui();J.getPathInfo=Ji.getPathInfo;J.hasProperty=Ji.hasProperty;J.getName=Jr();J.addProperty=di();J.addMethod=Ei();J.overwriteProperty=Si();J.overwriteMethod=Ni();J.addChainableMethod=Di();J.overwriteChainableMethod=qi();J.compareByInspect=Li();J.getOwnEnumerablePropertySymbols=tn();J.getOwnEnumerableProperties=zi();J.checkError=nn();J.proxify=zt();J.addLengthGuard=Rt();J.isProxyEnabled=Ut();J.isNaN=$i();J.getOperator=Ki()});var Zi=O((dd,Qi)=>{var vt=nt();Qi.exports=function(r,e){var t=r.AssertionError,o=e.flag;r.Assertion=n;function n(i,s,a,c){return o(this,"ssfi",a||n),o(this,"lockSsfi",c),o(this,"object",i),o(this,"message",s),e.proxify(this)}Object.defineProperty(n,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),vt.includeStack},set:function(i){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),vt.includeStack=i}}),Object.defineProperty(n,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),vt.showDiff},set:function(i){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),vt.showDiff=i}}),n.addProperty=function(i,s){e.addProperty(this.prototype,i,s)},n.addMethod=function(i,s){e.addMethod(this.prototype,i,s)},n.addChainableMethod=function(i,s,a){e.addChainableMethod(this.prototype,i,s,a)},n.overwriteProperty=function(i,s){e.overwriteProperty(this.prototype,i,s)},n.overwriteMethod=function(i,s){e.overwriteMethod(this.prototype,i,s)},n.overwriteChainableMethod=function(i,s,a){e.overwriteChainableMethod(this.prototype,i,s,a)},n.prototype.assert=function(i,s,a,c,u,d){var E=e.test(this,arguments);if(d!==!1&&(d=!0),c===void 0&&u===void 0&&(d=!1),vt.showDiff!==!0&&(d=!1),!E){s=e.getMessage(this,arguments);var B=e.getActual(this,arguments),k={actual:B,expected:c,showDiff:d},N=e.getOperator(this,arguments);throw N&&(k.operator=N),new t(s,k,vt.includeStack?this.assert:o(this,"ssfi"))}};Object.defineProperty(n.prototype,"_obj",{get:function(){return o(this,"object")},set:function(i){o(this,"object",i)}})}});var Hi=O((pd,Yi)=>{Yi.exports=function(r,e){var t=r.Assertion,o=r.AssertionError,n=e.flag;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(f){t.addProperty(f)}),t.addProperty("not",function(){n(this,"negate",!0)}),t.addProperty("deep",function(){n(this,"deep",!0)}),t.addProperty("nested",function(){n(this,"nested",!0)}),t.addProperty("own",function(){n(this,"own",!0)}),t.addProperty("ordered",function(){n(this,"ordered",!0)}),t.addProperty("any",function(){n(this,"any",!0),n(this,"all",!1)}),t.addProperty("all",function(){n(this,"all",!0),n(this,"any",!1)});function i(f,p){p&&n(this,"message",p),f=f.toLowerCase();var g=n(this,"object"),w=~["a","e","i","o","u"].indexOf(f.charAt(0))?"an ":"a ";this.assert(f===e.type(g).toLowerCase(),"expected #{this} to be "+w+f,"expected #{this} not to be "+w+f)}t.addChainableMethod("an",i),t.addChainableMethod("a",i);function s(f,p){return e.isNaN(f)&&e.isNaN(p)||f===p}function a(){n(this,"contains",!0)}function c(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=e.type(g).toLowerCase(),A=n(this,"message"),T=n(this,"negate"),v=n(this,"ssfi"),m=n(this,"deep"),M=m?"deep ":"";A=A?A+": ":"";var j=!1;switch(w){case"string":j=g.indexOf(f)!==-1;break;case"weakset":if(m)throw new o(A+"unable to use .deep.include with WeakSet",void 0,v);j=g.has(f);break;case"map":var F=m?e.eql:s;g.forEach(function(G){j=j||F(G,f)});break;case"set":m?g.forEach(function(G){j=j||e.eql(G,f)}):j=g.has(f);break;case"array":m?j=g.some(function(G){return e.eql(G,f)}):j=g.indexOf(f)!==-1;break;default:if(f!==Object(f))throw new o(A+"the given combination of arguments ("+w+" and "+e.type(f).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+e.type(f).toLowerCase(),void 0,v);var X=Object.keys(f),z=null,L=0;if(X.forEach(function(G){var ie=new t(g);if(e.transferFlags(this,ie,!0),n(ie,"lockSsfi",!0),!T||X.length===1){ie.property(G,f[G]);return}try{ie.property(G,f[G])}catch(le){if(!e.checkError.compatibleConstructor(le,o))throw le;z===null&&(z=le),L++}},this),T&&X.length>1&&L===X.length)throw z;return}this.assert(j,"expected #{this} to "+M+"include "+e.inspect(f),"expected #{this} to not "+M+"include "+e.inspect(f))}t.addChainableMethod("include",c,a),t.addChainableMethod("contain",c,a),t.addChainableMethod("contains",c,a),t.addChainableMethod("includes",c,a),t.addProperty("ok",function(){this.assert(n(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),t.addProperty("true",function(){this.assert(n(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!n(this,"negate"))}),t.addProperty("false",function(){this.assert(n(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!n(this,"negate"))}),t.addProperty("null",function(){this.assert(n(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")}),t.addProperty("undefined",function(){this.assert(n(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")}),t.addProperty("NaN",function(){this.assert(e.isNaN(n(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function u(){var f=n(this,"object");this.assert(f!=null,"expected #{this} to exist","expected #{this} to not exist")}t.addProperty("exist",u),t.addProperty("exists",u),t.addProperty("empty",function(){var f=n(this,"object"),p=n(this,"ssfi"),g=n(this,"message"),w;switch(g=g?g+": ":"",e.type(f).toLowerCase()){case"array":case"string":w=f.length;break;case"map":case"set":w=f.size;break;case"weakmap":case"weakset":throw new o(g+".empty was passed a weak collection",void 0,p);case"function":var A=g+".empty was passed a function "+e.getName(f);throw new o(A.trim(),void 0,p);default:if(f!==Object(f))throw new o(g+".empty was passed non-string primitive "+e.inspect(f),void 0,p);w=Object.keys(f).length}this.assert(w===0,"expected #{this} to be empty","expected #{this} not to be empty")});function d(){var f=n(this,"object"),p=e.type(f);this.assert(p==="Arguments","expected #{this} to be arguments but got "+p,"expected #{this} to not be arguments")}t.addProperty("arguments",d),t.addProperty("Arguments",d);function E(f,p){p&&n(this,"message",p);var g=n(this,"object");if(n(this,"deep")){var w=n(this,"lockSsfi");n(this,"lockSsfi",!0),this.eql(f),n(this,"lockSsfi",w)}else this.assert(f===g,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",f,this._obj,!0)}t.addMethod("equal",E),t.addMethod("equals",E),t.addMethod("eq",E);function B(f,p){p&&n(this,"message",p),this.assert(e.eql(f,n(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",f,this._obj,!0)}t.addMethod("eql",B),t.addMethod("eqls",B);function k(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",v=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(w&&m!=="map"&&m!=="set"&&new t(g,A,v,!0).to.have.property("length"),!w&&m==="date"&&M!=="date")j=T+"the argument to above must be a date";else if(M!=="number"&&(w||m==="number"))j=T+"the argument to above must be a number";else if(!w&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,v);if(w){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L>f,"expected #{this} to have a "+z+" above #{exp} but got #{act}","expected #{this} to not have a "+z+" above #{exp}",f,L)}else this.assert(g>f,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",f)}t.addMethod("above",k),t.addMethod("gt",k),t.addMethod("greaterThan",k);function N(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",v=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(w&&m!=="map"&&m!=="set"&&new t(g,A,v,!0).to.have.property("length"),!w&&m==="date"&&M!=="date")j=T+"the argument to least must be a date";else if(M!=="number"&&(w||m==="number"))j=T+"the argument to least must be a number";else if(!w&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,v);if(w){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L>=f,"expected #{this} to have a "+z+" at least #{exp} but got #{act}","expected #{this} to have a "+z+" below #{exp}",f,L)}else this.assert(g>=f,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",f)}t.addMethod("least",N),t.addMethod("gte",N),t.addMethod("greaterThanOrEqual",N);function x(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",v=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(w&&m!=="map"&&m!=="set"&&new t(g,A,v,!0).to.have.property("length"),!w&&m==="date"&&M!=="date")j=T+"the argument to below must be a date";else if(M!=="number"&&(w||m==="number"))j=T+"the argument to below must be a number";else if(!w&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,v);if(w){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L<f,"expected #{this} to have a "+z+" below #{exp} but got #{act}","expected #{this} to not have a "+z+" below #{exp}",f,L)}else this.assert(g<f,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",f)}t.addMethod("below",x),t.addMethod("lt",x),t.addMethod("lessThan",x);function I(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",v=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(w&&m!=="map"&&m!=="set"&&new t(g,A,v,!0).to.have.property("length"),!w&&m==="date"&&M!=="date")j=T+"the argument to most must be a date";else if(M!=="number"&&(w||m==="number"))j=T+"the argument to most must be a number";else if(!w&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,v);if(w){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L<=f,"expected #{this} to have a "+z+" at most #{exp} but got #{act}","expected #{this} to have a "+z+" above #{exp}",f,L)}else this.assert(g<=f,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",f)}t.addMethod("most",I),t.addMethod("lte",I),t.addMethod("lessThanOrEqual",I),t.addMethod("within",function(f,p,g){g&&n(this,"message",g);var w=n(this,"object"),A=n(this,"doLength"),T=n(this,"message"),v=T?T+": ":"",m=n(this,"ssfi"),M=e.type(w).toLowerCase(),j=e.type(f).toLowerCase(),F=e.type(p).toLowerCase(),X,z=!0,L=j==="date"&&F==="date"?f.toISOString()+".."+p.toISOString():f+".."+p;if(A&&M!=="map"&&M!=="set"&&new t(w,T,m,!0).to.have.property("length"),!A&&M==="date"&&(j!=="date"||F!=="date"))X=v+"the arguments to within must be dates";else if((j!=="number"||F!=="number")&&(A||M==="number"))X=v+"the arguments to within must be numbers";else if(!A&&M!=="date"&&M!=="number"){var G=M==="string"?"'"+w+"'":w;X=v+"expected "+G+" to be a number or a date"}else z=!1;if(z)throw new o(X,void 0,m);if(A){var ie="length",le;M==="map"||M==="set"?(ie="size",le=w.size):le=w.length,this.assert(le>=f&&le<=p,"expected #{this} to have a "+ie+" within "+L,"expected #{this} to not have a "+ie+" within "+L)}else this.assert(w>=f&&w<=p,"expected #{this} to be within "+L,"expected #{this} to not be within "+L)});function q(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"ssfi"),A=n(this,"message");try{var T=g instanceof f}catch(m){throw m instanceof TypeError?(A=A?A+": ":"",new o(A+"The instanceof assertion needs a constructor but "+e.type(f)+" was given.",void 0,w)):m}var v=e.getName(f);v===null&&(v="an unnamed constructor"),this.assert(T,"expected #{this} to be an instance of "+v,"expected #{this} to not be an instance of "+v)}t.addMethod("instanceof",q),t.addMethod("instanceOf",q);function $(f,p,g){g&&n(this,"message",g);var w=n(this,"nested"),A=n(this,"own"),T=n(this,"message"),v=n(this,"object"),m=n(this,"ssfi"),M=typeof f;if(T=T?T+": ":"",w){if(M!=="string")throw new o(T+"the argument to property must be a string when using nested syntax",void 0,m)}else if(M!=="string"&&M!=="number"&&M!=="symbol")throw new o(T+"the argument to property must be a string, number, or symbol",void 0,m);if(w&&A)throw new o(T+'The "nested" and "own" flags cannot be combined.',void 0,m);if(v==null)throw new o(T+"Target cannot be null or undefined.",void 0,m);var j=n(this,"deep"),F=n(this,"negate"),X=w?e.getPathInfo(v,f):null,z=w?X.value:v[f],L="";j&&(L+="deep "),A&&(L+="own "),w&&(L+="nested "),L+="property ";var G;A?G=Object.prototype.hasOwnProperty.call(v,f):w?G=X.exists:G=e.hasProperty(v,f),(!F||arguments.length===1)&&this.assert(G,"expected #{this} to have "+L+e.inspect(f),"expected #{this} to not have "+L+e.inspect(f)),arguments.length>1&&this.assert(G&&(j?e.eql(p,z):p===z),"expected #{this} to have "+L+e.inspect(f)+" of #{exp}, but got #{act}","expected #{this} to not have "+L+e.inspect(f)+" of #{act}",p,z),n(this,"object",z)}t.addMethod("property",$);function Q(f,p,g){n(this,"own",!0),$.apply(this,arguments)}t.addMethod("ownProperty",Q),t.addMethod("haveOwnProperty",Q);function te(f,p,g){typeof p=="string"&&(g=p,p=null),g&&n(this,"message",g);var w=n(this,"object"),A=Object.getOwnPropertyDescriptor(Object(w),f);A&&p?this.assert(e.eql(p,A),"expected the own property descriptor for "+e.inspect(f)+" on #{this} to match "+e.inspect(p)+", got "+e.inspect(A),"expected the own property descriptor for "+e.inspect(f)+" on #{this} to not match "+e.inspect(p),p,A,!0):this.assert(A,"expected #{this} to have an own property descriptor for "+e.inspect(f),"expected #{this} to not have an own property descriptor for "+e.inspect(f)),n(this,"object",A)}t.addMethod("ownPropertyDescriptor",te),t.addMethod("haveOwnPropertyDescriptor",te);function y(){n(this,"doLength",!0)}function S(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=e.type(g).toLowerCase(),A=n(this,"message"),T=n(this,"ssfi"),v="length",m;switch(w){case"map":case"set":v="size",m=g.size;break;default:new t(g,A,T,!0).to.have.property("length"),m=g.length}this.assert(m==f,"expected #{this} to have a "+v+" of #{exp} but got #{act}","expected #{this} to not have a "+v+" of #{act}",f,m)}t.addChainableMethod("length",S,y),t.addChainableMethod("lengthOf",S,y);function C(f,p){p&&n(this,"message",p);var g=n(this,"object");this.assert(f.exec(g),"expected #{this} to match "+f,"expected #{this} not to match "+f)}t.addMethod("match",C),t.addMethod("matches",C),t.addMethod("string",function(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"message"),A=n(this,"ssfi");new t(g,w,A,!0).is.a("string"),this.assert(~g.indexOf(f),"expected #{this} to contain "+e.inspect(f),"expected #{this} to not contain "+e.inspect(f))});function U(f){var p=n(this,"object"),g=e.type(p),w=e.type(f),A=n(this,"ssfi"),T=n(this,"deep"),v,m="",M,j=!0,F=n(this,"message");F=F?F+": ":"";var X=F+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(g==="Map"||g==="Set")m=T?"deeply ":"",M=[],p.forEach(function(ce,Be){M.push(Be)}),w!=="Array"&&(f=Array.prototype.slice.call(arguments));else{switch(M=e.getOwnEnumerableProperties(p),w){case"Array":if(arguments.length>1)throw new o(X,void 0,A);break;case"Object":if(arguments.length>1)throw new o(X,void 0,A);f=Object.keys(f);break;default:f=Array.prototype.slice.call(arguments)}f=f.map(function(ce){return typeof ce=="symbol"?ce:String(ce)})}if(!f.length)throw new o(F+"keys required",void 0,A);var z=f.length,L=n(this,"any"),G=n(this,"all"),ie=f;if(!L&&!G&&(G=!0),L&&(j=ie.some(function(ce){return M.some(function(Be){return T?e.eql(ce,Be):ce===Be})})),G&&(j=ie.every(function(ce){return M.some(function(Be){return T?e.eql(ce,Be):ce===Be})}),n(this,"contains")||(j=j&&f.length==M.length)),z>1){f=f.map(function(ce){return e.inspect(ce)});var le=f.pop();G&&(v=f.join(", ")+", and "+le),L&&(v=f.join(", ")+", or "+le)}else v=e.inspect(f[0]);v=(z>1?"keys ":"key ")+v,v=(n(this,"contains")?"contain ":"have ")+v,this.assert(j,"expected #{this} to "+m+v,"expected #{this} to not "+m+v,ie.slice(0).sort(e.compareByInspect),M.sort(e.compareByInspect),!0)}t.addMethod("keys",U),t.addMethod("key",U);function re(f,p,g){g&&n(this,"message",g);var w=n(this,"object"),A=n(this,"ssfi"),T=n(this,"message"),v=n(this,"negate")||!1;new t(w,T,A,!0).is.a("function"),(f instanceof RegExp||typeof f=="string")&&(p=f,f=null);var m;try{w()}catch(ce){m=ce}var M=f===void 0&&p===void 0,j=Boolean(f&&p),F=!1,X=!1;if(M||!M&&!v){var z="an error";f instanceof Error?z="#{exp}":f&&(z=e.checkError.getConstructorName(f)),this.assert(m,"expected #{this} to throw "+z,"expected #{this} to not throw an error but #{act} was thrown",f&&f.toString(),m instanceof Error?m.toString():typeof m=="string"?m:m&&e.checkError.getConstructorName(m))}if(f&&m){if(f instanceof Error){var L=e.checkError.compatibleInstance(m,f);L===v&&(j&&v?F=!0:this.assert(v,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(m&&!v?" but #{act} was thrown":""),f.toString(),m.toString()))}var G=e.checkError.compatibleConstructor(m,f);G===v&&(j&&v?F=!0:this.assert(v,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(m?" but #{act} was thrown":""),f instanceof Error?f.toString():f&&e.checkError.getConstructorName(f),m instanceof Error?m.toString():m&&e.checkError.getConstructorName(m)))}if(m&&p!==void 0&&p!==null){var ie="including";p instanceof RegExp&&(ie="matching");var le=e.checkError.compatibleMessage(m,p);le===v&&(j&&v?X=!0:this.assert(v,"expected #{this} to throw error "+ie+" #{exp} but got #{act}","expected #{this} to throw error not "+ie+" #{exp}",p,e.checkError.getMessage(m)))}F&&X&&this.assert(v,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(m?" but #{act} was thrown":""),f instanceof Error?f.toString():f&&e.checkError.getConstructorName(f),m instanceof Error?m.toString():m&&e.checkError.getConstructorName(m)),n(this,"object",m)}t.addMethod("throw",re),t.addMethod("throws",re),t.addMethod("Throw",re);function De(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"itself"),A=typeof g=="function"&&!w?g.prototype[f]:g[f];this.assert(typeof A=="function","expected #{this} to respond to "+e.inspect(f),"expected #{this} to not respond to "+e.inspect(f))}t.addMethod("respondTo",De),t.addMethod("respondsTo",De),t.addProperty("itself",function(){n(this,"itself",!0)});function fe(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=f(g);this.assert(w,"expected #{this} to satisfy "+e.objDisplay(f),"expected #{this} to not satisfy"+e.objDisplay(f),!n(this,"negate"),w)}t.addMethod("satisfy",fe),t.addMethod("satisfies",fe);function mt(f,p,g){g&&n(this,"message",g);var w=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");if(new t(w,A,T,!0).is.a("number"),typeof f!="number"||typeof p!="number"){A=A?A+": ":"";var v=p===void 0?", and a delta is required":"";throw new o(A+"the arguments to closeTo or approximately must be numbers"+v,void 0,T)}this.assert(Math.abs(w-f)<=p,"expected #{this} to be close to "+f+" +/- "+p,"expected #{this} not to be close to "+f+" +/- "+p)}t.addMethod("closeTo",mt),t.addMethod("approximately",mt);function ge(f,p,g,w,A){if(!w){if(f.length!==p.length)return!1;p=p.slice()}return f.every(function(T,v){if(A)return g?g(T,p[v]):T===p[v];if(!g){var m=p.indexOf(T);return m===-1?!1:(w||p.splice(m,1),!0)}return p.some(function(M,j){return g(T,M)?(w||p.splice(j,1),!0):!1})})}t.addMethod("members",function(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"message"),A=n(this,"ssfi");new t(g,w,A,!0).to.be.an("array"),new t(f,w,A,!0).to.be.an("array");var T=n(this,"contains"),v=n(this,"ordered"),m,M,j;T?(m=v?"an ordered superset":"a superset",M="expected #{this} to be "+m+" of #{exp}",j="expected #{this} to not be "+m+" of #{exp}"):(m=v?"ordered members":"members",M="expected #{this} to have the same "+m+" as #{exp}",j="expected #{this} to not have the same "+m+" as #{exp}");var F=n(this,"deep")?e.eql:void 0;this.assert(ge(f,g,F,T,v),M,j,f,g,!0)});function Oe(f,p){p&&n(this,"message",p);var g=n(this,"object"),w=n(this,"message"),A=n(this,"ssfi"),T=n(this,"contains"),v=n(this,"deep");new t(f,w,A,!0).to.be.an("array"),T?this.assert(f.some(function(m){return g.indexOf(m)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",f,g):v?this.assert(f.some(function(m){return e.eql(g,m)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",f,g):this.assert(f.indexOf(g)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",f,g)}t.addMethod("oneOf",Oe);function xe(f,p,g){g&&n(this,"message",g);var w=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");new t(w,A,T,!0).is.a("function");var v;p?(new t(f,A,T,!0).to.have.property(p),v=f[p]):(new t(f,A,T,!0).is.a("function"),v=f()),w();var m=p==null?f():f[p],M=p==null?v:"."+p;n(this,"deltaMsgObj",M),n(this,"initialDeltaValue",v),n(this,"finalDeltaValue",m),n(this,"deltaBehavior","change"),n(this,"realDelta",m!==v),this.assert(v!==m,"expected "+M+" to change","expected "+M+" to not change")}t.addMethod("change",xe),t.addMethod("changes",xe);function et(f,p,g){g&&n(this,"message",g);var w=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");new t(w,A,T,!0).is.a("function");var v;p?(new t(f,A,T,!0).to.have.property(p),v=f[p]):(new t(f,A,T,!0).is.a("function"),v=f()),new t(v,A,T,!0).is.a("number"),w();var m=p==null?f():f[p],M=p==null?v:"."+p;n(this,"deltaMsgObj",M),n(this,"initialDeltaValue",v),n(this,"finalDeltaValue",m),n(this,"deltaBehavior","increase"),n(this,"realDelta",m-v),this.assert(m-v>0,"expected "+M+" to increase","expected "+M+" to not increase")}t.addMethod("increase",et),t.addMethod("increases",et);function sr(f,p,g){g&&n(this,"message",g);var w=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");new t(w,A,T,!0).is.a("function");var v;p?(new t(f,A,T,!0).to.have.property(p),v=f[p]):(new t(f,A,T,!0).is.a("function"),v=f()),new t(v,A,T,!0).is.a("number"),w();var m=p==null?f():f[p],M=p==null?v:"."+p;n(this,"deltaMsgObj",M),n(this,"initialDeltaValue",v),n(this,"finalDeltaValue",m),n(this,"deltaBehavior","decrease"),n(this,"realDelta",v-m),this.assert(m-v<0,"expected "+M+" to decrease","expected "+M+" to not decrease")}t.addMethod("decrease",sr),t.addMethod("decreases",sr);function Ur(f,p){p&&n(this,"message",p);var g=n(this,"deltaMsgObj"),w=n(this,"initialDeltaValue"),A=n(this,"finalDeltaValue"),T=n(this,"deltaBehavior"),v=n(this,"realDelta"),m;T==="change"?m=Math.abs(A-w)===Math.abs(f):m=v===Math.abs(f),this.assert(m,"expected "+g+" to "+T+" by "+f,"expected "+g+" to not "+T+" by "+f)}t.addMethod("by",Ur),t.addProperty("extensible",function(){var f=n(this,"object"),p=f===Object(f)&&Object.isExtensible(f);this.assert(p,"expected #{this} to be extensible","expected #{this} to not be extensible")}),t.addProperty("sealed",function(){var f=n(this,"object"),p=f===Object(f)?Object.isSealed(f):!0;this.assert(p,"expected #{this} to be sealed","expected #{this} to not be sealed")}),t.addProperty("frozen",function(){var f=n(this,"object"),p=f===Object(f)?Object.isFrozen(f):!0;this.assert(p,"expected #{this} to be frozen","expected #{this} to not be frozen")}),t.addProperty("finite",function(f){var p=n(this,"object");this.assert(typeof p=="number"&&isFinite(p),"expected #{this} to be a finite number","expected #{this} to not be a finite number")})}});var ts=O((yd,es)=>{es.exports=function(r,e){r.expect=function(t,o){return new r.Assertion(t,o)},r.expect.fail=function(t,o,n,i){throw arguments.length<2&&(n=t,t=void 0),n=n||"expect.fail()",new r.AssertionError(n,{actual:t,expected:o,operator:i},r.expect.fail)}}});var ns=O((md,rs)=>{rs.exports=function(r,e){var t=r.Assertion;function o(){function n(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new t(this.valueOf(),null,n):new t(this,null,n)}function i(a){Object.defineProperty(this,"should",{value:a,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,"should",{set:i,get:n,configurable:!0});var s={};return s.fail=function(a,c,u,d){throw arguments.length<2&&(u=a,a=void 0),u=u||"should.fail()",new r.AssertionError(u,{actual:a,expected:c,operator:d},s.fail)},s.equal=function(a,c,u){new t(a,u).to.equal(c)},s.Throw=function(a,c,u,d){new t(a,d).to.Throw(c,u)},s.exist=function(a,c){new t(a,c).to.exist},s.not={},s.not.equal=function(a,c,u){new t(a,u).to.not.equal(c)},s.not.Throw=function(a,c,u,d){new t(a,d).to.not.Throw(c,u)},s.not.exist=function(a,c){new t(a,c).to.not.exist},s.throw=s.Throw,s.not.throw=s.not.Throw,s}r.should=o,r.Should=o}});var is=O((gd,os)=>{os.exports=function(r,e){var t=r.Assertion,o=e.flag;var n=r.assert=function(i,s){var a=new t(null,null,r.assert,!0);a.assert(i,s,"[ negation message unavailable ]")};n.fail=function(i,s,a,c){throw arguments.length<2&&(a=i,i=void 0),a=a||"assert.fail()",new r.AssertionError(a,{actual:i,expected:s,operator:c},n.fail)},n.isOk=function(i,s){new t(i,s,n.isOk,!0).is.ok},n.isNotOk=function(i,s){new t(i,s,n.isNotOk,!0).is.not.ok},n.equal=function(i,s,a){var c=new t(i,a,n.equal,!0);c.assert(s==o(c,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",s,i,!0)},n.notEqual=function(i,s,a){var c=new t(i,a,n.notEqual,!0);c.assert(s!=o(c,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",s,i,!0)},n.strictEqual=function(i,s,a){new t(i,a,n.strictEqual,!0).to.equal(s)},n.notStrictEqual=function(i,s,a){new t(i,a,n.notStrictEqual,!0).to.not.equal(s)},n.deepEqual=n.deepStrictEqual=function(i,s,a){new t(i,a,n.deepEqual,!0).to.eql(s)},n.notDeepEqual=function(i,s,a){new t(i,a,n.notDeepEqual,!0).to.not.eql(s)},n.isAbove=function(i,s,a){new t(i,a,n.isAbove,!0).to.be.above(s)},n.isAtLeast=function(i,s,a){new t(i,a,n.isAtLeast,!0).to.be.least(s)},n.isBelow=function(i,s,a){new t(i,a,n.isBelow,!0).to.be.below(s)},n.isAtMost=function(i,s,a){new t(i,a,n.isAtMost,!0).to.be.most(s)},n.isTrue=function(i,s){new t(i,s,n.isTrue,!0).is.true},n.isNotTrue=function(i,s){new t(i,s,n.isNotTrue,!0).to.not.equal(!0)},n.isFalse=function(i,s){new t(i,s,n.isFalse,!0).is.false},n.isNotFalse=function(i,s){new t(i,s,n.isNotFalse,!0).to.not.equal(!1)},n.isNull=function(i,s){new t(i,s,n.isNull,!0).to.equal(null)},n.isNotNull=function(i,s){new t(i,s,n.isNotNull,!0).to.not.equal(null)},n.isNaN=function(i,s){new t(i,s,n.isNaN,!0).to.be.NaN},n.isNotNaN=function(i,s){new t(i,s,n.isNotNaN,!0).not.to.be.NaN},n.exists=function(i,s){new t(i,s,n.exists,!0).to.exist},n.notExists=function(i,s){new t(i,s,n.notExists,!0).to.not.exist},n.isUndefined=function(i,s){new t(i,s,n.isUndefined,!0).to.equal(void 0)},n.isDefined=function(i,s){new t(i,s,n.isDefined,!0).to.not.equal(void 0)},n.isFunction=function(i,s){new t(i,s,n.isFunction,!0).to.be.a("function")},n.isNotFunction=function(i,s){new t(i,s,n.isNotFunction,!0).to.not.be.a("function")},n.isObject=function(i,s){new t(i,s,n.isObject,!0).to.be.a("object")},n.isNotObject=function(i,s){new t(i,s,n.isNotObject,!0).to.not.be.a("object")},n.isArray=function(i,s){new t(i,s,n.isArray,!0).to.be.an("array")},n.isNotArray=function(i,s){new t(i,s,n.isNotArray,!0).to.not.be.an("array")},n.isString=function(i,s){new t(i,s,n.isString,!0).to.be.a("string")},n.isNotString=function(i,s){new t(i,s,n.isNotString,!0).to.not.be.a("string")},n.isNumber=function(i,s){new t(i,s,n.isNumber,!0).to.be.a("number")},n.isNotNumber=function(i,s){new t(i,s,n.isNotNumber,!0).to.not.be.a("number")},n.isFinite=function(i,s){new t(i,s,n.isFinite,!0).to.be.finite},n.isBoolean=function(i,s){new t(i,s,n.isBoolean,!0).to.be.a("boolean")},n.isNotBoolean=function(i,s){new t(i,s,n.isNotBoolean,!0).to.not.be.a("boolean")},n.typeOf=function(i,s,a){new t(i,a,n.typeOf,!0).to.be.a(s)},n.notTypeOf=function(i,s,a){new t(i,a,n.notTypeOf,!0).to.not.be.a(s)},n.instanceOf=function(i,s,a){new t(i,a,n.instanceOf,!0).to.be.instanceOf(s)},n.notInstanceOf=function(i,s,a){new t(i,a,n.notInstanceOf,!0).to.not.be.instanceOf(s)},n.include=function(i,s,a){new t(i,a,n.include,!0).include(s)},n.notInclude=function(i,s,a){new t(i,a,n.notInclude,!0).not.include(s)},n.deepInclude=function(i,s,a){new t(i,a,n.deepInclude,!0).deep.include(s)},n.notDeepInclude=function(i,s,a){new t(i,a,n.notDeepInclude,!0).not.deep.include(s)},n.nestedInclude=function(i,s,a){new t(i,a,n.nestedInclude,!0).nested.include(s)},n.notNestedInclude=function(i,s,a){new t(i,a,n.notNestedInclude,!0).not.nested.include(s)},n.deepNestedInclude=function(i,s,a){new t(i,a,n.deepNestedInclude,!0).deep.nested.include(s)},n.notDeepNestedInclude=function(i,s,a){new t(i,a,n.notDeepNestedInclude,!0).not.deep.nested.include(s)},n.ownInclude=function(i,s,a){new t(i,a,n.ownInclude,!0).own.include(s)},n.notOwnInclude=function(i,s,a){new t(i,a,n.notOwnInclude,!0).not.own.include(s)},n.deepOwnInclude=function(i,s,a){new t(i,a,n.deepOwnInclude,!0).deep.own.include(s)},n.notDeepOwnInclude=function(i,s,a){new t(i,a,n.notDeepOwnInclude,!0).not.deep.own.include(s)},n.match=function(i,s,a){new t(i,a,n.match,!0).to.match(s)},n.notMatch=function(i,s,a){new t(i,a,n.notMatch,!0).to.not.match(s)},n.property=function(i,s,a){new t(i,a,n.property,!0).to.have.property(s)},n.notProperty=function(i,s,a){new t(i,a,n.notProperty,!0).to.not.have.property(s)},n.propertyVal=function(i,s,a,c){new t(i,c,n.propertyVal,!0).to.have.property(s,a)},n.notPropertyVal=function(i,s,a,c){new t(i,c,n.notPropertyVal,!0).to.not.have.property(s,a)},n.deepPropertyVal=function(i,s,a,c){new t(i,c,n.deepPropertyVal,!0).to.have.deep.property(s,a)},n.notDeepPropertyVal=function(i,s,a,c){new t(i,c,n.notDeepPropertyVal,!0).to.not.have.deep.property(s,a)},n.ownProperty=function(i,s,a){new t(i,a,n.ownProperty,!0).to.have.own.property(s)},n.notOwnProperty=function(i,s,a){new t(i,a,n.notOwnProperty,!0).to.not.have.own.property(s)},n.ownPropertyVal=function(i,s,a,c){new t(i,c,n.ownPropertyVal,!0).to.have.own.property(s,a)},n.notOwnPropertyVal=function(i,s,a,c){new t(i,c,n.notOwnPropertyVal,!0).to.not.have.own.property(s,a)},n.deepOwnPropertyVal=function(i,s,a,c){new t(i,c,n.deepOwnPropertyVal,!0).to.have.deep.own.property(s,a)},n.notDeepOwnPropertyVal=function(i,s,a,c){new t(i,c,n.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(s,a)},n.nestedProperty=function(i,s,a){new t(i,a,n.nestedProperty,!0).to.have.nested.property(s)},n.notNestedProperty=function(i,s,a){new t(i,a,n.notNestedProperty,!0).to.not.have.nested.property(s)},n.nestedPropertyVal=function(i,s,a,c){new t(i,c,n.nestedPropertyVal,!0).to.have.nested.property(s,a)},n.notNestedPropertyVal=function(i,s,a,c){new t(i,c,n.notNestedPropertyVal,!0).to.not.have.nested.property(s,a)},n.deepNestedPropertyVal=function(i,s,a,c){new t(i,c,n.deepNestedPropertyVal,!0).to.have.deep.nested.property(s,a)},n.notDeepNestedPropertyVal=function(i,s,a,c){new t(i,c,n.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(s,a)},n.lengthOf=function(i,s,a){new t(i,a,n.lengthOf,!0).to.have.lengthOf(s)},n.hasAnyKeys=function(i,s,a){new t(i,a,n.hasAnyKeys,!0).to.have.any.keys(s)},n.hasAllKeys=function(i,s,a){new t(i,a,n.hasAllKeys,!0).to.have.all.keys(s)},n.containsAllKeys=function(i,s,a){new t(i,a,n.containsAllKeys,!0).to.contain.all.keys(s)},n.doesNotHaveAnyKeys=function(i,s,a){new t(i,a,n.doesNotHaveAnyKeys,!0).to.not.have.any.keys(s)},n.doesNotHaveAllKeys=function(i,s,a){new t(i,a,n.doesNotHaveAllKeys,!0).to.not.have.all.keys(s)},n.hasAnyDeepKeys=function(i,s,a){new t(i,a,n.hasAnyDeepKeys,!0).to.have.any.deep.keys(s)},n.hasAllDeepKeys=function(i,s,a){new t(i,a,n.hasAllDeepKeys,!0).to.have.all.deep.keys(s)},n.containsAllDeepKeys=function(i,s,a){new t(i,a,n.containsAllDeepKeys,!0).to.contain.all.deep.keys(s)},n.doesNotHaveAnyDeepKeys=function(i,s,a){new t(i,a,n.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(s)},n.doesNotHaveAllDeepKeys=function(i,s,a){new t(i,a,n.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(s)},n.throws=function(i,s,a,c){(typeof s=="string"||s instanceof RegExp)&&(a=s,s=null);var u=new t(i,c,n.throws,!0).to.throw(s,a);return o(u,"object")},n.doesNotThrow=function(i,s,a,c){(typeof s=="string"||s instanceof RegExp)&&(a=s,s=null),new t(i,c,n.doesNotThrow,!0).to.not.throw(s,a)},n.operator=function(i,s,a,c){var u;switch(s){case"==":u=i==a;break;case"===":u=i===a;break;case">":u=i>a;break;case">=":u=i>=a;break;case"<":u=i<a;break;case"<=":u=i<=a;break;case"!=":u=i!=a;break;case"!==":u=i!==a;break;default:throw c=c&&c+": ",new r.AssertionError(c+'Invalid operator "'+s+'"',void 0,n.operator)}var d=new t(u,c,n.operator,!0);d.assert(o(d,"object")===!0,"expected "+e.inspect(i)+" to be "+s+" "+e.inspect(a),"expected "+e.inspect(i)+" to not be "+s+" "+e.inspect(a))},n.closeTo=function(i,s,a,c){new t(i,c,n.closeTo,!0).to.be.closeTo(s,a)},n.approximately=function(i,s,a,c){new t(i,c,n.approximately,!0).to.be.approximately(s,a)},n.sameMembers=function(i,s,a){new t(i,a,n.sameMembers,!0).to.have.same.members(s)},n.notSameMembers=function(i,s,a){new t(i,a,n.notSameMembers,!0).to.not.have.same.members(s)},n.sameDeepMembers=function(i,s,a){new t(i,a,n.sameDeepMembers,!0).to.have.same.deep.members(s)},n.notSameDeepMembers=function(i,s,a){new t(i,a,n.notSameDeepMembers,!0).to.not.have.same.deep.members(s)},n.sameOrderedMembers=function(i,s,a){new t(i,a,n.sameOrderedMembers,!0).to.have.same.ordered.members(s)},n.notSameOrderedMembers=function(i,s,a){new t(i,a,n.notSameOrderedMembers,!0).to.not.have.same.ordered.members(s)},n.sameDeepOrderedMembers=function(i,s,a){new t(i,a,n.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(s)},n.notSameDeepOrderedMembers=function(i,s,a){new t(i,a,n.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(s)},n.includeMembers=function(i,s,a){new t(i,a,n.includeMembers,!0).to.include.members(s)},n.notIncludeMembers=function(i,s,a){new t(i,a,n.notIncludeMembers,!0).to.not.include.members(s)},n.includeDeepMembers=function(i,s,a){new t(i,a,n.includeDeepMembers,!0).to.include.deep.members(s)},n.notIncludeDeepMembers=function(i,s,a){new t(i,a,n.notIncludeDeepMembers,!0).to.not.include.deep.members(s)},n.includeOrderedMembers=function(i,s,a){new t(i,a,n.includeOrderedMembers,!0).to.include.ordered.members(s)},n.notIncludeOrderedMembers=function(i,s,a){new t(i,a,n.notIncludeOrderedMembers,!0).to.not.include.ordered.members(s)},n.includeDeepOrderedMembers=function(i,s,a){new t(i,a,n.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(s)},n.notIncludeDeepOrderedMembers=function(i,s,a){new t(i,a,n.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(s)},n.oneOf=function(i,s,a){new t(i,a,n.oneOf,!0).to.be.oneOf(s)},n.changes=function(i,s,a,c){arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.changes,!0).to.change(s,a)},n.changesBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.changesBy,!0).to.change(s,a).by(c)},n.doesNotChange=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.doesNotChange,!0).to.not.change(s,a)},n.changesButNotBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.changesButNotBy,!0).to.change(s,a).but.not.by(c)},n.increases=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.increases,!0).to.increase(s,a)},n.increasesBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.increasesBy,!0).to.increase(s,a).by(c)},n.doesNotIncrease=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.doesNotIncrease,!0).to.not.increase(s,a)},n.increasesButNotBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.increasesButNotBy,!0).to.increase(s,a).but.not.by(c)},n.decreases=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.decreases,!0).to.decrease(s,a)},n.decreasesBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.decreasesBy,!0).to.decrease(s,a).by(c)},n.doesNotDecrease=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.doesNotDecrease,!0).to.not.decrease(s,a)},n.doesNotDecreaseBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);return new t(i,u,n.doesNotDecreaseBy,!0).to.not.decrease(s,a).by(c)},n.decreasesButNotBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.decreasesButNotBy,!0).to.decrease(s,a).but.not.by(c)};n.ifError=function(i){if(i)throw i},n.isExtensible=function(i,s){new t(i,s,n.isExtensible,!0).to.be.extensible},n.isNotExtensible=function(i,s){new t(i,s,n.isNotExtensible,!0).to.not.be.extensible},n.isSealed=function(i,s){new t(i,s,n.isSealed,!0).to.be.sealed},n.isNotSealed=function(i,s){new t(i,s,n.isNotSealed,!0).to.not.be.sealed},n.isFrozen=function(i,s){new t(i,s,n.isFrozen,!0).to.be.frozen},n.isNotFrozen=function(i,s){new t(i,s,n.isNotFrozen,!0).to.not.be.frozen},n.isEmpty=function(i,s){new t(i,s,n.isEmpty,!0).to.be.empty},n.isNotEmpty=function(i,s){new t(i,s,n.isNotEmpty,!0).to.not.be.empty};(function i(s,a){return n[a]=n[s],i})("isOk","ok")("isNotOk","notOk")("throws","throw")("throws","Throw")("isExtensible","extensible")("isNotExtensible","notExtensible")("isSealed","sealed")("isNotSealed","notSealed")("isFrozen","frozen")("isNotFrozen","notFrozen")("isEmpty","empty")("isNotEmpty","notEmpty")}});var $e=O(we=>{var ss=[];we.version="4.3.3";we.AssertionError=Vr();var as=Xi();we.use=function(r){return~ss.indexOf(r)||(r(we,as),ss.push(r)),we};we.util=as;var Gu=nt();we.config=Gu;var Ku=Zi();we.use(Ku);var Ju=Hi();we.use(Ju);var Xu=ts();we.use(Xu);var Qu=ns();we.use(Qu);var Zu=is();we.use(Zu)});var us=O((wd,cs)=>{cs.exports=$e()});var fs=O((Dd,Le)=>{"use strict";var st=nn();Le.exports=(r,e)=>{let t=r.Assertion,o=r.assert,n=e.proxify;e.checkError&&(st=e.checkError);function i(y){return typeof y.catch!="function"&&typeof y.always=="function"&&typeof y.done=="function"&&typeof y.fail=="function"&&typeof y.pipe=="function"&&typeof y.progress=="function"&&typeof y.state=="function"}function s(y){if(typeof y._obj.then!="function")throw new TypeError(e.inspect(y._obj)+" is not a thenable.");if(i(y._obj))throw new TypeError("Chai as Promised is incompatible with thenables of jQuery<3.0.0, sorry! Please upgrade jQuery or use another Promises/A+ compatible library (see http://promisesaplus.com/).")}function a(y){return n===void 0?y:n(y)}function c(y,S){e.addMethod(t.prototype,y,function(){return s(this),S.apply(this,arguments)})}function u(y,S){e.addProperty(t.prototype,y,function(){return s(this),a(S.apply(this,arguments))})}function d(y,S){y.then(()=>S(),S)}function E(y,S,C){y.assert(!0,null,S,C.expected,C.actual)}function B(y,S,C){y.assert(!1,S,null,C.expected,C.actual)}function k(y){return typeof y.then=="function"?y:y._obj}function N(y){return y instanceof Error?y.toString():st.getConstructorName(y)}let x=Object.getOwnPropertyNames(t.prototype),I={};for(let y of x)I[y]=Object.getOwnPropertyDescriptor(t.prototype,y);u("fulfilled",function(){let y=k(this).then(S=>(E(this,"expected promise not to be fulfilled but it was fulfilled with #{act}",{actual:S}),S),S=>(B(this,"expected promise to be fulfilled but it was rejected with #{act}",{actual:N(S)}),S));return Le.exports.transferPromiseness(this,y),this}),u("rejected",function(){let y=k(this).then(S=>(B(this,"expected promise to be rejected but it was fulfilled with #{act}",{actual:S}),S),S=>(E(this,"expected promise not to be rejected but it was rejected with #{act}",{actual:N(S)}),S));return Le.exports.transferPromiseness(this,y),this}),c("rejectedWith",function(y,S,C){let U=null,re=e.flag(this,"negate")||!1;if(y===void 0&&S===void 0&&C===void 0)return this.rejected;C!==void 0&&e.flag(this,"message",C),y instanceof RegExp||typeof y=="string"?(S=y,y=null):y&&y instanceof Error?U=y.toString():typeof y=="function"?U=st.getConstructorName(y):y=null;let De=Boolean(y&&S),fe="including";S instanceof RegExp&&(fe="matching");let mt=k(this).then(ge=>{let Oe=null,xe=null;return y?(Oe="expected promise to be rejected with #{exp} but it was fulfilled with #{act}",xe=U):S&&(Oe=`expected promise to be rejected with an error ${fe} #{exp} but it was fulfilled with #{act}`,xe=S),B(this,Oe,{expected:xe,actual:ge}),ge},ge=>{let Oe=y&&(y instanceof Error?st.compatibleInstance(ge,y):st.compatibleConstructor(ge,y)),xe=S&&st.compatibleMessage(ge,S),et=N(ge);return re&&De?Oe&&xe&&this.assert(!0,null,"expected promise not to be rejected with #{exp} but it was rejected with #{act}",U,et):(y&&this.assert(Oe,"expected promise to be rejected with #{exp} but it was rejected with #{act}","expected promise not to be rejected with #{exp} but it was rejected with #{act}",U,et),S&&this.assert(xe,`expected promise to be rejected with an error ${fe} #{exp} but got #{act}`,`expected promise not to be rejected with an error ${fe} #{exp}`,S,st.getMessage(ge))),ge});return Le.exports.transferPromiseness(this,mt),this}),u("eventually",function(){return e.flag(this,"eventually",!0),this}),c("notify",function(y){return d(k(this),y),this}),c("become",function(y,S){return this.eventually.deep.equal(y,S)}),x.filter(y=>y!=="assert"&&typeof I[y].value=="function").forEach(y=>{t.overwriteMethod(y,S=>function(){return Q(S,this,arguments)})}),x.filter(y=>y!=="_obj"&&typeof I[y].get=="function").forEach(y=>{t.prototype.__methods.hasOwnProperty(y)?t.overwriteChainableMethod(y,C=>function(){return Q(C,this,arguments)},C=>function(){return Q(C,this)}):t.overwriteProperty(y,C=>function(){return a(Q(C,this))})});function Q(y,S,C){if(!e.flag(S,"eventually"))return y.apply(S,C),S;let U=k(S).then(re=>(S._obj=re,e.flag(S,"eventually",!1),C&&Le.exports.transformAsserterArgs(C))).then(re=>(y.apply(S,re),S._obj));return Le.exports.transferPromiseness(S,U),S}let te=Object.getOwnPropertyNames(o).filter(y=>typeof o[y]=="function");o.isFulfilled=(y,S)=>new t(y,S).to.be.fulfilled,o.isRejected=(y,S,C,U)=>new t(y,U).to.be.rejectedWith(S,C,U),o.becomes=(y,S,C)=>o.eventually.deepEqual(y,S,C),o.doesNotBecome=(y,S,C)=>o.eventually.notDeepEqual(y,S,C),o.eventually={},te.forEach(y=>{o.eventually[y]=function(S){let C=Array.prototype.slice.call(arguments,1),U,re=arguments[o[y].length-1];typeof re=="string"&&(U=fe=>{throw new r.AssertionError(`${re}
2
+ "use strict";var Libp2PInterop=(()=>{var Gc=Object.create;var hr=Object.defineProperty;var Kc=Object.getOwnPropertyDescriptor;var Jc=Object.getOwnPropertyNames;var Xc=Object.getPrototypeOf,Qc=Object.prototype.hasOwnProperty;var ke=(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 new Error('Dynamic require of "'+r+'" is not supported')});var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),be=(r,e)=>{for(var t in e)hr(r,t,{get:e[t],enumerable:!0})},Do=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Jc(e))!Qc.call(r,n)&&n!==t&&hr(r,n,{get:()=>e[n],enumerable:!(o=Kc(e,n))||o.enumerable});return r};var oe=(r,e,t)=>(t=r!=null?Gc(Xc(r)):{},Do(e||!r||!r.__esModule?hr(t,"default",{value:r,enumerable:!0}):t,r)),Zc=r=>Do(hr({},"__esModule",{value:!0}),r);var Wr=O((Vh,Co)=>{function _o(){var r=[].slice.call(arguments);function e(t,o){Object.keys(o).forEach(function(n){~r.indexOf(n)||(t[n]=o[n])})}return function(){for(var o=[].slice.call(arguments),n=0,i={};n<o.length;n++)e(i,o[n]);return i}}Co.exports=nt;function nt(r,e,t){var o=_o("name","message","stack","constructor","toJSON"),n=o(e||{});this.message=r||"Unspecified AssertionError",this.showDiff=!1;for(var i in n)this[i]=n[i];if(t=t||nt,Error.captureStackTrace)Error.captureStackTrace(this,t);else try{throw new Error}catch(s){this.stack=s.stack}}nt.prototype=Object.create(Error.prototype);nt.prototype.name="AssertionError";nt.prototype.constructor=nt;nt.prototype.toJSON=function(r){var e=_o("constructor","toJSON","stack"),t=e({name:this.name},this);return r!==!1&&this.stack&&(t.stack=this.stack),t}});var Uo=O(($h,Lo)=>{"use strict";function qo(r,e){return typeof r>"u"||r===null?!1:e in Object(r)}function Bo(r){var e=r.replace(/([^\\])\[/g,"$1.["),t=e.match(/(\\\.|[^.]+?)+/g);return t.map(function(n){if(n==="constructor"||n==="__proto__"||n==="prototype")return{};var i=/^\[(\d+)\]$/,s=i.exec(n),a=null;return s?a={i:parseFloat(s[1])}:a={p:n.replace(/\\([.[\]])/g,"$1")},a})}function jo(r,e,t){var o=r,n=null;t=typeof t>"u"?e.length:t;for(var i=0;i<t;i++){var s=e[i];o&&(typeof s.p>"u"?o=o[s.i]:o=o[s.p],i===t-1&&(n=o))}return n}function Yc(r,e,t){for(var o=r,n=t.length,i=null,s=0;s<n;s++){var a=null,c=null;if(i=t[s],s===n-1)a=typeof i.p>"u"?i.i:i.p,o[a]=e;else if(typeof i.p<"u"&&o[i.p])o=o[i.p];else if(typeof i.i<"u"&&o[i.i])o=o[i.i];else{var u=t[s+1];a=typeof i.p>"u"?i.i:i.p,c=typeof u.p>"u"?[]:{},o[a]=c,o=o[a]}}}function ko(r,e){var t=Bo(e),o=t[t.length-1],n={parent:t.length>1?jo(r,t,t.length-1):r,name:o.p||o.i,value:jo(r,t)};return n.exists=qo(n.parent,n.name),n}function Hc(r,e){var t=ko(r,e);return t.value}function eu(r,e,t){var o=Bo(e);return Yc(r,t,o),r}Lo.exports={hasProperty:qo,getPathInfo:ko,getPathValue:Hc,setPathValue:eu}});var Ae=O((Wh,Ro)=>{Ro.exports=function(e,t,o){var n=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)n[t]=o;else return n[t]}});var Fo=O((Gh,zo)=>{var tu=Ae();zo.exports=function(e,t){var o=tu(e,"negate"),n=t[0];return o?!n:n}});var Ut=O((Gr,Kr)=>{(function(r,e){typeof Gr=="object"&&typeof Kr<"u"?Kr.exports=e():typeof define=="function"&&define.amd?define(e):r.typeDetect=e()})(Gr,function(){"use strict";var r=typeof Promise=="function",e=typeof self=="object"?self:globalThis,t=typeof Symbol<"u",o=typeof Map<"u",n=typeof Set<"u",i=typeof WeakMap<"u",s=typeof WeakSet<"u",a=typeof DataView<"u",c=t&&typeof Symbol.iterator<"u",u=t&&typeof Symbol.toStringTag<"u",d=n&&typeof Set.prototype.entries=="function",w=o&&typeof Map.prototype.entries=="function",q=d&&Object.getPrototypeOf(new Set().entries()),k=w&&Object.getPrototypeOf(new Map().entries()),N=c&&typeof Array.prototype[Symbol.iterator]=="function",E=N&&Object.getPrototypeOf([][Symbol.iterator]()),I=c&&typeof String.prototype[Symbol.iterator]=="function",B=I&&Object.getPrototypeOf(""[Symbol.iterator]()),$=8,Q=-1;function te(y){var S=typeof y;if(S!=="object")return S;if(y===null)return"null";if(y===e)return"global";if(Array.isArray(y)&&(u===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var C=u&&y[Symbol.toStringTag];if(typeof C=="string")return C;var U=Object.getPrototypeOf(y);return U===RegExp.prototype?"RegExp":U===Date.prototype?"Date":r&&U===Promise.prototype?"Promise":n&&U===Set.prototype?"Set":o&&U===Map.prototype?"Map":s&&U===WeakSet.prototype?"WeakSet":i&&U===WeakMap.prototype?"WeakMap":a&&U===DataView.prototype?"DataView":o&&U===k?"Map Iterator":n&&U===q?"Set Iterator":N&&U===E?"Array Iterator":I&&U===B?"String Iterator":U===null?"Object":Object.prototype.toString.call(y).slice($,Q)}return te})});var $o=O((Kh,Vo)=>{var ru=Wr(),Jr=Ae(),nu=Ut();Vo.exports=function(e,t){var o=Jr(e,"message"),n=Jr(e,"ssfi");o=o?o+": ":"",e=Jr(e,"object"),t=t.map(function(a){return a.toLowerCase()}),t.sort();var i=t.map(function(a,c){var u=~["a","e","i","o","u"].indexOf(a.charAt(0))?"an":"a",d=t.length>1&&c===t.length-1?"or ":"";return d+u+" "+a}).join(", "),s=nu(e).toLowerCase();if(!t.some(function(a){return s===a}))throw new ru(o+"object tested must be "+i+", but "+s+" given",void 0,n)}});var Xr=O((Jh,Wo)=>{Wo.exports=function(e,t){return t.length>4?t[4]:e._obj}});var Qr=O((Xh,Go)=>{"use strict";var ou=Function.prototype.toString,iu=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function su(r){if(typeof r!="function")return null;var e="";if(typeof Function.prototype.name>"u"&&typeof r.name>"u"){var t=ou.call(r).match(iu);t&&(e=t[1])}else e=r.name;return e}Go.exports=su});var Jo=O((dr,Ko)=>{(function(r,e){typeof dr=="object"&&typeof Ko<"u"?e(dr):typeof define=="function"&&define.amd?define(["exports"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.loupe={}))})(dr,function(r){"use strict";function e(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(h){return typeof h}:e=function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},e(l)}function t(l,h){return o(l)||n(l,h)||i(l,h)||a()}function o(l){if(Array.isArray(l))return l}function n(l,h){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(l)))){var b=[],P=!0,D=!1,R=void 0;try{for(var K=l[Symbol.iterator](),Y;!(P=(Y=K.next()).done)&&(b.push(Y.value),!(h&&b.length===h));P=!0);}catch(he){D=!0,R=he}finally{try{!P&&K.return!=null&&K.return()}finally{if(D)throw R}}return b}}function i(l,h){if(l){if(typeof l=="string")return s(l,h);var b=Object.prototype.toString.call(l).slice(8,-1);if(b==="Object"&&l.constructor&&(b=l.constructor.name),b==="Map"||b==="Set")return Array.from(l);if(b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b))return s(l,h)}}function s(l,h){(h==null||h>l.length)&&(h=l.length);for(var b=0,P=new Array(h);b<h;b++)P[b]=l[b];return P}function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c={bold:["1","22"],dim:["2","22"],italic:["3","23"],underline:["4","24"],inverse:["7","27"],hidden:["8","28"],strike:["9","29"],black:["30","39"],red:["31","39"],green:["32","39"],yellow:["33","39"],blue:["34","39"],magenta:["35","39"],cyan:["36","39"],white:["37","39"],brightblack:["30;1","39"],brightred:["31;1","39"],brightgreen:["32;1","39"],brightyellow:["33;1","39"],brightblue:["34;1","39"],brightmagenta:["35;1","39"],brightcyan:["36;1","39"],brightwhite:["37;1","39"],grey:["90","39"]},u={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},d="\u2026";function w(l,h){var b=c[u[h]]||c[h];return b?"\x1B[".concat(b[0],"m").concat(String(l),"\x1B[").concat(b[1],"m"):String(l)}function q(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=l.showHidden,b=h===void 0?!1:h,P=l.depth,D=P===void 0?2:P,R=l.colors,K=R===void 0?!1:R,Y=l.customInspect,he=Y===void 0?!0:Y,ue=l.showProxy,Ee=ue===void 0?!1:ue,rt=l.maxArrayLength,Vr=rt===void 0?1/0:rt,kt=l.breakLength,wt=kt===void 0?1/0:kt,Lt=l.seen,Vc=Lt===void 0?[]:Lt,Mo=l.truncate,$c=Mo===void 0?1/0:Mo,Io=l.stylize,Wc=Io===void 0?String:Io,$r={showHidden:Boolean(b),depth:Number(D),colors:Boolean(K),customInspect:Boolean(he),showProxy:Boolean(Ee),maxArrayLength:Number(Vr),breakLength:Number(wt),truncate:Number($c),seen:Vc,stylize:Wc};return $r.colors&&($r.stylize=w),$r}function k(l,h){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:d;l=String(l);var P=b.length,D=l.length;return P>h&&D>P?b:D>h&&D>P?"".concat(l.slice(0,h-P)).concat(b):l}function N(l,h,b){var P=arguments.length>3&&arguments[3]!==void 0?arguments[3]:", ";b=b||h.inspect;var D=l.length;if(D===0)return"";for(var R=h.truncate,K="",Y="",he="",ue=0;ue<D;ue+=1){var Ee=ue+1===l.length,rt=ue+2===l.length;he="".concat(d,"(").concat(l.length-ue,")");var Vr=l[ue];h.truncate=R-K.length-(Ee?0:P.length);var kt=Y||b(Vr,h)+(Ee?"":P),wt=K.length+kt.length,Lt=wt+he.length;if(Ee&&wt>R&&K.length+he.length<=R||!Ee&&!rt&&Lt>R||(Y=Ee?"":b(l[ue+1],h)+(rt?"":P),!Ee&&rt&&Lt>R&&wt+Y.length>R))break;if(K+=kt,!Ee&&!rt&&wt+Y.length>=R){he="".concat(d,"(").concat(l.length-ue-1,")");break}he=""}return"".concat(K).concat(he)}function E(l){return l.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?l:JSON.stringify(l).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}function I(l,h){var b=t(l,2),P=b[0],D=b[1];return h.truncate-=2,typeof P=="string"?P=E(P):typeof P!="number"&&(P="[".concat(h.inspect(P,h),"]")),h.truncate-=P.length,D=h.inspect(D,h),"".concat(P,": ").concat(D)}function B(l,h){var b=Object.keys(l).slice(l.length);if(!l.length&&!b.length)return"[]";h.truncate-=4;var P=N(l,h);h.truncate-=P.length;var D="";return b.length&&(D=N(b.map(function(R){return[R,l[R]]}),h,I)),"[ ".concat(P).concat(D?", ".concat(D):""," ]")}var $=Function.prototype.toString,Q=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\s\(\/]+)/;function te(l){if(typeof l!="function")return null;var h="";if(typeof Function.prototype.name>"u"&&typeof l.name>"u"){var b=$.call(l).match(Q);b&&(h=b[1])}else h=l.name;return h}var y=te,S=function(h){return typeof Buffer=="function"&&h instanceof Buffer?"Buffer":h[Symbol.toStringTag]?h[Symbol.toStringTag]:y(h.constructor)};function C(l,h){var b=S(l);h.truncate-=b.length+4;var P=Object.keys(l).slice(l.length);if(!l.length&&!P.length)return"".concat(b,"[]");for(var D="",R=0;R<l.length;R++){var K="".concat(h.stylize(k(l[R],h.truncate),"number")).concat(R===l.length-1?"":", ");if(h.truncate-=K.length,l[R]!==l.length&&h.truncate<=3){D+="".concat(d,"(").concat(l.length-l[R]+1,")");break}D+=K}var Y="";return P.length&&(Y=N(P.map(function(he){return[he,l[he]]}),h,I)),"".concat(b,"[ ").concat(D).concat(Y?", ".concat(Y):""," ]")}function U(l,h){var b=l.toJSON();if(b===null)return"Invalid Date";var P=b.split("T"),D=P[0];return h.stylize("".concat(D,"T").concat(k(P[1],h.truncate-D.length-1)),"date")}function re(l,h){var b=y(l);return b?h.stylize("[Function ".concat(k(b,h.truncate-11),"]"),"special"):h.stylize("[Function]","special")}function De(l,h){var b=t(l,2),P=b[0],D=b[1];return h.truncate-=4,P=h.inspect(P,h),h.truncate-=P.length,D=h.inspect(D,h),"".concat(P," => ").concat(D)}function fe(l){var h=[];return l.forEach(function(b,P){h.push([P,b])}),h}function gt(l,h){var b=l.size-1;return b<=0?"Map{}":(h.truncate-=7,"Map{ ".concat(N(fe(l),h,De)," }"))}var ge=Number.isNaN||function(l){return l!==l};function Oe(l,h){return ge(l)?h.stylize("NaN","number"):l===1/0?h.stylize("Infinity","number"):l===-1/0?h.stylize("-Infinity","number"):l===0?h.stylize(1/l===1/0?"+0":"-0","number"):h.stylize(k(l,h.truncate),"number")}function xe(l,h){var b=k(l.toString(),h.truncate-1);return b!==d&&(b+="n"),h.stylize(b,"bigint")}function tt(l,h){var b=l.toString().split("/")[2],P=h.truncate-(2+b.length),D=l.source;return h.stylize("/".concat(k(D,P),"/").concat(b),"regexp")}function ar(l){var h=[];return l.forEach(function(b){h.push(b)}),h}function zr(l,h){return l.size===0?"Set{}":(h.truncate-=7,"Set{ ".concat(N(ar(l),h)," }"))}var f=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),p={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},g=16,v=4;function A(l){return p[l]||"\\u".concat("0000".concat(l.charCodeAt(0).toString(g)).slice(-v))}function T(l,h){return f.test(l)&&(l=l.replace(f,A)),h.stylize("'".concat(k(l,h.truncate-2),"'"),"string")}function x(l){return"description"in Symbol.prototype?l.description?"Symbol(".concat(l.description,")"):"Symbol()":l.toString()}var m=function(){return"Promise{\u2026}"};try{var M=process.binding("util"),j=M.getPromiseDetails,F=M.kPending,X=M.kRejected;Array.isArray(j(Promise.resolve()))&&(m=function(h,b){var P=j(h),D=t(P,2),R=D[0],K=D[1];return R===F?"Promise{<pending>}":"Promise".concat(R===X?"!":"","{").concat(b.inspect(K,b),"}")})}catch{}var z=m;function L(l,h){var b=Object.getOwnPropertyNames(l),P=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l):[];if(b.length===0&&P.length===0)return"{}";if(h.truncate-=4,h.seen=h.seen||[],h.seen.indexOf(l)>=0)return"[Circular]";h.seen.push(l);var D=N(b.map(function(Y){return[Y,l[Y]]}),h,I),R=N(P.map(function(Y){return[Y,l[Y]]}),h,I);h.seen.pop();var K="";return D&&R&&(K=", "),"{ ".concat(D).concat(K).concat(R," }")}var G=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function ie(l,h){var b="";return G&&G in l&&(b=l[G]),b=b||y(l.constructor),(!b||b==="_class")&&(b="<Anonymous Class>"),h.truncate-=b.length,"".concat(b).concat(L(l,h))}function le(l,h){return l.length===0?"Arguments[]":(h.truncate-=13,"Arguments[ ".concat(N(l,h)," ]"))}var ce=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description"];function Be(l,h){var b=Object.getOwnPropertyNames(l).filter(function(K){return ce.indexOf(K)===-1}),P=l.name;h.truncate-=P.length;var D="";typeof l.message=="string"?D=k(l.message,h.truncate):b.unshift("message"),D=D?": ".concat(D):"",h.truncate-=D.length+5;var R=N(b.map(function(K){return[K,l[K]]}),h,I);return"".concat(P).concat(D).concat(R?" { ".concat(R," }"):"")}function Bc(l,h){var b=t(l,2),P=b[0],D=b[1];return h.truncate-=3,D?"".concat(h.stylize(P,"yellow"),"=").concat(h.stylize('"'.concat(D,'"'),"string")):"".concat(h.stylize(P,"yellow"))}function Fr(l,h){return N(l,h,To,`
4
+ `)}function To(l,h){var b=l.getAttributeNames(),P=l.tagName.toLowerCase(),D=h.stylize("<".concat(P),"special"),R=h.stylize(">","special"),K=h.stylize("</".concat(P,">"),"special");h.truncate-=P.length*2+5;var Y="";b.length>0&&(Y+=" ",Y+=N(b.map(function(Ee){return[Ee,l.getAttribute(Ee)]}),h,Bc," ")),h.truncate-=Y.length;var he=h.truncate,ue=Fr(l.children,h);return ue&&ue.length>he&&(ue="".concat(d,"(").concat(l.children.length,")")),"".concat(D).concat(Y).concat(R).concat(ue).concat(K)}var kc=typeof Symbol=="function"&&typeof Symbol.for=="function",cr=kc?Symbol.for("chai/inspect"):"@@chai/inspect",bt=!1;try{var No=ke("util");bt=No.inspect?No.inspect.custom:!1}catch{bt=!1}function Po(){this.key="chai/loupe__"+Math.random()+Date.now()}Po.prototype={get:function(h){return h[this.key]},has:function(h){return this.key in h},set:function(h,b){Object.isExtensible(h)&&Object.defineProperty(h,this.key,{value:b,configurable:!0})}};var ur=new(typeof WeakMap=="function"?WeakMap:Po),fr={},Oo={undefined:function(h,b){return b.stylize("undefined","undefined")},null:function(h,b){return b.stylize(null,"null")},boolean:function(h,b){return b.stylize(h,"boolean")},Boolean:function(h,b){return b.stylize(h,"boolean")},number:Oe,Number:Oe,bigint:xe,BigInt:xe,string:T,String:T,function:re,Function:re,symbol:x,Symbol:x,Array:B,Date:U,Map:gt,Set:zr,RegExp:tt,Promise:z,WeakSet:function(h,b){return b.stylize("WeakSet{\u2026}","special")},WeakMap:function(h,b){return b.stylize("WeakMap{\u2026}","special")},Arguments:le,Int8Array:C,Uint8Array:C,Uint8ClampedArray:C,Int16Array:C,Uint16Array:C,Int32Array:C,Uint32Array:C,Float32Array:C,Float64Array:C,Generator:function(){return""},DataView:function(){return""},ArrayBuffer:function(){return""},Error:Be,HTMLCollection:Fr,NodeList:Fr},Lc=function(h,b,P){return cr in h&&typeof h[cr]=="function"?h[cr](b):bt&&bt in h&&typeof h[bt]=="function"?h[bt](b.depth,b):"inspect"in h&&typeof h.inspect=="function"?h.inspect(b.depth,b):"constructor"in h&&ur.has(h.constructor)?ur.get(h.constructor)(h,b):fr[P]?fr[P](h,b):""},Uc=Object.prototype.toString;function lr(l,h){h=q(h),h.inspect=lr;var b=h,P=b.customInspect,D=l===null?"null":e(l);if(D==="object"&&(D=Uc.call(l).slice(8,-1)),Oo[D])return Oo[D](l,h);if(P&&l){var R=Lc(l,h,D);if(R)return typeof R=="string"?R:lr(R,h)}var K=l?Object.getPrototypeOf(l):!1;return K===Object.prototype||K===null?L(l,h):l&&typeof HTMLElement=="function"&&l instanceof HTMLElement?To(l,h):"constructor"in l?l.constructor!==Object?ie(l,h):L(l,h):l===Object(l)?L(l,h):h.stylize(String(l),D)}function Rc(l,h){return ur.has(l)?!1:(ur.set(l,h),!0)}function zc(l,h){return l in fr?!1:(fr[l]=h,!0)}var Fc=cr;r.custom=Fc,r.default=lr,r.inspect=lr,r.registerConstructor=Rc,r.registerStringTag=zc,Object.defineProperty(r,"__esModule",{value:!0})})});var ot=O((Qh,Xo)=>{Xo.exports={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"]}});var pr=O((Yh,Zo)=>{var Zh=Qr(),au=Jo(),Qo=ot();Zo.exports=cu;function cu(r,e,t,o){var n={colors:o,depth:typeof t>"u"?2:t,showHidden:e,truncate:Qo.truncateThreshold?Qo.truncateThreshold:1/0};return au.inspect(r,n)}});var Zr=O((Hh,Ho)=>{var uu=pr(),Yo=ot();Ho.exports=function(e){var t=uu(e),o=Object.prototype.toString.call(e);if(Yo.truncateThreshold&&t.length>=Yo.truncateThreshold){if(o==="[object Function]")return!e.name||e.name===""?"[Function]":"[Function: "+e.name+"]";if(o==="[object Array]")return"[ Array("+e.length+") ]";if(o==="[object Object]"){var n=Object.keys(e),i=n.length>2?n.splice(0,2).join(", ")+", ...":n.join(", ");return"{ Object ("+i+") }"}else return t}else return t}});var ti=O((ed,ei)=>{var Yr=Ae(),fu=Xr(),Hr=Zr();ei.exports=function(e,t){var o=Yr(e,"negate"),n=Yr(e,"object"),i=t[3],s=fu(e,t),a=o?t[2]:t[1],c=Yr(e,"message");return typeof a=="function"&&(a=a()),a=a||"",a=a.replace(/#\{this\}/g,function(){return Hr(n)}).replace(/#\{act\}/g,function(){return Hr(s)}).replace(/#\{exp\}/g,function(){return Hr(i)}),c?c+": "+a:a}});var Ve=O((td,ri)=>{ri.exports=function(e,t,o){var n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),o=arguments.length===3?o:!0;for(var i in n)(o||i!=="object"&&i!=="ssfi"&&i!=="lockSsfi"&&i!="message")&&(t.__flags[i]=n[i])}});var pi=O((rd,rn)=>{"use strict";var ni=Ut();function li(){this._key="chai/deep-eql__"+Math.random()+Date.now()}li.prototype={get:function(e){return e[this._key]},set:function(e,t){Object.isExtensible(e)&&Object.defineProperty(e,this._key,{value:t,configurable:!0})}};var tn=typeof WeakMap=="function"?WeakMap:li;function oi(r,e,t){if(!t||vt(r)||vt(e))return null;var o=t.get(r);if(o){var n=o.get(e);if(typeof n=="boolean")return n}return null}function yr(r,e,t,o){if(!(!t||vt(r)||vt(e))){var n=t.get(r);n?n.set(e,o):(n=new tn,n.set(e,o),t.set(r,n))}}rn.exports=mr;rn.exports.MemoizeMap=tn;function mr(r,e,t){if(t&&t.comparator)return ii(r,e,t);var o=hi(r,e);return o!==null?o:ii(r,e,t)}function hi(r,e){return r===e?r!==0||1/r===1/e:r!==r&&e!==e?!0:vt(r)||vt(e)?!1:null}function ii(r,e,t){t=t||{},t.memoize=t.memoize===!1?!1:t.memoize||new tn;var o=t&&t.comparator,n=oi(r,e,t.memoize);if(n!==null)return n;var i=oi(e,r,t.memoize);if(i!==null)return i;if(o){var s=o(r,e);if(s===!1||s===!0)return yr(r,e,t.memoize,s),s;var a=hi(r,e);if(a!==null)return a}var c=ni(r);if(c!==ni(e))return yr(r,e,t.memoize,!1),!1;yr(r,e,t.memoize,!0);var u=lu(r,e,c,t);return yr(r,e,t.memoize,u),u}function lu(r,e,t,o){switch(t){case"String":case"Number":case"Boolean":case"Date":return mr(r.valueOf(),e.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return r===e;case"Error":return di(r,e,["name","message","code"],o);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return st(r,e,o);case"RegExp":return hu(r,e);case"Generator":return du(r,e,o);case"DataView":return st(new Uint8Array(r.buffer),new Uint8Array(e.buffer),o);case"ArrayBuffer":return st(new Uint8Array(r),new Uint8Array(e),o);case"Set":return si(r,e,o);case"Map":return si(r,e,o);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return r.equals(e);case"Temporal.Duration":return r.total("nanoseconds")===e.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return r.toString()===e.toString();default:return yu(r,e,o)}}function hu(r,e){return r.toString()===e.toString()}function si(r,e,t){if(r.size!==e.size)return!1;if(r.size===0)return!0;var o=[],n=[];return r.forEach(function(s,a){o.push([s,a])}),e.forEach(function(s,a){n.push([s,a])}),st(o.sort(),n.sort(),t)}function st(r,e,t){var o=r.length;if(o!==e.length)return!1;if(o===0)return!0;for(var n=-1;++n<o;)if(mr(r[n],e[n],t)===!1)return!1;return!0}function du(r,e,t){return st(en(r),en(e),t)}function pu(r){return typeof Symbol<"u"&&typeof r=="object"&&typeof Symbol.iterator<"u"&&typeof r[Symbol.iterator]=="function"}function ai(r){if(pu(r))try{return en(r[Symbol.iterator]())}catch{return[]}return[]}function en(r){for(var e=r.next(),t=[e.value];e.done===!1;)e=r.next(),t.push(e.value);return t}function ci(r){var e=[];for(var t in r)e.push(t);return e}function ui(r){for(var e=[],t=Object.getOwnPropertySymbols(r),o=0;o<t.length;o+=1){var n=t[o];Object.getOwnPropertyDescriptor(r,n).enumerable&&e.push(n)}return e}function di(r,e,t,o){var n=t.length;if(n===0)return!0;for(var i=0;i<n;i+=1)if(mr(r[t[i]],e[t[i]],o)===!1)return!1;return!0}function yu(r,e,t){var o=ci(r),n=ci(e),i=ui(r),s=ui(e);if(o=o.concat(i),n=n.concat(s),o.length&&o.length===n.length)return st(fi(o).sort(),fi(n).sort())===!1?!1:di(r,e,o,t);var a=ai(r),c=ai(e);return a.length&&a.length===c.length?(a.sort(),c.sort(),st(a,c,t)):o.length===0&&a.length===0&&n.length===0&&c.length===0}function vt(r){return r===null||typeof r!="object"}function fi(r){return r.map(function(t){return typeof t=="symbol"?t.toString():t})}});var Rt=O((nd,yi)=>{var mu=ot();yi.exports=function(){return mu.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}});var bi=O((od,gi)=>{var gu=$e(),mi=Ae(),bu=Rt(),wu=Ve();gi.exports=function(e,t,o){o=o===void 0?function(){}:o,Object.defineProperty(e,t,{get:function n(){!bu()&&!mi(this,"lockSsfi")&&mi(this,"ssfi",n);var i=o.call(this);if(i!==void 0)return i;var s=new gu.Assertion;return wu(this,s),s},configurable:!0})}});var zt=O((id,wi)=>{var vu=Object.getOwnPropertyDescriptor(function(){},"length");wi.exports=function(e,t,o){return vu.configurable&&Object.defineProperty(e,"length",{get:function(){throw Error(o?"Invalid Chai property: "+t+'.length. Due to a compatibility issue, "length" cannot directly follow "'+t+'". Use "'+t+'.lengthOf" instead.':"Invalid Chai property: "+t+'.length. See docs for proper usage of "'+t+'".')}}),e}});var xi=O((sd,vi)=>{vi.exports=function(e){var t=Object.getOwnPropertyNames(e);function o(i){t.indexOf(i)===-1&&t.push(i)}for(var n=Object.getPrototypeOf(e);n!==null;)Object.getOwnPropertyNames(n).forEach(o),n=Object.getPrototypeOf(n);return t}});var Ft=O((ad,Si)=>{var xu=ot(),Ei=Ae(),Eu=xi(),Au=Rt();var Ai=["__flags","__methods","_obj","assert"];Si.exports=function(e,t){return Au()?new Proxy(e,{get:function o(n,i){if(typeof i=="string"&&xu.proxyExcludedKeys.indexOf(i)===-1&&!Reflect.has(n,i)){if(t)throw Error("Invalid Chai property: "+t+"."+i+'. See docs for proper usage of "'+t+'".');var s=null,a=4;throw Eu(n).forEach(function(c){if(!Object.prototype.hasOwnProperty(c)&&Ai.indexOf(c)===-1){var u=Su(i,c,a);u<a&&(s=c,a=u)}}),Error(s!==null?"Invalid Chai property: "+i+'. Did you mean "'+s+'"?':"Invalid Chai property: "+i)}return Ai.indexOf(i)===-1&&!Ei(n,"lockSsfi")&&Ei(n,"ssfi",o),Reflect.get(n,i)}}):e};function Su(r,e,t){if(Math.abs(r.length-e.length)>=t)return t;for(var o=[],n=0;n<=r.length;n++)o[n]=Array(e.length+1).fill(0),o[n][0]=n;for(var i=0;i<e.length;i++)o[0][i]=i;for(var n=1;n<=r.length;n++)for(var s=r.charCodeAt(n-1),i=1;i<=e.length;i++){if(Math.abs(n-i)>=t){o[n][i]=t;continue}o[n][i]=Math.min(o[n-1][i]+1,o[n][i-1]+1,o[n-1][i-1]+(s===e.charCodeAt(i-1)?0:1))}return o[r.length][e.length]}});var Pi=O((cd,Ni)=>{var Tu=zt(),Nu=$e(),Ti=Ae(),Pu=Ft(),Ou=Ve();Ni.exports=function(e,t,o){var n=function(){Ti(this,"lockSsfi")||Ti(this,"ssfi",n);var i=o.apply(this,arguments);if(i!==void 0)return i;var s=new Nu.Assertion;return Ou(this,s),s};Tu(n,t,!1),e[t]=Pu(n,t)}});var Mi=O((ud,Oi)=>{var Mu=$e(),Vt=Ae(),Iu=Rt(),Du=Ve();Oi.exports=function(e,t,o){var n=Object.getOwnPropertyDescriptor(e,t),i=function(){};n&&typeof n.get=="function"&&(i=n.get),Object.defineProperty(e,t,{get:function s(){!Iu()&&!Vt(this,"lockSsfi")&&Vt(this,"ssfi",s);var a=Vt(this,"lockSsfi");Vt(this,"lockSsfi",!0);var c=o(i).call(this);if(Vt(this,"lockSsfi",a),c!==void 0)return c;var u=new Mu.Assertion;return Du(this,u),u},configurable:!0})}});var Di=O((fd,Ii)=>{var _u=zt(),Cu=$e(),$t=Ae(),ju=Ft(),qu=Ve();Ii.exports=function(e,t,o){var n=e[t],i=function(){throw new Error(t+" is not a function")};n&&typeof n=="function"&&(i=n);var s=function(){$t(this,"lockSsfi")||$t(this,"ssfi",s);var a=$t(this,"lockSsfi");$t(this,"lockSsfi",!0);var c=o(i).apply(this,arguments);if($t(this,"lockSsfi",a),c!==void 0)return c;var u=new Cu.Assertion;return qu(this,u),u};_u(s,t,!1),e[t]=ju(s,t)}});var Bi=O((ld,qi)=>{var Bu=zt(),ku=$e(),_i=Ae(),Lu=Ft(),Ci=Ve();var Uu=typeof Object.setPrototypeOf=="function",ji=function(){},Ru=Object.getOwnPropertyNames(ji).filter(function(r){var e=Object.getOwnPropertyDescriptor(ji,r);return typeof e!="object"?!0:!e.configurable}),zu=Function.prototype.call,Fu=Function.prototype.apply;qi.exports=function(e,t,o,n){typeof n!="function"&&(n=function(){});var i={method:o,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=i,Object.defineProperty(e,t,{get:function(){i.chainingBehavior.call(this);var a=function(){_i(this,"lockSsfi")||_i(this,"ssfi",a);var d=i.method.apply(this,arguments);if(d!==void 0)return d;var w=new ku.Assertion;return Ci(this,w),w};if(Bu(a,t,!0),Uu){var c=Object.create(this);c.call=zu,c.apply=Fu,Object.setPrototypeOf(a,c)}else{var u=Object.getOwnPropertyNames(e);u.forEach(function(d){if(Ru.indexOf(d)===-1){var w=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(a,d,w)}})}return Ci(this,a),Lu(a)},configurable:!0})}});var Ri=O((hd,Ui)=>{var ki=$e(),Li=Ve();Ui.exports=function(e,t,o,n){var i=e.__methods[t],s=i.chainingBehavior;i.chainingBehavior=function(){var u=n(s).call(this);if(u!==void 0)return u;var d=new ki.Assertion;return Li(this,d),d};var a=i.method;i.method=function(){var u=o(a).apply(this,arguments);if(u!==void 0)return u;var d=new ki.Assertion;return Li(this,d),d}}});var Vi=O((dd,Fi)=>{var zi=pr();Fi.exports=function(e,t){return zi(e)<zi(t)?-1:1}});var nn=O((pd,$i)=>{$i.exports=function(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}});var Gi=O((yd,Wi)=>{var Vu=nn();Wi.exports=function(e){return Object.keys(e).concat(Vu(e))}});var sn=O((md,Ki)=>{"use strict";function $u(r,e){return e instanceof Error&&r===e}function Wu(r,e){return e instanceof Error?r.constructor===e.constructor||r instanceof e.constructor:e.prototype instanceof Error||e===Error?r.constructor===e||r instanceof e:!1}function Gu(r,e){var t=typeof r=="string"?r:r.message;return e instanceof RegExp?e.test(t):typeof e=="string"?t.indexOf(e)!==-1:!1}var Ku=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/;function on(r){var e="";if(typeof r.name>"u"){var t=String(r).match(Ku);t&&(e=t[1])}else e=r.name;return e}function Ju(r){var e=r;return r instanceof Error?e=on(r.constructor):typeof r=="function"&&(e=on(r).trim()||on(new r)),e}function Xu(r){var e="";return r&&r.message?e=r.message:typeof r=="string"&&(e=r),e}Ki.exports={compatibleInstance:$u,compatibleConstructor:Wu,compatibleMessage:Gu,getMessage:Xu,getConstructorName:Ju}});var Xi=O((gd,Ji)=>{function Qu(r){return r!==r}Ji.exports=Number.isNaN||Qu});var Yi=O((bd,Zi)=>{var Zu=Ut(),Qi=Ae();function Yu(r){var e=Zu(r),t=["Array","Object","function"];return t.indexOf(e)!==-1}Zi.exports=function(e,t){var o=Qi(e,"operator"),n=Qi(e,"negate"),i=t[3],s=n?t[2]:t[1];if(o)return o;if(typeof s=="function"&&(s=s()),s=s||"",!!s&&!/\shave\s/.test(s)){var a=Yu(i);return/\snot\s/.test(s)?a?"notDeepStrictEqual":"notStrictEqual":a?"deepStrictEqual":"strictEqual"}}});var es=O(J=>{var Hi=Uo();J.test=Fo();J.type=Ut();J.expectTypes=$o();J.getMessage=ti();J.getActual=Xr();J.inspect=pr();J.objDisplay=Zr();J.flag=Ae();J.transferFlags=Ve();J.eql=pi();J.getPathInfo=Hi.getPathInfo;J.hasProperty=Hi.hasProperty;J.getName=Qr();J.addProperty=bi();J.addMethod=Pi();J.overwriteProperty=Mi();J.overwriteMethod=Di();J.addChainableMethod=Bi();J.overwriteChainableMethod=Ri();J.compareByInspect=Vi();J.getOwnEnumerablePropertySymbols=nn();J.getOwnEnumerableProperties=Gi();J.checkError=sn();J.proxify=Ft();J.addLengthGuard=zt();J.isProxyEnabled=Rt();J.isNaN=Xi();J.getOperator=Yi()});var rs=O((vd,ts)=>{var xt=ot();ts.exports=function(r,e){var t=r.AssertionError,o=e.flag;r.Assertion=n;function n(i,s,a,c){return o(this,"ssfi",a||n),o(this,"lockSsfi",c),o(this,"object",i),o(this,"message",s),e.proxify(this)}Object.defineProperty(n,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),xt.includeStack},set:function(i){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),xt.includeStack=i}}),Object.defineProperty(n,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),xt.showDiff},set:function(i){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),xt.showDiff=i}}),n.addProperty=function(i,s){e.addProperty(this.prototype,i,s)},n.addMethod=function(i,s){e.addMethod(this.prototype,i,s)},n.addChainableMethod=function(i,s,a){e.addChainableMethod(this.prototype,i,s,a)},n.overwriteProperty=function(i,s){e.overwriteProperty(this.prototype,i,s)},n.overwriteMethod=function(i,s){e.overwriteMethod(this.prototype,i,s)},n.overwriteChainableMethod=function(i,s,a){e.overwriteChainableMethod(this.prototype,i,s,a)},n.prototype.assert=function(i,s,a,c,u,d){var w=e.test(this,arguments);if(d!==!1&&(d=!0),c===void 0&&u===void 0&&(d=!1),xt.showDiff!==!0&&(d=!1),!w){s=e.getMessage(this,arguments);var q=e.getActual(this,arguments),k={actual:q,expected:c,showDiff:d},N=e.getOperator(this,arguments);throw N&&(k.operator=N),new t(s,k,xt.includeStack?this.assert:o(this,"ssfi"))}};Object.defineProperty(n.prototype,"_obj",{get:function(){return o(this,"object")},set:function(i){o(this,"object",i)}})}});var os=O((xd,ns)=>{ns.exports=function(r,e){var t=r.Assertion,o=r.AssertionError,n=e.flag;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(f){t.addProperty(f)}),t.addProperty("not",function(){n(this,"negate",!0)}),t.addProperty("deep",function(){n(this,"deep",!0)}),t.addProperty("nested",function(){n(this,"nested",!0)}),t.addProperty("own",function(){n(this,"own",!0)}),t.addProperty("ordered",function(){n(this,"ordered",!0)}),t.addProperty("any",function(){n(this,"any",!0),n(this,"all",!1)}),t.addProperty("all",function(){n(this,"all",!0),n(this,"any",!1)});function i(f,p){p&&n(this,"message",p),f=f.toLowerCase();var g=n(this,"object"),v=~["a","e","i","o","u"].indexOf(f.charAt(0))?"an ":"a ";this.assert(f===e.type(g).toLowerCase(),"expected #{this} to be "+v+f,"expected #{this} not to be "+v+f)}t.addChainableMethod("an",i),t.addChainableMethod("a",i);function s(f,p){return e.isNaN(f)&&e.isNaN(p)||f===p}function a(){n(this,"contains",!0)}function c(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=e.type(g).toLowerCase(),A=n(this,"message"),T=n(this,"negate"),x=n(this,"ssfi"),m=n(this,"deep"),M=m?"deep ":"";A=A?A+": ":"";var j=!1;switch(v){case"string":j=g.indexOf(f)!==-1;break;case"weakset":if(m)throw new o(A+"unable to use .deep.include with WeakSet",void 0,x);j=g.has(f);break;case"map":var F=m?e.eql:s;g.forEach(function(G){j=j||F(G,f)});break;case"set":m?g.forEach(function(G){j=j||e.eql(G,f)}):j=g.has(f);break;case"array":m?j=g.some(function(G){return e.eql(G,f)}):j=g.indexOf(f)!==-1;break;default:if(f!==Object(f))throw new o(A+"the given combination of arguments ("+v+" and "+e.type(f).toLowerCase()+") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a "+e.type(f).toLowerCase(),void 0,x);var X=Object.keys(f),z=null,L=0;if(X.forEach(function(G){var ie=new t(g);if(e.transferFlags(this,ie,!0),n(ie,"lockSsfi",!0),!T||X.length===1){ie.property(G,f[G]);return}try{ie.property(G,f[G])}catch(le){if(!e.checkError.compatibleConstructor(le,o))throw le;z===null&&(z=le),L++}},this),T&&X.length>1&&L===X.length)throw z;return}this.assert(j,"expected #{this} to "+M+"include "+e.inspect(f),"expected #{this} to not "+M+"include "+e.inspect(f))}t.addChainableMethod("include",c,a),t.addChainableMethod("contain",c,a),t.addChainableMethod("contains",c,a),t.addChainableMethod("includes",c,a),t.addProperty("ok",function(){this.assert(n(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),t.addProperty("true",function(){this.assert(n(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!n(this,"negate"))}),t.addProperty("false",function(){this.assert(n(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!n(this,"negate"))}),t.addProperty("null",function(){this.assert(n(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")}),t.addProperty("undefined",function(){this.assert(n(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")}),t.addProperty("NaN",function(){this.assert(e.isNaN(n(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function u(){var f=n(this,"object");this.assert(f!=null,"expected #{this} to exist","expected #{this} to not exist")}t.addProperty("exist",u),t.addProperty("exists",u),t.addProperty("empty",function(){var f=n(this,"object"),p=n(this,"ssfi"),g=n(this,"message"),v;switch(g=g?g+": ":"",e.type(f).toLowerCase()){case"array":case"string":v=f.length;break;case"map":case"set":v=f.size;break;case"weakmap":case"weakset":throw new o(g+".empty was passed a weak collection",void 0,p);case"function":var A=g+".empty was passed a function "+e.getName(f);throw new o(A.trim(),void 0,p);default:if(f!==Object(f))throw new o(g+".empty was passed non-string primitive "+e.inspect(f),void 0,p);v=Object.keys(f).length}this.assert(v===0,"expected #{this} to be empty","expected #{this} not to be empty")});function d(){var f=n(this,"object"),p=e.type(f);this.assert(p==="Arguments","expected #{this} to be arguments but got "+p,"expected #{this} to not be arguments")}t.addProperty("arguments",d),t.addProperty("Arguments",d);function w(f,p){p&&n(this,"message",p);var g=n(this,"object");if(n(this,"deep")){var v=n(this,"lockSsfi");n(this,"lockSsfi",!0),this.eql(f),n(this,"lockSsfi",v)}else this.assert(f===g,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",f,this._obj,!0)}t.addMethod("equal",w),t.addMethod("equals",w),t.addMethod("eq",w);function q(f,p){p&&n(this,"message",p),this.assert(e.eql(f,n(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",f,this._obj,!0)}t.addMethod("eql",q),t.addMethod("eqls",q);function k(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",x=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(v&&m!=="map"&&m!=="set"&&new t(g,A,x,!0).to.have.property("length"),!v&&m==="date"&&M!=="date")j=T+"the argument to above must be a date";else if(M!=="number"&&(v||m==="number"))j=T+"the argument to above must be a number";else if(!v&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,x);if(v){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L>f,"expected #{this} to have a "+z+" above #{exp} but got #{act}","expected #{this} to not have a "+z+" above #{exp}",f,L)}else this.assert(g>f,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",f)}t.addMethod("above",k),t.addMethod("gt",k),t.addMethod("greaterThan",k);function N(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",x=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(v&&m!=="map"&&m!=="set"&&new t(g,A,x,!0).to.have.property("length"),!v&&m==="date"&&M!=="date")j=T+"the argument to least must be a date";else if(M!=="number"&&(v||m==="number"))j=T+"the argument to least must be a number";else if(!v&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,x);if(v){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L>=f,"expected #{this} to have a "+z+" at least #{exp} but got #{act}","expected #{this} to have a "+z+" below #{exp}",f,L)}else this.assert(g>=f,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",f)}t.addMethod("least",N),t.addMethod("gte",N),t.addMethod("greaterThanOrEqual",N);function E(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",x=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(v&&m!=="map"&&m!=="set"&&new t(g,A,x,!0).to.have.property("length"),!v&&m==="date"&&M!=="date")j=T+"the argument to below must be a date";else if(M!=="number"&&(v||m==="number"))j=T+"the argument to below must be a number";else if(!v&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,x);if(v){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L<f,"expected #{this} to have a "+z+" below #{exp} but got #{act}","expected #{this} to not have a "+z+" below #{exp}",f,L)}else this.assert(g<f,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",f)}t.addMethod("below",E),t.addMethod("lt",E),t.addMethod("lessThan",E);function I(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"doLength"),A=n(this,"message"),T=A?A+": ":"",x=n(this,"ssfi"),m=e.type(g).toLowerCase(),M=e.type(f).toLowerCase(),j,F=!0;if(v&&m!=="map"&&m!=="set"&&new t(g,A,x,!0).to.have.property("length"),!v&&m==="date"&&M!=="date")j=T+"the argument to most must be a date";else if(M!=="number"&&(v||m==="number"))j=T+"the argument to most must be a number";else if(!v&&m!=="date"&&m!=="number"){var X=m==="string"?"'"+g+"'":g;j=T+"expected "+X+" to be a number or a date"}else F=!1;if(F)throw new o(j,void 0,x);if(v){var z="length",L;m==="map"||m==="set"?(z="size",L=g.size):L=g.length,this.assert(L<=f,"expected #{this} to have a "+z+" at most #{exp} but got #{act}","expected #{this} to have a "+z+" above #{exp}",f,L)}else this.assert(g<=f,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",f)}t.addMethod("most",I),t.addMethod("lte",I),t.addMethod("lessThanOrEqual",I),t.addMethod("within",function(f,p,g){g&&n(this,"message",g);var v=n(this,"object"),A=n(this,"doLength"),T=n(this,"message"),x=T?T+": ":"",m=n(this,"ssfi"),M=e.type(v).toLowerCase(),j=e.type(f).toLowerCase(),F=e.type(p).toLowerCase(),X,z=!0,L=j==="date"&&F==="date"?f.toISOString()+".."+p.toISOString():f+".."+p;if(A&&M!=="map"&&M!=="set"&&new t(v,T,m,!0).to.have.property("length"),!A&&M==="date"&&(j!=="date"||F!=="date"))X=x+"the arguments to within must be dates";else if((j!=="number"||F!=="number")&&(A||M==="number"))X=x+"the arguments to within must be numbers";else if(!A&&M!=="date"&&M!=="number"){var G=M==="string"?"'"+v+"'":v;X=x+"expected "+G+" to be a number or a date"}else z=!1;if(z)throw new o(X,void 0,m);if(A){var ie="length",le;M==="map"||M==="set"?(ie="size",le=v.size):le=v.length,this.assert(le>=f&&le<=p,"expected #{this} to have a "+ie+" within "+L,"expected #{this} to not have a "+ie+" within "+L)}else this.assert(v>=f&&v<=p,"expected #{this} to be within "+L,"expected #{this} to not be within "+L)});function B(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"ssfi"),A=n(this,"message");try{var T=g instanceof f}catch(m){throw m instanceof TypeError?(A=A?A+": ":"",new o(A+"The instanceof assertion needs a constructor but "+e.type(f)+" was given.",void 0,v)):m}var x=e.getName(f);x===null&&(x="an unnamed constructor"),this.assert(T,"expected #{this} to be an instance of "+x,"expected #{this} to not be an instance of "+x)}t.addMethod("instanceof",B),t.addMethod("instanceOf",B);function $(f,p,g){g&&n(this,"message",g);var v=n(this,"nested"),A=n(this,"own"),T=n(this,"message"),x=n(this,"object"),m=n(this,"ssfi"),M=typeof f;if(T=T?T+": ":"",v){if(M!=="string")throw new o(T+"the argument to property must be a string when using nested syntax",void 0,m)}else if(M!=="string"&&M!=="number"&&M!=="symbol")throw new o(T+"the argument to property must be a string, number, or symbol",void 0,m);if(v&&A)throw new o(T+'The "nested" and "own" flags cannot be combined.',void 0,m);if(x==null)throw new o(T+"Target cannot be null or undefined.",void 0,m);var j=n(this,"deep"),F=n(this,"negate"),X=v?e.getPathInfo(x,f):null,z=v?X.value:x[f],L="";j&&(L+="deep "),A&&(L+="own "),v&&(L+="nested "),L+="property ";var G;A?G=Object.prototype.hasOwnProperty.call(x,f):v?G=X.exists:G=e.hasProperty(x,f),(!F||arguments.length===1)&&this.assert(G,"expected #{this} to have "+L+e.inspect(f),"expected #{this} to not have "+L+e.inspect(f)),arguments.length>1&&this.assert(G&&(j?e.eql(p,z):p===z),"expected #{this} to have "+L+e.inspect(f)+" of #{exp}, but got #{act}","expected #{this} to not have "+L+e.inspect(f)+" of #{act}",p,z),n(this,"object",z)}t.addMethod("property",$);function Q(f,p,g){n(this,"own",!0),$.apply(this,arguments)}t.addMethod("ownProperty",Q),t.addMethod("haveOwnProperty",Q);function te(f,p,g){typeof p=="string"&&(g=p,p=null),g&&n(this,"message",g);var v=n(this,"object"),A=Object.getOwnPropertyDescriptor(Object(v),f);A&&p?this.assert(e.eql(p,A),"expected the own property descriptor for "+e.inspect(f)+" on #{this} to match "+e.inspect(p)+", got "+e.inspect(A),"expected the own property descriptor for "+e.inspect(f)+" on #{this} to not match "+e.inspect(p),p,A,!0):this.assert(A,"expected #{this} to have an own property descriptor for "+e.inspect(f),"expected #{this} to not have an own property descriptor for "+e.inspect(f)),n(this,"object",A)}t.addMethod("ownPropertyDescriptor",te),t.addMethod("haveOwnPropertyDescriptor",te);function y(){n(this,"doLength",!0)}function S(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=e.type(g).toLowerCase(),A=n(this,"message"),T=n(this,"ssfi"),x="length",m;switch(v){case"map":case"set":x="size",m=g.size;break;default:new t(g,A,T,!0).to.have.property("length"),m=g.length}this.assert(m==f,"expected #{this} to have a "+x+" of #{exp} but got #{act}","expected #{this} to not have a "+x+" of #{act}",f,m)}t.addChainableMethod("length",S,y),t.addChainableMethod("lengthOf",S,y);function C(f,p){p&&n(this,"message",p);var g=n(this,"object");this.assert(f.exec(g),"expected #{this} to match "+f,"expected #{this} not to match "+f)}t.addMethod("match",C),t.addMethod("matches",C),t.addMethod("string",function(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"message"),A=n(this,"ssfi");new t(g,v,A,!0).is.a("string"),this.assert(~g.indexOf(f),"expected #{this} to contain "+e.inspect(f),"expected #{this} to not contain "+e.inspect(f))});function U(f){var p=n(this,"object"),g=e.type(p),v=e.type(f),A=n(this,"ssfi"),T=n(this,"deep"),x,m="",M,j=!0,F=n(this,"message");F=F?F+": ":"";var X=F+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(g==="Map"||g==="Set")m=T?"deeply ":"",M=[],p.forEach(function(ce,Be){M.push(Be)}),v!=="Array"&&(f=Array.prototype.slice.call(arguments));else{switch(M=e.getOwnEnumerableProperties(p),v){case"Array":if(arguments.length>1)throw new o(X,void 0,A);break;case"Object":if(arguments.length>1)throw new o(X,void 0,A);f=Object.keys(f);break;default:f=Array.prototype.slice.call(arguments)}f=f.map(function(ce){return typeof ce=="symbol"?ce:String(ce)})}if(!f.length)throw new o(F+"keys required",void 0,A);var z=f.length,L=n(this,"any"),G=n(this,"all"),ie=f;if(!L&&!G&&(G=!0),L&&(j=ie.some(function(ce){return M.some(function(Be){return T?e.eql(ce,Be):ce===Be})})),G&&(j=ie.every(function(ce){return M.some(function(Be){return T?e.eql(ce,Be):ce===Be})}),n(this,"contains")||(j=j&&f.length==M.length)),z>1){f=f.map(function(ce){return e.inspect(ce)});var le=f.pop();G&&(x=f.join(", ")+", and "+le),L&&(x=f.join(", ")+", or "+le)}else x=e.inspect(f[0]);x=(z>1?"keys ":"key ")+x,x=(n(this,"contains")?"contain ":"have ")+x,this.assert(j,"expected #{this} to "+m+x,"expected #{this} to not "+m+x,ie.slice(0).sort(e.compareByInspect),M.sort(e.compareByInspect),!0)}t.addMethod("keys",U),t.addMethod("key",U);function re(f,p,g){g&&n(this,"message",g);var v=n(this,"object"),A=n(this,"ssfi"),T=n(this,"message"),x=n(this,"negate")||!1;new t(v,T,A,!0).is.a("function"),(f instanceof RegExp||typeof f=="string")&&(p=f,f=null);var m;try{v()}catch(ce){m=ce}var M=f===void 0&&p===void 0,j=Boolean(f&&p),F=!1,X=!1;if(M||!M&&!x){var z="an error";f instanceof Error?z="#{exp}":f&&(z=e.checkError.getConstructorName(f)),this.assert(m,"expected #{this} to throw "+z,"expected #{this} to not throw an error but #{act} was thrown",f&&f.toString(),m instanceof Error?m.toString():typeof m=="string"?m:m&&e.checkError.getConstructorName(m))}if(f&&m){if(f instanceof Error){var L=e.checkError.compatibleInstance(m,f);L===x&&(j&&x?F=!0:this.assert(x,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(m&&!x?" but #{act} was thrown":""),f.toString(),m.toString()))}var G=e.checkError.compatibleConstructor(m,f);G===x&&(j&&x?F=!0:this.assert(x,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(m?" but #{act} was thrown":""),f instanceof Error?f.toString():f&&e.checkError.getConstructorName(f),m instanceof Error?m.toString():m&&e.checkError.getConstructorName(m)))}if(m&&p!==void 0&&p!==null){var ie="including";p instanceof RegExp&&(ie="matching");var le=e.checkError.compatibleMessage(m,p);le===x&&(j&&x?X=!0:this.assert(x,"expected #{this} to throw error "+ie+" #{exp} but got #{act}","expected #{this} to throw error not "+ie+" #{exp}",p,e.checkError.getMessage(m)))}F&&X&&this.assert(x,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(m?" but #{act} was thrown":""),f instanceof Error?f.toString():f&&e.checkError.getConstructorName(f),m instanceof Error?m.toString():m&&e.checkError.getConstructorName(m)),n(this,"object",m)}t.addMethod("throw",re),t.addMethod("throws",re),t.addMethod("Throw",re);function De(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"itself"),A=typeof g=="function"&&!v?g.prototype[f]:g[f];this.assert(typeof A=="function","expected #{this} to respond to "+e.inspect(f),"expected #{this} to not respond to "+e.inspect(f))}t.addMethod("respondTo",De),t.addMethod("respondsTo",De),t.addProperty("itself",function(){n(this,"itself",!0)});function fe(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=f(g);this.assert(v,"expected #{this} to satisfy "+e.objDisplay(f),"expected #{this} to not satisfy"+e.objDisplay(f),!n(this,"negate"),v)}t.addMethod("satisfy",fe),t.addMethod("satisfies",fe);function gt(f,p,g){g&&n(this,"message",g);var v=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");if(new t(v,A,T,!0).is.a("number"),typeof f!="number"||typeof p!="number"){A=A?A+": ":"";var x=p===void 0?", and a delta is required":"";throw new o(A+"the arguments to closeTo or approximately must be numbers"+x,void 0,T)}this.assert(Math.abs(v-f)<=p,"expected #{this} to be close to "+f+" +/- "+p,"expected #{this} not to be close to "+f+" +/- "+p)}t.addMethod("closeTo",gt),t.addMethod("approximately",gt);function ge(f,p,g,v,A){if(!v){if(f.length!==p.length)return!1;p=p.slice()}return f.every(function(T,x){if(A)return g?g(T,p[x]):T===p[x];if(!g){var m=p.indexOf(T);return m===-1?!1:(v||p.splice(m,1),!0)}return p.some(function(M,j){return g(T,M)?(v||p.splice(j,1),!0):!1})})}t.addMethod("members",function(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"message"),A=n(this,"ssfi");new t(g,v,A,!0).to.be.an("array"),new t(f,v,A,!0).to.be.an("array");var T=n(this,"contains"),x=n(this,"ordered"),m,M,j;T?(m=x?"an ordered superset":"a superset",M="expected #{this} to be "+m+" of #{exp}",j="expected #{this} to not be "+m+" of #{exp}"):(m=x?"ordered members":"members",M="expected #{this} to have the same "+m+" as #{exp}",j="expected #{this} to not have the same "+m+" as #{exp}");var F=n(this,"deep")?e.eql:void 0;this.assert(ge(f,g,F,T,x),M,j,f,g,!0)});function Oe(f,p){p&&n(this,"message",p);var g=n(this,"object"),v=n(this,"message"),A=n(this,"ssfi"),T=n(this,"contains"),x=n(this,"deep");new t(f,v,A,!0).to.be.an("array"),T?this.assert(f.some(function(m){return g.indexOf(m)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",f,g):x?this.assert(f.some(function(m){return e.eql(g,m)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",f,g):this.assert(f.indexOf(g)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",f,g)}t.addMethod("oneOf",Oe);function xe(f,p,g){g&&n(this,"message",g);var v=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");new t(v,A,T,!0).is.a("function");var x;p?(new t(f,A,T,!0).to.have.property(p),x=f[p]):(new t(f,A,T,!0).is.a("function"),x=f()),v();var m=p==null?f():f[p],M=p==null?x:"."+p;n(this,"deltaMsgObj",M),n(this,"initialDeltaValue",x),n(this,"finalDeltaValue",m),n(this,"deltaBehavior","change"),n(this,"realDelta",m!==x),this.assert(x!==m,"expected "+M+" to change","expected "+M+" to not change")}t.addMethod("change",xe),t.addMethod("changes",xe);function tt(f,p,g){g&&n(this,"message",g);var v=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");new t(v,A,T,!0).is.a("function");var x;p?(new t(f,A,T,!0).to.have.property(p),x=f[p]):(new t(f,A,T,!0).is.a("function"),x=f()),new t(x,A,T,!0).is.a("number"),v();var m=p==null?f():f[p],M=p==null?x:"."+p;n(this,"deltaMsgObj",M),n(this,"initialDeltaValue",x),n(this,"finalDeltaValue",m),n(this,"deltaBehavior","increase"),n(this,"realDelta",m-x),this.assert(m-x>0,"expected "+M+" to increase","expected "+M+" to not increase")}t.addMethod("increase",tt),t.addMethod("increases",tt);function ar(f,p,g){g&&n(this,"message",g);var v=n(this,"object"),A=n(this,"message"),T=n(this,"ssfi");new t(v,A,T,!0).is.a("function");var x;p?(new t(f,A,T,!0).to.have.property(p),x=f[p]):(new t(f,A,T,!0).is.a("function"),x=f()),new t(x,A,T,!0).is.a("number"),v();var m=p==null?f():f[p],M=p==null?x:"."+p;n(this,"deltaMsgObj",M),n(this,"initialDeltaValue",x),n(this,"finalDeltaValue",m),n(this,"deltaBehavior","decrease"),n(this,"realDelta",x-m),this.assert(m-x<0,"expected "+M+" to decrease","expected "+M+" to not decrease")}t.addMethod("decrease",ar),t.addMethod("decreases",ar);function zr(f,p){p&&n(this,"message",p);var g=n(this,"deltaMsgObj"),v=n(this,"initialDeltaValue"),A=n(this,"finalDeltaValue"),T=n(this,"deltaBehavior"),x=n(this,"realDelta"),m;T==="change"?m=Math.abs(A-v)===Math.abs(f):m=x===Math.abs(f),this.assert(m,"expected "+g+" to "+T+" by "+f,"expected "+g+" to not "+T+" by "+f)}t.addMethod("by",zr),t.addProperty("extensible",function(){var f=n(this,"object"),p=f===Object(f)&&Object.isExtensible(f);this.assert(p,"expected #{this} to be extensible","expected #{this} to not be extensible")}),t.addProperty("sealed",function(){var f=n(this,"object"),p=f===Object(f)?Object.isSealed(f):!0;this.assert(p,"expected #{this} to be sealed","expected #{this} to not be sealed")}),t.addProperty("frozen",function(){var f=n(this,"object"),p=f===Object(f)?Object.isFrozen(f):!0;this.assert(p,"expected #{this} to be frozen","expected #{this} to not be frozen")}),t.addProperty("finite",function(f){var p=n(this,"object");this.assert(typeof p=="number"&&isFinite(p),"expected #{this} to be a finite number","expected #{this} to not be a finite number")})}});var ss=O((Ed,is)=>{is.exports=function(r,e){r.expect=function(t,o){return new r.Assertion(t,o)},r.expect.fail=function(t,o,n,i){throw arguments.length<2&&(n=t,t=void 0),n=n||"expect.fail()",new r.AssertionError(n,{actual:t,expected:o,operator:i},r.expect.fail)}}});var cs=O((Ad,as)=>{as.exports=function(r,e){var t=r.Assertion;function o(){function n(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new t(this.valueOf(),null,n):new t(this,null,n)}function i(a){Object.defineProperty(this,"should",{value:a,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,"should",{set:i,get:n,configurable:!0});var s={};return s.fail=function(a,c,u,d){throw arguments.length<2&&(u=a,a=void 0),u=u||"should.fail()",new r.AssertionError(u,{actual:a,expected:c,operator:d},s.fail)},s.equal=function(a,c,u){new t(a,u).to.equal(c)},s.Throw=function(a,c,u,d){new t(a,d).to.Throw(c,u)},s.exist=function(a,c){new t(a,c).to.exist},s.not={},s.not.equal=function(a,c,u){new t(a,u).to.not.equal(c)},s.not.Throw=function(a,c,u,d){new t(a,d).to.not.Throw(c,u)},s.not.exist=function(a,c){new t(a,c).to.not.exist},s.throw=s.Throw,s.not.throw=s.not.Throw,s}r.should=o,r.Should=o}});var fs=O((Sd,us)=>{us.exports=function(r,e){var t=r.Assertion,o=e.flag;var n=r.assert=function(i,s){var a=new t(null,null,r.assert,!0);a.assert(i,s,"[ negation message unavailable ]")};n.fail=function(i,s,a,c){throw arguments.length<2&&(a=i,i=void 0),a=a||"assert.fail()",new r.AssertionError(a,{actual:i,expected:s,operator:c},n.fail)},n.isOk=function(i,s){new t(i,s,n.isOk,!0).is.ok},n.isNotOk=function(i,s){new t(i,s,n.isNotOk,!0).is.not.ok},n.equal=function(i,s,a){var c=new t(i,a,n.equal,!0);c.assert(s==o(c,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",s,i,!0)},n.notEqual=function(i,s,a){var c=new t(i,a,n.notEqual,!0);c.assert(s!=o(c,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",s,i,!0)},n.strictEqual=function(i,s,a){new t(i,a,n.strictEqual,!0).to.equal(s)},n.notStrictEqual=function(i,s,a){new t(i,a,n.notStrictEqual,!0).to.not.equal(s)},n.deepEqual=n.deepStrictEqual=function(i,s,a){new t(i,a,n.deepEqual,!0).to.eql(s)},n.notDeepEqual=function(i,s,a){new t(i,a,n.notDeepEqual,!0).to.not.eql(s)},n.isAbove=function(i,s,a){new t(i,a,n.isAbove,!0).to.be.above(s)},n.isAtLeast=function(i,s,a){new t(i,a,n.isAtLeast,!0).to.be.least(s)},n.isBelow=function(i,s,a){new t(i,a,n.isBelow,!0).to.be.below(s)},n.isAtMost=function(i,s,a){new t(i,a,n.isAtMost,!0).to.be.most(s)},n.isTrue=function(i,s){new t(i,s,n.isTrue,!0).is.true},n.isNotTrue=function(i,s){new t(i,s,n.isNotTrue,!0).to.not.equal(!0)},n.isFalse=function(i,s){new t(i,s,n.isFalse,!0).is.false},n.isNotFalse=function(i,s){new t(i,s,n.isNotFalse,!0).to.not.equal(!1)},n.isNull=function(i,s){new t(i,s,n.isNull,!0).to.equal(null)},n.isNotNull=function(i,s){new t(i,s,n.isNotNull,!0).to.not.equal(null)},n.isNaN=function(i,s){new t(i,s,n.isNaN,!0).to.be.NaN},n.isNotNaN=function(i,s){new t(i,s,n.isNotNaN,!0).not.to.be.NaN},n.exists=function(i,s){new t(i,s,n.exists,!0).to.exist},n.notExists=function(i,s){new t(i,s,n.notExists,!0).to.not.exist},n.isUndefined=function(i,s){new t(i,s,n.isUndefined,!0).to.equal(void 0)},n.isDefined=function(i,s){new t(i,s,n.isDefined,!0).to.not.equal(void 0)},n.isFunction=function(i,s){new t(i,s,n.isFunction,!0).to.be.a("function")},n.isNotFunction=function(i,s){new t(i,s,n.isNotFunction,!0).to.not.be.a("function")},n.isObject=function(i,s){new t(i,s,n.isObject,!0).to.be.a("object")},n.isNotObject=function(i,s){new t(i,s,n.isNotObject,!0).to.not.be.a("object")},n.isArray=function(i,s){new t(i,s,n.isArray,!0).to.be.an("array")},n.isNotArray=function(i,s){new t(i,s,n.isNotArray,!0).to.not.be.an("array")},n.isString=function(i,s){new t(i,s,n.isString,!0).to.be.a("string")},n.isNotString=function(i,s){new t(i,s,n.isNotString,!0).to.not.be.a("string")},n.isNumber=function(i,s){new t(i,s,n.isNumber,!0).to.be.a("number")},n.isNotNumber=function(i,s){new t(i,s,n.isNotNumber,!0).to.not.be.a("number")},n.isFinite=function(i,s){new t(i,s,n.isFinite,!0).to.be.finite},n.isBoolean=function(i,s){new t(i,s,n.isBoolean,!0).to.be.a("boolean")},n.isNotBoolean=function(i,s){new t(i,s,n.isNotBoolean,!0).to.not.be.a("boolean")},n.typeOf=function(i,s,a){new t(i,a,n.typeOf,!0).to.be.a(s)},n.notTypeOf=function(i,s,a){new t(i,a,n.notTypeOf,!0).to.not.be.a(s)},n.instanceOf=function(i,s,a){new t(i,a,n.instanceOf,!0).to.be.instanceOf(s)},n.notInstanceOf=function(i,s,a){new t(i,a,n.notInstanceOf,!0).to.not.be.instanceOf(s)},n.include=function(i,s,a){new t(i,a,n.include,!0).include(s)},n.notInclude=function(i,s,a){new t(i,a,n.notInclude,!0).not.include(s)},n.deepInclude=function(i,s,a){new t(i,a,n.deepInclude,!0).deep.include(s)},n.notDeepInclude=function(i,s,a){new t(i,a,n.notDeepInclude,!0).not.deep.include(s)},n.nestedInclude=function(i,s,a){new t(i,a,n.nestedInclude,!0).nested.include(s)},n.notNestedInclude=function(i,s,a){new t(i,a,n.notNestedInclude,!0).not.nested.include(s)},n.deepNestedInclude=function(i,s,a){new t(i,a,n.deepNestedInclude,!0).deep.nested.include(s)},n.notDeepNestedInclude=function(i,s,a){new t(i,a,n.notDeepNestedInclude,!0).not.deep.nested.include(s)},n.ownInclude=function(i,s,a){new t(i,a,n.ownInclude,!0).own.include(s)},n.notOwnInclude=function(i,s,a){new t(i,a,n.notOwnInclude,!0).not.own.include(s)},n.deepOwnInclude=function(i,s,a){new t(i,a,n.deepOwnInclude,!0).deep.own.include(s)},n.notDeepOwnInclude=function(i,s,a){new t(i,a,n.notDeepOwnInclude,!0).not.deep.own.include(s)},n.match=function(i,s,a){new t(i,a,n.match,!0).to.match(s)},n.notMatch=function(i,s,a){new t(i,a,n.notMatch,!0).to.not.match(s)},n.property=function(i,s,a){new t(i,a,n.property,!0).to.have.property(s)},n.notProperty=function(i,s,a){new t(i,a,n.notProperty,!0).to.not.have.property(s)},n.propertyVal=function(i,s,a,c){new t(i,c,n.propertyVal,!0).to.have.property(s,a)},n.notPropertyVal=function(i,s,a,c){new t(i,c,n.notPropertyVal,!0).to.not.have.property(s,a)},n.deepPropertyVal=function(i,s,a,c){new t(i,c,n.deepPropertyVal,!0).to.have.deep.property(s,a)},n.notDeepPropertyVal=function(i,s,a,c){new t(i,c,n.notDeepPropertyVal,!0).to.not.have.deep.property(s,a)},n.ownProperty=function(i,s,a){new t(i,a,n.ownProperty,!0).to.have.own.property(s)},n.notOwnProperty=function(i,s,a){new t(i,a,n.notOwnProperty,!0).to.not.have.own.property(s)},n.ownPropertyVal=function(i,s,a,c){new t(i,c,n.ownPropertyVal,!0).to.have.own.property(s,a)},n.notOwnPropertyVal=function(i,s,a,c){new t(i,c,n.notOwnPropertyVal,!0).to.not.have.own.property(s,a)},n.deepOwnPropertyVal=function(i,s,a,c){new t(i,c,n.deepOwnPropertyVal,!0).to.have.deep.own.property(s,a)},n.notDeepOwnPropertyVal=function(i,s,a,c){new t(i,c,n.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(s,a)},n.nestedProperty=function(i,s,a){new t(i,a,n.nestedProperty,!0).to.have.nested.property(s)},n.notNestedProperty=function(i,s,a){new t(i,a,n.notNestedProperty,!0).to.not.have.nested.property(s)},n.nestedPropertyVal=function(i,s,a,c){new t(i,c,n.nestedPropertyVal,!0).to.have.nested.property(s,a)},n.notNestedPropertyVal=function(i,s,a,c){new t(i,c,n.notNestedPropertyVal,!0).to.not.have.nested.property(s,a)},n.deepNestedPropertyVal=function(i,s,a,c){new t(i,c,n.deepNestedPropertyVal,!0).to.have.deep.nested.property(s,a)},n.notDeepNestedPropertyVal=function(i,s,a,c){new t(i,c,n.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(s,a)},n.lengthOf=function(i,s,a){new t(i,a,n.lengthOf,!0).to.have.lengthOf(s)},n.hasAnyKeys=function(i,s,a){new t(i,a,n.hasAnyKeys,!0).to.have.any.keys(s)},n.hasAllKeys=function(i,s,a){new t(i,a,n.hasAllKeys,!0).to.have.all.keys(s)},n.containsAllKeys=function(i,s,a){new t(i,a,n.containsAllKeys,!0).to.contain.all.keys(s)},n.doesNotHaveAnyKeys=function(i,s,a){new t(i,a,n.doesNotHaveAnyKeys,!0).to.not.have.any.keys(s)},n.doesNotHaveAllKeys=function(i,s,a){new t(i,a,n.doesNotHaveAllKeys,!0).to.not.have.all.keys(s)},n.hasAnyDeepKeys=function(i,s,a){new t(i,a,n.hasAnyDeepKeys,!0).to.have.any.deep.keys(s)},n.hasAllDeepKeys=function(i,s,a){new t(i,a,n.hasAllDeepKeys,!0).to.have.all.deep.keys(s)},n.containsAllDeepKeys=function(i,s,a){new t(i,a,n.containsAllDeepKeys,!0).to.contain.all.deep.keys(s)},n.doesNotHaveAnyDeepKeys=function(i,s,a){new t(i,a,n.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(s)},n.doesNotHaveAllDeepKeys=function(i,s,a){new t(i,a,n.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(s)},n.throws=function(i,s,a,c){(typeof s=="string"||s instanceof RegExp)&&(a=s,s=null);var u=new t(i,c,n.throws,!0).to.throw(s,a);return o(u,"object")},n.doesNotThrow=function(i,s,a,c){(typeof s=="string"||s instanceof RegExp)&&(a=s,s=null),new t(i,c,n.doesNotThrow,!0).to.not.throw(s,a)},n.operator=function(i,s,a,c){var u;switch(s){case"==":u=i==a;break;case"===":u=i===a;break;case">":u=i>a;break;case">=":u=i>=a;break;case"<":u=i<a;break;case"<=":u=i<=a;break;case"!=":u=i!=a;break;case"!==":u=i!==a;break;default:throw c=c&&c+": ",new r.AssertionError(c+'Invalid operator "'+s+'"',void 0,n.operator)}var d=new t(u,c,n.operator,!0);d.assert(o(d,"object")===!0,"expected "+e.inspect(i)+" to be "+s+" "+e.inspect(a),"expected "+e.inspect(i)+" to not be "+s+" "+e.inspect(a))},n.closeTo=function(i,s,a,c){new t(i,c,n.closeTo,!0).to.be.closeTo(s,a)},n.approximately=function(i,s,a,c){new t(i,c,n.approximately,!0).to.be.approximately(s,a)},n.sameMembers=function(i,s,a){new t(i,a,n.sameMembers,!0).to.have.same.members(s)},n.notSameMembers=function(i,s,a){new t(i,a,n.notSameMembers,!0).to.not.have.same.members(s)},n.sameDeepMembers=function(i,s,a){new t(i,a,n.sameDeepMembers,!0).to.have.same.deep.members(s)},n.notSameDeepMembers=function(i,s,a){new t(i,a,n.notSameDeepMembers,!0).to.not.have.same.deep.members(s)},n.sameOrderedMembers=function(i,s,a){new t(i,a,n.sameOrderedMembers,!0).to.have.same.ordered.members(s)},n.notSameOrderedMembers=function(i,s,a){new t(i,a,n.notSameOrderedMembers,!0).to.not.have.same.ordered.members(s)},n.sameDeepOrderedMembers=function(i,s,a){new t(i,a,n.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(s)},n.notSameDeepOrderedMembers=function(i,s,a){new t(i,a,n.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(s)},n.includeMembers=function(i,s,a){new t(i,a,n.includeMembers,!0).to.include.members(s)},n.notIncludeMembers=function(i,s,a){new t(i,a,n.notIncludeMembers,!0).to.not.include.members(s)},n.includeDeepMembers=function(i,s,a){new t(i,a,n.includeDeepMembers,!0).to.include.deep.members(s)},n.notIncludeDeepMembers=function(i,s,a){new t(i,a,n.notIncludeDeepMembers,!0).to.not.include.deep.members(s)},n.includeOrderedMembers=function(i,s,a){new t(i,a,n.includeOrderedMembers,!0).to.include.ordered.members(s)},n.notIncludeOrderedMembers=function(i,s,a){new t(i,a,n.notIncludeOrderedMembers,!0).to.not.include.ordered.members(s)},n.includeDeepOrderedMembers=function(i,s,a){new t(i,a,n.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(s)},n.notIncludeDeepOrderedMembers=function(i,s,a){new t(i,a,n.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(s)},n.oneOf=function(i,s,a){new t(i,a,n.oneOf,!0).to.be.oneOf(s)},n.changes=function(i,s,a,c){arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.changes,!0).to.change(s,a)},n.changesBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.changesBy,!0).to.change(s,a).by(c)},n.doesNotChange=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.doesNotChange,!0).to.not.change(s,a)},n.changesButNotBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.changesButNotBy,!0).to.change(s,a).but.not.by(c)},n.increases=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.increases,!0).to.increase(s,a)},n.increasesBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.increasesBy,!0).to.increase(s,a).by(c)},n.doesNotIncrease=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.doesNotIncrease,!0).to.not.increase(s,a)},n.increasesButNotBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.increasesButNotBy,!0).to.increase(s,a).but.not.by(c)},n.decreases=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.decreases,!0).to.decrease(s,a)},n.decreasesBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.decreasesBy,!0).to.decrease(s,a).by(c)},n.doesNotDecrease=function(i,s,a,c){return arguments.length===3&&typeof s=="function"&&(c=a,a=null),new t(i,c,n.doesNotDecrease,!0).to.not.decrease(s,a)},n.doesNotDecreaseBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);return new t(i,u,n.doesNotDecreaseBy,!0).to.not.decrease(s,a).by(c)},n.decreasesButNotBy=function(i,s,a,c,u){if(arguments.length===4&&typeof s=="function"){var d=c;c=a,u=d}else arguments.length===3&&(c=a,a=null);new t(i,u,n.decreasesButNotBy,!0).to.decrease(s,a).but.not.by(c)};n.ifError=function(i){if(i)throw i},n.isExtensible=function(i,s){new t(i,s,n.isExtensible,!0).to.be.extensible},n.isNotExtensible=function(i,s){new t(i,s,n.isNotExtensible,!0).to.not.be.extensible},n.isSealed=function(i,s){new t(i,s,n.isSealed,!0).to.be.sealed},n.isNotSealed=function(i,s){new t(i,s,n.isNotSealed,!0).to.not.be.sealed},n.isFrozen=function(i,s){new t(i,s,n.isFrozen,!0).to.be.frozen},n.isNotFrozen=function(i,s){new t(i,s,n.isNotFrozen,!0).to.not.be.frozen},n.isEmpty=function(i,s){new t(i,s,n.isEmpty,!0).to.be.empty},n.isNotEmpty=function(i,s){new t(i,s,n.isNotEmpty,!0).to.not.be.empty};(function i(s,a){return n[a]=n[s],i})("isOk","ok")("isNotOk","notOk")("throws","throw")("throws","Throw")("isExtensible","extensible")("isNotExtensible","notExtensible")("isSealed","sealed")("isNotSealed","notSealed")("isFrozen","frozen")("isNotFrozen","notFrozen")("isEmpty","empty")("isNotEmpty","notEmpty")}});var $e=O(we=>{var ls=[];we.version="4.3.3";we.AssertionError=Wr();var hs=es();we.use=function(r){return~ls.indexOf(r)||(r(we,hs),ls.push(r)),we};we.util=hs;var Hu=ot();we.config=Hu;var ef=rs();we.use(ef);var tf=os();we.use(tf);var rf=ss();we.use(rf);var nf=cs();we.use(nf);var of=fs();we.use(of)});var ps=O((Nd,ds)=>{ds.exports=$e()});var ys=O((Ld,Le)=>{"use strict";var at=sn();Le.exports=(r,e)=>{let t=r.Assertion,o=r.assert,n=e.proxify;e.checkError&&(at=e.checkError);function i(y){return typeof y.catch!="function"&&typeof y.always=="function"&&typeof y.done=="function"&&typeof y.fail=="function"&&typeof y.pipe=="function"&&typeof y.progress=="function"&&typeof y.state=="function"}function s(y){if(typeof y._obj.then!="function")throw new TypeError(e.inspect(y._obj)+" is not a thenable.");if(i(y._obj))throw new TypeError("Chai as Promised is incompatible with thenables of jQuery<3.0.0, sorry! Please upgrade jQuery or use another Promises/A+ compatible library (see http://promisesaplus.com/).")}function a(y){return n===void 0?y:n(y)}function c(y,S){e.addMethod(t.prototype,y,function(){return s(this),S.apply(this,arguments)})}function u(y,S){e.addProperty(t.prototype,y,function(){return s(this),a(S.apply(this,arguments))})}function d(y,S){y.then(()=>S(),S)}function w(y,S,C){y.assert(!0,null,S,C.expected,C.actual)}function q(y,S,C){y.assert(!1,S,null,C.expected,C.actual)}function k(y){return typeof y.then=="function"?y:y._obj}function N(y){return y instanceof Error?y.toString():at.getConstructorName(y)}let E=Object.getOwnPropertyNames(t.prototype),I={};for(let y of E)I[y]=Object.getOwnPropertyDescriptor(t.prototype,y);u("fulfilled",function(){let y=k(this).then(S=>(w(this,"expected promise not to be fulfilled but it was fulfilled with #{act}",{actual:S}),S),S=>(q(this,"expected promise to be fulfilled but it was rejected with #{act}",{actual:N(S)}),S));return Le.exports.transferPromiseness(this,y),this}),u("rejected",function(){let y=k(this).then(S=>(q(this,"expected promise to be rejected but it was fulfilled with #{act}",{actual:S}),S),S=>(w(this,"expected promise not to be rejected but it was rejected with #{act}",{actual:N(S)}),S));return Le.exports.transferPromiseness(this,y),this}),c("rejectedWith",function(y,S,C){let U=null,re=e.flag(this,"negate")||!1;if(y===void 0&&S===void 0&&C===void 0)return this.rejected;C!==void 0&&e.flag(this,"message",C),y instanceof RegExp||typeof y=="string"?(S=y,y=null):y&&y instanceof Error?U=y.toString():typeof y=="function"?U=at.getConstructorName(y):y=null;let De=Boolean(y&&S),fe="including";S instanceof RegExp&&(fe="matching");let gt=k(this).then(ge=>{let Oe=null,xe=null;return y?(Oe="expected promise to be rejected with #{exp} but it was fulfilled with #{act}",xe=U):S&&(Oe=`expected promise to be rejected with an error ${fe} #{exp} but it was fulfilled with #{act}`,xe=S),q(this,Oe,{expected:xe,actual:ge}),ge},ge=>{let Oe=y&&(y instanceof Error?at.compatibleInstance(ge,y):at.compatibleConstructor(ge,y)),xe=S&&at.compatibleMessage(ge,S),tt=N(ge);return re&&De?Oe&&xe&&this.assert(!0,null,"expected promise not to be rejected with #{exp} but it was rejected with #{act}",U,tt):(y&&this.assert(Oe,"expected promise to be rejected with #{exp} but it was rejected with #{act}","expected promise not to be rejected with #{exp} but it was rejected with #{act}",U,tt),S&&this.assert(xe,`expected promise to be rejected with an error ${fe} #{exp} but got #{act}`,`expected promise not to be rejected with an error ${fe} #{exp}`,S,at.getMessage(ge))),ge});return Le.exports.transferPromiseness(this,gt),this}),u("eventually",function(){return e.flag(this,"eventually",!0),this}),c("notify",function(y){return d(k(this),y),this}),c("become",function(y,S){return this.eventually.deep.equal(y,S)}),E.filter(y=>y!=="assert"&&typeof I[y].value=="function").forEach(y=>{t.overwriteMethod(y,S=>function(){return Q(S,this,arguments)})}),E.filter(y=>y!=="_obj"&&typeof I[y].get=="function").forEach(y=>{t.prototype.__methods.hasOwnProperty(y)?t.overwriteChainableMethod(y,C=>function(){return Q(C,this,arguments)},C=>function(){return Q(C,this)}):t.overwriteProperty(y,C=>function(){return a(Q(C,this))})});function Q(y,S,C){if(!e.flag(S,"eventually"))return y.apply(S,C),S;let U=k(S).then(re=>(S._obj=re,e.flag(S,"eventually",!1),C&&Le.exports.transformAsserterArgs(C))).then(re=>(y.apply(S,re),S._obj));return Le.exports.transferPromiseness(S,U),S}let te=Object.getOwnPropertyNames(o).filter(y=>typeof o[y]=="function");o.isFulfilled=(y,S)=>new t(y,S).to.be.fulfilled,o.isRejected=(y,S,C,U)=>new t(y,U).to.be.rejectedWith(S,C,U),o.becomes=(y,S,C)=>o.eventually.deepEqual(y,S,C),o.doesNotBecome=(y,S,C)=>o.eventually.notDeepEqual(y,S,C),o.eventually={},te.forEach(y=>{o.eventually[y]=function(S){let C=Array.prototype.slice.call(arguments,1),U,re=arguments[o[y].length-1];typeof re=="string"&&(U=fe=>{throw new r.AssertionError(`${re}
5
5
 
6
- Original reason: ${e.inspect(fe)}`)});let De=S.then(fe=>o[y].apply(o,[fe].concat(C)),U);return De.notify=fe=>{d(De,fe)},De}})};Le.exports.transferPromiseness=(r,e)=>{r.then=e.then.bind(e)};Le.exports.transformAsserterArgs=r=>r});var hs=O((_d,ls)=>{"use strict";function Yu(r,e){let t="__deferred__",o=e.flag,n=r.Assertion;function i(x,I){let q=o(x,t)||[];q.push(I),o(x,t,q)}function s(x){let I=o(x,t)||[],q=x,$;for(o(x,t,void 0);$=I.shift();){let Q=$.call(q);Q!==void 0&&(q=Q)}return q}function a(x,I){let q=o(x,t);q&&q.length>0&&q.splice(-1,0,function(){o(this,"message",I)})}function c(x,I){I&&n.addChainableMethod(x,function($){return $&&a(this,$),s(this)},function(){return i(this,I),this})}function u(x){let I={assertCalled:!1,assert:function(){this.assertCalled=!0}};try{x.call(I)}catch{I.assertCalled=!0}return I.assertCalled}let d=Object.getOwnPropertyNames(n.prototype).map(function(x){let I=Object.getOwnPropertyDescriptor(n.prototype,x);return I.name=x,I});d.filter(function(x){return x.name!=="assert"&&x.name!=="constructor"&&typeof x.value=="function"}).forEach(function(x){n.overwriteMethod(x.name,function(I){return function(){let q=s(this);return I.apply(q,arguments)}})}),d.filter(function(x){return Object.prototype.hasOwnProperty.call(n.prototype.__methods,x.name)}).forEach(function(x){n.overwriteChainableMethod(x.name,function(I){return function(){let q=s(this);return I.apply(q,arguments)}},function(I){return function(){return i(this,I),this}})});let E=d.filter(function(x){return x.name!=="_obj"&&typeof x.get=="function"&&!Object.prototype.hasOwnProperty.call(n.prototype.__methods,x.name)});E.filter(function(x){return!u(x.get)}).forEach(function(x){n.overwriteProperty(x.name,function(I){return function(){return i(this,I),this}})}),E.filter(function(x){return u(x.get)}).forEach(function(x){c(x.name,x.get)}),n.addMethod("ensure",function(){return s(this)});let B=e.addProperty;e.addProperty=function(x,I,q){B.apply(e,arguments),c(I,q)};let k=e.addMethod;e.addMethod=function(x,I){k.apply(e,arguments),n.overwriteMethod(I,function(q){return function(){let $=s(this);return q.apply($,arguments)}})};let N=e.addChainableMethod;e.addChainableMethod=function(x,I){let q=!0;Object.prototype.hasOwnProperty.call(n.prototype,I)&&(q=!1),N.apply(e,arguments),q&&n.overwriteChainableMethod(I,function($){return function(){let Q=s(this);return $.apply(Q,arguments)}},function($){return function(){return i(this,$),this}})}}ls.exports=Yu});var ds=O((on,sn)=>{(function(){(function(r){return typeof ke=="function"&&typeof on=="object"&&typeof sn=="object"?sn.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):chai.use(r)})(function(r,e){var t=r.Assertion,o=t.prototype;t.addMethod("containSubset",function(i){var s=e.flag(this,"object"),a=r.config.showDiff;o.assert.call(this,n(i,s),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",i,s,a)}),r.assert.containSubset=function(i,s,a){new r.Assertion(i,a).to.be.containSubset(s)};function n(i,s){if(i===s)return!0;if(typeof s!=typeof i)return!1;if(typeof i!="object"||i===null)return i===s;if(i&&!s)return!1;if(Array.isArray(i)){if(typeof s.length!="number")return!1;var a=Array.prototype.slice.call(s);return i.every(function(c){return a.some(function(u){return n(c,u)})})}return i instanceof Date?s instanceof Date?i.getTime()===s.getTime():!1:Object.keys(i).every(function(c){var u=i[c],d=s[c];return typeof u=="object"&&u!==null&&d!==null?n(u,d):typeof u=="function"?u(d):d===u})}})}).call(on)});var ms=O((jd,ys)=>{"use strict";function ps(r,e){if(Uint8Array&&Uint8Array.prototype.every)return r.every(e);for(let t=0;t<r.length;t++)if(!e(r[t],t,r))return!1;return!0}ys.exports=function(r){let e=r.Assertion;e.addMethod("equalBytes",function(t){if(typeof t=="string"){if(t.length%2!==0||!/^[0-9a-f]*$/i.test(t))throw new TypeError("Invalid hex string: "+t)}else if(t.length===void 0)throw new TypeError("equalBytes consumes string, array, or array-like object; got none of those");let o=this._obj;new e(o).to.be.a("uint8array");let n;typeof t=="string"?n=t.length===o.length*2&&ps(o,function(i,s){return i===parseInt(t.substring(2*s,2*s+2),16)}):n=t.length===o.length&&ps(o,function(i,s){return t[s]===i}),this.assert(n,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",t)}),r.assert.equalBytes=function(t,o,n){return new e(t,n,r.assert.equalBytes,!0).to.equalBytes(o)}}});var bs=O((gs,an)=>{(function(r){typeof ke=="function"&&typeof gs=="object"&&typeof an=="object"?an.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):chai.use(r)})(function(r,e){r.string=r.string||{};function t(s){return typeof s=="string"}r.string.startsWith=function(s,a){return!t(s)||!t(a)?!1:s.indexOf(a)===0},r.string.endsWith=function(s,a){return!t(s)||!t(a)?!1:s.indexOf(a,s.length-a.length)!==-1},r.string.equalIgnoreCase=function(s,a){return!t(s)||!t(a)?!1:s.toLowerCase()===a.toLowerCase()},r.string.equalIgnoreSpaces=function(s,a){return!t(s)||!t(a)?!1:s.replace(/\s/g,"")===a.replace(/\s/g,"")},r.string.containIgnoreSpaces=function(s,a){return!t(s)||!t(a)?!1:s.replace(/\s/g,"").indexOf(a.replace(/\s/g,""))>-1},r.string.containIgnoreCase=function(s,a){return!t(s)||!t(a)?!1:s.toLowerCase().indexOf(a.toLowerCase())>-1},r.string.singleLine=function(s){return t(s)?s.trim().indexOf(`
7
- `)===-1:!1},r.string.reverseOf=function(s,a){return!t(s)||!t(a)?!1:s.split("").reverse().join("")===a},r.string.palindrome=function(s){if(!t(s))return!1;for(var a=s.length,c=0;c<Math.floor(a/2);c++)if(s[c]!==s[a-1-c])return!1;return!0},r.string.entriesCount=function(s,a,c){var u=0;if(t(s)&&t(a))for(var d=0,E=s.length;d<E;){var B=s.indexOf(a,d);if(B===-1)break;u++,d=B+1}return u===c},r.string.indexOf=function(s,a,c){var u=!t(s)||!t(a)?-1:s.indexOf(a);return u===c};var o=function(s){var a=this._obj;return this.assert(r.string.startsWith(a,s),"expected "+this._obj+" to start with "+s,"expected "+this._obj+" not to start with "+s)};r.Assertion.addChainableMethod("startsWith",o),r.Assertion.addChainableMethod("startWith",o);var n=function(s){var a=this._obj;return this.assert(r.string.endsWith(a,s),"expected "+this._obj+" to end with "+s,"expected "+this._obj+" not to end with "+s)};r.Assertion.addChainableMethod("endsWith",n),r.Assertion.addChainableMethod("endWith",n),r.Assertion.addChainableMethod("equalIgnoreCase",function(s){var a=this._obj;return this.assert(r.string.equalIgnoreCase(a,s),"expected "+this._obj+" to equal "+s+" ignoring case","expected "+this._obj+" not to equal "+s+" ignoring case")}),r.Assertion.addChainableMethod("equalIgnoreSpaces",function(s){var a=this._obj;return this.assert(r.string.equalIgnoreSpaces(a,s),"expected "+this._obj+" to equal "+s+" ignoring spaces","expected "+this._obj+" not to equal "+s+" ignoring spaces")}),r.Assertion.addChainableMethod("containIgnoreSpaces",function(s){var a=this._obj;return this.assert(r.string.containIgnoreSpaces(a,s),"expected "+this._obj+" to contain "+s+" ignoring spaces","expected "+this._obj+" not to contain "+s+" ignoring spaces")}),r.Assertion.addChainableMethod("containIgnoreCase",function(s){var a=this._obj;return this.assert(r.string.containIgnoreCase(a,s),"expected "+this._obj+" to contain "+s+" ignoring case","expected "+this._obj+" not to contain "+s+" ignoring case")}),r.Assertion.addChainableMethod("singleLine",function(){var s=this._obj;return this.assert(r.string.singleLine(s),"expected "+this._obj+" to be a single line","expected "+this._obj+" not to be a single line")}),r.Assertion.addChainableMethod("reverseOf",function(s){var a=this._obj;return this.assert(r.string.reverseOf(a,s),"expected "+this._obj+" to be the reverse of "+s,"expected "+this._obj+" not to be the reverse of "+s)}),r.Assertion.addChainableMethod("palindrome",function(){var s=this._obj;return this.assert(r.string.palindrome(s),"expected "+this._obj+" to be a palindrome","expected "+this._obj+" not to be a palindrome")}),r.Assertion.addChainableMethod("entriesCount",function(s,a){var c=this._obj;return this.assert(r.string.entriesCount(c,s,a),"expected "+this._obj+" to have "+s+" "+a+" time(s)","expected "+this._obj+" to not have "+s+" "+a+" time(s)")}),r.Assertion.addChainableMethod("indexOf",function(s,a){var c=this._obj;return this.assert(r.string.indexOf(c,s,a),"expected "+this._obj+" to have "+s+" on index "+a,"expected "+this._obj+" to not have "+s+" on index "+a)});var i=r.assert;i.startsWith=function(s,a,c){new r.Assertion(s,c).to.startsWith(a)},i.notStartsWith=function(s,a,c){new r.Assertion(s,c).to.not.startsWith(a)},i.endsWith=function(s,a,c){new r.Assertion(s,c).to.endsWith(a)},i.notEndsWith=function(s,a,c){new r.Assertion(s,c).to.not.endsWith(a)},i.equalIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.be.equalIgnoreCase(a)},i.notEqualIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.not.be.equalIgnoreCase(a)},i.equalIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.be.equalIgnoreSpaces(a)},i.notEqualIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.not.be.equalIgnoreSpaces(a)},i.containIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.be.containIgnoreSpaces(a)},i.notContainIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.not.be.containIgnoreSpaces(a)},i.containIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.be.containIgnoreCase(a)},i.notContainIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.not.be.containIgnoreCase(a)},i.singleLine=function(s,a,c){new r.Assertion(s,c).to.be.singleLine()},i.notSingleLine=function(s,a,c){new r.Assertion(s,c).to.not.be.singleLine()},i.reverseOf=function(s,a,c){new r.Assertion(s,c).to.be.reverseOf(a)},i.notReverseOf=function(s,a,c){new r.Assertion(s,c).to.not.be.reverseOf(a)},i.palindrome=function(s,a,c){new r.Assertion(s,c).to.be.palindrome()},i.notPalindrome=function(s,a,c){new r.Assertion(s,c).to.not.be.palindrome()},i.entriesCount=function(s,a,c,u){new r.Assertion(s,u).to.have.entriesCount(a,c)},i.indexOf=function(s,a,c,u){new r.Assertion(s,u).to.have.indexOf(a,c)}})});var Ks=O((Gp,Gs)=>{function Ne(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Gs.exports=Ne;Ne.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Ne.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Ne.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},t),this._options.unref&&this._timer.unref(),!0};Ne.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Ne.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};Ne.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};Ne.prototype.start=Ne.prototype.try;Ne.prototype.errors=function(){return this._errors};Ne.prototype.attempts=function(){return this._attempts};Ne.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,o=0;o<this._errors.length;o++){var n=this._errors[o],i=n.message,s=(r[i]||0)+1;r[i]=s,s>=t&&(e=n,t=s)}return e}});var Js=O(ut=>{var pl=Ks();ut.operation=function(r){var e=ut.timeouts(r);return new pl(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};ut.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],n=0;n<e.retries;n++)o.push(this.createTimeout(n,e));return r&&r.forever&&!o.length&&o.push(this.createTimeout(n,e)),o.sort(function(i,s){return i-s}),o};ut.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,o=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return o=Math.min(o,e.maxTimeout),o};ut.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var o in r)typeof r[o]=="function"&&t.push(o)}for(var n=0;n<t.length;n++){var i=t[n],s=r[i];r[i]=function(c){var u=ut.operation(e),d=Array.prototype.slice.call(arguments,1),E=d.pop();d.push(function(B){u.retry(B)||(B&&(arguments[0]=u.mainError()),E.apply(this,arguments))}),u.attempt(function(){c.apply(r,d)})}.bind(r,s),r[i].options=e}}});var Qs=O((Jp,Xs)=>{Xs.exports=Js()});var ca=O(($y,aa)=>{aa.exports=Fn;var sa=128,Il=127,Dl=~Il,_l=Math.pow(2,31);function Fn(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Fn.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var o=t;r>=_l;)e[t++]=r&255|sa,r/=128;for(;r&Dl;)e[t++]=r&255|sa,r>>>=7;return e[t]=r|0,Fn.bytes=t-o+1,e}});var la=O((Wy,fa)=>{fa.exports=Vn;var Cl=128,ua=127;function Vn(r,o){var t=0,o=o||0,n=0,i=o,s,a=r.length;do{if(i>=a||n>49)throw Vn.bytes=0,new RangeError("Could not decode varint");s=r[i++],t+=n<28?(s&ua)<<n:(s&ua)*Math.pow(2,n),n+=7}while(s>=Cl);return Vn.bytes=i-o,t}});var da=O((Gy,ha)=>{var jl=Math.pow(2,7),ql=Math.pow(2,14),Bl=Math.pow(2,21),kl=Math.pow(2,28),Ll=Math.pow(2,35),Ul=Math.pow(2,42),Rl=Math.pow(2,49),zl=Math.pow(2,56),Fl=Math.pow(2,63);ha.exports=function(r){return r<jl?1:r<ql?2:r<Bl?3:r<kl?4:r<Ll?5:r<Ul?6:r<Rl?7:r<zl?8:r<Fl?9:10}});var Er=O((Ky,pa)=>{pa.exports={encode:ca(),decode:la(),encodingLength:da()}});var Zn=O((am,Ta)=>{"use strict";function Sa(r,e){for(let t in e)Object.defineProperty(r,t,{value:e[t],enumerable:!0,configurable:!0});return r}function nh(r,e,t){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=""),e&&(t.code=e);try{return Sa(r,t)}catch{t.message=r.message,t.stack=r.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(r)),Sa(new n,t)}}Ta.exports=nh});var Da=O((ym,Ia)=>{"use strict";Ia.exports=ch;function ch(r,e){for(var t=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)t[o++]=arguments[n++];return new Promise(function(a,c){t[o]=function(d){if(i)if(i=!1,d)c(d);else{for(var E=new Array(arguments.length-1),B=0;B<E.length;)E[B++]=arguments[B];a.apply(null,E)}};try{r.apply(e||null,t)}catch(u){i&&(i=!1,c(u))}})}});var qa=O(ja=>{"use strict";var Pr=ja;Pr.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4>1&&e.charAt(t)==="=";)++o;return Math.ceil(e.length*3)/4-o};var Dt=new Array(64),Ca=new Array(123);for(Me=0;Me<64;)Ca[Dt[Me]=Me<26?Me+65:Me<52?Me+71:Me<62?Me-4:Me-59|43]=Me++;var Me;Pr.encode=function(e,t,o){for(var n=null,i=[],s=0,a=0,c;t<o;){var u=e[t++];switch(a){case 0:i[s++]=Dt[u>>2],c=(u&3)<<4,a=1;break;case 1:i[s++]=Dt[c|u>>4],c=(u&15)<<2,a=2;break;case 2:i[s++]=Dt[c|u>>6],i[s++]=Dt[u&63],a=0;break}s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),s=0)}return a&&(i[s++]=Dt[c],i[s++]=61,a===1&&(i[s++]=61)),n?(s&&n.push(String.fromCharCode.apply(String,i.slice(0,s))),n.join("")):String.fromCharCode.apply(String,i.slice(0,s))};var _a="invalid encoding";Pr.decode=function(e,t,o){for(var n=o,i=0,s,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&i>1)break;if((c=Ca[c])===void 0)throw Error(_a);switch(i){case 0:s=c,i=1;break;case 1:t[o++]=s<<2|(c&48)>>4,s=c,i=2;break;case 2:t[o++]=(s&15)<<4|(c&60)>>2,s=c,i=3;break;case 3:t[o++]=(s&3)<<6|c,i=0;break}}if(i===1)throw Error(_a);return o-n};Pr.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var ka=O((gm,Ba)=>{"use strict";Ba.exports=Or;function Or(){this._listeners={}}Or.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Or.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],n=0;n<o.length;)o[n].fn===t?o.splice(n,1):++n;return this};Or.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],n=1;n<arguments.length;)o.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,o)}return this}});var $a=O((bm,Va)=>{"use strict";Va.exports=La(La);function La(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function n(c,u,d){e[0]=c,u[d]=t[0],u[d+1]=t[1],u[d+2]=t[2],u[d+3]=t[3]}function i(c,u,d){e[0]=c,u[d]=t[3],u[d+1]=t[2],u[d+2]=t[1],u[d+3]=t[0]}r.writeFloatLE=o?n:i,r.writeFloatBE=o?i:n;function s(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],e[0]}function a(c,u){return t[3]=c[u],t[2]=c[u+1],t[1]=c[u+2],t[0]=c[u+3],e[0]}r.readFloatLE=o?s:a,r.readFloatBE=o?a:s}():function(){function e(o,n,i,s){var a=n<0?1:0;if(a&&(n=-n),n===0)o(1/n>0?0:2147483648,i,s);else if(isNaN(n))o(2143289344,i,s);else if(n>34028234663852886e22)o((a<<31|2139095040)>>>0,i,s);else if(n<11754943508222875e-54)o((a<<31|Math.round(n/1401298464324817e-60))>>>0,i,s);else{var c=Math.floor(Math.log(n)/Math.LN2),u=Math.round(n*Math.pow(2,-c)*8388608)&8388607;o((a<<31|c+127<<23|u)>>>0,i,s)}}r.writeFloatLE=e.bind(null,Ua),r.writeFloatBE=e.bind(null,Ra);function t(o,n,i){var s=o(n,i),a=(s>>31)*2+1,c=s>>>23&255,u=s&8388607;return c===255?u?NaN:a*(1/0):c===0?a*1401298464324817e-60*u:a*Math.pow(2,c-150)*(u+8388608)}r.readFloatLE=t.bind(null,za),r.readFloatBE=t.bind(null,Fa)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function n(c,u,d){e[0]=c,u[d]=t[0],u[d+1]=t[1],u[d+2]=t[2],u[d+3]=t[3],u[d+4]=t[4],u[d+5]=t[5],u[d+6]=t[6],u[d+7]=t[7]}function i(c,u,d){e[0]=c,u[d]=t[7],u[d+1]=t[6],u[d+2]=t[5],u[d+3]=t[4],u[d+4]=t[3],u[d+5]=t[2],u[d+6]=t[1],u[d+7]=t[0]}r.writeDoubleLE=o?n:i,r.writeDoubleBE=o?i:n;function s(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],t[4]=c[u+4],t[5]=c[u+5],t[6]=c[u+6],t[7]=c[u+7],e[0]}function a(c,u){return t[7]=c[u],t[6]=c[u+1],t[5]=c[u+2],t[4]=c[u+3],t[3]=c[u+4],t[2]=c[u+5],t[1]=c[u+6],t[0]=c[u+7],e[0]}r.readDoubleLE=o?s:a,r.readDoubleBE=o?a:s}():function(){function e(o,n,i,s,a,c){var u=s<0?1:0;if(u&&(s=-s),s===0)o(0,a,c+n),o(1/s>0?0:2147483648,a,c+i);else if(isNaN(s))o(0,a,c+n),o(2146959360,a,c+i);else if(s>17976931348623157e292)o(0,a,c+n),o((u<<31|2146435072)>>>0,a,c+i);else{var d;if(s<22250738585072014e-324)d=s/5e-324,o(d>>>0,a,c+n),o((u<<31|d/4294967296)>>>0,a,c+i);else{var E=Math.floor(Math.log(s)/Math.LN2);E===1024&&(E=1023),d=s*Math.pow(2,-E),o(d*4503599627370496>>>0,a,c+n),o((u<<31|E+1023<<20|d*1048576&1048575)>>>0,a,c+i)}}}r.writeDoubleLE=e.bind(null,Ua,0,4),r.writeDoubleBE=e.bind(null,Ra,4,0);function t(o,n,i,s,a){var c=o(s,a+n),u=o(s,a+i),d=(u>>31)*2+1,E=u>>>20&2047,B=4294967296*(u&1048575)+c;return E===2047?B?NaN:d*(1/0):E===0?d*5e-324*B:d*Math.pow(2,E-1075)*(B+4503599627370496)}r.readDoubleLE=t.bind(null,za,0,4),r.readDoubleBE=t.bind(null,Fa,4,0)}(),r}function Ua(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Ra(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function za(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function Fa(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var Wa=O((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var Ka=O(Ga=>{"use strict";var eo=Ga;eo.length=function(e){for(var t=0,o=0,n=0;n<e.length;++n)o=e.charCodeAt(n),o<128?t+=1:o<2048?t+=2:(o&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3;return t};eo.read=function(e,t,o){var n=o-t;if(n<1)return"";for(var i=null,s=[],a=0,c;t<o;)c=e[t++],c<128?s[a++]=c:c>191&&c<224?s[a++]=(c&31)<<6|e[t++]&63:c>239&&c<365?(c=((c&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,s[a++]=55296+(c>>10),s[a++]=56320+(c&1023)):s[a++]=(c&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};eo.write=function(e,t,o){for(var n=o,i,s,a=0;a<e.length;++a)i=e.charCodeAt(a),i<128?t[o++]=i:i<2048?(t[o++]=i>>6|192,t[o++]=i&63|128):(i&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++a,t[o++]=i>>18|240,t[o++]=i>>12&63|128,t[o++]=i>>6&63|128,t[o++]=i&63|128):(t[o++]=i>>12|224,t[o++]=i>>6&63|128,t[o++]=i&63|128);return o-n}});var Xa=O((vm,Ja)=>{"use strict";Ja.exports=uh;function uh(r,e,t){var o=t||8192,n=o>>>1,i=null,s=o;return function(c){if(c<1||c>n)return r(c);s+c>o&&(i=r(o),s=0);var u=e.call(i,s,s+=c);return s&7&&(s=(s|7)+1),u}}});var Za=O((xm,Qa)=>{"use strict";Qa.exports=se;var tr=ht();function se(r,e){this.lo=r>>>0,this.hi=e>>>0}var lt=se.zero=new se(0,0);lt.toNumber=function(){return 0};lt.zzEncode=lt.zzDecode=function(){return this};lt.length=function(){return 1};var fh=se.zeroHash="\0\0\0\0\0\0\0\0";se.fromNumber=function(e){if(e===0)return lt;var t=e<0;t&&(e=-e);var o=e>>>0,n=(e-o)/4294967296>>>0;return t&&(n=~n>>>0,o=~o>>>0,++o>4294967295&&(o=0,++n>4294967295&&(n=0))),new se(o,n)};se.from=function(e){if(typeof e=="number")return se.fromNumber(e);if(tr.isString(e))if(tr.Long)e=tr.Long.fromString(e);else return se.fromNumber(parseInt(e,10));return e.low||e.high?new se(e.low>>>0,e.high>>>0):lt};se.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,o=~this.hi>>>0;return t||(o=o+1>>>0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};se.prototype.toLong=function(e){return tr.Long?new tr.Long(this.lo|0,this.hi|0,Boolean(e)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(e)}};var Xe=String.prototype.charCodeAt;se.fromHash=function(e){return e===fh?lt:new se((Xe.call(e,0)|Xe.call(e,1)<<8|Xe.call(e,2)<<16|Xe.call(e,3)<<24)>>>0,(Xe.call(e,4)|Xe.call(e,5)<<8|Xe.call(e,6)<<16|Xe.call(e,7)<<24)>>>0)};se.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};se.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};se.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};se.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:o<128?9:10}});var ht=O(to=>{"use strict";var _=to;_.asPromise=Da();_.base64=qa();_.EventEmitter=ka();_.float=$a();_.inquire=Wa();_.utf8=Ka();_.pool=Xa();_.LongBits=Za();_.isNode=Boolean(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);_.global=_.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||to;_.emptyArray=Object.freeze?Object.freeze([]):[];_.emptyObject=Object.freeze?Object.freeze({}):{};_.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};_.isString=function(e){return typeof e=="string"||e instanceof String};_.isObject=function(e){return e&&typeof e=="object"};_.isset=_.isSet=function(e,t){var o=e[t];return o!=null&&e.hasOwnProperty(t)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1};_.Buffer=function(){try{var r=_.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();_._Buffer_from=null;_._Buffer_allocUnsafe=null;_.newBuffer=function(e){return typeof e=="number"?_.Buffer?_._Buffer_allocUnsafe(e):new _.Array(e):_.Buffer?_._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};_.Array=typeof Uint8Array<"u"?Uint8Array:Array;_.Long=_.global.dcodeIO&&_.global.dcodeIO.Long||_.global.Long||_.inquire("long");_.key2Re=/^true|false|0|1$/;_.key32Re=/^-?(?:0|[1-9][0-9]*)$/;_.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;_.longToHash=function(e){return e?_.LongBits.from(e).toHash():_.LongBits.zeroHash};_.longFromHash=function(e,t){var o=_.LongBits.fromHash(e);return _.Long?_.Long.fromBits(o.lo,o.hi,t):o.toNumber(Boolean(t))};function Ya(r,e,t){for(var o=Object.keys(e),n=0;n<o.length;++n)(r[o[n]]===void 0||!t)&&(r[o[n]]=e[o[n]]);return r}_.merge=Ya;_.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function Ha(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&Ya(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}_.newError=Ha;_.ProtocolError=Ha("ProtocolError");_.oneOfGetter=function(e){for(var t={},o=0;o<e.length;++o)t[e[o]]=1;return function(){for(var n=Object.keys(this),i=n.length-1;i>-1;--i)if(t[n[i]]===1&&this[n[i]]!==void 0&&this[n[i]]!==null)return n[i]}};_.oneOfSetter=function(e){return function(t){for(var o=0;o<e.length;++o)e[o]!==t&&delete this[e[o]]}};_.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};_._configure=function(){var r=_.Buffer;if(!r){_._Buffer_from=_._Buffer_allocUnsafe=null;return}_._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,o){return new r(t,o)},_._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var oo=O((Am,oc)=>{"use strict";oc.exports=ne;var Ce=ht(),no,rc=Ce.LongBits,lh=Ce.utf8;function Ie(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function ne(r){this.buf=r,this.pos=0,this.len=r.length}var ec=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new ne(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new ne(e);throw Error("illegal buffer")},nc=function(){return Ce.Buffer?function(t){return(ne.create=function(n){return Ce.Buffer.isBuffer(n)?new no(n):ec(n)})(t)}:ec};ne.create=nc();ne.prototype._slice=Ce.Array.prototype.subarray||Ce.Array.prototype.slice;ne.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Ie(this,10);return e}}();ne.prototype.int32=function(){return this.uint32()|0};ne.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function ro(){var r=new rc(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw Ie(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw Ie(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}ne.prototype.bool=function(){return this.uint32()!==0};function Mr(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}ne.prototype.fixed32=function(){if(this.pos+4>this.len)throw Ie(this,4);return Mr(this.buf,this.pos+=4)};ne.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Ie(this,4);return Mr(this.buf,this.pos+=4)|0};function tc(){if(this.pos+8>this.len)throw Ie(this,8);return new rc(Mr(this.buf,this.pos+=4),Mr(this.buf,this.pos+=4))}ne.prototype.float=function(){if(this.pos+4>this.len)throw Ie(this,4);var e=Ce.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};ne.prototype.double=function(){if(this.pos+8>this.len)throw Ie(this,4);var e=Ce.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};ne.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o>this.len)throw Ie(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,o):t===o?new this.buf.constructor(0):this._slice.call(this.buf,t,o)};ne.prototype.string=function(){var e=this.bytes();return lh.read(e,0,e.length)};ne.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Ie(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Ie(this);while(this.buf[this.pos++]&128);return this};ne.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};ne._configure=function(r){no=r,ne.create=nc(),no._configure();var e=Ce.Long?"toLong":"toNumber";Ce.merge(ne.prototype,{int64:function(){return ro.call(this)[e](!1)},uint64:function(){return ro.call(this)[e](!0)},sint64:function(){return ro.call(this).zzDecode()[e](!1)},fixed64:function(){return tc.call(this)[e](!0)},sfixed64:function(){return tc.call(this)[e](!1)}})}});var cc=O((Sm,ac)=>{"use strict";ac.exports=dt;var sc=oo();(dt.prototype=Object.create(sc.prototype)).constructor=dt;var ic=ht();function dt(r){sc.call(this,r)}dt._configure=function(){ic.Buffer&&(dt.prototype._slice=ic.Buffer.prototype.slice)};dt.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};dt._configure()});var lo=O((Tm,hc)=>{"use strict";hc.exports=V;var Pe=ht(),io,Ir=Pe.LongBits,uc=Pe.base64,fc=Pe.utf8;function rr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function ao(){}function hh(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function V(){this.len=0,this.head=new rr(ao,0,0),this.tail=this.head,this.states=null}var lc=function(){return Pe.Buffer?function(){return(V.create=function(){return new io})()}:function(){return new V}};V.create=lc();V.alloc=function(e){return new Pe.Array(e)};Pe.Array!==Array&&(V.alloc=Pe.pool(V.alloc,Pe.Array.prototype.subarray));V.prototype._push=function(e,t,o){return this.tail=this.tail.next=new rr(e,t,o),this.len+=t,this};function co(r,e,t){e[t]=r&255}function dh(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function uo(r,e){this.len=r,this.next=void 0,this.val=e}uo.prototype=Object.create(rr.prototype);uo.prototype.fn=dh;V.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new uo((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};V.prototype.int32=function(e){return e<0?this._push(fo,10,Ir.fromNumber(e)):this.uint32(e)};V.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function fo(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}V.prototype.uint64=function(e){var t=Ir.from(e);return this._push(fo,t.length(),t)};V.prototype.int64=V.prototype.uint64;V.prototype.sint64=function(e){var t=Ir.from(e).zzEncode();return this._push(fo,t.length(),t)};V.prototype.bool=function(e){return this._push(co,1,e?1:0)};function so(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}V.prototype.fixed32=function(e){return this._push(so,4,e>>>0)};V.prototype.sfixed32=V.prototype.fixed32;V.prototype.fixed64=function(e){var t=Ir.from(e);return this._push(so,4,t.lo)._push(so,4,t.hi)};V.prototype.sfixed64=V.prototype.fixed64;V.prototype.float=function(e){return this._push(Pe.float.writeFloatLE,4,e)};V.prototype.double=function(e){return this._push(Pe.float.writeDoubleLE,8,e)};var ph=Pe.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var n=0;n<e.length;++n)t[o+n]=e[n]};V.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(co,1,0);if(Pe.isString(e)){var o=V.alloc(t=uc.length(e));uc.decode(e,o,0),e=o}return this.uint32(t)._push(ph,t,e)};V.prototype.string=function(e){var t=fc.length(e);return t?this.uint32(t)._push(fc.write,t,e):this._push(co,1,0)};V.prototype.fork=function(){return this.states=new hh(this),this.head=this.tail=new rr(ao,0,0),this.len=0,this};V.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new rr(ao,0,0),this.len=0),this};V.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=t,this.len+=o),this};V.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};V._configure=function(r){io=r,V.create=lc(),io._configure()}});var yc=O((Nm,pc)=>{"use strict";pc.exports=je;var dc=lo();(je.prototype=Object.create(dc.prototype)).constructor=je;var Qe=ht();function je(){dc.call(this)}je._configure=function(){je.alloc=Qe._Buffer_allocUnsafe,je.writeBytesBuffer=Qe.Buffer&&Qe.Buffer.prototype instanceof Uint8Array&&Qe.Buffer.prototype.set.name==="set"?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var n=0;n<e.length;)t[o++]=e[n++]}};je.prototype.bytes=function(e){Qe.isString(e)&&(e=Qe._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(je.writeBytesBuffer,t,e),this};function yh(r,e,t){r.length<40?Qe.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}je.prototype.string=function(e){var t=Qe.Buffer.byteLength(e);return this.uint32(t),t&&this._push(yh,t,e),this};je._configure()});var jh={};be(jh,{connectInteropTests:()=>un,dhtInteropTests:()=>jn,interopTests:()=>Ch,pubsubInteropTests:()=>qn,relayInteropTests:()=>wo,streamInteropTests:()=>Un});var Se=oe(us(),1),vd=Se.default.expect,xd=Se.default.version,Ed=Se.default.Assertion,Ad=Se.default.AssertionError,Sd=Se.default.util,Td=Se.default.config,Nd=Se.default.use,Pd=Se.default.should,Od=Se.default.assert,Md=Se.default.core,We=Se.default;var ws=oe(fs(),1),vs=oe(hs(),1),xs=oe(ds(),1),Es=oe(ms(),1),As=oe(bs(),1);We.use(ws.default);We.use(vs.default);We.use(xs.default);We.use(Es.default);We.use(As.default);var W=We.expect,kd=We.assert;var Ge=oe(ke("path"),1),Ss=ke("url"),tf={},xt=Ge.default.dirname((0,Ss.fileURLToPath)(tf.url)),Hu={ed25519:Ge.default.join(xt,"go.ed25519.key"),rsa:Ge.default.join(xt,"go.rsa.key"),secp256k1:Ge.default.join(xt,"go.secp256k1.key")},ef={ed25519:Ge.default.join(xt,"js.ed25519.key"),rsa:Ge.default.join(xt,"js.rsa.key"),secp256k1:Ge.default.join(xt,"js.secp256k1.key")},cn={go:Hu,js:ef};function un(r){let e=["ed25519","rsa","secp256k1"],t=["js","go"];for(let o of e)for(let n of t)for(let i of t)rf(`noise/${o}`,r,{type:n,noise:!0,key:cn.go[o]},{type:i,noise:!0,key:cn.js[o]})}function rf(r,e,t,o){describe(`connect using ${r}`,()=>{let n;before(async function(){this.timeout(20*1e3),n=await Promise.all([e.spawn(t),e.spawn(o)])}),after(async function(){n!=null&&await Promise.all(n.map(async i=>{await i.stop()}))}),it(`${t.type} peer to ${o.type} peer`,async function(){this.timeout(10*1e3);let i=await n[0].client.identify(),s=await n[1].client.identify(),a=await n[0].client.listPeers();W(a).to.have.lengthOf(0);let c=await n[1].client.listPeers();W(c).to.have.lengthOf(0),await n[0].client.connect(s.peerId,s.addrs),await new Promise(E=>setTimeout(E,1e3));let u=await n[0].client.listPeers();W(u).to.have.length.greaterThanOrEqual(1),W(u[0].toString()).to.equal(s.peerId.toString());let d=await n[1].client.listPeers();W(d).to.have.length.greaterThanOrEqual(1),W(d[0].toString()).to.equal(i.peerId.toString())})})}var pn={};be(pn,{identity:()=>uf});function nf(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),o=0;o<t.length;o++)t[o]=255;for(var n=0;n<r.length;n++){var i=r.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function E(N){if(N instanceof Uint8Array||(ArrayBuffer.isView(N)?N=new Uint8Array(N.buffer,N.byteOffset,N.byteLength):Array.isArray(N)&&(N=Uint8Array.from(N))),!(N instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(N.length===0)return"";for(var x=0,I=0,q=0,$=N.length;q!==$&&N[q]===0;)q++,x++;for(var Q=($-q)*d+1>>>0,te=new Uint8Array(Q);q!==$;){for(var y=N[q],S=0,C=Q-1;(y!==0||S<I)&&C!==-1;C--,S++)y+=256*te[C]>>>0,te[C]=y%a>>>0,y=y/a>>>0;if(y!==0)throw new Error("Non-zero carry");I=S,q++}for(var U=Q-I;U!==Q&&te[U]===0;)U++;for(var re=c.repeat(x);U<Q;++U)re+=r.charAt(te[U]);return re}function B(N){if(typeof N!="string")throw new TypeError("Expected String");if(N.length===0)return new Uint8Array;var x=0;if(N[x]!==" "){for(var I=0,q=0;N[x]===c;)I++,x++;for(var $=(N.length-x)*u+1>>>0,Q=new Uint8Array($);N[x];){var te=t[N.charCodeAt(x)];if(te===255)return;for(var y=0,S=$-1;(te!==0||y<q)&&S!==-1;S--,y++)te+=a*Q[S]>>>0,Q[S]=te%256>>>0,te=te/256>>>0;if(te!==0)throw new Error("Non-zero carry");q=y,x++}if(N[x]!==" "){for(var C=$-q;C!==$&&Q[C]===0;)C++;for(var U=new Uint8Array(I+($-C)),re=I;C!==$;)U[re++]=Q[C++];return U}}}function k(N){var x=B(N);if(x)return x;throw new Error(`Non-${e} character`)}return{encode:E,decodeUnsafe:B,decode:k}}var of=nf,sf=of,Ts=sf;var $d=new Uint8Array(0);var Ns=(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},Te=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 Ps=r=>new TextEncoder().encode(r),Os=r=>new TextDecoder().decode(r);var fn=class{constructor(e,t,o){this.name=e,this.prefix=t,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},ln=class{constructor(e,t,o){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=o}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 Is(this,e)}},hn=class{constructor(e){this.decoders=e}or(e){return Is(this,e)}decode(e){let t=e[0],o=this.decoders[t];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Is=(r,e)=>new hn({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),dn=class{constructor(e,t,o,n){this.name=e,this.prefix=t,this.baseEncode=o,this.baseDecode=n,this.encoder=new fn(e,t,o),this.decoder=new ln(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},Et=({name:r,prefix:e,encode:t,decode:o})=>new dn(r,e,t,o),Ke=({prefix:r,name:e,alphabet:t})=>{let{encode:o,decode:n}=Ts(t,e);return Et({prefix:r,name:e,encode:o,decode:i=>Te(n(i))})},af=(r,e,t,o)=>{let n={};for(let d=0;d<e.length;++d)n[e[d]]=d;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),a=0,c=0,u=0;for(let d=0;d<i;++d){let E=n[r[d]];if(E===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<t|E,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},cf=(r,e,t)=>{let o=e[e.length-1]==="=",n=(1<<t)-1,i="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,i+=e[n&a>>s];if(s&&(i+=e[n&a<<t-s]),o)for(;i.length*t&7;)i+="=";return i},ee=({name:r,prefix:e,bitsPerChar:t,alphabet:o})=>Et({prefix:e,name:r,encode(n){return cf(n,o,t)},decode(n){return af(n,o,t,r)}});var uf=Et({prefix:"\0",name:"identity",encode:r=>Os(r),decode:r=>Ps(r)});var yn={};be(yn,{base2:()=>ff});var ff=ee({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var mn={};be(mn,{base8:()=>lf});var lf=ee({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var gn={};be(gn,{base10:()=>hf});var hf=Ke({prefix:"9",name:"base10",alphabet:"0123456789"});var bn={};be(bn,{base16:()=>df,base16upper:()=>pf});var df=ee({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),pf=ee({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var wn={};be(wn,{base32:()=>Ue,base32hex:()=>bf,base32hexpad:()=>vf,base32hexpadupper:()=>xf,base32hexupper:()=>wf,base32pad:()=>mf,base32padupper:()=>gf,base32upper:()=>yf,base32z:()=>Ef});var Ue=ee({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),yf=ee({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),mf=ee({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),gf=ee({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),bf=ee({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),wf=ee({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vf=ee({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),xf=ee({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Ef=ee({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var vn={};be(vn,{base36:()=>Af,base36upper:()=>Sf});var Af=Ke({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Sf=Ke({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var xn={};be(xn,{base58btc:()=>de,base58flickr:()=>Tf});var de=Ke({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Tf=Ke({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var En={};be(En,{base64:()=>Nf,base64pad:()=>Pf,base64url:()=>Of,base64urlpad:()=>Mf});var Nf=ee({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Pf=ee({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Of=ee({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Mf=ee({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var An={};be(An,{base256emoji:()=>jf});var Ds=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}"),If=Ds.reduce((r,e,t)=>(r[t]=e,r),[]),Df=Ds.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function _f(r){return r.reduce((e,t)=>(e+=If[t],e),"")}function Cf(r){let e=[];for(let t of r){let o=Df[t.codePointAt(0)];if(o===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(o)}return new Uint8Array(e)}var jf=Et({prefix:"\u{1F680}",name:"base256emoji",encode:_f,decode:Cf});var On={};be(On,{sha256:()=>Hf,sha512:()=>el});var Pn=oe(ke("crypto"),1);var qf=js,_s=128,Bf=127,kf=~Bf,Lf=Math.pow(2,31);function js(r,e,t){e=e||[],t=t||0;for(var o=t;r>=Lf;)e[t++]=r&255|_s,r/=128;for(;r&kf;)e[t++]=r&255|_s,r>>>=7;return e[t]=r|0,js.bytes=t-o+1,e}var Uf=Sn,Rf=128,Cs=127;function Sn(r,o){var t=0,o=o||0,n=0,i=o,s,a=r.length;do{if(i>=a)throw Sn.bytes=0,new RangeError("Could not decode varint");s=r[i++],t+=n<28?(s&Cs)<<n:(s&Cs)*Math.pow(2,n),n+=7}while(s>=Rf);return Sn.bytes=i-o,t}var zf=Math.pow(2,7),Ff=Math.pow(2,14),Vf=Math.pow(2,21),$f=Math.pow(2,28),Wf=Math.pow(2,35),Gf=Math.pow(2,42),Kf=Math.pow(2,49),Jf=Math.pow(2,56),Xf=Math.pow(2,63),Qf=function(r){return r<zf?1:r<Ff?2:r<Vf?3:r<$f?4:r<Wf?5:r<Gf?6:r<Kf?7:r<Jf?8:r<Xf?9:10},Zf={encode:qf,decode:Uf,encodingLength:Qf},Yf=Zf,$t=Yf;var Wt=(r,e=0)=>[$t.decode(r,e),$t.decode.bytes],At=(r,e,t=0)=>($t.encode(r,e,t),e),St=r=>$t.encodingLength(r);var at=(r,e)=>{let t=e.byteLength,o=St(r),n=o+St(t),i=new Uint8Array(n+t);return At(r,i,0),At(t,i,o),i.set(e,n),new Tt(r,t,e,i)},gr=r=>{let e=Te(r),[t,o]=Wt(e),[n,i]=Wt(e.subarray(o)),s=e.subarray(o+i);if(s.byteLength!==n)throw new Error("Incorrect length");return new Tt(t,n,s,e)},qs=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Ns(r.bytes,t.bytes)}},Tt=class{constructor(e,t,o,n){this.code=e,this.size=t,this.digest=o,this.bytes=n}};var Nn=({name:r,code:e,encode:t})=>new Tn(r,e,t),Tn=class{constructor(e,t,o){this.name=e,this.code=t,this.encode=o}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?at(this.code,t):t.then(o=>at(this.code,o))}else throw Error("Unknown type, must be binary type")}};var Hf=Nn({name:"sha2-256",code:18,encode:r=>Te(Pn.default.createHash("sha256").update(r).digest())}),el=Nn({name:"sha2-512",code:19,encode:r=>Te(Pn.default.createHash("sha512").update(r).digest())});var Mn={};be(Mn,{identity:()=>nl});var ks=0,tl="identity",Ls=Te,rl=r=>at(ks,Ls(r)),nl={code:ks,name:tl,encode:Ls,digest:rl};var hp=new TextEncoder,dp=new TextDecoder;var Us=(r,e)=>{let{bytes:t,version:o}=r;switch(o){case 0:return al(t,In(r),e||de.encoder);default:return cl(t,In(r),e||Ue.encoder)}};var Rs=new WeakMap,In=r=>{let e=Rs.get(r);if(e==null){let t=new Map;return Rs.set(r,t),t}return e},Z=class{constructor(e,t,o,n){this.code=t,this.version=e,this.multihash=o,this.bytes=n,this["/"]=n}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!==Gt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ul)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Z.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,o=at(e,t);return Z.createV1(this.code,o)}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 Z.equals(this,e)}static equals(e,t){let o=t;return o&&e.code===o.code&&e.version===o.version&&qs(e.multihash,o.multihash)}toString(e){return Us(this,e)}toJSON(){return{"/":Us(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 Z)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:o,code:n,multihash:i,bytes:s}=t;return new Z(o,n,i,s||zs(o,n,i.bytes))}else if(t[fl]===!0){let{version:o,multihash:n,code:i}=t,s=gr(n);return Z.create(o,i,s)}else return null}static create(e,t,o){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(o.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==Gt)throw new Error(`Version 0 CID must use dag-pb (code: ${Gt}) block encoding`);return new Z(e,t,o,o.bytes)}case 1:{let n=zs(e,t,o.bytes);return new Z(e,t,o,n)}default:throw new Error("Invalid version")}}static createV0(e){return Z.create(0,Gt,e)}static createV1(e,t){return Z.create(1,e,t)}static decode(e){let[t,o]=Z.decodeFirst(e);if(o.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Z.inspectBytes(e),o=t.size-t.multihashSize,n=Te(e.subarray(o,o+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),s=new Tt(t.multihashCode,t.digestSize,i,n);return[t.version===0?Z.createV0(s):Z.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,o=()=>{let[E,B]=Wt(e.subarray(t));return t+=B,E},n=o(),i=Gt;if(n===18?(n=0,t=0):i=o(),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let s=t,a=o(),c=o(),u=t+c,d=u-s;return{version:n,codec:i,multihashCode:a,digestSize:c,multihashSize:d,size:u}}static parse(e,t){let[o,n]=sl(e,t),i=Z.decode(n);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return In(i).set(o,e),i}},sl=(r,e)=>{switch(r[0]){case"Q":{let t=e||de;return[de.prefix,t.decode(`${de.prefix}${r}`)]}case de.prefix:{let t=e||de;return[de.prefix,t.decode(r)]}case Ue.prefix:{let t=e||Ue;return[Ue.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)]}}},al=(r,e,t)=>{let{prefix:o}=t;if(o!==de.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let n=e.get(o);if(n==null){let i=t.encode(r).slice(1);return e.set(o,i),i}else return n},cl=(r,e,t)=>{let{prefix:o}=t,n=e.get(o);if(n==null){let i=t.encode(r);return e.set(o,i),i}else return n},Gt=112,ul=18,zs=(r,e,t)=>{let o=St(r),n=o+St(e),i=new Uint8Array(n+t.byteLength);return At(r,i,0),At(e,i,o),i.set(t,n),i},fl=Symbol.for("@ipld/js-cid/CID");var Kt={...pn,...yn,...mn,...gn,...bn,...wn,...vn,...xn,...En,...An},Ap={...On,...Mn};function ct(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function Re(r=0){return globalThis.Buffer?.alloc!=null?ct(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function ze(r=0){return globalThis.Buffer?.allocUnsafe!=null?ct(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Vs(r,e,t,o){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:o}}}var Fs=Vs("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Dn=Vs("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=ze(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),ll={utf8:Fs,"utf-8":Fs,hex:Kt.base16,latin1:Dn,ascii:Dn,binary:Dn,...Kt},br=ll;function ae(r,e="utf8"){let t=br[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ct(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function pe(r,e){e==null&&(e=r.reduce((n,i)=>n+i.length,0));let t=ze(e),o=0;for(let n of r)t.set(n,o),o+=n.length;return ct(t)}var wr={key:pe([ae("/pk/"),ae("muft89xjpybos8eas1vaq2xrbsx2vkll7is4ocy7pia5fsjlt3c2","base36")]),value:ae("080012a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100c2588f998971dac9e3eef76a311bf9159505aff69ea3b664c55a36aa28ee08de1127228a4d431bb9c0840240c75f6e98a0843a78d945491a3ea5e1f7cee2bc71383510db5290702383975b7bffae9fb40c84cc1220fb4a7db862fffb0de42f8fd8fb33a17deb20f30e2d0f194791fe69355a392f77df35f101e08a2fc95b2c018768938814fcb52482f899f5e90a1905e8abbcdbb1647ad80a5b0417e1ce8320d64197a6ba3848926375c63adebabdf6eb82109bcadfee13b62bf922bbb6f74c1a26c9bc6122d1436787e0e6de3c152b1959701092abef84599f73eaedb2fcef9f87293e1bbe8e0fef3f1a7fd2e8b94c7e633f88473644a63cb948e4d25c54490203010001","hex")};function $s(r){let e=["js","go"];for(let t of e)for(let o of e)hl(r,{type:t,dht:!0},{type:o,dht:!0})}function hl(r,e,t){describe("dht.contentFetching",()=>{let o;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]);let n=await o[0].client.identify();await o[1].client.connect(n.peerId,n.addrs),await new Promise(i=>setTimeout(i,1e3))}),after(async function(){o!=null&&await Promise.all(o.map(async n=>{await n.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){this.timeout(10*1e3),await o[0].client.dht.put(wr.key,wr.value);let n=await o[1].client.dht.get(wr.key);W(n).to.equalBytes(wr.value)})})}async function Jt(r){let e=[];for await(let t of r)e.push(t);return e}function Ws(r){let e=["js","go"];for(let t of e)for(let o of e)t==="go"&&o==="go"||dl(r,{type:t,dht:!0},{type:o,dht:!0})}function dl(r,e,t){describe("dht.contentRouting",()=>{let o,n;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t),r.spawn(t)]),n=await Promise.all(o.map(async i=>await i.client.identify())),await o[0].client.connect(n[1].peerId,n[1].addrs),await o[0].client.connect(n[2].peerId,n[2].addrs),await new Promise(i=>setTimeout(i,1e3))}),after(async function(){o!=null&&await Promise.all(o.map(async i=>{await i.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let i=Z.parse("QmVzw6MPsF96TyXBSRs1ptLoVMWRv5FCYJZZGJSVB2Hp39");await o[0].client.dht.provide(i);let s=await Jt(o[1].client.dht.findProviders(i,1));W(s).to.exist(),W(s.length).to.be.greaterThan(0)})})}var Ys=oe(Qs(),1),yl=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]),_n=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},ml=(r,e,t)=>{let o=t.retries-(e-1);return r.attemptNumber=e,r.retriesLeft=o,r},gl=r=>yl.has(r),Zs=r=>globalThis.DOMException===void 0?new Error(r):new DOMException(r);async function Cn(r,e){return new Promise((t,o)=>{e={onFailedAttempt(){},retries:10,...e};let n=Ys.default.operation(e);n.attempt(async i=>{try{t(await r(i))}catch(s){if(!(s instanceof Error)){o(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof _n)n.stop(),o(s.originalError);else if(s instanceof TypeError&&!gl(s.message))n.stop(),o(s);else{ml(s,i,e);try{await e.onFailedAttempt(s)}catch(a){o(a);return}n.retry(s)||o(n.mainError())}}}),e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",()=>{n.stop();let i=e.signal.reason===void 0?Zs("The operation was aborted."):e.signal.reason;o(i instanceof Error?i:Zs(i))},{once:!0})})}function Hs(r){let e=["js","go"];for(let t of e)for(let o of e)bl(r,{type:t,dht:!0},{type:o,dht:!0})}function bl(r,e,t){describe("dht.peerRouting",()=>{let o;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t),r.spawn(t)])}),after(async function(){o!=null&&await Promise.all(o.map(async n=>{await n.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let n=await o[1].client.identify(),i=await o[2].client.identify();await o[0].client.connect(n.peerId,n.addrs),await o[0].client.connect(i.peerId,i.addrs);let s=await Cn(async()=>await o[1].client.dht.findPeer(i.peerId),{retries:10});W(i.addrs.map(a=>a.toString())).to.include.deep.members(s.multiaddrs.map(a=>a.toString()))})})}async function jn(r){$s(r),Ws(r),Hs(r)}async function ft(r){for await(let e of r)return e}function ea(r){let e=["js","go"];for(let t of e)for(let o of e)wl(r,{type:t,pubsub:!0,pubsubRouter:"floodsub"},{type:o,pubsub:!0,pubsubRouter:"floodsub"})}function wl(r,e,t){describe("pubsub.floodSub",()=>{let o;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]);let[n,i]=o,s=await i.client.identify();await n.client.connect(s.peerId,s.addrs)}),after(async function(){o!=null&&await Promise.all(o.map(async n=>{await n.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let n="test-topic",i=ae("test-data"),[s,a]=o,c=a.client.pubsub.subscribe(n),u=async()=>{let E=await ft(c);W(E).to.exist(),W(E).to.have.property("data").that.equalBytes(i)},d=async()=>{await new Promise(E=>setTimeout(E,800)),await s.client.pubsub.publish(n,i)};return await Promise.all([u(),d()])})})}function ta(r){let e=["js","go"];for(let t of e)for(let o of e)vl(r,{type:t,pubsub:!0,pubsubRouter:"gossipsub"},{type:o,pubsub:!0,pubsubRouter:"gossipsub"})}function vl(r,e,t){describe("pubsub.gossipsub",()=>{let o;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]);let n=await o[1].client.identify();await o[0].client.connect(n.peerId,n.addrs)}),after(async function(){o!=null&&await Promise.all(o.map(async n=>{await n.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let n="test-topic",i=ae("test-data"),s=o[1].client.pubsub.subscribe(n),a=async()=>{let u=await ft(s);W(u).to.exist(),W(u).to.have.property("data").that.equalBytes(i)},c=async()=>{await new Promise(u=>setTimeout(u,800)),await o[0].client.pubsub.publish(n,i)};return await Promise.all([a(),c()])})})}function ra(r){let e=["js","go"];for(let t of e)for(let o of e)xl(r,{type:t,pubsub:!0,pubsubRouter:"floodsub"},{type:o,pubsub:!0,pubsubRouter:"gossipsub"})}function xl(r,e,t){describe("pubsub.hybrid",()=>{let o;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]);let n=await o[1].client.identify();await o[0].client.connect(n.peerId,n.addrs)}),after(async function(){o!=null&&await Promise.all(o.map(async n=>{await n.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let n="test-topic",i=ae("test-data"),s=o[1].client.pubsub.subscribe(n),a=async()=>{let u=await ft(s);W(u).to.exist(),W(u).to.have.property("data").that.equalBytes(i)},c=async()=>{await new Promise(u=>setTimeout(u,800)),await o[0].client.pubsub.publish(n,i)};return await Promise.all([a(),c()])})})}async function qn(r){ea(r),ta(r),ra(r)}var vr=class{constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Pt=class{constructor(e={}){this.hwm=e.splitLimit??16,this.head=new vr(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new vr(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};function Ot(r={}){return El(t=>{let o=t.shift();if(o==null)return{done:!0};if(o.error!=null)throw o.error;return{done:o.done===!0,value:o.value}},r)}function El(r,e){e=e??{};let t=e.onEnd,o=new Pt,n,i,s,a=async()=>o.isEmpty()?s?{done:!0}:await new Promise((x,I)=>{i=q=>{i=null,o.push(q);try{x(r(o))}catch($){I($)}return n}}):r(o),c=x=>i!=null?i(x):(o.push(x),n),u=x=>(o=new Pt,i!=null?i({error:x}):(o.push({error:x}),n)),d=x=>{if(s)return n;if(e?.objectMode!==!0&&x?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return c({done:!1,value:x})},E=x=>s?n:(s=!0,x!=null?u(x):c({done:!0})),B=()=>(o=new Pt,E(),{done:!0}),k=x=>(E(x),{done:!0});if(n={[Symbol.asyncIterator](){return this},next:a,return:B,throw:k,push:d,end:E,get readableLength(){return o.size}},t==null)return n;let N=n;return n={[Symbol.asyncIterator](){return this},next(){return N.next()},throw(x){return N.throw(x),t!=null&&(t(x),t=void 0),{done:!0}},return(){return N.return(),t!=null&&(t(),t=void 0),{done:!0}},push:d,end(x){return N.end(x),t!=null&&(t(x),t=void 0),n},get readableLength(){return N.readableLength}},n}async function*Bn(...r){let e=Ot({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async t=>{for await(let o of t)e.push(o)})),e.end()}catch(t){e.end(t)}}),yield*e}var Al=(...r)=>{let e;for(;r.length>0;)e=r.shift()(e);return e},na=r=>r!=null&&(typeof r[Symbol.asyncIterator]=="function"||typeof r[Symbol.iterator]=="function"||typeof r.next=="function"),kn=r=>r!=null&&typeof r.sink=="function"&&na(r.source),Sl=r=>e=>{let t=r.sink(e);if(t.then!=null){let o=Ot({objectMode:!0});return t.then(()=>{o.end()},i=>{o.end(i)}),Bn(o,async function*(){yield*r.source,o.end()}())}return r.source};function Xt(r,...e){if(kn(r)){let o=r;r=()=>o.source}else if(na(r)){let o=r;r=()=>o}let t=[r,...e];if(t.length>1&&kn(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let o=1;o<t.length-1;o++)kn(t[o])&&(t[o]=Sl(t[o]));return Al(...t)}function Qt(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}function Ln(r,e){let t=["js","go"];for(let o of t)for(let n of t)Tl(r,e,{type:o,muxer:e},{type:n,muxer:e})}function Tl(r,e,t,o){describe(`echo streams - ${e}`,()=>{let n;before(async function(){this.timeout(20*1e3),n=await Promise.all([r.spawn(t),r.spawn(o)]);let i=await n[0].client.identify();await n[1].client.connect(i.peerId,i.addrs),await new Promise(s=>setTimeout(s,1e3))}),after(async function(){n!=null&&await Promise.all(n.map(async i=>{await i.stop()}))}),it(`${t.type} sender to ${o.type} listener`,async function(){this.timeout(10*1e3);let i=await n[1].client.identify(),s="/echo/1.0.0",a=[ae("hello world")];await n[1].client.registerStreamHandler(s,async E=>{await Xt(E,async function*(B){for await(let k of B)yield k.subarray()},E)});let c=await n[0].client.openStream(i.peerId,s),u=Qt(),d=await Xt(a,async function*(E){yield*E,await u.promise},c,async function*(E){for await(let B of E)yield B.subarray(),u.resolve()},async E=>await Jt(E));W(d).to.deep.equal(a)})})}async function Un(r){Ln(r,"mplex"),Ln(r,"yamux")}var Je=ke("node:net");function xr(r){return Boolean((0,Je.isIP)(r))}function ye(r,e="utf8"){let t=br[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 oa=Je.isIPv4,Nl=Je.isIPv6,Rn=function(r){let e=0;if(r=r.toString().trim(),oa(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(o=>{t[e++]=parseInt(o,10)&255}),t}if(Nl(r)){let t=r.split(":",8),o;for(o=0;o<t.length;o++){let i=oa(t[o]),s;i&&(s=Rn(t[o]),t[o]=ye(s.slice(0,2),"base16")),s!=null&&++o<8&&t.splice(o,0,ye(s.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(o=0;o<t.length&&t[o]!=="";o++);let i=[o,1];for(o=9-t.length;o>0;o--)i.push("0");t.splice.apply(t,i)}let n=new Uint8Array(e+16);for(o=0;o<t.length;o++){let i=parseInt(t[o],16);n[e++]=i>>8&255,n[e++]=i&255}return n}throw new Error("invalid ip address")},ia=function(r,e=0,t){e=~~e,t=t??r.length-e;let o=new DataView(r.buffer);if(t===4){let n=[];for(let i=0;i<t;i++)n.push(r[e+i]);return n.join(".")}if(t===16){let n=[];for(let i=0;i<t;i+=2)n.push(o.getUint16(e+i).toString(16));return n.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Zt={},zn={},Ol=[[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"],[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"],[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"]];Ol.forEach(r=>{let e=Ml(...r);zn[e.code]=e,Zt[e.name]=e});function Ml(r,e,t,o,n){return{code:r,size:e,name:t,resolvable:Boolean(o),path:Boolean(n)}}function H(r){if(typeof r=="number"){if(zn[r]!=null)return zn[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Zt[r]!=null)return Zt[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var _e=oe(Er(),1);function wa(r,e){switch(H(r).code){case 4:case 41:return $l(e);case 42:return ga(e);case 6:case 273:case 33:case 132:return xa(e).toString();case 53:case 54:case 55:case 56:case 400:case 777:return ga(e);case 421:return Jl(e);case 444:return ba(e);case 445:return ba(e);case 466:return Kl(e);default:return ye(e,"base16")}}function va(r,e){switch(H(r).code){case 4:return ya(e);case 41:return ya(e);case 42:return ma(e);case 6:case 273:case 33:case 132:return Wn(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 777:return ma(e);case 421:return Wl(e);case 444:return Xl(e);case 445:return Ql(e);case 466:return Gl(e);default:return ae(e,"base16")}}var $n=Object.values(Kt).map(r=>r.decoder),Vl=function(){let r=$n[0].or($n[1]);return $n.slice(2).forEach(e=>r=r.or(e)),r}();function ya(r){if(!xr(r))throw new Error("invalid ip address");return Rn(r)}function $l(r){let e=ia(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!xr(e))throw new Error("invalid ip address");return e}function Wn(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function xa(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function ma(r){let e=ae(r),t=Uint8Array.from(_e.default.encode(e.length));return pe([t,e],t.length+e.length)}function ga(r){let e=_e.default.decode(r);if(r=r.slice(_e.default.decode.bytes),r.length!==e)throw new Error("inconsistent lengths");return ye(r)}function Wl(r){let e;r[0]==="Q"||r[0]==="1"?e=gr(de.decode(`z${r}`)).bytes:e=Z.parse(r).multihash.bytes;let t=Uint8Array.from(_e.default.encode(e.length));return pe([t,e],t.length+e.length)}function Gl(r){let e=Vl.decode(r),t=Uint8Array.from(_e.default.encode(e.length));return pe([t,e],t.length+e.length)}function Kl(r){let e=_e.default.decode(r),t=r.slice(_e.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return"u"+ye(t,"base64url")}function Jl(r){let e=_e.default.decode(r),t=r.slice(_e.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return ye(t,"base58btc")}function Xl(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=Ue.decode("b"+e[0]),o=parseInt(e[1],10);if(o<1||o>65536)throw new Error("Port number is not in range(1, 65536)");let n=Wn(o);return pe([t,n],t.length+n.length)}function Ql(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=Ue.decode(`b${e[0]}`),o=parseInt(e[1],10);if(o<1||o>65536)throw new Error("Port number is not in range(1, 65536)");let n=Wn(o);return pe([t,n],t.length+n.length)}function ba(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),o=ye(e,"base32"),n=xa(t);return`${o}:${n}`}var Mt=oe(Er(),1);function Zl(r){let e=[],t=r.split("/").slice(1);if(t.length===1&&t[0]==="")return[];for(let o=0;o<t.length;o++){let n=t[o],i=H(n);if(i.size===0){e.push([n]);continue}if(o++,o>=t.length)throw Aa("invalid address: "+r);if(i.path===!0){e.push([n,Qn(t.slice(o).join("/"))]);break}e.push([n,t[o]])}return e}function Yl(r){let e=[];return r.map(t=>{let o=Tr(t);return e.push(o.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),Qn(e.join("/"))}function Hl(r){return r.map(e=>{Array.isArray(e)||(e=[e]);let t=Tr(e);return e.length>1?[t.code,va(t.code,e[1])]:[t.code]})}function Gn(r){return r.map(e=>{let t=Tr(e);return e[1]!=null?[t.code,wa(t.code,e[1])]:[t.code]})}function Kn(r){return Sr(pe(r.map(e=>{let t=Tr(e),o=Uint8Array.from(Mt.default.encode(t.code));return e.length>1&&e[1]!=null&&(o=pe([o,e[1]])),o})))}function Jn(r,e){return r.size>0?r.size/8:r.size===0?0:Mt.default.decode(e)+(Mt.default.decode.bytes??0)}function Ar(r){let e=[],t=0;for(;t<r.length;){let o=Mt.default.decode(r,t),n=Mt.default.decode.bytes??0,i=H(o),s=Jn(i,r.slice(t+n));if(s===0){e.push([o]),t+=n;continue}let a=r.slice(t+n,t+n+s);if(t+=s+n,t>r.length)throw Aa("Invalid address Uint8Array: "+ye(r,"base16"));e.push([o,a])}return e}function Xn(r){let e=Ar(r),t=Gn(e);return Yl(t)}function eh(r){r=Qn(r);let e=Zl(r),t=Hl(e);return Kn(t)}function Ea(r){return eh(r)}function Sr(r){let e=th(r);if(e!=null)throw e;return Uint8Array.from(r)}function th(r){try{Ar(r)}catch(e){return e}}function Qn(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function Aa(r){return new Error("Error parsing address: "+r)}function Tr(r){return H(r[0])}var Hn=oe(Er(),1);var Pa=oe(Zn(),1);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 It=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Yn=function(r,e,t,o,n){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Yt,Ht,er,Na,oh=Symbol.for("nodejs.util.inspect.custom"),ih=[H("dns").code,H("dns4").code,H("dns6").code,H("dnsaddr").code],sh=new Map,Oa=Symbol.for("@multiformats/js-multiaddr/multiaddr");function ah(r){return Boolean(r?.[Oa])}var Fe=class{constructor(e){if(Yt.set(this,void 0),Ht.set(this,void 0),er.set(this,void 0),this[Na]=!0,e==null&&(e=""),e instanceof Uint8Array)this.bytes=Sr(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=Ea(e)}else if(ah(e))this.bytes=Sr(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return It(this,Yt,"f")==null&&Yn(this,Yt,Xn(this.bytes),"f"),It(this,Yt,"f")}toJSON(){return this.toString()}toOptions(){let e,t,o,n,i="",s=H("tcp"),a=H("udp"),c=H("ip4"),u=H("ip6"),d=H("dns6"),E=H("ip6zone");for(let[k,N]of this.stringTuples())k===E.code&&(i=`%${N??""}`),ih.includes(k)&&(t=s.name,n=443,o=`${N??""}${i}`,e=k===d.code?6:4),(k===s.code||k===a.code)&&(t=H(k).name,n=parseInt(N??"")),(k===c.code||k===u.code)&&(t=H(k).name,o=`${N??""}${i}`,e=k===u.code?6:4);if(e==null||t==null||o==null||n==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:o,transport:t,port:n}}protos(){return this.protoCodes().map(e=>Object.assign({},H(e)))}protoCodes(){let e=[],t=this.bytes,o=0;for(;o<t.length;){let n=Hn.default.decode(t,o),i=Hn.default.decode.bytes??0,s=H(n),a=Jn(s,t.slice(o+i));o+=a+i,e.push(n)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return It(this,Ht,"f")==null&&Yn(this,Ht,Ar(this.bytes),"f"),It(this,Ht,"f")}stringTuples(){return It(this,er,"f")==null&&Yn(this,er,Gn(this.tuples()),"f"),It(this,er,"f")}encapsulate(e){return e=new Fe(e),new Fe(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),o=this.toString(),n=o.lastIndexOf(t);if(n<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new Fe(o.slice(0,n))}decapsulateCode(e){let t=this.tuples();for(let o=t.length-1;o>=0;o--)if(t[o][0]===e)return new Fe(Kn(t.slice(0,o)));return this}getPeerId(){try{let t=this.stringTuples().filter(o=>o[0]===Zt.ipfs.code).pop();if(t?.[1]!=null){let o=t[1];return o[0]==="Q"||o[0]==="1"?ye(de.decode(`z${o}`),"base58btc"):ye(Z.parse(o).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let e=null;try{e=this.stringTuples().filter(t=>H(t[0]).path===!0)[0][1],e==null&&(e=null)}catch{e=null}return e}equals(e){return Nr(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(i=>i.resolvable);if(t==null)return[this];let o=sh.get(t.name);if(o==null)throw(0,Pa.default)(new Error(`no available resolver for ${t.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await o(this,e)).map(i=>new Fe(i))}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)}[(Yt=new WeakMap,Ht=new WeakMap,er=new WeakMap,Na=Oa,oh)](){return`Multiaddr(${Xn(this.bytes)})`}};function Ma(r){return new Fe(r)}var ho=oe(oo(),1),mc=oe(cc(),1),po=oe(lo(),1),gc=oe(yc(),1),bc=oe(ht(),1);function mh(){bc.default._configure(),ho.default._configure(mc.default),po.default._configure(gc.default)}mh();var wc=["uint64","int64","sint64","fixed64","sfixed64"];function gh(r){for(let e of wc){if(r[e]==null)continue;let t=r[e];r[e]=function(){return BigInt(t.call(this).toString())}}return r}function yo(r){return gh(new ho.default(r))}function bh(r){for(let e of wc){if(r[e]==null)continue;let t=r[e];r[e]=function(o){return t.call(this,o.toString())}}return r}function mo(){return bh(po.default.create())}function Ze(r,e){let t=yo(r instanceof Uint8Array?r:r.subarray());return e.decode(t)}function Ye(r,e){let t=mo();return e.encode(r,t,{lengthDelimited:!1}),t.finish()}var _t;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(_t||(_t={}));function Dr(r,e,t,o){return{name:r,type:e,encode:t,decode:o}}function nr(r){function e(n){if(r[n.toString()]==null)throw new Error("Invalid enum value");return r[n]}let t=function(i,s){let a=e(i);s.int32(a)},o=function(i){let s=i.int32();return e(s)};return Dr("enum",_t.VARINT,t,o)}function He(r,e){return Dr("message",_t.LENGTH_DELIMITED,r,e)}var Ct;(function(r){let e;(function(n){n.RESERVE="RESERVE",n.CONNECT="CONNECT",n.STATUS="STATUS"})(e=r.Type||(r.Type={}));let t;(function(n){n[n.RESERVE=0]="RESERVE",n[n.CONNECT=1]="CONNECT",n[n.STATUS=2]="STATUS"})(t||(t={})),function(n){n.codec=()=>nr(t)}(e=r.Type||(r.Type={}));let o;r.codec=()=>(o==null&&(o=He((n,i,s={})=>{s.lengthDelimited!==!1&&i.fork(),n.type!=null&&(i.uint32(8),r.Type.codec().encode(n.type,i)),n.peer!=null&&(i.uint32(18),jt.codec().encode(n.peer,i,{writeDefaults:!1})),n.reservation!=null&&(i.uint32(26),_r.codec().encode(n.reservation,i,{writeDefaults:!1})),n.limit!=null&&(i.uint32(34),qt.codec().encode(n.limit,i,{writeDefaults:!1})),n.status!=null&&(i.uint32(40),qe.codec().encode(n.status,i)),s.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{let s={},a=i==null?n.len:n.pos+i;for(;n.pos<a;){let c=n.uint32();switch(c>>>3){case 1:s.type=r.Type.codec().decode(n);break;case 2:s.peer=jt.codec().decode(n,n.uint32());break;case 3:s.reservation=_r.codec().decode(n,n.uint32());break;case 4:s.limit=qt.codec().decode(n,n.uint32());break;case 5:s.status=qe.codec().decode(n);break;default:n.skipType(c&7);break}}return s})),o),r.encode=n=>Ye(n,r.codec()),r.decode=n=>Ze(n,r.codec())})(Ct||(Ct={}));var vc;(function(r){let e;(function(n){n.CONNECT="CONNECT",n.STATUS="STATUS"})(e=r.Type||(r.Type={}));let t;(function(n){n[n.CONNECT=0]="CONNECT",n[n.STATUS=1]="STATUS"})(t||(t={})),function(n){n.codec=()=>nr(t)}(e=r.Type||(r.Type={}));let o;r.codec=()=>(o==null&&(o=He((n,i,s={})=>{s.lengthDelimited!==!1&&i.fork(),n.type!=null&&(i.uint32(8),r.Type.codec().encode(n.type,i)),n.peer!=null&&(i.uint32(18),jt.codec().encode(n.peer,i,{writeDefaults:!1})),n.limit!=null&&(i.uint32(26),qt.codec().encode(n.limit,i,{writeDefaults:!1})),n.status!=null&&(i.uint32(32),qe.codec().encode(n.status,i)),s.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{let s={},a=i==null?n.len:n.pos+i;for(;n.pos<a;){let c=n.uint32();switch(c>>>3){case 1:s.type=r.Type.codec().decode(n);break;case 2:s.peer=jt.codec().decode(n,n.uint32());break;case 3:s.limit=qt.codec().decode(n,n.uint32());break;case 4:s.status=qe.codec().decode(n);break;default:n.skipType(c&7);break}}return s})),o),r.encode=n=>Ye(n,r.codec()),r.decode=n=>Ze(n,r.codec())})(vc||(vc={}));var jt;(function(r){let e;r.codec=()=>(e==null&&(e=He((t,o,n={})=>{if(n.lengthDelimited!==!1&&o.fork(),(n.writeDefaults===!0||t.id!=null&&t.id.byteLength>0)&&(o.uint32(10),o.bytes(t.id)),t.addrs!=null)for(let i of t.addrs)o.uint32(18),o.bytes(i);n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={id:new Uint8Array(0),addrs:[]},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.id=t.bytes();break;case 2:n.addrs.push(t.bytes());break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>Ye(t,r.codec()),r.decode=t=>Ze(t,r.codec())})(jt||(jt={}));var _r;(function(r){let e;r.codec=()=>(e==null&&(e=He((t,o,n={})=>{if(n.lengthDelimited!==!1&&o.fork(),(n.writeDefaults===!0||t.expire!==0n)&&(o.uint32(8),o.uint64(t.expire)),t.addrs!=null)for(let i of t.addrs)o.uint32(18),o.bytes(i);t.voucher!=null&&(o.uint32(26),o.bytes(t.voucher)),n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={expire:0n,addrs:[]},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.expire=t.uint64();break;case 2:n.addrs.push(t.bytes());break;case 3:n.voucher=t.bytes();break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>Ye(t,r.codec()),r.decode=t=>Ze(t,r.codec())})(_r||(_r={}));var qt;(function(r){let e;r.codec=()=>(e==null&&(e=He((t,o,n={})=>{n.lengthDelimited!==!1&&o.fork(),t.duration!=null&&(o.uint32(8),o.uint32(t.duration)),t.data!=null&&(o.uint32(16),o.uint64(t.data)),n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.duration=t.uint32();break;case 2:n.data=t.uint64();break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>Ye(t,r.codec()),r.decode=t=>Ze(t,r.codec())})(qt||(qt={}));var qe;(function(r){r.UNUSED="UNUSED",r.OK="OK",r.RESERVATION_REFUSED="RESERVATION_REFUSED",r.RESOURCE_LIMIT_EXCEEDED="RESOURCE_LIMIT_EXCEEDED",r.PERMISSION_DENIED="PERMISSION_DENIED",r.CONNECTION_FAILED="CONNECTION_FAILED",r.NO_RESERVATION="NO_RESERVATION",r.MALFORMED_MESSAGE="MALFORMED_MESSAGE",r.UNEXPECTED_MESSAGE="UNEXPECTED_MESSAGE"})(qe||(qe={}));var go;(function(r){r[r.UNUSED=0]="UNUSED",r[r.OK=100]="OK",r[r.RESERVATION_REFUSED=200]="RESERVATION_REFUSED",r[r.RESOURCE_LIMIT_EXCEEDED=201]="RESOURCE_LIMIT_EXCEEDED",r[r.PERMISSION_DENIED=202]="PERMISSION_DENIED",r[r.CONNECTION_FAILED=203]="CONNECTION_FAILED",r[r.NO_RESERVATION=204]="NO_RESERVATION",r[r.MALFORMED_MESSAGE=400]="MALFORMED_MESSAGE",r[r.UNEXPECTED_MESSAGE=401]="UNEXPECTED_MESSAGE"})(go||(go={}));(function(r){r.codec=()=>nr(go)})(qe||(qe={}));var xc;(function(r){let e;r.codec=()=>(e==null&&(e=He((t,o,n={})=>{n.lengthDelimited!==!1&&o.fork(),(n.writeDefaults===!0||t.relay!=null&&t.relay.byteLength>0)&&(o.uint32(10),o.bytes(t.relay)),(n.writeDefaults===!0||t.peer!=null&&t.peer.byteLength>0)&&(o.uint32(18),o.bytes(t.peer)),(n.writeDefaults===!0||t.expiration!==0n)&&(o.uint32(24),o.uint64(t.expiration)),n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={relay:new Uint8Array(0),peer:new Uint8Array(0),expiration:0n},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.relay=t.bytes();break;case 2:n.peer=t.bytes();break;case 3:n.expiration=t.uint64();break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>Ye(t,r.codec()),r.decode=t=>Ze(t,r.codec())})(xc||(xc={}));var Ac=Symbol.for("@achingbrain/uint8arraylist");function Ec(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let o of r){let n=t+o.byteLength;if(e<n)return{buf:o,index:e-t};t=n}throw new RangeError("index is out of bounds")}function Cr(r){return Boolean(r?.[Ac])}var me=class{constructor(...e){Object.defineProperty(this,Ac,{value:!0}),this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let o of e)if(o instanceof Uint8Array)t+=o.byteLength,this.bufs.push(o);else if(Cr(o))t+=o.byteLength,this.bufs.push(...o.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let o of e.reverse())if(o instanceof Uint8Array)t+=o.byteLength,this.bufs.unshift(o);else if(Cr(o))t+=o.byteLength,this.bufs.unshift(...o.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=Ec(this.bufs,e);return t.buf[t.index]}set(e,t){let o=Ec(this.bufs,e);o.buf[o.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let o=0;o<e.length;o++)this.set(t+o,e[o]);else if(Cr(e))for(let o=0;o<e.length;o++)this.set(t+o,e.get(o));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:o,length:n}=this._subList(e,t);return pe(o,n)}subarray(e,t){let{bufs:o,length:n}=this._subList(e,t);return o.length===1?o[0]:pe(o,n)}sublist(e,t){let{bufs:o,length:n}=this._subList(e,t),i=new me;return i.length=n,i.bufs=o,i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:[...this.bufs],length:this.length};let o=[],n=0;for(let i=0;i<this.bufs.length;i++){let s=this.bufs[i],a=n,c=a+s.byteLength;if(n=c,e>=c)continue;let u=e>=a&&e<c,d=t>a&&t<=c;if(u&&d){if(e===a&&t===c){o.push(s);break}let E=e-a;o.push(s.subarray(E,E+(t-e)));break}if(u){if(e===0){o.push(s);continue}o.push(s.subarray(e-a));continue}if(d){if(t===c){o.push(s);break}o.push(s.subarray(0,t-a));break}o.push(s)}return{bufs:o,length:t-e}}indexOf(e,t=0){if(!Cr(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let o=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=o.byteLength;if(n===0)throw new TypeError("search must be at least 1 byte long");let i=256,s=new Int32Array(i);for(let E=0;E<i;E++)s[E]=-1;for(let E=0;E<n;E++)s[o[E]]=E;let a=s,c=this.byteLength-o.byteLength,u=o.byteLength-1,d;for(let E=t;E<=c;E+=d){d=0;for(let B=u;B>=0;B--){let k=this.get(E+B);if(o[B]!==k){d=Math.max(1,B-a[k]);break}}if(d===0)return E}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let o=ze(1);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt8(0,t),this.write(o,e)}getInt16(e,t){let o=this.subarray(e,e+2);return new DataView(o.buffer,o.byteOffset,o.byteLength).getInt16(0,t)}setInt16(e,t,o){let n=Re(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt16(0,t,o),this.write(n,e)}getInt32(e,t){let o=this.subarray(e,e+4);return new DataView(o.buffer,o.byteOffset,o.byteLength).getInt32(0,t)}setInt32(e,t,o){let n=Re(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt32(0,t,o),this.write(n,e)}getBigInt64(e,t){let o=this.subarray(e,e+8);return new DataView(o.buffer,o.byteOffset,o.byteLength).getBigInt64(0,t)}setBigInt64(e,t,o){let n=Re(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigInt64(0,t,o),this.write(n,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let o=ze(1);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint8(0,t),this.write(o,e)}getUint16(e,t){let o=this.subarray(e,e+2);return new DataView(o.buffer,o.byteOffset,o.byteLength).getUint16(0,t)}setUint16(e,t,o){let n=Re(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint16(0,t,o),this.write(n,e)}getUint32(e,t){let o=this.subarray(e,e+4);return new DataView(o.buffer,o.byteOffset,o.byteLength).getUint32(0,t)}setUint32(e,t,o){let n=Re(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,t,o),this.write(n,e)}getBigUint64(e,t){let o=this.subarray(e,e+8);return new DataView(o.buffer,o.byteOffset,o.byteLength).getBigUint64(0,t)}setBigUint64(e,t,o){let n=Re(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigUint64(0,t,o),this.write(n,e)}getFloat32(e,t){let o=this.subarray(e,e+4);return new DataView(o.buffer,o.byteOffset,o.byteLength).getFloat32(0,t)}setFloat32(e,t,o){let n=Re(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat32(0,t,o),this.write(n,e)}getFloat64(e,t){let o=this.subarray(e,e+8);return new DataView(o.buffer,o.byteOffset,o.byteLength).getFloat64(0,t)}setFloat64(e,t,o){let n=Re(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat64(0,t,o),this.write(n,e)}equals(e){if(e==null||!(e instanceof me)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!Nr(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let o=new me;return o.bufs=e,t==null&&(t=e.reduce((n,i)=>n+i.byteLength,0)),o.length=t,o}};function Sc(r){let e=async function*(){let t=yield,o=new me;for await(let n of r){if(t==null){o.append(n),t=yield o,o=new me;continue}for(o.append(n);o.length>=t;){let i=o.sublist(0,t);if(o.consume(t),t=yield i,t==null){o.length>0&&(t=yield o,o=new me);break}}}if(t!=null)throw Object.assign(new Error(`stream ended before ${t} bytes became available`),{code:"ERR_UNDER_READ",buffer:o})}();return e.next(),e}function jr(r){let e=Ot(),t=Sc(r.source),o=Qt(),n,i=r.sink(async function*(){yield*e,yield*await o.promise}());return i.catch(a=>{n=a}),{reader:t,writer:e,stream:{sink:async a=>n!=null?await Promise.reject(n):(o.resolve(a),await i),source:t},rest:()=>e.end(),write:e.push,read:async()=>{let a=await t.next();if(a.value!=null)return a.value}}}function qr(r){return r instanceof Uint8Array?{get(e){return r[e]},set(e,t){r[e]=t}}:{get(e){return r.get(e)},set(e,t){r.set(e,t)}}}var Tc=4294967296,ve=class{constructor(e=0,t=0){this.hi=e,this.lo=t}toBigInt(e){if(e===!0)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,o=~this.hi>>>0;return t===0&&(o=o+1>>>0),-(BigInt(t)+(BigInt(o)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toNumber(e){return Number(this.toBigInt(e))}zzDecode(){let e=-(this.lo&1),t=((this.lo>>>1|this.hi<<31)^e)>>>0,o=(this.hi>>>1^e)>>>0;return new ve(o,t)}zzEncode(){let e=this.hi>>31,t=((this.hi<<1|this.lo>>>31)^e)>>>0,o=(this.lo<<1^e)>>>0;return new ve(t,o)}toBytes(e,t=0){let o=qr(e);for(;this.hi>0;)o.set(t++,this.lo&127|128),this.lo=(this.lo>>>7|this.hi<<25)>>>0,this.hi>>>=7;for(;this.lo>127;)o.set(t++,this.lo&127|128),this.lo=this.lo>>>7;o.set(t++,this.lo)}static fromBigInt(e){if(e===0n)return new ve;let t=e<0;t&&(e=-e);let o=Number(e>>32n)|0,n=Number(e-(BigInt(o)<<32n))|0;return t&&(o=~o>>>0,n=~n>>>0,++n>Tc&&(n=0,++o>Tc&&(o=0))),new ve(o,n)}static fromNumber(e){if(e===0)return new ve;let t=e<0;t&&(e=-e);let o=e>>>0,n=(e-o)/4294967296>>>0;return t&&(n=~n>>>0,o=~o>>>0,++o>4294967295&&(o=0,++n>4294967295&&(n=0))),new ve(n,o)}static fromBytes(e,t=0){let o=qr(e),n=new ve,i=0;if(e.length-t>4){for(;i<4;++i)if(n.lo=(n.lo|(o.get(t)&127)<<i*7)>>>0,o.get(t++)<128)return n;if(n.lo=(n.lo|(o.get(t)&127)<<28)>>>0,n.hi=(n.hi|(o.get(t)&127)>>4)>>>0,o.get(t++)<128)return n;i=0}else for(;i<4;++i){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(n.lo=(n.lo|(o.get(t)&127)<<i*7)>>>0,o.get(t++)<128)return n}if(e.length-t>4){for(;i<5;++i)if(n.hi=(n.hi|(o.get(t)&127)<<i*7+3)>>>0,o.get(t++)<128)return n}else if(t<e.byteLength)for(;i<5;++i){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(n.hi=(n.hi|(o.get(t)&127)<<i*7+3)>>>0,o.get(t++)<128)return n}throw RangeError("invalid varint encoding")}};var wh=Math.pow(2,7),vh=Math.pow(2,14),xh=Math.pow(2,21),Eh=Math.pow(2,28),Ah=Math.pow(2,35),Sh=Math.pow(2,42),Th=Math.pow(2,49),Nh=Math.pow(2,56),Ph=Math.pow(2,63),pt={encodingLength(r){return r<wh?1:r<vh?2:r<xh?3:r<Eh?4:r<Ah?5:r<Sh?6:r<Th?7:r<Nh?8:r<Ph?9:10},encode(r,e,t=0){if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return e==null&&(e=ze(pt.encodingLength(r))),ve.fromNumber(r).toBytes(e,t),e},decode(r,e=0){return ve.fromBytes(r,e).toNumber(!0)}};function Nc(r){return globalThis?.Buffer?.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}var Br=r=>{let e=pt.encodingLength(r),t=Nc(e);return pt.encode(r,t),Br.bytes=e,t};Br.bytes=0;function kr(r){r=r??{};let e=r.lengthEncoder??Br;return async function*(o){for await(let n of o){let i=e(n.byteLength);i instanceof Uint8Array?yield i:yield*i,n instanceof Uint8Array?yield n:yield*n}}}kr.single=(r,e)=>{e=e??{};let t=e.lengthEncoder??Br;return new me(t(r.byteLength),r)};var or=oe(Zn(),1),Oh=8,Mh=1024*1024*4,yt;(function(r){r[r.LENGTH=0]="LENGTH",r[r.DATA=1]="DATA"})(yt||(yt={}));var bo=r=>{let e=pt.decode(r);return bo.bytes=pt.encodingLength(e),e};bo.bytes=0;function ir(r){return async function*(t){let o=new me,n=yt.LENGTH,i=-1,s=r?.lengthDecoder??bo,a=r?.maxLengthLength??Oh,c=r?.maxDataLength??Mh;for await(let u of t)for(o.append(u);o.byteLength>0;){if(n===yt.LENGTH)try{if(i=s(o),i<0)throw(0,or.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>c)throw(0,or.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let d=s.bytes;o.consume(d),r?.onLength!=null&&r.onLength(i),n=yt.DATA}catch(d){if(d instanceof RangeError){if(o.byteLength>a)throw(0,or.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw d}if(n===yt.DATA){if(o.byteLength<i)break;let d=o.sublist(0,i);o.consume(i),r?.onData!=null&&r.onData(d),yield d,n=yt.LENGTH}}if(o.byteLength>0)throw(0,or.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}}ir.fromReader=(r,e)=>{let t=1,o=async function*(){for(;;)try{let{done:i,value:s}=await r.next(t);if(i===!0)return;s!=null&&(yield s)}catch(i){if(i.code==="ERR_UNDER_READ")return{done:!0,value:null};throw i}finally{t=1}}();return ir({...e??{},onLength:i=>{t=i}})(o)};function Pc(r,e={}){let t=jr(r),o=ir.fromReader(t.reader,e),n={read:async i=>{let{value:s}=await t.reader.next(i);if(s==null)throw new Error("Value is null");return s},readLP:async()=>{let{value:i}=await o.next();if(i==null)throw new Error("Value is null");return i},readPB:async i=>{let s=await n.readLP();if(s==null)throw new Error("Value is null");let a=s instanceof Uint8Array?s:s.subarray();return i.decode(a)},write:i=>{i instanceof Uint8Array?t.writer.push(i):t.writer.push(i.subarray())},writeLP:i=>{n.write(kr.single(i,e))},writePB:(i,s)=>{n.writeLP(s.encode(i))},pb:i=>({read:async()=>await n.readPB(i),write:s=>n.writePB(s,i)}),unwrap:()=>(t.rest(),t.stream)};return n}var Dh="/libp2p/circuit/relay/0.2.0/hop",Oc=async(r,e,t)=>{let o=await r.client.openStream(e,Dh),n=Pc(o);return n.writePB({type:Ct.Type.RESERVE,...t??{}},Ct),await n.readPB(Ct)},Lr={protocol:"/echo/1.0.0",handler:async r=>{await Xt(r,async function*(e){for await(let t of e)yield t.subarray()},r)}};function wo(r){let e=["go","js"];e.forEach(t=>{e.forEach(o=>{e.forEach(n=>{_h(r,t,o,n)})})})}function _h(r,e,t,o){describe(`${e} to ${t} over relay ${o}`,()=>{let n=[{type:e,noise:!0,noListen:!0},{type:t,noise:!0,noListen:!0},{type:o,noise:!0,relay:!0}],i,s,a,c,u,d;beforeEach(async function(){this.timeout(20*1e3),[i,s,a]=await Promise.all(n.map(async E=>await r.spawn(E))),[c,u]=await Promise.all([s,a].map(async E=>await E.client.identify())),d=Ma(`${u.addrs[0].toString()}/p2p/${u.peerId.toString()}/p2p-circuit/p2p/${c.peerId.toString()}`),await s.client.connect(u.peerId,u.addrs)}),afterEach(async function(){await Promise.all([i,s,a].map(async E=>{await E.stop()}))}),it("connects",async()=>{let E=await Oc(s,u.peerId);W(E.status).to.eq(qe.OK),await i.client.connect(c.peerId,[d]),await new Promise(q=>setTimeout(q,500));let B=await i.client.listPeers();W(B.filter(q=>q.equals(c.peerId))).to.have.length(1),await s.client.registerStreamHandler(Lr.protocol,Lr.handler);let k=await i.client.openStream(c.peerId,Lr.protocol),N=ae("test"),x=jr(k);x.write(N);let I=await x.read();W(I?.subarray()).to.deep.equal(N)}),it("fails to connect without a reservation",async()=>{await W(i.client.connect(c.peerId,[d])).to.eventually.be.rejected.with.property("message").that.matches(/NO_RESERVATION/)})})}async function Ch(r){un(r),wo(r),await jn(r),await qn(r),await Un(r)}return $c(jh);})();
6
+ Original reason: ${e.inspect(fe)}`)});let De=S.then(fe=>o[y].apply(o,[fe].concat(C)),U);return De.notify=fe=>{d(De,fe)},De}})};Le.exports.transferPromiseness=(r,e)=>{r.then=e.then.bind(e)};Le.exports.transformAsserterArgs=r=>r});var gs=O((Ud,ms)=>{"use strict";function sf(r,e){let t="__deferred__",o=e.flag,n=r.Assertion;function i(E,I){let B=o(E,t)||[];B.push(I),o(E,t,B)}function s(E){let I=o(E,t)||[],B=E,$;for(o(E,t,void 0);$=I.shift();){let Q=$.call(B);Q!==void 0&&(B=Q)}return B}function a(E,I){let B=o(E,t);B&&B.length>0&&B.splice(-1,0,function(){o(this,"message",I)})}function c(E,I){I&&n.addChainableMethod(E,function($){return $&&a(this,$),s(this)},function(){return i(this,I),this})}function u(E){let I={assertCalled:!1,assert:function(){this.assertCalled=!0}};try{E.call(I)}catch{I.assertCalled=!0}return I.assertCalled}let d=Object.getOwnPropertyNames(n.prototype).map(function(E){let I=Object.getOwnPropertyDescriptor(n.prototype,E);return I.name=E,I});d.filter(function(E){return E.name!=="assert"&&E.name!=="constructor"&&typeof E.value=="function"}).forEach(function(E){n.overwriteMethod(E.name,function(I){return function(){let B=s(this);return I.apply(B,arguments)}})}),d.filter(function(E){return Object.prototype.hasOwnProperty.call(n.prototype.__methods,E.name)}).forEach(function(E){n.overwriteChainableMethod(E.name,function(I){return function(){let B=s(this);return I.apply(B,arguments)}},function(I){return function(){return i(this,I),this}})});let w=d.filter(function(E){return E.name!=="_obj"&&typeof E.get=="function"&&!Object.prototype.hasOwnProperty.call(n.prototype.__methods,E.name)});w.filter(function(E){return!u(E.get)}).forEach(function(E){n.overwriteProperty(E.name,function(I){return function(){return i(this,I),this}})}),w.filter(function(E){return u(E.get)}).forEach(function(E){c(E.name,E.get)}),n.addMethod("ensure",function(){return s(this)});let q=e.addProperty;e.addProperty=function(E,I,B){q.apply(e,arguments),c(I,B)};let k=e.addMethod;e.addMethod=function(E,I){k.apply(e,arguments),n.overwriteMethod(I,function(B){return function(){let $=s(this);return B.apply($,arguments)}})};let N=e.addChainableMethod;e.addChainableMethod=function(E,I){let B=!0;Object.prototype.hasOwnProperty.call(n.prototype,I)&&(B=!1),N.apply(e,arguments),B&&n.overwriteChainableMethod(I,function($){return function(){let Q=s(this);return $.apply(Q,arguments)}},function($){return function(){return i(this,$),this}})}}ms.exports=sf});var bs=O((an,cn)=>{(function(){(function(r){return typeof ke=="function"&&typeof an=="object"&&typeof cn=="object"?cn.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):chai.use(r)})(function(r,e){var t=r.Assertion,o=t.prototype;t.addMethod("containSubset",function(i){var s=e.flag(this,"object"),a=r.config.showDiff;o.assert.call(this,n(i,s),"expected #{act} to contain subset #{exp}","expected #{act} to not contain subset #{exp}",i,s,a)}),r.assert.containSubset=function(i,s,a){new r.Assertion(i,a).to.be.containSubset(s)};function n(i,s){if(i===s)return!0;if(typeof s!=typeof i)return!1;if(typeof i!="object"||i===null)return i===s;if(i&&!s)return!1;if(Array.isArray(i)){if(typeof s.length!="number")return!1;var a=Array.prototype.slice.call(s);return i.every(function(c){return a.some(function(u){return n(c,u)})})}return i instanceof Date?s instanceof Date?i.getTime()===s.getTime():!1:Object.keys(i).every(function(c){var u=i[c],d=s[c];return typeof u=="object"&&u!==null&&d!==null?n(u,d):typeof u=="function"?u(d):d===u})}})}).call(an)});var xs=O((zd,vs)=>{"use strict";function ws(r,e){if(Uint8Array&&Uint8Array.prototype.every)return r.every(e);for(let t=0;t<r.length;t++)if(!e(r[t],t,r))return!1;return!0}vs.exports=function(r){let e=r.Assertion;e.addMethod("equalBytes",function(t){if(typeof t=="string"){if(t.length%2!==0||!/^[0-9a-f]*$/i.test(t))throw new TypeError("Invalid hex string: "+t)}else if(t.length===void 0)throw new TypeError("equalBytes consumes string, array, or array-like object; got none of those");let o=this._obj;new e(o).to.be.a("uint8array");let n;typeof t=="string"?n=t.length===o.length*2&&ws(o,function(i,s){return i===parseInt(t.substring(2*s,2*s+2),16)}):n=t.length===o.length&&ws(o,function(i,s){return t[s]===i}),this.assert(n,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",t)}),r.assert.equalBytes=function(t,o,n){return new e(t,n,r.assert.equalBytes,!0).to.equalBytes(o)}}});var As=O((Es,un)=>{(function(r){typeof ke=="function"&&typeof Es=="object"&&typeof un=="object"?un.exports=r:typeof define=="function"&&define.amd?define(function(){return r}):chai.use(r)})(function(r,e){r.string=r.string||{};function t(s){return typeof s=="string"}r.string.startsWith=function(s,a){return!t(s)||!t(a)?!1:s.indexOf(a)===0},r.string.endsWith=function(s,a){return!t(s)||!t(a)?!1:s.indexOf(a,s.length-a.length)!==-1},r.string.equalIgnoreCase=function(s,a){return!t(s)||!t(a)?!1:s.toLowerCase()===a.toLowerCase()},r.string.equalIgnoreSpaces=function(s,a){return!t(s)||!t(a)?!1:s.replace(/\s/g,"")===a.replace(/\s/g,"")},r.string.containIgnoreSpaces=function(s,a){return!t(s)||!t(a)?!1:s.replace(/\s/g,"").indexOf(a.replace(/\s/g,""))>-1},r.string.containIgnoreCase=function(s,a){return!t(s)||!t(a)?!1:s.toLowerCase().indexOf(a.toLowerCase())>-1},r.string.singleLine=function(s){return t(s)?s.trim().indexOf(`
7
+ `)===-1:!1},r.string.reverseOf=function(s,a){return!t(s)||!t(a)?!1:s.split("").reverse().join("")===a},r.string.palindrome=function(s){if(!t(s))return!1;for(var a=s.length,c=0;c<Math.floor(a/2);c++)if(s[c]!==s[a-1-c])return!1;return!0},r.string.entriesCount=function(s,a,c){var u=0;if(t(s)&&t(a))for(var d=0,w=s.length;d<w;){var q=s.indexOf(a,d);if(q===-1)break;u++,d=q+1}return u===c},r.string.indexOf=function(s,a,c){var u=!t(s)||!t(a)?-1:s.indexOf(a);return u===c};var o=function(s){var a=this._obj;return this.assert(r.string.startsWith(a,s),"expected "+this._obj+" to start with "+s,"expected "+this._obj+" not to start with "+s)};r.Assertion.addChainableMethod("startsWith",o),r.Assertion.addChainableMethod("startWith",o);var n=function(s){var a=this._obj;return this.assert(r.string.endsWith(a,s),"expected "+this._obj+" to end with "+s,"expected "+this._obj+" not to end with "+s)};r.Assertion.addChainableMethod("endsWith",n),r.Assertion.addChainableMethod("endWith",n),r.Assertion.addChainableMethod("equalIgnoreCase",function(s){var a=this._obj;return this.assert(r.string.equalIgnoreCase(a,s),"expected "+this._obj+" to equal "+s+" ignoring case","expected "+this._obj+" not to equal "+s+" ignoring case")}),r.Assertion.addChainableMethod("equalIgnoreSpaces",function(s){var a=this._obj;return this.assert(r.string.equalIgnoreSpaces(a,s),"expected "+this._obj+" to equal "+s+" ignoring spaces","expected "+this._obj+" not to equal "+s+" ignoring spaces")}),r.Assertion.addChainableMethod("containIgnoreSpaces",function(s){var a=this._obj;return this.assert(r.string.containIgnoreSpaces(a,s),"expected "+this._obj+" to contain "+s+" ignoring spaces","expected "+this._obj+" not to contain "+s+" ignoring spaces")}),r.Assertion.addChainableMethod("containIgnoreCase",function(s){var a=this._obj;return this.assert(r.string.containIgnoreCase(a,s),"expected "+this._obj+" to contain "+s+" ignoring case","expected "+this._obj+" not to contain "+s+" ignoring case")}),r.Assertion.addChainableMethod("singleLine",function(){var s=this._obj;return this.assert(r.string.singleLine(s),"expected "+this._obj+" to be a single line","expected "+this._obj+" not to be a single line")}),r.Assertion.addChainableMethod("reverseOf",function(s){var a=this._obj;return this.assert(r.string.reverseOf(a,s),"expected "+this._obj+" to be the reverse of "+s,"expected "+this._obj+" not to be the reverse of "+s)}),r.Assertion.addChainableMethod("palindrome",function(){var s=this._obj;return this.assert(r.string.palindrome(s),"expected "+this._obj+" to be a palindrome","expected "+this._obj+" not to be a palindrome")}),r.Assertion.addChainableMethod("entriesCount",function(s,a){var c=this._obj;return this.assert(r.string.entriesCount(c,s,a),"expected "+this._obj+" to have "+s+" "+a+" time(s)","expected "+this._obj+" to not have "+s+" "+a+" time(s)")}),r.Assertion.addChainableMethod("indexOf",function(s,a){var c=this._obj;return this.assert(r.string.indexOf(c,s,a),"expected "+this._obj+" to have "+s+" on index "+a,"expected "+this._obj+" to not have "+s+" on index "+a)});var i=r.assert;i.startsWith=function(s,a,c){new r.Assertion(s,c).to.startsWith(a)},i.notStartsWith=function(s,a,c){new r.Assertion(s,c).to.not.startsWith(a)},i.endsWith=function(s,a,c){new r.Assertion(s,c).to.endsWith(a)},i.notEndsWith=function(s,a,c){new r.Assertion(s,c).to.not.endsWith(a)},i.equalIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.be.equalIgnoreCase(a)},i.notEqualIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.not.be.equalIgnoreCase(a)},i.equalIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.be.equalIgnoreSpaces(a)},i.notEqualIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.not.be.equalIgnoreSpaces(a)},i.containIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.be.containIgnoreSpaces(a)},i.notContainIgnoreSpaces=function(s,a,c){new r.Assertion(s,c).to.not.be.containIgnoreSpaces(a)},i.containIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.be.containIgnoreCase(a)},i.notContainIgnoreCase=function(s,a,c){new r.Assertion(s,c).to.not.be.containIgnoreCase(a)},i.singleLine=function(s,a,c){new r.Assertion(s,c).to.be.singleLine()},i.notSingleLine=function(s,a,c){new r.Assertion(s,c).to.not.be.singleLine()},i.reverseOf=function(s,a,c){new r.Assertion(s,c).to.be.reverseOf(a)},i.notReverseOf=function(s,a,c){new r.Assertion(s,c).to.not.be.reverseOf(a)},i.palindrome=function(s,a,c){new r.Assertion(s,c).to.be.palindrome()},i.notPalindrome=function(s,a,c){new r.Assertion(s,c).to.not.be.palindrome()},i.entriesCount=function(s,a,c,u){new r.Assertion(s,u).to.have.entriesCount(a,c)},i.indexOf=function(s,a,c,u){new r.Assertion(s,u).to.have.indexOf(a,c)}})});var Ys=O((Hp,Zs)=>{function Ne(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Zs.exports=Ne;Ne.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Ne.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Ne.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},t),this._options.unref&&this._timer.unref(),!0};Ne.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Ne.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};Ne.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};Ne.prototype.start=Ne.prototype.try;Ne.prototype.errors=function(){return this._errors};Ne.prototype.attempts=function(){return this._attempts};Ne.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,o=0;o<this._errors.length;o++){var n=this._errors[o],i=n.message,s=(r[i]||0)+1;r[i]=s,s>=t&&(e=n,t=s)}return e}});var Hs=O(ft=>{var xl=Ys();ft.operation=function(r){var e=ft.timeouts(r);return new xl(e,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};ft.timeouts=function(r){if(r instanceof Array)return[].concat(r);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in r)e[t]=r[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],n=0;n<e.retries;n++)o.push(this.createTimeout(n,e));return r&&r.forever&&!o.length&&o.push(this.createTimeout(n,e)),o.sort(function(i,s){return i-s}),o};ft.createTimeout=function(r,e){var t=e.randomize?Math.random()+1:1,o=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,r));return o=Math.min(o,e.maxTimeout),o};ft.wrap=function(r,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var o in r)typeof r[o]=="function"&&t.push(o)}for(var n=0;n<t.length;n++){var i=t[n],s=r[i];r[i]=function(c){var u=ft.operation(e),d=Array.prototype.slice.call(arguments,1),w=d.pop();d.push(function(q){u.retry(q)||(q&&(arguments[0]=u.mainError()),w.apply(this,arguments))}),u.attempt(function(){c.apply(r,d)})}.bind(r,s),r[i].options=e}}});var ta=O((ty,ea)=>{ea.exports=Hs()});var ya=O((om,pa)=>{pa.exports=Kn;var da=128,kl=127,Ll=~kl,Ul=Math.pow(2,31);function Kn(r,e,t){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw Kn.bytes=0,new RangeError("Could not encode varint");e=e||[],t=t||0;for(var o=t;r>=Ul;)e[t++]=r&255|da,r/=128;for(;r&Ll;)e[t++]=r&255|da,r>>>=7;return e[t]=r|0,Kn.bytes=t-o+1,e}});var ba=O((im,ga)=>{ga.exports=Jn;var Rl=128,ma=127;function Jn(r,o){var t=0,o=o||0,n=0,i=o,s,a=r.length;do{if(i>=a||n>49)throw Jn.bytes=0,new RangeError("Could not decode varint");s=r[i++],t+=n<28?(s&ma)<<n:(s&ma)*Math.pow(2,n),n+=7}while(s>=Rl);return Jn.bytes=i-o,t}});var va=O((sm,wa)=>{var zl=Math.pow(2,7),Fl=Math.pow(2,14),Vl=Math.pow(2,21),$l=Math.pow(2,28),Wl=Math.pow(2,35),Gl=Math.pow(2,42),Kl=Math.pow(2,49),Jl=Math.pow(2,56),Xl=Math.pow(2,63);wa.exports=function(r){return r<zl?1:r<Fl?2:r<Vl?3:r<$l?4:r<Wl?5:r<Gl?6:r<Kl?7:r<Jl?8:r<Xl?9:10}});var Sr=O((am,xa)=>{xa.exports={encode:ya(),decode:ba(),encodingLength:va()}});var ro=O((xm,_a)=>{"use strict";function Da(r,e){for(let t in e)Object.defineProperty(r,t,{value:e[t],enumerable:!0,configurable:!0});return r}function fh(r,e,t){if(!r||typeof r=="string")throw new TypeError("Please pass an Error to err-code");t||(t={}),typeof e=="object"&&(t=e,e=""),e&&(t.code=e);try{return Da(r,t)}catch{t.message=r.message,t.stack=r.stack;let n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(r)),Da(new n,t)}}_a.exports=fh});var La=O((Mm,ka)=>{"use strict";ka.exports=yh;function yh(r,e){for(var t=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)t[o++]=arguments[n++];return new Promise(function(a,c){t[o]=function(d){if(i)if(i=!1,d)c(d);else{for(var w=new Array(arguments.length-1),q=0;q<w.length;)w[q++]=arguments[q];a.apply(null,w)}};try{r.apply(e||null,t)}catch(u){i&&(i=!1,c(u))}})}});var Fa=O(za=>{"use strict";var Mr=za;Mr.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4>1&&e.charAt(t)==="=";)++o;return Math.ceil(e.length*3)/4-o};var _t=new Array(64),Ra=new Array(123);for(Me=0;Me<64;)Ra[_t[Me]=Me<26?Me+65:Me<52?Me+71:Me<62?Me-4:Me-59|43]=Me++;var Me;Mr.encode=function(e,t,o){for(var n=null,i=[],s=0,a=0,c;t<o;){var u=e[t++];switch(a){case 0:i[s++]=_t[u>>2],c=(u&3)<<4,a=1;break;case 1:i[s++]=_t[c|u>>4],c=(u&15)<<2,a=2;break;case 2:i[s++]=_t[c|u>>6],i[s++]=_t[u&63],a=0;break}s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),s=0)}return a&&(i[s++]=_t[c],i[s++]=61,a===1&&(i[s++]=61)),n?(s&&n.push(String.fromCharCode.apply(String,i.slice(0,s))),n.join("")):String.fromCharCode.apply(String,i.slice(0,s))};var Ua="invalid encoding";Mr.decode=function(e,t,o){for(var n=o,i=0,s,a=0;a<e.length;){var c=e.charCodeAt(a++);if(c===61&&i>1)break;if((c=Ra[c])===void 0)throw Error(Ua);switch(i){case 0:s=c,i=1;break;case 1:t[o++]=s<<2|(c&48)>>4,s=c,i=2;break;case 2:t[o++]=(s&15)<<4|(c&60)>>2,s=c,i=3;break;case 3:t[o++]=(s&3)<<6|c,i=0;break}}if(i===1)throw Error(Ua);return o-n};Mr.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var $a=O((Dm,Va)=>{"use strict";Va.exports=Ir;function Ir(){this._listeners={}}Ir.prototype.on=function(e,t,o){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:o||this}),this};Ir.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var o=this._listeners[e],n=0;n<o.length;)o[n].fn===t?o.splice(n,1):++n;return this};Ir.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var o=[],n=1;n<arguments.length;)o.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,o)}return this}});var Za=O((_m,Qa)=>{"use strict";Qa.exports=Wa(Wa);function Wa(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),o=t[3]===128;function n(c,u,d){e[0]=c,u[d]=t[0],u[d+1]=t[1],u[d+2]=t[2],u[d+3]=t[3]}function i(c,u,d){e[0]=c,u[d]=t[3],u[d+1]=t[2],u[d+2]=t[1],u[d+3]=t[0]}r.writeFloatLE=o?n:i,r.writeFloatBE=o?i:n;function s(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],e[0]}function a(c,u){return t[3]=c[u],t[2]=c[u+1],t[1]=c[u+2],t[0]=c[u+3],e[0]}r.readFloatLE=o?s:a,r.readFloatBE=o?a:s}():function(){function e(o,n,i,s){var a=n<0?1:0;if(a&&(n=-n),n===0)o(1/n>0?0:2147483648,i,s);else if(isNaN(n))o(2143289344,i,s);else if(n>34028234663852886e22)o((a<<31|2139095040)>>>0,i,s);else if(n<11754943508222875e-54)o((a<<31|Math.round(n/1401298464324817e-60))>>>0,i,s);else{var c=Math.floor(Math.log(n)/Math.LN2),u=Math.round(n*Math.pow(2,-c)*8388608)&8388607;o((a<<31|c+127<<23|u)>>>0,i,s)}}r.writeFloatLE=e.bind(null,Ga),r.writeFloatBE=e.bind(null,Ka);function t(o,n,i){var s=o(n,i),a=(s>>31)*2+1,c=s>>>23&255,u=s&8388607;return c===255?u?NaN:a*(1/0):c===0?a*1401298464324817e-60*u:a*Math.pow(2,c-150)*(u+8388608)}r.readFloatLE=t.bind(null,Ja),r.readFloatBE=t.bind(null,Xa)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),o=t[7]===128;function n(c,u,d){e[0]=c,u[d]=t[0],u[d+1]=t[1],u[d+2]=t[2],u[d+3]=t[3],u[d+4]=t[4],u[d+5]=t[5],u[d+6]=t[6],u[d+7]=t[7]}function i(c,u,d){e[0]=c,u[d]=t[7],u[d+1]=t[6],u[d+2]=t[5],u[d+3]=t[4],u[d+4]=t[3],u[d+5]=t[2],u[d+6]=t[1],u[d+7]=t[0]}r.writeDoubleLE=o?n:i,r.writeDoubleBE=o?i:n;function s(c,u){return t[0]=c[u],t[1]=c[u+1],t[2]=c[u+2],t[3]=c[u+3],t[4]=c[u+4],t[5]=c[u+5],t[6]=c[u+6],t[7]=c[u+7],e[0]}function a(c,u){return t[7]=c[u],t[6]=c[u+1],t[5]=c[u+2],t[4]=c[u+3],t[3]=c[u+4],t[2]=c[u+5],t[1]=c[u+6],t[0]=c[u+7],e[0]}r.readDoubleLE=o?s:a,r.readDoubleBE=o?a:s}():function(){function e(o,n,i,s,a,c){var u=s<0?1:0;if(u&&(s=-s),s===0)o(0,a,c+n),o(1/s>0?0:2147483648,a,c+i);else if(isNaN(s))o(0,a,c+n),o(2146959360,a,c+i);else if(s>17976931348623157e292)o(0,a,c+n),o((u<<31|2146435072)>>>0,a,c+i);else{var d;if(s<22250738585072014e-324)d=s/5e-324,o(d>>>0,a,c+n),o((u<<31|d/4294967296)>>>0,a,c+i);else{var w=Math.floor(Math.log(s)/Math.LN2);w===1024&&(w=1023),d=s*Math.pow(2,-w),o(d*4503599627370496>>>0,a,c+n),o((u<<31|w+1023<<20|d*1048576&1048575)>>>0,a,c+i)}}}r.writeDoubleLE=e.bind(null,Ga,0,4),r.writeDoubleBE=e.bind(null,Ka,4,0);function t(o,n,i,s,a){var c=o(s,a+n),u=o(s,a+i),d=(u>>31)*2+1,w=u>>>20&2047,q=4294967296*(u&1048575)+c;return w===2047?q?NaN:d*(1/0):w===0?d*5e-324*q:d*Math.pow(2,w-1075)*(q+4503599627370496)}r.readDoubleLE=t.bind(null,Ja,0,4),r.readDoubleBE=t.bind(null,Xa,4,0)}(),r}function Ga(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function Ka(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function Ja(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function Xa(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var Ya=O((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var ec=O(Ha=>{"use strict";var io=Ha;io.length=function(e){for(var t=0,o=0,n=0;n<e.length;++n)o=e.charCodeAt(n),o<128?t+=1:o<2048?t+=2:(o&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320?(++n,t+=4):t+=3;return t};io.read=function(e,t,o){var n=o-t;if(n<1)return"";for(var i=null,s=[],a=0,c;t<o;)c=e[t++],c<128?s[a++]=c:c>191&&c<224?s[a++]=(c&31)<<6|e[t++]&63:c>239&&c<365?(c=((c&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,s[a++]=55296+(c>>10),s[a++]=56320+(c&1023)):s[a++]=(c&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};io.write=function(e,t,o){for(var n=o,i,s,a=0;a<e.length;++a)i=e.charCodeAt(a),i<128?t[o++]=i:i<2048?(t[o++]=i>>6|192,t[o++]=i&63|128):(i&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(i=65536+((i&1023)<<10)+(s&1023),++a,t[o++]=i>>18|240,t[o++]=i>>12&63|128,t[o++]=i>>6&63|128,t[o++]=i&63|128):(t[o++]=i>>12|224,t[o++]=i>>6&63|128,t[o++]=i&63|128);return o-n}});var rc=O((jm,tc)=>{"use strict";tc.exports=mh;function mh(r,e,t){var o=t||8192,n=o>>>1,i=null,s=o;return function(c){if(c<1||c>n)return r(c);s+c>o&&(i=r(o),s=0);var u=e.call(i,s,s+=c);return s&7&&(s=(s|7)+1),u}}});var oc=O((qm,nc)=>{"use strict";nc.exports=se;var rr=dt();function se(r,e){this.lo=r>>>0,this.hi=e>>>0}var ht=se.zero=new se(0,0);ht.toNumber=function(){return 0};ht.zzEncode=ht.zzDecode=function(){return this};ht.length=function(){return 1};var gh=se.zeroHash="\0\0\0\0\0\0\0\0";se.fromNumber=function(e){if(e===0)return ht;var t=e<0;t&&(e=-e);var o=e>>>0,n=(e-o)/4294967296>>>0;return t&&(n=~n>>>0,o=~o>>>0,++o>4294967295&&(o=0,++n>4294967295&&(n=0))),new se(o,n)};se.from=function(e){if(typeof e=="number")return se.fromNumber(e);if(rr.isString(e))if(rr.Long)e=rr.Long.fromString(e);else return se.fromNumber(parseInt(e,10));return e.low||e.high?new se(e.low>>>0,e.high>>>0):ht};se.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,o=~this.hi>>>0;return t||(o=o+1>>>0),-(t+o*4294967296)}return this.lo+this.hi*4294967296};se.prototype.toLong=function(e){return rr.Long?new rr.Long(this.lo|0,this.hi|0,Boolean(e)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(e)}};var Qe=String.prototype.charCodeAt;se.fromHash=function(e){return e===gh?ht:new se((Qe.call(e,0)|Qe.call(e,1)<<8|Qe.call(e,2)<<16|Qe.call(e,3)<<24)>>>0,(Qe.call(e,4)|Qe.call(e,5)<<8|Qe.call(e,6)<<16|Qe.call(e,7)<<24)>>>0)};se.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};se.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};se.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};se.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:o<128?9:10}});var dt=O(so=>{"use strict";var _=so;_.asPromise=La();_.base64=Fa();_.EventEmitter=$a();_.float=Za();_.inquire=Ya();_.utf8=ec();_.pool=rc();_.LongBits=oc();_.isNode=Boolean(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node);_.global=_.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||so;_.emptyArray=Object.freeze?Object.freeze([]):[];_.emptyObject=Object.freeze?Object.freeze({}):{};_.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};_.isString=function(e){return typeof e=="string"||e instanceof String};_.isObject=function(e){return e&&typeof e=="object"};_.isset=_.isSet=function(e,t){var o=e[t];return o!=null&&e.hasOwnProperty(t)?typeof o!="object"||(Array.isArray(o)?o.length:Object.keys(o).length)>0:!1};_.Buffer=function(){try{var r=_.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();_._Buffer_from=null;_._Buffer_allocUnsafe=null;_.newBuffer=function(e){return typeof e=="number"?_.Buffer?_._Buffer_allocUnsafe(e):new _.Array(e):_.Buffer?_._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};_.Array=typeof Uint8Array<"u"?Uint8Array:Array;_.Long=_.global.dcodeIO&&_.global.dcodeIO.Long||_.global.Long||_.inquire("long");_.key2Re=/^true|false|0|1$/;_.key32Re=/^-?(?:0|[1-9][0-9]*)$/;_.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;_.longToHash=function(e){return e?_.LongBits.from(e).toHash():_.LongBits.zeroHash};_.longFromHash=function(e,t){var o=_.LongBits.fromHash(e);return _.Long?_.Long.fromBits(o.lo,o.hi,t):o.toNumber(Boolean(t))};function ic(r,e,t){for(var o=Object.keys(e),n=0;n<o.length;++n)(r[o[n]]===void 0||!t)&&(r[o[n]]=e[o[n]]);return r}_.merge=ic;_.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function sc(r){function e(t,o){if(!(this instanceof e))return new e(t,o);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),o&&ic(this,o)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}_.newError=sc;_.ProtocolError=sc("ProtocolError");_.oneOfGetter=function(e){for(var t={},o=0;o<e.length;++o)t[e[o]]=1;return function(){for(var n=Object.keys(this),i=n.length-1;i>-1;--i)if(t[n[i]]===1&&this[n[i]]!==void 0&&this[n[i]]!==null)return n[i]}};_.oneOfSetter=function(e){return function(t){for(var o=0;o<e.length;++o)e[o]!==t&&delete this[e[o]]}};_.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};_._configure=function(){var r=_.Buffer;if(!r){_._Buffer_from=_._Buffer_allocUnsafe=null;return}_._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,o){return new r(t,o)},_._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var uo=O((km,lc)=>{"use strict";lc.exports=ne;var Ce=dt(),co,uc=Ce.LongBits,bh=Ce.utf8;function Ie(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function ne(r){this.buf=r,this.pos=0,this.len=r.length}var ac=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new ne(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new ne(e);throw Error("illegal buffer")},fc=function(){return Ce.Buffer?function(t){return(ne.create=function(n){return Ce.Buffer.isBuffer(n)?new co(n):ac(n)})(t)}:ac};ne.create=fc();ne.prototype._slice=Ce.Array.prototype.subarray||Ce.Array.prototype.slice;ne.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Ie(this,10);return e}}();ne.prototype.int32=function(){return this.uint32()|0};ne.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function ao(){var r=new uc(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw Ie(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw Ie(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}ne.prototype.bool=function(){return this.uint32()!==0};function Dr(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}ne.prototype.fixed32=function(){if(this.pos+4>this.len)throw Ie(this,4);return Dr(this.buf,this.pos+=4)};ne.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Ie(this,4);return Dr(this.buf,this.pos+=4)|0};function cc(){if(this.pos+8>this.len)throw Ie(this,8);return new uc(Dr(this.buf,this.pos+=4),Dr(this.buf,this.pos+=4))}ne.prototype.float=function(){if(this.pos+4>this.len)throw Ie(this,4);var e=Ce.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};ne.prototype.double=function(){if(this.pos+8>this.len)throw Ie(this,4);var e=Ce.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};ne.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o>this.len)throw Ie(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,o):t===o?new this.buf.constructor(0):this._slice.call(this.buf,t,o)};ne.prototype.string=function(){var e=this.bytes();return bh.read(e,0,e.length)};ne.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw Ie(this,e);this.pos+=e}else do if(this.pos>=this.len)throw Ie(this);while(this.buf[this.pos++]&128);return this};ne.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};ne._configure=function(r){co=r,ne.create=fc(),co._configure();var e=Ce.Long?"toLong":"toNumber";Ce.merge(ne.prototype,{int64:function(){return ao.call(this)[e](!1)},uint64:function(){return ao.call(this)[e](!0)},sint64:function(){return ao.call(this).zzDecode()[e](!1)},fixed64:function(){return cc.call(this)[e](!0)},sfixed64:function(){return cc.call(this)[e](!1)}})}});var yc=O((Lm,pc)=>{"use strict";pc.exports=pt;var dc=uo();(pt.prototype=Object.create(dc.prototype)).constructor=pt;var hc=dt();function pt(r){dc.call(this,r)}pt._configure=function(){hc.Buffer&&(pt.prototype._slice=hc.Buffer.prototype.slice)};pt.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};pt._configure()});var go=O((Um,wc)=>{"use strict";wc.exports=V;var Pe=dt(),fo,_r=Pe.LongBits,mc=Pe.base64,gc=Pe.utf8;function nr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function ho(){}function wh(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function V(){this.len=0,this.head=new nr(ho,0,0),this.tail=this.head,this.states=null}var bc=function(){return Pe.Buffer?function(){return(V.create=function(){return new fo})()}:function(){return new V}};V.create=bc();V.alloc=function(e){return new Pe.Array(e)};Pe.Array!==Array&&(V.alloc=Pe.pool(V.alloc,Pe.Array.prototype.subarray));V.prototype._push=function(e,t,o){return this.tail=this.tail.next=new nr(e,t,o),this.len+=t,this};function po(r,e,t){e[t]=r&255}function vh(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function yo(r,e){this.len=r,this.next=void 0,this.val=e}yo.prototype=Object.create(nr.prototype);yo.prototype.fn=vh;V.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new yo((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};V.prototype.int32=function(e){return e<0?this._push(mo,10,_r.fromNumber(e)):this.uint32(e)};V.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function mo(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}V.prototype.uint64=function(e){var t=_r.from(e);return this._push(mo,t.length(),t)};V.prototype.int64=V.prototype.uint64;V.prototype.sint64=function(e){var t=_r.from(e).zzEncode();return this._push(mo,t.length(),t)};V.prototype.bool=function(e){return this._push(po,1,e?1:0)};function lo(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}V.prototype.fixed32=function(e){return this._push(lo,4,e>>>0)};V.prototype.sfixed32=V.prototype.fixed32;V.prototype.fixed64=function(e){var t=_r.from(e);return this._push(lo,4,t.lo)._push(lo,4,t.hi)};V.prototype.sfixed64=V.prototype.fixed64;V.prototype.float=function(e){return this._push(Pe.float.writeFloatLE,4,e)};V.prototype.double=function(e){return this._push(Pe.float.writeDoubleLE,8,e)};var xh=Pe.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var n=0;n<e.length;++n)t[o+n]=e[n]};V.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(po,1,0);if(Pe.isString(e)){var o=V.alloc(t=mc.length(e));mc.decode(e,o,0),e=o}return this.uint32(t)._push(xh,t,e)};V.prototype.string=function(e){var t=gc.length(e);return t?this.uint32(t)._push(gc.write,t,e):this._push(po,1,0)};V.prototype.fork=function(){return this.states=new wh(this),this.head=this.tail=new nr(ho,0,0),this.len=0,this};V.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new nr(ho,0,0),this.len=0),this};V.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=t,this.len+=o),this};V.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t};V._configure=function(r){fo=r,V.create=bc(),fo._configure()}});var Ec=O((Rm,xc)=>{"use strict";xc.exports=je;var vc=go();(je.prototype=Object.create(vc.prototype)).constructor=je;var Ze=dt();function je(){vc.call(this)}je._configure=function(){je.alloc=Ze._Buffer_allocUnsafe,je.writeBytesBuffer=Ze.Buffer&&Ze.Buffer.prototype instanceof Uint8Array&&Ze.Buffer.prototype.set.name==="set"?function(e,t,o){t.set(e,o)}:function(e,t,o){if(e.copy)e.copy(t,o,0,e.length);else for(var n=0;n<e.length;)t[o++]=e[n++]}};je.prototype.bytes=function(e){Ze.isString(e)&&(e=Ze._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(je.writeBytesBuffer,t,e),this};function Eh(r,e,t){r.length<40?Ze.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}je.prototype.string=function(e){var t=Ze.Buffer.byteLength(e);return this.uint32(t),t&&this._push(Eh,t,e),this};je._configure()});var zh={};be(zh,{connectInteropTests:()=>ln,dhtInteropTests:()=>Bn,interopTests:()=>Rh,pubsubInteropTests:()=>Rn,relayInteropTests:()=>So,streamInteropTests:()=>$n});var Se=oe(ps(),1),Pd=Se.default.expect,Od=Se.default.version,Md=Se.default.Assertion,Id=Se.default.AssertionError,Dd=Se.default.util,_d=Se.default.config,Cd=Se.default.use,jd=Se.default.should,qd=Se.default.assert,Bd=Se.default.core,We=Se.default;var Ss=oe(ys(),1),Ts=oe(gs(),1),Ns=oe(bs(),1),Ps=oe(xs(),1),Os=oe(As(),1);We.use(Ss.default);We.use(Ts.default);We.use(Ns.default);We.use(Ps.default);We.use(Os.default);var W=We.expect,$d=We.assert;var Ge=oe(ke("path"),1),Ms=ke("url"),uf={},Et=Ge.default.dirname((0,Ms.fileURLToPath)(uf.url)),af={ed25519:Ge.default.join(Et,"go.ed25519.key"),rsa:Ge.default.join(Et,"go.rsa.key"),secp256k1:Ge.default.join(Et,"go.secp256k1.key")},cf={ed25519:Ge.default.join(Et,"js.ed25519.key"),rsa:Ge.default.join(Et,"js.rsa.key"),secp256k1:Ge.default.join(Et,"js.secp256k1.key")},fn={go:af,js:cf};function ln(r){let e=["ed25519","rsa","secp256k1"],t=["js","go"];for(let o of e)for(let n of t)for(let i of t)ff(`noise/${o}`,r,{type:n,noise:!0,key:fn.go[o]},{type:i,noise:!0,key:fn.js[o]})}function ff(r,e,t,o){describe(`connect using ${r}`,()=>{let n;before(async function(){this.timeout(20*1e3),n=await Promise.all([e.spawn(t),e.spawn(o)])}),after(async function(){n!=null&&await Promise.all(n.map(async i=>{await i.stop()}))}),it(`${t.type} peer to ${o.type} peer`,async function(){this.timeout(10*1e3);let i=await n[0].client.identify(),s=await n[1].client.identify(),a=await n[0].client.listPeers();W(a).to.have.lengthOf(0);let c=await n[1].client.listPeers();W(c).to.have.lengthOf(0),await n[0].client.connect(s.peerId,s.addrs),await new Promise(w=>setTimeout(w,1e3));let u=await n[0].client.listPeers();W(u).to.have.length.greaterThanOrEqual(1),W(u[0].toString()).to.equal(s.peerId.toString());let d=await n[1].client.listPeers();W(d).to.have.length.greaterThanOrEqual(1),W(d[0].toString()).to.equal(i.peerId.toString())})})}var mn={};be(mn,{identity:()=>mf});function lf(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),o=0;o<t.length;o++)t[o]=255;for(var n=0;n<r.length;n++){var i=r.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var a=r.length,c=r.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function w(N){if(N instanceof Uint8Array||(ArrayBuffer.isView(N)?N=new Uint8Array(N.buffer,N.byteOffset,N.byteLength):Array.isArray(N)&&(N=Uint8Array.from(N))),!(N instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(N.length===0)return"";for(var E=0,I=0,B=0,$=N.length;B!==$&&N[B]===0;)B++,E++;for(var Q=($-B)*d+1>>>0,te=new Uint8Array(Q);B!==$;){for(var y=N[B],S=0,C=Q-1;(y!==0||S<I)&&C!==-1;C--,S++)y+=256*te[C]>>>0,te[C]=y%a>>>0,y=y/a>>>0;if(y!==0)throw new Error("Non-zero carry");I=S,B++}for(var U=Q-I;U!==Q&&te[U]===0;)U++;for(var re=c.repeat(E);U<Q;++U)re+=r.charAt(te[U]);return re}function q(N){if(typeof N!="string")throw new TypeError("Expected String");if(N.length===0)return new Uint8Array;var E=0;if(N[E]!==" "){for(var I=0,B=0;N[E]===c;)I++,E++;for(var $=(N.length-E)*u+1>>>0,Q=new Uint8Array($);N[E];){var te=t[N.charCodeAt(E)];if(te===255)return;for(var y=0,S=$-1;(te!==0||y<B)&&S!==-1;S--,y++)te+=a*Q[S]>>>0,Q[S]=te%256>>>0,te=te/256>>>0;if(te!==0)throw new Error("Non-zero carry");B=y,E++}if(N[E]!==" "){for(var C=$-B;C!==$&&Q[C]===0;)C++;for(var U=new Uint8Array(I+($-C)),re=I;C!==$;)U[re++]=Q[C++];return U}}}function k(N){var E=q(N);if(E)return E;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:q,decode:k}}var hf=lf,df=hf,Is=df;var Zd=new Uint8Array(0);var Ds=(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},Te=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 _s=r=>new TextEncoder().encode(r),Cs=r=>new TextDecoder().decode(r);var hn=class{constructor(e,t,o){this.name=e,this.prefix=t,this.baseEncode=o}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},dn=class{constructor(e,t,o){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=o}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 qs(this,e)}},pn=class{constructor(e){this.decoders=e}or(e){return qs(this,e)}decode(e){let t=e[0],o=this.decoders[t];if(o)return o.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},qs=(r,e)=>new pn({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}}),yn=class{constructor(e,t,o,n){this.name=e,this.prefix=t,this.baseEncode=o,this.baseDecode=n,this.encoder=new hn(e,t,o),this.decoder=new dn(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},At=({name:r,prefix:e,encode:t,decode:o})=>new yn(r,e,t,o),Ke=({prefix:r,name:e,alphabet:t})=>{let{encode:o,decode:n}=Is(t,e);return At({prefix:r,name:e,encode:o,decode:i=>Te(n(i))})},pf=(r,e,t,o)=>{let n={};for(let d=0;d<e.length;++d)n[e[d]]=d;let i=r.length;for(;r[i-1]==="=";)--i;let s=new Uint8Array(i*t/8|0),a=0,c=0,u=0;for(let d=0;d<i;++d){let w=n[r[d]];if(w===void 0)throw new SyntaxError(`Non-${o} character`);c=c<<t|w,a+=t,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=t||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s},yf=(r,e,t)=>{let o=e[e.length-1]==="=",n=(1<<t)-1,i="",s=0,a=0;for(let c=0;c<r.length;++c)for(a=a<<8|r[c],s+=8;s>t;)s-=t,i+=e[n&a>>s];if(s&&(i+=e[n&a<<t-s]),o)for(;i.length*t&7;)i+="=";return i},ee=({name:r,prefix:e,bitsPerChar:t,alphabet:o})=>At({prefix:e,name:r,encode(n){return yf(n,o,t)},decode(n){return pf(n,o,t,r)}});var mf=At({prefix:"\0",name:"identity",encode:r=>Cs(r),decode:r=>_s(r)});var gn={};be(gn,{base2:()=>gf});var gf=ee({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var bn={};be(bn,{base8:()=>bf});var bf=ee({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var wn={};be(wn,{base10:()=>wf});var wf=Ke({prefix:"9",name:"base10",alphabet:"0123456789"});var vn={};be(vn,{base16:()=>vf,base16upper:()=>xf});var vf=ee({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),xf=ee({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var xn={};be(xn,{base32:()=>Ue,base32hex:()=>Tf,base32hexpad:()=>Pf,base32hexpadupper:()=>Of,base32hexupper:()=>Nf,base32pad:()=>Af,base32padupper:()=>Sf,base32upper:()=>Ef,base32z:()=>Mf});var Ue=ee({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Ef=ee({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Af=ee({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Sf=ee({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Tf=ee({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Nf=ee({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Pf=ee({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Of=ee({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Mf=ee({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var En={};be(En,{base36:()=>If,base36upper:()=>Df});var If=Ke({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Df=Ke({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var An={};be(An,{base58btc:()=>de,base58flickr:()=>_f});var de=Ke({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),_f=Ke({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Sn={};be(Sn,{base64:()=>Cf,base64pad:()=>jf,base64url:()=>qf,base64urlpad:()=>Bf});var Cf=ee({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jf=ee({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),qf=ee({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Bf=ee({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Tn={};be(Tn,{base256emoji:()=>zf});var Bs=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}"),kf=Bs.reduce((r,e,t)=>(r[t]=e,r),[]),Lf=Bs.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function Uf(r){return r.reduce((e,t)=>(e+=kf[t],e),"")}function Rf(r){let e=[];for(let t of r){let o=Lf[t.codePointAt(0)];if(o===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(o)}return new Uint8Array(e)}var zf=At({prefix:"\u{1F680}",name:"base256emoji",encode:Uf,decode:Rf});var In={};be(In,{sha256:()=>sl,sha512:()=>al});var Mn=oe(ke("crypto"),1);var Ff=Us,ks=128,Vf=127,$f=~Vf,Wf=Math.pow(2,31);function Us(r,e,t){e=e||[],t=t||0;for(var o=t;r>=Wf;)e[t++]=r&255|ks,r/=128;for(;r&$f;)e[t++]=r&255|ks,r>>>=7;return e[t]=r|0,Us.bytes=t-o+1,e}var Gf=Nn,Kf=128,Ls=127;function Nn(r,o){var t=0,o=o||0,n=0,i=o,s,a=r.length;do{if(i>=a)throw Nn.bytes=0,new RangeError("Could not decode varint");s=r[i++],t+=n<28?(s&Ls)<<n:(s&Ls)*Math.pow(2,n),n+=7}while(s>=Kf);return Nn.bytes=i-o,t}var Jf=Math.pow(2,7),Xf=Math.pow(2,14),Qf=Math.pow(2,21),Zf=Math.pow(2,28),Yf=Math.pow(2,35),Hf=Math.pow(2,42),el=Math.pow(2,49),tl=Math.pow(2,56),rl=Math.pow(2,63),nl=function(r){return r<Jf?1:r<Xf?2:r<Qf?3:r<Zf?4:r<Yf?5:r<Hf?6:r<el?7:r<tl?8:r<rl?9:10},ol={encode:Ff,decode:Gf,encodingLength:nl},il=ol,Wt=il;var Gt=(r,e=0)=>[Wt.decode(r,e),Wt.decode.bytes],St=(r,e,t=0)=>(Wt.encode(r,e,t),e),Tt=r=>Wt.encodingLength(r);var ct=(r,e)=>{let t=e.byteLength,o=Tt(r),n=o+Tt(t),i=new Uint8Array(n+t);return St(r,i,0),St(t,i,o),i.set(e,n),new Nt(r,t,e,i)},br=r=>{let e=Te(r),[t,o]=Gt(e),[n,i]=Gt(e.subarray(o)),s=e.subarray(o+i);if(s.byteLength!==n)throw new Error("Incorrect length");return new Nt(t,n,s,e)},Rs=(r,e)=>{if(r===e)return!0;{let t=e;return r.code===t.code&&r.size===t.size&&t.bytes instanceof Uint8Array&&Ds(r.bytes,t.bytes)}},Nt=class{constructor(e,t,o,n){this.code=e,this.size=t,this.digest=o,this.bytes=n}};var On=({name:r,code:e,encode:t})=>new Pn(r,e,t),Pn=class{constructor(e,t,o){this.name=e,this.code=t,this.encode=o}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?ct(this.code,t):t.then(o=>ct(this.code,o))}else throw Error("Unknown type, must be binary type")}};var sl=On({name:"sha2-256",code:18,encode:r=>Te(Mn.default.createHash("sha256").update(r).digest())}),al=On({name:"sha2-512",code:19,encode:r=>Te(Mn.default.createHash("sha512").update(r).digest())});var Dn={};be(Dn,{identity:()=>fl});var Fs=0,cl="identity",Vs=Te,ul=r=>ct(Fs,Vs(r)),fl={code:Fs,name:cl,encode:Vs,digest:ul};var wp=new TextEncoder,vp=new TextDecoder;var $s=(r,e)=>{let{bytes:t,version:o}=r;switch(o){case 0:return pl(t,_n(r),e||de.encoder);default:return yl(t,_n(r),e||Ue.encoder)}};var Ws=new WeakMap,_n=r=>{let e=Ws.get(r);if(e==null){let t=new Map;return Ws.set(r,t),t}return e},Z=class{constructor(e,t,o,n){this.code=t,this.version=e,this.multihash=o,this.bytes=n,this["/"]=n}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!==Kt)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==ml)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Z.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,o=ct(e,t);return Z.createV1(this.code,o)}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 Z.equals(this,e)}static equals(e,t){let o=t;return o&&e.code===o.code&&e.version===o.version&&Rs(e.multihash,o.multihash)}toString(e){return $s(this,e)}toJSON(){return{"/":$s(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 Z)return t;if(t["/"]!=null&&t["/"]===t.bytes||t.asCID===t){let{version:o,code:n,multihash:i,bytes:s}=t;return new Z(o,n,i,s||Gs(o,n,i.bytes))}else if(t[gl]===!0){let{version:o,multihash:n,code:i}=t,s=br(n);return Z.create(o,i,s)}else return null}static create(e,t,o){if(typeof t!="number")throw new Error("String codecs are no longer supported");if(!(o.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(e){case 0:{if(t!==Kt)throw new Error(`Version 0 CID must use dag-pb (code: ${Kt}) block encoding`);return new Z(e,t,o,o.bytes)}case 1:{let n=Gs(e,t,o.bytes);return new Z(e,t,o,n)}default:throw new Error("Invalid version")}}static createV0(e){return Z.create(0,Kt,e)}static createV1(e,t){return Z.create(1,e,t)}static decode(e){let[t,o]=Z.decodeFirst(e);if(o.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Z.inspectBytes(e),o=t.size-t.multihashSize,n=Te(e.subarray(o,o+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),s=new Nt(t.multihashCode,t.digestSize,i,n);return[t.version===0?Z.createV0(s):Z.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,o=()=>{let[w,q]=Gt(e.subarray(t));return t+=q,w},n=o(),i=Kt;if(n===18?(n=0,t=0):i=o(),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let s=t,a=o(),c=o(),u=t+c,d=u-s;return{version:n,codec:i,multihashCode:a,digestSize:c,multihashSize:d,size:u}}static parse(e,t){let[o,n]=dl(e,t),i=Z.decode(n);if(i.version===0&&e[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return _n(i).set(o,e),i}},dl=(r,e)=>{switch(r[0]){case"Q":{let t=e||de;return[de.prefix,t.decode(`${de.prefix}${r}`)]}case de.prefix:{let t=e||de;return[de.prefix,t.decode(r)]}case Ue.prefix:{let t=e||Ue;return[Ue.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)]}}},pl=(r,e,t)=>{let{prefix:o}=t;if(o!==de.prefix)throw Error(`Cannot string encode V0 in ${t.name} encoding`);let n=e.get(o);if(n==null){let i=t.encode(r).slice(1);return e.set(o,i),i}else return n},yl=(r,e,t)=>{let{prefix:o}=t,n=e.get(o);if(n==null){let i=t.encode(r);return e.set(o,i),i}else return n},Kt=112,ml=18,Gs=(r,e,t)=>{let o=Tt(r),n=o+Tt(e),i=new Uint8Array(n+t.byteLength);return St(r,i,0),St(e,i,o),i.set(t,n),i},gl=Symbol.for("@ipld/js-cid/CID");var Jt={...mn,...gn,...bn,...wn,...vn,...xn,...En,...An,...Sn,...Tn},Ip={...In,...Dn};function ut(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function Re(r=0){return globalThis.Buffer?.alloc!=null?ut(globalThis.Buffer.alloc(r)):new Uint8Array(r)}function ze(r=0){return globalThis.Buffer?.allocUnsafe!=null?ut(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function Js(r,e,t,o){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:o}}}var Ks=Js("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Cn=Js("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=ze(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),bl={utf8:Ks,"utf-8":Ks,hex:Jt.base16,latin1:Cn,ascii:Cn,binary:Cn,...Jt},wr=bl;function ae(r,e="utf8"){let t=wr[e];if(t==null)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?ut(globalThis.Buffer.from(r,"utf-8")):t.decoder.decode(`${t.prefix}${r}`)}function pe(r,e){e==null&&(e=r.reduce((n,i)=>n+i.length,0));let t=ze(e),o=0;for(let n of r)t.set(n,o),o+=n.length;return ut(t)}var vr={key:pe([ae("/pk/"),ae("muft89xjpybos8eas1vaq2xrbsx2vkll7is4ocy7pia5fsjlt3c2","base36")]),value:ae("080012a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100c2588f998971dac9e3eef76a311bf9159505aff69ea3b664c55a36aa28ee08de1127228a4d431bb9c0840240c75f6e98a0843a78d945491a3ea5e1f7cee2bc71383510db5290702383975b7bffae9fb40c84cc1220fb4a7db862fffb0de42f8fd8fb33a17deb20f30e2d0f194791fe69355a392f77df35f101e08a2fc95b2c018768938814fcb52482f899f5e90a1905e8abbcdbb1647ad80a5b0417e1ce8320d64197a6ba3848926375c63adebabdf6eb82109bcadfee13b62bf922bbb6f74c1a26c9bc6122d1436787e0e6de3c152b1959701092abef84599f73eaedb2fcef9f87293e1bbe8e0fef3f1a7fd2e8b94c7e633f88473644a63cb948e4d25c54490203010001","hex")};function Xs(r){let e=["js","go"];for(let t of e)for(let o of e)wl(r,{type:t,dht:!0},{type:o,dht:!0})}function wl(r,e,t){describe("dht.contentFetching",()=>{let o;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]);let n=await o[0].client.identify();await o[1].client.connect(n.peerId,n.addrs),await new Promise(i=>setTimeout(i,1e3))}),after(async function(){o!=null&&await Promise.all(o.map(async n=>{await n.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){this.timeout(10*1e3),await o[0].client.dht.put(vr.key,vr.value);let n=await o[1].client.dht.get(vr.key);W(n).to.equalBytes(vr.value)})})}async function Xt(r){let e=[];for await(let t of r)e.push(t);return e}function Qs(r){let e=["js","go"];for(let t of e)for(let o of e)t==="go"&&o==="go"||vl(r,{type:t,dht:!0},{type:o,dht:!0})}function vl(r,e,t){describe("dht.contentRouting",()=>{let o,n;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t),r.spawn(t)]),n=await Promise.all(o.map(async i=>await i.client.identify())),await o[0].client.connect(n[1].peerId,n[1].addrs),await o[0].client.connect(n[2].peerId,n[2].addrs),await new Promise(i=>setTimeout(i,1e3))}),after(async function(){o!=null&&await Promise.all(o.map(async i=>{await i.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let i=Z.parse("QmVzw6MPsF96TyXBSRs1ptLoVMWRv5FCYJZZGJSVB2Hp39");await o[0].client.dht.provide(i);let s=await Xt(o[1].client.dht.findProviders(i,1));W(s).to.exist(),W(s.length).to.be.greaterThan(0)})})}var na=oe(ta(),1),El=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]),jn=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},Al=(r,e,t)=>{let o=t.retries-(e-1);return r.attemptNumber=e,r.retriesLeft=o,r},Sl=r=>El.has(r),ra=r=>globalThis.DOMException===void 0?new Error(r):new DOMException(r);async function qn(r,e){return new Promise((t,o)=>{e={onFailedAttempt(){},retries:10,...e};let n=na.default.operation(e);n.attempt(async i=>{try{t(await r(i))}catch(s){if(!(s instanceof Error)){o(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof jn)n.stop(),o(s.originalError);else if(s instanceof TypeError&&!Sl(s.message))n.stop(),o(s);else{Al(s,i,e);try{await e.onFailedAttempt(s)}catch(a){o(a);return}n.retry(s)||o(n.mainError())}}}),e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",()=>{n.stop();let i=e.signal.reason===void 0?ra("The operation was aborted."):e.signal.reason;o(i instanceof Error?i:ra(i))},{once:!0})})}function oa(r){let e=["js","go"];for(let t of e)for(let o of e)Tl(r,{type:t,dht:!0},{type:o,dht:!0})}function Tl(r,e,t){describe("dht.peerRouting",()=>{let o;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t),r.spawn(t)])}),after(async function(){o!=null&&await Promise.all(o.map(async n=>{await n.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let n=await o[1].client.identify(),i=await o[2].client.identify();await o[0].client.connect(n.peerId,n.addrs),await o[0].client.connect(i.peerId,i.addrs);let s=await qn(async()=>await o[1].client.dht.findPeer(i.peerId),{retries:10});W(i.addrs.map(a=>a.toString())).to.include.deep.members(s.multiaddrs.map(a=>a.toString()))})})}async function Bn(r){Xs(r),Qs(r),oa(r)}async function lt(r){for await(let e of r)return e}var xr=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},kn=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},ia=r=>globalThis.DOMException===void 0?new kn(r):new DOMException(r),sa=r=>{let e=r.reason===void 0?ia("This operation was aborted."):r.reason;return e instanceof Error?e:ia(e)};function Ln(r,e){let{milliseconds:t,fallback:o,message:n,customTimers:i={setTimeout,clearTimeout}}=e,s,a=new Promise((c,u)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t===Number.POSITIVE_INFINITY){c(r);return}if(e.signal){let{signal:w}=e;w.aborted&&u(sa(w)),w.addEventListener("abort",()=>{u(sa(w))})}let d=new xr;s=i.setTimeout.call(void 0,()=>{if(o){try{c(o())}catch(w){u(w)}return}typeof r.cancel=="function"&&r.cancel(),n===!1?c():n instanceof Error?u(n):(d.message=n??`Promise timed out after ${t} milliseconds`,u(d))},t),(async()=>{try{c(await r)}catch(w){u(w)}finally{i.clearTimeout.call(void 0,s)}})()});return a.clear=()=>{i.clearTimeout.call(void 0,s),s=void 0},a}var Un=Symbol("resolveValue");async function Je(r,e={}){let{interval:t=20,timeout:o=Number.POSITIVE_INFINITY,before:n=!0}=e,i,s=new Promise((a,c)=>{let u=async()=>{try{let d=await r();if(typeof d=="object"&&d[Un])a(d[Un]);else{if(typeof d!="boolean")throw new TypeError("Expected condition to return a boolean");d===!0?a():i=setTimeout(u,t)}}catch(d){c(d)}};n?u():i=setTimeout(u,t)});if(o===Number.POSITIVE_INFINITY)return s;try{return await Ln(s,typeof o=="number"?{milliseconds:o}:o)}finally{clearTimeout(i)}}Je.resolveWith=r=>({[Un]:r});function aa(r){let e=["js","go"];for(let t of e)for(let o of e)Nl(r,{type:t,pubsub:!0,pubsubRouter:"floodsub"},{type:o,pubsub:!0,pubsubRouter:"floodsub"})}function Nl(r,e,t){describe("pubsub.floodSub",()=>{let o,n;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]);let[i,s]=o;n=await s.client.identify(),await i.client.connect(n.peerId,n.addrs)}),after(async function(){o!=null&&await Promise.all(o.map(async i=>{await i.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let i="test-topic",s=ae("test-data"),[a,c]=o,u=c.client.pubsub.subscribe(i),d=async()=>{let q=await lt(u);W(q).to.exist(),W(q).to.have.property("data").that.equalBytes(s)},w=async()=>{await Je(async()=>(await o[0].client.pubsub.getSubscribers(i)).map(k=>k.toString()).includes(n.peerId.toString())),await a.client.pubsub.publish(i,s)};return await Promise.all([d(),w()])})})}function ca(r){let e=["js","go"];for(let t of e)for(let o of e)Pl(r,{type:t,pubsub:!0,pubsubRouter:"gossipsub"},{type:o,pubsub:!0,pubsubRouter:"gossipsub"})}function Pl(r,e,t){describe("pubsub.gossipsub",()=>{let o,n;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]),n=await o[1].client.identify(),await o[0].client.connect(n.peerId,n.addrs)}),after(async function(){o!=null&&await Promise.all(o.map(async i=>{await i.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let i="test-topic",s=ae("test-data"),a=o[1].client.pubsub.subscribe(i),c=async()=>{let d=await lt(a);W(d).to.exist(),W(d).to.have.property("data").that.equalBytes(s)},u=async()=>{await Je(async()=>(await o[0].client.pubsub.getSubscribers(i)).map(w=>w.toString()).includes(n.peerId.toString())),await o[0].client.pubsub.publish(i,s)};return await Promise.all([c(),u()])})})}function ua(r){let e=["js","go"];for(let t of e)for(let o of e)Ol(r,{type:t,pubsub:!0,pubsubRouter:"floodsub"},{type:o,pubsub:!0,pubsubRouter:"gossipsub"})}function Ol(r,e,t){describe("pubsub.hybrid",()=>{let o,n;before(async function(){this.timeout(20*1e3),o=await Promise.all([r.spawn(e),r.spawn(t)]),n=await o[1].client.identify(),await o[0].client.connect(n.peerId,n.addrs)}),after(async function(){o!=null&&await Promise.all(o.map(async i=>{await i.stop()}))}),it(`${e.type} peer to ${t.type} peer`,async function(){let i="test-topic",s=ae("test-data"),a=o[1].client.pubsub.subscribe(i),c=async()=>{let d=await lt(a);W(d).to.exist(),W(d).to.have.property("data").that.equalBytes(s)},u=async()=>{await Je(async()=>(await o[0].client.pubsub.getSubscribers(i)).map(w=>w.toString()).includes(n.peerId.toString())),await o[0].client.pubsub.publish(i,s)};return await Promise.all([c(),u()])})})}async function Rn(r){aa(r),ca(r),ua(r)}var Er=class{constructor(e){if(!(e>0)||e-1&e)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){let e=this.buffer[this.btm];if(e!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return this.buffer[this.btm]===void 0}},Ot=class{constructor(e={}){this.hwm=e.splitLimit??16,this.head=new Er(this.hwm),this.tail=this.head,this.size=0}calculateSize(e){return e?.byteLength!=null?e.byteLength:1}push(e){if(e?.value!=null&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){let t=this.head;this.head=t.next=new Er(2*this.head.buffer.length),this.head.push(e)}}shift(){let e=this.tail.shift();if(e===void 0&&this.tail.next!=null){let t=this.tail.next;this.tail.next=null,this.tail=t,e=this.tail.shift()}return e?.value!=null&&(this.size-=this.calculateSize(e.value)),e}isEmpty(){return this.head.isEmpty()}};function Mt(r={}){return Ml(t=>{let o=t.shift();if(o==null)return{done:!0};if(o.error!=null)throw o.error;return{done:o.done===!0,value:o.value}},r)}function Ml(r,e){e=e??{};let t=e.onEnd,o=new Ot,n,i,s,a=async()=>o.isEmpty()?s?{done:!0}:await new Promise((E,I)=>{i=B=>{i=null,o.push(B);try{E(r(o))}catch($){I($)}return n}}):r(o),c=E=>i!=null?i(E):(o.push(E),n),u=E=>(o=new Ot,i!=null?i({error:E}):(o.push({error:E}),n)),d=E=>{if(s)return n;if(e?.objectMode!==!0&&E?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return c({done:!1,value:E})},w=E=>s?n:(s=!0,E!=null?u(E):c({done:!0})),q=()=>(o=new Ot,w(),{done:!0}),k=E=>(w(E),{done:!0});if(n={[Symbol.asyncIterator](){return this},next:a,return:q,throw:k,push:d,end:w,get readableLength(){return o.size}},t==null)return n;let N=n;return n={[Symbol.asyncIterator](){return this},next(){return N.next()},throw(E){return N.throw(E),t!=null&&(t(E),t=void 0),{done:!0}},return(){return N.return(),t!=null&&(t(),t=void 0),{done:!0}},push:d,end(E){return N.end(E),t!=null&&(t(E),t=void 0),n},get readableLength(){return N.readableLength}},n}async function*zn(...r){let e=Mt({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async t=>{for await(let o of t)e.push(o)})),e.end()}catch(t){e.end(t)}}),yield*e}var Il=(...r)=>{let e;for(;r.length>0;)e=r.shift()(e);return e},fa=r=>r!=null&&(typeof r[Symbol.asyncIterator]=="function"||typeof r[Symbol.iterator]=="function"||typeof r.next=="function"),Fn=r=>r!=null&&typeof r.sink=="function"&&fa(r.source),Dl=r=>e=>{let t=r.sink(e);if(t.then!=null){let o=Mt({objectMode:!0});return t.then(()=>{o.end()},i=>{o.end(i)}),zn(o,async function*(){yield*r.source,o.end()}())}return r.source};function Qt(r,...e){if(Fn(r)){let o=r;r=()=>o.source}else if(fa(r)){let o=r;r=()=>o}let t=[r,...e];if(t.length>1&&Fn(t[t.length-1])&&(t[t.length-1]=t[t.length-1].sink),t.length>2)for(let o=1;o<t.length-1;o++)Fn(t[o])&&(t[o]=Dl(t[o]));return Il(...t)}function Zt(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}function Vn(r,e){let t=["js","go"];for(let o of t)for(let n of t)_l(r,e,{type:o,muxer:e},{type:n,muxer:e})}function _l(r,e,t,o){describe(`echo streams - ${e}`,()=>{let n;before(async function(){this.timeout(20*1e3),n=await Promise.all([r.spawn(t),r.spawn(o)]);let i=await n[0].client.identify();await n[1].client.connect(i.peerId,i.addrs),await new Promise(s=>setTimeout(s,1e3))}),after(async function(){n!=null&&await Promise.all(n.map(async i=>{await i.stop()}))}),it(`${t.type} sender to ${o.type} listener`,async function(){this.timeout(10*1e3);let i=await n[1].client.identify(),s="/echo/1.0.0",a=[ae("hello world")];await n[1].client.registerStreamHandler(s,async w=>{await Qt(w,async function*(q){for await(let k of q)yield k.subarray()},w)});let c=await n[0].client.openStream(i.peerId,s),u=Zt(),d=await Qt(a,async function*(w){yield*w,await u.promise},c,async function*(w){for await(let q of w)yield q.subarray(),u.resolve()},async w=>await Xt(w));W(d).to.deep.equal(a)})})}async function $n(r){Vn(r,"mplex"),Vn(r,"yamux")}var Xe=ke("node:net");function Ar(r){return Boolean((0,Xe.isIP)(r))}function ye(r,e="utf8"){let t=wr[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 la=Xe.isIPv4,Cl=Xe.isIPv6,Wn=function(r){let e=0;if(r=r.toString().trim(),la(r)){let t=new Uint8Array(e+4);return r.split(/\./g).forEach(o=>{t[e++]=parseInt(o,10)&255}),t}if(Cl(r)){let t=r.split(":",8),o;for(o=0;o<t.length;o++){let i=la(t[o]),s;i&&(s=Wn(t[o]),t[o]=ye(s.slice(0,2),"base16")),s!=null&&++o<8&&t.splice(o,0,ye(s.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(o=0;o<t.length&&t[o]!=="";o++);let i=[o,1];for(o=9-t.length;o>0;o--)i.push("0");t.splice.apply(t,i)}let n=new Uint8Array(e+16);for(o=0;o<t.length;o++){let i=parseInt(t[o],16);n[e++]=i>>8&255,n[e++]=i&255}return n}throw new Error("invalid ip address")},ha=function(r,e=0,t){e=~~e,t=t??r.length-e;let o=new DataView(r.buffer);if(t===4){let n=[];for(let i=0;i<t;i++)n.push(r[e+i]);return n.join(".")}if(t===16){let n=[];for(let i=0;i<t;i+=2)n.push(o.getUint16(e+i).toString(16));return n.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""};var Yt={},Gn={},ql=[[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"],[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"],[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"]];ql.forEach(r=>{let e=Bl(...r);Gn[e.code]=e,Yt[e.name]=e});function Bl(r,e,t,o,n){return{code:r,size:e,name:t,resolvable:Boolean(o),path:Boolean(n)}}function H(r){if(typeof r=="number"){if(Gn[r]!=null)return Gn[r];throw new Error(`no protocol with code: ${r}`)}else if(typeof r=="string"){if(Yt[r]!=null)return Yt[r];throw new Error(`no protocol with name: ${r}`)}throw new Error(`invalid protocol id type: ${typeof r}`)}var _e=oe(Sr(),1);function Na(r,e){switch(H(r).code){case 4:case 41:return Zl(e);case 42:return Sa(e);case 6:case 273:case 33:case 132:return Oa(e).toString();case 53:case 54:case 55:case 56:case 400:case 777:return Sa(e);case 421:return th(e);case 444:return Ta(e);case 445:return Ta(e);case 466:return eh(e);default:return ye(e,"base16")}}function Pa(r,e){switch(H(r).code){case 4:return Ea(e);case 41:return Ea(e);case 42:return Aa(e);case 6:case 273:case 33:case 132:return Qn(parseInt(e,10));case 53:case 54:case 55:case 56:case 400:case 777:return Aa(e);case 421:return Yl(e);case 444:return rh(e);case 445:return nh(e);case 466:return Hl(e);default:return ae(e,"base16")}}var Xn=Object.values(Jt).map(r=>r.decoder),Ql=function(){let r=Xn[0].or(Xn[1]);return Xn.slice(2).forEach(e=>r=r.or(e)),r}();function Ea(r){if(!Ar(r))throw new Error("invalid ip address");return Wn(r)}function Zl(r){let e=ha(r,0,r.length);if(e==null)throw new Error("ipBuff is required");if(!Ar(e))throw new Error("invalid ip address");return e}function Qn(r){let e=new ArrayBuffer(2);return new DataView(e).setUint16(0,r),new Uint8Array(e)}function Oa(r){return new DataView(r.buffer).getUint16(r.byteOffset)}function Aa(r){let e=ae(r),t=Uint8Array.from(_e.default.encode(e.length));return pe([t,e],t.length+e.length)}function Sa(r){let e=_e.default.decode(r);if(r=r.slice(_e.default.decode.bytes),r.length!==e)throw new Error("inconsistent lengths");return ye(r)}function Yl(r){let e;r[0]==="Q"||r[0]==="1"?e=br(de.decode(`z${r}`)).bytes:e=Z.parse(r).multihash.bytes;let t=Uint8Array.from(_e.default.encode(e.length));return pe([t,e],t.length+e.length)}function Hl(r){let e=Ql.decode(r),t=Uint8Array.from(_e.default.encode(e.length));return pe([t,e],t.length+e.length)}function eh(r){let e=_e.default.decode(r),t=r.slice(_e.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return"u"+ye(t,"base64url")}function th(r){let e=_e.default.decode(r),t=r.slice(_e.default.decode.bytes);if(t.length!==e)throw new Error("inconsistent lengths");return ye(t,"base58btc")}function rh(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=Ue.decode("b"+e[0]),o=parseInt(e[1],10);if(o<1||o>65536)throw new Error("Port number is not in range(1, 65536)");let n=Qn(o);return pe([t,n],t.length+n.length)}function nh(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=Ue.decode(`b${e[0]}`),o=parseInt(e[1],10);if(o<1||o>65536)throw new Error("Port number is not in range(1, 65536)");let n=Qn(o);return pe([t,n],t.length+n.length)}function Ta(r){let e=r.slice(0,r.length-2),t=r.slice(r.length-2),o=ye(e,"base32"),n=Oa(t);return`${o}:${n}`}var It=oe(Sr(),1);function oh(r){let e=[],t=r.split("/").slice(1);if(t.length===1&&t[0]==="")return[];for(let o=0;o<t.length;o++){let n=t[o],i=H(n);if(i.size===0){e.push([n]);continue}if(o++,o>=t.length)throw Ia("invalid address: "+r);if(i.path===!0){e.push([n,to(t.slice(o).join("/"))]);break}e.push([n,t[o]])}return e}function ih(r){let e=[];return r.map(t=>{let o=Pr(t);return e.push(o.name),t.length>1&&t[1]!=null&&e.push(t[1]),null}),to(e.join("/"))}function sh(r){return r.map(e=>{Array.isArray(e)||(e=[e]);let t=Pr(e);return e.length>1?[t.code,Pa(t.code,e[1])]:[t.code]})}function Zn(r){return r.map(e=>{let t=Pr(e);return e[1]!=null?[t.code,Na(t.code,e[1])]:[t.code]})}function Yn(r){return Nr(pe(r.map(e=>{let t=Pr(e),o=Uint8Array.from(It.default.encode(t.code));return e.length>1&&e[1]!=null&&(o=pe([o,e[1]])),o})))}function Hn(r,e){return r.size>0?r.size/8:r.size===0?0:It.default.decode(e)+(It.default.decode.bytes??0)}function Tr(r){let e=[],t=0;for(;t<r.length;){let o=It.default.decode(r,t),n=It.default.decode.bytes??0,i=H(o),s=Hn(i,r.slice(t+n));if(s===0){e.push([o]),t+=n;continue}let a=r.slice(t+n,t+n+s);if(t+=s+n,t>r.length)throw Ia("Invalid address Uint8Array: "+ye(r,"base16"));e.push([o,a])}return e}function eo(r){let e=Tr(r),t=Zn(e);return ih(t)}function ah(r){r=to(r);let e=oh(r),t=sh(e);return Yn(t)}function Ma(r){return ah(r)}function Nr(r){let e=ch(r);if(e!=null)throw e;return Uint8Array.from(r)}function ch(r){try{Tr(r)}catch(e){return e}}function to(r){return"/"+r.trim().split("/").filter(e=>e).join("/")}function Ia(r){return new Error("Error parsing address: "+r)}function Pr(r){return H(r[0])}var oo=oe(Sr(),1);var ja=oe(ro(),1);function Or(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 Dt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},no=function(r,e,t,o,n){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ht,er,tr,Ca,lh=Symbol.for("nodejs.util.inspect.custom"),hh=[H("dns").code,H("dns4").code,H("dns6").code,H("dnsaddr").code],dh=new Map,qa=Symbol.for("@multiformats/js-multiaddr/multiaddr");function ph(r){return Boolean(r?.[qa])}var Fe=class{constructor(e){if(Ht.set(this,void 0),er.set(this,void 0),tr.set(this,void 0),this[Ca]=!0,e==null&&(e=""),e instanceof Uint8Array)this.bytes=Nr(e);else if(typeof e=="string"){if(e.length>0&&e.charAt(0)!=="/")throw new Error(`multiaddr "${e}" must start with a "/"`);this.bytes=Ma(e)}else if(ph(e))this.bytes=Nr(e.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr")}toString(){return Dt(this,Ht,"f")==null&&no(this,Ht,eo(this.bytes),"f"),Dt(this,Ht,"f")}toJSON(){return this.toString()}toOptions(){let e,t,o,n,i="",s=H("tcp"),a=H("udp"),c=H("ip4"),u=H("ip6"),d=H("dns6"),w=H("ip6zone");for(let[k,N]of this.stringTuples())k===w.code&&(i=`%${N??""}`),hh.includes(k)&&(t=s.name,n=443,o=`${N??""}${i}`,e=k===d.code?6:4),(k===s.code||k===a.code)&&(t=H(k).name,n=parseInt(N??"")),(k===c.code||k===u.code)&&(t=H(k).name,o=`${N??""}${i}`,e=k===u.code?6:4);if(e==null||t==null||o==null||n==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:e,host:o,transport:t,port:n}}protos(){return this.protoCodes().map(e=>Object.assign({},H(e)))}protoCodes(){let e=[],t=this.bytes,o=0;for(;o<t.length;){let n=oo.default.decode(t,o),i=oo.default.decode.bytes??0,s=H(n),a=Hn(s,t.slice(o+i));o+=a+i,e.push(n)}return e}protoNames(){return this.protos().map(e=>e.name)}tuples(){return Dt(this,er,"f")==null&&no(this,er,Tr(this.bytes),"f"),Dt(this,er,"f")}stringTuples(){return Dt(this,tr,"f")==null&&no(this,tr,Zn(this.tuples()),"f"),Dt(this,tr,"f")}encapsulate(e){return e=new Fe(e),new Fe(this.toString()+e.toString())}decapsulate(e){let t=e.toString(),o=this.toString(),n=o.lastIndexOf(t);if(n<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${e.toString()}`);return new Fe(o.slice(0,n))}decapsulateCode(e){let t=this.tuples();for(let o=t.length-1;o>=0;o--)if(t[o][0]===e)return new Fe(Yn(t.slice(0,o)));return this}getPeerId(){try{let t=this.stringTuples().filter(o=>o[0]===Yt.ipfs.code).pop();if(t?.[1]!=null){let o=t[1];return o[0]==="Q"||o[0]==="1"?ye(de.decode(`z${o}`),"base58btc"):ye(Z.parse(o).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){let e=null;try{e=this.stringTuples().filter(t=>H(t[0]).path===!0)[0][1],e==null&&(e=null)}catch{e=null}return e}equals(e){return Or(this.bytes,e.bytes)}async resolve(e){let t=this.protos().find(i=>i.resolvable);if(t==null)return[this];let o=dh.get(t.name);if(o==null)throw(0,ja.default)(new Error(`no available resolver for ${t.name}`),"ERR_NO_AVAILABLE_RESOLVER");return(await o(this,e)).map(i=>new Fe(i))}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)}[(Ht=new WeakMap,er=new WeakMap,tr=new WeakMap,Ca=qa,lh)](){return`Multiaddr(${eo(this.bytes)})`}};function Ba(r){return new Fe(r)}var bo=oe(uo(),1),Ac=oe(yc(),1),Sc=oe(dt(),1),wo=oe(go(),1),Tc=oe(Ec(),1);function Ah(){Sc.default._configure(),bo.default._configure(Ac.default),wo.default._configure(Tc.default)}Ah();var Nc=["uint64","int64","sint64","fixed64","sfixed64"];function Sh(r){for(let e of Nc){if(r[e]==null)continue;let t=r[e];r[e]=function(){return BigInt(t.call(this).toString())}}return r}function vo(r){return Sh(new bo.default(r))}function Th(r){for(let e of Nc){if(r[e]==null)continue;let t=r[e];r[e]=function(o){return t.call(this,o.toString())}}return r}function xo(){return Th(wo.default.create())}function Ye(r,e){let t=vo(r instanceof Uint8Array?r:r.subarray());return e.decode(t)}function He(r,e){let t=xo();return e.encode(r,t,{lengthDelimited:!1}),t.finish()}var Ct;(function(r){r[r.VARINT=0]="VARINT",r[r.BIT64=1]="BIT64",r[r.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",r[r.START_GROUP=3]="START_GROUP",r[r.END_GROUP=4]="END_GROUP",r[r.BIT32=5]="BIT32"})(Ct||(Ct={}));function Cr(r,e,t,o){return{name:r,type:e,encode:t,decode:o}}function or(r){function e(n){if(r[n.toString()]==null)throw new Error("Invalid enum value");return r[n]}let t=function(i,s){let a=e(i);s.int32(a)},o=function(i){let s=i.int32();return e(s)};return Cr("enum",Ct.VARINT,t,o)}function et(r,e){return Cr("message",Ct.LENGTH_DELIMITED,r,e)}var jt;(function(r){let e;(function(n){n.RESERVE="RESERVE",n.CONNECT="CONNECT",n.STATUS="STATUS"})(e=r.Type||(r.Type={}));let t;(function(n){n[n.RESERVE=0]="RESERVE",n[n.CONNECT=1]="CONNECT",n[n.STATUS=2]="STATUS"})(t||(t={})),function(n){n.codec=()=>or(t)}(e=r.Type||(r.Type={}));let o;r.codec=()=>(o==null&&(o=et((n,i,s={})=>{s.lengthDelimited!==!1&&i.fork(),n.type!=null&&(i.uint32(8),r.Type.codec().encode(n.type,i)),n.peer!=null&&(i.uint32(18),qt.codec().encode(n.peer,i)),n.reservation!=null&&(i.uint32(26),jr.codec().encode(n.reservation,i)),n.limit!=null&&(i.uint32(34),Bt.codec().encode(n.limit,i)),n.status!=null&&(i.uint32(40),qe.codec().encode(n.status,i)),s.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{let s={},a=i==null?n.len:n.pos+i;for(;n.pos<a;){let c=n.uint32();switch(c>>>3){case 1:s.type=r.Type.codec().decode(n);break;case 2:s.peer=qt.codec().decode(n,n.uint32());break;case 3:s.reservation=jr.codec().decode(n,n.uint32());break;case 4:s.limit=Bt.codec().decode(n,n.uint32());break;case 5:s.status=qe.codec().decode(n);break;default:n.skipType(c&7);break}}return s})),o),r.encode=n=>He(n,r.codec()),r.decode=n=>Ye(n,r.codec())})(jt||(jt={}));var Pc;(function(r){let e;(function(n){n.CONNECT="CONNECT",n.STATUS="STATUS"})(e=r.Type||(r.Type={}));let t;(function(n){n[n.CONNECT=0]="CONNECT",n[n.STATUS=1]="STATUS"})(t||(t={})),function(n){n.codec=()=>or(t)}(e=r.Type||(r.Type={}));let o;r.codec=()=>(o==null&&(o=et((n,i,s={})=>{s.lengthDelimited!==!1&&i.fork(),n.type!=null&&(i.uint32(8),r.Type.codec().encode(n.type,i)),n.peer!=null&&(i.uint32(18),qt.codec().encode(n.peer,i)),n.limit!=null&&(i.uint32(26),Bt.codec().encode(n.limit,i)),n.status!=null&&(i.uint32(32),qe.codec().encode(n.status,i)),s.lengthDelimited!==!1&&i.ldelim()},(n,i)=>{let s={},a=i==null?n.len:n.pos+i;for(;n.pos<a;){let c=n.uint32();switch(c>>>3){case 1:s.type=r.Type.codec().decode(n);break;case 2:s.peer=qt.codec().decode(n,n.uint32());break;case 3:s.limit=Bt.codec().decode(n,n.uint32());break;case 4:s.status=qe.codec().decode(n);break;default:n.skipType(c&7);break}}return s})),o),r.encode=n=>He(n,r.codec()),r.decode=n=>Ye(n,r.codec())})(Pc||(Pc={}));var qt;(function(r){let e;r.codec=()=>(e==null&&(e=et((t,o,n={})=>{if(n.lengthDelimited!==!1&&o.fork(),t.id!=null&&t.id.byteLength>0&&(o.uint32(10),o.bytes(t.id)),t.addrs!=null)for(let i of t.addrs)o.uint32(18),o.bytes(i);n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={id:new Uint8Array(0),addrs:[]},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.id=t.bytes();break;case 2:n.addrs.push(t.bytes());break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>He(t,r.codec()),r.decode=t=>Ye(t,r.codec())})(qt||(qt={}));var jr;(function(r){let e;r.codec=()=>(e==null&&(e=et((t,o,n={})=>{if(n.lengthDelimited!==!1&&o.fork(),t.expire!=null&&t.expire!==0n&&(o.uint32(8),o.uint64(t.expire)),t.addrs!=null)for(let i of t.addrs)o.uint32(18),o.bytes(i);t.voucher!=null&&(o.uint32(26),o.bytes(t.voucher)),n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={expire:0n,addrs:[]},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.expire=t.uint64();break;case 2:n.addrs.push(t.bytes());break;case 3:n.voucher=t.bytes();break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>He(t,r.codec()),r.decode=t=>Ye(t,r.codec())})(jr||(jr={}));var Bt;(function(r){let e;r.codec=()=>(e==null&&(e=et((t,o,n={})=>{n.lengthDelimited!==!1&&o.fork(),t.duration!=null&&(o.uint32(8),o.uint32(t.duration)),t.data!=null&&(o.uint32(16),o.uint64(t.data)),n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.duration=t.uint32();break;case 2:n.data=t.uint64();break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>He(t,r.codec()),r.decode=t=>Ye(t,r.codec())})(Bt||(Bt={}));var qe;(function(r){r.UNUSED="UNUSED",r.OK="OK",r.RESERVATION_REFUSED="RESERVATION_REFUSED",r.RESOURCE_LIMIT_EXCEEDED="RESOURCE_LIMIT_EXCEEDED",r.PERMISSION_DENIED="PERMISSION_DENIED",r.CONNECTION_FAILED="CONNECTION_FAILED",r.NO_RESERVATION="NO_RESERVATION",r.MALFORMED_MESSAGE="MALFORMED_MESSAGE",r.UNEXPECTED_MESSAGE="UNEXPECTED_MESSAGE"})(qe||(qe={}));var Eo;(function(r){r[r.UNUSED=0]="UNUSED",r[r.OK=100]="OK",r[r.RESERVATION_REFUSED=200]="RESERVATION_REFUSED",r[r.RESOURCE_LIMIT_EXCEEDED=201]="RESOURCE_LIMIT_EXCEEDED",r[r.PERMISSION_DENIED=202]="PERMISSION_DENIED",r[r.CONNECTION_FAILED=203]="CONNECTION_FAILED",r[r.NO_RESERVATION=204]="NO_RESERVATION",r[r.MALFORMED_MESSAGE=400]="MALFORMED_MESSAGE",r[r.UNEXPECTED_MESSAGE=401]="UNEXPECTED_MESSAGE"})(Eo||(Eo={}));(function(r){r.codec=()=>or(Eo)})(qe||(qe={}));var Oc;(function(r){let e;r.codec=()=>(e==null&&(e=et((t,o,n={})=>{n.lengthDelimited!==!1&&o.fork(),t.relay!=null&&t.relay.byteLength>0&&(o.uint32(10),o.bytes(t.relay)),t.peer!=null&&t.peer.byteLength>0&&(o.uint32(18),o.bytes(t.peer)),t.expiration!=null&&t.expiration!==0n&&(o.uint32(24),o.uint64(t.expiration)),n.lengthDelimited!==!1&&o.ldelim()},(t,o)=>{let n={relay:new Uint8Array(0),peer:new Uint8Array(0),expiration:0n},i=o==null?t.len:t.pos+o;for(;t.pos<i;){let s=t.uint32();switch(s>>>3){case 1:n.relay=t.bytes();break;case 2:n.peer=t.bytes();break;case 3:n.expiration=t.uint64();break;default:t.skipType(s&7);break}}return n})),e),r.encode=t=>He(t,r.codec()),r.decode=t=>Ye(t,r.codec())})(Oc||(Oc={}));var Ic=Symbol.for("@achingbrain/uint8arraylist");function Mc(r,e){if(e==null||e<0)throw new RangeError("index is out of bounds");let t=0;for(let o of r){let n=t+o.byteLength;if(e<n)return{buf:o,index:e-t};t=n}throw new RangeError("index is out of bounds")}function qr(r){return Boolean(r?.[Ic])}var me=class{constructor(...e){Object.defineProperty(this,Ic,{value:!0}),this.bufs=[],this.length=0,e.length>0&&this.appendAll(e)}*[Symbol.iterator](){yield*this.bufs}get byteLength(){return this.length}append(...e){this.appendAll(e)}appendAll(e){let t=0;for(let o of e)if(o instanceof Uint8Array)t+=o.byteLength,this.bufs.push(o);else if(qr(o))t+=o.byteLength,this.bufs.push(...o.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}prepend(...e){this.prependAll(e)}prependAll(e){let t=0;for(let o of e.reverse())if(o instanceof Uint8Array)t+=o.byteLength,this.bufs.unshift(o);else if(qr(o))t+=o.byteLength,this.bufs.unshift(...o.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=t}get(e){let t=Mc(this.bufs,e);return t.buf[t.index]}set(e,t){let o=Mc(this.bufs,e);o.buf[o.index]=t}write(e,t=0){if(e instanceof Uint8Array)for(let o=0;o<e.length;o++)this.set(t+o,e[o]);else if(qr(e))for(let o=0;o<e.length;o++)this.set(t+o,e.get(o));else throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList")}consume(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0)){if(e===this.byteLength){this.bufs=[],this.length=0;return}for(;this.bufs.length>0;)if(e>=this.bufs[0].byteLength)e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}}}slice(e,t){let{bufs:o,length:n}=this._subList(e,t);return pe(o,n)}subarray(e,t){let{bufs:o,length:n}=this._subList(e,t);return o.length===1?o[0]:pe(o,n)}sublist(e,t){let{bufs:o,length:n}=this._subList(e,t),i=new me;return i.length=n,i.bufs=o,i}_subList(e,t){if(e=e??0,t=t??this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(e===0&&t===this.length)return{bufs:[...this.bufs],length:this.length};let o=[],n=0;for(let i=0;i<this.bufs.length;i++){let s=this.bufs[i],a=n,c=a+s.byteLength;if(n=c,e>=c)continue;let u=e>=a&&e<c,d=t>a&&t<=c;if(u&&d){if(e===a&&t===c){o.push(s);break}let w=e-a;o.push(s.subarray(w,w+(t-e)));break}if(u){if(e===0){o.push(s);continue}o.push(s.subarray(e-a));continue}if(d){if(t===c){o.push(s);break}o.push(s.subarray(0,t-a));break}o.push(s)}return{bufs:o,length:t-e}}indexOf(e,t=0){if(!qr(e)&&!(e instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');let o=e instanceof Uint8Array?e:e.subarray();if(t=Number(t??0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=o.byteLength;if(n===0)throw new TypeError("search must be at least 1 byte long");let i=256,s=new Int32Array(i);for(let w=0;w<i;w++)s[w]=-1;for(let w=0;w<n;w++)s[o[w]]=w;let a=s,c=this.byteLength-o.byteLength,u=o.byteLength-1,d;for(let w=t;w<=c;w+=d){d=0;for(let q=u;q>=0;q--){let k=this.get(w+q);if(o[q]!==k){d=Math.max(1,q-a[k]);break}}if(d===0)return w}return-1}getInt8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}setInt8(e,t){let o=ze(1);new DataView(o.buffer,o.byteOffset,o.byteLength).setInt8(0,t),this.write(o,e)}getInt16(e,t){let o=this.subarray(e,e+2);return new DataView(o.buffer,o.byteOffset,o.byteLength).getInt16(0,t)}setInt16(e,t,o){let n=Re(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt16(0,t,o),this.write(n,e)}getInt32(e,t){let o=this.subarray(e,e+4);return new DataView(o.buffer,o.byteOffset,o.byteLength).getInt32(0,t)}setInt32(e,t,o){let n=Re(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt32(0,t,o),this.write(n,e)}getBigInt64(e,t){let o=this.subarray(e,e+8);return new DataView(o.buffer,o.byteOffset,o.byteLength).getBigInt64(0,t)}setBigInt64(e,t,o){let n=Re(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigInt64(0,t,o),this.write(n,e)}getUint8(e){let t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}setUint8(e,t){let o=ze(1);new DataView(o.buffer,o.byteOffset,o.byteLength).setUint8(0,t),this.write(o,e)}getUint16(e,t){let o=this.subarray(e,e+2);return new DataView(o.buffer,o.byteOffset,o.byteLength).getUint16(0,t)}setUint16(e,t,o){let n=Re(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint16(0,t,o),this.write(n,e)}getUint32(e,t){let o=this.subarray(e,e+4);return new DataView(o.buffer,o.byteOffset,o.byteLength).getUint32(0,t)}setUint32(e,t,o){let n=Re(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,t,o),this.write(n,e)}getBigUint64(e,t){let o=this.subarray(e,e+8);return new DataView(o.buffer,o.byteOffset,o.byteLength).getBigUint64(0,t)}setBigUint64(e,t,o){let n=Re(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigUint64(0,t,o),this.write(n,e)}getFloat32(e,t){let o=this.subarray(e,e+4);return new DataView(o.buffer,o.byteOffset,o.byteLength).getFloat32(0,t)}setFloat32(e,t,o){let n=Re(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat32(0,t,o),this.write(n,e)}getFloat64(e,t){let o=this.subarray(e,e+8);return new DataView(o.buffer,o.byteOffset,o.byteLength).getFloat64(0,t)}setFloat64(e,t,o){let n=Re(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat64(0,t,o),this.write(n,e)}equals(e){if(e==null||!(e instanceof me)||e.bufs.length!==this.bufs.length)return!1;for(let t=0;t<this.bufs.length;t++)if(!Or(this.bufs[t],e.bufs[t]))return!1;return!0}static fromUint8Arrays(e,t){let o=new me;return o.bufs=e,t==null&&(t=e.reduce((n,i)=>n+i.byteLength,0)),o.length=t,o}};function Dc(r){let e=async function*(){let t=yield,o=new me;for await(let n of r){if(t==null){o.append(n),t=yield o,o=new me;continue}for(o.append(n);o.length>=t;){let i=o.sublist(0,t);if(o.consume(t),t=yield i,t==null){o.length>0&&(t=yield o,o=new me);break}}}if(t!=null)throw Object.assign(new Error(`stream ended before ${t} bytes became available`),{code:"ERR_UNDER_READ",buffer:o})}();return e.next(),e}function Br(r){let e=Mt(),t=Dc(r.source),o=Zt(),n,i=r.sink(async function*(){yield*e,yield*await o.promise}());return i.catch(a=>{n=a}),{reader:t,writer:e,stream:{sink:async a=>n!=null?await Promise.reject(n):(o.resolve(a),await i),source:t},rest:()=>e.end(),write:e.push,read:async()=>{let a=await t.next();if(a.value!=null)return a.value}}}function kr(r){return r instanceof Uint8Array?{get(e){return r[e]},set(e,t){r[e]=t}}:{get(e){return r.get(e)},set(e,t){r.set(e,t)}}}var _c=4294967296,ve=class{constructor(e=0,t=0){this.hi=e,this.lo=t}toBigInt(e){if(e===!0)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){let t=~this.lo+1>>>0,o=~this.hi>>>0;return t===0&&(o=o+1>>>0),-(BigInt(t)+(BigInt(o)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toNumber(e){return Number(this.toBigInt(e))}zzDecode(){let e=-(this.lo&1),t=((this.lo>>>1|this.hi<<31)^e)>>>0,o=(this.hi>>>1^e)>>>0;return new ve(o,t)}zzEncode(){let e=this.hi>>31,t=((this.hi<<1|this.lo>>>31)^e)>>>0,o=(this.lo<<1^e)>>>0;return new ve(t,o)}toBytes(e,t=0){let o=kr(e);for(;this.hi>0;)o.set(t++,this.lo&127|128),this.lo=(this.lo>>>7|this.hi<<25)>>>0,this.hi>>>=7;for(;this.lo>127;)o.set(t++,this.lo&127|128),this.lo=this.lo>>>7;o.set(t++,this.lo)}static fromBigInt(e){if(e===0n)return new ve;let t=e<0;t&&(e=-e);let o=Number(e>>32n)|0,n=Number(e-(BigInt(o)<<32n))|0;return t&&(o=~o>>>0,n=~n>>>0,++n>_c&&(n=0,++o>_c&&(o=0))),new ve(o,n)}static fromNumber(e){if(e===0)return new ve;let t=e<0;t&&(e=-e);let o=e>>>0,n=(e-o)/4294967296>>>0;return t&&(n=~n>>>0,o=~o>>>0,++o>4294967295&&(o=0,++n>4294967295&&(n=0))),new ve(n,o)}static fromBytes(e,t=0){let o=kr(e),n=new ve,i=0;if(e.length-t>4){for(;i<4;++i)if(n.lo=(n.lo|(o.get(t)&127)<<i*7)>>>0,o.get(t++)<128)return n;if(n.lo=(n.lo|(o.get(t)&127)<<28)>>>0,n.hi=(n.hi|(o.get(t)&127)>>4)>>>0,o.get(t++)<128)return n;i=0}else for(;i<4;++i){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(n.lo=(n.lo|(o.get(t)&127)<<i*7)>>>0,o.get(t++)<128)return n}if(e.length-t>4){for(;i<5;++i)if(n.hi=(n.hi|(o.get(t)&127)<<i*7+3)>>>0,o.get(t++)<128)return n}else if(t<e.byteLength)for(;i<5;++i){if(t>=e.length)throw RangeError(`index out of range: ${t} > ${e.length}`);if(n.hi=(n.hi|(o.get(t)&127)<<i*7+3)>>>0,o.get(t++)<128)return n}throw RangeError("invalid varint encoding")}};var Nh=Math.pow(2,7),Ph=Math.pow(2,14),Oh=Math.pow(2,21),Mh=Math.pow(2,28),Ih=Math.pow(2,35),Dh=Math.pow(2,42),_h=Math.pow(2,49),Ch=Math.pow(2,56),jh=Math.pow(2,63),yt={encodingLength(r){return r<Nh?1:r<Ph?2:r<Oh?3:r<Mh?4:r<Ih?5:r<Dh?6:r<_h?7:r<Ch?8:r<jh?9:10},encode(r,e,t=0){if(Number.MAX_SAFE_INTEGER!=null&&r>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return e==null&&(e=ze(yt.encodingLength(r))),ve.fromNumber(r).toBytes(e,t),e},decode(r,e=0){return ve.fromBytes(r,e).toNumber(!0)}};function Cc(r){return globalThis?.Buffer?.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}var Lr=r=>{let e=yt.encodingLength(r),t=Cc(e);return yt.encode(r,t),Lr.bytes=e,t};Lr.bytes=0;function Ur(r){r=r??{};let e=r.lengthEncoder??Lr;return async function*(o){for await(let n of o){let i=e(n.byteLength);i instanceof Uint8Array?yield i:yield*i,n instanceof Uint8Array?yield n:yield*n}}}Ur.single=(r,e)=>{e=e??{};let t=e.lengthEncoder??Lr;return new me(t(r.byteLength),r)};var ir=oe(ro(),1),qh=8,Bh=1024*1024*4,mt;(function(r){r[r.LENGTH=0]="LENGTH",r[r.DATA=1]="DATA"})(mt||(mt={}));var Ao=r=>{let e=yt.decode(r);return Ao.bytes=yt.encodingLength(e),e};Ao.bytes=0;function sr(r){return async function*(t){let o=new me,n=mt.LENGTH,i=-1,s=r?.lengthDecoder??Ao,a=r?.maxLengthLength??qh,c=r?.maxDataLength??Bh;for await(let u of t)for(o.append(u);o.byteLength>0;){if(n===mt.LENGTH)try{if(i=s(o),i<0)throw(0,ir.default)(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");if(i>c)throw(0,ir.default)(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");let d=s.bytes;o.consume(d),r?.onLength!=null&&r.onLength(i),n=mt.DATA}catch(d){if(d instanceof RangeError){if(o.byteLength>a)throw(0,ir.default)(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");break}throw d}if(n===mt.DATA){if(o.byteLength<i)break;let d=o.sublist(0,i);o.consume(i),r?.onData!=null&&r.onData(d),yield d,n=mt.LENGTH}}if(o.byteLength>0)throw(0,ir.default)(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF")}}sr.fromReader=(r,e)=>{let t=1,o=async function*(){for(;;)try{let{done:i,value:s}=await r.next(t);if(i===!0)return;s!=null&&(yield s)}catch(i){if(i.code==="ERR_UNDER_READ")return{done:!0,value:null};throw i}finally{t=1}}();return sr({...e??{},onLength:i=>{t=i}})(o)};function jc(r,e={}){let t=Br(r),o=sr.fromReader(t.reader,e),n={read:async i=>{let{value:s}=await t.reader.next(i);if(s==null)throw new Error("Value is null");return s},readLP:async()=>{let{value:i}=await o.next();if(i==null)throw new Error("Value is null");return i},readPB:async i=>{let s=await n.readLP();if(s==null)throw new Error("Value is null");let a=s instanceof Uint8Array?s:s.subarray();return i.decode(a)},write:i=>{i instanceof Uint8Array?t.writer.push(i):t.writer.push(i.subarray())},writeLP:i=>{n.write(Ur.single(i,e))},writePB:(i,s)=>{n.writeLP(s.encode(i))},pb:i=>({read:async()=>await n.readPB(i),write:s=>n.writePB(s,i)}),unwrap:()=>(t.rest(),t.stream)};return n}var Lh="/libp2p/circuit/relay/0.2.0/hop",qc=async(r,e,t)=>{let o=await r.client.openStream(e,Lh),n=jc(o);return n.writePB({type:jt.Type.RESERVE,...t??{}},jt),await n.readPB(jt)},Rr={protocol:"/echo/1.0.0",handler:async r=>{await Qt(r,async function*(e){for await(let t of e)yield t.subarray()},r)}};function So(r){let e=["go","js"];e.forEach(t=>{e.forEach(o=>{e.forEach(n=>{Uh(r,t,o,n)})})})}function Uh(r,e,t,o){describe(`${e} to ${t} over relay ${o}`,()=>{let n=[{type:e,noise:!0,noListen:!0},{type:t,noise:!0,noListen:!0},{type:o,noise:!0,relay:!0}],i,s,a,c,u,d;beforeEach(async function(){this.timeout(20*1e3),[i,s,a]=await Promise.all(n.map(async w=>await r.spawn(w))),[c,u]=await Promise.all([s,a].map(async w=>await w.client.identify())),d=Ba(`${u.addrs[0].toString()}/p2p/${u.peerId.toString()}/p2p-circuit/p2p/${c.peerId.toString()}`),await s.client.connect(u.peerId,u.addrs)}),afterEach(async function(){await Promise.all([i,s,a].map(async w=>{await w.stop()}))}),it("connects",async()=>{let w=await qc(s,u.peerId);W(w.status).to.eq(qe.OK),await i.client.connect(c.peerId,[d]),await new Promise(B=>setTimeout(B,500));let q=await i.client.listPeers();W(q.filter(B=>B.equals(c.peerId))).to.have.length(1),await s.client.registerStreamHandler(Rr.protocol,Rr.handler);let k=await i.client.openStream(c.peerId,Rr.protocol),N=ae("test"),E=Br(k);E.write(N);let I=await E.read();W(I?.subarray()).to.deep.equal(N)}),it("fails to connect without a reservation",async()=>{await W(i.client.connect(c.peerId,[d])).to.eventually.be.rejected.with.property("message").that.matches(/NO_RESERVATION/)})})}async function Rh(r){ln(r),So(r),await Bn(r),await Rn(r),await $n(r)}return Zc(zh);})();
8
8
  /*! Bundled license information:
9
9
 
10
10
  assertion-error/index.js: