"use strict";var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n * (c) 2010-2022 Google LLC. https://angular.io/ * License: MIT */!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){!function(e){var t,n=e.performance;function r(e){n&&n.mark&&n.mark(e)}function o(e,t){n&&n.measure&&n.measure(e,t)}r("Zone");var i=e.__Zone_symbol_prefix||"__zone_symbol__";function a(e){return i+e}var s=!0===e[a("forceDuplicateZoneCheck")];if(e.Zone){if(s||"function"!=typeof e.Zone.__symbol__)throw new Error("Zone already loaded.");return e.Zone}var c=function(){function n(e,t){this._parent=e,this._name=t?t.name||"unnamed":"",this._properties=t&&t.properties||{},this._zoneDelegate=new f(this,this._parent&&this._parent._zoneDelegate,t)}return n.assertZonePatched=function(){if(e.Promise!==z.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(n,"root",{get:function(){for(var e=t.current;e.parent;)e=e.parent;return e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"current",{get:function(){return I.zone},enumerable:!1,configurable:!0}),Object.defineProperty(n,"currentTask",{get:function(){return N},enumerable:!1,configurable:!0}),n.__load_patch=function(n,i,a){if(void 0===a&&(a=!1),z.hasOwnProperty(n)){if(!a&&s)throw Error("Already loaded patch: "+n)}else if(!e["__Zone_disable_"+n]){var c="Zone:"+n;r(c),z[n]=i(e,t,C),o(c,c)}},Object.defineProperty(n.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),n.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},n.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},n.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},n.prototype.wrap=function(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},n.prototype.run=function(e,t,n,r){I={parent:I,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{I=I.parent}},n.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),I={parent:I,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{I=I.parent}},n.prototype.runTask=function(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||T).name+"; Execution: "+this.name+")");if(e.state!==b||e.type!==O&&e.type!==j){var r=e.state!=E;r&&e._transitionTo(E,Z),e.runCount++;var o=N;N=e,I={parent:I,zone:this};try{e.type==j&&e.data&&!e.data.isPeriodic&&(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{e.state!==b&&e.state!==P&&(e.type==O||e.data&&e.data.isPeriodic?r&&e._transitionTo(Z,E):(e.runCount=0,this._updateTaskCount(e,-1),r&&e._transitionTo(b,E,b))),I=I.parent,N=o}}},n.prototype.scheduleTask=function(e){if(e.zone&&e.zone!==this)for(var t=this;t;){if(t===e.zone)throw Error("can not reschedule task to ".concat(this.name," which is descendants of the original zone ").concat(e.zone.name));t=t.parent}e._transitionTo(w,b);var n=[];e._zoneDelegates=n,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(P,w,b),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===n&&this._updateTaskCount(e,1),e.state==w&&e._transitionTo(Z,w),e},n.prototype.scheduleMicroTask=function(e,t,n,r){return this.scheduleTask(new h(D,e,t,n,r,void 0))},n.prototype.scheduleMacroTask=function(e,t,n,r,o){return this.scheduleTask(new h(j,e,t,n,r,o))},n.prototype.scheduleEventTask=function(e,t,n,r,o){return this.scheduleTask(new h(O,e,t,n,r,o))},n.prototype.cancelTask=function(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||T).name+"; Execution: "+this.name+")");if(e.state===Z||e.state===E){e._transitionTo(S,Z,E);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(P,S),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(b,S),e.runCount=0,e}},n.prototype._updateTaskCount=function(e,t){var n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(var r=0;r0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e})},e}(),h=function(){function t(n,r,o,i,a,s){if(this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=i,this.scheduleFn=a,this.cancelFn=s,!o)throw new Error("callback is not defined");this.callback=o;var c=this;this.invoke=n===O&&i&&i.useG?t.invokeTask:function(){return t.invokeTask.call(e,c,this,arguments)}}return t.invokeTask=function(e,t,n){e||(e=this),x++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==x&&m(),x--}},Object.defineProperty(t.prototype,"zone",{get:function(){return this._zone},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.cancelScheduleRequest=function(){this._transitionTo(b,w)},t.prototype._transitionTo=function(e,t,n){if(this._state!==t&&this._state!==n)throw new Error("".concat(this.type," '").concat(this.source,"': can not transition to '").concat(e,"', expecting state '").concat(t,"'").concat(n?" or '"+n+"'":"",", was '").concat(this._state,"'."));this._state=e,e==b&&(this._zoneDelegates=null)},t.prototype.toString=function(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)},t.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}},t}(),p=a("setTimeout"),v=a("Promise"),d=a("then"),_=[],k=!1;function y(t){if(u||e[v]&&(u=e[v].resolve(0)),u){var n=u[d];n||(n=u.then),n.call(u,t)}else e[p](t,0)}function g(e){0===x&&0===_.length&&y(m),e&&_.push(e)}function m(){if(!k){for(k=!0;_.length;){var e=_;_=[];for(var t=0;t=0;n--)"function"==typeof e[n]&&(e[n]=u(e[n],t+"_"+n));return e}var k="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,y=!("nw"in v)&&void 0!==v.process&&"[object process]"==={}.toString.call(v.process),g=!y&&!k&&!(!h||!p.HTMLElement),m=void 0!==v.process&&"[object process]"==={}.toString.call(v.process)&&!k&&!(!h||!p.HTMLElement),T={},b=function(e){if(e=e||v.event){var t=T[e.type];t||(t=T[e.type]=f("ON_PROPERTY"+e.type));var n,r=this||e.target||v,o=r[t];return g&&r===p&&"error"===e.type?!0===(n=o&&o.call(this,e.message,e.filename,e.lineno,e.colno,e.error))&&e.preventDefault():null==(n=o&&o.apply(this,arguments))||n||e.preventDefault(),n}};function w(n,r,o){var i=e(n,r);if(!i&&o&&e(o,r)&&(i={enumerable:!0,configurable:!0}),i&&i.configurable){var a=f("on"+r+"patched");if(!n.hasOwnProperty(a)||!n[a]){delete i.writable,delete i.value;var s=i.get,c=i.set,u=r.slice(2),l=T[u];l||(l=T[u]=f("ON_PROPERTY"+u)),i.set=function(e){var t=this;t||n!==v||(t=v),t&&("function"==typeof t[l]&&t.removeEventListener(u,b),c&&c.call(t,null),t[l]=e,"function"==typeof e&&t.addEventListener(u,b,!1))},i.get=function(){var e=this;if(e||n!==v||(e=v),!e)return null;var t=e[l];if(t)return t;if(s){var o=s.call(this);if(o)return i.set.call(this,o),"function"==typeof e[d]&&e.removeAttribute(r),o}return null},t(n,r,i),n[a]=!0}}}function Z(e,t,n){if(t)for(var r=0;r=0&&"function"==typeof r[i.cbIdx]?l(i.name,r[i.cbIdx],i,o):e.apply(t,r)}}))}function D(e,t){e[f("OriginalDelegate")]=t}Zone.__load_patch("ZoneAwarePromise",(function(e,t,n){var r=Object.getOwnPropertyDescriptor,o=Object.defineProperty,i=n.symbol,a=[],s=!1!==e[i("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=i("Promise"),u=i("then"),l="__creationTrace__";n.onUnhandledError=function(e){if(n.showUncaughtError()){var t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=function(){for(var e=function(){var e=a.shift();try{e.zone.runGuarded((function(){if(e.throwOriginal)throw e.rejection;throw e}))}catch(e){!function r(e){n.onUnhandledError(e);try{var r=t[f];"function"==typeof r&&r.call(this,e)}catch(e){}}(e)}};a.length;)e()};var f=i("unhandledPromiseRejectionHandler");function h(e){return e&&e.then}function p(e){return e}function v(e){return A.reject(e)}var d=i("state"),_=i("value"),k=i("finally"),y=i("parentPromiseValue"),g=i("parentPromiseState"),m="Promise.then",T=null,b=!0,w=!1,Z=0;function E(e,t){return function(n){try{O(e,t,n)}catch(t){O(e,!1,t)}}}var P=function(){var e=!1;return function t(n){return function(){e||(e=!0,n.apply(null,arguments))}}},D="Promise resolved with itself",j=i("currentTaskTrace");function O(e,r,i){var c=P();if(e===i)throw new TypeError(D);if(e[d]===T){var u=null;try{"object"!=typeof i&&"function"!=typeof i||(u=i&&i.then)}catch(t){return c((function(){O(e,!1,t)}))(),e}if(r!==w&&i instanceof A&&i.hasOwnProperty(d)&&i.hasOwnProperty(_)&&i[d]!==T)C(i),O(e,i[d],i[_]);else if(r!==w&&"function"==typeof u)try{u.call(i,c(E(e,r)),c(E(e,!1)))}catch(t){c((function(){O(e,!1,t)}))()}else{e[d]=r;var f=e[_];if(e[_]=i,e[k]===k&&r===b&&(e[d]=e[g],e[_]=e[y]),r===w&&i instanceof Error){var h=t.currentTask&&t.currentTask.data&&t.currentTask.data[l];h&&o(i,j,{configurable:!0,enumerable:!1,writable:!0,value:h})}for(var p=0;p0?n.length-1:-1,target:e}}))}))}));var H=f("zoneTask");function L(e,t,n,r){var o=null,i=null;n+=r;var a={};function s(t){var n=t.data;return n.args[0]=function(){return t.invoke.apply(this,arguments)},n.handleId=o.apply(e,n.args),t}function c(t){return i.call(e,t.data.handleId)}o=S(e,t+=r,(function(n){return function(o,i){if("function"==typeof i[0]){var u={isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?i[1]||0:void 0,args:i},f=i[0];i[0]=function e(){try{return f.apply(this,arguments)}finally{u.isPeriodic||("number"==typeof u.handleId?delete a[u.handleId]:u.handleId&&(u.handleId[H]=null))}};var h=l(t,i[0],u,s,c);if(!h)return h;var p=h.data.handleId;return"number"==typeof p?a[p]=h:p&&(p[H]=h),p&&p.ref&&p.unref&&"function"==typeof p.ref&&"function"==typeof p.unref&&(h.ref=p.ref.bind(p),h.unref=p.unref.bind(p)),"number"==typeof p||p?p:h}return n.apply(e,i)}})),i=S(e,n,(function(t){return function(n,r){var o,i=r[0];"number"==typeof i?o=a[i]:(o=i&&i[H])||(o=i),o&&"string"==typeof o.type?"notScheduled"!==o.state&&(o.cancelFn&&o.data.isPeriodic||0===o.runCount)&&("number"==typeof i?delete a[i]:i&&(i[H]=null),o.zone.cancelTask(o)):t.apply(e,r)}}))}var G="set",U="clear";Zone.__load_patch("node_timers",(function(e,t){var n=!1;try{var r=require("timers");if(e.setTimeout!==r.setTimeout&&!m){var o=r.setTimeout;r.setTimeout=function(){return n=!0,o.apply(this,arguments)};var i=e.setTimeout((function(){}),100);clearTimeout(i),r.setTimeout=o}L(r,G,U,"Timeout"),L(r,G,U,"Interval"),L(r,G,U,"Immediate")}catch(e){}m||(n?(e[t.__symbol__("setTimeout")]=e.setTimeout,e[t.__symbol__("setInterval")]=e.setInterval,e[t.__symbol__("setImmediate")]=e.setImmediate):(L(e,G,U,"Timeout"),L(e,G,U,"Interval"),L(e,G,U,"Immediate")))})),Zone.__load_patch("nextTick",(function(){!function e(t,n,r){var o=null;function i(e){var t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},o.apply(t.target,t.args),e}o=S(t,n,(function(e){return function(t,n){var o=r(t,n);return o.cbIdx>=0&&"function"==typeof n[o.cbIdx]?Zone.current.scheduleMicroTask(o.name,n[o.cbIdx],o,i):e.apply(t,n)}}))}(process,"nextTick",(function(e,t){return{name:"process.nextTick",args:t,cbIdx:t.length>0&&"function"==typeof t[0]?0:-1,target:process}}))})),Zone.__load_patch("handleUnhandledPromiseRejection",(function(e,t,n){function r(e){return function(t){R(process,e).forEach((function(n){"unhandledRejection"===e?n.invoke(t.rejection,t.promise):"rejectionHandled"===e&&n.invoke(t.promise)}))}}t[n.symbol("unhandledPromiseRejectionHandler")]=r("unhandledRejection"),t[n.symbol("rejectionHandledHandler")]=r("rejectionHandled")})),Zone.__load_patch("crypto",(function(){var e;try{e=require("crypto")}catch(e){}e&&["randomBytes","pbkdf2"].forEach((function(t){P(e,t,(function(n,r){return{name:"crypto."+t,args:r,cbIdx:r.length>0&&"function"==typeof r[r.length-1]?r.length-1:-1,target:e}}))}))})),Zone.__load_patch("console",(function(e,t){["dir","log","info","error","warn","assert","debug","timeEnd","trace"].forEach((function(e){var n=console[t.__symbol__(e)]=console[e];n&&(console[e]=function(){var e=r.call(arguments);return t.current===t.root?n.apply(this,e):t.root.run(n,this,e)})}))})),Zone.__load_patch("queueMicrotask",(function(e,t,n){F(e,n)}))}));