@sebastianwessel/quickjs
Version:
A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox
2 lines • 69.1 kB
JavaScript
var _J=Object.defineProperty,wX=(J,Q,X)=>(Q in J)?_J(J,Q,{enumerable:!0,configurable:!0,writable:!0,value:X}):J[Q]=X,K=(J,Q)=>_J(J,"name",{value:Q,configurable:!0}),vJ=(J,Q)=>{for(var X in Q)_J(J,X,{get:Q[X],enumerable:!0})},LQ=(J,Q,X)=>wX(J,typeof Q!=="symbol"?Q+"":Q,X),t={};vJ(t,{addChainableMethod:()=>iJ,addLengthGuard:()=>n,addMethod:()=>gJ,addProperty:()=>mJ,checkError:()=>M,compareByInspect:()=>JJ,eql:()=>eQ,events:()=>GJ,expectTypes:()=>vQ,flag:()=>R,getActual:()=>ZJ,getMessage:()=>hJ,getName:()=>WJ,getOperator:()=>rJ,getOwnEnumerableProperties:()=>aJ,getOwnEnumerablePropertySymbols:()=>oJ,getPathInfo:()=>cJ,hasProperty:()=>UJ,inspect:()=>S,isNaN:()=>QJ,isNumeric:()=>E,isProxyEnabled:()=>i,isRegExp:()=>XJ,objDisplay:()=>h,overwriteChainableMethod:()=>nJ,overwriteMethod:()=>pJ,overwriteProperty:()=>lJ,proxify:()=>d,test:()=>jJ,transferFlags:()=>x,type:()=>C});var M={};vJ(M,{compatibleConstructor:()=>OQ,compatibleInstance:()=>MQ,compatibleMessage:()=>xQ,getConstructorName:()=>kQ,getMessage:()=>AQ});function $J(J){return J instanceof Error||Object.prototype.toString.call(J)==="[object Error]"}K($J,"isErrorInstance");function HQ(J){return Object.prototype.toString.call(J)==="[object RegExp]"}K(HQ,"isRegExp");function MQ(J,Q){return $J(Q)&&J===Q}K(MQ,"compatibleInstance");function OQ(J,Q){if($J(Q))return J.constructor===Q.constructor||J instanceof Q.constructor;else if((typeof Q==="object"||typeof Q==="function")&&Q.prototype)return J.constructor===Q||J instanceof Q;return!1}K(OQ,"compatibleConstructor");function xQ(J,Q){let X=typeof J==="string"?J:J.message;if(HQ(Q))return Q.test(X);else if(typeof Q==="string")return X.indexOf(Q)!==-1;return!1}K(xQ,"compatibleMessage");function kQ(J){let Q=J;if($J(J))Q=J.constructor.name;else if(typeof J==="function"){if(Q=J.name,Q==="")Q=new J().name||Q}return Q}K(kQ,"getConstructorName");function AQ(J){let Q="";if(J&&J.message)Q=J.message;else if(typeof J==="string")Q=J;return Q}K(AQ,"getMessage");function R(J,Q,X){let Y=J.__flags||(J.__flags=Object.create(null));if(arguments.length===3)Y[Q]=X;else return Y[Q]}K(R,"flag");function jJ(J,Q){let X=R(J,"negate"),Y=Q[0];return X?!Y:Y}K(jJ,"test");function C(J){if(typeof J>"u")return"undefined";if(J===null)return"null";let Q=J[Symbol.toStringTag];if(typeof Q==="string")return Q;return Object.prototype.toString.call(J).slice(8,-1)}K(C,"type");var CX="captureStackTrace"in Error,_Q=class J extends Error{constructor(Q="Unspecified AssertionError",X,Y){super(Q);if(LQ(this,"message"),this.message=Q,CX)Error.captureStackTrace(this,Y||J);for(let $ in X)if(!($ in this))this[$]=X[$]}get name(){return"AssertionError"}get ok(){return!1}toJSON(Q){return{...this,name:this.name,message:this.message,ok:!1,stack:Q!==!1?this.stack:void 0}}};K(_Q,"AssertionError");var w=_Q;function vQ(J,Q){let X=R(J,"message"),Y=R(J,"ssfi");X=X?X+": ":"",J=R(J,"object"),Q=Q.map(function(W){return W.toLowerCase()}),Q.sort();let $=Q.map(function(W,z){let F=~["a","e","i","o","u"].indexOf(W.charAt(0))?"an":"a";return(Q.length>1&&z===Q.length-1?"or ":"")+F+" "+W}).join(", "),G=C(J).toLowerCase();if(!Q.some(function(W){return G===W}))throw new w(X+"object tested must be "+$+", but "+G+" given",void 0,Y)}K(vQ,"expectTypes");function ZJ(J,Q){return Q.length>4?Q[4]:J._obj}K(ZJ,"getActual");var RQ={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"]},PX={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},f="…";function jQ(J,Q){let X=RQ[PX[Q]]||RQ[Q]||"";if(!X)return String(J);return`\x1B[${X[0]}m${String(J)}\x1B[${X[1]}m`}K(jQ,"colorise");function yQ({showHidden:J=!1,depth:Q=2,colors:X=!1,customInspect:Y=!0,showProxy:$=!1,maxArrayLength:G=1/0,breakLength:W=1/0,seen:z=[],truncate:F=1/0,stylize:q=String}={},B){let I={showHidden:Boolean(J),depth:Number(Q),colors:Boolean(X),customInspect:Boolean(Y),showProxy:Boolean($),maxArrayLength:Number(G),breakLength:Number(W),truncate:Number(F),seen:z,inspect:B,stylize:q};if(I.colors)I.stylize=jQ;return I}K(yQ,"normaliseOptions");function hQ(J){return J>="\uD800"&&J<="\uDBFF"}K(hQ,"isHighSurrogate");function _(J,Q,X=f){J=String(J);let Y=X.length,$=J.length;if(Y>Q&&$>Y)return X;if($>Q&&$>Y){let G=Q-Y;if(G>0&&hQ(J[G-1]))G=G-1;return`${J.slice(0,G)}${X}`}return J}K(_,"truncate");function O(J,Q,X,Y=", "){X=X||Q.inspect;let $=J.length;if($===0)return"";let G=Q.truncate,W="",z="",F="";for(let q=0;q<$;q+=1){let B=q+1===J.length,I=q+2===J.length;F=`${f}(${J.length-q})`;let N=J[q];Q.truncate=G-W.length-(B?0:Y.length);let P=z||X(N,Q)+(B?"":Y),D=W.length+P.length,T=D+F.length;if(B&&D>G&&W.length+F.length<=G)break;if(!B&&!I&&T>G)break;if(z=B?"":X(J[q+1],Q)+(I?"":Y),!B&&I&&T>G&&D+z.length>G)break;if(W+=P,!B&&!I&&D+z.length>=G){F=`${f}(${J.length-q-1})`;break}F=""}return`${W}${F}`}K(O,"inspectList");function bQ(J){if(J.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/))return J;return JSON.stringify(J).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}K(bQ,"quoteComplexKey");function u([J,Q],X){if(X.truncate-=2,typeof J==="string")J=bQ(J);else if(typeof J!=="number")J=`[${X.inspect(J,X)}]`;return X.truncate-=J.length,Q=X.inspect(Q,X),`${J}: ${Q}`}K(u,"inspectProperty");function fQ(J,Q){let X=Object.keys(J).slice(J.length);if(!J.length&&!X.length)return"[]";Q.truncate-=4;let Y=O(J,Q);Q.truncate-=Y.length;let $="";if(X.length)$=O(X.map((G)=>[G,J[G]]),Q,u);return`[ ${Y}${$?`, ${$}`:""} ]`}K(fQ,"inspectArray");var TX=K((J)=>{if(typeof Buffer==="function"&&J instanceof Buffer)return"Buffer";if(J[Symbol.toStringTag])return J[Symbol.toStringTag];return J.constructor.name},"getArrayName");function k(J,Q){let X=TX(J);Q.truncate-=X.length+4;let Y=Object.keys(J).slice(J.length);if(!J.length&&!Y.length)return`${X}[]`;let $="";for(let W=0;W<J.length;W++){let z=`${Q.stylize(_(J[W],Q.truncate),"number")}${W===J.length-1?"":", "}`;if(Q.truncate-=z.length,J[W]!==J.length&&Q.truncate<=3){$+=`${f}(${J.length-J[W]+1})`;break}$+=z}let G="";if(Y.length)G=O(Y.map((W)=>[W,J[W]]),Q,u);return`${X}[ ${$}${G?`, ${G}`:""} ]`}K(k,"inspectTypedArray");function uQ(J,Q){let X=J.toJSON();if(X===null)return"Invalid Date";let Y=X.split("T"),$=Y[0];return Q.stylize(`${$}T${_(Y[1],Q.truncate-$.length-1)}`,"date")}K(uQ,"inspectDate");function NJ(J,Q){let X=J[Symbol.toStringTag]||"Function",Y=J.name;if(!Y)return Q.stylize(`[${X}]`,"special");return Q.stylize(`[${X} ${_(Y,Q.truncate-11)}]`,"special")}K(NJ,"inspectFunction");function cQ([J,Q],X){return X.truncate-=4,J=X.inspect(J,X),X.truncate-=J.length,Q=X.inspect(Q,X),`${J} => ${Q}`}K(cQ,"inspectMapEntry");function dQ(J){let Q=[];return J.forEach((X,Y)=>{Q.push([Y,X])}),Q}K(dQ,"mapToEntries");function mQ(J,Q){if(J.size===0)return"Map{}";return Q.truncate-=7,`Map{ ${O(dQ(J),Q,cQ)} }`}K(mQ,"inspectMap");var EX=Number.isNaN||((J)=>J!==J);function SJ(J,Q){if(EX(J))return Q.stylize("NaN","number");if(J===1/0)return Q.stylize("Infinity","number");if(J===-1/0)return Q.stylize("-Infinity","number");if(J===0)return Q.stylize(1/J===1/0?"+0":"-0","number");return Q.stylize(_(String(J),Q.truncate),"number")}K(SJ,"inspectNumber");function wJ(J,Q){let X=_(J.toString(),Q.truncate-1);if(X!==f)X+="n";return Q.stylize(X,"bigint")}K(wJ,"inspectBigInt");function gQ(J,Q){let X=J.toString().split("/")[2],Y=Q.truncate-(2+X.length),$=J.source;return Q.stylize(`/${_($,Y)}/${X}`,"regexp")}K(gQ,"inspectRegExp");function lQ(J){let Q=[];return J.forEach((X)=>{Q.push(X)}),Q}K(lQ,"arrayFromSet");function pQ(J,Q){if(J.size===0)return"Set{}";return Q.truncate-=7,`Set{ ${O(lQ(J),Q)} }`}K(pQ,"inspectSet");var DQ=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),LX={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},HX=16,MX=4;function iQ(J){return LX[J]||`\\u${`0000${J.charCodeAt(0).toString(HX)}`.slice(-MX)}`}K(iQ,"escape");function CJ(J,Q){if(DQ.test(J))J=J.replace(DQ,iQ);return Q.stylize(`'${_(J,Q.truncate-2)}'`,"string")}K(CJ,"inspectString");function PJ(J){if("description"in Symbol.prototype)return J.description?`Symbol(${J.description})`:"Symbol()";return J.toString()}K(PJ,"inspectSymbol");var OX=K(()=>"Promise{…}","getPromiseValue"),xX=OX;function g(J,Q){let X=Object.getOwnPropertyNames(J),Y=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(J):[];if(X.length===0&&Y.length===0)return"{}";if(Q.truncate-=4,Q.seen=Q.seen||[],Q.seen.includes(J))return"[Circular]";Q.seen.push(J);let $=O(X.map((z)=>[z,J[z]]),Q,u),G=O(Y.map((z)=>[z,J[z]]),Q,u);Q.seen.pop();let W="";if($&&G)W=", ";return`{ ${$}${W}${G} }`}K(g,"inspectObject");var IJ=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function nQ(J,Q){let X="";if(IJ&&IJ in J)X=J[IJ];if(X=X||J.constructor.name,!X||X==="_class")X="<Anonymous Class>";return Q.truncate-=X.length,`${X}${g(J,Q)}`}K(nQ,"inspectClass");function oQ(J,Q){if(J.length===0)return"Arguments[]";return Q.truncate-=13,`Arguments[ ${O(J,Q)} ]`}K(oQ,"inspectArguments");var kX=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function aQ(J,Q){let X=Object.getOwnPropertyNames(J).filter((W)=>kX.indexOf(W)===-1),Y=J.name;Q.truncate-=Y.length;let $="";if(typeof J.message==="string")$=_(J.message,Q.truncate);else X.unshift("message");if($=$?`: ${$}`:"",Q.truncate-=$.length+5,Q.seen=Q.seen||[],Q.seen.includes(J))return"[Circular]";Q.seen.push(J);let G=O(X.map((W)=>[W,J[W]]),Q,u);return`${Y}${$}${G?` { ${G} }`:""}`}K(aQ,"inspectObject");function rQ([J,Q],X){if(X.truncate-=3,!Q)return`${X.stylize(String(J),"yellow")}`;return`${X.stylize(String(J),"yellow")}=${X.stylize(`"${Q}"`,"string")}`}K(rQ,"inspectAttribute");function s(J,Q){return O(J,Q,tQ,`
`)}K(s,"inspectNodeCollection");function tQ(J,Q){switch(J.nodeType){case 1:return yJ(J,Q);case 3:return Q.inspect(J.data,Q);default:return Q.inspect(J,Q)}}K(tQ,"inspectNode");function yJ(J,Q){let X=J.getAttributeNames(),Y=J.tagName.toLowerCase(),$=Q.stylize(`<${Y}`,"special"),G=Q.stylize(">","special"),W=Q.stylize(`</${Y}>`,"special");Q.truncate-=Y.length*2+5;let z="";if(X.length>0)z+=" ",z+=O(X.map((B)=>[B,J.getAttribute(B)]),Q,rQ," ");Q.truncate-=z.length;let F=Q.truncate,q=s(J.children,Q);if(q&&q.length>F)q=`${f}(${J.children.length})`;return`${$}${z}${G}${q}${W}`}K(yJ,"inspectHTML");var AX=typeof Symbol==="function"&&typeof Symbol.for==="function",RJ=AX?Symbol.for("chai/inspect"):"@@chai/inspect",DJ=Symbol.for("nodejs.util.inspect.custom"),NQ=new WeakMap,SQ={},wQ={undefined:K((J,Q)=>Q.stylize("undefined","undefined"),"undefined"),null:K((J,Q)=>Q.stylize("null","null"),"null"),boolean:K((J,Q)=>Q.stylize(String(J),"boolean"),"boolean"),Boolean:K((J,Q)=>Q.stylize(String(J),"boolean"),"Boolean"),number:SJ,Number:SJ,bigint:wJ,BigInt:wJ,string:CJ,String:CJ,function:NJ,Function:NJ,symbol:PJ,Symbol:PJ,Array:fQ,Date:uQ,Map:mQ,Set:pQ,RegExp:gQ,Promise:xX,WeakSet:K((J,Q)=>Q.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:K((J,Q)=>Q.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:oQ,Int8Array:k,Uint8Array:k,Uint8ClampedArray:k,Int16Array:k,Uint16Array:k,Int32Array:k,Uint32Array:k,Float32Array:k,Float64Array:k,Generator:K(()=>"","Generator"),DataView:K(()=>"","DataView"),ArrayBuffer:K(()=>"","ArrayBuffer"),Error:aQ,HTMLCollection:s,NodeList:s},_X=K((J,Q,X,Y)=>{if(RJ in J&&typeof J[RJ]==="function")return J[RJ](Q);if(DJ in J&&typeof J[DJ]==="function")return J[DJ](Q.depth,Q,Y);if("inspect"in J&&typeof J.inspect==="function")return J.inspect(Q.depth,Q);if("constructor"in J&&NQ.has(J.constructor))return NQ.get(J.constructor)(J,Q);if(SQ[X])return SQ[X](J,Q);return""},"inspectCustom"),vX=Object.prototype.toString;function l(J,Q={}){let X=yQ(Q,l),{customInspect:Y}=X,$=J===null?"null":typeof J;if($==="object")$=vX.call(J).slice(8,-1);if($ in wQ)return wQ[$](J,X);if(Y&&J){let W=_X(J,X,$,l);if(W){if(typeof W==="string")return W;return l(W,X)}}let G=J?Object.getPrototypeOf(J):!1;if(G===Object.prototype||G===null)return g(J,X);if(J&&typeof HTMLElement==="function"&&J instanceof HTMLElement)return yJ(J,X);if("constructor"in J){if(J.constructor!==Object)return nQ(J,X);return g(J,X)}if(J===Object(J))return g(J,X);return X.stylize(String(J),$)}K(l,"inspect");var H={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function S(J,Q,X,Y){let $={colors:Y,depth:typeof X>"u"?2:X,showHidden:Q,truncate:H.truncateThreshold?H.truncateThreshold:1/0};return l(J,$)}K(S,"inspect");function h(J){let Q=S(J),X=Object.prototype.toString.call(J);if(H.truncateThreshold&&Q.length>=H.truncateThreshold)if(X==="[object Function]")return!J.name||J.name===""?"[Function]":"[Function: "+J.name+"]";else if(X==="[object Array]")return"[ Array("+J.length+") ]";else if(X==="[object Object]"){let Y=Object.keys(J);return"{ Object ("+(Y.length>2?Y.splice(0,2).join(", ")+", ...":Y.join(", "))+") }"}else return Q;else return Q}K(h,"objDisplay");function hJ(J,Q){let X=R(J,"negate"),Y=R(J,"object"),$=Q[3],G=ZJ(J,Q),W=X?Q[2]:Q[1],z=R(J,"message");if(typeof W==="function")W=W();return W=W||"",W=W.replace(/#\{this\}/g,function(){return h(Y)}).replace(/#\{act\}/g,function(){return h(G)}).replace(/#\{exp\}/g,function(){return h($)}),z?z+": "+W:W}K(hJ,"getMessage");function x(J,Q,X){let Y=J.__flags||(J.__flags=Object.create(null));if(!Q.__flags)Q.__flags=Object.create(null);X=arguments.length===3?X:!0;for(let $ in Y)if(X||$!=="object"&&$!=="ssfi"&&$!=="lockSsfi"&&$!="message")Q.__flags[$]=Y[$]}K(x,"transferFlags");function TJ(J){if(typeof J>"u")return"undefined";if(J===null)return"null";let Q=J[Symbol.toStringTag];if(typeof Q==="string")return Q;let X=8,Y=-1;return Object.prototype.toString.call(J).slice(X,Y)}K(TJ,"type");function bJ(){this._key="chai/deep-eql__"+Math.random()+Date.now()}K(bJ,"FakeMap");bJ.prototype={get:K(function(Q){return Q[this._key]},"get"),set:K(function(Q,X){if(Object.isExtensible(Q))Object.defineProperty(Q,this._key,{value:X,configurable:!0})},"set")};var sQ=typeof WeakMap==="function"?WeakMap:bJ;function EJ(J,Q,X){if(!X||b(J)||b(Q))return null;var Y=X.get(J);if(Y){var $=Y.get(Q);if(typeof $==="boolean")return $}return null}K(EJ,"memoizeCompare");function m(J,Q,X,Y){if(!X||b(J)||b(Q))return;var $=X.get(J);if($)$.set(Q,Y);else $=new sQ,$.set(Q,Y),X.set(J,$)}K(m,"memoizeSet");var eQ=p;function p(J,Q,X){if(X&&X.comparator)return LJ(J,Q,X);var Y=fJ(J,Q);if(Y!==null)return Y;return LJ(J,Q,X)}K(p,"deepEqual");function fJ(J,Q){if(J===Q)return J!==0||1/J===1/Q;if(J!==J&&Q!==Q)return!0;if(b(J)||b(Q))return!1;return null}K(fJ,"simpleEqual");function LJ(J,Q,X){X=X||{},X.memoize=X.memoize===!1?!1:X.memoize||new sQ;var Y=X&&X.comparator,$=EJ(J,Q,X.memoize);if($!==null)return $;var G=EJ(Q,J,X.memoize);if(G!==null)return G;if(Y){var W=Y(J,Q);if(W===!1||W===!0)return m(J,Q,X.memoize,W),W;var z=fJ(J,Q);if(z!==null)return z}var F=TJ(J);if(F!==TJ(Q))return m(J,Q,X.memoize,!1),!1;m(J,Q,X.memoize,!0);var q=JX(J,Q,F,X);return m(J,Q,X.memoize,q),q}K(LJ,"extensiveDeepEqual");function JX(J,Q,X,Y){switch(X){case"String":case"Number":case"Boolean":case"Date":return p(J.valueOf(),Q.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return J===Q;case"Error":return uJ(J,Q,["name","message","code"],Y);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return y(J,Q,Y);case"RegExp":return QX(J,Q);case"Generator":return XX(J,Q,Y);case"DataView":return y(new Uint8Array(J.buffer),new Uint8Array(Q.buffer),Y);case"ArrayBuffer":return y(new Uint8Array(J),new Uint8Array(Q),Y);case"Set":return HJ(J,Q,Y);case"Map":return HJ(J,Q,Y);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return J.equals(Q);case"Temporal.Duration":return J.total("nanoseconds")===Q.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return J.toString()===Q.toString();default:return $X(J,Q,Y)}}K(JX,"extensiveDeepEqualByType");function QX(J,Q){return J.toString()===Q.toString()}K(QX,"regexpEqual");function HJ(J,Q,X){try{if(J.size!==Q.size)return!1;if(J.size===0)return!0}catch(G){return!1}var Y=[],$=[];return J.forEach(K(function(W,z){Y.push([W,z])},"gatherEntries")),Q.forEach(K(function(W,z){$.push([W,z])},"gatherEntries")),y(Y.sort(),$.sort(),X)}K(HJ,"entriesEqual");function y(J,Q,X){var Y=J.length;if(Y!==Q.length)return!1;if(Y===0)return!0;var $=-1;while(++$<Y)if(p(J[$],Q[$],X)===!1)return!1;return!0}K(y,"iterableEqual");function XX(J,Q,X){return y(e(J),e(Q),X)}K(XX,"generatorEqual");function YX(J){return typeof Symbol<"u"&&typeof J==="object"&&typeof Symbol.iterator<"u"&&typeof J[Symbol.iterator]==="function"}K(YX,"hasIteratorFunction");function MJ(J){if(YX(J))try{return e(J[Symbol.iterator]())}catch(Q){return[]}return[]}K(MJ,"getIteratorEntries");function e(J){var Q=J.next(),X=[Q.value];while(Q.done===!1)Q=J.next(),X.push(Q.value);return X}K(e,"getGeneratorEntries");function OJ(J){var Q=[];for(var X in J)Q.push(X);return Q}K(OJ,"getEnumerableKeys");function xJ(J){var Q=[],X=Object.getOwnPropertySymbols(J);for(var Y=0;Y<X.length;Y+=1){var $=X[Y];if(Object.getOwnPropertyDescriptor(J,$).enumerable)Q.push($)}return Q}K(xJ,"getEnumerableSymbols");function uJ(J,Q,X,Y){var $=X.length;if($===0)return!0;for(var G=0;G<$;G+=1)if(p(J[X[G]],Q[X[G]],Y)===!1)return!1;return!0}K(uJ,"keysEqual");function $X(J,Q,X){var Y=OJ(J),$=OJ(Q),G=xJ(J),W=xJ(Q);if(Y=Y.concat(G),$=$.concat(W),Y.length&&Y.length===$.length){if(y(kJ(Y).sort(),kJ($).sort())===!1)return!1;return uJ(J,Q,Y,X)}var z=MJ(J),F=MJ(Q);if(z.length&&z.length===F.length)return z.sort(),F.sort(),y(z,F,X);if(Y.length===0&&z.length===0&&$.length===0&&F.length===0)return!0;return!1}K($X,"objectEqual");function b(J){return J===null||typeof J!=="object"}K(b,"isPrimitive");function kJ(J){return J.map(K(function(X){if(typeof X==="symbol")return X.toString();return X},"mapSymbol"))}K(kJ,"mapSymbols");function UJ(J,Q){if(typeof J>"u"||J===null)return!1;return Q in Object(J)}K(UJ,"hasProperty");function ZX(J){return J.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map((Y)=>{if(Y==="constructor"||Y==="__proto__"||Y==="prototype")return{};let G=/^\[(\d+)\]$/.exec(Y),W=null;if(G)W={i:parseFloat(G[1])};else W={p:Y.replace(/\\([.[\]])/g,"$1")};return W})}K(ZX,"parsePath");function AJ(J,Q,X){let Y=J,$=null;X=typeof X>"u"?Q.length:X;for(let G=0;G<X;G++){let W=Q[G];if(Y){if(typeof W.p>"u")Y=Y[W.i];else Y=Y[W.p];if(G===X-1)$=Y}}return $}K(AJ,"internalGetPathValue");function cJ(J,Q){let X=ZX(Q),Y=X[X.length-1],$={parent:X.length>1?AJ(J,X,X.length-1):J,name:Y.p||Y.i,value:AJ(J,X)};return $.exists=UJ($.parent,$.name),$}K(cJ,"getPathInfo");var UX=class J{constructor(Q,X,Y,$){return LQ(this,"__flags",{}),R(this,"ssfi",Y||J),R(this,"lockSsfi",$),R(this,"object",Q),R(this,"message",X),R(this,"eql",H.deepEqual||eQ),d(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),H.includeStack}static set includeStack(Q){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),H.includeStack=Q}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),H.showDiff}static set showDiff(Q){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),H.showDiff=Q}static addProperty(Q,X){mJ(this.prototype,Q,X)}static addMethod(Q,X){gJ(this.prototype,Q,X)}static addChainableMethod(Q,X,Y){iJ(this.prototype,Q,X,Y)}static overwriteProperty(Q,X){lJ(this.prototype,Q,X)}static overwriteMethod(Q,X){pJ(this.prototype,Q,X)}static overwriteChainableMethod(Q,X,Y){nJ(this.prototype,Q,X,Y)}assert(Q,X,Y,$,G,W){let z=jJ(this,arguments);if(W!==!1)W=!0;if($===void 0&&G===void 0)W=!1;if(H.showDiff!==!0)W=!1;if(!z){X=hJ(this,arguments);let q={actual:ZJ(this,arguments),expected:$,showDiff:W},B=rJ(this,arguments);if(B)q.operator=B;throw new w(X,q,H.includeStack?this.assert:R(this,"ssfi"))}}get _obj(){return R(this,"object")}set _obj(Q){R(this,"object",Q)}};K(UX,"Assertion");var U=UX,GJ=new EventTarget,GX=class extends Event{constructor(Q,X,Y){super(Q);this.name=String(X),this.fn=Y}};K(GX,"PluginEvent");var dJ=GX;function i(){return H.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}K(i,"isProxyEnabled");function mJ(J,Q,X){X=X===void 0?function(){}:X,Object.defineProperty(J,Q,{get:K(function Y(){if(!i()&&!R(this,"lockSsfi"))R(this,"ssfi",Y);let $=X.call(this);if($!==void 0)return $;let G=new U;return x(this,G),G},"propertyGetter"),configurable:!0}),GJ.dispatchEvent(new dJ("addProperty",Q,X))}K(mJ,"addProperty");var jX=Object.getOwnPropertyDescriptor(function(){},"length");function n(J,Q,X){if(!jX.configurable)return J;return Object.defineProperty(J,"length",{get:K(function(){if(X)throw Error("Invalid Chai property: "+Q+'.length. Due to a compatibility issue, "length" cannot directly follow "'+Q+'". Use "'+Q+'.lengthOf" instead.');throw Error("Invalid Chai property: "+Q+'.length. See docs for proper usage of "'+Q+'".')},"get")}),J}K(n,"addLengthGuard");function WX(J){let Q=Object.getOwnPropertyNames(J);function X($){if(Q.indexOf($)===-1)Q.push($)}K(X,"addProperty");let Y=Object.getPrototypeOf(J);while(Y!==null)Object.getOwnPropertyNames(Y).forEach(X),Y=Object.getPrototypeOf(Y);return Q}K(WX,"getProperties");var CQ=["__flags","__methods","_obj","assert"];function d(J,Q){if(!i())return J;return new Proxy(J,{get:K(function X(Y,$){if(typeof $==="string"&&H.proxyExcludedKeys.indexOf($)===-1&&!Reflect.has(Y,$)){if(Q)throw Error("Invalid Chai property: "+Q+"."+$+'. See docs for proper usage of "'+Q+'".');let G=null,W=4;if(WX(Y).forEach(function(z){if(!Object.prototype.hasOwnProperty(z)&&CQ.indexOf(z)===-1){let F=VX($,z,W);if(F<W)G=z,W=F}}),G!==null)throw Error("Invalid Chai property: "+$+'. Did you mean "'+G+'"?');else throw Error("Invalid Chai property: "+$)}if(CQ.indexOf($)===-1&&!R(Y,"lockSsfi"))R(Y,"ssfi",X);return Reflect.get(Y,$)},"proxyGetter")})}K(d,"proxify");function VX(J,Q,X){if(Math.abs(J.length-Q.length)>=X)return X;let Y=[];for(let $=0;$<=J.length;$++)Y[$]=Array(Q.length+1).fill(0),Y[$][0]=$;for(let $=0;$<Q.length;$++)Y[0][$]=$;for(let $=1;$<=J.length;$++){let G=J.charCodeAt($-1);for(let W=1;W<=Q.length;W++){if(Math.abs($-W)>=X){Y[$][W]=X;continue}Y[$][W]=Math.min(Y[$-1][W]+1,Y[$][W-1]+1,Y[$-1][W-1]+(G===Q.charCodeAt(W-1)?0:1))}}return Y[J.length][Q.length]}K(VX,"stringDistanceCapped");function gJ(J,Q,X){let Y=K(function(){if(!R(this,"lockSsfi"))R(this,"ssfi",Y);let $=X.apply(this,arguments);if($!==void 0)return $;let G=new U;return x(this,G),G},"methodWrapper");n(Y,Q,!1),J[Q]=d(Y,Q),GJ.dispatchEvent(new dJ("addMethod",Q,X))}K(gJ,"addMethod");function lJ(J,Q,X){let Y=Object.getOwnPropertyDescriptor(J,Q),$=K(function(){},"_super");if(Y&&typeof Y.get==="function")$=Y.get;Object.defineProperty(J,Q,{get:K(function G(){if(!i()&&!R(this,"lockSsfi"))R(this,"ssfi",G);let W=R(this,"lockSsfi");R(this,"lockSsfi",!0);let z=X($).call(this);if(R(this,"lockSsfi",W),z!==void 0)return z;let F=new U;return x(this,F),F},"overwritingPropertyGetter"),configurable:!0})}K(lJ,"overwriteProperty");function pJ(J,Q,X){let Y=J[Q],$=K(function(){throw Error(Q+" is not a function")},"_super");if(Y&&typeof Y==="function")$=Y;let G=K(function(){if(!R(this,"lockSsfi"))R(this,"ssfi",G);let W=R(this,"lockSsfi");R(this,"lockSsfi",!0);let z=X($).apply(this,arguments);if(R(this,"lockSsfi",W),z!==void 0)return z;let F=new U;return x(this,F),F},"overwritingMethodWrapper");n(G,Q,!1),J[Q]=d(G,Q)}K(pJ,"overwriteMethod");var yX=typeof Object.setPrototypeOf==="function",PQ=K(function(){},"testFn"),hX=Object.getOwnPropertyNames(PQ).filter(function(J){let Q=Object.getOwnPropertyDescriptor(PQ,J);if(typeof Q!=="object")return!0;return!Q.configurable}),bX=Function.prototype.call,fX=Function.prototype.apply,zX=class extends dJ{constructor(Q,X,Y,$){super(Q,X,Y);this.chainingBehavior=$}};K(zX,"PluginAddChainableMethodEvent");var uX=zX;function iJ(J,Q,X,Y){if(typeof Y!=="function")Y=K(function(){},"chainingBehavior");let $={method:X,chainingBehavior:Y};if(!J.__methods)J.__methods={};J.__methods[Q]=$,Object.defineProperty(J,Q,{get:K(function(){$.chainingBehavior.call(this);let W=K(function(){if(!R(this,"lockSsfi"))R(this,"ssfi",W);let z=$.method.apply(this,arguments);if(z!==void 0)return z;let F=new U;return x(this,F),F},"chainableMethodWrapper");if(n(W,Q,!0),yX){let z=Object.create(this);z.call=bX,z.apply=fX,Object.setPrototypeOf(W,z)}else Object.getOwnPropertyNames(J).forEach(function(F){if(hX.indexOf(F)!==-1)return;let q=Object.getOwnPropertyDescriptor(J,F);Object.defineProperty(W,F,q)});return x(this,W),d(W)},"chainableMethodGetter"),configurable:!0}),GJ.dispatchEvent(new uX("addChainableMethod",Q,X,Y))}K(iJ,"addChainableMethod");function nJ(J,Q,X,Y){let $=J.__methods[Q],G=$.chainingBehavior;$.chainingBehavior=K(function(){let F=Y(G).call(this);if(F!==void 0)return F;let q=new U;return x(this,q),q},"overwritingChainableMethodGetter");let W=$.method;$.method=K(function(){let F=X(W).apply(this,arguments);if(F!==void 0)return F;let q=new U;return x(this,q),q},"overwritingChainableMethodWrapper")}K(nJ,"overwriteChainableMethod");function JJ(J,Q){return S(J)<S(Q)?-1:1}K(JJ,"compareByInspect");function oJ(J){if(typeof Object.getOwnPropertySymbols!=="function")return[];return Object.getOwnPropertySymbols(J).filter(function(Q){return Object.getOwnPropertyDescriptor(J,Q).enumerable})}K(oJ,"getOwnEnumerablePropertySymbols");function aJ(J){return Object.keys(J).concat(oJ(J))}K(aJ,"getOwnEnumerableProperties");var QJ=Number.isNaN;function KX(J){let Q=C(J);return["Array","Object","Function"].indexOf(Q)!==-1}K(KX,"isObjectType");function rJ(J,Q){let X=R(J,"operator"),Y=R(J,"negate"),$=Q[3],G=Y?Q[2]:Q[1];if(X)return X;if(typeof G==="function")G=G();if(G=G||"",!G)return;if(/\shave\s/.test(G))return;let W=KX($);if(/\snot\s/.test(G))return W?"notDeepStrictEqual":"notStrictEqual";return W?"deepStrictEqual":"strictEqual"}K(rJ,"getOperator");function WJ(J){return J.name}K(WJ,"getName");function XJ(J){return Object.prototype.toString.call(J)==="[object RegExp]"}K(XJ,"isRegExp");function E(J){return["Number","BigInt"].includes(C(J))}K(E,"isNumeric");var{flag:V}=t;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(J){U.addProperty(J)});U.addProperty("not",function(){V(this,"negate",!0)});U.addProperty("deep",function(){V(this,"deep",!0)});U.addProperty("nested",function(){V(this,"nested",!0)});U.addProperty("own",function(){V(this,"own",!0)});U.addProperty("ordered",function(){V(this,"ordered",!0)});U.addProperty("any",function(){V(this,"any",!0),V(this,"all",!1)});U.addProperty("all",function(){V(this,"all",!0),V(this,"any",!1)});var TQ={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function tJ(J,Q){if(Q)V(this,"message",Q);J=J.toLowerCase();let X=V(this,"object"),Y=~["a","e","i","o","u"].indexOf(J.charAt(0))?"an ":"a ",$=C(X).toLowerCase();if(TQ.function.includes(J))this.assert(TQ[J].includes($),"expected #{this} to be "+Y+J,"expected #{this} not to be "+Y+J);else this.assert(J===$,"expected #{this} to be "+Y+J,"expected #{this} not to be "+Y+J)}K(tJ,"an");U.addChainableMethod("an",tJ);U.addChainableMethod("a",tJ);function FX(J,Q){return QJ(J)&&QJ(Q)||J===Q}K(FX,"SameValueZero");function o(){V(this,"contains",!0)}K(o,"includeChainingBehavior");function a(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=C(X).toLowerCase(),$=V(this,"message"),G=V(this,"negate"),W=V(this,"ssfi"),z=V(this,"deep"),F=z?"deep ":"",q=z?V(this,"eql"):FX;$=$?$+": ":"";let B=!1;switch(Y){case"string":B=X.indexOf(J)!==-1;break;case"weakset":if(z)throw new w($+"unable to use .deep.include with WeakSet",void 0,W);B=X.has(J);break;case"map":X.forEach(function(I){B=B||q(I,J)});break;case"set":if(z)X.forEach(function(I){B=B||q(I,J)});else B=X.has(J);break;case"array":if(z)B=X.some(function(I){return q(I,J)});else B=X.indexOf(J)!==-1;break;default:{if(J!==Object(J))throw new w($+"the given combination of arguments ("+Y+" and "+C(J).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 "+C(J).toLowerCase(),void 0,W);let I=Object.keys(J),N=null,P=0;if(I.forEach(function(D){let T=new U(X);if(x(this,T,!0),V(T,"lockSsfi",!0),!G||I.length===1){T.property(D,J[D]);return}try{T.property(D,J[D])}catch(j){if(!M.compatibleConstructor(j,w))throw j;if(N===null)N=j;P++}},this),G&&I.length>1&&P===I.length)throw N;return}}this.assert(B,"expected #{this} to "+F+"include "+S(J),"expected #{this} to not "+F+"include "+S(J))}K(a,"include");U.addChainableMethod("include",a,o);U.addChainableMethod("contain",a,o);U.addChainableMethod("contains",a,o);U.addChainableMethod("includes",a,o);U.addProperty("ok",function(){this.assert(V(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")});U.addProperty("true",function(){this.assert(V(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",V(this,"negate")?!1:!0)});U.addProperty("numeric",function(){let J=V(this,"object");this.assert(["Number","BigInt"].includes(C(J)),"expected #{this} to be numeric","expected #{this} to not be numeric",V(this,"negate")?!1:!0)});U.addProperty("callable",function(){let J=V(this,"object"),Q=V(this,"ssfi"),X=V(this,"message"),Y=X?`${X}: `:"",$=V(this,"negate"),G=$?`${Y}expected ${S(J)} not to be a callable function`:`${Y}expected ${S(J)} to be a callable function`,W=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(C(J));if(W&&$||!W&&!$)throw new w(G,void 0,Q)});U.addProperty("false",function(){this.assert(V(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",V(this,"negate")?!0:!1)});U.addProperty("null",function(){this.assert(V(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")});U.addProperty("undefined",function(){this.assert(V(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")});U.addProperty("NaN",function(){this.assert(QJ(V(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function sJ(){let J=V(this,"object");this.assert(J!==null&&J!==void 0,"expected #{this} to exist","expected #{this} to not exist")}K(sJ,"assertExist");U.addProperty("exist",sJ);U.addProperty("exists",sJ);U.addProperty("empty",function(){let J=V(this,"object"),Q=V(this,"ssfi"),X=V(this,"message"),Y;switch(X=X?X+": ":"",C(J).toLowerCase()){case"array":case"string":Y=J.length;break;case"map":case"set":Y=J.size;break;case"weakmap":case"weakset":throw new w(X+".empty was passed a weak collection",void 0,Q);case"function":{let $=X+".empty was passed a function "+WJ(J);throw new w($.trim(),void 0,Q)}default:if(J!==Object(J))throw new w(X+".empty was passed non-string primitive "+S(J),void 0,Q);Y=Object.keys(J).length}this.assert(Y===0,"expected #{this} to be empty","expected #{this} not to be empty")});function eJ(){let J=V(this,"object"),Q=C(J);this.assert(Q==="Arguments","expected #{this} to be arguments but got "+Q,"expected #{this} to not be arguments")}K(eJ,"checkArguments");U.addProperty("arguments",eJ);U.addProperty("Arguments",eJ);function VJ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object");if(V(this,"deep")){let Y=V(this,"lockSsfi");V(this,"lockSsfi",!0),this.eql(J),V(this,"lockSsfi",Y)}else this.assert(J===X,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",J,this._obj,!0)}K(VJ,"assertEqual");U.addMethod("equal",VJ);U.addMethod("equals",VJ);U.addMethod("eq",VJ);function JQ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"eql");this.assert(X(J,V(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",J,this._obj,!0)}K(JQ,"assertEql");U.addMethod("eql",JQ);U.addMethod("eqls",JQ);function zJ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"doLength"),$=V(this,"message"),G=$?$+": ":"",W=V(this,"ssfi"),z=C(X).toLowerCase(),F=C(J).toLowerCase();if(Y&&z!=="map"&&z!=="set")new U(X,$,W,!0).to.have.property("length");if(!Y&&z==="date"&&F!=="date")throw new w(G+"the argument to above must be a date",void 0,W);else if(!E(J)&&(Y||E(X)))throw new w(G+"the argument to above must be a number",void 0,W);else if(!Y&&z!=="date"&&!E(X)){let q=z==="string"?"'"+X+"'":X;throw new w(G+"expected "+q+" to be a number or a date",void 0,W)}if(Y){let q="length",B;if(z==="map"||z==="set")q="size",B=X.size;else B=X.length;this.assert(B>J,"expected #{this} to have a "+q+" above #{exp} but got #{act}","expected #{this} to not have a "+q+" above #{exp}",J,B)}else this.assert(X>J,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",J)}K(zJ,"assertAbove");U.addMethod("above",zJ);U.addMethod("gt",zJ);U.addMethod("greaterThan",zJ);function KJ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"doLength"),$=V(this,"message"),G=$?$+": ":"",W=V(this,"ssfi"),z=C(X).toLowerCase(),F=C(J).toLowerCase(),q,B=!0;if(Y&&z!=="map"&&z!=="set")new U(X,$,W,!0).to.have.property("length");if(!Y&&z==="date"&&F!=="date")q=G+"the argument to least must be a date";else if(!E(J)&&(Y||E(X)))q=G+"the argument to least must be a number";else if(!Y&&z!=="date"&&!E(X)){let I=z==="string"?"'"+X+"'":X;q=G+"expected "+I+" to be a number or a date"}else B=!1;if(B)throw new w(q,void 0,W);if(Y){let I="length",N;if(z==="map"||z==="set")I="size",N=X.size;else N=X.length;this.assert(N>=J,"expected #{this} to have a "+I+" at least #{exp} but got #{act}","expected #{this} to have a "+I+" below #{exp}",J,N)}else this.assert(X>=J,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",J)}K(KJ,"assertLeast");U.addMethod("least",KJ);U.addMethod("gte",KJ);U.addMethod("greaterThanOrEqual",KJ);function FJ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"doLength"),$=V(this,"message"),G=$?$+": ":"",W=V(this,"ssfi"),z=C(X).toLowerCase(),F=C(J).toLowerCase(),q,B=!0;if(Y&&z!=="map"&&z!=="set")new U(X,$,W,!0).to.have.property("length");if(!Y&&z==="date"&&F!=="date")q=G+"the argument to below must be a date";else if(!E(J)&&(Y||E(X)))q=G+"the argument to below must be a number";else if(!Y&&z!=="date"&&!E(X)){let I=z==="string"?"'"+X+"'":X;q=G+"expected "+I+" to be a number or a date"}else B=!1;if(B)throw new w(q,void 0,W);if(Y){let I="length",N;if(z==="map"||z==="set")I="size",N=X.size;else N=X.length;this.assert(N<J,"expected #{this} to have a "+I+" below #{exp} but got #{act}","expected #{this} to not have a "+I+" below #{exp}",J,N)}else this.assert(X<J,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",J)}K(FJ,"assertBelow");U.addMethod("below",FJ);U.addMethod("lt",FJ);U.addMethod("lessThan",FJ);function qJ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"doLength"),$=V(this,"message"),G=$?$+": ":"",W=V(this,"ssfi"),z=C(X).toLowerCase(),F=C(J).toLowerCase(),q,B=!0;if(Y&&z!=="map"&&z!=="set")new U(X,$,W,!0).to.have.property("length");if(!Y&&z==="date"&&F!=="date")q=G+"the argument to most must be a date";else if(!E(J)&&(Y||E(X)))q=G+"the argument to most must be a number";else if(!Y&&z!=="date"&&!E(X)){let I=z==="string"?"'"+X+"'":X;q=G+"expected "+I+" to be a number or a date"}else B=!1;if(B)throw new w(q,void 0,W);if(Y){let I="length",N;if(z==="map"||z==="set")I="size",N=X.size;else N=X.length;this.assert(N<=J,"expected #{this} to have a "+I+" at most #{exp} but got #{act}","expected #{this} to have a "+I+" above #{exp}",J,N)}else this.assert(X<=J,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",J)}K(qJ,"assertMost");U.addMethod("most",qJ);U.addMethod("lte",qJ);U.addMethod("lessThanOrEqual",qJ);U.addMethod("within",function(J,Q,X){if(X)V(this,"message",X);let Y=V(this,"object"),$=V(this,"doLength"),G=V(this,"message"),W=G?G+": ":"",z=V(this,"ssfi"),F=C(Y).toLowerCase(),q=C(J).toLowerCase(),B=C(Q).toLowerCase(),I,N=!0,P=q==="date"&&B==="date"?J.toISOString()+".."+Q.toISOString():J+".."+Q;if($&&F!=="map"&&F!=="set")new U(Y,G,z,!0).to.have.property("length");if(!$&&F==="date"&&(q!=="date"||B!=="date"))I=W+"the arguments to within must be dates";else if((!E(J)||!E(Q))&&($||E(Y)))I=W+"the arguments to within must be numbers";else if(!$&&F!=="date"&&!E(Y)){let D=F==="string"?"'"+Y+"'":Y;I=W+"expected "+D+" to be a number or a date"}else N=!1;if(N)throw new w(I,void 0,z);if($){let D="length",T;if(F==="map"||F==="set")D="size",T=Y.size;else T=Y.length;this.assert(T>=J&&T<=Q,"expected #{this} to have a "+D+" within "+P,"expected #{this} to not have a "+D+" within "+P)}else this.assert(Y>=J&&Y<=Q,"expected #{this} to be within "+P,"expected #{this} to not be within "+P)});function QQ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"ssfi"),$=V(this,"message"),G;try{G=X instanceof J}catch(z){if(z instanceof TypeError)throw $=$?$+": ":"",new w($+"The instanceof assertion needs a constructor but "+C(J)+" was given.",void 0,Y);throw z}let W=WJ(J);if(W==null)W="an unnamed constructor";this.assert(G,"expected #{this} to be an instance of "+W,"expected #{this} to not be an instance of "+W)}K(QQ,"assertInstanceOf");U.addMethod("instanceof",QQ);U.addMethod("instanceOf",QQ);function XQ(J,Q,X){if(X)V(this,"message",X);let Y=V(this,"nested"),$=V(this,"own"),G=V(this,"message"),W=V(this,"object"),z=V(this,"ssfi"),F=typeof J;if(G=G?G+": ":"",Y){if(F!=="string")throw new w(G+"the argument to property must be a string when using nested syntax",void 0,z)}else if(F!=="string"&&F!=="number"&&F!=="symbol")throw new w(G+"the argument to property must be a string, number, or symbol",void 0,z);if(Y&&$)throw new w(G+'The "nested" and "own" flags cannot be combined.',void 0,z);if(W===null||W===void 0)throw new w(G+"Target cannot be null or undefined.",void 0,z);let q=V(this,"deep"),B=V(this,"negate"),I=Y?cJ(W,J):null,N=Y?I.value:W[J],P=q?V(this,"eql"):(j,L)=>j===L,D="";if(q)D+="deep ";if($)D+="own ";if(Y)D+="nested ";D+="property ";let T;if($)T=Object.prototype.hasOwnProperty.call(W,J);else if(Y)T=I.exists;else T=UJ(W,J);if(!B||arguments.length===1)this.assert(T,"expected #{this} to have "+D+S(J),"expected #{this} to not have "+D+S(J));if(arguments.length>1)this.assert(T&&P(Q,N),"expected #{this} to have "+D+S(J)+" of #{exp}, but got #{act}","expected #{this} to not have "+D+S(J)+" of #{act}",Q,N);V(this,"object",N)}K(XQ,"assertProperty");U.addMethod("property",XQ);function YQ(J,Q,X){V(this,"own",!0),XQ.apply(this,arguments)}K(YQ,"assertOwnProperty");U.addMethod("ownProperty",YQ);U.addMethod("haveOwnProperty",YQ);function $Q(J,Q,X){if(typeof Q==="string")X=Q,Q=null;if(X)V(this,"message",X);let Y=V(this,"object"),$=Object.getOwnPropertyDescriptor(Object(Y),J),G=V(this,"eql");if($&&Q)this.assert(G(Q,$),"expected the own property descriptor for "+S(J)+" on #{this} to match "+S(Q)+", got "+S($),"expected the own property descriptor for "+S(J)+" on #{this} to not match "+S(Q),Q,$,!0);else this.assert($,"expected #{this} to have an own property descriptor for "+S(J),"expected #{this} to not have an own property descriptor for "+S(J));V(this,"object",$)}K($Q,"assertOwnPropertyDescriptor");U.addMethod("ownPropertyDescriptor",$Q);U.addMethod("haveOwnPropertyDescriptor",$Q);function ZQ(){V(this,"doLength",!0)}K(ZQ,"assertLengthChain");function UQ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=C(X).toLowerCase(),$=V(this,"message"),G=V(this,"ssfi"),W="length",z;switch(Y){case"map":case"set":W="size",z=X.size;break;default:new U(X,$,G,!0).to.have.property("length"),z=X.length}this.assert(z==J,"expected #{this} to have a "+W+" of #{exp} but got #{act}","expected #{this} to not have a "+W+" of #{act}",J,z)}K(UQ,"assertLength");U.addChainableMethod("length",UQ,ZQ);U.addChainableMethod("lengthOf",UQ,ZQ);function GQ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object");this.assert(J.exec(X),"expected #{this} to match "+J,"expected #{this} not to match "+J)}K(GQ,"assertMatch");U.addMethod("match",GQ);U.addMethod("matches",GQ);U.addMethod("string",function(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"message"),$=V(this,"ssfi");new U(X,Y,$,!0).is.a("string"),this.assert(~X.indexOf(J),"expected #{this} to contain "+S(J),"expected #{this} to not contain "+S(J))});function WQ(J){let Q=V(this,"object"),X=C(Q),Y=C(J),$=V(this,"ssfi"),G=V(this,"deep"),W,z="",F,q=!0,B=V(this,"message");B=B?B+": ":"";let I=B+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(X==="Map"||X==="Set"){if(z=G?"deeply ":"",F=[],Q.forEach(function(L,A){F.push(A)}),Y!=="Array")J=Array.prototype.slice.call(arguments)}else{switch(F=aJ(Q),Y){case"Array":if(arguments.length>1)throw new w(I,void 0,$);break;case"Object":if(arguments.length>1)throw new w(I,void 0,$);J=Object.keys(J);break;default:J=Array.prototype.slice.call(arguments)}J=J.map(function(L){return typeof L==="symbol"?L:String(L)})}if(!J.length)throw new w(B+"keys required",void 0,$);let N=J.length,P=V(this,"any"),D=V(this,"all"),T=J,j=G?V(this,"eql"):(L,A)=>L===A;if(!P&&!D)D=!0;if(P)q=T.some(function(L){return F.some(function(A){return j(L,A)})});if(D){if(q=T.every(function(L){return F.some(function(A){return j(L,A)})}),!V(this,"contains"))q=q&&J.length==F.length}if(N>1){J=J.map(function(A){return S(A)});let L=J.pop();if(D)W=J.join(", ")+", and "+L;if(P)W=J.join(", ")+", or "+L}else W=S(J[0]);W=(N>1?"keys ":"key ")+W,W=(V(this,"contains")?"contain ":"have ")+W,this.assert(q,"expected #{this} to "+z+W,"expected #{this} to not "+z+W,T.slice(0).sort(JJ),F.sort(JJ),!0)}K(WQ,"assertKeys");U.addMethod("keys",WQ);U.addMethod("key",WQ);function BJ(J,Q,X){if(X)V(this,"message",X);let Y=V(this,"object"),$=V(this,"ssfi"),G=V(this,"message"),W=V(this,"negate")||!1;if(new U(Y,G,$,!0).is.a("function"),XJ(J)||typeof J==="string")Q=J,J=null;let z,F=!1;try{Y()}catch(P){F=!0,z=P}let q=J===void 0&&Q===void 0,B=Boolean(J&&Q),I=!1,N=!1;if(q||!q&&!W){let P="an error";if(J instanceof Error)P="#{exp}";else if(J)P=M.getConstructorName(J);let D=z;if(z instanceof Error)D=z.toString();else if(typeof z==="string")D=z;else if(z&&(typeof z==="object"||typeof z==="function"))try{D=M.getConstructorName(z)}catch(T){}this.assert(F,"expected #{this} to throw "+P,"expected #{this} to not throw an error but #{act} was thrown",J&&J.toString(),D)}if(J&&z){if(J instanceof Error){if(M.compatibleInstance(z,J)===W)if(B&&W)I=!0;else this.assert(W,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(z&&!W?" but #{act} was thrown":""),J.toString(),z.toString())}if(M.compatibleConstructor(z,J)===W)if(B&&W)I=!0;else this.assert(W,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(z?" but #{act} was thrown":""),J instanceof Error?J.toString():J&&M.getConstructorName(J),z instanceof Error?z.toString():z&&M.getConstructorName(z))}if(z&&Q!==void 0&&Q!==null){let P="including";if(XJ(Q))P="matching";if(M.compatibleMessage(z,Q)===W)if(B&&W)N=!0;else this.assert(W,"expected #{this} to throw error "+P+" #{exp} but got #{act}","expected #{this} to throw error not "+P+" #{exp}",Q,M.getMessage(z))}if(I&&N)this.assert(W,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(z?" but #{act} was thrown":""),J instanceof Error?J.toString():J&&M.getConstructorName(J),z instanceof Error?z.toString():z&&M.getConstructorName(z));V(this,"object",z)}K(BJ,"assertThrows");U.addMethod("throw",BJ);U.addMethod("throws",BJ);U.addMethod("Throw",BJ);function VQ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"itself"),$=typeof X==="function"&&!Y?X.prototype[J]:X[J];this.assert(typeof $==="function","expected #{this} to respond to "+S(J),"expected #{this} to not respond to "+S(J))}K(VQ,"respondTo");U.addMethod("respondTo",VQ);U.addMethod("respondsTo",VQ);U.addProperty("itself",function(){V(this,"itself",!0)});function zQ(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=J(X);this.assert(Y,"expected #{this} to satisfy "+h(J),"expected #{this} to not satisfy"+h(J),V(this,"negate")?!1:!0,Y)}K(zQ,"satisfy");U.addMethod("satisfy",zQ);U.addMethod("satisfies",zQ);function KQ(J,Q,X){if(X)V(this,"message",X);let Y=V(this,"object"),$=V(this,"message"),G=V(this,"ssfi");new U(Y,$,G,!0).is.numeric;let W="A `delta` value is required for `closeTo`";if(Q==null)throw new w($?`${$}: ${W}`:W,void 0,G);if(new U(Q,$,G,!0).is.numeric,W="A `expected` value is required for `closeTo`",J==null)throw new w($?`${$}: ${W}`:W,void 0,G);new U(J,$,G,!0).is.numeric;let z=K((q)=>q<0?-q:q,"abs"),F=K((q)=>parseFloat(parseFloat(q).toPrecision(12)),"strip");this.assert(F(z(Y-J))<=Q,"expected #{this} to be close to "+J+" +/- "+Q,"expected #{this} not to be close to "+J+" +/- "+Q)}K(KQ,"closeTo");U.addMethod("closeTo",KQ);U.addMethod("approximately",KQ);function qX(J,Q,X,Y,$){let G=Array.from(Q),W=Array.from(J);if(!Y){if(W.length!==G.length)return!1;G=G.slice()}return W.every(function(z,F){if($)return X?X(z,G[F]):z===G[F];if(!X){let q=G.indexOf(z);if(q===-1)return!1;if(!Y)G.splice(q,1);return!0}return G.some(function(q,B){if(!X(z,q))return!1;if(!Y)G.splice(B,1);return!0})})}K(qX,"isSubsetOf");U.addMethod("members",function(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"message"),$=V(this,"ssfi");new U(X,Y,$,!0).to.be.iterable,new U(J,Y,$,!0).to.be.iterable;let G=V(this,"contains"),W=V(this,"ordered"),z,F,q;if(G)z=W?"an ordered superset":"a superset",F="expected #{this} to be "+z+" of #{exp}",q="expected #{this} to not be "+z+" of #{exp}";else z=W?"ordered members":"members",F="expected #{this} to have the same "+z+" as #{exp}",q="expected #{this} to not have the same "+z+" as #{exp}";let B=V(this,"deep")?V(this,"eql"):void 0;this.assert(qX(J,X,B,G,W),F,q,J,X,!0)});U.addProperty("iterable",function(J){if(J)V(this,"message",J);let Q=V(this,"object");this.assert(Q!=null&&Q[Symbol.iterator],"expected #{this} to be an iterable","expected #{this} to not be an iterable",Q)});function BX(J,Q){if(Q)V(this,"message",Q);let X=V(this,"object"),Y=V(this,"message"),$=V(this,"ssfi"),G=V(this,"contains"),W=V(this,"deep"),z=V(this,"eql");if(new U(J,Y,$,!0).to.be.an("array"),G)this.assert(J.some(function(F){return X.indexOf(F)>-1}),"expected #{this} to contain one of #{exp}","expected #{this} to not contain one of #{exp}",J,X);else if(W)this.assert(J.some(function(F){return z(X,F)}),"expected #{this} to deeply equal one of #{exp}","expected #{this} to deeply equal one of #{exp}",J,X);else this.assert(J.indexOf(X)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",J,X)}K(BX,"oneOf");U.addMethod("oneOf",BX);function FQ(J,Q,X){if(X)V(this,"message",X);let Y=V(this,"object"),$=V(this,"message"),G=V(this,"ssfi");new U(Y,$,G,!0).is.a("function");let W;if(!Q)new U(J,$,G,!0).is.a("function"),W=J();else new U(J,$,G,!0).to.have.property(Q),W=J[Q];Y();let z=Q===void 0||Q===null?J():J[Q],F=Q===void 0||Q===null?W:"."+Q;V(this,"deltaMsgObj",F),V(this,"initialDeltaValue",W),V(this,"finalDeltaValue",z),V(this,"deltaBehavior","change"),V(this,"realDelta",z!==W),this.assert(W!==z,"expected "+F+" to change","expected "+F+" to not change")}K(FQ,"assertChanges");U.addMethod("change",FQ);U.addMethod("changes",FQ);function qQ(J,Q,X){if(X)V(this,"message",X);let Y=V(this,"object"),$=V(this,"message"),G=V(this,"ssfi");new U(Y,$,G,!0).is.a("function");let W;if(!Q)new U(J,$,G,!0).is.a("function"),W=J();else new U(J,$,G,!0).to.have.property(Q),W=J[Q];new U(W,$,G,!0).is.a("number"),Y();let z=Q===void 0||Q===null?J():J[Q],F=Q===void 0||Q===null?W:"."+Q;V(this,"deltaMsgObj",F),V(this,"initialDeltaValue",W),V(this,"finalDeltaValue",z),V(this,"deltaBehavior","increase"),V(this,"realDelta",z-W),this.assert(z-W>0,"expected "+F+" to increase","expected "+F+" to not increase")}K(qQ,"assertIncreases");U.addMethod("increase",qQ);U.addMethod("increases",qQ);function BQ(J,Q,X){if(X)V(this,"message",X);let Y=V(this,"object"),$=V(this,"message"),G=V(this,"ssfi");new U(Y,$,G,!0).is.a("function");let W;if(!Q)new U(J,$,G,!0).is.a("function"),W=J();else new U(J,$,G,!0).to.have.property(Q),W=J[Q];new U(W,$,G,!0).is.a("number"),Y();let z=Q===void 0||Q===null?J():J[Q],F=Q===void 0||Q===null?W:"."+Q;V(this,"deltaMsgObj",F),V(this,"initialDeltaValue",W),V(this,"finalDeltaValue",z),V(this,"deltaBehavior","decrease"),V(this,"realDelta",W-z),this.assert(z-W<0,"expected "+F+" to decrease","expected "+F+" to not decrease")}K(BQ,"assertDecreases");U.addMethod("decrease",BQ);U.addMethod("decreases",BQ);function IX(J,Q){if(Q)V(this,"message",Q);let X=V(this,"deltaMsgObj"),Y=V(this,"initialDeltaValue"),$=V(this,"finalDeltaValue"),G=V(this,"deltaBehavior"),W=V(this,"realDelta"),z;if(G==="change")z=Math.abs($-Y)===Math.abs(J);else z=W===Math.abs(J);this.assert(z,"expected "+X+" to "+G+" by "+J,"expected "+X+" to not "+G+" by "+J)}K(IX,"assertDelta");U.addMethod("by",IX);U.addProperty("extensible",function(){let J=V(this,"object"),Q=J===Object(J)&&Object.isExtensible(J);this.assert(Q,"expected #{thi