@angular/core 17.1.0-next.3 → 17.1.0-next.5

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/esm2022/primitives/signals/src/signal.mjs +2 -9
  2. package/esm2022/src/application/application_config.mjs +21 -0
  3. package/esm2022/src/application/application_init.mjs +188 -0
  4. package/esm2022/src/application/application_module.mjs +29 -0
  5. package/esm2022/src/application/application_ref.mjs +505 -0
  6. package/esm2022/src/application/application_tokens.mjs +121 -0
  7. package/esm2022/src/application/create_application.mjs +102 -0
  8. package/esm2022/src/authoring/input.mjs +41 -0
  9. package/esm2022/src/authoring/input_signal.mjs +10 -0
  10. package/esm2022/src/authoring/input_type_checking.mjs +9 -0
  11. package/esm2022/src/authoring.mjs +12 -0
  12. package/esm2022/src/change_detection/flags.mjs +16 -0
  13. package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +164 -0
  14. package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +13 -0
  15. package/esm2022/src/compiler/compiler_facade_interface.mjs +1 -1
  16. package/esm2022/src/core.mjs +15 -7
  17. package/esm2022/src/core_private_export.mjs +8 -4
  18. package/esm2022/src/core_reactivity_export_internal.mjs +2 -2
  19. package/esm2022/src/core_render3_private_export.mjs +2 -2
  20. package/esm2022/src/error_handler.mjs +15 -1
  21. package/esm2022/src/event_emitter.mjs +1 -2
  22. package/esm2022/src/hydration/annotate.mjs +1 -1
  23. package/esm2022/src/hydration/api.mjs +2 -2
  24. package/esm2022/src/hydration/cleanup.mjs +1 -1
  25. package/esm2022/src/image_performance_warning.mjs +2 -2
  26. package/esm2022/src/linker/query_list.mjs +8 -6
  27. package/esm2022/src/metadata/do_bootstrap.mjs +1 -1
  28. package/esm2022/src/pending_tasks.mjs +57 -0
  29. package/esm2022/src/platform/platform.mjs +135 -0
  30. package/esm2022/src/platform/platform_core_providers.mjs +15 -0
  31. package/esm2022/src/platform/platform_ref.mjs +179 -0
  32. package/esm2022/src/render3/after_render_hooks.mjs +2 -2
  33. package/esm2022/src/render3/component_ref.mjs +13 -9
  34. package/esm2022/src/render3/instructions/change_detection.mjs +2 -4
  35. package/esm2022/src/render3/instructions/control_flow.mjs +5 -3
  36. package/esm2022/src/render3/instructions/mark_view_dirty.mjs +3 -2
  37. package/esm2022/src/render3/instructions/shared.mjs +3 -2
  38. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  39. package/esm2022/src/render3/interfaces/public_definitions.mjs +1 -1
  40. package/esm2022/src/render3/interfaces/view.mjs +1 -1
  41. package/esm2022/src/render3/list_reconciliation.mjs +58 -24
  42. package/esm2022/src/render3/util/change_detection_utils.mjs +3 -1
  43. package/esm2022/src/render3/util/misc_utils.mjs +2 -2
  44. package/esm2022/src/render3/util/view_utils.mjs +18 -5
  45. package/esm2022/src/render3/view_ref.mjs +8 -1
  46. package/esm2022/src/transfer_state.mjs +2 -2
  47. package/esm2022/src/util/performance.mjs +2 -2
  48. package/esm2022/src/version.mjs +6 -5
  49. package/esm2022/src/zone/ng_zone.mjs +10 -61
  50. package/esm2022/testing/src/component_fixture.mjs +20 -36
  51. package/esm2022/testing/src/logger.mjs +3 -3
  52. package/esm2022/testing/src/test_bed.mjs +5 -6
  53. package/fesm2022/core.mjs +1446 -1336
  54. package/fesm2022/core.mjs.map +1 -1
  55. package/fesm2022/primitives/signals.mjs +2 -9
  56. package/fesm2022/primitives/signals.mjs.map +1 -1
  57. package/fesm2022/rxjs-interop.mjs +1 -1
  58. package/fesm2022/testing.mjs +46 -64
  59. package/fesm2022/testing.mjs.map +1 -1
  60. package/index.d.ts +196 -43
  61. package/package.json +1 -1
  62. package/primitives/signals/index.d.ts +1 -1
  63. package/rxjs-interop/index.d.ts +1 -1
  64. package/schematics/migrations/block-template-entities/bundle.js +1019 -745
  65. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  66. package/schematics/migrations/compiler-options/bundle.js +13 -13
  67. package/schematics/migrations/transfer-state/bundle.js +13 -13
  68. package/schematics/ng-generate/control-flow-migration/bundle.js +1331 -854
  69. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  70. package/schematics/ng-generate/standalone-migration/bundle.js +2329 -1757
  71. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  72. package/testing/index.d.ts +6 -10
  73. package/esm2022/src/application_config.mjs +0 -21
  74. package/esm2022/src/application_init.mjs +0 -188
  75. package/esm2022/src/application_module.mjs +0 -29
  76. package/esm2022/src/application_ref.mjs +0 -997
  77. package/esm2022/src/application_tokens.mjs +0 -121
  78. package/esm2022/src/initial_render_pending_tasks.mjs +0 -49
  79. package/esm2022/src/platform_core_providers.mjs +0 -15
package/fesm2022/core.mjs CHANGED
@@ -1,12 +1,51 @@
1
1
  /**
2
- * @license Angular v17.1.0-next.3
2
+ * @license Angular v17.1.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { setActiveConsumer as setActiveConsumer$1, consumerDestroy as consumerDestroy$1, SIGNAL as SIGNAL$1, createComputed as createComputed$1, createSignal as createSignal$1, signalSetFn as signalSetFn$1, signalUpdateFn as signalUpdateFn$1, REACTIVE_NODE as REACTIVE_NODE$1, consumerBeforeComputation as consumerBeforeComputation$1, consumerAfterComputation as consumerAfterComputation$1, consumerPollProducersForChange as consumerPollProducersForChange$1, getActiveConsumer as getActiveConsumer$1, createWatch as createWatch$1, setThrowInvalidWriteToSignalError as setThrowInvalidWriteToSignalError$1 } from '@angular/core/primitives/signals';
8
- import { Subject, Subscription, Observable, merge as merge$1, BehaviorSubject, of } from 'rxjs';
9
- import { share, switchMap, distinctUntilChanged, first } from 'rxjs/operators';
8
+ import { Subject, Subscription, BehaviorSubject } from 'rxjs';
9
+ import { map, first } from 'rxjs/operators';
10
+
11
+ function inputFunction(_initialValue, _opts) {
12
+ throw new Error('TODO');
13
+ }
14
+ function inputRequiredFunction(_opts) {
15
+ throw new Error('TODO');
16
+ }
17
+ /**
18
+ * Initializes an input with an initial value. If no explicit value
19
+ * is specified, Angular will use `undefined`.
20
+ *
21
+ * Consider using `input.required` for inputs that don't need an
22
+ * initial value.
23
+ *
24
+ * @usageNotes
25
+ * Initialize an input in your directive or component by declaring a
26
+ * class field and initializing it with the `input()` function.
27
+ *
28
+ * ```ts
29
+ * @Directive({..})
30
+ * export class MyDir {
31
+ * firstName = input<string>(); // string|undefined
32
+ * lastName = input.required<string>(); // string
33
+ * age = input(0); // number
34
+ * }
35
+ * ```
36
+ */
37
+ const input = (() => {
38
+ // Note: This may be considered a side-effect, but nothing will depend on
39
+ // this assignment, unless this `input` constant export is accessed. It's a
40
+ // self-contained side effect that is local to the user facing`input` export.
41
+ inputFunction.required = inputRequiredFunction;
42
+ return inputFunction;
43
+ })();
44
+
45
+ const ɵINPUT_SIGNAL_BRAND_READ_TYPE = /* @__PURE__ */ Symbol();
46
+ const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE = /* @__PURE__ */ Symbol();
47
+
48
+ // Note: `input` is exported in `core.ts` due to:
10
49
 
11
50
  function getClosureSafeProperty(objWithPropertyToExtract) {
12
51
  for (let key in objWithPropertyToExtract) {
@@ -2565,6 +2604,15 @@ const profiler = function (event, instance, hookOrListener) {
2565
2604
  const SVG_NAMESPACE = 'svg';
2566
2605
  const MATH_ML_NAMESPACE = 'math';
2567
2606
 
2607
+ // TODO(atscott): flip default internally ASAP and externally for v18 (#52928)
2608
+ let _ensureDirtyViewsAreAlwaysReachable = false;
2609
+ function getEnsureDirtyViewsAreAlwaysReachable() {
2610
+ return _ensureDirtyViewsAreAlwaysReachable;
2611
+ }
2612
+ function setEnsureDirtyViewsAreAlwaysReachable(v) {
2613
+ _ensureDirtyViewsAreAlwaysReachable = v;
2614
+ }
2615
+
2568
2616
  /**
2569
2617
  * For efficiency reasons we often put several different data types (`RNode`, `LView`, `LContainer`)
2570
2618
  * in same location in `LView`. This is because we don't want to pre-allocate space for it
@@ -2731,10 +2779,21 @@ function requiresRefreshOrTraversal(lView) {
2731
2779
  * parents above.
2732
2780
  */
2733
2781
  function updateAncestorTraversalFlagsOnAttach(lView) {
2734
- if (!requiresRefreshOrTraversal(lView)) {
2735
- return;
2782
+ // TODO(atscott): Simplify if...else cases once getEnsureDirtyViewsAreAlwaysReachable is always
2783
+ // `true`. When we attach a view that's marked `Dirty`, we should ensure that it is reached during
2784
+ // the next CD traversal so we add the `RefreshView` flag and mark ancestors accordingly.
2785
+ if (requiresRefreshOrTraversal(lView)) {
2786
+ markAncestorsForTraversal(lView);
2787
+ }
2788
+ else if (lView[FLAGS] & 64 /* LViewFlags.Dirty */) {
2789
+ if (getEnsureDirtyViewsAreAlwaysReachable()) {
2790
+ lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
2791
+ markAncestorsForTraversal(lView);
2792
+ }
2793
+ else {
2794
+ lView[ENVIRONMENT].changeDetectionScheduler?.notify();
2795
+ }
2736
2796
  }
2737
- markAncestorsForTraversal(lView);
2738
2797
  }
2739
2798
  /**
2740
2799
  * Ensures views above the given `lView` are traversed during change detection even when they are
@@ -2744,6 +2803,7 @@ function updateAncestorTraversalFlagsOnAttach(lView) {
2744
2803
  * flag is already `true` or the `lView` is detached.
2745
2804
  */
2746
2805
  function markAncestorsForTraversal(lView) {
2806
+ lView[ENVIRONMENT].changeDetectionScheduler?.notify();
2747
2807
  let parent = lView[PARENT];
2748
2808
  while (parent !== null) {
2749
2809
  // We stop adding markers to the ancestors once we reach one that already has the marker. This
@@ -9841,6 +9901,12 @@ function getSanitizer() {
9841
9901
  return lView && lView[ENVIRONMENT].sanitizer;
9842
9902
  }
9843
9903
 
9904
+ /**
9905
+ * Injectable that is notified when an `LView` is made aware of changes to application state.
9906
+ */
9907
+ class ChangeDetectionScheduler {
9908
+ }
9909
+
9844
9910
  /**
9845
9911
  * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
9846
9912
  *
@@ -10411,24 +10477,6 @@ class Sanitizer {
10411
10477
  }); }
10412
10478
  }
10413
10479
 
10414
- /**
10415
- * @description Represents the version of Angular
10416
- *
10417
- * @publicApi
10418
- */
10419
- class Version {
10420
- constructor(full) {
10421
- this.full = full;
10422
- this.major = full.split('.')[0];
10423
- this.minor = full.split('.')[1];
10424
- this.patch = full.split('.').slice(2).join('.');
10425
- }
10426
- }
10427
- /**
10428
- * @publicApi
10429
- */
10430
- const VERSION = new Version('17.1.0-next.3');
10431
-
10432
10480
  // This default value is when checking the hierarchy for a token.
10433
10481
  //
10434
10482
  // It means both:
@@ -11762,6 +11810,19 @@ class ErrorHandler {
11762
11810
  return e || null;
11763
11811
  }
11764
11812
  }
11813
+ /**
11814
+ * `InjectionToken` used to configure how to call the `ErrorHandler`.
11815
+ *
11816
+ * `NgZone` is provided by default today so the default (and only) implementation for this
11817
+ * is calling `ErrorHandler.handleError` outside of the Angular zone.
11818
+ */
11819
+ const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
11820
+ providedIn: 'root',
11821
+ factory: () => {
11822
+ const userErrorHandler = inject(ErrorHandler);
11823
+ return userErrorHandler.handleError.bind(undefined);
11824
+ }
11825
+ });
11765
11826
 
11766
11827
  /**
11767
11828
  * Internal token that specifies whether DOM reuse logic
@@ -12030,7 +12091,8 @@ function processHostBindingOpCodes(tView, lView) {
12030
12091
  function createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {
12031
12092
  const lView = tView.blueprint.slice();
12032
12093
  lView[HOST] = host;
12033
- lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 128 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */;
12094
+ lView[FLAGS] = flags | 4 /* LViewFlags.CreationMode */ | 128 /* LViewFlags.Attached */ | 8 /* LViewFlags.FirstLViewPass */ |
12095
+ 64 /* LViewFlags.Dirty */;
12034
12096
  if (embeddedViewInjector !== null ||
12035
12097
  (parentLView && (parentLView[FLAGS] & 2048 /* LViewFlags.HasEmbeddedViewInjector */))) {
12036
12098
  lView[FLAGS] |= 2048 /* LViewFlags.HasEmbeddedViewInjector */;
@@ -13306,9 +13368,6 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
13306
13368
  afterRenderEventManager?.begin();
13307
13369
  }
13308
13370
  try {
13309
- const tView = lView[TVIEW];
13310
- const context = lView[CONTEXT];
13311
- refreshView(tView, lView, tView.template, context);
13312
13371
  detectChangesInViewWhileDirty(lView);
13313
13372
  }
13314
13373
  catch (error) {
@@ -13329,6 +13388,7 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
13329
13388
  }
13330
13389
  }
13331
13390
  function detectChangesInViewWhileDirty(lView) {
13391
+ detectChangesInView(lView, 0 /* ChangeDetectionMode.Global */);
13332
13392
  let retries = 0;
13333
13393
  // If after running change detection, this view still needs to be refreshed or there are
13334
13394
  // descendants views that need to be refreshed due to re-dirtying during the change detection
@@ -13641,6 +13701,7 @@ function detectChangesInChildComponents(hostLView, components, mode) {
13641
13701
  * @returns the root LView
13642
13702
  */
13643
13703
  function markViewDirty(lView) {
13704
+ lView[ENVIRONMENT].changeDetectionScheduler?.notify();
13644
13705
  while (lView) {
13645
13706
  lView[FLAGS] |= 64 /* LViewFlags.Dirty */;
13646
13707
  const parent = getLViewParent(lView);
@@ -13900,6 +13961,12 @@ class ViewRef$1 {
13900
13961
  * See {@link ChangeDetectorRef#detach} for more information.
13901
13962
  */
13902
13963
  detectChanges() {
13964
+ // Add `RefreshView` flag to ensure this view is refreshed if not already dirty.
13965
+ // `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before
13966
+ // executing any of the actual refresh code while the `Dirty` flag doesn't get cleared
13967
+ // until the end of the refresh. Using `RefreshView` prevents creating a potential difference
13968
+ // in the state of the LViewFlags during template execution.
13969
+ this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
13903
13970
  detectChangesInternal(this._lView, this.notifyErrorHandler);
13904
13971
  }
13905
13972
  /**
@@ -13928,6 +13995,7 @@ class ViewRef$1 {
13928
13995
  throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');
13929
13996
  }
13930
13997
  this._appRef = appRef;
13998
+ updateAncestorTraversalFlagsOnAttach(this._lView);
13931
13999
  }
13932
14000
  }
13933
14001
 
@@ -14269,10 +14337,9 @@ function performanceMarkFeature(feature) {
14269
14337
  return;
14270
14338
  }
14271
14339
  markedFeatures.add(feature);
14272
- performance?.mark?.('mark_use_counter', { detail: { feature } });
14340
+ performance?.mark?.('mark_feature_usage', { detail: { feature } });
14273
14341
  }
14274
14342
 
14275
- /// <reference types="rxjs" />
14276
14343
  class EventEmitter_ extends Subject {
14277
14344
  constructor(isAsync = false) {
14278
14345
  super();
@@ -14771,63 +14838,6 @@ class NoopNgZone {
14771
14838
  return fn.apply(applyThis, applyArgs);
14772
14839
  }
14773
14840
  }
14774
- /**
14775
- * Token used to drive ApplicationRef.isStable
14776
- *
14777
- * TODO: This should be moved entirely to NgZone (as a breaking change) so it can be tree-shakeable
14778
- * for `NoopNgZone` which is always just an `Observable` of `true`. Additionally, we should consider
14779
- * whether the property on `NgZone` should be `Observable` or `Signal`.
14780
- */
14781
- const ZONE_IS_STABLE_OBSERVABLE = new InjectionToken(ngDevMode ? 'isStable Observable' : '', {
14782
- providedIn: 'root',
14783
- // TODO(atscott): Replace this with a suitable default like `new
14784
- // BehaviorSubject(true).asObservable`. Again, long term this won't exist on ApplicationRef at
14785
- // all but until we can remove it, we need a default value zoneless.
14786
- factory: isStableFactory,
14787
- });
14788
- function isStableFactory() {
14789
- const zone = inject(NgZone);
14790
- let _stable = true;
14791
- const isCurrentlyStable = new Observable((observer) => {
14792
- _stable = zone.isStable && !zone.hasPendingMacrotasks && !zone.hasPendingMicrotasks;
14793
- zone.runOutsideAngular(() => {
14794
- observer.next(_stable);
14795
- observer.complete();
14796
- });
14797
- });
14798
- const isStable = new Observable((observer) => {
14799
- // Create the subscription to onStable outside the Angular Zone so that
14800
- // the callback is run outside the Angular Zone.
14801
- let stableSub;
14802
- zone.runOutsideAngular(() => {
14803
- stableSub = zone.onStable.subscribe(() => {
14804
- NgZone.assertNotInAngularZone();
14805
- // Check whether there are no pending macro/micro tasks in the next tick
14806
- // to allow for NgZone to update the state.
14807
- queueMicrotask(() => {
14808
- if (!_stable && !zone.hasPendingMacrotasks && !zone.hasPendingMicrotasks) {
14809
- _stable = true;
14810
- observer.next(true);
14811
- }
14812
- });
14813
- });
14814
- });
14815
- const unstableSub = zone.onUnstable.subscribe(() => {
14816
- NgZone.assertInAngularZone();
14817
- if (_stable) {
14818
- _stable = false;
14819
- zone.runOutsideAngular(() => {
14820
- observer.next(false);
14821
- });
14822
- }
14823
- });
14824
- return () => {
14825
- stableSub.unsubscribe();
14826
- unstableSub.unsubscribe();
14827
- };
14828
- });
14829
- return merge$1(isCurrentlyStable, isStable.pipe(share()));
14830
- }
14831
14841
  function shouldBeIgnoredByZone(applyArgs) {
14832
14842
  if (!Array.isArray(applyArgs)) {
14833
14843
  return false;
@@ -14840,8 +14850,15 @@ function shouldBeIgnoredByZone(applyArgs) {
14840
14850
  // Prevent triggering change detection when the __ignore_ng_zone__ flag is detected.
14841
14851
  return applyArgs[0].data?.['__ignore_ng_zone__'] === true;
14842
14852
  }
14843
-
14844
- // Public API for Zone
14853
+ function getNgZone(ngZoneToUse = 'zone.js', options) {
14854
+ if (ngZoneToUse === 'noop') {
14855
+ return new NoopNgZone();
14856
+ }
14857
+ if (ngZoneToUse === 'zone.js') {
14858
+ return new NgZone(options);
14859
+ }
14860
+ return ngZoneToUse;
14861
+ }
14845
14862
 
14846
14863
  /**
14847
14864
  * The phase to run an `afterRender` or `afterNextRender` callback in.
@@ -15460,12 +15477,14 @@ class ComponentFactory extends ComponentFactory$1 {
15460
15477
  }
15461
15478
  const sanitizer = rootViewInjector.get(Sanitizer, null);
15462
15479
  const afterRenderEventManager = rootViewInjector.get(AfterRenderEventManager, null);
15480
+ const changeDetectionScheduler = rootViewInjector.get(ChangeDetectionScheduler, null);
15463
15481
  const environment = {
15464
15482
  rendererFactory,
15465
15483
  sanitizer,
15466
15484
  // We don't use inline effects (yet).
15467
15485
  inlineEffectRunner: null,
15468
15486
  afterRenderEventManager,
15487
+ changeDetectionScheduler,
15469
15488
  };
15470
15489
  const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
15471
15490
  // Determine a tag name used for creating host elements when this component is created
@@ -15474,12 +15493,13 @@ class ComponentFactory extends ComponentFactory$1 {
15474
15493
  const hostRNode = rootSelectorOrNode ?
15475
15494
  locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation, rootViewInjector) :
15476
15495
  createElementNode(hostRenderer, elementName, getNamespace(elementName));
15477
- // Signal components use the granular "RefreshView" for change detection
15478
- const signalFlags = (4096 /* LViewFlags.SignalView */ | 512 /* LViewFlags.IsRoot */);
15479
- // Non-signal components use the traditional "CheckAlways or OnPush/Dirty" change detection
15480
- const nonSignalFlags = this.componentDef.onPush ? 64 /* LViewFlags.Dirty */ | 512 /* LViewFlags.IsRoot */ :
15481
- 16 /* LViewFlags.CheckAlways */ | 512 /* LViewFlags.IsRoot */;
15482
- const rootFlags = this.componentDef.signals ? signalFlags : nonSignalFlags;
15496
+ let rootFlags = 512 /* LViewFlags.IsRoot */;
15497
+ if (this.componentDef.signals) {
15498
+ rootFlags |= 4096 /* LViewFlags.SignalView */;
15499
+ }
15500
+ else if (!this.componentDef.onPush) {
15501
+ rootFlags |= 16 /* LViewFlags.CheckAlways */;
15502
+ }
15483
15503
  let hydrationInfo = null;
15484
15504
  if (hostRNode !== null) {
15485
15505
  hydrationInfo = retrieveHydrationInfo(hostRNode, rootViewInjector, true /* isRootView */);
@@ -15686,7 +15706,8 @@ function createRootComponent(componentView, rootComponentDef, rootDirectives, ho
15686
15706
  /** Sets the static attributes on a root component. */
15687
15707
  function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
15688
15708
  if (rootSelectorOrNode) {
15689
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
15709
+ // The placeholder will be replaced with the actual version at build time.
15710
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', '17.1.0-next.5']);
15690
15711
  }
15691
15712
  else {
15692
15713
  // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
@@ -19586,7 +19607,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
19586
19607
  }
19587
19608
  // Fallback to the slow path: we need to learn more about the content of the live and new
19588
19609
  // collections.
19589
- detachedItems ??= new MultiMap();
19610
+ detachedItems ??= new UniqueValueMultiKeyMap();
19590
19611
  liveKeysInTheFuture ??=
19591
19612
  initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
19592
19613
  // Check if I'm inserting a previously detached item: if so, attach it here
@@ -19634,7 +19655,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
19634
19655
  newIterationResult = newCollectionIterator.next();
19635
19656
  }
19636
19657
  else {
19637
- detachedItems ??= new MultiMap();
19658
+ detachedItems ??= new UniqueValueMultiKeyMap();
19638
19659
  liveKeysInTheFuture ??=
19639
19660
  initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
19640
19661
  // Check if I'm inserting a previously detached item: if so, attach it here
@@ -19700,40 +19721,73 @@ function initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {
19700
19721
  }
19701
19722
  return keys;
19702
19723
  }
19703
- class MultiMap {
19724
+ /**
19725
+ * A specific, partial implementation of the Map interface with the following characteristics:
19726
+ * - allows multiple values for a given key;
19727
+ * - maintain FIFO order for multiple values corresponding to a given key;
19728
+ * - assumes that all values are unique.
19729
+ *
19730
+ * The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated
19731
+ * (the most common case in the list reconciliation algorithm). To achieve this, the first value for
19732
+ * a given key is stored in a regular map. Then, when more values are set for a given key, we
19733
+ * maintain a form of linked list in a separate map. To maintain this linked list we assume that all
19734
+ * values (in the entire collection) are unique.
19735
+ */
19736
+ class UniqueValueMultiKeyMap {
19704
19737
  constructor() {
19705
- this.map = new Map();
19738
+ // A map from a key to the first value corresponding to this key.
19739
+ this.kvMap = new Map();
19740
+ // A map that acts as a linked list of values - each value maps to the next value in this "linked
19741
+ // list" (this only works if values are unique). Allocated lazily to avoid memory consumption when
19742
+ // there are no duplicated values.
19743
+ this._vMap = undefined;
19706
19744
  }
19707
19745
  has(key) {
19708
- const listOfKeys = this.map.get(key);
19709
- return listOfKeys !== undefined && listOfKeys.length > 0;
19746
+ return this.kvMap.has(key);
19710
19747
  }
19711
19748
  delete(key) {
19712
- const listOfKeys = this.map.get(key);
19713
- if (listOfKeys !== undefined) {
19714
- listOfKeys.shift();
19715
- return true;
19749
+ if (!this.has(key))
19750
+ return false;
19751
+ const value = this.kvMap.get(key);
19752
+ if (this._vMap !== undefined && this._vMap.has(value)) {
19753
+ this.kvMap.set(key, this._vMap.get(value));
19754
+ this._vMap.delete(value);
19716
19755
  }
19717
- return false;
19756
+ else {
19757
+ this.kvMap.delete(key);
19758
+ }
19759
+ return true;
19718
19760
  }
19719
19761
  get(key) {
19720
- const listOfKeys = this.map.get(key);
19721
- return listOfKeys !== undefined && listOfKeys.length > 0 ? listOfKeys[0] : undefined;
19762
+ return this.kvMap.get(key);
19722
19763
  }
19723
19764
  set(key, value) {
19724
- // if value is array, they we always store it as [value].
19725
- if (!this.map.has(key)) {
19726
- this.map.set(key, [value]);
19727
- return;
19765
+ if (this.kvMap.has(key)) {
19766
+ let prevValue = this.kvMap.get(key);
19767
+ ngDevMode &&
19768
+ assertNotSame(prevValue, value, `Detected a duplicated value ${value} for the key ${key}`);
19769
+ if (this._vMap === undefined) {
19770
+ this._vMap = new Map();
19771
+ }
19772
+ const vMap = this._vMap;
19773
+ while (vMap.has(prevValue)) {
19774
+ prevValue = vMap.get(prevValue);
19775
+ }
19776
+ vMap.set(prevValue, value);
19777
+ }
19778
+ else {
19779
+ this.kvMap.set(key, value);
19728
19780
  }
19729
- // THINK: this allows duplicate values, but I guess this is fine?
19730
- // Is the existing key an array or not?
19731
- this.map.get(key)?.push(value);
19732
19781
  }
19733
19782
  forEach(cb) {
19734
- for (const [key, values] of this.map) {
19735
- for (const value of values) {
19736
- cb(value, key);
19783
+ for (let [key, value] of this.kvMap) {
19784
+ cb(value, key);
19785
+ if (this._vMap !== undefined) {
19786
+ const vMap = this._vMap;
19787
+ while (vMap.has(value)) {
19788
+ value = vMap.get(value);
19789
+ cb(value, key);
19790
+ }
19737
19791
  }
19738
19792
  }
19739
19793
  }
@@ -20447,10 +20501,12 @@ class RepeaterMetadata {
20447
20501
  * @param emptyTemplateFn Reference to the template function of the empty block.
20448
20502
  * @param emptyDecls The number of nodes, local refs, and pipes for the empty block.
20449
20503
  * @param emptyVars The number of bindings for the empty block.
20504
+ * @param emptyTagName The name of the empty block container element, if applicable
20505
+ * @param emptyAttrsIndex Index of the empty block template attributes in the `consts` array.
20450
20506
  *
20451
20507
  * @codeGenApi
20452
20508
  */
20453
- function ɵɵrepeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars) {
20509
+ function ɵɵrepeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex, trackByFn, trackByUsesComponentInstance, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex) {
20454
20510
  performanceMarkFeature('NgControlFlow');
20455
20511
  const hasEmptyBlock = emptyTemplateFn !== undefined;
20456
20512
  const hostLView = getLView();
@@ -20467,7 +20523,7 @@ function ɵɵrepeaterCreate(index, templateFn, decls, vars, tagName, attrsIndex,
20467
20523
  assertDefined(emptyDecls, 'Missing number of declarations for the empty repeater block.');
20468
20524
  ngDevMode &&
20469
20525
  assertDefined(emptyVars, 'Missing number of bindings for the empty repeater block.');
20470
- ɵɵtemplate(index + 2, emptyTemplateFn, emptyDecls, emptyVars);
20526
+ ɵɵtemplate(index + 2, emptyTemplateFn, emptyDecls, emptyVars, emptyTagName, emptyAttrsIndex);
20471
20527
  }
20472
20528
  }
20473
20529
  class LiveCollectionLContainerImpl extends LiveCollection {
@@ -20708,6 +20764,8 @@ function invokeAllTriggerCleanupFns(lDetails) {
20708
20764
  invokeTriggerCleanupFns(0 /* TriggerType.Regular */, lDetails);
20709
20765
  }
20710
20766
 
20767
+ // Public API for Zone
20768
+
20711
20769
  /**
20712
20770
  * Calculates a data slot index for defer block info (either static or
20713
20771
  * instance-specific), given an index of a defer instruction.
@@ -27875,7 +27933,7 @@ class QueryList {
27875
27933
  * Returns `Observable` of `QueryList` notifying the subscriber of changes.
27876
27934
  */
27877
27935
  get changes() {
27878
- return this._changes || (this._changes = new EventEmitter());
27936
+ return this._changes ??= new EventEmitter();
27879
27937
  }
27880
27938
  /**
27881
27939
  * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
@@ -27887,7 +27945,7 @@ class QueryList {
27887
27945
  this.dirty = true;
27888
27946
  this._results = [];
27889
27947
  this._changesDetected = false;
27890
- this._changes = null;
27948
+ this._changes = undefined;
27891
27949
  this.length = 0;
27892
27950
  this.first = undefined;
27893
27951
  this.last = undefined;
@@ -27978,7 +28036,7 @@ class QueryList {
27978
28036
  * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
27979
28037
  */
27980
28038
  notifyOnChanges() {
27981
- if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))
28039
+ if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly))
27982
28040
  this._changes.emit(this);
27983
28041
  }
27984
28042
  /** internal */
@@ -27987,8 +28045,10 @@ class QueryList {
27987
28045
  }
27988
28046
  /** internal */
27989
28047
  destroy() {
27990
- this.changes.complete();
27991
- this.changes.unsubscribe();
28048
+ if (this._changes !== undefined) {
28049
+ this._changes.complete();
28050
+ this._changes.unsubscribe();
28051
+ }
27992
28052
  }
27993
28053
  }
27994
28054
 
@@ -29908,6 +29968,25 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
29908
29968
  * to be used by the decorator versions of these annotations.
29909
29969
  */
29910
29970
 
29971
+ /**
29972
+ * @description Represents the version of Angular
29973
+ *
29974
+ * @publicApi
29975
+ */
29976
+ class Version {
29977
+ constructor(full) {
29978
+ this.full = full;
29979
+ const parts = full.split('.');
29980
+ this.major = parts[0];
29981
+ this.minor = parts[1];
29982
+ this.patch = parts.slice(2).join('.');
29983
+ }
29984
+ }
29985
+ /**
29986
+ * @publicApi
29987
+ */
29988
+ const VERSION = new Version('17.1.0-next.5');
29989
+
29911
29990
  /*
29912
29991
  * This file exists to support compilation of @angular/core in Ivy mode.
29913
29992
  *
@@ -29928,190 +30007,6 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
29928
30007
  */
29929
30008
  const ITS_JUST_ANGULAR = true;
29930
30009
 
29931
- /**
29932
- * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
29933
- * one or more initialization functions.
29934
- *
29935
- * The provided functions are injected at application startup and executed during
29936
- * app initialization. If any of these functions returns a Promise or an Observable, initialization
29937
- * does not complete until the Promise is resolved or the Observable is completed.
29938
- *
29939
- * You can, for example, create a factory function that loads language data
29940
- * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
29941
- * The function is executed during the application bootstrap process,
29942
- * and the needed data is available on startup.
29943
- *
29944
- * @see {@link ApplicationInitStatus}
29945
- *
29946
- * @usageNotes
29947
- *
29948
- * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
29949
- * and a function returning a promise.
29950
- * ### Example with NgModule-based application
29951
- * ```
29952
- * function initializeApp(): Promise<any> {
29953
- * return new Promise((resolve, reject) => {
29954
- * // Do some asynchronous stuff
29955
- * resolve();
29956
- * });
29957
- * }
29958
- *
29959
- * @NgModule({
29960
- * imports: [BrowserModule],
29961
- * declarations: [AppComponent],
29962
- * bootstrap: [AppComponent],
29963
- * providers: [{
29964
- * provide: APP_INITIALIZER,
29965
- * useFactory: () => initializeApp,
29966
- * multi: true
29967
- * }]
29968
- * })
29969
- * export class AppModule {}
29970
- * ```
29971
- *
29972
- * ### Example with standalone application
29973
- * ```
29974
- * export function initializeApp(http: HttpClient) {
29975
- * return (): Promise<any> =>
29976
- * firstValueFrom(
29977
- * http
29978
- * .get("https://someUrl.com/api/user")
29979
- * .pipe(tap(user => { ... }))
29980
- * );
29981
- * }
29982
- *
29983
- * bootstrapApplication(App, {
29984
- * providers: [
29985
- * provideHttpClient(),
29986
- * {
29987
- * provide: APP_INITIALIZER,
29988
- * useFactory: initializeApp,
29989
- * multi: true,
29990
- * deps: [HttpClient],
29991
- * },
29992
- * ],
29993
- * });
29994
-
29995
- * ```
29996
- *
29997
- *
29998
- * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
29999
- * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
30000
- * demo purposes to illustrate how the factory function can work with other providers available
30001
- * through DI.
30002
- *
30003
- * ### Example with NgModule-based application
30004
- * ```
30005
- * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
30006
- * return () => httpClient.get("https://someUrl.com/api/user")
30007
- * .pipe(
30008
- * tap(user => { ... })
30009
- * );
30010
- * }
30011
- *
30012
- * @NgModule({
30013
- * imports: [BrowserModule, HttpClientModule],
30014
- * declarations: [AppComponent],
30015
- * bootstrap: [AppComponent],
30016
- * providers: [{
30017
- * provide: APP_INITIALIZER,
30018
- * useFactory: initializeAppFactory,
30019
- * deps: [HttpClient],
30020
- * multi: true
30021
- * }]
30022
- * })
30023
- * export class AppModule {}
30024
- * ```
30025
- *
30026
- * ### Example with standalone application
30027
- * ```
30028
- * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
30029
- * return () => httpClient.get("https://someUrl.com/api/user")
30030
- * .pipe(
30031
- * tap(user => { ... })
30032
- * );
30033
- * }
30034
- *
30035
- * bootstrapApplication(App, {
30036
- * providers: [
30037
- * provideHttpClient(),
30038
- * {
30039
- * provide: APP_INITIALIZER,
30040
- * useFactory: initializeAppFactory,
30041
- * multi: true,
30042
- * deps: [HttpClient],
30043
- * },
30044
- * ],
30045
- * });
30046
- * ```
30047
- *
30048
- * @publicApi
30049
- */
30050
- const APP_INITIALIZER = new InjectionToken('Application Initializer');
30051
- /**
30052
- * A class that reflects the state of running {@link APP_INITIALIZER} functions.
30053
- *
30054
- * @publicApi
30055
- */
30056
- class ApplicationInitStatus {
30057
- constructor() {
30058
- this.initialized = false;
30059
- this.done = false;
30060
- this.donePromise = new Promise((res, rej) => {
30061
- this.resolve = res;
30062
- this.reject = rej;
30063
- });
30064
- this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
30065
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
30066
- throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
30067
- `(expected an array, but got ${typeof this.appInits}). ` +
30068
- 'Please check that the `APP_INITIALIZER` token is configured as a ' +
30069
- '`multi: true` provider.');
30070
- }
30071
- }
30072
- /** @internal */
30073
- runInitializers() {
30074
- if (this.initialized) {
30075
- return;
30076
- }
30077
- const asyncInitPromises = [];
30078
- for (const appInits of this.appInits) {
30079
- const initResult = appInits();
30080
- if (isPromise(initResult)) {
30081
- asyncInitPromises.push(initResult);
30082
- }
30083
- else if (isSubscribable(initResult)) {
30084
- const observableAsPromise = new Promise((resolve, reject) => {
30085
- initResult.subscribe({ complete: resolve, error: reject });
30086
- });
30087
- asyncInitPromises.push(observableAsPromise);
30088
- }
30089
- }
30090
- const complete = () => {
30091
- // @ts-expect-error overwriting a readonly
30092
- this.done = true;
30093
- this.resolve();
30094
- };
30095
- Promise.all(asyncInitPromises)
30096
- .then(() => {
30097
- complete();
30098
- })
30099
- .catch(e => {
30100
- this.reject(e);
30101
- });
30102
- if (asyncInitPromises.length === 0) {
30103
- complete();
30104
- }
30105
- this.initialized = true;
30106
- }
30107
- static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
30108
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
30109
- }
30110
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
30111
- type: Injectable,
30112
- args: [{ providedIn: 'root' }]
30113
- }], () => [], null); })();
30114
-
30115
30010
  class Console {
30116
30011
  log(message) {
30117
30012
  // tslint:disable-next-line:no-console
@@ -30131,503 +30026,182 @@ class Console {
30131
30026
  }], null, null); })();
30132
30027
 
30133
30028
  /**
30134
- * Work out the locale from the potential global properties.
30029
+ * Combination of NgModuleFactory and ComponentFactories.
30135
30030
  *
30136
- * * Closure Compiler: use `goog.LOCALE`.
30137
- * * Ivy enabled: use `$localize.locale`
30031
+ * @publicApi
30032
+ *
30033
+ * @deprecated
30034
+ * Ivy JIT mode doesn't require accessing this symbol.
30035
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30036
+ * additional context.
30138
30037
  */
30139
- function getGlobalLocale() {
30140
- if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
30141
- typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
30142
- // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
30143
- // * In order to preserve backwards compatibility, we use Angular default value over
30144
- // Closure Compiler's one.
30145
- return goog.LOCALE;
30146
- }
30147
- else {
30148
- // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
30149
- // COMPILE-TIME INLINER.
30150
- //
30151
- // * During compile time inlining of translations the expression will be replaced
30152
- // with a string literal that is the current locale. Other forms of this expression are not
30153
- // guaranteed to be replaced.
30154
- //
30155
- // * During runtime translation evaluation, the developer is required to set `$localize.locale`
30156
- // if required, or just to provide their own `LOCALE_ID` provider.
30157
- return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
30038
+ class ModuleWithComponentFactories {
30039
+ constructor(ngModuleFactory, componentFactories) {
30040
+ this.ngModuleFactory = ngModuleFactory;
30041
+ this.componentFactories = componentFactories;
30158
30042
  }
30159
30043
  }
30160
30044
  /**
30161
- * Provide this token to set the locale of your application.
30162
- * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
30163
- * DecimalPipe and PercentPipe) and by ICU expressions.
30164
- *
30165
- * See the [i18n guide](guide/i18n-common-locale-id) for more information.
30045
+ * Low-level service for running the angular compiler during runtime
30046
+ * to create {@link ComponentFactory}s, which
30047
+ * can later be used to create and render a Component instance.
30166
30048
  *
30167
- * @usageNotes
30168
- * ### Example
30049
+ * Each `@NgModule` provides an own `Compiler` to its injector,
30050
+ * that will use the directives/pipes of the ng module for compilation
30051
+ * of components.
30169
30052
  *
30170
- * ```typescript
30171
- * import { LOCALE_ID } from '@angular/core';
30172
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30173
- * import { AppModule } from './app/app.module';
30053
+ * @publicApi
30174
30054
  *
30175
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30176
- * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
30177
- * });
30178
- * ```
30055
+ * @deprecated
30056
+ * Ivy JIT mode doesn't require accessing this symbol.
30057
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30058
+ * additional context.
30059
+ */
30060
+ class Compiler {
30061
+ /**
30062
+ * Compiles the given NgModule and all of its components. All templates of the components
30063
+ * have to be inlined.
30064
+ */
30065
+ compileModuleSync(moduleType) {
30066
+ return new NgModuleFactory(moduleType);
30067
+ }
30068
+ /**
30069
+ * Compiles the given NgModule and all of its components
30070
+ */
30071
+ compileModuleAsync(moduleType) {
30072
+ return Promise.resolve(this.compileModuleSync(moduleType));
30073
+ }
30074
+ /**
30075
+ * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
30076
+ */
30077
+ compileModuleAndAllComponentsSync(moduleType) {
30078
+ const ngModuleFactory = this.compileModuleSync(moduleType);
30079
+ const moduleDef = getNgModuleDef(moduleType);
30080
+ const componentFactories = maybeUnwrapFn(moduleDef.declarations)
30081
+ .reduce((factories, declaration) => {
30082
+ const componentDef = getComponentDef(declaration);
30083
+ componentDef && factories.push(new ComponentFactory(componentDef));
30084
+ return factories;
30085
+ }, []);
30086
+ return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
30087
+ }
30088
+ /**
30089
+ * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
30090
+ */
30091
+ compileModuleAndAllComponentsAsync(moduleType) {
30092
+ return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
30093
+ }
30094
+ /**
30095
+ * Clears all caches.
30096
+ */
30097
+ clearCache() { }
30098
+ /**
30099
+ * Clears the cache for the given component/ngModule.
30100
+ */
30101
+ clearCacheFor(type) { }
30102
+ /**
30103
+ * Returns the id for a given NgModule, if one is defined and known to the compiler.
30104
+ */
30105
+ getModuleId(moduleType) {
30106
+ return undefined;
30107
+ }
30108
+ static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
30109
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
30110
+ }
30111
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
30112
+ type: Injectable,
30113
+ args: [{ providedIn: 'root' }]
30114
+ }], null, null); })();
30115
+ /**
30116
+ * Token to provide CompilerOptions in the platform injector.
30179
30117
  *
30180
30118
  * @publicApi
30181
30119
  */
30182
- const LOCALE_ID = new InjectionToken('LocaleId', {
30183
- providedIn: 'root',
30184
- factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
30185
- });
30120
+ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
30186
30121
  /**
30187
- * Provide this token to set the default currency code your application uses for
30188
- * CurrencyPipe when there is no currency code passed into it. This is only used by
30189
- * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
30122
+ * A factory for creating a Compiler
30190
30123
  *
30191
- * See the [i18n guide](guide/i18n-common-locale-id) for more information.
30124
+ * @publicApi
30192
30125
  *
30193
- * <div class="alert is-helpful">
30126
+ * @deprecated
30127
+ * Ivy JIT mode doesn't require accessing this symbol.
30128
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30129
+ * additional context.
30130
+ */
30131
+ class CompilerFactory {
30132
+ }
30133
+
30134
+ /**
30135
+ * *Internal* service that keeps track of pending tasks happening in the system.
30194
30136
  *
30195
- * **Deprecation notice:**
30137
+ * This information is needed to make sure that the serialization on the server
30138
+ * is delayed until all tasks in the queue (such as an initial navigation or a
30139
+ * pending HTTP request) are completed.
30196
30140
  *
30197
- * The default currency code is currently always `USD` but this is deprecated from v9.
30141
+ * Pending tasks continue to contribute to the stableness of `ApplicationRef`
30142
+ * throughout the lifetime of the application.
30143
+ */
30144
+ class PendingTasks {
30145
+ constructor() {
30146
+ this.taskId = 0;
30147
+ this.pendingTasks = new Set();
30148
+ this.hasPendingTasks = new BehaviorSubject(false);
30149
+ }
30150
+ get _hasPendingTasks() {
30151
+ return this.hasPendingTasks.value;
30152
+ }
30153
+ add() {
30154
+ if (!this._hasPendingTasks) {
30155
+ this.hasPendingTasks.next(true);
30156
+ }
30157
+ const taskId = this.taskId++;
30158
+ this.pendingTasks.add(taskId);
30159
+ return taskId;
30160
+ }
30161
+ remove(taskId) {
30162
+ this.pendingTasks.delete(taskId);
30163
+ if (this.pendingTasks.size === 0 && this._hasPendingTasks) {
30164
+ this.hasPendingTasks.next(false);
30165
+ }
30166
+ }
30167
+ ngOnDestroy() {
30168
+ this.pendingTasks.clear();
30169
+ if (this._hasPendingTasks) {
30170
+ this.hasPendingTasks.next(false);
30171
+ }
30172
+ }
30173
+ static { this.ɵfac = function PendingTasks_Factory(t) { return new (t || PendingTasks)(); }; }
30174
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PendingTasks, factory: PendingTasks.ɵfac, providedIn: 'root' }); }
30175
+ }
30176
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PendingTasks, [{
30177
+ type: Injectable,
30178
+ args: [{ providedIn: 'root' }]
30179
+ }], null, null); })();
30180
+
30181
+ /**
30182
+ * These are the data structures that our framework injector profiler will fill with data in order
30183
+ * to support DI debugging APIs.
30198
30184
  *
30199
- * **In v10 the default currency code will be taken from the current locale.**
30185
+ * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
30186
+ * dependencies. Injector -> Token -> Dependencies This is used to support the
30187
+ * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
30188
+ * dependencies.
30200
30189
  *
30201
- * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
30202
- * your application `NgModule`:
30190
+ * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
30191
+ * within it This is used to support the getInjectorProviders API, which takes in an injector and
30192
+ * returns the providers that it was configured with. Note that for the element injector case we
30193
+ * use the TNode instead of the LView as the DI resolver. This is because the registration of
30194
+ * providers happens only once per type of TNode. If an injector is created with an identical TNode,
30195
+ * the providers for that injector will not be reconfigured.
30203
30196
  *
30204
- * ```ts
30205
- * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
30206
- * ```
30207
- *
30208
- * </div>
30209
- *
30210
- * @usageNotes
30211
- * ### Example
30212
- *
30213
- * ```typescript
30214
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30215
- * import { AppModule } from './app/app.module';
30216
- *
30217
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30218
- * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
30219
- * });
30220
- * ```
30221
- *
30222
- * @publicApi
30223
- */
30224
- const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
30225
- providedIn: 'root',
30226
- factory: () => USD_CURRENCY_CODE,
30227
- });
30228
- /**
30229
- * Use this token at bootstrap to provide the content of your translation file (`xtb`,
30230
- * `xlf` or `xlf2`) when you want to translate your application in another language.
30231
- *
30232
- * See the [i18n guide](guide/i18n-common-merge) for more information.
30233
- *
30234
- * @usageNotes
30235
- * ### Example
30236
- *
30237
- * ```typescript
30238
- * import { TRANSLATIONS } from '@angular/core';
30239
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30240
- * import { AppModule } from './app/app.module';
30241
- *
30242
- * // content of your translation file
30243
- * const translations = '....';
30244
- *
30245
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30246
- * providers: [{provide: TRANSLATIONS, useValue: translations }]
30247
- * });
30248
- * ```
30249
- *
30250
- * @publicApi
30251
- */
30252
- const TRANSLATIONS = new InjectionToken('Translations');
30253
- /**
30254
- * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
30255
- * `xlf` or `xlf2`.
30256
- *
30257
- * See the [i18n guide](guide/i18n-common-merge) for more information.
30258
- *
30259
- * @usageNotes
30260
- * ### Example
30261
- *
30262
- * ```typescript
30263
- * import { TRANSLATIONS_FORMAT } from '@angular/core';
30264
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30265
- * import { AppModule } from './app/app.module';
30266
- *
30267
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30268
- * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
30269
- * });
30270
- * ```
30271
- *
30272
- * @publicApi
30273
- */
30274
- const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
30275
- /**
30276
- * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
30277
- * that the compiler should use in case of missing translations:
30278
- * - Error: throw if you have missing translations.
30279
- * - Warning (default): show a warning in the console and/or shell.
30280
- * - Ignore: do nothing.
30281
- *
30282
- * See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
30283
- *
30284
- * @usageNotes
30285
- * ### Example
30286
- * ```typescript
30287
- * import { MissingTranslationStrategy } from '@angular/core';
30288
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30289
- * import { AppModule } from './app/app.module';
30290
- *
30291
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30292
- * missingTranslation: MissingTranslationStrategy.Error
30293
- * });
30294
- * ```
30295
- *
30296
- * @publicApi
30297
- */
30298
- var MissingTranslationStrategy;
30299
- (function (MissingTranslationStrategy) {
30300
- MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
30301
- MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
30302
- MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
30303
- })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
30304
-
30305
- // A delay in milliseconds before the scan is run after onLoad, to avoid any
30306
- // potential race conditions with other LCP-related functions. This delay
30307
- // happens outside of the main JavaScript execution and will only effect the timing
30308
- // on when the warning becomes visible in the console.
30309
- const SCAN_DELAY = 200;
30310
- const OVERSIZED_IMAGE_TOLERANCE = 1200;
30311
- class ImagePerformanceWarning {
30312
- constructor() {
30313
- // Map of full image URLs -> original `ngSrc` values.
30314
- this.window = null;
30315
- this.observer = null;
30316
- this.options = inject(IMAGE_CONFIG);
30317
- this.ngZone = inject(NgZone);
30318
- }
30319
- start() {
30320
- if (typeof PerformanceObserver === 'undefined' ||
30321
- (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
30322
- return;
30323
- }
30324
- this.observer = this.initPerformanceObserver();
30325
- const doc = getDocument();
30326
- const win = doc.defaultView;
30327
- if (typeof win !== 'undefined') {
30328
- this.window = win;
30329
- // Wait to avoid race conditions where LCP image triggers
30330
- // load event before it's recorded by the performance observer
30331
- const waitToScan = () => {
30332
- setTimeout(this.scanImages.bind(this), SCAN_DELAY);
30333
- };
30334
- // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
30335
- // the scope of this functionality.
30336
- this.ngZone.runOutsideAngular(() => {
30337
- // Consider the case when the application is created and destroyed multiple times.
30338
- // Typically, applications are created instantly once the page is loaded, and the
30339
- // `window.load` listener is always triggered. However, the `window.load` event will never
30340
- // be fired if the page is loaded, and the application is created later. Checking for
30341
- // `readyState` is the easiest way to determine whether the page has been loaded or not.
30342
- if (doc.readyState === 'complete') {
30343
- waitToScan();
30344
- }
30345
- else {
30346
- this.window?.addEventListener('load', waitToScan, { once: true });
30347
- }
30348
- });
30349
- }
30350
- }
30351
- ngOnDestroy() {
30352
- this.observer?.disconnect();
30353
- }
30354
- initPerformanceObserver() {
30355
- if (typeof PerformanceObserver === 'undefined') {
30356
- return null;
30357
- }
30358
- const observer = new PerformanceObserver((entryList) => {
30359
- const entries = entryList.getEntries();
30360
- if (entries.length === 0)
30361
- return;
30362
- // We use the latest entry produced by the `PerformanceObserver` as the best
30363
- // signal on which element is actually an LCP one. As an example, the first image to load on
30364
- // a page, by virtue of being the only thing on the page so far, is often a LCP candidate
30365
- // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
30366
- const lcpElement = entries[entries.length - 1];
30367
- // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
30368
- // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
30369
- const imgSrc = lcpElement.element?.src ?? '';
30370
- // Exclude `data:` and `blob:` URLs, since they are fetched resources.
30371
- if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
30372
- return;
30373
- this.lcpImageUrl = imgSrc;
30374
- });
30375
- observer.observe({ type: 'largest-contentful-paint', buffered: true });
30376
- return observer;
30377
- }
30378
- scanImages() {
30379
- const images = getDocument().querySelectorAll('img');
30380
- let lcpElementFound, lcpElementLoadedCorrectly = false;
30381
- images.forEach(image => {
30382
- if (!this.options?.disableImageSizeWarning) {
30383
- for (const image of images) {
30384
- // Image elements using the NgOptimizedImage directive are excluded,
30385
- // as that directive has its own version of this check.
30386
- if (!image.getAttribute('ng-img') && this.isOversized(image)) {
30387
- logOversizedImageWarning(image.src);
30388
- }
30389
- }
30390
- }
30391
- if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
30392
- if (image.src === this.lcpImageUrl) {
30393
- lcpElementFound = true;
30394
- if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
30395
- // This variable is set to true and never goes back to false to account
30396
- // for the case where multiple images have the same src url, and some
30397
- // have lazy loading while others don't.
30398
- // Also ignore NgOptimizedImage because there's a different warning for that.
30399
- lcpElementLoadedCorrectly = true;
30400
- }
30401
- }
30402
- }
30403
- });
30404
- if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
30405
- !this.options?.disableImageLazyLoadWarning) {
30406
- logLazyLCPWarning(this.lcpImageUrl);
30407
- }
30408
- }
30409
- isOversized(image) {
30410
- if (!this.window) {
30411
- return false;
30412
- }
30413
- const computedStyle = this.window.getComputedStyle(image);
30414
- let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
30415
- let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
30416
- const boxSizing = computedStyle.getPropertyValue('box-sizing');
30417
- const objectFit = computedStyle.getPropertyValue('object-fit');
30418
- if (objectFit === `cover`) {
30419
- // Object fit cover may indicate a use case such as a sprite sheet where
30420
- // this warning does not apply.
30421
- return false;
30422
- }
30423
- if (boxSizing === 'border-box') {
30424
- const paddingTop = computedStyle.getPropertyValue('padding-top');
30425
- const paddingRight = computedStyle.getPropertyValue('padding-right');
30426
- const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
30427
- const paddingLeft = computedStyle.getPropertyValue('padding-left');
30428
- renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
30429
- renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
30430
- }
30431
- const intrinsicWidth = image.naturalWidth;
30432
- const intrinsicHeight = image.naturalHeight;
30433
- const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
30434
- const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
30435
- const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
30436
- const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
30437
- return oversizedWidth || oversizedHeight;
30438
- }
30439
- static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
30440
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
30441
- }
30442
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
30443
- type: Injectable,
30444
- args: [{ providedIn: 'root' }]
30445
- }], null, null); })();
30446
- function logLazyLCPWarning(src) {
30447
- console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
30448
- `but was given a "loading" value of "lazy", which can negatively impact ` +
30449
- `application loading performance. This warning can be addressed by ` +
30450
- `changing the loading value of the LCP image to "eager", or by using the ` +
30451
- `NgOptimizedImage directive's prioritization utilities. For more ` +
30452
- `information about addressing or disabling this warning, see ` +
30453
- `https://angular.io/errors/NG0913`));
30454
- }
30455
- function logOversizedImageWarning(src) {
30456
- console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
30457
- `rendered size. This can negatively impact application loading performance. ` +
30458
- `For more information about addressing or disabling this warning, see ` +
30459
- `https://angular.io/errors/NG0913`));
30460
- }
30461
-
30462
- /**
30463
- * *Internal* service that keeps track of pending tasks happening in the system
30464
- * during the initial rendering. No tasks are tracked after an initial
30465
- * rendering.
30466
- *
30467
- * This information is needed to make sure that the serialization on the server
30468
- * is delayed until all tasks in the queue (such as an initial navigation or a
30469
- * pending HTTP request) are completed.
30470
- */
30471
- class InitialRenderPendingTasks {
30472
- constructor() {
30473
- this.taskId = 0;
30474
- this.pendingTasks = new Set();
30475
- this.hasPendingTasks = new BehaviorSubject(false);
30476
- }
30477
- add() {
30478
- this.hasPendingTasks.next(true);
30479
- const taskId = this.taskId++;
30480
- this.pendingTasks.add(taskId);
30481
- return taskId;
30482
- }
30483
- remove(taskId) {
30484
- this.pendingTasks.delete(taskId);
30485
- if (this.pendingTasks.size === 0) {
30486
- this.hasPendingTasks.next(false);
30487
- }
30488
- }
30489
- ngOnDestroy() {
30490
- this.pendingTasks.clear();
30491
- this.hasPendingTasks.next(false);
30492
- }
30493
- static { this.ɵfac = function InitialRenderPendingTasks_Factory(t) { return new (t || InitialRenderPendingTasks)(); }; }
30494
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: InitialRenderPendingTasks, factory: InitialRenderPendingTasks.ɵfac, providedIn: 'root' }); }
30495
- }
30496
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InitialRenderPendingTasks, [{
30497
- type: Injectable,
30498
- args: [{ providedIn: 'root' }]
30499
- }], null, null); })();
30500
-
30501
- /**
30502
- * Combination of NgModuleFactory and ComponentFactories.
30503
- *
30504
- * @publicApi
30505
- *
30506
- * @deprecated
30507
- * Ivy JIT mode doesn't require accessing this symbol.
30508
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30509
- * additional context.
30510
- */
30511
- class ModuleWithComponentFactories {
30512
- constructor(ngModuleFactory, componentFactories) {
30513
- this.ngModuleFactory = ngModuleFactory;
30514
- this.componentFactories = componentFactories;
30515
- }
30516
- }
30517
- /**
30518
- * Low-level service for running the angular compiler during runtime
30519
- * to create {@link ComponentFactory}s, which
30520
- * can later be used to create and render a Component instance.
30521
- *
30522
- * Each `@NgModule` provides an own `Compiler` to its injector,
30523
- * that will use the directives/pipes of the ng module for compilation
30524
- * of components.
30525
- *
30526
- * @publicApi
30527
- *
30528
- * @deprecated
30529
- * Ivy JIT mode doesn't require accessing this symbol.
30530
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30531
- * additional context.
30532
- */
30533
- class Compiler {
30534
- /**
30535
- * Compiles the given NgModule and all of its components. All templates of the components
30536
- * have to be inlined.
30537
- */
30538
- compileModuleSync(moduleType) {
30539
- return new NgModuleFactory(moduleType);
30540
- }
30541
- /**
30542
- * Compiles the given NgModule and all of its components
30543
- */
30544
- compileModuleAsync(moduleType) {
30545
- return Promise.resolve(this.compileModuleSync(moduleType));
30546
- }
30547
- /**
30548
- * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
30549
- */
30550
- compileModuleAndAllComponentsSync(moduleType) {
30551
- const ngModuleFactory = this.compileModuleSync(moduleType);
30552
- const moduleDef = getNgModuleDef(moduleType);
30553
- const componentFactories = maybeUnwrapFn(moduleDef.declarations)
30554
- .reduce((factories, declaration) => {
30555
- const componentDef = getComponentDef(declaration);
30556
- componentDef && factories.push(new ComponentFactory(componentDef));
30557
- return factories;
30558
- }, []);
30559
- return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
30560
- }
30561
- /**
30562
- * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
30563
- */
30564
- compileModuleAndAllComponentsAsync(moduleType) {
30565
- return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
30566
- }
30567
- /**
30568
- * Clears all caches.
30569
- */
30570
- clearCache() { }
30571
- /**
30572
- * Clears the cache for the given component/ngModule.
30573
- */
30574
- clearCacheFor(type) { }
30575
- /**
30576
- * Returns the id for a given NgModule, if one is defined and known to the compiler.
30577
- */
30578
- getModuleId(moduleType) {
30579
- return undefined;
30580
- }
30581
- static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
30582
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
30583
- }
30584
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
30585
- type: Injectable,
30586
- args: [{ providedIn: 'root' }]
30587
- }], null, null); })();
30588
- /**
30589
- * Token to provide CompilerOptions in the platform injector.
30590
- *
30591
- * @publicApi
30592
- */
30593
- const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
30594
- /**
30595
- * A factory for creating a Compiler
30596
- *
30597
- * @publicApi
30598
- *
30599
- * @deprecated
30600
- * Ivy JIT mode doesn't require accessing this symbol.
30601
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30602
- * additional context.
30603
- */
30604
- class CompilerFactory {
30605
- }
30606
-
30607
- /**
30608
- * These are the data structures that our framework injector profiler will fill with data in order
30609
- * to support DI debugging APIs.
30610
- *
30611
- * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
30612
- * dependencies. Injector -> Token -> Dependencies This is used to support the
30613
- * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
30614
- * dependencies.
30615
- *
30616
- * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
30617
- * within it This is used to support the getInjectorProviders API, which takes in an injector and
30618
- * returns the providers that it was configured with. Note that for the element injector case we
30619
- * use the TNode instead of the LView as the DI resolver. This is because the registration of
30620
- * providers happens only once per type of TNode. If an injector is created with an identical TNode,
30621
- * the providers for that injector will not be reconfigured.
30622
- *
30623
- * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
30624
- * component that it is associated with. Used in the getInjectorProviders API, specificially in the
30625
- * discovery of import paths for each provider. This is necessary because the imports array of a
30626
- * standalone component is processed and configured in its standalone injector, but exists within
30627
- * the component's definition. Because getInjectorProviders takes in an injector, if that injector
30628
- * is the injector of a standalone component, we need to be able to discover the place where the
30629
- * imports array is located (the component) in order to flatten the imports array within it to
30630
- * discover all of it's providers.
30197
+ * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
30198
+ * component that it is associated with. Used in the getInjectorProviders API, specificially in the
30199
+ * discovery of import paths for each provider. This is necessary because the imports array of a
30200
+ * standalone component is processed and configured in its standalone injector, but exists within
30201
+ * the component's definition. Because getInjectorProviders takes in an injector, if that injector
30202
+ * is the injector of a standalone component, we need to be able to discover the place where the
30203
+ * imports array is located (the component) in order to flatten the imports array within it to
30204
+ * discover all of it's providers.
30631
30205
  *
30632
30206
  *
30633
30207
  * All of these data structures are instantiated with WeakMaps. This will ensure that the presence
@@ -30864,6 +30438,7 @@ function applyChanges(component) {
30864
30438
  */
30865
30439
  function detectChanges(component) {
30866
30440
  const view = getComponentViewByInstance(component);
30441
+ view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
30867
30442
  detectChangesInternal(view);
30868
30443
  }
30869
30444
 
@@ -31759,19 +31334,190 @@ function setTestabilityGetter(getter) {
31759
31334
  }
31760
31335
  let _testabilityGetter;
31761
31336
 
31762
- let _platformInjector = null;
31763
31337
  /**
31764
- * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
31765
- * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
31338
+ * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
31339
+ * one or more initialization functions.
31340
+ *
31341
+ * The provided functions are injected at application startup and executed during
31342
+ * app initialization. If any of these functions returns a Promise or an Observable, initialization
31343
+ * does not complete until the Promise is resolved or the Observable is completed.
31344
+ *
31345
+ * You can, for example, create a factory function that loads language data
31346
+ * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
31347
+ * The function is executed during the application bootstrap process,
31348
+ * and the needed data is available on startup.
31349
+ *
31350
+ * @see {@link ApplicationInitStatus}
31351
+ *
31352
+ * @usageNotes
31353
+ *
31354
+ * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
31355
+ * and a function returning a promise.
31356
+ * ### Example with NgModule-based application
31357
+ * ```
31358
+ * function initializeApp(): Promise<any> {
31359
+ * return new Promise((resolve, reject) => {
31360
+ * // Do some asynchronous stuff
31361
+ * resolve();
31362
+ * });
31363
+ * }
31364
+ *
31365
+ * @NgModule({
31366
+ * imports: [BrowserModule],
31367
+ * declarations: [AppComponent],
31368
+ * bootstrap: [AppComponent],
31369
+ * providers: [{
31370
+ * provide: APP_INITIALIZER,
31371
+ * useFactory: () => initializeApp,
31372
+ * multi: true
31373
+ * }]
31374
+ * })
31375
+ * export class AppModule {}
31376
+ * ```
31377
+ *
31378
+ * ### Example with standalone application
31379
+ * ```
31380
+ * export function initializeApp(http: HttpClient) {
31381
+ * return (): Promise<any> =>
31382
+ * firstValueFrom(
31383
+ * http
31384
+ * .get("https://someUrl.com/api/user")
31385
+ * .pipe(tap(user => { ... }))
31386
+ * );
31387
+ * }
31388
+ *
31389
+ * bootstrapApplication(App, {
31390
+ * providers: [
31391
+ * provideHttpClient(),
31392
+ * {
31393
+ * provide: APP_INITIALIZER,
31394
+ * useFactory: initializeApp,
31395
+ * multi: true,
31396
+ * deps: [HttpClient],
31397
+ * },
31398
+ * ],
31399
+ * });
31400
+
31401
+ * ```
31402
+ *
31403
+ *
31404
+ * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
31405
+ * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
31406
+ * demo purposes to illustrate how the factory function can work with other providers available
31407
+ * through DI.
31408
+ *
31409
+ * ### Example with NgModule-based application
31410
+ * ```
31411
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
31412
+ * return () => httpClient.get("https://someUrl.com/api/user")
31413
+ * .pipe(
31414
+ * tap(user => { ... })
31415
+ * );
31416
+ * }
31417
+ *
31418
+ * @NgModule({
31419
+ * imports: [BrowserModule, HttpClientModule],
31420
+ * declarations: [AppComponent],
31421
+ * bootstrap: [AppComponent],
31422
+ * providers: [{
31423
+ * provide: APP_INITIALIZER,
31424
+ * useFactory: initializeAppFactory,
31425
+ * deps: [HttpClient],
31426
+ * multi: true
31427
+ * }]
31428
+ * })
31429
+ * export class AppModule {}
31430
+ * ```
31431
+ *
31432
+ * ### Example with standalone application
31433
+ * ```
31434
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
31435
+ * return () => httpClient.get("https://someUrl.com/api/user")
31436
+ * .pipe(
31437
+ * tap(user => { ... })
31438
+ * );
31439
+ * }
31440
+ *
31441
+ * bootstrapApplication(App, {
31442
+ * providers: [
31443
+ * provideHttpClient(),
31444
+ * {
31445
+ * provide: APP_INITIALIZER,
31446
+ * useFactory: initializeAppFactory,
31447
+ * multi: true,
31448
+ * deps: [HttpClient],
31449
+ * },
31450
+ * ],
31451
+ * });
31452
+ * ```
31453
+ *
31454
+ * @publicApi
31766
31455
  */
31767
- const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
31456
+ const APP_INITIALIZER = new InjectionToken('Application Initializer');
31768
31457
  /**
31769
- * Internal token that allows to register extra callbacks that should be invoked during the
31770
- * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
31771
- * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
31772
- * entire class tree-shakeable.
31458
+ * A class that reflects the state of running {@link APP_INITIALIZER} functions.
31459
+ *
31460
+ * @publicApi
31773
31461
  */
31774
- const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
31462
+ class ApplicationInitStatus {
31463
+ constructor() {
31464
+ this.initialized = false;
31465
+ this.done = false;
31466
+ this.donePromise = new Promise((res, rej) => {
31467
+ this.resolve = res;
31468
+ this.reject = rej;
31469
+ });
31470
+ this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
31471
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
31472
+ throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
31473
+ `(expected an array, but got ${typeof this.appInits}). ` +
31474
+ 'Please check that the `APP_INITIALIZER` token is configured as a ' +
31475
+ '`multi: true` provider.');
31476
+ }
31477
+ }
31478
+ /** @internal */
31479
+ runInitializers() {
31480
+ if (this.initialized) {
31481
+ return;
31482
+ }
31483
+ const asyncInitPromises = [];
31484
+ for (const appInits of this.appInits) {
31485
+ const initResult = appInits();
31486
+ if (isPromise(initResult)) {
31487
+ asyncInitPromises.push(initResult);
31488
+ }
31489
+ else if (isSubscribable(initResult)) {
31490
+ const observableAsPromise = new Promise((resolve, reject) => {
31491
+ initResult.subscribe({ complete: resolve, error: reject });
31492
+ });
31493
+ asyncInitPromises.push(observableAsPromise);
31494
+ }
31495
+ }
31496
+ const complete = () => {
31497
+ // @ts-expect-error overwriting a readonly
31498
+ this.done = true;
31499
+ this.resolve();
31500
+ };
31501
+ Promise.all(asyncInitPromises)
31502
+ .then(() => {
31503
+ complete();
31504
+ })
31505
+ .catch(e => {
31506
+ this.reject(e);
31507
+ });
31508
+ if (asyncInitPromises.length === 0) {
31509
+ complete();
31510
+ }
31511
+ this.initialized = true;
31512
+ }
31513
+ static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
31514
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
31515
+ }
31516
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
31517
+ type: Injectable,
31518
+ args: [{ providedIn: 'root' }]
31519
+ }], () => [], null); })();
31520
+
31775
31521
  /**
31776
31522
  * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
31777
31523
  * be called for every component that is bootstrapped.
@@ -31824,398 +31570,30 @@ function compileNgModuleFactory(injector, options, moduleType) {
31824
31570
  function publishDefaultGlobalUtils() {
31825
31571
  ngDevMode && publishDefaultGlobalUtils$1();
31826
31572
  }
31827
- /**
31828
- * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.
31829
- */
31830
- function publishSignalConfiguration() {
31831
- setThrowInvalidWriteToSignalError$1(() => {
31832
- throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, ngDevMode &&
31833
- 'Writing to signals is not allowed in a `computed` or an `effect` by default. ' +
31834
- 'Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.');
31835
- });
31836
- }
31837
- function isBoundToModule(cf) {
31838
- return cf.isBoundToModule;
31839
- }
31840
- /**
31841
- * A token for third-party components that can register themselves with NgProbe.
31842
- *
31843
- * @deprecated
31844
- * @publicApi
31845
- */
31846
- class NgProbeToken {
31847
- constructor(name, token) {
31848
- this.name = name;
31849
- this.token = token;
31850
- }
31851
- }
31852
- /**
31853
- * Creates a platform.
31854
- * Platforms must be created on launch using this function.
31855
- *
31856
- * @publicApi
31857
- */
31858
- function createPlatform(injector) {
31859
- if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
31860
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
31861
- 'There can be only one platform. Destroy the previous one to create a new one.');
31862
- }
31863
- publishDefaultGlobalUtils();
31864
- publishSignalConfiguration();
31865
- _platformInjector = injector;
31866
- const platform = injector.get(PlatformRef);
31867
- runPlatformInitializers(injector);
31868
- return platform;
31869
- }
31870
- /**
31871
- * The goal of this function is to bootstrap a platform injector,
31872
- * but avoid referencing `PlatformRef` class.
31873
- * This function is needed for bootstrapping a Standalone Component.
31874
- */
31875
- function createOrReusePlatformInjector(providers = []) {
31876
- // If a platform injector already exists, it means that the platform
31877
- // is already bootstrapped and no additional actions are required.
31878
- if (_platformInjector)
31879
- return _platformInjector;
31880
- publishDefaultGlobalUtils();
31881
- // Otherwise, setup a new platform injector and run platform initializers.
31882
- const injector = createPlatformInjector(providers);
31883
- _platformInjector = injector;
31884
- publishSignalConfiguration();
31885
- runPlatformInitializers(injector);
31886
- return injector;
31887
- }
31888
- function runPlatformInitializers(injector) {
31889
- const inits = injector.get(PLATFORM_INITIALIZER, null);
31890
- inits?.forEach((init) => init());
31891
- }
31892
- /**
31893
- * Internal create application API that implements the core application creation logic and optional
31894
- * bootstrap logic.
31895
- *
31896
- * Platforms (such as `platform-browser`) may require different set of application and platform
31897
- * providers for an application to function correctly. As a result, platforms may use this function
31898
- * internally and supply the necessary providers during the bootstrap, while exposing
31899
- * platform-specific APIs as a part of their public API.
31900
- *
31901
- * @returns A promise that returns an `ApplicationRef` instance once resolved.
31902
- */
31903
- function internalCreateApplication(config) {
31904
- try {
31905
- const { rootComponent, appProviders, platformProviders } = config;
31906
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
31907
- assertStandaloneComponentType(rootComponent);
31908
- }
31909
- const platformInjector = createOrReusePlatformInjector(platformProviders);
31910
- // Create root application injector based on a set of providers configured at the platform
31911
- // bootstrap level as well as providers passed to the bootstrap call by a user.
31912
- const allAppProviders = [
31913
- provideZoneChangeDetection(),
31914
- ...(appProviders || []),
31915
- ];
31916
- const adapter = new EnvironmentNgModuleRefAdapter({
31917
- providers: allAppProviders,
31918
- parent: platformInjector,
31919
- debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
31920
- // We skip environment initializers because we need to run them inside the NgZone, which
31921
- // happens after we get the NgZone instance from the Injector.
31922
- runEnvironmentInitializers: false,
31923
- });
31924
- const envInjector = adapter.injector;
31925
- const ngZone = envInjector.get(NgZone);
31926
- return ngZone.run(() => {
31927
- envInjector.resolveInjectorInitializers();
31928
- const exceptionHandler = envInjector.get(ErrorHandler, null);
31929
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
31930
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
31931
- }
31932
- let onErrorSubscription;
31933
- ngZone.runOutsideAngular(() => {
31934
- onErrorSubscription = ngZone.onError.subscribe({
31935
- next: (error) => {
31936
- exceptionHandler.handleError(error);
31937
- }
31938
- });
31939
- });
31940
- // If the whole platform is destroyed, invoke the `destroy` method
31941
- // for all bootstrapped applications as well.
31942
- const destroyListener = () => envInjector.destroy();
31943
- const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
31944
- onPlatformDestroyListeners.add(destroyListener);
31945
- envInjector.onDestroy(() => {
31946
- onErrorSubscription.unsubscribe();
31947
- onPlatformDestroyListeners.delete(destroyListener);
31948
- });
31949
- return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
31950
- const initStatus = envInjector.get(ApplicationInitStatus);
31951
- initStatus.runInitializers();
31952
- return initStatus.donePromise.then(() => {
31953
- const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
31954
- setLocaleId(localeId || DEFAULT_LOCALE_ID);
31955
- const appRef = envInjector.get(ApplicationRef);
31956
- if (rootComponent !== undefined) {
31957
- appRef.bootstrap(rootComponent);
31958
- }
31959
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
31960
- const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
31961
- imagePerformanceService.start();
31962
- }
31963
- return appRef;
31964
- });
31965
- });
31966
- });
31967
- }
31968
- catch (e) {
31969
- return Promise.reject(e);
31970
- }
31971
- }
31972
- /**
31973
- * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
31974
- * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
31975
- * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
31976
- * to build up configurations that might be required by different libraries or parts of the
31977
- * application.
31978
- * @param name Identifies the new platform factory.
31979
- * @param providers A set of dependency providers for platforms created with the new factory.
31980
- *
31981
- * @publicApi
31982
- */
31983
- function createPlatformFactory(parentPlatformFactory, name, providers = []) {
31984
- const desc = `Platform: ${name}`;
31985
- const marker = new InjectionToken(desc);
31986
- return (extraProviders = []) => {
31987
- let platform = getPlatform();
31988
- if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
31989
- const platformProviders = [
31990
- ...providers, //
31991
- ...extraProviders, //
31992
- { provide: marker, useValue: true }
31993
- ];
31994
- if (parentPlatformFactory) {
31995
- parentPlatformFactory(platformProviders);
31996
- }
31997
- else {
31998
- createPlatform(createPlatformInjector(platformProviders, desc));
31999
- }
32000
- }
32001
- return assertPlatform(marker);
32002
- };
32003
- }
32004
- /**
32005
- * Checks that there is currently a platform that contains the given token as a provider.
32006
- *
32007
- * @publicApi
32008
- */
32009
- function assertPlatform(requiredToken) {
32010
- const platform = getPlatform();
32011
- if (!platform) {
32012
- throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
32013
- }
32014
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32015
- !platform.injector.get(requiredToken, null)) {
32016
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
32017
- }
32018
- return platform;
32019
- }
32020
- /**
32021
- * Helper function to create an instance of a platform injector (that maintains the 'platform'
32022
- * scope).
32023
- */
32024
- function createPlatformInjector(providers = [], name) {
32025
- return Injector.create({
32026
- name,
32027
- providers: [
32028
- { provide: INJECTOR_SCOPE, useValue: 'platform' },
32029
- { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
32030
- ...providers
32031
- ],
32032
- });
32033
- }
32034
- /**
32035
- * Destroys the current Angular platform and all Angular applications on the page.
32036
- * Destroys all modules and listeners registered with the platform.
32037
- *
32038
- * @publicApi
32039
- */
32040
- function destroyPlatform() {
32041
- getPlatform()?.destroy();
32042
- }
32043
- /**
32044
- * Returns the current platform.
32045
- *
32046
- * @publicApi
32047
- */
32048
- function getPlatform() {
32049
- return _platformInjector?.get(PlatformRef) ?? null;
32050
- }
32051
- /**
32052
- * The Angular platform is the entry point for Angular on a web page.
32053
- * Each page has exactly one platform. Services (such as reflection) which are common
32054
- * to every Angular application running on the page are bound in its scope.
32055
- * A page's platform is initialized implicitly when a platform is created using a platform
32056
- * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
32057
- *
32058
- * @publicApi
32059
- */
32060
- class PlatformRef {
32061
- /** @internal */
32062
- constructor(_injector) {
32063
- this._injector = _injector;
32064
- this._modules = [];
32065
- this._destroyListeners = [];
32066
- this._destroyed = false;
32067
- }
32068
- /**
32069
- * Creates an instance of an `@NgModule` for the given platform.
32070
- *
32071
- * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
32072
- * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
32073
- */
32074
- bootstrapModuleFactory(moduleFactory, options) {
32075
- // Note: We need to create the NgZone _before_ we instantiate the module,
32076
- // as instantiating the module creates some providers eagerly.
32077
- // So we create a mini parent injector that just contains the new NgZone and
32078
- // pass that as parent to the NgModuleFactory.
32079
- const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
32080
- eventCoalescing: options?.ngZoneEventCoalescing,
32081
- runCoalescing: options?.ngZoneRunCoalescing
32082
- }));
32083
- // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
32084
- // created within the Angular zone
32085
- // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
32086
- // created outside of the Angular zone.
32087
- return ngZone.run(() => {
32088
- const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
32089
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32090
- moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
32091
- throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
32092
- }
32093
- const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
32094
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
32095
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
32096
- }
32097
- ngZone.runOutsideAngular(() => {
32098
- const subscription = ngZone.onError.subscribe({
32099
- next: (error) => {
32100
- exceptionHandler.handleError(error);
32101
- }
32102
- });
32103
- moduleRef.onDestroy(() => {
32104
- remove(this._modules, moduleRef);
32105
- subscription.unsubscribe();
32106
- });
32107
- });
32108
- return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
32109
- const initStatus = moduleRef.injector.get(ApplicationInitStatus);
32110
- initStatus.runInitializers();
32111
- return initStatus.donePromise.then(() => {
32112
- // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
32113
- const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
32114
- setLocaleId(localeId || DEFAULT_LOCALE_ID);
32115
- this._moduleDoBootstrap(moduleRef);
32116
- return moduleRef;
32117
- });
32118
- });
32119
- });
32120
- }
32121
- /**
32122
- * Creates an instance of an `@NgModule` for a given platform.
32123
- *
32124
- * @usageNotes
32125
- * ### Simple Example
32126
- *
32127
- * ```typescript
32128
- * @NgModule({
32129
- * imports: [BrowserModule]
32130
- * })
32131
- * class MyModule {}
32132
- *
32133
- * let moduleRef = platformBrowser().bootstrapModule(MyModule);
32134
- * ```
32135
- *
32136
- */
32137
- bootstrapModule(moduleType, compilerOptions = []) {
32138
- const options = optionsReducer({}, compilerOptions);
32139
- return compileNgModuleFactory(this.injector, options, moduleType)
32140
- .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
32141
- }
32142
- _moduleDoBootstrap(moduleRef) {
32143
- const appRef = moduleRef.injector.get(ApplicationRef);
32144
- if (moduleRef._bootstrapComponents.length > 0) {
32145
- moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
32146
- }
32147
- else if (moduleRef.instance.ngDoBootstrap) {
32148
- moduleRef.instance.ngDoBootstrap(appRef);
32149
- }
32150
- else {
32151
- throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
32152
- `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
32153
- `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
32154
- `Please define one of these.`);
32155
- }
32156
- this._modules.push(moduleRef);
32157
- }
32158
- /**
32159
- * Registers a listener to be called when the platform is destroyed.
32160
- */
32161
- onDestroy(callback) {
32162
- this._destroyListeners.push(callback);
32163
- }
32164
- /**
32165
- * Retrieves the platform {@link Injector}, which is the parent injector for
32166
- * every Angular application on the page and provides singleton providers.
32167
- */
32168
- get injector() {
32169
- return this._injector;
32170
- }
32171
- /**
32172
- * Destroys the current Angular platform and all Angular applications on the page.
32173
- * Destroys all modules and listeners registered with the platform.
32174
- */
32175
- destroy() {
32176
- if (this._destroyed) {
32177
- throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
32178
- }
32179
- this._modules.slice().forEach(module => module.destroy());
32180
- this._destroyListeners.forEach(listener => listener());
32181
- const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
32182
- if (destroyListeners) {
32183
- destroyListeners.forEach(listener => listener());
32184
- destroyListeners.clear();
32185
- }
32186
- this._destroyed = true;
32187
- }
32188
- /**
32189
- * Indicates whether this instance was destroyed.
32190
- */
32191
- get destroyed() {
32192
- return this._destroyed;
32193
- }
32194
- static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
32195
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
32196
- }
32197
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
32198
- type: Injectable,
32199
- args: [{ providedIn: 'platform' }]
32200
- }], () => [{ type: Injector }], null); })();
32201
- // Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
32202
- // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
32203
- // a set of default options returned.
32204
- function getNgZoneOptions(options) {
32205
- return {
32206
- enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
32207
- shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
32208
- shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
32209
- };
31573
+ /**
31574
+ * Sets the error for an invalid write to a signal to be an Angular `RuntimeError`.
31575
+ */
31576
+ function publishSignalConfiguration() {
31577
+ setThrowInvalidWriteToSignalError$1(() => {
31578
+ throw new RuntimeError(600 /* RuntimeErrorCode.SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT */, ngDevMode &&
31579
+ 'Writing to signals is not allowed in a `computed` or an `effect` by default. ' +
31580
+ 'Use `allowSignalWrites` in the `CreateEffectOptions` to enable this inside effects.');
31581
+ });
32210
31582
  }
32211
- function getNgZone(ngZoneToUse = 'zone.js', options) {
32212
- if (ngZoneToUse === 'noop') {
32213
- return new NoopNgZone();
32214
- }
32215
- if (ngZoneToUse === 'zone.js') {
32216
- return new NgZone(options);
31583
+ function isBoundToModule(cf) {
31584
+ return cf.isBoundToModule;
31585
+ }
31586
+ /**
31587
+ * A token for third-party components that can register themselves with NgProbe.
31588
+ *
31589
+ * @deprecated
31590
+ * @publicApi
31591
+ */
31592
+ class NgProbeToken {
31593
+ constructor(name, token) {
31594
+ this.name = name;
31595
+ this.token = token;
32217
31596
  }
32218
- return ngZoneToUse;
32219
31597
  }
32220
31598
  function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
32221
31599
  try {
@@ -32343,7 +31721,6 @@ class ApplicationRef {
32343
31721
  /** @internal */
32344
31722
  this._views = [];
32345
31723
  this.internalErrorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);
32346
- this.zoneIsStable = inject(ZONE_IS_STABLE_OBSERVABLE);
32347
31724
  /**
32348
31725
  * Get a list of component types registered to this application.
32349
31726
  * This list is populated even before the component is created.
@@ -32356,8 +31733,7 @@ class ApplicationRef {
32356
31733
  /**
32357
31734
  * Returns an Observable that indicates when the application is stable or unstable.
32358
31735
  */
32359
- this.isStable = inject(InitialRenderPendingTasks)
32360
- .hasPendingTasks.pipe(switchMap(hasPendingTasks => hasPendingTasks ? of(false) : this.zoneIsStable), distinctUntilChanged(), share());
31736
+ this.isStable = inject(PendingTasks).hasPendingTasks.pipe(map(pending => !pending));
32361
31737
  this._injector = inject(EnvironmentInjector);
32362
31738
  }
32363
31739
  /**
@@ -32536,179 +31912,682 @@ class ApplicationRef {
32536
31912
  }
32537
31913
  }
32538
31914
  /**
32539
- * Registers a listener to be called when an instance is destroyed.
32540
- *
32541
- * @param callback A callback function to add as a listener.
32542
- * @returns A function which unregisters a listener.
31915
+ * Registers a listener to be called when an instance is destroyed.
31916
+ *
31917
+ * @param callback A callback function to add as a listener.
31918
+ * @returns A function which unregisters a listener.
31919
+ */
31920
+ onDestroy(callback) {
31921
+ (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
31922
+ this._destroyListeners.push(callback);
31923
+ return () => remove(this._destroyListeners, callback);
31924
+ }
31925
+ /**
31926
+ * Destroys an Angular application represented by this `ApplicationRef`. Calling this function
31927
+ * will destroy the associated environment injectors as well as all the bootstrapped components
31928
+ * with their views.
31929
+ */
31930
+ destroy() {
31931
+ if (this._destroyed) {
31932
+ throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
31933
+ }
31934
+ const injector = this._injector;
31935
+ // Check that this injector instance supports destroy operation.
31936
+ if (injector.destroy && !injector.destroyed) {
31937
+ // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle
31938
+ // hook, which invokes the remaining cleanup actions.
31939
+ injector.destroy();
31940
+ }
31941
+ }
31942
+ /**
31943
+ * Returns the number of attached views.
31944
+ */
31945
+ get viewCount() {
31946
+ return this._views.length;
31947
+ }
31948
+ warnIfDestroyed() {
31949
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
31950
+ console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
31951
+ }
31952
+ }
31953
+ static { this.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(); }; }
31954
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); }
31955
+ }
31956
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
31957
+ type: Injectable,
31958
+ args: [{ providedIn: 'root' }]
31959
+ }], null, null); })();
31960
+ function remove(list, el) {
31961
+ const index = list.indexOf(el);
31962
+ if (index > -1) {
31963
+ list.splice(index, 1);
31964
+ }
31965
+ }
31966
+ function _lastDefined(args) {
31967
+ for (let i = args.length - 1; i >= 0; i--) {
31968
+ if (args[i] !== undefined) {
31969
+ return args[i];
31970
+ }
31971
+ }
31972
+ return undefined;
31973
+ }
31974
+ let whenStableStore;
31975
+ /**
31976
+ * Returns a Promise that resolves when the application becomes stable after this method is called
31977
+ * the first time.
31978
+ */
31979
+ function whenStable(applicationRef) {
31980
+ whenStableStore ??= new WeakMap();
31981
+ const cachedWhenStable = whenStableStore.get(applicationRef);
31982
+ if (cachedWhenStable) {
31983
+ return cachedWhenStable;
31984
+ }
31985
+ const whenStablePromise = applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => void 0);
31986
+ whenStableStore.set(applicationRef, whenStablePromise);
31987
+ // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.
31988
+ applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));
31989
+ return whenStablePromise;
31990
+ }
31991
+
31992
+ class NgZoneChangeDetectionScheduler {
31993
+ constructor() {
31994
+ this.zone = inject(NgZone);
31995
+ this.applicationRef = inject(ApplicationRef);
31996
+ }
31997
+ initialize() {
31998
+ if (this._onMicrotaskEmptySubscription) {
31999
+ return;
32000
+ }
32001
+ this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
32002
+ next: () => {
32003
+ this.zone.run(() => {
32004
+ this.applicationRef.tick();
32005
+ });
32006
+ }
32007
+ });
32008
+ }
32009
+ ngOnDestroy() {
32010
+ this._onMicrotaskEmptySubscription?.unsubscribe();
32011
+ }
32012
+ static { this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(t) { return new (t || NgZoneChangeDetectionScheduler)(); }; }
32013
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }
32014
+ }
32015
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
32016
+ type: Injectable,
32017
+ args: [{ providedIn: 'root' }]
32018
+ }], null, null); })();
32019
+ /**
32020
+ * Internal token used to verify that `provideZoneChangeDetection` is not used
32021
+ * with the bootstrapModule API.
32022
+ */
32023
+ const PROVIDED_NG_ZONE = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'provideZoneChangeDetection token' : '');
32024
+ function internalProvideZoneChangeDetection(ngZoneFactory) {
32025
+ return [
32026
+ { provide: NgZone, useFactory: ngZoneFactory },
32027
+ {
32028
+ provide: ENVIRONMENT_INITIALIZER,
32029
+ multi: true,
32030
+ useFactory: () => {
32031
+ const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, { optional: true });
32032
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32033
+ ngZoneChangeDetectionScheduler === null) {
32034
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +
32035
+ 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');
32036
+ }
32037
+ return () => ngZoneChangeDetectionScheduler.initialize();
32038
+ },
32039
+ },
32040
+ {
32041
+ provide: ENVIRONMENT_INITIALIZER,
32042
+ multi: true,
32043
+ useFactory: () => {
32044
+ const service = inject(ZoneStablePendingTask);
32045
+ return () => {
32046
+ service.initialize();
32047
+ };
32048
+ }
32049
+ },
32050
+ { provide: INTERNAL_APPLICATION_ERROR_HANDLER, useFactory: ngZoneApplicationErrorHandlerFactory },
32051
+ ];
32052
+ }
32053
+ function ngZoneApplicationErrorHandlerFactory() {
32054
+ const zone = inject(NgZone);
32055
+ const userErrorHandler = inject(ErrorHandler);
32056
+ return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
32057
+ }
32058
+ /**
32059
+ * Provides `NgZone`-based change detection for the application bootstrapped using
32060
+ * `bootstrapApplication`.
32061
+ *
32062
+ * `NgZone` is already provided in applications by default. This provider allows you to configure
32063
+ * options like `eventCoalescing` in the `NgZone`.
32064
+ * This provider is not available for `platformBrowser().bootstrapModule`, which uses
32065
+ * `BootstrapOptions` instead.
32066
+ *
32067
+ * @usageNotes
32068
+ * ```typescript
32069
+ * bootstrapApplication(MyApp, {providers: [
32070
+ * provideZoneChangeDetection({eventCoalescing: true}),
32071
+ * ]});
32072
+ * ```
32073
+ *
32074
+ * @publicApi
32075
+ * @see {@link bootstrapApplication}
32076
+ * @see {@link NgZoneOptions}
32077
+ */
32078
+ function provideZoneChangeDetection(options) {
32079
+ const zoneProviders = internalProvideZoneChangeDetection(() => new NgZone(getNgZoneOptions(options)));
32080
+ return makeEnvironmentProviders([
32081
+ (typeof ngDevMode === 'undefined' || ngDevMode) ? { provide: PROVIDED_NG_ZONE, useValue: true } :
32082
+ [],
32083
+ zoneProviders,
32084
+ ]);
32085
+ }
32086
+ // Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
32087
+ // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
32088
+ // a set of default options returned.
32089
+ function getNgZoneOptions(options) {
32090
+ return {
32091
+ enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
32092
+ shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
32093
+ shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
32094
+ };
32095
+ }
32096
+ class ZoneStablePendingTask {
32097
+ constructor() {
32098
+ this.subscription = new Subscription();
32099
+ this.initialized = false;
32100
+ this.zone = inject(NgZone);
32101
+ this.pendingTasks = inject(PendingTasks);
32102
+ }
32103
+ initialize() {
32104
+ if (this.initialized) {
32105
+ return;
32106
+ }
32107
+ this.initialized = true;
32108
+ let task = null;
32109
+ if (!this.zone.isStable && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
32110
+ task = this.pendingTasks.add();
32111
+ }
32112
+ this.zone.runOutsideAngular(() => {
32113
+ this.subscription.add(this.zone.onStable.subscribe(() => {
32114
+ NgZone.assertNotInAngularZone();
32115
+ // Check whether there are no pending macro/micro tasks in the next tick
32116
+ // to allow for NgZone to update the state.
32117
+ queueMicrotask(() => {
32118
+ if (task !== null && !this.zone.hasPendingMacrotasks && !this.zone.hasPendingMicrotasks) {
32119
+ this.pendingTasks.remove(task);
32120
+ task = null;
32121
+ }
32122
+ });
32123
+ }));
32124
+ });
32125
+ this.subscription.add(this.zone.onUnstable.subscribe(() => {
32126
+ NgZone.assertInAngularZone();
32127
+ task ??= this.pendingTasks.add();
32128
+ }));
32129
+ }
32130
+ ngOnDestroy() {
32131
+ this.subscription.unsubscribe();
32132
+ }
32133
+ static { this.ɵfac = function ZoneStablePendingTask_Factory(t) { return new (t || ZoneStablePendingTask)(); }; }
32134
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ZoneStablePendingTask, factory: ZoneStablePendingTask.ɵfac, providedIn: 'root' }); }
32135
+ }
32136
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ZoneStablePendingTask, [{
32137
+ type: Injectable,
32138
+ args: [{ providedIn: 'root' }]
32139
+ }], null, null); })();
32140
+
32141
+ /**
32142
+ * Work out the locale from the potential global properties.
32143
+ *
32144
+ * * Closure Compiler: use `goog.LOCALE`.
32145
+ * * Ivy enabled: use `$localize.locale`
32146
+ */
32147
+ function getGlobalLocale() {
32148
+ if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
32149
+ typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
32150
+ // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
32151
+ // * In order to preserve backwards compatibility, we use Angular default value over
32152
+ // Closure Compiler's one.
32153
+ return goog.LOCALE;
32154
+ }
32155
+ else {
32156
+ // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
32157
+ // COMPILE-TIME INLINER.
32158
+ //
32159
+ // * During compile time inlining of translations the expression will be replaced
32160
+ // with a string literal that is the current locale. Other forms of this expression are not
32161
+ // guaranteed to be replaced.
32162
+ //
32163
+ // * During runtime translation evaluation, the developer is required to set `$localize.locale`
32164
+ // if required, or just to provide their own `LOCALE_ID` provider.
32165
+ return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
32166
+ }
32167
+ }
32168
+ /**
32169
+ * Provide this token to set the locale of your application.
32170
+ * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
32171
+ * DecimalPipe and PercentPipe) and by ICU expressions.
32172
+ *
32173
+ * See the [i18n guide](guide/i18n-common-locale-id) for more information.
32174
+ *
32175
+ * @usageNotes
32176
+ * ### Example
32177
+ *
32178
+ * ```typescript
32179
+ * import { LOCALE_ID } from '@angular/core';
32180
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32181
+ * import { AppModule } from './app/app.module';
32182
+ *
32183
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32184
+ * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
32185
+ * });
32186
+ * ```
32187
+ *
32188
+ * @publicApi
32189
+ */
32190
+ const LOCALE_ID = new InjectionToken('LocaleId', {
32191
+ providedIn: 'root',
32192
+ factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
32193
+ });
32194
+ /**
32195
+ * Provide this token to set the default currency code your application uses for
32196
+ * CurrencyPipe when there is no currency code passed into it. This is only used by
32197
+ * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
32198
+ *
32199
+ * See the [i18n guide](guide/i18n-common-locale-id) for more information.
32200
+ *
32201
+ * <div class="alert is-helpful">
32202
+ *
32203
+ * **Deprecation notice:**
32204
+ *
32205
+ * The default currency code is currently always `USD` but this is deprecated from v9.
32206
+ *
32207
+ * **In v10 the default currency code will be taken from the current locale.**
32208
+ *
32209
+ * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
32210
+ * your application `NgModule`:
32211
+ *
32212
+ * ```ts
32213
+ * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
32214
+ * ```
32215
+ *
32216
+ * </div>
32217
+ *
32218
+ * @usageNotes
32219
+ * ### Example
32220
+ *
32221
+ * ```typescript
32222
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32223
+ * import { AppModule } from './app/app.module';
32224
+ *
32225
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32226
+ * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
32227
+ * });
32228
+ * ```
32229
+ *
32230
+ * @publicApi
32231
+ */
32232
+ const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
32233
+ providedIn: 'root',
32234
+ factory: () => USD_CURRENCY_CODE,
32235
+ });
32236
+ /**
32237
+ * Use this token at bootstrap to provide the content of your translation file (`xtb`,
32238
+ * `xlf` or `xlf2`) when you want to translate your application in another language.
32239
+ *
32240
+ * See the [i18n guide](guide/i18n-common-merge) for more information.
32241
+ *
32242
+ * @usageNotes
32243
+ * ### Example
32244
+ *
32245
+ * ```typescript
32246
+ * import { TRANSLATIONS } from '@angular/core';
32247
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32248
+ * import { AppModule } from './app/app.module';
32249
+ *
32250
+ * // content of your translation file
32251
+ * const translations = '....';
32252
+ *
32253
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32254
+ * providers: [{provide: TRANSLATIONS, useValue: translations }]
32255
+ * });
32256
+ * ```
32257
+ *
32258
+ * @publicApi
32259
+ */
32260
+ const TRANSLATIONS = new InjectionToken('Translations');
32261
+ /**
32262
+ * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
32263
+ * `xlf` or `xlf2`.
32264
+ *
32265
+ * See the [i18n guide](guide/i18n-common-merge) for more information.
32266
+ *
32267
+ * @usageNotes
32268
+ * ### Example
32269
+ *
32270
+ * ```typescript
32271
+ * import { TRANSLATIONS_FORMAT } from '@angular/core';
32272
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32273
+ * import { AppModule } from './app/app.module';
32274
+ *
32275
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32276
+ * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
32277
+ * });
32278
+ * ```
32279
+ *
32280
+ * @publicApi
32281
+ */
32282
+ const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
32283
+ /**
32284
+ * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
32285
+ * that the compiler should use in case of missing translations:
32286
+ * - Error: throw if you have missing translations.
32287
+ * - Warning (default): show a warning in the console and/or shell.
32288
+ * - Ignore: do nothing.
32289
+ *
32290
+ * See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
32291
+ *
32292
+ * @usageNotes
32293
+ * ### Example
32294
+ * ```typescript
32295
+ * import { MissingTranslationStrategy } from '@angular/core';
32296
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32297
+ * import { AppModule } from './app/app.module';
32298
+ *
32299
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32300
+ * missingTranslation: MissingTranslationStrategy.Error
32301
+ * });
32302
+ * ```
32303
+ *
32304
+ * @publicApi
32305
+ */
32306
+ var MissingTranslationStrategy;
32307
+ (function (MissingTranslationStrategy) {
32308
+ MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
32309
+ MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
32310
+ MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
32311
+ })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
32312
+
32313
+ /**
32314
+ * Internal token that allows to register extra callbacks that should be invoked during the
32315
+ * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
32316
+ * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
32317
+ * entire class tree-shakeable.
32318
+ */
32319
+ const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
32320
+ /**
32321
+ * The Angular platform is the entry point for Angular on a web page.
32322
+ * Each page has exactly one platform. Services (such as reflection) which are common
32323
+ * to every Angular application running on the page are bound in its scope.
32324
+ * A page's platform is initialized implicitly when a platform is created using a platform
32325
+ * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
32326
+ *
32327
+ * @publicApi
32328
+ */
32329
+ class PlatformRef {
32330
+ /** @internal */
32331
+ constructor(_injector) {
32332
+ this._injector = _injector;
32333
+ this._modules = [];
32334
+ this._destroyListeners = [];
32335
+ this._destroyed = false;
32336
+ }
32337
+ /**
32338
+ * Creates an instance of an `@NgModule` for the given platform.
32339
+ *
32340
+ * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
32341
+ * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
32342
+ */
32343
+ bootstrapModuleFactory(moduleFactory, options) {
32344
+ // Note: We need to create the NgZone _before_ we instantiate the module,
32345
+ // as instantiating the module creates some providers eagerly.
32346
+ // So we create a mini parent injector that just contains the new NgZone and
32347
+ // pass that as parent to the NgModuleFactory.
32348
+ const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
32349
+ eventCoalescing: options?.ngZoneEventCoalescing,
32350
+ runCoalescing: options?.ngZoneRunCoalescing
32351
+ }));
32352
+ // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
32353
+ // created within the Angular zone
32354
+ // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
32355
+ // created outside of the Angular zone.
32356
+ return ngZone.run(() => {
32357
+ const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
32358
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32359
+ moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
32360
+ throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
32361
+ }
32362
+ const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
32363
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
32364
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
32365
+ }
32366
+ ngZone.runOutsideAngular(() => {
32367
+ const subscription = ngZone.onError.subscribe({
32368
+ next: (error) => {
32369
+ exceptionHandler.handleError(error);
32370
+ }
32371
+ });
32372
+ moduleRef.onDestroy(() => {
32373
+ remove(this._modules, moduleRef);
32374
+ subscription.unsubscribe();
32375
+ });
32376
+ });
32377
+ return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
32378
+ const initStatus = moduleRef.injector.get(ApplicationInitStatus);
32379
+ initStatus.runInitializers();
32380
+ return initStatus.donePromise.then(() => {
32381
+ // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
32382
+ const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
32383
+ setLocaleId(localeId || DEFAULT_LOCALE_ID);
32384
+ this._moduleDoBootstrap(moduleRef);
32385
+ return moduleRef;
32386
+ });
32387
+ });
32388
+ });
32389
+ }
32390
+ /**
32391
+ * Creates an instance of an `@NgModule` for a given platform.
32392
+ *
32393
+ * @usageNotes
32394
+ * ### Simple Example
32395
+ *
32396
+ * ```typescript
32397
+ * @NgModule({
32398
+ * imports: [BrowserModule]
32399
+ * })
32400
+ * class MyModule {}
32401
+ *
32402
+ * let moduleRef = platformBrowser().bootstrapModule(MyModule);
32403
+ * ```
32404
+ *
32405
+ */
32406
+ bootstrapModule(moduleType, compilerOptions = []) {
32407
+ const options = optionsReducer({}, compilerOptions);
32408
+ return compileNgModuleFactory(this.injector, options, moduleType)
32409
+ .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
32410
+ }
32411
+ _moduleDoBootstrap(moduleRef) {
32412
+ const appRef = moduleRef.injector.get(ApplicationRef);
32413
+ if (moduleRef._bootstrapComponents.length > 0) {
32414
+ moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
32415
+ }
32416
+ else if (moduleRef.instance.ngDoBootstrap) {
32417
+ moduleRef.instance.ngDoBootstrap(appRef);
32418
+ }
32419
+ else {
32420
+ throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
32421
+ `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
32422
+ `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
32423
+ `Please define one of these.`);
32424
+ }
32425
+ this._modules.push(moduleRef);
32426
+ }
32427
+ /**
32428
+ * Registers a listener to be called when the platform is destroyed.
32543
32429
  */
32544
32430
  onDestroy(callback) {
32545
- (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
32546
32431
  this._destroyListeners.push(callback);
32547
- return () => remove(this._destroyListeners, callback);
32548
32432
  }
32549
32433
  /**
32550
- * Destroys an Angular application represented by this `ApplicationRef`. Calling this function
32551
- * will destroy the associated environment injectors as well as all the bootstrapped components
32552
- * with their views.
32434
+ * Retrieves the platform {@link Injector}, which is the parent injector for
32435
+ * every Angular application on the page and provides singleton providers.
32436
+ */
32437
+ get injector() {
32438
+ return this._injector;
32439
+ }
32440
+ /**
32441
+ * Destroys the current Angular platform and all Angular applications on the page.
32442
+ * Destroys all modules and listeners registered with the platform.
32553
32443
  */
32554
32444
  destroy() {
32555
32445
  if (this._destroyed) {
32556
- throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
32446
+ throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
32557
32447
  }
32558
- const injector = this._injector;
32559
- // Check that this injector instance supports destroy operation.
32560
- if (injector.destroy && !injector.destroyed) {
32561
- // Destroying an underlying injector will trigger the `ngOnDestroy` lifecycle
32562
- // hook, which invokes the remaining cleanup actions.
32563
- injector.destroy();
32448
+ this._modules.slice().forEach(module => module.destroy());
32449
+ this._destroyListeners.forEach(listener => listener());
32450
+ const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
32451
+ if (destroyListeners) {
32452
+ destroyListeners.forEach(listener => listener());
32453
+ destroyListeners.clear();
32564
32454
  }
32455
+ this._destroyed = true;
32565
32456
  }
32566
32457
  /**
32567
- * Returns the number of attached views.
32458
+ * Indicates whether this instance was destroyed.
32568
32459
  */
32569
- get viewCount() {
32570
- return this._views.length;
32571
- }
32572
- warnIfDestroyed() {
32573
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
32574
- console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
32575
- }
32460
+ get destroyed() {
32461
+ return this._destroyed;
32576
32462
  }
32577
- static { this.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(); }; }
32578
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); }
32463
+ static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
32464
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
32579
32465
  }
32580
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
32466
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
32581
32467
  type: Injectable,
32582
- args: [{ providedIn: 'root' }]
32583
- }], null, null); })();
32584
- function remove(list, el) {
32585
- const index = list.indexOf(el);
32586
- if (index > -1) {
32587
- list.splice(index, 1);
32468
+ args: [{ providedIn: 'platform' }]
32469
+ }], () => [{ type: Injector }], null); })();
32470
+
32471
+ let _platformInjector = null;
32472
+ /**
32473
+ * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
32474
+ * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
32475
+ */
32476
+ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
32477
+ /**
32478
+ * Creates a platform.
32479
+ * Platforms must be created on launch using this function.
32480
+ *
32481
+ * @publicApi
32482
+ */
32483
+ function createPlatform(injector) {
32484
+ if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
32485
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
32486
+ 'There can be only one platform. Destroy the previous one to create a new one.');
32588
32487
  }
32488
+ publishDefaultGlobalUtils();
32489
+ publishSignalConfiguration();
32490
+ _platformInjector = injector;
32491
+ const platform = injector.get(PlatformRef);
32492
+ runPlatformInitializers(injector);
32493
+ return platform;
32589
32494
  }
32590
- function _lastDefined(args) {
32591
- for (let i = args.length - 1; i >= 0; i--) {
32592
- if (args[i] !== undefined) {
32593
- return args[i];
32495
+ /**
32496
+ * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
32497
+ * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
32498
+ * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
32499
+ * to build up configurations that might be required by different libraries or parts of the
32500
+ * application.
32501
+ * @param name Identifies the new platform factory.
32502
+ * @param providers A set of dependency providers for platforms created with the new factory.
32503
+ *
32504
+ * @publicApi
32505
+ */
32506
+ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
32507
+ const desc = `Platform: ${name}`;
32508
+ const marker = new InjectionToken(desc);
32509
+ return (extraProviders = []) => {
32510
+ let platform = getPlatform();
32511
+ if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
32512
+ const platformProviders = [...providers, ...extraProviders, { provide: marker, useValue: true }];
32513
+ if (parentPlatformFactory) {
32514
+ parentPlatformFactory(platformProviders);
32515
+ }
32516
+ else {
32517
+ createPlatform(createPlatformInjector(platformProviders, desc));
32518
+ }
32594
32519
  }
32595
- }
32596
- return undefined;
32520
+ return assertPlatform(marker);
32521
+ };
32597
32522
  }
32598
32523
  /**
32599
- * `InjectionToken` used to configure how to call the `ErrorHandler`.
32600
- *
32601
- * `NgZone` is provided by default today so the default (and only) implementation for this
32602
- * is calling `ErrorHandler.handleError` outside of the Angular zone.
32524
+ * Helper function to create an instance of a platform injector (that maintains the 'platform'
32525
+ * scope).
32603
32526
  */
32604
- const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
32605
- providedIn: 'root',
32606
- factory: () => {
32607
- const userErrorHandler = inject(ErrorHandler);
32608
- return userErrorHandler.handleError.bind(undefined);
32609
- }
32610
- });
32611
- function ngZoneApplicationErrorHandlerFactory() {
32612
- const zone = inject(NgZone);
32613
- const userErrorHandler = inject(ErrorHandler);
32614
- return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
32527
+ function createPlatformInjector(providers = [], name) {
32528
+ return Injector.create({
32529
+ name,
32530
+ providers: [
32531
+ { provide: INJECTOR_SCOPE, useValue: 'platform' },
32532
+ { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
32533
+ ...providers
32534
+ ],
32535
+ });
32615
32536
  }
32616
- class NgZoneChangeDetectionScheduler {
32617
- constructor() {
32618
- this.zone = inject(NgZone);
32619
- this.applicationRef = inject(ApplicationRef);
32620
- }
32621
- initialize() {
32622
- if (this._onMicrotaskEmptySubscription) {
32623
- return;
32624
- }
32625
- this._onMicrotaskEmptySubscription = this.zone.onMicrotaskEmpty.subscribe({
32626
- next: () => {
32627
- this.zone.run(() => {
32628
- this.applicationRef.tick();
32629
- });
32630
- }
32631
- });
32537
+ /**
32538
+ * Checks that there is currently a platform that contains the given token as a provider.
32539
+ *
32540
+ * @publicApi
32541
+ */
32542
+ function assertPlatform(requiredToken) {
32543
+ const platform = getPlatform();
32544
+ if (!platform) {
32545
+ throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
32632
32546
  }
32633
- ngOnDestroy() {
32634
- this._onMicrotaskEmptySubscription?.unsubscribe();
32547
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32548
+ !platform.injector.get(requiredToken, null)) {
32549
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
32635
32550
  }
32636
- static { this.ɵfac = function NgZoneChangeDetectionScheduler_Factory(t) { return new (t || NgZoneChangeDetectionScheduler)(); }; }
32637
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: NgZoneChangeDetectionScheduler, factory: NgZoneChangeDetectionScheduler.ɵfac, providedIn: 'root' }); }
32551
+ return platform;
32638
32552
  }
32639
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(NgZoneChangeDetectionScheduler, [{
32640
- type: Injectable,
32641
- args: [{ providedIn: 'root' }]
32642
- }], null, null); })();
32643
32553
  /**
32644
- * Internal token used to verify that `provideZoneChangeDetection` is not used
32645
- * with the bootstrapModule API.
32554
+ * Returns the current platform.
32555
+ *
32556
+ * @publicApi
32646
32557
  */
32647
- const PROVIDED_NG_ZONE = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'provideZoneChangeDetection token' : '');
32648
- function internalProvideZoneChangeDetection(ngZoneFactory) {
32649
- return [
32650
- { provide: NgZone, useFactory: ngZoneFactory },
32651
- {
32652
- provide: ENVIRONMENT_INITIALIZER,
32653
- multi: true,
32654
- useFactory: () => {
32655
- const ngZoneChangeDetectionScheduler = inject(NgZoneChangeDetectionScheduler, { optional: true });
32656
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32657
- ngZoneChangeDetectionScheduler === null) {
32658
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, `A required Injectable was not found in the dependency injection tree. ` +
32659
- 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');
32660
- }
32661
- return () => ngZoneChangeDetectionScheduler.initialize();
32662
- },
32663
- },
32664
- { provide: INTERNAL_APPLICATION_ERROR_HANDLER, useFactory: ngZoneApplicationErrorHandlerFactory },
32665
- { provide: ZONE_IS_STABLE_OBSERVABLE, useFactory: isStableFactory },
32666
- ];
32558
+ function getPlatform() {
32559
+ return _platformInjector?.get(PlatformRef) ?? null;
32667
32560
  }
32668
32561
  /**
32669
- * Provides `NgZone`-based change detection for the application bootstrapped using
32670
- * `bootstrapApplication`.
32671
- *
32672
- * `NgZone` is already provided in applications by default. This provider allows you to configure
32673
- * options like `eventCoalescing` in the `NgZone`.
32674
- * This provider is not available for `platformBrowser().bootstrapModule`, which uses
32675
- * `BootstrapOptions` instead.
32676
- *
32677
- * @usageNotes
32678
- * ```typescript
32679
- * bootstrapApplication(MyApp, {providers: [
32680
- * provideZoneChangeDetection({eventCoalescing: true}),
32681
- * ]});
32682
- * ```
32562
+ * Destroys the current Angular platform and all Angular applications on the page.
32563
+ * Destroys all modules and listeners registered with the platform.
32683
32564
  *
32684
32565
  * @publicApi
32685
- * @see {@link bootstrapApplication}
32686
- * @see {@link NgZoneOptions}
32687
32566
  */
32688
- function provideZoneChangeDetection(options) {
32689
- const zoneProviders = internalProvideZoneChangeDetection(() => new NgZone(getNgZoneOptions(options)));
32690
- return makeEnvironmentProviders([
32691
- (typeof ngDevMode === 'undefined' || ngDevMode) ? { provide: PROVIDED_NG_ZONE, useValue: true } :
32692
- [],
32693
- zoneProviders,
32694
- ]);
32567
+ function destroyPlatform() {
32568
+ getPlatform()?.destroy();
32695
32569
  }
32696
- let whenStableStore;
32697
32570
  /**
32698
- * Returns a Promise that resolves when the application becomes stable after this method is called
32699
- * the first time.
32571
+ * The goal of this function is to bootstrap a platform injector,
32572
+ * but avoid referencing `PlatformRef` class.
32573
+ * This function is needed for bootstrapping a Standalone Component.
32700
32574
  */
32701
- function whenStable(applicationRef) {
32702
- whenStableStore ??= new WeakMap();
32703
- const cachedWhenStable = whenStableStore.get(applicationRef);
32704
- if (cachedWhenStable) {
32705
- return cachedWhenStable;
32706
- }
32707
- const whenStablePromise = applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => void 0);
32708
- whenStableStore.set(applicationRef, whenStablePromise);
32709
- // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.
32710
- applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));
32711
- return whenStablePromise;
32575
+ function createOrReusePlatformInjector(providers = []) {
32576
+ // If a platform injector already exists, it means that the platform
32577
+ // is already bootstrapped and no additional actions are required.
32578
+ if (_platformInjector)
32579
+ return _platformInjector;
32580
+ publishDefaultGlobalUtils();
32581
+ // Otherwise, setup a new platform injector and run platform initializers.
32582
+ const injector = createPlatformInjector(providers);
32583
+ _platformInjector = injector;
32584
+ publishSignalConfiguration();
32585
+ runPlatformInitializers(injector);
32586
+ return injector;
32587
+ }
32588
+ function runPlatformInitializers(injector) {
32589
+ const inits = injector.get(PLATFORM_INITIALIZER, null);
32590
+ inits?.forEach((init) => init());
32712
32591
  }
32713
32592
 
32714
32593
  /**
@@ -33868,14 +33747,7 @@ function signalSetFn(node, newValue) {
33868
33747
  if (!producerUpdatesAllowed()) {
33869
33748
  throwInvalidWriteToSignalError();
33870
33749
  }
33871
- const value = node.value;
33872
- if (Object.is(value, newValue)) {
33873
- if (typeof ngDevMode !== 'undefined' && ngDevMode && !node.equal(value, newValue)) {
33874
- console.warn('Signal value equality implementations should always return `true` for' +
33875
- ' values that are the same according to `Object.is` but returned `false` instead.');
33876
- }
33877
- }
33878
- else if (!node.equal(value, newValue)) {
33750
+ if (!node.equal(node.value, newValue)) {
33879
33751
  node.value = newValue;
33880
33752
  signalValueChanged(node);
33881
33753
  }
@@ -33989,6 +33861,244 @@ function setAlternateWeakRefImpl(impl) {
33989
33861
  // TODO: remove this function
33990
33862
  }
33991
33863
 
33864
+ // A delay in milliseconds before the scan is run after onLoad, to avoid any
33865
+ // potential race conditions with other LCP-related functions. This delay
33866
+ // happens outside of the main JavaScript execution and will only effect the timing
33867
+ // on when the warning becomes visible in the console.
33868
+ const SCAN_DELAY = 200;
33869
+ const OVERSIZED_IMAGE_TOLERANCE = 1200;
33870
+ class ImagePerformanceWarning {
33871
+ constructor() {
33872
+ // Map of full image URLs -> original `ngSrc` values.
33873
+ this.window = null;
33874
+ this.observer = null;
33875
+ this.options = inject(IMAGE_CONFIG);
33876
+ this.ngZone = inject(NgZone);
33877
+ }
33878
+ start() {
33879
+ if (typeof PerformanceObserver === 'undefined' ||
33880
+ (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
33881
+ return;
33882
+ }
33883
+ this.observer = this.initPerformanceObserver();
33884
+ const doc = getDocument();
33885
+ const win = doc.defaultView;
33886
+ if (typeof win !== 'undefined') {
33887
+ this.window = win;
33888
+ // Wait to avoid race conditions where LCP image triggers
33889
+ // load event before it's recorded by the performance observer
33890
+ const waitToScan = () => {
33891
+ setTimeout(this.scanImages.bind(this), SCAN_DELAY);
33892
+ };
33893
+ // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
33894
+ // the scope of this functionality.
33895
+ this.ngZone.runOutsideAngular(() => {
33896
+ // Consider the case when the application is created and destroyed multiple times.
33897
+ // Typically, applications are created instantly once the page is loaded, and the
33898
+ // `window.load` listener is always triggered. However, the `window.load` event will never
33899
+ // be fired if the page is loaded, and the application is created later. Checking for
33900
+ // `readyState` is the easiest way to determine whether the page has been loaded or not.
33901
+ if (doc.readyState === 'complete') {
33902
+ waitToScan();
33903
+ }
33904
+ else {
33905
+ this.window?.addEventListener('load', waitToScan, { once: true });
33906
+ }
33907
+ });
33908
+ }
33909
+ }
33910
+ ngOnDestroy() {
33911
+ this.observer?.disconnect();
33912
+ }
33913
+ initPerformanceObserver() {
33914
+ if (typeof PerformanceObserver === 'undefined') {
33915
+ return null;
33916
+ }
33917
+ const observer = new PerformanceObserver((entryList) => {
33918
+ const entries = entryList.getEntries();
33919
+ if (entries.length === 0)
33920
+ return;
33921
+ // We use the latest entry produced by the `PerformanceObserver` as the best
33922
+ // signal on which element is actually an LCP one. As an example, the first image to load on
33923
+ // a page, by virtue of being the only thing on the page so far, is often a LCP candidate
33924
+ // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
33925
+ const lcpElement = entries[entries.length - 1];
33926
+ // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
33927
+ // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
33928
+ const imgSrc = lcpElement.element?.src ?? '';
33929
+ // Exclude `data:` and `blob:` URLs, since they are fetched resources.
33930
+ if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
33931
+ return;
33932
+ this.lcpImageUrl = imgSrc;
33933
+ });
33934
+ observer.observe({ type: 'largest-contentful-paint', buffered: true });
33935
+ return observer;
33936
+ }
33937
+ scanImages() {
33938
+ const images = getDocument().querySelectorAll('img');
33939
+ let lcpElementFound, lcpElementLoadedCorrectly = false;
33940
+ images.forEach(image => {
33941
+ if (!this.options?.disableImageSizeWarning) {
33942
+ for (const image of images) {
33943
+ // Image elements using the NgOptimizedImage directive are excluded,
33944
+ // as that directive has its own version of this check.
33945
+ if (!image.getAttribute('ng-img') && this.isOversized(image)) {
33946
+ logOversizedImageWarning(image.src);
33947
+ }
33948
+ }
33949
+ }
33950
+ if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
33951
+ if (image.src === this.lcpImageUrl) {
33952
+ lcpElementFound = true;
33953
+ if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
33954
+ // This variable is set to true and never goes back to false to account
33955
+ // for the case where multiple images have the same src url, and some
33956
+ // have lazy loading while others don't.
33957
+ // Also ignore NgOptimizedImage because there's a different warning for that.
33958
+ lcpElementLoadedCorrectly = true;
33959
+ }
33960
+ }
33961
+ }
33962
+ });
33963
+ if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
33964
+ !this.options?.disableImageLazyLoadWarning) {
33965
+ logLazyLCPWarning(this.lcpImageUrl);
33966
+ }
33967
+ }
33968
+ isOversized(image) {
33969
+ if (!this.window) {
33970
+ return false;
33971
+ }
33972
+ const computedStyle = this.window.getComputedStyle(image);
33973
+ let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
33974
+ let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
33975
+ const boxSizing = computedStyle.getPropertyValue('box-sizing');
33976
+ const objectFit = computedStyle.getPropertyValue('object-fit');
33977
+ if (objectFit === `cover`) {
33978
+ // Object fit cover may indicate a use case such as a sprite sheet where
33979
+ // this warning does not apply.
33980
+ return false;
33981
+ }
33982
+ if (boxSizing === 'border-box') {
33983
+ const paddingTop = computedStyle.getPropertyValue('padding-top');
33984
+ const paddingRight = computedStyle.getPropertyValue('padding-right');
33985
+ const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
33986
+ const paddingLeft = computedStyle.getPropertyValue('padding-left');
33987
+ renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
33988
+ renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
33989
+ }
33990
+ const intrinsicWidth = image.naturalWidth;
33991
+ const intrinsicHeight = image.naturalHeight;
33992
+ const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
33993
+ const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
33994
+ const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
33995
+ const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
33996
+ return oversizedWidth || oversizedHeight;
33997
+ }
33998
+ static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
33999
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
34000
+ }
34001
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
34002
+ type: Injectable,
34003
+ args: [{ providedIn: 'root' }]
34004
+ }], null, null); })();
34005
+ function logLazyLCPWarning(src) {
34006
+ console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
34007
+ `but was given a "loading" value of "lazy", which can negatively impact ` +
34008
+ `application loading performance. This warning can be addressed by ` +
34009
+ `changing the loading value of the LCP image to "eager", or by using the ` +
34010
+ `NgOptimizedImage directive's prioritization utilities. For more ` +
34011
+ `information about addressing or disabling this warning, see ` +
34012
+ `https://angular.io/errors/NG0913`));
34013
+ }
34014
+ function logOversizedImageWarning(src) {
34015
+ console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
34016
+ `rendered size. This can negatively impact application loading performance. ` +
34017
+ `For more information about addressing or disabling this warning, see ` +
34018
+ `https://angular.io/errors/NG0913`));
34019
+ }
34020
+
34021
+ /**
34022
+ * Internal create application API that implements the core application creation logic and optional
34023
+ * bootstrap logic.
34024
+ *
34025
+ * Platforms (such as `platform-browser`) may require different set of application and platform
34026
+ * providers for an application to function correctly. As a result, platforms may use this function
34027
+ * internally and supply the necessary providers during the bootstrap, while exposing
34028
+ * platform-specific APIs as a part of their public API.
34029
+ *
34030
+ * @returns A promise that returns an `ApplicationRef` instance once resolved.
34031
+ */
34032
+ function internalCreateApplication(config) {
34033
+ try {
34034
+ const { rootComponent, appProviders, platformProviders } = config;
34035
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
34036
+ assertStandaloneComponentType(rootComponent);
34037
+ }
34038
+ const platformInjector = createOrReusePlatformInjector(platformProviders);
34039
+ // Create root application injector based on a set of providers configured at the platform
34040
+ // bootstrap level as well as providers passed to the bootstrap call by a user.
34041
+ const allAppProviders = [
34042
+ provideZoneChangeDetection(),
34043
+ ...(appProviders || []),
34044
+ ];
34045
+ const adapter = new EnvironmentNgModuleRefAdapter({
34046
+ providers: allAppProviders,
34047
+ parent: platformInjector,
34048
+ debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
34049
+ // We skip environment initializers because we need to run them inside the NgZone, which
34050
+ // happens after we get the NgZone instance from the Injector.
34051
+ runEnvironmentInitializers: false,
34052
+ });
34053
+ const envInjector = adapter.injector;
34054
+ const ngZone = envInjector.get(NgZone);
34055
+ return ngZone.run(() => {
34056
+ envInjector.resolveInjectorInitializers();
34057
+ const exceptionHandler = envInjector.get(ErrorHandler, null);
34058
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
34059
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
34060
+ }
34061
+ let onErrorSubscription;
34062
+ ngZone.runOutsideAngular(() => {
34063
+ onErrorSubscription = ngZone.onError.subscribe({
34064
+ next: (error) => {
34065
+ exceptionHandler.handleError(error);
34066
+ }
34067
+ });
34068
+ });
34069
+ // If the whole platform is destroyed, invoke the `destroy` method
34070
+ // for all bootstrapped applications as well.
34071
+ const destroyListener = () => envInjector.destroy();
34072
+ const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
34073
+ onPlatformDestroyListeners.add(destroyListener);
34074
+ envInjector.onDestroy(() => {
34075
+ onErrorSubscription.unsubscribe();
34076
+ onPlatformDestroyListeners.delete(destroyListener);
34077
+ });
34078
+ return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
34079
+ const initStatus = envInjector.get(ApplicationInitStatus);
34080
+ initStatus.runInitializers();
34081
+ return initStatus.donePromise.then(() => {
34082
+ const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
34083
+ setLocaleId(localeId || DEFAULT_LOCALE_ID);
34084
+ const appRef = envInjector.get(ApplicationRef);
34085
+ if (rootComponent !== undefined) {
34086
+ appRef.bootstrap(rootComponent);
34087
+ }
34088
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
34089
+ const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
34090
+ imagePerformanceService.start();
34091
+ }
34092
+ return appRef;
34093
+ });
34094
+ });
34095
+ });
34096
+ }
34097
+ catch (e) {
34098
+ return Promise.reject(e);
34099
+ }
34100
+ }
34101
+
33992
34102
  /**
33993
34103
  * Retrieves all defer blocks in a given LView.
33994
34104
  *
@@ -35041,5 +35151,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
35041
35151
  * Generated bundle index. Do not edit.
35042
35152
  */
35043
35153
 
35044
- export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, InitialRenderPendingTasks as ɵInitialRenderPendingTasks, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZoneAwareQueueingScheduler as ɵZoneAwareQueueingScheduler, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalAfterNextRender as ɵinternalAfterNextRender, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
35154
+ export { ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AfterRenderPhase, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, DestroyRef, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, Renderer2, RendererFactory2, RendererStyleFlags2, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TransferState, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, afterNextRender, afterRender, asNativeElements, assertInInjectionContext, assertNotInReactiveContext, assertPlatform, booleanAttribute, computed, createComponent, createEnvironmentInjector, createNgModule, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, effect, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, isSignal, isStandalone, makeEnvironmentProviders, makeStateKey, mergeApplicationConfig, numberAttribute, platformCore, provideZoneChangeDetection, reflectComponentType, resolveForwardRef, runInInjectionContext, setTestabilityGetter, signal, untracked, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, AfterRenderEventManager as ɵAfterRenderEventManager, CONTAINER_HEADER_OFFSET as ɵCONTAINER_HEADER_OFFSET, ChangeDetectionScheduler as ɵChangeDetectionScheduler, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG as ɵDEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR as ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DeferBlockBehavior as ɵDeferBlockBehavior, DeferBlockState as ɵDeferBlockState, EffectScheduler as ɵEffectScheduler, IMAGE_CONFIG as ɵIMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS as ɵIMAGE_CONFIG_DEFAULTS, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, ɵINPUT_SIGNAL_BRAND_WRITE_TYPE, IS_HYDRATION_DOM_REUSE_ENABLED as ɵIS_HYDRATION_DOM_REUSE_ENABLED, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, PendingTasks as ɵPendingTasks, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, SSR_CONTENT_INTEGRITY_MARKER as ɵSSR_CONTENT_INTEGRITY_MARKER, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, USE_RUNTIME_DEPS_TRACKER_FOR_JIT as ɵUSE_RUNTIME_DEPS_TRACKER_FOR_JIT, ViewRef$1 as ɵViewRef, XSS_SECURITY_URL as ɵXSS_SECURITY_URL, ZoneAwareQueueingScheduler as ɵZoneAwareQueueingScheduler, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, annotateForHydration as ɵannotateForHydration, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, convertToBitFlags as ɵconvertToBitFlags, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, depsTracker as ɵdepsTracker, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, formatRuntimeError as ɵformatRuntimeError, generateStandaloneInDeclarationsError as ɵgenerateStandaloneInDeclarationsError, getAsyncClassMetadataFn as ɵgetAsyncClassMetadataFn, getDebugNode as ɵgetDebugNode, getDeferBlocks as ɵgetDeferBlocks, getDirectives as ɵgetDirectives, getEnsureDirtyViewsAreAlwaysReachable as ɵgetEnsureDirtyViewsAreAlwaysReachable, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, input as ɵinput, inputFunction as ɵinputFunctionForApiGuard, inputRequiredFunction as ɵinputFunctionRequiredForApiGuard, internalAfterNextRender as ɵinternalAfterNextRender, internalCreateApplication as ɵinternalCreateApplication, isBoundToModule as ɵisBoundToModule, isComponentDefPendingResolution as ɵisComponentDefPendingResolution, isEnvironmentProviders as ɵisEnvironmentProviders, isInjectable as ɵisInjectable, isNgModule as ɵisNgModule, isPromise as ɵisPromise, isSubscribable as ɵisSubscribable, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, performanceMarkFeature as ɵperformanceMarkFeature, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderDeferBlockState as ɵrenderDeferBlockState, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, restoreComponentResolutionQueue as ɵrestoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setAlternateWeakRefImpl as ɵsetAlternateWeakRefImpl, ɵsetClassDebugInfo, setClassMetadata as ɵsetClassMetadata, setClassMetadataAsync as ɵsetClassMetadataAsync, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setEnsureDirtyViewsAreAlwaysReachable as ɵsetEnsureDirtyViewsAreAlwaysReachable, setInjectorProfilerContext as ɵsetInjectorProfilerContext, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, triggerResourceLoading as ɵtriggerResourceLoading, truncateMiddle as ɵtruncateMiddle, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenStable as ɵwhenStable, withDomHydration as ɵwithDomHydration, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵInputTransformsFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵcontentQuery, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵvalidateIframeAttribute, ɵɵviewQuery };
35045
35155
  //# sourceMappingURL=core.mjs.map