sinon-ts
Version:
sinon library extension to stub whole object and interfaces
12 lines • 731 kB
JavaScript
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.SinonTs = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var SinonTs=(()=>{var K2=Object.defineProperty;var l3=Object.getOwnPropertyDescriptor;var n3=Object.getOwnPropertyNames;var u3=Object.prototype.hasOwnProperty;var X2=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(a,c)=>(typeof require<"u"?require:a)[c]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+l+'" is not supported')});var e3=(l,a)=>{for(var c in a)K2(l,c,{get:a[c],enumerable:!0})},t3=(l,a,c,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let u of n3(a))!u3.call(l,u)&&u!==c&&K2(l,u,{get:()=>a[u],enumerable:!(r=l3(a,u))||r.enumerable});return l};var r3=l=>t3(K2({},"__esModule",{value:!0}),l);var a3={};e3(a3,{stubConstructor:()=>s3,stubInterface:()=>i3,stubObject:()=>Z2});var y2;(function(){function l(a,c,r){function u(h,F){if(!c[h]){if(!a[h]){var M=typeof X2=="function"&&X2;if(!F&&M)return M(h,!0);if(p)return p(h,!0);var A=new Error("Cannot find module '"+h+"'");throw A.code="MODULE_NOT_FOUND",A}var P=c[h]={exports:{}};a[h][0].call(P.exports,function(f){var q=a[h][1][f];return u(q||f)},P,P.exports,l,a,c,r)}return c[h].exports}for(var p=typeof X2=="function"&&X2,i=0;i<r.length;i++)u(r[i]);return u}return l})()({1:[function(l,a,c){"use strict";let r=l("./sinon/behavior"),u=l("./sinon/create-sandbox"),p=l("./sinon/util/core/extend"),i=l("./sinon/util/fake-timers"),h=l("./sinon/sandbox"),F=l("./sinon/stub"),M=l("./sinon/promise"),A=l("nise"),P=l("assert");a.exports=function(q={sinonXhrLib:A}){P(q?.sinonXhrLib,"No XHR lib passed in");let{sinonXhrLib:I}=q,w={createSandbox:u,match:l("@sinonjs/samsam").createMatcher,restoreObject:l("./sinon/restore-object"),expectation:l("./sinon/mock-expectation"),defaultConfig:l("./sinon/util/core/default-config"),timers:i.timers,xhr:I.fakeXhr.xhr,FakeXMLHttpRequest:I.fakeXhr.FakeXMLHttpRequest,fakeServer:I.fakeServer,fakeServerWithClock:I.fakeServerWithClock,createFakeServer:I.fakeServer.create.bind(I.fakeServer),createFakeServerWithClock:I.fakeServerWithClock.create.bind(I.fakeServerWithClock),addBehavior:function(b,m){r.addBehavior(F,b,m)},promise:M},T=new h;return p(T,w)}},{"./sinon/behavior":5,"./sinon/create-sandbox":8,"./sinon/mock-expectation":12,"./sinon/promise":14,"./sinon/restore-object":19,"./sinon/sandbox":20,"./sinon/stub":23,"./sinon/util/core/default-config":25,"./sinon/util/core/extend":27,"./sinon/util/fake-timers":42,"@sinonjs/samsam":89,assert:112,nise:133}],2:[function(l,a,c){"use strict";y2=l("./sinon")},{"./sinon":3}],3:[function(l,a,c){"use strict";let r=l("./create-sinon-api");a.exports=r()},{"./create-sinon-api":1}],4:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("@sinonjs/commons").calledInOrder,p=l("@sinonjs/samsam").createMatcher,i=l("@sinonjs/commons").orderByFirstCall,h=l("./util/core/times-in-words"),F=l("util").inspect,M=l("@sinonjs/commons").prototypes.string.slice,A=l("@sinonjs/commons").global,P=r.slice,f=r.concat,q=r.forEach,I=r.join,w=r.splice;function T(m,O){for(let j of Object.keys(O)){let $=m[j];($===null||typeof $>"u")&&(m[j]=O[j])}}function b(m){let O=m||{};T(O,{shouldLimitAssertionLogs:!1,assertionLogLimit:1e4});let j={failException:"AssertError",fail:function(g){let R=g;O.shouldLimitAssertionLogs&&(R=g.substring(0,O.assertionLogLimit));let k=new Error(R);throw k.name=this.failException||j.failException,k},pass:function(){},callOrder:function(){$.apply(null,arguments);let g="",R="";if(u(arguments))j.pass("callOrder");else{try{g=I(arguments,", ");let k=P(arguments),S=k.length;for(;S;)k[--S].called||w(k,S,1);R=I(i(k),", ")}catch{}E(this,`expected ${g} to be called in order but were called as ${R}`)}},callCount:function(g,R){$(g);let k;typeof R!="number"?(k=`expected ${F(R)} to be a number but was of type ${typeof R}`,E(this,k)):g.callCount!==R?(k=`expected %n to be called ${h(R)} but was called %c%C`,E(this,g.printf(k))):j.pass("callCount")},expose:function(g,R){if(!g)throw new TypeError("target is null or undefined");let k=R||{},S=typeof k.prefix>"u"&&"assert"||k.prefix,L=typeof k.includeFail>"u"||!!k.includeFail,_=this;return q(Object.keys(_),function(Q){Q!=="expose"&&(L||!/^(fail)/.test(Q))&&(g[H(S,Q)]=_[Q])}),g},match:function(g,R){if(p(R).test(g))j.pass("match");else{let S=["expected value to match",` expected = ${F(R)}`,` actual = ${F(g)}`];E(this,I(S,`
`))}}};function $(){let y=P(arguments);q(y,function(g){g||j.fail("fake is not a spy"),g.proxy&&g.proxy.isSinonProxy?$(g.proxy):(typeof g!="function"&&j.fail(`${g} is not a function`),typeof g.getCall!="function"&&j.fail(`${g} is not stubbed`))})}function Z(y,g){switch(y){case"notCalled":case"called":case"calledOnce":case"calledTwice":case"calledThrice":g.length!==0&&j.fail(`${y} takes 1 argument but was called with ${g.length+1} arguments`);break;default:break}}function E(y,g){let R=y||A;(R.fail||j.fail).call(R,g)}function x(y,g,R){let k=R,S=g;arguments.length===2&&(k=g,S=y),j[y]=function(L){$(L);let _=P(arguments,1),Q=!1;Z(y,_),typeof S=="function"?Q=!S(L):Q=typeof L[S]=="function"?!L[S].apply(L,_):!L[S],Q?E(this,(L.printf||L.proxy.printf).apply(L,f([k],_))):j.pass(y)}}function H(y,g){return!y||/^fail/.test(g)?g:y+M(g,0,1).toUpperCase()+M(g,1)}return x("called","expected %n to have been called at least once but was never called"),x("notCalled",function(y){return!y.called},"expected %n to not have been called but was called %c%C"),x("calledOnce","expected %n to be called once but was called %c%C"),x("calledTwice","expected %n to be called twice but was called %c%C"),x("calledThrice","expected %n to be called thrice but was called %c%C"),x("calledOn","expected %n to be called with %1 as this but was called with %t"),x("alwaysCalledOn","expected %n to always be called with %1 as this but was called with %t"),x("calledWithNew","expected %n to be called with new"),x("alwaysCalledWithNew","expected %n to always be called with new"),x("calledWith","expected %n to be called with arguments %D"),x("calledWithMatch","expected %n to be called with match %D"),x("alwaysCalledWith","expected %n to always be called with arguments %D"),x("alwaysCalledWithMatch","expected %n to always be called with match %D"),x("calledWithExactly","expected %n to be called with exact arguments %D"),x("calledOnceWithExactly","expected %n to be called once and with exact arguments %D"),x("calledOnceWithMatch","expected %n to be called once and with match %D"),x("alwaysCalledWithExactly","expected %n to always be called with exact arguments %D"),x("neverCalledWith","expected %n to never be called with arguments %*%C"),x("neverCalledWithMatch","expected %n to never be called with match %*%C"),x("threw","%n did not throw exception%C"),x("alwaysThrew","%n did not always throw exception%C"),j}a.exports=b(),a.exports.createAssertObject=b},{"./util/core/times-in-words":37,"@sinonjs/commons":49,"@sinonjs/samsam":89,util:118}],5:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./util/core/extend"),p=l("@sinonjs/commons").functionName,i=l("./util/core/next-tick"),h=l("@sinonjs/commons").valueToString,F=l("./util/core/export-async-behaviors"),M=r.concat,A=r.join,P=r.reverse,f=r.slice,q=-1,I=-2;function w(E,x){let H=E.callArgAt;if(H>=0)return x[H];let y;H===q&&(y=x),H===I&&(y=P(f(x)));let g=E.callArgProp;for(let R=0,k=y.length;R<k;++R){if(!g&&typeof y[R]=="function")return y[R];if(g&&y[R]&&typeof y[R][g]=="function")return y[R][g]}return null}function T(E,x,H){if(E.callArgAt<0){let y;return E.callArgProp?y=`${p(E.stub)} expected to yield to '${h(E.callArgProp)}', but no object with such a property was passed.`:y=`${p(E.stub)} expected to yield, but no callback was passed.`,H.length>0&&(y+=` Received [${A(H,", ")}]`),y}return`argument at index ${E.callArgAt} is not a function: ${x}`}function b(E,x,H){let y=E.replace(/sArg/,"ArgAt"),g=x[y];if(g>=H.length)throw new TypeError(`${E} failed: ${g+1} arguments required but only ${H.length} present`)}function m(E,x){if(typeof E.callArgAt=="number"){b("callsArg",E,x);let H=w(E,x);if(typeof H!="function")throw new TypeError(T(E,H,x));if(E.callbackAsync)i(function(){H.apply(E.callbackContext,E.callbackArguments)});else return H.apply(E.callbackContext,E.callbackArguments)}}let O={create:function(x){let H=u({},O);return delete H.create,delete H.addBehavior,delete H.createBehavior,H.stub=x,x.defaultBehavior&&x.defaultBehavior.promiseLibrary&&(H.promiseLibrary=x.defaultBehavior.promiseLibrary),H},isPresent:function(){return typeof this.callArgAt=="number"||this.exception||this.exceptionCreator||typeof this.returnArgAt=="number"||this.returnThis||typeof this.resolveArgAt=="number"||this.resolveThis||typeof this.throwArgAt=="number"||this.fakeFn||this.returnValueDefined},invoke:function(x,H){let y=m(this,H);if(this.exception)throw this.exception;if(this.exceptionCreator)throw this.exception=this.exceptionCreator(),this.exceptionCreator=void 0,this.exception;if(typeof this.returnArgAt=="number")return b("returnsArg",this,H),H[this.returnArgAt];if(this.returnThis)return x;if(typeof this.throwArgAt=="number")throw b("throwsArg",this,H),H[this.throwArgAt];if(this.fakeFn)return this.fakeFn.apply(x,H);if(typeof this.resolveArgAt=="number")return b("resolvesArg",this,H),(this.promiseLibrary||Promise).resolve(H[this.resolveArgAt]);if(this.resolveThis)return(this.promiseLibrary||Promise).resolve(x);if(this.resolve)return(this.promiseLibrary||Promise).resolve(this.returnValue);if(this.reject)return(this.promiseLibrary||Promise).reject(this.returnValue);if(this.callsThrough)return this.effectiveWrappedMethod().apply(x,H);if(this.callsThroughWithNew){let g=this.effectiveWrappedMethod(),R=f(H),k=g.bind.apply(g,M([null],R));return new k}else{if(typeof this.returnValue<"u")return this.returnValue;if(typeof this.callArgAt=="number")return y}return this.returnValue},effectiveWrappedMethod:function(){for(let x=this.stub;x;x=x.parent)if(x.wrappedMethod)return x.wrappedMethod;throw new Error("Unable to find wrapped method")},onCall:function(x){return this.stub.onCall(x)},onFirstCall:function(){return this.stub.onFirstCall()},onSecondCall:function(){return this.stub.onSecondCall()},onThirdCall:function(){return this.stub.onThirdCall()},withArgs:function(){throw new Error('Defining a stub by invoking "stub.onCall(...).withArgs(...)" is not supported. Use "stub.withArgs(...).onCall(...)" to define sequential behavior for calls with certain arguments.')}};function j(E){return function(){return this.defaultBehavior=this.defaultBehavior||O.create(this),this.defaultBehavior[E].apply(this.defaultBehavior,arguments),this}}function $(E,x,H){O[x]=function(){return H.apply(this,M([this],f(arguments))),this.stub||this},E[x]=j(x)}O.addBehavior=$,O.createBehavior=j;let Z=F(O);a.exports=u.nonEnum({},O,Z)},{"./util/core/export-async-behaviors":26,"./util/core/extend":27,"./util/core/next-tick":35,"@sinonjs/commons":49}],6:[function(l,a,c){"use strict";let r=l("./util/core/walk"),u=l("./util/core/get-property-descriptor"),p=l("@sinonjs/commons").prototypes.object.hasOwnProperty,i=l("@sinonjs/commons").prototypes.array.push;function h(M,A,P,f){typeof u(f,P).value=="function"&&p(A,P)&&i(M,A[P])}function F(M){let A=[];return r(M,h.bind(null,A,M)),A}a.exports=F},{"./util/core/get-property-descriptor":30,"./util/core/walk":40,"@sinonjs/commons":49}],7:[function(l,a,c){"use strict";a.exports=class{constructor(u=l("supports-color")){this.supportsColor=u}colorize(u,p){return this.supportsColor.stdout===!1?u:`\x1B[${p}m${u}\x1B[0m`}red(u){return this.colorize(u,31)}green(u){return this.colorize(u,32)}cyan(u){return this.colorize(u,96)}white(u){return this.colorize(u,39)}bold(u){return this.colorize(u,1)}}},{"supports-color":177}],8:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./sandbox"),p=r.forEach,i=r.push;function h(A){let P=new u({assertOptions:A.assertOptions});return A.useFakeServer&&(typeof A.useFakeServer=="object"&&(P.serverPrototype=A.useFakeServer),P.useFakeServer()),A.useFakeTimers&&(typeof A.useFakeTimers=="object"?P.useFakeTimers(A.useFakeTimers):P.useFakeTimers()),P}function F(A,P,f,q){q&&(P.injectInto&&!(f in P.injectInto)?(P.injectInto[f]=q,i(A.injectedKeys,f)):i(A.args,q))}function M(A){if(!A)return new u;let P=h(A);P.args=P.args||[],P.injectedKeys=[],P.injectInto=A.injectInto;let f=P.inject({});return A.properties?p(A.properties,function(q){let I=f[q]||q==="sandbox"&&P;F(P,A,q,I)}):F(P,A,"sandbox"),P}a.exports=M},{"./sandbox":20,"@sinonjs/commons":49}],9:[function(l,a,c){"use strict";let r=l("./stub"),u=l("./util/core/sinon-type"),p=l("@sinonjs/commons").prototypes.array.forEach;function i(h){return u.get(h)==="stub"}a.exports=function(F,M){if(typeof F!="function")throw new TypeError("The constructor should be a function.");let A=Object.create(F.prototype);u.set(A,"stub-instance");let P=r(A);return p(Object.keys(M||{}),function(f){if(f in P){let q=M[f];i(q)?P[f]=q:P[f].returns(q)}else throw new Error(`Cannot stub ${f}. Property does not exist!`)}),P}},{"./stub":23,"./util/core/sinon-type":36,"@sinonjs/commons":49}],10:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./util/core/is-property-configurable"),p=l("./util/core/export-async-behaviors"),i=l("./util/core/extend"),h=r.slice,F=-1,M=-2;function A(w,T,b){typeof T=="function"?w.exceptionCreator=T:typeof T=="string"?w.exceptionCreator=function(){let m=new Error(b||`Sinon-provided ${T}`);return m.name=T,m}:T?w.exception=T:w.exceptionCreator=function(){return new Error("Error")}}let P={skipReturn:!0,skipThrows:!0};function f(w,T){w.fakeFn=void 0,w.callsThrough=void 0,w.callsThroughWithNew=void 0,(!T||!T.skipThrows)&&(w.exception=void 0,w.exceptionCreator=void 0,w.throwArgAt=void 0),w.callArgAt=void 0,w.callbackArguments=void 0,w.callbackContext=void 0,w.callArgProp=void 0,w.callbackAsync=void 0,(!T||!T.skipReturn)&&(w.returnValue=void 0,w.returnValueDefined=void 0,w.returnArgAt=void 0,w.returnThis=void 0),w.resolve=void 0,w.resolveThis=void 0,w.resolveArgAt=void 0,w.reject=void 0}let q={callsFake:function(T,b){f(T),T.fakeFn=b},callsArg:function(T,b){if(typeof b!="number")throw new TypeError("argument index is not number");f(T),T.callArgAt=b,T.callbackArguments=[]},callsArgOn:function(T,b,m){if(typeof b!="number")throw new TypeError("argument index is not number");f(T),T.callArgAt=b,T.callbackArguments=[],T.callbackContext=m},callsArgWith:function(T,b){if(typeof b!="number")throw new TypeError("argument index is not number");f(T),T.callArgAt=b,T.callbackArguments=h(arguments,2)},callsArgOnWith:function(T,b,m){if(typeof b!="number")throw new TypeError("argument index is not number");f(T),T.callArgAt=b,T.callbackArguments=h(arguments,3),T.callbackContext=m},usingPromise:function(T,b){T.promiseLibrary=b},yields:function(w){f(w,P),w.callArgAt=F,w.callbackArguments=h(arguments,1)},yieldsRight:function(w){f(w,P),w.callArgAt=M,w.callbackArguments=h(arguments,1)},yieldsOn:function(w,T){f(w,P),w.callArgAt=F,w.callbackArguments=h(arguments,2),w.callbackContext=T},yieldsTo:function(w,T){f(w,P),w.callArgAt=F,w.callbackArguments=h(arguments,2),w.callArgProp=T},yieldsToOn:function(w,T,b){f(w,P),w.callArgAt=F,w.callbackArguments=h(arguments,3),w.callbackContext=b,w.callArgProp=T},throws:A,throwsException:A,returns:function(T,b){f(T),T.returnValue=b,T.returnValueDefined=!0},returnsArg:function(T,b){if(typeof b!="number")throw new TypeError("argument index is not number");f(T),T.returnArgAt=b},throwsArg:function(T,b){if(typeof b!="number")throw new TypeError("argument index is not number");f(T),T.throwArgAt=b},returnsThis:function(T){f(T),T.returnThis=!0},resolves:function(T,b){f(T),T.returnValue=b,T.resolve=!0,T.returnValueDefined=!0},resolvesArg:function(T,b){if(typeof b!="number")throw new TypeError("argument index is not number");f(T),T.resolveArgAt=b,T.resolve=!0},rejects:function(T,b,m){let O;return typeof b=="string"?(O=new Error(m||""),O.name=b):b?O=b:O=new Error("Error"),f(T),T.returnValue=O,T.reject=!0,T.returnValueDefined=!0,T},resolvesThis:function(T){f(T),T.resolveThis=!0},callThrough:function(T){f(T),T.callsThrough=!0},callThroughWithNew:function(T){f(T),T.callsThroughWithNew=!0},get:function(T,b){let m=T.stub||T;return Object.defineProperty(m.rootObj,m.propName,{get:b,configurable:u(m.rootObj,m.propName)}),T},set:function(T,b){let m=T.stub||T;return Object.defineProperty(m.rootObj,m.propName,{set:b,configurable:u(m.rootObj,m.propName)}),T},value:function(T,b){let m=T.stub||T;return Object.defineProperty(m.rootObj,m.propName,{value:b,enumerable:!0,writable:!0,configurable:m.shadowsPropOnPrototype||u(m.rootObj,m.propName)}),T}},I=p(q);a.exports=i({},q,I)},{"./util/core/export-async-behaviors":26,"./util/core/extend":27,"./util/core/is-property-configurable":33,"@sinonjs/commons":49}],11:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./proxy"),p=l("./util/core/next-tick"),i=r.slice,h=Promise;a.exports=F;function F(f){if(arguments.length>0&&typeof f!="function")throw new TypeError("Expected f argument to be a Function");return A(f)}F.returns=function(q){function I(){return q}return A(I)},F.throws=function(q){function I(){throw P(q)}return A(I)},F.resolves=function(q){function I(){return h.resolve(q)}return A(I)},F.rejects=function(q){function I(){return h.reject(P(q))}return A(I)},F.usingPromise=function(q){return h=q,F},F.yields=function(){let q=i(arguments);function I(){let w=arguments[arguments.length-1];if(typeof w!="function")throw new TypeError("Expected last argument to be a function");w.apply(null,q)}return A(I)},F.yieldsAsync=function(){let q=i(arguments);function I(){let w=arguments[arguments.length-1];if(typeof w!="function")throw new TypeError("Expected last argument to be a function");p(function(){w.apply(null,q)})}return A(I)};let M=0;function A(f){let q=function(){let w,T;arguments.length>0&&(w=arguments[0],T=arguments[arguments.length-1]);let b=T&&typeof T=="function"?T:void 0;return I.firstArg=w,I.lastArg=T,I.callback=b,f&&f.apply(this,arguments)},I=u(q,f||q);return I.displayName="fake",I.id=`fake#${M++}`,I}function P(f){return f instanceof Error?f:new Error(f)}},{"./proxy":18,"./util/core/next-tick":35,"@sinonjs/commons":49}],12:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./proxy-invoke"),p=l("./proxy-call").toString,i=l("./util/core/times-in-words"),h=l("./util/core/extend"),F=l("@sinonjs/samsam").createMatcher,M=l("./stub"),A=l("./assert"),P=l("@sinonjs/samsam").deepEqual,f=l("util").inspect,q=l("@sinonjs/commons").valueToString,I=r.every,w=r.forEach,T=r.push,b=r.slice;function m(x){return x===0?"never called":`called ${i(x)}`}function O(x){let H=x.minCalls,y=x.maxCalls;if(typeof H=="number"&&typeof y=="number"){let g=i(H);return H!==y&&(g=`at least ${g} and at most ${i(y)}`),g}return typeof H=="number"?`at least ${i(H)}`:`at most ${i(y)}`}function j(x){return!(typeof x.minCalls=="number")||x.callCount>=x.minCalls}function $(x){return typeof x.maxCalls!="number"?!1:x.callCount===x.maxCalls}function Z(x,H){return F.isMatcher(x)&&x.test(H)||!0}let E={minCalls:1,maxCalls:1,create:function(H){let y=h.nonEnum(M(),E);return delete y.create,y.method=H,y},invoke:function(H,y,g){return this.verifyCallAllowed(y,g),u.apply(this,arguments)},atLeast:function(H){if(typeof H!="number")throw new TypeError(`'${q(H)}' is not number`);return this.limitsSet||(this.maxCalls=null,this.limitsSet=!0),this.minCalls=H,this},atMost:function(H){if(typeof H!="number")throw new TypeError(`'${q(H)}' is not number`);return this.limitsSet||(this.minCalls=null,this.limitsSet=!0),this.maxCalls=H,this},never:function(){return this.exactly(0)},once:function(){return this.exactly(1)},twice:function(){return this.exactly(2)},thrice:function(){return this.exactly(3)},exactly:function(H){if(typeof H!="number")throw new TypeError(`'${q(H)}' is not a number`);return this.atLeast(H),this.atMost(H)},met:function(){return!this.failed&&j(this)},verifyCallAllowed:function(H,y){let g=this.expectedArguments;$(this)&&(this.failed=!0,E.fail(`${this.method} already called ${i(this.maxCalls)}`)),"expectedThis"in this&&this.expectedThis!==H&&E.fail(`${this.method} called with ${q(H)} as thisValue, expected ${q(this.expectedThis)}`),"expectedArguments"in this&&(y||E.fail(`${this.method} received no arguments, expected ${f(g)}`),y.length<g.length&&E.fail(`${this.method} received too few arguments (${f(y)}), expected ${f(g)}`),this.expectsExactArgCount&&y.length!==g.length&&E.fail(`${this.method} received too many arguments (${f(y)}), expected ${f(g)}`),w(g,function(R,k){Z(R,y[k])||E.fail(`${this.method} received wrong arguments ${f(y)}, didn't match ${String(g)}`),P(y[k],R)||E.fail(`${this.method} received wrong arguments ${f(y)}, expected ${f(g)}`)},this))},allowsCall:function(H,y){let g=this.expectedArguments;if(this.met()&&$(this)||"expectedThis"in this&&this.expectedThis!==H)return!1;if(!("expectedArguments"in this))return!0;let R=y||[];return R.length<g.length||this.expectsExactArgCount&&R.length!==g.length?!1:I(g,function(k,S){return!(!Z(k,R[S])||!P(R[S],k))})},withArgs:function(){return this.expectedArguments=b(arguments),this},withExactArgs:function(){return this.withArgs.apply(this,arguments),this.expectsExactArgCount=!0,this},on:function(H){return this.expectedThis=H,this},toString:function(){let x=b(this.expectedArguments||[]);this.expectsExactArgCount||T(x,"[...]");let y=`${p.call({proxy:this.method||"anonymous mock expectation",args:x}).replace(", [...","[, ...")} ${O(this)}`;return this.met()?`Expectation met: ${y}`:`Expected ${y} (${m(this.callCount)})`},verify:function(){return this.met()?E.pass(String(this)):E.fail(String(this)),!0},pass:function(H){A.pass(H)},fail:function(H){let y=new Error(H);throw y.name="ExpectationError",y}};a.exports=E},{"./assert":4,"./proxy-call":16,"./proxy-invoke":17,"./stub":23,"./util/core/extend":27,"./util/core/times-in-words":37,"@sinonjs/commons":49,"@sinonjs/samsam":89,util:118}],13:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./mock-expectation"),p=l("./proxy-call").toString,i=l("./util/core/extend"),h=l("@sinonjs/samsam").deepEqual,F=l("./util/core/wrap-method"),M=l("./util/core/use-promise-library"),A=r.concat,P=r.filter,f=r.forEach,q=r.every,I=r.join,w=r.push,T=r.slice,b=r.unshift;function m($){return!$||typeof $=="string"?u.create($||"Anonymous mock"):m.create($)}function O($,Z){f($||[],Z)}function j($,Z,E){return E&&$.length!==Z.length?!1:q($,function(x,H){return h(Z[H],x)})}i(m,{create:function(Z){if(!Z)throw new TypeError("object is null");let E=i.nonEnum({},m,{object:Z});return delete E.create,E},expects:function(Z){if(!Z)throw new TypeError("method is falsy");if(this.expectations||(this.expectations={},this.proxies=[],this.failures=[]),!this.expectations[Z]){this.expectations[Z]=[];let x=this;F(this.object,Z,function(){return x.invokeMethod(Z,this,arguments)}),w(this.proxies,Z)}let E=u.create(Z);return E.wrappedMethod=this.object[Z].wrappedMethod,w(this.expectations[Z],E),M(this.promiseLibrary,E),E},restore:function(){let Z=this.object;O(this.proxies,function(E){typeof Z[E].restore=="function"&&Z[E].restore()})},verify:function(){let Z=this.expectations||{},E=this.failures?T(this.failures):[],x=[];return O(this.proxies,function(H){O(Z[H],function(y){y.met()?w(x,String(y)):w(E,String(y))})}),this.restore(),E.length>0?u.fail(I(A(E,x),`
`)):x.length>0&&u.pass(I(A(E,x),`
`)),!0},usingPromise:function(Z){return this.promiseLibrary=Z,this},invokeMethod:function(Z,E,x){let H=this.expectations&&this.expectations[Z]?this.expectations[Z]:[],y=x||[],g,R=P(H,function(Q){let p2=Q.expectedArguments||[];return j(p2,y,Q.expectsExactArgCount)}),k=P(R,function(Q){return!Q.met()&&Q.allowsCall(E,x)});if(k.length>0)return k[0].apply(E,x);let S=[],L=0;if(f(R,function(Q){Q.allowsCall(E,x)?g=g||Q:L+=1}),g&&L===0)return g.apply(E,x);f(H,function(Q){w(S,` ${String(Q)}`)}),b(S,`Unexpected call: ${p.call({proxy:Z,args:x})}`);let _=new Error;if(!_.stack)try{throw _}catch{}w(this.failures,`Unexpected call: ${p.call({proxy:Z,args:x,stack:_.stack})}`),u.fail(I(S,`
`))}}),a.exports=m},{"./mock-expectation":12,"./proxy-call":16,"./util/core/extend":27,"./util/core/use-promise-library":38,"./util/core/wrap-method":41,"@sinonjs/commons":49,"@sinonjs/samsam":89}],14:[function(l,a,c){"use strict";let r=l("./fake"),u=l("./util/core/is-restorable"),p="pending",i="resolved",h="rejected";function F(A){return u(A)?A:A?r(A):r()}function M(A){let P=F(A),f=new Promise(P);f.status=p,f.then(function(I){f.status=i,f.resolvedValue=I}).catch(function(I){f.status=h,f.rejectedValue=I});function q(I,w,T){if(f.status!==p)throw new Error(`Promise already ${f.status}`);f.status=I,T(w)}return f.resolve=function(I){return q(i,I,P.firstCall.args[0]),f},f.reject=function(I){return q(h,I,P.firstCall.args[1]),new Promise(function(w){f.catch(()=>w())})},f}a.exports=M},{"./fake":11,"./util/core/is-restorable":34}],15:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array.push;c.incrementCallCount=function(p){p.called=!0,p.callCount+=1,p.notCalled=!1,p.calledOnce=p.callCount===1,p.calledTwice=p.callCount===2,p.calledThrice=p.callCount===3},c.createCallProperties=function(p){p.firstCall=p.getCall(0),p.secondCall=p.getCall(1),p.thirdCall=p.getCall(2),p.lastCall=p.getCall(p.callCount-1)},c.delegateToCalls=function(p,i,h,F,M,A,P){p[i]=function(){if(!this.called)return A?A.apply(this,arguments):!1;if(P!==void 0&&this.callCount!==P)return!1;let f,q=0,I=[];for(let w=0,T=this.callCount;w<T;w+=1){f=this.getCall(w);let b=f[F||i].apply(f,arguments);if(r(I,b),b&&(q+=1,h))return!0}return M?I:q===this.callCount}}},{"@sinonjs/commons":49}],16:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("@sinonjs/samsam").createMatcher,p=l("@sinonjs/samsam").deepEqual,i=l("@sinonjs/commons").functionName,h=l("util").inspect,F=l("@sinonjs/commons").valueToString,M=r.concat,A=r.filter,P=r.join,f=r.map,q=r.reduce,I=r.slice;function w(m,O,j){let $=i(m)+O;throw j.length&&($+=` Received [${P(I(j),", ")}]`),new Error($)}let T={calledOn:function(O){return u.isMatcher(O)?O.test(this.thisValue):this.thisValue===O},calledWith:function(){let O=this,j=I(arguments);return j.length>O.args.length?!1:q(j,function($,Z,E){return $&&p(O.args[E],Z)},!0)},calledWithMatch:function(){let O=this,j=I(arguments);return j.length>O.args.length?!1:q(j,function($,Z,E){let x=O.args[E];return $&&u(Z).test(x)},!0)},calledWithExactly:function(){return arguments.length===this.args.length&&this.calledWith.apply(this,arguments)},notCalledWith:function(){return!this.calledWith.apply(this,arguments)},notCalledWithMatch:function(){return!this.calledWithMatch.apply(this,arguments)},returned:function(O){return p(this.returnValue,O)},threw:function(O){return typeof O>"u"||!this.exception?!!this.exception:this.exception===O||this.exception.name===O},calledWithNew:function(){return this.proxy.prototype&&this.thisValue instanceof this.proxy},calledBefore:function(m){return this.callId<m.callId},calledAfter:function(m){return this.callId>m.callId},calledImmediatelyBefore:function(m){return this.callId===m.callId-1},calledImmediatelyAfter:function(m){return this.callId===m.callId+1},callArg:function(m){return this.ensureArgIsAFunction(m),this.args[m]()},callArgOn:function(m,O){return this.ensureArgIsAFunction(m),this.args[m].apply(O)},callArgWith:function(m){return this.callArgOnWith.apply(this,M([m,null],I(arguments,1)))},callArgOnWith:function(m,O){this.ensureArgIsAFunction(m);let j=I(arguments,2);return this.args[m].apply(O,j)},throwArg:function(m){throw m>this.args.length?new TypeError(`Not enough arguments: ${m} required but only ${this.args.length} present`):this.args[m]},yield:function(){return this.yieldOn.apply(this,M([null],I(arguments,0)))},yieldOn:function(m){let O=I(this.args),j=A(O,function($){return typeof $=="function"})[0];return j||w(this.proxy," cannot yield since no callback was passed.",O),j.apply(m,I(arguments,1))},yieldTo:function(m){return this.yieldToOn.apply(this,M([m,null],I(arguments,1)))},yieldToOn:function(m,O){let j=I(this.args),$=A(j,function(E){return E&&typeof E[m]=="function"})[0],Z=$&&$[m];return Z||w(this.proxy,` cannot yield to '${F(m)}' since no callback was passed.`,j),Z.apply(O,I(arguments,2))},toString:function(){if(!this.args)return":(";let m=this.proxy?`${String(this.proxy)}(`:"",O=f(this.args,function(j){return h(j)});return m=`${m+P(O,", ")})`,typeof this.returnValue<"u"&&(m+=` => ${h(this.returnValue)}`),this.exception&&(m+=` !${this.exception.name}`,this.exception.message&&(m+=`(${this.exception.message})`)),this.stack&&(m+=(this.stack.split(`
`)[3]||"unknown").replace(/^\s*(?:at\s+|@)?/," at ")),m},ensureArgIsAFunction:function(m){if(typeof this.args[m]!="function")throw new TypeError(`Expected argument at position ${m} to be a Function, but was ${typeof this.args[m]}`)}};Object.defineProperty(T,"stack",{enumerable:!0,configurable:!0,get:function(){return this.errorWithCallStack&&this.errorWithCallStack.stack||""}}),T.invokeCallback=T.yield;function b(m,O,j,$,Z,E,x){if(typeof E!="number")throw new TypeError("Call id is not a number");let H,y;j.length>0&&(H=j[0],y=j[j.length-1]);let g=Object.create(T),R=y&&typeof y=="function"?y:void 0;return g.proxy=m,g.thisValue=O,g.args=j,g.firstArg=H,g.lastArg=y,g.callback=R,g.returnValue=$,g.exception=Z,g.callId=E,g.errorWithCallStack=x,g}b.toString=T.toString,a.exports=b},{"@sinonjs/commons":49,"@sinonjs/samsam":89,util:118}],17:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./proxy-call-util"),p=r.push,i=r.forEach,h=r.concat,F=Error.prototype.constructor,M=Function.prototype.bind,A=0;a.exports=function(f,q,I){let w=this.matchingFakes(I),T=A++,b,m;u.incrementCallCount(this),p(this.thisValues,q),p(this.args,I),p(this.callIds,T),i(w,function(j){u.incrementCallCount(j),p(j.thisValues,q),p(j.args,I),p(j.callIds,T)}),u.createCallProperties(this),i(w,u.createCallProperties);try{this.invoking=!0,this.getCall(this.callCount-1).calledWithNew()?(m=new(M.apply(this.func||f,h([q],I))),typeof m!="object"&&typeof m!="function"&&(m=q)):m=(this.func||f).apply(q,I)}catch(j){b=j}finally{delete this.invoking}p(this.exceptions,b),p(this.returnValues,m),i(w,function(j){p(j.exceptions,b),p(j.returnValues,m)});let O=new F;try{throw O}catch{}if(p(this.errorsWithCallStack,O),i(w,function(j){p(j.errorsWithCallStack,O)}),u.createCallProperties(this),i(w,u.createCallProperties),b!==void 0)throw b;return m}},{"./proxy-call-util":15,"@sinonjs/commons":49}],18:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./util/core/extend"),p=l("./util/core/function-to-string"),i=l("./proxy-call"),h=l("./proxy-call-util"),F=l("./proxy-invoke"),M=l("util").inspect,A=r.push,P=r.forEach,f=r.slice,q=Object.freeze([]),I={toString:p,named:function(O){this.displayName=O;let j=Object.getOwnPropertyDescriptor(this,"name");return j&&j.configurable&&(j.value=O,Object.defineProperty(this,"name",j)),this},invoke:F,matchingFakes:function(){return q},getCall:function(O){let j=O;return j<0&&(j+=this.callCount),j<0||j>=this.callCount?null:i(this,this.thisValues[j],this.args[j],this.returnValues[j],this.exceptions[j],this.callIds[j],this.errorsWithCallStack[j])},getCalls:function(){let m=[],O;for(O=0;O<this.callCount;O++)A(m,this.getCall(O));return m},calledBefore:function(O){return this.called?O.called?this.callIds[0]<O.callIds[O.callIds.length-1]:!0:!1},calledAfter:function(O){return!this.called||!O.called?!1:this.callIds[this.callCount-1]>O.callIds[0]},calledImmediatelyBefore:function(O){return!this.called||!O.called?!1:this.callIds[this.callCount-1]===O.callIds[O.callCount-1]-1},calledImmediatelyAfter:function(O){return!this.called||!O.called?!1:this.callIds[this.callCount-1]===O.callIds[O.callCount-1]+1},formatters:l("./spy-formatters"),printf:function(m){let O=this,j=f(arguments,1),$;return(m||"").replace(/%(.)/g,function(Z,E){return $=I.formatters[E],typeof $=="function"?String($(O,j)):isNaN(parseInt(E,10))?`%${E}`:M(j[E-1])})},resetHistory:function(){if(this.invoking){let m=new Error("Cannot reset Sinon function while invoking it. Move the call to .resetHistory outside of the callback.");throw m.name="InvalidResetException",m}return this.called=!1,this.notCalled=!0,this.calledOnce=!1,this.calledTwice=!1,this.calledThrice=!1,this.callCount=0,this.firstCall=null,this.secondCall=null,this.thirdCall=null,this.lastCall=null,this.args=[],this.firstArg=null,this.lastArg=null,this.returnValues=[],this.thisValues=[],this.exceptions=[],this.callIds=[],this.errorsWithCallStack=[],this.fakes&&P(this.fakes,function(m){m.resetHistory()}),this}},w=h.delegateToCalls;w(I,"calledOn",!0),w(I,"alwaysCalledOn",!1,"calledOn"),w(I,"calledWith",!0),w(I,"calledOnceWith",!0,"calledWith",!1,void 0,1),w(I,"calledWithMatch",!0),w(I,"alwaysCalledWith",!1,"calledWith"),w(I,"alwaysCalledWithMatch",!1,"calledWithMatch"),w(I,"calledWithExactly",!0),w(I,"calledOnceWithExactly",!0,"calledWithExactly",!1,void 0,1),w(I,"calledOnceWithMatch",!0,"calledWithMatch",!1,void 0,1),w(I,"alwaysCalledWithExactly",!1,"calledWithExactly"),w(I,"neverCalledWith",!1,"notCalledWith",!1,function(){return!0}),w(I,"neverCalledWithMatch",!1,"notCalledWithMatch",!1,function(){return!0}),w(I,"threw",!0),w(I,"alwaysThrew",!1,"threw"),w(I,"returned",!0),w(I,"alwaysReturned",!1,"returned"),w(I,"calledWithNew",!0),w(I,"alwaysCalledWithNew",!1,"calledWithNew");function T(m,O){let j=b(m,O);return u(j,m),j.prototype=m.prototype,u.nonEnum(j,I),j}function b(m,O){let j=O.length,$;switch(j){case 0:$=function(){return $.invoke(m,this,f(arguments))};break;case 1:$=function(x){return $.invoke(m,this,f(arguments))};break;case 2:$=function(x,H){return $.invoke(m,this,f(arguments))};break;case 3:$=function(x,H,y){return $.invoke(m,this,f(arguments))};break;case 4:$=function(x,H,y,g){return $.invoke(m,this,f(arguments))};break;case 5:$=function(x,H,y,g,R){return $.invoke(m,this,f(arguments))};break;case 6:$=function(x,H,y,g,R,k){return $.invoke(m,this,f(arguments))};break;case 7:$=function(x,H,y,g,R,k,S){return $.invoke(m,this,f(arguments))};break;case 8:$=function(x,H,y,g,R,k,S,L){return $.invoke(m,this,f(arguments))};break;case 9:$=function(x,H,y,g,R,k,S,L,_){return $.invoke(m,this,f(arguments))};break;case 10:$=function(x,H,y,g,R,k,S,L,_,Q){return $.invoke(m,this,f(arguments))};break;case 11:$=function(x,H,y,g,R,k,S,L,_,Q,p2){return $.invoke(m,this,f(arguments))};break;case 12:$=function(x,H,y,g,R,k,S,L,_,Q,p2,X){return $.invoke(m,this,f(arguments))};break;default:$=function(){return $.invoke(m,this,f(arguments))};break}let Z=Object.getOwnPropertyDescriptor(O,"name");return Z&&Z.configurable&&Object.defineProperty($,"name",Z),u.nonEnum($,{isSinonProxy:!0,called:!1,notCalled:!0,calledOnce:!1,calledTwice:!1,calledThrice:!1,callCount:0,firstCall:null,firstArg:null,secondCall:null,thirdCall:null,lastCall:null,lastArg:null,args:[],returnValues:[],thisValues:[],exceptions:[],callIds:[],errorsWithCallStack:[]}),$}a.exports=T},{"./proxy-call":16,"./proxy-call-util":15,"./proxy-invoke":17,"./spy-formatters":21,"./util/core/extend":27,"./util/core/function-to-string":28,"@sinonjs/commons":49,util:118}],19:[function(l,a,c){"use strict";let r=l("./util/core/walk-object");function u(h,F){return h[F].restore&&h[F].restore.sinon}function p(h,F){h[F].restore()}function i(h){return r(p,h,u)}a.exports=i},{"./util/core/walk-object":39}],20:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("@sinonjs/commons").deprecated,p=l("./collect-own-methods"),i=l("./util/core/get-property-descriptor"),h=l("./util/core/is-property-configurable"),F=l("@sinonjs/samsam").createMatcher,M=l("./assert"),A=l("./util/fake-timers"),P=l("./mock"),f=l("./spy"),q=l("./stub"),I=l("./create-stub-instance"),w=l("./fake"),T=l("@sinonjs/commons").valueToString,b=l("nise").fakeServer,m=l("nise").fakeXhr,O=l("./util/core/use-promise-library"),j=1e4,$=r.filter,Z=r.forEach,E=r.push,x=r.reverse;function H(S,L){let _=$(S,function(Q){return typeof Q[L]=="function"});Z(_,function(Q){Q[L]()})}function y(S){if(typeof S.get=="function")throw new Error("Use sandbox.replaceGetter for replacing getters");if(typeof S.set=="function")throw new Error("Use sandbox.replaceSetter for replacing setters")}function g(S,L,_){if(typeof S[L]!=typeof _)throw new TypeError(`Cannot replace ${typeof S[L]} with ${typeof _}`)}function R(S,L,_){if(typeof S>"u")throw new TypeError(`Cannot replace non-existent property ${T(L)}. Perhaps you meant sandbox.define()?`);if(typeof _>"u")throw new TypeError("Expected replacement argument to be defined")}function k(S={}){let L=this,_=S.assertOptions||{},Q=[],p2,X=[],r2=!1;L.leakThreshold=j;function Y(i2){E(X,i2)>L.leakThreshold&&!r2&&(u.printWarning("Potential memory leak detected; be sure to call restore() to clean up your sandbox. To suppress this warning, modify the leakThreshold property of your sandbox."),r2=!0)}L.assert=M.createAssertObject(_),L.serverPrototype=b,L.getFakes=function(){return X},L.createStubInstance=function(){let J=I.apply(null,arguments),c2=p(J);return Z(c2,function(f2){Y(f2)}),O(p2,c2),J},L.inject=function(J){return J.spy=function(){return L.spy.apply(null,arguments)},J.stub=function(){return L.stub.apply(null,arguments)},J.mock=function(){return L.mock.apply(null,arguments)},J.createStubInstance=function(){return L.createStubInstance.apply(L,arguments)},J.fake=function(){return L.fake.apply(null,arguments)},J.define=function(){return L.define.apply(null,arguments)},J.replace=function(){return L.replace.apply(null,arguments)},J.replaceSetter=function(){return L.replaceSetter.apply(null,arguments)},J.replaceGetter=function(){return L.replaceGetter.apply(null,arguments)},L.clock&&(J.clock=L.clock),L.server&&(J.server=L.server,J.requests=L.server.requests),J.match=F,J},L.mock=function(){let J=P.apply(null,arguments);return Y(J),O(p2,J),J},L.reset=function(){H(X,"reset"),H(X,"resetHistory")},L.resetBehavior=function(){H(X,"resetBehavior")},L.resetHistory=function(){function J(c2){let f2=c2.resetHistory||c2.reset;f2&&f2.call(c2)}Z(X,J)},L.restore=function(){if(arguments.length)throw new Error("sandbox.restore() does not take any parameters. Perhaps you meant stub.restore()");x(X),H(X,"restore"),X=[],Z(Q,function(J){J()}),Q=[],L.restoreContext()},L.restoreContext=function(){L.injectedKeys&&(Z(L.injectedKeys,function(J){delete L.injectInto[J]}),L.injectedKeys.length=0)};function n2(i2,J,c2=!1){let f2=i(i2,J),m2=i2[J];function x2(){c2?i2[J]=m2:f2?.isOwn?Object.defineProperty(i2,J,f2):delete i2[J]}return x2.object=i2,x2.property=J,x2}function u2(i2,J){Z(Q,function(c2){if(c2.object===i2&&c2.property===J)throw new TypeError(`Attempted to replace ${J} which is already replaced`)})}L.replace=function(J,c2,f2){let m2=i(J,c2);return R(m2,c2,f2),y(m2),g(J,c2,f2),u2(J,c2),E(Q,n2(J,c2)),J[c2]=f2,f2},L.replace.usingAccessor=function(J,c2,f2){let m2=i(J,c2);return R(m2,c2,f2),g(J,c2,f2),u2(J,c2),E(Q,n2(J,c2,!0)),J[c2]=f2,f2},L.define=function(J,c2,f2){if(i(J,c2))throw new TypeError(`Cannot define the already existing property ${T(c2)}. Perhaps you meant sandbox.replace()?`);if(typeof f2>"u")throw new TypeError("Expected value argument to be defined");return u2(J,c2),E(Q,n2(J,c2)),J[c2]=f2,f2},L.replaceGetter=function(J,c2,f2){let m2=i(J,c2);if(typeof m2>"u")throw new TypeError(`Cannot replace non-existent property ${T(c2)}`);if(typeof f2!="function")throw new TypeError("Expected replacement argument to be a function");if(typeof m2.get!="function")throw new Error("`object.property` is not a getter");return u2(J,c2),E(Q,n2(J,c2)),Object.defineProperty(J,c2,{get:f2,configurable:h(J,c2)}),f2},L.replaceSetter=function(J,c2,f2){let m2=i(J,c2);if(typeof m2>"u")throw new TypeError(`Cannot replace non-existent property ${T(c2)}`);if(typeof f2!="function")throw new TypeError("Expected replacement argument to be a function");if(typeof m2.set!="function")throw new Error("`object.property` is not a setter");return u2(J,c2),E(Q,n2(J,c2)),Object.defineProperty(J,c2,{set:f2,configurable:h(J,c2)}),f2};function t2(i2,J){let[c2,f2,m2]=i2;if(typeof f2>"u"&&typeof c2=="object"){let A2=p(J);Z(A2,function(T2){Y(T2)}),O(p2,A2)}else if(Array.isArray(m2))for(let A2 of m2)Y(J[A2]),O(p2,J[A2]);else Y(J),O(p2,J);return J}L.spy=function(){let J=f.apply(f,arguments);return t2(arguments,J)},L.stub=function(){let J=q.apply(q,arguments);return t2(arguments,J)},L.fake=function(J){let c2=w.apply(w,arguments);return Y(c2),c2},Z(Object.keys(w),function(i2){let J=w[i2];typeof J=="function"&&(L.fake[i2]=function(){let c2=J.apply(J,arguments);return Y(c2),c2})}),L.useFakeTimers=function(J){let c2=A.useFakeTimers.call(null,J);return L.clock=c2,Y(c2),c2},L.verify=function(){H(X,"verify")},L.verifyAndRestore=function(){let J;try{L.verify()}catch(c2){J=c2}if(L.restore(),J)throw J},L.useFakeServer=function(){let J=L.serverPrototype||b;return!J||!J.create?null:(L.server=J.create(),Y(L.server),L.server)},L.useFakeXMLHttpRequest=function(){let J=m.useFakeXMLHttpRequest();return Y(J),J},L.usingPromise=function(J){return p2=J,X.promiseLibrary=J,L}}k.prototype.match=F,a.exports=k},{"./assert":4,"./collect-own-methods":6,"./create-stub-instance":9,"./fake":11,"./mock":13,"./spy":22,"./stub":23,"./util/core/get-property-descriptor":30,"./util/core/is-property-configurable":33,"./util/core/use-promise-library":38,"./util/fake-timers":42,"@sinonjs/commons":49,"@sinonjs/samsam":89,nise:133}],21:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./colorizer"),p=new u,i=l("@sinonjs/samsam").createMatcher,h=l("./util/core/times-in-words"),F=l("util").inspect,M=l("diff"),A=r.join,P=r.map,f=r.push,q=r.slice;function I(b,m,O){let j=O,$=b.message;return b.test(m)||($=p.red(b.message),j&&(j=p.green(j))),`${j} ${$}`}function w(b){let m=P(b,function(O){let j=O.value;return O.added?j=p.green(j):O.removed&&(j=p.red(j)),b.length===2&&(j+=" "),j});return A(m,"")}function T(b){return typeof b=="string"?JSON.stringify(b):b}a.exports={c:function(b){return h(b.callCount)},n:function(b){return b.toString()},D:function(b,m){let O="";for(let j=0,$=b.callCount;j<$;++j){$>1&&(O+=`
Call ${j+1}:`);let Z=b.getCall(j).args,E=q(m);for(let x=0;x<Z.length||x<E.length;++x){let H=Z[x],y=E[x];H&&(H=T(H)),y&&(y=T(y)),O+=`
`;let g=x<Z.length?F(H):"";if(i.isMatcher(y))O+=I(y,H,g);else{let R=x<E.length?F(y):"",k=M.diffJson(g,R);O+=w(k)}}}return O},C:function(b){let m=[];for(let O=0,j=b.callCount;O<j;++O){let $=` ${b.getCall(O).toString()}`;/\n/.test(m[O-1])&&($=`
${$}`),f(m,$)}return m.length>0?`
${A(m,`
`)}`:""},t:function(b){let m=[];for(let O=0,j=b.callCount;O<j;++O)f(m,F(b.thisValues[O]));return A(m,", ")},"*":function(b,m){return A(P(m,function(O){return F(O)}),", ")}}},{"./colorizer":7,"./util/core/times-in-words":37,"@sinonjs/commons":49,"@sinonjs/samsam":89,diff:119,util:118}],22:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./proxy"),p=l("./util/core/extend"),i=l("@sinonjs/commons").functionName,h=l("./util/core/get-property-descriptor"),F=l("@sinonjs/samsam").deepEqual,M=l("./util/core/is-es-module"),A=l("./proxy-call-util"),P=l("./util/core/walk-object"),f=l("./util/core/wrap-method"),q=l("@sinonjs/commons").valueToString,I=r.forEach,w=r.pop,T=r.push,b=r.slice,m=Array.prototype.filter,O=0;function j(H,y,g){let R=H.matchingArguments;return R.length<=y.length&&F(b(y,0,R.length),R)?!g||R.length===y.length:!1}let $={withArgs:function(){let H=b(arguments),y=w(this.matchingFakes(H,!0));if(y)return y;let g=this,R=this.instantiateFake();return R.matchingArguments=H,R.parent=this,T(this.fakes,R),R.withArgs=function(){return g.withArgs.apply(g,arguments)},I(g.args,function(k,S){j(R,k)&&(A.incrementCallCount(R),T(R.thisValues,g.thisValues[S]),T(R.args,k),T(R.returnValues,g.returnValues[S]),T(R.exceptions,g.exceptions[S]),T(R.callIds,g.callIds[S]))}),A.createCallProperties(R),R},matchingFakes:function(H,y){return m.call(this.fakes,function(g){return j(g,H,y)})}},Z=A.delegateToCalls;Z($,"callArg",!1,"callArgWith",!0,function(){throw new Error(`${this.toString()} cannot call arg since it was not yet invoked.`)}),$.callArgWith=$.callArg,Z($,"callArgOn",!1,"callArgOnWith",!0,function(){throw new Error(`${this.toString()} cannot call arg since it was not yet invoked.`)}),$.callArgOnWith=$.callArgOn,Z($,"throwArg",!1,"throwArg",!1,function(){throw new Error(`${this.toString()} cannot throw arg since it was not yet invoked.`)}),Z($,"yield",!1,"yield",!0,function(){throw new Error(`${this.toString()} cannot yield since it was not yet invoked.`)}),$.invokeCallback=$.yield,Z($,"yieldOn",!1,"yieldOn",!0,function(){throw new Error(`${this.toString()} cannot yield since it was not yet invoked.`)}),Z($,"yieldTo",!1,"yieldTo",!0,function(H){throw new Error(`${this.toString()} cannot yield to '${q(H)}' since it was not yet invoked.`)}),Z($,"yieldToOn",!1,"yieldToOn",!0,function(H){throw new Error(`${this.toString()} cannot yield to '${q(H)}' since it was not yet invoked.`)});function E(H){let y,g=H;typeof g!="function"?g=function(){}:y=i(g);let R=u(g,g);return p.nonEnum(R,$),p.nonEnum(R,{displayName:y||"spy",fakes:[],instantiateFake:E,id:`spy#${O++}`}),R}function x(H,y,g){if(M(H))throw new TypeError("ES Modules cannot be spied");if(!y&&typeof H=="function")return E(H);if(!y&&typeof H=="object")return P(x,H);if(!H&&!y)return E(function(){});if(!g)return f(H,y,E(H[y]));let R={},k=h(H,y);return I(g,function(S){R[S]=E(k[S])}),f(H,y,R)}p(x,$),a.exports=x},{"./proxy":18,"./proxy-call-util":15,"./util/core/extend":27,"./util/core/get-property-descriptor":30,"./util/core/is-es-module":31,"./util/core/walk-object":39,"./util/core/wrap-method":41,"@sinonjs/commons":49,"@sinonjs/samsam":89}],23:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").prototypes.array,u=l("./behavior"),p=l("./default-behaviors"),i=l("./proxy"),h=l("@sinonjs/commons").functionName,F=l("@sinonjs/commons").prototypes.object.hasOwnProperty,M=l("./util/core/is-non-existent-property"),A=l("./spy"),P=l("./util/core/extend"),f=l("./util/core/get-property-descriptor"),q=l("./util/core/is-es-module"),I=l("./util/core/sinon-type"),w=l("./util/core/wrap-method"),T=l("./throw-on-falsy-object"),b=l("@sinonjs/commons").valueToString,m=l("./util/core/walk-object"),O=r.forEach,j=r.pop,$=r.slice,Z=r.sort,E=0;function x(_){let Q;function p2(){let r2=$(arguments),Y=Q.matchingFakes(r2),n2=j(Z(Y,function(u2,t2){return u2.matchingArguments.length-t2.matchingArguments.length}))||Q;return S(n2).invoke(this,arguments)}Q=i(p2,_||p2),P.nonEnum(Q,A),P.nonEnum(Q,H);let X=_?h(_):null;return P.nonEnum(Q,{fakes:[],instantiateFake:x,displayName:X||"stub",defaultBehavior:null,behaviors:[],id:`stub#${E++}`}),I.set(Q,"stub"),Q}function H(_,Q){if(arguments.length>2)throw new TypeError("stub(obj, 'meth', fn) has been removed, see documentation");if(q(_))throw new TypeError("ES Modules cannot be stubbed");if(T.apply(null,arguments),M(_,Q))throw new TypeError(`Cannot stub non-existent property ${b(Q)}`);let p2=f(_,Q);y(p2,Q);let X=typeof _=="object"||typeof _=="function",r2=typeof Q>"u"&&X,Y=!_&&typeof Q>"u",n2=X&&typeof Q<"u"&&(typeof p2>"u"||typeof p2.value!="function");if(r2)return m(H,_);if(Y)return x();let u2=typeof p2.value=="function"?p2.value:null,t2=x(u2);return P.nonEnum(t2,{rootObj:_,propName:Q,shadowsPropOnPrototype:!p2.isOwn,restore:function(){if(p2!==void 0&&p2.isOwn){Object.defineProperty(_,Q,p2);return}delete _[Q]}}),n2?t2:w(_,Q,t2)}function y(_,Q){if(!(!_||!Q)){if(_.isOwn&&!_.configurable&&!_.writable)throw new TypeError(`Descriptor for property ${Q} is non-configurable and non-writable`);if((_.get||_.set)&&!_.configurable)throw new TypeError(`Descriptor for accessor property ${Q} is non-configurable`);if(g(_)&&!_.writable)throw new TypeError(`Descriptor for data property ${Q} is non-writable`)}}function g(_){return!_.value&&!_.writable&&!_.set&&!_.get}function R(_){return _.parent&&S(_.parent)}function k(_){return _.defaultBehavior||R(_)||u.create(_)}function S(_){let Q=_.behaviors[_.callCount-1];return Q&&Q.isPresent()?Q:k(_)}let L={resetBehavior:function(){this.defaultBehavior=null,this.behaviors=[],delete this.returnValue,delete this.returnArgAt,delete this.throwArgAt,delete this.resolveArgAt,delete this.fakeFn,this.returnThis=!1,this.resolveThis=!1,O(this.fakes,function(_){_.resetBehavior()})},reset:function(){this.resetHistory(),this.resetBehavior()},onCall:function(Q){return this.behaviors[Q]||(this.behaviors[Q]=u.create(this)),this.behaviors[Q]},onFirstCall:function(){return this.onCall(0)},onSecondCall:function(){return this.onCall(1)},onThirdCall:function(){return this.onCall(2)},withArgs:function(){let Q=A.withArgs.apply(this,arguments);return this.defaultBehavior&&this.defaultBehavior.promiseLibrary&&(Q.defaultBehavior=Q.defaultBehavior||u.create(Q),Q.defaultBehavior.promiseLibrary=this.defaultBehavior.promiseLibrary),Q}};O(Object.keys(u),function(_){F(u,_)&&!F(L,_)&&_!=="create"&&_!=="invoke"&&(L[_]=u.createBehavior(_))}),O(Object.keys(p),function(_){F(p,_)&&!F(L,_)&&u.addBehavior(H,_,p[_])}),P(H,L),a.exports=H},{"./behavior":5,"./default-behaviors":10,"./proxy":18,"./spy":22,"./throw-on-falsy-object":24,"./util/core/extend":27,"./util/core/get-property-descriptor":30,"./util/core/is-es-module":31,"./util/core/is-non-existent-property":32,"./util/core/sinon-type":36,"./util/core/walk-object":39,"./util/core/wrap-method":41,"@sinonjs/commons":49}],24:[function(l,a,c){"use strict";let r=l("@sinonjs/commons").valueToString;function u(p,i){if(i&&!p){let h=p===null?"null":"undefined";throw new Error(`Trying to stub property '${r(i)}' of ${h}`)}}a.exports=u},{"@sinonjs/commons":49}],25:[function(l,a,c){"use strict";a.exports={injectInto:null,properties:["spy","stub","mock","clock","server","requests","fake"