@libp2p/interop 4.0.2 → 6.0.0
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 +5 -5
- package/dist/src/connect.d.ts.map +1 -1
- package/dist/src/connect.js +3 -3
- package/dist/src/connect.js.map +1 -1
- package/dist/src/dht/content-fetching.d.ts.map +1 -1
- package/dist/src/dht/content-fetching.js +1 -1
- package/dist/src/dht/content-fetching.js.map +1 -1
- package/dist/src/dht/content-routing.d.ts.map +1 -1
- package/dist/src/dht/content-routing.js +1 -1
- package/dist/src/dht/content-routing.js.map +1 -1
- package/dist/src/dht/index.d.ts.map +1 -1
- package/dist/src/dht/index.js +3 -3
- package/dist/src/dht/index.js.map +1 -1
- package/dist/src/dht/peer-routing.d.ts.map +1 -1
- package/dist/src/dht/peer-routing.js +1 -1
- package/dist/src/dht/peer-routing.js.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/pubsub/floodsub.d.ts.map +1 -1
- package/dist/src/pubsub/floodsub.js +7 -5
- package/dist/src/pubsub/floodsub.js.map +1 -1
- package/dist/src/pubsub/gossipsub.d.ts.map +1 -1
- package/dist/src/pubsub/gossipsub.js +1 -1
- package/dist/src/pubsub/gossipsub.js.map +1 -1
- package/dist/src/pubsub/hybrid.d.ts.map +1 -1
- package/dist/src/pubsub/hybrid.js +1 -1
- package/dist/src/pubsub/hybrid.js.map +1 -1
- package/dist/src/pubsub/index.d.ts.map +1 -1
- package/dist/src/pubsub/index.js +3 -3
- package/dist/src/pubsub/index.js.map +1 -1
- package/dist/src/relay/index.d.ts +3 -0
- package/dist/src/relay/index.d.ts.map +1 -0
- package/dist/src/relay/index.js +62 -0
- package/dist/src/relay/index.js.map +1 -0
- package/dist/src/relay/pb/index.d.ts +93 -0
- package/dist/src/relay/pb/index.d.ts.map +1 -0
- package/dist/src/relay/pb/index.js +435 -0
- package/dist/src/relay/pb/index.js.map +1 -0
- package/dist/src/relay/util.d.ts +11 -0
- package/dist/src/relay/util.d.ts.map +1 -0
- package/dist/src/relay/util.js +24 -0
- package/dist/src/relay/util.js.map +1 -0
- package/dist/src/streams/echo.d.ts.map +1 -1
- package/dist/src/streams/echo.js +1 -1
- package/dist/src/streams/echo.js.map +1 -1
- package/dist/src/streams/index.d.ts.map +1 -1
- package/dist/src/streams/index.js +2 -2
- package/dist/src/streams/index.js.map +1 -1
- package/package.json +14 -7
- package/src/connect.ts +5 -5
- package/src/dht/content-fetching.ts +3 -3
- package/src/dht/content-routing.ts +3 -3
- package/src/dht/index.ts +4 -4
- package/src/dht/peer-routing.ts +3 -3
- package/src/index.ts +10 -3
- package/src/pubsub/floodsub.ts +11 -9
- package/src/pubsub/gossipsub.ts +5 -5
- package/src/pubsub/hybrid.ts +5 -5
- package/src/pubsub/index.ts +4 -4
- package/src/relay/index.ts +76 -0
- package/src/relay/pb/index.proto +67 -0
- package/src/relay/pb/index.ts +549 -0
- package/src/relay/util.ts +35 -0
- package/src/streams/echo.ts +3 -3
- package/src/streams/index.ts +3 -3
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
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
|
4
|
-
`)}function On(f,l){var b=f.getAttributeNames(),E=f.tagName.toLowerCase(),O=l.stylize("<".concat(E),"special"),_=l.stylize(">","special"),L=l.stylize("</".concat(E,">"),"special");l.truncate-=E.length*2+5;var J="";b.length>0&&(J+=" ",J+=M(b.map(function(fe){return[fe,f.getAttribute(fe)]}),l,bi," ")),l.truncate-=J.length;var ie=l.truncate,ne=Tt(f.children,l);return ne&&ne.length>ie&&(ne="".concat(g,"(").concat(f.children.length,")")),"".concat(O).concat(J).concat(_).concat(ne).concat(L)}var gi=typeof Symbol=="function"&&typeof Symbol.for=="function",lt=gi?Symbol.for("chai/inspect"):"@@chai/inspect",Be=!1;try{var qn=Se("util");Be=qn.inspect?qn.inspect.custom:!1}catch{Be=!1}function Nn(){this.key="chai/loupe__"+Math.random()+Date.now()}Nn.prototype={get:function(l){return l[this.key]},has:function(l){return this.key in l},set:function(l,b){Object.isExtensible(l)&&Object.defineProperty(l,this.key,{value:b,configurable:!0})}};var ht=new(typeof WeakMap=="function"?WeakMap:Nn),dt={},Cn={undefined:function(l,b){return b.stylize("undefined","undefined")},null:function(l,b){return b.stylize(null,"null")},boolean:function(l,b){return b.stylize(l,"boolean")},Boolean:function(l,b){return b.stylize(l,"boolean")},number:me,Number:me,bigint:ce,BigInt:ce,string:P,String:P,function:H,Function:H,symbol:v,Symbol:v,Array:k,Date:z,Map:_e,Set:Et,RegExp:je,Promise:B,WeakSet:function(l,b){return b.stylize("WeakSet{\u2026}","special")},WeakMap:function(l,b){return b.stylize("WeakMap{\u2026}","special")},Arguments:oe,Int8Array:q,Uint8Array:q,Uint8ClampedArray:q,Int16Array:q,Uint16Array:q,Int32Array:q,Uint32Array:q,Float32Array:q,Float64Array:q,Generator:function(){return""},DataView:function(){return""},ArrayBuffer:function(){return""},Error:we,HTMLCollection:Tt,NodeList:Tt},wi=function(l,b,E){return lt in l&&typeof l[lt]=="function"?l[lt](b):Be&&Be in l&&typeof l[Be]=="function"?l[Be](b.depth,b):"inspect"in l&&typeof l.inspect=="function"?l.inspect(b.depth,b):"constructor"in l&&ht.has(l.constructor)?ht.get(l.constructor)(l,b):dt[E]?dt[E](l,b):""},vi=Object.prototype.toString;function pt(f,l){l=V(l),l.inspect=pt;var b=l,E=b.customInspect,O=f===null?"null":n(f);if(O==="object"&&(O=vi.call(f).slice(8,-1)),Cn[O])return Cn[O](f,l);if(E&&f){var _=wi(f,l,O);if(_)return typeof _=="string"?_:pt(_,l)}var L=f?Object.getPrototypeOf(f):!1;return L===Object.prototype||L===null?C(f,l):f&&typeof HTMLElement=="function"&&f instanceof HTMLElement?On(f,l):"constructor"in f?f.constructor!==Object?ee(f,l):C(f,l):f===Object(f)?C(f,l):l.stylize(String(f),O)}function xi(f,l){return ht.has(f)?!1:(ht.set(f,l),!0)}function Si(f,l){return f in dt?!1:(dt[f]=l,!0)}var Ai=lt;r.custom=Ai,r.default=pt,r.inspect=pt,r.registerConstructor=xi,r.registerStringTag=Si,Object.defineProperty(r,"__esModule",{value:!0})})});var Ne=I((Au,Hn)=>{Hn.exports={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"]}});var bt=I((Eu,tr)=>{var Pu=Dt(),Ri=Yn(),er=Ne();tr.exports=$i;function $i(r,n,e,a){var t={colors:a,depth:typeof e>"u"?2:e,showHidden:n,truncate:er.truncateThreshold?er.truncateThreshold:1/0};return Ri.inspect(r,t)}});var kt=I((Tu,rr)=>{var Li=bt(),nr=Ne();rr.exports=function(n){var e=Li(n),a=Object.prototype.toString.call(n);if(nr.truncateThreshold&&e.length>=nr.truncateThreshold){if(a==="[object Function]")return!n.name||n.name===""?"[Function]":"[Function: "+n.name+"]";if(a==="[object Array]")return"[ Array("+n.length+") ]";if(a==="[object Object]"){var t=Object.keys(n),i=t.length>2?t.splice(0,2).join(", ")+", ...":t.join(", ");return"{ Object ("+i+") }"}else return e}else return e}});var ir=I((Mu,or)=>{var zt=le(),Wi=It(),_t=kt();or.exports=function(n,e){var a=zt(n,"negate"),t=zt(n,"object"),i=e[3],o=Wi(n,e),s=a?e[2]:e[1],u=zt(n,"message");return typeof s=="function"&&(s=s()),s=s||"",s=s.replace(/#\{this\}/g,function(){return _t(t)}).replace(/#\{act\}/g,function(){return _t(o)}).replace(/#\{exp\}/g,function(){return _t(i)}),u?u+": "+s:s}});var Ae=I((ju,sr)=>{sr.exports=function(n,e,a){var t=n.__flags||(n.__flags=Object.create(null));e.__flags||(e.__flags=Object.create(null)),a=arguments.length===3?a:!0;for(var i in t)(a||i!=="object"&&i!=="ssfi"&&i!=="lockSsfi"&&i!="message")&&(e.__flags[i]=t[i])}});var gr=I((Ou,Ut)=>{"use strict";var ar=Ye();function yr(){this._key="chai/deep-eql__"+Math.random()+Date.now()}yr.prototype={get:function(n){return n[this._key]},set:function(n,e){Object.isExtensible(n)&&Object.defineProperty(n,this._key,{value:e,configurable:!0})}};var Ft=typeof WeakMap=="function"?WeakMap:yr;function ur(r,n,e){if(!e||Ue(r)||Ue(n))return null;var a=e.get(r);if(a){var t=a.get(n);if(typeof t=="boolean")return t}return null}function gt(r,n,e,a){if(!(!e||Ue(r)||Ue(n))){var t=e.get(r);t?t.set(n,a):(t=new Ft,t.set(n,a),e.set(r,t))}}Ut.exports=wt;Ut.exports.MemoizeMap=Ft;function wt(r,n,e){if(e&&e.comparator)return cr(r,n,e);var a=mr(r,n);return a!==null?a:cr(r,n,e)}function mr(r,n){return r===n?r!==0||1/r===1/n:r!==r&&n!==n?!0:Ue(r)||Ue(n)?!1:null}function cr(r,n,e){e=e||{},e.memoize=e.memoize===!1?!1:e.memoize||new Ft;var a=e&&e.comparator,t=ur(r,n,e.memoize);if(t!==null)return t;var i=ur(n,r,e.memoize);if(i!==null)return i;if(a){var o=a(r,n);if(o===!1||o===!0)return gt(r,n,e.memoize,o),o;var s=mr(r,n);if(s!==null)return s}var u=ar(r);if(u!==ar(n))return gt(r,n,e.memoize,!1),!1;gt(r,n,e.memoize,!0);var d=Ki(r,n,u,e);return gt(r,n,e.memoize,d),d}function Ki(r,n,e,a){switch(e){case"String":case"Number":case"Boolean":case"Date":return wt(r.valueOf(),n.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return r===n;case"Error":return br(r,n,["name","message","code"],a);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return Ce(r,n,a);case"RegExp":return Gi(r,n);case"Generator":return Ji(r,n,a);case"DataView":return Ce(new Uint8Array(r.buffer),new Uint8Array(n.buffer),a);case"ArrayBuffer":return Ce(new Uint8Array(r),new Uint8Array(n),a);case"Set":return fr(r,n,a);case"Map":return fr(r,n,a);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return r.equals(n);case"Temporal.Duration":return r.total("nanoseconds")===n.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return r.toString()===n.toString();default:return Zi(r,n,a)}}function Gi(r,n){return r.toString()===n.toString()}function fr(r,n,e){if(r.size!==n.size)return!1;if(r.size===0)return!0;var a=[],t=[];return r.forEach(function(o,s){a.push([o,s])}),n.forEach(function(o,s){t.push([o,s])}),Ce(a.sort(),t.sort(),e)}function Ce(r,n,e){var a=r.length;if(a!==n.length)return!1;if(a===0)return!0;for(var t=-1;++t<a;)if(wt(r[t],n[t],e)===!1)return!1;return!0}function Ji(r,n,e){return Ce(Bt(r),Bt(n),e)}function Qi(r){return typeof Symbol<"u"&&typeof r=="object"&&typeof Symbol.iterator<"u"&&typeof r[Symbol.iterator]=="function"}function lr(r){if(Qi(r))try{return Bt(r[Symbol.iterator]())}catch{return[]}return[]}function Bt(r){for(var n=r.next(),e=[n.value];n.done===!1;)n=r.next(),e.push(n.value);return e}function hr(r){var n=[];for(var e in r)n.push(e);return n}function dr(r){for(var n=[],e=Object.getOwnPropertySymbols(r),a=0;a<e.length;a+=1){var t=e[a];Object.getOwnPropertyDescriptor(r,t).enumerable&&n.push(t)}return n}function br(r,n,e,a){var t=e.length;if(t===0)return!0;for(var i=0;i<t;i+=1)if(wt(r[e[i]],n[e[i]],a)===!1)return!1;return!0}function Zi(r,n,e){var a=hr(r),t=hr(n),i=dr(r),o=dr(n);if(a=a.concat(i),t=t.concat(o),a.length&&a.length===t.length)return Ce(pr(a).sort(),pr(t).sort())===!1?!1:br(r,n,a,e);var s=lr(r),u=lr(n);return s.length&&s.length===u.length?(s.sort(),u.sort(),Ce(s,u,e)):a.length===0&&s.length===0&&t.length===0&&u.length===0}function Ue(r){return r===null||typeof r!="object"}function pr(r){return r.map(function(e){return typeof e=="symbol"?e.toString():e})}});var He=I((qu,wr)=>{var Xi=Ne();wr.exports=function(){return Xi.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}});var Sr=I((Nu,xr)=>{var Yi=Pe(),vr=le(),Hi=He(),es=Ae();xr.exports=function(n,e,a){a=a===void 0?function(){}:a,Object.defineProperty(n,e,{get:function t(){!Hi()&&!vr(this,"lockSsfi")&&vr(this,"ssfi",t);var i=a.call(this);if(i!==void 0)return i;var o=new Yi.Assertion;return es(this,o),o},configurable:!0})}});var et=I((Cu,Ar)=>{var ts=Object.getOwnPropertyDescriptor(function(){},"length");Ar.exports=function(n,e,a){return ts.configurable&&Object.defineProperty(n,"length",{get:function(){throw Error(a?"Invalid Chai property: "+e+'.length. Due to a compatibility issue, "length" cannot directly follow "'+e+'". Use "'+e+'.lengthOf" instead.':"Invalid Chai property: "+e+'.length. See docs for proper usage of "'+e+'".')}}),n}});var Er=I((Iu,Pr)=>{Pr.exports=function(n){var e=Object.getOwnPropertyNames(n);function a(i){e.indexOf(i)===-1&&e.push(i)}for(var t=Object.getPrototypeOf(n);t!==null;)Object.getOwnPropertyNames(t).forEach(a),t=Object.getPrototypeOf(t);return e}});var tt=I((Du,jr)=>{var ns=Ne(),Tr=le(),rs=Er(),os=He();var Mr=["__flags","__methods","_obj","assert"];jr.exports=function(n,e){return os()?new Proxy(n,{get:function a(t,i){if(typeof i=="string"&&ns.proxyExcludedKeys.indexOf(i)===-1&&!Reflect.has(t,i)){if(e)throw Error("Invalid Chai property: "+e+"."+i+'. See docs for proper usage of "'+e+'".');var o=null,s=4;throw rs(t).forEach(function(u){if(!Object.prototype.hasOwnProperty(u)&&Mr.indexOf(u)===-1){var d=is(i,u,s);d<s&&(o=u,s=d)}}),Error(o!==null?"Invalid Chai property: "+i+'. Did you mean "'+o+'"?':"Invalid Chai property: "+i)}return Mr.indexOf(i)===-1&&!Tr(t,"lockSsfi")&&Tr(t,"ssfi",a),Reflect.get(t,i)}}):n};function is(r,n,e){if(Math.abs(r.length-n.length)>=e)return e;for(var a=[],t=0;t<=r.length;t++)a[t]=Array(n.length+1).fill(0),a[t][0]=t;for(var i=0;i<n.length;i++)a[0][i]=i;for(var t=1;t<=r.length;t++)for(var o=r.charCodeAt(t-1),i=1;i<=n.length;i++){if(Math.abs(t-i)>=e){a[t][i]=e;continue}a[t][i]=Math.min(a[t-1][i]+1,a[t][i-1]+1,a[t-1][i-1]+(o===n.charCodeAt(i-1)?0:1))}return a[r.length][n.length]}});var Nr=I((ku,qr)=>{var ss=et(),as=Pe(),Or=le(),us=tt(),cs=Ae();qr.exports=function(n,e,a){var t=function(){Or(this,"lockSsfi")||Or(this,"ssfi",t);var i=a.apply(this,arguments);if(i!==void 0)return i;var o=new as.Assertion;return cs(this,o),o};ss(t,e,!1),n[e]=us(t,e)}});var Ir=I((zu,Cr)=>{var fs=Pe(),nt=le(),ls=He(),hs=Ae();Cr.exports=function(n,e,a){var t=Object.getOwnPropertyDescriptor(n,e),i=function(){};t&&typeof t.get=="function"&&(i=t.get),Object.defineProperty(n,e,{get:function o(){!ls()&&!nt(this,"lockSsfi")&&nt(this,"ssfi",o);var s=nt(this,"lockSsfi");nt(this,"lockSsfi",!0);var u=a(i).call(this);if(nt(this,"lockSsfi",s),u!==void 0)return u;var d=new fs.Assertion;return hs(this,d),d},configurable:!0})}});var kr=I((_u,Dr)=>{var ds=et(),ps=Pe(),rt=le(),ys=tt(),ms=Ae();Dr.exports=function(n,e,a){var t=n[e],i=function(){throw new Error(e+" is not a function")};t&&typeof t=="function"&&(i=t);var o=function(){rt(this,"lockSsfi")||rt(this,"ssfi",o);var s=rt(this,"lockSsfi");rt(this,"lockSsfi",!0);var u=a(i).apply(this,arguments);if(rt(this,"lockSsfi",s),u!==void 0)return u;var d=new ps.Assertion;return ms(this,d),d};ds(o,e,!1),n[e]=ys(o,e)}});var Ur=I((Bu,Fr)=>{var bs=et(),gs=Pe(),zr=le(),ws=tt(),_r=Ae();var vs=typeof Object.setPrototypeOf=="function",Br=function(){},xs=Object.getOwnPropertyNames(Br).filter(function(r){var n=Object.getOwnPropertyDescriptor(Br,r);return typeof n!="object"?!0:!n.configurable}),Ss=Function.prototype.call,As=Function.prototype.apply;Fr.exports=function(n,e,a,t){typeof t!="function"&&(t=function(){});var i={method:a,chainingBehavior:t};n.__methods||(n.__methods={}),n.__methods[e]=i,Object.defineProperty(n,e,{get:function(){i.chainingBehavior.call(this);var s=function(){zr(this,"lockSsfi")||zr(this,"ssfi",s);var g=i.method.apply(this,arguments);if(g!==void 0)return g;var D=new gs.Assertion;return _r(this,D),D};if(bs(s,e,!0),vs){var u=Object.create(this);u.call=Ss,u.apply=As,Object.setPrototypeOf(s,u)}else{var d=Object.getOwnPropertyNames(n);d.forEach(function(g){if(xs.indexOf(g)===-1){var D=Object.getOwnPropertyDescriptor(n,g);Object.defineProperty(s,g,D)}})}return _r(this,s),ws(s)},configurable:!0})}});var Lr=I((Fu,$r)=>{var Vr=Pe(),Rr=Ae();$r.exports=function(n,e,a,t){var i=n.__methods[e],o=i.chainingBehavior;i.chainingBehavior=function(){var d=t(o).call(this);if(d!==void 0)return d;var g=new Vr.Assertion;return Rr(this,g),g};var s=i.method;i.method=function(){var d=a(s).apply(this,arguments);if(d!==void 0)return d;var g=new Vr.Assertion;return Rr(this,g),g}}});var Gr=I((Uu,Kr)=>{var Wr=bt();Kr.exports=function(n,e){return Wr(n)<Wr(e)?-1:1}});var Vt=I((Vu,Jr)=>{Jr.exports=function(n){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})}});var Zr=I((Ru,Qr)=>{var Ps=Vt();Qr.exports=function(n){return Object.keys(n).concat(Ps(n))}});var $t=I(($u,Xr)=>{"use strict";function Es(r,n){return n instanceof Error&&r===n}function Ts(r,n){return n instanceof Error?r.constructor===n.constructor||r instanceof n.constructor:n.prototype instanceof Error||n===Error?r.constructor===n||r instanceof n:!1}function Ms(r,n){var e=typeof r=="string"?r:r.message;return n instanceof RegExp?n.test(e):typeof n=="string"?e.indexOf(n)!==-1:!1}var js=/\s*function(?:\s|\s*\/\*[^(?:*\/)]+\*\/\s*)*([^\(\/]+)/;function Rt(r){var n="";if(typeof r.name>"u"){var e=String(r).match(js);e&&(n=e[1])}else n=r.name;return n}function Os(r){var n=r;return r instanceof Error?n=Rt(r.constructor):typeof r=="function"&&(n=Rt(r).trim()||Rt(new r)),n}function qs(r){var n="";return r&&r.message?n=r.message:typeof r=="string"&&(n=r),n}Xr.exports={compatibleInstance:Es,compatibleConstructor:Ts,compatibleMessage:Ms,getMessage:qs,getConstructorName:Os}});var Hr=I((Lu,Yr)=>{function Ns(r){return r!==r}Yr.exports=Number.isNaN||Ns});var no=I((Wu,to)=>{var Cs=Ye(),eo=le();function Is(r){var n=Cs(r),e=["Array","Object","function"];return e.indexOf(n)!==-1}to.exports=function(n,e){var a=eo(n,"operator"),t=eo(n,"negate"),i=e[3],o=t?e[2]:e[1];if(a)return a;if(typeof o=="function"&&(o=o()),o=o||"",!!o&&!/\shave\s/.test(o)){var s=Is(i);return/\snot\s/.test(o)?s?"notDeepStrictEqual":"notStrictEqual":s?"deepStrictEqual":"strictEqual"}}});var oo=I(W=>{var ro=$n();W.test=Kn();W.type=Ye();W.expectTypes=Jn();W.getMessage=ir();W.getActual=It();W.inspect=bt();W.objDisplay=kt();W.flag=le();W.transferFlags=Ae();W.eql=gr();W.getPathInfo=ro.getPathInfo;W.hasProperty=ro.hasProperty;W.getName=Dt();W.addProperty=Sr();W.addMethod=Nr();W.overwriteProperty=Ir();W.overwriteMethod=kr();W.addChainableMethod=Ur();W.overwriteChainableMethod=Lr();W.compareByInspect=Gr();W.getOwnEnumerablePropertySymbols=Vt();W.getOwnEnumerableProperties=Zr();W.checkError=$t();W.proxify=tt();W.addLengthGuard=et();W.isProxyEnabled=He();W.isNaN=Hr();W.getOperator=no()});var so=I((Gu,io)=>{var Ve=Ne();io.exports=function(r,n){var e=r.AssertionError,a=n.flag;r.Assertion=t;function t(i,o,s,u){return a(this,"ssfi",s||t),a(this,"lockSsfi",u),a(this,"object",i),a(this,"message",o),n.proxify(this)}Object.defineProperty(t,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Ve.includeStack},set:function(i){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),Ve.includeStack=i}}),Object.defineProperty(t,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Ve.showDiff},set:function(i){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),Ve.showDiff=i}}),t.addProperty=function(i,o){n.addProperty(this.prototype,i,o)},t.addMethod=function(i,o){n.addMethod(this.prototype,i,o)},t.addChainableMethod=function(i,o,s){n.addChainableMethod(this.prototype,i,o,s)},t.overwriteProperty=function(i,o){n.overwriteProperty(this.prototype,i,o)},t.overwriteMethod=function(i,o){n.overwriteMethod(this.prototype,i,o)},t.overwriteChainableMethod=function(i,o,s){n.overwriteChainableMethod(this.prototype,i,o,s)},t.prototype.assert=function(i,o,s,u,d,g){var D=n.test(this,arguments);if(g!==!1&&(g=!0),u===void 0&&d===void 0&&(g=!1),Ve.showDiff!==!0&&(g=!1),!D){o=n.getMessage(this,arguments);var V=n.getActual(this,arguments),R={actual:V,expected:u,showDiff:g},M=n.getOperator(this,arguments);throw M&&(R.operator=M),new e(o,R,Ve.includeStack?this.assert:a(this,"ssfi"))}};Object.defineProperty(t.prototype,"_obj",{get:function(){return a(this,"object")},set:function(i){a(this,"object",i)}})}});var uo=I((Ju,ao)=>{ao.exports=function(r,n){var e=r.Assertion,a=r.AssertionError,t=n.flag;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(c){e.addProperty(c)}),e.addProperty("not",function(){t(this,"negate",!0)}),e.addProperty("deep",function(){t(this,"deep",!0)}),e.addProperty("nested",function(){t(this,"nested",!0)}),e.addProperty("own",function(){t(this,"own",!0)}),e.addProperty("ordered",function(){t(this,"ordered",!0)}),e.addProperty("any",function(){t(this,"any",!0),t(this,"all",!1)}),e.addProperty("all",function(){t(this,"all",!0),t(this,"any",!1)});function i(c,h){h&&t(this,"message",h),c=c.toLowerCase();var m=t(this,"object"),w=~["a","e","i","o","u"].indexOf(c.charAt(0))?"an ":"a ";this.assert(c===n.type(m).toLowerCase(),"expected #{this} to be "+w+c,"expected #{this} not to be "+w+c)}e.addChainableMethod("an",i),e.addChainableMethod("a",i);function o(c,h){return n.isNaN(c)&&n.isNaN(h)||c===h}function s(){t(this,"contains",!0)}function u(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=n.type(m).toLowerCase(),S=t(this,"message"),P=t(this,"negate"),v=t(this,"ssfi"),y=t(this,"deep"),T=y?"deep ":"";S=S?S+": ":"";var N=!1;switch(w){case"string":N=m.indexOf(c)!==-1;break;case"weakset":if(y)throw new a(S+"unable to use .deep.include with WeakSet",void 0,v);N=m.has(c);break;case"map":var F=y?n.eql:o;m.forEach(function($){N=N||F($,c)});break;case"set":y?m.forEach(function($){N=N||n.eql($,c)}):N=m.has(c);break;case"array":y?N=m.some(function($){return n.eql($,c)}):N=m.indexOf(c)!==-1;break;default:if(c!==Object(c))throw new a(S+"the given combination of arguments ("+w+" and "+n.type(c).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 "+n.type(c).toLowerCase(),void 0,v);var K=Object.keys(c),B=null,C=0;if(K.forEach(function($){var ee=new e(m);if(n.transferFlags(this,ee,!0),t(ee,"lockSsfi",!0),!P||K.length===1){ee.property($,c[$]);return}try{ee.property($,c[$])}catch(oe){if(!n.checkError.compatibleConstructor(oe,a))throw oe;B===null&&(B=oe),C++}},this),P&&K.length>1&&C===K.length)throw B;return}this.assert(N,"expected #{this} to "+T+"include "+n.inspect(c),"expected #{this} to not "+T+"include "+n.inspect(c))}e.addChainableMethod("include",u,s),e.addChainableMethod("contain",u,s),e.addChainableMethod("contains",u,s),e.addChainableMethod("includes",u,s),e.addProperty("ok",function(){this.assert(t(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),e.addProperty("true",function(){this.assert(t(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!t(this,"negate"))}),e.addProperty("false",function(){this.assert(t(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!t(this,"negate"))}),e.addProperty("null",function(){this.assert(t(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")}),e.addProperty("undefined",function(){this.assert(t(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")}),e.addProperty("NaN",function(){this.assert(n.isNaN(t(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function d(){var c=t(this,"object");this.assert(c!=null,"expected #{this} to exist","expected #{this} to not exist")}e.addProperty("exist",d),e.addProperty("exists",d),e.addProperty("empty",function(){var c=t(this,"object"),h=t(this,"ssfi"),m=t(this,"message"),w;switch(m=m?m+": ":"",n.type(c).toLowerCase()){case"array":case"string":w=c.length;break;case"map":case"set":w=c.size;break;case"weakmap":case"weakset":throw new a(m+".empty was passed a weak collection",void 0,h);case"function":var S=m+".empty was passed a function "+n.getName(c);throw new a(S.trim(),void 0,h);default:if(c!==Object(c))throw new a(m+".empty was passed non-string primitive "+n.inspect(c),void 0,h);w=Object.keys(c).length}this.assert(w===0,"expected #{this} to be empty","expected #{this} not to be empty")});function g(){var c=t(this,"object"),h=n.type(c);this.assert(h==="Arguments","expected #{this} to be arguments but got "+h,"expected #{this} to not be arguments")}e.addProperty("arguments",g),e.addProperty("Arguments",g);function D(c,h){h&&t(this,"message",h);var m=t(this,"object");if(t(this,"deep")){var w=t(this,"lockSsfi");t(this,"lockSsfi",!0),this.eql(c),t(this,"lockSsfi",w)}else this.assert(c===m,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",c,this._obj,!0)}e.addMethod("equal",D),e.addMethod("equals",D),e.addMethod("eq",D);function V(c,h){h&&t(this,"message",h),this.assert(n.eql(c,t(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",c,this._obj,!0)}e.addMethod("eql",V),e.addMethod("eqls",V);function R(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"doLength"),S=t(this,"message"),P=S?S+": ":"",v=t(this,"ssfi"),y=n.type(m).toLowerCase(),T=n.type(c).toLowerCase(),N,F=!0;if(w&&y!=="map"&&y!=="set"&&new e(m,S,v,!0).to.have.property("length"),!w&&y==="date"&&T!=="date")N=P+"the argument to above must be a date";else if(T!=="number"&&(w||y==="number"))N=P+"the argument to above must be a number";else if(!w&&y!=="date"&&y!=="number"){var K=y==="string"?"'"+m+"'":m;N=P+"expected "+K+" to be a number or a date"}else F=!1;if(F)throw new a(N,void 0,v);if(w){var B="length",C;y==="map"||y==="set"?(B="size",C=m.size):C=m.length,this.assert(C>c,"expected #{this} to have a "+B+" above #{exp} but got #{act}","expected #{this} to not have a "+B+" above #{exp}",c,C)}else this.assert(m>c,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",c)}e.addMethod("above",R),e.addMethod("gt",R),e.addMethod("greaterThan",R);function M(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"doLength"),S=t(this,"message"),P=S?S+": ":"",v=t(this,"ssfi"),y=n.type(m).toLowerCase(),T=n.type(c).toLowerCase(),N,F=!0;if(w&&y!=="map"&&y!=="set"&&new e(m,S,v,!0).to.have.property("length"),!w&&y==="date"&&T!=="date")N=P+"the argument to least must be a date";else if(T!=="number"&&(w||y==="number"))N=P+"the argument to least must be a number";else if(!w&&y!=="date"&&y!=="number"){var K=y==="string"?"'"+m+"'":m;N=P+"expected "+K+" to be a number or a date"}else F=!1;if(F)throw new a(N,void 0,v);if(w){var B="length",C;y==="map"||y==="set"?(B="size",C=m.size):C=m.length,this.assert(C>=c,"expected #{this} to have a "+B+" at least #{exp} but got #{act}","expected #{this} to have a "+B+" below #{exp}",c,C)}else this.assert(m>=c,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",c)}e.addMethod("least",M),e.addMethod("gte",M),e.addMethod("greaterThanOrEqual",M);function x(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"doLength"),S=t(this,"message"),P=S?S+": ":"",v=t(this,"ssfi"),y=n.type(m).toLowerCase(),T=n.type(c).toLowerCase(),N,F=!0;if(w&&y!=="map"&&y!=="set"&&new e(m,S,v,!0).to.have.property("length"),!w&&y==="date"&&T!=="date")N=P+"the argument to below must be a date";else if(T!=="number"&&(w||y==="number"))N=P+"the argument to below must be a number";else if(!w&&y!=="date"&&y!=="number"){var K=y==="string"?"'"+m+"'":m;N=P+"expected "+K+" to be a number or a date"}else F=!1;if(F)throw new a(N,void 0,v);if(w){var B="length",C;y==="map"||y==="set"?(B="size",C=m.size):C=m.length,this.assert(C<c,"expected #{this} to have a "+B+" below #{exp} but got #{act}","expected #{this} to not have a "+B+" below #{exp}",c,C)}else this.assert(m<c,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",c)}e.addMethod("below",x),e.addMethod("lt",x),e.addMethod("lessThan",x);function j(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"doLength"),S=t(this,"message"),P=S?S+": ":"",v=t(this,"ssfi"),y=n.type(m).toLowerCase(),T=n.type(c).toLowerCase(),N,F=!0;if(w&&y!=="map"&&y!=="set"&&new e(m,S,v,!0).to.have.property("length"),!w&&y==="date"&&T!=="date")N=P+"the argument to most must be a date";else if(T!=="number"&&(w||y==="number"))N=P+"the argument to most must be a number";else if(!w&&y!=="date"&&y!=="number"){var K=y==="string"?"'"+m+"'":m;N=P+"expected "+K+" to be a number or a date"}else F=!1;if(F)throw new a(N,void 0,v);if(w){var B="length",C;y==="map"||y==="set"?(B="size",C=m.size):C=m.length,this.assert(C<=c,"expected #{this} to have a "+B+" at most #{exp} but got #{act}","expected #{this} to have a "+B+" above #{exp}",c,C)}else this.assert(m<=c,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",c)}e.addMethod("most",j),e.addMethod("lte",j),e.addMethod("lessThanOrEqual",j),e.addMethod("within",function(c,h,m){m&&t(this,"message",m);var w=t(this,"object"),S=t(this,"doLength"),P=t(this,"message"),v=P?P+": ":"",y=t(this,"ssfi"),T=n.type(w).toLowerCase(),N=n.type(c).toLowerCase(),F=n.type(h).toLowerCase(),K,B=!0,C=N==="date"&&F==="date"?c.toISOString()+".."+h.toISOString():c+".."+h;if(S&&T!=="map"&&T!=="set"&&new e(w,P,y,!0).to.have.property("length"),!S&&T==="date"&&(N!=="date"||F!=="date"))K=v+"the arguments to within must be dates";else if((N!=="number"||F!=="number")&&(S||T==="number"))K=v+"the arguments to within must be numbers";else if(!S&&T!=="date"&&T!=="number"){var $=T==="string"?"'"+w+"'":w;K=v+"expected "+$+" to be a number or a date"}else B=!1;if(B)throw new a(K,void 0,y);if(S){var ee="length",oe;T==="map"||T==="set"?(ee="size",oe=w.size):oe=w.length,this.assert(oe>=c&&oe<=h,"expected #{this} to have a "+ee+" within "+C,"expected #{this} to not have a "+ee+" within "+C)}else this.assert(w>=c&&w<=h,"expected #{this} to be within "+C,"expected #{this} to not be within "+C)});function k(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"ssfi"),S=t(this,"message");try{var P=m instanceof c}catch(y){throw y instanceof TypeError?(S=S?S+": ":"",new a(S+"The instanceof assertion needs a constructor but "+n.type(c)+" was given.",void 0,w)):y}var v=n.getName(c);v===null&&(v="an unnamed constructor"),this.assert(P,"expected #{this} to be an instance of "+v,"expected #{this} to not be an instance of "+v)}e.addMethod("instanceof",k),e.addMethod("instanceOf",k);function U(c,h,m){m&&t(this,"message",m);var w=t(this,"nested"),S=t(this,"own"),P=t(this,"message"),v=t(this,"object"),y=t(this,"ssfi"),T=typeof c;if(P=P?P+": ":"",w){if(T!=="string")throw new a(P+"the argument to property must be a string when using nested syntax",void 0,y)}else if(T!=="string"&&T!=="number"&&T!=="symbol")throw new a(P+"the argument to property must be a string, number, or symbol",void 0,y);if(w&&S)throw new a(P+'The "nested" and "own" flags cannot be combined.',void 0,y);if(v==null)throw new a(P+"Target cannot be null or undefined.",void 0,y);var N=t(this,"deep"),F=t(this,"negate"),K=w?n.getPathInfo(v,c):null,B=w?K.value:v[c],C="";N&&(C+="deep "),S&&(C+="own "),w&&(C+="nested "),C+="property ";var $;S?$=Object.prototype.hasOwnProperty.call(v,c):w?$=K.exists:$=n.hasProperty(v,c),(!F||arguments.length===1)&&this.assert($,"expected #{this} to have "+C+n.inspect(c),"expected #{this} to not have "+C+n.inspect(c)),arguments.length>1&&this.assert($&&(N?n.eql(h,B):h===B),"expected #{this} to have "+C+n.inspect(c)+" of #{exp}, but got #{act}","expected #{this} to not have "+C+n.inspect(c)+" of #{act}",h,B),t(this,"object",B)}e.addMethod("property",U);function G(c,h,m){t(this,"own",!0),U.apply(this,arguments)}e.addMethod("ownProperty",G),e.addMethod("haveOwnProperty",G);function Y(c,h,m){typeof h=="string"&&(m=h,h=null),m&&t(this,"message",m);var w=t(this,"object"),S=Object.getOwnPropertyDescriptor(Object(w),c);S&&h?this.assert(n.eql(h,S),"expected the own property descriptor for "+n.inspect(c)+" on #{this} to match "+n.inspect(h)+", got "+n.inspect(S),"expected the own property descriptor for "+n.inspect(c)+" on #{this} to not match "+n.inspect(h),h,S,!0):this.assert(S,"expected #{this} to have an own property descriptor for "+n.inspect(c),"expected #{this} to not have an own property descriptor for "+n.inspect(c)),t(this,"object",S)}e.addMethod("ownPropertyDescriptor",Y),e.addMethod("haveOwnPropertyDescriptor",Y);function p(){t(this,"doLength",!0)}function A(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=n.type(m).toLowerCase(),S=t(this,"message"),P=t(this,"ssfi"),v="length",y;switch(w){case"map":case"set":v="size",y=m.size;break;default:new e(m,S,P,!0).to.have.property("length"),y=m.length}this.assert(y==c,"expected #{this} to have a "+v+" of #{exp} but got #{act}","expected #{this} to not have a "+v+" of #{act}",c,y)}e.addChainableMethod("length",A,p),e.addChainableMethod("lengthOf",A,p);function q(c,h){h&&t(this,"message",h);var m=t(this,"object");this.assert(c.exec(m),"expected #{this} to match "+c,"expected #{this} not to match "+c)}e.addMethod("match",q),e.addMethod("matches",q),e.addMethod("string",function(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"message"),S=t(this,"ssfi");new e(m,w,S,!0).is.a("string"),this.assert(~m.indexOf(c),"expected #{this} to contain "+n.inspect(c),"expected #{this} to not contain "+n.inspect(c))});function z(c){var h=t(this,"object"),m=n.type(h),w=n.type(c),S=t(this,"ssfi"),P=t(this,"deep"),v,y="",T,N=!0,F=t(this,"message");F=F?F+": ":"";var K=F+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(m==="Map"||m==="Set")y=P?"deeply ":"",T=[],h.forEach(function(te,we){T.push(we)}),w!=="Array"&&(c=Array.prototype.slice.call(arguments));else{switch(T=n.getOwnEnumerableProperties(h),w){case"Array":if(arguments.length>1)throw new a(K,void 0,S);break;case"Object":if(arguments.length>1)throw new a(K,void 0,S);c=Object.keys(c);break;default:c=Array.prototype.slice.call(arguments)}c=c.map(function(te){return typeof te=="symbol"?te:String(te)})}if(!c.length)throw new a(F+"keys required",void 0,S);var B=c.length,C=t(this,"any"),$=t(this,"all"),ee=c;if(!C&&!$&&($=!0),C&&(N=ee.some(function(te){return T.some(function(we){return P?n.eql(te,we):te===we})})),$&&(N=ee.every(function(te){return T.some(function(we){return P?n.eql(te,we):te===we})}),t(this,"contains")||(N=N&&c.length==T.length)),B>1){c=c.map(function(te){return n.inspect(te)});var oe=c.pop();$&&(v=c.join(", ")+", and "+oe),C&&(v=c.join(", ")+", or "+oe)}else v=n.inspect(c[0]);v=(B>1?"keys ":"key ")+v,v=(t(this,"contains")?"contain ":"have ")+v,this.assert(N,"expected #{this} to "+y+v,"expected #{this} to not "+y+v,ee.slice(0).sort(n.compareByInspect),T.sort(n.compareByInspect),!0)}e.addMethod("keys",z),e.addMethod("key",z);function H(c,h,m){m&&t(this,"message",m);var w=t(this,"object"),S=t(this,"ssfi"),P=t(this,"message"),v=t(this,"negate")||!1;new e(w,P,S,!0).is.a("function"),(c instanceof RegExp||typeof c=="string")&&(h=c,c=null);var y;try{w()}catch(te){y=te}var T=c===void 0&&h===void 0,N=Boolean(c&&h),F=!1,K=!1;if(T||!T&&!v){var B="an error";c instanceof Error?B="#{exp}":c&&(B=n.checkError.getConstructorName(c)),this.assert(y,"expected #{this} to throw "+B,"expected #{this} to not throw an error but #{act} was thrown",c&&c.toString(),y instanceof Error?y.toString():typeof y=="string"?y:y&&n.checkError.getConstructorName(y))}if(c&&y){if(c instanceof Error){var C=n.checkError.compatibleInstance(y,c);C===v&&(N&&v?F=!0:this.assert(v,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(y&&!v?" but #{act} was thrown":""),c.toString(),y.toString()))}var $=n.checkError.compatibleConstructor(y,c);$===v&&(N&&v?F=!0:this.assert(v,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(y?" but #{act} was thrown":""),c instanceof Error?c.toString():c&&n.checkError.getConstructorName(c),y instanceof Error?y.toString():y&&n.checkError.getConstructorName(y)))}if(y&&h!==void 0&&h!==null){var ee="including";h instanceof RegExp&&(ee="matching");var oe=n.checkError.compatibleMessage(y,h);oe===v&&(N&&v?K=!0:this.assert(v,"expected #{this} to throw error "+ee+" #{exp} but got #{act}","expected #{this} to throw error not "+ee+" #{exp}",h,n.checkError.getMessage(y)))}F&&K&&this.assert(v,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(y?" but #{act} was thrown":""),c instanceof Error?c.toString():c&&n.checkError.getConstructorName(c),y instanceof Error?y.toString():y&&n.checkError.getConstructorName(y)),t(this,"object",y)}e.addMethod("throw",H),e.addMethod("throws",H),e.addMethod("Throw",H);function be(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"itself"),S=typeof m=="function"&&!w?m.prototype[c]:m[c];this.assert(typeof S=="function","expected #{this} to respond to "+n.inspect(c),"expected #{this} to not respond to "+n.inspect(c))}e.addMethod("respondTo",be),e.addMethod("respondsTo",be),e.addProperty("itself",function(){t(this,"itself",!0)});function re(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=c(m);this.assert(w,"expected #{this} to satisfy "+n.objDisplay(c),"expected #{this} to not satisfy"+n.objDisplay(c),!t(this,"negate"),w)}e.addMethod("satisfy",re),e.addMethod("satisfies",re);function _e(c,h,m){m&&t(this,"message",m);var w=t(this,"object"),S=t(this,"message"),P=t(this,"ssfi");if(new e(w,S,P,!0).is.a("number"),typeof c!="number"||typeof h!="number"){S=S?S+": ":"";var v=h===void 0?", and a delta is required":"";throw new a(S+"the arguments to closeTo or approximately must be numbers"+v,void 0,P)}this.assert(Math.abs(w-c)<=h,"expected #{this} to be close to "+c+" +/- "+h,"expected #{this} not to be close to "+c+" +/- "+h)}e.addMethod("closeTo",_e),e.addMethod("approximately",_e);function se(c,h,m,w,S){if(!w){if(c.length!==h.length)return!1;h=h.slice()}return c.every(function(P,v){if(S)return m?m(P,h[v]):P===h[v];if(!m){var y=h.indexOf(P);return y===-1?!1:(w||h.splice(y,1),!0)}return h.some(function(T,N){return m(P,T)?(w||h.splice(N,1),!0):!1})})}e.addMethod("members",function(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"message"),S=t(this,"ssfi");new e(m,w,S,!0).to.be.an("array"),new e(c,w,S,!0).to.be.an("array");var P=t(this,"contains"),v=t(this,"ordered"),y,T,N;P?(y=v?"an ordered superset":"a superset",T="expected #{this} to be "+y+" of #{exp}",N="expected #{this} to not be "+y+" of #{exp}"):(y=v?"ordered members":"members",T="expected #{this} to have the same "+y+" as #{exp}",N="expected #{this} to not have the same "+y+" as #{exp}");var F=t(this,"deep")?n.eql:void 0;this.assert(se(c,m,F,P,v),T,N,c,m,!0)});function me(c,h){h&&t(this,"message",h);var m=t(this,"object"),w=t(this,"message"),S=t(this,"ssfi"),P=t(this,"contains"),v=t(this,"deep");new e(c,w,S,!0).to.be.an("array"),P?this.assert(c.some(function(y){return m.indexOf(y)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",c,m):v?this.assert(c.some(function(y){return n.eql(m,y)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",c,m):this.assert(c.indexOf(m)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",c,m)}e.addMethod("oneOf",me);function ce(c,h,m){m&&t(this,"message",m);var w=t(this,"object"),S=t(this,"message"),P=t(this,"ssfi");new e(w,S,P,!0).is.a("function");var v;h?(new e(c,S,P,!0).to.have.property(h),v=c[h]):(new e(c,S,P,!0).is.a("function"),v=c()),w();var y=h==null?c():c[h],T=h==null?v:"."+h;t(this,"deltaMsgObj",T),t(this,"initialDeltaValue",v),t(this,"finalDeltaValue",y),t(this,"deltaBehavior","change"),t(this,"realDelta",y!==v),this.assert(v!==y,"expected "+T+" to change","expected "+T+" to not change")}e.addMethod("change",ce),e.addMethod("changes",ce);function je(c,h,m){m&&t(this,"message",m);var w=t(this,"object"),S=t(this,"message"),P=t(this,"ssfi");new e(w,S,P,!0).is.a("function");var v;h?(new e(c,S,P,!0).to.have.property(h),v=c[h]):(new e(c,S,P,!0).is.a("function"),v=c()),new e(v,S,P,!0).is.a("number"),w();var y=h==null?c():c[h],T=h==null?v:"."+h;t(this,"deltaMsgObj",T),t(this,"initialDeltaValue",v),t(this,"finalDeltaValue",y),t(this,"deltaBehavior","increase"),t(this,"realDelta",y-v),this.assert(y-v>0,"expected "+T+" to increase","expected "+T+" to not increase")}e.addMethod("increase",je),e.addMethod("increases",je);function ft(c,h,m){m&&t(this,"message",m);var w=t(this,"object"),S=t(this,"message"),P=t(this,"ssfi");new e(w,S,P,!0).is.a("function");var v;h?(new e(c,S,P,!0).to.have.property(h),v=c[h]):(new e(c,S,P,!0).is.a("function"),v=c()),new e(v,S,P,!0).is.a("number"),w();var y=h==null?c():c[h],T=h==null?v:"."+h;t(this,"deltaMsgObj",T),t(this,"initialDeltaValue",v),t(this,"finalDeltaValue",y),t(this,"deltaBehavior","decrease"),t(this,"realDelta",v-y),this.assert(y-v<0,"expected "+T+" to decrease","expected "+T+" to not decrease")}e.addMethod("decrease",ft),e.addMethod("decreases",ft);function Et(c,h){h&&t(this,"message",h);var m=t(this,"deltaMsgObj"),w=t(this,"initialDeltaValue"),S=t(this,"finalDeltaValue"),P=t(this,"deltaBehavior"),v=t(this,"realDelta"),y;P==="change"?y=Math.abs(S-w)===Math.abs(c):y=v===Math.abs(c),this.assert(y,"expected "+m+" to "+P+" by "+c,"expected "+m+" to not "+P+" by "+c)}e.addMethod("by",Et),e.addProperty("extensible",function(){var c=t(this,"object"),h=c===Object(c)&&Object.isExtensible(c);this.assert(h,"expected #{this} to be extensible","expected #{this} to not be extensible")}),e.addProperty("sealed",function(){var c=t(this,"object"),h=c===Object(c)?Object.isSealed(c):!0;this.assert(h,"expected #{this} to be sealed","expected #{this} to not be sealed")}),e.addProperty("frozen",function(){var c=t(this,"object"),h=c===Object(c)?Object.isFrozen(c):!0;this.assert(h,"expected #{this} to be frozen","expected #{this} to not be frozen")}),e.addProperty("finite",function(c){var h=t(this,"object");this.assert(typeof h=="number"&&isFinite(h),"expected #{this} to be a finite number","expected #{this} to not be a finite number")})}});var fo=I((Qu,co)=>{co.exports=function(r,n){r.expect=function(e,a){return new r.Assertion(e,a)},r.expect.fail=function(e,a,t,i){throw arguments.length<2&&(t=e,e=void 0),t=t||"expect.fail()",new r.AssertionError(t,{actual:e,expected:a,operator:i},r.expect.fail)}}});var ho=I((Zu,lo)=>{lo.exports=function(r,n){var e=r.Assertion;function a(){function t(){return this instanceof String||this instanceof Number||this instanceof Boolean||typeof Symbol=="function"&&this instanceof Symbol||typeof BigInt=="function"&&this instanceof BigInt?new e(this.valueOf(),null,t):new e(this,null,t)}function i(s){Object.defineProperty(this,"should",{value:s,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,"should",{set:i,get:t,configurable:!0});var o={};return o.fail=function(s,u,d,g){throw arguments.length<2&&(d=s,s=void 0),d=d||"should.fail()",new r.AssertionError(d,{actual:s,expected:u,operator:g},o.fail)},o.equal=function(s,u,d){new e(s,d).to.equal(u)},o.Throw=function(s,u,d,g){new e(s,g).to.Throw(u,d)},o.exist=function(s,u){new e(s,u).to.exist},o.not={},o.not.equal=function(s,u,d){new e(s,d).to.not.equal(u)},o.not.Throw=function(s,u,d,g){new e(s,g).to.not.Throw(u,d)},o.not.exist=function(s,u){new e(s,u).to.not.exist},o.throw=o.Throw,o.not.throw=o.not.Throw,o}r.should=a,r.Should=a}});var yo=I((Xu,po)=>{po.exports=function(r,n){var e=r.Assertion,a=n.flag;var t=r.assert=function(i,o){var s=new e(null,null,r.assert,!0);s.assert(i,o,"[ negation message unavailable ]")};t.fail=function(i,o,s,u){throw arguments.length<2&&(s=i,i=void 0),s=s||"assert.fail()",new r.AssertionError(s,{actual:i,expected:o,operator:u},t.fail)},t.isOk=function(i,o){new e(i,o,t.isOk,!0).is.ok},t.isNotOk=function(i,o){new e(i,o,t.isNotOk,!0).is.not.ok},t.equal=function(i,o,s){var u=new e(i,s,t.equal,!0);u.assert(o==a(u,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",o,i,!0)},t.notEqual=function(i,o,s){var u=new e(i,s,t.notEqual,!0);u.assert(o!=a(u,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",o,i,!0)},t.strictEqual=function(i,o,s){new e(i,s,t.strictEqual,!0).to.equal(o)},t.notStrictEqual=function(i,o,s){new e(i,s,t.notStrictEqual,!0).to.not.equal(o)},t.deepEqual=t.deepStrictEqual=function(i,o,s){new e(i,s,t.deepEqual,!0).to.eql(o)},t.notDeepEqual=function(i,o,s){new e(i,s,t.notDeepEqual,!0).to.not.eql(o)},t.isAbove=function(i,o,s){new e(i,s,t.isAbove,!0).to.be.above(o)},t.isAtLeast=function(i,o,s){new e(i,s,t.isAtLeast,!0).to.be.least(o)},t.isBelow=function(i,o,s){new e(i,s,t.isBelow,!0).to.be.below(o)},t.isAtMost=function(i,o,s){new e(i,s,t.isAtMost,!0).to.be.most(o)},t.isTrue=function(i,o){new e(i,o,t.isTrue,!0).is.true},t.isNotTrue=function(i,o){new e(i,o,t.isNotTrue,!0).to.not.equal(!0)},t.isFalse=function(i,o){new e(i,o,t.isFalse,!0).is.false},t.isNotFalse=function(i,o){new e(i,o,t.isNotFalse,!0).to.not.equal(!1)},t.isNull=function(i,o){new e(i,o,t.isNull,!0).to.equal(null)},t.isNotNull=function(i,o){new e(i,o,t.isNotNull,!0).to.not.equal(null)},t.isNaN=function(i,o){new e(i,o,t.isNaN,!0).to.be.NaN},t.isNotNaN=function(i,o){new e(i,o,t.isNotNaN,!0).not.to.be.NaN},t.exists=function(i,o){new e(i,o,t.exists,!0).to.exist},t.notExists=function(i,o){new e(i,o,t.notExists,!0).to.not.exist},t.isUndefined=function(i,o){new e(i,o,t.isUndefined,!0).to.equal(void 0)},t.isDefined=function(i,o){new e(i,o,t.isDefined,!0).to.not.equal(void 0)},t.isFunction=function(i,o){new e(i,o,t.isFunction,!0).to.be.a("function")},t.isNotFunction=function(i,o){new e(i,o,t.isNotFunction,!0).to.not.be.a("function")},t.isObject=function(i,o){new e(i,o,t.isObject,!0).to.be.a("object")},t.isNotObject=function(i,o){new e(i,o,t.isNotObject,!0).to.not.be.a("object")},t.isArray=function(i,o){new e(i,o,t.isArray,!0).to.be.an("array")},t.isNotArray=function(i,o){new e(i,o,t.isNotArray,!0).to.not.be.an("array")},t.isString=function(i,o){new e(i,o,t.isString,!0).to.be.a("string")},t.isNotString=function(i,o){new e(i,o,t.isNotString,!0).to.not.be.a("string")},t.isNumber=function(i,o){new e(i,o,t.isNumber,!0).to.be.a("number")},t.isNotNumber=function(i,o){new e(i,o,t.isNotNumber,!0).to.not.be.a("number")},t.isFinite=function(i,o){new e(i,o,t.isFinite,!0).to.be.finite},t.isBoolean=function(i,o){new e(i,o,t.isBoolean,!0).to.be.a("boolean")},t.isNotBoolean=function(i,o){new e(i,o,t.isNotBoolean,!0).to.not.be.a("boolean")},t.typeOf=function(i,o,s){new e(i,s,t.typeOf,!0).to.be.a(o)},t.notTypeOf=function(i,o,s){new e(i,s,t.notTypeOf,!0).to.not.be.a(o)},t.instanceOf=function(i,o,s){new e(i,s,t.instanceOf,!0).to.be.instanceOf(o)},t.notInstanceOf=function(i,o,s){new e(i,s,t.notInstanceOf,!0).to.not.be.instanceOf(o)},t.include=function(i,o,s){new e(i,s,t.include,!0).include(o)},t.notInclude=function(i,o,s){new e(i,s,t.notInclude,!0).not.include(o)},t.deepInclude=function(i,o,s){new e(i,s,t.deepInclude,!0).deep.include(o)},t.notDeepInclude=function(i,o,s){new e(i,s,t.notDeepInclude,!0).not.deep.include(o)},t.nestedInclude=function(i,o,s){new e(i,s,t.nestedInclude,!0).nested.include(o)},t.notNestedInclude=function(i,o,s){new e(i,s,t.notNestedInclude,!0).not.nested.include(o)},t.deepNestedInclude=function(i,o,s){new e(i,s,t.deepNestedInclude,!0).deep.nested.include(o)},t.notDeepNestedInclude=function(i,o,s){new e(i,s,t.notDeepNestedInclude,!0).not.deep.nested.include(o)},t.ownInclude=function(i,o,s){new e(i,s,t.ownInclude,!0).own.include(o)},t.notOwnInclude=function(i,o,s){new e(i,s,t.notOwnInclude,!0).not.own.include(o)},t.deepOwnInclude=function(i,o,s){new e(i,s,t.deepOwnInclude,!0).deep.own.include(o)},t.notDeepOwnInclude=function(i,o,s){new e(i,s,t.notDeepOwnInclude,!0).not.deep.own.include(o)},t.match=function(i,o,s){new e(i,s,t.match,!0).to.match(o)},t.notMatch=function(i,o,s){new e(i,s,t.notMatch,!0).to.not.match(o)},t.property=function(i,o,s){new e(i,s,t.property,!0).to.have.property(o)},t.notProperty=function(i,o,s){new e(i,s,t.notProperty,!0).to.not.have.property(o)},t.propertyVal=function(i,o,s,u){new e(i,u,t.propertyVal,!0).to.have.property(o,s)},t.notPropertyVal=function(i,o,s,u){new e(i,u,t.notPropertyVal,!0).to.not.have.property(o,s)},t.deepPropertyVal=function(i,o,s,u){new e(i,u,t.deepPropertyVal,!0).to.have.deep.property(o,s)},t.notDeepPropertyVal=function(i,o,s,u){new e(i,u,t.notDeepPropertyVal,!0).to.not.have.deep.property(o,s)},t.ownProperty=function(i,o,s){new e(i,s,t.ownProperty,!0).to.have.own.property(o)},t.notOwnProperty=function(i,o,s){new e(i,s,t.notOwnProperty,!0).to.not.have.own.property(o)},t.ownPropertyVal=function(i,o,s,u){new e(i,u,t.ownPropertyVal,!0).to.have.own.property(o,s)},t.notOwnPropertyVal=function(i,o,s,u){new e(i,u,t.notOwnPropertyVal,!0).to.not.have.own.property(o,s)},t.deepOwnPropertyVal=function(i,o,s,u){new e(i,u,t.deepOwnPropertyVal,!0).to.have.deep.own.property(o,s)},t.notDeepOwnPropertyVal=function(i,o,s,u){new e(i,u,t.notDeepOwnPropertyVal,!0).to.not.have.deep.own.property(o,s)},t.nestedProperty=function(i,o,s){new e(i,s,t.nestedProperty,!0).to.have.nested.property(o)},t.notNestedProperty=function(i,o,s){new e(i,s,t.notNestedProperty,!0).to.not.have.nested.property(o)},t.nestedPropertyVal=function(i,o,s,u){new e(i,u,t.nestedPropertyVal,!0).to.have.nested.property(o,s)},t.notNestedPropertyVal=function(i,o,s,u){new e(i,u,t.notNestedPropertyVal,!0).to.not.have.nested.property(o,s)},t.deepNestedPropertyVal=function(i,o,s,u){new e(i,u,t.deepNestedPropertyVal,!0).to.have.deep.nested.property(o,s)},t.notDeepNestedPropertyVal=function(i,o,s,u){new e(i,u,t.notDeepNestedPropertyVal,!0).to.not.have.deep.nested.property(o,s)},t.lengthOf=function(i,o,s){new e(i,s,t.lengthOf,!0).to.have.lengthOf(o)},t.hasAnyKeys=function(i,o,s){new e(i,s,t.hasAnyKeys,!0).to.have.any.keys(o)},t.hasAllKeys=function(i,o,s){new e(i,s,t.hasAllKeys,!0).to.have.all.keys(o)},t.containsAllKeys=function(i,o,s){new e(i,s,t.containsAllKeys,!0).to.contain.all.keys(o)},t.doesNotHaveAnyKeys=function(i,o,s){new e(i,s,t.doesNotHaveAnyKeys,!0).to.not.have.any.keys(o)},t.doesNotHaveAllKeys=function(i,o,s){new e(i,s,t.doesNotHaveAllKeys,!0).to.not.have.all.keys(o)},t.hasAnyDeepKeys=function(i,o,s){new e(i,s,t.hasAnyDeepKeys,!0).to.have.any.deep.keys(o)},t.hasAllDeepKeys=function(i,o,s){new e(i,s,t.hasAllDeepKeys,!0).to.have.all.deep.keys(o)},t.containsAllDeepKeys=function(i,o,s){new e(i,s,t.containsAllDeepKeys,!0).to.contain.all.deep.keys(o)},t.doesNotHaveAnyDeepKeys=function(i,o,s){new e(i,s,t.doesNotHaveAnyDeepKeys,!0).to.not.have.any.deep.keys(o)},t.doesNotHaveAllDeepKeys=function(i,o,s){new e(i,s,t.doesNotHaveAllDeepKeys,!0).to.not.have.all.deep.keys(o)},t.throws=function(i,o,s,u){(typeof o=="string"||o instanceof RegExp)&&(s=o,o=null);var d=new e(i,u,t.throws,!0).to.throw(o,s);return a(d,"object")},t.doesNotThrow=function(i,o,s,u){(typeof o=="string"||o instanceof RegExp)&&(s=o,o=null),new e(i,u,t.doesNotThrow,!0).to.not.throw(o,s)},t.operator=function(i,o,s,u){var d;switch(o){case"==":d=i==s;break;case"===":d=i===s;break;case">":d=i>s;break;case">=":d=i>=s;break;case"<":d=i<s;break;case"<=":d=i<=s;break;case"!=":d=i!=s;break;case"!==":d=i!==s;break;default:throw u=u&&u+": ",new r.AssertionError(u+'Invalid operator "'+o+'"',void 0,t.operator)}var g=new e(d,u,t.operator,!0);g.assert(a(g,"object")===!0,"expected "+n.inspect(i)+" to be "+o+" "+n.inspect(s),"expected "+n.inspect(i)+" to not be "+o+" "+n.inspect(s))},t.closeTo=function(i,o,s,u){new e(i,u,t.closeTo,!0).to.be.closeTo(o,s)},t.approximately=function(i,o,s,u){new e(i,u,t.approximately,!0).to.be.approximately(o,s)},t.sameMembers=function(i,o,s){new e(i,s,t.sameMembers,!0).to.have.same.members(o)},t.notSameMembers=function(i,o,s){new e(i,s,t.notSameMembers,!0).to.not.have.same.members(o)},t.sameDeepMembers=function(i,o,s){new e(i,s,t.sameDeepMembers,!0).to.have.same.deep.members(o)},t.notSameDeepMembers=function(i,o,s){new e(i,s,t.notSameDeepMembers,!0).to.not.have.same.deep.members(o)},t.sameOrderedMembers=function(i,o,s){new e(i,s,t.sameOrderedMembers,!0).to.have.same.ordered.members(o)},t.notSameOrderedMembers=function(i,o,s){new e(i,s,t.notSameOrderedMembers,!0).to.not.have.same.ordered.members(o)},t.sameDeepOrderedMembers=function(i,o,s){new e(i,s,t.sameDeepOrderedMembers,!0).to.have.same.deep.ordered.members(o)},t.notSameDeepOrderedMembers=function(i,o,s){new e(i,s,t.notSameDeepOrderedMembers,!0).to.not.have.same.deep.ordered.members(o)},t.includeMembers=function(i,o,s){new e(i,s,t.includeMembers,!0).to.include.members(o)},t.notIncludeMembers=function(i,o,s){new e(i,s,t.notIncludeMembers,!0).to.not.include.members(o)},t.includeDeepMembers=function(i,o,s){new e(i,s,t.includeDeepMembers,!0).to.include.deep.members(o)},t.notIncludeDeepMembers=function(i,o,s){new e(i,s,t.notIncludeDeepMembers,!0).to.not.include.deep.members(o)},t.includeOrderedMembers=function(i,o,s){new e(i,s,t.includeOrderedMembers,!0).to.include.ordered.members(o)},t.notIncludeOrderedMembers=function(i,o,s){new e(i,s,t.notIncludeOrderedMembers,!0).to.not.include.ordered.members(o)},t.includeDeepOrderedMembers=function(i,o,s){new e(i,s,t.includeDeepOrderedMembers,!0).to.include.deep.ordered.members(o)},t.notIncludeDeepOrderedMembers=function(i,o,s){new e(i,s,t.notIncludeDeepOrderedMembers,!0).to.not.include.deep.ordered.members(o)},t.oneOf=function(i,o,s){new e(i,s,t.oneOf,!0).to.be.oneOf(o)},t.changes=function(i,o,s,u){arguments.length===3&&typeof o=="function"&&(u=s,s=null),new e(i,u,t.changes,!0).to.change(o,s)},t.changesBy=function(i,o,s,u,d){if(arguments.length===4&&typeof o=="function"){var g=u;u=s,d=g}else arguments.length===3&&(u=s,s=null);new e(i,d,t.changesBy,!0).to.change(o,s).by(u)},t.doesNotChange=function(i,o,s,u){return arguments.length===3&&typeof o=="function"&&(u=s,s=null),new e(i,u,t.doesNotChange,!0).to.not.change(o,s)},t.changesButNotBy=function(i,o,s,u,d){if(arguments.length===4&&typeof o=="function"){var g=u;u=s,d=g}else arguments.length===3&&(u=s,s=null);new e(i,d,t.changesButNotBy,!0).to.change(o,s).but.not.by(u)},t.increases=function(i,o,s,u){return arguments.length===3&&typeof o=="function"&&(u=s,s=null),new e(i,u,t.increases,!0).to.increase(o,s)},t.increasesBy=function(i,o,s,u,d){if(arguments.length===4&&typeof o=="function"){var g=u;u=s,d=g}else arguments.length===3&&(u=s,s=null);new e(i,d,t.increasesBy,!0).to.increase(o,s).by(u)},t.doesNotIncrease=function(i,o,s,u){return arguments.length===3&&typeof o=="function"&&(u=s,s=null),new e(i,u,t.doesNotIncrease,!0).to.not.increase(o,s)},t.increasesButNotBy=function(i,o,s,u,d){if(arguments.length===4&&typeof o=="function"){var g=u;u=s,d=g}else arguments.length===3&&(u=s,s=null);new e(i,d,t.increasesButNotBy,!0).to.increase(o,s).but.not.by(u)},t.decreases=function(i,o,s,u){return arguments.length===3&&typeof o=="function"&&(u=s,s=null),new e(i,u,t.decreases,!0).to.decrease(o,s)},t.decreasesBy=function(i,o,s,u,d){if(arguments.length===4&&typeof o=="function"){var g=u;u=s,d=g}else arguments.length===3&&(u=s,s=null);new e(i,d,t.decreasesBy,!0).to.decrease(o,s).by(u)},t.doesNotDecrease=function(i,o,s,u){return arguments.length===3&&typeof o=="function"&&(u=s,s=null),new e(i,u,t.doesNotDecrease,!0).to.not.decrease(o,s)},t.doesNotDecreaseBy=function(i,o,s,u,d){if(arguments.length===4&&typeof o=="function"){var g=u;u=s,d=g}else arguments.length===3&&(u=s,s=null);return new e(i,d,t.doesNotDecreaseBy,!0).to.not.decrease(o,s).by(u)},t.decreasesButNotBy=function(i,o,s,u,d){if(arguments.length===4&&typeof o=="function"){var g=u;u=s,d=g}else arguments.length===3&&(u=s,s=null);new e(i,d,t.decreasesButNotBy,!0).to.decrease(o,s).but.not.by(u)};t.ifError=function(i){if(i)throw i},t.isExtensible=function(i,o){new e(i,o,t.isExtensible,!0).to.be.extensible},t.isNotExtensible=function(i,o){new e(i,o,t.isNotExtensible,!0).to.not.be.extensible},t.isSealed=function(i,o){new e(i,o,t.isSealed,!0).to.be.sealed},t.isNotSealed=function(i,o){new e(i,o,t.isNotSealed,!0).to.not.be.sealed},t.isFrozen=function(i,o){new e(i,o,t.isFrozen,!0).to.be.frozen},t.isNotFrozen=function(i,o){new e(i,o,t.isNotFrozen,!0).to.not.be.frozen},t.isEmpty=function(i,o){new e(i,o,t.isEmpty,!0).to.be.empty},t.isNotEmpty=function(i,o){new e(i,o,t.isNotEmpty,!0).to.not.be.empty};(function i(o,s){return t[s]=t[o],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 Pe=I(ue=>{var mo=[];ue.version="4.3.3";ue.AssertionError=Ot();var bo=oo();ue.use=function(r){return~mo.indexOf(r)||(r(ue,bo),mo.push(r)),ue};ue.util=bo;var Ds=Ne();ue.config=Ds;var ks=so();ue.use(ks);var zs=uo();ue.use(zs);var _s=fo();ue.use(_s);var Bs=ho();ue.use(Bs);var Fs=yo();ue.use(Fs)});var wo=I((Hu,go)=>{go.exports=Pe()});var vo=I((lc,xe)=>{"use strict";var Ie=$t();xe.exports=(r,n)=>{let e=r.Assertion,a=r.assert,t=n.proxify;n.checkError&&(Ie=n.checkError);function i(p){return typeof p.catch!="function"&&typeof p.always=="function"&&typeof p.done=="function"&&typeof p.fail=="function"&&typeof p.pipe=="function"&&typeof p.progress=="function"&&typeof p.state=="function"}function o(p){if(typeof p._obj.then!="function")throw new TypeError(n.inspect(p._obj)+" is not a thenable.");if(i(p._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 s(p){return t===void 0?p:t(p)}function u(p,A){n.addMethod(e.prototype,p,function(){return o(this),A.apply(this,arguments)})}function d(p,A){n.addProperty(e.prototype,p,function(){return o(this),s(A.apply(this,arguments))})}function g(p,A){p.then(()=>A(),A)}function D(p,A,q){p.assert(!0,null,A,q.expected,q.actual)}function V(p,A,q){p.assert(!1,A,null,q.expected,q.actual)}function R(p){return typeof p.then=="function"?p:p._obj}function M(p){return p instanceof Error?p.toString():Ie.getConstructorName(p)}let x=Object.getOwnPropertyNames(e.prototype),j={};for(let p of x)j[p]=Object.getOwnPropertyDescriptor(e.prototype,p);d("fulfilled",function(){let p=R(this).then(A=>(D(this,"expected promise not to be fulfilled but it was fulfilled with #{act}",{actual:A}),A),A=>(V(this,"expected promise to be fulfilled but it was rejected with #{act}",{actual:M(A)}),A));return xe.exports.transferPromiseness(this,p),this}),d("rejected",function(){let p=R(this).then(A=>(V(this,"expected promise to be rejected but it was fulfilled with #{act}",{actual:A}),A),A=>(D(this,"expected promise not to be rejected but it was rejected with #{act}",{actual:M(A)}),A));return xe.exports.transferPromiseness(this,p),this}),u("rejectedWith",function(p,A,q){let z=null,H=n.flag(this,"negate")||!1;if(p===void 0&&A===void 0&&q===void 0)return this.rejected;q!==void 0&&n.flag(this,"message",q),p instanceof RegExp||typeof p=="string"?(A=p,p=null):p&&p instanceof Error?z=p.toString():typeof p=="function"?z=Ie.getConstructorName(p):p=null;let be=Boolean(p&&A),re="including";A instanceof RegExp&&(re="matching");let _e=R(this).then(se=>{let me=null,ce=null;return p?(me="expected promise to be rejected with #{exp} but it was fulfilled with #{act}",ce=z):A&&(me=`expected promise to be rejected with an error ${re} #{exp} but it was fulfilled with #{act}`,ce=A),V(this,me,{expected:ce,actual:se}),se},se=>{let me=p&&(p instanceof Error?Ie.compatibleInstance(se,p):Ie.compatibleConstructor(se,p)),ce=A&&Ie.compatibleMessage(se,A),je=M(se);return H&&be?me&&ce&&this.assert(!0,null,"expected promise not to be rejected with #{exp} but it was rejected with #{act}",z,je):(p&&this.assert(me,"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}",z,je),A&&this.assert(ce,`expected promise to be rejected with an error ${re} #{exp} but got #{act}`,`expected promise not to be rejected with an error ${re} #{exp}`,A,Ie.getMessage(se))),se});return xe.exports.transferPromiseness(this,_e),this}),d("eventually",function(){return n.flag(this,"eventually",!0),this}),u("notify",function(p){return g(R(this),p),this}),u("become",function(p,A){return this.eventually.deep.equal(p,A)}),x.filter(p=>p!=="assert"&&typeof j[p].value=="function").forEach(p=>{e.overwriteMethod(p,A=>function(){return G(A,this,arguments)})}),x.filter(p=>p!=="_obj"&&typeof j[p].get=="function").forEach(p=>{e.prototype.__methods.hasOwnProperty(p)?e.overwriteChainableMethod(p,q=>function(){return G(q,this,arguments)},q=>function(){return G(q,this)}):e.overwriteProperty(p,q=>function(){return s(G(q,this))})});function G(p,A,q){if(!n.flag(A,"eventually"))return p.apply(A,q),A;let z=R(A).then(H=>(A._obj=H,n.flag(A,"eventually",!1),q&&xe.exports.transformAsserterArgs(q))).then(H=>(p.apply(A,H),A._obj));return xe.exports.transferPromiseness(A,z),A}let Y=Object.getOwnPropertyNames(a).filter(p=>typeof a[p]=="function");a.isFulfilled=(p,A)=>new e(p,A).to.be.fulfilled,a.isRejected=(p,A,q,z)=>new e(p,z).to.be.rejectedWith(A,q,z),a.becomes=(p,A,q)=>a.eventually.deepEqual(p,A,q),a.doesNotBecome=(p,A,q)=>a.eventually.notDeepEqual(p,A,q),a.eventually={},Y.forEach(p=>{a.eventually[p]=function(A){let q=Array.prototype.slice.call(arguments,1),z,H=arguments[a[p].length-1];typeof H=="string"&&(z=re=>{throw new r.AssertionError(`${H}
|
|
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&> 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}
|
|
5
5
|
|
|
6
|
-
Original reason: ${
|
|
7
|
-
`)===-1:!1},r.string.reverseOf=function(o,s){return!e(o)||!e(s)?!1:o.split("").reverse().join("")===s},r.string.palindrome=function(o){if(!e(o))return!1;for(var s=o.length,u=0;u<Math.floor(s/2);u++)if(o[u]!==o[s-1-u])return!1;return!0},r.string.entriesCount=function(o,s,u){var d=0;if(e(o)&&e(s))for(var g=0,D=o.length;g<D;){var V=o.indexOf(s,g);if(V===-1)break;d++,g=V+1}return d===u},r.string.indexOf=function(o,s,u){var d=!e(o)||!e(s)?-1:o.indexOf(s);return d===u};var a=function(o){var s=this._obj;return this.assert(r.string.startsWith(s,o),"expected "+this._obj+" to start with "+o,"expected "+this._obj+" not to start with "+o)};r.Assertion.addChainableMethod("startsWith",a),r.Assertion.addChainableMethod("startWith",a);var t=function(o){var s=this._obj;return this.assert(r.string.endsWith(s,o),"expected "+this._obj+" to end with "+o,"expected "+this._obj+" not to end with "+o)};r.Assertion.addChainableMethod("endsWith",t),r.Assertion.addChainableMethod("endWith",t),r.Assertion.addChainableMethod("equalIgnoreCase",function(o){var s=this._obj;return this.assert(r.string.equalIgnoreCase(s,o),"expected "+this._obj+" to equal "+o+" ignoring case","expected "+this._obj+" not to equal "+o+" ignoring case")}),r.Assertion.addChainableMethod("equalIgnoreSpaces",function(o){var s=this._obj;return this.assert(r.string.equalIgnoreSpaces(s,o),"expected "+this._obj+" to equal "+o+" ignoring spaces","expected "+this._obj+" not to equal "+o+" ignoring spaces")}),r.Assertion.addChainableMethod("containIgnoreSpaces",function(o){var s=this._obj;return this.assert(r.string.containIgnoreSpaces(s,o),"expected "+this._obj+" to contain "+o+" ignoring spaces","expected "+this._obj+" not to contain "+o+" ignoring spaces")}),r.Assertion.addChainableMethod("containIgnoreCase",function(o){var s=this._obj;return this.assert(r.string.containIgnoreCase(s,o),"expected "+this._obj+" to contain "+o+" ignoring case","expected "+this._obj+" not to contain "+o+" ignoring case")}),r.Assertion.addChainableMethod("singleLine",function(){var o=this._obj;return this.assert(r.string.singleLine(o),"expected "+this._obj+" to be a single line","expected "+this._obj+" not to be a single line")}),r.Assertion.addChainableMethod("reverseOf",function(o){var s=this._obj;return this.assert(r.string.reverseOf(s,o),"expected "+this._obj+" to be the reverse of "+o,"expected "+this._obj+" not to be the reverse of "+o)}),r.Assertion.addChainableMethod("palindrome",function(){var o=this._obj;return this.assert(r.string.palindrome(o),"expected "+this._obj+" to be a palindrome","expected "+this._obj+" not to be a palindrome")}),r.Assertion.addChainableMethod("entriesCount",function(o,s){var u=this._obj;return this.assert(r.string.entriesCount(u,o,s),"expected "+this._obj+" to have "+o+" "+s+" time(s)","expected "+this._obj+" to not have "+o+" "+s+" time(s)")}),r.Assertion.addChainableMethod("indexOf",function(o,s){var u=this._obj;return this.assert(r.string.indexOf(u,o,s),"expected "+this._obj+" to have "+o+" on index "+s,"expected "+this._obj+" to not have "+o+" on index "+s)});var i=r.assert;i.startsWith=function(o,s,u){new r.Assertion(o,u).to.startsWith(s)},i.notStartsWith=function(o,s,u){new r.Assertion(o,u).to.not.startsWith(s)},i.endsWith=function(o,s,u){new r.Assertion(o,u).to.endsWith(s)},i.notEndsWith=function(o,s,u){new r.Assertion(o,u).to.not.endsWith(s)},i.equalIgnoreCase=function(o,s,u){new r.Assertion(o,u).to.be.equalIgnoreCase(s)},i.notEqualIgnoreCase=function(o,s,u){new r.Assertion(o,u).to.not.be.equalIgnoreCase(s)},i.equalIgnoreSpaces=function(o,s,u){new r.Assertion(o,u).to.be.equalIgnoreSpaces(s)},i.notEqualIgnoreSpaces=function(o,s,u){new r.Assertion(o,u).to.not.be.equalIgnoreSpaces(s)},i.containIgnoreSpaces=function(o,s,u){new r.Assertion(o,u).to.be.containIgnoreSpaces(s)},i.notContainIgnoreSpaces=function(o,s,u){new r.Assertion(o,u).to.not.be.containIgnoreSpaces(s)},i.containIgnoreCase=function(o,s,u){new r.Assertion(o,u).to.be.containIgnoreCase(s)},i.notContainIgnoreCase=function(o,s,u){new r.Assertion(o,u).to.not.be.containIgnoreCase(s)},i.singleLine=function(o,s,u){new r.Assertion(o,u).to.be.singleLine()},i.notSingleLine=function(o,s,u){new r.Assertion(o,u).to.not.be.singleLine()},i.reverseOf=function(o,s,u){new r.Assertion(o,u).to.be.reverseOf(s)},i.notReverseOf=function(o,s,u){new r.Assertion(o,u).to.not.be.reverseOf(s)},i.palindrome=function(o,s,u){new r.Assertion(o,u).to.be.palindrome()},i.notPalindrome=function(o,s,u){new r.Assertion(o,u).to.not.be.palindrome()},i.entriesCount=function(o,s,u,d){new r.Assertion(o,d).to.have.entriesCount(s,u)},i.indexOf=function(o,s,u,d){new r.Assertion(o,d).to.have.indexOf(s,u)}})});var si=I((Mf,ii)=>{function ye(r,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=n||{},this._maxRetryTime=n&&n.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))}ii.exports=ye;ye.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};ye.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};ye.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var n=new Date().getTime();if(r&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var e=this._timeouts.shift();if(e===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),e=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},e),this._options.unref&&this._timer.unref(),!0};ye.prototype.attempt=function(r,n){this._fn=r,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var e=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){e._operationTimeoutCb()},e._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};ye.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)};ye.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)};ye.prototype.start=ye.prototype.try;ye.prototype.errors=function(){return this._errors};ye.prototype.attempts=function(){return this._attempts};ye.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},n=null,e=0,a=0;a<this._errors.length;a++){var t=this._errors[a],i=t.message,o=(r[i]||0)+1;r[i]=o,o>=e&&(n=t,e=o)}return n}});var ai=I(ke=>{var tu=si();ke.operation=function(r){var n=ke.timeouts(r);return new tu(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})};ke.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var e in r)n[e]=r[e];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var a=[],t=0;t<n.retries;t++)a.push(this.createTimeout(t,n));return r&&r.forever&&!a.length&&a.push(this.createTimeout(t,n)),a.sort(function(i,o){return i-o}),a};ke.createTimeout=function(r,n){var e=n.randomize?Math.random()+1:1,a=Math.round(e*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return a=Math.min(a,n.maxTimeout),a};ke.wrap=function(r,n,e){if(n instanceof Array&&(e=n,n=null),!e){e=[];for(var a in r)typeof r[a]=="function"&&e.push(a)}for(var t=0;t<e.length;t++){var i=e[t],o=r[i];r[i]=function(u){var d=ke.operation(n),g=Array.prototype.slice.call(arguments,1),D=g.pop();g.push(function(V){d.retry(V)||(V&&(arguments[0]=d.mainError()),D.apply(this,arguments))}),d.attempt(function(){u.apply(r,g)})}.bind(r,o),r[i].options=n}}});var ci=I((Of,ui)=>{ui.exports=ai()});var pu={};ae(pu,{connectInteropTests:()=>Jt,dhtInteropTests:()=>xn,interopTests:()=>du,pubsubInteropTests:()=>Sn,streamInteropTests:()=>jn});var he=ve(wo(),1),ec=he.default.expect,tc=he.default.version,nc=he.default.Assertion,rc=he.default.AssertionError,oc=he.default.util,ic=he.default.config,sc=he.default.use,ac=he.default.should,uc=he.default.assert,cc=he.default.core,Ee=he.default;var Oo=ve(vo(),1),qo=ve(So(),1),No=ve(Ao(),1),Co=ve(To(),1),Io=ve(jo(),1);Ee.use(Oo.default);Ee.use(qo.default);Ee.use(No.default);Ee.use(Co.default);Ee.use(Io.default);var Q=Ee.expect,bc=Ee.assert;var Te=ve(Se("path"),1),Do=Se("url"),$s={},Re=Te.default.dirname((0,Do.fileURLToPath)($s.url)),Vs={ed25519:Te.default.join(Re,"go.ed25519.key"),rsa:Te.default.join(Re,"go.rsa.key"),secp256k1:Te.default.join(Re,"go.secp256k1.key")},Rs={ed25519:Te.default.join(Re,"js.ed25519.key"),rsa:Te.default.join(Re,"js.rsa.key"),secp256k1:Te.default.join(Re,"js.secp256k1.key")},Gt={go:Vs,js:Rs};function Jt(r){let n=["ed25519","rsa","secp256k1"],e=["js","go"];for(let a of n)for(let t of e)for(let i of e)Ls(`noise/${a}`,r,{type:t,noise:!0,key:Gt.go[a]},{type:i,noise:!0,key:Gt.js[a]})}function Ls(r,n,e,a){describe(`connect using ${r}`,()=>{let t;before(async function(){this.timeout(20*1e3),t=await Promise.all([n.spawn(e),n.spawn(a)])}),after(async function(){t!=null&&await Promise.all(t.map(async i=>await i.stop()))}),it(`${e.type} peer to ${a.type} peer`,async function(){this.timeout(10*1e3);let i=await t[0].client.identify(),o=await t[1].client.identify(),s=await t[0].client.listPeers();Q(s).to.have.lengthOf(0);let u=await t[1].client.listPeers();Q(u).to.have.lengthOf(0),await t[0].client.connect(o.peerId,o.addrs),await new Promise(D=>setTimeout(D,1e3));let d=await t[0].client.listPeers();Q(d).to.have.lengthOf(1),Q(d[0].toString()).to.equal(o.peerId.toString());let g=await t[1].client.listPeers();Q(g).to.have.lengthOf(1),Q(g[0].toString()).to.equal(i.peerId.toString())})})}var Ht={};ae(Ht,{identity:()=>Zs});function Ws(r,n){if(r.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),a=0;a<e.length;a++)e[a]=255;for(var t=0;t<r.length;t++){var i=r.charAt(t),o=i.charCodeAt(0);if(e[o]!==255)throw new TypeError(i+" is ambiguous");e[o]=t}var s=r.length,u=r.charAt(0),d=Math.log(s)/Math.log(256),g=Math.log(256)/Math.log(s);function D(M){if(M instanceof Uint8Array||(ArrayBuffer.isView(M)?M=new Uint8Array(M.buffer,M.byteOffset,M.byteLength):Array.isArray(M)&&(M=Uint8Array.from(M))),!(M instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(M.length===0)return"";for(var x=0,j=0,k=0,U=M.length;k!==U&&M[k]===0;)k++,x++;for(var G=(U-k)*g+1>>>0,Y=new Uint8Array(G);k!==U;){for(var p=M[k],A=0,q=G-1;(p!==0||A<j)&&q!==-1;q--,A++)p+=256*Y[q]>>>0,Y[q]=p%s>>>0,p=p/s>>>0;if(p!==0)throw new Error("Non-zero carry");j=A,k++}for(var z=G-j;z!==G&&Y[z]===0;)z++;for(var H=u.repeat(x);z<G;++z)H+=r.charAt(Y[z]);return H}function V(M){if(typeof M!="string")throw new TypeError("Expected String");if(M.length===0)return new Uint8Array;var x=0;if(M[x]!==" "){for(var j=0,k=0;M[x]===u;)j++,x++;for(var U=(M.length-x)*d+1>>>0,G=new Uint8Array(U);M[x];){var Y=e[M.charCodeAt(x)];if(Y===255)return;for(var p=0,A=U-1;(Y!==0||p<k)&&A!==-1;A--,p++)Y+=s*G[A]>>>0,G[A]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");k=p,x++}if(M[x]!==" "){for(var q=U-k;q!==U&&G[q]===0;)q++;for(var z=new Uint8Array(j+(U-q)),H=j;q!==U;)z[H++]=G[q++];return z}}}function R(M){var x=V(M);if(x)return x;throw new Error(`Non-${n} character`)}return{encode:D,decodeUnsafe:V,decode:R}}var Ks=Ws,Gs=Ks,ko=Gs;var Pc=new Uint8Array(0);var zo=(r,n)=>{if(r===n)return!0;if(r.byteLength!==n.byteLength)return!1;for(let e=0;e<r.byteLength;e++)if(r[e]!==n[e])return!1;return!0},de=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 _o=r=>new TextEncoder().encode(r),Bo=r=>new TextDecoder().decode(r);var Qt=class{constructor(n,e,a){this.name=n,this.prefix=e,this.baseEncode=a}encode(n){if(n instanceof Uint8Array)return`${this.prefix}${this.baseEncode(n)}`;throw Error("Unknown type, must be binary type")}},Zt=class{constructor(n,e,a){if(this.name=n,this.prefix=e,e.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=e.codePointAt(0),this.baseDecode=a}decode(n){if(typeof n=="string"){if(n.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(n)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(n.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(n){return Uo(this,n)}},Xt=class{constructor(n){this.decoders=n}or(n){return Uo(this,n)}decode(n){let e=n[0],a=this.decoders[e];if(a)return a.decode(n);throw RangeError(`Unable to decode multibase string ${JSON.stringify(n)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},Uo=(r,n)=>new Xt({...r.decoders||{[r.prefix]:r},...n.decoders||{[n.prefix]:n}}),Yt=class{constructor(n,e,a,t){this.name=n,this.prefix=e,this.baseEncode=a,this.baseDecode=t,this.encoder=new Qt(n,e,a),this.decoder=new Zt(n,e,t)}encode(n){return this.encoder.encode(n)}decode(n){return this.decoder.decode(n)}},$e=({name:r,prefix:n,encode:e,decode:a})=>new Yt(r,n,e,a),Me=({prefix:r,name:n,alphabet:e})=>{let{encode:a,decode:t}=ko(e,n);return $e({prefix:r,name:n,encode:a,decode:i=>de(t(i))})},Js=(r,n,e,a)=>{let t={};for(let g=0;g<n.length;++g)t[n[g]]=g;let i=r.length;for(;r[i-1]==="=";)--i;let o=new Uint8Array(i*e/8|0),s=0,u=0,d=0;for(let g=0;g<i;++g){let D=t[r[g]];if(D===void 0)throw new SyntaxError(`Non-${a} character`);u=u<<e|D,s+=e,s>=8&&(s-=8,o[d++]=255&u>>s)}if(s>=e||255&u<<8-s)throw new SyntaxError("Unexpected end of data");return o},Qs=(r,n,e)=>{let a=n[n.length-1]==="=",t=(1<<e)-1,i="",o=0,s=0;for(let u=0;u<r.length;++u)for(s=s<<8|r[u],o+=8;o>e;)o-=e,i+=n[t&s>>o];if(o&&(i+=n[t&s<<e-o]),a)for(;i.length*e&7;)i+="=";return i},Z=({name:r,prefix:n,bitsPerChar:e,alphabet:a})=>$e({prefix:n,name:r,encode(t){return Qs(t,a,e)},decode(t){return Js(t,a,e,r)}});var Zs=$e({prefix:"\0",name:"identity",encode:r=>Bo(r),decode:r=>_o(r)});var en={};ae(en,{base2:()=>Xs});var Xs=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var tn={};ae(tn,{base8:()=>Ys});var Ys=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var nn={};ae(nn,{base10:()=>Hs});var Hs=Me({prefix:"9",name:"base10",alphabet:"0123456789"});var rn={};ae(rn,{base16:()=>ea,base16upper:()=>ta});var ea=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ta=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var on={};ae(on,{base32:()=>Le,base32hex:()=>ia,base32hexpad:()=>aa,base32hexpadupper:()=>ua,base32hexupper:()=>sa,base32pad:()=>ra,base32padupper:()=>oa,base32upper:()=>na,base32z:()=>ca});var Le=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),na=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ra=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),oa=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ia=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sa=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),aa=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),ua=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ca=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var sn={};ae(sn,{base36:()=>fa,base36upper:()=>la});var fa=Me({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),la=Me({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var an={};ae(an,{base58btc:()=>ge,base58flickr:()=>ha});var ge=Me({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ha=Me({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var un={};ae(un,{base64:()=>da,base64pad:()=>pa,base64url:()=>ya,base64urlpad:()=>ma});var da=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),pa=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ya=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ma=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var cn={};ae(cn,{base256emoji:()=>xa});var Vo=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}"),ba=Vo.reduce((r,n,e)=>(r[e]=n,r),[]),ga=Vo.reduce((r,n,e)=>(r[n.codePointAt(0)]=e,r),[]);function wa(r){return r.reduce((n,e)=>(n+=ba[e],n),"")}function va(r){let n=[];for(let e of r){let a=ga[e.codePointAt(0)];if(a===void 0)throw new Error(`Non-base256emoji character: ${e}`);n.push(a)}return new Uint8Array(n)}var xa=$e({prefix:"\u{1F680}",name:"base256emoji",encode:wa,decode:va});var pn={};ae(pn,{sha256:()=>Ua,sha512:()=>Va});var dn=ve(Se("crypto"),1);var Sa=Lo,Ro=128,Aa=127,Pa=~Aa,Ea=Math.pow(2,31);function Lo(r,n,e){n=n||[],e=e||0;for(var a=e;r>=Ea;)n[e++]=r&255|Ro,r/=128;for(;r&Pa;)n[e++]=r&255|Ro,r>>>=7;return n[e]=r|0,Lo.bytes=e-a+1,n}var Ta=fn,Ma=128,$o=127;function fn(r,a){var e=0,a=a||0,t=0,i=a,o,s=r.length;do{if(i>=s)throw fn.bytes=0,new RangeError("Could not decode varint");o=r[i++],e+=t<28?(o&$o)<<t:(o&$o)*Math.pow(2,t),t+=7}while(o>=Ma);return fn.bytes=i-a,e}var ja=Math.pow(2,7),Oa=Math.pow(2,14),qa=Math.pow(2,21),Na=Math.pow(2,28),Ca=Math.pow(2,35),Ia=Math.pow(2,42),Da=Math.pow(2,49),ka=Math.pow(2,56),za=Math.pow(2,63),_a=function(r){return r<ja?1:r<Oa?2:r<qa?3:r<Na?4:r<Ca?5:r<Ia?6:r<Da?7:r<ka?8:r<za?9:10},Ba={encode:Sa,decode:Ta,encodingLength:_a},Fa=Ba,ot=Fa;var st=(r,n=0)=>[ot.decode(r,n),ot.decode.bytes],We=(r,n,e=0)=>(ot.encode(r,n,e),n),Ke=r=>ot.encodingLength(r);var De=(r,n)=>{let e=n.byteLength,a=Ke(r),t=a+Ke(e),i=new Uint8Array(t+e);return We(r,i,0),We(e,i,a),i.set(n,t),new Ge(r,e,n,i)},Wo=r=>{let n=de(r),[e,a]=st(n),[t,i]=st(n.subarray(a)),o=n.subarray(a+i);if(o.byteLength!==t)throw new Error("Incorrect length");return new Ge(e,t,o,n)},Ko=(r,n)=>{if(r===n)return!0;{let e=n;return r.code===e.code&&r.size===e.size&&e.bytes instanceof Uint8Array&&zo(r.bytes,e.bytes)}},Ge=class{constructor(n,e,a,t){this.code=n,this.size=e,this.digest=a,this.bytes=t}};var hn=({name:r,code:n,encode:e})=>new ln(r,n,e),ln=class{constructor(n,e,a){this.name=n,this.code=e,this.encode=a}digest(n){if(n instanceof Uint8Array){let e=this.encode(n);return e instanceof Uint8Array?De(this.code,e):e.then(a=>De(this.code,a))}else throw Error("Unknown type, must be binary type")}};var Ua=hn({name:"sha2-256",code:18,encode:r=>de(dn.default.createHash("sha256").update(r).digest())}),Va=hn({name:"sha2-512",code:19,encode:r=>de(dn.default.createHash("sha512").update(r).digest())});var yn={};ae(yn,{identity:()=>La});var Jo=0,Ra="identity",Qo=de,$a=r=>De(Jo,Qo(r)),La={code:Jo,name:Ra,encode:Qo,digest:$a};var Kc=new TextEncoder,Gc=new TextDecoder;var Zo=(r,n)=>{let{bytes:e,version:a}=r;switch(a){case 0:return Ja(e,mn(r),n||ge.encoder);default:return Qa(e,mn(r),n||Le.encoder)}};var Xo=new WeakMap,mn=r=>{let n=Xo.get(r);if(n==null){let e=new Map;return Xo.set(r,e),e}return n},X=class{constructor(n,e,a,t){this.code=e,this.version=n,this.multihash=a,this.bytes=t,this["/"]=t}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:n,multihash:e}=this;if(n!==ut)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(e.code!==Za)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return X.createV0(e)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:n,digest:e}=this.multihash,a=De(n,e);return X.createV1(this.code,a)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(n){return X.equals(this,n)}static equals(n,e){let a=e;return a&&n.code===a.code&&n.version===a.version&&Ko(n.multihash,a.multihash)}toString(n){return Zo(this,n)}toJSON(){return{"/":Zo(this)}}link(){return this}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(n){if(n==null)return null;let e=n;if(e instanceof X)return e;if(e["/"]!=null&&e["/"]===e.bytes||e.asCID===e){let{version:a,code:t,multihash:i,bytes:o}=e;return new X(a,t,i,o||Yo(a,t,i.bytes))}else if(e[Xa]===!0){let{version:a,multihash:t,code:i}=e,o=Wo(t);return X.create(a,i,o)}else return null}static create(n,e,a){if(typeof e!="number")throw new Error("String codecs are no longer supported");if(!(a.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(n){case 0:{if(e!==ut)throw new Error(`Version 0 CID must use dag-pb (code: ${ut}) block encoding`);return new X(n,e,a,a.bytes)}case 1:{let t=Yo(n,e,a.bytes);return new X(n,e,a,t)}default:throw new Error("Invalid version")}}static createV0(n){return X.create(0,ut,n)}static createV1(n,e){return X.create(1,n,e)}static decode(n){let[e,a]=X.decodeFirst(n);if(a.length)throw new Error("Incorrect length");return e}static decodeFirst(n){let e=X.inspectBytes(n),a=e.size-e.multihashSize,t=de(n.subarray(a,a+e.multihashSize));if(t.byteLength!==e.multihashSize)throw new Error("Incorrect length");let i=t.subarray(e.multihashSize-e.digestSize),o=new Ge(e.multihashCode,e.digestSize,i,t);return[e.version===0?X.createV0(o):X.createV1(e.codec,o),n.subarray(e.size)]}static inspectBytes(n){let e=0,a=()=>{let[D,V]=st(n.subarray(e));return e+=V,D},t=a(),i=ut;if(t===18?(t=0,e=0):i=a(),t!==0&&t!==1)throw new RangeError(`Invalid CID version ${t}`);let o=e,s=a(),u=a(),d=e+u,g=d-o;return{version:t,codec:i,multihashCode:s,digestSize:u,multihashSize:g,size:d}}static parse(n,e){let[a,t]=Ga(n,e),i=X.decode(t);return mn(i).set(a,n),i}},Ga=(r,n)=>{switch(r[0]){case"Q":{let e=n||ge;return[ge.prefix,e.decode(`${ge.prefix}${r}`)]}case ge.prefix:{let e=n||ge;return[ge.prefix,e.decode(r)]}case Le.prefix:{let e=n||Le;return[Le.prefix,e.decode(r)]}default:{if(n==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[r[0],n.decode(r)]}}},Ja=(r,n,e)=>{let{prefix:a}=e;if(a!==ge.prefix)throw Error(`Cannot string encode V0 in ${e.name} encoding`);let t=n.get(a);if(t==null){let i=e.encode(r).slice(1);return n.set(a,i),i}else return t},Qa=(r,n,e)=>{let{prefix:a}=e,t=n.get(a);if(t==null){let i=e.encode(r);return n.set(a,i),i}else return t},ut=112,Za=18,Yo=(r,n,e)=>{let a=Ke(r),t=a+Ke(n),i=new Uint8Array(t+e.byteLength);return We(r,i,0),We(n,i,a),i.set(e,t),i},Xa=Symbol.for("@ipld/js-cid/CID");var bn={...Ht,...en,...tn,...nn,...rn,...on,...sn,...an,...un,...cn},rf={...pn,...yn};function Je(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function xt(r=0){return globalThis.Buffer?.allocUnsafe!=null?Je(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function ei(r,n,e,a){return{name:r,prefix:n,encoder:{name:r,prefix:n,encode:e},decoder:{decode:a}}}var Ho=ei("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),gn=ei("ascii","a",r=>{let n="a";for(let e=0;e<r.length;e++)n+=String.fromCharCode(r[e]);return n},r=>{r=r.substring(1);let n=xt(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}),Ya={utf8:Ho,"utf-8":Ho,hex:bn.base16,latin1:gn,ascii:gn,binary:gn,...bn},ti=Ya;function pe(r,n="utf8"){let e=ti[n];if(e==null)throw new Error(`Unsupported encoding "${n}"`);return(n==="utf8"||n==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Je(globalThis.Buffer.from(r,"utf-8")):e.decoder.decode(`${e.prefix}${r}`)}function ni(r,n){n==null&&(n=r.reduce((t,i)=>t+i.length,0));let e=xt(n),a=0;for(let t of r)e.set(t,a),a+=t.length;return Je(e)}var St={key:ni([pe("/pk/"),pe("muft89xjpybos8eas1vaq2xrbsx2vkll7is4ocy7pia5fsjlt3c2","base36")]),value:pe("080012a60230820122300d06092a864886f70d01010105000382010f003082010a0282010100c2588f998971dac9e3eef76a311bf9159505aff69ea3b664c55a36aa28ee08de1127228a4d431bb9c0840240c75f6e98a0843a78d945491a3ea5e1f7cee2bc71383510db5290702383975b7bffae9fb40c84cc1220fb4a7db862fffb0de42f8fd8fb33a17deb20f30e2d0f194791fe69355a392f77df35f101e08a2fc95b2c018768938814fcb52482f899f5e90a1905e8abbcdbb1647ad80a5b0417e1ce8320d64197a6ba3848926375c63adebabdf6eb82109bcadfee13b62bf922bbb6f74c1a26c9bc6122d1436787e0e6de3c152b1959701092abef84599f73eaedb2fcef9f87293e1bbe8e0fef3f1a7fd2e8b94c7e633f88473644a63cb948e4d25c54490203010001","hex")};function ri(r){let n=["js","go"];for(let e of n)for(let a of n)Ha(r,{type:e,dht:!0},{type:a,dht:!0})}function Ha(r,n,e){describe("dht.contentFetching",()=>{let a;before(async function(){this.timeout(20*1e3),a=await Promise.all([r.spawn(n),r.spawn(e)]);let t=await a[0].client.identify();await a[1].client.connect(t.peerId,t.addrs),await new Promise(i=>setTimeout(i,1e3))}),after(async function(){a!=null&&await Promise.all(a.map(async t=>await t.stop()))}),it(`${n.type} peer to ${e.type} peer`,async function(){this.timeout(10*1e3),await a[0].client.dht.put(St.key,St.value);let t=await a[1].client.dht.get(St.key);Q(t).to.equalBytes(St.value)})})}async function ct(r){let n=[];for await(let e of r)n.push(e);return n}function oi(r){let n=["js","go"];for(let e of n)for(let a of n)e==="go"&&a==="go"||eu(r,{type:e,dht:!0},{type:a,dht:!0})}function eu(r,n,e){describe("dht.contentRouting",()=>{let a,t;before(async function(){this.timeout(20*1e3),a=await Promise.all([r.spawn(n),r.spawn(e),r.spawn(e)]),t=await Promise.all(a.map(async i=>await i.client.identify())),await a[0].client.connect(t[1].peerId,t[1].addrs),await a[0].client.connect(t[2].peerId,t[2].addrs),await new Promise(i=>setTimeout(i,1e3))}),after(async function(){a!=null&&await Promise.all(a.map(async i=>await i.stop()))}),it(`${n.type} peer to ${e.type} peer`,async function(){let i=X.parse("QmVzw6MPsF96TyXBSRs1ptLoVMWRv5FCYJZZGJSVB2Hp39");await a[0].client.dht.provide(i);let o=await ct(a[1].client.dht.findProviders(i,1));Q(o).to.exist(),Q(o.length).to.be.greaterThan(0)})})}var li=ve(ci(),1),nu=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed"]),wn=class extends Error{constructor(n){super(),n instanceof Error?(this.originalError=n,{message:n}=n):(this.originalError=new Error(n),this.originalError.stack=this.stack),this.name="AbortError",this.message=n}},ru=(r,n,e)=>{let a=e.retries-(n-1);return r.attemptNumber=n,r.retriesLeft=a,r},ou=r=>nu.has(r),fi=r=>globalThis.DOMException===void 0?new Error(r):new DOMException(r);async function vn(r,n){return new Promise((e,a)=>{n={onFailedAttempt(){},retries:10,...n};let t=li.default.operation(n);t.attempt(async i=>{try{e(await r(i))}catch(o){if(!(o instanceof Error)){a(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof wn)t.stop(),a(o.originalError);else if(o instanceof TypeError&&!ou(o.message))t.stop(),a(o);else{ru(o,i,n);try{await n.onFailedAttempt(o)}catch(s){a(s);return}t.retry(o)||a(t.mainError())}}}),n.signal&&!n.signal.aborted&&n.signal.addEventListener("abort",()=>{t.stop();let i=n.signal.reason===void 0?fi("The operation was aborted."):n.signal.reason;a(i instanceof Error?i:fi(i))},{once:!0})})}function hi(r){let n=["js","go"];for(let e of n)for(let a of n)iu(r,{type:e,dht:!0},{type:a,dht:!0})}function iu(r,n,e){describe("dht.peerRouting",()=>{let a;before(async function(){this.timeout(20*1e3),a=await Promise.all([r.spawn(n),r.spawn(e),r.spawn(e)])}),after(async function(){a!=null&&await Promise.all(a.map(async t=>await t.stop()))}),it(`${n.type} peer to ${e.type} peer`,async function(){let t=await a[1].client.identify(),i=await a[2].client.identify();await a[0].client.connect(t.peerId,t.addrs),await a[0].client.connect(i.peerId,i.addrs);let o=await vn(async()=>await a[1].client.dht.findPeer(i.peerId),{retries:10});Q(i.addrs.map(s=>s.toString())).to.include.deep.members(o.multiaddrs.map(s=>s.toString()))})})}async function xn(r){await ri(r),await oi(r),await hi(r)}async function ze(r){for await(let n of r)return n}function di(r){let n=["js","go"];for(let e of n)for(let a of n)su(r,{type:e,pubsub:!0,pubsubRouter:"floodsub"},{type:a,pubsub:!0,pubsubRouter:"floodsub"})}function su(r,n,e){describe("pubsub.floodSub",()=>{let a;before(async function(){this.timeout(20*1e3),a=await Promise.all([r.spawn(n),r.spawn(e)]);let t=await a[1].client.identify();await a[0].client.connect(t.peerId,t.addrs)}),after(async function(){a!=null&&await Promise.all(a.map(async t=>await t.stop()))}),it(`${n.type} peer to ${e.type} peer`,async function(){let t="test-topic",i=pe("test-data"),o=a[1].client.pubsub.subscribe(t),s=async()=>{let d=await ze(o);Q(d).to.exist(),Q(d).to.have.property("data").that.equalBytes(i)},u=async()=>{await new Promise(d=>setTimeout(d,800)),await a[0].client.pubsub.publish(t,i)};return await Promise.all([s(),u()])})})}function pi(r){let n=["js","go"];for(let e of n)for(let a of n)au(r,{type:e,pubsub:!0,pubsubRouter:"gossipsub"},{type:a,pubsub:!0,pubsubRouter:"gossipsub"})}function au(r,n,e){describe("pubsub.gossipsub",()=>{let a;before(async function(){this.timeout(20*1e3),a=await Promise.all([r.spawn(n),r.spawn(e)]);let t=await a[1].client.identify();await a[0].client.connect(t.peerId,t.addrs)}),after(async function(){a!=null&&await Promise.all(a.map(async t=>await t.stop()))}),it(`${n.type} peer to ${e.type} peer`,async function(){let t="test-topic",i=pe("test-data"),o=a[1].client.pubsub.subscribe(t),s=async()=>{let d=await ze(o);Q(d).to.exist(),Q(d).to.have.property("data").that.equalBytes(i)},u=async()=>{await new Promise(d=>setTimeout(d,800)),await a[0].client.pubsub.publish(t,i)};return await Promise.all([s(),u()])})})}function yi(r){let n=["js","go"];for(let e of n)for(let a of n)uu(r,{type:e,pubsub:!0,pubsubRouter:"floodsub"},{type:a,pubsub:!0,pubsubRouter:"gossipsub"})}function uu(r,n,e){describe("pubsub.hybrid",()=>{let a;before(async function(){this.timeout(20*1e3),a=await Promise.all([r.spawn(n),r.spawn(e)]);let t=await a[1].client.identify();await a[0].client.connect(t.peerId,t.addrs)}),after(async function(){a!=null&&await Promise.all(a.map(async t=>await t.stop()))}),it(`${n.type} peer to ${e.type} peer`,async function(){let t="test-topic",i=pe("test-data"),o=a[1].client.pubsub.subscribe(t),s=async()=>{let d=await ze(o);Q(d).to.exist(),Q(d).to.have.property("data").that.equalBytes(i)},u=async()=>{await new Promise(d=>setTimeout(d,800)),await a[0].client.pubsub.publish(t,i)};return await Promise.all([s(),u()])})})}async function Sn(r){await di(r),await pi(r),await yi(r)}var At=class{constructor(n){if(!(n>0)||n-1&n)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(n),this.mask=n-1,this.top=0,this.btm=0,this.next=null}push(n){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=n,this.top=this.top+1&this.mask,!0)}shift(){let n=this.buffer[this.btm];if(n!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,n}isEmpty(){return this.buffer[this.btm]===void 0}},Qe=class{constructor(n={}){this.hwm=n.splitLimit??16,this.head=new At(this.hwm),this.tail=this.head,this.size=0}calculateSize(n){return n?.byteLength!=null?n.byteLength:1}push(n){if(n?.value!=null&&(this.size+=this.calculateSize(n.value)),!this.head.push(n)){let e=this.head;this.head=e.next=new At(2*this.head.buffer.length),this.head.push(n)}}shift(){let n=this.tail.shift();if(n===void 0&&this.tail.next!=null){let e=this.tail.next;this.tail.next=null,this.tail=e,n=this.tail.shift()}return n?.value!=null&&(this.size-=this.calculateSize(n.value)),n}isEmpty(){return this.head.isEmpty()}};function Pt(r={}){return cu(e=>{let a=e.shift();if(a==null)return{done:!0};if(a.error!=null)throw a.error;return{done:a.done===!0,value:a.value}},r)}function cu(r,n){n=n??{};let e=n.onEnd,a=new Qe,t,i,o,s=async()=>a.isEmpty()?o?{done:!0}:await new Promise((x,j)=>{i=k=>{i=null,a.push(k);try{x(r(a))}catch(U){j(U)}return t}}):r(a),u=x=>i!=null?i(x):(a.push(x),t),d=x=>(a=new Qe,i!=null?i({error:x}):(a.push({error:x}),t)),g=x=>{if(o)return t;if(n?.objectMode!==!0&&x?.byteLength==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return u({done:!1,value:x})},D=x=>o?t:(o=!0,x!=null?d(x):u({done:!0})),V=()=>(a=new Qe,D(),{done:!0}),R=x=>(D(x),{done:!0});if(t={[Symbol.asyncIterator](){return this},next:s,return:V,throw:R,push:g,end:D,get readableLength(){return a.size}},e==null)return t;let M=t;return t={[Symbol.asyncIterator](){return this},next(){return M.next()},throw(x){return M.throw(x),e!=null&&(e(x),e=void 0),{done:!0}},return(){return M.return(),e!=null&&(e(),e=void 0),{done:!0}},push:g,end(x){return M.end(x),e!=null&&(e(x),e=void 0),t},get readableLength(){return M.readableLength}},t}async function*An(...r){let n=Pt({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(r.map(async e=>{for await(let a of e)n.push(a)})),n.end()}catch(e){n.end(e)}}),yield*n}var fu=(...r)=>{let n;for(;r.length>0;)n=r.shift()(n);return n},mi=r=>r!=null&&(typeof r[Symbol.asyncIterator]=="function"||typeof r[Symbol.iterator]=="function"||typeof r.next=="function"),Pn=r=>r!=null&&typeof r.sink=="function"&&mi(r.source),lu=r=>n=>{let e=r.sink(n);if(e.then!=null){let a=Pt({objectMode:!0});return e.then(()=>{a.end()},i=>{a.end(i)}),An(a,async function*(){yield*r.source,a.end()}())}return r.source};function En(r,...n){if(Pn(r)){let a=r;r=()=>a.source}else if(mi(r)){let a=r;r=()=>a}let e=[r,...n];if(e.length>1&&Pn(e[e.length-1])&&(e[e.length-1]=e[e.length-1].sink),e.length>2)for(let a=1;a<e.length-1;a++)Pn(e[a])&&(e[a]=lu(e[a]));return fu(...e)}function Tn(){let r={};return r.promise=new Promise((n,e)=>{r.resolve=n,r.reject=e}),r}function Mn(r,n){let e=["js","go"];for(let a of e)for(let t of e)hu(r,n,{type:a,muxer:n},{type:t,muxer:n})}function hu(r,n,e,a){describe(`echo streams - ${n}`,()=>{let t;before(async function(){this.timeout(20*1e3),t=await Promise.all([r.spawn(e),r.spawn(a)]);let i=await t[0].client.identify();await t[1].client.connect(i.peerId,i.addrs),await new Promise(o=>setTimeout(o,1e3))}),after(async function(){t!=null&&await Promise.all(t.map(async i=>await i.stop()))}),it(`${e.type} sender to ${a.type} listener`,async function(){this.timeout(10*1e3);let i=await t[1].client.identify(),o="/echo/1.0.0",s=[pe("hello world")];await t[1].client.registerStreamHandler(o,async D=>{await En(D,async function*(V){for await(let R of V)yield R.subarray()},D)});let u=await t[0].client.openStream(i.peerId,o),d=Tn(),g=await En(s,async function*(D){yield*D,await d.promise},u,async function*(D){for await(let V of D)yield V.subarray(),d.resolve()},async D=>await ct(D));Q(g).to.deep.equal(s)})})}async function jn(r){await Mn(r,"mplex"),await Mn(r,"yamux")}async function du(r){await Jt(r),await xn(r),await Sn(r),await jn(r)}return Ci(pu);})();
|
|
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);})();
|
|
8
8
|
/*! Bundled license information:
|
|
9
9
|
|
|
10
10
|
assertion-error/index.js:
|