@angular/core 14.1.0-next.1 → 14.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 (56) hide show
  1. package/esm2020/src/application_ref.mjs +31 -35
  2. package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +3 -5
  3. package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +3 -5
  4. package/esm2020/src/change_detection/differs/iterable_differs.mjs +3 -5
  5. package/esm2020/src/change_detection/differs/keyvalue_differs.mjs +2 -5
  6. package/esm2020/src/core.mjs +1 -1
  7. package/esm2020/src/core_render3_private_export.mjs +2 -2
  8. package/esm2020/src/debug/debug_node.mjs +2 -3
  9. package/esm2020/src/di/index.mjs +1 -1
  10. package/esm2020/src/di/injector_compatibility.mjs +16 -16
  11. package/esm2020/src/di/interface/injector.mjs +2 -1
  12. package/esm2020/src/di/jit/util.mjs +3 -2
  13. package/esm2020/src/di/r3_injector.mjs +13 -1
  14. package/esm2020/src/di/reflective_key.mjs +3 -2
  15. package/esm2020/src/errors.mjs +1 -1
  16. package/esm2020/src/i18n/locale_data_api.mjs +3 -2
  17. package/esm2020/src/linker/component_factory.mjs +1 -1
  18. package/esm2020/src/metadata/di.mjs +1 -1
  19. package/esm2020/src/render/api.mjs +2 -11
  20. package/esm2020/src/render3/component.mjs +3 -57
  21. package/esm2020/src/render3/component_ref.mjs +30 -5
  22. package/esm2020/src/render3/features/inherit_definition_feature.mjs +3 -5
  23. package/esm2020/src/render3/index.mjs +3 -3
  24. package/esm2020/src/render3/instructions/element_validation.mjs +4 -1
  25. package/esm2020/src/render3/instructions/listener.mjs +34 -44
  26. package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
  27. package/esm2020/src/render3/instructions/shared.mjs +22 -59
  28. package/esm2020/src/render3/instructions/styling.mjs +2 -2
  29. package/esm2020/src/render3/interfaces/renderer.mjs +1 -17
  30. package/esm2020/src/render3/interfaces/view.mjs +1 -1
  31. package/esm2020/src/render3/jit/directive.mjs +20 -3
  32. package/esm2020/src/render3/ng_module_ref.mjs +13 -2
  33. package/esm2020/src/render3/node_manipulation.mjs +24 -87
  34. package/esm2020/src/render3/node_manipulation_i18n.mjs +1 -1
  35. package/esm2020/src/render3/util/attrs_utils.mjs +4 -12
  36. package/esm2020/src/render3/util/view_utils.mjs +3 -6
  37. package/esm2020/src/render3/view_ref.mjs +3 -5
  38. package/esm2020/src/sanitization/sanitization.mjs +4 -9
  39. package/esm2020/src/version.mjs +1 -1
  40. package/esm2020/src/zone/ng_zone.mjs +5 -4
  41. package/esm2020/testing/src/logger.mjs +3 -3
  42. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  43. package/esm2020/testing/src/r3_test_bed_compiler.mjs +30 -25
  44. package/fesm2015/core.mjs +1871 -2015
  45. package/fesm2015/core.mjs.map +1 -1
  46. package/fesm2015/testing.mjs +1601 -1837
  47. package/fesm2015/testing.mjs.map +1 -1
  48. package/fesm2020/core.mjs +1871 -2015
  49. package/fesm2020/core.mjs.map +1 -1
  50. package/fesm2020/testing.mjs +1601 -1837
  51. package/fesm2020/testing.mjs.map +1 -1
  52. package/index.d.ts +152 -134
  53. package/package.json +1 -1
  54. package/testing/index.d.ts +1 -1
  55. package/schematics/utils/schematics_prompt.d.ts +0 -17
  56. package/schematics/utils/schematics_prompt.js +0 -45
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.1
2
+ * @license Angular v14.1.0-next.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -499,6 +499,7 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
499
499
  * Injection flags for DI.
500
500
  *
501
501
  * @publicApi
502
+ * @deprecated use an options object for `inject` instead.
502
503
  */
503
504
  var InjectFlags;
504
505
  (function (InjectFlags) {
@@ -1593,87 +1594,6 @@ function getNamespaceUri(namespace) {
1593
1594
  (name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
1594
1595
  }
1595
1596
 
1596
- /**
1597
- * @license
1598
- * Copyright Google LLC All Rights Reserved.
1599
- *
1600
- * Use of this source code is governed by an MIT-style license that can be
1601
- * found in the LICENSE file at https://angular.io/license
1602
- */
1603
- /**
1604
- * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
1605
- * inject the `DOCUMENT` token and are done.
1606
- *
1607
- * Ivy is special because it does not rely upon the DI and must get hold of the document some other
1608
- * way.
1609
- *
1610
- * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
1611
- * Wherever ivy needs the global document, it calls `getDocument()` instead.
1612
- *
1613
- * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
1614
- * tell ivy what the global `document` is.
1615
- *
1616
- * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
1617
- * by calling `setDocument()` when providing the `DOCUMENT` token.
1618
- */
1619
- let DOCUMENT = undefined;
1620
- /**
1621
- * Tell ivy what the `document` is for this platform.
1622
- *
1623
- * It is only necessary to call this if the current platform is not a browser.
1624
- *
1625
- * @param document The object representing the global `document` in this environment.
1626
- */
1627
- function setDocument(document) {
1628
- DOCUMENT = document;
1629
- }
1630
- /**
1631
- * Access the object that represents the `document` for this platform.
1632
- *
1633
- * Ivy calls this whenever it needs to access the `document` object.
1634
- * For example to create the renderer or to do sanitization.
1635
- */
1636
- function getDocument() {
1637
- if (DOCUMENT !== undefined) {
1638
- return DOCUMENT;
1639
- }
1640
- else if (typeof document !== 'undefined') {
1641
- return document;
1642
- }
1643
- // No "document" can be found. This should only happen if we are running ivy outside Angular and
1644
- // the current platform is not a browser. Since this is not a supported scenario at the moment
1645
- // this should not happen in Angular apps.
1646
- // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
1647
- // public API. Meanwhile we just return `undefined` and let the application fail.
1648
- return undefined;
1649
- }
1650
-
1651
- /**
1652
- * @license
1653
- * Copyright Google LLC All Rights Reserved.
1654
- *
1655
- * Use of this source code is governed by an MIT-style license that can be
1656
- * found in the LICENSE file at https://angular.io/license
1657
- */
1658
- // TODO: cleanup once the code is merged in angular/angular
1659
- var RendererStyleFlags3;
1660
- (function (RendererStyleFlags3) {
1661
- RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
1662
- RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
1663
- })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
1664
- /** Returns whether the `renderer` is a `ProceduralRenderer3` */
1665
- function isProceduralRenderer(renderer) {
1666
- return !!(renderer.listen);
1667
- }
1668
- const domRendererFactory3 = {
1669
- createRenderer: (hostElement, rendererType) => {
1670
- return getDocument();
1671
- }
1672
- };
1673
- // Note: This hack is necessary so we don't erroneously get a circular dependency
1674
- // failure based on types.
1675
- const unusedValueExportToPlacateAjd$6 = 1;
1676
-
1677
1597
  /**
1678
1598
  * @license
1679
1599
  * Copyright Google LLC All Rights Reserved.
@@ -1756,7 +1676,6 @@ function getNativeByTNode(tNode, lView) {
1756
1676
  ngDevMode && assertTNodeForLView(tNode, lView);
1757
1677
  ngDevMode && assertIndexInRange(lView, tNode.index);
1758
1678
  const node = unwrapRNode(lView[tNode.index]);
1759
- ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
1760
1679
  return node;
1761
1680
  }
1762
1681
  /**
@@ -1772,7 +1691,6 @@ function getNativeByTNodeOrNull(tNode, lView) {
1772
1691
  if (index !== -1) {
1773
1692
  ngDevMode && assertTNodeForLView(tNode, lView);
1774
1693
  const node = unwrapRNode(lView[index]);
1775
- ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
1776
1694
  return node;
1777
1695
  }
1778
1696
  return null;
@@ -2721,7 +2639,7 @@ function isFactory(obj) {
2721
2639
  }
2722
2640
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2723
2641
  // failure based on types.
2724
- const unusedValueExportToPlacateAjd$5 = 1;
2642
+ const unusedValueExportToPlacateAjd$6 = 1;
2725
2643
 
2726
2644
  /**
2727
2645
  * Converts `TNodeType` into human readable text.
@@ -2740,7 +2658,7 @@ function toTNodeTypeAsString(tNodeType) {
2740
2658
  }
2741
2659
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2742
2660
  // failure based on types.
2743
- const unusedValueExportToPlacateAjd$4 = 1;
2661
+ const unusedValueExportToPlacateAjd$5 = 1;
2744
2662
  /**
2745
2663
  * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
2746
2664
  *
@@ -2844,7 +2762,6 @@ function assertPureTNodeType(type) {
2844
2762
  * @returns the index value that was last accessed in the attributes array
2845
2763
  */
2846
2764
  function setUpAttributes(renderer, native, attrs) {
2847
- const isProc = isProceduralRenderer(renderer);
2848
2765
  let i = 0;
2849
2766
  while (i < attrs.length) {
2850
2767
  const value = attrs[i];
@@ -2861,9 +2778,7 @@ function setUpAttributes(renderer, native, attrs) {
2861
2778
  const attrName = attrs[i++];
2862
2779
  const attrVal = attrs[i++];
2863
2780
  ngDevMode && ngDevMode.rendererSetAttribute++;
2864
- isProc ?
2865
- renderer.setAttribute(native, attrName, attrVal, namespaceURI) :
2866
- native.setAttributeNS(namespaceURI, attrName, attrVal);
2781
+ renderer.setAttribute(native, attrName, attrVal, namespaceURI);
2867
2782
  }
2868
2783
  else {
2869
2784
  // attrName is string;
@@ -2872,14 +2787,10 @@ function setUpAttributes(renderer, native, attrs) {
2872
2787
  // Standard attributes
2873
2788
  ngDevMode && ngDevMode.rendererSetAttribute++;
2874
2789
  if (isAnimationProp(attrName)) {
2875
- if (isProc) {
2876
- renderer.setProperty(native, attrName, attrVal);
2877
- }
2790
+ renderer.setProperty(native, attrName, attrVal);
2878
2791
  }
2879
2792
  else {
2880
- isProc ?
2881
- renderer.setAttribute(native, attrName, attrVal) :
2882
- native.setAttribute(attrName, attrVal);
2793
+ renderer.setAttribute(native, attrName, attrVal);
2883
2794
  }
2884
2795
  i++;
2885
2796
  }
@@ -4858,10 +4769,8 @@ function setCurrentInjector(injector) {
4858
4769
  }
4859
4770
  function injectInjectorOnly(token, flags = InjectFlags.Default) {
4860
4771
  if (_currentInjector === undefined) {
4861
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4862
- `inject() must be called from an injection context (a constructor, a factory function or a field initializer)` :
4863
- '';
4864
- throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, errorMessage);
4772
+ throw new RuntimeError(-203 /* RuntimeErrorCode.MISSING_INJECTION_CONTEXT */, ngDevMode &&
4773
+ `inject() must be called from an injection context (a constructor, a factory function or a field initializer)`);
4865
4774
  }
4866
4775
  else if (_currentInjector === null) {
4867
4776
  return injectRootLimpMode(token, undefined, flags);
@@ -4877,22 +4786,17 @@ function ɵɵinject(token, flags = InjectFlags.Default) {
4877
4786
  * Throws an error indicating that a factory function could not be generated by the compiler for a
4878
4787
  * particular class.
4879
4788
  *
4880
- * This instruction allows the actual error message to be optimized away when ngDevMode is turned
4881
- * off, saving bytes of generated code while still providing a good experience in dev mode.
4882
- *
4883
4789
  * The name of the class is not mentioned here, but will be in the generated factory function name
4884
4790
  * and thus in the stack trace.
4885
4791
  *
4886
4792
  * @codeGenApi
4887
4793
  */
4888
4794
  function ɵɵinvalidFactoryDep(index) {
4889
- const msg = ngDevMode ?
4795
+ throw new RuntimeError(202 /* RuntimeErrorCode.INVALID_FACTORY_DEPENDENCY */, ngDevMode &&
4890
4796
  `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.
4891
4797
  This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.
4892
4798
 
4893
- Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.` :
4894
- 'invalid';
4895
- throw new Error(msg);
4799
+ Please check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);
4896
4800
  }
4897
4801
  /**
4898
4802
  * Injects a token from the currently active injector.
@@ -4959,6 +4863,16 @@ Please check that 1) the type for the parameter at index ${index} is correct and
4959
4863
  * @publicApi
4960
4864
  */
4961
4865
  function inject(token, flags = InjectFlags.Default) {
4866
+ if (typeof flags !== 'number') {
4867
+ // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in
4868
+ // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from
4869
+ // `InjectOptions` to `InjectFlags`.
4870
+ flags = (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter
4871
+ (flags.optional && 8 /* InternalInjectFlags.Optional */) |
4872
+ (flags.host && 1 /* InternalInjectFlags.Host */) |
4873
+ (flags.self && 2 /* InternalInjectFlags.Self */) |
4874
+ (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));
4875
+ }
4962
4876
  return ɵɵinject(token, flags);
4963
4877
  }
4964
4878
  function injectArgs(types) {
@@ -4967,10 +4881,7 @@ function injectArgs(types) {
4967
4881
  const arg = resolveForwardRef(types[i]);
4968
4882
  if (Array.isArray(arg)) {
4969
4883
  if (arg.length === 0) {
4970
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
4971
- 'Arguments array must have arguments.' :
4972
- '';
4973
- throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
4884
+ throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode && 'Arguments array must have arguments.');
4974
4885
  }
4975
4886
  let type = undefined;
4976
4887
  let flags = InjectFlags.Default;
@@ -5159,7 +5070,7 @@ function reflectDependency(dep) {
5159
5070
  }
5160
5071
  else if (param instanceof Attribute) {
5161
5072
  if (param.attributeName === undefined) {
5162
- throw new Error(`Attribute name must be defined.`);
5073
+ throw new RuntimeError(204 /* RuntimeErrorCode.INVALID_INJECTION_TOKEN */, ngDevMode && `Attribute name must be defined.`);
5163
5074
  }
5164
5075
  meta.attribute = param.attributeName;
5165
5076
  }
@@ -5345,6 +5256,61 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
5345
5256
  checkForDuplicateNgModules = !allowDuplicates;
5346
5257
  }
5347
5258
 
5259
+ /**
5260
+ * @license
5261
+ * Copyright Google LLC All Rights Reserved.
5262
+ *
5263
+ * Use of this source code is governed by an MIT-style license that can be
5264
+ * found in the LICENSE file at https://angular.io/license
5265
+ */
5266
+ /**
5267
+ * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
5268
+ * inject the `DOCUMENT` token and are done.
5269
+ *
5270
+ * Ivy is special because it does not rely upon the DI and must get hold of the document some other
5271
+ * way.
5272
+ *
5273
+ * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
5274
+ * Wherever ivy needs the global document, it calls `getDocument()` instead.
5275
+ *
5276
+ * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
5277
+ * tell ivy what the global `document` is.
5278
+ *
5279
+ * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
5280
+ * by calling `setDocument()` when providing the `DOCUMENT` token.
5281
+ */
5282
+ let DOCUMENT = undefined;
5283
+ /**
5284
+ * Tell ivy what the `document` is for this platform.
5285
+ *
5286
+ * It is only necessary to call this if the current platform is not a browser.
5287
+ *
5288
+ * @param document The object representing the global `document` in this environment.
5289
+ */
5290
+ function setDocument(document) {
5291
+ DOCUMENT = document;
5292
+ }
5293
+ /**
5294
+ * Access the object that represents the `document` for this platform.
5295
+ *
5296
+ * Ivy calls this whenever it needs to access the `document` object.
5297
+ * For example to create the renderer or to do sanitization.
5298
+ */
5299
+ function getDocument() {
5300
+ if (DOCUMENT !== undefined) {
5301
+ return DOCUMENT;
5302
+ }
5303
+ else if (typeof document !== 'undefined') {
5304
+ return document;
5305
+ }
5306
+ // No "document" can be found. This should only happen if we are running ivy outside Angular and
5307
+ // the current platform is not a browser. Since this is not a supported scenario at the moment
5308
+ // this should not happen in Angular apps.
5309
+ // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
5310
+ // public API. Meanwhile we just return `undefined` and let the application fail.
5311
+ return undefined;
5312
+ }
5313
+
5348
5314
  /**
5349
5315
  * @license
5350
5316
  * Copyright Google LLC All Rights Reserved.
@@ -6215,10 +6181,8 @@ function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
6215
6181
  if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
6216
6182
  return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
6217
6183
  }
6218
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6219
- 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)' :
6220
- '';
6221
- throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, errorMessage);
6184
+ throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode &&
6185
+ 'unsafe value used in a resource URL context (see https://g.co/ng/security#xss)');
6222
6186
  }
6223
6187
  /**
6224
6188
  * A `script` sanitizer which only lets trusted javascript through.
@@ -6240,10 +6204,7 @@ function ɵɵsanitizeScript(unsafeScript) {
6240
6204
  if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
6241
6205
  return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
6242
6206
  }
6243
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
6244
- 'unsafe value used in a script context' :
6245
- '';
6246
- throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, errorMessage);
6207
+ throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');
6247
6208
  }
6248
6209
  /**
6249
6210
  * A template tag function for promoting the associated constant literal to a
@@ -7079,6 +7040,17 @@ function ensureIcuContainerVisitorLoaded(loader) {
7079
7040
  }
7080
7041
  }
7081
7042
 
7043
+ /**
7044
+ * @license
7045
+ * Copyright Google LLC All Rights Reserved.
7046
+ *
7047
+ * Use of this source code is governed by an MIT-style license that can be
7048
+ * found in the LICENSE file at https://angular.io/license
7049
+ */
7050
+ // Note: This hack is necessary so we don't erroneously get a circular dependency
7051
+ // failure based on types.
7052
+ const unusedValueExportToPlacateAjd$4 = 1;
7053
+
7082
7054
  /**
7083
7055
  * @license
7084
7056
  * Copyright Google LLC All Rights Reserved.
@@ -7161,7 +7133,7 @@ function getNearestLContainer(viewOrContainer) {
7161
7133
  * Use of this source code is governed by an MIT-style license that can be
7162
7134
  * found in the LICENSE file at https://angular.io/license
7163
7135
  */
7164
- const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$8;
7136
+ const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$8;
7165
7137
  /**
7166
7138
  * NOTE: for performance reasons, the possible actions are inlined within the function instead of
7167
7139
  * being passed as an argument.
@@ -7186,7 +7158,6 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
7186
7158
  lNodeToHandle = lNodeToHandle[HOST];
7187
7159
  }
7188
7160
  const rNode = unwrapRNode(lNodeToHandle);
7189
- ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
7190
7161
  if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
7191
7162
  if (beforeNode == null) {
7192
7163
  nativeAppendChild(renderer, parent, rNode);
@@ -7213,17 +7184,14 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
7213
7184
  function createTextNode(renderer, value) {
7214
7185
  ngDevMode && ngDevMode.rendererCreateTextNode++;
7215
7186
  ngDevMode && ngDevMode.rendererSetText++;
7216
- return isProceduralRenderer(renderer) ? renderer.createText(value) :
7217
- renderer.createTextNode(value);
7187
+ return renderer.createText(value);
7218
7188
  }
7219
7189
  function updateTextNode(renderer, rNode, value) {
7220
7190
  ngDevMode && ngDevMode.rendererSetText++;
7221
- isProceduralRenderer(renderer) ? renderer.setValue(rNode, value) : rNode.textContent = value;
7191
+ renderer.setValue(rNode, value);
7222
7192
  }
7223
7193
  function createCommentNode(renderer, value) {
7224
7194
  ngDevMode && ngDevMode.rendererCreateComment++;
7225
- // isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
7226
- // method name.
7227
7195
  return renderer.createComment(escapeCommentText(value));
7228
7196
  }
7229
7197
  /**
@@ -7235,14 +7203,7 @@ function createCommentNode(renderer, value) {
7235
7203
  */
7236
7204
  function createElementNode(renderer, name, namespace) {
7237
7205
  ngDevMode && ngDevMode.rendererCreateElement++;
7238
- if (isProceduralRenderer(renderer)) {
7239
- return renderer.createElement(name, namespace);
7240
- }
7241
- else {
7242
- const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
7243
- return namespaceUri === null ? renderer.createElement(name) :
7244
- renderer.createElementNS(namespaceUri, name);
7245
- }
7206
+ return renderer.createElement(name, namespace);
7246
7207
  }
7247
7208
  /**
7248
7209
  * Removes all DOM elements associated with a view.
@@ -7474,7 +7435,7 @@ function detachView(lContainer, removeIndex) {
7474
7435
  function destroyLView(tView, lView) {
7475
7436
  if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
7476
7437
  const renderer = lView[RENDERER];
7477
- if (isProceduralRenderer(renderer) && renderer.destroyNode) {
7438
+ if (renderer.destroyNode) {
7478
7439
  applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
7479
7440
  }
7480
7441
  destroyViewTree(lView);
@@ -7502,7 +7463,7 @@ function cleanUpView(tView, lView) {
7502
7463
  executeOnDestroys(tView, lView);
7503
7464
  processCleanups(tView, lView);
7504
7465
  // For component views only, the local renderer is destroyed at clean up time.
7505
- if (lView[TVIEW].type === 1 /* TViewType.Component */ && isProceduralRenderer(lView[RENDERER])) {
7466
+ if (lView[TVIEW].type === 1 /* TViewType.Component */) {
7506
7467
  ngDevMode && ngDevMode.rendererDestroy++;
7507
7468
  lView[RENDERER].destroy();
7508
7469
  }
@@ -7678,30 +7639,17 @@ function getClosestRElement(tView, tNode, lView) {
7678
7639
  }
7679
7640
  }
7680
7641
  /**
7681
- * Inserts a native node before another native node for a given parent using {@link Renderer3}.
7682
- * This is a utility function that can be used when native nodes were determined - it abstracts an
7683
- * actual renderer being used.
7642
+ * Inserts a native node before another native node for a given parent.
7643
+ * This is a utility function that can be used when native nodes were determined.
7684
7644
  */
7685
7645
  function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
7686
7646
  ngDevMode && ngDevMode.rendererInsertBefore++;
7687
- if (isProceduralRenderer(renderer)) {
7688
- renderer.insertBefore(parent, child, beforeNode, isMove);
7689
- }
7690
- else {
7691
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
7692
- targetParent.insertBefore(child, beforeNode, isMove);
7693
- }
7647
+ renderer.insertBefore(parent, child, beforeNode, isMove);
7694
7648
  }
7695
7649
  function nativeAppendChild(renderer, parent, child) {
7696
7650
  ngDevMode && ngDevMode.rendererAppendChild++;
7697
7651
  ngDevMode && assertDefined(parent, 'parent node must be defined');
7698
- if (isProceduralRenderer(renderer)) {
7699
- renderer.appendChild(parent, child);
7700
- }
7701
- else {
7702
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
7703
- targetParent.appendChild(child);
7704
- }
7652
+ renderer.appendChild(parent, child);
7705
7653
  }
7706
7654
  function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
7707
7655
  if (beforeNode !== null) {
@@ -7713,12 +7661,7 @@ function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove)
7713
7661
  }
7714
7662
  /** Removes a node from the DOM given its native parent. */
7715
7663
  function nativeRemoveChild(renderer, parent, child, isHostElement) {
7716
- if (isProceduralRenderer(renderer)) {
7717
- renderer.removeChild(parent, child, isHostElement);
7718
- }
7719
- else {
7720
- parent.removeChild(child);
7721
- }
7664
+ renderer.removeChild(parent, child, isHostElement);
7722
7665
  }
7723
7666
  /** Checks if an element is a `<template>` node. */
7724
7667
  function isTemplateNode(node) {
@@ -7728,13 +7671,13 @@ function isTemplateNode(node) {
7728
7671
  * Returns a native parent of a given native node.
7729
7672
  */
7730
7673
  function nativeParentNode(renderer, node) {
7731
- return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode);
7674
+ return renderer.parentNode(node);
7732
7675
  }
7733
7676
  /**
7734
7677
  * Returns a native sibling of a given native node.
7735
7678
  */
7736
7679
  function nativeNextSibling(renderer, node) {
7737
- return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;
7680
+ return renderer.nextSibling(node);
7738
7681
  }
7739
7682
  /**
7740
7683
  * Find a node in front of which `currentTNode` should be inserted.
@@ -8043,39 +7986,22 @@ function applyContainer(renderer, action, lContainer, parentRElement, beforeNode
8043
7986
  * otherwise).
8044
7987
  */
8045
7988
  function applyStyling(renderer, isClassBased, rNode, prop, value) {
8046
- const isProcedural = isProceduralRenderer(renderer);
8047
7989
  if (isClassBased) {
8048
7990
  // We actually want JS true/false here because any truthy value should add the class
8049
7991
  if (!value) {
8050
7992
  ngDevMode && ngDevMode.rendererRemoveClass++;
8051
- if (isProcedural) {
8052
- renderer.removeClass(rNode, prop);
8053
- }
8054
- else {
8055
- rNode.classList.remove(prop);
8056
- }
7993
+ renderer.removeClass(rNode, prop);
8057
7994
  }
8058
7995
  else {
8059
7996
  ngDevMode && ngDevMode.rendererAddClass++;
8060
- if (isProcedural) {
8061
- renderer.addClass(rNode, prop);
8062
- }
8063
- else {
8064
- ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
8065
- rNode.classList.add(prop);
8066
- }
7997
+ renderer.addClass(rNode, prop);
8067
7998
  }
8068
7999
  }
8069
8000
  else {
8070
8001
  let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
8071
8002
  if (value == null /** || value === undefined */) {
8072
8003
  ngDevMode && ngDevMode.rendererRemoveStyle++;
8073
- if (isProcedural) {
8074
- renderer.removeStyle(rNode, prop, flags);
8075
- }
8076
- else {
8077
- rNode.style.removeProperty(prop);
8078
- }
8004
+ renderer.removeStyle(rNode, prop, flags);
8079
8005
  }
8080
8006
  else {
8081
8007
  // A value is important if it ends with `!important`. The style
@@ -8087,13 +8013,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
8087
8013
  flags |= RendererStyleFlags2.Important;
8088
8014
  }
8089
8015
  ngDevMode && ngDevMode.rendererSetStyle++;
8090
- if (isProcedural) {
8091
- renderer.setStyle(rNode, prop, value, flags);
8092
- }
8093
- else {
8094
- ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
8095
- rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
8096
- }
8016
+ renderer.setStyle(rNode, prop, value, flags);
8097
8017
  }
8098
8018
  }
8099
8019
  }
@@ -8109,12 +8029,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
8109
8029
  */
8110
8030
  function writeDirectStyle(renderer, element, newValue) {
8111
8031
  ngDevMode && assertString(newValue, '\'newValue\' should be a string');
8112
- if (isProceduralRenderer(renderer)) {
8113
- renderer.setAttribute(element, 'style', newValue);
8114
- }
8115
- else {
8116
- element.style.cssText = newValue;
8117
- }
8032
+ renderer.setAttribute(element, 'style', newValue);
8118
8033
  ngDevMode && ngDevMode.rendererSetStyle++;
8119
8034
  }
8120
8035
  /**
@@ -8129,17 +8044,12 @@ function writeDirectStyle(renderer, element, newValue) {
8129
8044
  */
8130
8045
  function writeDirectClass(renderer, element, newValue) {
8131
8046
  ngDevMode && assertString(newValue, '\'newValue\' should be a string');
8132
- if (isProceduralRenderer(renderer)) {
8133
- if (newValue === '') {
8134
- // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
8135
- renderer.removeAttribute(element, 'class');
8136
- }
8137
- else {
8138
- renderer.setAttribute(element, 'class', newValue);
8139
- }
8047
+ if (newValue === '') {
8048
+ // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
8049
+ renderer.removeAttribute(element, 'class');
8140
8050
  }
8141
8051
  else {
8142
- element.className = newValue;
8052
+ renderer.setAttribute(element, 'class', newValue);
8143
8053
  }
8144
8054
  ngDevMode && ngDevMode.rendererSetClassName++;
8145
8055
  }
@@ -8189,7 +8099,7 @@ function classIndexOf(className, classToSearch, startingIndex) {
8189
8099
  * Use of this source code is governed by an MIT-style license that can be
8190
8100
  * found in the LICENSE file at https://angular.io/license
8191
8101
  */
8192
- const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3;
8102
+ const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
8193
8103
  const NG_TEMPLATE_SELECTOR = 'ng-template';
8194
8104
  /**
8195
8105
  * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
@@ -9218,6 +9128,18 @@ class R3Injector extends EnvironmentInjector {
9218
9128
  onDestroy(callback) {
9219
9129
  this._onDestroyHooks.push(callback);
9220
9130
  }
9131
+ runInContext(fn) {
9132
+ this.assertNotDestroyed();
9133
+ const previousInjector = setCurrentInjector(this);
9134
+ const previousInjectImplementation = setInjectImplementation(undefined);
9135
+ try {
9136
+ return fn();
9137
+ }
9138
+ finally {
9139
+ setCurrentInjector(previousInjector);
9140
+ setInjectImplementation(previousInjectImplementation);
9141
+ }
9142
+ }
9221
9143
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
9222
9144
  this.assertNotDestroyed();
9223
9145
  // Set the injection context.
@@ -9828,7 +9750,7 @@ class ReflectiveKey {
9828
9750
  this.token = token;
9829
9751
  this.id = id;
9830
9752
  if (!token) {
9831
- throw new Error('Token must be defined!');
9753
+ throw new RuntimeError(208 /* RuntimeErrorCode.MISSING_INJECTION_TOKEN */, ngDevMode && 'Token must be defined!');
9832
9754
  }
9833
9755
  this.displayName = stringify(this.token);
9834
9756
  }
@@ -10632,6 +10554,9 @@ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
10632
10554
  `the ${schemas} of this component.`;
10633
10555
  }
10634
10556
  }
10557
+ reportUnknownPropertyError(message);
10558
+ }
10559
+ function reportUnknownPropertyError(message) {
10635
10560
  if (shouldThrowErrorOnUnknownProperty) {
10636
10561
  throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
10637
10562
  }
@@ -11518,6 +11443,13 @@ class LContainerDebug {
11518
11443
  }
11519
11444
  }
11520
11445
 
11446
+ /**
11447
+ * @license
11448
+ * Copyright Google LLC All Rights Reserved.
11449
+ *
11450
+ * Use of this source code is governed by an MIT-style license that can be
11451
+ * found in the LICENSE file at https://angular.io/license
11452
+ */
11521
11453
  /**
11522
11454
  * A permanent marker promise which signifies that the current CD tree is
11523
11455
  * clean.
@@ -11585,7 +11517,7 @@ function refreshChildComponents(hostLView, components) {
11585
11517
  /** Renders child components in the current view (creation mode). */
11586
11518
  function renderChildComponents(hostLView, components) {
11587
11519
  for (let i = 0; i < components.length; i++) {
11588
- renderComponent$1(hostLView, components[i]);
11520
+ renderComponent(hostLView, components[i]);
11589
11521
  }
11590
11522
  }
11591
11523
  function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
@@ -12103,16 +12035,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
12103
12035
  function createError(text, token) {
12104
12036
  return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
12105
12037
  }
12106
- function assertHostNodeExists(rElement, elementOrSelector) {
12107
- if (!rElement) {
12108
- if (typeof elementOrSelector === 'string') {
12109
- throw createError('Host node with selector not found:', elementOrSelector);
12110
- }
12111
- else {
12112
- throw createError('Host node is required:', elementOrSelector);
12113
- }
12114
- }
12115
- }
12116
12038
  /**
12117
12039
  * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
12118
12040
  *
@@ -12121,21 +12043,9 @@ function assertHostNodeExists(rElement, elementOrSelector) {
12121
12043
  * @param encapsulation View Encapsulation defined for component that requests host element.
12122
12044
  */
12123
12045
  function locateHostElement(renderer, elementOrSelector, encapsulation) {
12124
- if (isProceduralRenderer(renderer)) {
12125
- // When using native Shadow DOM, do not clear host element to allow native slot projection
12126
- const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
12127
- return renderer.selectRootElement(elementOrSelector, preserveContent);
12128
- }
12129
- let rElement = typeof elementOrSelector === 'string' ?
12130
- renderer.querySelector(elementOrSelector) :
12131
- elementOrSelector;
12132
- ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
12133
- // Always clear host element's content when Renderer3 is in use. For procedural renderer case we
12134
- // make it depend on whether ShadowDom encapsulation is used (in which case the content should be
12135
- // preserved to allow native slot projection). ShadowDom encapsulation requires procedural
12136
- // renderer, and procedural renderer case is handled above.
12137
- rElement.textContent = '';
12138
- return rElement;
12046
+ // When using native Shadow DOM, do not clear host element to allow native slot projection
12047
+ const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
12048
+ return renderer.selectRootElement(elementOrSelector, preserveContent);
12139
12049
  }
12140
12050
  /**
12141
12051
  * Saves context for this cleanup function in LView.cleanupInstances.
@@ -12350,13 +12260,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
12350
12260
  // It is assumed that the sanitizer is only added when the compiler determines that the
12351
12261
  // property is risky, so sanitization can be done without further checks.
12352
12262
  value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
12353
- if (isProceduralRenderer(renderer)) {
12354
- renderer.setProperty(element, propName, value);
12355
- }
12356
- else if (!isAnimationProp(propName)) {
12357
- element.setProperty ? element.setProperty(propName, value) :
12358
- element[propName] = value;
12359
- }
12263
+ renderer.setProperty(element, propName, value);
12360
12264
  }
12361
12265
  else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
12362
12266
  // If the node is a container and the property didn't
@@ -12380,23 +12284,15 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
12380
12284
  const debugValue = normalizeDebugBindingValue(value);
12381
12285
  if (type & 3 /* TNodeType.AnyRNode */) {
12382
12286
  if (value == null) {
12383
- isProceduralRenderer(renderer) ? renderer.removeAttribute(element, attrName) :
12384
- element.removeAttribute(attrName);
12287
+ renderer.removeAttribute(element, attrName);
12385
12288
  }
12386
12289
  else {
12387
- isProceduralRenderer(renderer) ?
12388
- renderer.setAttribute(element, attrName, debugValue) :
12389
- element.setAttribute(attrName, debugValue);
12290
+ renderer.setAttribute(element, attrName, debugValue);
12390
12291
  }
12391
12292
  }
12392
12293
  else {
12393
12294
  const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
12394
- if (isProceduralRenderer(renderer)) {
12395
- renderer.setValue(element, textContent);
12396
- }
12397
- else {
12398
- element.textContent = textContent;
12399
- }
12295
+ renderer.setValue(element, textContent);
12400
12296
  }
12401
12297
  }
12402
12298
  function setNgReflectProperties(lView, element, type, dataValue, value) {
@@ -12426,6 +12322,7 @@ function instantiateRootComponent(tView, lView, def) {
12426
12322
  ngDevMode &&
12427
12323
  assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
12428
12324
  configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
12325
+ initializeInputAndOutputAliases(tView, rootTNode);
12429
12326
  }
12430
12327
  const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);
12431
12328
  attachPatchData(directive, lView);
@@ -12750,19 +12647,12 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
12750
12647
  function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
12751
12648
  if (value == null) {
12752
12649
  ngDevMode && ngDevMode.rendererRemoveAttribute++;
12753
- isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name, namespace) :
12754
- element.removeAttribute(name);
12650
+ renderer.removeAttribute(element, name, namespace);
12755
12651
  }
12756
12652
  else {
12757
12653
  ngDevMode && ngDevMode.rendererSetAttribute++;
12758
12654
  const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
12759
- if (isProceduralRenderer(renderer)) {
12760
- renderer.setAttribute(element, name, strValue, namespace);
12761
- }
12762
- else {
12763
- namespace ? element.setAttributeNS(namespace, name, strValue) :
12764
- element.setAttribute(name, strValue);
12765
- }
12655
+ renderer.setAttribute(element, name, strValue, namespace);
12766
12656
  }
12767
12657
  }
12768
12658
  /**
@@ -12854,7 +12744,6 @@ const LContainerArray = class LContainer extends Array {
12854
12744
  */
12855
12745
  function createLContainer(hostNative, currentView, native, tNode) {
12856
12746
  ngDevMode && assertLView(currentView);
12857
- ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
12858
12747
  // https://jsperf.com/array-literal-vs-new-array-really
12859
12748
  const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
12860
12749
  true, // Boolean `true` in this position signifies that this is an `LContainer`
@@ -12970,7 +12859,7 @@ function refreshContainsDirtyView(lView) {
12970
12859
  }
12971
12860
  }
12972
12861
  }
12973
- function renderComponent$1(hostLView, componentHostIdx) {
12862
+ function renderComponent(hostLView, componentHostIdx) {
12974
12863
  ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
12975
12864
  const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
12976
12865
  const componentTView = componentView[TVIEW];
@@ -13322,458 +13211,450 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
13322
13211
  * Use of this source code is governed by an MIT-style license that can be
13323
13212
  * found in the LICENSE file at https://angular.io/license
13324
13213
  */
13214
+ // TODO: A hack to not pull in the NullInjector from @angular/core.
13215
+ const NULL_INJECTOR = {
13216
+ get: (token, notFoundValue) => {
13217
+ throwProviderNotFoundError(token, 'NullInjector');
13218
+ }
13219
+ };
13325
13220
  /**
13326
- * Synchronously perform change detection on a component (and possibly its sub-components).
13327
- *
13328
- * This function triggers change detection in a synchronous way on a component.
13329
- *
13330
- * @param component The component which the change detection should be performed on.
13331
- */
13332
- function detectChanges(component) {
13333
- const view = getComponentViewByInstance(component);
13334
- detectChangesInternal(view[TVIEW], view, component);
13335
- }
13336
- /**
13337
- * Marks the component as dirty (needing change detection). Marking a component dirty will
13338
- * schedule a change detection on it at some point in the future.
13339
- *
13340
- * Marking an already dirty component as dirty won't do anything. Only one outstanding change
13341
- * detection can be scheduled per component tree.
13342
- *
13343
- * @param component Component to mark as dirty.
13344
- */
13345
- function markDirty(component) {
13346
- ngDevMode && assertDefined(component, 'component');
13347
- const rootView = markViewDirty(getComponentViewByInstance(component));
13348
- ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
13349
- scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
13350
- }
13351
- /**
13352
- * Used to perform change detection on the whole application.
13221
+ * Creates the root component view and the root component node.
13353
13222
  *
13354
- * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
13355
- * executes lifecycle hooks and conditionally checks components based on their
13356
- * `ChangeDetectionStrategy` and dirtiness.
13223
+ * @param rNode Render host element.
13224
+ * @param def ComponentDef
13225
+ * @param rootView The parent view where the host node is stored
13226
+ * @param rendererFactory Factory to be used for creating child renderers.
13227
+ * @param hostRenderer The current renderer
13228
+ * @param sanitizer The sanitizer, if provided
13357
13229
  *
13358
- * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
13359
- * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
13360
- * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
13361
- * be changed when calling `renderComponent` and providing the `scheduler` option.
13230
+ * @returns Component view created
13362
13231
  */
13363
- function tick(component) {
13364
- const rootView = getRootView(component);
13365
- const rootContext = rootView[CONTEXT];
13366
- tickRootContext(rootContext);
13232
+ function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
13233
+ const tView = rootView[TVIEW];
13234
+ const index = HEADER_OFFSET;
13235
+ ngDevMode && assertIndexInRange(rootView, index);
13236
+ rootView[index] = rNode;
13237
+ // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
13238
+ // the same time we want to communicate the debug `TNode` that this is a special `TNode`
13239
+ // representing a host element.
13240
+ const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
13241
+ const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
13242
+ if (mergedAttrs !== null) {
13243
+ computeStaticStyling(tNode, mergedAttrs, true);
13244
+ if (rNode !== null) {
13245
+ setUpAttributes(hostRenderer, rNode, mergedAttrs);
13246
+ if (tNode.classes !== null) {
13247
+ writeDirectClass(hostRenderer, rNode, tNode.classes);
13248
+ }
13249
+ if (tNode.styles !== null) {
13250
+ writeDirectStyle(hostRenderer, rNode, tNode.styles);
13251
+ }
13252
+ }
13253
+ }
13254
+ const viewRenderer = rendererFactory.createRenderer(rNode, def);
13255
+ const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
13256
+ if (tView.firstCreatePass) {
13257
+ diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
13258
+ markAsComponentHost(tView, tNode);
13259
+ initTNodeFlags(tNode, rootView.length, 1);
13260
+ }
13261
+ addToViewTree(rootView, componentView);
13262
+ // Store component view at node index, with node as the HOST
13263
+ return rootView[index] = componentView;
13367
13264
  }
13368
-
13369
- /**
13370
- * @license
13371
- * Copyright Google LLC All Rights Reserved.
13372
- *
13373
- * Use of this source code is governed by an MIT-style license that can be
13374
- * found in the LICENSE file at https://angular.io/license
13375
- */
13376
13265
  /**
13377
- * Retrieves the component instance associated with a given DOM element.
13378
- *
13379
- * @usageNotes
13380
- * Given the following DOM structure:
13381
- *
13382
- * ```html
13383
- * <app-root>
13384
- * <div>
13385
- * <child-comp></child-comp>
13386
- * </div>
13387
- * </app-root>
13388
- * ```
13389
- *
13390
- * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
13391
- * associated with this DOM element.
13392
- *
13393
- * Calling the function on `<app-root>` will return the `MyApp` instance.
13394
- *
13395
- *
13396
- * @param element DOM element from which the component should be retrieved.
13397
- * @returns Component instance associated with the element or `null` if there
13398
- * is no component associated with it.
13399
- *
13400
- * @publicApi
13401
- * @globalApi ng
13266
+ * Creates a root component and sets it up with features and host bindings. Shared by
13267
+ * renderComponent() and ViewContainerRef.createComponent().
13402
13268
  */
13403
- function getComponent$1(element) {
13404
- ngDevMode && assertDomElement(element);
13405
- const context = getLContext(element);
13406
- if (context === null)
13407
- return null;
13408
- if (context.component === undefined) {
13409
- const lView = context.lView;
13410
- if (lView === null) {
13411
- return null;
13269
+ function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
13270
+ const tView = rootLView[TVIEW];
13271
+ // Create directive instance with factory() and store at next index in viewData
13272
+ const component = instantiateRootComponent(tView, rootLView, componentDef);
13273
+ rootContext.components.push(component);
13274
+ componentView[CONTEXT] = component;
13275
+ if (hostFeatures !== null) {
13276
+ for (const feature of hostFeatures) {
13277
+ feature(component, componentDef);
13412
13278
  }
13413
- context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
13414
13279
  }
13415
- return context.component;
13280
+ // We want to generate an empty QueryList for root content queries for backwards
13281
+ // compatibility with ViewEngine.
13282
+ if (componentDef.contentQueries) {
13283
+ const tNode = getCurrentTNode();
13284
+ ngDevMode && assertDefined(tNode, 'TNode expected');
13285
+ componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
13286
+ }
13287
+ const rootTNode = getCurrentTNode();
13288
+ ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
13289
+ if (tView.firstCreatePass &&
13290
+ (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
13291
+ setSelectedIndex(rootTNode.index);
13292
+ const rootTView = rootLView[TVIEW];
13293
+ registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
13294
+ invokeHostBindingsInCreationMode(componentDef, component);
13295
+ }
13296
+ return component;
13416
13297
  }
13417
- /**
13418
- * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
13419
- * view that the element is part of. Otherwise retrieves the instance of the component whose view
13420
- * owns the element (in this case, the result is the same as calling `getOwningComponent`).
13421
- *
13422
- * @param element Element for which to get the surrounding component instance.
13423
- * @returns Instance of the component that is around the element or null if the element isn't
13424
- * inside any component.
13425
- *
13426
- * @publicApi
13427
- * @globalApi ng
13428
- */
13429
- function getContext(element) {
13430
- assertDomElement(element);
13431
- const context = getLContext(element);
13432
- const lView = context ? context.lView : null;
13433
- return lView === null ? null : lView[CONTEXT];
13298
+ function createRootContext(scheduler, playerHandler) {
13299
+ return {
13300
+ components: [],
13301
+ scheduler: scheduler || defaultScheduler,
13302
+ clean: CLEAN_PROMISE,
13303
+ playerHandler: playerHandler || null,
13304
+ flags: 0 /* RootContextFlags.Empty */
13305
+ };
13434
13306
  }
13435
13307
  /**
13436
- * Retrieves the component instance whose view contains the DOM element.
13308
+ * Used to enable lifecycle hooks on the root component.
13437
13309
  *
13438
- * For example, if `<child-comp>` is used in the template of `<app-comp>`
13439
- * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
13440
- * would return `<app-comp>`.
13310
+ * Include this feature when calling `renderComponent` if the root component
13311
+ * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
13312
+ * be called properly.
13441
13313
  *
13442
- * @param elementOrDir DOM element, component or directive instance
13443
- * for which to retrieve the root components.
13444
- * @returns Component instance whose view owns the DOM element or null if the element is not
13445
- * part of a component view.
13314
+ * Example:
13446
13315
  *
13447
- * @publicApi
13448
- * @globalApi ng
13316
+ * ```
13317
+ * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
13318
+ * ```
13449
13319
  */
13450
- function getOwningComponent(elementOrDir) {
13451
- const context = getLContext(elementOrDir);
13452
- let lView = context ? context.lView : null;
13453
- if (lView === null)
13454
- return null;
13455
- let parent;
13456
- while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
13457
- lView = parent;
13458
- }
13459
- return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
13320
+ function LifecycleHooksFeature() {
13321
+ const tNode = getCurrentTNode();
13322
+ ngDevMode && assertDefined(tNode, 'TNode is required');
13323
+ registerPostOrderHooks(getLView()[TVIEW], tNode);
13460
13324
  }
13461
13325
  /**
13462
- * Retrieves all root components associated with a DOM element, directive or component instance.
13463
- * Root components are those which have been bootstrapped by Angular.
13326
+ * Wait on component until it is rendered.
13464
13327
  *
13465
- * @param elementOrDir DOM element, component or directive instance
13466
- * for which to retrieve the root components.
13467
- * @returns Root components associated with the target object.
13328
+ * This function returns a `Promise` which is resolved when the component's
13329
+ * change detection is executed. This is determined by finding the scheduler
13330
+ * associated with the `component`'s render tree and waiting until the scheduler
13331
+ * flushes. If nothing is scheduled, the function returns a resolved promise.
13468
13332
  *
13469
- * @publicApi
13470
- * @globalApi ng
13333
+ * Example:
13334
+ * ```
13335
+ * await whenRendered(myComponent);
13336
+ * ```
13337
+ *
13338
+ * @param component Component to wait upon
13339
+ * @returns Promise which resolves when the component is rendered.
13471
13340
  */
13472
- function getRootComponents(elementOrDir) {
13473
- const lView = readPatchedLView(elementOrDir);
13474
- return lView !== null ? [...getRootContext(lView).components] : [];
13341
+ function whenRendered(component) {
13342
+ return getRootContext(component).clean;
13475
13343
  }
13344
+
13476
13345
  /**
13477
- * Retrieves an `Injector` associated with an element, component or directive instance.
13478
- *
13479
- * @param elementOrDir DOM element, component or directive instance for which to
13480
- * retrieve the injector.
13481
- * @returns Injector associated with the element, component or directive instance.
13346
+ * @license
13347
+ * Copyright Google LLC All Rights Reserved.
13482
13348
  *
13483
- * @publicApi
13484
- * @globalApi ng
13349
+ * Use of this source code is governed by an MIT-style license that can be
13350
+ * found in the LICENSE file at https://angular.io/license
13485
13351
  */
13486
- function getInjector(elementOrDir) {
13487
- const context = getLContext(elementOrDir);
13488
- const lView = context ? context.lView : null;
13489
- if (lView === null)
13490
- return Injector.NULL;
13491
- const tNode = lView[TVIEW].data[context.nodeIndex];
13492
- return new NodeInjector(tNode, lView);
13352
+ function getSuperType(type) {
13353
+ return Object.getPrototypeOf(type.prototype).constructor;
13493
13354
  }
13494
13355
  /**
13495
- * Retrieve a set of injection tokens at a given DOM node.
13356
+ * Merges the definition from a super class to a sub class.
13357
+ * @param definition The definition that is a SubClass of another directive of component
13496
13358
  *
13497
- * @param element Element for which the injection tokens should be retrieved.
13359
+ * @codeGenApi
13498
13360
  */
13499
- function getInjectionTokens(element) {
13500
- const context = getLContext(element);
13501
- const lView = context ? context.lView : null;
13502
- if (lView === null)
13503
- return [];
13504
- const tView = lView[TVIEW];
13505
- const tNode = tView.data[context.nodeIndex];
13506
- const providerTokens = [];
13507
- const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
13508
- const endIndex = tNode.directiveEnd;
13509
- for (let i = startIndex; i < endIndex; i++) {
13510
- let value = tView.data[i];
13511
- if (isDirectiveDefHack(value)) {
13512
- // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
13513
- // design flaw. We should always store same type so that we can be monomorphic. The issue
13514
- // is that for Components/Directives we store the def instead the type. The correct behavior
13515
- // is that we should always be storing injectable type in this location.
13516
- value = value.type;
13361
+ function ɵɵInheritDefinitionFeature(definition) {
13362
+ let superType = getSuperType(definition.type);
13363
+ let shouldInheritFields = true;
13364
+ const inheritanceChain = [definition];
13365
+ while (superType) {
13366
+ let superDef = undefined;
13367
+ if (isComponentDef(definition)) {
13368
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13369
+ superDef = superType.ɵcmp || superType.ɵdir;
13517
13370
  }
13518
- providerTokens.push(value);
13519
- }
13520
- return providerTokens;
13521
- }
13522
- /**
13523
- * Retrieves directive instances associated with a given DOM node. Does not include
13524
- * component instances.
13525
- *
13526
- * @usageNotes
13527
- * Given the following DOM structure:
13528
- *
13529
- * ```html
13530
- * <app-root>
13531
- * <button my-button></button>
13532
- * <my-comp></my-comp>
13533
- * </app-root>
13534
- * ```
13535
- *
13536
- * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
13537
- * directive that is associated with the DOM node.
13538
- *
13539
- * Calling `getDirectives` on `<my-comp>` will return an empty array.
13540
- *
13541
- * @param node DOM node for which to get the directives.
13542
- * @returns Array of directives associated with the node.
13371
+ else {
13372
+ if (superType.ɵcmp) {
13373
+ throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
13374
+ `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
13375
+ }
13376
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13377
+ superDef = superType.ɵdir;
13378
+ }
13379
+ if (superDef) {
13380
+ if (shouldInheritFields) {
13381
+ inheritanceChain.push(superDef);
13382
+ // Some fields in the definition may be empty, if there were no values to put in them that
13383
+ // would've justified object creation. Unwrap them if necessary.
13384
+ const writeableDef = definition;
13385
+ writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
13386
+ writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
13387
+ writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
13388
+ // Merge hostBindings
13389
+ const superHostBindings = superDef.hostBindings;
13390
+ superHostBindings && inheritHostBindings(definition, superHostBindings);
13391
+ // Merge queries
13392
+ const superViewQuery = superDef.viewQuery;
13393
+ const superContentQueries = superDef.contentQueries;
13394
+ superViewQuery && inheritViewQuery(definition, superViewQuery);
13395
+ superContentQueries && inheritContentQueries(definition, superContentQueries);
13396
+ // Merge inputs and outputs
13397
+ fillProperties(definition.inputs, superDef.inputs);
13398
+ fillProperties(definition.declaredInputs, superDef.declaredInputs);
13399
+ fillProperties(definition.outputs, superDef.outputs);
13400
+ // Merge animations metadata.
13401
+ // If `superDef` is a Component, the `data` field is present (defaults to an empty object).
13402
+ if (isComponentDef(superDef) && superDef.data.animation) {
13403
+ // If super def is a Component, the `definition` is also a Component, since Directives can
13404
+ // not inherit Components (we throw an error above and cannot reach this code).
13405
+ const defData = definition.data;
13406
+ defData.animation = (defData.animation || []).concat(superDef.data.animation);
13407
+ }
13408
+ }
13409
+ // Run parent features
13410
+ const features = superDef.features;
13411
+ if (features) {
13412
+ for (let i = 0; i < features.length; i++) {
13413
+ const feature = features[i];
13414
+ if (feature && feature.ngInherit) {
13415
+ feature(definition);
13416
+ }
13417
+ // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
13418
+ // def already has all the necessary information inherited from its super class(es), so we
13419
+ // can stop merging fields from super classes. However we need to iterate through the
13420
+ // prototype chain to look for classes that might contain other "features" (like
13421
+ // NgOnChanges), which we should invoke for the original `definition`. We set the
13422
+ // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
13423
+ // logic and only invoking functions from the "features" list.
13424
+ if (feature === ɵɵInheritDefinitionFeature) {
13425
+ shouldInheritFields = false;
13426
+ }
13427
+ }
13428
+ }
13429
+ }
13430
+ superType = Object.getPrototypeOf(superType);
13431
+ }
13432
+ mergeHostAttrsAcrossInheritance(inheritanceChain);
13433
+ }
13434
+ /**
13435
+ * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
13543
13436
  *
13544
- * @publicApi
13545
- * @globalApi ng
13437
+ * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
13438
+ * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
13439
+ * type.
13546
13440
  */
13547
- function getDirectives(node) {
13548
- // Skip text nodes because we can't have directives associated with them.
13549
- if (node instanceof Text) {
13550
- return [];
13441
+ function mergeHostAttrsAcrossInheritance(inheritanceChain) {
13442
+ let hostVars = 0;
13443
+ let hostAttrs = null;
13444
+ // We process the inheritance order from the base to the leaves here.
13445
+ for (let i = inheritanceChain.length - 1; i >= 0; i--) {
13446
+ const def = inheritanceChain[i];
13447
+ // For each `hostVars`, we need to add the superclass amount.
13448
+ def.hostVars = (hostVars += def.hostVars);
13449
+ // for each `hostAttrs` we need to merge it with superclass.
13450
+ def.hostAttrs =
13451
+ mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
13551
13452
  }
13552
- const context = getLContext(node);
13553
- const lView = context ? context.lView : null;
13554
- if (lView === null) {
13555
- return [];
13453
+ }
13454
+ function maybeUnwrapEmpty(value) {
13455
+ if (value === EMPTY_OBJ) {
13456
+ return {};
13556
13457
  }
13557
- const tView = lView[TVIEW];
13558
- const nodeIndex = context.nodeIndex;
13559
- if (!tView?.data[nodeIndex]) {
13458
+ else if (value === EMPTY_ARRAY) {
13560
13459
  return [];
13561
13460
  }
13562
- if (context.directives === undefined) {
13563
- context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
13461
+ else {
13462
+ return value;
13564
13463
  }
13565
- // The `directives` in this case are a named array called `LComponentView`. Clone the
13566
- // result so we don't expose an internal data structure in the user's console.
13567
- return context.directives === null ? [] : [...context.directives];
13568
13464
  }
13569
- /**
13570
- * Returns the debug (partial) metadata for a particular directive or component instance.
13571
- * The function accepts an instance of a directive or component and returns the corresponding
13572
- * metadata.
13573
- *
13574
- * @param directiveOrComponentInstance Instance of a directive or component
13575
- * @returns metadata of the passed directive or component
13576
- *
13577
- * @publicApi
13578
- * @globalApi ng
13579
- */
13580
- function getDirectiveMetadata$1(directiveOrComponentInstance) {
13581
- const { constructor } = directiveOrComponentInstance;
13582
- if (!constructor) {
13583
- throw new Error('Unable to find the instance constructor');
13465
+ function inheritViewQuery(definition, superViewQuery) {
13466
+ const prevViewQuery = definition.viewQuery;
13467
+ if (prevViewQuery) {
13468
+ definition.viewQuery = (rf, ctx) => {
13469
+ superViewQuery(rf, ctx);
13470
+ prevViewQuery(rf, ctx);
13471
+ };
13584
13472
  }
13585
- // In case a component inherits from a directive, we may have component and directive metadata
13586
- // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
13587
- const componentDef = getComponentDef(constructor);
13588
- if (componentDef) {
13589
- return {
13590
- inputs: componentDef.inputs,
13591
- outputs: componentDef.outputs,
13592
- encapsulation: componentDef.encapsulation,
13593
- changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
13594
- ChangeDetectionStrategy.Default
13473
+ else {
13474
+ definition.viewQuery = superViewQuery;
13475
+ }
13476
+ }
13477
+ function inheritContentQueries(definition, superContentQueries) {
13478
+ const prevContentQueries = definition.contentQueries;
13479
+ if (prevContentQueries) {
13480
+ definition.contentQueries = (rf, ctx, directiveIndex) => {
13481
+ superContentQueries(rf, ctx, directiveIndex);
13482
+ prevContentQueries(rf, ctx, directiveIndex);
13595
13483
  };
13596
13484
  }
13597
- const directiveDef = getDirectiveDef(constructor);
13598
- if (directiveDef) {
13599
- return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
13485
+ else {
13486
+ definition.contentQueries = superContentQueries;
13600
13487
  }
13601
- return null;
13602
13488
  }
13603
- /**
13604
- * Retrieve map of local references.
13605
- *
13606
- * The references are retrieved as a map of local reference name to element or directive instance.
13607
- *
13608
- * @param target DOM element, component or directive instance for which to retrieve
13609
- * the local references.
13610
- */
13611
- function getLocalRefs(target) {
13612
- const context = getLContext(target);
13613
- if (context === null)
13614
- return {};
13615
- if (context.localRefs === undefined) {
13616
- const lView = context.lView;
13617
- if (lView === null) {
13618
- return {};
13619
- }
13620
- context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
13489
+ function inheritHostBindings(definition, superHostBindings) {
13490
+ const prevHostBindings = definition.hostBindings;
13491
+ if (prevHostBindings) {
13492
+ definition.hostBindings = (rf, ctx) => {
13493
+ superHostBindings(rf, ctx);
13494
+ prevHostBindings(rf, ctx);
13495
+ };
13496
+ }
13497
+ else {
13498
+ definition.hostBindings = superHostBindings;
13621
13499
  }
13622
- return context.localRefs || {};
13623
13500
  }
13501
+
13624
13502
  /**
13625
- * Retrieves the host element of a component or directive instance.
13626
- * The host element is the DOM element that matched the selector of the directive.
13627
- *
13628
- * @param componentOrDirective Component or directive instance for which the host
13629
- * element should be retrieved.
13630
- * @returns Host element of the target.
13503
+ * @license
13504
+ * Copyright Google LLC All Rights Reserved.
13631
13505
  *
13632
- * @publicApi
13633
- * @globalApi ng
13506
+ * Use of this source code is governed by an MIT-style license that can be
13507
+ * found in the LICENSE file at https://angular.io/license
13634
13508
  */
13635
- function getHostElement(componentOrDirective) {
13636
- return getLContext(componentOrDirective).native;
13637
- }
13638
13509
  /**
13639
- * Retrieves the rendered text for a given component.
13640
- *
13641
- * This function retrieves the host element of a component and
13642
- * and then returns the `textContent` for that element. This implies
13643
- * that the text returned will include re-projected content of
13644
- * the component as well.
13510
+ * Fields which exist on either directive or component definitions, and need to be copied from
13511
+ * parent to child classes by the `ɵɵCopyDefinitionFeature`.
13512
+ */
13513
+ const COPY_DIRECTIVE_FIELDS = [
13514
+ // The child class should use the providers of its parent.
13515
+ 'providersResolver',
13516
+ // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
13517
+ // as inputs, outputs, and host binding functions.
13518
+ ];
13519
+ /**
13520
+ * Fields which exist only on component definitions, and need to be copied from parent to child
13521
+ * classes by the `ɵɵCopyDefinitionFeature`.
13645
13522
  *
13646
- * @param component The component to return the content text for.
13523
+ * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
13524
+ * since those should go in `COPY_DIRECTIVE_FIELDS` above.
13647
13525
  */
13648
- function getRenderedText(component) {
13649
- const hostElement = getHostElement(component);
13650
- return hostElement.textContent || '';
13651
- }
13526
+ const COPY_COMPONENT_FIELDS = [
13527
+ // The child class should use the template function of its parent, including all template
13528
+ // semantics.
13529
+ 'template',
13530
+ 'decls',
13531
+ 'consts',
13532
+ 'vars',
13533
+ 'onPush',
13534
+ 'ngContentSelectors',
13535
+ // The child class should use the CSS styles of its parent, including all styling semantics.
13536
+ 'styles',
13537
+ 'encapsulation',
13538
+ // The child class should be checked by the runtime in the same way as its parent.
13539
+ 'schemas',
13540
+ ];
13652
13541
  /**
13653
- * Retrieves a list of event listeners associated with a DOM element. The list does include host
13654
- * listeners, but it does not include event listeners defined outside of the Angular context
13655
- * (e.g. through `addEventListener`).
13542
+ * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
13543
+ * definition.
13656
13544
  *
13657
- * @usageNotes
13658
- * Given the following DOM structure:
13545
+ * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
13546
+ * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
13547
+ * generates a skeleton definition on the child class, and applies this feature.
13659
13548
  *
13660
- * ```html
13661
- * <app-root>
13662
- * <div (click)="doSomething()"></div>
13663
- * </app-root>
13664
- * ```
13665
- *
13666
- * Calling `getListeners` on `<div>` will return an object that looks as follows:
13667
- *
13668
- * ```ts
13669
- * {
13670
- * name: 'click',
13671
- * element: <div>,
13672
- * callback: () => doSomething(),
13673
- * useCapture: false
13674
- * }
13675
- * ```
13549
+ * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
13550
+ * including things like the component template function.
13676
13551
  *
13677
- * @param element Element for which the DOM listeners should be retrieved.
13678
- * @returns Array of event listeners on the DOM element.
13552
+ * @param definition The definition of a child class which inherits from a parent class with its
13553
+ * own definition.
13679
13554
  *
13680
- * @publicApi
13681
- * @globalApi ng
13555
+ * @codeGenApi
13682
13556
  */
13683
- function getListeners(element) {
13684
- ngDevMode && assertDomElement(element);
13685
- const lContext = getLContext(element);
13686
- const lView = lContext === null ? null : lContext.lView;
13687
- if (lView === null)
13688
- return [];
13689
- const tView = lView[TVIEW];
13690
- const lCleanup = lView[CLEANUP];
13691
- const tCleanup = tView.cleanup;
13692
- const listeners = [];
13693
- if (tCleanup && lCleanup) {
13694
- for (let i = 0; i < tCleanup.length;) {
13695
- const firstParam = tCleanup[i++];
13696
- const secondParam = tCleanup[i++];
13697
- if (typeof firstParam === 'string') {
13698
- const name = firstParam;
13699
- const listenerElement = unwrapRNode(lView[secondParam]);
13700
- const callback = lCleanup[tCleanup[i++]];
13701
- const useCaptureOrIndx = tCleanup[i++];
13702
- // if useCaptureOrIndx is boolean then report it as is.
13703
- // if useCaptureOrIndx is positive number then it in unsubscribe method
13704
- // if useCaptureOrIndx is negative number then it is a Subscription
13705
- const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
13706
- const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
13707
- if (element == listenerElement) {
13708
- listeners.push({ element, name, callback, useCapture, type });
13709
- }
13710
- }
13557
+ function ɵɵCopyDefinitionFeature(definition) {
13558
+ let superType = getSuperType(definition.type);
13559
+ let superDef = undefined;
13560
+ if (isComponentDef(definition)) {
13561
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13562
+ superDef = superType.ɵcmp;
13563
+ }
13564
+ else {
13565
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13566
+ superDef = superType.ɵdir;
13567
+ }
13568
+ // Needed because `definition` fields are readonly.
13569
+ const defAny = definition;
13570
+ // Copy over any fields that apply to either directives or components.
13571
+ for (const field of COPY_DIRECTIVE_FIELDS) {
13572
+ defAny[field] = superDef[field];
13573
+ }
13574
+ if (isComponentDef(superDef)) {
13575
+ // Copy over any component-specific fields.
13576
+ for (const field of COPY_COMPONENT_FIELDS) {
13577
+ defAny[field] = superDef[field];
13711
13578
  }
13712
13579
  }
13713
- listeners.sort(sortListeners);
13714
- return listeners;
13715
- }
13716
- function sortListeners(a, b) {
13717
- if (a.name == b.name)
13718
- return 0;
13719
- return a.name < b.name ? -1 : 1;
13720
13580
  }
13581
+
13721
13582
  /**
13722
- * This function should not exist because it is megamorphic and only mostly correct.
13583
+ * @license
13584
+ * Copyright Google LLC All Rights Reserved.
13723
13585
  *
13724
- * See call site for more info.
13586
+ * Use of this source code is governed by an MIT-style license that can be
13587
+ * found in the LICENSE file at https://angular.io/license
13725
13588
  */
13726
- function isDirectiveDefHack(obj) {
13727
- return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
13589
+ let _symbolIterator = null;
13590
+ function getSymbolIterator() {
13591
+ if (!_symbolIterator) {
13592
+ const Symbol = _global['Symbol'];
13593
+ if (Symbol && Symbol.iterator) {
13594
+ _symbolIterator = Symbol.iterator;
13595
+ }
13596
+ else {
13597
+ // es6-shim specific logic
13598
+ const keys = Object.getOwnPropertyNames(Map.prototype);
13599
+ for (let i = 0; i < keys.length; ++i) {
13600
+ const key = keys[i];
13601
+ if (key !== 'entries' && key !== 'size' &&
13602
+ Map.prototype[key] === Map.prototype['entries']) {
13603
+ _symbolIterator = key;
13604
+ }
13605
+ }
13606
+ }
13607
+ }
13608
+ return _symbolIterator;
13728
13609
  }
13610
+
13729
13611
  /**
13730
- * Returns the attached `DebugNode` instance for an element in the DOM.
13612
+ * @license
13613
+ * Copyright Google LLC All Rights Reserved.
13731
13614
  *
13732
- * @param element DOM element which is owned by an existing component's view.
13615
+ * Use of this source code is governed by an MIT-style license that can be
13616
+ * found in the LICENSE file at https://angular.io/license
13733
13617
  */
13734
- function getDebugNode$1(element) {
13735
- if (ngDevMode && !(element instanceof Node)) {
13736
- throw new Error('Expecting instance of DOM Element');
13618
+ function isIterable(obj) {
13619
+ return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
13620
+ }
13621
+ function isListLikeIterable(obj) {
13622
+ if (!isJsObject(obj))
13623
+ return false;
13624
+ return Array.isArray(obj) ||
13625
+ (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
13626
+ getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
13627
+ }
13628
+ function areIterablesEqual(a, b, comparator) {
13629
+ const iterator1 = a[getSymbolIterator()]();
13630
+ const iterator2 = b[getSymbolIterator()]();
13631
+ while (true) {
13632
+ const item1 = iterator1.next();
13633
+ const item2 = iterator2.next();
13634
+ if (item1.done && item2.done)
13635
+ return true;
13636
+ if (item1.done || item2.done)
13637
+ return false;
13638
+ if (!comparator(item1.value, item2.value))
13639
+ return false;
13737
13640
  }
13738
- const lContext = getLContext(element);
13739
- const lView = lContext ? lContext.lView : null;
13740
- if (lView === null) {
13741
- return null;
13641
+ }
13642
+ function iterateListLike(obj, fn) {
13643
+ if (Array.isArray(obj)) {
13644
+ for (let i = 0; i < obj.length; i++) {
13645
+ fn(obj[i]);
13646
+ }
13742
13647
  }
13743
- const nodeIndex = lContext.nodeIndex;
13744
- if (nodeIndex !== -1) {
13745
- const valueInLView = lView[nodeIndex];
13746
- // this means that value in the lView is a component with its own
13747
- // data. In this situation the TNode is not accessed at the same spot.
13748
- const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
13749
- ngDevMode &&
13750
- assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
13751
- return buildDebugNode(tNode, lView);
13648
+ else {
13649
+ const iterator = obj[getSymbolIterator()]();
13650
+ let item;
13651
+ while (!((item = iterator.next()).done)) {
13652
+ fn(item.value);
13653
+ }
13752
13654
  }
13753
- return null;
13754
- }
13755
- /**
13756
- * Retrieve the component `LView` from component/element.
13757
- *
13758
- * NOTE: `LView` is a private and should not be leaked outside.
13759
- * Don't export this method to `ng.*` on window.
13760
- *
13761
- * @param target DOM element or component instance for which to retrieve the LView.
13762
- */
13763
- function getComponentLView(target) {
13764
- const lContext = getLContext(target);
13765
- const nodeIndx = lContext.nodeIndex;
13766
- const lView = lContext.lView;
13767
- ngDevMode && assertLView(lView);
13768
- const componentLView = lView[nodeIndx];
13769
- ngDevMode && assertLView(componentLView);
13770
- return componentLView;
13771
13655
  }
13772
- /** Asserts that a value is a DOM Element. */
13773
- function assertDomElement(value) {
13774
- if (typeof Element !== 'undefined' && !(value instanceof Element)) {
13775
- throw new Error('Expecting instance of DOM Element');
13776
- }
13656
+ function isJsObject(o) {
13657
+ return o !== null && (typeof o === 'function' || typeof o === 'object');
13777
13658
  }
13778
13659
 
13779
13660
  /**
@@ -13783,18 +13664,22 @@ function assertDomElement(value) {
13783
13664
  * Use of this source code is governed by an MIT-style license that can be
13784
13665
  * found in the LICENSE file at https://angular.io/license
13785
13666
  */
13786
- /**
13787
- * Marks a component for check (in case of OnPush components) and synchronously
13788
- * performs change detection on the application this component belongs to.
13789
- *
13790
- * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
13791
- *
13792
- * @publicApi
13793
- * @globalApi ng
13794
- */
13795
- function applyChanges(component) {
13796
- markDirty(component);
13797
- getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
13667
+ function devModeEqual(a, b) {
13668
+ const isListLikeIterableA = isListLikeIterable(a);
13669
+ const isListLikeIterableB = isListLikeIterable(b);
13670
+ if (isListLikeIterableA && isListLikeIterableB) {
13671
+ return areIterablesEqual(a, b, devModeEqual);
13672
+ }
13673
+ else {
13674
+ const isAObject = a && (typeof a === 'object' || typeof a === 'function');
13675
+ const isBObject = b && (typeof b === 'object' || typeof b === 'function');
13676
+ if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
13677
+ return true;
13678
+ }
13679
+ else {
13680
+ return Object.is(a, b);
13681
+ }
13682
+ }
13798
13683
  }
13799
13684
 
13800
13685
  /**
@@ -13804,70 +13689,73 @@ function applyChanges(component) {
13804
13689
  * Use of this source code is governed by an MIT-style license that can be
13805
13690
  * found in the LICENSE file at https://angular.io/license
13806
13691
  */
13692
+ // TODO(misko): consider inlining
13693
+ /** Updates binding and returns the value. */
13694
+ function updateBinding(lView, bindingIndex, value) {
13695
+ return lView[bindingIndex] = value;
13696
+ }
13697
+ /** Gets the current binding value. */
13698
+ function getBinding(lView, bindingIndex) {
13699
+ ngDevMode && assertIndexInRange(lView, bindingIndex);
13700
+ ngDevMode &&
13701
+ assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
13702
+ return lView[bindingIndex];
13703
+ }
13807
13704
  /**
13808
- * This file introduces series of globally accessible debug tools
13809
- * to allow for the Angular debugging story to function.
13810
- *
13811
- * To see this in action run the following command:
13812
- *
13813
- * bazel run //packages/core/test/bundling/todo:devserver
13705
+ * Updates binding if changed, then returns whether it was updated.
13814
13706
  *
13815
- * Then load `localhost:5432` and start using the console tools.
13816
- */
13817
- /**
13818
- * This value reflects the property on the window where the dev
13819
- * tools are patched (window.ng).
13820
- * */
13821
- const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
13822
- let _published = false;
13823
- /**
13824
- * Publishes a collection of default debug tools onto`window.ng`.
13707
+ * This function also checks the `CheckNoChangesMode` and throws if changes are made.
13708
+ * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
13709
+ * behavior.
13825
13710
  *
13826
- * These functions are available globally when Angular is in development
13827
- * mode and are automatically stripped away from prod mode is on.
13711
+ * @param lView current `LView`
13712
+ * @param bindingIndex The binding in the `LView` to check
13713
+ * @param value New value to check against `lView[bindingIndex]`
13714
+ * @returns `true` if the bindings has changed. (Throws if binding has changed during
13715
+ * `CheckNoChangesMode`)
13828
13716
  */
13829
- function publishDefaultGlobalUtils$1() {
13830
- if (!_published) {
13831
- _published = true;
13832
- /**
13833
- * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
13834
- * The contract of the function might be changed in any release and/or the function can be
13835
- * removed completely.
13836
- */
13837
- publishGlobalUtil('ɵsetProfiler', setProfiler);
13838
- publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
13839
- publishGlobalUtil('getComponent', getComponent$1);
13840
- publishGlobalUtil('getContext', getContext);
13841
- publishGlobalUtil('getListeners', getListeners);
13842
- publishGlobalUtil('getOwningComponent', getOwningComponent);
13843
- publishGlobalUtil('getHostElement', getHostElement);
13844
- publishGlobalUtil('getInjector', getInjector);
13845
- publishGlobalUtil('getRootComponents', getRootComponents);
13846
- publishGlobalUtil('getDirectives', getDirectives);
13847
- publishGlobalUtil('applyChanges', applyChanges);
13717
+ function bindingUpdated(lView, bindingIndex, value) {
13718
+ ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
13719
+ ngDevMode &&
13720
+ assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
13721
+ const oldValue = lView[bindingIndex];
13722
+ if (Object.is(oldValue, value)) {
13723
+ return false;
13848
13724
  }
13849
- }
13850
- /**
13851
- * Publishes the given function to `window.ng` so that it can be
13852
- * used from the browser console when an application is not in production.
13853
- */
13854
- function publishGlobalUtil(name, fn) {
13855
- if (typeof COMPILED === 'undefined' || !COMPILED) {
13856
- // Note: we can't export `ng` when using closure enhanced optimization as:
13857
- // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
13858
- // - we can't declare a closure extern as the namespace `ng` is already used within Google
13859
- // for typings for AngularJS (via `goog.provide('ng....')`).
13860
- const w = _global;
13861
- ngDevMode && assertDefined(fn, 'function not defined');
13862
- if (w) {
13863
- let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
13864
- if (!container) {
13865
- container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
13725
+ else {
13726
+ if (ngDevMode && isInCheckNoChangesMode()) {
13727
+ // View engine didn't report undefined values as changed on the first checkNoChanges pass
13728
+ // (before the change detection was run).
13729
+ const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
13730
+ if (!devModeEqual(oldValueToCompare, value)) {
13731
+ const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
13732
+ throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
13866
13733
  }
13867
- container[name] = fn;
13734
+ // There was a change, but the `devModeEqual` decided that the change is exempt from an error.
13735
+ // For this reason we exit as if no change. The early exit is needed to prevent the changed
13736
+ // value to be written into `LView` (If we would write the new value that we would not see it
13737
+ // as change on next CD.)
13738
+ return false;
13868
13739
  }
13740
+ lView[bindingIndex] = value;
13741
+ return true;
13869
13742
  }
13870
13743
  }
13744
+ /** Updates 2 bindings if changed, then returns whether either was updated. */
13745
+ function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
13746
+ const different = bindingUpdated(lView, bindingIndex, exp1);
13747
+ return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
13748
+ }
13749
+ /** Updates 3 bindings if changed, then returns whether any was updated. */
13750
+ function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
13751
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
13752
+ return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
13753
+ }
13754
+ /** Updates 4 bindings if changed, then returns whether any was updated. */
13755
+ function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
13756
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
13757
+ return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
13758
+ }
13871
13759
 
13872
13760
  /**
13873
13761
  * @license
@@ -13876,975 +13764,370 @@ function publishGlobalUtil(name, fn) {
13876
13764
  * Use of this source code is governed by an MIT-style license that can be
13877
13765
  * found in the LICENSE file at https://angular.io/license
13878
13766
  */
13879
- // TODO: A hack to not pull in the NullInjector from @angular/core.
13880
- const NULL_INJECTOR = {
13881
- get: (token, notFoundValue) => {
13882
- throwProviderNotFoundError(token, 'NullInjector');
13883
- }
13884
- };
13885
13767
  /**
13886
- * Bootstraps a Component into an existing host element and returns an instance
13887
- * of the component.
13768
+ * Updates the value of or removes a bound attribute on an Element.
13888
13769
  *
13889
- * Use this function to bootstrap a component into the DOM tree. Each invocation
13890
- * of this function will create a separate tree of components, injectors and
13891
- * change detection cycles and lifetimes. To dynamically insert a new component
13892
- * into an existing tree such that it shares the same injection, change detection
13893
- * and object lifetime, use {@link ViewContainer#createComponent}.
13770
+ * Used in the case of `[attr.title]="value"`
13771
+ *
13772
+ * @param name name The name of the attribute.
13773
+ * @param value value The attribute is removed when value is `null` or `undefined`.
13774
+ * Otherwise the attribute value is set to the stringified value.
13775
+ * @param sanitizer An optional function used to sanitize the value.
13776
+ * @param namespace Optional namespace to use when setting the attribute.
13894
13777
  *
13895
- * @param componentType Component to bootstrap
13896
- * @param options Optional parameters which control bootstrapping
13778
+ * @codeGenApi
13897
13779
  */
13898
- function renderComponent(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) {
13899
- ngDevMode && publishDefaultGlobalUtils$1();
13900
- ngDevMode && assertComponentType(componentType);
13901
- const rendererFactory = opts.rendererFactory || domRendererFactory3;
13902
- const sanitizer = opts.sanitizer || null;
13903
- const componentDef = getComponentDef(componentType);
13904
- if (componentDef.type != componentType)
13905
- componentDef.type = componentType;
13906
- // The first index of the first selector is the tag name.
13907
- const componentTag = componentDef.selectors[0][0];
13908
- const hostRenderer = rendererFactory.createRenderer(null, null);
13909
- const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
13910
- const rootFlags = componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
13911
- 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
13912
- const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
13913
- const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
13914
- const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
13915
- const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
13916
- enterView(rootView);
13917
- let component;
13918
- try {
13919
- if (rendererFactory.begin)
13920
- rendererFactory.begin();
13921
- const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
13922
- component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
13923
- // create mode pass
13924
- renderView(rootTView, rootView, null);
13925
- // update mode pass
13926
- refreshView(rootTView, rootView, null, null);
13927
- }
13928
- finally {
13929
- leaveView();
13930
- if (rendererFactory.end)
13931
- rendererFactory.end();
13780
+ function ɵɵattribute(name, value, sanitizer, namespace) {
13781
+ const lView = getLView();
13782
+ const bindingIndex = nextBindingIndex();
13783
+ if (bindingUpdated(lView, bindingIndex, value)) {
13784
+ const tView = getTView();
13785
+ const tNode = getSelectedTNode();
13786
+ elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
13787
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
13932
13788
  }
13933
- return component;
13789
+ return ɵɵattribute;
13934
13790
  }
13791
+
13935
13792
  /**
13936
- * Creates the root component view and the root component node.
13937
- *
13938
- * @param rNode Render host element.
13939
- * @param def ComponentDef
13940
- * @param rootView The parent view where the host node is stored
13941
- * @param rendererFactory Factory to be used for creating child renderers.
13942
- * @param hostRenderer The current renderer
13943
- * @param sanitizer The sanitizer, if provided
13793
+ * @license
13794
+ * Copyright Google LLC All Rights Reserved.
13944
13795
  *
13945
- * @returns Component view created
13796
+ * Use of this source code is governed by an MIT-style license that can be
13797
+ * found in the LICENSE file at https://angular.io/license
13946
13798
  */
13947
- function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
13948
- const tView = rootView[TVIEW];
13949
- const index = HEADER_OFFSET;
13950
- ngDevMode && assertIndexInRange(rootView, index);
13951
- rootView[index] = rNode;
13952
- // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
13953
- // the same time we want to communicate the debug `TNode` that this is a special `TNode`
13954
- // representing a host element.
13955
- const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
13956
- const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
13957
- if (mergedAttrs !== null) {
13958
- computeStaticStyling(tNode, mergedAttrs, true);
13959
- if (rNode !== null) {
13960
- setUpAttributes(hostRenderer, rNode, mergedAttrs);
13961
- if (tNode.classes !== null) {
13962
- writeDirectClass(hostRenderer, rNode, tNode.classes);
13963
- }
13964
- if (tNode.styles !== null) {
13965
- writeDirectStyle(hostRenderer, rNode, tNode.styles);
13966
- }
13967
- }
13968
- }
13969
- const viewRenderer = rendererFactory.createRenderer(rNode, def);
13970
- const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
13971
- if (tView.firstCreatePass) {
13972
- diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
13973
- markAsComponentHost(tView, tNode);
13974
- initTNodeFlags(tNode, rootView.length, 1);
13975
- }
13976
- addToViewTree(rootView, componentView);
13977
- // Store component view at node index, with node as the HOST
13978
- return rootView[index] = componentView;
13979
- }
13980
13799
  /**
13981
- * Creates a root component and sets it up with features and host bindings. Shared by
13982
- * renderComponent() and ViewContainerRef.createComponent().
13800
+ * Create interpolation bindings with a variable number of expressions.
13801
+ *
13802
+ * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
13803
+ * Those are faster because there is no need to create an array of expressions and iterate over it.
13804
+ *
13805
+ * `values`:
13806
+ * - has static text at even indexes,
13807
+ * - has evaluated expressions at odd indexes.
13808
+ *
13809
+ * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
13983
13810
  */
13984
- function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
13985
- const tView = rootLView[TVIEW];
13986
- // Create directive instance with factory() and store at next index in viewData
13987
- const component = instantiateRootComponent(tView, rootLView, componentDef);
13988
- rootContext.components.push(component);
13989
- componentView[CONTEXT] = component;
13990
- if (hostFeatures !== null) {
13991
- for (const feature of hostFeatures) {
13992
- feature(component, componentDef);
13993
- }
13811
+ function interpolationV(lView, values) {
13812
+ ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
13813
+ ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
13814
+ let isBindingUpdated = false;
13815
+ let bindingIndex = getBindingIndex();
13816
+ for (let i = 1; i < values.length; i += 2) {
13817
+ // Check if bindings (odd indexes) have changed
13818
+ isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
13994
13819
  }
13995
- // We want to generate an empty QueryList for root content queries for backwards
13996
- // compatibility with ViewEngine.
13997
- if (componentDef.contentQueries) {
13998
- const tNode = getCurrentTNode();
13999
- ngDevMode && assertDefined(tNode, 'TNode expected');
14000
- componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
13820
+ setBindingIndex(bindingIndex);
13821
+ if (!isBindingUpdated) {
13822
+ return NO_CHANGE;
14001
13823
  }
14002
- const rootTNode = getCurrentTNode();
14003
- ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
14004
- if (tView.firstCreatePass &&
14005
- (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
14006
- setSelectedIndex(rootTNode.index);
14007
- const rootTView = rootLView[TVIEW];
14008
- registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
14009
- invokeHostBindingsInCreationMode(componentDef, component);
13824
+ // Build the updated content
13825
+ let content = values[0];
13826
+ for (let i = 1; i < values.length; i += 2) {
13827
+ content += renderStringify(values[i]) + values[i + 1];
14010
13828
  }
14011
- return component;
14012
- }
14013
- function createRootContext(scheduler, playerHandler) {
14014
- return {
14015
- components: [],
14016
- scheduler: scheduler || defaultScheduler,
14017
- clean: CLEAN_PROMISE,
14018
- playerHandler: playerHandler || null,
14019
- flags: 0 /* RootContextFlags.Empty */
14020
- };
13829
+ return content;
14021
13830
  }
14022
13831
  /**
14023
- * Used to enable lifecycle hooks on the root component.
14024
- *
14025
- * Include this feature when calling `renderComponent` if the root component
14026
- * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
14027
- * be called properly.
14028
- *
14029
- * Example:
13832
+ * Creates an interpolation binding with 1 expression.
14030
13833
  *
14031
- * ```
14032
- * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
14033
- * ```
13834
+ * @param prefix static value used for concatenation only.
13835
+ * @param v0 value checked for change.
13836
+ * @param suffix static value used for concatenation only.
14034
13837
  */
14035
- function LifecycleHooksFeature() {
14036
- const tNode = getCurrentTNode();
14037
- ngDevMode && assertDefined(tNode, 'TNode is required');
14038
- registerPostOrderHooks(getLView()[TVIEW], tNode);
13838
+ function interpolation1(lView, prefix, v0, suffix) {
13839
+ const different = bindingUpdated(lView, nextBindingIndex(), v0);
13840
+ return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
14039
13841
  }
14040
13842
  /**
14041
- * Wait on component until it is rendered.
14042
- *
14043
- * This function returns a `Promise` which is resolved when the component's
14044
- * change detection is executed. This is determined by finding the scheduler
14045
- * associated with the `component`'s render tree and waiting until the scheduler
14046
- * flushes. If nothing is scheduled, the function returns a resolved promise.
14047
- *
14048
- * Example:
14049
- * ```
14050
- * await whenRendered(myComponent);
14051
- * ```
14052
- *
14053
- * @param component Component to wait upon
14054
- * @returns Promise which resolves when the component is rendered.
13843
+ * Creates an interpolation binding with 2 expressions.
14055
13844
  */
14056
- function whenRendered(component) {
14057
- return getRootContext(component).clean;
14058
- }
14059
-
14060
- /**
14061
- * @license
14062
- * Copyright Google LLC All Rights Reserved.
14063
- *
14064
- * Use of this source code is governed by an MIT-style license that can be
14065
- * found in the LICENSE file at https://angular.io/license
14066
- */
14067
- function getSuperType(type) {
14068
- return Object.getPrototypeOf(type.prototype).constructor;
13845
+ function interpolation2(lView, prefix, v0, i0, v1, suffix) {
13846
+ const bindingIndex = getBindingIndex();
13847
+ const different = bindingUpdated2(lView, bindingIndex, v0, v1);
13848
+ incrementBindingIndex(2);
13849
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
14069
13850
  }
14070
13851
  /**
14071
- * Merges the definition from a super class to a sub class.
14072
- * @param definition The definition that is a SubClass of another directive of component
14073
- *
14074
- * @codeGenApi
13852
+ * Creates an interpolation binding with 3 expressions.
14075
13853
  */
14076
- function ɵɵInheritDefinitionFeature(definition) {
14077
- let superType = getSuperType(definition.type);
14078
- let shouldInheritFields = true;
14079
- const inheritanceChain = [definition];
14080
- while (superType) {
14081
- let superDef = undefined;
14082
- if (isComponentDef(definition)) {
14083
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14084
- superDef = superType.ɵcmp || superType.ɵdir;
14085
- }
14086
- else {
14087
- if (superType.ɵcmp) {
14088
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
14089
- `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}` :
14090
- '';
14091
- throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, errorMessage);
14092
- }
14093
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14094
- superDef = superType.ɵdir;
14095
- }
14096
- if (superDef) {
14097
- if (shouldInheritFields) {
14098
- inheritanceChain.push(superDef);
14099
- // Some fields in the definition may be empty, if there were no values to put in them that
14100
- // would've justified object creation. Unwrap them if necessary.
14101
- const writeableDef = definition;
14102
- writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
14103
- writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
14104
- writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
14105
- // Merge hostBindings
14106
- const superHostBindings = superDef.hostBindings;
14107
- superHostBindings && inheritHostBindings(definition, superHostBindings);
14108
- // Merge queries
14109
- const superViewQuery = superDef.viewQuery;
14110
- const superContentQueries = superDef.contentQueries;
14111
- superViewQuery && inheritViewQuery(definition, superViewQuery);
14112
- superContentQueries && inheritContentQueries(definition, superContentQueries);
14113
- // Merge inputs and outputs
14114
- fillProperties(definition.inputs, superDef.inputs);
14115
- fillProperties(definition.declaredInputs, superDef.declaredInputs);
14116
- fillProperties(definition.outputs, superDef.outputs);
14117
- // Merge animations metadata.
14118
- // If `superDef` is a Component, the `data` field is present (defaults to an empty object).
14119
- if (isComponentDef(superDef) && superDef.data.animation) {
14120
- // If super def is a Component, the `definition` is also a Component, since Directives can
14121
- // not inherit Components (we throw an error above and cannot reach this code).
14122
- const defData = definition.data;
14123
- defData.animation = (defData.animation || []).concat(superDef.data.animation);
14124
- }
14125
- }
14126
- // Run parent features
14127
- const features = superDef.features;
14128
- if (features) {
14129
- for (let i = 0; i < features.length; i++) {
14130
- const feature = features[i];
14131
- if (feature && feature.ngInherit) {
14132
- feature(definition);
14133
- }
14134
- // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
14135
- // def already has all the necessary information inherited from its super class(es), so we
14136
- // can stop merging fields from super classes. However we need to iterate through the
14137
- // prototype chain to look for classes that might contain other "features" (like
14138
- // NgOnChanges), which we should invoke for the original `definition`. We set the
14139
- // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
14140
- // logic and only invoking functions from the "features" list.
14141
- if (feature === ɵɵInheritDefinitionFeature) {
14142
- shouldInheritFields = false;
14143
- }
14144
- }
14145
- }
14146
- }
14147
- superType = Object.getPrototypeOf(superType);
14148
- }
14149
- mergeHostAttrsAcrossInheritance(inheritanceChain);
13854
+ function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
13855
+ const bindingIndex = getBindingIndex();
13856
+ const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
13857
+ incrementBindingIndex(3);
13858
+ return different ?
13859
+ prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
13860
+ NO_CHANGE;
14150
13861
  }
14151
13862
  /**
14152
- * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
14153
- *
14154
- * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
14155
- * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
14156
- * type.
13863
+ * Create an interpolation binding with 4 expressions.
14157
13864
  */
14158
- function mergeHostAttrsAcrossInheritance(inheritanceChain) {
14159
- let hostVars = 0;
14160
- let hostAttrs = null;
14161
- // We process the inheritance order from the base to the leaves here.
14162
- for (let i = inheritanceChain.length - 1; i >= 0; i--) {
14163
- const def = inheritanceChain[i];
14164
- // For each `hostVars`, we need to add the superclass amount.
14165
- def.hostVars = (hostVars += def.hostVars);
14166
- // for each `hostAttrs` we need to merge it with superclass.
14167
- def.hostAttrs =
14168
- mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
14169
- }
14170
- }
14171
- function maybeUnwrapEmpty(value) {
14172
- if (value === EMPTY_OBJ) {
14173
- return {};
14174
- }
14175
- else if (value === EMPTY_ARRAY) {
14176
- return [];
14177
- }
14178
- else {
14179
- return value;
14180
- }
14181
- }
14182
- function inheritViewQuery(definition, superViewQuery) {
14183
- const prevViewQuery = definition.viewQuery;
14184
- if (prevViewQuery) {
14185
- definition.viewQuery = (rf, ctx) => {
14186
- superViewQuery(rf, ctx);
14187
- prevViewQuery(rf, ctx);
14188
- };
14189
- }
14190
- else {
14191
- definition.viewQuery = superViewQuery;
14192
- }
14193
- }
14194
- function inheritContentQueries(definition, superContentQueries) {
14195
- const prevContentQueries = definition.contentQueries;
14196
- if (prevContentQueries) {
14197
- definition.contentQueries = (rf, ctx, directiveIndex) => {
14198
- superContentQueries(rf, ctx, directiveIndex);
14199
- prevContentQueries(rf, ctx, directiveIndex);
14200
- };
14201
- }
14202
- else {
14203
- definition.contentQueries = superContentQueries;
14204
- }
13865
+ function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
13866
+ const bindingIndex = getBindingIndex();
13867
+ const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13868
+ incrementBindingIndex(4);
13869
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13870
+ renderStringify(v2) + i2 + renderStringify(v3) + suffix :
13871
+ NO_CHANGE;
14205
13872
  }
14206
- function inheritHostBindings(definition, superHostBindings) {
14207
- const prevHostBindings = definition.hostBindings;
14208
- if (prevHostBindings) {
14209
- definition.hostBindings = (rf, ctx) => {
14210
- superHostBindings(rf, ctx);
14211
- prevHostBindings(rf, ctx);
14212
- };
14213
- }
14214
- else {
14215
- definition.hostBindings = superHostBindings;
14216
- }
13873
+ /**
13874
+ * Creates an interpolation binding with 5 expressions.
13875
+ */
13876
+ function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
13877
+ const bindingIndex = getBindingIndex();
13878
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13879
+ different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
13880
+ incrementBindingIndex(5);
13881
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13882
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
13883
+ NO_CHANGE;
14217
13884
  }
14218
-
14219
13885
  /**
14220
- * @license
14221
- * Copyright Google LLC All Rights Reserved.
14222
- *
14223
- * Use of this source code is governed by an MIT-style license that can be
14224
- * found in the LICENSE file at https://angular.io/license
13886
+ * Creates an interpolation binding with 6 expressions.
14225
13887
  */
13888
+ function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
13889
+ const bindingIndex = getBindingIndex();
13890
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13891
+ different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
13892
+ incrementBindingIndex(6);
13893
+ return different ?
13894
+ prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
13895
+ renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
13896
+ NO_CHANGE;
13897
+ }
14226
13898
  /**
14227
- * Fields which exist on either directive or component definitions, and need to be copied from
14228
- * parent to child classes by the `ɵɵCopyDefinitionFeature`.
13899
+ * Creates an interpolation binding with 7 expressions.
14229
13900
  */
14230
- const COPY_DIRECTIVE_FIELDS = [
14231
- // The child class should use the providers of its parent.
14232
- 'providersResolver',
14233
- // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
14234
- // as inputs, outputs, and host binding functions.
14235
- ];
13901
+ function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
13902
+ const bindingIndex = getBindingIndex();
13903
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13904
+ different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
13905
+ incrementBindingIndex(7);
13906
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13907
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
13908
+ renderStringify(v5) + i5 + renderStringify(v6) + suffix :
13909
+ NO_CHANGE;
13910
+ }
14236
13911
  /**
14237
- * Fields which exist only on component definitions, and need to be copied from parent to child
14238
- * classes by the `ɵɵCopyDefinitionFeature`.
14239
- *
14240
- * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
14241
- * since those should go in `COPY_DIRECTIVE_FIELDS` above.
13912
+ * Creates an interpolation binding with 8 expressions.
14242
13913
  */
14243
- const COPY_COMPONENT_FIELDS = [
14244
- // The child class should use the template function of its parent, including all template
14245
- // semantics.
14246
- 'template',
14247
- 'decls',
14248
- 'consts',
14249
- 'vars',
14250
- 'onPush',
14251
- 'ngContentSelectors',
14252
- // The child class should use the CSS styles of its parent, including all styling semantics.
14253
- 'styles',
14254
- 'encapsulation',
14255
- // The child class should be checked by the runtime in the same way as its parent.
14256
- 'schemas',
14257
- ];
13914
+ function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
13915
+ const bindingIndex = getBindingIndex();
13916
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13917
+ different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
13918
+ incrementBindingIndex(8);
13919
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13920
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
13921
+ renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
13922
+ NO_CHANGE;
13923
+ }
13924
+
14258
13925
  /**
14259
- * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
14260
- * definition.
14261
13926
  *
14262
- * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
14263
- * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
14264
- * generates a skeleton definition on the child class, and applies this feature.
13927
+ * Update an interpolated attribute on an element with single bound value surrounded by text.
14265
13928
  *
14266
- * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
14267
- * including things like the component template function.
13929
+ * Used when the value passed to a property has 1 interpolated value in it:
14268
13930
  *
14269
- * @param definition The definition of a child class which inherits from a parent class with its
14270
- * own definition.
13931
+ * ```html
13932
+ * <div attr.title="prefix{{v0}}suffix"></div>
13933
+ * ```
13934
+ *
13935
+ * Its compiled representation is::
13936
+ *
13937
+ * ```ts
13938
+ * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
13939
+ * ```
14271
13940
  *
13941
+ * @param attrName The name of the attribute to update
13942
+ * @param prefix Static value used for concatenation only.
13943
+ * @param v0 Value checked for change.
13944
+ * @param suffix Static value used for concatenation only.
13945
+ * @param sanitizer An optional sanitizer function
13946
+ * @returns itself, so that it may be chained.
14272
13947
  * @codeGenApi
14273
13948
  */
14274
- function ɵɵCopyDefinitionFeature(definition) {
14275
- let superType = getSuperType(definition.type);
14276
- let superDef = undefined;
14277
- if (isComponentDef(definition)) {
14278
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14279
- superDef = superType.ɵcmp;
14280
- }
14281
- else {
14282
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14283
- superDef = superType.ɵdir;
14284
- }
14285
- // Needed because `definition` fields are readonly.
14286
- const defAny = definition;
14287
- // Copy over any fields that apply to either directives or components.
14288
- for (const field of COPY_DIRECTIVE_FIELDS) {
14289
- defAny[field] = superDef[field];
14290
- }
14291
- if (isComponentDef(superDef)) {
14292
- // Copy over any component-specific fields.
14293
- for (const field of COPY_COMPONENT_FIELDS) {
14294
- defAny[field] = superDef[field];
14295
- }
13949
+ function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
13950
+ const lView = getLView();
13951
+ const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
13952
+ if (interpolatedValue !== NO_CHANGE) {
13953
+ const tNode = getSelectedTNode();
13954
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13955
+ ngDevMode &&
13956
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
14296
13957
  }
13958
+ return ɵɵattributeInterpolate1;
14297
13959
  }
14298
-
14299
13960
  /**
14300
- * @license
14301
- * Copyright Google LLC All Rights Reserved.
14302
13961
  *
14303
- * Use of this source code is governed by an MIT-style license that can be
14304
- * found in the LICENSE file at https://angular.io/license
13962
+ * Update an interpolated attribute on an element with 2 bound values surrounded by text.
13963
+ *
13964
+ * Used when the value passed to a property has 2 interpolated values in it:
13965
+ *
13966
+ * ```html
13967
+ * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
13968
+ * ```
13969
+ *
13970
+ * Its compiled representation is::
13971
+ *
13972
+ * ```ts
13973
+ * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
13974
+ * ```
13975
+ *
13976
+ * @param attrName The name of the attribute to update
13977
+ * @param prefix Static value used for concatenation only.
13978
+ * @param v0 Value checked for change.
13979
+ * @param i0 Static value used for concatenation only.
13980
+ * @param v1 Value checked for change.
13981
+ * @param suffix Static value used for concatenation only.
13982
+ * @param sanitizer An optional sanitizer function
13983
+ * @returns itself, so that it may be chained.
13984
+ * @codeGenApi
14305
13985
  */
14306
- let _symbolIterator = null;
14307
- function getSymbolIterator() {
14308
- if (!_symbolIterator) {
14309
- const Symbol = _global['Symbol'];
14310
- if (Symbol && Symbol.iterator) {
14311
- _symbolIterator = Symbol.iterator;
14312
- }
14313
- else {
14314
- // es6-shim specific logic
14315
- const keys = Object.getOwnPropertyNames(Map.prototype);
14316
- for (let i = 0; i < keys.length; ++i) {
14317
- const key = keys[i];
14318
- if (key !== 'entries' && key !== 'size' &&
14319
- Map.prototype[key] === Map.prototype['entries']) {
14320
- _symbolIterator = key;
14321
- }
14322
- }
14323
- }
13986
+ function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
13987
+ const lView = getLView();
13988
+ const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
13989
+ if (interpolatedValue !== NO_CHANGE) {
13990
+ const tNode = getSelectedTNode();
13991
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13992
+ ngDevMode &&
13993
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
14324
13994
  }
14325
- return _symbolIterator;
13995
+ return ɵɵattributeInterpolate2;
14326
13996
  }
14327
-
14328
13997
  /**
14329
- * @license
14330
- * Copyright Google LLC All Rights Reserved.
14331
13998
  *
14332
- * Use of this source code is governed by an MIT-style license that can be
14333
- * found in the LICENSE file at https://angular.io/license
13999
+ * Update an interpolated attribute on an element with 3 bound values surrounded by text.
14000
+ *
14001
+ * Used when the value passed to a property has 3 interpolated values in it:
14002
+ *
14003
+ * ```html
14004
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
14005
+ * ```
14006
+ *
14007
+ * Its compiled representation is::
14008
+ *
14009
+ * ```ts
14010
+ * ɵɵattributeInterpolate3(
14011
+ * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
14012
+ * ```
14013
+ *
14014
+ * @param attrName The name of the attribute to update
14015
+ * @param prefix Static value used for concatenation only.
14016
+ * @param v0 Value checked for change.
14017
+ * @param i0 Static value used for concatenation only.
14018
+ * @param v1 Value checked for change.
14019
+ * @param i1 Static value used for concatenation only.
14020
+ * @param v2 Value checked for change.
14021
+ * @param suffix Static value used for concatenation only.
14022
+ * @param sanitizer An optional sanitizer function
14023
+ * @returns itself, so that it may be chained.
14024
+ * @codeGenApi
14334
14025
  */
14335
- function isIterable(obj) {
14336
- return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
14337
- }
14338
- function isListLikeIterable(obj) {
14339
- if (!isJsObject(obj))
14340
- return false;
14341
- return Array.isArray(obj) ||
14342
- (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
14343
- getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
14344
- }
14345
- function areIterablesEqual(a, b, comparator) {
14346
- const iterator1 = a[getSymbolIterator()]();
14347
- const iterator2 = b[getSymbolIterator()]();
14348
- while (true) {
14349
- const item1 = iterator1.next();
14350
- const item2 = iterator2.next();
14351
- if (item1.done && item2.done)
14352
- return true;
14353
- if (item1.done || item2.done)
14354
- return false;
14355
- if (!comparator(item1.value, item2.value))
14356
- return false;
14357
- }
14358
- }
14359
- function iterateListLike(obj, fn) {
14360
- if (Array.isArray(obj)) {
14361
- for (let i = 0; i < obj.length; i++) {
14362
- fn(obj[i]);
14363
- }
14364
- }
14365
- else {
14366
- const iterator = obj[getSymbolIterator()]();
14367
- let item;
14368
- while (!((item = iterator.next()).done)) {
14369
- fn(item.value);
14370
- }
14026
+ function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
14027
+ const lView = getLView();
14028
+ const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
14029
+ if (interpolatedValue !== NO_CHANGE) {
14030
+ const tNode = getSelectedTNode();
14031
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14032
+ ngDevMode &&
14033
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
14371
14034
  }
14035
+ return ɵɵattributeInterpolate3;
14372
14036
  }
14373
- function isJsObject(o) {
14374
- return o !== null && (typeof o === 'function' || typeof o === 'object');
14375
- }
14376
-
14377
14037
  /**
14378
- * @license
14379
- * Copyright Google LLC All Rights Reserved.
14380
14038
  *
14381
- * Use of this source code is governed by an MIT-style license that can be
14382
- * found in the LICENSE file at https://angular.io/license
14039
+ * Update an interpolated attribute on an element with 4 bound values surrounded by text.
14040
+ *
14041
+ * Used when the value passed to a property has 4 interpolated values in it:
14042
+ *
14043
+ * ```html
14044
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
14045
+ * ```
14046
+ *
14047
+ * Its compiled representation is::
14048
+ *
14049
+ * ```ts
14050
+ * ɵɵattributeInterpolate4(
14051
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
14052
+ * ```
14053
+ *
14054
+ * @param attrName The name of the attribute to update
14055
+ * @param prefix Static value used for concatenation only.
14056
+ * @param v0 Value checked for change.
14057
+ * @param i0 Static value used for concatenation only.
14058
+ * @param v1 Value checked for change.
14059
+ * @param i1 Static value used for concatenation only.
14060
+ * @param v2 Value checked for change.
14061
+ * @param i2 Static value used for concatenation only.
14062
+ * @param v3 Value checked for change.
14063
+ * @param suffix Static value used for concatenation only.
14064
+ * @param sanitizer An optional sanitizer function
14065
+ * @returns itself, so that it may be chained.
14066
+ * @codeGenApi
14383
14067
  */
14384
- function devModeEqual(a, b) {
14385
- const isListLikeIterableA = isListLikeIterable(a);
14386
- const isListLikeIterableB = isListLikeIterable(b);
14387
- if (isListLikeIterableA && isListLikeIterableB) {
14388
- return areIterablesEqual(a, b, devModeEqual);
14389
- }
14390
- else {
14391
- const isAObject = a && (typeof a === 'object' || typeof a === 'function');
14392
- const isBObject = b && (typeof b === 'object' || typeof b === 'function');
14393
- if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
14394
- return true;
14395
- }
14396
- else {
14397
- return Object.is(a, b);
14398
- }
14068
+ function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
14069
+ const lView = getLView();
14070
+ const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
14071
+ if (interpolatedValue !== NO_CHANGE) {
14072
+ const tNode = getSelectedTNode();
14073
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14074
+ ngDevMode &&
14075
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
14399
14076
  }
14077
+ return ɵɵattributeInterpolate4;
14400
14078
  }
14401
-
14402
14079
  /**
14403
- * @license
14404
- * Copyright Google LLC All Rights Reserved.
14405
14080
  *
14406
- * Use of this source code is governed by an MIT-style license that can be
14407
- * found in the LICENSE file at https://angular.io/license
14408
- */
14409
- // TODO(misko): consider inlining
14410
- /** Updates binding and returns the value. */
14411
- function updateBinding(lView, bindingIndex, value) {
14412
- return lView[bindingIndex] = value;
14413
- }
14414
- /** Gets the current binding value. */
14415
- function getBinding(lView, bindingIndex) {
14416
- ngDevMode && assertIndexInRange(lView, bindingIndex);
14417
- ngDevMode &&
14418
- assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
14419
- return lView[bindingIndex];
14420
- }
14421
- /**
14422
- * Updates binding if changed, then returns whether it was updated.
14423
- *
14424
- * This function also checks the `CheckNoChangesMode` and throws if changes are made.
14425
- * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
14426
- * behavior.
14427
- *
14428
- * @param lView current `LView`
14429
- * @param bindingIndex The binding in the `LView` to check
14430
- * @param value New value to check against `lView[bindingIndex]`
14431
- * @returns `true` if the bindings has changed. (Throws if binding has changed during
14432
- * `CheckNoChangesMode`)
14433
- */
14434
- function bindingUpdated(lView, bindingIndex, value) {
14435
- ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
14436
- ngDevMode &&
14437
- assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
14438
- const oldValue = lView[bindingIndex];
14439
- if (Object.is(oldValue, value)) {
14440
- return false;
14441
- }
14442
- else {
14443
- if (ngDevMode && isInCheckNoChangesMode()) {
14444
- // View engine didn't report undefined values as changed on the first checkNoChanges pass
14445
- // (before the change detection was run).
14446
- const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
14447
- if (!devModeEqual(oldValueToCompare, value)) {
14448
- const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
14449
- throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
14450
- }
14451
- // There was a change, but the `devModeEqual` decided that the change is exempt from an error.
14452
- // For this reason we exit as if no change. The early exit is needed to prevent the changed
14453
- // value to be written into `LView` (If we would write the new value that we would not see it
14454
- // as change on next CD.)
14455
- return false;
14456
- }
14457
- lView[bindingIndex] = value;
14458
- return true;
14459
- }
14460
- }
14461
- /** Updates 2 bindings if changed, then returns whether either was updated. */
14462
- function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
14463
- const different = bindingUpdated(lView, bindingIndex, exp1);
14464
- return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
14465
- }
14466
- /** Updates 3 bindings if changed, then returns whether any was updated. */
14467
- function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
14468
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
14469
- return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
14470
- }
14471
- /** Updates 4 bindings if changed, then returns whether any was updated. */
14472
- function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
14473
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
14474
- return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
14475
- }
14476
-
14477
- /**
14478
- * @license
14479
- * Copyright Google LLC All Rights Reserved.
14480
- *
14481
- * Use of this source code is governed by an MIT-style license that can be
14482
- * found in the LICENSE file at https://angular.io/license
14483
- */
14484
- /**
14485
- * Updates the value of or removes a bound attribute on an Element.
14486
- *
14487
- * Used in the case of `[attr.title]="value"`
14488
- *
14489
- * @param name name The name of the attribute.
14490
- * @param value value The attribute is removed when value is `null` or `undefined`.
14491
- * Otherwise the attribute value is set to the stringified value.
14492
- * @param sanitizer An optional function used to sanitize the value.
14493
- * @param namespace Optional namespace to use when setting the attribute.
14494
- *
14495
- * @codeGenApi
14496
- */
14497
- function ɵɵattribute(name, value, sanitizer, namespace) {
14498
- const lView = getLView();
14499
- const bindingIndex = nextBindingIndex();
14500
- if (bindingUpdated(lView, bindingIndex, value)) {
14501
- const tView = getTView();
14502
- const tNode = getSelectedTNode();
14503
- elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
14504
- ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
14505
- }
14506
- return ɵɵattribute;
14507
- }
14508
-
14509
- /**
14510
- * @license
14511
- * Copyright Google LLC All Rights Reserved.
14512
- *
14513
- * Use of this source code is governed by an MIT-style license that can be
14514
- * found in the LICENSE file at https://angular.io/license
14515
- */
14516
- /**
14517
- * Create interpolation bindings with a variable number of expressions.
14518
- *
14519
- * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
14520
- * Those are faster because there is no need to create an array of expressions and iterate over it.
14521
- *
14522
- * `values`:
14523
- * - has static text at even indexes,
14524
- * - has evaluated expressions at odd indexes.
14525
- *
14526
- * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
14527
- */
14528
- function interpolationV(lView, values) {
14529
- ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
14530
- ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
14531
- let isBindingUpdated = false;
14532
- let bindingIndex = getBindingIndex();
14533
- for (let i = 1; i < values.length; i += 2) {
14534
- // Check if bindings (odd indexes) have changed
14535
- isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
14536
- }
14537
- setBindingIndex(bindingIndex);
14538
- if (!isBindingUpdated) {
14539
- return NO_CHANGE;
14540
- }
14541
- // Build the updated content
14542
- let content = values[0];
14543
- for (let i = 1; i < values.length; i += 2) {
14544
- content += renderStringify(values[i]) + values[i + 1];
14545
- }
14546
- return content;
14547
- }
14548
- /**
14549
- * Creates an interpolation binding with 1 expression.
14550
- *
14551
- * @param prefix static value used for concatenation only.
14552
- * @param v0 value checked for change.
14553
- * @param suffix static value used for concatenation only.
14554
- */
14555
- function interpolation1(lView, prefix, v0, suffix) {
14556
- const different = bindingUpdated(lView, nextBindingIndex(), v0);
14557
- return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
14558
- }
14559
- /**
14560
- * Creates an interpolation binding with 2 expressions.
14561
- */
14562
- function interpolation2(lView, prefix, v0, i0, v1, suffix) {
14563
- const bindingIndex = getBindingIndex();
14564
- const different = bindingUpdated2(lView, bindingIndex, v0, v1);
14565
- incrementBindingIndex(2);
14566
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
14567
- }
14568
- /**
14569
- * Creates an interpolation binding with 3 expressions.
14570
- */
14571
- function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
14572
- const bindingIndex = getBindingIndex();
14573
- const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
14574
- incrementBindingIndex(3);
14575
- return different ?
14576
- prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
14577
- NO_CHANGE;
14578
- }
14579
- /**
14580
- * Create an interpolation binding with 4 expressions.
14581
- */
14582
- function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
14583
- const bindingIndex = getBindingIndex();
14584
- const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14585
- incrementBindingIndex(4);
14586
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14587
- renderStringify(v2) + i2 + renderStringify(v3) + suffix :
14588
- NO_CHANGE;
14589
- }
14590
- /**
14591
- * Creates an interpolation binding with 5 expressions.
14592
- */
14593
- function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
14594
- const bindingIndex = getBindingIndex();
14595
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14596
- different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
14597
- incrementBindingIndex(5);
14598
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14599
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
14600
- NO_CHANGE;
14601
- }
14602
- /**
14603
- * Creates an interpolation binding with 6 expressions.
14604
- */
14605
- function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
14606
- const bindingIndex = getBindingIndex();
14607
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14608
- different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
14609
- incrementBindingIndex(6);
14610
- return different ?
14611
- prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
14612
- renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
14613
- NO_CHANGE;
14614
- }
14615
- /**
14616
- * Creates an interpolation binding with 7 expressions.
14617
- */
14618
- function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
14619
- const bindingIndex = getBindingIndex();
14620
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14621
- different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
14622
- incrementBindingIndex(7);
14623
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14624
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
14625
- renderStringify(v5) + i5 + renderStringify(v6) + suffix :
14626
- NO_CHANGE;
14627
- }
14628
- /**
14629
- * Creates an interpolation binding with 8 expressions.
14630
- */
14631
- function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
14632
- const bindingIndex = getBindingIndex();
14633
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14634
- different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
14635
- incrementBindingIndex(8);
14636
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14637
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
14638
- renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
14639
- NO_CHANGE;
14640
- }
14641
-
14642
- /**
14643
- *
14644
- * Update an interpolated attribute on an element with single bound value surrounded by text.
14081
+ * Update an interpolated attribute on an element with 5 bound values surrounded by text.
14645
14082
  *
14646
- * Used when the value passed to a property has 1 interpolated value in it:
14083
+ * Used when the value passed to a property has 5 interpolated values in it:
14647
14084
  *
14648
14085
  * ```html
14649
- * <div attr.title="prefix{{v0}}suffix"></div>
14086
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
14650
14087
  * ```
14651
14088
  *
14652
14089
  * Its compiled representation is::
14653
14090
  *
14654
14091
  * ```ts
14655
- * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
14092
+ * ɵɵattributeInterpolate5(
14093
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
14656
14094
  * ```
14657
14095
  *
14658
14096
  * @param attrName The name of the attribute to update
14659
14097
  * @param prefix Static value used for concatenation only.
14660
14098
  * @param v0 Value checked for change.
14099
+ * @param i0 Static value used for concatenation only.
14100
+ * @param v1 Value checked for change.
14101
+ * @param i1 Static value used for concatenation only.
14102
+ * @param v2 Value checked for change.
14103
+ * @param i2 Static value used for concatenation only.
14104
+ * @param v3 Value checked for change.
14105
+ * @param i3 Static value used for concatenation only.
14106
+ * @param v4 Value checked for change.
14661
14107
  * @param suffix Static value used for concatenation only.
14662
14108
  * @param sanitizer An optional sanitizer function
14663
14109
  * @returns itself, so that it may be chained.
14664
14110
  * @codeGenApi
14665
14111
  */
14666
- function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
14112
+ function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
14667
14113
  const lView = getLView();
14668
- const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
14114
+ const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
14669
14115
  if (interpolatedValue !== NO_CHANGE) {
14670
14116
  const tNode = getSelectedTNode();
14671
14117
  elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14672
14118
  ngDevMode &&
14673
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
14119
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
14674
14120
  }
14675
- return ɵɵattributeInterpolate1;
14121
+ return ɵɵattributeInterpolate5;
14676
14122
  }
14677
14123
  /**
14678
14124
  *
14679
- * Update an interpolated attribute on an element with 2 bound values surrounded by text.
14125
+ * Update an interpolated attribute on an element with 6 bound values surrounded by text.
14680
14126
  *
14681
- * Used when the value passed to a property has 2 interpolated values in it:
14127
+ * Used when the value passed to a property has 6 interpolated values in it:
14682
14128
  *
14683
14129
  * ```html
14684
- * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
14685
- * ```
14686
- *
14687
- * Its compiled representation is::
14688
- *
14689
- * ```ts
14690
- * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
14691
- * ```
14692
- *
14693
- * @param attrName The name of the attribute to update
14694
- * @param prefix Static value used for concatenation only.
14695
- * @param v0 Value checked for change.
14696
- * @param i0 Static value used for concatenation only.
14697
- * @param v1 Value checked for change.
14698
- * @param suffix Static value used for concatenation only.
14699
- * @param sanitizer An optional sanitizer function
14700
- * @returns itself, so that it may be chained.
14701
- * @codeGenApi
14702
- */
14703
- function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
14704
- const lView = getLView();
14705
- const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
14706
- if (interpolatedValue !== NO_CHANGE) {
14707
- const tNode = getSelectedTNode();
14708
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14709
- ngDevMode &&
14710
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
14711
- }
14712
- return ɵɵattributeInterpolate2;
14713
- }
14714
- /**
14715
- *
14716
- * Update an interpolated attribute on an element with 3 bound values surrounded by text.
14717
- *
14718
- * Used when the value passed to a property has 3 interpolated values in it:
14719
- *
14720
- * ```html
14721
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
14722
- * ```
14723
- *
14724
- * Its compiled representation is::
14725
- *
14726
- * ```ts
14727
- * ɵɵattributeInterpolate3(
14728
- * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
14729
- * ```
14730
- *
14731
- * @param attrName The name of the attribute to update
14732
- * @param prefix Static value used for concatenation only.
14733
- * @param v0 Value checked for change.
14734
- * @param i0 Static value used for concatenation only.
14735
- * @param v1 Value checked for change.
14736
- * @param i1 Static value used for concatenation only.
14737
- * @param v2 Value checked for change.
14738
- * @param suffix Static value used for concatenation only.
14739
- * @param sanitizer An optional sanitizer function
14740
- * @returns itself, so that it may be chained.
14741
- * @codeGenApi
14742
- */
14743
- function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
14744
- const lView = getLView();
14745
- const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
14746
- if (interpolatedValue !== NO_CHANGE) {
14747
- const tNode = getSelectedTNode();
14748
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14749
- ngDevMode &&
14750
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
14751
- }
14752
- return ɵɵattributeInterpolate3;
14753
- }
14754
- /**
14755
- *
14756
- * Update an interpolated attribute on an element with 4 bound values surrounded by text.
14757
- *
14758
- * Used when the value passed to a property has 4 interpolated values in it:
14759
- *
14760
- * ```html
14761
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
14762
- * ```
14763
- *
14764
- * Its compiled representation is::
14765
- *
14766
- * ```ts
14767
- * ɵɵattributeInterpolate4(
14768
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
14769
- * ```
14770
- *
14771
- * @param attrName The name of the attribute to update
14772
- * @param prefix Static value used for concatenation only.
14773
- * @param v0 Value checked for change.
14774
- * @param i0 Static value used for concatenation only.
14775
- * @param v1 Value checked for change.
14776
- * @param i1 Static value used for concatenation only.
14777
- * @param v2 Value checked for change.
14778
- * @param i2 Static value used for concatenation only.
14779
- * @param v3 Value checked for change.
14780
- * @param suffix Static value used for concatenation only.
14781
- * @param sanitizer An optional sanitizer function
14782
- * @returns itself, so that it may be chained.
14783
- * @codeGenApi
14784
- */
14785
- function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
14786
- const lView = getLView();
14787
- const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
14788
- if (interpolatedValue !== NO_CHANGE) {
14789
- const tNode = getSelectedTNode();
14790
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14791
- ngDevMode &&
14792
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
14793
- }
14794
- return ɵɵattributeInterpolate4;
14795
- }
14796
- /**
14797
- *
14798
- * Update an interpolated attribute on an element with 5 bound values surrounded by text.
14799
- *
14800
- * Used when the value passed to a property has 5 interpolated values in it:
14801
- *
14802
- * ```html
14803
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
14804
- * ```
14805
- *
14806
- * Its compiled representation is::
14807
- *
14808
- * ```ts
14809
- * ɵɵattributeInterpolate5(
14810
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
14811
- * ```
14812
- *
14813
- * @param attrName The name of the attribute to update
14814
- * @param prefix Static value used for concatenation only.
14815
- * @param v0 Value checked for change.
14816
- * @param i0 Static value used for concatenation only.
14817
- * @param v1 Value checked for change.
14818
- * @param i1 Static value used for concatenation only.
14819
- * @param v2 Value checked for change.
14820
- * @param i2 Static value used for concatenation only.
14821
- * @param v3 Value checked for change.
14822
- * @param i3 Static value used for concatenation only.
14823
- * @param v4 Value checked for change.
14824
- * @param suffix Static value used for concatenation only.
14825
- * @param sanitizer An optional sanitizer function
14826
- * @returns itself, so that it may be chained.
14827
- * @codeGenApi
14828
- */
14829
- function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
14830
- const lView = getLView();
14831
- const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
14832
- if (interpolatedValue !== NO_CHANGE) {
14833
- const tNode = getSelectedTNode();
14834
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14835
- ngDevMode &&
14836
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
14837
- }
14838
- return ɵɵattributeInterpolate5;
14839
- }
14840
- /**
14841
- *
14842
- * Update an interpolated attribute on an element with 6 bound values surrounded by text.
14843
- *
14844
- * Used when the value passed to a property has 6 interpolated values in it:
14845
- *
14846
- * ```html
14847
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
14130
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
14848
14131
  * ```
14849
14132
  *
14850
14133
  * Its compiled representation is::
@@ -15024,6 +14307,57 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
15024
14307
  return ɵɵattributeInterpolateV;
15025
14308
  }
15026
14309
 
14310
+ /**
14311
+ * @license
14312
+ * Copyright Google LLC All Rights Reserved.
14313
+ *
14314
+ * Use of this source code is governed by an MIT-style license that can be
14315
+ * found in the LICENSE file at https://angular.io/license
14316
+ */
14317
+ /**
14318
+ * Synchronously perform change detection on a component (and possibly its sub-components).
14319
+ *
14320
+ * This function triggers change detection in a synchronous way on a component.
14321
+ *
14322
+ * @param component The component which the change detection should be performed on.
14323
+ */
14324
+ function detectChanges(component) {
14325
+ const view = getComponentViewByInstance(component);
14326
+ detectChangesInternal(view[TVIEW], view, component);
14327
+ }
14328
+ /**
14329
+ * Marks the component as dirty (needing change detection). Marking a component dirty will
14330
+ * schedule a change detection on it at some point in the future.
14331
+ *
14332
+ * Marking an already dirty component as dirty won't do anything. Only one outstanding change
14333
+ * detection can be scheduled per component tree.
14334
+ *
14335
+ * @param component Component to mark as dirty.
14336
+ */
14337
+ function markDirty(component) {
14338
+ ngDevMode && assertDefined(component, 'component');
14339
+ const rootView = markViewDirty(getComponentViewByInstance(component));
14340
+ ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
14341
+ scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
14342
+ }
14343
+ /**
14344
+ * Used to perform change detection on the whole application.
14345
+ *
14346
+ * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
14347
+ * executes lifecycle hooks and conditionally checks components based on their
14348
+ * `ChangeDetectionStrategy` and dirtiness.
14349
+ *
14350
+ * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
14351
+ * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
14352
+ * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
14353
+ * be changed when calling `renderComponent` and providing the `scheduler` option.
14354
+ */
14355
+ function tick(component) {
14356
+ const rootView = getRootView(component);
14357
+ const rootContext = rootView[CONTEXT];
14358
+ tickRootContext(rootContext);
14359
+ }
14360
+
15027
14361
  /**
15028
14362
  * @license
15029
14363
  * Copyright Google LLC All Rights Reserved.
@@ -15568,51 +14902,42 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
15568
14902
  tNode.index;
15569
14903
  // In order to match current behavior, native DOM event listeners must be added for all
15570
14904
  // events (including outputs).
15571
- if (isProceduralRenderer(renderer)) {
15572
- // There might be cases where multiple directives on the same element try to register an event
15573
- // handler function for the same event. In this situation we want to avoid registration of
15574
- // several native listeners as each registration would be intercepted by NgZone and
15575
- // trigger change detection. This would mean that a single user action would result in several
15576
- // change detections being invoked. To avoid this situation we want to have only one call to
15577
- // native handler registration (for the same element and same type of event).
15578
- //
15579
- // In order to have just one native event handler in presence of multiple handler functions,
15580
- // we just register a first handler function as a native event listener and then chain
15581
- // (coalesce) other handler functions on top of the first native handler function.
15582
- let existingListener = null;
15583
- // Please note that the coalescing described here doesn't happen for events specifying an
15584
- // alternative target (ex. (document:click)) - this is to keep backward compatibility with the
15585
- // view engine.
15586
- // Also, we don't have to search for existing listeners is there are no directives
15587
- // matching on a given node as we can't register multiple event handlers for the same event in
15588
- // a template (this would mean having duplicate attributes).
15589
- if (!eventTargetResolver && isTNodeDirectiveHost) {
15590
- existingListener = findExistingListener(tView, lView, eventName, tNode.index);
15591
- }
15592
- if (existingListener !== null) {
15593
- // Attach a new listener to coalesced listeners list, maintaining the order in which
15594
- // listeners are registered. For performance reasons, we keep a reference to the last
15595
- // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
15596
- // the entire set each time we need to add a new listener.
15597
- const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
15598
- lastListenerFn.__ngNextListenerFn__ = listenerFn;
15599
- existingListener.__ngLastListenerFn__ = listenerFn;
15600
- processOutputs = false;
15601
- }
15602
- else {
15603
- listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
15604
- const cleanupFn = renderer.listen(target, eventName, listenerFn);
15605
- ngDevMode && ngDevMode.rendererAddEventListener++;
15606
- lCleanup.push(listenerFn, cleanupFn);
15607
- tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
15608
- }
14905
+ // There might be cases where multiple directives on the same element try to register an event
14906
+ // handler function for the same event. In this situation we want to avoid registration of
14907
+ // several native listeners as each registration would be intercepted by NgZone and
14908
+ // trigger change detection. This would mean that a single user action would result in several
14909
+ // change detections being invoked. To avoid this situation we want to have only one call to
14910
+ // native handler registration (for the same element and same type of event).
14911
+ //
14912
+ // In order to have just one native event handler in presence of multiple handler functions,
14913
+ // we just register a first handler function as a native event listener and then chain
14914
+ // (coalesce) other handler functions on top of the first native handler function.
14915
+ let existingListener = null;
14916
+ // Please note that the coalescing described here doesn't happen for events specifying an
14917
+ // alternative target (ex. (document:click)) - this is to keep backward compatibility with the
14918
+ // view engine.
14919
+ // Also, we don't have to search for existing listeners is there are no directives
14920
+ // matching on a given node as we can't register multiple event handlers for the same event in
14921
+ // a template (this would mean having duplicate attributes).
14922
+ if (!eventTargetResolver && isTNodeDirectiveHost) {
14923
+ existingListener = findExistingListener(tView, lView, eventName, tNode.index);
14924
+ }
14925
+ if (existingListener !== null) {
14926
+ // Attach a new listener to coalesced listeners list, maintaining the order in which
14927
+ // listeners are registered. For performance reasons, we keep a reference to the last
14928
+ // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
14929
+ // the entire set each time we need to add a new listener.
14930
+ const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
14931
+ lastListenerFn.__ngNextListenerFn__ = listenerFn;
14932
+ existingListener.__ngLastListenerFn__ = listenerFn;
14933
+ processOutputs = false;
15609
14934
  }
15610
14935
  else {
15611
- listenerFn = wrapListener(tNode, lView, context, listenerFn, true /** preventDefault */);
15612
- target.addEventListener(eventName, listenerFn, useCapture);
14936
+ listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
14937
+ const cleanupFn = renderer.listen(target, eventName, listenerFn);
15613
14938
  ngDevMode && ngDevMode.rendererAddEventListener++;
15614
- lCleanup.push(listenerFn);
15615
- tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, useCapture);
14939
+ lCleanup.push(listenerFn, cleanupFn);
14940
+ tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
15616
14941
  }
15617
14942
  }
15618
14943
  else {
@@ -17686,7 +17011,7 @@ function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
17686
17011
  valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
17687
17012
  }
17688
17013
  let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
17689
- key === prop ? valueAtLViewIndex : undefined;
17014
+ (key === prop ? valueAtLViewIndex : undefined);
17690
17015
  if (containsStatics && !isStylingValuePresent(currentValue)) {
17691
17016
  currentValue = keyValueArrayGet(rawKey, prop);
17692
17017
  }
@@ -19209,7 +18534,7 @@ function findLocaleData(locale) {
19209
18534
  if (parentLocale === 'en') {
19210
18535
  return localeEn;
19211
18536
  }
19212
- throw new Error(`Missing locale data for the locale "${locale}".`);
18537
+ throw new RuntimeError(701 /* RuntimeErrorCode.MISSING_LOCALE_DATA */, ngDevMode && `Missing locale data for the locale "${locale}".`);
19213
18538
  }
19214
18539
  /**
19215
18540
  * Retrieves the default currency code for the given locale.
@@ -21539,7 +20864,7 @@ function noComponentFactoryError(component) {
21539
20864
  return error;
21540
20865
  }
21541
20866
  const ERROR_COMPONENT = 'ngComponent';
21542
- function getComponent(error) {
20867
+ function getComponent$1(error) {
21543
20868
  return error[ERROR_COMPONENT];
21544
20869
  }
21545
20870
  class _NullComponentFactoryResolver {
@@ -21723,14 +21048,6 @@ class Renderer2 {
21723
21048
  * @nocollapse
21724
21049
  */
21725
21050
  Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
21726
- /** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
21727
- function getOrCreateRenderer2(lView) {
21728
- const renderer = lView[RENDERER];
21729
- if (ngDevMode && !isProceduralRenderer(renderer)) {
21730
- throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
21731
- }
21732
- return renderer;
21733
- }
21734
21051
  /** Injects a Renderer2 for the current component. */
21735
21052
  function injectRenderer2() {
21736
21053
  // We need the Renderer to be based on the component that it's being injected into, however since
@@ -21738,7 +21055,7 @@ function injectRenderer2() {
21738
21055
  const lView = getLView();
21739
21056
  const tNode = getCurrentTNode();
21740
21057
  const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
21741
- return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);
21058
+ return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
21742
21059
  }
21743
21060
 
21744
21061
  /**
@@ -21785,7 +21102,7 @@ class Version {
21785
21102
  /**
21786
21103
  * @publicApi
21787
21104
  */
21788
- const VERSION = new Version('14.1.0-next.1');
21105
+ const VERSION = new Version('14.1.0-next.4');
21789
21106
 
21790
21107
  /**
21791
21108
  * @license
@@ -22123,8 +21440,7 @@ class ViewRef$1 {
22123
21440
  }
22124
21441
  attachToViewContainerRef() {
22125
21442
  if (this._appRef) {
22126
- const errorMessage = ngDevMode ? 'This view is already attached directly to the ApplicationRef!' : '';
22127
- throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
21443
+ throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached directly to the ApplicationRef!');
22128
21444
  }
22129
21445
  this._attachedToViewContainer = true;
22130
21446
  }
@@ -22134,8 +21450,7 @@ class ViewRef$1 {
22134
21450
  }
22135
21451
  attachToAppRef(appRef) {
22136
21452
  if (this._attachedToViewContainer) {
22137
- const errorMessage = ngDevMode ? 'This view is already attached to a ViewContainer!' : '';
22138
- throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, errorMessage);
21453
+ throw new RuntimeError(902 /* RuntimeErrorCode.VIEW_ALREADY_ATTACHED */, ngDevMode && 'This view is already attached to a ViewContainer!');
22139
21454
  }
22140
21455
  this._appRef = appRef;
22141
21456
  }
@@ -22166,367 +21481,811 @@ class RootViewRef extends ViewRef$1 {
22166
21481
  * Use of this source code is governed by an MIT-style license that can be
22167
21482
  * found in the LICENSE file at https://angular.io/license
22168
21483
  */
22169
- class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
22170
- /**
22171
- * @param ngModule The NgModuleRef to which all resolved factories are bound.
22172
- */
22173
- constructor(ngModule) {
22174
- super();
22175
- this.ngModule = ngModule;
22176
- }
22177
- resolveComponentFactory(component) {
22178
- ngDevMode && assertComponentType(component);
22179
- const componentDef = getComponentDef(component);
22180
- return new ComponentFactory(componentDef, this.ngModule);
22181
- }
22182
- }
22183
- function toRefArray(map) {
22184
- const array = [];
22185
- for (let nonMinified in map) {
22186
- if (map.hasOwnProperty(nonMinified)) {
22187
- const minified = map[nonMinified];
22188
- array.push({ propName: minified, templateName: nonMinified });
21484
+ class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
21485
+ /**
21486
+ * @param ngModule The NgModuleRef to which all resolved factories are bound.
21487
+ */
21488
+ constructor(ngModule) {
21489
+ super();
21490
+ this.ngModule = ngModule;
21491
+ }
21492
+ resolveComponentFactory(component) {
21493
+ ngDevMode && assertComponentType(component);
21494
+ const componentDef = getComponentDef(component);
21495
+ return new ComponentFactory(componentDef, this.ngModule);
21496
+ }
21497
+ }
21498
+ function toRefArray(map) {
21499
+ const array = [];
21500
+ for (let nonMinified in map) {
21501
+ if (map.hasOwnProperty(nonMinified)) {
21502
+ const minified = map[nonMinified];
21503
+ array.push({ propName: minified, templateName: nonMinified });
21504
+ }
21505
+ }
21506
+ return array;
21507
+ }
21508
+ function getNamespace(elementName) {
21509
+ const name = elementName.toLowerCase();
21510
+ return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
21511
+ }
21512
+ /**
21513
+ * Injector that looks up a value using a specific injector, before falling back to the module
21514
+ * injector. Used primarily when creating components or embedded views dynamically.
21515
+ */
21516
+ class ChainedInjector {
21517
+ constructor(injector, parentInjector) {
21518
+ this.injector = injector;
21519
+ this.parentInjector = parentInjector;
21520
+ }
21521
+ get(token, notFoundValue, flags) {
21522
+ const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
21523
+ if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
21524
+ notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
21525
+ // Return the value from the root element injector when
21526
+ // - it provides it
21527
+ // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21528
+ // - the module injector should not be checked
21529
+ // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21530
+ return value;
21531
+ }
21532
+ return this.parentInjector.get(token, notFoundValue, flags);
21533
+ }
21534
+ }
21535
+ /**
21536
+ * Render3 implementation of {@link viewEngine_ComponentFactory}.
21537
+ */
21538
+ class ComponentFactory extends ComponentFactory$1 {
21539
+ /**
21540
+ * @param componentDef The component definition.
21541
+ * @param ngModule The NgModuleRef to which the factory is bound.
21542
+ */
21543
+ constructor(componentDef, ngModule) {
21544
+ super();
21545
+ this.componentDef = componentDef;
21546
+ this.ngModule = ngModule;
21547
+ this.componentType = componentDef.type;
21548
+ this.selector = stringifyCSSSelectorList(componentDef.selectors);
21549
+ this.ngContentSelectors =
21550
+ componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
21551
+ this.isBoundToModule = !!ngModule;
21552
+ }
21553
+ get inputs() {
21554
+ return toRefArray(this.componentDef.inputs);
21555
+ }
21556
+ get outputs() {
21557
+ return toRefArray(this.componentDef.outputs);
21558
+ }
21559
+ create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
21560
+ environmentInjector = environmentInjector || this.ngModule;
21561
+ let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
21562
+ environmentInjector :
21563
+ environmentInjector?.injector;
21564
+ if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
21565
+ realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
21566
+ realEnvironmentInjector;
21567
+ }
21568
+ const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
21569
+ const rendererFactory = rootViewInjector.get(RendererFactory2, null);
21570
+ if (rendererFactory === null) {
21571
+ throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&
21572
+ 'Angular was not able to inject a renderer (RendererFactory2). ' +
21573
+ 'Likely this is due to a broken DI hierarchy. ' +
21574
+ 'Make sure that any injector used to create this component has a correct parent.');
21575
+ }
21576
+ const sanitizer = rootViewInjector.get(Sanitizer, null);
21577
+ const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
21578
+ // Determine a tag name used for creating host elements when this component is created
21579
+ // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
21580
+ const elementName = this.componentDef.selectors[0][0] || 'div';
21581
+ const hostRNode = rootSelectorOrNode ?
21582
+ locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
21583
+ createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
21584
+ const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
21585
+ 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
21586
+ const rootContext = createRootContext();
21587
+ // Create the root view. Uses empty TView and ContentTemplate.
21588
+ const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
21589
+ const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
21590
+ // rootView is the parent when bootstrapping
21591
+ // TODO(misko): it looks like we are entering view here but we don't really need to as
21592
+ // `renderView` does that. However as the code is written it is needed because
21593
+ // `createRootComponentView` and `createRootComponent` both read global state. Fixing those
21594
+ // issues would allow us to drop this.
21595
+ enterView(rootLView);
21596
+ let component;
21597
+ let tElementNode;
21598
+ try {
21599
+ const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
21600
+ if (hostRNode) {
21601
+ if (rootSelectorOrNode) {
21602
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
21603
+ }
21604
+ else {
21605
+ // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
21606
+ // is not defined), also apply attributes and classes extracted from component selector.
21607
+ // Extract attributes and classes from the first selector only to match VE behavior.
21608
+ const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
21609
+ if (attrs) {
21610
+ setUpAttributes(hostRenderer, hostRNode, attrs);
21611
+ }
21612
+ if (classes && classes.length > 0) {
21613
+ writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
21614
+ }
21615
+ }
21616
+ }
21617
+ tElementNode = getTNode(rootTView, HEADER_OFFSET);
21618
+ if (projectableNodes !== undefined) {
21619
+ const projection = tElementNode.projection = [];
21620
+ for (let i = 0; i < this.ngContentSelectors.length; i++) {
21621
+ const nodesforSlot = projectableNodes[i];
21622
+ // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
21623
+ // case). Here we do normalize passed data structure to be an array of arrays to avoid
21624
+ // complex checks down the line.
21625
+ // We also normalize the length of the passed in projectable nodes (to match the number of
21626
+ // <ng-container> slots defined by a component).
21627
+ projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
21628
+ }
21629
+ }
21630
+ // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
21631
+ // executed here?
21632
+ // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
21633
+ component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
21634
+ renderView(rootTView, rootLView, null);
21635
+ }
21636
+ finally {
21637
+ leaveView();
21638
+ }
21639
+ return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
21640
+ }
21641
+ }
21642
+ const componentFactoryResolver = new ComponentFactoryResolver();
21643
+ /**
21644
+ * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
21645
+ * ComponentFactoryResolver
21646
+ * already exists, retrieves the existing ComponentFactoryResolver.
21647
+ *
21648
+ * @returns The ComponentFactoryResolver instance to use
21649
+ */
21650
+ function injectComponentFactoryResolver() {
21651
+ return componentFactoryResolver;
21652
+ }
21653
+ /**
21654
+ * Represents an instance of a Component created via a {@link ComponentFactory}.
21655
+ *
21656
+ * `ComponentRef` provides access to the Component Instance as well other objects related to this
21657
+ * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
21658
+ * method.
21659
+ *
21660
+ */
21661
+ class ComponentRef extends ComponentRef$1 {
21662
+ constructor(componentType, instance, location, _rootLView, _tNode) {
21663
+ super();
21664
+ this.location = location;
21665
+ this._rootLView = _rootLView;
21666
+ this._tNode = _tNode;
21667
+ this.instance = instance;
21668
+ this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
21669
+ this.componentType = componentType;
21670
+ }
21671
+ setInput(name, value) {
21672
+ const inputData = this._tNode.inputs;
21673
+ let dataValue;
21674
+ if (inputData !== null && (dataValue = inputData[name])) {
21675
+ const lView = this._rootLView;
21676
+ setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
21677
+ markDirtyIfOnPush(lView, this._tNode.index);
21678
+ }
21679
+ else {
21680
+ if (ngDevMode) {
21681
+ const cmpNameForError = stringifyForError(this.componentType);
21682
+ let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
21683
+ message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
21684
+ reportUnknownPropertyError(message);
21685
+ }
21686
+ }
21687
+ }
21688
+ get injector() {
21689
+ return new NodeInjector(this._tNode, this._rootLView);
21690
+ }
21691
+ destroy() {
21692
+ this.hostView.destroy();
21693
+ }
21694
+ onDestroy(callback) {
21695
+ this.hostView.onDestroy(callback);
21696
+ }
21697
+ }
21698
+
21699
+ /**
21700
+ * @license
21701
+ * Copyright Google LLC All Rights Reserved.
21702
+ *
21703
+ * Use of this source code is governed by an MIT-style license that can be
21704
+ * found in the LICENSE file at https://angular.io/license
21705
+ */
21706
+ /**
21707
+ * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
21708
+ * @param ngModule NgModule class.
21709
+ * @param parentInjector Optional injector instance to use as a parent for the module injector. If
21710
+ * not provided, `NullInjector` will be used instead.
21711
+ * @publicApi
21712
+ */
21713
+ function createNgModuleRef(ngModule, parentInjector) {
21714
+ return new NgModuleRef(ngModule, parentInjector ?? null);
21715
+ }
21716
+ class NgModuleRef extends NgModuleRef$1 {
21717
+ constructor(ngModuleType, _parent) {
21718
+ super();
21719
+ this._parent = _parent;
21720
+ // tslint:disable-next-line:require-internal-with-underscore
21721
+ this._bootstrapComponents = [];
21722
+ this.injector = this;
21723
+ this.destroyCbs = [];
21724
+ // When bootstrapping a module we have a dependency graph that looks like this:
21725
+ // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
21726
+ // module being resolved tries to inject the ComponentFactoryResolver, it'll create a
21727
+ // circular dependency which will result in a runtime error, because the injector doesn't
21728
+ // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
21729
+ // and providing it, rather than letting the injector resolve it.
21730
+ this.componentFactoryResolver = new ComponentFactoryResolver(this);
21731
+ const ngModuleDef = getNgModuleDef(ngModuleType);
21732
+ ngDevMode &&
21733
+ assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
21734
+ this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
21735
+ this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
21736
+ { provide: NgModuleRef$1, useValue: this }, {
21737
+ provide: ComponentFactoryResolver$1,
21738
+ useValue: this.componentFactoryResolver
21739
+ }
21740
+ ], stringify(ngModuleType), new Set(['environment']));
21741
+ // We need to resolve the injector types separately from the injector creation, because
21742
+ // the module might be trying to use this ref in its constructor for DI which will cause a
21743
+ // circular error that will eventually error out, because the injector isn't created yet.
21744
+ this._r3Injector.resolveInjectorInitializers();
21745
+ this.instance = this.get(ngModuleType);
21746
+ }
21747
+ get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
21748
+ if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
21749
+ return this;
21750
+ }
21751
+ return this._r3Injector.get(token, notFoundValue, injectFlags);
21752
+ }
21753
+ runInContext(fn) {
21754
+ return this.injector.runInContext(fn);
21755
+ }
21756
+ destroy() {
21757
+ ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
21758
+ const injector = this._r3Injector;
21759
+ !injector.destroyed && injector.destroy();
21760
+ this.destroyCbs.forEach(fn => fn());
21761
+ this.destroyCbs = null;
21762
+ }
21763
+ onDestroy(callback) {
21764
+ ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
21765
+ this.destroyCbs.push(callback);
21766
+ }
21767
+ }
21768
+ class NgModuleFactory extends NgModuleFactory$1 {
21769
+ constructor(moduleType) {
21770
+ super();
21771
+ this.moduleType = moduleType;
21772
+ }
21773
+ create(parentInjector) {
21774
+ return new NgModuleRef(this.moduleType, parentInjector);
21775
+ }
21776
+ }
21777
+ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
21778
+ constructor(providers, parent, source) {
21779
+ super();
21780
+ this.componentFactoryResolver = new ComponentFactoryResolver(this);
21781
+ this.instance = null;
21782
+ const injector = new R3Injector([
21783
+ ...providers,
21784
+ { provide: NgModuleRef$1, useValue: this },
21785
+ { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
21786
+ ], parent || getNullInjector(), source, new Set(['environment']));
21787
+ this.injector = injector;
21788
+ injector.resolveInjectorInitializers();
21789
+ }
21790
+ destroy() {
21791
+ this.injector.destroy();
21792
+ }
21793
+ onDestroy(callback) {
21794
+ this.injector.onDestroy(callback);
21795
+ }
21796
+ }
21797
+ /**
21798
+ * Create a new environment injector.
21799
+ *
21800
+ * Learn more about environment injectors in
21801
+ * [this guide](guide/standalone-components#environment-injectors).
21802
+ *
21803
+ * @param providers An array of providers.
21804
+ * @param parent A parent environment injector.
21805
+ * @param debugName An optional name for this injector instance, which will be used in error
21806
+ * messages.
21807
+ *
21808
+ * @publicApi
21809
+ * @developerPreview
21810
+ */
21811
+ function createEnvironmentInjector(providers, parent, debugName = null) {
21812
+ const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
21813
+ return adapter.injector;
21814
+ }
21815
+
21816
+ /**
21817
+ * @license
21818
+ * Copyright Google LLC All Rights Reserved.
21819
+ *
21820
+ * Use of this source code is governed by an MIT-style license that can be
21821
+ * found in the LICENSE file at https://angular.io/license
21822
+ */
21823
+ /**
21824
+ * A service used by the framework to create instances of standalone injectors. Those injectors are
21825
+ * created on demand in case of dynamic component instantiation and contain ambient providers
21826
+ * collected from the imports graph rooted at a given standalone component.
21827
+ */
21828
+ class StandaloneService {
21829
+ constructor(_injector) {
21830
+ this._injector = _injector;
21831
+ this.cachedInjectors = new Map();
21832
+ }
21833
+ getOrCreateStandaloneInjector(componentDef) {
21834
+ if (!componentDef.standalone) {
21835
+ return null;
21836
+ }
21837
+ if (!this.cachedInjectors.has(componentDef.id)) {
21838
+ const providers = internalImportProvidersFrom(false, componentDef.type);
21839
+ const standaloneInjector = providers.length > 0 ?
21840
+ createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
21841
+ null;
21842
+ this.cachedInjectors.set(componentDef.id, standaloneInjector);
21843
+ }
21844
+ return this.cachedInjectors.get(componentDef.id);
21845
+ }
21846
+ ngOnDestroy() {
21847
+ try {
21848
+ for (const injector of this.cachedInjectors.values()) {
21849
+ if (injector !== null) {
21850
+ injector.destroy();
21851
+ }
21852
+ }
21853
+ }
21854
+ finally {
21855
+ this.cachedInjectors.clear();
21856
+ }
21857
+ }
21858
+ }
21859
+ /** @nocollapse */
21860
+ StandaloneService.ɵprov = ɵɵdefineInjectable({
21861
+ token: StandaloneService,
21862
+ providedIn: 'environment',
21863
+ factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
21864
+ });
21865
+ /**
21866
+ * A feature that acts as a setup code for the {@link StandaloneService}.
21867
+ *
21868
+ * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
21869
+ * function (an entry points to a standalone injector creation) on a component definition object. We
21870
+ * go through the features infrastructure to make sure that the standalone injector creation logic
21871
+ * is tree-shakable and not included in applications that don't use standalone components.
21872
+ *
21873
+ * @codeGenApi
21874
+ */
21875
+ function ɵɵStandaloneFeature(definition) {
21876
+ definition.getStandaloneInjector = (parentInjector) => {
21877
+ return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
21878
+ };
21879
+ }
21880
+
21881
+ /**
21882
+ * @license
21883
+ * Copyright Google LLC All Rights Reserved.
21884
+ *
21885
+ * Use of this source code is governed by an MIT-style license that can be
21886
+ * found in the LICENSE file at https://angular.io/license
21887
+ */
21888
+ /**
21889
+ * Retrieves the component instance associated with a given DOM element.
21890
+ *
21891
+ * @usageNotes
21892
+ * Given the following DOM structure:
21893
+ *
21894
+ * ```html
21895
+ * <app-root>
21896
+ * <div>
21897
+ * <child-comp></child-comp>
21898
+ * </div>
21899
+ * </app-root>
21900
+ * ```
21901
+ *
21902
+ * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
21903
+ * associated with this DOM element.
21904
+ *
21905
+ * Calling the function on `<app-root>` will return the `MyApp` instance.
21906
+ *
21907
+ *
21908
+ * @param element DOM element from which the component should be retrieved.
21909
+ * @returns Component instance associated with the element or `null` if there
21910
+ * is no component associated with it.
21911
+ *
21912
+ * @publicApi
21913
+ * @globalApi ng
21914
+ */
21915
+ function getComponent(element) {
21916
+ ngDevMode && assertDomElement(element);
21917
+ const context = getLContext(element);
21918
+ if (context === null)
21919
+ return null;
21920
+ if (context.component === undefined) {
21921
+ const lView = context.lView;
21922
+ if (lView === null) {
21923
+ return null;
22189
21924
  }
21925
+ context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
22190
21926
  }
22191
- return array;
21927
+ return context.component;
22192
21928
  }
22193
- function getNamespace(elementName) {
22194
- const name = elementName.toLowerCase();
22195
- return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
21929
+ /**
21930
+ * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
21931
+ * view that the element is part of. Otherwise retrieves the instance of the component whose view
21932
+ * owns the element (in this case, the result is the same as calling `getOwningComponent`).
21933
+ *
21934
+ * @param element Element for which to get the surrounding component instance.
21935
+ * @returns Instance of the component that is around the element or null if the element isn't
21936
+ * inside any component.
21937
+ *
21938
+ * @publicApi
21939
+ * @globalApi ng
21940
+ */
21941
+ function getContext(element) {
21942
+ assertDomElement(element);
21943
+ const context = getLContext(element);
21944
+ const lView = context ? context.lView : null;
21945
+ return lView === null ? null : lView[CONTEXT];
22196
21946
  }
22197
21947
  /**
22198
- * Injector that looks up a value using a specific injector, before falling back to the module
22199
- * injector. Used primarily when creating components or embedded views dynamically.
21948
+ * Retrieves the component instance whose view contains the DOM element.
21949
+ *
21950
+ * For example, if `<child-comp>` is used in the template of `<app-comp>`
21951
+ * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
21952
+ * would return `<app-comp>`.
21953
+ *
21954
+ * @param elementOrDir DOM element, component or directive instance
21955
+ * for which to retrieve the root components.
21956
+ * @returns Component instance whose view owns the DOM element or null if the element is not
21957
+ * part of a component view.
21958
+ *
21959
+ * @publicApi
21960
+ * @globalApi ng
22200
21961
  */
22201
- class ChainedInjector {
22202
- constructor(injector, parentInjector) {
22203
- this.injector = injector;
22204
- this.parentInjector = parentInjector;
22205
- }
22206
- get(token, notFoundValue, flags) {
22207
- const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
22208
- if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
22209
- notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
22210
- // Return the value from the root element injector when
22211
- // - it provides it
22212
- // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
22213
- // - the module injector should not be checked
22214
- // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
22215
- return value;
22216
- }
22217
- return this.parentInjector.get(token, notFoundValue, flags);
21962
+ function getOwningComponent(elementOrDir) {
21963
+ const context = getLContext(elementOrDir);
21964
+ let lView = context ? context.lView : null;
21965
+ if (lView === null)
21966
+ return null;
21967
+ let parent;
21968
+ while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
21969
+ lView = parent;
22218
21970
  }
21971
+ return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
22219
21972
  }
22220
21973
  /**
22221
- * Render3 implementation of {@link viewEngine_ComponentFactory}.
21974
+ * Retrieves all root components associated with a DOM element, directive or component instance.
21975
+ * Root components are those which have been bootstrapped by Angular.
21976
+ *
21977
+ * @param elementOrDir DOM element, component or directive instance
21978
+ * for which to retrieve the root components.
21979
+ * @returns Root components associated with the target object.
21980
+ *
21981
+ * @publicApi
21982
+ * @globalApi ng
22222
21983
  */
22223
- class ComponentFactory extends ComponentFactory$1 {
22224
- /**
22225
- * @param componentDef The component definition.
22226
- * @param ngModule The NgModuleRef to which the factory is bound.
22227
- */
22228
- constructor(componentDef, ngModule) {
22229
- super();
22230
- this.componentDef = componentDef;
22231
- this.ngModule = ngModule;
22232
- this.componentType = componentDef.type;
22233
- this.selector = stringifyCSSSelectorList(componentDef.selectors);
22234
- this.ngContentSelectors =
22235
- componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
22236
- this.isBoundToModule = !!ngModule;
22237
- }
22238
- get inputs() {
22239
- return toRefArray(this.componentDef.inputs);
22240
- }
22241
- get outputs() {
22242
- return toRefArray(this.componentDef.outputs);
22243
- }
22244
- create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
22245
- environmentInjector = environmentInjector || this.ngModule;
22246
- let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
22247
- environmentInjector :
22248
- environmentInjector?.injector;
22249
- if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
22250
- realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
22251
- realEnvironmentInjector;
22252
- }
22253
- const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
22254
- const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
22255
- const sanitizer = rootViewInjector.get(Sanitizer, null);
22256
- const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
22257
- // Determine a tag name used for creating host elements when this component is created
22258
- // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
22259
- const elementName = this.componentDef.selectors[0][0] || 'div';
22260
- const hostRNode = rootSelectorOrNode ?
22261
- locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
22262
- createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
22263
- const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
22264
- 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
22265
- const rootContext = createRootContext();
22266
- // Create the root view. Uses empty TView and ContentTemplate.
22267
- const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
22268
- const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
22269
- // rootView is the parent when bootstrapping
22270
- // TODO(misko): it looks like we are entering view here but we don't really need to as
22271
- // `renderView` does that. However as the code is written it is needed because
22272
- // `createRootComponentView` and `createRootComponent` both read global state. Fixing those
22273
- // issues would allow us to drop this.
22274
- enterView(rootLView);
22275
- let component;
22276
- let tElementNode;
22277
- try {
22278
- const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
22279
- if (hostRNode) {
22280
- if (rootSelectorOrNode) {
22281
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
22282
- }
22283
- else {
22284
- // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
22285
- // is not defined), also apply attributes and classes extracted from component selector.
22286
- // Extract attributes and classes from the first selector only to match VE behavior.
22287
- const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
22288
- if (attrs) {
22289
- setUpAttributes(hostRenderer, hostRNode, attrs);
22290
- }
22291
- if (classes && classes.length > 0) {
22292
- writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
22293
- }
22294
- }
22295
- }
22296
- tElementNode = getTNode(rootTView, HEADER_OFFSET);
22297
- if (projectableNodes !== undefined) {
22298
- const projection = tElementNode.projection = [];
22299
- for (let i = 0; i < this.ngContentSelectors.length; i++) {
22300
- const nodesforSlot = projectableNodes[i];
22301
- // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
22302
- // case). Here we do normalize passed data structure to be an array of arrays to avoid
22303
- // complex checks down the line.
22304
- // We also normalize the length of the passed in projectable nodes (to match the number of
22305
- // <ng-container> slots defined by a component).
22306
- projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
22307
- }
22308
- }
22309
- // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
22310
- // executed here?
22311
- // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
22312
- component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
22313
- renderView(rootTView, rootLView, null);
22314
- }
22315
- finally {
22316
- leaveView();
21984
+ function getRootComponents(elementOrDir) {
21985
+ const lView = readPatchedLView(elementOrDir);
21986
+ return lView !== null ? [...getRootContext(lView).components] : [];
21987
+ }
21988
+ /**
21989
+ * Retrieves an `Injector` associated with an element, component or directive instance.
21990
+ *
21991
+ * @param elementOrDir DOM element, component or directive instance for which to
21992
+ * retrieve the injector.
21993
+ * @returns Injector associated with the element, component or directive instance.
21994
+ *
21995
+ * @publicApi
21996
+ * @globalApi ng
21997
+ */
21998
+ function getInjector(elementOrDir) {
21999
+ const context = getLContext(elementOrDir);
22000
+ const lView = context ? context.lView : null;
22001
+ if (lView === null)
22002
+ return Injector.NULL;
22003
+ const tNode = lView[TVIEW].data[context.nodeIndex];
22004
+ return new NodeInjector(tNode, lView);
22005
+ }
22006
+ /**
22007
+ * Retrieve a set of injection tokens at a given DOM node.
22008
+ *
22009
+ * @param element Element for which the injection tokens should be retrieved.
22010
+ */
22011
+ function getInjectionTokens(element) {
22012
+ const context = getLContext(element);
22013
+ const lView = context ? context.lView : null;
22014
+ if (lView === null)
22015
+ return [];
22016
+ const tView = lView[TVIEW];
22017
+ const tNode = tView.data[context.nodeIndex];
22018
+ const providerTokens = [];
22019
+ const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
22020
+ const endIndex = tNode.directiveEnd;
22021
+ for (let i = startIndex; i < endIndex; i++) {
22022
+ let value = tView.data[i];
22023
+ if (isDirectiveDefHack(value)) {
22024
+ // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
22025
+ // design flaw. We should always store same type so that we can be monomorphic. The issue
22026
+ // is that for Components/Directives we store the def instead the type. The correct behavior
22027
+ // is that we should always be storing injectable type in this location.
22028
+ value = value.type;
22317
22029
  }
22318
- return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
22030
+ providerTokens.push(value);
22319
22031
  }
22032
+ return providerTokens;
22320
22033
  }
22321
- const componentFactoryResolver = new ComponentFactoryResolver();
22322
22034
  /**
22323
- * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
22324
- * ComponentFactoryResolver
22325
- * already exists, retrieves the existing ComponentFactoryResolver.
22035
+ * Retrieves directive instances associated with a given DOM node. Does not include
22036
+ * component instances.
22326
22037
  *
22327
- * @returns The ComponentFactoryResolver instance to use
22038
+ * @usageNotes
22039
+ * Given the following DOM structure:
22040
+ *
22041
+ * ```html
22042
+ * <app-root>
22043
+ * <button my-button></button>
22044
+ * <my-comp></my-comp>
22045
+ * </app-root>
22046
+ * ```
22047
+ *
22048
+ * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
22049
+ * directive that is associated with the DOM node.
22050
+ *
22051
+ * Calling `getDirectives` on `<my-comp>` will return an empty array.
22052
+ *
22053
+ * @param node DOM node for which to get the directives.
22054
+ * @returns Array of directives associated with the node.
22055
+ *
22056
+ * @publicApi
22057
+ * @globalApi ng
22328
22058
  */
22329
- function injectComponentFactoryResolver() {
22330
- return componentFactoryResolver;
22059
+ function getDirectives(node) {
22060
+ // Skip text nodes because we can't have directives associated with them.
22061
+ if (node instanceof Text) {
22062
+ return [];
22063
+ }
22064
+ const context = getLContext(node);
22065
+ const lView = context ? context.lView : null;
22066
+ if (lView === null) {
22067
+ return [];
22068
+ }
22069
+ const tView = lView[TVIEW];
22070
+ const nodeIndex = context.nodeIndex;
22071
+ if (!tView?.data[nodeIndex]) {
22072
+ return [];
22073
+ }
22074
+ if (context.directives === undefined) {
22075
+ context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
22076
+ }
22077
+ // The `directives` in this case are a named array called `LComponentView`. Clone the
22078
+ // result so we don't expose an internal data structure in the user's console.
22079
+ return context.directives === null ? [] : [...context.directives];
22331
22080
  }
22332
22081
  /**
22333
- * Represents an instance of a Component created via a {@link ComponentFactory}.
22082
+ * Returns the debug (partial) metadata for a particular directive or component instance.
22083
+ * The function accepts an instance of a directive or component and returns the corresponding
22084
+ * metadata.
22334
22085
  *
22335
- * `ComponentRef` provides access to the Component Instance as well other objects related to this
22336
- * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
22337
- * method.
22086
+ * @param directiveOrComponentInstance Instance of a directive or component
22087
+ * @returns metadata of the passed directive or component
22338
22088
  *
22089
+ * @publicApi
22090
+ * @globalApi ng
22339
22091
  */
22340
- class ComponentRef extends ComponentRef$1 {
22341
- constructor(componentType, instance, location, _rootLView, _tNode) {
22342
- super();
22343
- this.location = location;
22344
- this._rootLView = _rootLView;
22345
- this._tNode = _tNode;
22346
- this.instance = instance;
22347
- this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
22348
- this.componentType = componentType;
22349
- }
22350
- get injector() {
22351
- return new NodeInjector(this._tNode, this._rootLView);
22092
+ function getDirectiveMetadata$1(directiveOrComponentInstance) {
22093
+ const { constructor } = directiveOrComponentInstance;
22094
+ if (!constructor) {
22095
+ throw new Error('Unable to find the instance constructor');
22352
22096
  }
22353
- destroy() {
22354
- this.hostView.destroy();
22097
+ // In case a component inherits from a directive, we may have component and directive metadata
22098
+ // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
22099
+ const componentDef = getComponentDef(constructor);
22100
+ if (componentDef) {
22101
+ return {
22102
+ inputs: componentDef.inputs,
22103
+ outputs: componentDef.outputs,
22104
+ encapsulation: componentDef.encapsulation,
22105
+ changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
22106
+ ChangeDetectionStrategy.Default
22107
+ };
22355
22108
  }
22356
- onDestroy(callback) {
22357
- this.hostView.onDestroy(callback);
22109
+ const directiveDef = getDirectiveDef(constructor);
22110
+ if (directiveDef) {
22111
+ return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
22358
22112
  }
22113
+ return null;
22359
22114
  }
22360
-
22361
22115
  /**
22362
- * @license
22363
- * Copyright Google LLC All Rights Reserved.
22116
+ * Retrieve map of local references.
22364
22117
  *
22365
- * Use of this source code is governed by an MIT-style license that can be
22366
- * found in the LICENSE file at https://angular.io/license
22118
+ * The references are retrieved as a map of local reference name to element or directive instance.
22119
+ *
22120
+ * @param target DOM element, component or directive instance for which to retrieve
22121
+ * the local references.
22367
22122
  */
22123
+ function getLocalRefs(target) {
22124
+ const context = getLContext(target);
22125
+ if (context === null)
22126
+ return {};
22127
+ if (context.localRefs === undefined) {
22128
+ const lView = context.lView;
22129
+ if (lView === null) {
22130
+ return {};
22131
+ }
22132
+ context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
22133
+ }
22134
+ return context.localRefs || {};
22135
+ }
22368
22136
  /**
22369
- * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
22370
- * @param ngModule NgModule class.
22371
- * @param parentInjector Optional injector instance to use as a parent for the module injector. If
22372
- * not provided, `NullInjector` will be used instead.
22137
+ * Retrieves the host element of a component or directive instance.
22138
+ * The host element is the DOM element that matched the selector of the directive.
22139
+ *
22140
+ * @param componentOrDirective Component or directive instance for which the host
22141
+ * element should be retrieved.
22142
+ * @returns Host element of the target.
22143
+ *
22373
22144
  * @publicApi
22145
+ * @globalApi ng
22374
22146
  */
22375
- function createNgModuleRef(ngModule, parentInjector) {
22376
- return new NgModuleRef(ngModule, parentInjector ?? null);
22147
+ function getHostElement(componentOrDirective) {
22148
+ return getLContext(componentOrDirective).native;
22377
22149
  }
22378
- class NgModuleRef extends NgModuleRef$1 {
22379
- constructor(ngModuleType, _parent) {
22380
- super();
22381
- this._parent = _parent;
22382
- // tslint:disable-next-line:require-internal-with-underscore
22383
- this._bootstrapComponents = [];
22384
- this.injector = this;
22385
- this.destroyCbs = [];
22386
- // When bootstrapping a module we have a dependency graph that looks like this:
22387
- // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
22388
- // module being resolved tries to inject the ComponentFactoryResolver, it'll create a
22389
- // circular dependency which will result in a runtime error, because the injector doesn't
22390
- // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
22391
- // and providing it, rather than letting the injector resolve it.
22392
- this.componentFactoryResolver = new ComponentFactoryResolver(this);
22393
- const ngModuleDef = getNgModuleDef(ngModuleType);
22394
- ngDevMode &&
22395
- assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
22396
- this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
22397
- this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
22398
- { provide: NgModuleRef$1, useValue: this }, {
22399
- provide: ComponentFactoryResolver$1,
22400
- useValue: this.componentFactoryResolver
22150
+ /**
22151
+ * Retrieves the rendered text for a given component.
22152
+ *
22153
+ * This function retrieves the host element of a component and
22154
+ * and then returns the `textContent` for that element. This implies
22155
+ * that the text returned will include re-projected content of
22156
+ * the component as well.
22157
+ *
22158
+ * @param component The component to return the content text for.
22159
+ */
22160
+ function getRenderedText(component) {
22161
+ const hostElement = getHostElement(component);
22162
+ return hostElement.textContent || '';
22163
+ }
22164
+ /**
22165
+ * Retrieves a list of event listeners associated with a DOM element. The list does include host
22166
+ * listeners, but it does not include event listeners defined outside of the Angular context
22167
+ * (e.g. through `addEventListener`).
22168
+ *
22169
+ * @usageNotes
22170
+ * Given the following DOM structure:
22171
+ *
22172
+ * ```html
22173
+ * <app-root>
22174
+ * <div (click)="doSomething()"></div>
22175
+ * </app-root>
22176
+ * ```
22177
+ *
22178
+ * Calling `getListeners` on `<div>` will return an object that looks as follows:
22179
+ *
22180
+ * ```ts
22181
+ * {
22182
+ * name: 'click',
22183
+ * element: <div>,
22184
+ * callback: () => doSomething(),
22185
+ * useCapture: false
22186
+ * }
22187
+ * ```
22188
+ *
22189
+ * @param element Element for which the DOM listeners should be retrieved.
22190
+ * @returns Array of event listeners on the DOM element.
22191
+ *
22192
+ * @publicApi
22193
+ * @globalApi ng
22194
+ */
22195
+ function getListeners(element) {
22196
+ ngDevMode && assertDomElement(element);
22197
+ const lContext = getLContext(element);
22198
+ const lView = lContext === null ? null : lContext.lView;
22199
+ if (lView === null)
22200
+ return [];
22201
+ const tView = lView[TVIEW];
22202
+ const lCleanup = lView[CLEANUP];
22203
+ const tCleanup = tView.cleanup;
22204
+ const listeners = [];
22205
+ if (tCleanup && lCleanup) {
22206
+ for (let i = 0; i < tCleanup.length;) {
22207
+ const firstParam = tCleanup[i++];
22208
+ const secondParam = tCleanup[i++];
22209
+ if (typeof firstParam === 'string') {
22210
+ const name = firstParam;
22211
+ const listenerElement = unwrapRNode(lView[secondParam]);
22212
+ const callback = lCleanup[tCleanup[i++]];
22213
+ const useCaptureOrIndx = tCleanup[i++];
22214
+ // if useCaptureOrIndx is boolean then report it as is.
22215
+ // if useCaptureOrIndx is positive number then it in unsubscribe method
22216
+ // if useCaptureOrIndx is negative number then it is a Subscription
22217
+ const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
22218
+ const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
22219
+ if (element == listenerElement) {
22220
+ listeners.push({ element, name, callback, useCapture, type });
22221
+ }
22401
22222
  }
22402
- ], stringify(ngModuleType), new Set(['environment']));
22403
- // We need to resolve the injector types separately from the injector creation, because
22404
- // the module might be trying to use this ref in its constructor for DI which will cause a
22405
- // circular error that will eventually error out, because the injector isn't created yet.
22406
- this._r3Injector.resolveInjectorInitializers();
22407
- this.instance = this.get(ngModuleType);
22408
- }
22409
- get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
22410
- if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
22411
- return this;
22412
22223
  }
22413
- return this._r3Injector.get(token, notFoundValue, injectFlags);
22414
- }
22415
- destroy() {
22416
- ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
22417
- const injector = this._r3Injector;
22418
- !injector.destroyed && injector.destroy();
22419
- this.destroyCbs.forEach(fn => fn());
22420
- this.destroyCbs = null;
22421
- }
22422
- onDestroy(callback) {
22423
- ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
22424
- this.destroyCbs.push(callback);
22425
- }
22426
- }
22427
- class NgModuleFactory extends NgModuleFactory$1 {
22428
- constructor(moduleType) {
22429
- super();
22430
- this.moduleType = moduleType;
22431
- }
22432
- create(parentInjector) {
22433
- return new NgModuleRef(this.moduleType, parentInjector);
22434
22224
  }
22225
+ listeners.sort(sortListeners);
22226
+ return listeners;
22435
22227
  }
22436
- class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
22437
- constructor(providers, parent, source) {
22438
- super();
22439
- this.componentFactoryResolver = new ComponentFactoryResolver(this);
22440
- this.instance = null;
22441
- const injector = new R3Injector([
22442
- ...providers,
22443
- { provide: NgModuleRef$1, useValue: this },
22444
- { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
22445
- ], parent || getNullInjector(), source, new Set(['environment']));
22446
- this.injector = injector;
22447
- injector.resolveInjectorInitializers();
22448
- }
22449
- destroy() {
22450
- this.injector.destroy();
22451
- }
22452
- onDestroy(callback) {
22453
- this.injector.onDestroy(callback);
22454
- }
22228
+ function sortListeners(a, b) {
22229
+ if (a.name == b.name)
22230
+ return 0;
22231
+ return a.name < b.name ? -1 : 1;
22455
22232
  }
22456
22233
  /**
22457
- * Create a new environment injector.
22234
+ * This function should not exist because it is megamorphic and only mostly correct.
22458
22235
  *
22459
- * @publicApi
22460
- * @developerPreview
22236
+ * See call site for more info.
22461
22237
  */
22462
- function createEnvironmentInjector(providers, parent = null, debugName = null) {
22463
- const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
22464
- return adapter.injector;
22238
+ function isDirectiveDefHack(obj) {
22239
+ return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
22465
22240
  }
22466
-
22467
22241
  /**
22468
- * @license
22469
- * Copyright Google LLC All Rights Reserved.
22242
+ * Returns the attached `DebugNode` instance for an element in the DOM.
22470
22243
  *
22471
- * Use of this source code is governed by an MIT-style license that can be
22472
- * found in the LICENSE file at https://angular.io/license
22473
- */
22474
- /**
22475
- * A service used by the framework to create instances of standalone injectors. Those injectors are
22476
- * created on demand in case of dynamic component instantiation and contain ambient providers
22477
- * collected from the imports graph rooted at a given standalone component.
22244
+ * @param element DOM element which is owned by an existing component's view.
22478
22245
  */
22479
- class StandaloneService {
22480
- constructor(_injector) {
22481
- this._injector = _injector;
22482
- this.cachedInjectors = new Map();
22246
+ function getDebugNode$1(element) {
22247
+ if (ngDevMode && !(element instanceof Node)) {
22248
+ throw new Error('Expecting instance of DOM Element');
22483
22249
  }
22484
- getOrCreateStandaloneInjector(componentDef) {
22485
- if (!componentDef.standalone) {
22486
- return null;
22487
- }
22488
- if (!this.cachedInjectors.has(componentDef.id)) {
22489
- const providers = internalImportProvidersFrom(false, componentDef.type);
22490
- const standaloneInjector = providers.length > 0 ?
22491
- createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
22492
- null;
22493
- this.cachedInjectors.set(componentDef.id, standaloneInjector);
22494
- }
22495
- return this.cachedInjectors.get(componentDef.id);
22250
+ const lContext = getLContext(element);
22251
+ const lView = lContext ? lContext.lView : null;
22252
+ if (lView === null) {
22253
+ return null;
22496
22254
  }
22497
- ngOnDestroy() {
22498
- try {
22499
- for (const injector of this.cachedInjectors.values()) {
22500
- if (injector !== null) {
22501
- injector.destroy();
22502
- }
22503
- }
22504
- }
22505
- finally {
22506
- this.cachedInjectors.clear();
22507
- }
22255
+ const nodeIndex = lContext.nodeIndex;
22256
+ if (nodeIndex !== -1) {
22257
+ const valueInLView = lView[nodeIndex];
22258
+ // this means that value in the lView is a component with its own
22259
+ // data. In this situation the TNode is not accessed at the same spot.
22260
+ const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
22261
+ ngDevMode &&
22262
+ assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
22263
+ return buildDebugNode(tNode, lView);
22508
22264
  }
22265
+ return null;
22509
22266
  }
22510
- /** @nocollapse */
22511
- StandaloneService.ɵprov = ɵɵdefineInjectable({
22512
- token: StandaloneService,
22513
- providedIn: 'environment',
22514
- factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
22515
- });
22516
22267
  /**
22517
- * A feature that acts as a setup code for the {@link StandaloneService}.
22268
+ * Retrieve the component `LView` from component/element.
22518
22269
  *
22519
- * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
22520
- * function (an entry points to a standalone injector creation) on a component definition object. We
22521
- * go through the features infrastructure to make sure that the standalone injector creation logic
22522
- * is tree-shakable and not included in applications that don't use standalone components.
22270
+ * NOTE: `LView` is a private and should not be leaked outside.
22271
+ * Don't export this method to `ng.*` on window.
22523
22272
  *
22524
- * @codeGenApi
22273
+ * @param target DOM element or component instance for which to retrieve the LView.
22525
22274
  */
22526
- function ɵɵStandaloneFeature(definition) {
22527
- definition.getStandaloneInjector = (parentInjector) => {
22528
- return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
22529
- };
22275
+ function getComponentLView(target) {
22276
+ const lContext = getLContext(target);
22277
+ const nodeIndx = lContext.nodeIndex;
22278
+ const lView = lContext.lView;
22279
+ ngDevMode && assertLView(lView);
22280
+ const componentLView = lView[nodeIndx];
22281
+ ngDevMode && assertLView(componentLView);
22282
+ return componentLView;
22283
+ }
22284
+ /** Asserts that a value is a DOM Element. */
22285
+ function assertDomElement(value) {
22286
+ if (typeof Element !== 'undefined' && !(value instanceof Element)) {
22287
+ throw new Error('Expecting instance of DOM Element');
22288
+ }
22530
22289
  }
22531
22290
 
22532
22291
  /**
@@ -23746,7 +23505,7 @@ const unusedValueExportToPlacateAjd = 1;
23746
23505
  * Use of this source code is governed by an MIT-style license that can be
23747
23506
  * found in the LICENSE file at https://angular.io/license
23748
23507
  */
23749
- const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd;
23508
+ const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
23750
23509
  class LQuery_ {
23751
23510
  constructor(queryList) {
23752
23511
  this.queryList = queryList;
@@ -25177,14 +24936,20 @@ function getStandaloneDefFunctions(type, imports) {
25177
24936
  // Standalone components are always able to self-reference, so include the component's own
25178
24937
  // definition in its `directiveDefs`.
25179
24938
  cachedDirectiveDefs = [getComponentDef(type)];
24939
+ const seen = new Set();
25180
24940
  for (const rawDep of imports) {
25181
24941
  ngDevMode && verifyStandaloneImport(rawDep, type);
25182
24942
  const dep = resolveForwardRef(rawDep);
24943
+ if (seen.has(dep)) {
24944
+ continue;
24945
+ }
24946
+ seen.add(dep);
25183
24947
  if (!!getNgModuleDef(dep)) {
25184
24948
  const scope = transitiveScopesFor(dep);
25185
24949
  for (const dir of scope.exported.directives) {
25186
24950
  const def = getComponentDef(dir) || getDirectiveDef(dir);
25187
- if (def) {
24951
+ if (def && !seen.has(dir)) {
24952
+ seen.add(dir);
25188
24953
  cachedDirectiveDefs.push(def);
25189
24954
  }
25190
24955
  }
@@ -25202,11 +24967,22 @@ function getStandaloneDefFunctions(type, imports) {
25202
24967
  const pipeDefs = () => {
25203
24968
  if (cachedPipeDefs === null) {
25204
24969
  cachedPipeDefs = [];
24970
+ const seen = new Set();
25205
24971
  for (const rawDep of imports) {
25206
24972
  const dep = resolveForwardRef(rawDep);
24973
+ if (seen.has(dep)) {
24974
+ continue;
24975
+ }
24976
+ seen.add(dep);
25207
24977
  if (!!getNgModuleDef(dep)) {
25208
24978
  const scope = transitiveScopesFor(dep);
25209
- cachedPipeDefs.push(...Array.from(scope.exported.pipes).map(pipe => getPipeDef$1(pipe)));
24979
+ for (const pipe of scope.exported.pipes) {
24980
+ const def = getPipeDef$1(pipe);
24981
+ if (def && !seen.has(pipe)) {
24982
+ seen.add(pipe);
24983
+ cachedPipeDefs.push(def);
24984
+ }
24985
+ }
25210
24986
  }
25211
24987
  else {
25212
24988
  const def = getPipeDef$1(dep);
@@ -26163,6 +25939,99 @@ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
26163
25939
  class CompilerFactory {
26164
25940
  }
26165
25941
 
25942
+ /**
25943
+ * @license
25944
+ * Copyright Google LLC All Rights Reserved.
25945
+ *
25946
+ * Use of this source code is governed by an MIT-style license that can be
25947
+ * found in the LICENSE file at https://angular.io/license
25948
+ */
25949
+ /**
25950
+ * Marks a component for check (in case of OnPush components) and synchronously
25951
+ * performs change detection on the application this component belongs to.
25952
+ *
25953
+ * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
25954
+ *
25955
+ * @publicApi
25956
+ * @globalApi ng
25957
+ */
25958
+ function applyChanges(component) {
25959
+ markDirty(component);
25960
+ getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
25961
+ }
25962
+
25963
+ /**
25964
+ * @license
25965
+ * Copyright Google LLC All Rights Reserved.
25966
+ *
25967
+ * Use of this source code is governed by an MIT-style license that can be
25968
+ * found in the LICENSE file at https://angular.io/license
25969
+ */
25970
+ /**
25971
+ * This file introduces series of globally accessible debug tools
25972
+ * to allow for the Angular debugging story to function.
25973
+ *
25974
+ * To see this in action run the following command:
25975
+ *
25976
+ * bazel run //packages/core/test/bundling/todo:devserver
25977
+ *
25978
+ * Then load `localhost:5432` and start using the console tools.
25979
+ */
25980
+ /**
25981
+ * This value reflects the property on the window where the dev
25982
+ * tools are patched (window.ng).
25983
+ * */
25984
+ const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
25985
+ let _published = false;
25986
+ /**
25987
+ * Publishes a collection of default debug tools onto`window.ng`.
25988
+ *
25989
+ * These functions are available globally when Angular is in development
25990
+ * mode and are automatically stripped away from prod mode is on.
25991
+ */
25992
+ function publishDefaultGlobalUtils$1() {
25993
+ if (!_published) {
25994
+ _published = true;
25995
+ /**
25996
+ * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
25997
+ * The contract of the function might be changed in any release and/or the function can be
25998
+ * removed completely.
25999
+ */
26000
+ publishGlobalUtil('ɵsetProfiler', setProfiler);
26001
+ publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
26002
+ publishGlobalUtil('getComponent', getComponent);
26003
+ publishGlobalUtil('getContext', getContext);
26004
+ publishGlobalUtil('getListeners', getListeners);
26005
+ publishGlobalUtil('getOwningComponent', getOwningComponent);
26006
+ publishGlobalUtil('getHostElement', getHostElement);
26007
+ publishGlobalUtil('getInjector', getInjector);
26008
+ publishGlobalUtil('getRootComponents', getRootComponents);
26009
+ publishGlobalUtil('getDirectives', getDirectives);
26010
+ publishGlobalUtil('applyChanges', applyChanges);
26011
+ }
26012
+ }
26013
+ /**
26014
+ * Publishes the given function to `window.ng` so that it can be
26015
+ * used from the browser console when an application is not in production.
26016
+ */
26017
+ function publishGlobalUtil(name, fn) {
26018
+ if (typeof COMPILED === 'undefined' || !COMPILED) {
26019
+ // Note: we can't export `ng` when using closure enhanced optimization as:
26020
+ // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
26021
+ // - we can't declare a closure extern as the namespace `ng` is already used within Google
26022
+ // for typings for AngularJS (via `goog.provide('ng....')`).
26023
+ const w = _global;
26024
+ ngDevMode && assertDefined(fn, 'function not defined');
26025
+ if (w) {
26026
+ let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
26027
+ if (!container) {
26028
+ container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
26029
+ }
26030
+ container[name] = fn;
26031
+ }
26032
+ }
26033
+ }
26034
+
26166
26035
  /**
26167
26036
  * @license
26168
26037
  * Copyright Google LLC All Rights Reserved.
@@ -26318,7 +26187,7 @@ class NgZone {
26318
26187
  */
26319
26188
  this.onError = new EventEmitter(false);
26320
26189
  if (typeof Zone == 'undefined') {
26321
- throw new Error(`In this configuration Angular requires Zone.js`);
26190
+ throw new RuntimeError(908 /* RuntimeErrorCode.MISSING_ZONEJS */, ngDevMode && `In this configuration Angular requires Zone.js`);
26322
26191
  }
26323
26192
  Zone.assertZonePatched();
26324
26193
  const self = this;
@@ -26345,12 +26214,12 @@ class NgZone {
26345
26214
  }
26346
26215
  static assertInAngularZone() {
26347
26216
  if (!NgZone.isInAngularZone()) {
26348
- throw new Error('Expected to be in Angular Zone, but it is not!');
26217
+ throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to be in Angular Zone, but it is not!');
26349
26218
  }
26350
26219
  }
26351
26220
  static assertNotInAngularZone() {
26352
26221
  if (NgZone.isInAngularZone()) {
26353
- throw new Error('Expected to not be in Angular Zone, but it is!');
26222
+ throw new RuntimeError(909 /* RuntimeErrorCode.UNEXPECTED_ZONE_STATE */, ngDevMode && 'Expected to not be in Angular Zone, but it is!');
26354
26223
  }
26355
26224
  }
26356
26225
  /**
@@ -26914,7 +26783,7 @@ const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken('AllowMultipleToken');
26914
26783
  * `PlatformRef` class (i.e. register the callback via `PlatformRef.onDestroy`), thus making the
26915
26784
  * entire class tree-shakeable.
26916
26785
  */
26917
- const PLATFORM_ON_DESTROY = new InjectionToken('PlatformOnDestroy');
26786
+ const PLATFORM_DESTROY_LISTENERS = new InjectionToken('PlatformDestroyListeners');
26918
26787
  const NG_DEV_MODE = typeof ngDevMode === 'undefined' || ngDevMode;
26919
26788
  function compileNgModuleFactory(injector, options, moduleType) {
26920
26789
  ngDevMode && assertNgModuleType(moduleType);
@@ -26979,10 +26848,8 @@ class NgProbeToken {
26979
26848
  */
26980
26849
  function createPlatform(injector) {
26981
26850
  if (_platformInjector && !_platformInjector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
26982
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
26983
- 'There can be only one platform. Destroy the previous one to create a new one.' :
26984
- '';
26985
- throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, errorMessage);
26851
+ throw new RuntimeError(400 /* RuntimeErrorCode.MULTIPLE_PLATFORMS */, ngDevMode &&
26852
+ 'There can be only one platform. Destroy the previous one to create a new one.');
26986
26853
  }
26987
26854
  publishDefaultGlobalUtils();
26988
26855
  _platformInjector = injector;
@@ -27055,7 +26922,15 @@ function internalBootstrapApplication(config) {
27055
26922
  const localeId = appInjector.get(LOCALE_ID, DEFAULT_LOCALE_ID);
27056
26923
  setLocaleId(localeId || DEFAULT_LOCALE_ID);
27057
26924
  const appRef = appInjector.get(ApplicationRef);
27058
- appRef.onDestroy(() => onErrorSubscription.unsubscribe());
26925
+ // If the whole platform is destroyed, invoke the `destroy` method
26926
+ // for all bootstrapped applications as well.
26927
+ const destroyListener = () => appRef.destroy();
26928
+ const onPlatformDestroyListeners = platformInjector.get(PLATFORM_DESTROY_LISTENERS, null);
26929
+ onPlatformDestroyListeners?.add(destroyListener);
26930
+ appRef.onDestroy(() => {
26931
+ onPlatformDestroyListeners?.delete(destroyListener);
26932
+ onErrorSubscription.unsubscribe();
26933
+ });
27059
26934
  appRef.bootstrap(rootComponent);
27060
26935
  return appRef;
27061
26936
  });
@@ -27102,8 +26977,7 @@ function createPlatformFactory(parentPlatformFactory, name, providers = []) {
27102
26977
  function assertPlatform(requiredToken) {
27103
26978
  const platform = getPlatform();
27104
26979
  if (!platform) {
27105
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ? 'No platform exists!' : '';
27106
- throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, errorMessage);
26980
+ throw new RuntimeError(401 /* RuntimeErrorCode.PLATFORM_NOT_FOUND */, ngDevMode && 'No platform exists!');
27107
26981
  }
27108
26982
  if ((typeof ngDevMode === 'undefined' || ngDevMode) &&
27109
26983
  !platform.injector.get(requiredToken, null)) {
@@ -27120,7 +26994,7 @@ function createPlatformInjector(providers = [], name) {
27120
26994
  name,
27121
26995
  providers: [
27122
26996
  { provide: INJECTOR_SCOPE, useValue: 'platform' },
27123
- { provide: PLATFORM_ON_DESTROY, useValue: () => _platformInjector = null },
26997
+ { provide: PLATFORM_DESTROY_LISTENERS, useValue: new Set([() => _platformInjector = null]) },
27124
26998
  ...providers
27125
26999
  ],
27126
27000
  });
@@ -27181,10 +27055,7 @@ class PlatformRef {
27181
27055
  const moduleRef = moduleFactory.create(ngZoneInjector);
27182
27056
  const exceptionHandler = moduleRef.injector.get(ErrorHandler, null);
27183
27057
  if (!exceptionHandler) {
27184
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27185
- 'No ErrorHandler. Is platform module (BrowserModule) included?' :
27186
- '';
27187
- throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, errorMessage);
27058
+ throw new RuntimeError(402 /* RuntimeErrorCode.ERROR_HANDLER_NOT_FOUND */, ngDevMode && 'No ErrorHandler. Is platform module (BrowserModule) included?');
27188
27059
  }
27189
27060
  ngZone.runOutsideAngular(() => {
27190
27061
  const subscription = ngZone.onError.subscribe({
@@ -27240,12 +27111,10 @@ class PlatformRef {
27240
27111
  moduleRef.instance.ngDoBootstrap(appRef);
27241
27112
  }
27242
27113
  else {
27243
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27114
+ throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, ngDevMode &&
27244
27115
  `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, ` +
27245
27116
  `but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. ` +
27246
- `Please define one of these.` :
27247
- '';
27248
- throw new RuntimeError(403 /* RuntimeErrorCode.BOOTSTRAP_COMPONENTS_NOT_FOUND */, errorMessage);
27117
+ `Please define one of these.`);
27249
27118
  }
27250
27119
  this._modules.push(moduleRef);
27251
27120
  }
@@ -27268,15 +27137,15 @@ class PlatformRef {
27268
27137
  */
27269
27138
  destroy() {
27270
27139
  if (this._destroyed) {
27271
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27272
- 'The platform has already been destroyed!' :
27273
- '';
27274
- throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, errorMessage);
27140
+ throw new RuntimeError(404 /* RuntimeErrorCode.PLATFORM_ALREADY_DESTROYED */, ngDevMode && 'The platform has already been destroyed!');
27275
27141
  }
27276
27142
  this._modules.slice().forEach(module => module.destroy());
27277
27143
  this._destroyListeners.forEach(listener => listener());
27278
- const destroyListener = this._injector.get(PLATFORM_ON_DESTROY, null);
27279
- destroyListener?.();
27144
+ const destroyListeners = this._injector.get(PLATFORM_DESTROY_LISTENERS, null);
27145
+ if (destroyListeners) {
27146
+ destroyListeners.forEach(listener => listener());
27147
+ destroyListeners.clear();
27148
+ }
27280
27149
  this._destroyed = true;
27281
27150
  }
27282
27151
  /**
@@ -27434,11 +27303,10 @@ function optionsReducer(dst, objs) {
27434
27303
  */
27435
27304
  class ApplicationRef {
27436
27305
  /** @internal */
27437
- constructor(_zone, _injector, _exceptionHandler, _initStatus) {
27306
+ constructor(_zone, _injector, _exceptionHandler) {
27438
27307
  this._zone = _zone;
27439
27308
  this._injector = _injector;
27440
27309
  this._exceptionHandler = _exceptionHandler;
27441
- this._initStatus = _initStatus;
27442
27310
  /** @internal */
27443
27311
  this._bootstrapListeners = [];
27444
27312
  this._views = [];
@@ -27555,7 +27423,8 @@ class ApplicationRef {
27555
27423
  bootstrap(componentOrFactory, rootSelectorOrNode) {
27556
27424
  NG_DEV_MODE && this.warnIfDestroyed();
27557
27425
  const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
27558
- if (!this._initStatus.done) {
27426
+ const initStatus = this._injector.get(ApplicationInitStatus);
27427
+ if (!initStatus.done) {
27559
27428
  const standalone = !isComponentFactory && isStandalone(componentOrFactory);
27560
27429
  const errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' +
27561
27430
  (standalone ? '' :
@@ -27603,10 +27472,7 @@ class ApplicationRef {
27603
27472
  tick() {
27604
27473
  NG_DEV_MODE && this.warnIfDestroyed();
27605
27474
  if (this._runningTick) {
27606
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
27607
- 'ApplicationRef.tick is called recursively' :
27608
- '';
27609
- throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, errorMessage);
27475
+ throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');
27610
27476
  }
27611
27477
  try {
27612
27478
  this._runningTick = true;
@@ -27695,7 +27561,7 @@ class ApplicationRef {
27695
27561
  */
27696
27562
  destroy() {
27697
27563
  if (this._destroyed) {
27698
- throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, NG_DEV_MODE && 'This instance of the `ApplicationRef` has already been destroyed.');
27564
+ throw new RuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.');
27699
27565
  }
27700
27566
  const injector = this._injector;
27701
27567
  // Check that this injector instance supports destroy operation.
@@ -27717,12 +27583,12 @@ class ApplicationRef {
27717
27583
  }
27718
27584
  }
27719
27585
  }
27720
- ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ApplicationInitStatus)); };
27586
+ ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler)); };
27721
27587
  ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
27722
27588
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
27723
27589
  type: Injectable,
27724
27590
  args: [{ providedIn: 'root' }]
27725
- }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ApplicationInitStatus }]; }, null); })();
27591
+ }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }]; }, null); })();
27726
27592
  function remove(list, el) {
27727
27593
  const index = list.indexOf(el);
27728
27594
  if (index > -1) {
@@ -28069,7 +27935,7 @@ class DebugNode {
28069
27935
  get componentInstance() {
28070
27936
  const nativeElement = this.nativeNode;
28071
27937
  return nativeElement &&
28072
- (getComponent$1(nativeElement) || getOwningComponent(nativeElement));
27938
+ (getComponent(nativeElement) || getOwningComponent(nativeElement));
28073
27939
  }
28074
27940
  /**
28075
27941
  * An object that provides parent context for this element. Often an ancestor component instance
@@ -28080,7 +27946,7 @@ class DebugNode {
28080
27946
  * of heroes"`.
28081
27947
  */
28082
27948
  get context() {
28083
- return getComponent$1(this.nativeNode) || getContext(this.nativeNode);
27949
+ return getComponent(this.nativeNode) || getContext(this.nativeNode);
28084
27950
  }
28085
27951
  /**
28086
27952
  * The callbacks attached to the component's @Output properties and/or the element's event
@@ -28420,8 +28286,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
28420
28286
  // Renderer2, however that's not the case in Ivy. This approach is being used because:
28421
28287
  // 1. Matching the ViewEngine behavior would mean potentially introducing a depedency
28422
28288
  // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
28423
- // 2. We would have to make `Renderer3` "know" about debug nodes.
28424
- // 3. It allows us to capture nodes that were inserted directly via the DOM.
28289
+ // 2. It allows us to capture nodes that were inserted directly via the DOM.
28425
28290
  nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
28426
28291
  }
28427
28292
  // In all cases, if a dynamic container exists for this node, each view inside it has to be
@@ -28732,10 +28597,8 @@ class DefaultIterableDiffer {
28732
28597
  if (collection == null)
28733
28598
  collection = [];
28734
28599
  if (!isListLikeIterable(collection)) {
28735
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
28736
- `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed` :
28737
- '';
28738
- throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
28600
+ throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
28601
+ `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);
28739
28602
  }
28740
28603
  if (this.check(collection)) {
28741
28604
  return this;
@@ -29336,10 +29199,8 @@ class DefaultKeyValueDiffer {
29336
29199
  map = new Map();
29337
29200
  }
29338
29201
  else if (!(map instanceof Map || isJsObject(map))) {
29339
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
29340
- `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed` :
29341
- '';
29342
- throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, errorMessage);
29202
+ throw new RuntimeError(900 /* RuntimeErrorCode.INVALID_DIFFER_INPUT */, ngDevMode &&
29203
+ `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);
29343
29204
  }
29344
29205
  return this.check(map) ? this : null;
29345
29206
  }
@@ -29586,10 +29447,8 @@ class IterableDiffers {
29586
29447
  return factory;
29587
29448
  }
29588
29449
  else {
29589
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
29590
- `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'` :
29591
- '';
29592
- throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
29450
+ throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode &&
29451
+ `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);
29593
29452
  }
29594
29453
  }
29595
29454
  }
@@ -29663,10 +29522,7 @@ class KeyValueDiffers {
29663
29522
  if (factory) {
29664
29523
  return factory;
29665
29524
  }
29666
- const errorMessage = (typeof ngDevMode === 'undefined' || ngDevMode) ?
29667
- `Cannot find a differ supporting object '${kv}'` :
29668
- '';
29669
- throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, errorMessage);
29525
+ throw new RuntimeError(901 /* RuntimeErrorCode.NO_SUPPORTING_DIFFER_FACTORY */, ngDevMode && `Cannot find a differ supporting object '${kv}'`);
29670
29526
  }
29671
29527
  }
29672
29528
  /** @nocollapse */
@@ -29906,5 +29762,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
29906
29762
  * Generated bundle index. Do not edit.
29907
29763
  */
29908
29764
 
29909
- export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, 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, 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, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, 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, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, 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, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderComponent as ɵrenderComponent, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵ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, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵ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, ɵɵ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, ɵɵviewQuery };
29765
+ export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, 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, 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, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, 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, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, 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, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵ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, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵ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, ɵɵ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, ɵɵviewQuery };
29910
29766
  //# sourceMappingURL=core.mjs.map