@angular/core 17.1.0-next.2 → 17.1.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/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 +509 -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/scheduling.mjs +103 -0
  13. package/esm2022/src/compiler/compiler_facade_interface.mjs +1 -1
  14. package/esm2022/src/core.mjs +15 -7
  15. package/esm2022/src/core_private_export.mjs +5 -3
  16. package/esm2022/src/core_reactivity_export_internal.mjs +2 -2
  17. package/esm2022/src/core_render3_private_export.mjs +2 -2
  18. package/esm2022/src/error_handler.mjs +15 -1
  19. package/esm2022/src/hydration/annotate.mjs +30 -20
  20. package/esm2022/src/hydration/api.mjs +2 -2
  21. package/esm2022/src/hydration/cleanup.mjs +1 -1
  22. package/esm2022/src/hydration/interfaces.mjs +1 -1
  23. package/esm2022/src/hydration/node_lookup_utils.mjs +23 -2
  24. package/esm2022/src/image_performance_warning.mjs +2 -2
  25. package/esm2022/src/linker/query_list.mjs +8 -6
  26. package/esm2022/src/metadata/do_bootstrap.mjs +1 -1
  27. package/esm2022/src/platform/platform.mjs +135 -0
  28. package/esm2022/src/platform/platform_core_providers.mjs +15 -0
  29. package/esm2022/src/platform/platform_ref.mjs +179 -0
  30. package/esm2022/src/render3/instructions/change_detection.mjs +2 -4
  31. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  32. package/esm2022/src/render3/interfaces/public_definitions.mjs +1 -1
  33. package/esm2022/src/render3/list_reconciliation.mjs +58 -24
  34. package/esm2022/src/render3/node_manipulation.mjs +2 -2
  35. package/esm2022/src/render3/util/change_detection_utils.mjs +3 -1
  36. package/esm2022/src/render3/util/misc_utils.mjs +2 -2
  37. package/esm2022/src/render3/view_manipulation.mjs +13 -5
  38. package/esm2022/src/render3/view_ref.mjs +7 -1
  39. package/esm2022/src/transfer_state.mjs +2 -2
  40. package/esm2022/src/util/performance.mjs +2 -2
  41. package/esm2022/src/version.mjs +1 -1
  42. package/esm2022/src/zone/ng_zone.mjs +10 -1
  43. package/esm2022/testing/src/component_fixture.mjs +20 -36
  44. package/esm2022/testing/src/logger.mjs +3 -3
  45. package/esm2022/testing/src/test_bed.mjs +5 -6
  46. package/fesm2022/core.mjs +1280 -1169
  47. package/fesm2022/core.mjs.map +1 -1
  48. package/fesm2022/primitives/signals.mjs +2 -9
  49. package/fesm2022/primitives/signals.mjs.map +1 -1
  50. package/fesm2022/rxjs-interop.mjs +1 -1
  51. package/fesm2022/testing.mjs +46 -64
  52. package/fesm2022/testing.mjs.map +1 -1
  53. package/index.d.ts +161 -21
  54. package/package.json +1 -1
  55. package/primitives/signals/index.d.ts +1 -1
  56. package/rxjs-interop/index.d.ts +1 -1
  57. package/schematics/migrations/block-template-entities/bundle.js +951 -429
  58. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  59. package/schematics/ng-generate/control-flow-migration/bundle.js +1214 -497
  60. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  61. package/schematics/ng-generate/standalone-migration/bundle.js +2023 -1223
  62. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  63. package/testing/index.d.ts +6 -10
  64. package/esm2022/src/application_config.mjs +0 -21
  65. package/esm2022/src/application_init.mjs +0 -188
  66. package/esm2022/src/application_module.mjs +0 -29
  67. package/esm2022/src/application_ref.mjs +0 -997
  68. package/esm2022/src/application_tokens.mjs +0 -121
  69. package/esm2022/src/platform_core_providers.mjs +0 -15
package/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.0-next.2
2
+ * @license Angular v17.1.0-next.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -8,6 +8,45 @@ import { setActiveConsumer as setActiveConsumer$1, consumerDestroy as consumerDe
8
8
  import { Subject, Subscription, Observable, merge as merge$1, BehaviorSubject, of } from 'rxjs';
9
9
  import { share, switchMap, distinctUntilChanged, first } from 'rxjs/operators';
10
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:
49
+
11
50
  function getClosureSafeProperty(objWithPropertyToExtract) {
12
51
  for (let key in objWithPropertyToExtract) {
13
52
  if (objWithPropertyToExtract[key] === getClosureSafeProperty) {
@@ -8267,7 +8306,6 @@ function detachView(lContainer, removeIndex) {
8267
8306
  function destroyLView(tView, lView) {
8268
8307
  if (!(lView[FLAGS] & 256 /* LViewFlags.Destroyed */)) {
8269
8308
  const renderer = lView[RENDERER];
8270
- lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy$1(lView[REACTIVE_TEMPLATE_CONSUMER]);
8271
8309
  if (renderer.destroyNode) {
8272
8310
  applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
8273
8311
  }
@@ -8293,6 +8331,7 @@ function cleanUpView(tView, lView) {
8293
8331
  // This also aligns with the ViewEngine behavior. It also means that the onDestroy hook is
8294
8332
  // really more of an "afterDestroy" hook if you think about it.
8295
8333
  lView[FLAGS] |= 256 /* LViewFlags.Destroyed */;
8334
+ lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy$1(lView[REACTIVE_TEMPLATE_CONSUMER]);
8296
8335
  executeOnDestroys(tView, lView);
8297
8336
  processCleanups(tView, lView);
8298
8337
  // For component views only, the local renderer is destroyed at clean up time.
@@ -10427,7 +10466,7 @@ class Version {
10427
10466
  /**
10428
10467
  * @publicApi
10429
10468
  */
10430
- const VERSION = new Version('17.1.0-next.2');
10469
+ const VERSION = new Version('17.1.0-next.4');
10431
10470
 
10432
10471
  // This default value is when checking the hierarchy for a token.
10433
10472
  //
@@ -11762,6 +11801,19 @@ class ErrorHandler {
11762
11801
  return e || null;
11763
11802
  }
11764
11803
  }
11804
+ /**
11805
+ * `InjectionToken` used to configure how to call the `ErrorHandler`.
11806
+ *
11807
+ * `NgZone` is provided by default today so the default (and only) implementation for this
11808
+ * is calling `ErrorHandler.handleError` outside of the Angular zone.
11809
+ */
11810
+ const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
11811
+ providedIn: 'root',
11812
+ factory: () => {
11813
+ const userErrorHandler = inject(ErrorHandler);
11814
+ return userErrorHandler.handleError.bind(undefined);
11815
+ }
11816
+ });
11765
11817
 
11766
11818
  /**
11767
11819
  * Internal token that specifies whether DOM reuse logic
@@ -13306,9 +13358,6 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
13306
13358
  afterRenderEventManager?.begin();
13307
13359
  }
13308
13360
  try {
13309
- const tView = lView[TVIEW];
13310
- const context = lView[CONTEXT];
13311
- refreshView(tView, lView, tView.template, context);
13312
13361
  detectChangesInViewWhileDirty(lView);
13313
13362
  }
13314
13363
  catch (error) {
@@ -13329,6 +13378,7 @@ function detectChangesInternal(lView, notifyErrorHandler = true) {
13329
13378
  }
13330
13379
  }
13331
13380
  function detectChangesInViewWhileDirty(lView) {
13381
+ detectChangesInView(lView, 0 /* ChangeDetectionMode.Global */);
13332
13382
  let retries = 0;
13333
13383
  // If after running change detection, this view still needs to be refreshed or there are
13334
13384
  // descendants views that need to be refreshed due to re-dirtying during the change detection
@@ -13900,6 +13950,12 @@ class ViewRef$1 {
13900
13950
  * See {@link ChangeDetectorRef#detach} for more information.
13901
13951
  */
13902
13952
  detectChanges() {
13953
+ // Add `RefreshView` flag to ensure this view is refreshed if not already dirty.
13954
+ // `RefreshView` flag is used intentionally over `Dirty` because it gets cleared before
13955
+ // executing any of the actual refresh code while the `Dirty` flag doesn't get cleared
13956
+ // until the end of the refresh. Using `RefreshView` prevents creating a potential difference
13957
+ // in the state of the LViewFlags during template execution.
13958
+ this._lView[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
13903
13959
  detectChangesInternal(this._lView, this.notifyErrorHandler);
13904
13960
  }
13905
13961
  /**
@@ -14269,7 +14325,7 @@ function performanceMarkFeature(feature) {
14269
14325
  return;
14270
14326
  }
14271
14327
  markedFeatures.add(feature);
14272
- performance?.mark?.('mark_use_counter', { detail: { feature } });
14328
+ performance?.mark?.('mark_feature_usage', { detail: { feature } });
14273
14329
  }
14274
14330
 
14275
14331
  /// <reference types="rxjs" />
@@ -14840,6 +14896,15 @@ function shouldBeIgnoredByZone(applyArgs) {
14840
14896
  // Prevent triggering change detection when the __ignore_ng_zone__ flag is detected.
14841
14897
  return applyArgs[0].data?.['__ignore_ng_zone__'] === true;
14842
14898
  }
14899
+ function getNgZone(ngZoneToUse = 'zone.js', options) {
14900
+ if (ngZoneToUse === 'noop') {
14901
+ return new NoopNgZone();
14902
+ }
14903
+ if (ngZoneToUse === 'zone.js') {
14904
+ return new NgZone(options);
14905
+ }
14906
+ return ngZoneToUse;
14907
+ }
14843
14908
 
14844
14909
  // Public API for Zone
14845
14910
 
@@ -19117,6 +19182,17 @@ function isFirstElementInNgContainer(tNode) {
19117
19182
  function getNoOffsetIndex(tNode) {
19118
19183
  return tNode.index - HEADER_OFFSET;
19119
19184
  }
19185
+ /**
19186
+ * Check whether a given node exists, but is disconnected from the DOM.
19187
+ *
19188
+ * Note: we leverage the fact that we have this information available in the DOM emulation
19189
+ * layer (in Domino) for now. Longer-term solution should not rely on the DOM emulation and
19190
+ * only use internal data structures and state to compute this information.
19191
+ */
19192
+ function isDisconnectedNode(tNode, lView) {
19193
+ return !(tNode.type & 16 /* TNodeType.Projection */) && !!lView[tNode.index] &&
19194
+ !unwrapRNode(lView[tNode.index])?.isConnected;
19195
+ }
19120
19196
  /**
19121
19197
  * Locate a node in DOM tree that corresponds to a given TNode.
19122
19198
  *
@@ -19318,10 +19394,20 @@ function calcPathBetween(from, to, fromNodeName) {
19318
19394
  * instructions needs to be generated for a TNode.
19319
19395
  */
19320
19396
  function calcPathForNode(tNode, lView) {
19321
- const parentTNode = tNode.parent;
19397
+ let parentTNode = tNode.parent;
19322
19398
  let parentIndex;
19323
19399
  let parentRNode;
19324
19400
  let referenceNodeName;
19401
+ // Skip over all parent nodes that are disconnected from the DOM, such nodes
19402
+ // can not be used as anchors.
19403
+ //
19404
+ // This might happen in certain content projection-based use-cases, where
19405
+ // a content of an element is projected and used, when a parent element
19406
+ // itself remains detached from DOM. In this scenario we try to find a parent
19407
+ // element that is attached to DOM and can act as an anchor instead.
19408
+ while (parentTNode !== null && isDisconnectedNode(parentTNode, lView)) {
19409
+ parentTNode = parentTNode.parent;
19410
+ }
19325
19411
  if (parentTNode === null || !(parentTNode.type & 3 /* TNodeType.AnyRNode */)) {
19326
19412
  // If there is no parent TNode or a parent TNode does not represent an RNode
19327
19413
  // (i.e. not a DOM node), use component host element as a reference node.
@@ -19565,7 +19651,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
19565
19651
  }
19566
19652
  // Fallback to the slow path: we need to learn more about the content of the live and new
19567
19653
  // collections.
19568
- detachedItems ??= new MultiMap();
19654
+ detachedItems ??= new UniqueValueMultiKeyMap();
19569
19655
  liveKeysInTheFuture ??=
19570
19656
  initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
19571
19657
  // Check if I'm inserting a previously detached item: if so, attach it here
@@ -19613,7 +19699,7 @@ function reconcile(liveCollection, newCollection, trackByFn) {
19613
19699
  newIterationResult = newCollectionIterator.next();
19614
19700
  }
19615
19701
  else {
19616
- detachedItems ??= new MultiMap();
19702
+ detachedItems ??= new UniqueValueMultiKeyMap();
19617
19703
  liveKeysInTheFuture ??=
19618
19704
  initLiveItemsInTheFuture(liveCollection, liveStartIdx, liveEndIdx, trackByFn);
19619
19705
  // Check if I'm inserting a previously detached item: if so, attach it here
@@ -19679,40 +19765,73 @@ function initLiveItemsInTheFuture(liveCollection, start, end, trackByFn) {
19679
19765
  }
19680
19766
  return keys;
19681
19767
  }
19682
- class MultiMap {
19768
+ /**
19769
+ * A specific, partial implementation of the Map interface with the following characteristics:
19770
+ * - allows multiple values for a given key;
19771
+ * - maintain FIFO order for multiple values corresponding to a given key;
19772
+ * - assumes that all values are unique.
19773
+ *
19774
+ * The implementation aims at having the minimal overhead for cases where keys are _not_ duplicated
19775
+ * (the most common case in the list reconciliation algorithm). To achieve this, the first value for
19776
+ * a given key is stored in a regular map. Then, when more values are set for a given key, we
19777
+ * maintain a form of linked list in a separate map. To maintain this linked list we assume that all
19778
+ * values (in the entire collection) are unique.
19779
+ */
19780
+ class UniqueValueMultiKeyMap {
19683
19781
  constructor() {
19684
- this.map = new Map();
19782
+ // A map from a key to the first value corresponding to this key.
19783
+ this.kvMap = new Map();
19784
+ // A map that acts as a linked list of values - each value maps to the next value in this "linked
19785
+ // list" (this only works if values are unique). Allocated lazily to avoid memory consumption when
19786
+ // there are no duplicated values.
19787
+ this._vMap = undefined;
19685
19788
  }
19686
19789
  has(key) {
19687
- const listOfKeys = this.map.get(key);
19688
- return listOfKeys !== undefined && listOfKeys.length > 0;
19790
+ return this.kvMap.has(key);
19689
19791
  }
19690
19792
  delete(key) {
19691
- const listOfKeys = this.map.get(key);
19692
- if (listOfKeys !== undefined) {
19693
- listOfKeys.shift();
19694
- return true;
19793
+ if (!this.has(key))
19794
+ return false;
19795
+ const value = this.kvMap.get(key);
19796
+ if (this._vMap !== undefined && this._vMap.has(value)) {
19797
+ this.kvMap.set(key, this._vMap.get(value));
19798
+ this._vMap.delete(value);
19695
19799
  }
19696
- return false;
19800
+ else {
19801
+ this.kvMap.delete(key);
19802
+ }
19803
+ return true;
19697
19804
  }
19698
19805
  get(key) {
19699
- const listOfKeys = this.map.get(key);
19700
- return listOfKeys !== undefined && listOfKeys.length > 0 ? listOfKeys[0] : undefined;
19806
+ return this.kvMap.get(key);
19701
19807
  }
19702
19808
  set(key, value) {
19703
- // if value is array, they we always store it as [value].
19704
- if (!this.map.has(key)) {
19705
- this.map.set(key, [value]);
19706
- return;
19809
+ if (this.kvMap.has(key)) {
19810
+ let prevValue = this.kvMap.get(key);
19811
+ ngDevMode &&
19812
+ assertNotSame(prevValue, value, `Detected a duplicated value ${value} for the key ${key}`);
19813
+ if (this._vMap === undefined) {
19814
+ this._vMap = new Map();
19815
+ }
19816
+ const vMap = this._vMap;
19817
+ while (vMap.has(prevValue)) {
19818
+ prevValue = vMap.get(prevValue);
19819
+ }
19820
+ vMap.set(prevValue, value);
19821
+ }
19822
+ else {
19823
+ this.kvMap.set(key, value);
19707
19824
  }
19708
- // THINK: this allows duplicate values, but I guess this is fine?
19709
- // Is the existing key an array or not?
19710
- this.map.get(key)?.push(value);
19711
19825
  }
19712
19826
  forEach(cb) {
19713
- for (const [key, values] of this.map) {
19714
- for (const value of values) {
19715
- cb(value, key);
19827
+ for (let [key, value] of this.kvMap) {
19828
+ cb(value, key);
19829
+ if (this._vMap !== undefined) {
19830
+ const vMap = this._vMap;
19831
+ while (vMap.has(value)) {
19832
+ value = vMap.get(value);
19833
+ cb(value, key);
19834
+ }
19716
19835
  }
19717
19836
  }
19718
19837
  }
@@ -19755,13 +19874,14 @@ function getLViewFromLContainer(lContainer, index) {
19755
19874
  * block (in which case view contents was re-created, thus needing insertion).
19756
19875
  */
19757
19876
  function shouldAddViewToDom(tNode, dehydratedView) {
19758
- return !dehydratedView || hasInSkipHydrationBlockFlag(tNode);
19877
+ return !dehydratedView || dehydratedView.firstChild === null ||
19878
+ hasInSkipHydrationBlockFlag(tNode);
19759
19879
  }
19760
19880
  function addLViewToLContainer(lContainer, lView, index, addToDOM = true) {
19761
19881
  const tView = lView[TVIEW];
19762
- // insert to the view tree so the new view can be change-detected
19882
+ // Insert into the view tree so the new view can be change-detected
19763
19883
  insertView(tView, lView, lContainer, index);
19764
- // insert to the view to the DOM tree
19884
+ // Insert elements that belong to this view into the DOM tree
19765
19885
  if (addToDOM) {
19766
19886
  const beforeNode = getBeforeNodeForView(index, lContainer);
19767
19887
  const renderer = lView[RENDERER];
@@ -19770,6 +19890,13 @@ function addLViewToLContainer(lContainer, lView, index, addToDOM = true) {
19770
19890
  addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);
19771
19891
  }
19772
19892
  }
19893
+ // When in hydration mode, reset the pointer to the first child in
19894
+ // the dehydrated view. This indicates that the view was hydrated and
19895
+ // further attaching/detaching should work with this view as normal.
19896
+ const hydrationInfo = lView[HYDRATION];
19897
+ if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {
19898
+ hydrationInfo.firstChild = null;
19899
+ }
19773
19900
  }
19774
19901
  function removeLViewFromLContainer(lContainer, index) {
19775
19902
  const lView = detachView(lContainer, index);
@@ -27846,7 +27973,7 @@ class QueryList {
27846
27973
  * Returns `Observable` of `QueryList` notifying the subscriber of changes.
27847
27974
  */
27848
27975
  get changes() {
27849
- return this._changes || (this._changes = new EventEmitter());
27976
+ return this._changes ??= new EventEmitter();
27850
27977
  }
27851
27978
  /**
27852
27979
  * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
@@ -27858,7 +27985,7 @@ class QueryList {
27858
27985
  this.dirty = true;
27859
27986
  this._results = [];
27860
27987
  this._changesDetected = false;
27861
- this._changes = null;
27988
+ this._changes = undefined;
27862
27989
  this.length = 0;
27863
27990
  this.first = undefined;
27864
27991
  this.last = undefined;
@@ -27949,7 +28076,7 @@ class QueryList {
27949
28076
  * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
27950
28077
  */
27951
28078
  notifyOnChanges() {
27952
- if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))
28079
+ if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly))
27953
28080
  this._changes.emit(this);
27954
28081
  }
27955
28082
  /** internal */
@@ -27958,8 +28085,10 @@ class QueryList {
27958
28085
  }
27959
28086
  /** internal */
27960
28087
  destroy() {
27961
- this.changes.complete();
27962
- this.changes.unsubscribe();
28088
+ if (this._changes !== undefined) {
28089
+ this._changes.complete();
28090
+ this._changes.unsubscribe();
28091
+ }
27963
28092
  }
27964
28093
  }
27965
28094
 
@@ -29899,190 +30028,6 @@ const NgModule = makeDecorator('NgModule', (ngModule) => ngModule, undefined, un
29899
30028
  */
29900
30029
  const ITS_JUST_ANGULAR = true;
29901
30030
 
29902
- /**
29903
- * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
29904
- * one or more initialization functions.
29905
- *
29906
- * The provided functions are injected at application startup and executed during
29907
- * app initialization. If any of these functions returns a Promise or an Observable, initialization
29908
- * does not complete until the Promise is resolved or the Observable is completed.
29909
- *
29910
- * You can, for example, create a factory function that loads language data
29911
- * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
29912
- * The function is executed during the application bootstrap process,
29913
- * and the needed data is available on startup.
29914
- *
29915
- * @see {@link ApplicationInitStatus}
29916
- *
29917
- * @usageNotes
29918
- *
29919
- * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
29920
- * and a function returning a promise.
29921
- * ### Example with NgModule-based application
29922
- * ```
29923
- * function initializeApp(): Promise<any> {
29924
- * return new Promise((resolve, reject) => {
29925
- * // Do some asynchronous stuff
29926
- * resolve();
29927
- * });
29928
- * }
29929
- *
29930
- * @NgModule({
29931
- * imports: [BrowserModule],
29932
- * declarations: [AppComponent],
29933
- * bootstrap: [AppComponent],
29934
- * providers: [{
29935
- * provide: APP_INITIALIZER,
29936
- * useFactory: () => initializeApp,
29937
- * multi: true
29938
- * }]
29939
- * })
29940
- * export class AppModule {}
29941
- * ```
29942
- *
29943
- * ### Example with standalone application
29944
- * ```
29945
- * export function initializeApp(http: HttpClient) {
29946
- * return (): Promise<any> =>
29947
- * firstValueFrom(
29948
- * http
29949
- * .get("https://someUrl.com/api/user")
29950
- * .pipe(tap(user => { ... }))
29951
- * );
29952
- * }
29953
- *
29954
- * bootstrapApplication(App, {
29955
- * providers: [
29956
- * provideHttpClient(),
29957
- * {
29958
- * provide: APP_INITIALIZER,
29959
- * useFactory: initializeApp,
29960
- * multi: true,
29961
- * deps: [HttpClient],
29962
- * },
29963
- * ],
29964
- * });
29965
-
29966
- * ```
29967
- *
29968
- *
29969
- * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
29970
- * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
29971
- * demo purposes to illustrate how the factory function can work with other providers available
29972
- * through DI.
29973
- *
29974
- * ### Example with NgModule-based application
29975
- * ```
29976
- * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
29977
- * return () => httpClient.get("https://someUrl.com/api/user")
29978
- * .pipe(
29979
- * tap(user => { ... })
29980
- * );
29981
- * }
29982
- *
29983
- * @NgModule({
29984
- * imports: [BrowserModule, HttpClientModule],
29985
- * declarations: [AppComponent],
29986
- * bootstrap: [AppComponent],
29987
- * providers: [{
29988
- * provide: APP_INITIALIZER,
29989
- * useFactory: initializeAppFactory,
29990
- * deps: [HttpClient],
29991
- * multi: true
29992
- * }]
29993
- * })
29994
- * export class AppModule {}
29995
- * ```
29996
- *
29997
- * ### Example with standalone application
29998
- * ```
29999
- * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
30000
- * return () => httpClient.get("https://someUrl.com/api/user")
30001
- * .pipe(
30002
- * tap(user => { ... })
30003
- * );
30004
- * }
30005
- *
30006
- * bootstrapApplication(App, {
30007
- * providers: [
30008
- * provideHttpClient(),
30009
- * {
30010
- * provide: APP_INITIALIZER,
30011
- * useFactory: initializeAppFactory,
30012
- * multi: true,
30013
- * deps: [HttpClient],
30014
- * },
30015
- * ],
30016
- * });
30017
- * ```
30018
- *
30019
- * @publicApi
30020
- */
30021
- const APP_INITIALIZER = new InjectionToken('Application Initializer');
30022
- /**
30023
- * A class that reflects the state of running {@link APP_INITIALIZER} functions.
30024
- *
30025
- * @publicApi
30026
- */
30027
- class ApplicationInitStatus {
30028
- constructor() {
30029
- this.initialized = false;
30030
- this.done = false;
30031
- this.donePromise = new Promise((res, rej) => {
30032
- this.resolve = res;
30033
- this.reject = rej;
30034
- });
30035
- this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
30036
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
30037
- throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
30038
- `(expected an array, but got ${typeof this.appInits}). ` +
30039
- 'Please check that the `APP_INITIALIZER` token is configured as a ' +
30040
- '`multi: true` provider.');
30041
- }
30042
- }
30043
- /** @internal */
30044
- runInitializers() {
30045
- if (this.initialized) {
30046
- return;
30047
- }
30048
- const asyncInitPromises = [];
30049
- for (const appInits of this.appInits) {
30050
- const initResult = appInits();
30051
- if (isPromise(initResult)) {
30052
- asyncInitPromises.push(initResult);
30053
- }
30054
- else if (isSubscribable(initResult)) {
30055
- const observableAsPromise = new Promise((resolve, reject) => {
30056
- initResult.subscribe({ complete: resolve, error: reject });
30057
- });
30058
- asyncInitPromises.push(observableAsPromise);
30059
- }
30060
- }
30061
- const complete = () => {
30062
- // @ts-expect-error overwriting a readonly
30063
- this.done = true;
30064
- this.resolve();
30065
- };
30066
- Promise.all(asyncInitPromises)
30067
- .then(() => {
30068
- complete();
30069
- })
30070
- .catch(e => {
30071
- this.reject(e);
30072
- });
30073
- if (asyncInitPromises.length === 0) {
30074
- complete();
30075
- }
30076
- this.initialized = true;
30077
- }
30078
- static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
30079
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
30080
- }
30081
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
30082
- type: Injectable,
30083
- args: [{ providedIn: 'root' }]
30084
- }], () => [], null); })();
30085
-
30086
30031
  class Console {
30087
30032
  log(message) {
30088
30033
  // tslint:disable-next-line:no-console
@@ -30102,538 +30047,209 @@ class Console {
30102
30047
  }], null, null); })();
30103
30048
 
30104
30049
  /**
30105
- * Work out the locale from the potential global properties.
30050
+ * *Internal* service that keeps track of pending tasks happening in the system
30051
+ * during the initial rendering. No tasks are tracked after an initial
30052
+ * rendering.
30106
30053
  *
30107
- * * Closure Compiler: use `goog.LOCALE`.
30108
- * * Ivy enabled: use `$localize.locale`
30054
+ * This information is needed to make sure that the serialization on the server
30055
+ * is delayed until all tasks in the queue (such as an initial navigation or a
30056
+ * pending HTTP request) are completed.
30109
30057
  */
30110
- function getGlobalLocale() {
30111
- if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
30112
- typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
30113
- // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
30114
- // * In order to preserve backwards compatibility, we use Angular default value over
30115
- // Closure Compiler's one.
30116
- return goog.LOCALE;
30058
+ class InitialRenderPendingTasks {
30059
+ constructor() {
30060
+ this.taskId = 0;
30061
+ this.pendingTasks = new Set();
30062
+ this.hasPendingTasks = new BehaviorSubject(false);
30117
30063
  }
30118
- else {
30119
- // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
30120
- // COMPILE-TIME INLINER.
30121
- //
30122
- // * During compile time inlining of translations the expression will be replaced
30123
- // with a string literal that is the current locale. Other forms of this expression are not
30124
- // guaranteed to be replaced.
30125
- //
30126
- // * During runtime translation evaluation, the developer is required to set `$localize.locale`
30127
- // if required, or just to provide their own `LOCALE_ID` provider.
30128
- return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
30064
+ add() {
30065
+ this.hasPendingTasks.next(true);
30066
+ const taskId = this.taskId++;
30067
+ this.pendingTasks.add(taskId);
30068
+ return taskId;
30069
+ }
30070
+ remove(taskId) {
30071
+ this.pendingTasks.delete(taskId);
30072
+ if (this.pendingTasks.size === 0) {
30073
+ this.hasPendingTasks.next(false);
30074
+ }
30075
+ }
30076
+ ngOnDestroy() {
30077
+ this.pendingTasks.clear();
30078
+ this.hasPendingTasks.next(false);
30129
30079
  }
30080
+ static { this.ɵfac = function InitialRenderPendingTasks_Factory(t) { return new (t || InitialRenderPendingTasks)(); }; }
30081
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: InitialRenderPendingTasks, factory: InitialRenderPendingTasks.ɵfac, providedIn: 'root' }); }
30130
30082
  }
30083
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InitialRenderPendingTasks, [{
30084
+ type: Injectable,
30085
+ args: [{ providedIn: 'root' }]
30086
+ }], null, null); })();
30087
+
30131
30088
  /**
30132
- * Provide this token to set the locale of your application.
30133
- * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
30134
- * DecimalPipe and PercentPipe) and by ICU expressions.
30135
- *
30136
- * See the [i18n guide](guide/i18n-common-locale-id) for more information.
30089
+ * Combination of NgModuleFactory and ComponentFactories.
30137
30090
  *
30138
- * @usageNotes
30139
- * ### Example
30091
+ * @publicApi
30140
30092
  *
30141
- * ```typescript
30142
- * import { LOCALE_ID } from '@angular/core';
30143
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30144
- * import { AppModule } from './app/app.module';
30093
+ * @deprecated
30094
+ * Ivy JIT mode doesn't require accessing this symbol.
30095
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30096
+ * additional context.
30097
+ */
30098
+ class ModuleWithComponentFactories {
30099
+ constructor(ngModuleFactory, componentFactories) {
30100
+ this.ngModuleFactory = ngModuleFactory;
30101
+ this.componentFactories = componentFactories;
30102
+ }
30103
+ }
30104
+ /**
30105
+ * Low-level service for running the angular compiler during runtime
30106
+ * to create {@link ComponentFactory}s, which
30107
+ * can later be used to create and render a Component instance.
30145
30108
  *
30146
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30147
- * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
30148
- * });
30149
- * ```
30109
+ * Each `@NgModule` provides an own `Compiler` to its injector,
30110
+ * that will use the directives/pipes of the ng module for compilation
30111
+ * of components.
30150
30112
  *
30151
30113
  * @publicApi
30114
+ *
30115
+ * @deprecated
30116
+ * Ivy JIT mode doesn't require accessing this symbol.
30117
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30118
+ * additional context.
30152
30119
  */
30153
- const LOCALE_ID = new InjectionToken('LocaleId', {
30154
- providedIn: 'root',
30155
- factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
30156
- });
30120
+ class Compiler {
30121
+ /**
30122
+ * Compiles the given NgModule and all of its components. All templates of the components
30123
+ * have to be inlined.
30124
+ */
30125
+ compileModuleSync(moduleType) {
30126
+ return new NgModuleFactory(moduleType);
30127
+ }
30128
+ /**
30129
+ * Compiles the given NgModule and all of its components
30130
+ */
30131
+ compileModuleAsync(moduleType) {
30132
+ return Promise.resolve(this.compileModuleSync(moduleType));
30133
+ }
30134
+ /**
30135
+ * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
30136
+ */
30137
+ compileModuleAndAllComponentsSync(moduleType) {
30138
+ const ngModuleFactory = this.compileModuleSync(moduleType);
30139
+ const moduleDef = getNgModuleDef(moduleType);
30140
+ const componentFactories = maybeUnwrapFn(moduleDef.declarations)
30141
+ .reduce((factories, declaration) => {
30142
+ const componentDef = getComponentDef(declaration);
30143
+ componentDef && factories.push(new ComponentFactory(componentDef));
30144
+ return factories;
30145
+ }, []);
30146
+ return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
30147
+ }
30148
+ /**
30149
+ * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
30150
+ */
30151
+ compileModuleAndAllComponentsAsync(moduleType) {
30152
+ return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
30153
+ }
30154
+ /**
30155
+ * Clears all caches.
30156
+ */
30157
+ clearCache() { }
30158
+ /**
30159
+ * Clears the cache for the given component/ngModule.
30160
+ */
30161
+ clearCacheFor(type) { }
30162
+ /**
30163
+ * Returns the id for a given NgModule, if one is defined and known to the compiler.
30164
+ */
30165
+ getModuleId(moduleType) {
30166
+ return undefined;
30167
+ }
30168
+ static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
30169
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
30170
+ }
30171
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
30172
+ type: Injectable,
30173
+ args: [{ providedIn: 'root' }]
30174
+ }], null, null); })();
30157
30175
  /**
30158
- * Provide this token to set the default currency code your application uses for
30159
- * CurrencyPipe when there is no currency code passed into it. This is only used by
30160
- * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
30161
- *
30162
- * See the [i18n guide](guide/i18n-common-locale-id) for more information.
30163
- *
30164
- * <div class="alert is-helpful">
30176
+ * Token to provide CompilerOptions in the platform injector.
30165
30177
  *
30166
- * **Deprecation notice:**
30178
+ * @publicApi
30179
+ */
30180
+ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
30181
+ /**
30182
+ * A factory for creating a Compiler
30167
30183
  *
30168
- * The default currency code is currently always `USD` but this is deprecated from v9.
30184
+ * @publicApi
30169
30185
  *
30170
- * **In v10 the default currency code will be taken from the current locale.**
30186
+ * @deprecated
30187
+ * Ivy JIT mode doesn't require accessing this symbol.
30188
+ * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30189
+ * additional context.
30190
+ */
30191
+ class CompilerFactory {
30192
+ }
30193
+
30194
+ /**
30195
+ * These are the data structures that our framework injector profiler will fill with data in order
30196
+ * to support DI debugging APIs.
30171
30197
  *
30172
- * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
30173
- * your application `NgModule`:
30198
+ * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
30199
+ * dependencies. Injector -> Token -> Dependencies This is used to support the
30200
+ * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
30201
+ * dependencies.
30174
30202
  *
30175
- * ```ts
30176
- * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
30177
- * ```
30203
+ * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
30204
+ * within it This is used to support the getInjectorProviders API, which takes in an injector and
30205
+ * returns the providers that it was configured with. Note that for the element injector case we
30206
+ * use the TNode instead of the LView as the DI resolver. This is because the registration of
30207
+ * providers happens only once per type of TNode. If an injector is created with an identical TNode,
30208
+ * the providers for that injector will not be reconfigured.
30178
30209
  *
30179
- * </div>
30210
+ * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
30211
+ * component that it is associated with. Used in the getInjectorProviders API, specificially in the
30212
+ * discovery of import paths for each provider. This is necessary because the imports array of a
30213
+ * standalone component is processed and configured in its standalone injector, but exists within
30214
+ * the component's definition. Because getInjectorProviders takes in an injector, if that injector
30215
+ * is the injector of a standalone component, we need to be able to discover the place where the
30216
+ * imports array is located (the component) in order to flatten the imports array within it to
30217
+ * discover all of it's providers.
30180
30218
  *
30181
- * @usageNotes
30182
- * ### Example
30183
30219
  *
30184
- * ```typescript
30185
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30186
- * import { AppModule } from './app/app.module';
30220
+ * All of these data structures are instantiated with WeakMaps. This will ensure that the presence
30221
+ * of any object in the keys of these maps does not prevent the garbage collector from collecting
30222
+ * those objects. Because of this property of WeakMaps, these data structures will never be the
30223
+ * source of a memory leak.
30187
30224
  *
30188
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30189
- * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
30190
- * });
30191
- * ```
30225
+ * An example of this advantage: When components are destroyed, we don't need to do
30226
+ * any additional work to remove that component from our mappings.
30192
30227
  *
30193
- * @publicApi
30194
30228
  */
30195
- const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
30196
- providedIn: 'root',
30197
- factory: () => USD_CURRENCY_CODE,
30198
- });
30229
+ class DIDebugData {
30230
+ constructor() {
30231
+ this.resolverToTokenToDependencies = new WeakMap();
30232
+ this.resolverToProviders = new WeakMap();
30233
+ this.standaloneInjectorToComponent = new WeakMap();
30234
+ }
30235
+ reset() {
30236
+ this.resolverToTokenToDependencies =
30237
+ new WeakMap();
30238
+ this.resolverToProviders = new WeakMap();
30239
+ this.standaloneInjectorToComponent = new WeakMap();
30240
+ }
30241
+ }
30242
+ let frameworkDIDebugData = new DIDebugData();
30243
+ function getFrameworkDIDebugData() {
30244
+ return frameworkDIDebugData;
30245
+ }
30199
30246
  /**
30200
- * Use this token at bootstrap to provide the content of your translation file (`xtb`,
30201
- * `xlf` or `xlf2`) when you want to translate your application in another language.
30202
- *
30203
- * See the [i18n guide](guide/i18n-common-merge) for more information.
30247
+ * Initalize default handling of injector events. This handling parses events
30248
+ * as they are emitted and constructs the data structures necessary to support
30249
+ * some of debug APIs.
30204
30250
  *
30205
- * @usageNotes
30206
- * ### Example
30207
- *
30208
- * ```typescript
30209
- * import { TRANSLATIONS } from '@angular/core';
30210
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30211
- * import { AppModule } from './app/app.module';
30212
- *
30213
- * // content of your translation file
30214
- * const translations = '....';
30215
- *
30216
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30217
- * providers: [{provide: TRANSLATIONS, useValue: translations }]
30218
- * });
30219
- * ```
30220
- *
30221
- * @publicApi
30222
- */
30223
- const TRANSLATIONS = new InjectionToken('Translations');
30224
- /**
30225
- * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
30226
- * `xlf` or `xlf2`.
30227
- *
30228
- * See the [i18n guide](guide/i18n-common-merge) for more information.
30229
- *
30230
- * @usageNotes
30231
- * ### Example
30232
- *
30233
- * ```typescript
30234
- * import { TRANSLATIONS_FORMAT } from '@angular/core';
30235
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30236
- * import { AppModule } from './app/app.module';
30237
- *
30238
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30239
- * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
30240
- * });
30241
- * ```
30242
- *
30243
- * @publicApi
30244
- */
30245
- const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
30246
- /**
30247
- * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
30248
- * that the compiler should use in case of missing translations:
30249
- * - Error: throw if you have missing translations.
30250
- * - Warning (default): show a warning in the console and/or shell.
30251
- * - Ignore: do nothing.
30252
- *
30253
- * See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
30254
- *
30255
- * @usageNotes
30256
- * ### Example
30257
- * ```typescript
30258
- * import { MissingTranslationStrategy } from '@angular/core';
30259
- * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
30260
- * import { AppModule } from './app/app.module';
30261
- *
30262
- * platformBrowserDynamic().bootstrapModule(AppModule, {
30263
- * missingTranslation: MissingTranslationStrategy.Error
30264
- * });
30265
- * ```
30266
- *
30267
- * @publicApi
30268
- */
30269
- var MissingTranslationStrategy;
30270
- (function (MissingTranslationStrategy) {
30271
- MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
30272
- MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
30273
- MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
30274
- })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
30275
-
30276
- // A delay in milliseconds before the scan is run after onLoad, to avoid any
30277
- // potential race conditions with other LCP-related functions. This delay
30278
- // happens outside of the main JavaScript execution and will only effect the timing
30279
- // on when the warning becomes visible in the console.
30280
- const SCAN_DELAY = 200;
30281
- const OVERSIZED_IMAGE_TOLERANCE = 1200;
30282
- class ImagePerformanceWarning {
30283
- constructor() {
30284
- // Map of full image URLs -> original `ngSrc` values.
30285
- this.window = null;
30286
- this.observer = null;
30287
- this.options = inject(IMAGE_CONFIG);
30288
- this.ngZone = inject(NgZone);
30289
- }
30290
- start() {
30291
- if (typeof PerformanceObserver === 'undefined' ||
30292
- (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
30293
- return;
30294
- }
30295
- this.observer = this.initPerformanceObserver();
30296
- const doc = getDocument();
30297
- const win = doc.defaultView;
30298
- if (typeof win !== 'undefined') {
30299
- this.window = win;
30300
- // Wait to avoid race conditions where LCP image triggers
30301
- // load event before it's recorded by the performance observer
30302
- const waitToScan = () => {
30303
- setTimeout(this.scanImages.bind(this), SCAN_DELAY);
30304
- };
30305
- // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
30306
- // the scope of this functionality.
30307
- this.ngZone.runOutsideAngular(() => {
30308
- // Consider the case when the application is created and destroyed multiple times.
30309
- // Typically, applications are created instantly once the page is loaded, and the
30310
- // `window.load` listener is always triggered. However, the `window.load` event will never
30311
- // be fired if the page is loaded, and the application is created later. Checking for
30312
- // `readyState` is the easiest way to determine whether the page has been loaded or not.
30313
- if (doc.readyState === 'complete') {
30314
- waitToScan();
30315
- }
30316
- else {
30317
- this.window?.addEventListener('load', waitToScan, { once: true });
30318
- }
30319
- });
30320
- }
30321
- }
30322
- ngOnDestroy() {
30323
- this.observer?.disconnect();
30324
- }
30325
- initPerformanceObserver() {
30326
- if (typeof PerformanceObserver === 'undefined') {
30327
- return null;
30328
- }
30329
- const observer = new PerformanceObserver((entryList) => {
30330
- const entries = entryList.getEntries();
30331
- if (entries.length === 0)
30332
- return;
30333
- // We use the latest entry produced by the `PerformanceObserver` as the best
30334
- // signal on which element is actually an LCP one. As an example, the first image to load on
30335
- // a page, by virtue of being the only thing on the page so far, is often a LCP candidate
30336
- // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
30337
- const lcpElement = entries[entries.length - 1];
30338
- // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
30339
- // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
30340
- const imgSrc = lcpElement.element?.src ?? '';
30341
- // Exclude `data:` and `blob:` URLs, since they are fetched resources.
30342
- if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
30343
- return;
30344
- this.lcpImageUrl = imgSrc;
30345
- });
30346
- observer.observe({ type: 'largest-contentful-paint', buffered: true });
30347
- return observer;
30348
- }
30349
- scanImages() {
30350
- const images = getDocument().querySelectorAll('img');
30351
- let lcpElementFound, lcpElementLoadedCorrectly = false;
30352
- images.forEach(image => {
30353
- if (!this.options?.disableImageSizeWarning) {
30354
- for (const image of images) {
30355
- // Image elements using the NgOptimizedImage directive are excluded,
30356
- // as that directive has its own version of this check.
30357
- if (!image.getAttribute('ng-img') && this.isOversized(image)) {
30358
- logOversizedImageWarning(image.src);
30359
- }
30360
- }
30361
- }
30362
- if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
30363
- if (image.src === this.lcpImageUrl) {
30364
- lcpElementFound = true;
30365
- if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
30366
- // This variable is set to true and never goes back to false to account
30367
- // for the case where multiple images have the same src url, and some
30368
- // have lazy loading while others don't.
30369
- // Also ignore NgOptimizedImage because there's a different warning for that.
30370
- lcpElementLoadedCorrectly = true;
30371
- }
30372
- }
30373
- }
30374
- });
30375
- if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
30376
- !this.options?.disableImageLazyLoadWarning) {
30377
- logLazyLCPWarning(this.lcpImageUrl);
30378
- }
30379
- }
30380
- isOversized(image) {
30381
- if (!this.window) {
30382
- return false;
30383
- }
30384
- const computedStyle = this.window.getComputedStyle(image);
30385
- let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
30386
- let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
30387
- const boxSizing = computedStyle.getPropertyValue('box-sizing');
30388
- const objectFit = computedStyle.getPropertyValue('object-fit');
30389
- if (objectFit === `cover`) {
30390
- // Object fit cover may indicate a use case such as a sprite sheet where
30391
- // this warning does not apply.
30392
- return false;
30393
- }
30394
- if (boxSizing === 'border-box') {
30395
- const paddingTop = computedStyle.getPropertyValue('padding-top');
30396
- const paddingRight = computedStyle.getPropertyValue('padding-right');
30397
- const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
30398
- const paddingLeft = computedStyle.getPropertyValue('padding-left');
30399
- renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
30400
- renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
30401
- }
30402
- const intrinsicWidth = image.naturalWidth;
30403
- const intrinsicHeight = image.naturalHeight;
30404
- const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
30405
- const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
30406
- const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
30407
- const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
30408
- return oversizedWidth || oversizedHeight;
30409
- }
30410
- static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
30411
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
30412
- }
30413
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
30414
- type: Injectable,
30415
- args: [{ providedIn: 'root' }]
30416
- }], null, null); })();
30417
- function logLazyLCPWarning(src) {
30418
- console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
30419
- `but was given a "loading" value of "lazy", which can negatively impact ` +
30420
- `application loading performance. This warning can be addressed by ` +
30421
- `changing the loading value of the LCP image to "eager", or by using the ` +
30422
- `NgOptimizedImage directive's prioritization utilities. For more ` +
30423
- `information about addressing or disabling this warning, see ` +
30424
- `https://angular.io/errors/NG0913`));
30425
- }
30426
- function logOversizedImageWarning(src) {
30427
- console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
30428
- `rendered size. This can negatively impact application loading performance. ` +
30429
- `For more information about addressing or disabling this warning, see ` +
30430
- `https://angular.io/errors/NG0913`));
30431
- }
30432
-
30433
- /**
30434
- * *Internal* service that keeps track of pending tasks happening in the system
30435
- * during the initial rendering. No tasks are tracked after an initial
30436
- * rendering.
30437
- *
30438
- * This information is needed to make sure that the serialization on the server
30439
- * is delayed until all tasks in the queue (such as an initial navigation or a
30440
- * pending HTTP request) are completed.
30441
- */
30442
- class InitialRenderPendingTasks {
30443
- constructor() {
30444
- this.taskId = 0;
30445
- this.pendingTasks = new Set();
30446
- this.hasPendingTasks = new BehaviorSubject(false);
30447
- }
30448
- add() {
30449
- this.hasPendingTasks.next(true);
30450
- const taskId = this.taskId++;
30451
- this.pendingTasks.add(taskId);
30452
- return taskId;
30453
- }
30454
- remove(taskId) {
30455
- this.pendingTasks.delete(taskId);
30456
- if (this.pendingTasks.size === 0) {
30457
- this.hasPendingTasks.next(false);
30458
- }
30459
- }
30460
- ngOnDestroy() {
30461
- this.pendingTasks.clear();
30462
- this.hasPendingTasks.next(false);
30463
- }
30464
- static { this.ɵfac = function InitialRenderPendingTasks_Factory(t) { return new (t || InitialRenderPendingTasks)(); }; }
30465
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: InitialRenderPendingTasks, factory: InitialRenderPendingTasks.ɵfac, providedIn: 'root' }); }
30466
- }
30467
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(InitialRenderPendingTasks, [{
30468
- type: Injectable,
30469
- args: [{ providedIn: 'root' }]
30470
- }], null, null); })();
30471
-
30472
- /**
30473
- * Combination of NgModuleFactory and ComponentFactories.
30474
- *
30475
- * @publicApi
30476
- *
30477
- * @deprecated
30478
- * Ivy JIT mode doesn't require accessing this symbol.
30479
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30480
- * additional context.
30481
- */
30482
- class ModuleWithComponentFactories {
30483
- constructor(ngModuleFactory, componentFactories) {
30484
- this.ngModuleFactory = ngModuleFactory;
30485
- this.componentFactories = componentFactories;
30486
- }
30487
- }
30488
- /**
30489
- * Low-level service for running the angular compiler during runtime
30490
- * to create {@link ComponentFactory}s, which
30491
- * can later be used to create and render a Component instance.
30492
- *
30493
- * Each `@NgModule` provides an own `Compiler` to its injector,
30494
- * that will use the directives/pipes of the ng module for compilation
30495
- * of components.
30496
- *
30497
- * @publicApi
30498
- *
30499
- * @deprecated
30500
- * Ivy JIT mode doesn't require accessing this symbol.
30501
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30502
- * additional context.
30503
- */
30504
- class Compiler {
30505
- /**
30506
- * Compiles the given NgModule and all of its components. All templates of the components
30507
- * have to be inlined.
30508
- */
30509
- compileModuleSync(moduleType) {
30510
- return new NgModuleFactory(moduleType);
30511
- }
30512
- /**
30513
- * Compiles the given NgModule and all of its components
30514
- */
30515
- compileModuleAsync(moduleType) {
30516
- return Promise.resolve(this.compileModuleSync(moduleType));
30517
- }
30518
- /**
30519
- * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.
30520
- */
30521
- compileModuleAndAllComponentsSync(moduleType) {
30522
- const ngModuleFactory = this.compileModuleSync(moduleType);
30523
- const moduleDef = getNgModuleDef(moduleType);
30524
- const componentFactories = maybeUnwrapFn(moduleDef.declarations)
30525
- .reduce((factories, declaration) => {
30526
- const componentDef = getComponentDef(declaration);
30527
- componentDef && factories.push(new ComponentFactory(componentDef));
30528
- return factories;
30529
- }, []);
30530
- return new ModuleWithComponentFactories(ngModuleFactory, componentFactories);
30531
- }
30532
- /**
30533
- * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.
30534
- */
30535
- compileModuleAndAllComponentsAsync(moduleType) {
30536
- return Promise.resolve(this.compileModuleAndAllComponentsSync(moduleType));
30537
- }
30538
- /**
30539
- * Clears all caches.
30540
- */
30541
- clearCache() { }
30542
- /**
30543
- * Clears the cache for the given component/ngModule.
30544
- */
30545
- clearCacheFor(type) { }
30546
- /**
30547
- * Returns the id for a given NgModule, if one is defined and known to the compiler.
30548
- */
30549
- getModuleId(moduleType) {
30550
- return undefined;
30551
- }
30552
- static { this.ɵfac = function Compiler_Factory(t) { return new (t || Compiler)(); }; }
30553
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Compiler, factory: Compiler.ɵfac, providedIn: 'root' }); }
30554
- }
30555
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Compiler, [{
30556
- type: Injectable,
30557
- args: [{ providedIn: 'root' }]
30558
- }], null, null); })();
30559
- /**
30560
- * Token to provide CompilerOptions in the platform injector.
30561
- *
30562
- * @publicApi
30563
- */
30564
- const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
30565
- /**
30566
- * A factory for creating a Compiler
30567
- *
30568
- * @publicApi
30569
- *
30570
- * @deprecated
30571
- * Ivy JIT mode doesn't require accessing this symbol.
30572
- * See [JIT API changes due to ViewEngine deprecation](guide/deprecations#jit-api-changes) for
30573
- * additional context.
30574
- */
30575
- class CompilerFactory {
30576
- }
30577
-
30578
- /**
30579
- * These are the data structures that our framework injector profiler will fill with data in order
30580
- * to support DI debugging APIs.
30581
- *
30582
- * resolverToTokenToDependencies: Maps an injector to a Map of tokens to an Array of
30583
- * dependencies. Injector -> Token -> Dependencies This is used to support the
30584
- * getDependenciesFromInjectable API, which takes in an injector and a token and returns it's
30585
- * dependencies.
30586
- *
30587
- * resolverToProviders: Maps a DI resolver (an Injector or a TNode) to the providers configured
30588
- * within it This is used to support the getInjectorProviders API, which takes in an injector and
30589
- * returns the providers that it was configured with. Note that for the element injector case we
30590
- * use the TNode instead of the LView as the DI resolver. This is because the registration of
30591
- * providers happens only once per type of TNode. If an injector is created with an identical TNode,
30592
- * the providers for that injector will not be reconfigured.
30593
- *
30594
- * standaloneInjectorToComponent: Maps the injector of a standalone component to the standalone
30595
- * component that it is associated with. Used in the getInjectorProviders API, specificially in the
30596
- * discovery of import paths for each provider. This is necessary because the imports array of a
30597
- * standalone component is processed and configured in its standalone injector, but exists within
30598
- * the component's definition. Because getInjectorProviders takes in an injector, if that injector
30599
- * is the injector of a standalone component, we need to be able to discover the place where the
30600
- * imports array is located (the component) in order to flatten the imports array within it to
30601
- * discover all of it's providers.
30602
- *
30603
- *
30604
- * All of these data structures are instantiated with WeakMaps. This will ensure that the presence
30605
- * of any object in the keys of these maps does not prevent the garbage collector from collecting
30606
- * those objects. Because of this property of WeakMaps, these data structures will never be the
30607
- * source of a memory leak.
30608
- *
30609
- * An example of this advantage: When components are destroyed, we don't need to do
30610
- * any additional work to remove that component from our mappings.
30611
- *
30612
- */
30613
- class DIDebugData {
30614
- constructor() {
30615
- this.resolverToTokenToDependencies = new WeakMap();
30616
- this.resolverToProviders = new WeakMap();
30617
- this.standaloneInjectorToComponent = new WeakMap();
30618
- }
30619
- reset() {
30620
- this.resolverToTokenToDependencies =
30621
- new WeakMap();
30622
- this.resolverToProviders = new WeakMap();
30623
- this.standaloneInjectorToComponent = new WeakMap();
30624
- }
30625
- }
30626
- let frameworkDIDebugData = new DIDebugData();
30627
- function getFrameworkDIDebugData() {
30628
- return frameworkDIDebugData;
30629
- }
30630
- /**
30631
- * Initalize default handling of injector events. This handling parses events
30632
- * as they are emitted and constructs the data structures necessary to support
30633
- * some of debug APIs.
30634
- *
30635
- * See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent
30636
- * for descriptions of each handler
30251
+ * See handleInjectEvent, handleCreateEvent and handleProviderConfiguredEvent
30252
+ * for descriptions of each handler
30637
30253
  *
30638
30254
  * Supported APIs:
30639
30255
  * - getDependenciesFromInjectable
@@ -30835,6 +30451,7 @@ function applyChanges(component) {
30835
30451
  */
30836
30452
  function detectChanges(component) {
30837
30453
  const view = getComponentViewByInstance(component);
30454
+ view[FLAGS] |= 1024 /* LViewFlags.RefreshView */;
30838
30455
  detectChangesInternal(view);
30839
30456
  }
30840
30457
 
@@ -31730,19 +31347,190 @@ function setTestabilityGetter(getter) {
31730
31347
  }
31731
31348
  let _testabilityGetter;
31732
31349
 
31733
- let _platformInjector = null;
31734
31350
  /**
31735
- * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
31736
- * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
31351
+ * A [DI token](guide/glossary#di-token "DI token definition") that you can use to provide
31352
+ * one or more initialization functions.
31353
+ *
31354
+ * The provided functions are injected at application startup and executed during
31355
+ * app initialization. If any of these functions returns a Promise or an Observable, initialization
31356
+ * does not complete until the Promise is resolved or the Observable is completed.
31357
+ *
31358
+ * You can, for example, create a factory function that loads language data
31359
+ * or an external configuration, and provide that function to the `APP_INITIALIZER` token.
31360
+ * The function is executed during the application bootstrap process,
31361
+ * and the needed data is available on startup.
31362
+ *
31363
+ * @see {@link ApplicationInitStatus}
31364
+ *
31365
+ * @usageNotes
31366
+ *
31367
+ * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
31368
+ * and a function returning a promise.
31369
+ * ### Example with NgModule-based application
31370
+ * ```
31371
+ * function initializeApp(): Promise<any> {
31372
+ * return new Promise((resolve, reject) => {
31373
+ * // Do some asynchronous stuff
31374
+ * resolve();
31375
+ * });
31376
+ * }
31377
+ *
31378
+ * @NgModule({
31379
+ * imports: [BrowserModule],
31380
+ * declarations: [AppComponent],
31381
+ * bootstrap: [AppComponent],
31382
+ * providers: [{
31383
+ * provide: APP_INITIALIZER,
31384
+ * useFactory: () => initializeApp,
31385
+ * multi: true
31386
+ * }]
31387
+ * })
31388
+ * export class AppModule {}
31389
+ * ```
31390
+ *
31391
+ * ### Example with standalone application
31392
+ * ```
31393
+ * export function initializeApp(http: HttpClient) {
31394
+ * return (): Promise<any> =>
31395
+ * firstValueFrom(
31396
+ * http
31397
+ * .get("https://someUrl.com/api/user")
31398
+ * .pipe(tap(user => { ... }))
31399
+ * );
31400
+ * }
31401
+ *
31402
+ * bootstrapApplication(App, {
31403
+ * providers: [
31404
+ * provideHttpClient(),
31405
+ * {
31406
+ * provide: APP_INITIALIZER,
31407
+ * useFactory: initializeApp,
31408
+ * multi: true,
31409
+ * deps: [HttpClient],
31410
+ * },
31411
+ * ],
31412
+ * });
31413
+
31414
+ * ```
31415
+ *
31416
+ *
31417
+ * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
31418
+ * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
31419
+ * demo purposes to illustrate how the factory function can work with other providers available
31420
+ * through DI.
31421
+ *
31422
+ * ### Example with NgModule-based application
31423
+ * ```
31424
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
31425
+ * return () => httpClient.get("https://someUrl.com/api/user")
31426
+ * .pipe(
31427
+ * tap(user => { ... })
31428
+ * );
31429
+ * }
31430
+ *
31431
+ * @NgModule({
31432
+ * imports: [BrowserModule, HttpClientModule],
31433
+ * declarations: [AppComponent],
31434
+ * bootstrap: [AppComponent],
31435
+ * providers: [{
31436
+ * provide: APP_INITIALIZER,
31437
+ * useFactory: initializeAppFactory,
31438
+ * deps: [HttpClient],
31439
+ * multi: true
31440
+ * }]
31441
+ * })
31442
+ * export class AppModule {}
31443
+ * ```
31444
+ *
31445
+ * ### Example with standalone application
31446
+ * ```
31447
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
31448
+ * return () => httpClient.get("https://someUrl.com/api/user")
31449
+ * .pipe(
31450
+ * tap(user => { ... })
31451
+ * );
31452
+ * }
31453
+ *
31454
+ * bootstrapApplication(App, {
31455
+ * providers: [
31456
+ * provideHttpClient(),
31457
+ * {
31458
+ * provide: APP_INITIALIZER,
31459
+ * useFactory: initializeAppFactory,
31460
+ * multi: true,
31461
+ * deps: [HttpClient],
31462
+ * },
31463
+ * ],
31464
+ * });
31465
+ * ```
31466
+ *
31467
+ * @publicApi
31737
31468
  */
31738
- const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
31469
+ const APP_INITIALIZER = new InjectionToken('Application Initializer');
31739
31470
  /**
31740
- * Internal token that allows to register extra callbacks that should be invoked during the
31741
- * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
31742
- * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
31743
- * entire class tree-shakeable.
31471
+ * A class that reflects the state of running {@link APP_INITIALIZER} functions.
31472
+ *
31473
+ * @publicApi
31744
31474
  */
31745
- const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
31475
+ class ApplicationInitStatus {
31476
+ constructor() {
31477
+ this.initialized = false;
31478
+ this.done = false;
31479
+ this.donePromise = new Promise((res, rej) => {
31480
+ this.resolve = res;
31481
+ this.reject = rej;
31482
+ });
31483
+ this.appInits = inject(APP_INITIALIZER, { optional: true }) ?? [];
31484
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {
31485
+ throw new RuntimeError(-209 /* RuntimeErrorCode.INVALID_MULTI_PROVIDER */, 'Unexpected type of the `APP_INITIALIZER` token value ' +
31486
+ `(expected an array, but got ${typeof this.appInits}). ` +
31487
+ 'Please check that the `APP_INITIALIZER` token is configured as a ' +
31488
+ '`multi: true` provider.');
31489
+ }
31490
+ }
31491
+ /** @internal */
31492
+ runInitializers() {
31493
+ if (this.initialized) {
31494
+ return;
31495
+ }
31496
+ const asyncInitPromises = [];
31497
+ for (const appInits of this.appInits) {
31498
+ const initResult = appInits();
31499
+ if (isPromise(initResult)) {
31500
+ asyncInitPromises.push(initResult);
31501
+ }
31502
+ else if (isSubscribable(initResult)) {
31503
+ const observableAsPromise = new Promise((resolve, reject) => {
31504
+ initResult.subscribe({ complete: resolve, error: reject });
31505
+ });
31506
+ asyncInitPromises.push(observableAsPromise);
31507
+ }
31508
+ }
31509
+ const complete = () => {
31510
+ // @ts-expect-error overwriting a readonly
31511
+ this.done = true;
31512
+ this.resolve();
31513
+ };
31514
+ Promise.all(asyncInitPromises)
31515
+ .then(() => {
31516
+ complete();
31517
+ })
31518
+ .catch(e => {
31519
+ this.reject(e);
31520
+ });
31521
+ if (asyncInitPromises.length === 0) {
31522
+ complete();
31523
+ }
31524
+ this.initialized = true;
31525
+ }
31526
+ static { this.ɵfac = function ApplicationInitStatus_Factory(t) { return new (t || ApplicationInitStatus)(); }; }
31527
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); }
31528
+ }
31529
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{
31530
+ type: Injectable,
31531
+ args: [{ providedIn: 'root' }]
31532
+ }], () => [], null); })();
31533
+
31746
31534
  /**
31747
31535
  * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
31748
31536
  * be called for every component that is bootstrapped.
@@ -31810,383 +31598,15 @@ function isBoundToModule(cf) {
31810
31598
  }
31811
31599
  /**
31812
31600
  * A token for third-party components that can register themselves with NgProbe.
31813
- *
31814
- * @deprecated
31815
- * @publicApi
31816
- */
31817
- class NgProbeToken {
31818
- constructor(name, token) {
31819
- this.name = name;
31820
- this.token = token;
31821
- }
31822
- }
31823
- /**
31824
- * Creates a platform.
31825
- * Platforms must be created on launch using this function.
31826
- *
31827
- * @publicApi
31828
- */
31829
- function createPlatform(injector) {
31830
- if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
31831
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
31832
- 'There can be only one platform. Destroy the previous one to create a new one.');
31833
- }
31834
- publishDefaultGlobalUtils();
31835
- publishSignalConfiguration();
31836
- _platformInjector = injector;
31837
- const platform = injector.get(PlatformRef);
31838
- runPlatformInitializers(injector);
31839
- return platform;
31840
- }
31841
- /**
31842
- * The goal of this function is to bootstrap a platform injector,
31843
- * but avoid referencing `PlatformRef` class.
31844
- * This function is needed for bootstrapping a Standalone Component.
31845
- */
31846
- function createOrReusePlatformInjector(providers = []) {
31847
- // If a platform injector already exists, it means that the platform
31848
- // is already bootstrapped and no additional actions are required.
31849
- if (_platformInjector)
31850
- return _platformInjector;
31851
- publishDefaultGlobalUtils();
31852
- // Otherwise, setup a new platform injector and run platform initializers.
31853
- const injector = createPlatformInjector(providers);
31854
- _platformInjector = injector;
31855
- publishSignalConfiguration();
31856
- runPlatformInitializers(injector);
31857
- return injector;
31858
- }
31859
- function runPlatformInitializers(injector) {
31860
- const inits = injector.get(PLATFORM_INITIALIZER, null);
31861
- inits?.forEach((init) => init());
31862
- }
31863
- /**
31864
- * Internal create application API that implements the core application creation logic and optional
31865
- * bootstrap logic.
31866
- *
31867
- * Platforms (such as `platform-browser`) may require different set of application and platform
31868
- * providers for an application to function correctly. As a result, platforms may use this function
31869
- * internally and supply the necessary providers during the bootstrap, while exposing
31870
- * platform-specific APIs as a part of their public API.
31871
- *
31872
- * @returns A promise that returns an `ApplicationRef` instance once resolved.
31873
- */
31874
- function internalCreateApplication(config) {
31875
- try {
31876
- const { rootComponent, appProviders, platformProviders } = config;
31877
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
31878
- assertStandaloneComponentType(rootComponent);
31879
- }
31880
- const platformInjector = createOrReusePlatformInjector(platformProviders);
31881
- // Create root application injector based on a set of providers configured at the platform
31882
- // bootstrap level as well as providers passed to the bootstrap call by a user.
31883
- const allAppProviders = [
31884
- provideZoneChangeDetection(),
31885
- ...(appProviders || []),
31886
- ];
31887
- const adapter = new EnvironmentNgModuleRefAdapter({
31888
- providers: allAppProviders,
31889
- parent: platformInjector,
31890
- debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
31891
- // We skip environment initializers because we need to run them inside the NgZone, which
31892
- // happens after we get the NgZone instance from the Injector.
31893
- runEnvironmentInitializers: false,
31894
- });
31895
- const envInjector = adapter.injector;
31896
- const ngZone = envInjector.get(NgZone);
31897
- return ngZone.run(() => {
31898
- envInjector.resolveInjectorInitializers();
31899
- const exceptionHandler = envInjector.get(ErrorHandler, null);
31900
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
31901
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
31902
- }
31903
- let onErrorSubscription;
31904
- ngZone.runOutsideAngular(() => {
31905
- onErrorSubscription = ngZone.onError.subscribe({
31906
- next: (error) => {
31907
- exceptionHandler.handleError(error);
31908
- }
31909
- });
31910
- });
31911
- // If the whole platform is destroyed, invoke the `destroy` method
31912
- // for all bootstrapped applications as well.
31913
- const destroyListener = () => envInjector.destroy();
31914
- const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
31915
- onPlatformDestroyListeners.add(destroyListener);
31916
- envInjector.onDestroy(() => {
31917
- onErrorSubscription.unsubscribe();
31918
- onPlatformDestroyListeners.delete(destroyListener);
31919
- });
31920
- return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
31921
- const initStatus = envInjector.get(ApplicationInitStatus);
31922
- initStatus.runInitializers();
31923
- return initStatus.donePromise.then(() => {
31924
- const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
31925
- setLocaleId(localeId || DEFAULT_LOCALE_ID);
31926
- const appRef = envInjector.get(ApplicationRef);
31927
- if (rootComponent !== undefined) {
31928
- appRef.bootstrap(rootComponent);
31929
- }
31930
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
31931
- const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
31932
- imagePerformanceService.start();
31933
- }
31934
- return appRef;
31935
- });
31936
- });
31937
- });
31938
- }
31939
- catch (e) {
31940
- return Promise.reject(e);
31941
- }
31942
- }
31943
- /**
31944
- * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
31945
- * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
31946
- * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
31947
- * to build up configurations that might be required by different libraries or parts of the
31948
- * application.
31949
- * @param name Identifies the new platform factory.
31950
- * @param providers A set of dependency providers for platforms created with the new factory.
31951
- *
31952
- * @publicApi
31953
- */
31954
- function createPlatformFactory(parentPlatformFactory, name, providers = []) {
31955
- const desc = `Platform: ${name}`;
31956
- const marker = new InjectionToken(desc);
31957
- return (extraProviders = []) => {
31958
- let platform = getPlatform();
31959
- if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
31960
- const platformProviders = [
31961
- ...providers, //
31962
- ...extraProviders, //
31963
- { provide: marker, useValue: true }
31964
- ];
31965
- if (parentPlatformFactory) {
31966
- parentPlatformFactory(platformProviders);
31967
- }
31968
- else {
31969
- createPlatform(createPlatformInjector(platformProviders, desc));
31970
- }
31971
- }
31972
- return assertPlatform(marker);
31973
- };
31974
- }
31975
- /**
31976
- * Checks that there is currently a platform that contains the given token as a provider.
31977
- *
31978
- * @publicApi
31979
- */
31980
- function assertPlatform(requiredToken) {
31981
- const platform = getPlatform();
31982
- if (!platform) {
31983
- throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
31984
- }
31985
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
31986
- !platform.injector.get(requiredToken, null)) {
31987
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
31988
- }
31989
- return platform;
31990
- }
31991
- /**
31992
- * Helper function to create an instance of a platform injector (that maintains the 'platform'
31993
- * scope).
31994
- */
31995
- function createPlatformInjector(providers = [], name) {
31996
- return Injector.create({
31997
- name,
31998
- providers: [
31999
- { provide: INJECTOR_SCOPE, useValue: 'platform' },
32000
- { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
32001
- ...providers
32002
- ],
32003
- });
32004
- }
32005
- /**
32006
- * Destroys the current Angular platform and all Angular applications on the page.
32007
- * Destroys all modules and listeners registered with the platform.
32008
- *
32009
- * @publicApi
32010
- */
32011
- function destroyPlatform() {
32012
- getPlatform()?.destroy();
32013
- }
32014
- /**
32015
- * Returns the current platform.
32016
- *
32017
- * @publicApi
32018
- */
32019
- function getPlatform() {
32020
- return _platformInjector?.get(PlatformRef) ?? null;
32021
- }
32022
- /**
32023
- * The Angular platform is the entry point for Angular on a web page.
32024
- * Each page has exactly one platform. Services (such as reflection) which are common
32025
- * to every Angular application running on the page are bound in its scope.
32026
- * A page's platform is initialized implicitly when a platform is created using a platform
32027
- * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
32028
- *
32029
- * @publicApi
32030
- */
32031
- class PlatformRef {
32032
- /** @internal */
32033
- constructor(_injector) {
32034
- this._injector = _injector;
32035
- this._modules = [];
32036
- this._destroyListeners = [];
32037
- this._destroyed = false;
32038
- }
32039
- /**
32040
- * Creates an instance of an `@NgModule` for the given platform.
32041
- *
32042
- * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
32043
- * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
32044
- */
32045
- bootstrapModuleFactory(moduleFactory, options) {
32046
- // Note: We need to create the NgZone _before_ we instantiate the module,
32047
- // as instantiating the module creates some providers eagerly.
32048
- // So we create a mini parent injector that just contains the new NgZone and
32049
- // pass that as parent to the NgModuleFactory.
32050
- const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
32051
- eventCoalescing: options?.ngZoneEventCoalescing,
32052
- runCoalescing: options?.ngZoneRunCoalescing
32053
- }));
32054
- // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
32055
- // created within the Angular zone
32056
- // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
32057
- // created outside of the Angular zone.
32058
- return ngZone.run(() => {
32059
- const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
32060
- if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32061
- moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
32062
- throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
32063
- }
32064
- const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
32065
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
32066
- throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
32067
- }
32068
- ngZone.runOutsideAngular(() => {
32069
- const subscription = ngZone.onError.subscribe({
32070
- next: (error) => {
32071
- exceptionHandler.handleError(error);
32072
- }
32073
- });
32074
- moduleRef.onDestroy(() => {
32075
- remove(this._modules, moduleRef);
32076
- subscription.unsubscribe();
32077
- });
32078
- });
32079
- return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
32080
- const initStatus = moduleRef.injector.get(ApplicationInitStatus);
32081
- initStatus.runInitializers();
32082
- return initStatus.donePromise.then(() => {
32083
- // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
32084
- const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
32085
- setLocaleId(localeId || DEFAULT_LOCALE_ID);
32086
- this._moduleDoBootstrap(moduleRef);
32087
- return moduleRef;
32088
- });
32089
- });
32090
- });
32091
- }
32092
- /**
32093
- * Creates an instance of an `@NgModule` for a given platform.
32094
- *
32095
- * @usageNotes
32096
- * ### Simple Example
32097
- *
32098
- * ```typescript
32099
- * @NgModule({
32100
- * imports: [BrowserModule]
32101
- * })
32102
- * class MyModule {}
32103
- *
32104
- * let moduleRef = platformBrowser().bootstrapModule(MyModule);
32105
- * ```
32106
- *
32107
- */
32108
- bootstrapModule(moduleType, compilerOptions = []) {
32109
- const options = optionsReducer({}, compilerOptions);
32110
- return compileNgModuleFactory(this.injector, options, moduleType)
32111
- .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
32112
- }
32113
- _moduleDoBootstrap(moduleRef) {
32114
- const appRef = moduleRef.injector.get(ApplicationRef);
32115
- if (moduleRef._bootstrapComponents.length > 0) {
32116
- moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
32117
- }
32118
- else if (moduleRef.instance.ngDoBootstrap) {
32119
- moduleRef.instance.ngDoBootstrap(appRef);
32120
- }
32121
- else {
32122
- throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
32123
- `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
32124
- `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
32125
- `Please define one of these.`);
32126
- }
32127
- this._modules.push(moduleRef);
32128
- }
32129
- /**
32130
- * Registers a listener to be called when the platform is destroyed.
32131
- */
32132
- onDestroy(callback) {
32133
- this._destroyListeners.push(callback);
32134
- }
32135
- /**
32136
- * Retrieves the platform {@link Injector}, which is the parent injector for
32137
- * every Angular application on the page and provides singleton providers.
32138
- */
32139
- get injector() {
32140
- return this._injector;
32141
- }
32142
- /**
32143
- * Destroys the current Angular platform and all Angular applications on the page.
32144
- * Destroys all modules and listeners registered with the platform.
32145
- */
32146
- destroy() {
32147
- if (this._destroyed) {
32148
- throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
32149
- }
32150
- this._modules.slice().forEach(module => module.destroy());
32151
- this._destroyListeners.forEach(listener => listener());
32152
- const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
32153
- if (destroyListeners) {
32154
- destroyListeners.forEach(listener => listener());
32155
- destroyListeners.clear();
32156
- }
32157
- this._destroyed = true;
32158
- }
32159
- /**
32160
- * Indicates whether this instance was destroyed.
32161
- */
32162
- get destroyed() {
32163
- return this._destroyed;
32164
- }
32165
- static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
32166
- static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
32167
- }
32168
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
32169
- type: Injectable,
32170
- args: [{ providedIn: 'platform' }]
32171
- }], () => [{ type: Injector }], null); })();
32172
- // Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
32173
- // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
32174
- // a set of default options returned.
32175
- function getNgZoneOptions(options) {
32176
- return {
32177
- enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
32178
- shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
32179
- shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
32180
- };
32181
- }
32182
- function getNgZone(ngZoneToUse = 'zone.js', options) {
32183
- if (ngZoneToUse === 'noop') {
32184
- return new NoopNgZone();
32185
- }
32186
- if (ngZoneToUse === 'zone.js') {
32187
- return new NgZone(options);
31601
+ *
31602
+ * @deprecated
31603
+ * @publicApi
31604
+ */
31605
+ class NgProbeToken {
31606
+ constructor(name, token) {
31607
+ this.name = name;
31608
+ this.token = token;
32188
31609
  }
32189
- return ngZoneToUse;
32190
31610
  }
32191
31611
  function _callAndReportToErrorHandler(errorHandler, ngZone, callback) {
32192
31612
  try {
@@ -32328,7 +31748,7 @@ class ApplicationRef {
32328
31748
  * Returns an Observable that indicates when the application is stable or unstable.
32329
31749
  */
32330
31750
  this.isStable = inject(InitialRenderPendingTasks)
32331
- .hasPendingTasks.pipe(switchMap(hasPendingTasks => hasPendingTasks ? of(false) : this.zoneIsStable), distinctUntilChanged(), share());
31751
+ .hasPendingTasks.pipe(switchMap(hasPendingTasks => hasPendingTasks ? of(false) : this.zoneIsStable), distinctUntilChanged());
32332
31752
  this._injector = inject(EnvironmentInjector);
32333
31753
  }
32334
31754
  /**
@@ -32566,24 +31986,24 @@ function _lastDefined(args) {
32566
31986
  }
32567
31987
  return undefined;
32568
31988
  }
31989
+ let whenStableStore;
32569
31990
  /**
32570
- * `InjectionToken` used to configure how to call the `ErrorHandler`.
32571
- *
32572
- * `NgZone` is provided by default today so the default (and only) implementation for this
32573
- * is calling `ErrorHandler.handleError` outside of the Angular zone.
31991
+ * Returns a Promise that resolves when the application becomes stable after this method is called
31992
+ * the first time.
32574
31993
  */
32575
- const INTERNAL_APPLICATION_ERROR_HANDLER = new InjectionToken((typeof ngDevMode === 'undefined' || ngDevMode) ? 'internal error handler' : '', {
32576
- providedIn: 'root',
32577
- factory: () => {
32578
- const userErrorHandler = inject(ErrorHandler);
32579
- return userErrorHandler.handleError.bind(undefined);
31994
+ function whenStable(applicationRef) {
31995
+ whenStableStore ??= new WeakMap();
31996
+ const cachedWhenStable = whenStableStore.get(applicationRef);
31997
+ if (cachedWhenStable) {
31998
+ return cachedWhenStable;
32580
31999
  }
32581
- });
32582
- function ngZoneApplicationErrorHandlerFactory() {
32583
- const zone = inject(NgZone);
32584
- const userErrorHandler = inject(ErrorHandler);
32585
- return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
32000
+ const whenStablePromise = applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => void 0);
32001
+ whenStableStore.set(applicationRef, whenStablePromise);
32002
+ // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.
32003
+ applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));
32004
+ return whenStablePromise;
32586
32005
  }
32006
+
32587
32007
  class NgZoneChangeDetectionScheduler {
32588
32008
  constructor() {
32589
32009
  this.zone = inject(NgZone);
@@ -32636,6 +32056,11 @@ function internalProvideZoneChangeDetection(ngZoneFactory) {
32636
32056
  { provide: ZONE_IS_STABLE_OBSERVABLE, useFactory: isStableFactory },
32637
32057
  ];
32638
32058
  }
32059
+ function ngZoneApplicationErrorHandlerFactory() {
32060
+ const zone = inject(NgZone);
32061
+ const userErrorHandler = inject(ErrorHandler);
32062
+ return (e) => zone.runOutsideAngular(() => userErrorHandler.handleError(e));
32063
+ }
32639
32064
  /**
32640
32065
  * Provides `NgZone`-based change detection for the application bootstrapped using
32641
32066
  * `bootstrapApplication`.
@@ -32664,22 +32089,467 @@ function provideZoneChangeDetection(options) {
32664
32089
  zoneProviders,
32665
32090
  ]);
32666
32091
  }
32667
- let whenStableStore;
32092
+ // Transforms a set of `BootstrapOptions` (supported by the NgModule-based bootstrap APIs) ->
32093
+ // `NgZoneOptions` that are recognized by the NgZone constructor. Passing no options will result in
32094
+ // a set of default options returned.
32095
+ function getNgZoneOptions(options) {
32096
+ return {
32097
+ enableLongStackTrace: typeof ngDevMode === 'undefined' ? false : !!ngDevMode,
32098
+ shouldCoalesceEventChangeDetection: options?.eventCoalescing ?? false,
32099
+ shouldCoalesceRunChangeDetection: options?.runCoalescing ?? false,
32100
+ };
32101
+ }
32102
+
32668
32103
  /**
32669
- * Returns a Promise that resolves when the application becomes stable after this method is called
32670
- * the first time.
32104
+ * Work out the locale from the potential global properties.
32105
+ *
32106
+ * * Closure Compiler: use `goog.LOCALE`.
32107
+ * * Ivy enabled: use `$localize.locale`
32671
32108
  */
32672
- function whenStable(applicationRef) {
32673
- whenStableStore ??= new WeakMap();
32674
- const cachedWhenStable = whenStableStore.get(applicationRef);
32675
- if (cachedWhenStable) {
32676
- return cachedWhenStable;
32109
+ function getGlobalLocale() {
32110
+ if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
32111
+ typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
32112
+ // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`.
32113
+ // * In order to preserve backwards compatibility, we use Angular default value over
32114
+ // Closure Compiler's one.
32115
+ return goog.LOCALE;
32677
32116
  }
32678
- const whenStablePromise = applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise().then(() => void 0);
32679
- whenStableStore.set(applicationRef, whenStablePromise);
32680
- // Be a good citizen and clean the store `onDestroy` even though we are using `WeakMap`.
32681
- applicationRef.onDestroy(() => whenStableStore?.delete(applicationRef));
32682
- return whenStablePromise;
32117
+ else {
32118
+ // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
32119
+ // COMPILE-TIME INLINER.
32120
+ //
32121
+ // * During compile time inlining of translations the expression will be replaced
32122
+ // with a string literal that is the current locale. Other forms of this expression are not
32123
+ // guaranteed to be replaced.
32124
+ //
32125
+ // * During runtime translation evaluation, the developer is required to set `$localize.locale`
32126
+ // if required, or just to provide their own `LOCALE_ID` provider.
32127
+ return (typeof $localize !== 'undefined' && $localize.locale) || DEFAULT_LOCALE_ID;
32128
+ }
32129
+ }
32130
+ /**
32131
+ * Provide this token to set the locale of your application.
32132
+ * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,
32133
+ * DecimalPipe and PercentPipe) and by ICU expressions.
32134
+ *
32135
+ * See the [i18n guide](guide/i18n-common-locale-id) for more information.
32136
+ *
32137
+ * @usageNotes
32138
+ * ### Example
32139
+ *
32140
+ * ```typescript
32141
+ * import { LOCALE_ID } from '@angular/core';
32142
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32143
+ * import { AppModule } from './app/app.module';
32144
+ *
32145
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32146
+ * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
32147
+ * });
32148
+ * ```
32149
+ *
32150
+ * @publicApi
32151
+ */
32152
+ const LOCALE_ID = new InjectionToken('LocaleId', {
32153
+ providedIn: 'root',
32154
+ factory: () => inject(LOCALE_ID, InjectFlags.Optional | InjectFlags.SkipSelf) || getGlobalLocale(),
32155
+ });
32156
+ /**
32157
+ * Provide this token to set the default currency code your application uses for
32158
+ * CurrencyPipe when there is no currency code passed into it. This is only used by
32159
+ * CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.
32160
+ *
32161
+ * See the [i18n guide](guide/i18n-common-locale-id) for more information.
32162
+ *
32163
+ * <div class="alert is-helpful">
32164
+ *
32165
+ * **Deprecation notice:**
32166
+ *
32167
+ * The default currency code is currently always `USD` but this is deprecated from v9.
32168
+ *
32169
+ * **In v10 the default currency code will be taken from the current locale.**
32170
+ *
32171
+ * If you need the previous behavior then set it by creating a `DEFAULT_CURRENCY_CODE` provider in
32172
+ * your application `NgModule`:
32173
+ *
32174
+ * ```ts
32175
+ * {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
32176
+ * ```
32177
+ *
32178
+ * </div>
32179
+ *
32180
+ * @usageNotes
32181
+ * ### Example
32182
+ *
32183
+ * ```typescript
32184
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32185
+ * import { AppModule } from './app/app.module';
32186
+ *
32187
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32188
+ * providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
32189
+ * });
32190
+ * ```
32191
+ *
32192
+ * @publicApi
32193
+ */
32194
+ const DEFAULT_CURRENCY_CODE = new InjectionToken('DefaultCurrencyCode', {
32195
+ providedIn: 'root',
32196
+ factory: () => USD_CURRENCY_CODE,
32197
+ });
32198
+ /**
32199
+ * Use this token at bootstrap to provide the content of your translation file (`xtb`,
32200
+ * `xlf` or `xlf2`) when you want to translate your application in another language.
32201
+ *
32202
+ * See the [i18n guide](guide/i18n-common-merge) for more information.
32203
+ *
32204
+ * @usageNotes
32205
+ * ### Example
32206
+ *
32207
+ * ```typescript
32208
+ * import { TRANSLATIONS } from '@angular/core';
32209
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32210
+ * import { AppModule } from './app/app.module';
32211
+ *
32212
+ * // content of your translation file
32213
+ * const translations = '....';
32214
+ *
32215
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32216
+ * providers: [{provide: TRANSLATIONS, useValue: translations }]
32217
+ * });
32218
+ * ```
32219
+ *
32220
+ * @publicApi
32221
+ */
32222
+ const TRANSLATIONS = new InjectionToken('Translations');
32223
+ /**
32224
+ * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,
32225
+ * `xlf` or `xlf2`.
32226
+ *
32227
+ * See the [i18n guide](guide/i18n-common-merge) for more information.
32228
+ *
32229
+ * @usageNotes
32230
+ * ### Example
32231
+ *
32232
+ * ```typescript
32233
+ * import { TRANSLATIONS_FORMAT } from '@angular/core';
32234
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32235
+ * import { AppModule } from './app/app.module';
32236
+ *
32237
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32238
+ * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]
32239
+ * });
32240
+ * ```
32241
+ *
32242
+ * @publicApi
32243
+ */
32244
+ const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');
32245
+ /**
32246
+ * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy
32247
+ * that the compiler should use in case of missing translations:
32248
+ * - Error: throw if you have missing translations.
32249
+ * - Warning (default): show a warning in the console and/or shell.
32250
+ * - Ignore: do nothing.
32251
+ *
32252
+ * See the [i18n guide](guide/i18n-common-merge#report-missing-translations) for more information.
32253
+ *
32254
+ * @usageNotes
32255
+ * ### Example
32256
+ * ```typescript
32257
+ * import { MissingTranslationStrategy } from '@angular/core';
32258
+ * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
32259
+ * import { AppModule } from './app/app.module';
32260
+ *
32261
+ * platformBrowserDynamic().bootstrapModule(AppModule, {
32262
+ * missingTranslation: MissingTranslationStrategy.Error
32263
+ * });
32264
+ * ```
32265
+ *
32266
+ * @publicApi
32267
+ */
32268
+ var MissingTranslationStrategy;
32269
+ (function (MissingTranslationStrategy) {
32270
+ MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error";
32271
+ MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning";
32272
+ MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore";
32273
+ })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
32274
+
32275
+ /**
32276
+ * Internal token that allows to register extra callbacks that should be invoked during the
32277
+ * `PlatformRef.destroy` operation. This token is needed to avoid a direct reference to the
32278
+ * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
32279
+ * entire class tree-shakeable.
32280
+ */
32281
+ const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
32282
+ /**
32283
+ * The Angular platform is the entry point for Angular on a web page.
32284
+ * Each page has exactly one platform. Services (such as reflection) which are common
32285
+ * to every Angular application running on the page are bound in its scope.
32286
+ * A page's platform is initialized implicitly when a platform is created using a platform
32287
+ * factory such as `PlatformBrowser`, or explicitly by calling the `createPlatform()` function.
32288
+ *
32289
+ * @publicApi
32290
+ */
32291
+ class PlatformRef {
32292
+ /** @internal */
32293
+ constructor(_injector) {
32294
+ this._injector = _injector;
32295
+ this._modules = [];
32296
+ this._destroyListeners = [];
32297
+ this._destroyed = false;
32298
+ }
32299
+ /**
32300
+ * Creates an instance of an `@NgModule` for the given platform.
32301
+ *
32302
+ * @deprecated Passing NgModule factories as the `PlatformRef.bootstrapModuleFactory` function
32303
+ * argument is deprecated. Use the `PlatformRef.bootstrapModule` API instead.
32304
+ */
32305
+ bootstrapModuleFactory(moduleFactory, options) {
32306
+ // Note: We need to create the NgZone _before_ we instantiate the module,
32307
+ // as instantiating the module creates some providers eagerly.
32308
+ // So we create a mini parent injector that just contains the new NgZone and
32309
+ // pass that as parent to the NgModuleFactory.
32310
+ const ngZone = getNgZone(options?.ngZone, getNgZoneOptions({
32311
+ eventCoalescing: options?.ngZoneEventCoalescing,
32312
+ runCoalescing: options?.ngZoneRunCoalescing
32313
+ }));
32314
+ // Note: Create ngZoneInjector within ngZone.run so that all of the instantiated services are
32315
+ // created within the Angular zone
32316
+ // Do not try to replace ngZone.run with ApplicationRef#run because ApplicationRef would then be
32317
+ // created outside of the Angular zone.
32318
+ return ngZone.run(() => {
32319
+ const moduleRef = createNgModuleRefWithProviders(moduleFactory.moduleType, this.injector, internalProvideZoneChangeDetection(() => ngZone));
32320
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32321
+ moduleRef.injector.get(PROVIDED_NG_ZONE, null) !== null) {
32322
+ throw new RuntimeError(207 /* RuntimeErrorCode.PROVIDER_IN_WRONG_CONTEXT */, '`bootstrapModule` does not support `provideZoneChangeDetection`. Use `BootstrapOptions` instead.');
32323
+ }
32324
+ const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
32325
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && exceptionHandler === null) {
32326
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No ErrorHandler. Is platform module (BrowserModule) included?');
32327
+ }
32328
+ ngZone.runOutsideAngular(() => {
32329
+ const subscription = ngZone.onError.subscribe({
32330
+ next: (error) => {
32331
+ exceptionHandler.handleError(error);
32332
+ }
32333
+ });
32334
+ moduleRef.onDestroy(() => {
32335
+ remove(this._modules, moduleRef);
32336
+ subscription.unsubscribe();
32337
+ });
32338
+ });
32339
+ return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
32340
+ const initStatus = moduleRef.injector.get(ApplicationInitStatus);
32341
+ initStatus.runInitializers();
32342
+ return initStatus.donePromise.then(() => {
32343
+ // If the `LOCALE_ID` provider is defined at bootstrap then we set the value for ivy
32344
+ const localeId = moduleRef.injector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
32345
+ setLocaleId(localeId || DEFAULT_LOCALE_ID);
32346
+ this._moduleDoBootstrap(moduleRef);
32347
+ return moduleRef;
32348
+ });
32349
+ });
32350
+ });
32351
+ }
32352
+ /**
32353
+ * Creates an instance of an `@NgModule` for a given platform.
32354
+ *
32355
+ * @usageNotes
32356
+ * ### Simple Example
32357
+ *
32358
+ * ```typescript
32359
+ * @NgModule({
32360
+ * imports: [BrowserModule]
32361
+ * })
32362
+ * class MyModule {}
32363
+ *
32364
+ * let moduleRef = platformBrowser().bootstrapModule(MyModule);
32365
+ * ```
32366
+ *
32367
+ */
32368
+ bootstrapModule(moduleType, compilerOptions = []) {
32369
+ const options = optionsReducer({}, compilerOptions);
32370
+ return compileNgModuleFactory(this.injector, options, moduleType)
32371
+ .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));
32372
+ }
32373
+ _moduleDoBootstrap(moduleRef) {
32374
+ const appRef = moduleRef.injector.get(ApplicationRef);
32375
+ if (moduleRef._bootstrapComponents.length > 0) {
32376
+ moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));
32377
+ }
32378
+ else if (moduleRef.instance.ngDoBootstrap) {
32379
+ moduleRef.instance.ngDoBootstrap(appRef);
32380
+ }
32381
+ else {
32382
+ throw new RuntimeError(-403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
32383
+ `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
32384
+ `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
32385
+ `Please define one of these.`);
32386
+ }
32387
+ this._modules.push(moduleRef);
32388
+ }
32389
+ /**
32390
+ * Registers a listener to be called when the platform is destroyed.
32391
+ */
32392
+ onDestroy(callback) {
32393
+ this._destroyListeners.push(callback);
32394
+ }
32395
+ /**
32396
+ * Retrieves the platform {@link Injector}, which is the parent injector for
32397
+ * every Angular application on the page and provides singleton providers.
32398
+ */
32399
+ get injector() {
32400
+ return this._injector;
32401
+ }
32402
+ /**
32403
+ * Destroys the current Angular platform and all Angular applications on the page.
32404
+ * Destroys all modules and listeners registered with the platform.
32405
+ */
32406
+ destroy() {
32407
+ if (this._destroyed) {
32408
+ throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
32409
+ }
32410
+ this._modules.slice().forEach(module => module.destroy());
32411
+ this._destroyListeners.forEach(listener => listener());
32412
+ const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
32413
+ if (destroyListeners) {
32414
+ destroyListeners.forEach(listener => listener());
32415
+ destroyListeners.clear();
32416
+ }
32417
+ this._destroyed = true;
32418
+ }
32419
+ /**
32420
+ * Indicates whether this instance was destroyed.
32421
+ */
32422
+ get destroyed() {
32423
+ return this._destroyed;
32424
+ }
32425
+ static { this.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); }; }
32426
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' }); }
32427
+ }
32428
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
32429
+ type: Injectable,
32430
+ args: [{ providedIn: 'platform' }]
32431
+ }], () => [{ type: Injector }], null); })();
32432
+
32433
+ let _platformInjector = null;
32434
+ /**
32435
+ * Internal token to indicate whether having multiple bootstrapped platform should be allowed (only
32436
+ * one bootstrapped platform is allowed by default). This token helps to support SSR scenarios.
32437
+ */
32438
+ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
32439
+ /**
32440
+ * Creates a platform.
32441
+ * Platforms must be created on launch using this function.
32442
+ *
32443
+ * @publicApi
32444
+ */
32445
+ function createPlatform(injector) {
32446
+ if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
32447
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
32448
+ 'There can be only one platform. Destroy the previous one to create a new one.');
32449
+ }
32450
+ publishDefaultGlobalUtils();
32451
+ publishSignalConfiguration();
32452
+ _platformInjector = injector;
32453
+ const platform = injector.get(PlatformRef);
32454
+ runPlatformInitializers(injector);
32455
+ return platform;
32456
+ }
32457
+ /**
32458
+ * Creates a factory for a platform. Can be used to provide or override `Providers` specific to
32459
+ * your application's runtime needs, such as `PLATFORM_INITIALIZER` and `PLATFORM_ID`.
32460
+ * @param parentPlatformFactory Another platform factory to modify. Allows you to compose factories
32461
+ * to build up configurations that might be required by different libraries or parts of the
32462
+ * application.
32463
+ * @param name Identifies the new platform factory.
32464
+ * @param providers A set of dependency providers for platforms created with the new factory.
32465
+ *
32466
+ * @publicApi
32467
+ */
32468
+ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
32469
+ const desc = `Platform: ${name}`;
32470
+ const marker = new InjectionToken(desc);
32471
+ return (extraProviders = []) => {
32472
+ let platform = getPlatform();
32473
+ if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
32474
+ const platformProviders = [...providers, ...extraProviders, { provide: marker, useValue: true }];
32475
+ if (parentPlatformFactory) {
32476
+ parentPlatformFactory(platformProviders);
32477
+ }
32478
+ else {
32479
+ createPlatform(createPlatformInjector(platformProviders, desc));
32480
+ }
32481
+ }
32482
+ return assertPlatform(marker);
32483
+ };
32484
+ }
32485
+ /**
32486
+ * Helper function to create an instance of a platform injector (that maintains the 'platform'
32487
+ * scope).
32488
+ */
32489
+ function createPlatformInjector(providers = [], name) {
32490
+ return Injector.create({
32491
+ name,
32492
+ providers: [
32493
+ { provide: INJECTOR_SCOPE, useValue: 'platform' },
32494
+ { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
32495
+ ...providers
32496
+ ],
32497
+ });
32498
+ }
32499
+ /**
32500
+ * Checks that there is currently a platform that contains the given token as a provider.
32501
+ *
32502
+ * @publicApi
32503
+ */
32504
+ function assertPlatform(requiredToken) {
32505
+ const platform = getPlatform();
32506
+ if (!platform) {
32507
+ throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
32508
+ }
32509
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
32510
+ !platform.injector.get(requiredToken, null)) {
32511
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, 'A platform with a different configuration has been created. Please destroy it first.');
32512
+ }
32513
+ return platform;
32514
+ }
32515
+ /**
32516
+ * Returns the current platform.
32517
+ *
32518
+ * @publicApi
32519
+ */
32520
+ function getPlatform() {
32521
+ return _platformInjector?.get(PlatformRef) ?? null;
32522
+ }
32523
+ /**
32524
+ * Destroys the current Angular platform and all Angular applications on the page.
32525
+ * Destroys all modules and listeners registered with the platform.
32526
+ *
32527
+ * @publicApi
32528
+ */
32529
+ function destroyPlatform() {
32530
+ getPlatform()?.destroy();
32531
+ }
32532
+ /**
32533
+ * The goal of this function is to bootstrap a platform injector,
32534
+ * but avoid referencing `PlatformRef` class.
32535
+ * This function is needed for bootstrapping a Standalone Component.
32536
+ */
32537
+ function createOrReusePlatformInjector(providers = []) {
32538
+ // If a platform injector already exists, it means that the platform
32539
+ // is already bootstrapped and no additional actions are required.
32540
+ if (_platformInjector)
32541
+ return _platformInjector;
32542
+ publishDefaultGlobalUtils();
32543
+ // Otherwise, setup a new platform injector and run platform initializers.
32544
+ const injector = createPlatformInjector(providers);
32545
+ _platformInjector = injector;
32546
+ publishSignalConfiguration();
32547
+ runPlatformInitializers(injector);
32548
+ return injector;
32549
+ }
32550
+ function runPlatformInitializers(injector) {
32551
+ const inits = injector.get(PLATFORM_INITIALIZER, null);
32552
+ inits?.forEach((init) => init());
32683
32553
  }
32684
32554
 
32685
32555
  /**
@@ -33839,14 +33709,7 @@ function signalSetFn(node, newValue) {
33839
33709
  if (!producerUpdatesAllowed()) {
33840
33710
  throwInvalidWriteToSignalError();
33841
33711
  }
33842
- const value = node.value;
33843
- if (Object.is(value, newValue)) {
33844
- if (typeof ngDevMode !== 'undefined' && ngDevMode && !node.equal(value, newValue)) {
33845
- console.warn('Signal value equality implementations should always return `true` for' +
33846
- ' values that are the same according to `Object.is` but returned `false` instead.');
33847
- }
33848
- }
33849
- else if (!node.equal(value, newValue)) {
33712
+ if (!node.equal(node.value, newValue)) {
33850
33713
  node.value = newValue;
33851
33714
  signalValueChanged(node);
33852
33715
  }
@@ -33960,6 +33823,244 @@ function setAlternateWeakRefImpl(impl) {
33960
33823
  // TODO: remove this function
33961
33824
  }
33962
33825
 
33826
+ // A delay in milliseconds before the scan is run after onLoad, to avoid any
33827
+ // potential race conditions with other LCP-related functions. This delay
33828
+ // happens outside of the main JavaScript execution and will only effect the timing
33829
+ // on when the warning becomes visible in the console.
33830
+ const SCAN_DELAY = 200;
33831
+ const OVERSIZED_IMAGE_TOLERANCE = 1200;
33832
+ class ImagePerformanceWarning {
33833
+ constructor() {
33834
+ // Map of full image URLs -> original `ngSrc` values.
33835
+ this.window = null;
33836
+ this.observer = null;
33837
+ this.options = inject(IMAGE_CONFIG);
33838
+ this.ngZone = inject(NgZone);
33839
+ }
33840
+ start() {
33841
+ if (typeof PerformanceObserver === 'undefined' ||
33842
+ (this.options?.disableImageSizeWarning && this.options?.disableImageLazyLoadWarning)) {
33843
+ return;
33844
+ }
33845
+ this.observer = this.initPerformanceObserver();
33846
+ const doc = getDocument();
33847
+ const win = doc.defaultView;
33848
+ if (typeof win !== 'undefined') {
33849
+ this.window = win;
33850
+ // Wait to avoid race conditions where LCP image triggers
33851
+ // load event before it's recorded by the performance observer
33852
+ const waitToScan = () => {
33853
+ setTimeout(this.scanImages.bind(this), SCAN_DELAY);
33854
+ };
33855
+ // Angular doesn't have to run change detection whenever any asynchronous tasks are invoked in
33856
+ // the scope of this functionality.
33857
+ this.ngZone.runOutsideAngular(() => {
33858
+ // Consider the case when the application is created and destroyed multiple times.
33859
+ // Typically, applications are created instantly once the page is loaded, and the
33860
+ // `window.load` listener is always triggered. However, the `window.load` event will never
33861
+ // be fired if the page is loaded, and the application is created later. Checking for
33862
+ // `readyState` is the easiest way to determine whether the page has been loaded or not.
33863
+ if (doc.readyState === 'complete') {
33864
+ waitToScan();
33865
+ }
33866
+ else {
33867
+ this.window?.addEventListener('load', waitToScan, { once: true });
33868
+ }
33869
+ });
33870
+ }
33871
+ }
33872
+ ngOnDestroy() {
33873
+ this.observer?.disconnect();
33874
+ }
33875
+ initPerformanceObserver() {
33876
+ if (typeof PerformanceObserver === 'undefined') {
33877
+ return null;
33878
+ }
33879
+ const observer = new PerformanceObserver((entryList) => {
33880
+ const entries = entryList.getEntries();
33881
+ if (entries.length === 0)
33882
+ return;
33883
+ // We use the latest entry produced by the `PerformanceObserver` as the best
33884
+ // signal on which element is actually an LCP one. As an example, the first image to load on
33885
+ // a page, by virtue of being the only thing on the page so far, is often a LCP candidate
33886
+ // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
33887
+ const lcpElement = entries[entries.length - 1];
33888
+ // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
33889
+ // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
33890
+ const imgSrc = lcpElement.element?.src ?? '';
33891
+ // Exclude `data:` and `blob:` URLs, since they are fetched resources.
33892
+ if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:'))
33893
+ return;
33894
+ this.lcpImageUrl = imgSrc;
33895
+ });
33896
+ observer.observe({ type: 'largest-contentful-paint', buffered: true });
33897
+ return observer;
33898
+ }
33899
+ scanImages() {
33900
+ const images = getDocument().querySelectorAll('img');
33901
+ let lcpElementFound, lcpElementLoadedCorrectly = false;
33902
+ images.forEach(image => {
33903
+ if (!this.options?.disableImageSizeWarning) {
33904
+ for (const image of images) {
33905
+ // Image elements using the NgOptimizedImage directive are excluded,
33906
+ // as that directive has its own version of this check.
33907
+ if (!image.getAttribute('ng-img') && this.isOversized(image)) {
33908
+ logOversizedImageWarning(image.src);
33909
+ }
33910
+ }
33911
+ }
33912
+ if (!this.options?.disableImageLazyLoadWarning && this.lcpImageUrl) {
33913
+ if (image.src === this.lcpImageUrl) {
33914
+ lcpElementFound = true;
33915
+ if (image.loading !== 'lazy' || image.getAttribute('ng-img')) {
33916
+ // This variable is set to true and never goes back to false to account
33917
+ // for the case where multiple images have the same src url, and some
33918
+ // have lazy loading while others don't.
33919
+ // Also ignore NgOptimizedImage because there's a different warning for that.
33920
+ lcpElementLoadedCorrectly = true;
33921
+ }
33922
+ }
33923
+ }
33924
+ });
33925
+ if (lcpElementFound && !lcpElementLoadedCorrectly && this.lcpImageUrl &&
33926
+ !this.options?.disableImageLazyLoadWarning) {
33927
+ logLazyLCPWarning(this.lcpImageUrl);
33928
+ }
33929
+ }
33930
+ isOversized(image) {
33931
+ if (!this.window) {
33932
+ return false;
33933
+ }
33934
+ const computedStyle = this.window.getComputedStyle(image);
33935
+ let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
33936
+ let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
33937
+ const boxSizing = computedStyle.getPropertyValue('box-sizing');
33938
+ const objectFit = computedStyle.getPropertyValue('object-fit');
33939
+ if (objectFit === `cover`) {
33940
+ // Object fit cover may indicate a use case such as a sprite sheet where
33941
+ // this warning does not apply.
33942
+ return false;
33943
+ }
33944
+ if (boxSizing === 'border-box') {
33945
+ const paddingTop = computedStyle.getPropertyValue('padding-top');
33946
+ const paddingRight = computedStyle.getPropertyValue('padding-right');
33947
+ const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
33948
+ const paddingLeft = computedStyle.getPropertyValue('padding-left');
33949
+ renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
33950
+ renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
33951
+ }
33952
+ const intrinsicWidth = image.naturalWidth;
33953
+ const intrinsicHeight = image.naturalHeight;
33954
+ const recommendedWidth = this.window.devicePixelRatio * renderedWidth;
33955
+ const recommendedHeight = this.window.devicePixelRatio * renderedHeight;
33956
+ const oversizedWidth = (intrinsicWidth - recommendedWidth) >= OVERSIZED_IMAGE_TOLERANCE;
33957
+ const oversizedHeight = (intrinsicHeight - recommendedHeight) >= OVERSIZED_IMAGE_TOLERANCE;
33958
+ return oversizedWidth || oversizedHeight;
33959
+ }
33960
+ static { this.ɵfac = function ImagePerformanceWarning_Factory(t) { return new (t || ImagePerformanceWarning)(); }; }
33961
+ static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ImagePerformanceWarning, factory: ImagePerformanceWarning.ɵfac, providedIn: 'root' }); }
33962
+ }
33963
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ImagePerformanceWarning, [{
33964
+ type: Injectable,
33965
+ args: [{ providedIn: 'root' }]
33966
+ }], null, null); })();
33967
+ function logLazyLCPWarning(src) {
33968
+ console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} is the Largest Contentful Paint (LCP) element ` +
33969
+ `but was given a "loading" value of "lazy", which can negatively impact ` +
33970
+ `application loading performance. This warning can be addressed by ` +
33971
+ `changing the loading value of the LCP image to "eager", or by using the ` +
33972
+ `NgOptimizedImage directive's prioritization utilities. For more ` +
33973
+ `information about addressing or disabling this warning, see ` +
33974
+ `https://angular.io/errors/NG0913`));
33975
+ }
33976
+ function logOversizedImageWarning(src) {
33977
+ console.warn(formatRuntimeError(-913 /* RuntimeErrorCode.IMAGE_PERFORMANCE_WARNING */, `An image with src ${src} has intrinsic file dimensions much larger than its ` +
33978
+ `rendered size. This can negatively impact application loading performance. ` +
33979
+ `For more information about addressing or disabling this warning, see ` +
33980
+ `https://angular.io/errors/NG0913`));
33981
+ }
33982
+
33983
+ /**
33984
+ * Internal create application API that implements the core application creation logic and optional
33985
+ * bootstrap logic.
33986
+ *
33987
+ * Platforms (such as `platform-browser`) may require different set of application and platform
33988
+ * providers for an application to function correctly. As a result, platforms may use this function
33989
+ * internally and supply the necessary providers during the bootstrap, while exposing
33990
+ * platform-specific APIs as a part of their public API.
33991
+ *
33992
+ * @returns A promise that returns an `ApplicationRef` instance once resolved.
33993
+ */
33994
+ function internalCreateApplication(config) {
33995
+ try {
33996
+ const { rootComponent, appProviders, platformProviders } = config;
33997
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && rootComponent !== undefined) {
33998
+ assertStandaloneComponentType(rootComponent);
33999
+ }
34000
+ const platformInjector = createOrReusePlatformInjector(platformProviders);
34001
+ // Create root application injector based on a set of providers configured at the platform
34002
+ // bootstrap level as well as providers passed to the bootstrap call by a user.
34003
+ const allAppProviders = [
34004
+ provideZoneChangeDetection(),
34005
+ ...(appProviders || []),
34006
+ ];
34007
+ const adapter = new EnvironmentNgModuleRefAdapter({
34008
+ providers: allAppProviders,
34009
+ parent: platformInjector,
34010
+ debugName: (typeof ngDevMode === 'undefined' || ngDevMode) ? 'Environment Injector' : '',
34011
+ // We skip environment initializers because we need to run them inside the NgZone, which
34012
+ // happens after we get the NgZone instance from the Injector.
34013
+ runEnvironmentInitializers: false,
34014
+ });
34015
+ const envInjector = adapter.injector;
34016
+ const ngZone = envInjector.get(NgZone);
34017
+ return ngZone.run(() => {
34018
+ envInjector.resolveInjectorInitializers();
34019
+ const exceptionHandler = envInjector.get(ErrorHandler, null);
34020
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !exceptionHandler) {
34021
+ throw new RuntimeError(402 /* RuntimeErrorCode.MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP */, 'No `ErrorHandler` found in the Dependency Injection tree.');
34022
+ }
34023
+ let onErrorSubscription;
34024
+ ngZone.runOutsideAngular(() => {
34025
+ onErrorSubscription = ngZone.onError.subscribe({
34026
+ next: (error) => {
34027
+ exceptionHandler.handleError(error);
34028
+ }
34029
+ });
34030
+ });
34031
+ // If the whole platform is destroyed, invoke the `destroy` method
34032
+ // for all bootstrapped applications as well.
34033
+ const destroyListener = () => envInjector.destroy();
34034
+ const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS);
34035
+ onPlatformDestroyListeners.add(destroyListener);
34036
+ envInjector.onDestroy(() => {
34037
+ onErrorSubscription.unsubscribe();
34038
+ onPlatformDestroyListeners.delete(destroyListener);
34039
+ });
34040
+ return _callAndReportToErrorHandler(exceptionHandler, ngZone, () => {
34041
+ const initStatus = envInjector.get(ApplicationInitStatus);
34042
+ initStatus.runInitializers();
34043
+ return initStatus.donePromise.then(() => {
34044
+ const localeId = envInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
34045
+ setLocaleId(localeId || DEFAULT_LOCALE_ID);
34046
+ const appRef = envInjector.get(ApplicationRef);
34047
+ if (rootComponent !== undefined) {
34048
+ appRef.bootstrap(rootComponent);
34049
+ }
34050
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
34051
+ const imagePerformanceService = envInjector.get(ImagePerformanceWarning);
34052
+ imagePerformanceService.start();
34053
+ }
34054
+ return appRef;
34055
+ });
34056
+ });
34057
+ });
34058
+ }
34059
+ catch (e) {
34060
+ return Promise.reject(e);
34061
+ }
34062
+ }
34063
+
33963
34064
  /**
33964
34065
  * Retrieves all defer blocks in a given LView.
33965
34066
  *
@@ -34304,6 +34405,7 @@ function serializeLView(lView, context) {
34304
34405
  }
34305
34406
  }
34306
34407
  }
34408
+ conditionallyAnnotateNodePath(ngh, tNode, lView);
34307
34409
  if (isLContainer(lView[i])) {
34308
34410
  // Serialize information about a template.
34309
34411
  const embeddedTView = tNode.tView;
@@ -34395,18 +34497,38 @@ function serializeLView(lView, context) {
34395
34497
  context.corruptedTextNodes.set(rNode, "ngtns" /* TextNodeMarker.Separator */);
34396
34498
  }
34397
34499
  }
34398
- if (tNode.projectionNext && tNode.projectionNext !== tNode.next &&
34399
- !isInSkipHydrationBlock(tNode.projectionNext)) {
34400
- // Check if projection next is not the same as next, in which case
34401
- // the node would not be found at creation time at runtime and we
34402
- // need to provide a location for that node.
34403
- appendSerializedNodePath(ngh, tNode.projectionNext, lView);
34404
- }
34405
34500
  }
34406
34501
  }
34407
34502
  }
34408
34503
  return ngh;
34409
34504
  }
34505
+ /**
34506
+ * Serializes node location in cases when it's needed, specifically:
34507
+ *
34508
+ * 1. If `tNode.projectionNext` is different from `tNode.next` - it means that
34509
+ * the next `tNode` after projection is different from the one in the original
34510
+ * template. Since hydration relies on `tNode.next`, this serialized info
34511
+ * if required to help runtime code find the node at the correct location.
34512
+ * 2. In certain content projection-based use-cases, it's possible that only
34513
+ * a content of a projected element is rendered. In this case, content nodes
34514
+ * require an extra annotation, since runtime logic can't rely on parent-child
34515
+ * connection to identify the location of a node.
34516
+ */
34517
+ function conditionallyAnnotateNodePath(ngh, tNode, lView) {
34518
+ // Handle case #1 described above.
34519
+ if (tNode.projectionNext && tNode.projectionNext !== tNode.next &&
34520
+ !isInSkipHydrationBlock(tNode.projectionNext)) {
34521
+ appendSerializedNodePath(ngh, tNode.projectionNext, lView);
34522
+ }
34523
+ // Handle case #2 described above.
34524
+ // Note: we only do that for the first node (i.e. when `tNode.prev === null`),
34525
+ // the rest of the nodes would rely on the current node location, so no extra
34526
+ // annotation is needed.
34527
+ if (tNode.prev === null && tNode.parent !== null && isDisconnectedNode(tNode.parent, lView) &&
34528
+ !isDisconnectedNode(tNode, lView)) {
34529
+ appendSerializedNodePath(ngh, tNode, lView);
34530
+ }
34531
+ }
34410
34532
  /**
34411
34533
  * Determines whether a component instance that is represented
34412
34534
  * by a given LView uses `ViewEncapsulation.ShadowDom`.
@@ -34478,17 +34600,6 @@ function isContentProjectedNode(tNode) {
34478
34600
  }
34479
34601
  return false;
34480
34602
  }
34481
- /**
34482
- * Check whether a given node exists, but is disconnected from the DOM.
34483
- *
34484
- * Note: we leverage the fact that we have this information available in the DOM emulation
34485
- * layer (in Domino) for now. Longer-term solution should not rely on the DOM emulation and
34486
- * only use internal data structures and state to compute this information.
34487
- */
34488
- function isDisconnectedNode(tNode, lView) {
34489
- return !(tNode.type & 16 /* TNodeType.Projection */) && !!lView[tNode.index] &&
34490
- !unwrapRNode(lView[tNode.index]).isConnected;
34491
- }
34492
34603
 
34493
34604
  /**
34494
34605
  * Indicates whether the hydration-related code was added,
@@ -35002,5 +35113,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
35002
35113
  * Generated bundle index. Do not edit.
35003
35114
  */
35004
35115
 
35005
- 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 };
35116
+ 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, ɵINPUT_SIGNAL_BRAND_WRITE_TYPE, 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, 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, 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 };
35006
35117
  //# sourceMappingURL=core.mjs.map