UNPKG

zone.js

Version:
10 lines (8 loc) 36.6 kB
'use strict'; /** * @license Angular * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */(function(g,f){if(typeof define=="function"&&define.amd){define(["timers","crypto","events","fs"],function(_d_0,_d_1,_d_2,_d_3){var d={"timers": _d_0,"crypto": _d_1,"events": _d_2,"fs": _d_3},r=function(m){if(m in d) return d[m];if(typeof require=="function") return require(m);throw new Error("Cannot find module '"+m+"'")};return f(r)})}else if(typeof exports=="object" && typeof module<"u"){module.exports=f(require)}else{var gN={"timers":"timers","crypto":"crypto","events":"events","fs":"fs"},gReq=function(r){var mod = r in gN ? g[gN[r]] : g[r]; return mod };var m=f(gReq);for(var i in m) g[i]=m[i]}}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : this,function(require){var exports={};var __exports=exports;var module={exports}; "use strict";(function(ve,de){if(typeof define=="function"&&define.amd)define(["timers","crypto","events","fs"],function(ye,ge,Fe,ze){var me={timers:ye,crypto:ge,events:Fe,fs:ze},Ae=function(ke){if(ke in me)return me[ke];if(typeof require=="function")return require(ke);throw new Error("Cannot find module '"+ke+"'")};return de(Ae)});else if(typeof exports=="object"&&typeof module<"u")module.exports=de(require);else{var Re={timers:"timers",crypto:"crypto",events:"events",fs:"fs"},Ce=function(ye){var ge=ye in Re?ve[Re[ye]]:ve[ye];return ge},Ie=de(Ce);for(var Ne in Ie)ve[Ne]=Ie[Ne]}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:exports,function(ve){var de={},Re=de,Ce={exports:de},Ie=Object.defineProperty,Ne=Object.defineProperties,ye=Object.getOwnPropertyDescriptors,ge=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,ze=Object.prototype.propertyIsEnumerable,me=function(r,i,u){return i in r?Ie(r,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[i]=u},Ae=function(r,i){for(var u in i||(i={}))Fe.call(i,u)&&me(r,u,i[u]);if(ge)for(var a=0,l=ge(i);a<l.length;a++){var u=l[a];ze.call(i,u)&&me(r,u,i[u])}return r},ke=function(r,i){return Ne(r,ye(i))},b=function(r,i,u){return me(r,typeof i!="symbol"?i+"":i,u),u},le=globalThis;function te(r){var i=le.__Zone_symbol_prefix||"__zone_symbol__";return i+r}function vr(){var r=le.performance;function i(v){r&&r.mark&&r.mark(v)}function u(v,n){r&&r.measure&&r.measure(v,n)}i("Zone");var a=function(){function v(n,t){b(this,"_parent"),b(this,"_name"),b(this,"_properties"),b(this,"_zoneDelegate"),this._parent=n,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new d(this,this._parent&&this._parent._zoneDelegate,t)}return v.assertZonePatched=function(){if(le.Promise!==D.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(v,"root",{get:function(){for(var n=v.current;n.parent;)n=n.parent;return n},enumerable:!1,configurable:!0}),Object.defineProperty(v,"current",{get:function(){return x.zone},enumerable:!1,configurable:!0}),Object.defineProperty(v,"currentTask",{get:function(){return ae},enumerable:!1,configurable:!0}),v.__load_patch=function(n,t,o){if(o===void 0&&(o=!1),D.hasOwnProperty(n)){var E=le[te("forceDuplicateZoneCheck")]===!0;if(!o&&E)throw Error("Already loaded patch: "+n)}else if(!le["__Zone_disable_"+n]){var A="Zone:"+n;i(A),D[n]=t(le,v,$),u(A,A)}},Object.defineProperty(v.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),v.prototype.get=function(n){var t=this.getZoneWith(n);if(t)return t._properties[n]},v.prototype.getZoneWith=function(n){for(var t=this;t;){if(t._properties.hasOwnProperty(n))return t;t=t._parent}return null},v.prototype.fork=function(n){if(!n)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,n)},v.prototype.wrap=function(n,t){if(typeof n!="function")throw new Error("Expecting function got: "+n);var o=this._zoneDelegate.intercept(this,n,t),E=this;return function(){return E.runGuarded(o,this,arguments,t)}},v.prototype.run=function(n,t,o,E){x={parent:x,zone:this};try{return this._zoneDelegate.invoke(this,n,t,o,E)}finally{x=x.parent}},v.prototype.runGuarded=function(n,t,o,E){t===void 0&&(t=null),x={parent:x,zone:this};try{try{return this._zoneDelegate.invoke(this,n,t,o,E)}catch(A){if(this._zoneDelegate.handleError(this,A))throw A}}finally{x=x.parent}},v.prototype.runTask=function(n,t,o){if(n.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(n.zone||oe).name+"; Execution: "+this.name+")");var E=n,A=n.type,F=n.data,se=F===void 0?{}:F,Ee=se.isPeriodic,he=Ee===void 0?!1:Ee,Te=se.isRefreshable,ce=Te===void 0?!1:Te;if(!(n.state===N&&(A===G||A===k))){var s=n.state!=B;s&&E._transitionTo(B,_);var f=ae;ae=E,x={parent:x,zone:this};try{A==k&&n.data&&!he&&!ce&&(n.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,E,t,o)}catch(T){if(this._zoneDelegate.handleError(this,T))throw T}}finally{var e=n.state;if(e!==N&&e!==U)if(A==G||he||ce&&e===Z)s&&E._transitionTo(_,B,Z);else{var h=E._zoneDelegates;this._updateTaskCount(E,-1),s&&E._transitionTo(N,B,N),ce&&(E._zoneDelegates=h)}x=x.parent,ae=f}}},v.prototype.scheduleTask=function(n){if(n.zone&&n.zone!==this)for(var t=this;t;){if(t===n.zone)throw Error("can not reschedule task to ".concat(this.name," which is descendants of the original zone ").concat(n.zone.name));t=t.parent}n._transitionTo(Z,N);var o=[];n._zoneDelegates=o,n._zone=this;try{n=this._zoneDelegate.scheduleTask(this,n)}catch(E){throw n._transitionTo(U,Z,N),this._zoneDelegate.handleError(this,E),E}return n._zoneDelegates===o&&this._updateTaskCount(n,1),n.state==Z&&n._transitionTo(_,Z),n},v.prototype.scheduleMicroTask=function(n,t,o,E){return this.scheduleTask(new p(j,n,t,o,E,void 0))},v.prototype.scheduleMacroTask=function(n,t,o,E,A){return this.scheduleTask(new p(k,n,t,o,E,A))},v.prototype.scheduleEventTask=function(n,t,o,E,A){return this.scheduleTask(new p(G,n,t,o,E,A))},v.prototype.cancelTask=function(n){if(n.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(n.zone||oe).name+"; Execution: "+this.name+")");if(!(n.state!==_&&n.state!==B)){n._transitionTo(z,_,B);try{this._zoneDelegate.cancelTask(this,n)}catch(t){throw n._transitionTo(U,z),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(n,-1),n._transitionTo(N,z),n.runCount=-1,n}},v.prototype._updateTaskCount=function(n,t){var o=n._zoneDelegates;t==-1&&(n._zoneDelegates=null);for(var E=0;E<o.length;E++)o[E]._updateTaskCount(n.type,t)},v}();b(a,"__symbol__",te);var l=a,c={name:"",onHasTask:function(v,n,t,o){return v.hasTask(t,o)},onScheduleTask:function(v,n,t,o){return v.scheduleTask(t,o)},onInvokeTask:function(v,n,t,o,E,A){return v.invokeTask(t,o,E,A)},onCancelTask:function(v,n,t,o){return v.cancelTask(t,o)}},d=function(){function v(n,t,o){b(this,"_zone"),b(this,"_taskCounts",{microTask:0,macroTask:0,eventTask:0}),b(this,"_parentDelegate"),b(this,"_forkDlgt"),b(this,"_forkZS"),b(this,"_forkCurrZone"),b(this,"_interceptDlgt"),b(this,"_interceptZS"),b(this,"_interceptCurrZone"),b(this,"_invokeDlgt"),b(this,"_invokeZS"),b(this,"_invokeCurrZone"),b(this,"_handleErrorDlgt"),b(this,"_handleErrorZS"),b(this,"_handleErrorCurrZone"),b(this,"_scheduleTaskDlgt"),b(this,"_scheduleTaskZS"),b(this,"_scheduleTaskCurrZone"),b(this,"_invokeTaskDlgt"),b(this,"_invokeTaskZS"),b(this,"_invokeTaskCurrZone"),b(this,"_cancelTaskDlgt"),b(this,"_cancelTaskZS"),b(this,"_cancelTaskCurrZone"),b(this,"_hasTaskDlgt"),b(this,"_hasTaskDlgtOwner"),b(this,"_hasTaskZS"),b(this,"_hasTaskCurrZone"),this._zone=n,this._parentDelegate=t,this._forkZS=o&&(o&&o.onFork?o:t._forkZS),this._forkDlgt=o&&(o.onFork?t:t._forkDlgt),this._forkCurrZone=o&&(o.onFork?this._zone:t._forkCurrZone),this._interceptZS=o&&(o.onIntercept?o:t._interceptZS),this._interceptDlgt=o&&(o.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=o&&(o.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=o&&(o.onInvoke?o:t._invokeZS),this._invokeDlgt=o&&(o.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=o&&(o.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=o&&(o.onHandleError?o:t._handleErrorZS),this._handleErrorDlgt=o&&(o.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=o&&(o.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=o&&(o.onScheduleTask?o:t._scheduleTaskZS),this._scheduleTaskDlgt=o&&(o.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=o&&(o.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=o&&(o.onInvokeTask?o:t._invokeTaskZS),this._invokeTaskDlgt=o&&(o.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=o&&(o.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=o&&(o.onCancelTask?o:t._cancelTaskZS),this._cancelTaskDlgt=o&&(o.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=o&&(o.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;var E=o&&o.onHasTask,A=t&&t._hasTaskZS;(E||A)&&(this._hasTaskZS=E?o:c,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,o.onScheduleTask||(this._scheduleTaskZS=c,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),o.onInvokeTask||(this._invokeTaskZS=c,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),o.onCancelTask||(this._cancelTaskZS=c,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}return Object.defineProperty(v.prototype,"zone",{get:function(){return this._zone},enumerable:!1,configurable:!0}),v.prototype.fork=function(n,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,n,t):new l(n,t)},v.prototype.intercept=function(n,t,o){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,n,t,o):t},v.prototype.invoke=function(n,t,o,E,A){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,n,t,o,E,A):t.apply(o,E)},v.prototype.handleError=function(n,t){return this._handleErrorZS?this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,n,t):!0},v.prototype.scheduleTask=function(n,t){var o=t;if(this._scheduleTaskZS)this._hasTaskZS&&o._zoneDelegates.push(this._hasTaskDlgtOwner),o=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,n,t),o||(o=t);else if(t.scheduleFn)t.scheduleFn(t);else if(t.type==j)I(t);else throw new Error("Task is missing scheduleFn.");return o},v.prototype.invokeTask=function(n,t,o,E){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,n,t,o,E):t.callback.apply(o,E)},v.prototype.cancelTask=function(n,t){var o;if(this._cancelTaskZS)o=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,n,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");o=t.cancelFn(t)}return o},v.prototype.hasTask=function(n,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,n,t)}catch(o){this.handleError(n,o)}},v.prototype._updateTaskCount=function(n,t){var o=this._taskCounts,E=o[n],A=o[n]=E+t;if(A<0)throw new Error("More tasks executed then were scheduled.");if(E==0||A==0){var F={microTask:o.microTask>0,macroTask:o.macroTask>0,eventTask:o.eventTask>0,change:n};this.hasTask(this._zone,F)}},v}(),p=function(){function v(n,t,o,E,A,F){if(b(this,"type"),b(this,"source"),b(this,"invoke"),b(this,"callback"),b(this,"data"),b(this,"scheduleFn"),b(this,"cancelFn"),b(this,"_zone",null),b(this,"runCount",0),b(this,"_zoneDelegates",null),b(this,"_state","notScheduled"),this.type=n,this.source=t,this.data=E,this.scheduleFn=A,this.cancelFn=F,!o)throw new Error("callback is not defined");this.callback=o;var se=this;n===G&&E&&E.useG?this.invoke=v.invokeTask:this.invoke=function(){return v.invokeTask.call(le,se,this,arguments)}}return v.invokeTask=function(n,t,o){n||(n=this),fe++;try{return n.runCount++,n.zone.runTask(n,t,o)}finally{fe==1&&K(),fe--}},Object.defineProperty(v.prototype,"zone",{get:function(){return this._zone},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),v.prototype.cancelScheduleRequest=function(){this._transitionTo(N,Z)},v.prototype._transitionTo=function(n,t,o){if(this._state===t||this._state===o)this._state=n,n==N&&(this._zoneDelegates=null);else throw new Error("".concat(this.type," '").concat(this.source,"': can not transition to '").concat(n,"', expecting state '").concat(t,"'").concat(o?" or '"+o+"'":"",", was '").concat(this._state,"'."))},v.prototype.toString=function(){return this.data&&typeof this.data.handleId!="undefined"?this.data.handleId.toString():Object.prototype.toString.call(this)},v.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}},v}(),y=te("setTimeout"),C=te("Promise"),S=te("then"),m=[],M=!1,L;function ee(v){if(L||le[C]&&(L=le[C].resolve(0)),L){var n=L[S];n||(n=L.then),n.call(L,v)}else le[y](v,0)}function I(v){fe===0&&m.length===0&&ee(K),v&&m.push(v)}function K(){if(!M){for(M=!0;m.length;){var v=m;m=[];for(var n=0;n<v.length;n++){var t=v[n];try{t.zone.runTask(t,null,null)}catch(o){$.onUnhandledError(o)}}}$.microtaskDrainDone(),M=!1}}var oe={name:"NO ZONE"},N="notScheduled",Z="scheduling",_="scheduled",B="running",z="canceling",U="unknown",j="microTask",k="macroTask",G="eventTask",D={},$={symbol:te,currentZoneFrame:function(){return x},onUnhandledError:V,microtaskDrainDone:V,scheduleMicroTask:I,showUncaughtError:function(){return!l[te("ignoreConsoleErrorUncaughtError")]},patchEventTarget:function(){return[]},patchOnProperties:V,patchMethod:function(){return V},bindArguments:function(){return[]},patchThen:function(){return V},patchMacroTask:function(){return V},patchEventPrototype:function(){return V},getGlobalObjects:function(){},ObjectDefineProperty:function(){return V},ObjectGetOwnPropertyDescriptor:function(){},ObjectCreate:function(){},ArraySlice:function(){return[]},patchClass:function(){return V},wrapWithCurrentZone:function(){return V},filterProperties:function(){return[]},attachOriginToPatched:function(){return V},_redefineProperty:function(){return V},patchCallbacks:function(){return V},nativeScheduleMicroTask:ee},x={parent:null,zone:new l(null,null)},ae=null,fe=0;function V(){}return u("Zone","Zone"),l}var Ue=Object.getOwnPropertyDescriptor,dr=Object.defineProperty,Be=Object.getPrototypeOf,_r=Array.prototype.slice,Ye="addEventListener",Je="removeEventListener",Hr=te(Ye),xr=te(Je),_e="true",pe="false",Me=te("");function pr(r,i){return Zone.current.wrap(r,i)}function Qe(r,i,u,a,l){return Zone.current.scheduleMacroTask(r,i,u,a,l)}var Q=te,Le=typeof window!="undefined",je=Le?window:void 0,ne=Le&&je||globalThis,Tr="removeAttribute";function yr(r,i){for(var u=r.length-1;u>=0;u--)typeof r[u]=="function"&&(r[u]=pr(r[u],i+"_"+u));return r}function Er(r){return r?r.writable===!1?!1:!(typeof r.get=="function"&&typeof r.set=="undefined"):!0}var Ke=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope,Xe=!("nw"in ne)&&typeof ne.process!="undefined"&&ne.process.toString()==="[object process]",gr=!Xe&&!Ke&&!!(Le&&je.HTMLElement),$e=typeof ne.process!="undefined"&&ne.process.toString()==="[object process]"&&!Ke&&!!(Le&&je.HTMLElement),Ve={},mr=Q("enable_beforeunload"),qe=function(r){if(r=r||ne.event,!!r){var i=Ve[r.type];i||(i=Ve[r.type]=Q("ON_PROPERTY"+r.type));var u=this||r.target||ne,a=u[i],l;if(gr&&u===je&&r.type==="error"){var c=r;l=a&&a.call(this,c.message,c.filename,c.lineno,c.colno,c.error),l===!0&&r.preventDefault()}else l=a&&a.apply(this,arguments),r.type==="beforeunload"&&ne[mr]&&typeof l=="string"?r.returnValue=l:l!=null&&!l&&r.preventDefault();return l}};function er(r,i,u){var a=Ue(r,i);if(!a&&u){var l=Ue(u,i);l&&(a={enumerable:!0,configurable:!0})}if(!(!a||!a.configurable)){var c=Q("on"+i+"patched");if(!(r.hasOwnProperty(c)&&r[c])){delete a.writable,delete a.value;var d=a.get,p=a.set,y=i.slice(2),C=Ve[y];C||(C=Ve[y]=Q("ON_PROPERTY"+y)),a.set=function(S){var m=this;if(!m&&r===ne&&(m=ne),!!m){var M=m[C];typeof M=="function"&&m.removeEventListener(y,qe),p==null||p.call(m,null),m[C]=S,typeof S=="function"&&m.addEventListener(y,qe,!1)}},a.get=function(){var S=this;if(!S&&r===ne&&(S=ne),!S)return null;var m=S[C];if(m)return m;if(d){var M=d.call(this);if(M)return a.set.call(this,M),typeof S[Tr]=="function"&&S.removeAttribute(i),M}return null},dr(r,i,a),r[c]=!0}}}function kr(r,i,u){if(i)for(var a=0;a<i.length;a++)er(r,"on"+i[a],u);else{var l=[];for(var c in r)c.slice(0,2)=="on"&&l.push(c);for(var d=0;d<l.length;d++)er(r,l[d],u)}}var Fr=Q("originalInstance");function br(r,i){if(typeof Object.getOwnPropertySymbols=="function"){var u=Object.getOwnPropertySymbols(r);u.forEach(function(a){var l=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(i,a,{get:function(){return r[a]},set:function(c){l&&(!l.writable||typeof l.set!="function")||(r[a]=c)},enumerable:l?l.enumerable:!0,configurable:l?l.configurable:!0})})}}var rr=!1;function wr(r){rr=r}function be(r,i,u){for(var a=r;a&&!a.hasOwnProperty(i);)a=Be(a);!a&&r[i]&&(a=r);var l=Q(i),c=null;if(a&&(!(c=a[l])||!a.hasOwnProperty(l))){c=a[l]=a[i];var d=a&&Ue(a,i);if(Er(d)){var p=u(c,l,i);a[i]=function(){return p(this,arguments)},Oe(a[i],c),rr&&br(c,a[i])}}return c}function Ge(r,i,u){var a=null;function l(c){var d=c.data;return d.args[d.cbIdx]=function(){c.invoke.apply(this,arguments)},a.apply(d.target,d.args),c}a=be(r,i,function(c){return function(d,p){var y=u(d,p);return y.cbIdx>=0&&typeof p[y.cbIdx]=="function"?Qe(y.name,p[y.cbIdx],y,l):c.apply(d,p)}})}function Pr(r,i,u){var a=null;function l(c){var d=c.data;return d.args[d.cbIdx]=function(){c.invoke.apply(this,arguments)},a.apply(d.target,d.args),c}a=be(r,i,function(c){return function(d,p){var y=u(d,p);return y.cbIdx>=0&&typeof p[y.cbIdx]=="function"?Zone.current.scheduleMicroTask(y.name,p[y.cbIdx],y,l):c.apply(d,p)}})}function Oe(r,i){r[Q("OriginalDelegate")]=i}function tr(r){return typeof r=="function"}function nr(r){return typeof r=="number"}function Sr(r){r.__load_patch("ZoneAwarePromise",function(i,u,a){var l=Object.getOwnPropertyDescriptor,c=Object.defineProperty;function d(s){if(s&&s.toString===Object.prototype.toString){var f=s.constructor&&s.constructor.name;return(f||"")+": "+JSON.stringify(s)}return s?s.toString():Object.prototype.toString.call(s)}var p=a.symbol,y=[],C=i[p("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")]!==!1,S=p("Promise"),m=p("then"),M="__creationTrace__";a.onUnhandledError=function(s){if(a.showUncaughtError()){var f=s&&s.rejection;f?console.error("Unhandled Promise rejection:",f instanceof Error?f.message:f,"; Zone:",s.zone.name,"; Task:",s.task&&s.task.source,"; Value:",f,f instanceof Error?f.stack:void 0):console.error(s)}},a.microtaskDrainDone=function(){for(var s=function(){var f=y.shift();try{f.zone.runGuarded(function(){throw f.throwOriginal?f.rejection:f})}catch(e){ee(e)}};y.length;)s()};var L=p("unhandledPromiseRejectionHandler");function ee(s){a.onUnhandledError(s);try{var f=u[L];typeof f=="function"&&f.call(this,s)}catch(e){}}function I(s){return s&&typeof s.then=="function"}function K(s){return s}function oe(s){return F.reject(s)}var N=p("state"),Z=p("value"),_=p("finally"),B=p("parentPromiseValue"),z=p("parentPromiseState"),U="Promise.then",j=null,k=!0,G=!1,D=0;function $(s,f){return function(e){try{V(s,f,e)}catch(h){V(s,!1,h)}}}var x=function(){var s=!1;return function(e){return function(){s||(s=!0,e.apply(null,arguments))}}},ae="Promise resolved with itself",fe=p("currentTaskTrace");function V(s,f,e){var h=x();if(s===e)throw new TypeError(ae);if(s[N]===j){var T=null;try{(typeof e=="object"||typeof e=="function")&&(T=e&&e.then)}catch(P){return h(function(){V(s,!1,P)})(),s}if(f!==G&&e instanceof F&&e.hasOwnProperty(N)&&e.hasOwnProperty(Z)&&e[N]!==j)n(e),V(s,e[N],e[Z]);else if(f!==G&&typeof T=="function")try{T.call(e,h($(s,f)),h($(s,!1)))}catch(P){h(function(){V(s,!1,P)})()}else{s[N]=f;var g=s[Z];if(s[Z]=e,s[_]===_&&f===k&&(s[N]=s[z],s[Z]=s[B]),f===G&&e instanceof Error){var O=u.currentTask&&u.currentTask.data&&u.currentTask.data[M];O&&c(e,fe,{configurable:!0,enumerable:!1,writable:!0,value:O})}for(var R=0;R<g.length;)t(s,g[R++],g[R++],g[R++],g[R++]);if(g.length==0&&f==G){s[N]=D;var w=e;try{throw new Error("Uncaught (in promise): "+d(e)+(e&&e.stack?"\n"+e.stack:""))}catch(P){w=P}C&&(w.throwOriginal=!0),w.rejection=e,w.promise=s,w.zone=u.current,w.task=u.currentTask,y.push(w),a.scheduleMicroTask()}}}return s}var v=p("rejectionHandledHandler");function n(s){if(s[N]===D){try{var f=u[v];f&&typeof f=="function"&&f.call(this,{rejection:s[Z],promise:s})}catch(h){}s[N]=G;for(var e=0;e<y.length;e++)s===y[e].promise&&y.splice(e,1)}}function t(s,f,e,h,T){n(s);var g=s[N],O=g?typeof h=="function"?h:K:typeof T=="function"?T:oe;f.scheduleMicroTask(U,function(){try{var R=s[Z],w=!!e&&_===e[_];w&&(e[B]=R,e[z]=g);var P=f.run(O,void 0,w&&O!==oe&&O!==K?[]:[R]);V(e,!0,P)}catch(H){V(e,!1,H)}},e)}var o="function ZoneAwarePromise() { [native code] }",E=function(){},A=i.AggregateError,F=function(){function s(f){var e=this;if(!(e instanceof s))throw new Error("Must be an instanceof Promise.");e[N]=j,e[Z]=[];try{var h=x();f&&f(h($(e,k)),h($(e,G)))}catch(T){V(e,!1,T)}}return s.toString=function(){return o},s.resolve=function(f){return f instanceof s?f:V(new this(null),k,f)},s.reject=function(f){return V(new this(null),G,f)},s.withResolvers=function(){var f={};return f.promise=new s(function(e,h){f.resolve=e,f.reject=h}),f},s.any=function(f){if(!f||typeof f[Symbol.iterator]!="function")return Promise.reject(new A([],"All promises were rejected"));var e=[],h=0;try{for(var T=0,g=f;T<g.length;T++){var O=g[T];h++,e.push(s.resolve(O))}}catch(P){return Promise.reject(new A([],"All promises were rejected"))}if(h===0)return Promise.reject(new A([],"All promises were rejected"));var R=!1,w=[];return new s(function(P,H){for(var Y=0;Y<e.length;Y++)e[Y].then(function(re){R||(R=!0,P(re))},function(re){w.push(re),h--,h===0&&(R=!0,H(new A(w,"All promises were rejected")))})})},s.race=function(f){var e,h,T=new this(function(H,Y){e=H,h=Y});function g(H){e(H)}function O(H){h(H)}for(var R=0,w=f;R<w.length;R++){var P=w[R];I(P)||(P=this.resolve(P)),P.then(g,O)}return T},s.all=function(f){return s.allWithCallback(f)},s.allSettled=function(f){var e=this&&this.prototype instanceof s?this:s;return e.allWithCallback(f,{thenCallback:function(h){return{status:"fulfilled",value:h}},errorCallback:function(h){return{status:"rejected",reason:h}}})},s.allWithCallback=function(f,e){for(var h,T,g=new this(function(J,W){h=J,T=W}),O=2,R=0,w=[],P=function(J){I(J)||(J=H.resolve(J));var W=R;try{J.then(function(q){w[W]=e?e.thenCallback(q):q,O--,O===0&&h(w)},function(q){e?(w[W]=e.errorCallback(q),O--,O===0&&h(w)):T(q)})}catch(q){T(q)}O++,R++},H=this,Y=0,re=f;Y<re.length;Y++){var X=re[Y];P(X)}return O-=2,O===0&&h(w),g},Object.defineProperty(s.prototype,Symbol.toStringTag,{get:function(){return"Promise"},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,Symbol.species,{get:function(){return s},enumerable:!1,configurable:!0}),s.prototype.then=function(f,e){var h,T=(h=this.constructor)==null?void 0:h[Symbol.species];(!T||typeof T!="function")&&(T=this.constructor||s);var g=new T(E),O=u.current;return this[N]==j?this[Z].push(O,g,f,e):t(this,O,g,f,e),g},s.prototype.catch=function(f){return this.then(null,f)},s.prototype.finally=function(f){var e,h=(e=this.constructor)==null?void 0:e[Symbol.species];(!h||typeof h!="function")&&(h=s);var T=new h(E);T[_]=_;var g=u.current;return this[N]==j?this[Z].push(g,T,f,f):t(this,g,T,f,f),T},s}();F.resolve=F.resolve,F.reject=F.reject,F.race=F.race,F.all=F.all;var se=i[S]=i.Promise;i.Promise=F;var Ee=p("thenPatched");function he(s){var f=s.prototype,e=l(f,"then");if(!(e&&(e.writable===!1||!e.configurable))){var h=f.then;f[m]=h,s.prototype.then=function(T,g){var O=this,R=new F(function(w,P){h.call(O,w,P)});return R.then(T,g)},s[Ee]=!0}}a.patchThen=he;function Te(s){return function(f,e){var h=s.apply(f,e);if(h instanceof F)return h;var T=h.constructor;return T[Ee]||he(T),h}}if(se){he(se);var ce=se.try;ce&&typeof ce=="function"&&(F.try=ce),be(i,"fetch",function(s){return Te(s)})}return Promise[u.__symbol__("uncaughtPromiseErrors")]=y,F})}function Zr(r){r.__load_patch("toString",function(i){var u=Function.prototype.toString,a=Q("OriginalDelegate"),l=Q("Promise"),c=Q("Error"),d=function(){if(typeof this=="function"){var S=this[a];if(S)return typeof S=="function"?u.call(S):Object.prototype.toString.call(S);if(this===Promise){var m=i[l];if(m)return u.call(m)}if(this===Error){var M=i[c];if(M)return u.call(M)}}return u.call(this)};d[a]=u,Function.prototype.toString=d;var p=Object.prototype.toString,y="[object Promise]";Object.prototype.toString=function(){return typeof Promise=="function"&&this instanceof Promise?y:p.call(this)}})}function Or(){var r,i=globalThis,u=i[te("forceDuplicateZoneCheck")]===!0;if(i.Zone&&(u||typeof i.Zone.__symbol__!="function"))throw new Error("Zone already loaded.");return(r=i.Zone)!=null||(i.Zone=vr()),i.Zone}var Dr={useG:!0},ie={},Rr={},or=new RegExp("^"+Me+"(\\w+)(true|false)$"),Cr=Q("propagationStopped");function ir(r,i){var u=(i?i(r):r)+pe,a=(i?i(r):r)+_e,l=Me+u,c=Me+a;ie[r]={},ie[r][pe]=l,ie[r][_e]=c}function Ir(r,i,u,a){var l=a&&a.add||Ye,c=a&&a.rm||Je,d=a&&a.listeners||"eventListeners",p=a&&a.rmAll||"removeAllListeners",y=Q(l),C="."+l+":",S="prependListener",m="."+S+":",M=function(Z,_,B){if(!Z.isRemoved){var z=Z.callback;typeof z=="object"&&z.handleEvent&&(Z.callback=function(G){return z.handleEvent(G)},Z.originalDelegate=z);var U;try{Z.invoke(Z,_,[B])}catch(G){U=G}var j=Z.options;if(j&&typeof j=="object"&&j.once){var k=Z.originalDelegate?Z.originalDelegate:Z.callback;_[c].call(_,B.type,k,j)}return U}};function L(Z,_,B){if(_=_||r.event,!!_){var z=Z||_.target||r,U=z[ie[_.type][B?_e:pe]];if(U){var j=[];if(U.length===1){var k=M(U[0],z,_);k&&j.push(k)}else for(var G=U.slice(),D=0;D<G.length&&!(_&&_[Cr]===!0);D++){var k=M(G[D],z,_);k&&j.push(k)}if(j.length===1)throw j[0];for(var $=function(x){var ae=j[x];i.nativeScheduleMicroTask(function(){throw ae})},D=0;D<j.length;D++)$(D)}}}var ee=function(Z){return L(this,Z,!1)},I=function(Z){return L(this,Z,!0)};function K(Z,_){if(!Z)return!1;var B=!0;_&&_.useG!==void 0&&(B=_.useG);var z=_&&_.vh,U=!0;_&&_.chkDup!==void 0&&(U=_.chkDup);var j=!1;_&&_.rt!==void 0&&(j=_.rt);for(var k=Z;k&&!k.hasOwnProperty(l);)k=Be(k);if(!k&&Z[l]&&(k=Z),!k||k[y])return!1;var G=_&&_.eventNameToString,D={},$=k[y]=k[l],x=k[Q(c)]=k[c],ae=k[Q(d)]=k[d],fe=k[Q(p)]=k[p],V;_&&_.prepend&&(V=k[Q(_.prepend)]=k[_.prepend]);function v(e,h){return h?typeof e=="boolean"?{capture:e,passive:!0}:e?typeof e=="object"&&e.passive!==!1?ke(Ae({},e),{passive:!0}):e:{passive:!0}:e}var n=function(e){if(!D.isExisting)return $.call(D.target,D.eventName,D.capture?I:ee,D.options)},t=function(e){if(!e.isRemoved){var h=ie[e.eventName],T=void 0;h&&(T=h[e.capture?_e:pe]);var g=T&&e.target[T];if(g)for(var O=0;O<g.length;O++){var R=g[O];if(R===e){g.splice(O,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),g.length===0&&(e.allRemoved=!0,e.target[T]=null);break}}}if(e.allRemoved)return x.call(e.target,e.eventName,e.capture?I:ee,e.options)},o=function(e){return $.call(D.target,D.eventName,e.invoke,D.options)},E=function(e){return V.call(D.target,D.eventName,e.invoke,D.options)},A=function(e){return x.call(e.target,e.eventName,e.invoke,e.options)},F=B?n:o,se=B?t:A,Ee=function(e,h){var T=typeof h;return T==="function"&&e.callback===h||T==="object"&&e.originalDelegate===h},he=(_==null?void 0:_.diff)||Ee,Te=Zone[Q("UNPATCHED_EVENTS")],ce=r[Q("PASSIVE_EVENTS")];function s(e){if(typeof e=="object"&&e!==null){var h=Ae({},e);return e.signal&&(h.signal=e.signal),h}return e}var f=function(e,h,T,g,O,R){return O===void 0&&(O=!1),R===void 0&&(R=!1),function(){var w=this||r,P=arguments[0];_&&_.transferEventName&&(P=_.transferEventName(P));var H=arguments[1];if(!H)return e.apply(this,arguments);if(Xe&&P==="uncaughtException")return e.apply(this,arguments);var Y=!1;if(typeof H!="function"){if(!H.handleEvent)return e.apply(this,arguments);Y=!0}if(!(z&&!z(e,H,w,arguments))){var re=!!ce&&ce.indexOf(P)!==-1,X=s(v(arguments[2],re)),J=X==null?void 0:X.signal;if(!(J!=null&&J.aborted)){if(Te){for(var W=0;W<Te.length;W++)if(P===Te[W])return re?e.call(w,P,H,X):e.apply(this,arguments)}var q=X?typeof X=="boolean"?!0:X.capture:!1,sr=X&&typeof X=="object"?X.once:!1,Gr=Zone.current,We=ie[P];We||(ir(P,G),We=ie[P]);var ur=We[q?_e:pe],Ze=w[ur],lr=!1;if(Ze){if(lr=!0,U){for(var W=0;W<Ze.length;W++)if(he(Ze[W],H))return}}else Ze=w[ur]=[];var xe,cr=w.constructor.name,fr=Rr[cr];fr&&(xe=fr[P]),xe||(xe=cr+h+(G?G(P):P)),D.options=X,sr&&(D.options.once=!1),D.target=w,D.capture=q,D.eventName=P,D.isExisting=lr;var De=B?Dr:void 0;De&&(De.taskData=D),J&&(D.options.signal=void 0);var ue=Gr.scheduleEventTask(xe,H,De,T,g);if(J){D.options.signal=J;var hr=function(){return ue.zone.cancelTask(ue)};e.call(J,"abort",hr,{once:!0}),ue.removeAbortListener=function(){return J.removeEventListener("abort",hr)}}if(D.target=null,De&&(De.taskData=null),sr&&(D.options.once=!0),typeof ue.options!="boolean"&&(ue.options=X),ue.target=w,ue.capture=q,ue.eventName=P,Y&&(ue.originalDelegate=H),R?Ze.unshift(ue):Ze.push(ue),O)return w}}}};return k[l]=f($,C,F,se,j),V&&(k[S]=f(V,m,E,se,j,!0)),k[c]=function(){var e=this||r,h=arguments[0];_&&_.transferEventName&&(h=_.transferEventName(h));var T=arguments[2],g=T?typeof T=="boolean"?!0:T.capture:!1,O=arguments[1];if(!O)return x.apply(this,arguments);if(!(z&&!z(x,O,e,arguments))){var R=ie[h],w;R&&(w=R[g?_e:pe]);var P=w&&e[w];if(P)for(var H=0;H<P.length;H++){var Y=P[H];if(he(Y,O)){if(P.splice(H,1),Y.isRemoved=!0,P.length===0&&(Y.allRemoved=!0,e[w]=null,!g&&typeof h=="string")){var re=Me+"ON_PROPERTY"+h;e[re]=null}return Y.zone.cancelTask(Y),j?e:void 0}}return x.apply(this,arguments)}},k[d]=function(){var e=this||r,h=arguments[0];_&&_.transferEventName&&(h=_.transferEventName(h));for(var T=[],g=ar(e,G?G(h):h),O=0;O<g.length;O++){var R=g[O],w=R.originalDelegate?R.originalDelegate:R.callback;T.push(w)}return T},k[p]=function(){var e=this||r,h=arguments[0];if(h){_&&_.transferEventName&&(h=_.transferEventName(h));var P=ie[h];if(P){var H=P[pe],Y=P[_e],re=e[H],X=e[Y];if(re)for(var J=re.slice(),g=0;g<J.length;g++){var W=J[g],q=W.originalDelegate?W.originalDelegate:W.callback;this[c].call(this,h,q,W.options)}if(X)for(var J=X.slice(),g=0;g<J.length;g++){var W=J[g],q=W.originalDelegate?W.originalDelegate:W.callback;this[c].call(this,h,q,W.options)}}}else{for(var T=Object.keys(e),g=0;g<T.length;g++){var O=T[g],R=or.exec(O),w=R&&R[1];w&&w!=="removeListener"&&this[p].call(this,w)}this[p].call(this,"removeListener")}if(j)return this},Oe(k[l],$),Oe(k[c],x),fe&&Oe(k[p],fe),ae&&Oe(k[d],ae),!0}for(var oe=[],N=0;N<u.length;N++)oe[N]=K(u[N],a);return oe}function ar(r,i){if(!i){var u=[];for(var a in r){var l=or.exec(a),c=l&&l[1];if(c&&(!i||c===i)){var d=r[a];if(d)for(var p=0;p<d.length;p++)u.push(d[p])}}return u}var y=ie[i];y||(ir(i),y=ie[i]);var C=r[y[pe]],S=r[y[_e]];return C?S?C.concat(S):C.slice():S?S.slice():[]}function Nr(r,i){i.patchMethod(r,"queueMicrotask",function(u){return function(a,l){Zone.current.scheduleMicroTask("queueMicrotask",l[0])}})}var He=Q("zoneTask");function we(r,i,u,a){var l=null,c=null;i+=a,u+=a;var d={};function p(C){var S=C.data;S.args[0]=function(){return C.invoke.apply(this,arguments)};var m=l.apply(r,S.args);return nr(m)?S.handleId=m:(S.handle=m,S.isRefreshable=tr(m.refresh)),C}function y(C){var S=C.data,m=S.handle,M=S.handleId;return c.call(r,m!=null?m:M)}l=be(r,i,function(C){return function(S,m){var M;if(tr(m[0])){var L={isRefreshable:!1,isPeriodic:a==="Interval",delay:a==="Timeout"||a==="Interval"?m[1]||0:void 0,args:m},ee=m[0];m[0]=function(){try{return ee.apply(this,arguments)}finally{var U=L.handle,j=L.handleId,k=L.isPeriodic,G=L.isRefreshable;!k&&!G&&(j?delete d[j]:U&&(U[He]=null))}};var I=Qe(i,m[0],L,p,y);if(!I)return I;var K=I.data,oe=K.handleId,N=K.handle,Z=K.isRefreshable,_=K.isPeriodic;if(oe)d[oe]=I;else if(N&&(N[He]=I,Z&&!_)){var B=N.refresh;N.refresh=function(){var z=I.zone,U=I.state;return U==="notScheduled"?(I._state="scheduled",z._updateTaskCount(I,1)):U==="running"&&(I._state="scheduling"),B.call(this)}}return(M=N!=null?N:oe)!=null?M:I}else return C.apply(r,m)}}),c=be(r,u,function(C){return function(S,m){var M=m[0],L;nr(M)?(L=d[M],delete d[M]):(L=M==null?void 0:M[He],L?M[He]=null:L=M),L!=null&&L.type?L.cancelFn&&L.zone.cancelTask(L):C.apply(r,m)}})}function Ar(r){r.__load_patch("EventEmitter",function(i,u,a){var l="addListener",c="prependListener",d="removeListener",p="removeAllListeners",y="listeners",C="on",S="off",m=function(I,K){return I.callback===K||I.callback.listener===K},M=function(I){return typeof I=="string"?I:I?I.toString().replace("(","_").replace(")","_"):""};function L(I){var K=Ir(i,a,[I],{useG:!1,add:l,rm:d,prepend:c,rmAll:p,listeners:y,chkDup:!1,rt:!0,diff:m,eventNameToString:M});K&&K[0]&&(I[C]=I[l],I[S]=I[d])}var ee;try{ee=ve("events")}catch(I){}ee&&ee.EventEmitter&&L(ee.EventEmitter.prototype)})}function Mr(r){r.__load_patch("fs",function(i,u,a){var l,c;try{c=ve("fs")}catch(y){}if(c){var d=["access","appendFile","chmod","chown","close","exists","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","read","readdir","readFile","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","write","writeFile","writev"];d.filter(function(y){return!!c[y]&&typeof c[y]=="function"}).forEach(function(y){Ge(c,y,function(C,S){return{name:"fs."+y,args:S,cbIdx:S.length>0?S.length-1:-1,target:C}})});var p=(l=c.realpath)==null?void 0:l[a.symbol("OriginalDelegate")];p!=null&&p.native&&(c.realpath.native=p.native,Ge(c.realpath,"native",function(y,C){return{args:C,target:y,cbIdx:C.length>0?C.length-1:-1,name:"fs.realpath.native"}}))}})}function Lr(r){r.__load_patch("node_util",function(i,u,a){a.patchOnProperties=kr,a.patchMethod=be,a.bindArguments=yr,a.patchMacroTask=Ge,wr(!0)})}var Pe="set",Se="clear";function jr(r){Lr(r),Ar(r),Mr(r),r.__load_patch("node_timers",function(i,u){var a=!1;try{var l=ve("timers"),c=i.setTimeout===l.setTimeout;if(!c&&!$e){var d=l.setTimeout;l.setTimeout=function(){return a=!0,d.apply(this,arguments)};var p=i.setTimeout(function(){},100);clearTimeout(p),l.setTimeout=d}we(l,Pe,Se,"Timeout"),we(l,Pe,Se,"Interval"),we(l,Pe,Se,"Immediate")}catch(y){}$e||(a?(i[u.__symbol__("setTimeout")]=i.setTimeout,i[u.__symbol__("setInterval")]=i.setInterval,i[u.__symbol__("setImmediate")]=i.setImmediate):(we(i,Pe,Se,"Timeout"),we(i,Pe,Se,"Interval"),we(i,Pe,Se,"Immediate")))}),r.__load_patch("nextTick",function(){Pr(process,"nextTick",function(i,u){return{name:"process.nextTick",args:u,cbIdx:u.length>0&&typeof u[0]=="function"?0:-1,target:process}})}),r.__load_patch("handleUnhandledPromiseRejection",function(i,u,a){u[a.symbol("unhandledPromiseRejectionHandler")]=l("unhandledRejection"),u[a.symbol("rejectionHandledHandler")]=l("rejectionHandled");function l(c){return function(d){var p=ar(process,c);p.forEach(function(y){c==="unhandledRejection"?y.invoke(d.rejection,d.promise):c==="rejectionHandled"&&y.invoke(d.promise)})}}}),r.__load_patch("crypto",function(){var i;try{i=ve("crypto")}catch(a){}if(i){var u=["randomBytes","pbkdf2"];u.forEach(function(a){Ge(i,a,function(l,c){return{name:"crypto."+a,args:c,cbIdx:c.length>0&&typeof c[c.length-1]=="function"?c.length-1:-1,target:i}})})}}),r.__load_patch("console",function(i,u){var a=["dir","log","info","error","warn","assert","debug","timeEnd","trace"];a.forEach(function(l){var c=console[u.__symbol__(l)]=console[l];c&&(console[l]=function(){var d=_r.call(arguments);return u.current===u.root?c.apply(this,d):u.root.run(c,this,d)})})}),r.__load_patch("queueMicrotask",function(i,u,a){Nr(i,a)})}function Vr(){var r=Or();return jr(r),Sr(r),Zr(r),r}return Vr(),Re!=de&&(Ce.exports=de),Ce.exports}); if(__exports != exports)module.exports = exports;return module.exports}));