twd-js
Version:
Test While Developing (TWD) - in-browser testing
2 lines • 341 kB
JavaScript
(function(de,ke){typeof exports=="object"&&typeof module<"u"?ke(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],ke):(de=typeof globalThis<"u"?globalThis:de||self,ke(de.TWD={},de.React))})(this,(function(de,ke){"use strict";var Rt,wt;const Sp=(e,t=2e3,r=50)=>new Promise((n,o)=>{const a=Date.now(),i=()=>{const s=e();if(s)return n(s);if(Date.now()-a>t)return o(new Error("Timeout waiting for element"));setTimeout(i,r)};i()}),Op=(e,t=2e3,r=50)=>new Promise((n,o)=>{const a=Date.now(),i=()=>{const s=e();if(s&&s.length>0)return n(Array.from(s));if(Date.now()-a>t)return o(new Error("Timeout waiting for elements"));setTimeout(i,r)};i()}),Ko=e=>new Promise(t=>setTimeout(t,e)),Qe=[];let Ua=[];const za=(e,t,r={})=>{Qe.push({name:e,fn:t,status:"idle",logs:[],suite:[...Ua],...r})},Ap=e=>{Ua.push(e)},Mp=()=>{Ua.pop()},ge=(e,t,r,n)=>{if(!e&&!t)throw new Error(n);if(e&&t)throw new Error(n.replace("to be","to not be").replace("to have","to not have").replace("to contain","to not contain"));return r};function Ip(e){if(!e.isConnected)return!1;let t=e;for(;t;){const r=getComputedStyle(t);if(r.display==="none"||r.visibility==="hidden"||r.visibility==="collapse")return!1;t=t.parentElement}return!0}const Ss=(e,t,...r)=>{const n=t.startsWith("not."),o=n?t.slice(4):t,a=(e.textContent||"").trim();switch(o){case"have.text":return ge(a===r[0],n,`Assertion passed: Text is exactly "${r[0]}"`,`Assertion failed: Expected text to be "${r[0]}", but got "${a}"`);case"contain.text":return ge(a.includes(r[0]),n,`Assertion passed: Text contains "${r[0]}"`,`Assertion failed: Expected text to contain "${r[0]}", but got "${a}"`);case"be.empty":return ge(a.length===0,n,"Assertion passed: Text is empty",`Assertion failed: Expected text to be empty, but got "${a}"`);case"have.attr":return ge(e.getAttribute(r[0])===r[1],n,`Assertion passed: Attribute "${r[0]}" is "${r[1]}"`,`Assertion failed: Expected attribute "${r[0]}" to be "${r[1]}", but got "${e.getAttribute(r[0])}"`);case"have.value":return ge(e.value===r[0],n,`Assertion passed: Value is "${r[0]}"`,`Assertion failed: Expected value to be "${r[0]}", but got "${e.value}"`);case"be.disabled":return ge(e.disabled===!0,n,"Assertion passed: Element is disabled","Assertion failed: Expected element to be disabled");case"be.enabled":return ge(e.disabled===!1,n,"Assertion passed: Element is enabled","Assertion failed: Expected element to be enabled");case"be.checked":return ge(e.checked===!0,n,"Assertion passed: Element is checked","Assertion failed: Expected element to be checked");case"be.selected":return ge(e.selected===!0,n,"Assertion passed: Element is selected","Assertion failed: Expected element to be selected");case"be.focused":return ge(document.activeElement===e,n,"Assertion passed: Element is focused","Assertion failed: Expected element to be focused");case"be.visible":return ge(Ip(e),n,"Assertion passed: Element is visible","Assertion failed: Expected element to be visible");case"have.class":return ge(e.classList.contains(r[0]),n,`Assertion passed: Element has class "${r[0]}"`,`Assertion failed: Expected element to have class "${r[0]}"`);default:throw new Error(`Unknown assertion: ${o}`)}},st=e=>{const t=Qe.find(r=>r.status==="running");t&&t.logs?.push(e)},lt=[],Os=100,Np=async()=>{"serviceWorker"in navigator&&(await navigator.serviceWorker.register("/mock-sw.js?v=1"),navigator.serviceWorker.addEventListener("message",e=>{if(e.data?.type==="EXECUTED"){const{alias:t,request:r}=e.data,n=lt.find(o=>o.alias===t);n&&(n.executed=!0,n.request=r)}}))},kp=async(e,t)=>{const r={alias:e,...t,executed:!1},n=lt.findIndex(o=>o.alias===e);n!==-1?lt[n]=r:lt.push(r),navigator.serviceWorker.controller?.postMessage({type:"ADD_RULE",rule:r}),await Ko(Os),await Promise.resolve()},Dp=async e=>await Promise.all(e.map(r=>As(r))),As=async e=>{await Ko(Os);const t=lt.find(r=>r.alias===e&&r.executed);if(!t)throw new Error(`Rule ${e} not found or not executed`);return Promise.resolve(t)},jp=()=>lt,Bp=()=>{navigator.serviceWorker.controller?.postMessage({type:"CLEAR_RULES"}),lt.length=0},Lp=(e,t)=>{const r=e.startsWith("not.");switch(r?e.slice(4):e){case"eq":return ge(window.location.href===t,r,`Assertion passed: URL is ${t}`,`Assertion failed: Expected URL to be ${t}, but got ${window.location.href}`);case"contain.url":return ge(window.location.href.includes(t),r,`Assertion passed: URL contains ${t}`,`Assertion failed: Expected URL to contain ${t}, but got ${window.location.href}`);default:throw new Error(`Unknown assertion: ${e}`)}},$p=()=>({location:window.location,should:(e,t)=>{const r=Lp(e,t);return st(r),r}}),Fp=100,Up=async e=>{st(`visit("${e}")`),window.history.pushState({},"",e),window.dispatchEvent(new PopStateEvent("popstate")),await Ko(Fp)};let Dt=null;const zp=e=>{Dt=e},Vp=(e,t)=>{Ap(e),t(),Mp()},Hp=(e,t)=>{za(e,async()=>{Dt&&await Dt(),await t()})},Wp=(e,t)=>{za(e,async()=>{Dt&&await Dt(),await t()},{only:!0})},Gp=(e,t)=>{za(e,async()=>{},{skip:!0})},Kp={get:async e=>{st(`Searching get("${e}")`);const t=await Sp(()=>document.querySelector(e)),r={el:t,should:(n,...o)=>{const a=Ss(t,n,...o);return st(a),r}};return r},getAll:async e=>(st(`Searching getAll("${e}")`),(await Op(()=>document.querySelectorAll(e))).map(r=>{const n={el:r,should:(o,...a)=>{const i=Ss(r,o,...a);return st(i),n}};return n})),visit:Up,url:$p,mockRequest:kp,waitForRequest:As,waitForRequests:Dp,initRequestMocking:Np,clearRequestMockRules:Bp,getRequestMockRules:jp,wait:Ko};var Ms=Object.defineProperty,x=(e,t)=>Ms(e,"name",{value:t,configurable:!0}),Va=(e,t)=>{for(var r in t)Ms(e,r,{get:t[r],enumerable:!0})},Yo={};Va(Yo,{addChainableMethod:()=>gi,addLengthGuard:()=>Ft,addMethod:()=>bi,addProperty:()=>hi,checkError:()=>we,compareByInspect:()=>ra,eql:()=>cl,expectTypes:()=>Ls,flag:()=>z,getActual:()=>Jo,getMessage:()=>ti,getName:()=>oa,getOperator:()=>Ci,getOwnEnumerableProperties:()=>Ei,getOwnEnumerablePropertySymbols:()=>wi,getPathInfo:()=>mi,hasProperty:()=>ta,inspect:()=>G,isNaN:()=>na,isNumeric:()=>se,isProxyEnabled:()=>$t,isRegExp:()=>aa,objDisplay:()=>ut,overwriteChainableMethod:()=>Ri,overwriteMethod:()=>yi,overwriteProperty:()=>vi,proxify:()=>xt,test:()=>Ha,transferFlags:()=>Te,type:()=>ee});var we={};Va(we,{compatibleConstructor:()=>ks,compatibleInstance:()=>Ns,compatibleMessage:()=>Ds,getConstructorName:()=>js,getMessage:()=>Bs});function Xo(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}x(Xo,"isErrorInstance");function Is(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(Is,"isRegExp");function Ns(e,t){return Xo(t)&&e===t}x(Ns,"compatibleInstance");function ks(e,t){return Xo(t)?e.constructor===t.constructor||e instanceof t.constructor:(typeof t=="object"||typeof t=="function")&&t.prototype?e.constructor===t||e instanceof t:!1}x(ks,"compatibleConstructor");function Ds(e,t){const r=typeof e=="string"?e:e.message;return Is(t)?t.test(r):typeof t=="string"?r.indexOf(t)!==-1:!1}x(Ds,"compatibleMessage");function js(e){let t=e;return Xo(e)?t=e.constructor.name:typeof e=="function"&&(t=e.name,t===""&&(t=new e().name||t)),t}x(js,"getConstructorName");function Bs(e){let t="";return e&&e.message?t=e.message:typeof e=="string"&&(t=e),t}x(Bs,"getMessage");function z(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));if(arguments.length===3)n[t]=r;else return n[t]}x(z,"flag");function Ha(e,t){let r=z(e,"negate"),n=t[0];return r?!n:n}x(Ha,"test");function ee(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}x(ee,"type");var Yp="captureStackTrace"in Error,Y=(Rt=class extends Error{message;get name(){return"AssertionError"}get ok(){return!1}constructor(t="Unspecified AssertionError",r,n){super(t),this.message=t,Yp&&Error.captureStackTrace(this,n||Rt);for(const o in r)o in this||(this[o]=r[o])}toJSON(t){return{...this,name:this.name,message:this.message,ok:!1,stack:t!==!1?this.stack:void 0}}},x(Rt,"AssertionError"),Rt);function Ls(e,t){let r=z(e,"message"),n=z(e,"ssfi");r=r?r+": ":"",e=z(e,"object"),t=t.map(function(i){return i.toLowerCase()}),t.sort();let o=t.map(function(i,s){let l=~["a","e","i","o","u"].indexOf(i.charAt(0))?"an":"a";return(t.length>1&&s===t.length-1?"or ":"")+l+" "+i}).join(", "),a=ee(e).toLowerCase();if(!t.some(function(i){return a===i}))throw new Y(r+"object tested must be "+o+", but "+a+" given",void 0,n)}x(Ls,"expectTypes");function Jo(e,t){return t.length>4?t[4]:e._obj}x(Jo,"getActual");var $s={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"]},Xp={special:"cyan",number:"yellow",bigint:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",symbol:"green",date:"magenta",regexp:"red"},Et="…";function Fs(e,t){const r=$s[Xp[t]]||$s[t]||"";return r?`\x1B[${r[0]}m${String(e)}\x1B[${r[1]}m`:String(e)}x(Fs,"colorise");function Us({showHidden:e=!1,depth:t=2,colors:r=!1,customInspect:n=!0,showProxy:o=!1,maxArrayLength:a=1/0,breakLength:i=1/0,seen:s=[],truncate:l=1/0,stylize:u=String}={},f){const d={showHidden:!!e,depth:Number(t),colors:!!r,customInspect:!!n,showProxy:!!o,maxArrayLength:Number(a),breakLength:Number(i),truncate:Number(l),seen:s,inspect:f,stylize:u};return d.colors&&(d.stylize=Fs),d}x(Us,"normaliseOptions");function zs(e){return e>="\uD800"&&e<="\uDBFF"}x(zs,"isHighSurrogate");function De(e,t,r=Et){e=String(e);const n=r.length,o=e.length;if(n>t&&o>n)return r;if(o>t&&o>n){let a=t-n;return a>0&&zs(e[a-1])&&(a=a-1),`${e.slice(0,a)}${r}`}return e}x(De,"truncate");function xe(e,t,r,n=", "){r=r||t.inspect;const o=e.length;if(o===0)return"";const a=t.truncate;let i="",s="",l="";for(let u=0;u<o;u+=1){const f=u+1===e.length,d=u+2===e.length;l=`${Et}(${e.length-u})`;const c=e[u];t.truncate=a-i.length-(f?0:n.length);const h=s||r(c,t)+(f?"":n),v=i.length+h.length,R=v+l.length;if(f&&v>a&&i.length+l.length<=a||!f&&!d&&R>a||(s=f?"":r(e[u+1],t)+(d?"":n),!f&&d&&R>a&&v+s.length>a))break;if(i+=h,!f&&!d&&v+s.length>=a){l=`${Et}(${e.length-u-1})`;break}l=""}return`${i}${l}`}x(xe,"inspectList");function Vs(e){return e.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)?e:JSON.stringify(e).replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'")}x(Vs,"quoteComplexKey");function Ct([e,t],r){return r.truncate-=2,typeof e=="string"?e=Vs(e):typeof e!="number"&&(e=`[${r.inspect(e,r)}]`),r.truncate-=e.length,t=r.inspect(t,r),`${e}: ${t}`}x(Ct,"inspectProperty");function Hs(e,t){const r=Object.keys(e).slice(e.length);if(!e.length&&!r.length)return"[]";t.truncate-=4;const n=xe(e,t);t.truncate-=n.length;let o="";return r.length&&(o=xe(r.map(a=>[a,e[a]]),t,Ct)),`[ ${n}${o?`, ${o}`:""} ]`}x(Hs,"inspectArray");var Jp=x(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag]?e[Symbol.toStringTag]:e.constructor.name,"getArrayName");function Oe(e,t){const r=Jp(e);t.truncate-=r.length+4;const n=Object.keys(e).slice(e.length);if(!e.length&&!n.length)return`${r}[]`;let o="";for(let i=0;i<e.length;i++){const s=`${t.stylize(De(e[i],t.truncate),"number")}${i===e.length-1?"":", "}`;if(t.truncate-=s.length,e[i]!==e.length&&t.truncate<=3){o+=`${Et}(${e.length-e[i]+1})`;break}o+=s}let a="";return n.length&&(a=xe(n.map(i=>[i,e[i]]),t,Ct)),`${r}[ ${o}${a?`, ${a}`:""} ]`}x(Oe,"inspectTypedArray");function Ws(e,t){const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),o=n[0];return t.stylize(`${o}T${De(n[1],t.truncate-o.length-1)}`,"date")}x(Ws,"inspectDate");function Wa(e,t){const r=e[Symbol.toStringTag]||"Function",n=e.name;return n?t.stylize(`[${r} ${De(n,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")}x(Wa,"inspectFunction");function Gs([e,t],r){return r.truncate-=4,e=r.inspect(e,r),r.truncate-=e.length,t=r.inspect(t,r),`${e} => ${t}`}x(Gs,"inspectMapEntry");function Ks(e){const t=[];return e.forEach((r,n)=>{t.push([n,r])}),t}x(Ks,"mapToEntries");function Ys(e,t){return e.size===0?"Map{}":(t.truncate-=7,`Map{ ${xe(Ks(e),t,Gs)} }`)}x(Ys,"inspectMap");var Qp=Number.isNaN||(e=>e!==e);function Ga(e,t){return Qp(e)?t.stylize("NaN","number"):e===1/0?t.stylize("Infinity","number"):e===-1/0?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===1/0?"+0":"-0","number"):t.stylize(De(String(e),t.truncate),"number")}x(Ga,"inspectNumber");function Ka(e,t){let r=De(e.toString(),t.truncate-1);return r!==Et&&(r+="n"),t.stylize(r,"bigint")}x(Ka,"inspectBigInt");function Xs(e,t){const r=e.toString().split("/")[2],n=t.truncate-(2+r.length),o=e.source;return t.stylize(`/${De(o,n)}/${r}`,"regexp")}x(Xs,"inspectRegExp");function Js(e){const t=[];return e.forEach(r=>{t.push(r)}),t}x(Js,"arrayFromSet");function Qs(e,t){return e.size===0?"Set{}":(t.truncate-=7,`Set{ ${xe(Js(e),t)} }`)}x(Qs,"inspectSet");var Zs=new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]","g"),Zp={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","'":"\\'","\\":"\\\\"},em=16;function el(e){return Zp[e]||`\\u${`0000${e.charCodeAt(0).toString(em)}`.slice(-4)}`}x(el,"escape");function Ya(e,t){return Zs.test(e)&&(e=e.replace(Zs,el)),t.stylize(`'${De(e,t.truncate-2)}'`,"string")}x(Ya,"inspectString");function Xa(e){return"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString()}x(Xa,"inspectSymbol");var tm=x(()=>"Promise{…}","getPromiseValue"),rm=tm;function jt(e,t){const r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[];if(r.length===0&&n.length===0)return"{}";if(t.truncate-=4,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const o=xe(r.map(s=>[s,e[s]]),t,Ct),a=xe(n.map(s=>[s,e[s]]),t,Ct);t.seen.pop();let i="";return o&&a&&(i=", "),`{ ${o}${i}${a} }`}x(jt,"inspectObject");var Ja=typeof Symbol<"u"&&Symbol.toStringTag?Symbol.toStringTag:!1;function tl(e,t){let r="";return Ja&&Ja in e&&(r=e[Ja]),r=r||e.constructor.name,(!r||r==="_class")&&(r="<Anonymous Class>"),t.truncate-=r.length,`${r}${jt(e,t)}`}x(tl,"inspectClass");function rl(e,t){return e.length===0?"Arguments[]":(t.truncate-=13,`Arguments[ ${xe(e,t)} ]`)}x(rl,"inspectArguments");var nm=["stack","line","column","name","message","fileName","lineNumber","columnNumber","number","description","cause"];function nl(e,t){const r=Object.getOwnPropertyNames(e).filter(i=>nm.indexOf(i)===-1),n=e.name;t.truncate-=n.length;let o="";if(typeof e.message=="string"?o=De(e.message,t.truncate):r.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5,t.seen=t.seen||[],t.seen.includes(e))return"[Circular]";t.seen.push(e);const a=xe(r.map(i=>[i,e[i]]),t,Ct);return`${n}${o}${a?` { ${a} }`:""}`}x(nl,"inspectObject");function ol([e,t],r){return r.truncate-=3,t?`${r.stylize(String(e),"yellow")}=${r.stylize(`"${t}"`,"string")}`:`${r.stylize(String(e),"yellow")}`}x(ol,"inspectAttribute");function Qo(e,t){return xe(e,t,al,`
`)}x(Qo,"inspectNodeCollection");function al(e,t){switch(e.nodeType){case 1:return Qa(e,t);case 3:return t.inspect(e.data,t);default:return t.inspect(e,t)}}x(al,"inspectNode");function Qa(e,t){const r=e.getAttributeNames(),n=e.tagName.toLowerCase(),o=t.stylize(`<${n}`,"special"),a=t.stylize(">","special"),i=t.stylize(`</${n}>`,"special");t.truncate-=n.length*2+5;let s="";r.length>0&&(s+=" ",s+=xe(r.map(f=>[f,e.getAttribute(f)]),t,ol," ")),t.truncate-=s.length;const l=t.truncate;let u=Qo(e.children,t);return u&&u.length>l&&(u=`${Et}(${e.children.length})`),`${o}${s}${a}${u}${i}`}x(Qa,"inspectHTML");var om=typeof Symbol=="function"&&typeof Symbol.for=="function",Za=om?Symbol.for("chai/inspect"):"@@chai/inspect",ei=Symbol.for("nodejs.util.inspect.custom"),il=new WeakMap,sl={},ll={undefined:x((e,t)=>t.stylize("undefined","undefined"),"undefined"),null:x((e,t)=>t.stylize("null","null"),"null"),boolean:x((e,t)=>t.stylize(String(e),"boolean"),"boolean"),Boolean:x((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),number:Ga,Number:Ga,bigint:Ka,BigInt:Ka,string:Ya,String:Ya,function:Wa,Function:Wa,symbol:Xa,Symbol:Xa,Array:Hs,Date:Ws,Map:Ys,Set:Qs,RegExp:Xs,Promise:rm,WeakSet:x((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet"),WeakMap:x((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),Arguments:rl,Int8Array:Oe,Uint8Array:Oe,Uint8ClampedArray:Oe,Int16Array:Oe,Uint16Array:Oe,Int32Array:Oe,Uint32Array:Oe,Float32Array:Oe,Float64Array:Oe,Generator:x(()=>"","Generator"),DataView:x(()=>"","DataView"),ArrayBuffer:x(()=>"","ArrayBuffer"),Error:nl,HTMLCollection:Qo,NodeList:Qo},am=x((e,t,r)=>Za in e&&typeof e[Za]=="function"?e[Za](t):ei in e&&typeof e[ei]=="function"?e[ei](t.depth,t):"inspect"in e&&typeof e.inspect=="function"?e.inspect(t.depth,t):"constructor"in e&&il.has(e.constructor)?il.get(e.constructor)(e,t):sl[r]?sl[r](e,t):"","inspectCustom"),im=Object.prototype.toString;function Zo(e,t={}){const r=Us(t,Zo),{customInspect:n}=r;let o=e===null?"null":typeof e;if(o==="object"&&(o=im.call(e).slice(8,-1)),o in ll)return ll[o](e,r);if(n&&e){const i=am(e,r,o);if(i)return typeof i=="string"?i:Zo(i,r)}const a=e?Object.getPrototypeOf(e):!1;return a===Object.prototype||a===null?jt(e,r):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Qa(e,r):"constructor"in e?e.constructor!==Object?tl(e,r):jt(e,r):e===Object(e)?jt(e,r):r.stylize(String(e),o)}x(Zo,"inspect");var fe={includeStack:!1,showDiff:!0,truncateThreshold:40,useProxy:!0,proxyExcludedKeys:["then","catch","inspect","toJSON"],deepEqual:null};function G(e,t,r,n){let o={colors:n,depth:typeof r>"u"?2:r,showHidden:t,truncate:fe.truncateThreshold?fe.truncateThreshold:1/0};return Zo(e,o)}x(G,"inspect");function ut(e){let t=G(e),r=Object.prototype.toString.call(e);if(fe.truncateThreshold&&t.length>=fe.truncateThreshold){if(r==="[object Function]")return!e.name||e.name===""?"[Function]":"[Function: "+e.name+"]";if(r==="[object Array]")return"[ Array("+e.length+") ]";if(r==="[object Object]"){let n=Object.keys(e);return"{ Object ("+(n.length>2?n.splice(0,2).join(", ")+", ...":n.join(", "))+") }"}else return t}else return t}x(ut,"objDisplay");function ti(e,t){let r=z(e,"negate"),n=z(e,"object"),o=t[3],a=Jo(e,t),i=r?t[2]:t[1],s=z(e,"message");return typeof i=="function"&&(i=i()),i=i||"",i=i.replace(/#\{this\}/g,function(){return ut(n)}).replace(/#\{act\}/g,function(){return ut(a)}).replace(/#\{exp\}/g,function(){return ut(o)}),s?s+": "+i:i}x(ti,"getMessage");function Te(e,t,r){let n=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),r=arguments.length===3?r:!0;for(let o in n)(r||o!=="object"&&o!=="ssfi"&&o!=="lockSsfi"&&o!="message")&&(t.__flags[o]=n[o])}x(Te,"transferFlags");function ri(e){if(typeof e>"u")return"undefined";if(e===null)return"null";const t=e[Symbol.toStringTag];return typeof t=="string"?t:Object.prototype.toString.call(e).slice(8,-1)}x(ri,"type");function ni(){this._key="chai/deep-eql__"+Math.random()+Date.now()}x(ni,"FakeMap"),ni.prototype={get:x(function(t){return t[this._key]},"get"),set:x(function(t,r){Object.isExtensible(t)&&Object.defineProperty(t,this._key,{value:r,configurable:!0})},"set")};var ul=typeof WeakMap=="function"?WeakMap:ni;function oi(e,t,r){if(!r||ct(e)||ct(t))return null;var n=r.get(e);if(n){var o=n.get(t);if(typeof o=="boolean")return o}return null}x(oi,"memoizeCompare");function Bt(e,t,r,n){if(!(!r||ct(e)||ct(t))){var o=r.get(e);o?o.set(t,n):(o=new ul,o.set(t,n),r.set(e,o))}}x(Bt,"memoizeSet");var cl=Lt;function Lt(e,t,r){if(r&&r.comparator)return ii(e,t,r);var n=ai(e,t);return n!==null?n:ii(e,t,r)}x(Lt,"deepEqual");function ai(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t?!0:ct(e)||ct(t)?!1:null}x(ai,"simpleEqual");function ii(e,t,r){r=r||{},r.memoize=r.memoize===!1?!1:r.memoize||new ul;var n=r&&r.comparator,o=oi(e,t,r.memoize);if(o!==null)return o;var a=oi(t,e,r.memoize);if(a!==null)return a;if(n){var i=n(e,t);if(i===!1||i===!0)return Bt(e,t,r.memoize,i),i;var s=ai(e,t);if(s!==null)return s}var l=ri(e);if(l!==ri(t))return Bt(e,t,r.memoize,!1),!1;Bt(e,t,r.memoize,!0);var u=dl(e,t,l,r);return Bt(e,t,r.memoize,u),u}x(ii,"extensiveDeepEqual");function dl(e,t,r,n){switch(r){case"String":case"Number":case"Boolean":case"Date":return Lt(e.valueOf(),t.valueOf());case"Promise":case"Symbol":case"function":case"WeakMap":case"WeakSet":return e===t;case"Error":return di(e,t,["name","message","code"],n);case"Arguments":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"Array":return Ze(e,t,n);case"RegExp":return fl(e,t);case"Generator":return pl(e,t,n);case"DataView":return Ze(new Uint8Array(e.buffer),new Uint8Array(t.buffer),n);case"ArrayBuffer":return Ze(new Uint8Array(e),new Uint8Array(t),n);case"Set":return si(e,t,n);case"Map":return si(e,t,n);case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.Instant":case"Temporal.ZonedDateTime":case"Temporal.PlainYearMonth":case"Temporal.PlainMonthDay":return e.equals(t);case"Temporal.Duration":return e.total("nanoseconds")===t.total("nanoseconds");case"Temporal.TimeZone":case"Temporal.Calendar":return e.toString()===t.toString();default:return hl(e,t,n)}}x(dl,"extensiveDeepEqualByType");function fl(e,t){return e.toString()===t.toString()}x(fl,"regexpEqual");function si(e,t,r){try{if(e.size!==t.size)return!1;if(e.size===0)return!0}catch{return!1}var n=[],o=[];return e.forEach(x(function(i,s){n.push([i,s])},"gatherEntries")),t.forEach(x(function(i,s){o.push([i,s])},"gatherEntries")),Ze(n.sort(),o.sort(),r)}x(si,"entriesEqual");function Ze(e,t,r){var n=e.length;if(n!==t.length)return!1;if(n===0)return!0;for(var o=-1;++o<n;)if(Lt(e[o],t[o],r)===!1)return!1;return!0}x(Ze,"iterableEqual");function pl(e,t,r){return Ze(ea(e),ea(t),r)}x(pl,"generatorEqual");function ml(e){return typeof Symbol<"u"&&typeof e=="object"&&typeof Symbol.iterator<"u"&&typeof e[Symbol.iterator]=="function"}x(ml,"hasIteratorFunction");function li(e){if(ml(e))try{return ea(e[Symbol.iterator]())}catch{return[]}return[]}x(li,"getIteratorEntries");function ea(e){for(var t=e.next(),r=[t.value];t.done===!1;)t=e.next(),r.push(t.value);return r}x(ea,"getGeneratorEntries");function ui(e){var t=[];for(var r in e)t.push(r);return t}x(ui,"getEnumerableKeys");function ci(e){for(var t=[],r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n+=1){var o=r[n];Object.getOwnPropertyDescriptor(e,o).enumerable&&t.push(o)}return t}x(ci,"getEnumerableSymbols");function di(e,t,r,n){var o=r.length;if(o===0)return!0;for(var a=0;a<o;a+=1)if(Lt(e[r[a]],t[r[a]],n)===!1)return!1;return!0}x(di,"keysEqual");function hl(e,t,r){var n=ui(e),o=ui(t),a=ci(e),i=ci(t);if(n=n.concat(a),o=o.concat(i),n.length&&n.length===o.length)return Ze(fi(n).sort(),fi(o).sort())===!1?!1:di(e,t,n,r);var s=li(e),l=li(t);return s.length&&s.length===l.length?(s.sort(),l.sort(),Ze(s,l,r)):n.length===0&&s.length===0&&o.length===0&&l.length===0}x(hl,"objectEqual");function ct(e){return e===null||typeof e!="object"}x(ct,"isPrimitive");function fi(e){return e.map(x(function(r){return typeof r=="symbol"?r.toString():r},"mapSymbol"))}x(fi,"mapSymbols");function ta(e,t){return typeof e>"u"||e===null?!1:t in Object(e)}x(ta,"hasProperty");function bl(e){return e.replace(/([^\\])\[/g,"$1.[").match(/(\\\.|[^.]+?)+/g).map(n=>{if(n==="constructor"||n==="__proto__"||n==="prototype")return{};const a=/^\[(\d+)\]$/.exec(n);let i=null;return a?i={i:parseFloat(a[1])}:i={p:n.replace(/\\([.[\]])/g,"$1")},i})}x(bl,"parsePath");function pi(e,t,r){let n=e,o=null;r=typeof r>"u"?t.length:r;for(let a=0;a<r;a++){const i=t[a];n&&(typeof i.p>"u"?n=n[i.i]:n=n[i.p],a===r-1&&(o=n))}return o}x(pi,"internalGetPathValue");function mi(e,t){const r=bl(t),n=r[r.length-1],o={parent:r.length>1?pi(e,r,r.length-1):e,name:n.p||n.i,value:pi(e,r)};return o.exists=ta(o.parent,o.name),o}x(mi,"getPathInfo");var b=(wt=class{__flags={};constructor(t,r,n,o){return z(this,"ssfi",n||wt),z(this,"lockSsfi",o),z(this,"object",t),z(this,"message",r),z(this,"eql",fe.deepEqual||cl),xt(this)}static get includeStack(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),fe.includeStack}static set includeStack(t){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),fe.includeStack=t}static get showDiff(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),fe.showDiff}static set showDiff(t){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),fe.showDiff=t}static addProperty(t,r){hi(this.prototype,t,r)}static addMethod(t,r){bi(this.prototype,t,r)}static addChainableMethod(t,r,n){gi(this.prototype,t,r,n)}static overwriteProperty(t,r){vi(this.prototype,t,r)}static overwriteMethod(t,r){yi(this.prototype,t,r)}static overwriteChainableMethod(t,r,n){Ri(this.prototype,t,r,n)}assert(t,r,n,o,a,i){const s=Ha(this,arguments);if(i!==!1&&(i=!0),o===void 0&&a===void 0&&(i=!1),fe.showDiff!==!0&&(i=!1),!s){r=ti(this,arguments);const u={actual:Jo(this,arguments),expected:o,showDiff:i},f=Ci(this,arguments);throw f&&(u.operator=f),new Y(r,u,fe.includeStack?this.assert:z(this,"ssfi"))}}get _obj(){return z(this,"object")}set _obj(t){z(this,"object",t)}},x(wt,"Assertion"),wt);function $t(){return fe.useProxy&&typeof Proxy<"u"&&typeof Reflect<"u"}x($t,"isProxyEnabled");function hi(e,t,r){r=r===void 0?function(){}:r,Object.defineProperty(e,t,{get:x(function n(){!$t()&&!z(this,"lockSsfi")&&z(this,"ssfi",n);let o=r.call(this);if(o!==void 0)return o;let a=new b;return Te(this,a),a},"propertyGetter"),configurable:!0})}x(hi,"addProperty");var sm=Object.getOwnPropertyDescriptor(function(){},"length");function Ft(e,t,r){return sm.configurable&&Object.defineProperty(e,"length",{get:x(function(){throw Error(r?"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+'".')},"get")}),e}x(Ft,"addLengthGuard");function vl(e){let t=Object.getOwnPropertyNames(e);function r(o){t.indexOf(o)===-1&&t.push(o)}x(r,"addProperty");let n=Object.getPrototypeOf(e);for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r),n=Object.getPrototypeOf(n);return t}x(vl,"getProperties");var yl=["__flags","__methods","_obj","assert"];function xt(e,t){return $t()?new Proxy(e,{get:x(function r(n,o){if(typeof o=="string"&&fe.proxyExcludedKeys.indexOf(o)===-1&&!Reflect.has(n,o)){if(t)throw Error("Invalid Chai property: "+t+"."+o+'. See docs for proper usage of "'+t+'".');let a=null,i=4;throw vl(n).forEach(function(s){if(!Object.prototype.hasOwnProperty(s)&&yl.indexOf(s)===-1){let l=gl(o,s,i);l<i&&(a=s,i=l)}}),Error(a!==null?"Invalid Chai property: "+o+'. Did you mean "'+a+'"?':"Invalid Chai property: "+o)}return yl.indexOf(o)===-1&&!z(n,"lockSsfi")&&z(n,"ssfi",r),Reflect.get(n,o)},"proxyGetter")}):e}x(xt,"proxify");function gl(e,t,r){if(Math.abs(e.length-t.length)>=r)return r;let n=[];for(let o=0;o<=e.length;o++)n[o]=Array(t.length+1).fill(0),n[o][0]=o;for(let o=0;o<t.length;o++)n[0][o]=o;for(let o=1;o<=e.length;o++){let a=e.charCodeAt(o-1);for(let i=1;i<=t.length;i++){if(Math.abs(o-i)>=r){n[o][i]=r;continue}n[o][i]=Math.min(n[o-1][i]+1,n[o][i-1]+1,n[o-1][i-1]+(a===t.charCodeAt(i-1)?0:1))}}return n[e.length][t.length]}x(gl,"stringDistanceCapped");function bi(e,t,r){let n=x(function(){z(this,"lockSsfi")||z(this,"ssfi",n);let o=r.apply(this,arguments);if(o!==void 0)return o;let a=new b;return Te(this,a),a},"methodWrapper");Ft(n,t,!1),e[t]=xt(n,t)}x(bi,"addMethod");function vi(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t),o=x(function(){},"_super");n&&typeof n.get=="function"&&(o=n.get),Object.defineProperty(e,t,{get:x(function a(){!$t()&&!z(this,"lockSsfi")&&z(this,"ssfi",a);let i=z(this,"lockSsfi");z(this,"lockSsfi",!0);let s=r(o).call(this);if(z(this,"lockSsfi",i),s!==void 0)return s;let l=new b;return Te(this,l),l},"overwritingPropertyGetter"),configurable:!0})}x(vi,"overwriteProperty");function yi(e,t,r){let n=e[t],o=x(function(){throw new Error(t+" is not a function")},"_super");n&&typeof n=="function"&&(o=n);let a=x(function(){z(this,"lockSsfi")||z(this,"ssfi",a);let i=z(this,"lockSsfi");z(this,"lockSsfi",!0);let s=r(o).apply(this,arguments);if(z(this,"lockSsfi",i),s!==void 0)return s;let l=new b;return Te(this,l),l},"overwritingMethodWrapper");Ft(a,t,!1),e[t]=xt(a,t)}x(yi,"overwriteMethod");var lm=typeof Object.setPrototypeOf=="function",Rl=x(function(){},"testFn"),um=Object.getOwnPropertyNames(Rl).filter(function(e){let t=Object.getOwnPropertyDescriptor(Rl,e);return typeof t!="object"?!0:!t.configurable}),cm=Function.prototype.call,dm=Function.prototype.apply;function gi(e,t,r,n){typeof n!="function"&&(n=x(function(){},"chainingBehavior"));let o={method:r,chainingBehavior:n};e.__methods||(e.__methods={}),e.__methods[t]=o,Object.defineProperty(e,t,{get:x(function(){o.chainingBehavior.call(this);let i=x(function(){z(this,"lockSsfi")||z(this,"ssfi",i);let s=o.method.apply(this,arguments);if(s!==void 0)return s;let l=new b;return Te(this,l),l},"chainableMethodWrapper");if(Ft(i,t,!0),lm){let s=Object.create(this);s.call=cm,s.apply=dm,Object.setPrototypeOf(i,s)}else Object.getOwnPropertyNames(e).forEach(function(l){if(um.indexOf(l)!==-1)return;let u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(i,l,u)});return Te(this,i),xt(i)},"chainableMethodGetter"),configurable:!0})}x(gi,"addChainableMethod");function Ri(e,t,r,n){let o=e.__methods[t],a=o.chainingBehavior;o.chainingBehavior=x(function(){let l=n(a).call(this);if(l!==void 0)return l;let u=new b;return Te(this,u),u},"overwritingChainableMethodGetter");let i=o.method;o.method=x(function(){let l=r(i).apply(this,arguments);if(l!==void 0)return l;let u=new b;return Te(this,u),u},"overwritingChainableMethodWrapper")}x(Ri,"overwriteChainableMethod");function ra(e,t){return G(e)<G(t)?-1:1}x(ra,"compareByInspect");function wi(e){return typeof Object.getOwnPropertySymbols!="function"?[]:Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}x(wi,"getOwnEnumerablePropertySymbols");function Ei(e){return Object.keys(e).concat(wi(e))}x(Ei,"getOwnEnumerableProperties");var na=Number.isNaN;function wl(e){let t=ee(e);return["Array","Object","Function"].indexOf(t)!==-1}x(wl,"isObjectType");function Ci(e,t){let r=z(e,"operator"),n=z(e,"negate"),o=t[3],a=n?t[2]:t[1];if(r)return r;if(typeof a=="function"&&(a=a()),a=a||"",!a||/\shave\s/.test(a))return;let i=wl(o);return/\snot\s/.test(a)?i?"notDeepStrictEqual":"notStrictEqual":i?"deepStrictEqual":"strictEqual"}x(Ci,"getOperator");function oa(e){return e.name}x(oa,"getName");function aa(e){return Object.prototype.toString.call(e)==="[object RegExp]"}x(aa,"isRegExp");function se(e){return["Number","BigInt"].includes(ee(e))}x(se,"isNumeric");var{flag:w}=Yo;["to","be","been","is","and","has","have","with","that","which","at","of","same","but","does","still","also"].forEach(function(e){b.addProperty(e)}),b.addProperty("not",function(){w(this,"negate",!0)}),b.addProperty("deep",function(){w(this,"deep",!0)}),b.addProperty("nested",function(){w(this,"nested",!0)}),b.addProperty("own",function(){w(this,"own",!0)}),b.addProperty("ordered",function(){w(this,"ordered",!0)}),b.addProperty("any",function(){w(this,"any",!0),w(this,"all",!1)}),b.addProperty("all",function(){w(this,"all",!0),w(this,"any",!1)});var El={function:["function","asyncfunction","generatorfunction","asyncgeneratorfunction"],asyncfunction:["asyncfunction","asyncgeneratorfunction"],generatorfunction:["generatorfunction","asyncgeneratorfunction"],asyncgeneratorfunction:["asyncgeneratorfunction"]};function xi(e,t){t&&w(this,"message",t),e=e.toLowerCase();let r=w(this,"object"),n=~["a","e","i","o","u"].indexOf(e.charAt(0))?"an ":"a ";const o=ee(r).toLowerCase();El.function.includes(e)?this.assert(El[e].includes(o),"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e):this.assert(e===o,"expected #{this} to be "+n+e,"expected #{this} not to be "+n+e)}x(xi,"an"),b.addChainableMethod("an",xi),b.addChainableMethod("a",xi);function Cl(e,t){return na(e)&&na(t)||e===t}x(Cl,"SameValueZero");function Ut(){w(this,"contains",!0)}x(Ut,"includeChainingBehavior");function zt(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=ee(r).toLowerCase(),o=w(this,"message"),a=w(this,"negate"),i=w(this,"ssfi"),s=w(this,"deep"),l=s?"deep ":"",u=s?w(this,"eql"):Cl;o=o?o+": ":"";let f=!1;switch(n){case"string":f=r.indexOf(e)!==-1;break;case"weakset":if(s)throw new Y(o+"unable to use .deep.include with WeakSet",void 0,i);f=r.has(e);break;case"map":r.forEach(function(d){f=f||u(d,e)});break;case"set":s?r.forEach(function(d){f=f||u(d,e)}):f=r.has(e);break;case"array":s?f=r.some(function(d){return u(d,e)}):f=r.indexOf(e)!==-1;break;default:{if(e!==Object(e))throw new Y(o+"the given combination of arguments ("+n+" and "+ee(e).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 "+ee(e).toLowerCase(),void 0,i);let d=Object.keys(e),c=null,h=0;if(d.forEach(function(v){let R=new b(r);if(Te(this,R,!0),w(R,"lockSsfi",!0),!a||d.length===1){R.property(v,e[v]);return}try{R.property(v,e[v])}catch(S){if(!we.compatibleConstructor(S,Y))throw S;c===null&&(c=S),h++}},this),a&&d.length>1&&h===d.length)throw c;return}}this.assert(f,"expected #{this} to "+l+"include "+G(e),"expected #{this} to not "+l+"include "+G(e))}x(zt,"include"),b.addChainableMethod("include",zt,Ut),b.addChainableMethod("contain",zt,Ut),b.addChainableMethod("contains",zt,Ut),b.addChainableMethod("includes",zt,Ut),b.addProperty("ok",function(){this.assert(w(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),b.addProperty("true",function(){this.assert(w(this,"object")===!0,"expected #{this} to be true","expected #{this} to be false",!w(this,"negate"))}),b.addProperty("numeric",function(){const e=w(this,"object");this.assert(["Number","BigInt"].includes(ee(e)),"expected #{this} to be numeric","expected #{this} to not be numeric",!w(this,"negate"))}),b.addProperty("callable",function(){const e=w(this,"object"),t=w(this,"ssfi"),r=w(this,"message"),n=r?`${r}: `:"",o=w(this,"negate"),a=o?`${n}expected ${G(e)} not to be a callable function`:`${n}expected ${G(e)} to be a callable function`,i=["Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"].includes(ee(e));if(i&&o||!i&&!o)throw new Y(a,void 0,t)}),b.addProperty("false",function(){this.assert(w(this,"object")===!1,"expected #{this} to be false","expected #{this} to be true",!!w(this,"negate"))}),b.addProperty("null",function(){this.assert(w(this,"object")===null,"expected #{this} to be null","expected #{this} not to be null")}),b.addProperty("undefined",function(){this.assert(w(this,"object")===void 0,"expected #{this} to be undefined","expected #{this} not to be undefined")}),b.addProperty("NaN",function(){this.assert(na(w(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")});function qi(){let e=w(this,"object");this.assert(e!=null,"expected #{this} to exist","expected #{this} to not exist")}x(qi,"assertExist"),b.addProperty("exist",qi),b.addProperty("exists",qi),b.addProperty("empty",function(){let e=w(this,"object"),t=w(this,"ssfi"),r=w(this,"message"),n;switch(r=r?r+": ":"",ee(e).toLowerCase()){case"array":case"string":n=e.length;break;case"map":case"set":n=e.size;break;case"weakmap":case"weakset":throw new Y(r+".empty was passed a weak collection",void 0,t);case"function":{const o=r+".empty was passed a function "+oa(e);throw new Y(o.trim(),void 0,t)}default:if(e!==Object(e))throw new Y(r+".empty was passed non-string primitive "+G(e),void 0,t);n=Object.keys(e).length}this.assert(n===0,"expected #{this} to be empty","expected #{this} not to be empty")});function _i(){let e=w(this,"object"),t=ee(e);this.assert(t==="Arguments","expected #{this} to be arguments but got "+t,"expected #{this} to not be arguments")}x(_i,"checkArguments"),b.addProperty("arguments",_i),b.addProperty("Arguments",_i);function ia(e,t){t&&w(this,"message",t);let r=w(this,"object");if(w(this,"deep")){let n=w(this,"lockSsfi");w(this,"lockSsfi",!0),this.eql(e),w(this,"lockSsfi",n)}else this.assert(e===r,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",e,this._obj,!0)}x(ia,"assertEqual"),b.addMethod("equal",ia),b.addMethod("equals",ia),b.addMethod("eq",ia);function Pi(e,t){t&&w(this,"message",t);let r=w(this,"eql");this.assert(r(e,w(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",e,this._obj,!0)}x(Pi,"assertEql"),b.addMethod("eql",Pi),b.addMethod("eqls",Pi);function sa(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),a=o?o+": ":"",i=w(this,"ssfi"),s=ee(r).toLowerCase(),l=ee(e).toLowerCase();if(n&&s!=="map"&&s!=="set"&&new b(r,o,i,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")throw new Y(a+"the argument to above must be a date",void 0,i);if(!se(e)&&(n||se(r)))throw new Y(a+"the argument to above must be a number",void 0,i);if(!n&&s!=="date"&&!se(r)){let u=s==="string"?"'"+r+"'":r;throw new Y(a+"expected "+u+" to be a number or a date",void 0,i)}if(n){let u="length",f;s==="map"||s==="set"?(u="size",f=r.size):f=r.length,this.assert(f>e,"expected #{this} to have a "+u+" above #{exp} but got #{act}","expected #{this} to not have a "+u+" above #{exp}",e,f)}else this.assert(r>e,"expected #{this} to be above #{exp}","expected #{this} to be at most #{exp}",e)}x(sa,"assertAbove"),b.addMethod("above",sa),b.addMethod("gt",sa),b.addMethod("greaterThan",sa);function la(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),a=o?o+": ":"",i=w(this,"ssfi"),s=ee(r).toLowerCase(),l=ee(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,o,i,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=a+"the argument to least must be a date";else if(!se(e)&&(n||se(r)))u=a+"the argument to least must be a number";else if(!n&&s!=="date"&&!se(r)){let d=s==="string"?"'"+r+"'":r;u=a+"expected "+d+" to be a number or a date"}else f=!1;if(f)throw new Y(u,void 0,i);if(n){let d="length",c;s==="map"||s==="set"?(d="size",c=r.size):c=r.length,this.assert(c>=e,"expected #{this} to have a "+d+" at least #{exp} but got #{act}","expected #{this} to have a "+d+" below #{exp}",e,c)}else this.assert(r>=e,"expected #{this} to be at least #{exp}","expected #{this} to be below #{exp}",e)}x(la,"assertLeast"),b.addMethod("least",la),b.addMethod("gte",la),b.addMethod("greaterThanOrEqual",la);function ua(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),a=o?o+": ":"",i=w(this,"ssfi"),s=ee(r).toLowerCase(),l=ee(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,o,i,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=a+"the argument to below must be a date";else if(!se(e)&&(n||se(r)))u=a+"the argument to below must be a number";else if(!n&&s!=="date"&&!se(r)){let d=s==="string"?"'"+r+"'":r;u=a+"expected "+d+" to be a number or a date"}else f=!1;if(f)throw new Y(u,void 0,i);if(n){let d="length",c;s==="map"||s==="set"?(d="size",c=r.size):c=r.length,this.assert(c<e,"expected #{this} to have a "+d+" below #{exp} but got #{act}","expected #{this} to not have a "+d+" below #{exp}",e,c)}else this.assert(r<e,"expected #{this} to be below #{exp}","expected #{this} to be at least #{exp}",e)}x(ua,"assertBelow"),b.addMethod("below",ua),b.addMethod("lt",ua),b.addMethod("lessThan",ua);function ca(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"doLength"),o=w(this,"message"),a=o?o+": ":"",i=w(this,"ssfi"),s=ee(r).toLowerCase(),l=ee(e).toLowerCase(),u,f=!0;if(n&&s!=="map"&&s!=="set"&&new b(r,o,i,!0).to.have.property("length"),!n&&s==="date"&&l!=="date")u=a+"the argument to most must be a date";else if(!se(e)&&(n||se(r)))u=a+"the argument to most must be a number";else if(!n&&s!=="date"&&!se(r)){let d=s==="string"?"'"+r+"'":r;u=a+"expected "+d+" to be a number or a date"}else f=!1;if(f)throw new Y(u,void 0,i);if(n){let d="length",c;s==="map"||s==="set"?(d="size",c=r.size):c=r.length,this.assert(c<=e,"expected #{this} to have a "+d+" at most #{exp} but got #{act}","expected #{this} to have a "+d+" above #{exp}",e,c)}else this.assert(r<=e,"expected #{this} to be at most #{exp}","expected #{this} to be above #{exp}",e)}x(ca,"assertMost"),b.addMethod("most",ca),b.addMethod("lte",ca),b.addMethod("lessThanOrEqual",ca),b.addMethod("within",function(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"doLength"),a=w(this,"message"),i=a?a+": ":"",s=w(this,"ssfi"),l=ee(n).toLowerCase(),u=ee(e).toLowerCase(),f=ee(t).toLowerCase(),d,c=!0,h=u==="date"&&f==="date"?e.toISOString()+".."+t.toISOString():e+".."+t;if(o&&l!=="map"&&l!=="set"&&new b(n,a,s,!0).to.have.property("length"),!o&&l==="date"&&(u!=="date"||f!=="date"))d=i+"the arguments to within must be dates";else if((!se(e)||!se(t))&&(o||se(n)))d=i+"the arguments to within must be numbers";else if(!o&&l!=="date"&&!se(n)){let v=l==="string"?"'"+n+"'":n;d=i+"expected "+v+" to be a number or a date"}else c=!1;if(c)throw new Y(d,void 0,s);if(o){let v="length",R;l==="map"||l==="set"?(v="size",R=n.size):R=n.length,this.assert(R>=e&&R<=t,"expected #{this} to have a "+v+" within "+h,"expected #{this} to not have a "+v+" within "+h)}else this.assert(n>=e&&n<=t,"expected #{this} to be within "+h,"expected #{this} to not be within "+h)});function Ti(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"ssfi"),o=w(this,"message"),a;try{a=r instanceof e}catch(s){throw s instanceof TypeError?(o=o?o+": ":"",new Y(o+"The instanceof assertion needs a constructor but "+ee(e)+" was given.",void 0,n)):s}let i=oa(e);i==null&&(i="an unnamed constructor"),this.assert(a,"expected #{this} to be an instance of "+i,"expected #{this} to not be an instance of "+i)}x(Ti,"assertInstanceOf"),b.addMethod("instanceof",Ti),b.addMethod("instanceOf",Ti);function Si(e,t,r){r&&w(this,"message",r);let n=w(this,"nested"),o=w(this,"own"),a=w(this,"message"),i=w(this,"object"),s=w(this,"ssfi"),l=typeof e;if(a=a?a+": ":"",n){if(l!=="string")throw new Y(a+"the argument to property must be a string when using nested syntax",void 0,s)}else if(l!=="string"&&l!=="number"&&l!=="symbol")throw new Y(a+"the argument to property must be a string, number, or symbol",void 0,s);if(n&&o)throw new Y(a+'The "nested" and "own" flags cannot be combined.',void 0,s);if(i==null)throw new Y(a+"Target cannot be null or undefined.",void 0,s);let u=w(this,"deep"),f=w(this,"negate"),d=n?mi(i,e):null,c=n?d.value:i[e],h=u?w(this,"eql"):(S,p)=>S===p,v="";u&&(v+="deep "),o&&(v+="own "),n&&(v+="nested "),v+="property ";let R;o?R=Object.prototype.hasOwnProperty.call(i,e):n?R=d.exists:R=ta(i,e),(!f||arguments.length===1)&&this.assert(R,"expected #{this} to have "+v+G(e),"expected #{this} to not have "+v+G(e)),arguments.length>1&&this.assert(R&&h(t,c),"expected #{this} to have "+v+G(e)+" of #{exp}, but got #{act}","expected #{this} to not have "+v+G(e)+" of #{act}",t,c),w(this,"object",c)}x(Si,"assertProperty"),b.addMethod("property",Si);function Oi(e,t,r){w(this,"own",!0),Si.apply(this,arguments)}x(Oi,"assertOwnProperty"),b.addMethod("ownProperty",Oi),b.addMethod("haveOwnProperty",Oi);function Ai(e,t,r){typeof t=="string"&&(r=t,t=null),r&&w(this,"message",r);let n=w(this,"object"),o=Object.getOwnPropertyDescriptor(Object(n),e),a=w(this,"eql");o&&t?this.assert(a(t,o),"expected the own property descriptor for "+G(e)+" on #{this} to match "+G(t)+", got "+G(o),"expected the own property descriptor for "+G(e)+" on #{this} to not match "+G(t),t,o,!0):this.assert(o,"expected #{this} to have an own property descriptor for "+G(e),"expected #{this} to not have an own property descriptor for "+G(e)),w(this,"object",o)}x(Ai,"assertOwnPropertyDescriptor"),b.addMethod("ownPropertyDescriptor",Ai),b.addMethod("haveOwnPropertyDescriptor",Ai);function Mi(){w(this,"doLength",!0)}x(Mi,"assertLengthChain");function Ii(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=ee(r).toLowerCase(),o=w(this,"message"),a=w(this,"ssfi"),i="length",s;switch(n){case"map":case"set":i="size",s=r.size;break;default:new b(r,o,a,!0).to.have.property("length"),s=r.length}this.assert(s==e,"expected #{this} to have a "+i+" of #{exp} but got #{act}","expected #{this} to not have a "+i+" of #{act}",e,s)}x(Ii,"assertLength"),b.addChainableMethod("length",Ii,Mi),b.addChainableMethod("lengthOf",Ii,Mi);function Ni(e,t){t&&w(this,"message",t);let r=w(this,"object");this.assert(e.exec(r),"expected #{this} to match "+e,"expected #{this} not to match "+e)}x(Ni,"assertMatch"),b.addMethod("match",Ni),b.addMethod("matches",Ni),b.addMethod("string",function(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"message"),o=w(this,"ssfi");new b(r,n,o,!0).is.a("string"),this.assert(~r.indexOf(e),"expected #{this} to contain "+G(e),"expected #{this} to not contain "+G(e))});function ki(e){let t=w(this,"object"),r=ee(t),n=ee(e),o=w(this,"ssfi"),a=w(this,"deep"),i,s="",l,u=!0,f=w(this,"message");f=f?f+": ":"";let d=f+"when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";if(r==="Map"||r==="Set")s=a?"deeply ":"",l=[],t.forEach(function(p,q){l.push(q)}),n!=="Array"&&(e=Array.prototype.slice.call(arguments));else{switch(l=Ei(t),n){case"Array":if(arguments.length>1)throw new Y(d,void 0,o);break;case"Object":if(arguments.length>1)throw new Y(d,void 0,o);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}e=e.map(function(p){return typeof p=="symbol"?p:String(p)})}if(!e.length)throw new Y(f+"keys required",void 0,o);let c=e.length,h=w(this,"any"),v=w(this,"all"),R=e,S=a?w(this,"eql"):(p,q)=>p===q;if(!h&&!v&&(v=!0),h&&(u=R.some(function(p){return l.some(function(q){return S(p,q)})})),v&&(u=R.every(function(p){return l.some(function(q){return S(p,q)})}),w(this,"contains")||(u=u&&e.length==l.length)),c>1){e=e.map(function(q){return G(q)});let p=e.pop();v&&(i=e.join(", ")+", and "+p),h&&(i=e.join(", ")+", or "+p)}else i=G(e[0]);i=(c>1?"keys ":"key ")+i,i=(w(this,"contains")?"contain ":"have ")+i,this.assert(u,"expected #{this} to "+s+i,"expected #{this} to not "+s+i,R.slice(0).sort(ra),l.sort(ra),!0)}x(ki,"assertKeys"),b.addMethod("keys",ki),b.addMethod("key",ki);function da(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"ssfi"),a=w(this,"message"),i=w(this,"negate")||!1;new b(n,a,o,!0).is.a("function"),(aa(e)||typeof e=="string")&&(t=e,e=null);let s,l=!1;try{n()}catch(h){l=!0,s=h}let u=e===void 0&&t===void 0,f=!!(e&&t),d=!1,c=!1;if(u||!u&&!i){let h="an error";e instanceof Error?h="#{exp}":e&&(h=we.getConstructorName(e));let v=s;if(s instanceof Error)v=s.toString();else if(typeof s=="string")v=s;else if(s&&(typeof s=="object"||typeof s=="function"))try{v=we.getConstructorName(s)}catch{}this.assert(l,"expected #{this} to throw "+h,"expected #{this} to not throw an error but #{act} was thrown",e&&e.toString(),v)}if(e&&s&&(e instanceof Error&&we.compatibleInstance(s,e)===i&&(f&&i?d=!0:this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s&&!i?" but #{act} was thrown":""),e.toString(),s.toString())),we.compatibleConstructor(s,e)===i&&(f&&i?d=!0:this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&we.getConstructorName(e),s instanceof Error?s.toString():s&&we.getConstructorName(s)))),s&&t!==void 0&&t!==null){let h="including";aa(t)&&(h="matching"),we.compatibleMessage(s,t)===i&&(f&&i?c=!0:this.assert(i,"expected #{this} to throw error "+h+" #{exp} but got #{act}","expected #{this} to throw error not "+h+" #{exp}",t,we.getMessage(s)))}d&&c&&this.assert(i,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}"+(s?" but #{act} was thrown":""),e instanceof Error?e.toString():e&&we.getConstructorName(e),s instanceof Error?s.toString():s&&we.getConstructorName(s)),w(this,"object",s)}x(da,"assertThrows"),b.addMethod("throw",da),b.addMethod("throws",da),b.addMethod("Throw",da);function Di(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=w(this,"itself"),o=typeof r=="function"&&!n?r.prototype[e]:r[e];this.assert(typeof o=="function","expected #{this} to respond to "+G(e),"expected #{this} to not respond to "+G(e))}x(Di,"respondTo"),b.addMethod("respondTo",Di),b.addMethod("respondsTo",Di),b.addProperty("itself",function(){w(this,"itself",!0)});function ji(e,t){t&&w(this,"message",t);let r=w(this,"object"),n=e(r);this.assert(n,"expected #{this} to satisfy "+ut(e),"expected #{this} to not satisfy"+ut(e),!w(this,"negate"),n)}x(ji,"satisfy"),b.addMethod("satisfy",ji),b.addMethod("satisfies",ji);function Bi(e,t,r){r&&w(this,"message",r);let n=w(this,"object"),o=w(this,"message"),a=w(this,"ssfi");new b(n,o,a,!0).is.numeric;let i="A `delta` value is required for `closeTo`";if(t==null)throw new Y(o?`${o}: ${i}`:i,void 0,a);if(new b(t,o,a,!0).is.numeric,i="A `expected` value is required for `closeTo`",e==null)throw new Y(o?`${o}: ${i}`:i,void 0,a);new b(e,o,a,!0).is.numeric;const s=x(u=>u<0n?-u:u,"abs"),l=x(u=>parseFloat(parseFloat(u).toPrecision(12)),"strip");this.assert(l(s(n-e))<=t,"expected #{this} to be close to "+e+" +/- "+t,"expected #{this} not to be close to "+e+" +/- "+t)}x(Bi,"closeTo