'use strict'; /** * @license Angular * (c) 2010-2025 Google LLC. https://angular.dev/ * License: MIT */(function(g,f){if(typeof define=="function"&&define.amd){define(f)}else if(typeof exports=="object" && typeof module<"u"){module.exports=f()}else{var m=f();for(var i in m) g[i]=m[i]}}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : this,function(){var exports={};var __exports=exports;var module={exports}; "use strict";var $=exports&&exports.__generator||function(R,j){var E={label:0,sent:function(){if(k[0]&1)throw k[1];return k[1]},trys:[],ops:[]},C,M,k,O=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return O.next=J(0),O.throw=J(1),O.return=J(2),typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function J(P){return function(L){return Y([P,L])}}function Y(P){if(C)throw new TypeError("Generator is already executing.");for(;O&&(O=0,P[0]&&(E=0)),E;)try{if(C=1,M&&(k=P[0]&2?M.return:P[0]?M.throw||((k=M.return)&&k.call(M),0):M.next)&&!(k=k.call(M,P[1])).done)return k;switch(M=0,k&&(P=[P[0]&2,k.value]),P[0]){case 0:case 1:k=P;break;case 4:return E.label++,{value:P[1],done:!1};case 5:E.label++,M=P[1],P=[0];continue;case 7:P=E.ops.pop(),E.trys.pop();continue;default:if(k=E.trys,!(k=k.length>0&&k[k.length-1])&&(P[0]===6||P[0]===2)){E=0;continue}if(P[0]===3&&(!k||P[1]>k[0]&&P[1]0?arguments[0]:new Date;return v.setFakeBaseSystemTime.apply(v,F&&typeof F.getTime=="function"?[F.getTime()]:arguments)}return p.apply(this,arguments)},I&&["install","uninstall"].forEach(function(v){var F=s[T(v)]=s[v];s[v]=function(){var D=t.FakeAsyncTestZoneSpec;if(D){jasmine[T("clockInstalled")]=v==="install";return}return F.apply(this,arguments)}})}return s}}if(!jasmine[t.__symbol__("createSpyObj")]){var _=jasmine.createSpyObj;jasmine[t.__symbol__("createSpyObj")]=_,jasmine.createSpyObj=function(){var s=Array.prototype.slice.call(arguments),o=s.length>=3?s[2]:null,p;if(o){var v=Object.defineProperty;Object.defineProperty=function(F,D,H){return v.call(this,F,D,ae(L({},H),{configurable:!0,enumerable:!0}))};try{p=_.apply(this,s)}finally{Object.defineProperty=v}}else p=_.apply(this,s);return p}}function l(s,o){return function(){var p=f.fork(new u("jasmine.describe#".concat(s)));return p.run(o,this,arguments)}}function h(s,o,p,v){var F=!!jasmine[T("clockInstalled")],D=p.testProxyZoneSpec,H=p.testProxyZone,z;if(F&&I){var W=t[t.__symbol__("fakeAsyncTest")];W&&typeof W.fakeAsync=="function"&&(s=W.fakeAsync(s))}return v?H.run(s,o,[v]):H.run(s,o)}function m(s){return s&&(s.length?function(o){return h(s,this,this.queueRunner,o)}:function(){return h(s,this,this.queueRunner)})}var S=jasmine,c=(i=S==null?void 0:S.private)!=null&&i.QueueRunner?S==null?void 0:S.private:S,d=c.QueueRunner;c.QueueRunner=function(s){a(o,s);function o(p){var v=this;p.onComplete&&(p.onComplete=function(z){return function(){v.testProxyZone=null,v.testProxyZoneSpec=null,f.scheduleMicroTask("jasmine.onComplete",z)}}(p.onComplete));var F=e[t.__symbol__("setTimeout")],D=e[t.__symbol__("clearTimeout")];F&&(p.timeout={setTimeout:F||e.setTimeout,clearTimeout:D||e.clearTimeout}),c.UserContext?(p.userContext||(p.userContext=new c.UserContext),p.userContext.queueRunner=this):(p.userContext||(p.userContext={}),p.userContext.queueRunner=this);var H=p.onException;p.onException=function(z){if(z&&z.message==="Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL."){var W=this&&this.testProxyZoneSpec;if(W){var Ce=W.getAndClearPendingTasksInfo();try{z.message+=Ce}catch(je){}}}H&&H.call(this,z)},s.call(this,p)}return o.prototype.execute=function(){for(var p=this,v=t.current,F=!1;v;){if(v===f){F=!0;break}v=v.parent}if(!F)throw new Error("Unexpected Zone: "+t.current.name);this.testProxyZoneSpec=new y,this.testProxyZone=f.fork(this.testProxyZoneSpec),t.currentTask?s.prototype.execute.call(this):t.current.scheduleMicroTask("jasmine.execute().forceTask",function(){return d.prototype.execute.call(p)})},o}(d)})}function ue(r){r.__load_patch("jest",function(e,t,n){if(typeof jest=="undefined"||jest.__zone_patch__)return;t[n.symbol("ignoreConsoleErrorUncaughtError")]=!0,jest.__zone_patch__=!0;var i=t.ProxyZoneSpec,a=t.SyncTestZoneSpec;if(!i)throw new Error("Missing ProxyZoneSpec");var u=t.current,y=u.fork(new a("jest.describe")),f=new i,T=u.fork(f);function b(_){return function(){for(var l=[],h=0;h0},r.prototype._finishCallbackIfDone=function(){var e=this;this._existingFinishTimer!==null&&(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)})},r.prototype.patchPromiseForTest=function(){if(this.supportWaitUnresolvedChainedPromise){var e=Promise[Zone.__symbol__("patchPromiseForTest")];e&&e()}},r.prototype.unPatchPromiseForTest=function(){if(this.supportWaitUnresolvedChainedPromise){var e=Promise[Zone.__symbol__("unPatchPromiseForTest")];e&&e()}},r.prototype.onScheduleTask=function(e,t,n,i){return i.type!=="eventTask"&&(this._isSync=!1),i.type==="microTask"&&i.data&&i.data instanceof Promise&&i.data[r.symbolParentUnresolved]===!0&&this.unresolvedChainedPromiseCount--,e.scheduleTask(n,i)},r.prototype.onInvokeTask=function(e,t,n,i,a,u){return i.type!=="eventTask"&&(this._isSync=!1),e.invokeTask(n,i,a,u)},r.prototype.onCancelTask=function(e,t,n,i){return i.type!=="eventTask"&&(this._isSync=!1),e.cancelTask(n,i)},r.prototype.onInvoke=function(e,t,n,i,a,u,y){this.entryFunction||(this.entryFunction=i);try{return this._isSync=!0,e.invoke(n,i,a,u,y)}finally{this._isSync&&this.entryFunction===i&&this._finishCallbackIfDone()}},r.prototype.onHandleError=function(e,t,n,i){var a=e.handleError(n,i);return a&&(this.failCallback(i),this._alreadyErrored=!0),!1},r.prototype.onHasTask=function(e,t,n,i){e.hasTask(n,i),t===n&&(i.change=="microTask"?(this._pendingMicroTasks=i.microTask,this._finishCallbackIfDone()):i.change=="macroTask"&&(this._pendingMacroTasks=i.macroTask,this._finishCallbackIfDone()))},r}();function ye(r){r.AsyncTestZoneSpec=pe,r.__load_patch("asynctest",function(e,t,n){t[n.symbol("asyncTest")]=function(u){return e.jasmine?function(y){y||(y=function(){},y.fail=function(f){throw f}),i(u,this,void 0,y,function(f){if(typeof f=="string")return y.fail(new Error(f));y.fail(f)})}:function(){for(var y=this,f=[],T=0;T0;){this._currentTickRequeuePeriodicEntries=[];var y=u[0];if(i=0&&this._schedulerQueue.splice(T,1)}a=this._currentTickTime,this._currentTickTime=f.endTime,t&&t(this._currentTickTime-a);var b=f.func.apply(w,f.isRequestAnimationFrame?[this._currentTickTime]:f.args);if(!b)break;n.processNewMacroTasksSynchronously||this._currentTickRequeuePeriodicEntries.forEach(function(I){for(var A=0;A0;){if(a++,a>e)throw new Error("flush failed after reaching the limit of "+e+" tasks. Does your code use a polling timeout?");if(this._schedulerQueue.filter(function(f){return!f.isPeriodic&&!f.isRequestAnimationFrame}).length===0)break;var u=this._schedulerQueue.shift();i=this._currentTickTime,this._currentTickTime=u.endTime,t&&t(this._currentTickTime-i);var y=u.func.apply(w,u.args);if(!y)break}return this._currentTickTime-n},r}();g(B,"nextNodeJSId",1),g(B,"nextId",-1);var N=B,_e=function(){function r(e,t,n){t===void 0&&(t=!1),g(this,"trackPendingRequestAnimationFrame"),g(this,"macroTaskOptions"),g(this,"_scheduler",new N),g(this,"_microtasks",[]),g(this,"_lastError",null),g(this,"_uncaughtPromiseErrors",Promise[Zone.__symbol__("uncaughtPromiseErrors")]),g(this,"pendingPeriodicTimers",[]),g(this,"pendingTimers",[]),g(this,"patchDateLocked",!1),g(this,"tickMode",{counter:0,mode:"manual"}),g(this,"name"),g(this,"properties",{FakeAsyncTestZoneSpec:this}),this.trackPendingRequestAnimationFrame=t,this.macroTaskOptions=n,this.name="fakeAsyncTestZone for "+e,this.macroTaskOptions||(this.macroTaskOptions=w[Zone.__symbol__("FakeAsyncTestMacroTask")])}return r.assertInZone=function(){if(Zone.current.get("FakeAsyncTestZoneSpec")==null)throw new Error("The code should be running in the fakeAsync zone to call this function")},r.prototype._fnAndFlush=function(e,t){var n=this;return function(){for(var i=[],a=0;a-1&&e.splice(n,1)},r.prototype._dequeueTimer=function(e){var t=this;return function(){r._removeTimer(t.pendingTimers,e)}},r.prototype._requeuePeriodicTimer=function(e,t,n,i){var a=this;return function(){a.pendingPeriodicTimers.indexOf(i)!==-1&&a._scheduler.scheduleFunction(e,t,{args:n,isPeriodic:!0,id:i,isRequeuePeriodic:!0})}},r.prototype._dequeuePeriodicTimer=function(e){var t=this;return function(){r._removeTimer(t.pendingPeriodicTimers,e)}},r.prototype._setTimeout=function(e,t,n,i){i===void 0&&(i=!0);var a=this._dequeueTimer(N.nextId),u=this._fnAndFlush(e,{onSuccess:a,onError:a}),y=this._scheduler.scheduleFunction(u,t,{args:n,isRequestAnimationFrame:!i});return i&&this.pendingTimers.push(y),y},r.prototype._clearTimeout=function(e){r._removeTimer(this.pendingTimers,e),this._scheduler.removeScheduledFunctionWithId(e)},r.prototype._setInterval=function(e,t,n){var i=N.nextId,a={onSuccess:null,onError:this._dequeuePeriodicTimer(i)},u=this._fnAndFlush(e,a);return a.onSuccess=this._requeuePeriodicTimer(u,t,n,i),this._scheduler.scheduleFunction(u,t,{args:n,isPeriodic:!0}),this.pendingPeriodicTimers.push(i),i},r.prototype._clearInterval=function(e){r._removeTimer(this.pendingPeriodicTimers,e),this._scheduler.removeScheduledFunctionWithId(e)},r.prototype._resetLastErrorAndThrow=function(){var e=this._lastError||this._uncaughtPromiseErrors[0];throw this._uncaughtPromiseErrors.length=0,this._lastError=null,e},r.prototype.getCurrentTickTime=function(){return this._scheduler.getCurrentTickTime()},r.prototype.getFakeSystemTime=function(){return this._scheduler.getFakeSystemTime()},r.prototype.setFakeBaseSystemTime=function(e){this._scheduler.setFakeBaseSystemTime(e)},r.prototype.getRealSystemTime=function(){return this._scheduler.getRealSystemTime()},r.patchDate=function(){w[Zone.__symbol__("disableDatePatching")]||w.Date!==U&&(w.Date=U,U.prototype=q.prototype,r.checkTimerPatch())},r.resetDate=function(){w.Date===U&&(w.Date=q)},r.checkTimerPatch=function(){if(!Q)throw new Error("Expected timers to have been patched.");w.setTimeout!==Q.setTimeout&&(w.setTimeout=Q.setTimeout,w.clearTimeout=Q.clearTimeout),w.setInterval!==Q.setInterval&&(w.setInterval=Q.setInterval,w.clearInterval=Q.clearInterval)},r.prototype.lockDatePatch=function(){this.patchDateLocked=!0,r.patchDate()},r.prototype.unlockDatePatch=function(){this.patchDateLocked=!1,r.resetDate()},r.prototype.setTickMode=function(e,t){e!==this.tickMode.mode&&(this.tickMode.counter++,this.tickMode.mode=e,e==="automatic"&&this.advanceUntilModeChanges(t))},r.prototype.advanceUntilModeChanges=function(e){var t=this;r.assertInZone();var n=Zone.current,i=this.tickMode.counter;Zone.root.run(function(){return G(t,null,function(){var a=this;return $(this,function(u){switch(u.label){case 0:return[4,ee(function(){return G(a,null,function(){var y=this;return $(this,function(f){switch(f.label){case 0:return[4,void 0];case 1:return f.sent(),n.run(function(){y.flushMicrotasks()}),[2]}})})})];case 1:if(u.sent(),this.tickMode.counter!==i)return[2];u.label=2;case 2:return[4,ee(function(){return a.newMacrotask(n)})];case 3:return u.sent(),this.tickMode.counter!==i?[2]:[4,ee(function(){return n.run(function(){a._scheduler.executeNextTask(e)})})];case 4:return u.sent(),[3,2];case 5:return[2]}})})})},r.prototype.newMacrotask=function(e){return G(this,null,function(){var t,n=this;return $(this,function(i){switch(i.label){case 0:return re?[4,new Promise(function(a){re(a)})]:[3,2];case 1:return i.sent(),[3,5];case 2:return t=new MessageChannel,[4,new Promise(function(a){t.port1.onmessage=a,t.port2.postMessage(void 0)})];case 3:return i.sent(),t.port1.close(),t.port2.close(),[4,new Promise(function(a){ne(a)})];case 4:i.sent(),i.label=5;case 5:return e.run(function(){n.flushMicrotasks()}),[2]}})})},r.prototype.tickToNext=function(e,t,n){e===void 0&&(e=1),n===void 0&&(n={processNewMacroTasksSynchronously:!0}),!(e<=0)&&(r.assertInZone(),this.flushMicrotasks(),this._scheduler.tickToNext(e,t,n),this._lastError!==null&&this._resetLastErrorAndThrow())},r.prototype.tick=function(e,t,n){e===void 0&&(e=0),n===void 0&&(n={processNewMacroTasksSynchronously:!0}),r.assertInZone(),this.flushMicrotasks(),this._scheduler.tick(e,t,n),this._lastError!==null&&this._resetLastErrorAndThrow()},r.prototype.flushMicrotasks=function(){var e=this;r.assertInZone();for(var t=function(){(e._lastError!==null||e._uncaughtPromiseErrors.length)&&e._resetLastErrorAndThrow()};this._microtasks.length>0;){var n=this._microtasks.shift();n.func.apply(n.target,n.args)}t()},r.prototype.flush=function(e,t,n){r.assertInZone(),this.flushMicrotasks();var i=this._scheduler.flush(e,t,n);return this._lastError!==null&&this._resetLastErrorAndThrow(),i},r.prototype.flushOnlyPendingTimers=function(e){r.assertInZone(),this.flushMicrotasks();var t=this._scheduler.flushOnlyPendingTimers(e);return this._lastError!==null&&this._resetLastErrorAndThrow(),t},r.prototype.removeAllTimers=function(){r.assertInZone(),this._scheduler.removeAll(),this.pendingPeriodicTimers=[],this.pendingTimers=[]},r.prototype.getTimerCount=function(){return this._scheduler.getTimerCount()+this._microtasks.length},r.prototype.onScheduleTask=function(e,t,n,i){switch(i.type){case"microTask":var a=i.data&&i.data.args,u=void 0;if(a){var y=i.data.cbIdx;typeof a.length=="number"&&a.length>y+1&&(u=Array.prototype.slice.call(a,y+1))}this._microtasks.push({func:i.invoke,args:u,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":if(this.tickMode.mode==="manual")throw new Error("Cannot make XHRs from within a fake async test. Request URL: "+i.data.url);i=e.scheduleTask(n,i);break;case"requestAnimationFrame":case"webkitRequestAnimationFrame":case"mozRequestAnimationFrame":i.data.handleId=this._setTimeout(i.invoke,16,i.data.args,this.trackPendingRequestAnimationFrame);break;default:var f=this.findMacroTaskOption(i);if(f){var T=i.data&&i.data.args,b=T&&T.length>1?T[1]:0,I=f.callbackArgs?f.callbackArgs:T;f.isPeriodic?(i.data.handleId=this._setInterval(i.invoke,b,I),i.data.isPeriodic=!0):i.data.handleId=this._setTimeout(i.invoke,b,I);break}throw new Error("Unknown macroTask scheduled in fake async test: "+i.source)}break;case"eventTask":i=e.scheduleTask(n,i);break}return i},r.prototype.onCancelTask=function(e,t,n,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 a=this.findMacroTaskOption(i);if(a){var u=i.data.handleId;return a.isPeriodic?this._clearInterval(u):this._clearTimeout(u)}return e.cancelTask(n,i)}},r.prototype.onInvoke=function(e,t,n,i,a,u,y){try{return r.patchDate(),e.invoke(n,i,a,u,y)}finally{this.patchDateLocked||r.resetDate()}},r.prototype.findMacroTaskOption=function(e){if(!this.macroTaskOptions)return null;for(var t=0;t0)throw new Error("".concat(Z.pendingPeriodicTimers.length," periodic timer(s) still in the queue."));if(Z.pendingTimers.length>0)throw new Error("".concat(Z.pendingTimers.length," timer(s) still in the queue."))}return b}finally{se()}};return i.isFakeAsync=!0,i}function X(){if(Z==null&&(Z=Zone.current.get("FakeAsyncTestZoneSpec"),Z==null))throw new Error("The code should be running in the fakeAsync zone to call this function");return Z}function ke(r,e){r===void 0&&(r=0),e===void 0&&(e=!1),X().tick(r,null,e)}function Se(r){return X().flush(r)}function Pe(){var r=X(),e=r.pendingPeriodicTimers;r.pendingPeriodicTimers.length=0}function be(r){var e=function(){for(var t=[],n=0;n0}r.longStackTraceZoneSpec={name:"long-stack-trace",longStackTraceLimit:10,getLongStackTrace:function(c){if(c){var d=c[r.__symbol__("currentTaskTrace")];return d?l(d,c.stack):c.stack}},onScheduleTask:function(c,d,s,o){if(h()){var p=r.currentTask,v=p&&p.data&&p.data[n]||[];v=[new y].concat(v),v.length>this.longStackTraceLimit&&(v.length=this.longStackTraceLimit),o.data||(o.data={}),o.type==="eventTask"&&(o.data=L({},o.data)),o.data[n]=v}return c.scheduleTask(s,o)},onHandleError:function(c,d,s,o){if(h()){var p=r.currentTask||o.task;if(o instanceof Error&&p){var v=l(p.data&&p.data[n],o.stack);try{o.stack=o.longStack=v}catch(F){}}}return c.handleError(s,o)}};function m(c,d){d>0&&(c.push(x(new y().error)),m(c,d-1))}function S(){if(h()){var c=[];m(c,2);for(var d=c[0],s=c[1],o=0;o