Socket
Socket
Sign inDemoInstall

zone.js

Package Overview
Dependencies
Maintainers
2
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zone.js - npm Package Compare versions

Comparing version 0.14.8 to 0.14.10

30

bundles/fake-async-test.umd.js

@@ -677,3 +677,4 @@ 'use strict';

*
* If there are any pending timers at the end of the function, an exception will be thrown.
* When flush is `false`, if there are any pending timers at the end of the function,
* an exception will be thrown.
*

@@ -687,2 +688,4 @@ * Can be used to wrap inject() calls.

* @param fn
* @param options
* flush: when true, will drain the macrotask queue after the test function completes.
* @returns The function wrapped to be executed in the fakeAsync zone

@@ -692,3 +695,5 @@ *

*/
function fakeAsync(fn) {
function fakeAsync(fn, options) {
if (options === void 0) { options = {}; }
var _b = options.flush, flush = _b === void 0 ? false : _b;
// Not using an arrow function to preserve context passed from call site

@@ -724,3 +729,8 @@ var fakeAsyncFn = function () {

res = fn.apply(this, args);
flushMicrotasks();
if (flush) {
_fakeAsyncTestZoneSpec.flush(20, true);
}
else {
flushMicrotasks();
}
}

@@ -730,9 +740,11 @@ finally {

}
if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {
throw new Error("".concat(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length, " ") +
"periodic timer(s) still in the queue.");
if (!flush) {
if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {
throw new Error("".concat(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length, " ") +
"periodic timer(s) still in the queue.");
}
if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {
throw new Error("".concat(_fakeAsyncTestZoneSpec.pendingTimers.length, " timer(s) still in the queue."));
}
}
if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {
throw new Error("".concat(_fakeAsyncTestZoneSpec.pendingTimers.length, " timer(s) still in the queue."));
}
return res;

@@ -739,0 +751,0 @@ }

@@ -7,2 +7,2 @@ "use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},__assign.apply(this,arguments)},__spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var i,n=0,s=t.length;n<s;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))};

*/
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){var e,t,r="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,i=r.Date;function n(){if(0===arguments.length){var e=new i;return e.setTime(n.now()),e}var t=Array.prototype.slice.call(arguments);return new(i.bind.apply(i,__spreadArray([void 0],t,!1)))}n.now=function(){var e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():i.now.apply(this,arguments)},n.UTC=i.UTC,n.parse=i.parse;var s=function(){},o=function(){function n(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=i.now(),this._currentTickRequeuePeriodicEntries=[]}return n.getNextId=function(){var i=t.nativeSetTimeout.call(r,s,0);return t.nativeClearTimeout.call(r,i),"number"==typeof i?i:e.nextNodeJSId++},n.prototype.getCurrentTickTime=function(){return this._currentTickTime},n.prototype.getFakeSystemTime=function(){return this._currentFakeBaseSystemTime+this._currentTickTime},n.prototype.setFakeBaseSystemTime=function(e){this._currentFakeBaseSystemTime=e},n.prototype.getRealSystemTime=function(){return i.now()},n.prototype.scheduleFunction=function(t,r,i){var n=(i=__assign({args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1},i)).id<0?e.nextId:i.id;e.nextId=e.getNextId();var s={endTime:this._currentTickTime+r,id:n,func:t,args:i.args,delay:r,isPeriodic:i.isPeriodic,isRequestAnimationFrame:i.isRequestAnimationFrame};i.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(s);for(var o=0;o<this._schedulerQueue.length&&!(s.endTime<this._schedulerQueue[o].endTime);o++);return this._schedulerQueue.splice(o,0,s),n},n.prototype.removeScheduledFunctionWithId=function(e){for(var t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}},n.prototype.removeAll=function(){this._schedulerQueue=[]},n.prototype.getTimerCount=function(){return this._schedulerQueue.length},n.prototype.tickToNext=function(e,t,r){void 0===e&&(e=1),this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,r)},n.prototype.tick=function(e,t,i){void 0===e&&(e=0);var n=this._currentTickTime+e,s=0,o=(i=Object.assign({processNewMacroTasksSynchronously:!0},i)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===o.length&&t)t(e);else{for(;o.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(n<o[0].endTime));){var a=o.shift();if(!i.processNewMacroTasksSynchronously){var c=this._schedulerQueue.indexOf(a);c>=0&&this._schedulerQueue.splice(c,1)}if(s=this._currentTickTime,this._currentTickTime=a.endTime,t&&t(this._currentTickTime-s),!a.func.apply(r,a.isRequestAnimationFrame?[this._currentTickTime]:a.args))break;i.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((function(e){for(var t=0;t<o.length&&!(e.endTime<o[t].endTime);t++);o.splice(t,0,e)}))}s=this._currentTickTime,this._currentTickTime=n,t&&t(this._currentTickTime-s)}},n.prototype.flushOnlyPendingTimers=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t},n.prototype.flush=function(e,t,r){return void 0===e&&(e=20),void 0===t&&(t=!1),t?this.flushPeriodic(r):this.flushNonPeriodic(e,r)},n.prototype.flushPeriodic=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t},n.prototype.flushNonPeriodic=function(e,t){for(var i=this._currentTickTime,n=0,s=0;this._schedulerQueue.length>0;){if(++s>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((function(e){return!e.isPeriodic&&!e.isRequestAnimationFrame})).length)break;var o=this._schedulerQueue.shift();if(n=this._currentTickTime,this._currentTickTime=o.endTime,t&&t(this._currentTickTime-n),!o.func.apply(r,o.args))break}return this._currentTickTime-i},n}();(e=o).nextNodeJSId=1,e.nextId=-1;var a=function(){function e(e,t,i){void 0===t&&(t=!1),this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=i,this._scheduler=new o,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=r[Zone.__symbol__("FakeAsyncTestMacroTask")])}return e.assertInZone=function(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")},e.prototype._fnAndFlush=function(e,t){var i=this;return function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];return e.apply(r,n),null===i._lastError?(null!=t.onSuccess&&t.onSuccess.apply(r),i.flushMicrotasks()):null!=t.onError&&t.onError.apply(r),null===i._lastError}},e._removeTimer=function(e,t){var r=e.indexOf(t);r>-1&&e.splice(r,1)},e.prototype._dequeueTimer=function(t){var r=this;return function(){e._removeTimer(r.pendingTimers,t)}},e.prototype._requeuePeriodicTimer=function(e,t,r,i){var n=this;return function(){-1!==n.pendingPeriodicTimers.indexOf(i)&&n._scheduler.scheduleFunction(e,t,{args:r,isPeriodic:!0,id:i,isRequeuePeriodic:!0})}},e.prototype._dequeuePeriodicTimer=function(t){var r=this;return function(){e._removeTimer(r.pendingPeriodicTimers,t)}},e.prototype._setTimeout=function(e,t,r,i){void 0===i&&(i=!0);var n=this._dequeueTimer(o.nextId),s=this._fnAndFlush(e,{onSuccess:n,onError:n}),a=this._scheduler.scheduleFunction(s,t,{args:r,isRequestAnimationFrame:!i});return i&&this.pendingTimers.push(a),a},e.prototype._clearTimeout=function(t){e._removeTimer(this.pendingTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._setInterval=function(e,t,r){var i=o.nextId,n={onSuccess:null,onError:this._dequeuePeriodicTimer(i)},s=this._fnAndFlush(e,n);return n.onSuccess=this._requeuePeriodicTimer(s,t,r,i),this._scheduler.scheduleFunction(s,t,{args:r,isPeriodic:!0}),this.pendingPeriodicTimers.push(i),i},e.prototype._clearInterval=function(t){e._removeTimer(this.pendingPeriodicTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._resetLastErrorAndThrow=function(){var e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e},e.prototype.getCurrentTickTime=function(){return this._scheduler.getCurrentTickTime()},e.prototype.getFakeSystemTime=function(){return this._scheduler.getFakeSystemTime()},e.prototype.setFakeBaseSystemTime=function(e){this._scheduler.setFakeBaseSystemTime(e)},e.prototype.getRealSystemTime=function(){return this._scheduler.getRealSystemTime()},e.patchDate=function(){r[Zone.__symbol__("disableDatePatching")]||r.Date!==n&&(r.Date=n,n.prototype=i.prototype,e.checkTimerPatch())},e.resetDate=function(){r.Date===n&&(r.Date=i)},e.checkTimerPatch=function(){if(!t)throw new Error("Expected timers to have been patched.");r.setTimeout!==t.setTimeout&&(r.setTimeout=t.setTimeout,r.clearTimeout=t.clearTimeout),r.setInterval!==t.setInterval&&(r.setInterval=t.setInterval,r.clearInterval=t.clearInterval)},e.prototype.lockDatePatch=function(){this.patchDateLocked=!0,e.patchDate()},e.prototype.unlockDatePatch=function(){this.patchDateLocked=!1,e.resetDate()},e.prototype.tickToNext=function(t,r,i){void 0===t&&(t=1),void 0===i&&(i={processNewMacroTasksSynchronously:!0}),t<=0||(e.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(t,r,i),null!==this._lastError&&this._resetLastErrorAndThrow())},e.prototype.tick=function(t,r,i){void 0===t&&(t=0),void 0===i&&(i={processNewMacroTasksSynchronously:!0}),e.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(t,r,i),null!==this._lastError&&this._resetLastErrorAndThrow()},e.prototype.flushMicrotasks=function(){var t=this;for(e.assertInZone();this._microtasks.length>0;){var r=this._microtasks.shift();r.func.apply(r.target,r.args)}(null!==t._lastError||t._uncaughtPromiseErrors.length)&&t._resetLastErrorAndThrow()},e.prototype.flush=function(t,r,i){e.assertInZone(),this.flushMicrotasks();var n=this._scheduler.flush(t,r,i);return null!==this._lastError&&this._resetLastErrorAndThrow(),n},e.prototype.flushOnlyPendingTimers=function(t){e.assertInZone(),this.flushMicrotasks();var r=this._scheduler.flushOnlyPendingTimers(t);return null!==this._lastError&&this._resetLastErrorAndThrow(),r},e.prototype.removeAllTimers=function(){e.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]},e.prototype.getTimerCount=function(){return this._scheduler.getTimerCount()+this._microtasks.length},e.prototype.onScheduleTask=function(e,t,r,i){switch(i.type){case"microTask":var n=i.data&&i.data.args,s=void 0;if(n){var o=i.data.cbIdx;"number"==typeof n.length&&n.length>o+1&&(s=Array.prototype.slice.call(n,o+1))}this._microtasks.push({func:i.invoke,args:s,target:i.data&&i.data.target});break;case"macroTask":switch(i.source){case"setTimeout":i.data.handleId=this._setTimeout(i.invoke,i.data.delay,Array.prototype.slice.call(i.data.args,2));break;case"setImmediate":i.data.handleId=this._setTimeout(i.invoke,0,Array.prototype.slice.call(i.data.args,1));break;case"setInterval":i.data.handleId=this._setInterval(i.invoke,i.data.delay,Array.prototype.slice.call(i.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+i.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":i.data.handleId=this._setTimeout(i.invoke,16,i.data.args,this.trackPendingRequestAnimationFrame);break;default:var a=this.findMacroTaskOption(i);if(a){var c=i.data&&i.data.args,u=c&&c.length>1?c[1]:0,h=a.callbackArgs?a.callbackArgs:c;a.isPeriodic?(i.data.handleId=this._setInterval(i.invoke,u,h),i.data.isPeriodic=!0):i.data.handleId=this._setTimeout(i.invoke,u,h);break}throw new Error("Unknown macroTask scheduled in fake async test: "+i.source)}break;case"eventTask":i=e.scheduleTask(r,i)}return i},e.prototype.onCancelTask=function(e,t,r,i){switch(i.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(i.data.handleId);case"setInterval":return this._clearInterval(i.data.handleId);default:var n=this.findMacroTaskOption(i);if(n){var s=i.data.handleId;return n.isPeriodic?this._clearInterval(s):this._clearTimeout(s)}return e.cancelTask(r,i)}},e.prototype.onInvoke=function(t,r,i,n,s,o,a){try{return e.patchDate(),t.invoke(i,n,s,o,a)}finally{this.patchDateLocked||e.resetDate()}},e.prototype.findMacroTaskOption=function(e){if(!this.macroTaskOptions)return null;for(var t=0;t<this.macroTaskOptions.length;t++){var r=this.macroTaskOptions[t];if(r.source===e.source)return r}return null},e.prototype.onHandleError=function(e,t,r,i){return this._lastError=i,!1},e}(),c=null;function u(){return Zone&&Zone.ProxyZoneSpec}function h(){c&&c.unlockDatePatch(),c=null,u()&&u().assertPresent().resetDelegate()}function l(e){var t=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=u();if(!i)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");var n=i.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!c){var s=Zone&&Zone.FakeAsyncTestZoneSpec;if(n.getDelegate()instanceof s)throw new Error("fakeAsync() calls can not be nested");c=new s}var o=void 0,a=n.getDelegate();n.setDelegate(c),c.lockDatePatch();try{o=e.apply(this,t),f()}finally{n.setDelegate(a)}if(c.pendingPeriodicTimers.length>0)throw new Error("".concat(c.pendingPeriodicTimers.length," ")+"periodic timer(s) still in the queue.");if(c.pendingTimers.length>0)throw new Error("".concat(c.pendingTimers.length," timer(s) still in the queue."));return o}finally{h()}};return t.isFakeAsync=!0,t}function d(){if(null==c&&null==(c=Zone.current.get("FakeAsyncTestZoneSpec")))throw new Error("The code should be running in the fakeAsync zone to call this function");return c}function m(e,t){void 0===e&&(e=0),void 0===t&&(t=!1),d().tick(e,null,t)}function p(e){return d().flush(e)}function T(){d().pendingPeriodicTimers.length=0}function f(){d().flushMicrotasks()}!function _(e){e.FakeAsyncTestZoneSpec=a,e.__load_patch("fakeasync",(function(e,t,r){t[r.symbol("fakeAsyncTest")]={resetFakeAsyncZone:h,flushMicrotasks:f,discardPeriodicTasks:T,tick:m,flush:p,fakeAsync:l}}),!0),t={setTimeout:r.setTimeout,setInterval:r.setInterval,clearTimeout:r.clearTimeout,clearInterval:r.clearInterval,nativeSetTimeout:r[e.__symbol__("setTimeout")],nativeClearTimeout:r[e.__symbol__("clearTimeout")]},o.nextId=o.getNextId()}(Zone)}));
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){var e,t,r="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,i=r.Date;function n(){if(0===arguments.length){var e=new i;return e.setTime(n.now()),e}var t=Array.prototype.slice.call(arguments);return new(i.bind.apply(i,__spreadArray([void 0],t,!1)))}n.now=function(){var e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():i.now.apply(this,arguments)},n.UTC=i.UTC,n.parse=i.parse;var s=function(){},o=function(){function n(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=i.now(),this._currentTickRequeuePeriodicEntries=[]}return n.getNextId=function(){var i=t.nativeSetTimeout.call(r,s,0);return t.nativeClearTimeout.call(r,i),"number"==typeof i?i:e.nextNodeJSId++},n.prototype.getCurrentTickTime=function(){return this._currentTickTime},n.prototype.getFakeSystemTime=function(){return this._currentFakeBaseSystemTime+this._currentTickTime},n.prototype.setFakeBaseSystemTime=function(e){this._currentFakeBaseSystemTime=e},n.prototype.getRealSystemTime=function(){return i.now()},n.prototype.scheduleFunction=function(t,r,i){var n=(i=__assign({args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1},i)).id<0?e.nextId:i.id;e.nextId=e.getNextId();var s={endTime:this._currentTickTime+r,id:n,func:t,args:i.args,delay:r,isPeriodic:i.isPeriodic,isRequestAnimationFrame:i.isRequestAnimationFrame};i.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(s);for(var o=0;o<this._schedulerQueue.length&&!(s.endTime<this._schedulerQueue[o].endTime);o++);return this._schedulerQueue.splice(o,0,s),n},n.prototype.removeScheduledFunctionWithId=function(e){for(var t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}},n.prototype.removeAll=function(){this._schedulerQueue=[]},n.prototype.getTimerCount=function(){return this._schedulerQueue.length},n.prototype.tickToNext=function(e,t,r){void 0===e&&(e=1),this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,r)},n.prototype.tick=function(e,t,i){void 0===e&&(e=0);var n=this._currentTickTime+e,s=0,o=(i=Object.assign({processNewMacroTasksSynchronously:!0},i)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===o.length&&t)t(e);else{for(;o.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(n<o[0].endTime));){var a=o.shift();if(!i.processNewMacroTasksSynchronously){var c=this._schedulerQueue.indexOf(a);c>=0&&this._schedulerQueue.splice(c,1)}if(s=this._currentTickTime,this._currentTickTime=a.endTime,t&&t(this._currentTickTime-s),!a.func.apply(r,a.isRequestAnimationFrame?[this._currentTickTime]:a.args))break;i.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((function(e){for(var t=0;t<o.length&&!(e.endTime<o[t].endTime);t++);o.splice(t,0,e)}))}s=this._currentTickTime,this._currentTickTime=n,t&&t(this._currentTickTime-s)}},n.prototype.flushOnlyPendingTimers=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t},n.prototype.flush=function(e,t,r){return void 0===e&&(e=20),void 0===t&&(t=!1),t?this.flushPeriodic(r):this.flushNonPeriodic(e,r)},n.prototype.flushPeriodic=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t},n.prototype.flushNonPeriodic=function(e,t){for(var i=this._currentTickTime,n=0,s=0;this._schedulerQueue.length>0;){if(++s>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((function(e){return!e.isPeriodic&&!e.isRequestAnimationFrame})).length)break;var o=this._schedulerQueue.shift();if(n=this._currentTickTime,this._currentTickTime=o.endTime,t&&t(this._currentTickTime-n),!o.func.apply(r,o.args))break}return this._currentTickTime-i},n}();(e=o).nextNodeJSId=1,e.nextId=-1;var a=function(){function e(e,t,i){void 0===t&&(t=!1),this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=i,this._scheduler=new o,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=r[Zone.__symbol__("FakeAsyncTestMacroTask")])}return e.assertInZone=function(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")},e.prototype._fnAndFlush=function(e,t){var i=this;return function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];return e.apply(r,n),null===i._lastError?(null!=t.onSuccess&&t.onSuccess.apply(r),i.flushMicrotasks()):null!=t.onError&&t.onError.apply(r),null===i._lastError}},e._removeTimer=function(e,t){var r=e.indexOf(t);r>-1&&e.splice(r,1)},e.prototype._dequeueTimer=function(t){var r=this;return function(){e._removeTimer(r.pendingTimers,t)}},e.prototype._requeuePeriodicTimer=function(e,t,r,i){var n=this;return function(){-1!==n.pendingPeriodicTimers.indexOf(i)&&n._scheduler.scheduleFunction(e,t,{args:r,isPeriodic:!0,id:i,isRequeuePeriodic:!0})}},e.prototype._dequeuePeriodicTimer=function(t){var r=this;return function(){e._removeTimer(r.pendingPeriodicTimers,t)}},e.prototype._setTimeout=function(e,t,r,i){void 0===i&&(i=!0);var n=this._dequeueTimer(o.nextId),s=this._fnAndFlush(e,{onSuccess:n,onError:n}),a=this._scheduler.scheduleFunction(s,t,{args:r,isRequestAnimationFrame:!i});return i&&this.pendingTimers.push(a),a},e.prototype._clearTimeout=function(t){e._removeTimer(this.pendingTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._setInterval=function(e,t,r){var i=o.nextId,n={onSuccess:null,onError:this._dequeuePeriodicTimer(i)},s=this._fnAndFlush(e,n);return n.onSuccess=this._requeuePeriodicTimer(s,t,r,i),this._scheduler.scheduleFunction(s,t,{args:r,isPeriodic:!0}),this.pendingPeriodicTimers.push(i),i},e.prototype._clearInterval=function(t){e._removeTimer(this.pendingPeriodicTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._resetLastErrorAndThrow=function(){var e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e},e.prototype.getCurrentTickTime=function(){return this._scheduler.getCurrentTickTime()},e.prototype.getFakeSystemTime=function(){return this._scheduler.getFakeSystemTime()},e.prototype.setFakeBaseSystemTime=function(e){this._scheduler.setFakeBaseSystemTime(e)},e.prototype.getRealSystemTime=function(){return this._scheduler.getRealSystemTime()},e.patchDate=function(){r[Zone.__symbol__("disableDatePatching")]||r.Date!==n&&(r.Date=n,n.prototype=i.prototype,e.checkTimerPatch())},e.resetDate=function(){r.Date===n&&(r.Date=i)},e.checkTimerPatch=function(){if(!t)throw new Error("Expected timers to have been patched.");r.setTimeout!==t.setTimeout&&(r.setTimeout=t.setTimeout,r.clearTimeout=t.clearTimeout),r.setInterval!==t.setInterval&&(r.setInterval=t.setInterval,r.clearInterval=t.clearInterval)},e.prototype.lockDatePatch=function(){this.patchDateLocked=!0,e.patchDate()},e.prototype.unlockDatePatch=function(){this.patchDateLocked=!1,e.resetDate()},e.prototype.tickToNext=function(t,r,i){void 0===t&&(t=1),void 0===i&&(i={processNewMacroTasksSynchronously:!0}),t<=0||(e.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(t,r,i),null!==this._lastError&&this._resetLastErrorAndThrow())},e.prototype.tick=function(t,r,i){void 0===t&&(t=0),void 0===i&&(i={processNewMacroTasksSynchronously:!0}),e.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(t,r,i),null!==this._lastError&&this._resetLastErrorAndThrow()},e.prototype.flushMicrotasks=function(){var t=this;for(e.assertInZone();this._microtasks.length>0;){var r=this._microtasks.shift();r.func.apply(r.target,r.args)}(null!==t._lastError||t._uncaughtPromiseErrors.length)&&t._resetLastErrorAndThrow()},e.prototype.flush=function(t,r,i){e.assertInZone(),this.flushMicrotasks();var n=this._scheduler.flush(t,r,i);return null!==this._lastError&&this._resetLastErrorAndThrow(),n},e.prototype.flushOnlyPendingTimers=function(t){e.assertInZone(),this.flushMicrotasks();var r=this._scheduler.flushOnlyPendingTimers(t);return null!==this._lastError&&this._resetLastErrorAndThrow(),r},e.prototype.removeAllTimers=function(){e.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]},e.prototype.getTimerCount=function(){return this._scheduler.getTimerCount()+this._microtasks.length},e.prototype.onScheduleTask=function(e,t,r,i){switch(i.type){case"microTask":var n=i.data&&i.data.args,s=void 0;if(n){var o=i.data.cbIdx;"number"==typeof n.length&&n.length>o+1&&(s=Array.prototype.slice.call(n,o+1))}this._microtasks.push({func:i.invoke,args:s,target:i.data&&i.data.target});break;case"macroTask":switch(i.source){case"setTimeout":i.data.handleId=this._setTimeout(i.invoke,i.data.delay,Array.prototype.slice.call(i.data.args,2));break;case"setImmediate":i.data.handleId=this._setTimeout(i.invoke,0,Array.prototype.slice.call(i.data.args,1));break;case"setInterval":i.data.handleId=this._setInterval(i.invoke,i.data.delay,Array.prototype.slice.call(i.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+i.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":i.data.handleId=this._setTimeout(i.invoke,16,i.data.args,this.trackPendingRequestAnimationFrame);break;default:var a=this.findMacroTaskOption(i);if(a){var c=i.data&&i.data.args,u=c&&c.length>1?c[1]:0,h=a.callbackArgs?a.callbackArgs:c;a.isPeriodic?(i.data.handleId=this._setInterval(i.invoke,u,h),i.data.isPeriodic=!0):i.data.handleId=this._setTimeout(i.invoke,u,h);break}throw new Error("Unknown macroTask scheduled in fake async test: "+i.source)}break;case"eventTask":i=e.scheduleTask(r,i)}return i},e.prototype.onCancelTask=function(e,t,r,i){switch(i.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(i.data.handleId);case"setInterval":return this._clearInterval(i.data.handleId);default:var n=this.findMacroTaskOption(i);if(n){var s=i.data.handleId;return n.isPeriodic?this._clearInterval(s):this._clearTimeout(s)}return e.cancelTask(r,i)}},e.prototype.onInvoke=function(t,r,i,n,s,o,a){try{return e.patchDate(),t.invoke(i,n,s,o,a)}finally{this.patchDateLocked||e.resetDate()}},e.prototype.findMacroTaskOption=function(e){if(!this.macroTaskOptions)return null;for(var t=0;t<this.macroTaskOptions.length;t++){var r=this.macroTaskOptions[t];if(r.source===e.source)return r}return null},e.prototype.onHandleError=function(e,t,r,i){return this._lastError=i,!1},e}(),c=null;function u(){return Zone&&Zone.ProxyZoneSpec}function h(){c&&c.unlockDatePatch(),c=null,u()&&u().assertPresent().resetDelegate()}function l(e,t){void 0===t&&(t={});var r=t.flush,i=void 0!==r&&r,n=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=u();if(!n)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");var s=n.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!c){var o=Zone&&Zone.FakeAsyncTestZoneSpec;if(s.getDelegate()instanceof o)throw new Error("fakeAsync() calls can not be nested");c=new o}var a=void 0,l=s.getDelegate();s.setDelegate(c),c.lockDatePatch();try{a=e.apply(this,t),i?c.flush(20,!0):T()}finally{s.setDelegate(l)}if(!i){if(c.pendingPeriodicTimers.length>0)throw new Error("".concat(c.pendingPeriodicTimers.length," ")+"periodic timer(s) still in the queue.");if(c.pendingTimers.length>0)throw new Error("".concat(c.pendingTimers.length," timer(s) still in the queue."))}return a}finally{h()}};return n.isFakeAsync=!0,n}function d(){if(null==c&&null==(c=Zone.current.get("FakeAsyncTestZoneSpec")))throw new Error("The code should be running in the fakeAsync zone to call this function");return c}function m(e,t){void 0===e&&(e=0),void 0===t&&(t=!1),d().tick(e,null,t)}function p(e){return d().flush(e)}function f(){d().pendingPeriodicTimers.length=0}function T(){d().flushMicrotasks()}!function _(e){e.FakeAsyncTestZoneSpec=a,e.__load_patch("fakeasync",(function(e,t,r){t[r.symbol("fakeAsyncTest")]={resetFakeAsyncZone:h,flushMicrotasks:T,discardPeriodicTasks:f,tick:m,flush:p,fakeAsync:l}}),!0),t={setTimeout:r.setTimeout,setInterval:r.setInterval,clearTimeout:r.clearTimeout,clearInterval:r.clearInterval,nativeSetTimeout:r[e.__symbol__("setTimeout")],nativeClearTimeout:r[e.__symbol__("clearTimeout")]},o.nextId=o.getNextId()}(Zone)}));

@@ -7,2 +7,2 @@ "use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)},__spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))};

*/
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){var e,t=globalThis;function n(e){return(t.__Zone_symbol_prefix||"__zone_symbol__")+e}var r,i="undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global,s=function(){function e(e,t,r){this.finishCallback=e,this.failCallback=t,this._pendingMicroTasks=!1,this._pendingMacroTasks=!1,this._alreadyErrored=!1,this._isSync=!1,this._existingFinishTimer=null,this.entryFunction=null,this.runZone=Zone.current,this.unresolvedChainedPromiseCount=0,this.supportWaitUnresolvedChainedPromise=!1,this.name="asyncTestZone for "+r,this.properties={AsyncTestZoneSpec:this},this.supportWaitUnresolvedChainedPromise=!0===i[n("supportWaitUnResolvedChainedPromise")]}return Object.defineProperty(e,"symbolParentUnresolved",{get:function(){return n("parentUnresolved")},enumerable:!1,configurable:!0}),e.prototype.isUnresolvedChainedPromisePending=function(){return this.unresolvedChainedPromiseCount>0},e.prototype._finishCallbackIfDone=function(){var e=this;null!==this._existingFinishTimer&&(clearTimeout(this._existingFinishTimer),this._existingFinishTimer=null),this._pendingMicroTasks||this._pendingMacroTasks||this.supportWaitUnresolvedChainedPromise&&this.isUnresolvedChainedPromisePending()||this.runZone.run((function(){e._existingFinishTimer=setTimeout((function(){e._alreadyErrored||e._pendingMicroTasks||e._pendingMacroTasks||e.finishCallback()}),0)}))},e.prototype.patchPromiseForTest=function(){if(this.supportWaitUnresolvedChainedPromise){var e=Promise[Zone.__symbol__("patchPromiseForTest")];e&&e()}},e.prototype.unPatchPromiseForTest=function(){if(this.supportWaitUnresolvedChainedPromise){var e=Promise[Zone.__symbol__("unPatchPromiseForTest")];e&&e()}},e.prototype.onScheduleTask=function(t,n,r,i){return"eventTask"!==i.type&&(this._isSync=!1),"microTask"===i.type&&i.data&&i.data instanceof Promise&&!0===i.data[e.symbolParentUnresolved]&&this.unresolvedChainedPromiseCount--,t.scheduleTask(r,i)},e.prototype.onInvokeTask=function(e,t,n,r,i,s){return"eventTask"!==r.type&&(this._isSync=!1),e.invokeTask(n,r,i,s)},e.prototype.onCancelTask=function(e,t,n,r){return"eventTask"!==r.type&&(this._isSync=!1),e.cancelTask(n,r)},e.prototype.onInvoke=function(e,t,n,r,i,s,o){this.entryFunction||(this.entryFunction=r);try{return this._isSync=!0,e.invoke(n,r,i,s,o)}finally{this._isSync&&this.entryFunction===r&&this._finishCallbackIfDone()}},e.prototype.onHandleError=function(e,t,n,r){return e.handleError(n,r)&&(this.failCallback(r),this._alreadyErrored=!0),!1},e.prototype.onHasTask=function(e,t,n,r){e.hasTask(n,r),t===n&&("microTask"==r.change?(this._pendingMicroTasks=r.microTask,this._finishCallbackIfDone()):"macroTask"==r.change&&(this._pendingMacroTasks=r.macroTask,this._finishCallbackIfDone()))},e}(),o="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,a=o.Date;function c(){if(0===arguments.length){var e=new a;return e.setTime(c.now()),e}var t=Array.prototype.slice.call(arguments);return new(a.bind.apply(a,__spreadArray([void 0],t,!1)))}c.now=function(){var e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():a.now.apply(this,arguments)},c.UTC=a.UTC,c.parse=a.parse;var u=function(){},l=function(){function t(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=a.now(),this._currentTickRequeuePeriodicEntries=[]}return t.getNextId=function(){var t=r.nativeSetTimeout.call(o,u,0);return r.nativeClearTimeout.call(o,t),"number"==typeof t?t:e.nextNodeJSId++},t.prototype.getCurrentTickTime=function(){return this._currentTickTime},t.prototype.getFakeSystemTime=function(){return this._currentFakeBaseSystemTime+this._currentTickTime},t.prototype.setFakeBaseSystemTime=function(e){this._currentFakeBaseSystemTime=e},t.prototype.getRealSystemTime=function(){return a.now()},t.prototype.scheduleFunction=function(t,n,r){var i=(r=__assign({args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1},r)).id<0?e.nextId:r.id;e.nextId=e.getNextId();var s={endTime:this._currentTickTime+n,id:i,func:t,args:r.args,delay:n,isPeriodic:r.isPeriodic,isRequestAnimationFrame:r.isRequestAnimationFrame};r.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(s);for(var o=0;o<this._schedulerQueue.length&&!(s.endTime<this._schedulerQueue[o].endTime);o++);return this._schedulerQueue.splice(o,0,s),i},t.prototype.removeScheduledFunctionWithId=function(e){for(var t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}},t.prototype.removeAll=function(){this._schedulerQueue=[]},t.prototype.getTimerCount=function(){return this._schedulerQueue.length},t.prototype.tickToNext=function(e,t,n){void 0===e&&(e=1),this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,n)},t.prototype.tick=function(e,t,n){void 0===e&&(e=0);var r=this._currentTickTime+e,i=0,s=(n=Object.assign({processNewMacroTasksSynchronously:!0},n)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===s.length&&t)t(e);else{for(;s.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(r<s[0].endTime));){var a=s.shift();if(!n.processNewMacroTasksSynchronously){var c=this._schedulerQueue.indexOf(a);c>=0&&this._schedulerQueue.splice(c,1)}if(i=this._currentTickTime,this._currentTickTime=a.endTime,t&&t(this._currentTickTime-i),!a.func.apply(o,a.isRequestAnimationFrame?[this._currentTickTime]:a.args))break;n.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((function(e){for(var t=0;t<s.length&&!(e.endTime<s[t].endTime);t++);s.splice(t,0,e)}))}i=this._currentTickTime,this._currentTickTime=r,t&&t(this._currentTickTime-i)}},t.prototype.flushOnlyPendingTimers=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t},t.prototype.flush=function(e,t,n){return void 0===e&&(e=20),void 0===t&&(t=!1),t?this.flushPeriodic(n):this.flushNonPeriodic(e,n)},t.prototype.flushPeriodic=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t},t.prototype.flushNonPeriodic=function(e,t){for(var n=this._currentTickTime,r=0,i=0;this._schedulerQueue.length>0;){if(++i>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((function(e){return!e.isPeriodic&&!e.isRequestAnimationFrame})).length)break;var s=this._schedulerQueue.shift();if(r=this._currentTickTime,this._currentTickTime=s.endTime,t&&t(this._currentTickTime-r),!s.func.apply(o,s.args))break}return this._currentTickTime-n},t}();(e=l).nextNodeJSId=1,e.nextId=-1;var h=function(){function e(e,t,n){void 0===t&&(t=!1),this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=n,this._scheduler=new l,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=o[Zone.__symbol__("FakeAsyncTestMacroTask")])}return e.assertInZone=function(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")},e.prototype._fnAndFlush=function(e,t){var n=this;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.apply(o,r),null===n._lastError?(null!=t.onSuccess&&t.onSuccess.apply(o),n.flushMicrotasks()):null!=t.onError&&t.onError.apply(o),null===n._lastError}},e._removeTimer=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)},e.prototype._dequeueTimer=function(t){var n=this;return function(){e._removeTimer(n.pendingTimers,t)}},e.prototype._requeuePeriodicTimer=function(e,t,n,r){var i=this;return function(){-1!==i.pendingPeriodicTimers.indexOf(r)&&i._scheduler.scheduleFunction(e,t,{args:n,isPeriodic:!0,id:r,isRequeuePeriodic:!0})}},e.prototype._dequeuePeriodicTimer=function(t){var n=this;return function(){e._removeTimer(n.pendingPeriodicTimers,t)}},e.prototype._setTimeout=function(e,t,n,r){void 0===r&&(r=!0);var i=this._dequeueTimer(l.nextId),s=this._fnAndFlush(e,{onSuccess:i,onError:i}),o=this._scheduler.scheduleFunction(s,t,{args:n,isRequestAnimationFrame:!r});return r&&this.pendingTimers.push(o),o},e.prototype._clearTimeout=function(t){e._removeTimer(this.pendingTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._setInterval=function(e,t,n){var r=l.nextId,i={onSuccess:null,onError:this._dequeuePeriodicTimer(r)},s=this._fnAndFlush(e,i);return i.onSuccess=this._requeuePeriodicTimer(s,t,n,r),this._scheduler.scheduleFunction(s,t,{args:n,isPeriodic:!0}),this.pendingPeriodicTimers.push(r),r},e.prototype._clearInterval=function(t){e._removeTimer(this.pendingPeriodicTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._resetLastErrorAndThrow=function(){var e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e},e.prototype.getCurrentTickTime=function(){return this._scheduler.getCurrentTickTime()},e.prototype.getFakeSystemTime=function(){return this._scheduler.getFakeSystemTime()},e.prototype.setFakeBaseSystemTime=function(e){this._scheduler.setFakeBaseSystemTime(e)},e.prototype.getRealSystemTime=function(){return this._scheduler.getRealSystemTime()},e.patchDate=function(){o[Zone.__symbol__("disableDatePatching")]||o.Date!==c&&(o.Date=c,c.prototype=a.prototype,e.checkTimerPatch())},e.resetDate=function(){o.Date===c&&(o.Date=a)},e.checkTimerPatch=function(){if(!r)throw new Error("Expected timers to have been patched.");o.setTimeout!==r.setTimeout&&(o.setTimeout=r.setTimeout,o.clearTimeout=r.clearTimeout),o.setInterval!==r.setInterval&&(o.setInterval=r.setInterval,o.clearInterval=r.clearInterval)},e.prototype.lockDatePatch=function(){this.patchDateLocked=!0,e.patchDate()},e.prototype.unlockDatePatch=function(){this.patchDateLocked=!1,e.resetDate()},e.prototype.tickToNext=function(t,n,r){void 0===t&&(t=1),void 0===r&&(r={processNewMacroTasksSynchronously:!0}),t<=0||(e.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(t,n,r),null!==this._lastError&&this._resetLastErrorAndThrow())},e.prototype.tick=function(t,n,r){void 0===t&&(t=0),void 0===r&&(r={processNewMacroTasksSynchronously:!0}),e.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(t,n,r),null!==this._lastError&&this._resetLastErrorAndThrow()},e.prototype.flushMicrotasks=function(){var t=this;for(e.assertInZone();this._microtasks.length>0;){var n=this._microtasks.shift();n.func.apply(n.target,n.args)}(null!==t._lastError||t._uncaughtPromiseErrors.length)&&t._resetLastErrorAndThrow()},e.prototype.flush=function(t,n,r){e.assertInZone(),this.flushMicrotasks();var i=this._scheduler.flush(t,n,r);return null!==this._lastError&&this._resetLastErrorAndThrow(),i},e.prototype.flushOnlyPendingTimers=function(t){e.assertInZone(),this.flushMicrotasks();var n=this._scheduler.flushOnlyPendingTimers(t);return null!==this._lastError&&this._resetLastErrorAndThrow(),n},e.prototype.removeAllTimers=function(){e.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]},e.prototype.getTimerCount=function(){return this._scheduler.getTimerCount()+this._microtasks.length},e.prototype.onScheduleTask=function(e,t,n,r){switch(r.type){case"microTask":var i=r.data&&r.data.args,s=void 0;if(i){var o=r.data.cbIdx;"number"==typeof i.length&&i.length>o+1&&(s=Array.prototype.slice.call(i,o+1))}this._microtasks.push({func:r.invoke,args:s,target:r.data&&r.data.target});break;case"macroTask":switch(r.source){case"setTimeout":r.data.handleId=this._setTimeout(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"setImmediate":r.data.handleId=this._setTimeout(r.invoke,0,Array.prototype.slice.call(r.data.args,1));break;case"setInterval":r.data.handleId=this._setInterval(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+r.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":r.data.handleId=this._setTimeout(r.invoke,16,r.data.args,this.trackPendingRequestAnimationFrame);break;default:var a=this.findMacroTaskOption(r);if(a){var c=r.data&&r.data.args,u=c&&c.length>1?c[1]:0,l=a.callbackArgs?a.callbackArgs:c;a.isPeriodic?(r.data.handleId=this._setInterval(r.invoke,u,l),r.data.isPeriodic=!0):r.data.handleId=this._setTimeout(r.invoke,u,l);break}throw new Error("Unknown macroTask scheduled in fake async test: "+r.source)}break;case"eventTask":r=e.scheduleTask(n,r)}return r},e.prototype.onCancelTask=function(e,t,n,r){switch(r.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(r.data.handleId);case"setInterval":return this._clearInterval(r.data.handleId);default:var i=this.findMacroTaskOption(r);if(i){var s=r.data.handleId;return i.isPeriodic?this._clearInterval(s):this._clearTimeout(s)}return e.cancelTask(n,r)}},e.prototype.onInvoke=function(t,n,r,i,s,o,a){try{return e.patchDate(),t.invoke(r,i,s,o,a)}finally{this.patchDateLocked||e.resetDate()}},e.prototype.findMacroTaskOption=function(e){if(!this.macroTaskOptions)return null;for(var t=0;t<this.macroTaskOptions.length;t++){var n=this.macroTaskOptions[t];if(n.source===e.source)return n}return null},e.prototype.onHandleError=function(e,t,n,r){return this._lastError=r,!1},e}(),p=null;function f(){return Zone&&Zone.ProxyZoneSpec}function d(){p&&p.unlockDatePatch(),p=null,f()&&f().assertPresent().resetDelegate()}function y(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=f();if(!r)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");var i=r.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!p){var s=Zone&&Zone.FakeAsyncTestZoneSpec;if(i.getDelegate()instanceof s)throw new Error("fakeAsync() calls can not be nested");p=new s}var o=void 0,a=i.getDelegate();i.setDelegate(p),p.lockDatePatch();try{o=e.apply(this,t),g()}finally{i.setDelegate(a)}if(p.pendingPeriodicTimers.length>0)throw new Error("".concat(p.pendingPeriodicTimers.length," ")+"periodic timer(s) still in the queue.");if(p.pendingTimers.length>0)throw new Error("".concat(p.pendingTimers.length," timer(s) still in the queue."));return o}finally{d()}};return t.isFakeAsync=!0,t}function m(){if(null==p&&null==(p=Zone.current.get("FakeAsyncTestZoneSpec")))throw new Error("The code should be running in the fakeAsync zone to call this function");return p}function T(e,t){void 0===e&&(e=0),void 0===t&&(t=!1),m().tick(e,null,t)}function _(e){return m().flush(e)}function k(){m().pendingPeriodicTimers.length=0}function g(){m().flushMicrotasks()}function v(e){var t="\n",n={},r="__creationTrace__",i="STACKTRACE TRACKING",s="__SEP_TAG__",o=s+"@[native]",a=function a(){this.error=p(),this.timestamp=new Date};function c(){return new Error(i)}function u(){try{throw c()}catch(e){return e}}var l=c(),h=u(),p=l.stack?c:h.stack?u:c;function f(e){return e.stack?e.stack.split(t):[]}function d(e,t){for(var r=f(t),i=0;i<r.length;i++)n.hasOwnProperty(r[i])||e.push(r[i])}function y(e,n){var r=[n?n.trim():""];if(e)for(var i=(new Date).getTime(),a=0;a<e.length;a++){var c=e[a],u=c.timestamp,l="____________________Elapsed ".concat(i-u.getTime()," ms; At: ").concat(u);l=l.replace(/[^\w\d]/g,"_"),r.push(o.replace(s,l)),d(r,c.error),i=u.getTime()}return r.join(t)}function m(){return Error.stackTraceLimit>0}function T(e,t){t>0&&(e.push(f((new a).error)),T(e,t-1))}e.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(t){var n=t[e.__symbol__("currentTaskTrace")];return n?y(n,t.stack):t.stack}},onScheduleTask:function(t,n,i,s){if(m()){var o=e.currentTask,c=o&&o.data&&o.data[r]||[];(c=[new a].concat(c)).length>this.longStackTraceLimit&&(c.length=this.longStackTraceLimit),s.data||(s.data={}),"eventTask"===s.type&&(s.data=__assign({},s.data)),s.data[r]=c}return t.scheduleTask(i,s)},onHandleError:function(t,n,i,s){if(m()){var o=e.currentTask||s.task;if(s instanceof Error&&o){var a=y(o.data&&o.data[r],s.stack);try{s.stack=s.longStack=a}catch(e){}}}return t.handleError(i,s)}},function _(){if(m()){var e=[];T(e,2);for(var t=e[0],r=e[1],a=0;a<t.length;a++)if(-1==(u=t[a]).indexOf(i)){var c=u.match(/^\s*at\s+/);if(c){o=c[0]+s+" (http://localhost)";break}}for(a=0;a<t.length;a++){var u;if((u=t[a])!==r[a])break;n[u]=!0}}}()}var S=function(){function e(e){void 0===e&&(e=null),this.defaultSpecDelegate=e,this.name="ProxyZone",this._delegateSpec=null,this.properties={ProxyZoneSpec:this},this.propertyKeys=null,this.lastTaskState=null,this.isNeedToTriggerHasTask=!1,this.tasks=[],this.setDelegate(e)}return e.get=function(){return Zone.current.get("ProxyZoneSpec")},e.isLoaded=function(){return e.get()instanceof e},e.assertPresent=function(){if(!e.isLoaded())throw new Error("Expected to be running in 'ProxyZone', but it was not found.");return e.get()},e.prototype.setDelegate=function(e){var t=this,n=this._delegateSpec!==e;this._delegateSpec=e,this.propertyKeys&&this.propertyKeys.forEach((function(e){return delete t.properties[e]})),this.propertyKeys=null,e&&e.properties&&(this.propertyKeys=Object.keys(e.properties),this.propertyKeys.forEach((function(n){return t.properties[n]=e.properties[n]}))),n&&this.lastTaskState&&(this.lastTaskState.macroTask||this.lastTaskState.microTask)&&(this.isNeedToTriggerHasTask=!0)},e.prototype.getDelegate=function(){return this._delegateSpec},e.prototype.resetDelegate=function(){this.getDelegate(),this.setDelegate(this.defaultSpecDelegate)},e.prototype.tryTriggerHasTask=function(e,t,n){this.isNeedToTriggerHasTask&&this.lastTaskState&&(this.isNeedToTriggerHasTask=!1,this.onHasTask(e,t,n,this.lastTaskState))},e.prototype.removeFromTasks=function(e){if(this.tasks)for(var t=0;t<this.tasks.length;t++)if(this.tasks[t]===e)return void this.tasks.splice(t,1)},e.prototype.getAndClearPendingTasksInfo=function(){if(0===this.tasks.length)return"";var e="--Pending async tasks are: ["+this.tasks.map((function(e){var t=e.data&&Object.keys(e.data).map((function(t){return t+":"+e.data[t]})).join(",");return"type: ".concat(e.type,", source: ").concat(e.source,", args: {").concat(t,"}")}))+"]";return this.tasks=[],e},e.prototype.onFork=function(e,t,n,r){return this._delegateSpec&&this._delegateSpec.onFork?this._delegateSpec.onFork(e,t,n,r):e.fork(n,r)},e.prototype.onIntercept=function(e,t,n,r,i){return this._delegateSpec&&this._delegateSpec.onIntercept?this._delegateSpec.onIntercept(e,t,n,r,i):e.intercept(n,r,i)},e.prototype.onInvoke=function(e,t,n,r,i,s,o){return this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvoke?this._delegateSpec.onInvoke(e,t,n,r,i,s,o):e.invoke(n,r,i,s,o)},e.prototype.onHandleError=function(e,t,n,r){return this._delegateSpec&&this._delegateSpec.onHandleError?this._delegateSpec.onHandleError(e,t,n,r):e.handleError(n,r)},e.prototype.onScheduleTask=function(e,t,n,r){return"eventTask"!==r.type&&this.tasks.push(r),this._delegateSpec&&this._delegateSpec.onScheduleTask?this._delegateSpec.onScheduleTask(e,t,n,r):e.scheduleTask(n,r)},e.prototype.onInvokeTask=function(e,t,n,r,i,s){return"eventTask"!==r.type&&this.removeFromTasks(r),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvokeTask?this._delegateSpec.onInvokeTask(e,t,n,r,i,s):e.invokeTask(n,r,i,s)},e.prototype.onCancelTask=function(e,t,n,r){return"eventTask"!==r.type&&this.removeFromTasks(r),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onCancelTask?this._delegateSpec.onCancelTask(e,t,n,r):e.cancelTask(n,r)},e.prototype.onHasTask=function(e,t,n,r){this.lastTaskState=r,this._delegateSpec&&this._delegateSpec.onHasTask?this._delegateSpec.onHasTask(e,t,n,r):e.hasTask(n,r)},e}();!function b(e){v(e),function t(e){e.ProxyZoneSpec=S}(e),function n(e){var t=function(){function t(t){this.runZone=e.current,this.name="syncTestZone for "+t}return t.prototype.onScheduleTask=function(e,t,n,r){switch(r.type){case"microTask":case"macroTask":throw new Error("Cannot call ".concat(r.source," from within a sync test (").concat(this.name,")."));case"eventTask":r=e.scheduleTask(n,r)}return r},t}();e.SyncTestZoneSpec=t}(e),function i(e){e.__load_patch("jasmine",(function(e,t,n){if(!t)throw new Error("Missing: zone.js");if("undefined"==typeof jest&&"undefined"!=typeof jasmine&&!jasmine.__zone_patch__){jasmine.__zone_patch__=!0;var r=t.SyncTestZoneSpec,i=t.ProxyZoneSpec;if(!r)throw new Error("Missing: SyncTestZoneSpec");if(!i)throw new Error("Missing: ProxyZoneSpec");var s=t.current,o=t.__symbol__,a=!0===e[o("fakeAsyncDisablePatchingClock")],c=!a&&(!0===e[o("fakeAsyncPatchLock")]||!0===e[o("fakeAsyncAutoFakeAsyncWhenClockPatched")]);if(!0!==e[o("ignoreUnhandledRejection")]){var u=jasmine.GlobalErrors;u&&!jasmine[o("GlobalErrors")]&&(jasmine[o("GlobalErrors")]=u,jasmine.GlobalErrors=function(){var t=new u,n=t.install;return n&&!t[o("install")]&&(t[o("install")]=n,t.install=function(){var t="undefined"!=typeof process&&!!process.on,r=t?process.listeners("unhandledRejection"):e.eventListeners("unhandledrejection"),i=n.apply(this,arguments);return t?process.removeAllListeners("unhandledRejection"):e.removeAllListeners("unhandledrejection"),r&&r.forEach((function(n){t?process.on("unhandledRejection",n):e.addEventListener("unhandledrejection",n)})),i}),t})}var l=jasmine.getEnv();if(["describe","xdescribe","fdescribe"].forEach((function(e){var t=l[e];l[e]=function(e,n){return t.call(this,e,function i(e,t){return function(){return s.fork(new r("jasmine.describe#".concat(e))).run(t,this,arguments)}}(e,n))}})),["it","xit","fit"].forEach((function(e){var t=l[e];l[o(e)]=t,l[e]=function(e,n,r){return arguments[1]=y(n),t.apply(this,arguments)}})),["beforeEach","afterEach","beforeAll","afterAll"].forEach((function(e){var t=l[e];l[o(e)]=t,l[e]=function(e,n){return arguments[0]=y(e),t.apply(this,arguments)}})),!a){var h=jasmine[o("clock")]=jasmine.clock;jasmine.clock=function(){var e=h.apply(this,arguments);if(!e[o("patched")]){e[o("patched")]=o("patched");var n=e[o("tick")]=e.tick;e.tick=function(){var e=t.current.get("FakeAsyncTestZoneSpec");return e?e.tick.apply(e,arguments):n.apply(this,arguments)};var r=e[o("mockDate")]=e.mockDate;e.mockDate=function(){var e=t.current.get("FakeAsyncTestZoneSpec");if(e){var n=arguments.length>0?arguments[0]:new Date;return e.setFakeBaseSystemTime.apply(e,n&&"function"==typeof n.getTime?[n.getTime()]:arguments)}return r.apply(this,arguments)},c&&["install","uninstall"].forEach((function(n){var r=e[o(n)]=e[n];e[n]=function(){if(!t.FakeAsyncTestZoneSpec)return r.apply(this,arguments);jasmine[o("clockInstalled")]="install"===n}}))}return e}}if(!jasmine[t.__symbol__("createSpyObj")]){var p=jasmine.createSpyObj;jasmine[t.__symbol__("createSpyObj")]=p,jasmine.createSpyObj=function(){var e,t=Array.prototype.slice.call(arguments);if(t.length>=3&&t[2]){var n=Object.defineProperty;Object.defineProperty=function(e,t,r){return n.call(this,e,t,__assign(__assign({},r),{configurable:!0,enumerable:!0}))};try{e=p.apply(this,t)}finally{Object.defineProperty=n}}else e=p.apply(this,t);return e}}var f=jasmine.QueueRunner;jasmine.QueueRunner=function(n){function r(r){var i,o=this;r.onComplete&&(r.onComplete=(i=r.onComplete,function(){o.testProxyZone=null,o.testProxyZoneSpec=null,s.scheduleMicroTask("jasmine.onComplete",i)}));var a=e[t.__symbol__("setTimeout")],c=e[t.__symbol__("clearTimeout")];a&&(r.timeout={setTimeout:a||e.setTimeout,clearTimeout:c||e.clearTimeout}),jasmine.UserContext?(r.userContext||(r.userContext=new jasmine.UserContext),r.userContext.queueRunner=this):(r.userContext||(r.userContext={}),r.userContext.queueRunner=this);var u=r.onException;r.onException=function(e){if(e&&"Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL."===e.message){var t=this&&this.testProxyZoneSpec;if(t){var n=t.getAndClearPendingTasksInfo();try{e.message+=n}catch(e){}}}u&&u.call(this,e)},n.call(this,r)}return function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(r,n),r.prototype.execute=function(){for(var e=this,r=t.current,o=!1;r;){if(r===s){o=!0;break}r=r.parent}if(!o)throw new Error("Unexpected Zone: "+t.current.name);this.testProxyZoneSpec=new i,this.testProxyZone=s.fork(this.testProxyZoneSpec),t.currentTask?n.prototype.execute.call(this):t.current.scheduleMicroTask("jasmine.execute().forceTask",(function(){return f.prototype.execute.call(e)}))},r}(f)}function d(e,n,r,i){var s=!!jasmine[o("clockInstalled")],a=r.testProxyZone;if(s&&c){var u=t[t.__symbol__("fakeAsyncTest")];u&&"function"==typeof u.fakeAsync&&(e=u.fakeAsync(e))}return i?a.run(e,n,[i]):a.run(e,n)}function y(e){return e&&(e.length?function(t){return d(e,this,this.queueRunner,t)}:function(){return d(e,this,this.queueRunner)})}}))}(e),function a(e){e.__load_patch("jest",(function(e,t,n){if("undefined"!=typeof jest&&!jest.__zone_patch__){t[n.symbol("ignoreConsoleErrorUncaughtError")]=!0,jest.__zone_patch__=!0;var r=t.ProxyZoneSpec,i=t.SyncTestZoneSpec;if(!r)throw new Error("Missing ProxyZoneSpec");var s=t.current,o=s.fork(new i("jest.describe")),a=new r,c=s.fork(a);["describe","xdescribe","fdescribe"].forEach((function(n){var r=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=r,e[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[1]=u(e[1]),r.apply(this,e)},e[n].each=function i(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.apply(this,t);return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[1]=u(e[1]),r.apply(this,e)}}}(r.each))})),e.describe.only=e.fdescribe,e.describe.skip=e.xdescribe,["it","xit","fit","test","xtest"].forEach((function(n){var r=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=r,e[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[1]=l(e[1],!0),r.apply(this,e)},e[n].each=function i(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n[1]=l(n[1]),e.apply(this,t).apply(this,n)}}}(r.each),e[n].todo=r.todo)})),e.it.only=e.fit,e.it.skip=e.xit,e.test.only=e.fit,e.test.skip=e.xit,["beforeEach","afterEach","beforeAll","afterAll"].forEach((function(n){var r=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=r,e[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[0]=l(e[0]),r.apply(this,e)})})),t.patchJestObject=function e(r,i){function s(){return!!t.current.get("FakeAsyncTestZoneSpec")}function o(){var e=t.current.get("ProxyZoneSpec");return e&&e.isTestFunc}void 0===i&&(i=!1),r[n.symbol("fakeTimers")]||(r[n.symbol("fakeTimers")]=!0,n.patchMethod(r,"_checkFakeTimers",(function(e){return function(t,n){return!!s()||e.apply(t,n)}})),n.patchMethod(r,"useFakeTimers",(function(e){return function(r,s){return t[n.symbol("useFakeTimersCalled")]=!0,i||o()?e.apply(r,s):r}})),n.patchMethod(r,"useRealTimers",(function(e){return function(r,s){return t[n.symbol("useFakeTimersCalled")]=!1,i||o()?e.apply(r,s):r}})),n.patchMethod(r,"setSystemTime",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i||!s())return e.apply(n,r);i.setFakeBaseSystemTime(r[0])}})),n.patchMethod(r,"getRealSystemTime",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");return i&&s()?i.getRealSystemTime():e.apply(n,r)}})),n.patchMethod(r,"runAllTicks",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.flushMicrotasks()}})),n.patchMethod(r,"runAllTimers",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.flush(100,!0)}})),n.patchMethod(r,"advanceTimersByTime",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.tick(r[0])}})),n.patchMethod(r,"runOnlyPendingTimers",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.flushOnlyPendingTimers()}})),n.patchMethod(r,"advanceTimersToNextTimer",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.tickToNext(r[0])}})),n.patchMethod(r,"clearAllTimers",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.removeAllTimers()}})),n.patchMethod(r,"getTimerCount",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");return i?i.getTimerCount():e.apply(n,r)}})))}}function u(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o.run(e,this,t)}}function l(e,r){if(void 0===r&&(r=!1),"function"!=typeof e)return e;var i=function(){if(!0===t[n.symbol("useFakeTimersCalled")]&&e&&!e.isFakeAsync){var i=t[t.__symbol__("fakeAsyncTest")];i&&"function"==typeof i.fakeAsync&&(e=i.fakeAsync(e))}return a.isTestFunc=r,c.run(e,null,arguments)};return Object.defineProperty(i,"length",{configurable:!0,writable:!0,enumerable:!1}),i.length=e.length,i}}))}(e),function c(e){e.__load_patch("mocha",(function(e,t){var n=e.Mocha;if(void 0!==n){if(void 0===t)throw new Error("Missing Zone.js");var r=t.ProxyZoneSpec,i=t.SyncTestZoneSpec;if(!r)throw new Error("Missing ProxyZoneSpec");if(n.__zone_patch__)throw new Error('"Mocha" has already been patched with "Zone".');n.__zone_patch__=!0;var s,o,a=t.current,c=a.fork(new i("Mocha.describe")),u=null,l=a.fork(new r),h={after:e.after,afterEach:e.afterEach,before:e.before,beforeEach:e.beforeEach,describe:e.describe,it:e.it};e.describe=e.suite=function(){return h.describe.apply(this,f(arguments))},e.xdescribe=e.suite.skip=e.describe.skip=function(){return h.describe.skip.apply(this,f(arguments))},e.describe.only=e.suite.only=function(){return h.describe.only.apply(this,f(arguments))},e.it=e.specify=e.test=function(){return h.it.apply(this,d(arguments))},e.xit=e.xspecify=e.it.skip=function(){return h.it.skip.apply(this,d(arguments))},e.it.only=e.test.only=function(){return h.it.only.apply(this,d(arguments))},e.after=e.suiteTeardown=function(){return h.after.apply(this,y(arguments))},e.afterEach=e.teardown=function(){return h.afterEach.apply(this,d(arguments))},e.before=e.suiteSetup=function(){return h.before.apply(this,y(arguments))},e.beforeEach=e.setup=function(){return h.beforeEach.apply(this,d(arguments))},s=n.Runner.prototype.runTest,o=n.Runner.prototype.run,n.Runner.prototype.runTest=function(e){var n=this;t.current.scheduleMicroTask("mocha.forceTask",(function(){s.call(n,e)}))},n.Runner.prototype.run=function(e){return this.on("test",(function(e){u=a.fork(new r)})),this.on("fail",(function(e,t){var n=u&&u.get("ProxyZoneSpec");if(n&&t)try{t.message+=n.getAndClearPendingTasksInfo()}catch(e){}})),o.call(this,e)}}function p(e,t,n){for(var r=function(r){var i=e[r];"function"==typeof i&&(e[r]=0===i.length?t(i):n(i),e[r].toString=function(){return i.toString()})},i=0;i<e.length;i++)r(i);return e}function f(e){return p(e,(function(e){return function(){return c.run(e,this,arguments)}}))}function d(e){return p(e,(function(e){return function(){return u.run(e,this)}}),(function(e){return function(t){return u.run(e,this,[t])}}))}function y(e){return p(e,(function(e){return function(){return l.run(e,this)}}),(function(e){return function(t){return l.run(e,this,[t])}}))}}))}(e),function u(e){e.AsyncTestZoneSpec=s,e.__load_patch("asynctest",(function(e,t,n){function r(e,n,r,i){var s=t.current,o=t.AsyncTestZoneSpec;if(void 0===o)throw new Error("AsyncTestZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/async-test");var a=t.ProxyZoneSpec;if(!a)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");var c=a.get();a.assertPresent();var u=t.current.getZoneWith("ProxyZoneSpec"),l=c.getDelegate();return u.parent.run((function(){var e=new o((function(){c.getDelegate()==e&&c.setDelegate(l),e.unPatchPromiseForTest(),s.run((function(){r()}))}),(function(t){c.getDelegate()==e&&c.setDelegate(l),e.unPatchPromiseForTest(),s.run((function(){i(t)}))}),"test");c.setDelegate(e),e.patchPromiseForTest()})),t.current.runGuarded(e,n)}t[n.symbol("asyncTest")]=function t(n){return e.jasmine?function(e){e||((e=function(){}).fail=function(e){throw e}),r(n,this,e,(function(t){if("string"==typeof t)return e.fail(new Error(t));e.fail(t)}))}:function(){var e=this;return new Promise((function(t,i){r(n,e,t,i)}))}}}))}(e),function p(e){e.FakeAsyncTestZoneSpec=h,e.__load_patch("fakeasync",(function(e,t,n){t[n.symbol("fakeAsyncTest")]={resetFakeAsyncZone:d,flushMicrotasks:g,discardPeriodicTasks:k,tick:T,flush:_,fakeAsync:y}}),!0),r={setTimeout:o.setTimeout,setInterval:o.setInterval,clearTimeout:o.clearTimeout,clearInterval:o.clearInterval,nativeSetTimeout:o[e.__symbol__("setTimeout")],nativeClearTimeout:o[e.__symbol__("clearTimeout")]},l.nextId=l.getNextId()}(e),function f(e){e.__load_patch("promisefortest",(function(e,t,n){var r=n.symbol("state"),i=n.symbol("parentUnresolved");Promise[n.symbol("patchPromiseForTest")]=function e(){var n=Promise[t.__symbol__("ZonePromiseThen")];n||(n=Promise[t.__symbol__("ZonePromiseThen")]=Promise.prototype.then,Promise.prototype.then=function(){var e=n.apply(this,arguments);if(null===this[r]){var s=t.current.get("AsyncTestZoneSpec");s&&(s.unresolvedChainedPromiseCount++,e[i]=!0)}return e})},Promise[n.symbol("unPatchPromiseForTest")]=function e(){var n=Promise[t.__symbol__("ZonePromiseThen")];n&&(Promise.prototype.then=n,Promise[t.__symbol__("ZonePromiseThen")]=void 0)}}))}(e)}(Zone)}));
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){var e,t=globalThis;function n(e){return(t.__Zone_symbol_prefix||"__zone_symbol__")+e}var r,i="undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global,s=function(){function e(e,t,r){this.finishCallback=e,this.failCallback=t,this._pendingMicroTasks=!1,this._pendingMacroTasks=!1,this._alreadyErrored=!1,this._isSync=!1,this._existingFinishTimer=null,this.entryFunction=null,this.runZone=Zone.current,this.unresolvedChainedPromiseCount=0,this.supportWaitUnresolvedChainedPromise=!1,this.name="asyncTestZone for "+r,this.properties={AsyncTestZoneSpec:this},this.supportWaitUnresolvedChainedPromise=!0===i[n("supportWaitUnResolvedChainedPromise")]}return Object.defineProperty(e,"symbolParentUnresolved",{get:function(){return n("parentUnresolved")},enumerable:!1,configurable:!0}),e.prototype.isUnresolvedChainedPromisePending=function(){return this.unresolvedChainedPromiseCount>0},e.prototype._finishCallbackIfDone=function(){var e=this;null!==this._existingFinishTimer&&(clearTimeout(this._existingFinishTimer),this._existingFinishTimer=null),this._pendingMicroTasks||this._pendingMacroTasks||this.supportWaitUnresolvedChainedPromise&&this.isUnresolvedChainedPromisePending()||this.runZone.run((function(){e._existingFinishTimer=setTimeout((function(){e._alreadyErrored||e._pendingMicroTasks||e._pendingMacroTasks||e.finishCallback()}),0)}))},e.prototype.patchPromiseForTest=function(){if(this.supportWaitUnresolvedChainedPromise){var e=Promise[Zone.__symbol__("patchPromiseForTest")];e&&e()}},e.prototype.unPatchPromiseForTest=function(){if(this.supportWaitUnresolvedChainedPromise){var e=Promise[Zone.__symbol__("unPatchPromiseForTest")];e&&e()}},e.prototype.onScheduleTask=function(t,n,r,i){return"eventTask"!==i.type&&(this._isSync=!1),"microTask"===i.type&&i.data&&i.data instanceof Promise&&!0===i.data[e.symbolParentUnresolved]&&this.unresolvedChainedPromiseCount--,t.scheduleTask(r,i)},e.prototype.onInvokeTask=function(e,t,n,r,i,s){return"eventTask"!==r.type&&(this._isSync=!1),e.invokeTask(n,r,i,s)},e.prototype.onCancelTask=function(e,t,n,r){return"eventTask"!==r.type&&(this._isSync=!1),e.cancelTask(n,r)},e.prototype.onInvoke=function(e,t,n,r,i,s,o){this.entryFunction||(this.entryFunction=r);try{return this._isSync=!0,e.invoke(n,r,i,s,o)}finally{this._isSync&&this.entryFunction===r&&this._finishCallbackIfDone()}},e.prototype.onHandleError=function(e,t,n,r){return e.handleError(n,r)&&(this.failCallback(r),this._alreadyErrored=!0),!1},e.prototype.onHasTask=function(e,t,n,r){e.hasTask(n,r),t===n&&("microTask"==r.change?(this._pendingMicroTasks=r.microTask,this._finishCallbackIfDone()):"macroTask"==r.change&&(this._pendingMacroTasks=r.macroTask,this._finishCallbackIfDone()))},e}(),o="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,a=o.Date;function c(){if(0===arguments.length){var e=new a;return e.setTime(c.now()),e}var t=Array.prototype.slice.call(arguments);return new(a.bind.apply(a,__spreadArray([void 0],t,!1)))}c.now=function(){var e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():a.now.apply(this,arguments)},c.UTC=a.UTC,c.parse=a.parse;var u=function(){},l=function(){function t(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=a.now(),this._currentTickRequeuePeriodicEntries=[]}return t.getNextId=function(){var t=r.nativeSetTimeout.call(o,u,0);return r.nativeClearTimeout.call(o,t),"number"==typeof t?t:e.nextNodeJSId++},t.prototype.getCurrentTickTime=function(){return this._currentTickTime},t.prototype.getFakeSystemTime=function(){return this._currentFakeBaseSystemTime+this._currentTickTime},t.prototype.setFakeBaseSystemTime=function(e){this._currentFakeBaseSystemTime=e},t.prototype.getRealSystemTime=function(){return a.now()},t.prototype.scheduleFunction=function(t,n,r){var i=(r=__assign({args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1},r)).id<0?e.nextId:r.id;e.nextId=e.getNextId();var s={endTime:this._currentTickTime+n,id:i,func:t,args:r.args,delay:n,isPeriodic:r.isPeriodic,isRequestAnimationFrame:r.isRequestAnimationFrame};r.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(s);for(var o=0;o<this._schedulerQueue.length&&!(s.endTime<this._schedulerQueue[o].endTime);o++);return this._schedulerQueue.splice(o,0,s),i},t.prototype.removeScheduledFunctionWithId=function(e){for(var t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}},t.prototype.removeAll=function(){this._schedulerQueue=[]},t.prototype.getTimerCount=function(){return this._schedulerQueue.length},t.prototype.tickToNext=function(e,t,n){void 0===e&&(e=1),this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,n)},t.prototype.tick=function(e,t,n){void 0===e&&(e=0);var r=this._currentTickTime+e,i=0,s=(n=Object.assign({processNewMacroTasksSynchronously:!0},n)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===s.length&&t)t(e);else{for(;s.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(r<s[0].endTime));){var a=s.shift();if(!n.processNewMacroTasksSynchronously){var c=this._schedulerQueue.indexOf(a);c>=0&&this._schedulerQueue.splice(c,1)}if(i=this._currentTickTime,this._currentTickTime=a.endTime,t&&t(this._currentTickTime-i),!a.func.apply(o,a.isRequestAnimationFrame?[this._currentTickTime]:a.args))break;n.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((function(e){for(var t=0;t<s.length&&!(e.endTime<s[t].endTime);t++);s.splice(t,0,e)}))}i=this._currentTickTime,this._currentTickTime=r,t&&t(this._currentTickTime-i)}},t.prototype.flushOnlyPendingTimers=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t},t.prototype.flush=function(e,t,n){return void 0===e&&(e=20),void 0===t&&(t=!1),t?this.flushPeriodic(n):this.flushNonPeriodic(e,n)},t.prototype.flushPeriodic=function(e){if(0===this._schedulerQueue.length)return 0;var t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t},t.prototype.flushNonPeriodic=function(e,t){for(var n=this._currentTickTime,r=0,i=0;this._schedulerQueue.length>0;){if(++i>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((function(e){return!e.isPeriodic&&!e.isRequestAnimationFrame})).length)break;var s=this._schedulerQueue.shift();if(r=this._currentTickTime,this._currentTickTime=s.endTime,t&&t(this._currentTickTime-r),!s.func.apply(o,s.args))break}return this._currentTickTime-n},t}();(e=l).nextNodeJSId=1,e.nextId=-1;var h=function(){function e(e,t,n){void 0===t&&(t=!1),this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=n,this._scheduler=new l,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=o[Zone.__symbol__("FakeAsyncTestMacroTask")])}return e.assertInZone=function(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")},e.prototype._fnAndFlush=function(e,t){var n=this;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return e.apply(o,r),null===n._lastError?(null!=t.onSuccess&&t.onSuccess.apply(o),n.flushMicrotasks()):null!=t.onError&&t.onError.apply(o),null===n._lastError}},e._removeTimer=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)},e.prototype._dequeueTimer=function(t){var n=this;return function(){e._removeTimer(n.pendingTimers,t)}},e.prototype._requeuePeriodicTimer=function(e,t,n,r){var i=this;return function(){-1!==i.pendingPeriodicTimers.indexOf(r)&&i._scheduler.scheduleFunction(e,t,{args:n,isPeriodic:!0,id:r,isRequeuePeriodic:!0})}},e.prototype._dequeuePeriodicTimer=function(t){var n=this;return function(){e._removeTimer(n.pendingPeriodicTimers,t)}},e.prototype._setTimeout=function(e,t,n,r){void 0===r&&(r=!0);var i=this._dequeueTimer(l.nextId),s=this._fnAndFlush(e,{onSuccess:i,onError:i}),o=this._scheduler.scheduleFunction(s,t,{args:n,isRequestAnimationFrame:!r});return r&&this.pendingTimers.push(o),o},e.prototype._clearTimeout=function(t){e._removeTimer(this.pendingTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._setInterval=function(e,t,n){var r=l.nextId,i={onSuccess:null,onError:this._dequeuePeriodicTimer(r)},s=this._fnAndFlush(e,i);return i.onSuccess=this._requeuePeriodicTimer(s,t,n,r),this._scheduler.scheduleFunction(s,t,{args:n,isPeriodic:!0}),this.pendingPeriodicTimers.push(r),r},e.prototype._clearInterval=function(t){e._removeTimer(this.pendingPeriodicTimers,t),this._scheduler.removeScheduledFunctionWithId(t)},e.prototype._resetLastErrorAndThrow=function(){var e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e},e.prototype.getCurrentTickTime=function(){return this._scheduler.getCurrentTickTime()},e.prototype.getFakeSystemTime=function(){return this._scheduler.getFakeSystemTime()},e.prototype.setFakeBaseSystemTime=function(e){this._scheduler.setFakeBaseSystemTime(e)},e.prototype.getRealSystemTime=function(){return this._scheduler.getRealSystemTime()},e.patchDate=function(){o[Zone.__symbol__("disableDatePatching")]||o.Date!==c&&(o.Date=c,c.prototype=a.prototype,e.checkTimerPatch())},e.resetDate=function(){o.Date===c&&(o.Date=a)},e.checkTimerPatch=function(){if(!r)throw new Error("Expected timers to have been patched.");o.setTimeout!==r.setTimeout&&(o.setTimeout=r.setTimeout,o.clearTimeout=r.clearTimeout),o.setInterval!==r.setInterval&&(o.setInterval=r.setInterval,o.clearInterval=r.clearInterval)},e.prototype.lockDatePatch=function(){this.patchDateLocked=!0,e.patchDate()},e.prototype.unlockDatePatch=function(){this.patchDateLocked=!1,e.resetDate()},e.prototype.tickToNext=function(t,n,r){void 0===t&&(t=1),void 0===r&&(r={processNewMacroTasksSynchronously:!0}),t<=0||(e.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(t,n,r),null!==this._lastError&&this._resetLastErrorAndThrow())},e.prototype.tick=function(t,n,r){void 0===t&&(t=0),void 0===r&&(r={processNewMacroTasksSynchronously:!0}),e.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(t,n,r),null!==this._lastError&&this._resetLastErrorAndThrow()},e.prototype.flushMicrotasks=function(){var t=this;for(e.assertInZone();this._microtasks.length>0;){var n=this._microtasks.shift();n.func.apply(n.target,n.args)}(null!==t._lastError||t._uncaughtPromiseErrors.length)&&t._resetLastErrorAndThrow()},e.prototype.flush=function(t,n,r){e.assertInZone(),this.flushMicrotasks();var i=this._scheduler.flush(t,n,r);return null!==this._lastError&&this._resetLastErrorAndThrow(),i},e.prototype.flushOnlyPendingTimers=function(t){e.assertInZone(),this.flushMicrotasks();var n=this._scheduler.flushOnlyPendingTimers(t);return null!==this._lastError&&this._resetLastErrorAndThrow(),n},e.prototype.removeAllTimers=function(){e.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]},e.prototype.getTimerCount=function(){return this._scheduler.getTimerCount()+this._microtasks.length},e.prototype.onScheduleTask=function(e,t,n,r){switch(r.type){case"microTask":var i=r.data&&r.data.args,s=void 0;if(i){var o=r.data.cbIdx;"number"==typeof i.length&&i.length>o+1&&(s=Array.prototype.slice.call(i,o+1))}this._microtasks.push({func:r.invoke,args:s,target:r.data&&r.data.target});break;case"macroTask":switch(r.source){case"setTimeout":r.data.handleId=this._setTimeout(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"setImmediate":r.data.handleId=this._setTimeout(r.invoke,0,Array.prototype.slice.call(r.data.args,1));break;case"setInterval":r.data.handleId=this._setInterval(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+r.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":r.data.handleId=this._setTimeout(r.invoke,16,r.data.args,this.trackPendingRequestAnimationFrame);break;default:var a=this.findMacroTaskOption(r);if(a){var c=r.data&&r.data.args,u=c&&c.length>1?c[1]:0,l=a.callbackArgs?a.callbackArgs:c;a.isPeriodic?(r.data.handleId=this._setInterval(r.invoke,u,l),r.data.isPeriodic=!0):r.data.handleId=this._setTimeout(r.invoke,u,l);break}throw new Error("Unknown macroTask scheduled in fake async test: "+r.source)}break;case"eventTask":r=e.scheduleTask(n,r)}return r},e.prototype.onCancelTask=function(e,t,n,r){switch(r.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(r.data.handleId);case"setInterval":return this._clearInterval(r.data.handleId);default:var i=this.findMacroTaskOption(r);if(i){var s=r.data.handleId;return i.isPeriodic?this._clearInterval(s):this._clearTimeout(s)}return e.cancelTask(n,r)}},e.prototype.onInvoke=function(t,n,r,i,s,o,a){try{return e.patchDate(),t.invoke(r,i,s,o,a)}finally{this.patchDateLocked||e.resetDate()}},e.prototype.findMacroTaskOption=function(e){if(!this.macroTaskOptions)return null;for(var t=0;t<this.macroTaskOptions.length;t++){var n=this.macroTaskOptions[t];if(n.source===e.source)return n}return null},e.prototype.onHandleError=function(e,t,n,r){return this._lastError=r,!1},e}(),p=null;function f(){return Zone&&Zone.ProxyZoneSpec}function d(){p&&p.unlockDatePatch(),p=null,f()&&f().assertPresent().resetDelegate()}function y(e,t){void 0===t&&(t={});var n=t.flush,r=void 0!==n&&n,i=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=f();if(!i)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");var s=i.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!p){var o=Zone&&Zone.FakeAsyncTestZoneSpec;if(s.getDelegate()instanceof o)throw new Error("fakeAsync() calls can not be nested");p=new o}var a=void 0,c=s.getDelegate();s.setDelegate(p),p.lockDatePatch();try{a=e.apply(this,t),r?p.flush(20,!0):g()}finally{s.setDelegate(c)}if(!r){if(p.pendingPeriodicTimers.length>0)throw new Error("".concat(p.pendingPeriodicTimers.length," ")+"periodic timer(s) still in the queue.");if(p.pendingTimers.length>0)throw new Error("".concat(p.pendingTimers.length," timer(s) still in the queue."))}return a}finally{d()}};return i.isFakeAsync=!0,i}function m(){if(null==p&&null==(p=Zone.current.get("FakeAsyncTestZoneSpec")))throw new Error("The code should be running in the fakeAsync zone to call this function");return p}function T(e,t){void 0===e&&(e=0),void 0===t&&(t=!1),m().tick(e,null,t)}function _(e){return m().flush(e)}function k(){m().pendingPeriodicTimers.length=0}function g(){m().flushMicrotasks()}function v(e){var t="\n",n={},r="__creationTrace__",i="STACKTRACE TRACKING",s="__SEP_TAG__",o=s+"@[native]",a=function a(){this.error=p(),this.timestamp=new Date};function c(){return new Error(i)}function u(){try{throw c()}catch(e){return e}}var l=c(),h=u(),p=l.stack?c:h.stack?u:c;function f(e){return e.stack?e.stack.split(t):[]}function d(e,t){for(var r=f(t),i=0;i<r.length;i++)n.hasOwnProperty(r[i])||e.push(r[i])}function y(e,n){var r=[n?n.trim():""];if(e)for(var i=(new Date).getTime(),a=0;a<e.length;a++){var c=e[a],u=c.timestamp,l="____________________Elapsed ".concat(i-u.getTime()," ms; At: ").concat(u);l=l.replace(/[^\w\d]/g,"_"),r.push(o.replace(s,l)),d(r,c.error),i=u.getTime()}return r.join(t)}function m(){return Error.stackTraceLimit>0}function T(e,t){t>0&&(e.push(f((new a).error)),T(e,t-1))}e.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(t){var n=t[e.__symbol__("currentTaskTrace")];return n?y(n,t.stack):t.stack}},onScheduleTask:function(t,n,i,s){if(m()){var o=e.currentTask,c=o&&o.data&&o.data[r]||[];(c=[new a].concat(c)).length>this.longStackTraceLimit&&(c.length=this.longStackTraceLimit),s.data||(s.data={}),"eventTask"===s.type&&(s.data=__assign({},s.data)),s.data[r]=c}return t.scheduleTask(i,s)},onHandleError:function(t,n,i,s){if(m()){var o=e.currentTask||s.task;if(s instanceof Error&&o){var a=y(o.data&&o.data[r],s.stack);try{s.stack=s.longStack=a}catch(e){}}}return t.handleError(i,s)}},function _(){if(m()){var e=[];T(e,2);for(var t=e[0],r=e[1],a=0;a<t.length;a++)if(-1==(u=t[a]).indexOf(i)){var c=u.match(/^\s*at\s+/);if(c){o=c[0]+s+" (http://localhost)";break}}for(a=0;a<t.length;a++){var u;if((u=t[a])!==r[a])break;n[u]=!0}}}()}var S=function(){function e(e){void 0===e&&(e=null),this.defaultSpecDelegate=e,this.name="ProxyZone",this._delegateSpec=null,this.properties={ProxyZoneSpec:this},this.propertyKeys=null,this.lastTaskState=null,this.isNeedToTriggerHasTask=!1,this.tasks=[],this.setDelegate(e)}return e.get=function(){return Zone.current.get("ProxyZoneSpec")},e.isLoaded=function(){return e.get()instanceof e},e.assertPresent=function(){if(!e.isLoaded())throw new Error("Expected to be running in 'ProxyZone', but it was not found.");return e.get()},e.prototype.setDelegate=function(e){var t=this,n=this._delegateSpec!==e;this._delegateSpec=e,this.propertyKeys&&this.propertyKeys.forEach((function(e){return delete t.properties[e]})),this.propertyKeys=null,e&&e.properties&&(this.propertyKeys=Object.keys(e.properties),this.propertyKeys.forEach((function(n){return t.properties[n]=e.properties[n]}))),n&&this.lastTaskState&&(this.lastTaskState.macroTask||this.lastTaskState.microTask)&&(this.isNeedToTriggerHasTask=!0)},e.prototype.getDelegate=function(){return this._delegateSpec},e.prototype.resetDelegate=function(){this.getDelegate(),this.setDelegate(this.defaultSpecDelegate)},e.prototype.tryTriggerHasTask=function(e,t,n){this.isNeedToTriggerHasTask&&this.lastTaskState&&(this.isNeedToTriggerHasTask=!1,this.onHasTask(e,t,n,this.lastTaskState))},e.prototype.removeFromTasks=function(e){if(this.tasks)for(var t=0;t<this.tasks.length;t++)if(this.tasks[t]===e)return void this.tasks.splice(t,1)},e.prototype.getAndClearPendingTasksInfo=function(){if(0===this.tasks.length)return"";var e="--Pending async tasks are: ["+this.tasks.map((function(e){var t=e.data&&Object.keys(e.data).map((function(t){return t+":"+e.data[t]})).join(",");return"type: ".concat(e.type,", source: ").concat(e.source,", args: {").concat(t,"}")}))+"]";return this.tasks=[],e},e.prototype.onFork=function(e,t,n,r){return this._delegateSpec&&this._delegateSpec.onFork?this._delegateSpec.onFork(e,t,n,r):e.fork(n,r)},e.prototype.onIntercept=function(e,t,n,r,i){return this._delegateSpec&&this._delegateSpec.onIntercept?this._delegateSpec.onIntercept(e,t,n,r,i):e.intercept(n,r,i)},e.prototype.onInvoke=function(e,t,n,r,i,s,o){return this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvoke?this._delegateSpec.onInvoke(e,t,n,r,i,s,o):e.invoke(n,r,i,s,o)},e.prototype.onHandleError=function(e,t,n,r){return this._delegateSpec&&this._delegateSpec.onHandleError?this._delegateSpec.onHandleError(e,t,n,r):e.handleError(n,r)},e.prototype.onScheduleTask=function(e,t,n,r){return"eventTask"!==r.type&&this.tasks.push(r),this._delegateSpec&&this._delegateSpec.onScheduleTask?this._delegateSpec.onScheduleTask(e,t,n,r):e.scheduleTask(n,r)},e.prototype.onInvokeTask=function(e,t,n,r,i,s){return"eventTask"!==r.type&&this.removeFromTasks(r),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvokeTask?this._delegateSpec.onInvokeTask(e,t,n,r,i,s):e.invokeTask(n,r,i,s)},e.prototype.onCancelTask=function(e,t,n,r){return"eventTask"!==r.type&&this.removeFromTasks(r),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onCancelTask?this._delegateSpec.onCancelTask(e,t,n,r):e.cancelTask(n,r)},e.prototype.onHasTask=function(e,t,n,r){this.lastTaskState=r,this._delegateSpec&&this._delegateSpec.onHasTask?this._delegateSpec.onHasTask(e,t,n,r):e.hasTask(n,r)},e}();!function b(e){v(e),function t(e){e.ProxyZoneSpec=S}(e),function n(e){var t=function(){function t(t){this.runZone=e.current,this.name="syncTestZone for "+t}return t.prototype.onScheduleTask=function(e,t,n,r){switch(r.type){case"microTask":case"macroTask":throw new Error("Cannot call ".concat(r.source," from within a sync test (").concat(this.name,")."));case"eventTask":r=e.scheduleTask(n,r)}return r},t}();e.SyncTestZoneSpec=t}(e),function i(e){e.__load_patch("jasmine",(function(e,t,n){if(!t)throw new Error("Missing: zone.js");if("undefined"==typeof jest&&"undefined"!=typeof jasmine&&!jasmine.__zone_patch__){jasmine.__zone_patch__=!0;var r=t.SyncTestZoneSpec,i=t.ProxyZoneSpec;if(!r)throw new Error("Missing: SyncTestZoneSpec");if(!i)throw new Error("Missing: ProxyZoneSpec");var s=t.current,o=t.__symbol__,a=!0===e[o("fakeAsyncDisablePatchingClock")],c=!a&&(!0===e[o("fakeAsyncPatchLock")]||!0===e[o("fakeAsyncAutoFakeAsyncWhenClockPatched")]);if(!0!==e[o("ignoreUnhandledRejection")]){var u=jasmine.GlobalErrors;u&&!jasmine[o("GlobalErrors")]&&(jasmine[o("GlobalErrors")]=u,jasmine.GlobalErrors=function(){var t=new u,n=t.install;return n&&!t[o("install")]&&(t[o("install")]=n,t.install=function(){var t="undefined"!=typeof process&&!!process.on,r=t?process.listeners("unhandledRejection"):e.eventListeners("unhandledrejection"),i=n.apply(this,arguments);return t?process.removeAllListeners("unhandledRejection"):e.removeAllListeners("unhandledrejection"),r&&r.forEach((function(n){t?process.on("unhandledRejection",n):e.addEventListener("unhandledrejection",n)})),i}),t})}var l=jasmine.getEnv();if(["describe","xdescribe","fdescribe"].forEach((function(e){var t=l[e];l[e]=function(e,n){return t.call(this,e,function i(e,t){return function(){return s.fork(new r("jasmine.describe#".concat(e))).run(t,this,arguments)}}(e,n))}})),["it","xit","fit"].forEach((function(e){var t=l[e];l[o(e)]=t,l[e]=function(e,n,r){return arguments[1]=y(n),t.apply(this,arguments)}})),["beforeEach","afterEach","beforeAll","afterAll"].forEach((function(e){var t=l[e];l[o(e)]=t,l[e]=function(e,n){return arguments[0]=y(e),t.apply(this,arguments)}})),!a){var h=jasmine[o("clock")]=jasmine.clock;jasmine.clock=function(){var e=h.apply(this,arguments);if(!e[o("patched")]){e[o("patched")]=o("patched");var n=e[o("tick")]=e.tick;e.tick=function(){var e=t.current.get("FakeAsyncTestZoneSpec");return e?e.tick.apply(e,arguments):n.apply(this,arguments)};var r=e[o("mockDate")]=e.mockDate;e.mockDate=function(){var e=t.current.get("FakeAsyncTestZoneSpec");if(e){var n=arguments.length>0?arguments[0]:new Date;return e.setFakeBaseSystemTime.apply(e,n&&"function"==typeof n.getTime?[n.getTime()]:arguments)}return r.apply(this,arguments)},c&&["install","uninstall"].forEach((function(n){var r=e[o(n)]=e[n];e[n]=function(){if(!t.FakeAsyncTestZoneSpec)return r.apply(this,arguments);jasmine[o("clockInstalled")]="install"===n}}))}return e}}if(!jasmine[t.__symbol__("createSpyObj")]){var p=jasmine.createSpyObj;jasmine[t.__symbol__("createSpyObj")]=p,jasmine.createSpyObj=function(){var e,t=Array.prototype.slice.call(arguments);if(t.length>=3&&t[2]){var n=Object.defineProperty;Object.defineProperty=function(e,t,r){return n.call(this,e,t,__assign(__assign({},r),{configurable:!0,enumerable:!0}))};try{e=p.apply(this,t)}finally{Object.defineProperty=n}}else e=p.apply(this,t);return e}}var f=jasmine.QueueRunner;jasmine.QueueRunner=function(n){function r(r){var i,o=this;r.onComplete&&(r.onComplete=(i=r.onComplete,function(){o.testProxyZone=null,o.testProxyZoneSpec=null,s.scheduleMicroTask("jasmine.onComplete",i)}));var a=e[t.__symbol__("setTimeout")],c=e[t.__symbol__("clearTimeout")];a&&(r.timeout={setTimeout:a||e.setTimeout,clearTimeout:c||e.clearTimeout}),jasmine.UserContext?(r.userContext||(r.userContext=new jasmine.UserContext),r.userContext.queueRunner=this):(r.userContext||(r.userContext={}),r.userContext.queueRunner=this);var u=r.onException;r.onException=function(e){if(e&&"Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL."===e.message){var t=this&&this.testProxyZoneSpec;if(t){var n=t.getAndClearPendingTasksInfo();try{e.message+=n}catch(e){}}}u&&u.call(this,e)},n.call(this,r)}return function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function r(){this.constructor=e}e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(r,n),r.prototype.execute=function(){for(var e=this,r=t.current,o=!1;r;){if(r===s){o=!0;break}r=r.parent}if(!o)throw new Error("Unexpected Zone: "+t.current.name);this.testProxyZoneSpec=new i,this.testProxyZone=s.fork(this.testProxyZoneSpec),t.currentTask?n.prototype.execute.call(this):t.current.scheduleMicroTask("jasmine.execute().forceTask",(function(){return f.prototype.execute.call(e)}))},r}(f)}function d(e,n,r,i){var s=!!jasmine[o("clockInstalled")],a=r.testProxyZone;if(s&&c){var u=t[t.__symbol__("fakeAsyncTest")];u&&"function"==typeof u.fakeAsync&&(e=u.fakeAsync(e))}return i?a.run(e,n,[i]):a.run(e,n)}function y(e){return e&&(e.length?function(t){return d(e,this,this.queueRunner,t)}:function(){return d(e,this,this.queueRunner)})}}))}(e),function a(e){e.__load_patch("jest",(function(e,t,n){if("undefined"!=typeof jest&&!jest.__zone_patch__){t[n.symbol("ignoreConsoleErrorUncaughtError")]=!0,jest.__zone_patch__=!0;var r=t.ProxyZoneSpec,i=t.SyncTestZoneSpec;if(!r)throw new Error("Missing ProxyZoneSpec");var s=t.current,o=s.fork(new i("jest.describe")),a=new r,c=s.fork(a);["describe","xdescribe","fdescribe"].forEach((function(n){var r=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=r,e[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[1]=u(e[1]),r.apply(this,e)},e[n].each=function i(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.apply(this,t);return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[1]=u(e[1]),r.apply(this,e)}}}(r.each))})),e.describe.only=e.fdescribe,e.describe.skip=e.xdescribe,["it","xit","fit","test","xtest"].forEach((function(n){var r=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=r,e[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[1]=l(e[1],!0),r.apply(this,e)},e[n].each=function i(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n[1]=l(n[1]),e.apply(this,t).apply(this,n)}}}(r.each),e[n].todo=r.todo)})),e.it.only=e.fit,e.it.skip=e.xit,e.test.only=e.fit,e.test.skip=e.xit,["beforeEach","afterEach","beforeAll","afterAll"].forEach((function(n){var r=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=r,e[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[0]=l(e[0]),r.apply(this,e)})})),t.patchJestObject=function e(r,i){function s(){return!!t.current.get("FakeAsyncTestZoneSpec")}function o(){var e=t.current.get("ProxyZoneSpec");return e&&e.isTestFunc}void 0===i&&(i=!1),r[n.symbol("fakeTimers")]||(r[n.symbol("fakeTimers")]=!0,n.patchMethod(r,"_checkFakeTimers",(function(e){return function(t,n){return!!s()||e.apply(t,n)}})),n.patchMethod(r,"useFakeTimers",(function(e){return function(r,s){return t[n.symbol("useFakeTimersCalled")]=!0,i||o()?e.apply(r,s):r}})),n.patchMethod(r,"useRealTimers",(function(e){return function(r,s){return t[n.symbol("useFakeTimersCalled")]=!1,i||o()?e.apply(r,s):r}})),n.patchMethod(r,"setSystemTime",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i||!s())return e.apply(n,r);i.setFakeBaseSystemTime(r[0])}})),n.patchMethod(r,"getRealSystemTime",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");return i&&s()?i.getRealSystemTime():e.apply(n,r)}})),n.patchMethod(r,"runAllTicks",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.flushMicrotasks()}})),n.patchMethod(r,"runAllTimers",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.flush(100,!0)}})),n.patchMethod(r,"advanceTimersByTime",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.tick(r[0])}})),n.patchMethod(r,"runOnlyPendingTimers",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.flushOnlyPendingTimers()}})),n.patchMethod(r,"advanceTimersToNextTimer",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.tickToNext(r[0])}})),n.patchMethod(r,"clearAllTimers",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");if(!i)return e.apply(n,r);i.removeAllTimers()}})),n.patchMethod(r,"getTimerCount",(function(e){return function(n,r){var i=t.current.get("FakeAsyncTestZoneSpec");return i?i.getTimerCount():e.apply(n,r)}})))}}function u(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o.run(e,this,t)}}function l(e,r){if(void 0===r&&(r=!1),"function"!=typeof e)return e;var i=function(){if(!0===t[n.symbol("useFakeTimersCalled")]&&e&&!e.isFakeAsync){var i=t[t.__symbol__("fakeAsyncTest")];i&&"function"==typeof i.fakeAsync&&(e=i.fakeAsync(e))}return a.isTestFunc=r,c.run(e,null,arguments)};return Object.defineProperty(i,"length",{configurable:!0,writable:!0,enumerable:!1}),i.length=e.length,i}}))}(e),function c(e){e.__load_patch("mocha",(function(e,t){var n=e.Mocha;if(void 0!==n){if(void 0===t)throw new Error("Missing Zone.js");var r=t.ProxyZoneSpec,i=t.SyncTestZoneSpec;if(!r)throw new Error("Missing ProxyZoneSpec");if(n.__zone_patch__)throw new Error('"Mocha" has already been patched with "Zone".');n.__zone_patch__=!0;var s,o,a=t.current,c=a.fork(new i("Mocha.describe")),u=null,l=a.fork(new r),h={after:e.after,afterEach:e.afterEach,before:e.before,beforeEach:e.beforeEach,describe:e.describe,it:e.it};e.describe=e.suite=function(){return h.describe.apply(this,f(arguments))},e.xdescribe=e.suite.skip=e.describe.skip=function(){return h.describe.skip.apply(this,f(arguments))},e.describe.only=e.suite.only=function(){return h.describe.only.apply(this,f(arguments))},e.it=e.specify=e.test=function(){return h.it.apply(this,d(arguments))},e.xit=e.xspecify=e.it.skip=function(){return h.it.skip.apply(this,d(arguments))},e.it.only=e.test.only=function(){return h.it.only.apply(this,d(arguments))},e.after=e.suiteTeardown=function(){return h.after.apply(this,y(arguments))},e.afterEach=e.teardown=function(){return h.afterEach.apply(this,d(arguments))},e.before=e.suiteSetup=function(){return h.before.apply(this,y(arguments))},e.beforeEach=e.setup=function(){return h.beforeEach.apply(this,d(arguments))},s=n.Runner.prototype.runTest,o=n.Runner.prototype.run,n.Runner.prototype.runTest=function(e){var n=this;t.current.scheduleMicroTask("mocha.forceTask",(function(){s.call(n,e)}))},n.Runner.prototype.run=function(e){return this.on("test",(function(e){u=a.fork(new r)})),this.on("fail",(function(e,t){var n=u&&u.get("ProxyZoneSpec");if(n&&t)try{t.message+=n.getAndClearPendingTasksInfo()}catch(e){}})),o.call(this,e)}}function p(e,t,n){for(var r=function(r){var i=e[r];"function"==typeof i&&(e[r]=0===i.length?t(i):n(i),e[r].toString=function(){return i.toString()})},i=0;i<e.length;i++)r(i);return e}function f(e){return p(e,(function(e){return function(){return c.run(e,this,arguments)}}))}function d(e){return p(e,(function(e){return function(){return u.run(e,this)}}),(function(e){return function(t){return u.run(e,this,[t])}}))}function y(e){return p(e,(function(e){return function(){return l.run(e,this)}}),(function(e){return function(t){return l.run(e,this,[t])}}))}}))}(e),function u(e){e.AsyncTestZoneSpec=s,e.__load_patch("asynctest",(function(e,t,n){function r(e,n,r,i){var s=t.current,o=t.AsyncTestZoneSpec;if(void 0===o)throw new Error("AsyncTestZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/async-test");var a=t.ProxyZoneSpec;if(!a)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");var c=a.get();a.assertPresent();var u=t.current.getZoneWith("ProxyZoneSpec"),l=c.getDelegate();return u.parent.run((function(){var e=new o((function(){c.getDelegate()==e&&c.setDelegate(l),e.unPatchPromiseForTest(),s.run((function(){r()}))}),(function(t){c.getDelegate()==e&&c.setDelegate(l),e.unPatchPromiseForTest(),s.run((function(){i(t)}))}),"test");c.setDelegate(e),e.patchPromiseForTest()})),t.current.runGuarded(e,n)}t[n.symbol("asyncTest")]=function t(n){return e.jasmine?function(e){e||((e=function(){}).fail=function(e){throw e}),r(n,this,e,(function(t){if("string"==typeof t)return e.fail(new Error(t));e.fail(t)}))}:function(){var e=this;return new Promise((function(t,i){r(n,e,t,i)}))}}}))}(e),function p(e){e.FakeAsyncTestZoneSpec=h,e.__load_patch("fakeasync",(function(e,t,n){t[n.symbol("fakeAsyncTest")]={resetFakeAsyncZone:d,flushMicrotasks:g,discardPeriodicTasks:k,tick:T,flush:_,fakeAsync:y}}),!0),r={setTimeout:o.setTimeout,setInterval:o.setInterval,clearTimeout:o.clearTimeout,clearInterval:o.clearInterval,nativeSetTimeout:o[e.__symbol__("setTimeout")],nativeClearTimeout:o[e.__symbol__("clearTimeout")]},l.nextId=l.getNextId()}(e),function f(e){e.__load_patch("promisefortest",(function(e,t,n){var r=n.symbol("state"),i=n.symbol("parentUnresolved");Promise[n.symbol("patchPromiseForTest")]=function e(){var n=Promise[t.__symbol__("ZonePromiseThen")];n||(n=Promise[t.__symbol__("ZonePromiseThen")]=Promise.prototype.then,Promise.prototype.then=function(){var e=n.apply(this,arguments);if(null===this[r]){var s=t.current.get("AsyncTestZoneSpec");s&&(s.unresolvedChainedPromiseCount++,e[i]=!0)}return e})},Promise[n.symbol("unPatchPromiseForTest")]=function e(){var n=Promise[t.__symbol__("ZonePromiseThen")];n&&(Promise.prototype.then=n,Promise[t.__symbol__("ZonePromiseThen")]=void 0)}}))}(e)}(Zone)}));

@@ -628,3 +628,4 @@ 'use strict';

*
* If there are any pending timers at the end of the function, an exception will be thrown.
* When flush is `false`, if there are any pending timers at the end of the function,
* an exception will be thrown.
*

@@ -638,2 +639,4 @@ * Can be used to wrap inject() calls.

* @param fn
* @param options
* flush: when true, will drain the macrotask queue after the test function completes.
* @returns The function wrapped to be executed in the fakeAsync zone

@@ -643,3 +646,4 @@ *

*/
function fakeAsync(fn) {
function fakeAsync(fn, options = {}) {
const { flush = false } = options;
// Not using an arrow function to preserve context passed from call site

@@ -671,3 +675,8 @@ const fakeAsyncFn = function (...args) {

res = fn.apply(this, args);
flushMicrotasks();
if (flush) {
_fakeAsyncTestZoneSpec.flush(20, true);
}
else {
flushMicrotasks();
}
}

@@ -677,9 +686,11 @@ finally {

}
if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {
throw new Error(`${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} ` +
`periodic timer(s) still in the queue.`);
if (!flush) {
if (_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length > 0) {
throw new Error(`${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} ` +
`periodic timer(s) still in the queue.`);
}
if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {
throw new Error(`${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`);
}
}
if (_fakeAsyncTestZoneSpec.pendingTimers.length > 0) {
throw new Error(`${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`);
}
return res;

@@ -686,0 +697,0 @@ }

@@ -6,2 +6,2 @@ "use strict";

* License: MIT
*/const global="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,OriginalDate=global.Date;function FakeDate(){if(0===arguments.length){const e=new OriginalDate;return e.setTime(FakeDate.now()),e}{const e=Array.prototype.slice.call(arguments);return new OriginalDate(...e)}}let patchedTimers;FakeDate.now=function(){const e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():OriginalDate.now.apply(this,arguments)},FakeDate.UTC=OriginalDate.UTC,FakeDate.parse=OriginalDate.parse;const timeoutCallback=function(){};class Scheduler{static{this.nextNodeJSId=1}static{this.nextId=-1}constructor(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=OriginalDate.now(),this._currentTickRequeuePeriodicEntries=[]}static getNextId(){const e=patchedTimers.nativeSetTimeout.call(global,timeoutCallback,0);return patchedTimers.nativeClearTimeout.call(global,e),"number"==typeof e?e:Scheduler.nextNodeJSId++}getCurrentTickTime(){return this._currentTickTime}getFakeSystemTime(){return this._currentFakeBaseSystemTime+this._currentTickTime}setFakeBaseSystemTime(e){this._currentFakeBaseSystemTime=e}getRealSystemTime(){return OriginalDate.now()}scheduleFunction(e,t,s){let r=(s={args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1,...s}).id<0?Scheduler.nextId:s.id;Scheduler.nextId=Scheduler.getNextId();let i={endTime:this._currentTickTime+t,id:r,func:e,args:s.args,delay:t,isPeriodic:s.isPeriodic,isRequestAnimationFrame:s.isRequestAnimationFrame};s.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(i);let n=0;for(;n<this._schedulerQueue.length&&!(i.endTime<this._schedulerQueue[n].endTime);n++);return this._schedulerQueue.splice(n,0,i),r}removeScheduledFunctionWithId(e){for(let t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}}removeAll(){this._schedulerQueue=[]}getTimerCount(){return this._schedulerQueue.length}tickToNext(e=1,t,s){this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,s)}tick(e=0,t,s){let r=this._currentTickTime+e,i=0;const n=(s=Object.assign({processNewMacroTasksSynchronously:!0},s)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===n.length&&t)t(e);else{for(;n.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(r<n[0].endTime));){let e=n.shift();if(!s.processNewMacroTasksSynchronously){const t=this._schedulerQueue.indexOf(e);t>=0&&this._schedulerQueue.splice(t,1)}if(i=this._currentTickTime,this._currentTickTime=e.endTime,t&&t(this._currentTickTime-i),!e.func.apply(global,e.isRequestAnimationFrame?[this._currentTickTime]:e.args))break;s.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((e=>{let t=0;for(;t<n.length&&!(e.endTime<n[t].endTime);t++);n.splice(t,0,e)}))}i=this._currentTickTime,this._currentTickTime=r,t&&t(this._currentTickTime-i)}}flushOnlyPendingTimers(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t}flush(e=20,t=!1,s){return t?this.flushPeriodic(s):this.flushNonPeriodic(e,s)}flushPeriodic(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t}flushNonPeriodic(e,t){const s=this._currentTickTime;let r=0,i=0;for(;this._schedulerQueue.length>0;){if(i++,i>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((e=>!e.isPeriodic&&!e.isRequestAnimationFrame)).length)break;const s=this._schedulerQueue.shift();if(r=this._currentTickTime,this._currentTickTime=s.endTime,t&&t(this._currentTickTime-r),!s.func.apply(global,s.args))break}return this._currentTickTime-s}}class FakeAsyncTestZoneSpec{static assertInZone(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")}constructor(e,t=!1,s){this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=s,this._scheduler=new Scheduler,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=global[Zone.__symbol__("FakeAsyncTestMacroTask")])}_fnAndFlush(e,t){return(...s)=>(e.apply(global,s),null===this._lastError?(null!=t.onSuccess&&t.onSuccess.apply(global),this.flushMicrotasks()):null!=t.onError&&t.onError.apply(global),null===this._lastError)}static _removeTimer(e,t){let s=e.indexOf(t);s>-1&&e.splice(s,1)}_dequeueTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e)}}_requeuePeriodicTimer(e,t,s,r){return()=>{-1!==this.pendingPeriodicTimers.indexOf(r)&&this._scheduler.scheduleFunction(e,t,{args:s,isPeriodic:!0,id:r,isRequeuePeriodic:!0})}}_dequeuePeriodicTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e)}}_setTimeout(e,t,s,r=!0){let i=this._dequeueTimer(Scheduler.nextId),n=this._fnAndFlush(e,{onSuccess:i,onError:i}),a=this._scheduler.scheduleFunction(n,t,{args:s,isRequestAnimationFrame:!r});return r&&this.pendingTimers.push(a),a}_clearTimeout(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_setInterval(e,t,s){let r=Scheduler.nextId,i={onSuccess:null,onError:this._dequeuePeriodicTimer(r)},n=this._fnAndFlush(e,i);return i.onSuccess=this._requeuePeriodicTimer(n,t,s,r),this._scheduler.scheduleFunction(n,t,{args:s,isPeriodic:!0}),this.pendingPeriodicTimers.push(r),r}_clearInterval(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_resetLastErrorAndThrow(){let e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e}getCurrentTickTime(){return this._scheduler.getCurrentTickTime()}getFakeSystemTime(){return this._scheduler.getFakeSystemTime()}setFakeBaseSystemTime(e){this._scheduler.setFakeBaseSystemTime(e)}getRealSystemTime(){return this._scheduler.getRealSystemTime()}static patchDate(){global[Zone.__symbol__("disableDatePatching")]||global.Date!==FakeDate&&(global.Date=FakeDate,FakeDate.prototype=OriginalDate.prototype,FakeAsyncTestZoneSpec.checkTimerPatch())}static resetDate(){global.Date===FakeDate&&(global.Date=OriginalDate)}static checkTimerPatch(){if(!patchedTimers)throw new Error("Expected timers to have been patched.");global.setTimeout!==patchedTimers.setTimeout&&(global.setTimeout=patchedTimers.setTimeout,global.clearTimeout=patchedTimers.clearTimeout),global.setInterval!==patchedTimers.setInterval&&(global.setInterval=patchedTimers.setInterval,global.clearInterval=patchedTimers.clearInterval)}lockDatePatch(){this.patchDateLocked=!0,FakeAsyncTestZoneSpec.patchDate()}unlockDatePatch(){this.patchDateLocked=!1,FakeAsyncTestZoneSpec.resetDate()}tickToNext(e=1,t,s={processNewMacroTasksSynchronously:!0}){e<=0||(FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(e,t,s),null!==this._lastError&&this._resetLastErrorAndThrow())}tick(e=0,t,s={processNewMacroTasksSynchronously:!0}){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(e,t,s),null!==this._lastError&&this._resetLastErrorAndThrow()}flushMicrotasks(){for(FakeAsyncTestZoneSpec.assertInZone();this._microtasks.length>0;){let e=this._microtasks.shift();e.func.apply(e.target,e.args)}(()=>{(null!==this._lastError||this._uncaughtPromiseErrors.length)&&this._resetLastErrorAndThrow()})()}flush(e,t,s){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const r=this._scheduler.flush(e,t,s);return null!==this._lastError&&this._resetLastErrorAndThrow(),r}flushOnlyPendingTimers(e){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const t=this._scheduler.flushOnlyPendingTimers(e);return null!==this._lastError&&this._resetLastErrorAndThrow(),t}removeAllTimers(){FakeAsyncTestZoneSpec.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]}getTimerCount(){return this._scheduler.getTimerCount()+this._microtasks.length}onScheduleTask(e,t,s,r){switch(r.type){case"microTask":let t,i=r.data&&r.data.args;if(i){let e=r.data.cbIdx;"number"==typeof i.length&&i.length>e+1&&(t=Array.prototype.slice.call(i,e+1))}this._microtasks.push({func:r.invoke,args:t,target:r.data&&r.data.target});break;case"macroTask":switch(r.source){case"setTimeout":r.data.handleId=this._setTimeout(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"setImmediate":r.data.handleId=this._setTimeout(r.invoke,0,Array.prototype.slice.call(r.data.args,1));break;case"setInterval":r.data.handleId=this._setInterval(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+r.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":r.data.handleId=this._setTimeout(r.invoke,16,r.data.args,this.trackPendingRequestAnimationFrame);break;default:const e=this.findMacroTaskOption(r);if(e){const t=r.data&&r.data.args,s=t&&t.length>1?t[1]:0;let i=e.callbackArgs?e.callbackArgs:t;e.isPeriodic?(r.data.handleId=this._setInterval(r.invoke,s,i),r.data.isPeriodic=!0):r.data.handleId=this._setTimeout(r.invoke,s,i);break}throw new Error("Unknown macroTask scheduled in fake async test: "+r.source)}break;case"eventTask":r=e.scheduleTask(s,r)}return r}onCancelTask(e,t,s,r){switch(r.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(r.data.handleId);case"setInterval":return this._clearInterval(r.data.handleId);default:const t=this.findMacroTaskOption(r);if(t){const e=r.data.handleId;return t.isPeriodic?this._clearInterval(e):this._clearTimeout(e)}return e.cancelTask(s,r)}}onInvoke(e,t,s,r,i,n,a){try{return FakeAsyncTestZoneSpec.patchDate(),e.invoke(s,r,i,n,a)}finally{this.patchDateLocked||FakeAsyncTestZoneSpec.resetDate()}}findMacroTaskOption(e){if(!this.macroTaskOptions)return null;for(let t=0;t<this.macroTaskOptions.length;t++){const s=this.macroTaskOptions[t];if(s.source===e.source)return s}return null}onHandleError(e,t,s,r){return this._lastError=r,!1}}let _fakeAsyncTestZoneSpec=null;function getProxyZoneSpec(){return Zone&&Zone.ProxyZoneSpec}function resetFakeAsyncZone(){_fakeAsyncTestZoneSpec&&_fakeAsyncTestZoneSpec.unlockDatePatch(),_fakeAsyncTestZoneSpec=null,getProxyZoneSpec()&&getProxyZoneSpec().assertPresent().resetDelegate()}function fakeAsync(e){const t=function(...t){const s=getProxyZoneSpec();if(!s)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");const r=s.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!_fakeAsyncTestZoneSpec){const e=Zone&&Zone.FakeAsyncTestZoneSpec;if(r.getDelegate()instanceof e)throw new Error("fakeAsync() calls can not be nested");_fakeAsyncTestZoneSpec=new e}let s;const i=r.getDelegate();r.setDelegate(_fakeAsyncTestZoneSpec),_fakeAsyncTestZoneSpec.lockDatePatch();try{s=e.apply(this,t),flushMicrotasks()}finally{r.setDelegate(i)}if(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} periodic timer(s) still in the queue.`);if(_fakeAsyncTestZoneSpec.pendingTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`);return s}finally{resetFakeAsyncZone()}};return t.isFakeAsync=!0,t}function _getFakeAsyncZoneSpec(){if(null==_fakeAsyncTestZoneSpec&&(_fakeAsyncTestZoneSpec=Zone.current.get("FakeAsyncTestZoneSpec"),null==_fakeAsyncTestZoneSpec))throw new Error("The code should be running in the fakeAsync zone to call this function");return _fakeAsyncTestZoneSpec}function tick(e=0,t=!1){_getFakeAsyncZoneSpec().tick(e,null,t)}function flush(e){return _getFakeAsyncZoneSpec().flush(e)}function discardPeriodicTasks(){_getFakeAsyncZoneSpec().pendingPeriodicTimers.length=0}function flushMicrotasks(){_getFakeAsyncZoneSpec().flushMicrotasks()}function patchFakeAsyncTest(e){e.FakeAsyncTestZoneSpec=FakeAsyncTestZoneSpec,e.__load_patch("fakeasync",((e,t,s)=>{t[s.symbol("fakeAsyncTest")]={resetFakeAsyncZone:resetFakeAsyncZone,flushMicrotasks:flushMicrotasks,discardPeriodicTasks:discardPeriodicTasks,tick:tick,flush:flush,fakeAsync:fakeAsync}}),!0),patchedTimers={setTimeout:global.setTimeout,setInterval:global.setInterval,clearTimeout:global.clearTimeout,clearInterval:global.clearInterval,nativeSetTimeout:global[e.__symbol__("setTimeout")],nativeClearTimeout:global[e.__symbol__("clearTimeout")]},Scheduler.nextId=Scheduler.getNextId()}patchFakeAsyncTest(Zone);
*/const global="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,OriginalDate=global.Date;function FakeDate(){if(0===arguments.length){const e=new OriginalDate;return e.setTime(FakeDate.now()),e}{const e=Array.prototype.slice.call(arguments);return new OriginalDate(...e)}}let patchedTimers;FakeDate.now=function(){const e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():OriginalDate.now.apply(this,arguments)},FakeDate.UTC=OriginalDate.UTC,FakeDate.parse=OriginalDate.parse;const timeoutCallback=function(){};class Scheduler{static{this.nextNodeJSId=1}static{this.nextId=-1}constructor(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=OriginalDate.now(),this._currentTickRequeuePeriodicEntries=[]}static getNextId(){const e=patchedTimers.nativeSetTimeout.call(global,timeoutCallback,0);return patchedTimers.nativeClearTimeout.call(global,e),"number"==typeof e?e:Scheduler.nextNodeJSId++}getCurrentTickTime(){return this._currentTickTime}getFakeSystemTime(){return this._currentFakeBaseSystemTime+this._currentTickTime}setFakeBaseSystemTime(e){this._currentFakeBaseSystemTime=e}getRealSystemTime(){return OriginalDate.now()}scheduleFunction(e,t,s){let r=(s={args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1,...s}).id<0?Scheduler.nextId:s.id;Scheduler.nextId=Scheduler.getNextId();let i={endTime:this._currentTickTime+t,id:r,func:e,args:s.args,delay:t,isPeriodic:s.isPeriodic,isRequestAnimationFrame:s.isRequestAnimationFrame};s.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(i);let n=0;for(;n<this._schedulerQueue.length&&!(i.endTime<this._schedulerQueue[n].endTime);n++);return this._schedulerQueue.splice(n,0,i),r}removeScheduledFunctionWithId(e){for(let t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}}removeAll(){this._schedulerQueue=[]}getTimerCount(){return this._schedulerQueue.length}tickToNext(e=1,t,s){this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,s)}tick(e=0,t,s){let r=this._currentTickTime+e,i=0;const n=(s=Object.assign({processNewMacroTasksSynchronously:!0},s)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===n.length&&t)t(e);else{for(;n.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(r<n[0].endTime));){let e=n.shift();if(!s.processNewMacroTasksSynchronously){const t=this._schedulerQueue.indexOf(e);t>=0&&this._schedulerQueue.splice(t,1)}if(i=this._currentTickTime,this._currentTickTime=e.endTime,t&&t(this._currentTickTime-i),!e.func.apply(global,e.isRequestAnimationFrame?[this._currentTickTime]:e.args))break;s.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((e=>{let t=0;for(;t<n.length&&!(e.endTime<n[t].endTime);t++);n.splice(t,0,e)}))}i=this._currentTickTime,this._currentTickTime=r,t&&t(this._currentTickTime-i)}}flushOnlyPendingTimers(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t}flush(e=20,t=!1,s){return t?this.flushPeriodic(s):this.flushNonPeriodic(e,s)}flushPeriodic(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t}flushNonPeriodic(e,t){const s=this._currentTickTime;let r=0,i=0;for(;this._schedulerQueue.length>0;){if(i++,i>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((e=>!e.isPeriodic&&!e.isRequestAnimationFrame)).length)break;const s=this._schedulerQueue.shift();if(r=this._currentTickTime,this._currentTickTime=s.endTime,t&&t(this._currentTickTime-r),!s.func.apply(global,s.args))break}return this._currentTickTime-s}}class FakeAsyncTestZoneSpec{static assertInZone(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")}constructor(e,t=!1,s){this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=s,this._scheduler=new Scheduler,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=global[Zone.__symbol__("FakeAsyncTestMacroTask")])}_fnAndFlush(e,t){return(...s)=>(e.apply(global,s),null===this._lastError?(null!=t.onSuccess&&t.onSuccess.apply(global),this.flushMicrotasks()):null!=t.onError&&t.onError.apply(global),null===this._lastError)}static _removeTimer(e,t){let s=e.indexOf(t);s>-1&&e.splice(s,1)}_dequeueTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e)}}_requeuePeriodicTimer(e,t,s,r){return()=>{-1!==this.pendingPeriodicTimers.indexOf(r)&&this._scheduler.scheduleFunction(e,t,{args:s,isPeriodic:!0,id:r,isRequeuePeriodic:!0})}}_dequeuePeriodicTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e)}}_setTimeout(e,t,s,r=!0){let i=this._dequeueTimer(Scheduler.nextId),n=this._fnAndFlush(e,{onSuccess:i,onError:i}),a=this._scheduler.scheduleFunction(n,t,{args:s,isRequestAnimationFrame:!r});return r&&this.pendingTimers.push(a),a}_clearTimeout(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_setInterval(e,t,s){let r=Scheduler.nextId,i={onSuccess:null,onError:this._dequeuePeriodicTimer(r)},n=this._fnAndFlush(e,i);return i.onSuccess=this._requeuePeriodicTimer(n,t,s,r),this._scheduler.scheduleFunction(n,t,{args:s,isPeriodic:!0}),this.pendingPeriodicTimers.push(r),r}_clearInterval(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_resetLastErrorAndThrow(){let e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e}getCurrentTickTime(){return this._scheduler.getCurrentTickTime()}getFakeSystemTime(){return this._scheduler.getFakeSystemTime()}setFakeBaseSystemTime(e){this._scheduler.setFakeBaseSystemTime(e)}getRealSystemTime(){return this._scheduler.getRealSystemTime()}static patchDate(){global[Zone.__symbol__("disableDatePatching")]||global.Date!==FakeDate&&(global.Date=FakeDate,FakeDate.prototype=OriginalDate.prototype,FakeAsyncTestZoneSpec.checkTimerPatch())}static resetDate(){global.Date===FakeDate&&(global.Date=OriginalDate)}static checkTimerPatch(){if(!patchedTimers)throw new Error("Expected timers to have been patched.");global.setTimeout!==patchedTimers.setTimeout&&(global.setTimeout=patchedTimers.setTimeout,global.clearTimeout=patchedTimers.clearTimeout),global.setInterval!==patchedTimers.setInterval&&(global.setInterval=patchedTimers.setInterval,global.clearInterval=patchedTimers.clearInterval)}lockDatePatch(){this.patchDateLocked=!0,FakeAsyncTestZoneSpec.patchDate()}unlockDatePatch(){this.patchDateLocked=!1,FakeAsyncTestZoneSpec.resetDate()}tickToNext(e=1,t,s={processNewMacroTasksSynchronously:!0}){e<=0||(FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(e,t,s),null!==this._lastError&&this._resetLastErrorAndThrow())}tick(e=0,t,s={processNewMacroTasksSynchronously:!0}){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(e,t,s),null!==this._lastError&&this._resetLastErrorAndThrow()}flushMicrotasks(){for(FakeAsyncTestZoneSpec.assertInZone();this._microtasks.length>0;){let e=this._microtasks.shift();e.func.apply(e.target,e.args)}(()=>{(null!==this._lastError||this._uncaughtPromiseErrors.length)&&this._resetLastErrorAndThrow()})()}flush(e,t,s){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const r=this._scheduler.flush(e,t,s);return null!==this._lastError&&this._resetLastErrorAndThrow(),r}flushOnlyPendingTimers(e){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const t=this._scheduler.flushOnlyPendingTimers(e);return null!==this._lastError&&this._resetLastErrorAndThrow(),t}removeAllTimers(){FakeAsyncTestZoneSpec.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]}getTimerCount(){return this._scheduler.getTimerCount()+this._microtasks.length}onScheduleTask(e,t,s,r){switch(r.type){case"microTask":let t,i=r.data&&r.data.args;if(i){let e=r.data.cbIdx;"number"==typeof i.length&&i.length>e+1&&(t=Array.prototype.slice.call(i,e+1))}this._microtasks.push({func:r.invoke,args:t,target:r.data&&r.data.target});break;case"macroTask":switch(r.source){case"setTimeout":r.data.handleId=this._setTimeout(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"setImmediate":r.data.handleId=this._setTimeout(r.invoke,0,Array.prototype.slice.call(r.data.args,1));break;case"setInterval":r.data.handleId=this._setInterval(r.invoke,r.data.delay,Array.prototype.slice.call(r.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+r.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":r.data.handleId=this._setTimeout(r.invoke,16,r.data.args,this.trackPendingRequestAnimationFrame);break;default:const e=this.findMacroTaskOption(r);if(e){const t=r.data&&r.data.args,s=t&&t.length>1?t[1]:0;let i=e.callbackArgs?e.callbackArgs:t;e.isPeriodic?(r.data.handleId=this._setInterval(r.invoke,s,i),r.data.isPeriodic=!0):r.data.handleId=this._setTimeout(r.invoke,s,i);break}throw new Error("Unknown macroTask scheduled in fake async test: "+r.source)}break;case"eventTask":r=e.scheduleTask(s,r)}return r}onCancelTask(e,t,s,r){switch(r.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(r.data.handleId);case"setInterval":return this._clearInterval(r.data.handleId);default:const t=this.findMacroTaskOption(r);if(t){const e=r.data.handleId;return t.isPeriodic?this._clearInterval(e):this._clearTimeout(e)}return e.cancelTask(s,r)}}onInvoke(e,t,s,r,i,n,a){try{return FakeAsyncTestZoneSpec.patchDate(),e.invoke(s,r,i,n,a)}finally{this.patchDateLocked||FakeAsyncTestZoneSpec.resetDate()}}findMacroTaskOption(e){if(!this.macroTaskOptions)return null;for(let t=0;t<this.macroTaskOptions.length;t++){const s=this.macroTaskOptions[t];if(s.source===e.source)return s}return null}onHandleError(e,t,s,r){return this._lastError=r,!1}}let _fakeAsyncTestZoneSpec=null;function getProxyZoneSpec(){return Zone&&Zone.ProxyZoneSpec}function resetFakeAsyncZone(){_fakeAsyncTestZoneSpec&&_fakeAsyncTestZoneSpec.unlockDatePatch(),_fakeAsyncTestZoneSpec=null,getProxyZoneSpec()&&getProxyZoneSpec().assertPresent().resetDelegate()}function fakeAsync(e,t={}){const{flush:s=!1}=t,r=function(...t){const r=getProxyZoneSpec();if(!r)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");const i=r.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!_fakeAsyncTestZoneSpec){const e=Zone&&Zone.FakeAsyncTestZoneSpec;if(i.getDelegate()instanceof e)throw new Error("fakeAsync() calls can not be nested");_fakeAsyncTestZoneSpec=new e}let r;const n=i.getDelegate();i.setDelegate(_fakeAsyncTestZoneSpec),_fakeAsyncTestZoneSpec.lockDatePatch();try{r=e.apply(this,t),s?_fakeAsyncTestZoneSpec.flush(20,!0):flushMicrotasks()}finally{i.setDelegate(n)}if(!s){if(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} periodic timer(s) still in the queue.`);if(_fakeAsyncTestZoneSpec.pendingTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`)}return r}finally{resetFakeAsyncZone()}};return r.isFakeAsync=!0,r}function _getFakeAsyncZoneSpec(){if(null==_fakeAsyncTestZoneSpec&&(_fakeAsyncTestZoneSpec=Zone.current.get("FakeAsyncTestZoneSpec"),null==_fakeAsyncTestZoneSpec))throw new Error("The code should be running in the fakeAsync zone to call this function");return _fakeAsyncTestZoneSpec}function tick(e=0,t=!1){_getFakeAsyncZoneSpec().tick(e,null,t)}function flush(e){return _getFakeAsyncZoneSpec().flush(e)}function discardPeriodicTasks(){_getFakeAsyncZoneSpec().pendingPeriodicTimers.length=0}function flushMicrotasks(){_getFakeAsyncZoneSpec().flushMicrotasks()}function patchFakeAsyncTest(e){e.FakeAsyncTestZoneSpec=FakeAsyncTestZoneSpec,e.__load_patch("fakeasync",((e,t,s)=>{t[s.symbol("fakeAsyncTest")]={resetFakeAsyncZone:resetFakeAsyncZone,flushMicrotasks:flushMicrotasks,discardPeriodicTasks:discardPeriodicTasks,tick:tick,flush:flush,fakeAsync:fakeAsync}}),!0),patchedTimers={setTimeout:global.setTimeout,setInterval:global.setInterval,clearTimeout:global.clearTimeout,clearInterval:global.clearInterval,nativeSetTimeout:global[e.__symbol__("setTimeout")],nativeClearTimeout:global[e.__symbol__("clearTimeout")]},Scheduler.nextId=Scheduler.getNextId()}patchFakeAsyncTest(Zone);

@@ -6,2 +6,2 @@ "use strict";

* License: MIT
*/function patchJasmine(e){e.__load_patch("jasmine",((e,t,n)=>{if(!t)throw new Error("Missing: zone.js");if("undefined"!=typeof jest)return;if("undefined"==typeof jasmine||jasmine.__zone_patch__)return;jasmine.__zone_patch__=!0;const s=t.SyncTestZoneSpec,r=t.ProxyZoneSpec;if(!s)throw new Error("Missing: SyncTestZoneSpec");if(!r)throw new Error("Missing: ProxyZoneSpec");const i=t.current,o=t.__symbol__,c=!0===e[o("fakeAsyncDisablePatchingClock")],a=!c&&(!0===e[o("fakeAsyncPatchLock")]||!0===e[o("fakeAsyncAutoFakeAsyncWhenClockPatched")]);if(!0!==e[o("ignoreUnhandledRejection")]){const t=jasmine.GlobalErrors;t&&!jasmine[o("GlobalErrors")]&&(jasmine[o("GlobalErrors")]=t,jasmine.GlobalErrors=function(){const n=new t,s=n.install;return s&&!n[o("install")]&&(n[o("install")]=s,n.install=function(){const t="undefined"!=typeof process&&!!process.on,n=t?process.listeners("unhandledRejection"):e.eventListeners("unhandledrejection"),r=s.apply(this,arguments);return t?process.removeAllListeners("unhandledRejection"):e.removeAllListeners("unhandledrejection"),n&&n.forEach((n=>{t?process.on("unhandledRejection",n):e.addEventListener("unhandledrejection",n)})),r}),n})}const l=jasmine.getEnv();if(["describe","xdescribe","fdescribe"].forEach((e=>{let t=l[e];l[e]=function(e,n){return t.call(this,e,function r(e,t){return function(){return i.fork(new s(`jasmine.describe#${e}`)).run(t,this,arguments)}}(e,n))}})),["it","xit","fit"].forEach((e=>{let t=l[e];l[o(e)]=t,l[e]=function(e,n,s){return arguments[1]=h(n),t.apply(this,arguments)}})),["beforeEach","afterEach","beforeAll","afterAll"].forEach((e=>{let t=l[e];l[o(e)]=t,l[e]=function(e,n){return arguments[0]=h(e),t.apply(this,arguments)}})),!c){const e=jasmine[o("clock")]=jasmine.clock;jasmine.clock=function(){const n=e.apply(this,arguments);if(!n[o("patched")]){n[o("patched")]=o("patched");const e=n[o("tick")]=n.tick;n.tick=function(){const n=t.current.get("FakeAsyncTestZoneSpec");return n?n.tick.apply(n,arguments):e.apply(this,arguments)};const s=n[o("mockDate")]=n.mockDate;n.mockDate=function(){const e=t.current.get("FakeAsyncTestZoneSpec");if(e){const t=arguments.length>0?arguments[0]:new Date;return e.setFakeBaseSystemTime.apply(e,t&&"function"==typeof t.getTime?[t.getTime()]:arguments)}return s.apply(this,arguments)},a&&["install","uninstall"].forEach((e=>{const s=n[o(e)]=n[e];n[e]=function(){if(!t.FakeAsyncTestZoneSpec)return s.apply(this,arguments);jasmine[o("clockInstalled")]="install"===e}}))}return n}}if(!jasmine[t.__symbol__("createSpyObj")]){const e=jasmine.createSpyObj;jasmine[t.__symbol__("createSpyObj")]=e,jasmine.createSpyObj=function(){const t=Array.prototype.slice.call(arguments);let n;if(t.length>=3&&t[2]){const s=Object.defineProperty;Object.defineProperty=function(e,t,n){return s.call(this,e,t,{...n,configurable:!0,enumerable:!0})};try{n=e.apply(this,t)}finally{Object.defineProperty=s}}else n=e.apply(this,t);return n}}function u(e,n,s,r){const i=!!jasmine[o("clockInstalled")],c=s.testProxyZone;if(i&&a){const n=t[t.__symbol__("fakeAsyncTest")];n&&"function"==typeof n.fakeAsync&&(e=n.fakeAsync(e))}return r?c.run(e,n,[r]):c.run(e,n)}function h(e){return e&&(e.length?function(t){return u(e,this,this.queueRunner,t)}:function(){return u(e,this,this.queueRunner)})}const p=jasmine.QueueRunner;jasmine.QueueRunner=function(n){function s(s){s.onComplete&&(s.onComplete=(e=>()=>{this.testProxyZone=null,this.testProxyZoneSpec=null,i.scheduleMicroTask("jasmine.onComplete",e)})(s.onComplete));const r=e[t.__symbol__("setTimeout")],o=e[t.__symbol__("clearTimeout")];r&&(s.timeout={setTimeout:r||e.setTimeout,clearTimeout:o||e.clearTimeout}),jasmine.UserContext?(s.userContext||(s.userContext=new jasmine.UserContext),s.userContext.queueRunner=this):(s.userContext||(s.userContext={}),s.userContext.queueRunner=this);const c=s.onException;s.onException=function(e){if(e&&"Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL."===e.message){const t=this&&this.testProxyZoneSpec;if(t){const n=t.getAndClearPendingTasksInfo();try{e.message+=n}catch(e){}}}c&&c.call(this,e)},n.call(this,s)}return function(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(s,n),s.prototype.execute=function(){let e=t.current,s=!1;for(;e;){if(e===i){s=!0;break}e=e.parent}if(!s)throw new Error("Unexpected Zone: "+t.current.name);this.testProxyZoneSpec=new r,this.testProxyZone=i.fork(this.testProxyZoneSpec),t.currentTask?n.prototype.execute.call(this):t.current.scheduleMicroTask("jasmine.execute().forceTask",(()=>p.prototype.execute.call(this)))},s}(p)}))}function patchJest(e){e.__load_patch("jest",((e,t,n)=>{if("undefined"==typeof jest||jest.__zone_patch__)return;t[n.symbol("ignoreConsoleErrorUncaughtError")]=!0,jest.__zone_patch__=!0;const s=t.ProxyZoneSpec,r=t.SyncTestZoneSpec;if(!s)throw new Error("Missing ProxyZoneSpec");const i=t.current,o=i.fork(new r("jest.describe")),c=new s,a=i.fork(c);function l(e){return function(...t){return o.run(e,this,t)}}function u(e,s=!1){if("function"!=typeof e)return e;const r=function(){if(!0===t[n.symbol("useFakeTimersCalled")]&&e&&!e.isFakeAsync){const n=t[t.__symbol__("fakeAsyncTest")];n&&"function"==typeof n.fakeAsync&&(e=n.fakeAsync(e))}return c.isTestFunc=s,a.run(e,null,arguments)};return Object.defineProperty(r,"length",{configurable:!0,writable:!0,enumerable:!1}),r.length=e.length,r}["describe","xdescribe","fdescribe"].forEach((n=>{let s=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=s,e[n]=function(...e){return e[1]=l(e[1]),s.apply(this,e)},e[n].each=function r(e){return function(...t){const n=e.apply(this,t);return function(...e){return e[1]=l(e[1]),n.apply(this,e)}}}(s.each))})),e.describe.only=e.fdescribe,e.describe.skip=e.xdescribe,["it","xit","fit","test","xtest"].forEach((n=>{let s=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=s,e[n]=function(...e){return e[1]=u(e[1],!0),s.apply(this,e)},e[n].each=function r(e){return function(...t){return function(...n){return n[1]=u(n[1]),e.apply(this,t).apply(this,n)}}}(s.each),e[n].todo=s.todo)})),e.it.only=e.fit,e.it.skip=e.xit,e.test.only=e.fit,e.test.skip=e.xit,["beforeEach","afterEach","beforeAll","afterAll"].forEach((n=>{let s=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=s,e[n]=function(...e){return e[0]=u(e[0]),s.apply(this,e)})})),t.patchJestObject=function e(s,r=!1){function i(){return!!t.current.get("FakeAsyncTestZoneSpec")}function o(){const e=t.current.get("ProxyZoneSpec");return e&&e.isTestFunc}s[n.symbol("fakeTimers")]||(s[n.symbol("fakeTimers")]=!0,n.patchMethod(s,"_checkFakeTimers",(e=>function(t,n){return!!i()||e.apply(t,n)})),n.patchMethod(s,"useFakeTimers",(e=>function(s,i){return t[n.symbol("useFakeTimersCalled")]=!0,r||o()?e.apply(s,i):s})),n.patchMethod(s,"useRealTimers",(e=>function(s,i){return t[n.symbol("useFakeTimersCalled")]=!1,r||o()?e.apply(s,i):s})),n.patchMethod(s,"setSystemTime",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r||!i())return e.apply(n,s);r.setFakeBaseSystemTime(s[0])})),n.patchMethod(s,"getRealSystemTime",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");return r&&i()?r.getRealSystemTime():e.apply(n,s)})),n.patchMethod(s,"runAllTicks",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.flushMicrotasks()})),n.patchMethod(s,"runAllTimers",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.flush(100,!0)})),n.patchMethod(s,"advanceTimersByTime",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.tick(s[0])})),n.patchMethod(s,"runOnlyPendingTimers",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.flushOnlyPendingTimers()})),n.patchMethod(s,"advanceTimersToNextTimer",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.tickToNext(s[0])})),n.patchMethod(s,"clearAllTimers",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.removeAllTimers()})),n.patchMethod(s,"getTimerCount",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");return r?r.getTimerCount():e.apply(n,s)})))}}))}function patchMocha(e){e.__load_patch("mocha",((e,t)=>{const n=e.Mocha;if(void 0===n)return;if(void 0===t)throw new Error("Missing Zone.js");const s=t.ProxyZoneSpec,r=t.SyncTestZoneSpec;if(!s)throw new Error("Missing ProxyZoneSpec");if(n.__zone_patch__)throw new Error('"Mocha" has already been patched with "Zone".');n.__zone_patch__=!0;const i=t.current,o=i.fork(new r("Mocha.describe"));let c=null;const a=i.fork(new s),l={after:e.after,afterEach:e.afterEach,before:e.before,beforeEach:e.beforeEach,describe:e.describe,it:e.it};function u(e,t,n){for(let s=0;s<e.length;s++){let r=e[s];"function"==typeof r&&(e[s]=0===r.length?t(r):n(r),e[s].toString=function(){return r.toString()})}return e}function h(e){return u(e,(function(e){return function(){return o.run(e,this,arguments)}}))}function p(e){return u(e,(function(e){return function(){return c.run(e,this)}}),(function(e){return function(t){return c.run(e,this,[t])}}))}function d(e){return u(e,(function(e){return function(){return a.run(e,this)}}),(function(e){return function(t){return a.run(e,this,[t])}}))}var T,f;e.describe=e.suite=function(){return l.describe.apply(this,h(arguments))},e.xdescribe=e.suite.skip=e.describe.skip=function(){return l.describe.skip.apply(this,h(arguments))},e.describe.only=e.suite.only=function(){return l.describe.only.apply(this,h(arguments))},e.it=e.specify=e.test=function(){return l.it.apply(this,p(arguments))},e.xit=e.xspecify=e.it.skip=function(){return l.it.skip.apply(this,p(arguments))},e.it.only=e.test.only=function(){return l.it.only.apply(this,p(arguments))},e.after=e.suiteTeardown=function(){return l.after.apply(this,d(arguments))},e.afterEach=e.teardown=function(){return l.afterEach.apply(this,p(arguments))},e.before=e.suiteSetup=function(){return l.before.apply(this,d(arguments))},e.beforeEach=e.setup=function(){return l.beforeEach.apply(this,p(arguments))},T=n.Runner.prototype.runTest,f=n.Runner.prototype.run,n.Runner.prototype.runTest=function(e){t.current.scheduleMicroTask("mocha.forceTask",(()=>{T.call(this,e)}))},n.Runner.prototype.run=function(e){return this.on("test",(e=>{c=i.fork(new s)})),this.on("fail",((e,t)=>{const n=c&&c.get("ProxyZoneSpec");if(n&&t)try{t.message+=n.getAndClearPendingTasksInfo()}catch(e){}})),f.call(this,e)}}))}const global$2=globalThis;function __symbol__(e){return(global$2.__Zone_symbol_prefix||"__zone_symbol__")+e}const __global="undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global;class AsyncTestZoneSpec{static get symbolParentUnresolved(){return __symbol__("parentUnresolved")}constructor(e,t,n){this.finishCallback=e,this.failCallback=t,this._pendingMicroTasks=!1,this._pendingMacroTasks=!1,this._alreadyErrored=!1,this._isSync=!1,this._existingFinishTimer=null,this.entryFunction=null,this.runZone=Zone.current,this.unresolvedChainedPromiseCount=0,this.supportWaitUnresolvedChainedPromise=!1,this.name="asyncTestZone for "+n,this.properties={AsyncTestZoneSpec:this},this.supportWaitUnresolvedChainedPromise=!0===__global[__symbol__("supportWaitUnResolvedChainedPromise")]}isUnresolvedChainedPromisePending(){return this.unresolvedChainedPromiseCount>0}_finishCallbackIfDone(){null!==this._existingFinishTimer&&(clearTimeout(this._existingFinishTimer),this._existingFinishTimer=null),this._pendingMicroTasks||this._pendingMacroTasks||this.supportWaitUnresolvedChainedPromise&&this.isUnresolvedChainedPromisePending()||this.runZone.run((()=>{this._existingFinishTimer=setTimeout((()=>{this._alreadyErrored||this._pendingMicroTasks||this._pendingMacroTasks||this.finishCallback()}),0)}))}patchPromiseForTest(){if(!this.supportWaitUnresolvedChainedPromise)return;const e=Promise[Zone.__symbol__("patchPromiseForTest")];e&&e()}unPatchPromiseForTest(){if(!this.supportWaitUnresolvedChainedPromise)return;const e=Promise[Zone.__symbol__("unPatchPromiseForTest")];e&&e()}onScheduleTask(e,t,n,s){return"eventTask"!==s.type&&(this._isSync=!1),"microTask"===s.type&&s.data&&s.data instanceof Promise&&!0===s.data[AsyncTestZoneSpec.symbolParentUnresolved]&&this.unresolvedChainedPromiseCount--,e.scheduleTask(n,s)}onInvokeTask(e,t,n,s,r,i){return"eventTask"!==s.type&&(this._isSync=!1),e.invokeTask(n,s,r,i)}onCancelTask(e,t,n,s){return"eventTask"!==s.type&&(this._isSync=!1),e.cancelTask(n,s)}onInvoke(e,t,n,s,r,i,o){this.entryFunction||(this.entryFunction=s);try{return this._isSync=!0,e.invoke(n,s,r,i,o)}finally{this._isSync&&this.entryFunction===s&&this._finishCallbackIfDone()}}onHandleError(e,t,n,s){return e.handleError(n,s)&&(this.failCallback(s),this._alreadyErrored=!0),!1}onHasTask(e,t,n,s){e.hasTask(n,s),t===n&&("microTask"==s.change?(this._pendingMicroTasks=s.microTask,this._finishCallbackIfDone()):"macroTask"==s.change&&(this._pendingMacroTasks=s.macroTask,this._finishCallbackIfDone()))}}function patchAsyncTest(e){e.AsyncTestZoneSpec=AsyncTestZoneSpec,e.__load_patch("asynctest",((e,t,n)=>{function s(e,n,s,r){const i=t.current,o=t.AsyncTestZoneSpec;if(void 0===o)throw new Error("AsyncTestZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/async-test");const c=t.ProxyZoneSpec;if(!c)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");const a=c.get();c.assertPresent();const l=t.current.getZoneWith("ProxyZoneSpec"),u=a.getDelegate();return l.parent.run((()=>{const e=new o((()=>{a.getDelegate()==e&&a.setDelegate(u),e.unPatchPromiseForTest(),i.run((()=>{s()}))}),(t=>{a.getDelegate()==e&&a.setDelegate(u),e.unPatchPromiseForTest(),i.run((()=>{r(t)}))}),"test");a.setDelegate(e),e.patchPromiseForTest()})),t.current.runGuarded(e,n)}t[n.symbol("asyncTest")]=function t(n){return e.jasmine?function(e){e||((e=function(){}).fail=function(e){throw e}),s(n,this,e,(t=>{if("string"==typeof t)return e.fail(new Error(t));e.fail(t)}))}:function(){return new Promise(((e,t)=>{s(n,this,e,t)}))}}}))}const global$1="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,OriginalDate=global$1.Date;function FakeDate(){if(0===arguments.length){const e=new OriginalDate;return e.setTime(FakeDate.now()),e}{const e=Array.prototype.slice.call(arguments);return new OriginalDate(...e)}}let patchedTimers;FakeDate.now=function(){const e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():OriginalDate.now.apply(this,arguments)},FakeDate.UTC=OriginalDate.UTC,FakeDate.parse=OriginalDate.parse;const timeoutCallback=function(){};class Scheduler{static{this.nextNodeJSId=1}static{this.nextId=-1}constructor(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=OriginalDate.now(),this._currentTickRequeuePeriodicEntries=[]}static getNextId(){const e=patchedTimers.nativeSetTimeout.call(global$1,timeoutCallback,0);return patchedTimers.nativeClearTimeout.call(global$1,e),"number"==typeof e?e:Scheduler.nextNodeJSId++}getCurrentTickTime(){return this._currentTickTime}getFakeSystemTime(){return this._currentFakeBaseSystemTime+this._currentTickTime}setFakeBaseSystemTime(e){this._currentFakeBaseSystemTime=e}getRealSystemTime(){return OriginalDate.now()}scheduleFunction(e,t,n){let s=(n={args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1,...n}).id<0?Scheduler.nextId:n.id;Scheduler.nextId=Scheduler.getNextId();let r={endTime:this._currentTickTime+t,id:s,func:e,args:n.args,delay:t,isPeriodic:n.isPeriodic,isRequestAnimationFrame:n.isRequestAnimationFrame};n.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(r);let i=0;for(;i<this._schedulerQueue.length&&!(r.endTime<this._schedulerQueue[i].endTime);i++);return this._schedulerQueue.splice(i,0,r),s}removeScheduledFunctionWithId(e){for(let t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}}removeAll(){this._schedulerQueue=[]}getTimerCount(){return this._schedulerQueue.length}tickToNext(e=1,t,n){this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,n)}tick(e=0,t,n){let s=this._currentTickTime+e,r=0;const i=(n=Object.assign({processNewMacroTasksSynchronously:!0},n)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===i.length&&t)t(e);else{for(;i.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(s<i[0].endTime));){let e=i.shift();if(!n.processNewMacroTasksSynchronously){const t=this._schedulerQueue.indexOf(e);t>=0&&this._schedulerQueue.splice(t,1)}if(r=this._currentTickTime,this._currentTickTime=e.endTime,t&&t(this._currentTickTime-r),!e.func.apply(global$1,e.isRequestAnimationFrame?[this._currentTickTime]:e.args))break;n.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((e=>{let t=0;for(;t<i.length&&!(e.endTime<i[t].endTime);t++);i.splice(t,0,e)}))}r=this._currentTickTime,this._currentTickTime=s,t&&t(this._currentTickTime-r)}}flushOnlyPendingTimers(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t}flush(e=20,t=!1,n){return t?this.flushPeriodic(n):this.flushNonPeriodic(e,n)}flushPeriodic(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t}flushNonPeriodic(e,t){const n=this._currentTickTime;let s=0,r=0;for(;this._schedulerQueue.length>0;){if(r++,r>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((e=>!e.isPeriodic&&!e.isRequestAnimationFrame)).length)break;const n=this._schedulerQueue.shift();if(s=this._currentTickTime,this._currentTickTime=n.endTime,t&&t(this._currentTickTime-s),!n.func.apply(global$1,n.args))break}return this._currentTickTime-n}}class FakeAsyncTestZoneSpec{static assertInZone(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")}constructor(e,t=!1,n){this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=n,this._scheduler=new Scheduler,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=global$1[Zone.__symbol__("FakeAsyncTestMacroTask")])}_fnAndFlush(e,t){return(...n)=>(e.apply(global$1,n),null===this._lastError?(null!=t.onSuccess&&t.onSuccess.apply(global$1),this.flushMicrotasks()):null!=t.onError&&t.onError.apply(global$1),null===this._lastError)}static _removeTimer(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}_dequeueTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e)}}_requeuePeriodicTimer(e,t,n,s){return()=>{-1!==this.pendingPeriodicTimers.indexOf(s)&&this._scheduler.scheduleFunction(e,t,{args:n,isPeriodic:!0,id:s,isRequeuePeriodic:!0})}}_dequeuePeriodicTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e)}}_setTimeout(e,t,n,s=!0){let r=this._dequeueTimer(Scheduler.nextId),i=this._fnAndFlush(e,{onSuccess:r,onError:r}),o=this._scheduler.scheduleFunction(i,t,{args:n,isRequestAnimationFrame:!s});return s&&this.pendingTimers.push(o),o}_clearTimeout(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_setInterval(e,t,n){let s=Scheduler.nextId,r={onSuccess:null,onError:this._dequeuePeriodicTimer(s)},i=this._fnAndFlush(e,r);return r.onSuccess=this._requeuePeriodicTimer(i,t,n,s),this._scheduler.scheduleFunction(i,t,{args:n,isPeriodic:!0}),this.pendingPeriodicTimers.push(s),s}_clearInterval(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_resetLastErrorAndThrow(){let e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e}getCurrentTickTime(){return this._scheduler.getCurrentTickTime()}getFakeSystemTime(){return this._scheduler.getFakeSystemTime()}setFakeBaseSystemTime(e){this._scheduler.setFakeBaseSystemTime(e)}getRealSystemTime(){return this._scheduler.getRealSystemTime()}static patchDate(){global$1[Zone.__symbol__("disableDatePatching")]||global$1.Date!==FakeDate&&(global$1.Date=FakeDate,FakeDate.prototype=OriginalDate.prototype,FakeAsyncTestZoneSpec.checkTimerPatch())}static resetDate(){global$1.Date===FakeDate&&(global$1.Date=OriginalDate)}static checkTimerPatch(){if(!patchedTimers)throw new Error("Expected timers to have been patched.");global$1.setTimeout!==patchedTimers.setTimeout&&(global$1.setTimeout=patchedTimers.setTimeout,global$1.clearTimeout=patchedTimers.clearTimeout),global$1.setInterval!==patchedTimers.setInterval&&(global$1.setInterval=patchedTimers.setInterval,global$1.clearInterval=patchedTimers.clearInterval)}lockDatePatch(){this.patchDateLocked=!0,FakeAsyncTestZoneSpec.patchDate()}unlockDatePatch(){this.patchDateLocked=!1,FakeAsyncTestZoneSpec.resetDate()}tickToNext(e=1,t,n={processNewMacroTasksSynchronously:!0}){e<=0||(FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(e,t,n),null!==this._lastError&&this._resetLastErrorAndThrow())}tick(e=0,t,n={processNewMacroTasksSynchronously:!0}){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(e,t,n),null!==this._lastError&&this._resetLastErrorAndThrow()}flushMicrotasks(){for(FakeAsyncTestZoneSpec.assertInZone();this._microtasks.length>0;){let e=this._microtasks.shift();e.func.apply(e.target,e.args)}(()=>{(null!==this._lastError||this._uncaughtPromiseErrors.length)&&this._resetLastErrorAndThrow()})()}flush(e,t,n){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const s=this._scheduler.flush(e,t,n);return null!==this._lastError&&this._resetLastErrorAndThrow(),s}flushOnlyPendingTimers(e){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const t=this._scheduler.flushOnlyPendingTimers(e);return null!==this._lastError&&this._resetLastErrorAndThrow(),t}removeAllTimers(){FakeAsyncTestZoneSpec.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]}getTimerCount(){return this._scheduler.getTimerCount()+this._microtasks.length}onScheduleTask(e,t,n,s){switch(s.type){case"microTask":let t,r=s.data&&s.data.args;if(r){let e=s.data.cbIdx;"number"==typeof r.length&&r.length>e+1&&(t=Array.prototype.slice.call(r,e+1))}this._microtasks.push({func:s.invoke,args:t,target:s.data&&s.data.target});break;case"macroTask":switch(s.source){case"setTimeout":s.data.handleId=this._setTimeout(s.invoke,s.data.delay,Array.prototype.slice.call(s.data.args,2));break;case"setImmediate":s.data.handleId=this._setTimeout(s.invoke,0,Array.prototype.slice.call(s.data.args,1));break;case"setInterval":s.data.handleId=this._setInterval(s.invoke,s.data.delay,Array.prototype.slice.call(s.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+s.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":s.data.handleId=this._setTimeout(s.invoke,16,s.data.args,this.trackPendingRequestAnimationFrame);break;default:const e=this.findMacroTaskOption(s);if(e){const t=s.data&&s.data.args,n=t&&t.length>1?t[1]:0;let r=e.callbackArgs?e.callbackArgs:t;e.isPeriodic?(s.data.handleId=this._setInterval(s.invoke,n,r),s.data.isPeriodic=!0):s.data.handleId=this._setTimeout(s.invoke,n,r);break}throw new Error("Unknown macroTask scheduled in fake async test: "+s.source)}break;case"eventTask":s=e.scheduleTask(n,s)}return s}onCancelTask(e,t,n,s){switch(s.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(s.data.handleId);case"setInterval":return this._clearInterval(s.data.handleId);default:const t=this.findMacroTaskOption(s);if(t){const e=s.data.handleId;return t.isPeriodic?this._clearInterval(e):this._clearTimeout(e)}return e.cancelTask(n,s)}}onInvoke(e,t,n,s,r,i,o){try{return FakeAsyncTestZoneSpec.patchDate(),e.invoke(n,s,r,i,o)}finally{this.patchDateLocked||FakeAsyncTestZoneSpec.resetDate()}}findMacroTaskOption(e){if(!this.macroTaskOptions)return null;for(let t=0;t<this.macroTaskOptions.length;t++){const n=this.macroTaskOptions[t];if(n.source===e.source)return n}return null}onHandleError(e,t,n,s){return this._lastError=s,!1}}let _fakeAsyncTestZoneSpec=null;function getProxyZoneSpec(){return Zone&&Zone.ProxyZoneSpec}function resetFakeAsyncZone(){_fakeAsyncTestZoneSpec&&_fakeAsyncTestZoneSpec.unlockDatePatch(),_fakeAsyncTestZoneSpec=null,getProxyZoneSpec()&&getProxyZoneSpec().assertPresent().resetDelegate()}function fakeAsync(e){const t=function(...t){const n=getProxyZoneSpec();if(!n)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");const s=n.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!_fakeAsyncTestZoneSpec){const e=Zone&&Zone.FakeAsyncTestZoneSpec;if(s.getDelegate()instanceof e)throw new Error("fakeAsync() calls can not be nested");_fakeAsyncTestZoneSpec=new e}let n;const r=s.getDelegate();s.setDelegate(_fakeAsyncTestZoneSpec),_fakeAsyncTestZoneSpec.lockDatePatch();try{n=e.apply(this,t),flushMicrotasks()}finally{s.setDelegate(r)}if(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} periodic timer(s) still in the queue.`);if(_fakeAsyncTestZoneSpec.pendingTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`);return n}finally{resetFakeAsyncZone()}};return t.isFakeAsync=!0,t}function _getFakeAsyncZoneSpec(){if(null==_fakeAsyncTestZoneSpec&&(_fakeAsyncTestZoneSpec=Zone.current.get("FakeAsyncTestZoneSpec"),null==_fakeAsyncTestZoneSpec))throw new Error("The code should be running in the fakeAsync zone to call this function");return _fakeAsyncTestZoneSpec}function tick(e=0,t=!1){_getFakeAsyncZoneSpec().tick(e,null,t)}function flush(e){return _getFakeAsyncZoneSpec().flush(e)}function discardPeriodicTasks(){_getFakeAsyncZoneSpec().pendingPeriodicTimers.length=0}function flushMicrotasks(){_getFakeAsyncZoneSpec().flushMicrotasks()}function patchFakeAsyncTest(e){e.FakeAsyncTestZoneSpec=FakeAsyncTestZoneSpec,e.__load_patch("fakeasync",((e,t,n)=>{t[n.symbol("fakeAsyncTest")]={resetFakeAsyncZone:resetFakeAsyncZone,flushMicrotasks:flushMicrotasks,discardPeriodicTasks:discardPeriodicTasks,tick:tick,flush:flush,fakeAsync:fakeAsync}}),!0),patchedTimers={setTimeout:global$1.setTimeout,setInterval:global$1.setInterval,clearTimeout:global$1.clearTimeout,clearInterval:global$1.clearInterval,nativeSetTimeout:global$1[e.__symbol__("setTimeout")],nativeClearTimeout:global$1[e.__symbol__("clearTimeout")]},Scheduler.nextId=Scheduler.getNextId()}function patchLongStackTrace(e){const t="\n",n={},s="__creationTrace__",r="STACKTRACE TRACKING",i="__SEP_TAG__";let o=i+"@[native]";class c{constructor(){this.error=p(),this.timestamp=new Date}}function a(){return new Error(r)}function l(){try{throw a()}catch(e){return e}}const u=a(),h=l(),p=u.stack?a:h.stack?l:a;function d(e){return e.stack?e.stack.split(t):[]}function T(e,t){let s=d(t);for(let t=0;t<s.length;t++)n.hasOwnProperty(s[t])||e.push(s[t])}function f(e,n){const s=[n?n.trim():""];if(e){let t=(new Date).getTime();for(let n=0;n<e.length;n++){const r=e[n],c=r.timestamp;let a=`____________________Elapsed ${t-c.getTime()} ms; At: ${c}`;a=a.replace(/[^\w\d]/g,"_"),s.push(o.replace(i,a)),T(s,r.error),t=c.getTime()}}return s.join(t)}function m(){return Error.stackTraceLimit>0}function k(e,t){t>0&&(e.push(d((new c).error)),k(e,t-1))}e.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(!t)return;const n=t[e.__symbol__("currentTaskTrace")];return n?f(n,t.stack):t.stack},onScheduleTask:function(t,n,r,i){if(m()){const t=e.currentTask;let n=t&&t.data&&t.data[s]||[];n=[new c].concat(n),n.length>this.longStackTraceLimit&&(n.length=this.longStackTraceLimit),i.data||(i.data={}),"eventTask"===i.type&&(i.data={...i.data}),i.data[s]=n}return t.scheduleTask(r,i)},onHandleError:function(t,n,r,i){if(m()){const t=e.currentTask||i.task;if(i instanceof Error&&t){const e=f(t.data&&t.data[s],i.stack);try{i.stack=i.longStack=e}catch(e){}}}return t.handleError(r,i)}},function y(){if(!m())return;const e=[];k(e,2);const t=e[0],s=e[1];for(let e=0;e<t.length;e++){const n=t[e];if(-1==n.indexOf(r)){let e=n.match(/^\s*at\s+/);if(e){o=e[0]+i+" (http://localhost)";break}}}for(let e=0;e<t.length;e++){const r=t[e];if(r!==s[e])break;n[r]=!0}}()}class ProxyZoneSpec{static get(){return Zone.current.get("ProxyZoneSpec")}static isLoaded(){return ProxyZoneSpec.get()instanceof ProxyZoneSpec}static assertPresent(){if(!ProxyZoneSpec.isLoaded())throw new Error("Expected to be running in 'ProxyZone', but it was not found.");return ProxyZoneSpec.get()}constructor(e=null){this.defaultSpecDelegate=e,this.name="ProxyZone",this._delegateSpec=null,this.properties={ProxyZoneSpec:this},this.propertyKeys=null,this.lastTaskState=null,this.isNeedToTriggerHasTask=!1,this.tasks=[],this.setDelegate(e)}setDelegate(e){const t=this._delegateSpec!==e;this._delegateSpec=e,this.propertyKeys&&this.propertyKeys.forEach((e=>delete this.properties[e])),this.propertyKeys=null,e&&e.properties&&(this.propertyKeys=Object.keys(e.properties),this.propertyKeys.forEach((t=>this.properties[t]=e.properties[t]))),t&&this.lastTaskState&&(this.lastTaskState.macroTask||this.lastTaskState.microTask)&&(this.isNeedToTriggerHasTask=!0)}getDelegate(){return this._delegateSpec}resetDelegate(){this.getDelegate(),this.setDelegate(this.defaultSpecDelegate)}tryTriggerHasTask(e,t,n){this.isNeedToTriggerHasTask&&this.lastTaskState&&(this.isNeedToTriggerHasTask=!1,this.onHasTask(e,t,n,this.lastTaskState))}removeFromTasks(e){if(this.tasks)for(let t=0;t<this.tasks.length;t++)if(this.tasks[t]===e)return void this.tasks.splice(t,1)}getAndClearPendingTasksInfo(){if(0===this.tasks.length)return"";const e="--Pending async tasks are: ["+this.tasks.map((e=>{const t=e.data&&Object.keys(e.data).map((t=>t+":"+e.data[t])).join(",");return`type: ${e.type}, source: ${e.source}, args: {${t}}`}))+"]";return this.tasks=[],e}onFork(e,t,n,s){return this._delegateSpec&&this._delegateSpec.onFork?this._delegateSpec.onFork(e,t,n,s):e.fork(n,s)}onIntercept(e,t,n,s,r){return this._delegateSpec&&this._delegateSpec.onIntercept?this._delegateSpec.onIntercept(e,t,n,s,r):e.intercept(n,s,r)}onInvoke(e,t,n,s,r,i,o){return this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvoke?this._delegateSpec.onInvoke(e,t,n,s,r,i,o):e.invoke(n,s,r,i,o)}onHandleError(e,t,n,s){return this._delegateSpec&&this._delegateSpec.onHandleError?this._delegateSpec.onHandleError(e,t,n,s):e.handleError(n,s)}onScheduleTask(e,t,n,s){return"eventTask"!==s.type&&this.tasks.push(s),this._delegateSpec&&this._delegateSpec.onScheduleTask?this._delegateSpec.onScheduleTask(e,t,n,s):e.scheduleTask(n,s)}onInvokeTask(e,t,n,s,r,i){return"eventTask"!==s.type&&this.removeFromTasks(s),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvokeTask?this._delegateSpec.onInvokeTask(e,t,n,s,r,i):e.invokeTask(n,s,r,i)}onCancelTask(e,t,n,s){return"eventTask"!==s.type&&this.removeFromTasks(s),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onCancelTask?this._delegateSpec.onCancelTask(e,t,n,s):e.cancelTask(n,s)}onHasTask(e,t,n,s){this.lastTaskState=s,this._delegateSpec&&this._delegateSpec.onHasTask?this._delegateSpec.onHasTask(e,t,n,s):e.hasTask(n,s)}}function patchProxyZoneSpec(e){e.ProxyZoneSpec=ProxyZoneSpec}function patchSyncTest(e){e.SyncTestZoneSpec=class{constructor(t){this.runZone=e.current,this.name="syncTestZone for "+t}onScheduleTask(e,t,n,s){switch(s.type){case"microTask":case"macroTask":throw new Error(`Cannot call ${s.source} from within a sync test (${this.name}).`);case"eventTask":s=e.scheduleTask(n,s)}return s}}}function patchPromiseTesting(e){e.__load_patch("promisefortest",((e,t,n)=>{const s=n.symbol("state"),r=n.symbol("parentUnresolved");Promise[n.symbol("patchPromiseForTest")]=function e(){let n=Promise[t.__symbol__("ZonePromiseThen")];n||(n=Promise[t.__symbol__("ZonePromiseThen")]=Promise.prototype.then,Promise.prototype.then=function(){const e=n.apply(this,arguments);if(null===this[s]){const n=t.current.get("AsyncTestZoneSpec");n&&(n.unresolvedChainedPromiseCount++,e[r]=!0)}return e})},Promise[n.symbol("unPatchPromiseForTest")]=function e(){const n=Promise[t.__symbol__("ZonePromiseThen")];n&&(Promise.prototype.then=n,Promise[t.__symbol__("ZonePromiseThen")]=void 0)}}))}function rollupTesting(e){patchLongStackTrace(e),patchProxyZoneSpec(e),patchSyncTest(e),patchJasmine(e),patchJest(e),patchMocha(e),patchAsyncTest(e),patchFakeAsyncTest(e),patchPromiseTesting(e)}rollupTesting(Zone);
*/function patchJasmine(e){e.__load_patch("jasmine",((e,t,n)=>{if(!t)throw new Error("Missing: zone.js");if("undefined"!=typeof jest)return;if("undefined"==typeof jasmine||jasmine.__zone_patch__)return;jasmine.__zone_patch__=!0;const s=t.SyncTestZoneSpec,r=t.ProxyZoneSpec;if(!s)throw new Error("Missing: SyncTestZoneSpec");if(!r)throw new Error("Missing: ProxyZoneSpec");const i=t.current,o=t.__symbol__,c=!0===e[o("fakeAsyncDisablePatchingClock")],a=!c&&(!0===e[o("fakeAsyncPatchLock")]||!0===e[o("fakeAsyncAutoFakeAsyncWhenClockPatched")]);if(!0!==e[o("ignoreUnhandledRejection")]){const t=jasmine.GlobalErrors;t&&!jasmine[o("GlobalErrors")]&&(jasmine[o("GlobalErrors")]=t,jasmine.GlobalErrors=function(){const n=new t,s=n.install;return s&&!n[o("install")]&&(n[o("install")]=s,n.install=function(){const t="undefined"!=typeof process&&!!process.on,n=t?process.listeners("unhandledRejection"):e.eventListeners("unhandledrejection"),r=s.apply(this,arguments);return t?process.removeAllListeners("unhandledRejection"):e.removeAllListeners("unhandledrejection"),n&&n.forEach((n=>{t?process.on("unhandledRejection",n):e.addEventListener("unhandledrejection",n)})),r}),n})}const l=jasmine.getEnv();if(["describe","xdescribe","fdescribe"].forEach((e=>{let t=l[e];l[e]=function(e,n){return t.call(this,e,function r(e,t){return function(){return i.fork(new s(`jasmine.describe#${e}`)).run(t,this,arguments)}}(e,n))}})),["it","xit","fit"].forEach((e=>{let t=l[e];l[o(e)]=t,l[e]=function(e,n,s){return arguments[1]=h(n),t.apply(this,arguments)}})),["beforeEach","afterEach","beforeAll","afterAll"].forEach((e=>{let t=l[e];l[o(e)]=t,l[e]=function(e,n){return arguments[0]=h(e),t.apply(this,arguments)}})),!c){const e=jasmine[o("clock")]=jasmine.clock;jasmine.clock=function(){const n=e.apply(this,arguments);if(!n[o("patched")]){n[o("patched")]=o("patched");const e=n[o("tick")]=n.tick;n.tick=function(){const n=t.current.get("FakeAsyncTestZoneSpec");return n?n.tick.apply(n,arguments):e.apply(this,arguments)};const s=n[o("mockDate")]=n.mockDate;n.mockDate=function(){const e=t.current.get("FakeAsyncTestZoneSpec");if(e){const t=arguments.length>0?arguments[0]:new Date;return e.setFakeBaseSystemTime.apply(e,t&&"function"==typeof t.getTime?[t.getTime()]:arguments)}return s.apply(this,arguments)},a&&["install","uninstall"].forEach((e=>{const s=n[o(e)]=n[e];n[e]=function(){if(!t.FakeAsyncTestZoneSpec)return s.apply(this,arguments);jasmine[o("clockInstalled")]="install"===e}}))}return n}}if(!jasmine[t.__symbol__("createSpyObj")]){const e=jasmine.createSpyObj;jasmine[t.__symbol__("createSpyObj")]=e,jasmine.createSpyObj=function(){const t=Array.prototype.slice.call(arguments);let n;if(t.length>=3&&t[2]){const s=Object.defineProperty;Object.defineProperty=function(e,t,n){return s.call(this,e,t,{...n,configurable:!0,enumerable:!0})};try{n=e.apply(this,t)}finally{Object.defineProperty=s}}else n=e.apply(this,t);return n}}function u(e,n,s,r){const i=!!jasmine[o("clockInstalled")],c=s.testProxyZone;if(i&&a){const n=t[t.__symbol__("fakeAsyncTest")];n&&"function"==typeof n.fakeAsync&&(e=n.fakeAsync(e))}return r?c.run(e,n,[r]):c.run(e,n)}function h(e){return e&&(e.length?function(t){return u(e,this,this.queueRunner,t)}:function(){return u(e,this,this.queueRunner)})}const p=jasmine.QueueRunner;jasmine.QueueRunner=function(n){function s(s){s.onComplete&&(s.onComplete=(e=>()=>{this.testProxyZone=null,this.testProxyZoneSpec=null,i.scheduleMicroTask("jasmine.onComplete",e)})(s.onComplete));const r=e[t.__symbol__("setTimeout")],o=e[t.__symbol__("clearTimeout")];r&&(s.timeout={setTimeout:r||e.setTimeout,clearTimeout:o||e.clearTimeout}),jasmine.UserContext?(s.userContext||(s.userContext=new jasmine.UserContext),s.userContext.queueRunner=this):(s.userContext||(s.userContext={}),s.userContext.queueRunner=this);const c=s.onException;s.onException=function(e){if(e&&"Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL."===e.message){const t=this&&this.testProxyZoneSpec;if(t){const n=t.getAndClearPendingTasksInfo();try{e.message+=n}catch(e){}}}c&&c.call(this,e)},n.call(this,s)}return function(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function n(){this.constructor=e}e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(s,n),s.prototype.execute=function(){let e=t.current,s=!1;for(;e;){if(e===i){s=!0;break}e=e.parent}if(!s)throw new Error("Unexpected Zone: "+t.current.name);this.testProxyZoneSpec=new r,this.testProxyZone=i.fork(this.testProxyZoneSpec),t.currentTask?n.prototype.execute.call(this):t.current.scheduleMicroTask("jasmine.execute().forceTask",(()=>p.prototype.execute.call(this)))},s}(p)}))}function patchJest(e){e.__load_patch("jest",((e,t,n)=>{if("undefined"==typeof jest||jest.__zone_patch__)return;t[n.symbol("ignoreConsoleErrorUncaughtError")]=!0,jest.__zone_patch__=!0;const s=t.ProxyZoneSpec,r=t.SyncTestZoneSpec;if(!s)throw new Error("Missing ProxyZoneSpec");const i=t.current,o=i.fork(new r("jest.describe")),c=new s,a=i.fork(c);function l(e){return function(...t){return o.run(e,this,t)}}function u(e,s=!1){if("function"!=typeof e)return e;const r=function(){if(!0===t[n.symbol("useFakeTimersCalled")]&&e&&!e.isFakeAsync){const n=t[t.__symbol__("fakeAsyncTest")];n&&"function"==typeof n.fakeAsync&&(e=n.fakeAsync(e))}return c.isTestFunc=s,a.run(e,null,arguments)};return Object.defineProperty(r,"length",{configurable:!0,writable:!0,enumerable:!1}),r.length=e.length,r}["describe","xdescribe","fdescribe"].forEach((n=>{let s=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=s,e[n]=function(...e){return e[1]=l(e[1]),s.apply(this,e)},e[n].each=function r(e){return function(...t){const n=e.apply(this,t);return function(...e){return e[1]=l(e[1]),n.apply(this,e)}}}(s.each))})),e.describe.only=e.fdescribe,e.describe.skip=e.xdescribe,["it","xit","fit","test","xtest"].forEach((n=>{let s=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=s,e[n]=function(...e){return e[1]=u(e[1],!0),s.apply(this,e)},e[n].each=function r(e){return function(...t){return function(...n){return n[1]=u(n[1]),e.apply(this,t).apply(this,n)}}}(s.each),e[n].todo=s.todo)})),e.it.only=e.fit,e.it.skip=e.xit,e.test.only=e.fit,e.test.skip=e.xit,["beforeEach","afterEach","beforeAll","afterAll"].forEach((n=>{let s=e[n];e[t.__symbol__(n)]||(e[t.__symbol__(n)]=s,e[n]=function(...e){return e[0]=u(e[0]),s.apply(this,e)})})),t.patchJestObject=function e(s,r=!1){function i(){return!!t.current.get("FakeAsyncTestZoneSpec")}function o(){const e=t.current.get("ProxyZoneSpec");return e&&e.isTestFunc}s[n.symbol("fakeTimers")]||(s[n.symbol("fakeTimers")]=!0,n.patchMethod(s,"_checkFakeTimers",(e=>function(t,n){return!!i()||e.apply(t,n)})),n.patchMethod(s,"useFakeTimers",(e=>function(s,i){return t[n.symbol("useFakeTimersCalled")]=!0,r||o()?e.apply(s,i):s})),n.patchMethod(s,"useRealTimers",(e=>function(s,i){return t[n.symbol("useFakeTimersCalled")]=!1,r||o()?e.apply(s,i):s})),n.patchMethod(s,"setSystemTime",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r||!i())return e.apply(n,s);r.setFakeBaseSystemTime(s[0])})),n.patchMethod(s,"getRealSystemTime",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");return r&&i()?r.getRealSystemTime():e.apply(n,s)})),n.patchMethod(s,"runAllTicks",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.flushMicrotasks()})),n.patchMethod(s,"runAllTimers",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.flush(100,!0)})),n.patchMethod(s,"advanceTimersByTime",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.tick(s[0])})),n.patchMethod(s,"runOnlyPendingTimers",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.flushOnlyPendingTimers()})),n.patchMethod(s,"advanceTimersToNextTimer",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.tickToNext(s[0])})),n.patchMethod(s,"clearAllTimers",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");if(!r)return e.apply(n,s);r.removeAllTimers()})),n.patchMethod(s,"getTimerCount",(e=>function(n,s){const r=t.current.get("FakeAsyncTestZoneSpec");return r?r.getTimerCount():e.apply(n,s)})))}}))}function patchMocha(e){e.__load_patch("mocha",((e,t)=>{const n=e.Mocha;if(void 0===n)return;if(void 0===t)throw new Error("Missing Zone.js");const s=t.ProxyZoneSpec,r=t.SyncTestZoneSpec;if(!s)throw new Error("Missing ProxyZoneSpec");if(n.__zone_patch__)throw new Error('"Mocha" has already been patched with "Zone".');n.__zone_patch__=!0;const i=t.current,o=i.fork(new r("Mocha.describe"));let c=null;const a=i.fork(new s),l={after:e.after,afterEach:e.afterEach,before:e.before,beforeEach:e.beforeEach,describe:e.describe,it:e.it};function u(e,t,n){for(let s=0;s<e.length;s++){let r=e[s];"function"==typeof r&&(e[s]=0===r.length?t(r):n(r),e[s].toString=function(){return r.toString()})}return e}function h(e){return u(e,(function(e){return function(){return o.run(e,this,arguments)}}))}function p(e){return u(e,(function(e){return function(){return c.run(e,this)}}),(function(e){return function(t){return c.run(e,this,[t])}}))}function d(e){return u(e,(function(e){return function(){return a.run(e,this)}}),(function(e){return function(t){return a.run(e,this,[t])}}))}var T,f;e.describe=e.suite=function(){return l.describe.apply(this,h(arguments))},e.xdescribe=e.suite.skip=e.describe.skip=function(){return l.describe.skip.apply(this,h(arguments))},e.describe.only=e.suite.only=function(){return l.describe.only.apply(this,h(arguments))},e.it=e.specify=e.test=function(){return l.it.apply(this,p(arguments))},e.xit=e.xspecify=e.it.skip=function(){return l.it.skip.apply(this,p(arguments))},e.it.only=e.test.only=function(){return l.it.only.apply(this,p(arguments))},e.after=e.suiteTeardown=function(){return l.after.apply(this,d(arguments))},e.afterEach=e.teardown=function(){return l.afterEach.apply(this,p(arguments))},e.before=e.suiteSetup=function(){return l.before.apply(this,d(arguments))},e.beforeEach=e.setup=function(){return l.beforeEach.apply(this,p(arguments))},T=n.Runner.prototype.runTest,f=n.Runner.prototype.run,n.Runner.prototype.runTest=function(e){t.current.scheduleMicroTask("mocha.forceTask",(()=>{T.call(this,e)}))},n.Runner.prototype.run=function(e){return this.on("test",(e=>{c=i.fork(new s)})),this.on("fail",((e,t)=>{const n=c&&c.get("ProxyZoneSpec");if(n&&t)try{t.message+=n.getAndClearPendingTasksInfo()}catch(e){}})),f.call(this,e)}}))}const global$2=globalThis;function __symbol__(e){return(global$2.__Zone_symbol_prefix||"__zone_symbol__")+e}const __global="undefined"!=typeof window&&window||"undefined"!=typeof self&&self||global;class AsyncTestZoneSpec{static get symbolParentUnresolved(){return __symbol__("parentUnresolved")}constructor(e,t,n){this.finishCallback=e,this.failCallback=t,this._pendingMicroTasks=!1,this._pendingMacroTasks=!1,this._alreadyErrored=!1,this._isSync=!1,this._existingFinishTimer=null,this.entryFunction=null,this.runZone=Zone.current,this.unresolvedChainedPromiseCount=0,this.supportWaitUnresolvedChainedPromise=!1,this.name="asyncTestZone for "+n,this.properties={AsyncTestZoneSpec:this},this.supportWaitUnresolvedChainedPromise=!0===__global[__symbol__("supportWaitUnResolvedChainedPromise")]}isUnresolvedChainedPromisePending(){return this.unresolvedChainedPromiseCount>0}_finishCallbackIfDone(){null!==this._existingFinishTimer&&(clearTimeout(this._existingFinishTimer),this._existingFinishTimer=null),this._pendingMicroTasks||this._pendingMacroTasks||this.supportWaitUnresolvedChainedPromise&&this.isUnresolvedChainedPromisePending()||this.runZone.run((()=>{this._existingFinishTimer=setTimeout((()=>{this._alreadyErrored||this._pendingMicroTasks||this._pendingMacroTasks||this.finishCallback()}),0)}))}patchPromiseForTest(){if(!this.supportWaitUnresolvedChainedPromise)return;const e=Promise[Zone.__symbol__("patchPromiseForTest")];e&&e()}unPatchPromiseForTest(){if(!this.supportWaitUnresolvedChainedPromise)return;const e=Promise[Zone.__symbol__("unPatchPromiseForTest")];e&&e()}onScheduleTask(e,t,n,s){return"eventTask"!==s.type&&(this._isSync=!1),"microTask"===s.type&&s.data&&s.data instanceof Promise&&!0===s.data[AsyncTestZoneSpec.symbolParentUnresolved]&&this.unresolvedChainedPromiseCount--,e.scheduleTask(n,s)}onInvokeTask(e,t,n,s,r,i){return"eventTask"!==s.type&&(this._isSync=!1),e.invokeTask(n,s,r,i)}onCancelTask(e,t,n,s){return"eventTask"!==s.type&&(this._isSync=!1),e.cancelTask(n,s)}onInvoke(e,t,n,s,r,i,o){this.entryFunction||(this.entryFunction=s);try{return this._isSync=!0,e.invoke(n,s,r,i,o)}finally{this._isSync&&this.entryFunction===s&&this._finishCallbackIfDone()}}onHandleError(e,t,n,s){return e.handleError(n,s)&&(this.failCallback(s),this._alreadyErrored=!0),!1}onHasTask(e,t,n,s){e.hasTask(n,s),t===n&&("microTask"==s.change?(this._pendingMicroTasks=s.microTask,this._finishCallbackIfDone()):"macroTask"==s.change&&(this._pendingMacroTasks=s.macroTask,this._finishCallbackIfDone()))}}function patchAsyncTest(e){e.AsyncTestZoneSpec=AsyncTestZoneSpec,e.__load_patch("asynctest",((e,t,n)=>{function s(e,n,s,r){const i=t.current,o=t.AsyncTestZoneSpec;if(void 0===o)throw new Error("AsyncTestZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/async-test");const c=t.ProxyZoneSpec;if(!c)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");const a=c.get();c.assertPresent();const l=t.current.getZoneWith("ProxyZoneSpec"),u=a.getDelegate();return l.parent.run((()=>{const e=new o((()=>{a.getDelegate()==e&&a.setDelegate(u),e.unPatchPromiseForTest(),i.run((()=>{s()}))}),(t=>{a.getDelegate()==e&&a.setDelegate(u),e.unPatchPromiseForTest(),i.run((()=>{r(t)}))}),"test");a.setDelegate(e),e.patchPromiseForTest()})),t.current.runGuarded(e,n)}t[n.symbol("asyncTest")]=function t(n){return e.jasmine?function(e){e||((e=function(){}).fail=function(e){throw e}),s(n,this,e,(t=>{if("string"==typeof t)return e.fail(new Error(t));e.fail(t)}))}:function(){return new Promise(((e,t)=>{s(n,this,e,t)}))}}}))}const global$1="object"==typeof window&&window||"object"==typeof self&&self||globalThis.global,OriginalDate=global$1.Date;function FakeDate(){if(0===arguments.length){const e=new OriginalDate;return e.setTime(FakeDate.now()),e}{const e=Array.prototype.slice.call(arguments);return new OriginalDate(...e)}}let patchedTimers;FakeDate.now=function(){const e=Zone.current.get("FakeAsyncTestZoneSpec");return e?e.getFakeSystemTime():OriginalDate.now.apply(this,arguments)},FakeDate.UTC=OriginalDate.UTC,FakeDate.parse=OriginalDate.parse;const timeoutCallback=function(){};class Scheduler{static{this.nextNodeJSId=1}static{this.nextId=-1}constructor(){this._schedulerQueue=[],this._currentTickTime=0,this._currentFakeBaseSystemTime=OriginalDate.now(),this._currentTickRequeuePeriodicEntries=[]}static getNextId(){const e=patchedTimers.nativeSetTimeout.call(global$1,timeoutCallback,0);return patchedTimers.nativeClearTimeout.call(global$1,e),"number"==typeof e?e:Scheduler.nextNodeJSId++}getCurrentTickTime(){return this._currentTickTime}getFakeSystemTime(){return this._currentFakeBaseSystemTime+this._currentTickTime}setFakeBaseSystemTime(e){this._currentFakeBaseSystemTime=e}getRealSystemTime(){return OriginalDate.now()}scheduleFunction(e,t,n){let s=(n={args:[],isPeriodic:!1,isRequestAnimationFrame:!1,id:-1,isRequeuePeriodic:!1,...n}).id<0?Scheduler.nextId:n.id;Scheduler.nextId=Scheduler.getNextId();let r={endTime:this._currentTickTime+t,id:s,func:e,args:n.args,delay:t,isPeriodic:n.isPeriodic,isRequestAnimationFrame:n.isRequestAnimationFrame};n.isRequeuePeriodic&&this._currentTickRequeuePeriodicEntries.push(r);let i=0;for(;i<this._schedulerQueue.length&&!(r.endTime<this._schedulerQueue[i].endTime);i++);return this._schedulerQueue.splice(i,0,r),s}removeScheduledFunctionWithId(e){for(let t=0;t<this._schedulerQueue.length;t++)if(this._schedulerQueue[t].id==e){this._schedulerQueue.splice(t,1);break}}removeAll(){this._schedulerQueue=[]}getTimerCount(){return this._schedulerQueue.length}tickToNext(e=1,t,n){this._schedulerQueue.length<e||this.tick(this._schedulerQueue[e-1].endTime-this._currentTickTime,t,n)}tick(e=0,t,n){let s=this._currentTickTime+e,r=0;const i=(n=Object.assign({processNewMacroTasksSynchronously:!0},n)).processNewMacroTasksSynchronously?this._schedulerQueue:this._schedulerQueue.slice();if(0===i.length&&t)t(e);else{for(;i.length>0&&(this._currentTickRequeuePeriodicEntries=[],!(s<i[0].endTime));){let e=i.shift();if(!n.processNewMacroTasksSynchronously){const t=this._schedulerQueue.indexOf(e);t>=0&&this._schedulerQueue.splice(t,1)}if(r=this._currentTickTime,this._currentTickTime=e.endTime,t&&t(this._currentTickTime-r),!e.func.apply(global$1,e.isRequestAnimationFrame?[this._currentTickTime]:e.args))break;n.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach((e=>{let t=0;for(;t<i.length&&!(e.endTime<i[t].endTime);t++);i.splice(t,0,e)}))}r=this._currentTickTime,this._currentTickTime=s,t&&t(this._currentTickTime-r)}}flushOnlyPendingTimers(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e,{processNewMacroTasksSynchronously:!1}),this._currentTickTime-t}flush(e=20,t=!1,n){return t?this.flushPeriodic(n):this.flushNonPeriodic(e,n)}flushPeriodic(e){if(0===this._schedulerQueue.length)return 0;const t=this._currentTickTime;return this.tick(this._schedulerQueue[this._schedulerQueue.length-1].endTime-t,e),this._currentTickTime-t}flushNonPeriodic(e,t){const n=this._currentTickTime;let s=0,r=0;for(;this._schedulerQueue.length>0;){if(r++,r>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(0===this._schedulerQueue.filter((e=>!e.isPeriodic&&!e.isRequestAnimationFrame)).length)break;const n=this._schedulerQueue.shift();if(s=this._currentTickTime,this._currentTickTime=n.endTime,t&&t(this._currentTickTime-s),!n.func.apply(global$1,n.args))break}return this._currentTickTime-n}}class FakeAsyncTestZoneSpec{static assertInZone(){if(null==Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("The code should be running in the fakeAsync zone to call this function")}constructor(e,t=!1,n){this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=n,this._scheduler=new Scheduler,this._microtasks=[],this._lastError=null,this._uncaughtPromiseErrors=Promise[Zone.__symbol__("uncaughtPromiseErrors")],this.pendingPeriodicTimers=[],this.pendingTimers=[],this.patchDateLocked=!1,this.properties={FakeAsyncTestZoneSpec:this},this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=global$1[Zone.__symbol__("FakeAsyncTestMacroTask")])}_fnAndFlush(e,t){return(...n)=>(e.apply(global$1,n),null===this._lastError?(null!=t.onSuccess&&t.onSuccess.apply(global$1),this.flushMicrotasks()):null!=t.onError&&t.onError.apply(global$1),null===this._lastError)}static _removeTimer(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}_dequeueTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e)}}_requeuePeriodicTimer(e,t,n,s){return()=>{-1!==this.pendingPeriodicTimers.indexOf(s)&&this._scheduler.scheduleFunction(e,t,{args:n,isPeriodic:!0,id:s,isRequeuePeriodic:!0})}}_dequeuePeriodicTimer(e){return()=>{FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e)}}_setTimeout(e,t,n,s=!0){let r=this._dequeueTimer(Scheduler.nextId),i=this._fnAndFlush(e,{onSuccess:r,onError:r}),o=this._scheduler.scheduleFunction(i,t,{args:n,isRequestAnimationFrame:!s});return s&&this.pendingTimers.push(o),o}_clearTimeout(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_setInterval(e,t,n){let s=Scheduler.nextId,r={onSuccess:null,onError:this._dequeuePeriodicTimer(s)},i=this._fnAndFlush(e,r);return r.onSuccess=this._requeuePeriodicTimer(i,t,n,s),this._scheduler.scheduleFunction(i,t,{args:n,isPeriodic:!0}),this.pendingPeriodicTimers.push(s),s}_clearInterval(e){FakeAsyncTestZoneSpec._removeTimer(this.pendingPeriodicTimers,e),this._scheduler.removeScheduledFunctionWithId(e)}_resetLastErrorAndThrow(){let e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e}getCurrentTickTime(){return this._scheduler.getCurrentTickTime()}getFakeSystemTime(){return this._scheduler.getFakeSystemTime()}setFakeBaseSystemTime(e){this._scheduler.setFakeBaseSystemTime(e)}getRealSystemTime(){return this._scheduler.getRealSystemTime()}static patchDate(){global$1[Zone.__symbol__("disableDatePatching")]||global$1.Date!==FakeDate&&(global$1.Date=FakeDate,FakeDate.prototype=OriginalDate.prototype,FakeAsyncTestZoneSpec.checkTimerPatch())}static resetDate(){global$1.Date===FakeDate&&(global$1.Date=OriginalDate)}static checkTimerPatch(){if(!patchedTimers)throw new Error("Expected timers to have been patched.");global$1.setTimeout!==patchedTimers.setTimeout&&(global$1.setTimeout=patchedTimers.setTimeout,global$1.clearTimeout=patchedTimers.clearTimeout),global$1.setInterval!==patchedTimers.setInterval&&(global$1.setInterval=patchedTimers.setInterval,global$1.clearInterval=patchedTimers.clearInterval)}lockDatePatch(){this.patchDateLocked=!0,FakeAsyncTestZoneSpec.patchDate()}unlockDatePatch(){this.patchDateLocked=!1,FakeAsyncTestZoneSpec.resetDate()}tickToNext(e=1,t,n={processNewMacroTasksSynchronously:!0}){e<=0||(FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(e,t,n),null!==this._lastError&&this._resetLastErrorAndThrow())}tick(e=0,t,n={processNewMacroTasksSynchronously:!0}){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(e,t,n),null!==this._lastError&&this._resetLastErrorAndThrow()}flushMicrotasks(){for(FakeAsyncTestZoneSpec.assertInZone();this._microtasks.length>0;){let e=this._microtasks.shift();e.func.apply(e.target,e.args)}(()=>{(null!==this._lastError||this._uncaughtPromiseErrors.length)&&this._resetLastErrorAndThrow()})()}flush(e,t,n){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const s=this._scheduler.flush(e,t,n);return null!==this._lastError&&this._resetLastErrorAndThrow(),s}flushOnlyPendingTimers(e){FakeAsyncTestZoneSpec.assertInZone(),this.flushMicrotasks();const t=this._scheduler.flushOnlyPendingTimers(e);return null!==this._lastError&&this._resetLastErrorAndThrow(),t}removeAllTimers(){FakeAsyncTestZoneSpec.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]}getTimerCount(){return this._scheduler.getTimerCount()+this._microtasks.length}onScheduleTask(e,t,n,s){switch(s.type){case"microTask":let t,r=s.data&&s.data.args;if(r){let e=s.data.cbIdx;"number"==typeof r.length&&r.length>e+1&&(t=Array.prototype.slice.call(r,e+1))}this._microtasks.push({func:s.invoke,args:t,target:s.data&&s.data.target});break;case"macroTask":switch(s.source){case"setTimeout":s.data.handleId=this._setTimeout(s.invoke,s.data.delay,Array.prototype.slice.call(s.data.args,2));break;case"setImmediate":s.data.handleId=this._setTimeout(s.invoke,0,Array.prototype.slice.call(s.data.args,1));break;case"setInterval":s.data.handleId=this._setInterval(s.invoke,s.data.delay,Array.prototype.slice.call(s.data.args,2));break;case"XMLHttpRequest.send":throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+s.data.url);case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":s.data.handleId=this._setTimeout(s.invoke,16,s.data.args,this.trackPendingRequestAnimationFrame);break;default:const e=this.findMacroTaskOption(s);if(e){const t=s.data&&s.data.args,n=t&&t.length>1?t[1]:0;let r=e.callbackArgs?e.callbackArgs:t;e.isPeriodic?(s.data.handleId=this._setInterval(s.invoke,n,r),s.data.isPeriodic=!0):s.data.handleId=this._setTimeout(s.invoke,n,r);break}throw new Error("Unknown macroTask scheduled in fake async test: "+s.source)}break;case"eventTask":s=e.scheduleTask(n,s)}return s}onCancelTask(e,t,n,s){switch(s.source){case"setTimeout":case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":return this._clearTimeout(s.data.handleId);case"setInterval":return this._clearInterval(s.data.handleId);default:const t=this.findMacroTaskOption(s);if(t){const e=s.data.handleId;return t.isPeriodic?this._clearInterval(e):this._clearTimeout(e)}return e.cancelTask(n,s)}}onInvoke(e,t,n,s,r,i,o){try{return FakeAsyncTestZoneSpec.patchDate(),e.invoke(n,s,r,i,o)}finally{this.patchDateLocked||FakeAsyncTestZoneSpec.resetDate()}}findMacroTaskOption(e){if(!this.macroTaskOptions)return null;for(let t=0;t<this.macroTaskOptions.length;t++){const n=this.macroTaskOptions[t];if(n.source===e.source)return n}return null}onHandleError(e,t,n,s){return this._lastError=s,!1}}let _fakeAsyncTestZoneSpec=null;function getProxyZoneSpec(){return Zone&&Zone.ProxyZoneSpec}function resetFakeAsyncZone(){_fakeAsyncTestZoneSpec&&_fakeAsyncTestZoneSpec.unlockDatePatch(),_fakeAsyncTestZoneSpec=null,getProxyZoneSpec()&&getProxyZoneSpec().assertPresent().resetDelegate()}function fakeAsync(e,t={}){const{flush:n=!1}=t,s=function(...t){const s=getProxyZoneSpec();if(!s)throw new Error("ProxyZoneSpec is needed for the async() test helper but could not be found. Please make sure that your environment includes zone.js/plugins/proxy");const r=s.assertPresent();if(Zone.current.get("FakeAsyncTestZoneSpec"))throw new Error("fakeAsync() calls can not be nested");try{if(!_fakeAsyncTestZoneSpec){const e=Zone&&Zone.FakeAsyncTestZoneSpec;if(r.getDelegate()instanceof e)throw new Error("fakeAsync() calls can not be nested");_fakeAsyncTestZoneSpec=new e}let s;const i=r.getDelegate();r.setDelegate(_fakeAsyncTestZoneSpec),_fakeAsyncTestZoneSpec.lockDatePatch();try{s=e.apply(this,t),n?_fakeAsyncTestZoneSpec.flush(20,!0):flushMicrotasks()}finally{r.setDelegate(i)}if(!n){if(_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingPeriodicTimers.length} periodic timer(s) still in the queue.`);if(_fakeAsyncTestZoneSpec.pendingTimers.length>0)throw new Error(`${_fakeAsyncTestZoneSpec.pendingTimers.length} timer(s) still in the queue.`)}return s}finally{resetFakeAsyncZone()}};return s.isFakeAsync=!0,s}function _getFakeAsyncZoneSpec(){if(null==_fakeAsyncTestZoneSpec&&(_fakeAsyncTestZoneSpec=Zone.current.get("FakeAsyncTestZoneSpec"),null==_fakeAsyncTestZoneSpec))throw new Error("The code should be running in the fakeAsync zone to call this function");return _fakeAsyncTestZoneSpec}function tick(e=0,t=!1){_getFakeAsyncZoneSpec().tick(e,null,t)}function flush(e){return _getFakeAsyncZoneSpec().flush(e)}function discardPeriodicTasks(){_getFakeAsyncZoneSpec().pendingPeriodicTimers.length=0}function flushMicrotasks(){_getFakeAsyncZoneSpec().flushMicrotasks()}function patchFakeAsyncTest(e){e.FakeAsyncTestZoneSpec=FakeAsyncTestZoneSpec,e.__load_patch("fakeasync",((e,t,n)=>{t[n.symbol("fakeAsyncTest")]={resetFakeAsyncZone:resetFakeAsyncZone,flushMicrotasks:flushMicrotasks,discardPeriodicTasks:discardPeriodicTasks,tick:tick,flush:flush,fakeAsync:fakeAsync}}),!0),patchedTimers={setTimeout:global$1.setTimeout,setInterval:global$1.setInterval,clearTimeout:global$1.clearTimeout,clearInterval:global$1.clearInterval,nativeSetTimeout:global$1[e.__symbol__("setTimeout")],nativeClearTimeout:global$1[e.__symbol__("clearTimeout")]},Scheduler.nextId=Scheduler.getNextId()}function patchLongStackTrace(e){const t="\n",n={},s="__creationTrace__",r="STACKTRACE TRACKING",i="__SEP_TAG__";let o=i+"@[native]";class c{constructor(){this.error=p(),this.timestamp=new Date}}function a(){return new Error(r)}function l(){try{throw a()}catch(e){return e}}const u=a(),h=l(),p=u.stack?a:h.stack?l:a;function d(e){return e.stack?e.stack.split(t):[]}function T(e,t){let s=d(t);for(let t=0;t<s.length;t++)n.hasOwnProperty(s[t])||e.push(s[t])}function f(e,n){const s=[n?n.trim():""];if(e){let t=(new Date).getTime();for(let n=0;n<e.length;n++){const r=e[n],c=r.timestamp;let a=`____________________Elapsed ${t-c.getTime()} ms; At: ${c}`;a=a.replace(/[^\w\d]/g,"_"),s.push(o.replace(i,a)),T(s,r.error),t=c.getTime()}}return s.join(t)}function m(){return Error.stackTraceLimit>0}function k(e,t){t>0&&(e.push(d((new c).error)),k(e,t-1))}e.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(t){if(!t)return;const n=t[e.__symbol__("currentTaskTrace")];return n?f(n,t.stack):t.stack},onScheduleTask:function(t,n,r,i){if(m()){const t=e.currentTask;let n=t&&t.data&&t.data[s]||[];n=[new c].concat(n),n.length>this.longStackTraceLimit&&(n.length=this.longStackTraceLimit),i.data||(i.data={}),"eventTask"===i.type&&(i.data={...i.data}),i.data[s]=n}return t.scheduleTask(r,i)},onHandleError:function(t,n,r,i){if(m()){const t=e.currentTask||i.task;if(i instanceof Error&&t){const e=f(t.data&&t.data[s],i.stack);try{i.stack=i.longStack=e}catch(e){}}}return t.handleError(r,i)}},function y(){if(!m())return;const e=[];k(e,2);const t=e[0],s=e[1];for(let e=0;e<t.length;e++){const n=t[e];if(-1==n.indexOf(r)){let e=n.match(/^\s*at\s+/);if(e){o=e[0]+i+" (http://localhost)";break}}}for(let e=0;e<t.length;e++){const r=t[e];if(r!==s[e])break;n[r]=!0}}()}class ProxyZoneSpec{static get(){return Zone.current.get("ProxyZoneSpec")}static isLoaded(){return ProxyZoneSpec.get()instanceof ProxyZoneSpec}static assertPresent(){if(!ProxyZoneSpec.isLoaded())throw new Error("Expected to be running in 'ProxyZone', but it was not found.");return ProxyZoneSpec.get()}constructor(e=null){this.defaultSpecDelegate=e,this.name="ProxyZone",this._delegateSpec=null,this.properties={ProxyZoneSpec:this},this.propertyKeys=null,this.lastTaskState=null,this.isNeedToTriggerHasTask=!1,this.tasks=[],this.setDelegate(e)}setDelegate(e){const t=this._delegateSpec!==e;this._delegateSpec=e,this.propertyKeys&&this.propertyKeys.forEach((e=>delete this.properties[e])),this.propertyKeys=null,e&&e.properties&&(this.propertyKeys=Object.keys(e.properties),this.propertyKeys.forEach((t=>this.properties[t]=e.properties[t]))),t&&this.lastTaskState&&(this.lastTaskState.macroTask||this.lastTaskState.microTask)&&(this.isNeedToTriggerHasTask=!0)}getDelegate(){return this._delegateSpec}resetDelegate(){this.getDelegate(),this.setDelegate(this.defaultSpecDelegate)}tryTriggerHasTask(e,t,n){this.isNeedToTriggerHasTask&&this.lastTaskState&&(this.isNeedToTriggerHasTask=!1,this.onHasTask(e,t,n,this.lastTaskState))}removeFromTasks(e){if(this.tasks)for(let t=0;t<this.tasks.length;t++)if(this.tasks[t]===e)return void this.tasks.splice(t,1)}getAndClearPendingTasksInfo(){if(0===this.tasks.length)return"";const e="--Pending async tasks are: ["+this.tasks.map((e=>{const t=e.data&&Object.keys(e.data).map((t=>t+":"+e.data[t])).join(",");return`type: ${e.type}, source: ${e.source}, args: {${t}}`}))+"]";return this.tasks=[],e}onFork(e,t,n,s){return this._delegateSpec&&this._delegateSpec.onFork?this._delegateSpec.onFork(e,t,n,s):e.fork(n,s)}onIntercept(e,t,n,s,r){return this._delegateSpec&&this._delegateSpec.onIntercept?this._delegateSpec.onIntercept(e,t,n,s,r):e.intercept(n,s,r)}onInvoke(e,t,n,s,r,i,o){return this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvoke?this._delegateSpec.onInvoke(e,t,n,s,r,i,o):e.invoke(n,s,r,i,o)}onHandleError(e,t,n,s){return this._delegateSpec&&this._delegateSpec.onHandleError?this._delegateSpec.onHandleError(e,t,n,s):e.handleError(n,s)}onScheduleTask(e,t,n,s){return"eventTask"!==s.type&&this.tasks.push(s),this._delegateSpec&&this._delegateSpec.onScheduleTask?this._delegateSpec.onScheduleTask(e,t,n,s):e.scheduleTask(n,s)}onInvokeTask(e,t,n,s,r,i){return"eventTask"!==s.type&&this.removeFromTasks(s),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onInvokeTask?this._delegateSpec.onInvokeTask(e,t,n,s,r,i):e.invokeTask(n,s,r,i)}onCancelTask(e,t,n,s){return"eventTask"!==s.type&&this.removeFromTasks(s),this.tryTriggerHasTask(e,t,n),this._delegateSpec&&this._delegateSpec.onCancelTask?this._delegateSpec.onCancelTask(e,t,n,s):e.cancelTask(n,s)}onHasTask(e,t,n,s){this.lastTaskState=s,this._delegateSpec&&this._delegateSpec.onHasTask?this._delegateSpec.onHasTask(e,t,n,s):e.hasTask(n,s)}}function patchProxyZoneSpec(e){e.ProxyZoneSpec=ProxyZoneSpec}function patchSyncTest(e){e.SyncTestZoneSpec=class{constructor(t){this.runZone=e.current,this.name="syncTestZone for "+t}onScheduleTask(e,t,n,s){switch(s.type){case"microTask":case"macroTask":throw new Error(`Cannot call ${s.source} from within a sync test (${this.name}).`);case"eventTask":s=e.scheduleTask(n,s)}return s}}}function patchPromiseTesting(e){e.__load_patch("promisefortest",((e,t,n)=>{const s=n.symbol("state"),r=n.symbol("parentUnresolved");Promise[n.symbol("patchPromiseForTest")]=function e(){let n=Promise[t.__symbol__("ZonePromiseThen")];n||(n=Promise[t.__symbol__("ZonePromiseThen")]=Promise.prototype.then,Promise.prototype.then=function(){const e=n.apply(this,arguments);if(null===this[s]){const n=t.current.get("AsyncTestZoneSpec");n&&(n.unresolvedChainedPromiseCount++,e[r]=!0)}return e})},Promise[n.symbol("unPatchPromiseForTest")]=function e(){const n=Promise[t.__symbol__("ZonePromiseThen")];n&&(Promise.prototype.then=n,Promise[t.__symbol__("ZonePromiseThen")]=void 0)}}))}function rollupTesting(e){patchLongStackTrace(e),patchProxyZoneSpec(e),patchSyncTest(e),patchJasmine(e),patchJest(e),patchMocha(e),patchAsyncTest(e),patchFakeAsyncTest(e),patchPromiseTesting(e)}rollupTesting(Zone);
{
"name": "zone.js",
"version": "0.14.8",
"version": "0.14.10",
"description": "Zones for JavaScript",

@@ -5,0 +5,0 @@ "main": "./bundles/zone.umd.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc