@angular/core 20.0.0-next.5 → 20.0.0-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/{api.d-mxcXqDpA.d.ts → api.d-KjtSQajV.d.ts} +4 -4
  2. package/{ng_i18n_closure_mode.d-DLxSUiDr.d.ts → chrome_dev_tools_performance.d-qv7drdAl.d.ts} +20 -5
  3. package/{discovery.d-CyYpOJ7j.d.ts → discovery.d-D6xf1HH-.d.ts} +8 -79
  4. package/{event_dispatcher.d-PWnbqZDx.d.ts → event_dispatcher.d-DlbccpYq.d.ts} +3 -3
  5. package/fesm2022/{attribute-B17mgaqe.mjs → attribute-BWp59EjE.mjs} +3 -3
  6. package/fesm2022/{attribute-B17mgaqe.mjs.map → attribute-BWp59EjE.mjs.map} +1 -1
  7. package/fesm2022/core.mjs +22 -31
  8. package/fesm2022/core.mjs.map +1 -1
  9. package/fesm2022/{debug_node-xKpCIZm-.mjs → debug_node-B3CixwNH.mjs} +218 -141
  10. package/fesm2022/debug_node-B3CixwNH.mjs.map +1 -0
  11. package/fesm2022/primitives/di.mjs +1 -1
  12. package/fesm2022/primitives/event-dispatch.mjs +2 -2
  13. package/fesm2022/primitives/signals.mjs +5 -5
  14. package/fesm2022/{resource-BPpYEDic.mjs → resource-DtpS_sTw.mjs} +6 -8
  15. package/fesm2022/resource-DtpS_sTw.mjs.map +1 -0
  16. package/fesm2022/{root_effect_scheduler-D0_b1cf_.mjs → root_effect_scheduler-BK3l7wIO.mjs} +144 -68
  17. package/fesm2022/root_effect_scheduler-BK3l7wIO.mjs.map +1 -0
  18. package/fesm2022/rxjs-interop.mjs +7 -84
  19. package/fesm2022/rxjs-interop.mjs.map +1 -1
  20. package/fesm2022/{signal-DhRAAi7R.mjs → signal-B6pMq7KS.mjs} +3 -3
  21. package/fesm2022/{signal-DhRAAi7R.mjs.map → signal-B6pMq7KS.mjs.map} +1 -1
  22. package/fesm2022/testing.mjs +167 -103
  23. package/fesm2022/testing.mjs.map +1 -1
  24. package/fesm2022/{untracked-DaaW3JJm.mjs → untracked-Bz5WMeU1.mjs} +4 -4
  25. package/fesm2022/{untracked-DaaW3JJm.mjs.map → untracked-Bz5WMeU1.mjs.map} +1 -1
  26. package/fesm2022/{weak_ref-DrMdAIDh.mjs → weak_ref-BaIq-pgY.mjs} +3 -3
  27. package/fesm2022/{weak_ref-DrMdAIDh.mjs.map → weak_ref-BaIq-pgY.mjs.map} +1 -1
  28. package/{graph.d-StYigYp1.d.ts → graph.d-BcIOep_B.d.ts} +3 -3
  29. package/index.d.ts +34 -41
  30. package/package.json +2 -2
  31. package/primitives/di/index.d.ts +1 -1
  32. package/primitives/event-dispatch/index.d.ts +3 -3
  33. package/primitives/signals/index.d.ts +6 -6
  34. package/rxjs-interop/index.d.ts +8 -17
  35. package/schematics/bundles/{apply_import_manager-C-ysxahq.js → apply_import_manager-DczRKpTm.js} +6 -6
  36. package/schematics/bundles/{change_tracker-0Ktek5Xl.js → change_tracker-CWLh-wes.js} +3 -3
  37. package/schematics/bundles/{checker-DqUKCGda.js → checker-_f5wM7PH.js} +20 -3
  38. package/schematics/bundles/cleanup-unused-imports.js +25 -20
  39. package/schematics/bundles/{compiler-CuoiHqkc.js → compiler-BaCbbux6.js} +964 -298
  40. package/schematics/bundles/compiler_host-CAfDJO3W.js +1 -1
  41. package/schematics/bundles/control-flow-migration.js +2 -2
  42. package/schematics/bundles/document-core.js +12 -12
  43. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  44. package/schematics/bundles/{index-CwFQSYXZ.js → index--W6S49uu.js} +10 -10
  45. package/schematics/bundles/{index-WFXCe5Q0.js → index-rsJ8I_hu.js} +131 -64
  46. package/schematics/bundles/inject-flags.js +14 -14
  47. package/schematics/bundles/inject-migration.js +108 -19
  48. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  49. package/schematics/bundles/{migrate_ts_type_references-BNuHufqZ.js → migrate_ts_type_references-C4D_SzJk.js} +21 -21
  50. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  51. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  52. package/schematics/bundles/output-migration.js +80 -22
  53. package/schematics/bundles/{run_in_devkit-CmHxABFr.js → project_paths-Ce0O2u-M.js} +254 -244
  54. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  55. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  56. package/schematics/bundles/route-lazy-loading.js +4 -4
  57. package/schematics/bundles/self-closing-tags-migration.js +20 -15
  58. package/schematics/bundles/signal-input-migration.js +26 -21
  59. package/schematics/bundles/signal-queries-migration.js +32 -27
  60. package/schematics/bundles/signals.js +8 -8
  61. package/schematics/bundles/standalone-migration.js +5 -5
  62. package/schematics/bundles/symbol-VPWguRxr.js +1 -1
  63. package/schematics/bundles/test-bed-get.js +13 -13
  64. package/{signal.d-BeaTIeOE.d.ts → signal.d-E0e5nW1p.d.ts} +4 -4
  65. package/testing/index.d.ts +9 -25
  66. package/{weak_ref.d-ttyj86RV.d.ts → weak_ref.d-eGOEP9S1.d.ts} +2 -2
  67. package/fesm2022/debug_node-xKpCIZm-.mjs.map +0 -1
  68. package/fesm2022/resource-BPpYEDic.mjs.map +0 -1
  69. package/fesm2022/root_effect_scheduler-D0_b1cf_.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.5
2
+ * @license Angular v20.0.0-next.7
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.5
2
+ * @license Angular v20.0.0-next.7
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { A as Attribute } from '../attribute-B17mgaqe.mjs';
7
+ import { Attribute } from '../attribute-BWp59EjE.mjs';
8
8
 
9
9
  /** All properties that are used by jsaction. */
10
10
  const Property = {
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.5
2
+ * @license Angular v20.0.0-next.7
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { c as consumerMarkDirty, S as SIGNAL, a as consumerDestroy, i as isInNotificationPhase, b as consumerPollProducersForChange, d as consumerBeforeComputation, e as consumerAfterComputation, R as REACTIVE_NODE } from '../signal-DhRAAi7R.mjs';
8
- export { u as SIGNAL_NODE, f as createComputed, v as createSignal, g as defaultEquals, h as getActiveConsumer, j as isReactive, p as producerAccessed, k as producerIncrementEpoch, l as producerMarkClean, m as producerNotifyConsumers, n as producerUpdateValueVersion, o as producerUpdatesAllowed, r as runPostProducerCreatedFn, w as runPostSignalSetFn, q as setActiveConsumer, t as setPostProducerCreatedFn, x as setPostSignalSetFn, s as setThrowInvalidWriteToSignalError, y as signalGetFn, z as signalSetFn, A as signalUpdateFn } from '../signal-DhRAAi7R.mjs';
9
- export { c as createLinkedSignal, l as linkedSignalSetFn, a as linkedSignalUpdateFn, u as untracked } from '../untracked-DaaW3JJm.mjs';
10
- export { s as setAlternateWeakRefImpl } from '../weak_ref-DrMdAIDh.mjs';
7
+ import { consumerMarkDirty, SIGNAL, consumerDestroy, isInNotificationPhase, consumerPollProducersForChange, consumerBeforeComputation, consumerAfterComputation, REACTIVE_NODE } from '../signal-B6pMq7KS.mjs';
8
+ export { SIGNAL_NODE, createComputed, createSignal, defaultEquals, getActiveConsumer, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, runPostProducerCreatedFn, runPostSignalSetFn, setActiveConsumer, setPostProducerCreatedFn, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalGetFn, signalSetFn, signalUpdateFn } from '../signal-B6pMq7KS.mjs';
9
+ export { createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn, untracked } from '../untracked-Bz5WMeU1.mjs';
10
+ export { setAlternateWeakRefImpl } from '../weak_ref-BaIq-pgY.mjs';
11
11
 
12
12
  function createWatch(fn, schedule, allowSignalWrites) {
13
13
  const node = Object.create(WATCH_NODE);
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.5
2
+ * @license Angular v20.0.0-next.7
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { i as inject, R as RuntimeError, f as formatRuntimeError, E as ErrorHandler, D as DestroyRef, b as assertNotInReactiveContext, a as assertInInjectionContext, I as Injector, V as ViewContext, C as ChangeDetectionScheduler, c as EffectScheduler, d as setInjectorProfilerContext, e as emitEffectCreatedEvent, g as EFFECTS, n as noop, F as FLAGS, m as markAncestorsForTraversal, h as setIsRefreshingViews, N as NodeInjectorDestroyRef, j as InjectionToken, k as signalAsReadonlyFn, P as PendingTasks, s as signal } from './root_effect_scheduler-D0_b1cf_.mjs';
8
- import { q as setActiveConsumer, f as createComputed, S as SIGNAL, R as REACTIVE_NODE, a as consumerDestroy, i as isInNotificationPhase, b as consumerPollProducersForChange, d as consumerBeforeComputation, e as consumerAfterComputation } from './signal-DhRAAi7R.mjs';
9
- import { u as untracked$1, c as createLinkedSignal, l as linkedSignalSetFn, a as linkedSignalUpdateFn } from './untracked-DaaW3JJm.mjs';
7
+ import { inject, RuntimeError, formatRuntimeError, ErrorHandler, DestroyRef, assertNotInReactiveContext, assertInInjectionContext, Injector, ViewContext, ChangeDetectionScheduler, EffectScheduler, setInjectorProfilerContext, emitEffectCreatedEvent, EFFECTS, noop, FLAGS, markAncestorsForTraversal, setIsRefreshingViews, NodeInjectorDestroyRef, InjectionToken, signalAsReadonlyFn, PendingTasks, signal } from './root_effect_scheduler-BK3l7wIO.mjs';
8
+ import { setActiveConsumer, createComputed, SIGNAL, REACTIVE_NODE, consumerDestroy, isInNotificationPhase, consumerPollProducersForChange, consumerBeforeComputation, consumerAfterComputation } from './signal-B6pMq7KS.mjs';
9
+ import { untracked as untracked$1, createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn } from './untracked-Bz5WMeU1.mjs';
10
10
 
11
11
  /**
12
12
  * An `OutputEmitterRef` is created by the `output()` function and can be
@@ -126,8 +126,6 @@ class EffectRefImpl {
126
126
  * and have no connection to the component tree or change detection.
127
127
  *
128
128
  * `effect()` must be run in injection context, unless the `injector` option is manually specified.
129
- *
130
- * @developerPreview
131
129
  */
132
130
  function effect(effectFn, options) {
133
131
  ngDevMode &&
@@ -617,5 +615,5 @@ function isResolved(state) {
617
615
  return state.error === undefined;
618
616
  }
619
617
 
620
- export { OutputEmitterRef as O, ResourceImpl as R, ResourceStatus as a, computed as c, effect as e, getOutputDestroyRef as g, linkedSignal as l, resource as r, untracked as u };
621
- //# sourceMappingURL=resource-BPpYEDic.mjs.map
618
+ export { OutputEmitterRef, ResourceImpl, ResourceStatus, computed, effect, getOutputDestroyRef, linkedSignal, resource, untracked };
619
+ //# sourceMappingURL=resource-DtpS_sTw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-DtpS_sTw.mjs","sources":["../../../../../../packages/core/src/authoring/output/output_emitter_ref.ts","../../../../../../packages/core/src/render3/reactivity/untracked.ts","../../../../../../packages/core/src/render3/reactivity/computed.ts","../../../../../../packages/core/src/render3/reactivity/effect.ts","../../../../../../packages/core/src/resource/api.ts","../../../../../../packages/core/src/render3/reactivity/linked_signal.ts","../../../../../../packages/core/src/resource/resource.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {setActiveConsumer} from '../../../primitives/signals';\n\nimport {inject} from '../../di/injector_compatibility';\nimport {ErrorHandler} from '../../error_handler';\nimport {formatRuntimeError, RuntimeError, RuntimeErrorCode} from '../../errors';\nimport {DestroyRef} from '../../linker/destroy_ref';\n\nimport {OutputRef, OutputRefSubscription} from './output_ref';\n\n/**\n * An `OutputEmitterRef` is created by the `output()` function and can be\n * used to emit values to consumers of your directive or component.\n *\n * Consumers of your directive/component can bind to the output and\n * subscribe to changes via the bound event syntax. For example:\n *\n * ```html\n * <my-comp (valueChange)=\"processNewValue($event)\" />\n * ```\n *\n * @publicAPI\n */\nexport class OutputEmitterRef<T> implements OutputRef<T> {\n private destroyed = false;\n private listeners: Array<(value: T) => void> | null = null;\n private errorHandler = inject(ErrorHandler, {optional: true});\n\n /** @internal */\n destroyRef: DestroyRef = inject(DestroyRef);\n\n constructor() {\n // Clean-up all listeners and mark as destroyed upon destroy.\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.listeners = null;\n });\n }\n\n subscribe(callback: (value: T) => void): OutputRefSubscription {\n if (this.destroyed) {\n throw new RuntimeError(\n RuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected subscription to destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n );\n }\n\n (this.listeners ??= []).push(callback);\n\n return {\n unsubscribe: () => {\n const idx = this.listeners?.indexOf(callback);\n if (idx !== undefined && idx !== -1) {\n this.listeners?.splice(idx, 1);\n }\n },\n };\n }\n\n /** Emits a new value to the output. */\n emit(value: T): void {\n if (this.destroyed) {\n console.warn(\n formatRuntimeError(\n RuntimeErrorCode.OUTPUT_REF_DESTROYED,\n ngDevMode &&\n 'Unexpected emit for destroyed `OutputRef`. ' +\n 'The owning directive/component is destroyed.',\n ),\n );\n return;\n }\n\n if (this.listeners === null) {\n return;\n }\n\n const previousConsumer = setActiveConsumer(null);\n try {\n for (const listenerFn of this.listeners) {\n try {\n listenerFn(value);\n } catch (err: unknown) {\n this.errorHandler?.handleError(err);\n }\n }\n } finally {\n setActiveConsumer(previousConsumer);\n }\n }\n}\n\n/** Gets the owning `DestroyRef` for the given output. */\nexport function getOutputDestroyRef(ref: OutputRef<unknown>): DestroyRef | undefined {\n return ref.destroyRef;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {untracked as untrackedPrimitive} from '../../../primitives/signals';\n\n/**\n * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function\n * can, optionally, return a value.\n */\nexport function untracked<T>(nonReactiveReadsFn: () => T): T {\n return untrackedPrimitive(nonReactiveReadsFn);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {createComputed, SIGNAL} from '../../../primitives/signals';\n\nimport {Signal, ValueEqualityFn} from './api';\n\n/**\n * Options passed to the `computed` creation function.\n */\nexport interface CreateComputedOptions<T> {\n /**\n * A comparison function which defines equality for computed values.\n */\n equal?: ValueEqualityFn<T>;\n\n /**\n * A debug name for the computed signal. Used in Angular DevTools to identify the signal.\n */\n debugName?: string;\n}\n\n/**\n * Create a computed `Signal` which derives a reactive value from an expression.\n */\nexport function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T> {\n const getter = createComputed(computation, options?.equal);\n\n if (ngDevMode) {\n getter.toString = () => `[Computed: ${getter()}]`;\n getter[SIGNAL].debugName = options?.debugName;\n }\n\n return getter;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n REACTIVE_NODE,\n ReactiveNode,\n SIGNAL,\n consumerAfterComputation,\n consumerBeforeComputation,\n consumerDestroy,\n consumerPollProducersForChange,\n isInNotificationPhase,\n setActiveConsumer,\n} from '../../../primitives/signals';\nimport {FLAGS, LViewFlags, LView, EFFECTS} from '../interfaces/view';\nimport {markAncestorsForTraversal} from '../util/view_utils';\nimport {InjectionToken} from '../../di/injection_token';\nimport {inject} from '../../di/injector_compatibility';\nimport {Injector} from '../../di/injector';\nimport {assertNotInReactiveContext} from './asserts';\nimport {assertInInjectionContext} from '../../di/contextual';\nimport {DestroyRef, NodeInjectorDestroyRef} from '../../linker/destroy_ref';\nimport {ViewContext} from '../view_context';\nimport {noop} from '../../util/noop';\nimport {\n ChangeDetectionScheduler,\n NotificationSource,\n} from '../../change_detection/scheduling/zoneless_scheduling';\nimport {setIsRefreshingViews} from '../state';\nimport {EffectScheduler, SchedulableEffect} from './root_effect_scheduler';\n\nimport {emitEffectCreatedEvent, setInjectorProfilerContext} from '../debug/injector_profiler';\n\n/**\n * A global reactive effect, which can be manually destroyed.\n */\nexport interface EffectRef {\n /**\n * Shut down the effect, removing it from any upcoming scheduled executions.\n */\n destroy(): void;\n}\n\nexport class EffectRefImpl implements EffectRef {\n [SIGNAL]: EffectNode;\n\n constructor(node: EffectNode) {\n this[SIGNAL] = node;\n }\n\n destroy(): void {\n this[SIGNAL].destroy();\n }\n}\n\n/**\n * Options passed to the `effect` function.\n */\nexport interface CreateEffectOptions {\n /**\n * The `Injector` in which to create the effect.\n *\n * If this is not provided, the current [injection context](guide/di/dependency-injection-context)\n * will be used instead (via `inject`).\n */\n injector?: Injector;\n\n /**\n * Whether the `effect` should require manual cleanup.\n *\n * If this is `false` (the default) the effect will automatically register itself to be cleaned up\n * with the current `DestroyRef`.\n *\n * If this is `true` and you want to use the effect outside an injection context, you still\n * need to provide an `Injector` to the effect.\n */\n manualCleanup?: boolean;\n\n /**\n * @deprecated no longer required, signal writes are allowed by default.\n */\n allowSignalWrites?: boolean;\n\n /**\n * A debug name for the effect. Used in Angular DevTools to identify the effect.\n */\n debugName?: string;\n}\n\n/**\n * An effect can, optionally, register a cleanup function. If registered, the cleanup is executed\n * before the next effect run. The cleanup function makes it possible to \"cancel\" any work that the\n * previous effect run might have started.\n */\nexport type EffectCleanupFn = () => void;\n\n/**\n * A callback passed to the effect function that makes it possible to register cleanup logic.\n */\nexport type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;\n\n/**\n * Registers an \"effect\" that will be scheduled & executed whenever the signals that it reads\n * changes.\n *\n * Angular has two different kinds of effect: component effects and root effects. Component effects\n * are created when `effect()` is called from a component, directive, or within a service of a\n * component/directive. Root effects are created when `effect()` is called from outside the\n * component tree, such as in a root service.\n *\n * The two effect types differ in their timing. Component effects run as a component lifecycle\n * event during Angular's synchronization (change detection) process, and can safely read input\n * signals or create/destroy views that depend on component state. Root effects run as microtasks\n * and have no connection to the component tree or change detection.\n *\n * `effect()` must be run in injection context, unless the `injector` option is manually specified.\n */\nexport function effect(\n effectFn: (onCleanup: EffectCleanupRegisterFn) => void,\n options?: CreateEffectOptions,\n): EffectRef {\n ngDevMode &&\n assertNotInReactiveContext(\n effect,\n 'Call `effect` outside of a reactive context. For example, schedule the ' +\n 'effect inside the component constructor.',\n );\n\n !options?.injector && assertInInjectionContext(effect);\n\n if (ngDevMode && options?.allowSignalWrites !== undefined) {\n console.warn(\n `The 'allowSignalWrites' flag is deprecated and no longer impacts effect() (writes are always allowed)`,\n );\n }\n\n const injector = options?.injector ?? inject(Injector);\n let destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n\n let node: EffectNode;\n\n const viewContext = injector.get(ViewContext, null, {optional: true});\n const notifier = injector.get(ChangeDetectionScheduler);\n if (viewContext !== null) {\n // This effect was created in the context of a view, and will be associated with the view.\n node = createViewEffect(viewContext.view, notifier, effectFn);\n if (destroyRef instanceof NodeInjectorDestroyRef && destroyRef._lView === viewContext.view) {\n // The effect is being created in the same view as the `DestroyRef` references, so it will be\n // automatically destroyed without the need for an explicit `DestroyRef` registration.\n destroyRef = null;\n }\n } else {\n // This effect was created outside the context of a view, and will be scheduled independently.\n node = createRootEffect(effectFn, injector.get(EffectScheduler), notifier);\n }\n node.injector = injector;\n\n if (destroyRef !== null) {\n // If we need to register for cleanup, do that here.\n node.onDestroyFn = destroyRef.onDestroy(() => node.destroy());\n }\n\n const effectRef = new EffectRefImpl(node);\n\n if (ngDevMode) {\n node.debugName = options?.debugName ?? '';\n const prevInjectorProfilerContext = setInjectorProfilerContext({injector, token: null});\n try {\n emitEffectCreatedEvent(effectRef);\n } finally {\n setInjectorProfilerContext(prevInjectorProfilerContext);\n }\n }\n\n return effectRef;\n}\n\nexport interface EffectNode extends ReactiveNode, SchedulableEffect {\n hasRun: boolean;\n cleanupFns: EffectCleanupFn[] | undefined;\n injector: Injector;\n notifier: ChangeDetectionScheduler;\n\n onDestroyFn: () => void;\n fn: (cleanupFn: EffectCleanupRegisterFn) => void;\n run(): void;\n destroy(): void;\n maybeCleanup(): void;\n}\n\nexport interface ViewEffectNode extends EffectNode {\n view: LView;\n}\n\nexport interface RootEffectNode extends EffectNode {\n scheduler: EffectScheduler;\n}\n\n/**\n * Not public API, which guarantees `EffectScheduler` only ever comes from the application root\n * injector.\n */\nexport const APP_EFFECT_SCHEDULER = /* @__PURE__ */ new InjectionToken('', {\n providedIn: 'root',\n factory: () => inject(EffectScheduler),\n});\n\nexport const BASE_EFFECT_NODE: Omit<EffectNode, 'fn' | 'destroy' | 'injector' | 'notifier'> =\n /* @__PURE__ */ (() => ({\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: true,\n dirty: true,\n hasRun: false,\n cleanupFns: undefined,\n zone: null,\n kind: 'effect',\n onDestroyFn: noop,\n run(this: EffectNode): void {\n this.dirty = false;\n\n if (ngDevMode && isInNotificationPhase()) {\n throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);\n }\n\n if (this.hasRun && !consumerPollProducersForChange(this)) {\n return;\n }\n this.hasRun = true;\n\n const registerCleanupFn: EffectCleanupRegisterFn = (cleanupFn) =>\n (this.cleanupFns ??= []).push(cleanupFn);\n\n const prevNode = consumerBeforeComputation(this);\n\n // We clear `setIsRefreshingViews` so that `markForCheck()` within the body of an effect will\n // cause CD to reach the component in question.\n const prevRefreshingViews = setIsRefreshingViews(false);\n try {\n this.maybeCleanup();\n this.fn(registerCleanupFn);\n } finally {\n setIsRefreshingViews(prevRefreshingViews);\n consumerAfterComputation(this, prevNode);\n }\n },\n\n maybeCleanup(this: EffectNode): void {\n if (!this.cleanupFns?.length) {\n return;\n }\n const prevConsumer = setActiveConsumer(null);\n try {\n // Attempt to run the cleanup functions. Regardless of failure or success, we consider\n // cleanup \"completed\" and clear the list for the next run of the effect. Note that an error\n // from the cleanup function will still crash the current run of the effect.\n while (this.cleanupFns.length) {\n this.cleanupFns.pop()!();\n }\n } finally {\n this.cleanupFns = [];\n setActiveConsumer(prevConsumer);\n }\n },\n }))();\n\nexport const ROOT_EFFECT_NODE: Omit<RootEffectNode, 'fn' | 'scheduler' | 'notifier' | 'injector'> =\n /* @__PURE__ */ (() => ({\n ...BASE_EFFECT_NODE,\n consumerMarkedDirty(this: RootEffectNode) {\n this.scheduler.schedule(this);\n this.notifier.notify(NotificationSource.RootEffect);\n },\n destroy(this: RootEffectNode) {\n consumerDestroy(this);\n this.onDestroyFn();\n this.maybeCleanup();\n this.scheduler.remove(this);\n },\n }))();\n\nexport const VIEW_EFFECT_NODE: Omit<ViewEffectNode, 'fn' | 'view' | 'injector' | 'notifier'> =\n /* @__PURE__ */ (() => ({\n ...BASE_EFFECT_NODE,\n consumerMarkedDirty(this: ViewEffectNode): void {\n this.view[FLAGS] |= LViewFlags.HasChildViewsToRefresh;\n markAncestorsForTraversal(this.view);\n this.notifier.notify(NotificationSource.ViewEffect);\n },\n destroy(this: ViewEffectNode): void {\n consumerDestroy(this);\n this.onDestroyFn();\n this.maybeCleanup();\n this.view[EFFECTS]?.delete(this);\n },\n }))();\n\nexport function createViewEffect(\n view: LView,\n notifier: ChangeDetectionScheduler,\n fn: (onCleanup: EffectCleanupRegisterFn) => void,\n): ViewEffectNode {\n const node = Object.create(VIEW_EFFECT_NODE) as ViewEffectNode;\n node.view = view;\n node.zone = typeof Zone !== 'undefined' ? Zone.current : null;\n node.notifier = notifier;\n node.fn = fn;\n\n view[EFFECTS] ??= new Set();\n view[EFFECTS].add(node);\n\n node.consumerMarkedDirty(node);\n return node;\n}\n\nexport function createRootEffect(\n fn: (onCleanup: EffectCleanupRegisterFn) => void,\n scheduler: EffectScheduler,\n notifier: ChangeDetectionScheduler,\n): RootEffectNode {\n const node = Object.create(ROOT_EFFECT_NODE) as RootEffectNode;\n node.fn = fn;\n node.scheduler = scheduler;\n node.notifier = notifier;\n node.zone = typeof Zone !== 'undefined' ? Zone.current : null;\n node.scheduler.add(node);\n node.notifier.notify(NotificationSource.RootEffect);\n return node;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Injector} from '../di/injector';\nimport {Signal, ValueEqualityFn} from '../render3/reactivity/api';\nimport {WritableSignal} from '../render3/reactivity/signal';\n\n/**\n * Status of a `Resource`.\n *\n * @experimental\n */\nexport enum ResourceStatus {\n /**\n * The resource has no valid request and will not perform any loading.\n *\n * `value()` will be `undefined`.\n */\n Idle,\n\n /**\n * Loading failed with an error.\n *\n * `value()` will be `undefined`.\n */\n Error,\n\n /**\n * The resource is currently loading a new value as a result of a change in its `request`.\n *\n * `value()` will be `undefined`.\n */\n Loading,\n\n /**\n * The resource is currently reloading a fresh value for the same request.\n *\n * `value()` will continue to return the previously fetched value during the reloading operation.\n */\n Reloading,\n\n /**\n * Loading has completed and the resource has the value returned from the loader.\n */\n Resolved,\n\n /**\n * The resource's value was set locally via `.set()` or `.update()`.\n */\n Local,\n}\n\n/**\n * A Resource is an asynchronous dependency (for example, the results of an API call) that is\n * managed and delivered through signals.\n *\n * The usual way of creating a `Resource` is through the `resource` function, but various other APIs\n * may present `Resource` instances to describe their own concepts.\n *\n * @experimental\n */\nexport interface Resource<T> {\n /**\n * The current value of the `Resource`, or `undefined` if there is no current value.\n */\n readonly value: Signal<T>;\n\n /**\n * The current status of the `Resource`, which describes what the resource is currently doing and\n * what can be expected of its `value`.\n */\n readonly status: Signal<ResourceStatus>;\n\n /**\n * When in the `error` state, this returns the last known error from the `Resource`.\n */\n readonly error: Signal<unknown>;\n\n /**\n * Whether this resource is loading a new value (or reloading the existing one).\n */\n readonly isLoading: Signal<boolean>;\n\n /**\n * Whether this resource has a valid current value.\n *\n * This function is reactive.\n */\n hasValue(): this is Resource<Exclude<T, undefined>>;\n\n /**\n * Instructs the resource to re-load any asynchronous dependency it may have.\n *\n * Note that the resource will not enter its reloading state until the actual backend request is\n * made.\n *\n * @returns true if a reload was initiated, false if a reload was unnecessary or unsupported\n */\n reload(): boolean;\n}\n\n/**\n * A `Resource` with a mutable value.\n *\n * Overwriting the value of a resource sets it to the 'local' state.\n *\n * @experimental\n */\nexport interface WritableResource<T> extends Resource<T> {\n readonly value: WritableSignal<T>;\n hasValue(): this is WritableResource<Exclude<T, undefined>>;\n\n /**\n * Convenience wrapper for `value.set`.\n */\n set(value: T): void;\n\n /**\n * Convenience wrapper for `value.update`.\n */\n update(updater: (value: T) => T): void;\n asReadonly(): Resource<T>;\n}\n\n/**\n * A `WritableResource` created through the `resource` function.\n *\n * @experimental\n */\nexport interface ResourceRef<T> extends WritableResource<T> {\n hasValue(): this is ResourceRef<Exclude<T, undefined>>;\n\n /**\n * Manually destroy the resource, which cancels pending requests and returns it to `idle` state.\n */\n destroy(): void;\n}\n\n/**\n * Parameter to a `ResourceLoader` which gives the request and other options for the current loading\n * operation.\n *\n * @experimental\n */\nexport interface ResourceLoaderParams<R> {\n request: Exclude<NoInfer<R>, undefined>;\n abortSignal: AbortSignal;\n previous: {\n status: ResourceStatus;\n };\n}\n\n/**\n * Loading function for a `Resource`.\n *\n * @experimental\n */\nexport type ResourceLoader<T, R> = (param: ResourceLoaderParams<R>) => PromiseLike<T>;\n\n/**\n * Streaming loader for a `Resource`.\n *\n * @experimental\n */\nexport type ResourceStreamingLoader<T, R> = (\n param: ResourceLoaderParams<R>,\n) => PromiseLike<Signal<ResourceStreamItem<T>>>;\n\n/**\n * Options to the `resource` function, for creating a resource.\n *\n * @experimental\n */\nexport interface BaseResourceOptions<T, R> {\n /**\n * A reactive function which determines the request to be made. Whenever the request changes, the\n * loader will be triggered to fetch a new value for the resource.\n *\n * If a request function isn't provided, the loader won't rerun unless the resource is reloaded.\n */\n request?: () => R;\n\n /**\n * The value which will be returned from the resource when a server value is unavailable, such as\n * when the resource is still loading, or in an error state.\n */\n defaultValue?: NoInfer<T>;\n\n /**\n * Equality function used to compare the return value of the loader.\n */\n equal?: ValueEqualityFn<T>;\n\n /**\n * Overrides the `Injector` used by `resource`.\n */\n injector?: Injector;\n}\n\n/**\n * Options to the `resource` function, for creating a resource.\n *\n * @experimental\n */\nexport interface PromiseResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n /**\n * Loading function which returns a `Promise` of the resource's value for a given request.\n */\n loader: ResourceLoader<T, R>;\n\n /**\n * Cannot specify `stream` and `loader` at the same time.\n */\n stream?: never;\n}\n\n/**\n * Options to the `resource` function, for creating a resource.\n *\n * @experimental\n */\nexport interface StreamingResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n /**\n * Loading function which returns a `Promise` of a signal of the resource's value for a given\n * request, which can change over time as new values are received from a stream.\n */\n stream: ResourceStreamingLoader<T, R>;\n\n /**\n * Cannot specify `stream` and `loader` at the same time.\n */\n loader?: never;\n}\n\n/**\n * @experimental\n */\nexport type ResourceOptions<T, R> = PromiseResourceOptions<T, R> | StreamingResourceOptions<T, R>;\n\n/**\n * @experimental\n */\nexport type ResourceStreamItem<T> = {value: T} | {error: unknown};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComputationFn,\n createLinkedSignal,\n LinkedSignalGetter,\n LinkedSignalNode,\n linkedSignalSetFn,\n linkedSignalUpdateFn,\n SIGNAL,\n} from '../../../primitives/signals';\nimport {Signal, ValueEqualityFn} from './api';\nimport {signalAsReadonlyFn, WritableSignal} from './signal';\n\nconst identityFn = <T>(v: T) => v;\n\n/**\n * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.\n *\n * @publicApi\n */\nexport function linkedSignal<D>(\n computation: () => D,\n options?: {equal?: ValueEqualityFn<NoInfer<D>>},\n): WritableSignal<D>;\n\n/**\n * Creates a writable signal whose value is initialized and reset by the linked, reactive computation.\n * This is an advanced API form where the computation has access to the previous value of the signal and the computation result.\n *\n * Note: The computation is reactive, meaning the linked signal will automatically update whenever any of the signals used within the computation change.\n *\n * @publicApi\n */\nexport function linkedSignal<S, D>(options: {\n source: () => S;\n computation: (source: NoInfer<S>, previous?: {source: NoInfer<S>; value: NoInfer<D>}) => D;\n equal?: ValueEqualityFn<NoInfer<D>>;\n}): WritableSignal<D>;\n\nexport function linkedSignal<S, D>(\n optionsOrComputation:\n | {\n source: () => S;\n computation: ComputationFn<S, D>;\n equal?: ValueEqualityFn<D>;\n }\n | (() => D),\n options?: {equal?: ValueEqualityFn<D>},\n): WritableSignal<D> {\n if (typeof optionsOrComputation === 'function') {\n const getter = createLinkedSignal<D, D>(\n optionsOrComputation,\n identityFn<D>,\n options?.equal,\n ) as LinkedSignalGetter<D, D> & WritableSignal<D>;\n return upgradeLinkedSignalGetter(getter);\n } else {\n const getter = createLinkedSignal<S, D>(\n optionsOrComputation.source,\n optionsOrComputation.computation,\n optionsOrComputation.equal,\n );\n return upgradeLinkedSignalGetter(getter);\n }\n}\n\nfunction upgradeLinkedSignalGetter<S, D>(getter: LinkedSignalGetter<S, D>): WritableSignal<D> {\n if (ngDevMode) {\n getter.toString = () => `[LinkedSignal: ${getter()}]`;\n }\n\n const node = getter[SIGNAL] as LinkedSignalNode<S, D>;\n const upgradedGetter = getter as LinkedSignalGetter<S, D> & WritableSignal<D>;\n\n upgradedGetter.set = (newValue: D) => linkedSignalSetFn(node, newValue);\n upgradedGetter.update = (updateFn: (value: D) => D) => linkedSignalUpdateFn(node, updateFn);\n upgradedGetter.asReadonly = signalAsReadonlyFn.bind(getter as any) as () => Signal<D>;\n\n return upgradedGetter;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {untracked} from '../render3/reactivity/untracked';\nimport {computed} from '../render3/reactivity/computed';\nimport {signal, signalAsReadonlyFn, WritableSignal} from '../render3/reactivity/signal';\nimport {Signal} from '../render3/reactivity/api';\nimport {effect, EffectRef} from '../render3/reactivity/effect';\nimport {\n ResourceOptions,\n ResourceStatus,\n WritableResource,\n Resource,\n ResourceRef,\n ResourceStreamingLoader,\n StreamingResourceOptions,\n ResourceStreamItem,\n} from './api';\n\nimport {ValueEqualityFn} from '../../primitives/signals';\n\nimport {Injector} from '../di/injector';\nimport {assertInInjectionContext} from '../di/contextual';\nimport {inject} from '../di/injector_compatibility';\nimport {PendingTasks} from '../pending_tasks';\nimport {linkedSignal} from '../render3/reactivity/linked_signal';\nimport {DestroyRef} from '../linker/destroy_ref';\n\n/**\n * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by\n * a loader function, which exposes the result of the loading operation via signals.\n *\n * Note that `resource` is intended for _read_ operations, not operations which perform mutations.\n * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new\n * request object becomes available, which could prematurely abort mutations.\n *\n * @experimental\n */\nexport function resource<T, R>(\n options: ResourceOptions<T, R> & {defaultValue: NoInfer<T>},\n): ResourceRef<T>;\n\n/**\n * Constructs a `Resource` that projects a reactive request to an asynchronous operation defined by\n * a loader function, which exposes the result of the loading operation via signals.\n *\n * Note that `resource` is intended for _read_ operations, not operations which perform mutations.\n * `resource` will cancel in-progress loads via the `AbortSignal` when destroyed or when a new\n * request object becomes available, which could prematurely abort mutations.\n *\n * @experimental\n */\nexport function resource<T, R>(options: ResourceOptions<T, R>): ResourceRef<T | undefined>;\nexport function resource<T, R>(options: ResourceOptions<T, R>): ResourceRef<T | undefined> {\n options?.injector || assertInInjectionContext(resource);\n const request = (options.request ?? (() => null)) as () => R;\n return new ResourceImpl<T | undefined, R>(\n request,\n getLoader(options),\n options.defaultValue,\n options.equal ? wrapEqualityFn(options.equal) : undefined,\n options.injector ?? inject(Injector),\n );\n}\n\ntype ResourceInternalStatus =\n | ResourceStatus.Idle\n | ResourceStatus.Loading\n | ResourceStatus.Resolved\n | ResourceStatus.Local;\n\n/**\n * Internal state of a resource.\n */\ninterface ResourceProtoState<T> {\n extRequest: WrappedRequest;\n\n // For simplicity, status is internally tracked as a subset of the public status enum.\n // Reloading and Error statuses are projected from Loading and Resolved based on other state.\n status: ResourceInternalStatus;\n}\n\ninterface ResourceState<T> extends ResourceProtoState<T> {\n previousStatus: ResourceStatus;\n stream: Signal<ResourceStreamItem<T>> | undefined;\n}\n\ntype WrappedRequest = {request: unknown; reload: number};\n\n/**\n * Base class which implements `.value` as a `WritableSignal` by delegating `.set` and `.update`.\n */\nabstract class BaseWritableResource<T> implements WritableResource<T> {\n readonly value: WritableSignal<T>;\n abstract readonly status: Signal<ResourceStatus>;\n abstract readonly error: Signal<unknown>;\n abstract reload(): boolean;\n\n constructor(value: Signal<T>) {\n this.value = value as WritableSignal<T>;\n this.value.set = this.set.bind(this);\n this.value.update = this.update.bind(this);\n this.value.asReadonly = signalAsReadonlyFn;\n }\n\n abstract set(value: T): void;\n\n update(updateFn: (value: T) => T): void {\n this.set(updateFn(untracked(this.value)));\n }\n\n readonly isLoading = computed(\n () => this.status() === ResourceStatus.Loading || this.status() === ResourceStatus.Reloading,\n );\n\n hasValue(): this is ResourceRef<Exclude<T, undefined>> {\n return this.value() !== undefined;\n }\n\n asReadonly(): Resource<T> {\n return this;\n }\n}\n\n/**\n * Implementation for `resource()` which uses a `linkedSignal` to manage the resource's state.\n */\nexport class ResourceImpl<T, R> extends BaseWritableResource<T> implements ResourceRef<T> {\n private readonly pendingTasks: PendingTasks;\n\n /**\n * The current state of the resource. Status, value, and error are derived from this.\n */\n private readonly state: WritableSignal<ResourceState<T>>;\n\n /**\n * Combines the current request with a reload counter which allows the resource to be reloaded on\n * imperative command.\n */\n protected readonly extRequest: WritableSignal<WrappedRequest>;\n private readonly effectRef: EffectRef;\n\n private pendingController: AbortController | undefined;\n private resolvePendingTask: (() => void) | undefined = undefined;\n private destroyed = false;\n\n constructor(\n request: () => R,\n private readonly loaderFn: ResourceStreamingLoader<T, R>,\n private readonly defaultValue: T,\n private readonly equal: ValueEqualityFn<T> | undefined,\n injector: Injector,\n ) {\n super(\n // Feed a computed signal for the value to `BaseWritableResource`, which will upgrade it to a\n // `WritableSignal` that delegates to `ResourceImpl.set`.\n computed(\n () => {\n const streamValue = this.state().stream?.();\n return streamValue && isResolved(streamValue) ? streamValue.value : this.defaultValue;\n },\n {equal},\n ),\n );\n\n // Extend `request()` to include a writable reload signal.\n this.extRequest = linkedSignal({\n source: request,\n computation: (request) => ({request, reload: 0}),\n });\n\n // The main resource state is managed in a `linkedSignal`, which allows the resource to change\n // state instantaneously when the request signal changes.\n this.state = linkedSignal<WrappedRequest, ResourceState<T>>({\n // Whenever the request changes,\n source: this.extRequest,\n // Compute the state of the resource given a change in status.\n computation: (extRequest, previous) => {\n const status =\n extRequest.request === undefined ? ResourceStatus.Idle : ResourceStatus.Loading;\n if (!previous) {\n return {\n extRequest,\n status,\n previousStatus: ResourceStatus.Idle,\n stream: undefined,\n };\n } else {\n return {\n extRequest,\n status,\n previousStatus: projectStatusOfState(previous.value),\n // If the request hasn't changed, keep the previous stream.\n stream:\n previous.value.extRequest.request === extRequest.request\n ? previous.value.stream\n : undefined,\n };\n }\n },\n });\n\n this.effectRef = effect(this.loadEffect.bind(this), {\n injector,\n manualCleanup: true,\n });\n\n this.pendingTasks = injector.get(PendingTasks);\n\n // Cancel any pending request when the resource itself is destroyed.\n injector.get(DestroyRef).onDestroy(() => this.destroy());\n }\n\n override readonly status = computed(() => projectStatusOfState(this.state()));\n\n override readonly error = computed(() => {\n const stream = this.state().stream?.();\n return stream && !isResolved(stream) ? stream.error : undefined;\n });\n\n /**\n * Called either directly via `WritableResource.set` or via `.value.set()`.\n */\n override set(value: T): void {\n if (this.destroyed) {\n return;\n }\n\n const current = untracked(this.value);\n const state = untracked(this.state);\n\n if (\n state.status === ResourceStatus.Local &&\n (this.equal ? this.equal(current, value) : current === value)\n ) {\n return;\n }\n\n // Enter Local state with the user-defined value.\n this.state.set({\n extRequest: state.extRequest,\n status: ResourceStatus.Local,\n previousStatus: ResourceStatus.Local,\n stream: signal({value}),\n });\n\n // We're departing from whatever state the resource was in previously, so cancel any in-progress\n // loading operations.\n this.abortInProgressLoad();\n }\n\n override reload(): boolean {\n // We don't want to restart in-progress loads.\n const {status} = untracked(this.state);\n if (status === ResourceStatus.Idle || status === ResourceStatus.Loading) {\n return false;\n }\n\n // Increment the request reload to trigger the `state` linked signal to switch us to `Reload`\n this.extRequest.update(({request, reload}) => ({request, reload: reload + 1}));\n return true;\n }\n\n destroy(): void {\n this.destroyed = true;\n this.effectRef.destroy();\n this.abortInProgressLoad();\n\n // Destroyed resources enter Idle state.\n this.state.set({\n extRequest: {request: undefined, reload: 0},\n status: ResourceStatus.Idle,\n previousStatus: ResourceStatus.Idle,\n stream: undefined,\n });\n }\n\n private async loadEffect(): Promise<void> {\n const extRequest = this.extRequest();\n\n // Capture the previous status before any state transitions. Note that this is `untracked` since\n // we do not want the effect to depend on the state of the resource, only on the request.\n const {status: currentStatus, previousStatus} = untracked(this.state);\n\n if (extRequest.request === undefined) {\n // Nothing to load (and we should already be in a non-loading state).\n return;\n } else if (currentStatus !== ResourceStatus.Loading) {\n // We're not in a loading or reloading state, so this loading request is stale.\n return;\n }\n\n // Cancel any previous loading attempts.\n this.abortInProgressLoad();\n\n // Capturing _this_ load's pending task in a local variable is important here. We may attempt to\n // resolve it twice:\n //\n // 1. when the loading function promise resolves/rejects\n // 2. when cancelling the loading operation\n //\n // After the loading operation is cancelled, `this.resolvePendingTask` no longer represents this\n // particular task, but this `await` may eventually resolve/reject. Thus, when we cancel in\n // response to (1) below, we need to cancel the locally saved task.\n let resolvePendingTask: (() => void) | undefined = (this.resolvePendingTask =\n this.pendingTasks.add());\n\n const {signal: abortSignal} = (this.pendingController = new AbortController());\n\n try {\n // The actual loading is run through `untracked` - only the request side of `resource` is\n // reactive. This avoids any confusion with signals tracking or not tracking depending on\n // which side of the `await` they are.\n const stream = await untracked(() => {\n return this.loaderFn({\n request: extRequest.request as Exclude<R, undefined>,\n abortSignal,\n previous: {\n status: previousStatus,\n },\n });\n });\n\n // If this request has been aborted, or the current request no longer\n // matches this load, then we should ignore this resolution.\n if (abortSignal.aborted || untracked(this.extRequest) !== extRequest) {\n return;\n }\n\n this.state.set({\n extRequest,\n status: ResourceStatus.Resolved,\n previousStatus: ResourceStatus.Resolved,\n stream,\n });\n } catch (err) {\n if (abortSignal.aborted || untracked(this.extRequest) !== extRequest) {\n return;\n }\n\n this.state.set({\n extRequest,\n status: ResourceStatus.Resolved,\n previousStatus: ResourceStatus.Error,\n stream: signal({error: err}),\n });\n } finally {\n // Resolve the pending task now that the resource has a value.\n resolvePendingTask?.();\n resolvePendingTask = undefined;\n }\n }\n\n private abortInProgressLoad(): void {\n untracked(() => this.pendingController?.abort());\n this.pendingController = undefined;\n\n // Once the load is aborted, we no longer want to block stability on its resolution.\n this.resolvePendingTask?.();\n this.resolvePendingTask = undefined;\n }\n}\n\n/**\n * Wraps an equality function to handle either value being `undefined`.\n */\nfunction wrapEqualityFn<T>(equal: ValueEqualityFn<T>): ValueEqualityFn<T | undefined> {\n return (a, b) => (a === undefined || b === undefined ? a === b : equal(a, b));\n}\n\nfunction getLoader<T, R>(options: ResourceOptions<T, R>): ResourceStreamingLoader<T, R> {\n if (isStreamingResourceOptions(options)) {\n return options.stream;\n }\n\n return async (params) => {\n try {\n return signal({value: await options.loader(params)});\n } catch (err) {\n return signal({error: err});\n }\n };\n}\n\nfunction isStreamingResourceOptions<T, R>(\n options: ResourceOptions<T, R>,\n): options is StreamingResourceOptions<T, R> {\n return !!(options as StreamingResourceOptions<T, R>).stream;\n}\n\n/**\n * Project from a state with `ResourceInternalStatus` to the user-facing `ResourceStatus`\n */\nfunction projectStatusOfState(state: ResourceState<unknown>): ResourceStatus {\n switch (state.status) {\n case ResourceStatus.Loading:\n return state.extRequest.reload === 0 ? ResourceStatus.Loading : ResourceStatus.Reloading;\n case ResourceStatus.Resolved:\n return isResolved(untracked(state.stream!)) ? ResourceStatus.Resolved : ResourceStatus.Error;\n default:\n return state.status;\n }\n}\n\nfunction isResolved<T>(state: ResourceStreamItem<T>): state is {value: T} {\n return (state as {error: unknown}).error === undefined;\n}\n"],"names":["untrackedPrimitive"],"mappings":";;;;;;;;;;AAiBA;;;;;;;;;;;;AAYG;MACU,gBAAgB,CAAA;IACnB,SAAS,GAAG,KAAK;IACjB,SAAS,GAAqC,IAAI;IAClD,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;AAG7D,IAAA,UAAU,GAAe,MAAM,CAAC,UAAU,CAAC;AAE3C,IAAA,WAAA,GAAA;;AAEE,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;AAC7B,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;AACrB,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;AACvB,SAAC,CAAC;;AAGJ,IAAA,SAAS,CAAC,QAA4B,EAAA;AACpC,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,IAAI,YAAY,CAAA,GAAA,8CAEpB,SAAS;gBACP,oDAAoD;AAClD,oBAAA,8CAA8C,CACnD;;QAGH,CAAC,IAAI,CAAC,SAAS,KAAK,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC;QAEtC,OAAO;YACL,WAAW,EAAE,MAAK;gBAChB,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC;gBAC7C,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE,EAAE;oBACnC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;;aAEjC;SACF;;;AAIH,IAAA,IAAI,CAAC,KAAQ,EAA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AACxD;;;;"}
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.5
2
+ * @license Angular v20.0.0-next.7
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { getCurrentInjector, isNotFound, setCurrentInjector } from './primitives/di.mjs';
8
+ import { getActiveConsumer, SIGNAL, createSignal, signalSetFn, signalUpdateFn } from './signal-B6pMq7KS.mjs';
9
+ import { BehaviorSubject, Observable } from 'rxjs';
8
10
  import { NotFoundError, isNotFound as isNotFound$1 } from '@angular/core/primitives/di';
9
11
  import { setActiveConsumer } from '@angular/core/primitives/signals';
10
- import { h as getActiveConsumer, S as SIGNAL, v as createSignal, z as signalSetFn, A as signalUpdateFn } from './signal-DhRAAi7R.mjs';
11
- import { BehaviorSubject, Observable } from 'rxjs';
12
12
 
13
13
  /**
14
14
  * Base URL for the error details page.
@@ -436,7 +436,7 @@ function ɵɵdefineInjector(options) {
436
436
  * @param type A type which may have its own (non-inherited) `ɵprov`.
437
437
  */
438
438
  function getInjectableDef(type) {
439
- return getOwnDefinition(type, NG_PROV_DEF) || getOwnDefinition(type, NG_INJECTABLE_DEF);
439
+ return getOwnDefinition(type, NG_PROV_DEF);
440
440
  }
441
441
  function isInjectable(type) {
442
442
  return getInjectableDef(type) !== null;
@@ -446,7 +446,8 @@ function isInjectable(type) {
446
446
  * class of `type`.
447
447
  */
448
448
  function getOwnDefinition(type, field) {
449
- return type.hasOwnProperty(field) ? type[field] : null;
449
+ // if the ɵprov prop exist but is undefined we still want to return null
450
+ return (type.hasOwnProperty(field) && type[field]) || null;
450
451
  }
451
452
  /**
452
453
  * Read the injectable def (`ɵprov`) for `type` or read the `ɵprov` from one of its ancestors.
@@ -457,7 +458,8 @@ function getOwnDefinition(type, field) {
457
458
  * scenario if we find the `ɵprov` on an ancestor only.
458
459
  */
459
460
  function getInheritedInjectableDef(type) {
460
- const def = type && (type[NG_PROV_DEF] || type[NG_INJECTABLE_DEF]);
461
+ // if the ɵprov prop exist but is undefined we still want to return null
462
+ const def = type?.[NG_PROV_DEF] ?? null;
461
463
  if (def) {
462
464
  ngDevMode &&
463
465
  console.warn(`DEPRECATED: DI is instantiating a token "${type.name}" that inherits its @Injectable decorator but does not provide one itself.\n` +
@@ -474,15 +476,10 @@ function getInheritedInjectableDef(type) {
474
476
  * @param type type which may have an injector def (`ɵinj`)
475
477
  */
476
478
  function getInjectorDef(type) {
477
- return type && (type.hasOwnProperty(NG_INJ_DEF) || type.hasOwnProperty(NG_INJECTOR_DEF))
478
- ? type[NG_INJ_DEF]
479
- : null;
479
+ return type && type.hasOwnProperty(NG_INJ_DEF) ? type[NG_INJ_DEF] : null;
480
480
  }
481
481
  const NG_PROV_DEF = getClosureSafeProperty({ ɵprov: getClosureSafeProperty });
482
482
  const NG_INJ_DEF = getClosureSafeProperty({ ɵinj: getClosureSafeProperty });
483
- // We need to keep these around so we can read off old defs if new defs are unavailable
484
- const NG_INJECTABLE_DEF = getClosureSafeProperty({ ngInjectableDef: getClosureSafeProperty });
485
- const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafeProperty });
486
483
 
487
484
  /**
488
485
  * Creates a token that can be used in a DI Provider.
@@ -583,21 +580,40 @@ function setInjectorProfilerContext(context) {
583
580
  _injectorProfilerContext = context;
584
581
  return previous;
585
582
  }
586
- let injectorProfilerCallback = null;
583
+ const injectorProfilerCallbacks = [];
584
+ const NOOP_PROFILER_REMOVAL = () => { };
585
+ function removeProfiler(profiler) {
586
+ const profilerIdx = injectorProfilerCallbacks.indexOf(profiler);
587
+ if (profilerIdx !== -1) {
588
+ injectorProfilerCallbacks.splice(profilerIdx, 1);
589
+ }
590
+ }
587
591
  /**
588
- * Sets the callback function which will be invoked during certain DI events within the
589
- * runtime (for example: injecting services, creating injectable instances, configuring providers)
592
+ * Adds a callback function which will be invoked during certain DI events within the
593
+ * runtime (for example: injecting services, creating injectable instances, configuring providers).
594
+ * Multiple profiler callbacks can be set: in this case profiling events are
595
+ * reported to every registered callback.
590
596
  *
591
597
  * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
592
598
  * The contract of the function might be changed in any release and/or the function can be removed
593
599
  * completely.
594
600
  *
595
601
  * @param profiler function provided by the caller or null value to disable profiling.
602
+ * @returns a cleanup function that, when invoked, removes a given profiler callback.
596
603
  */
597
- const setInjectorProfiler = (injectorProfiler) => {
604
+ function setInjectorProfiler(injectorProfiler) {
598
605
  !ngDevMode && throwError('setInjectorProfiler should never be called in production mode');
599
- injectorProfilerCallback = injectorProfiler;
600
- };
606
+ if (injectorProfiler !== null) {
607
+ if (!injectorProfilerCallbacks.includes(injectorProfiler)) {
608
+ injectorProfilerCallbacks.push(injectorProfiler);
609
+ }
610
+ return () => removeProfiler(injectorProfiler);
611
+ }
612
+ else {
613
+ injectorProfilerCallbacks.length = 0;
614
+ return NOOP_PROFILER_REMOVAL;
615
+ }
616
+ }
601
617
  /**
602
618
  * Injector profiler function which emits on DI events executed by the runtime.
603
619
  *
@@ -605,7 +621,8 @@ const setInjectorProfiler = (injectorProfiler) => {
605
621
  */
606
622
  function injectorProfiler(event) {
607
623
  !ngDevMode && throwError('Injector profiler should never be called in production mode');
608
- if (injectorProfilerCallback != null /* both `null` and `undefined` */) {
624
+ for (let i = 0; i < injectorProfilerCallbacks.length; i++) {
625
+ const injectorProfilerCallback = injectorProfilerCallbacks[i];
609
626
  injectorProfilerCallback(event);
610
627
  }
611
628
  }
@@ -3391,55 +3408,13 @@ class Injector {
3391
3408
  }
3392
3409
 
3393
3410
  /**
3394
- * Provides a hook for centralized exception handling.
3395
- *
3396
- * The default implementation of `ErrorHandler` prints error messages to the `console`. To
3397
- * intercept error handling, write a custom exception handler that replaces this default as
3398
- * appropriate for your app.
3399
- *
3400
- * @usageNotes
3401
- * ### Example
3402
- *
3403
- * ```ts
3404
- * class MyErrorHandler implements ErrorHandler {
3405
- * handleError(error) {
3406
- * // do something with the exception
3407
- * }
3408
- * }
3409
- *
3410
- * // Provide in standalone apps
3411
- * bootstrapApplication(AppComponent, {
3412
- * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
3413
- * })
3414
- *
3415
- * // Provide in module-based apps
3416
- * @NgModule({
3417
- * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
3418
- * })
3419
- * class MyModule {}
3420
- * ```
3411
+ * A DI Token representing the main rendering context.
3412
+ * In a browser and SSR this is the DOM Document.
3413
+ * When using SSR, that document is created by [Domino](https://github.com/angular/domino).
3421
3414
  *
3422
3415
  * @publicApi
3423
3416
  */
3424
- class ErrorHandler {
3425
- /**
3426
- * @internal
3427
- */
3428
- _console = console;
3429
- handleError(error) {
3430
- this._console.error('ERROR', error);
3431
- }
3432
- }
3433
- /**
3434
- * `InjectionToken` used to configure how to call the `ErrorHandler`.
3435
- */
3436
- const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'internal error handler' : '', {
3437
- providedIn: 'root',
3438
- factory: () => {
3439
- const userErrorHandler = inject(ErrorHandler);
3440
- return (e) => userErrorHandler.handleError(e);
3441
- },
3442
- });
3417
+ const DOCUMENT = new InjectionToken(ngDevMode ? 'DocumentToken' : '');
3443
3418
 
3444
3419
  /**
3445
3420
  * `DestroyRef` lets you set callbacks to run for any cleanup or destruction behavior.
@@ -3494,6 +3469,107 @@ function injectDestroyRef() {
3494
3469
  return new NodeInjectorDestroyRef(getLView());
3495
3470
  }
3496
3471
 
3472
+ /**
3473
+ * Provides a hook for centralized exception handling.
3474
+ *
3475
+ * The default implementation of `ErrorHandler` prints error messages to the `console`. To
3476
+ * intercept error handling, write a custom exception handler that replaces this default as
3477
+ * appropriate for your app.
3478
+ *
3479
+ * @usageNotes
3480
+ * ### Example
3481
+ *
3482
+ * ```ts
3483
+ * class MyErrorHandler implements ErrorHandler {
3484
+ * handleError(error) {
3485
+ * // do something with the exception
3486
+ * }
3487
+ * }
3488
+ *
3489
+ * // Provide in standalone apps
3490
+ * bootstrapApplication(AppComponent, {
3491
+ * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
3492
+ * })
3493
+ *
3494
+ * // Provide in module-based apps
3495
+ * @NgModule({
3496
+ * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]
3497
+ * })
3498
+ * class MyModule {}
3499
+ * ```
3500
+ *
3501
+ * @publicApi
3502
+ */
3503
+ class ErrorHandler {
3504
+ /**
3505
+ * @internal
3506
+ */
3507
+ _console = console;
3508
+ handleError(error) {
3509
+ this._console.error('ERROR', error);
3510
+ }
3511
+ }
3512
+ /**
3513
+ * `InjectionToken` used to configure how to call the `ErrorHandler`.
3514
+ */
3515
+ const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'internal error handler' : '', {
3516
+ providedIn: 'root',
3517
+ factory: () => {
3518
+ // The user's error handler may depend on things that create a circular dependency
3519
+ // so we inject it lazily.
3520
+ const injector = inject(EnvironmentInjector);
3521
+ let userErrorHandler;
3522
+ return (e) => {
3523
+ userErrorHandler ??= injector.get(ErrorHandler);
3524
+ userErrorHandler.handleError(e);
3525
+ };
3526
+ },
3527
+ });
3528
+ const errorHandlerEnvironmentInitializer = {
3529
+ provide: ENVIRONMENT_INITIALIZER,
3530
+ useValue: () => void inject(ErrorHandler),
3531
+ multi: true,
3532
+ };
3533
+ const globalErrorListeners = new InjectionToken(ngDevMode ? 'GlobalErrorListeners' : '', {
3534
+ providedIn: 'root',
3535
+ factory: () => {
3536
+ if (typeof ngServerMode !== 'undefined' && ngServerMode) {
3537
+ return;
3538
+ }
3539
+ const window = inject(DOCUMENT).defaultView;
3540
+ if (!window) {
3541
+ return;
3542
+ }
3543
+ const errorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);
3544
+ const rejectionListener = (e) => {
3545
+ errorHandler(e.reason);
3546
+ e.preventDefault();
3547
+ };
3548
+ const errorListener = (e) => {
3549
+ errorHandler(e.error);
3550
+ e.preventDefault();
3551
+ };
3552
+ window.addEventListener('unhandledrejection', rejectionListener);
3553
+ window.addEventListener('error', errorListener);
3554
+ inject(DestroyRef).onDestroy(() => {
3555
+ window.removeEventListener('error', errorListener);
3556
+ window.removeEventListener('unhandledrejection', rejectionListener);
3557
+ });
3558
+ },
3559
+ });
3560
+ /**
3561
+ * Provides an environment initializer which forwards unhandled errors to the ErrorHandler.
3562
+ *
3563
+ * The listeners added are for the window's 'unhandledrejection' and 'error' events.
3564
+ *
3565
+ * @publicApi
3566
+ */
3567
+ function provideBrowserGlobalErrorListeners() {
3568
+ return makeEnvironmentProviders([
3569
+ provideEnvironmentInitializer(() => void inject(globalErrorListeners)),
3570
+ ]);
3571
+ }
3572
+
3497
3573
  /**
3498
3574
  * Checks if the given `value` is a reactive `Signal`.
3499
3575
  */
@@ -3672,7 +3748,6 @@ class PendingTasksInternal {
3672
3748
  * ```
3673
3749
  *
3674
3750
  * @publicApi
3675
- * @developerPreview
3676
3751
  */
3677
3752
  class PendingTasks {
3678
3753
  internalPendingTasks = inject(PendingTasksInternal);
@@ -3705,6 +3780,7 @@ class PendingTasks {
3705
3780
  * ```
3706
3781
  *
3707
3782
  * @param fn The asynchronous function to execute
3783
+ * @developerPreview
3708
3784
  */
3709
3785
  run(fn) {
3710
3786
  const removeTask = this.add();
@@ -3812,5 +3888,5 @@ class ZoneAwareEffectScheduler {
3812
3888
  }
3813
3889
  }
3814
3890
 
3815
- export { CLEANUP as $, runInInjectionContext as A, EnvironmentInjector as B, ChangeDetectionScheduler as C, DestroyRef as D, ErrorHandler as E, FLAGS as F, getCurrentTNode as G, assertNgModuleType as H, Injector as I, PROVIDED_ZONELESS as J, ɵɵinject as K, makeEnvironmentProviders as L, INJECTOR_SCOPE as M, NodeInjectorDestroyRef as N, ENVIRONMENT_INITIALIZER as O, PendingTasks as P, CheckNoChangesMode as Q, RuntimeError as R, isComponentHost as S, getComponentLViewByIndex as T, DECLARATION_COMPONENT_VIEW as U, ViewContext as V, getLView as W, ɵɵdefineInjector as X, unwrapRNode as Y, ZONELESS_ENABLED as Z, _global as _, assertInInjectionContext as a, throwProviderNotFoundError as a$, isLContainer as a0, unwrapLView as a1, hasI18n as a2, RENDERER as a3, HOST as a4, getComponentDef as a5, assertTNode as a6, isProjectionTNode as a7, PARENT as a8, CONTEXT as a9, ɵɵrestoreView as aA, isSignal as aB, ɵunwrapWritableSignal as aC, attachInjectFlag as aD, newArray as aE, assertString as aF, EMPTY_OBJ as aG, assertFirstCreatePass as aH, assertDefined as aI, assertNotEqual as aJ, assertEqual as aK, isInCheckNoChangesMode as aL, PREORDER_HOOK_FLAGS as aM, throwError as aN, assertNumber as aO, assertGreaterThan as aP, DECLARATION_VIEW as aQ, throwCyclicDependencyError as aR, stringifyForError as aS, setInjectImplementation as aT, enterDI as aU, emitInjectorToCreateInstanceEvent as aV, emitInstanceCreatedByInjectorEvent as aW, assertDirectiveDef as aX, leaveDI as aY, assertTNodeForLView as aZ, runInInjectorProfilerContext as a_, HEADER_OFFSET as aa, TVIEW as ab, isRootView as ac, isLView as ad, getTNode as ae, getNullInjector as af, isStandalone as ag, defineInjectable as ah, forwardRef as ai, importProvidersFrom as aj, provideEnvironmentInitializer as ak, ɵɵinvalidFactoryDep as al, INJECTOR$1 as am, convertToBitFlags as an, XSS_SECURITY_URL as ao, truncateMiddle as ap, NG_PROV_DEF as aq, isInjectable as ar, createInjector as as, NG_ELEMENT_ID as at, ɵɵdisableBindings as au, ɵɵenableBindings as av, ɵɵnamespaceHTML as aw, ɵɵnamespaceMathML as ax, ɵɵnamespaceSVG as ay, ɵɵresetView as az, assertNotInReactiveContext as b, requiresRefreshOrTraversal as b$, assertNodeInjector as b0, injectRootLimpMode as b1, assertIndexInRange as b2, EMBEDDED_VIEW_INJECTOR as b3, T_HOST as b4, INJECTOR as b5, isComponentDef as b6, NG_FACTORY_DEF as b7, isForwardRef as b8, getFactoryDef as b9, resetPreOrderHookFlags as bA, HYDRATION as bB, CHILD_TAIL as bC, assertSame as bD, assertFirstUpdatePass as bE, getSelectedIndex as bF, getTView as bG, setSelectedIndex as bH, assertNotSame as bI, setCurrentDirectiveIndex as bJ, getCurrentDirectiveIndex as bK, assertNotReactive as bL, enterView as bM, QUERIES as bN, leaveView as bO, isCreationMode as bP, DECLARATION_LCONTAINER as bQ, MOVED_VIEWS as bR, NATIVE as bS, assertProjectionSlots as bT, assertParentView as bU, REACTIVE_TEMPLATE_CONSUMER as bV, ON_DESTROY_HOOKS as bW, assertFunction as bX, markViewForRefresh as bY, setIsInCheckNoChangesMode as bZ, isExhaustiveCheckNoChanges as b_, getClosureSafeProperty as ba, getNativeByTNode as bb, flatten as bc, arrayEquals as bd, ID as be, assertDomNode as bf, EMPTY_ARRAY as bg, assertLView as bh, getLViewParent as bi, CHILD_HEAD as bj, NEXT as bk, getDirectiveDef as bl, isInInjectionContext as bm, AFTER_RENDER_SEQUENCES_TO_ADD as bn, assertIndexInDeclRange as bo, isDestroyed as bp, removeLViewOnDestroy as bq, storeLViewOnDestroy as br, walkUpViews as bs, assertLContainer as bt, getNativeByIndex as bu, assertElement as bv, isContentQueryHost as bw, setCurrentQueryIndex as bx, renderStringify as by, ENVIRONMENT as bz, EffectScheduler as c, getNamespace as c$, setBindingIndex as c0, EFFECTS_TO_SCHEDULE as c1, setBindingRootForHostBindings as c2, viewAttachedToChangeDetector as c3, isRefreshingViews as c4, removeFromArray as c5, addToArray as c6, updateAncestorTraversalFlagsOnAttach as c7, VIEW_REFS as c8, assertGreaterThanOrEqual as c9, MATH_ML_NAMESPACE as cA, viewAttachedToContainer as cB, storeCleanupWithContext as cC, createInjectorWithoutInjectorInstances as cD, R3Injector as cE, internalImportProvidersFrom as cF, initNgDevMode as cG, fillProperties as cH, wasLastNodeCreated as cI, getBindingsEnabled as cJ, lastNodeWasCreated as cK, arrayInsert2 as cL, arraySplice as cM, setInjectorProfiler as cN, NullInjector as cO, INJECTOR_DEF_TYPES as cP, walkProviderTree as cQ, getInjectorDef as cR, deepForEach as cS, incrementBindingIndex as cT, getBindingIndex as cU, keyValueArrayIndexOf as cV, keyValueArrayGet as cW, getCurrentDirectiveDef as cX, keyValueArraySet as cY, assertHasParent as cZ, getElementDepthCount as c_, isInI18nBlock as ca, getCurrentParentTNode as cb, assertTNodeForTView as cc, setCurrentTNode as cd, getCurrentTNodePlaceholderOk as ce, isCurrentTNodeParent as cf, isInSkipHydrationBlock as cg, assertTIcu as ch, assertNumberInRange as ci, DEHYDRATED_VIEWS as cj, getNgModuleDef as ck, getPipeDef as cl, concatStringsWithSpace as cm, assertInjectImplementationNotEqual as cn, emitInjectEvent as co, getConstant as cp, assertLessThan as cq, getOrCreateTViewCleanup as cr, getOrCreateLViewCleanup as cs, isDirectiveHost as ct, assertNotDefined as cu, getSelectedTNode as cv, nextBindingIndex as cw, debugStringifyTypeForError as cx, assertComponentType as cy, SVG_NAMESPACE as cz, setInjectorProfilerContext as d, enterSkipHydrationBlock as d0, increaseElementDepthCount as d1, setCurrentTNodeAsNotParent as d2, isSkipHydrationRootTNode as d3, leaveSkipHydrationBlock as d4, decreaseElementDepthCount as d5, assertIndexInExpandoRange as d6, assertOneOf as d7, setInI18nBlock as d8, nextContextImpl as d9, getCurrentQueryIndex as da, getContextLView as db, load as dc, isWritableSignal as dd, isTypeProvider as de, providerToFactory as df, emitProviderConfiguredEvent as dg, isClassProvider as dh, getBindingRoot as di, ZONELESS_SCHEDULER_DISABLED as dj, SCHEDULE_IN_ROOT_ZONE as dk, getNativeByTNodeOrNull as dl, emitEffectCreatedEvent as e, formatRuntimeError as f, EFFECTS as g, setIsRefreshingViews as h, inject as i, InjectionToken as j, signalAsReadonlyFn as k, CONTAINER_HEADER_OFFSET as l, markAncestorsForTraversal as m, noop as n, PendingTasksInternal as o, stringify as p, getInjectableDef as q, resolveForwardRef as r, signal as s, NG_COMP_DEF as t, NG_DIR_DEF as u, NG_PIPE_DEF as v, NG_INJ_DEF as w, NG_MOD_DEF as x, INTERNAL_APPLICATION_ERROR_HANDLER as y, isEnvironmentProviders as z, ɵɵdefineInjectable as ɵ };
3816
- //# sourceMappingURL=root_effect_scheduler-D0_b1cf_.mjs.map
3891
+ export { AFTER_RENDER_SEQUENCES_TO_ADD, CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTAINER_HEADER_OFFSET, CONTEXT, ChangeDetectionScheduler, CheckNoChangesMode, DECLARATION_COMPONENT_VIEW, DECLARATION_LCONTAINER, DECLARATION_VIEW, DEHYDRATED_VIEWS, DOCUMENT, DestroyRef, EFFECTS, EFFECTS_TO_SCHEDULE, EMBEDDED_VIEW_INJECTOR, EMPTY_ARRAY, EMPTY_OBJ, ENVIRONMENT, ENVIRONMENT_INITIALIZER, EffectScheduler, EnvironmentInjector, ErrorHandler, FLAGS, HEADER_OFFSET, HOST, HYDRATION, ID, INJECTOR$1 as INJECTOR, INJECTOR as INJECTOR$1, INJECTOR_DEF_TYPES, INJECTOR_SCOPE, INTERNAL_APPLICATION_ERROR_HANDLER, InjectionToken, Injector, MATH_ML_NAMESPACE, MOVED_VIEWS, NATIVE, NEXT, NG_COMP_DEF, NG_DIR_DEF, NG_ELEMENT_ID, NG_FACTORY_DEF, NG_INJ_DEF, NG_MOD_DEF, NG_PIPE_DEF, NG_PROV_DEF, NodeInjectorDestroyRef, NullInjector, ON_DESTROY_HOOKS, PARENT, PREORDER_HOOK_FLAGS, PROVIDED_ZONELESS, PendingTasks, PendingTasksInternal, QUERIES, R3Injector, REACTIVE_TEMPLATE_CONSUMER, RENDERER, RuntimeError, SCHEDULE_IN_ROOT_ZONE, SVG_NAMESPACE, TVIEW, T_HOST, VIEW_REFS, ViewContext, XSS_SECURITY_URL, ZONELESS_ENABLED, ZONELESS_SCHEDULER_DISABLED, _global, addToArray, arrayEquals, arrayInsert2, arraySplice, assertComponentType, assertDefined, assertDirectiveDef, assertDomNode, assertElement, assertEqual, assertFirstCreatePass, assertFirstUpdatePass, assertFunction, assertGreaterThan, assertGreaterThanOrEqual, assertHasParent, assertInInjectionContext, assertIndexInDeclRange, assertIndexInExpandoRange, assertIndexInRange, assertInjectImplementationNotEqual, assertLContainer, assertLView, assertLessThan, assertNgModuleType, assertNodeInjector, assertNotDefined, assertNotEqual, assertNotInReactiveContext, assertNotReactive, assertNotSame, assertNumber, assertNumberInRange, assertOneOf, assertParentView, assertProjectionSlots, assertSame, assertString, assertTIcu, assertTNode, assertTNodeForLView, assertTNodeForTView, attachInjectFlag, concatStringsWithSpace, convertToBitFlags, createInjector, createInjectorWithoutInjectorInstances, debugStringifyTypeForError, decreaseElementDepthCount, deepForEach, defineInjectable, emitEffectCreatedEvent, emitInjectEvent, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, emitProviderConfiguredEvent, enterDI, enterSkipHydrationBlock, enterView, errorHandlerEnvironmentInitializer, fillProperties, flatten, formatRuntimeError, forwardRef, getBindingIndex, getBindingRoot, getBindingsEnabled, getClosureSafeProperty, getComponentDef, getComponentLViewByIndex, getConstant, getContextLView, getCurrentDirectiveDef, getCurrentDirectiveIndex, getCurrentParentTNode, getCurrentQueryIndex, getCurrentTNode, getCurrentTNodePlaceholderOk, getDirectiveDef, getElementDepthCount, getFactoryDef, getInjectableDef, getInjectorDef, getLView, getLViewParent, getNamespace, getNativeByIndex, getNativeByTNode, getNativeByTNodeOrNull, getNgModuleDef, getNullInjector, getOrCreateLViewCleanup, getOrCreateTViewCleanup, getPipeDef, getSelectedIndex, getSelectedTNode, getTNode, getTView, hasI18n, importProvidersFrom, increaseElementDepthCount, incrementBindingIndex, initNgDevMode, inject, injectRootLimpMode, internalImportProvidersFrom, isClassProvider, isComponentDef, isComponentHost, isContentQueryHost, isCreationMode, isCurrentTNodeParent, isDestroyed, isDirectiveHost, isEnvironmentProviders, isExhaustiveCheckNoChanges, isForwardRef, isInCheckNoChangesMode, isInI18nBlock, isInInjectionContext, isInSkipHydrationBlock, isInjectable, isLContainer, isLView, isProjectionTNode, isRefreshingViews, isRootView, isSignal, isSkipHydrationRootTNode, isStandalone, isTypeProvider, isWritableSignal, keyValueArrayGet, keyValueArrayIndexOf, keyValueArraySet, lastNodeWasCreated, leaveDI, leaveSkipHydrationBlock, leaveView, load, makeEnvironmentProviders, markAncestorsForTraversal, markViewForRefresh, newArray, nextBindingIndex, nextContextImpl, noop, provideBrowserGlobalErrorListeners, provideEnvironmentInitializer, providerToFactory, removeFromArray, removeLViewOnDestroy, renderStringify, requiresRefreshOrTraversal, resetPreOrderHookFlags, resolveForwardRef, runInInjectionContext, runInInjectorProfilerContext, setBindingIndex, setBindingRootForHostBindings, setCurrentDirectiveIndex, setCurrentQueryIndex, setCurrentTNode, setCurrentTNodeAsNotParent, setInI18nBlock, setInjectImplementation, setInjectorProfiler, setInjectorProfilerContext, setIsInCheckNoChangesMode, setIsRefreshingViews, setSelectedIndex, signal, signalAsReadonlyFn, storeCleanupWithContext, storeLViewOnDestroy, stringify, stringifyForError, throwCyclicDependencyError, throwError, throwProviderNotFoundError, truncateMiddle, unwrapLView, unwrapRNode, updateAncestorTraversalFlagsOnAttach, viewAttachedToChangeDetector, viewAttachedToContainer, walkProviderTree, walkUpViews, wasLastNodeCreated, ɵunwrapWritableSignal, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdisableBindings, ɵɵenableBindings, ɵɵinject, ɵɵinvalidFactoryDep, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵresetView, ɵɵrestoreView };
3892
+ //# sourceMappingURL=root_effect_scheduler-BK3l7wIO.mjs.map