@angular/core 16.0.0-next.6 → 16.0.0-rc.0

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 (62) hide show
  1. package/esm2022/rxjs-interop/src/index.mjs +3 -3
  2. package/esm2022/rxjs-interop/src/to_observable.mjs +39 -0
  3. package/esm2022/rxjs-interop/src/to_signal.mjs +52 -0
  4. package/esm2022/src/application_ref.mjs +3 -5
  5. package/esm2022/src/application_tokens.mjs +11 -1
  6. package/esm2022/src/change_detection/differs/iterable_differs.mjs +1 -1
  7. package/esm2022/src/core_private_export.mjs +3 -3
  8. package/esm2022/src/di/index.mjs +1 -4
  9. package/esm2022/src/errors.mjs +1 -1
  10. package/esm2022/src/hydration/annotate.mjs +45 -34
  11. package/esm2022/src/hydration/api.mjs +52 -55
  12. package/esm2022/src/hydration/error_handling.mjs +8 -24
  13. package/esm2022/src/initial_render_pending_tasks.mjs +10 -10
  14. package/esm2022/src/linker/query_list.mjs +1 -5
  15. package/esm2022/src/linker/view_ref.mjs +1 -1
  16. package/esm2022/src/metadata/ng_module.mjs +1 -2
  17. package/esm2022/src/render3/component_ref.mjs +9 -7
  18. package/esm2022/src/render3/di.mjs +3 -3
  19. package/esm2022/src/render3/hooks.mjs +35 -31
  20. package/esm2022/src/render3/instructions/i18n.mjs +14 -2
  21. package/esm2022/src/render3/instructions/mark_view_dirty.mjs +1 -1
  22. package/esm2022/src/render3/instructions/shared.mjs +29 -20
  23. package/esm2022/src/render3/interfaces/type_checks.mjs +1 -1
  24. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  25. package/esm2022/src/render3/node_manipulation.mjs +9 -9
  26. package/esm2022/src/render3/pipe.mjs +2 -2
  27. package/esm2022/src/render3/reactivity/effect.mjs +1 -1
  28. package/esm2022/src/render3/util/discovery_utils.mjs +1 -1
  29. package/esm2022/src/render3/util/view_traversal_utils.mjs +1 -1
  30. package/esm2022/src/render3/util/view_utils.mjs +2 -2
  31. package/esm2022/src/render3/view_ref.mjs +4 -4
  32. package/esm2022/src/sanitization/url_sanitizer.mjs +7 -6
  33. package/esm2022/src/signals/index.mjs +4 -4
  34. package/esm2022/src/signals/src/graph.mjs +4 -1
  35. package/esm2022/src/signals/src/signal.mjs +15 -1
  36. package/esm2022/src/signals/src/watch.mjs +6 -2
  37. package/esm2022/src/signals/src/weak_ref.mjs +4 -1
  38. package/esm2022/src/util/decorators.mjs +6 -1
  39. package/esm2022/src/version.mjs +1 -1
  40. package/esm2022/testing/src/fake_async.mjs +2 -2
  41. package/esm2022/testing/src/logger.mjs +3 -3
  42. package/esm2022/testing/src/ng_zone_mock.mjs +3 -3
  43. package/fesm2022/core.mjs +8836 -9558
  44. package/fesm2022/core.mjs.map +1 -1
  45. package/fesm2022/rxjs-interop.mjs +704 -56
  46. package/fesm2022/rxjs-interop.mjs.map +1 -1
  47. package/fesm2022/testing.mjs +7918 -8641
  48. package/fesm2022/testing.mjs.map +1 -1
  49. package/index.d.ts +61 -424
  50. package/package.json +2 -2
  51. package/rxjs-interop/index.d.ts +53 -46
  52. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +13 -13
  53. package/schematics/migrations/remove-module-id/bundle.js +14 -14
  54. package/schematics/ng-generate/standalone-migration/bundle.js +5323 -3817
  55. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  56. package/testing/index.d.ts +2 -2
  57. package/esm2022/rxjs-interop/src/from_observable.mjs +0 -46
  58. package/esm2022/rxjs-interop/src/from_signal.mjs +0 -36
  59. package/esm2022/src/di/reflective_errors.mjs +0 -217
  60. package/esm2022/src/di/reflective_injector.mjs +0 -311
  61. package/esm2022/src/di/reflective_key.mjs +0 -73
  62. package/esm2022/src/di/reflective_provider.mjs +0 -209
@@ -1 +1 @@
1
- {"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../../packages/core/rxjs-interop/src/from_observable.ts","../../../../../../packages/core/rxjs-interop/src/from_signal.ts","../../../../../../packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../../packages/core/rxjs-interop/rxjs-interop.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.io/license\n */\n\nimport {assertInInjectionContext, computed, DestroyRef, inject, signal, Signal, WritableSignal} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `fromObservable` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * The subscription will last for the lifetime of the current injection context. That is, if\n * `fromObservable` is called from a component context, the subscription will be cleaned up when the\n * component is destroyed. When called outside of a component, the current `EnvironmentInjector`'s\n * lifetime will be used (which is typically the lifetime of the application itself).\n *\n * If the `Observable` does not produce a value before the `Signal` is read, the `Signal` will throw\n * an error. To avoid this, use a synchronous `Observable` (potentially created with the `startWith`\n * operator) or pass an initial value to `fromObservable` as the second argument.\n *\n * `fromObservable` must be called in an injection context.\n */\nexport function fromObservable<T>(source: Observable<T>): Signal<T>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `fromObservable` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * The subscription will last for the lifetime of the current injection context. That is, if\n * `fromObservable` is called from a component context, the subscription will be cleaned up when the\n * component is destroyed. When called outside of a component, the current `EnvironmentInjector`'s\n * lifetime will be used (which is typically the lifetime of the application itself).\n *\n * Before the `Observable` emits its first value, the `Signal` will return the configured\n * `initialValue`. If the `Observable` is known to produce a value before the `Signal` will be read,\n * `initialValue` does not need to be passed.\n *\n * `fromObservable` must be called in an injection context.\n *\n * @developerPreview\n */\nexport function fromObservable<T, U extends T|null|undefined>(\n // fromObservable(Observable<Animal>) -> Signal<Cat>\n source: Observable<T>, initialValue: U): Signal<T|U>;\nexport function fromObservable<T, U = never>(source: Observable<T>, initialValue?: U): Signal<T|U> {\n assertInInjectionContext(fromObservable);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T|U>>;\n if (initialValue === undefined && arguments.length !== 2) {\n // No initial value was passed, so initially the signal is in a `NoValue` state and will throw\n // if accessed.\n state = signal({kind: StateKind.NoValue});\n } else {\n // An initial value was passed, so use it.\n state = signal<State<T|U>>({kind: StateKind.Value, value: initialValue!});\n }\n\n const sub = source.subscribe({\n next: value => state.set({kind: StateKind.Value, value}),\n error: error => state.set({kind: StateKind.Error, error}),\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n // Unsubscribe when the current context is destroyed.\n inject(DestroyRef).onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(() => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // TODO(alxhub): use a RuntimeError when we finalize the error semantics\n throw new Error(`fromObservable() signal read before the Observable emitted`);\n }\n });\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState|ValueState<T>|ErrorState;\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.io/license\n */\n\nimport {assertInInjectionContext, effect, inject, Injector, Signal} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Options for `fromSignal`.\n *\n * @developerPreview\n */\nexport interface FromSignalOptions {\n /**\n * The `Injector` to use when creating the effect.\n *\n * If this isn't specified, the current injection context will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `fromSignal` must be called in an injection context.\n *\n * @developerPreview\n */\nexport function fromSignal<T>(\n source: Signal<T>,\n options?: FromSignalOptions,\n ): Observable<T> {\n !options?.injector && assertInInjectionContext(fromSignal);\n const injector = options?.injector ?? inject(Injector);\n\n // Creating a new `Observable` allows the creation of the effect to be lazy. This allows for all\n // references to `source` to be dropped if the `Observable` is fully unsubscribed and thrown away.\n return new Observable(observer => {\n const watcher = effect(() => {\n try {\n observer.next(source());\n } catch (err) {\n observer.error(err);\n }\n }, {injector, manualCleanup: true});\n return () => watcher.destroy();\n });\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.io/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '@angular/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an injection context. Otherwise, the\n * current `DestroyRef` is injected.\n *\n * @developerPreview\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>(observer => {\n destroyRef!.onDestroy(observer.next.bind(observer));\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAwDgB,SAAA,cAA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../../../../../../packages/core/rxjs-interop/src/to_observable.ts","../../../../../../packages/core/src/signals/src/api.ts","../../../../../../packages/core/src/util/global.ts","../../../../../../packages/core/src/util/ng_dev_mode.ts","../../../../../../packages/core/src/signals/src/weak_ref.ts","../../../../../../packages/core/src/signals/src/graph.ts","../../../../../../packages/core/src/signals/src/computed.ts","../../../../../../packages/core/src/signals/src/errors.ts","../../../../../../packages/core/src/signals/src/signal.ts","../../../../../../packages/core/src/signals/src/untracked.ts","../../../../../../packages/core/src/signals/src/watch.ts","../../../../../../packages/core/rxjs-interop/src/to_signal.ts","../../../../../../packages/core/rxjs-interop/rxjs-interop.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.io/license\n */\n\nimport {assertInInjectionContext, DestroyRef, inject} from '@angular/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\n/**\n * Operator which completes the Observable when the calling context (component, directive, service,\n * etc) is destroyed.\n *\n * @param destroyRef optionally, the `DestroyRef` representing the current context. This can be\n * passed explicitly to use `takeUntilDestroyed` outside of an injection context. Otherwise, the\n * current `DestroyRef` is injected.\n *\n * @developerPreview\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>(observer => {\n destroyRef!.onDestroy(observer.next.bind(observer));\n });\n\n return <T>(source: Observable<T>) => {\n return source.pipe(takeUntil(destroyed$));\n };\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.io/license\n */\n\nimport {assertInInjectionContext, effect, inject, Injector, Signal} from '@angular/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @developerPreview\n */\nexport interface toObservableOptions {\n /**\n * The `Injector` to use when creating the effect.\n *\n * If this isn't specified, the current injection context will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n *\n * The signal's value will be propagated into the `Observable`'s subscribers using an `effect`.\n *\n * `toObservable` must be called in an injection context.\n *\n * @developerPreview\n */\nexport function toObservable<T>(\n source: Signal<T>,\n options?: toObservableOptions,\n ): Observable<T> {\n !options?.injector && assertInInjectionContext(toObservable);\n const injector = options?.injector ?? inject(Injector);\n\n // Creating a new `Observable` allows the creation of the effect to be lazy. This allows for all\n // references to `source` to be dropped if the `Observable` is fully unsubscribed and thrown away.\n return new Observable(observer => {\n const watcher = effect(() => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n observer.error(err);\n return;\n }\n observer.next(value);\n }, {injector, manualCleanup: true, allowSignalWrites: true});\n return () => watcher.destroy();\n });\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.io/license\n */\n\nimport {ReactiveNode} from './graph';\n\n/**\n * Symbol used to tell `Signal`s apart from other functions.\n *\n * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.\n */\nconst SIGNAL = Symbol('SIGNAL');\n\n/**\n * A reactive value which notifies consumers of any changes.\n *\n * Signals are functions which returns their current value. To access the current value of a signal,\n * call it.\n *\n * Ordinary values can be turned into `Signal`s with the `signal` function.\n *\n * @developerPreview\n */\nexport type Signal<T> = (() => T)&{\n [SIGNAL]: unknown;\n};\n\n/**\n * Checks if the given `value` function is a reactive `Signal`.\n */\nexport function isSignal(value: Function): value is Signal<unknown> {\n return (value as Signal<unknown>)[SIGNAL] !== undefined;\n}\n\n/**\n * Converts `fn` into a marked signal function (where `isSignal(fn)` will be `true`).\n *\n * @param fn A zero-argument function which will be converted into a `Signal`.\n */\nexport function createSignalFromFunction<T>(node: ReactiveNode, fn: () => T): Signal<T>;\n\n/**\n * Converts `fn` into a marked signal function (where `isSignal(fn)` will be `true`), and\n * potentially add some set of extra properties (passed as an object record `extraApi`).\n *\n * @param fn A zero-argument function which will be converted into a `Signal`.\n * @param extraApi An object whose properties will be copied onto `fn` in order to create a specific\n * desired interface for the `Signal`.\n */\nexport function createSignalFromFunction<T, U extends Record<string, unknown>>(\n node: ReactiveNode, fn: () => T, extraApi: U): Signal<T>&U;\n\n/**\n * Converts `fn` into a marked signal function (where `isSignal(fn)` will be `true`), and\n * potentially add some set of extra properties (passed as an object record `extraApi`).\n */\nexport function createSignalFromFunction<T, U extends Record<string, unknown> = {}>(\n node: ReactiveNode, fn: () => T, extraApi: U = ({} as U)): Signal<T>&U {\n (fn as any)[SIGNAL] = node;\n // Copy properties from `extraApi` to `fn` to complete the desired API of the `Signal`.\n return Object.assign(fn, extraApi) as (Signal<T>& U);\n}\n\n/**\n * A comparison function which can determine if two values are equal.\n *\n * @developerPreview\n */\nexport type ValueEqualityFn<T> = (a: T, b: T) => boolean;\n\n/**\n * The default equality function used for `signal` and `computed`, which treats objects and arrays\n * as never equal, and all other primitive values using identity semantics.\n *\n * This allows signals to hold non-primitive values (arrays, objects, other collections) and still\n * propagate change notification upon explicit mutation without identity change.\n *\n * @developerPreview\n */\nexport function defaultEquals<T>(a: T, b: T) {\n // `Object.is` compares two values using identity semantics which is desired behavior for\n // primitive values. If `Object.is` determines two values to be equal we need to make sure that\n // those don't represent objects (we want to make sure that 2 objects are always considered\n // \"unequal\"). The null check is needed for the special case of JavaScript reporting null values\n // as objects (`typeof null === 'object'`).\n return (a === null || typeof a !== 'object') && Object.is(a, b);\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.io/license\n */\n\n// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492\ndeclare var WorkerGlobalScope: any;\n// CommonJS / Node have global context exposed as \"global\" variable.\n// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake\n// the global \"global\" var for now.\ndeclare var global: any;\n\n// Always use __globalThis if available, which is the spec-defined global variable across all\n// environments, then fallback to __global first, because in Node tests both __global and\n// __window may be defined and _global should be __global in that case. Note: Typeof/Instanceof\n// checks are considered side-effects in Terser. We explicitly mark this as side-effect free:\n// https://github.com/terser/terser/issues/250.\nconst _global: any = (/* @__PURE__ */ (\n () => (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||\n (typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self))());\n\n/**\n * Attention: whenever providing a new value, be sure to add an\n * entry into the corresponding `....externs.js` file,\n * so that closure won't use that global for its purposes.\n */\nexport {_global as global};\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.io/license\n */\n\nimport {global} from './global';\n\ndeclare global {\n /**\n * Values of ngDevMode\n * Depending on the current state of the application, ngDevMode may have one of several values.\n *\n * For convenience, the “truthy” value which enables dev mode is also an object which contains\n * Angular’s performance counters. This is not necessary, but cuts down on boilerplate for the\n * perf counters.\n *\n * ngDevMode may also be set to false. This can happen in one of a few ways:\n * - The user explicitly sets `window.ngDevMode = false` somewhere in their app.\n * - The user calls `enableProdMode()`.\n * - The URL contains a `ngDevMode=false` text.\n * Finally, ngDevMode may not have been defined at all.\n */\n const ngDevMode: null|NgDevModePerfCounters;\n\n interface NgDevModePerfCounters {\n namedConstructors: boolean;\n firstCreatePass: number;\n tNode: number;\n tView: number;\n rendererCreateTextNode: number;\n rendererSetText: number;\n rendererCreateElement: number;\n rendererAddEventListener: number;\n rendererSetAttribute: number;\n rendererRemoveAttribute: number;\n rendererSetProperty: number;\n rendererSetClassName: number;\n rendererAddClass: number;\n rendererRemoveClass: number;\n rendererSetStyle: number;\n rendererRemoveStyle: number;\n rendererDestroy: number;\n rendererDestroyNode: number;\n rendererMoveNode: number;\n rendererRemoveNode: number;\n rendererAppendChild: number;\n rendererInsertBefore: number;\n rendererCreateComment: number;\n hydratedNodes: number;\n hydratedComponents: number;\n dehydratedViewsRemoved: number;\n dehydratedViewsCleanupRuns: number;\n componentsSkippedHydration: number;\n }\n}\n\nexport function ngDevModeResetPerfCounters(): NgDevModePerfCounters {\n const locationString = typeof location !== 'undefined' ? location.toString() : '';\n const newCounters: NgDevModePerfCounters = {\n namedConstructors: locationString.indexOf('ngDevMode=namedConstructors') != -1,\n firstCreatePass: 0,\n tNode: 0,\n tView: 0,\n rendererCreateTextNode: 0,\n rendererSetText: 0,\n rendererCreateElement: 0,\n rendererAddEventListener: 0,\n rendererSetAttribute: 0,\n rendererRemoveAttribute: 0,\n rendererSetProperty: 0,\n rendererSetClassName: 0,\n rendererAddClass: 0,\n rendererRemoveClass: 0,\n rendererSetStyle: 0,\n rendererRemoveStyle: 0,\n rendererDestroy: 0,\n rendererDestroyNode: 0,\n rendererMoveNode: 0,\n rendererRemoveNode: 0,\n rendererAppendChild: 0,\n rendererInsertBefore: 0,\n rendererCreateComment: 0,\n hydratedNodes: 0,\n hydratedComponents: 0,\n dehydratedViewsRemoved: 0,\n dehydratedViewsCleanupRuns: 0,\n componentsSkippedHydration: 0,\n };\n\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;\n global['ngDevMode'] = allowNgDevModeTrue && newCounters;\n return newCounters;\n}\n\n/**\n * This function checks to see if the `ngDevMode` has been set. If yes,\n * then we honor it, otherwise we default to dev mode with additional checks.\n *\n * The idea is that unless we are doing production build where we explicitly\n * set `ngDevMode == false` we should be helping the developer by providing\n * as much early warning and errors as possible.\n *\n * `ɵɵdefineComponent` is guaranteed to have been called before any component template functions\n * (and thus Ivy instructions), so a single initialization there is sufficient to ensure ngDevMode\n * is defined for the entire instruction set.\n *\n * When checking `ngDevMode` on toplevel, always init it before referencing it\n * (e.g. `((typeof ngDevMode === 'undefined' || ngDevMode) && initNgDevMode())`), otherwise you can\n * get a `ReferenceError` like in https://github.com/angular/angular/issues/31595.\n *\n * Details on possible values for `ngDevMode` can be found on its docstring.\n *\n * NOTE:\n * - changes to the `ngDevMode` name must be synced with `compiler-cli/src/tooling.ts`.\n */\nexport function initNgDevMode(): boolean {\n // The below checks are to ensure that calling `initNgDevMode` multiple times does not\n // reset the counters.\n // If the `ngDevMode` is not an object, then it means we have not created the perf counters\n // yet.\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (typeof ngDevMode !== 'object') {\n ngDevModeResetPerfCounters();\n }\n return typeof ngDevMode !== 'undefined' && !!ngDevMode;\n }\n return false;\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.io/license\n */\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\nimport '../../util/ng_dev_mode';\n\nimport {global} from '../../util/global';\n\n/**\n * A `WeakRef`-compatible reference that fakes the API with a strong reference\n * internally.\n */\nclass LeakyRef<T>/* implements WeakRef<T> */ {\n constructor(private readonly ref: T) {}\n\n deref(): T|undefined {\n return this.ref;\n }\n}\n\n// `WeakRef` is not always defined in every TS environment where Angular is compiled. Instead,\n// read it off of the global context if available.\n// tslint:disable-next-line: no-toplevel-property-access\nlet WeakRefImpl: WeakRefCtor|undefined = global['WeakRef'] ?? LeakyRef;\n\nexport interface WeakRef<T extends object> {\n deref(): T|undefined;\n}\n\nexport function newWeakRef<T extends object>(value: T): WeakRef<T> {\n if (typeof ngDevMode !== 'undefined' && ngDevMode && WeakRefImpl === undefined) {\n throw new Error(`Angular requires a browser which supports the 'WeakRef' API`);\n }\n return new WeakRefImpl!(value);\n}\n\nexport interface WeakRefCtor {\n new<T extends object>(value: T): WeakRef<T>;\n}\n\nexport function setAlternateWeakRefImpl(impl: WeakRefCtor) {\n // no-op since the alternate impl is included by default by the framework. Remove once internal\n // migration is complete.\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.io/license\n */\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\nimport '../../util/ng_dev_mode';\n\nimport {throwInvalidWriteToSignalError} from './errors';\nimport {newWeakRef, WeakRef} from './weak_ref';\n\n/**\n * Counter tracking the next `ProducerId` or `ConsumerId`.\n */\nlet _nextReactiveId: number = 0;\n\n/**\n * Tracks the currently active reactive consumer (or `null` if there is no active\n * consumer).\n */\nlet activeConsumer: ReactiveNode|null = null;\n\n/**\n * Whether the graph is currently propagating change notifications.\n */\nlet inNotificationPhase = false;\n\nexport function setActiveConsumer(consumer: ReactiveNode|null): ReactiveNode|null {\n const prev = activeConsumer;\n activeConsumer = consumer;\n return prev;\n}\n\n/**\n * A bidirectional edge in the dependency graph of `ReactiveNode`s.\n */\ninterface ReactiveEdge {\n /**\n * Weakly held reference to the consumer side of this edge.\n */\n readonly producerNode: WeakRef<ReactiveNode>;\n\n /**\n * Weakly held reference to the producer side of this edge.\n */\n readonly consumerNode: WeakRef<ReactiveNode>;\n /**\n * `trackingVersion` of the consumer at which this dependency edge was last observed.\n *\n * If this doesn't match the consumer's current `trackingVersion`, then this dependency record\n * is stale, and needs to be cleaned up.\n */\n atTrackingVersion: number;\n\n /**\n * `valueVersion` of the producer at the time this dependency was last accessed.\n */\n seenValueVersion: number;\n}\n\n/**\n * A node in the reactive graph.\n *\n * Nodes can be producers of reactive values, consumers of other reactive values, or both.\n *\n * Producers are nodes that produce values, and can be depended upon by consumer nodes.\n *\n * Producers expose a monotonic `valueVersion` counter, and are responsible for incrementing this\n * version when their value semantically changes. Some producers may produce their values lazily and\n * thus at times need to be polled for potential updates to their value (and by extension their\n * `valueVersion`). This is accomplished via the `onProducerUpdateValueVersion` method for\n * implemented by producers, which should perform whatever calculations are necessary to ensure\n * `valueVersion` is up to date.\n *\n * Consumers are nodes that depend on the values of producers and are notified when those values\n * might have changed.\n *\n * Consumers do not wrap the reads they consume themselves, but rather can be set as the active\n * reader via `setActiveConsumer`. Reads of producers that happen while a consumer is active will\n * result in those producers being added as dependencies of that consumer node.\n *\n * The set of dependencies of a consumer is dynamic. Implementers expose a monotonically increasing\n * `trackingVersion` counter, which increments whenever the consumer is about to re-run any reactive\n * reads it needs and establish a new set of dependencies as a result.\n *\n * Producers store the last `trackingVersion` they've seen from `Consumer`s which have read them.\n * This allows a producer to identify whether its record of the dependency is current or stale, by\n * comparing the consumer's `trackingVersion` to the version at which the dependency was\n * last observed.\n */\nexport abstract class ReactiveNode {\n private readonly id = _nextReactiveId++;\n\n /**\n * A cached weak reference to this node, which will be used in `ReactiveEdge`s.\n */\n private readonly ref = newWeakRef(this);\n\n /**\n * Edges to producers on which this node depends (in its consumer capacity).\n */\n private readonly producers = new Map<number, ReactiveEdge>();\n\n /**\n * Edges to consumers on which this node depends (in its producer capacity).\n */\n private readonly consumers = new Map<number, ReactiveEdge>();\n\n /**\n * Monotonically increasing counter representing a version of this `Consumer`'s\n * dependencies.\n */\n protected trackingVersion = 0;\n\n /**\n * Monotonically increasing counter which increases when the value of this `Producer`\n * semantically changes.\n */\n protected valueVersion = 0;\n\n /**\n * Whether signal writes should be allowed while this `ReactiveNode` is the current consumer.\n */\n protected abstract readonly consumerAllowSignalWrites: boolean;\n\n /**\n * Called for consumers whenever one of their dependencies notifies that it might have a new\n * value.\n */\n protected abstract onConsumerDependencyMayHaveChanged(): void;\n\n /**\n * Called for producers when a dependent consumer is checking if the producer's value has actually\n * changed.\n */\n protected abstract onProducerUpdateValueVersion(): void;\n\n /**\n * Polls dependencies of a consumer to determine if they have actually changed.\n *\n * If this returns `false`, then even though the consumer may have previously been notified of a\n * change, the values of its dependencies have not actually changed and the consumer should not\n * rerun any reactions.\n */\n protected consumerPollProducersForChange(): boolean {\n for (const [producerId, edge] of this.producers) {\n const producer = edge.producerNode.deref();\n\n if (producer === undefined || edge.atTrackingVersion !== this.trackingVersion) {\n // This dependency edge is stale, so remove it.\n this.producers.delete(producerId);\n producer?.consumers.delete(this.id);\n continue;\n }\n\n if (producer.producerPollStatus(edge.seenValueVersion)) {\n // One of the dependencies reports a real value change.\n return true;\n }\n }\n\n // No dependency reported a real value change, so the `Consumer` has also not been\n // impacted.\n return false;\n }\n\n /**\n * Notify all consumers of this producer that its value may have changed.\n */\n protected producerMayHaveChanged(): void {\n // Prevent signal reads when we're updating the graph\n const prev = inNotificationPhase;\n inNotificationPhase = true;\n try {\n for (const [consumerId, edge] of this.consumers) {\n const consumer = edge.consumerNode.deref();\n if (consumer === undefined || consumer.trackingVersion !== edge.atTrackingVersion) {\n this.consumers.delete(consumerId);\n consumer?.producers.delete(this.id);\n continue;\n }\n\n consumer.onConsumerDependencyMayHaveChanged();\n }\n } finally {\n inNotificationPhase = prev;\n }\n }\n\n /**\n * Mark that this producer node has been accessed in the current reactive context.\n */\n protected producerAccessed(): void {\n if (inNotificationPhase) {\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode ?\n `Assertion error: signal read during notification phase` :\n '');\n }\n\n if (activeConsumer === null) {\n return;\n }\n\n // Either create or update the dependency `Edge` in both directions.\n let edge = activeConsumer.producers.get(this.id);\n if (edge === undefined) {\n edge = {\n consumerNode: activeConsumer.ref,\n producerNode: this.ref,\n seenValueVersion: this.valueVersion,\n atTrackingVersion: activeConsumer.trackingVersion,\n };\n activeConsumer.producers.set(this.id, edge);\n this.consumers.set(activeConsumer.id, edge);\n } else {\n edge.seenValueVersion = this.valueVersion;\n edge.atTrackingVersion = activeConsumer.trackingVersion;\n }\n }\n\n /**\n * Whether this consumer currently has any producers registered.\n */\n protected get hasProducers(): boolean {\n return this.producers.size > 0;\n }\n\n /**\n * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,\n * based on the current consumer context.\n */\n protected get producerUpdatesAllowed(): boolean {\n return activeConsumer?.consumerAllowSignalWrites !== false;\n }\n\n /**\n * Checks if a `Producer` has a current value which is different than the value\n * last seen at a specific version by a `Consumer` which recorded a dependency on\n * this `Producer`.\n */\n private producerPollStatus(lastSeenValueVersion: number): boolean {\n // `producer.valueVersion` may be stale, but a mismatch still means that the value\n // last seen by the `Consumer` is also stale.\n if (this.valueVersion !== lastSeenValueVersion) {\n return true;\n }\n\n // Trigger the `Producer` to update its `valueVersion` if necessary.\n this.onProducerUpdateValueVersion();\n\n // At this point, we can trust `producer.valueVersion`.\n return this.valueVersion !== lastSeenValueVersion;\n }\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.io/license\n */\n\nimport {createSignalFromFunction, defaultEquals, Signal, ValueEqualityFn} from './api';\nimport {ReactiveNode, setActiveConsumer} from './graph';\n\n/**\n * Options passed to the `computed` creation function.\n *\n * @developerPreview\n */\nexport interface CreateComputedOptions<T> {\n /**\n * A comparison function which defines equality for computed values.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n\n/**\n * Create a computed `Signal` which derives a reactive value from an expression.\n *\n * @developerPreview\n */\nexport function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T> {\n const node = new ComputedImpl(computation, options?.equal ?? defaultEquals);\n\n // Casting here is required for g3, as TS inference behavior is slightly different between our\n // version/options and g3's.\n return createSignalFromFunction(node, node.signal.bind(node)) as unknown as Signal<T>;\n}\n\n/**\n * A dedicated symbol used before a computed value has been calculated for the first time.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst UNSET: any = Symbol('UNSET');\n\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * is in progress. Used to detect cycles in computation chains.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst COMPUTING: any = Symbol('COMPUTING');\n\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * failed. The thrown error is cached until the computation gets dirty again.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nconst ERRORED: any = Symbol('ERRORED');\n\n/**\n * A computation, which derives a value from a declarative reactive expression.\n *\n * `Computed`s are both producers and consumers of reactivity.\n */\nclass ComputedImpl<T> extends ReactiveNode {\n constructor(private computation: () => T, private equal: (oldValue: T, newValue: T) => boolean) {\n super();\n }\n /**\n * Current value of the computation.\n *\n * This can also be one of the special values `UNSET`, `COMPUTING`, or `ERRORED`.\n */\n private value: T = UNSET;\n\n /**\n * If `value` is `ERRORED`, the error caught from the last computation attempt which will\n * be re-thrown.\n */\n private error: unknown = null;\n\n /**\n * Flag indicating that the computation is currently stale, meaning that one of the\n * dependencies has notified of a potential change.\n *\n * It's possible that no dependency has _actually_ changed, in which case the `stale`\n * state can be resolved without recomputing the value.\n */\n private stale = true;\n\n protected override readonly consumerAllowSignalWrites = false;\n\n protected override onConsumerDependencyMayHaveChanged(): void {\n if (this.stale) {\n // We've already notified consumers that this value has potentially changed.\n return;\n }\n\n // Record that the currently cached value may be stale.\n this.stale = true;\n\n // Notify any consumers about the potential change.\n this.producerMayHaveChanged();\n }\n\n protected override onProducerUpdateValueVersion(): void {\n if (!this.stale) {\n // The current value and its version are already up to date.\n return;\n }\n\n // The current value is stale. Check whether we need to produce a new one.\n\n if (this.value !== UNSET && this.value !== COMPUTING &&\n !this.consumerPollProducersForChange()) {\n // Even though we were previously notified of a potential dependency update, all of\n // our dependencies report that they have not actually changed in value, so we can\n // resolve the stale state without needing to recompute the current value.\n this.stale = false;\n return;\n }\n\n // The current value is stale, and needs to be recomputed. It still may not change -\n // that depends on whether the newly computed value is equal to the old.\n this.recomputeValue();\n }\n\n private recomputeValue(): void {\n if (this.value === COMPUTING) {\n // Our computation somehow led to a cyclic read of itself.\n throw new Error('Detected cycle in computations.');\n }\n\n const oldValue = this.value;\n this.value = COMPUTING;\n\n // As we're re-running the computation, update our dependent tracking version number.\n this.trackingVersion++;\n const prevConsumer = setActiveConsumer(this);\n let newValue: T;\n try {\n newValue = this.computation();\n } catch (err) {\n newValue = ERRORED;\n this.error = err;\n } finally {\n setActiveConsumer(prevConsumer);\n }\n\n this.stale = false;\n\n if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED &&\n this.equal(oldValue, newValue)) {\n // No change to `valueVersion` - old and new values are\n // semantically equivalent.\n this.value = oldValue;\n return;\n }\n\n this.value = newValue;\n this.valueVersion++;\n }\n\n signal(): T {\n // Check if the value needs updating before returning it.\n this.onProducerUpdateValueVersion();\n\n // Record that someone looked at this signal.\n this.producerAccessed();\n\n if (this.value === ERRORED) {\n throw this.error;\n }\n\n return this.value;\n }\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.io/license\n */\n\nfunction defaultThrowError(): never {\n throw new Error();\n}\n\nlet throwInvalidWriteToSignalErrorFn = defaultThrowError;\n\nexport function throwInvalidWriteToSignalError() {\n throwInvalidWriteToSignalErrorFn();\n}\n\nexport function setThrowInvalidWriteToSignalError(fn: () => never): void {\n throwInvalidWriteToSignalErrorFn = fn;\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.io/license\n */\n\nimport {createSignalFromFunction, defaultEquals, Signal, ValueEqualityFn} from './api';\nimport {throwInvalidWriteToSignalError} from './errors';\nimport {ReactiveNode} from './graph';\n\n/**\n * If set, called after `WritableSignal`s are updated.\n *\n * This hook can be used to achieve various effects, such as running effects synchronously as part\n * of setting a signal.\n */\nlet postSignalSetFn: (() => void)|null = null;\n\n/**\n * A `Signal` with a value that can be mutated via a setter interface.\n *\n * @developerPreview\n */\nexport interface WritableSignal<T> extends Signal<T> {\n /**\n * Directly set the signal to a new value, and notify any dependents.\n */\n set(value: T): void;\n\n /**\n * Update the value of the signal based on its current value, and\n * notify any dependents.\n */\n update(updateFn: (value: T) => T): void;\n\n /**\n * Update the current value by mutating it in-place, and\n * notify any dependents.\n */\n mutate(mutatorFn: (value: T) => void): void;\n}\n\nclass WritableSignalImpl<T> extends ReactiveNode {\n protected override readonly consumerAllowSignalWrites = false;\n\n constructor(private value: T, private equal: ValueEqualityFn<T>) {\n super();\n }\n\n protected override onConsumerDependencyMayHaveChanged(): void {\n // This never happens for writable signals as they're not consumers.\n }\n\n protected override onProducerUpdateValueVersion(): void {\n // Writable signal value versions are always up to date.\n }\n\n /**\n * Directly update the value of the signal to a new value, which may or may not be\n * equal to the previous.\n *\n * In the event that `newValue` is semantically equal to the current value, `set` is\n * a no-op.\n */\n set(newValue: T): void {\n if (!this.producerUpdatesAllowed) {\n throwInvalidWriteToSignalError();\n }\n if (!this.equal(this.value, newValue)) {\n this.value = newValue;\n this.valueVersion++;\n this.producerMayHaveChanged();\n\n postSignalSetFn?.();\n }\n }\n\n /**\n * Derive a new value for the signal from its current value using the `updater` function.\n *\n * This is equivalent to calling `set` on the result of running `updater` on the current\n * value.\n */\n update(updater: (value: T) => T): void {\n if (!this.producerUpdatesAllowed) {\n throwInvalidWriteToSignalError();\n }\n this.set(updater(this.value));\n }\n\n /**\n * Calls `mutator` on the current value and assumes that it has been mutated.\n */\n mutate(mutator: (value: T) => void): void {\n if (!this.producerUpdatesAllowed) {\n throwInvalidWriteToSignalError();\n }\n // Mutate bypasses equality checks as it's by definition changing the value.\n mutator(this.value);\n this.valueVersion++;\n this.producerMayHaveChanged();\n\n postSignalSetFn?.();\n }\n\n signal(): T {\n this.producerAccessed();\n return this.value;\n }\n}\n\n/**\n * Options passed to the `signal` creation function.\n *\n * @developerPreview\n */\nexport interface CreateSignalOptions<T> {\n /**\n * A comparison function which defines equality for signal values.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n/**\n * Create a `Signal` that can be set or updated directly.\n *\n * @developerPreview\n */\nexport function signal<T>(initialValue: T, options?: CreateSignalOptions<T>): WritableSignal<T> {\n const signalNode = new WritableSignalImpl(initialValue, options?.equal ?? defaultEquals);\n\n // Casting here is required for g3, as TS inference behavior is slightly different between our\n // version/options and g3's.\n const signalFn = createSignalFromFunction(signalNode, signalNode.signal.bind(signalNode), {\n set: signalNode.set.bind(signalNode),\n update: signalNode.update.bind(signalNode),\n mutate: signalNode.mutate.bind(signalNode),\n }) as unknown as WritableSignal<T>;\n return signalFn;\n}\n\nexport function setPostSignalSetFn(fn: (() => void)|null): (() => void)|null {\n const prev = postSignalSetFn;\n postSignalSetFn = fn;\n return prev;\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.io/license\n */\n\nimport {setActiveConsumer} from './graph';\n\n/**\n * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function\n * can, optionally, return a value.\n *\n * @developerPreview\n */\nexport function untracked<T>(nonReactiveReadsFn: () => T): T {\n const prevConsumer = setActiveConsumer(null);\n // We are not trying to catch any particular errors here, just making sure that the consumers\n // stack is restored in case of errors.\n try {\n return nonReactiveReadsFn();\n } finally {\n setActiveConsumer(prevConsumer);\n }\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.io/license\n */\n\nimport {ReactiveNode, setActiveConsumer} from './graph';\n\n/**\n * A cleanup function that can be optionally registered from the watch logic. If registered, the\n * cleanup logic runs before the next watch execution.\n */\nexport type WatchCleanupFn = () => void;\n\n/**\n * A callback passed to the watch function that makes it possible to register cleanup logic.\n */\nexport type WatchCleanupRegisterFn = (cleanupFn: WatchCleanupFn) => void;\n\nconst NOOP_CLEANUP_FN: WatchCleanupFn = () => {};\n\n/**\n * Watches a reactive expression and allows it to be scheduled to re-run\n * when any dependencies notify of a change.\n *\n * `Watch` doesn't run reactive expressions itself, but relies on a consumer-\n * provided scheduling operation to coordinate calling `Watch.run()`.\n */\nexport class Watch extends ReactiveNode {\n protected override readonly consumerAllowSignalWrites: boolean;\n private dirty = false;\n private cleanupFn = NOOP_CLEANUP_FN;\n private registerOnCleanup =\n (cleanupFn: WatchCleanupFn) => {\n this.cleanupFn = cleanupFn;\n }\n\n constructor(\n private watch: (onCleanup: WatchCleanupRegisterFn) => void,\n private schedule: (watch: Watch) => void, allowSignalWrites: boolean) {\n super();\n this.consumerAllowSignalWrites = allowSignalWrites;\n }\n\n notify(): void {\n if (!this.dirty) {\n this.schedule(this);\n }\n this.dirty = true;\n }\n\n protected override onConsumerDependencyMayHaveChanged(): void {\n this.notify();\n }\n\n protected override onProducerUpdateValueVersion(): void {\n // Watches are not producers.\n }\n\n /**\n * Execute the reactive expression in the context of this `Watch` consumer.\n *\n * Should be called by the user scheduling algorithm when the provided\n * `schedule` hook is called by `Watch`.\n */\n run(): void {\n this.dirty = false;\n if (this.trackingVersion !== 0 && !this.consumerPollProducersForChange()) {\n return;\n }\n\n const prevConsumer = setActiveConsumer(this);\n this.trackingVersion++;\n try {\n this.cleanupFn();\n this.cleanupFn = NOOP_CLEANUP_FN;\n this.watch(this.registerOnCleanup);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n\n cleanup() {\n this.cleanupFn();\n }\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.io/license\n */\n\nimport {assertInInjectionContext, computed, DestroyRef, inject, signal, Signal, WritableSignal} from '@angular/core';\nimport {RuntimeError, RuntimeErrorCode} from '@angular/core/src/errors';\nimport {Observable} from 'rxjs';\n\nimport {untracked} from '../../src/signals';\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * The subscription will last for the lifetime of the current injection context. That is, if\n * `toSignal` is called from a component context, the subscription will be cleaned up when the\n * component is destroyed. When called outside of a component, the current `EnvironmentInjector`'s\n * lifetime will be used (which is typically the lifetime of the application itself).\n *\n * If the `Observable` does not produce a value before the `Signal` is read, the `Signal` will throw\n * an error. To avoid this, use a synchronous `Observable` (potentially created with the `startWith`\n * operator) or pass an initial value to `toSignal` as the second argument.\n *\n * `toSignal` must be called in an injection context.\n */\nexport function toSignal<T>(source: Observable<T>): Signal<T|undefined>;\n\n/**\n * Get the current value of an `Observable` as a reactive `Signal`.\n *\n * `toSignal` returns a `Signal` which provides synchronous reactive access to values produced\n * by the given `Observable`, by subscribing to that `Observable`. The returned `Signal` will always\n * have the most recent value emitted by the subscription, and will throw an error if the\n * `Observable` errors.\n *\n * The subscription will last for the lifetime of the current injection context. That is, if\n * `toSignal` is called from a component context, the subscription will be cleaned up when the\n * component is destroyed. When called outside of a component, the current `EnvironmentInjector`'s\n * lifetime will be used (which is typically the lifetime of the application itself).\n *\n * Before the `Observable` emits its first value, the `Signal` will return the configured\n * `initialValue`. If the `Observable` is known to produce a value before the `Signal` will be read,\n * `initialValue` does not need to be passed.\n *\n * `toSignal` must be called in an injection context.\n *\n * @developerPreview\n */\nexport function toSignal<T, U extends T|null|undefined>(\n // toSignal(Observable<Animal>, {initialValue: null}) -> Signal<Animal|null>\n source: Observable<T>, options: {initialValue: U, requireSync?: false}): Signal<T|U>;\nexport function toSignal<T>(\n // toSignal(Observable<Animal>, {requireSync: true}) -> Signal<Animal>\n source: Observable<T>, options: {requireSync: true}): Signal<T>;\n// toSignal(Observable<Animal>) -> Signal<Animal|undefined>\nexport function toSignal<T, U = undefined>(\n source: Observable<T>, options?: {initialValue?: U, requireSync?: boolean}): Signal<T|U> {\n assertInInjectionContext(toSignal);\n\n // Note: T is the Observable value type, and U is the initial value type. They don't have to be\n // the same - the returned signal gives values of type `T`.\n let state: WritableSignal<State<T|U>>;\n if (options?.requireSync) {\n // Initially the signal is in a `NoValue` state.\n state = signal({kind: StateKind.NoValue});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T|U>>({kind: StateKind.Value, value: options?.initialValue as U});\n }\n\n const sub = source.subscribe({\n next: value => state.set({kind: StateKind.Value, value}),\n error: error => state.set({kind: StateKind.Error, error}),\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (ngDevMode && options?.requireSync && untracked(state).kind === StateKind.NoValue) {\n throw new RuntimeError(\n RuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');\n }\n\n // Unsubscribe when the current context is destroyed.\n inject(DestroyRef).onDestroy(sub.unsubscribe.bind(sub));\n\n // The actual returned signal is a `computed` of the `State` signal, which maps the various states\n // to either values or errors.\n return computed(() => {\n const current = state();\n switch (current.kind) {\n case StateKind.Value:\n return current.value;\n case StateKind.Error:\n throw current.error;\n case StateKind.NoValue:\n // This shouldn't really happen because the error is thrown on creation.\n // TODO(alxhub): use a RuntimeError when we finalize the error semantics\n throw new RuntimeError(\n RuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.');\n }\n });\n}\n\nconst enum StateKind {\n NoValue,\n Value,\n Error,\n}\n\ninterface NoValueState {\n kind: StateKind.NoValue;\n}\n\ninterface ValueState<T> {\n kind: StateKind.Value;\n value: T;\n}\n\ninterface ErrorState {\n kind: StateKind.Error;\n error: unknown;\n}\n\ntype State<T> = NoValueState|ValueState<T>|ErrorState;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["global","signal","computed"],"mappings":";;;;;;;;;;;AAYA;;;;;;;;;AASG;AACG,SAAU,kBAAkB,CAAI,UAAuB,EAAA;IAC3D,IAAI,CAAC,UAAU,EAAE;QACf,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;AAC7C,QAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACjC,KAAA;AAED,IAAA,MAAM,UAAU,GAAG,IAAI,UAAU,CAAO,QAAQ,IAAG;AACjD,QAAA,UAAW,CAAC,SA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