@angular/core 21.0.0-rc.0 → 21.0.0-rc.2

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 (79) hide show
  1. package/README.md +1 -2
  2. package/fesm2022/_attribute-chunk.mjs +1 -1
  3. package/fesm2022/_attribute-chunk.mjs.map +1 -1
  4. package/fesm2022/_debug_node-chunk.mjs +388 -270
  5. package/fesm2022/_debug_node-chunk.mjs.map +1 -1
  6. package/fesm2022/_effect-chunk.mjs +11 -2
  7. package/fesm2022/_effect-chunk.mjs.map +1 -1
  8. package/fesm2022/_linked_signal-chunk.mjs +87 -0
  9. package/fesm2022/_linked_signal-chunk.mjs.map +1 -0
  10. package/fesm2022/_not_found-chunk.mjs +1 -1
  11. package/fesm2022/_not_found-chunk.mjs.map +1 -1
  12. package/fesm2022/_resource-chunk.mjs +4 -8
  13. package/fesm2022/_resource-chunk.mjs.map +1 -1
  14. package/fesm2022/_untracked-chunk.mjs +2922 -74
  15. package/fesm2022/_untracked-chunk.mjs.map +1 -1
  16. package/fesm2022/_weak_ref-chunk.mjs +1 -1
  17. package/fesm2022/_weak_ref-chunk.mjs.map +1 -1
  18. package/fesm2022/core.mjs +8 -8
  19. package/fesm2022/core.mjs.map +1 -1
  20. package/fesm2022/primitives-di.mjs +1 -1
  21. package/fesm2022/primitives-di.mjs.map +1 -1
  22. package/fesm2022/primitives-event-dispatch.mjs +1 -1
  23. package/fesm2022/primitives-event-dispatch.mjs.map +1 -1
  24. package/fesm2022/primitives-signals.mjs +5 -5
  25. package/fesm2022/primitives-signals.mjs.map +1 -1
  26. package/fesm2022/rxjs-interop.mjs +4 -4
  27. package/fesm2022/rxjs-interop.mjs.map +1 -1
  28. package/fesm2022/testing.mjs +24 -36
  29. package/fesm2022/testing.mjs.map +1 -1
  30. package/package.json +2 -2
  31. package/resources/best-practices.md +1 -1
  32. package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +1 -1
  33. package/schematics/bundles/application-config-core.cjs +1 -1
  34. package/schematics/bundles/apply_import_manager-1Zs_gpB6.cjs +1 -1
  35. package/schematics/bundles/bootstrap-options-migration.cjs +1 -1
  36. package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
  37. package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
  38. package/schematics/bundles/compiler_host-DBwYMlTo.cjs +1 -1
  39. package/schematics/bundles/control-flow-migration.cjs +2 -2
  40. package/schematics/bundles/imports-DP72APSx.cjs +1 -1
  41. package/schematics/bundles/index-B7I9sIUx.cjs +1 -1
  42. package/schematics/bundles/inject-migration.cjs +1 -1
  43. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  44. package/schematics/bundles/migrate_ts_type_references-UGIUl7En.cjs +1 -1
  45. package/schematics/bundles/ng_component_template-Dsuq1Lw7.cjs +1 -1
  46. package/schematics/bundles/ng_decorators-DSFlWYQY.cjs +1 -1
  47. package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
  48. package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
  49. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  50. package/schematics/bundles/output-migration.cjs +1 -1
  51. package/schematics/bundles/parse_html-8VLCL37B.cjs +1 -1
  52. package/schematics/bundles/project_paths-DvD50ouC.cjs +1 -1
  53. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +1 -1
  54. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  55. package/schematics/bundles/route-lazy-loading.cjs +1 -1
  56. package/schematics/bundles/router-current-navigation.cjs +1 -1
  57. package/schematics/bundles/router-last-successful-navigation.cjs +1 -1
  58. package/schematics/bundles/router-testing-module-migration.cjs +1 -1
  59. package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
  60. package/schematics/bundles/signal-input-migration.cjs +1 -1
  61. package/schematics/bundles/signal-queries-migration.cjs +1 -1
  62. package/schematics/bundles/signals.cjs +1 -1
  63. package/schematics/bundles/standalone-migration.cjs +1 -1
  64. package/schematics/bundles/symbol-BObKoqes.cjs +1 -1
  65. package/types/_api-chunk.d.ts +1 -1
  66. package/types/_chrome_dev_tools_performance-chunk.d.ts +34 -28
  67. package/types/_discovery-chunk.d.ts +23 -8
  68. package/types/_effect-chunk.d.ts +1 -1
  69. package/types/_event_dispatcher-chunk.d.ts +1 -1
  70. package/types/_formatter-chunk.d.ts +2 -2
  71. package/types/_weak_ref-chunk.d.ts +1 -1
  72. package/types/core.d.ts +56 -55
  73. package/types/primitives-di.d.ts +1 -1
  74. package/types/primitives-event-dispatch.d.ts +1 -1
  75. package/types/primitives-signals.d.ts +6 -5
  76. package/types/rxjs-interop.d.ts +1 -1
  77. package/types/testing.d.ts +2 -2
  78. package/fesm2022/_effect-chunk2.mjs +0 -2951
  79. package/fesm2022/_effect-chunk2.mjs.map +0 -1
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Angular v21.0.0-rc.0
2
+ * @license Angular v21.0.0-rc.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { SIGNAL, consumerMarkDirty, REACTIVE_NODE, consumerDestroy, isInNotificationPhase, consumerPollProducersForChange, consumerBeforeComputation, consumerAfterComputation } from './_effect-chunk.mjs';
8
- export { BASE_EFFECT_NODE, SIGNAL_NODE, createComputed, createSignal, defaultEquals, finalizeConsumerAfterComputation, getActiveConsumer, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, resetConsumerBeforeComputation, runEffect, runPostProducerCreatedFn, runPostSignalSetFn, setActiveConsumer, setPostProducerCreatedFn, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalGetFn, signalSetFn, signalUpdateFn } from './_effect-chunk.mjs';
9
- export { createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn, untracked } from './_untracked-chunk.mjs';
8
+ export { BASE_EFFECT_NODE, SIGNAL_NODE, createComputed, createSignal, defaultEquals, finalizeConsumerAfterComputation, getActiveConsumer, isReactive, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, resetConsumerBeforeComputation, runEffect, runPostProducerCreatedFn, runPostSignalSetFn, setActiveConsumer, setPostProducerCreatedFn, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalGetFn, signalSetFn, signalUpdateFn, untracked } from './_effect-chunk.mjs';
9
+ export { createLinkedSignal, linkedSignalSetFn, linkedSignalUpdateFn } from './_linked_signal-chunk.mjs';
10
10
  export { setAlternateWeakRefImpl } from './_weak_ref-chunk.mjs';
11
11
 
12
12
  const formatter = {
@@ -60,7 +60,7 @@ const formatter = {
60
60
  object: sig,
61
61
  config: {
62
62
  ...config,
63
- skipFormatting: true
63
+ ngSkipFormatting: true
64
64
  }
65
65
  }]]];
66
66
  }
@@ -96,7 +96,7 @@ function prettifyPreview(value) {
96
96
  return ['object', {
97
97
  object: value,
98
98
  config: {
99
- skipFormatting: true
99
+ ngSkipFormatting: true
100
100
  }
101
101
  }];
102
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"primitives-signals.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/formatter.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/watch.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 {SIGNAL} from './graph';\n\n// Only a subset of HTML tags are allowed in the custom formatter JsonML format.\n// See https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html#html-template-format\ntype AllowedTags = 'span' | 'div' | 'ol' | 'ul' | 'li' | 'table' | 'tr' | 'td';\n\ntype JsonMLText = string;\ntype JsonMLAttrs = Record<string, string>;\ntype JsonMLElement =\n | [tagName: AllowedTags, ...children: (JsonMLNode | JsonMLChild)[]]\n | [tagName: AllowedTags, attrs: JsonMLAttrs, ...children: (JsonMLNode | JsonMLChild)[]];\ntype JsonMLNode = JsonMLText | JsonMLElement;\ntype JsonMLChild = ['object', {object: unknown; config?: unknown}];\ntype JsonML = JsonMLNode;\n\ntype FormatterConfig = unknown & {ngSkipFormatting?: boolean};\n\ndeclare global {\n // We need to use `var` here to be able to declare a global variable.\n // `let` and `const` will be locally scoped to the file.\n // tslint:disable-next-line:no-unused-variable\n var devtoolsFormatters: any[];\n}\n\n/**\n * A custom formatter which renders signals in an easy-to-read format.\n *\n * @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\n\nconst formatter = {\n /**\n * If the function returns `null`, the formatter is not used for this reference\n */\n header: (sig: any, config: FormatterConfig): JsonML | null => {\n if (!isSignal(sig) || config?.ngSkipFormatting) return null;\n\n let value: unknown;\n try {\n value = sig();\n } catch {\n // In case the signl throws, we don't want to break the formatting.\n return ['span', 'Signal(⚠️ Error)'];\n }\n\n const kind = 'computation' in (sig[SIGNAL] as any) ? 'Computed' : 'Signal';\n\n const isPrimitive = value === null || (!Array.isArray(value) && typeof value !== 'object');\n\n return [\n 'span',\n {},\n ['span', {}, `${kind}(`],\n (() => {\n if (isSignal(value)) {\n // Recursively call formatter. Could return an `object` to call the formatter through DevTools,\n // but then recursive signals will render multiple expando arrows which is an awkward UX.\n return formatter.header(value, config)!;\n } else if (isPrimitive && value !== undefined && typeof value !== 'function') {\n // Use built-in rendering for primitives which applies standard syntax highlighting / theming.\n // Can't do this for `undefined` however, as the browser thinks we forgot to provide an object.\n // Also don't want to do this for functions which render nested expando arrows.\n return ['object', {object: value}];\n } else {\n return prettifyPreview(value as Record<string | number | symbol, unknown>);\n }\n })(),\n ['span', {}, `)`],\n ];\n },\n\n hasBody: (sig: any, config: FormatterConfig) => {\n if (!isSignal(sig)) return false;\n\n try {\n sig();\n } catch {\n return false;\n }\n return !config?.ngSkipFormatting;\n },\n\n body: (sig: any, config: any): JsonML => {\n // We can use sys colors to fit the current DevTools theme.\n // Those are unfortunately only available on Chromium-based browsers.\n // On Firefow we fall back to the default color\n const color = 'var(--sys-color-primary)';\n\n return [\n 'div',\n {style: `background: #FFFFFF10; padding-left: 4px; padding-top: 2px; padding-bottom: 2px;`},\n ['div', {style: `color: ${color}`}, 'Signal value: '],\n ['div', {style: `padding-left: .5rem;`}, ['object', {object: sig(), config}]],\n ['div', {style: `color: ${color}`}, 'Signal function: '],\n [\n 'div',\n {style: `padding-left: .5rem;`},\n ['object', {object: sig, config: {...config, skipFormatting: true}}],\n ],\n ];\n },\n};\n\nfunction prettifyPreview(\n value: Record<string | number | symbol, unknown> | Array<unknown> | undefined,\n): string | JsonMLChild {\n if (value === null) return 'null';\n if (Array.isArray(value)) return `Array(${value.length})`;\n if (value instanceof Element) return `<${value.tagName.toLowerCase()}>`;\n if (value instanceof URL) return `URL`;\n\n switch (typeof value) {\n case 'undefined': {\n return 'undefined';\n }\n case 'function': {\n if ('prototype' in value) {\n // This is what Chrome renders, can't use `object` though because it creates a nested expando arrow.\n return 'class';\n } else {\n return '() => {…}';\n }\n }\n case 'object': {\n if (value.constructor.name === 'Object') {\n return '{…}';\n } else {\n return `${value.constructor.name} {}`;\n }\n }\n default: {\n return ['object', {object: value, config: {skipFormatting: true}}];\n }\n }\n}\n\nfunction isSignal(value: any): boolean {\n return value[SIGNAL] !== undefined;\n}\n\n/**\n * Installs the custom formatter into custom formatting on Signals in the devtools.\n *\n * Supported by both Chrome and Firefox.\n *\n * @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\nexport function installDevToolsSignalFormatter() {\n globalThis.devtoolsFormatters ??= [];\n if (!globalThis.devtoolsFormatters.some((f: any) => f === formatter)) {\n globalThis.devtoolsFormatters.push(formatter);\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.dev/license\n */\n\nimport {\n consumerAfterComputation,\n consumerBeforeComputation,\n consumerDestroy,\n consumerMarkDirty,\n consumerPollProducersForChange,\n isInNotificationPhase,\n REACTIVE_NODE,\n ReactiveNode,\n SIGNAL,\n} from './graph';\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.\ndeclare const ngDevMode: boolean | undefined;\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\nexport interface Watch {\n notify(): void;\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\n cleanup(): void;\n\n /**\n * Destroy the watcher:\n * - disconnect it from the reactive graph;\n * - mark it as destroyed so subsequent run and notify operations are noop.\n */\n destroy(): void;\n\n [SIGNAL]: WatchNode;\n}\nexport interface WatchNode extends ReactiveNode {\n fn: ((onCleanup: WatchCleanupRegisterFn) => void) | null;\n schedule: ((watch: Watch) => void) | null;\n cleanupFn: WatchCleanupFn;\n ref: Watch;\n}\n\nexport function createWatch(\n fn: (onCleanup: WatchCleanupRegisterFn) => void,\n schedule: (watch: Watch) => void,\n allowSignalWrites: boolean,\n): Watch {\n const node: WatchNode = Object.create(WATCH_NODE);\n if (allowSignalWrites) {\n node.consumerAllowSignalWrites = true;\n }\n\n node.fn = fn;\n node.schedule = schedule;\n\n const registerOnCleanup = (cleanupFn: WatchCleanupFn) => {\n node.cleanupFn = cleanupFn;\n };\n\n function isWatchNodeDestroyed(node: WatchNode) {\n return node.fn === null && node.schedule === null;\n }\n\n function destroyWatchNode(node: WatchNode) {\n if (!isWatchNodeDestroyed(node)) {\n consumerDestroy(node); // disconnect watcher from the reactive graph\n node.cleanupFn();\n\n // nullify references to the integration functions to mark node as destroyed\n node.fn = null;\n node.schedule = null;\n node.cleanupFn = NOOP_CLEANUP_FN;\n }\n }\n\n const run = () => {\n if (node.fn === null) {\n // trying to run a destroyed watch is noop\n return;\n }\n\n if (isInNotificationPhase()) {\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode\n ? 'Schedulers cannot synchronously execute watches while scheduling.'\n : '',\n );\n }\n\n node.dirty = false;\n if (node.version > 0 && !consumerPollProducersForChange(node)) {\n return;\n }\n node.version++;\n\n const prevConsumer = consumerBeforeComputation(node);\n try {\n node.cleanupFn();\n node.cleanupFn = NOOP_CLEANUP_FN;\n node.fn(registerOnCleanup);\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n };\n\n node.ref = {\n notify: () => consumerMarkDirty(node),\n run,\n cleanup: () => node.cleanupFn(),\n destroy: () => destroyWatchNode(node),\n [SIGNAL]: node,\n };\n\n return node.ref;\n}\n\nconst NOOP_CLEANUP_FN: WatchCleanupFn = () => {};\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst WATCH_NODE: Partial<WatchNode> = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: false,\n consumerMarkedDirty: (node: WatchNode) => {\n if (node.schedule !== null) {\n node.schedule(node.ref);\n }\n },\n cleanupFn: NOOP_CLEANUP_FN,\n };\n})();\n"],"names":["formatter","kind","sig","SIGNAL","isPrimitive","value","Array","isArray","isSignal","header","config","undefined","ngSkipFormatting","style","object","skipFormatting","prettifyPreview","length","URL","constructor","name","node","fn","schedule","registerOnCleanup","cleanupFn","isWatchNodeDestroyed"],"mappings":";;;;;;;;;;;MAsCAA,SAAA,GAAA;;;;;;MAoCM,MAAA;AACiB,MAAA,OAAA,CAAA,MAAA,EAAA,kBAAA,CAAA;AAErB;AAEA,IAAA,MAAAC,IAAA,GAAA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A;6BAEJ,MAAA;mCAEE,CAAAA,MAAAA,EAAAA,KAAA,CAAAY,MAAA,CAAA,CAAA,CAAA;;AAKN,EAAA,IAAAZ,KAAS,YACPa,GAAA,EAGF,OAAA,CAAA,GAAA,CAAA;AAAA,EAAA,QAAA,OAAAb,KAAA;;;;;;;;;AAMG,SAAA,MACG;AACJ,UAAA,OAAA,WAAA;AACA;;AAEA,IAAA,KAAA,QAAA;AAAA,MAAA;YACFA,KAAA,CAAAc,WAAA,CAAAC,IAAA,KAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECtFEC,IAAA,CAAAC,EAAA,GAAAA,EAAA;EAGAD,IAAA,CACEE,QAAA,GAAAA,QAAA;EAmEA,MAAAC,iBAAgB,GACUC,aAE1B;IAEIJ,IAAA,CAAAI,SAAa,YAAU;;AAE1BC,EAAAA,SAAAA,oBAAAA,CAAAL,IAAA,EAAA;AACD,IAAA,OAAAA,IAAA,CAAAC,EAAA,KAAAD,IAAAA,IAAAA,IAAA,CAAAE,QAAA,KAAA,IAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"primitives-signals.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/formatter.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/src/watch.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/primitives/signals/index.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 {SIGNAL} from './graph';\n\n// Only a subset of HTML tags are allowed in the custom formatter JsonML format.\n// See https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html#html-template-format\ntype AllowedTags = 'span' | 'div' | 'ol' | 'ul' | 'li' | 'table' | 'tr' | 'td';\n\ntype JsonMLText = string;\ntype JsonMLAttrs = Record<string, string>;\ntype JsonMLElement =\n | [tagName: AllowedTags, ...children: (JsonMLNode | JsonMLChild)[]]\n | [tagName: AllowedTags, attrs: JsonMLAttrs, ...children: (JsonMLNode | JsonMLChild)[]];\ntype JsonMLNode = JsonMLText | JsonMLElement;\ntype JsonMLChild = ['object', {object: unknown; config?: unknown}];\ntype JsonML = JsonMLNode;\n\ntype FormatterConfig = unknown & {ngSkipFormatting?: boolean};\n\ndeclare global {\n // We need to use `var` here to be able to declare a global variable.\n // `let` and `const` will be locally scoped to the file.\n // tslint:disable-next-line:no-unused-variable\n var devtoolsFormatters: any[];\n}\n\n/**\n * A custom formatter which renders signals in an easy-to-read format.\n *\n * @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\n\nconst formatter = {\n /**\n * If the function returns `null`, the formatter is not used for this reference\n */\n header: (sig: any, config: FormatterConfig): JsonML | null => {\n if (!isSignal(sig) || config?.ngSkipFormatting) return null;\n\n let value: unknown;\n try {\n value = sig();\n } catch {\n // In case the signal throws, we don't want to break the formatting.\n return ['span', 'Signal(⚠️ Error)'];\n }\n\n const kind = 'computation' in (sig[SIGNAL] as any) ? 'Computed' : 'Signal';\n\n const isPrimitive = value === null || (!Array.isArray(value) && typeof value !== 'object');\n\n return [\n 'span',\n {},\n ['span', {}, `${kind}(`],\n (() => {\n if (isSignal(value)) {\n // Recursively call formatter. Could return an `object` to call the formatter through DevTools,\n // but then recursive signals will render multiple expando arrows which is an awkward UX.\n return formatter.header(value, config)!;\n } else if (isPrimitive && value !== undefined && typeof value !== 'function') {\n // Use built-in rendering for primitives which applies standard syntax highlighting / theming.\n // Can't do this for `undefined` however, as the browser thinks we forgot to provide an object.\n // Also don't want to do this for functions which render nested expando arrows.\n return ['object', {object: value}];\n } else {\n return prettifyPreview(value as Record<string | number | symbol, unknown>);\n }\n })(),\n ['span', {}, `)`],\n ];\n },\n\n hasBody: (sig: any, config: FormatterConfig) => {\n if (!isSignal(sig)) return false;\n\n try {\n sig();\n } catch {\n return false;\n }\n return !config?.ngSkipFormatting;\n },\n\n body: (sig: any, config: any): JsonML => {\n // We can use sys colors to fit the current DevTools theme.\n // Those are unfortunately only available on Chromium-based browsers.\n // On Firefow we fall back to the default color\n const color = 'var(--sys-color-primary)';\n\n return [\n 'div',\n {style: `background: #FFFFFF10; padding-left: 4px; padding-top: 2px; padding-bottom: 2px;`},\n ['div', {style: `color: ${color}`}, 'Signal value: '],\n ['div', {style: `padding-left: .5rem;`}, ['object', {object: sig(), config}]],\n ['div', {style: `color: ${color}`}, 'Signal function: '],\n [\n 'div',\n {style: `padding-left: .5rem;`},\n ['object', {object: sig, config: {...config, ngSkipFormatting: true}}],\n ],\n ];\n },\n};\n\nfunction prettifyPreview(\n value: Record<string | number | symbol, unknown> | Array<unknown> | undefined,\n): string | JsonMLChild {\n if (value === null) return 'null';\n if (Array.isArray(value)) return `Array(${value.length})`;\n if (value instanceof Element) return `<${value.tagName.toLowerCase()}>`;\n if (value instanceof URL) return `URL`;\n\n switch (typeof value) {\n case 'undefined': {\n return 'undefined';\n }\n case 'function': {\n if ('prototype' in value) {\n // This is what Chrome renders, can't use `object` though because it creates a nested expando arrow.\n return 'class';\n } else {\n return '() => {…}';\n }\n }\n case 'object': {\n if (value.constructor.name === 'Object') {\n return '{…}';\n } else {\n return `${value.constructor.name} {}`;\n }\n }\n default: {\n return ['object', {object: value, config: {ngSkipFormatting: true}}];\n }\n }\n}\n\nfunction isSignal(value: any): boolean {\n return value[SIGNAL] !== undefined;\n}\n\n/**\n * Installs the custom formatter into custom formatting on Signals in the devtools.\n *\n * Supported by both Chrome and Firefox.\n *\n * @see https://firefox-source-docs.mozilla.org/devtools-user/custom_formatters/index.html\n */\nexport function installDevToolsSignalFormatter() {\n globalThis.devtoolsFormatters ??= [];\n if (!globalThis.devtoolsFormatters.some((f: any) => f === formatter)) {\n globalThis.devtoolsFormatters.push(formatter);\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.dev/license\n */\n\nimport {\n consumerAfterComputation,\n consumerBeforeComputation,\n consumerDestroy,\n consumerMarkDirty,\n consumerPollProducersForChange,\n isInNotificationPhase,\n REACTIVE_NODE,\n ReactiveNode,\n SIGNAL,\n} from './graph';\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.\ndeclare const ngDevMode: boolean | undefined;\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\nexport interface Watch {\n notify(): void;\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\n cleanup(): void;\n\n /**\n * Destroy the watcher:\n * - disconnect it from the reactive graph;\n * - mark it as destroyed so subsequent run and notify operations are noop.\n */\n destroy(): void;\n\n [SIGNAL]: WatchNode;\n}\nexport interface WatchNode extends ReactiveNode {\n fn: ((onCleanup: WatchCleanupRegisterFn) => void) | null;\n schedule: ((watch: Watch) => void) | null;\n cleanupFn: WatchCleanupFn;\n ref: Watch;\n}\n\nexport function createWatch(\n fn: (onCleanup: WatchCleanupRegisterFn) => void,\n schedule: (watch: Watch) => void,\n allowSignalWrites: boolean,\n): Watch {\n const node: WatchNode = Object.create(WATCH_NODE);\n if (allowSignalWrites) {\n node.consumerAllowSignalWrites = true;\n }\n\n node.fn = fn;\n node.schedule = schedule;\n\n const registerOnCleanup = (cleanupFn: WatchCleanupFn) => {\n node.cleanupFn = cleanupFn;\n };\n\n function isWatchNodeDestroyed(node: WatchNode) {\n return node.fn === null && node.schedule === null;\n }\n\n function destroyWatchNode(node: WatchNode) {\n if (!isWatchNodeDestroyed(node)) {\n consumerDestroy(node); // disconnect watcher from the reactive graph\n node.cleanupFn();\n\n // nullify references to the integration functions to mark node as destroyed\n node.fn = null;\n node.schedule = null;\n node.cleanupFn = NOOP_CLEANUP_FN;\n }\n }\n\n const run = () => {\n if (node.fn === null) {\n // trying to run a destroyed watch is noop\n return;\n }\n\n if (isInNotificationPhase()) {\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode\n ? 'Schedulers cannot synchronously execute watches while scheduling.'\n : '',\n );\n }\n\n node.dirty = false;\n if (node.version > 0 && !consumerPollProducersForChange(node)) {\n return;\n }\n node.version++;\n\n const prevConsumer = consumerBeforeComputation(node);\n try {\n node.cleanupFn();\n node.cleanupFn = NOOP_CLEANUP_FN;\n node.fn(registerOnCleanup);\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n };\n\n node.ref = {\n notify: () => consumerMarkDirty(node),\n run,\n cleanup: () => node.cleanupFn(),\n destroy: () => destroyWatchNode(node),\n [SIGNAL]: node,\n };\n\n return node.ref;\n}\n\nconst NOOP_CLEANUP_FN: WatchCleanupFn = () => {};\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\n// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.\nconst WATCH_NODE: Partial<WatchNode> = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: false,\n consumerMarkedDirty: (node: WatchNode) => {\n if (node.schedule !== null) {\n node.schedule(node.ref);\n }\n },\n cleanupFn: NOOP_CLEANUP_FN,\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.dev/license\n */\n\nimport {installDevToolsSignalFormatter} from './src/formatter';\n\nexport {ComputedNode, createComputed} from './src/computed';\nexport {\n ComputationFn,\n LinkedSignalNode,\n LinkedSignalGetter,\n PreviousValue,\n createLinkedSignal,\n linkedSignalSetFn,\n linkedSignalUpdateFn,\n} from './src/linked_signal';\nexport {ValueEqualityFn, defaultEquals} from './src/equality';\nexport {setThrowInvalidWriteToSignalError} from './src/errors';\nexport {\n REACTIVE_NODE,\n Reactive,\n ReactiveHookFn,\n ReactiveNode,\n ReactiveNodeKind,\n SIGNAL,\n consumerAfterComputation,\n consumerBeforeComputation,\n consumerDestroy,\n consumerMarkDirty,\n consumerPollProducersForChange,\n finalizeConsumerAfterComputation,\n getActiveConsumer,\n isInNotificationPhase,\n isReactive,\n producerAccessed,\n producerIncrementEpoch,\n producerMarkClean,\n producerNotifyConsumers,\n producerUpdateValueVersion,\n producerUpdatesAllowed,\n resetConsumerBeforeComputation,\n runPostProducerCreatedFn,\n setActiveConsumer,\n setPostProducerCreatedFn,\n Version,\n} from './src/graph';\nexport {\n SIGNAL_NODE,\n SignalGetter,\n SignalNode,\n createSignal,\n runPostSignalSetFn,\n setPostSignalSetFn,\n signalGetFn,\n signalSetFn,\n signalUpdateFn,\n} from './src/signal';\nexport {Watch, WatchCleanupFn, WatchCleanupRegisterFn, createWatch} from './src/watch';\nexport {setAlternateWeakRefImpl} from './src/weak_ref';\nexport {untracked} from './src/untracked';\nexport {runEffect, BASE_EFFECT_NODE, BaseEffectNode} from './src/effect';\nexport {installDevToolsSignalFormatter} from './src/formatter';\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.\ndeclare const ngDevMode: boolean | undefined;\n\n// We're using a top-level access to enable signal formatting whenever the signals package is loaded.\nif (typeof ngDevMode !== 'undefined' && ngDevMode) {\n // tslint:disable-next-line: no-toplevel-property-access\n installDevToolsSignalFormatter();\n}\n"],"names":["formatter","header","sig","config","isSignal","ngSkipFormatting","value","kind","SIGNAL","isPrimitive","Array","isArray","undefined","object","prettifyPreview","hasBody","body","color","style","length","Element","tagName","toLowerCase","URL","constructor","name","installDevToolsSignalFormatter","globalThis","devtoolsFormatters","some","f","push","createWatch","fn","schedule","allowSignalWrites","node","Object","create","WATCH_NODE","consumerAllowSignalWrites","registerOnCleanup","cleanupFn","isWatchNodeDestroyed","destroyWatchNode","consumerDestroy","NOOP_CLEANUP_FN","run","isInNotificationPhase","Error","ngDevMode","dirty","version","consumerPollProducersForChange","prevConsumer","consumerBeforeComputation","consumerAfterComputation","ref","notify","consumerMarkDirty","cleanup","destroy","REACTIVE_NODE","consumerIsAlwaysLive","consumerMarkedDirty"],"mappings":";;;;;;;;;;;AAsCA,MAAMA,SAAS,GAAG;AAIhBC,EAAAA,MAAM,EAAEA,CAACC,GAAQ,EAAEC,MAAuB,KAAmB;IAC3D,IAAI,CAACC,QAAQ,CAACF,GAAG,CAAC,IAAIC,MAAM,EAAEE,gBAAgB,EAAE,OAAO,IAAI;AAE3D,IAAA,IAAIC,KAAc;IAClB,IAAI;MACFA,KAAK,GAAGJ,GAAG,EAAE;AACf,KAAA,CAAE,MAAM;AAEN,MAAA,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC;AACrC;IAEA,MAAMK,IAAI,GAAG,aAAa,IAAKL,GAAG,CAACM,MAAM,CAAS,GAAG,UAAU,GAAG,QAAQ;AAE1E,IAAA,MAAMC,WAAW,GAAGH,KAAK,KAAK,IAAI,IAAK,CAACI,KAAK,CAACC,OAAO,CAACL,KAAK,CAAC,IAAI,OAAOA,KAAK,KAAK,QAAS;AAE1F,IAAA,OAAO,CACL,MAAM,EACN,EAAE,EACF,CAAC,MAAM,EAAE,EAAE,EAAE,CAAGC,EAAAA,IAAI,GAAG,CAAC,EACxB,CAAC,MAAK;AACJ,MAAA,IAAIH,QAAQ,CAACE,KAAK,CAAC,EAAE;AAGnB,QAAA,OAAON,SAAS,CAACC,MAAM,CAACK,KAAK,EAAEH,MAAM,CAAE;AACzC,OAAA,MAAO,IAAIM,WAAW,IAAIH,KAAK,KAAKM,SAAS,IAAI,OAAON,KAAK,KAAK,UAAU,EAAE;QAI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AAS,KAAK,WAAW,IAAIA,SAAS,EAAE;AAEjDxB,EAAAA,8BAA8B,EAAE;AAClC;;;;"}
@@ -1,18 +1,18 @@
1
1
  /**
2
- * @license Angular v21.0.0-rc.0
2
+ * @license Angular v21.0.0-rc.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { Observable, ReplaySubject } from 'rxjs';
8
8
  import { takeUntil } from 'rxjs/operators';
9
- import { assertInInjectionContext, inject, DestroyRef, RuntimeError, Injector, effect, assertNotInReactiveContext, signal, PendingTasks } from './_effect-chunk2.mjs';
10
- import { getOutputDestroyRef, untracked, computed, resource, encapsulateResourceError } from './_resource-chunk.mjs';
9
+ import { assertInInjectionContext, inject, DestroyRef, RuntimeError, Injector, effect, untracked, assertNotInReactiveContext, signal, PendingTasks } from './_untracked-chunk.mjs';
10
+ import { getOutputDestroyRef, computed, resource, encapsulateResourceError } from './_resource-chunk.mjs';
11
11
  import './_effect-chunk.mjs';
12
12
  import './_not_found-chunk.mjs';
13
13
  import '@angular/core/primitives/signals';
14
14
  import '@angular/core/primitives/di';
15
- import './_untracked-chunk.mjs';
15
+ import './_linked_signal-chunk.mjs';
16
16
 
17
17
  function takeUntilDestroyed(destroyRef) {
18
18
  if (!destroyRef) {
@@ -1 +1 @@
1
- {"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/pending_until_event.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/rx_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 {assertInInjectionContext, DestroyRef, inject} from '../../src/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\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @publicApi 19.0\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n ngDevMode && assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((subscriber) => {\n if (destroyRef.destroyed) {\n subscriber.next();\n return;\n }\n const unregisterFn = destroyRef.onDestroy(subscriber.next.bind(subscriber));\n return unregisterFn;\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.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (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 // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n *\n * @publicApi 19.0\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\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 {OutputRef, ɵgetOutputDestroyRef} from '../../src/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n * It creates an observable that represents the stream of \"events firing\" in an output.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @publicApi 19.0\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n const unregisterOnDestroy = destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => {\n subscription.unsubscribe();\n unregisterOnDestroy?.();\n };\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.dev/license\n */\n\nimport {assertInInjectionContext, PendingTasks, inject, Injector} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\n\n/**\n * Operator which makes the application unstable until the observable emits, completes, errors, or is unsubscribed.\n *\n * Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.\n *\n * @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).\n *\n * @developerPreview 20.0\n */\nexport function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T> {\n if (injector === undefined) {\n ngDevMode && assertInInjectionContext(pendingUntilEvent);\n injector = inject(Injector);\n }\n const taskService = injector.get(PendingTasks);\n\n return (sourceObservable) => {\n return new Observable<T>((originalSubscriber) => {\n // create a new task on subscription\n const removeTask = taskService.add();\n\n let cleanedUp = false;\n function cleanupTask() {\n if (cleanedUp) {\n return;\n }\n\n removeTask();\n cleanedUp = true;\n }\n\n const innerSubscription = sourceObservable.subscribe({\n next: (v) => {\n originalSubscriber.next(v);\n cleanupTask();\n },\n complete: () => {\n originalSubscriber.complete();\n cleanupTask();\n },\n error: (e) => {\n originalSubscriber.error(e);\n cleanupTask();\n },\n });\n innerSubscription.add(() => {\n originalSubscriber.unsubscribe();\n cleanupTask();\n });\n return innerSubscription;\n });\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.dev/license\n */\n\nimport {\n assertInInjectionContext,\n resource,\n ResourceLoaderParams,\n ResourceRef,\n Signal,\n signal,\n BaseResourceOptions,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n ResourceStreamItem,\n} from '../../src/core';\nimport {Observable, Subscription} from 'rxjs';\nimport {encapsulateResourceError} from '../../src/resource/resource';\n\n/**\n * Like `ResourceOptions` but uses an RxJS-based `loader`.\n *\n * @experimental\n */\nexport interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n stream: (params: ResourceLoaderParams<R>) => Observable<T>;\n}\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(\n opts: RxResourceOptions<T, R> & {defaultValue: NoInfer<T>},\n): ResourceRef<T>;\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined> {\n if (ngDevMode && !opts?.injector) {\n assertInInjectionContext(rxResource);\n }\n return resource<T, R>({\n ...opts,\n loader: undefined,\n stream: (params) => {\n let sub: Subscription | undefined;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub?.unsubscribe();\n params.abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<ResourceStreamItem<T>>({value: undefined as T});\n let resolve: ((value: Signal<ResourceStreamItem<T>>) => void) | undefined;\n const promise = new Promise<Signal<ResourceStreamItem<T>>>((r) => (resolve = r));\n\n function send(value: ResourceStreamItem<T>): void {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n }\n\n // TODO(alxhub): remove after g3 updated to rename loader -> stream\n const streamFn = opts.stream ?? (opts as {loader?: RxResourceOptions<T, R>['stream']}).loader;\n if (streamFn === undefined) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.MUST_PROVIDE_STREAM_OPTION,\n ngDevMode && `Must provide \\`stream\\` option.`,\n );\n }\n\n sub = streamFn(params).subscribe({\n next: (value) => send({value}),\n error: (error: unknown) => {\n send({error: encapsulateResourceError(error)});\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new ɵRuntimeError(\n ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE,\n ngDevMode && 'Resource completed before producing a value',\n ),\n });\n }\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n });\n}\n"],"names":["next","unregisterFn","destroyRef","onDestroy","subscriber","bind","source","callbackFn","destroyed","ɵRuntimeError","ngDevMode","unregisterOnDestroy","observer","complete","ref","subscribe","v","subscription","unsubscribe","Observable","originalSubscriber","removeTask","taskService","add","cleanedUp","sourceObservable","cleanupTask","error","e","resource","opts","loader","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;gBAgCI,CAAAA,IAAA,EAAA;AACA,MAAA;AACA;AACF,IAAA,MAAAC,YAAE,GAAAC,UAAA,CAAAC,SAAA,CAAAC,UAAA,CAAAJ,IAAA,CAAAK,IAAA,CAAAD,UAAA,CAAA,CAAA;;AAIF,GAAA,CAAA;AACFE,EAAAA,OAAAA,MAAA,IAAA;;;;;6BCC6B,CAAA;EAIjBA,MAAA;;;;;IAOP,IAAAJ,CAAAA,UAAA,CAAAC,SAAA,CAAA,MAAA;uBAEM,IAAA;AAMX,KAAA,CAAA;AALM;YAEJI,UAAA,EAAA;AAGF,IAAA,IAAA,IAAA,CAAAC,SAAA,EAAA;AAAA,MAAA,MAAA,IAAAC,YAAA,CAAAC,GAAAA,EAAAA,SAAA;;;;;;;;;;;;;;;;;;IC9BI,MAAAC,mBAAA,GAAAT,UAAA,EAAAC,SAAA,CAAAS,MAAAA,QAAA,CAAAC,QAAA,EAAA,CAAA;sBACc,GAAAC,GAAA,CAAAC,SAAc,CAAAC,CAAA,IAAAJ,QAAA,CAAAZ,IAAA,CAAAgB,CAAA,CAAA,CAAA;iBACP;MAErBC,YAAA,CAAAC,WAAA,EAAA;MACJP,mBAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ICLM,OAAAQ,IAAAA,UAAA,CAAAC,kBAAoC,IAAA;AAGpC,MAAA,MAAAC,UAAA,GAAAC,WAAA,CAAAC,GAAoB,EAAA;mBACd,GAAA,KAAA;;qBAEJ,EAAA;;;QAMFF,UAAA,EAAA;AACEG,QAAAA,SAAA,GAAM,IAAE;AAEN;6BACD,GAAAC,gBAAA,CAAAV,SAAA,CAAA;mBACO;;UAENW,WAAA,EAAA;AAEF,SAAA;QACEb,QAAA,EAAAA,MAAA;AACAO,UAAAA,kBAAA,CAAAP,QAAA,EAAA;UAEHa,WAAA,EAAA;AACD,SAAA;;UAEEN,kBAAA,CAAAO,KAAA,CAAAC,CAAA,CAAA;UACFF,WAAA,EAAA;AACA;;AAEH,MAAA,iBAAA,CAAAH,GAAA,CAAA,MAAA;AACHH,QAAAA,kBAAA,CAAAF,WAAA,EAAA;;;;;;;;;;;;ACVE,EAAA,OAAAW,QAAA,CAAA;AAEE,IAAA,GACAC,IAAA;AAeIC,IAAAA,MAAA,EAAAC,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rxjs-interop.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/take_until_destroyed.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_from_observable.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/output_to_observable.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/to_observable.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/to_signal.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/pending_until_event.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/core/rxjs-interop/src/rx_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 {assertInInjectionContext, DestroyRef, inject} from '../../src/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\n * context](guide/di/dependency-injection-context). Otherwise, the current `DestroyRef` is injected.\n *\n * @publicApi 19.0\n */\nexport function takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n if (!destroyRef) {\n ngDevMode && assertInInjectionContext(takeUntilDestroyed);\n destroyRef = inject(DestroyRef);\n }\n\n const destroyed$ = new Observable<void>((subscriber) => {\n if (destroyRef.destroyed) {\n subscriber.next();\n return;\n }\n const unregisterFn = destroyRef.onDestroy(subscriber.next.bind(subscriber));\n return unregisterFn;\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.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n inject,\n OutputOptions,\n OutputRef,\n OutputRefSubscription,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {Observable} from 'rxjs';\n\nimport {takeUntilDestroyed} from './take_until_destroyed';\n\n/**\n * Implementation of `OutputRef` that emits values from\n * an RxJS observable source.\n *\n * @internal\n */\nclass OutputFromObservableRef<T> implements OutputRef<T> {\n private destroyed = false;\n\n destroyRef = inject(DestroyRef);\n\n constructor(private source: Observable<T>) {\n this.destroyRef.onDestroy(() => {\n this.destroyed = true;\n });\n }\n\n subscribe(callbackFn: (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 // Stop yielding more values when the directive/component is already destroyed.\n const subscription = this.source.pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (value) => callbackFn(value),\n });\n\n return {\n unsubscribe: () => subscription.unsubscribe(),\n };\n }\n}\n\n/**\n * Declares an Angular output that is using an RxJS observable as a source\n * for events dispatched to parent subscribers.\n *\n * The behavior for an observable as source is defined as followed:\n * 1. New values are forwarded to the Angular output (next notifications).\n * 2. Errors notifications are not handled by Angular. You need to handle these manually.\n * For example by using `catchError`.\n * 3. Completion notifications stop the output from emitting new values.\n *\n * @usageNotes\n * Initialize an output in your directive by declaring a\n * class field and initializing it with the `outputFromObservable()` function.\n *\n * ```ts\n * @Directive({..})\n * export class MyDir {\n * nameChange$ = <some-observable>;\n * nameChange = outputFromObservable(this.nameChange$);\n * }\n * ```\n *\n * @publicApi 19.0\n */\nexport function outputFromObservable<T>(\n observable: Observable<T>,\n opts?: OutputOptions,\n): OutputRef<T> {\n ngDevMode && assertInInjectionContext(outputFromObservable);\n return new OutputFromObservableRef<T>(observable);\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 {OutputRef, ɵgetOutputDestroyRef} from '../../src/core';\nimport {Observable} from 'rxjs';\n\n/**\n * Converts an Angular output declared via `output()` or `outputFromObservable()`\n * to an observable.\n * It creates an observable that represents the stream of \"events firing\" in an output.\n *\n * You can subscribe to the output via `Observable.subscribe` then.\n *\n * @publicApi 19.0\n */\nexport function outputToObservable<T>(ref: OutputRef<T>): Observable<T> {\n const destroyRef = ɵgetOutputDestroyRef(ref);\n\n return new Observable<T>((observer) => {\n // Complete the observable upon directive/component destroy.\n // Note: May be `undefined` if an `EventEmitter` is declared outside\n // of an injection context.\n const unregisterOnDestroy = destroyRef?.onDestroy(() => observer.complete());\n\n const subscription = ref.subscribe((v) => observer.next(v));\n return () => {\n subscription.unsubscribe();\n unregisterOnDestroy?.();\n };\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.dev/license\n */\n\nimport {\n assertInInjectionContext,\n DestroyRef,\n effect,\n inject,\n Injector,\n Signal,\n untracked,\n} from '../../src/core';\nimport {Observable, ReplaySubject} from 'rxjs';\n\n/**\n * Options for `toObservable`.\n *\n * @publicApi 20.0\n */\nexport interface ToObservableOptions {\n /**\n * The `Injector` to use when creating the underlying `effect` which watches the signal.\n *\n * If this isn't specified, the current [injection context](guide/di/dependency-injection-context)\n * will be used.\n */\n injector?: Injector;\n}\n\n/**\n * Exposes the value of an Angular `Signal` as an RxJS `Observable`.\n * As it reflects a state, the observable will always emit the latest value upon subscription.\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 unless an injector is provided via options.\n *\n * @publicApi 20.0\n */\nexport function toObservable<T>(source: Signal<T>, options?: ToObservableOptions): Observable<T> {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(toObservable);\n }\n const injector = options?.injector ?? inject(Injector);\n const subject = new ReplaySubject<T>(1);\n\n const watcher = effect(\n () => {\n let value: T;\n try {\n value = source();\n } catch (err) {\n untracked(() => subject.error(err));\n return;\n }\n untracked(() => subject.next(value));\n },\n {injector, manualCleanup: true},\n );\n\n injector.get(DestroyRef).onDestroy(() => {\n watcher.destroy();\n subject.complete();\n });\n\n return subject.asObservable();\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 assertInInjectionContext,\n assertNotInReactiveContext,\n computed,\n DestroyRef,\n inject,\n Injector,\n signal,\n Signal,\n WritableSignal,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n} from '../../src/core';\nimport {ValueEqualityFn} from '../../primitives/signals';\nimport {Observable, Subscribable} from 'rxjs';\n\n/**\n * Options for `toSignal`.\n *\n * @publicApi 20.0\n */\nexport interface ToSignalOptions<T> {\n /**\n * Initial value for the signal produced by `toSignal`.\n *\n * This will be the value of the signal until the observable emits its first value.\n */\n initialValue?: unknown;\n\n /**\n * Whether to require that the observable emits synchronously when `toSignal` subscribes.\n *\n * If this is `true`, `toSignal` will assert that the observable produces a value immediately upon\n * subscription. Setting this option removes the need to either deal with `undefined` in the\n * signal type or provide an `initialValue`, at the cost of a runtime error if this requirement is\n * not met.\n */\n requireSync?: boolean;\n\n /**\n * `Injector` which will provide the `DestroyRef` used to clean up the Observable subscription.\n *\n * If this is not provided, a `DestroyRef` will be retrieved from the current [injection\n * context](guide/di/dependency-injection-context), unless manual cleanup is requested.\n */\n injector?: Injector;\n\n /**\n * Whether the subscription should be automatically cleaned up (via `DestroyRef`) when\n * `toSignal`'s creation context is destroyed.\n *\n * If manual cleanup is enabled, then `DestroyRef` is not used, and the subscription will persist\n * until the `Observable` itself completes.\n */\n manualCleanup?: boolean;\n\n /**\n * A comparison function which defines equality for values emitted by the observable.\n *\n * Equality comparisons are executed against the initial value if one is provided.\n */\n equal?: ValueEqualityFn<T>;\n}\n\n// Base case: no options -> `undefined` in the result type.\nexport function toSignal<T>(source: Observable<T> | Subscribable<T>): Signal<T | undefined>;\n// Options with `undefined` initial value and no `requiredSync` -> `undefined`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | undefined>> & {\n initialValue?: undefined;\n requireSync?: false;\n },\n): Signal<T | undefined>;\n// Options with `null` initial value -> `null`.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | null>> & {initialValue?: null; requireSync?: false},\n): Signal<T | null>;\n// Options with `undefined` initial value and `requiredSync` -> strict result type.\nexport function toSignal<T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T>> & {initialValue?: undefined; requireSync: true},\n): Signal<T>;\n// Options with a more specific initial value type.\nexport function toSignal<T, const U extends T>(\n source: Observable<T> | Subscribable<T>,\n options: NoInfer<ToSignalOptions<T | U>> & {initialValue: U; requireSync?: false},\n): Signal<T | U>;\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 * With `requireSync` set to `true`, `toSignal` will assert that the `Observable` produces a value\n * immediately upon subscription. No `initialValue` is needed in this case, and the returned signal\n * does not include an `undefined` type.\n *\n * By default, the subscription will be automatically cleaned up when the current [injection\n * context](guide/di/dependency-injection-context) is destroyed. For example, when `toSignal` is\n * called during the construction of a component, the subscription will be cleaned up when the\n * component is destroyed. If an injection context is not available, an explicit `Injector` can be\n * passed instead.\n *\n * If the subscription should persist until the `Observable` itself completes, the `manualCleanup`\n * option can be specified instead, which disables the automatic subscription teardown. No injection\n * context is needed in this configuration as well.\n */\nexport function toSignal<T, U = undefined>(\n source: Observable<T> | Subscribable<T>,\n options?: ToSignalOptions<T | U> & {initialValue?: U},\n): Signal<T | U> {\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n assertNotInReactiveContext(\n toSignal,\n 'Invoking `toSignal` causes new subscriptions every time. ' +\n 'Consider moving `toSignal` outside of the reactive context and read the signal value where needed.',\n );\n\n const requiresCleanup = !options?.manualCleanup;\n\n if (ngDevMode && requiresCleanup && !options?.injector) {\n assertInInjectionContext(toSignal);\n }\n\n const cleanupRef = requiresCleanup\n ? (options?.injector?.get(DestroyRef) ?? inject(DestroyRef))\n : null;\n\n const equal = makeToSignalEqual(options?.equal);\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}, {equal});\n } else {\n // If an initial value was passed, use it. Otherwise, use `undefined` as the initial value.\n state = signal<State<T | U>>(\n {kind: StateKind.Value, value: options?.initialValue as U},\n {equal},\n );\n }\n\n let destroyUnregisterFn: (() => void) | undefined;\n\n // Note: This code cannot run inside a reactive context (see assertion above). If we'd support\n // this, we would subscribe to the observable outside of the current reactive context, avoiding\n // that side-effect signal reads/writes are attribute to the current consumer. The current\n // consumer only needs to be notified when the `state` signal changes through the observable\n // subscription. Additional context (related to async pipe):\n // https://github.com/angular/angular/pull/50522.\n const sub = source.subscribe({\n next: (value) => state.set({kind: StateKind.Value, value}),\n error: (error) => {\n state.set({kind: StateKind.Error, error});\n destroyUnregisterFn?.();\n },\n complete: () => {\n destroyUnregisterFn?.();\n },\n // Completion of the Observable is meaningless to the signal. Signals don't have a concept of\n // \"complete\".\n });\n\n if (options?.requireSync && state().kind === StateKind.NoValue) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n\n // Unsubscribe when the current context is destroyed, if requested.\n destroyUnregisterFn = cleanupRef?.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 () => {\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 throw new ɵRuntimeError(\n ɵRuntimeErrorCode.REQUIRE_SYNC_WITHOUT_SYNC_EMIT,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n '`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',\n );\n }\n },\n {equal: options?.equal},\n );\n}\n\nfunction makeToSignalEqual<T>(\n userEquality: ValueEqualityFn<T> = Object.is,\n): ValueEqualityFn<State<T>> {\n return (a, b) =>\n a.kind === StateKind.Value && b.kind === StateKind.Value && userEquality(a.value, b.value);\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.dev/license\n */\n\nimport {assertInInjectionContext, PendingTasks, inject, Injector} from '../../src/core';\nimport {MonoTypeOperatorFunction, Observable} from 'rxjs';\n\n/**\n * Operator which makes the application unstable until the observable emits, completes, errors, or is unsubscribed.\n *\n * Use this operator in observables whose subscriptions are important for rendering and should be included in SSR serialization.\n *\n * @param injector The `Injector` to use during creation. If this is not provided, the current injection context will be used instead (via `inject`).\n *\n * @developerPreview 20.0\n */\nexport function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T> {\n if (injector === undefined) {\n ngDevMode && assertInInjectionContext(pendingUntilEvent);\n injector = inject(Injector);\n }\n const taskService = injector.get(PendingTasks);\n\n return (sourceObservable) => {\n return new Observable<T>((originalSubscriber) => {\n // create a new task on subscription\n const removeTask = taskService.add();\n\n let cleanedUp = false;\n function cleanupTask() {\n if (cleanedUp) {\n return;\n }\n\n removeTask();\n cleanedUp = true;\n }\n\n const innerSubscription = sourceObservable.subscribe({\n next: (v) => {\n originalSubscriber.next(v);\n cleanupTask();\n },\n complete: () => {\n originalSubscriber.complete();\n cleanupTask();\n },\n error: (e) => {\n originalSubscriber.error(e);\n cleanupTask();\n },\n });\n innerSubscription.add(() => {\n originalSubscriber.unsubscribe();\n cleanupTask();\n });\n return innerSubscription;\n });\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.dev/license\n */\n\nimport {\n assertInInjectionContext,\n resource,\n ResourceLoaderParams,\n ResourceRef,\n Signal,\n signal,\n BaseResourceOptions,\n ɵRuntimeError,\n ɵRuntimeErrorCode,\n ResourceStreamItem,\n} from '../../src/core';\nimport {Observable, Subscription} from 'rxjs';\nimport {encapsulateResourceError} from '../../src/resource/resource';\n\n/**\n * Like `ResourceOptions` but uses an RxJS-based `loader`.\n *\n * @experimental\n */\nexport interface RxResourceOptions<T, R> extends BaseResourceOptions<T, R> {\n stream: (params: ResourceLoaderParams<R>) => Observable<T>;\n}\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(\n opts: RxResourceOptions<T, R> & {defaultValue: NoInfer<T>},\n): ResourceRef<T>;\n\n/**\n * Like `resource` but uses an RxJS based `loader` which maps the request to an `Observable` of the\n * resource's value.\n *\n * @experimental\n */\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined>;\nexport function rxResource<T, R>(opts: RxResourceOptions<T, R>): ResourceRef<T | undefined> {\n if (ngDevMode && !opts?.injector) {\n assertInInjectionContext(rxResource);\n }\n return resource<T, R>({\n ...opts,\n loader: undefined,\n stream: (params) => {\n let sub: Subscription | undefined;\n\n // Track the abort listener so it can be removed if the Observable completes (as a memory\n // optimization).\n const onAbort = () => sub?.unsubscribe();\n params.abortSignal.addEventListener('abort', onAbort);\n\n // Start off stream as undefined.\n const stream = signal<ResourceStreamItem<T>>({value: undefined as T});\n let resolve: ((value: Signal<ResourceStreamItem<T>>) => void) | undefined;\n const promise = new Promise<Signal<ResourceStreamItem<T>>>((r) => (resolve = r));\n\n function send(value: ResourceStreamItem<T>): void {\n stream.set(value);\n resolve?.(stream);\n resolve = undefined;\n }\n\n // TODO(alxhub): remove after g3 updated to rename loader -> stream\n const streamFn = opts.stream ?? (opts as {loader?: RxResourceOptions<T, R>['stream']}).loader;\n if (streamFn === undefined) {\n throw new ɵRuntimeError(\n ɵRuntimeErrorCode.MUST_PROVIDE_STREAM_OPTION,\n ngDevMode && `Must provide \\`stream\\` option.`,\n );\n }\n\n sub = streamFn(params).subscribe({\n next: (value) => send({value}),\n error: (error: unknown) => {\n send({error: encapsulateResourceError(error)});\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n complete: () => {\n if (resolve) {\n send({\n error: new ɵRuntimeError(\n ɵRuntimeErrorCode.RESOURCE_COMPLETED_BEFORE_PRODUCING_VALUE,\n ngDevMode && 'Resource completed before producing a value',\n ),\n });\n }\n params.abortSignal.removeEventListener('abort', onAbort);\n },\n });\n\n return promise;\n },\n });\n}\n"],"names":["takeUntilDestroyed","destroyRef","ngDevMode","assertInInjectionContext","inject","DestroyRef","destroyed$","Observable","subscriber","destroyed","next","unregisterFn","onDestroy","bind","source","pipe","takeUntil","OutputFromObservableRef","constructor","subscribe","callbackFn","ɵRuntimeError","subscription","value","unsubscribe","outputFromObservable","observable","opts","outputToObservable","ref","ɵgetOutputDestroyRef","observer","unregisterOnDestroy","complete","v","toObservable","options","injector","Injector","subject","ReplaySubject","watcher","effect","err","untracked","error","manualCleanup","get","destroy","asObservable","toSignal","assertNotInReactiveContext","requiresCleanup","cleanupRef","equal","makeToSignalEqual","state","requireSync","signal","kind","initialValue","destroyUnregisterFn","sub","set","computed","current","userEquality","Object","is","a","b","pendingUntilEvent","undefined","taskService","PendingTasks","sourceObservable","originalSubscriber","removeTask","add","cleanedUp","cleanupTask","innerSubscription","e","rxResource","resource","loader","stream","params","onAbort","abortSignal","addEventListener","resolve","promise","Promise","r","send","streamFn","enc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AAS;AACrB;MAGA,MAAMwB,QAAQ,GAAGrE,IAAI,CAAC2D,MAAM,IAAK3D,IAAqD,CAAC0D,MAAM;MAC7F,IAAIW,QAAQ,KAAKxB,SAAS,EAAE;QAC1B,MAAM,IAAInD,YAAa,CAAA,GAAA,EAErBnB,SAAS,IAAI,iCAAiC,CAC/C;AACH;AAEA4D,MAAAA,GAAG,GAAGkC,QAAQ,CAACT,MAAM,CAAC,CAACpE,SAAS,CAAC;AAC/BT,QAAAA,IAAI,EAAGa,KAAK,IAAKwE,IAAI,CAAC;AAACxE,UAAAA;AAAK,SAAC,CAAC;QAC9BsB,KAAK,EAAGA,KAAc,IAAI;AACxBkD,UAAAA,IAAI,CAAC;YAAClD,KAAK,EAAEoD,wBAAwB,CAACpD,KAAK;AAAE,WAAA,CAAC;UAC9C0C,MAAM,CAACE,WAAW,CAACS,mBAAmB,CAAC,OAAO,EAAEV,OAAO,CAAC;SACzD;QACDvD,QAAQ,EAAEA,MAAK;AACb,UAAA,IAAI0D,OAAO,EAAE;AACXI,YAAAA,IAAI,CAAC;cACHlD,KAAK,EAAE,IAAIxB,YAAa,MAEtBnB,SAAS,IAAI,6CAA6C;AAE7D,aAAA,CAAC;AACJ;UACAqF,MAAM,CAACE,WAAW,CAACS,mBAAmB,CAAC,OAAO,EAAEV,OAAO,CAAC;AAC1D;AACD,OAAA,CAAC;AAEF,MAAA,OAAOI,OAAO;AAChB;AACD,GAAA,CAAC;AACJ;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-rc.0
2
+ * @license Angular v21.0.0-rc.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -7,7 +7,7 @@
7
7
  import * as i0 from '@angular/core';
8
8
  import { Injectable, DeferBlockState, triggerResourceLoading, renderDeferBlockState, getDeferBlocks, DeferBlockBehavior, ApplicationRef, getDebugNode, RendererFactory2, Directive, Component, Pipe, NgModule, ReflectionCapabilities, depsTracker, isComponentDefPendingResolution, resolveComponentResources, NgModuleRef, ApplicationInitStatus, LOCALE_ID, DEFAULT_LOCALE_ID, setLocaleId, ComponentFactory, getAsyncClassMetadataFn, compileComponent, compileDirective, compilePipe, patchComponentDefWithScope, compileNgModuleDefs, clearResolutionOfComponentResourcesQueue, restoreComponentResolutionQueue, provideZonelessChangeDetectionInternal, COMPILER_OPTIONS, generateStandaloneInDeclarationsError, transitiveScopesFor, Compiler, DEFER_BLOCK_CONFIG, ANIMATIONS_DISABLED, NgModuleFactory, ModuleWithComponentFactories, resetCompiledComponents, ɵsetUnknownElementStrictMode as _setUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode as _setUnknownPropertyStrictMode, ɵgetUnknownElementStrictMode as _getUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode as _getUnknownPropertyStrictMode, inferTagNameFromDefinition, flushModuleScopingQueueAsMuchAsPossible, setAllowDuplicateNgModuleIdsForTest } from './_debug_node-chunk.mjs';
9
9
  import { Subscription } from 'rxjs';
10
- import { inject as inject$1, NgZone, EnvironmentInjector, ErrorHandler, CONTAINER_HEADER_OFFSET, InjectionToken, NoopNgZone, PendingTasksInternal, ZONELESS_ENABLED, ChangeDetectionScheduler, EffectScheduler, stringify, getInjectableDef, resolveForwardRef, NG_COMP_DEF, NG_DIR_DEF, NG_PIPE_DEF, NG_INJ_DEF, NG_MOD_DEF, ENVIRONMENT_INITIALIZER, Injector, isEnvironmentProviders, INTERNAL_APPLICATION_ERROR_HANDLER, runInInjectionContext, getComponentDef as getComponentDef$1 } from './_effect-chunk2.mjs';
10
+ import { inject as inject$1, NgZone, EnvironmentInjector, ErrorHandler, CONTAINER_HEADER_OFFSET, InjectionToken, NoopNgZone, PendingTasksInternal, ZONELESS_ENABLED, ChangeDetectionScheduler, EffectScheduler, stringify, getInjectableDef, resolveForwardRef, NG_COMP_DEF, NG_DIR_DEF, NG_PIPE_DEF, NG_INJ_DEF, NG_MOD_DEF, ENVIRONMENT_INITIALIZER, Injector, isEnvironmentProviders, INTERNAL_APPLICATION_ERROR_HANDLER, runInInjectionContext, getComponentDef as getComponentDef$1 } from './_untracked-chunk.mjs';
11
11
  import { ResourceLoader } from '@angular/compiler';
12
12
  import './_effect-chunk.mjs';
13
13
  import '@angular/core/primitives/signals';
@@ -1900,7 +1900,7 @@ class FakeNavigation {
1900
1900
  return;
1901
1901
  }
1902
1902
  const abortReason = reason ?? new DOMException('Navigation aborted', 'AbortError');
1903
- this.navigateEvent.cancel(abortReason);
1903
+ this.navigateEvent.abort(abortReason);
1904
1904
  }
1905
1905
  userAgentNavigate(destination, result, options) {
1906
1906
  this.canSetInitialEntry = false;
@@ -2157,12 +2157,23 @@ function dispatchNavigateEvent({
2157
2157
  event.info = options.info;
2158
2158
  }
2159
2159
  }
2160
+ function processNavigateEventHandlerFailure(reason) {
2161
+ if (event.abortController.signal.aborted) {
2162
+ return;
2163
+ }
2164
+ if (event !== navigation.navigateEvent) {
2165
+ throw new Error('Event is no longer the current navigation event');
2166
+ }
2167
+ if (event.interceptionState !== 'intercepted') {
2168
+ finishNavigationEvent(event, false);
2169
+ }
2170
+ event.abort(reason);
2171
+ }
2160
2172
  function commit() {
2161
2173
  if (result.signal.aborted) {
2162
2174
  return;
2163
2175
  }
2164
- navigation.transition?.committedResolve();
2165
- if (event.interceptionState === 'intercepted') {
2176
+ if (event.interceptionState !== 'none') {
2166
2177
  event.interceptionState = 'committed';
2167
2178
  switch (event.navigationType) {
2168
2179
  case 'push':
@@ -2183,6 +2194,7 @@ function dispatchNavigateEvent({
2183
2194
  }
2184
2195
  }
2185
2196
  }
2197
+ navigation.transition?.committedResolve();
2186
2198
  const promisesList = handlers.map(handler => handler());
2187
2199
  if (promisesList.length === 0) {
2188
2200
  promisesList.push(Promise.resolve());
@@ -2207,27 +2219,11 @@ function dispatchNavigateEvent({
2207
2219
  navigation.eventTarget.dispatchEvent(navigatesuccessEvent);
2208
2220
  navigation.transition?.finishedResolve();
2209
2221
  navigation.transition = null;
2210
- }).catch(reason => {
2211
- if (!event.abortController.signal.aborted) {
2212
- event.cancel(reason);
2213
- }
2214
- });
2222
+ }).catch(processNavigateEventHandlerFailure);
2215
2223
  }
2216
- event.cancel = function (reason) {
2217
- if (result.signal.aborted) {
2218
- return;
2219
- }
2224
+ event.abort = function (reason) {
2220
2225
  this.abortController.abort(reason);
2221
- const isCurrentGlobalNavigationEvent = this === navigation.navigateEvent;
2222
- if (isCurrentGlobalNavigationEvent) {
2223
- navigation.navigateEvent = null;
2224
- }
2225
- if (this.interceptionState !== 'intercepted' && this.interceptionState !== 'finished') {
2226
- finishNavigationEvent(this, false);
2227
- } else if (this.interceptionState === 'intercepted') {
2228
- this.interceptionState = 'finished';
2229
- }
2230
- result.committedReject(reason);
2226
+ navigation.navigateEvent = null;
2231
2227
  result.finishedReject(reason);
2232
2228
  const navigateerrorEvent = new Event('navigateerror', {
2233
2229
  bubbles: false,
@@ -2245,7 +2241,7 @@ function dispatchNavigateEvent({
2245
2241
  const dispatchResult = navigation.eventTarget.dispatchEvent(event);
2246
2242
  if (event.interceptionState === 'intercepted') {
2247
2243
  if (!navigation.currentEntry) {
2248
- event.cancel(new DOMException('Cannot create transition without a currentEntry for intercepted navigation.', 'InvalidStateError'));
2244
+ event.abort(new DOMException('Cannot create transition without a currentEntry for intercepted navigation.', 'InvalidStateError'));
2249
2245
  return;
2250
2246
  }
2251
2247
  const transition = new InternalNavigationTransition(navigation.currentEntry, navigationType);
@@ -2255,7 +2251,7 @@ function dispatchNavigateEvent({
2255
2251
  }
2256
2252
  if (!dispatchResult && event.cancelable) {
2257
2253
  if (!event.abortController.signal.aborted) {
2258
- event.cancel(new DOMException('Navigation prevented by event.preventDefault()', 'AbortError'));
2254
+ event.abort(new DOMException('Navigation prevented by event.preventDefault()', 'AbortError'));
2259
2255
  }
2260
2256
  } else {
2261
2257
  if (precommitHandlers.length === 0) {
@@ -2274,15 +2270,7 @@ function dispatchNavigateEvent({
2274
2270
  p.catch(() => {});
2275
2271
  return p;
2276
2272
  });
2277
- Promise.all(precommitPromisesList).then(() => commit()).catch(reason => {
2278
- if (event.abortController.signal.aborted) {
2279
- return;
2280
- }
2281
- if (navigation.transition) {
2282
- navigation.transition.committedReject(reason);
2283
- }
2284
- event.cancel(reason);
2285
- });
2273
+ Promise.all(precommitPromisesList).then(() => commit()).catch(processNavigateEventHandlerFailure);
2286
2274
  }
2287
2275
  }
2288
2276
  }
@@ -2452,8 +2440,8 @@ class InternalNavigationResult {
2452
2440
  resolve(this.committedTo);
2453
2441
  };
2454
2442
  this.finishedReject = reason => {
2443
+ this.committedReject(reason);
2455
2444
  reject(reason);
2456
- this.abortController.abort(reason);
2457
2445
  };
2458
2446
  });
2459
2447
  this.committed.catch(() => {});