@angular/core 11.1.0-next.5 → 11.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/bundles/core-testing.umd.js +2 -2
  2. package/bundles/core-testing.umd.js.map +1 -1
  3. package/bundles/core-testing.umd.min.js +2 -2
  4. package/bundles/core-testing.umd.min.js.map +1 -1
  5. package/bundles/core.umd.js +473 -346
  6. package/bundles/core.umd.js.map +1 -1
  7. package/bundles/core.umd.min.js +116 -117
  8. package/bundles/core.umd.min.js.map +1 -1
  9. package/core.d.ts +237 -144
  10. package/core.metadata.json +1 -1
  11. package/esm2015/core.js +33 -33
  12. package/esm2015/src/compiler/compiler_facade_interface.js +1 -1
  13. package/esm2015/src/core_render3_private_export.js +2 -2
  14. package/esm2015/src/di/injector_compatibility.js +39 -16
  15. package/esm2015/src/di/interface/injector.js +3 -2
  16. package/esm2015/src/di/metadata.js +22 -6
  17. package/esm2015/src/event_emitter.js +15 -15
  18. package/esm2015/src/linker/compiler.js +2 -2
  19. package/esm2015/src/linker/element_ref.js +10 -1
  20. package/esm2015/src/linker/query_list.js +39 -11
  21. package/esm2015/src/metadata/di.js +7 -3
  22. package/esm2015/src/metadata/view.js +2 -2
  23. package/esm2015/src/render3/component.js +2 -2
  24. package/esm2015/src/render3/di.js +17 -32
  25. package/esm2015/src/render3/error_code.js +28 -2
  26. package/esm2015/src/render3/index.js +2 -2
  27. package/esm2015/src/render3/instructions/lview_debug.js +24 -4
  28. package/esm2015/src/render3/interfaces/query.js +1 -1
  29. package/esm2015/src/render3/interfaces/view.js +1 -1
  30. package/esm2015/src/render3/jit/directive.js +3 -2
  31. package/esm2015/src/render3/jit/environment.js +1 -3
  32. package/esm2015/src/render3/query.js +28 -54
  33. package/esm2015/src/util/array_utils.js +25 -1
  34. package/esm2015/src/util/dom.js +25 -12
  35. package/esm2015/src/version.js +1 -1
  36. package/esm2015/src/view/query.js +5 -5
  37. package/esm2015/src/view/types.js +1 -1
  38. package/esm2015/src/view/view.js +3 -2
  39. package/esm2015/testing/src/fake_async.js +2 -2
  40. package/fesm2015/core.js +420 -297
  41. package/fesm2015/core.js.map +1 -1
  42. package/fesm2015/testing.js +2 -2
  43. package/fesm2015/testing.js.map +1 -1
  44. package/package.json +1 -1
  45. package/schematics/migrations/static-queries/index.js +3 -8
  46. package/src/r3_symbols.d.ts +1 -2
  47. package/testing/testing.d.ts +1 -1
  48. package/testing.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v11.1.0-next.5
2
+ * @license Angular v11.1.2
3
3
  * (c) 2010-2020 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -379,7 +379,8 @@
379
379
  * found in the LICENSE file at https://angular.io/license
380
380
  */
381
381
  (function (InjectFlags) {
382
- // TODO(alxhub): make this 'const' when ngc no longer writes exports of it into ngfactory files.
382
+ // TODO(alxhub): make this 'const' (and remove `InternalInjectFlags` enum) when ngc no longer
383
+ // writes exports of it into ngfactory files.
383
384
  /** Check self and check parent injector if needed */
384
385
  InjectFlags[InjectFlags["Default"] = 0] = "Default";
385
386
  /**
@@ -565,7 +566,7 @@
565
566
  * Use Shadow DOM to encapsulate styles.
566
567
  *
567
568
  * For the DOM this means using modern [Shadow
568
- * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
569
+ * DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) and
569
570
  * creating a ShadowRoot for Component's Host Element.
570
571
  */
571
572
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
@@ -1568,6 +1569,10 @@
1568
1569
  * Use of this source code is governed by an MIT-style license that can be
1569
1570
  * found in the LICENSE file at https://angular.io/license
1570
1571
  */
1572
+ // Base URL for the error details page.
1573
+ // Keep this value in sync with a similar const in
1574
+ // `packages/compiler-cli/src/ngtsc/diagnostics/src/error_code.ts`.
1575
+ var ERROR_DETAILS_PAGE_BASE_URL = 'https://angular.io/errors';
1571
1576
  var RuntimeError = /** @class */ (function (_super) {
1572
1577
  __extends(RuntimeError, _super);
1573
1578
  function RuntimeError(code, message) {
@@ -1577,10 +1582,32 @@
1577
1582
  }
1578
1583
  return RuntimeError;
1579
1584
  }(Error));
1585
+ // Contains a set of error messages that have details guides at angular.io.
1586
+ // Full list of available error guides can be found at https://angular.io/errors
1587
+ /* tslint:disable:no-toplevel-property-access */
1588
+ var RUNTIME_ERRORS_WITH_GUIDES = new Set([
1589
+ "100" /* EXPRESSION_CHANGED_AFTER_CHECKED */,
1590
+ "200" /* CYCLIC_DI_DEPENDENCY */,
1591
+ "201" /* PROVIDER_NOT_FOUND */,
1592
+ "300" /* MULTIPLE_COMPONENTS_MATCH */,
1593
+ "301" /* EXPORT_NOT_FOUND */,
1594
+ "302" /* PIPE_NOT_FOUND */,
1595
+ ]);
1596
+ /* tslint:enable:no-toplevel-property-access */
1580
1597
  /** Called to format a runtime error */
1581
1598
  function formatRuntimeError(code, message) {
1582
1599
  var fullCode = code ? "NG0" + code + ": " : '';
1583
- return "" + fullCode + message;
1600
+ var errorMessage = "" + fullCode + message;
1601
+ // Some runtime errors are still thrown without `ngDevMode` (for example
1602
+ // `throwProviderNotFoundError`), so we add `ngDevMode` check here to avoid pulling
1603
+ // `RUNTIME_ERRORS_WITH_GUIDES` symbol into prod bundles.
1604
+ // TODO: revisit all instances where `RuntimeError` is thrown and see if `ngDevMode` can be added
1605
+ // there instead to tree-shake more devmode-only code (and eventually remove `ngDevMode` check
1606
+ // from this code).
1607
+ if (ngDevMode && RUNTIME_ERRORS_WITH_GUIDES.has(code)) {
1608
+ errorMessage = errorMessage + ". Find more at " + ERROR_DETAILS_PAGE_BASE_URL + "/NG0" + code;
1609
+ }
1610
+ return errorMessage;
1584
1611
  }
1585
1612
 
1586
1613
  /**
@@ -3298,6 +3325,12 @@
3298
3325
  */
3299
3326
  var BLOOM_SIZE = 256;
3300
3327
  var BLOOM_MASK = BLOOM_SIZE - 1;
3328
+ /**
3329
+ * The number of bits that is represented by a single bloom bucket. JS bit operations are 32 bits,
3330
+ * so each bucket represents 32 distinct tokens which accounts for log2(32) = 5 bits of a bloom hash
3331
+ * number.
3332
+ */
3333
+ var BLOOM_BUCKET_BITS = 5;
3301
3334
  /** Counter used to generate unique IDs for directives. */
3302
3335
  var nextNgElementId = 0;
3303
3336
  /**
@@ -3324,25 +3357,15 @@
3324
3357
  }
3325
3358
  // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),
3326
3359
  // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.
3327
- var bloomBit = id & BLOOM_MASK;
3360
+ var bloomHash = id & BLOOM_MASK;
3328
3361
  // Create a mask that targets the specific bit associated with the directive.
3329
3362
  // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
3330
3363
  // to bit positions 0 - 31 in a 32 bit integer.
3331
- var mask = 1 << bloomBit;
3332
- // Use the raw bloomBit number to determine which bloom filter bucket we should check
3333
- // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc
3334
- var b7 = bloomBit & 0x80;
3335
- var b6 = bloomBit & 0x40;
3336
- var b5 = bloomBit & 0x20;
3337
- var tData = tView.data;
3338
- if (b7) {
3339
- b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) :
3340
- (b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask));
3341
- }
3342
- else {
3343
- b6 ? (b5 ? (tData[injectorIndex + 3] |= mask) : (tData[injectorIndex + 2] |= mask)) :
3344
- (b5 ? (tData[injectorIndex + 1] |= mask) : (tData[injectorIndex] |= mask));
3345
- }
3364
+ var mask = 1 << bloomHash;
3365
+ // Each bloom bucket in `tData` represents `BLOOM_BUCKET_BITS` number of bits of `bloomHash`.
3366
+ // Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset that the mask
3367
+ // should be written to.
3368
+ tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;
3346
3369
  }
3347
3370
  /**
3348
3371
  * Creates (or gets an existing) injector for a given element or container.
@@ -3838,21 +3861,10 @@
3838
3861
  // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding
3839
3862
  // to bit positions 0 - 31 in a 32 bit integer.
3840
3863
  var mask = 1 << bloomHash;
3841
- var b7 = bloomHash & 0x80;
3842
- var b6 = bloomHash & 0x40;
3843
- var b5 = bloomHash & 0x20;
3844
- // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:
3845
- // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.
3846
- // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.
3847
- var value;
3848
- if (b7) {
3849
- value = b6 ? (b5 ? injectorView[injectorIndex + 7] : injectorView[injectorIndex + 6]) :
3850
- (b5 ? injectorView[injectorIndex + 5] : injectorView[injectorIndex + 4]);
3851
- }
3852
- else {
3853
- value = b6 ? (b5 ? injectorView[injectorIndex + 3] : injectorView[injectorIndex + 2]) :
3854
- (b5 ? injectorView[injectorIndex + 1] : injectorView[injectorIndex]);
3855
- }
3864
+ // Each bloom bucket in `injectorView` represents `BLOOM_BUCKET_BITS` number of bits of
3865
+ // `bloomHash`. Any bits in `bloomHash` beyond `BLOOM_BUCKET_BITS` indicate the bucket offset
3866
+ // that should be used.
3867
+ var value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];
3856
3868
  // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,
3857
3869
  // this injector is a potential match.
3858
3870
  return !!(value & mask);
@@ -4205,6 +4217,10 @@
4205
4217
  * @deprecated Since 9.0.0. With Ivy, this property is no longer necessary.
4206
4218
  */
4207
4219
  var ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken('AnalyzeForEntryComponents');
4220
+ // Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not
4221
+ // explicitly set. This value will be changed to `true` in v12.
4222
+ // TODO(misko): switch the default in v12 to `true`. See: packages/compiler/src/core.ts
4223
+ var emitDistinctChangesOnlyDefaultValue = false;
4208
4224
  /**
4209
4225
  * Base class for query metadata.
4210
4226
  *
@@ -4222,7 +4238,7 @@
4222
4238
  }());
4223
4239
  var ɵ0$1 = function (selector, data) {
4224
4240
  if (data === void 0) { data = {}; }
4225
- return (Object.assign({ selector: selector, first: false, isViewQuery: false, descendants: false }, data));
4241
+ return (Object.assign({ selector: selector, first: false, isViewQuery: false, descendants: false, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));
4226
4242
  };
4227
4243
  /**
4228
4244
  * ContentChildren decorator and metadata.
@@ -4247,7 +4263,7 @@
4247
4263
  var ContentChild = makePropDecorator('ContentChild', ɵ1, Query);
4248
4264
  var ɵ2 = function (selector, data) {
4249
4265
  if (data === void 0) { data = {}; }
4250
- return (Object.assign({ selector: selector, first: false, isViewQuery: true, descendants: true }, data));
4266
+ return (Object.assign({ selector: selector, first: false, isViewQuery: true, descendants: true, emitDistinctChangesOnly: emitDistinctChangesOnlyDefaultValue }, data));
4251
4267
  };
4252
4268
  /**
4253
4269
  * ViewChildren decorator and metadata.
@@ -4353,6 +4369,30 @@
4353
4369
  arr.push(items[i]);
4354
4370
  }
4355
4371
  }
4372
+ /**
4373
+ * Determines if the contents of two arrays is identical
4374
+ *
4375
+ * @param a first array
4376
+ * @param b second array
4377
+ * @param identityAccessor Optional function for extracting stable object identity from a value in
4378
+ * the array.
4379
+ */
4380
+ function arrayEquals(a, b, identityAccessor) {
4381
+ if (a.length !== b.length)
4382
+ return false;
4383
+ for (var i = 0; i < a.length; i++) {
4384
+ var valueA = a[i];
4385
+ var valueB = b[i];
4386
+ if (identityAccessor) {
4387
+ valueA = identityAccessor(valueA);
4388
+ valueB = identityAccessor(valueB);
4389
+ }
4390
+ if (valueB !== valueA) {
4391
+ return false;
4392
+ }
4393
+ }
4394
+ return true;
4395
+ }
4356
4396
  /**
4357
4397
  * Flattens an array.
4358
4398
  */
@@ -4935,42 +4975,237 @@
4935
4975
  * Use of this source code is governed by an MIT-style license that can be
4936
4976
  * found in the LICENSE file at https://angular.io/license
4937
4977
  */
4938
- var ɵ0$2 = function (token) { return ({ token: token }); };
4978
+ var _THROW_IF_NOT_FOUND = {};
4979
+ var THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
4980
+ /*
4981
+ * Name of a property (that we patch onto DI decorator), which is used as an annotation of which
4982
+ * InjectFlag this decorator represents. This allows to avoid direct references to the DI decorators
4983
+ * in the code, thus making them tree-shakable.
4984
+ */
4985
+ var DI_DECORATOR_FLAG = '__NG_DI_FLAG__';
4986
+ var NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
4987
+ var NG_TOKEN_PATH = 'ngTokenPath';
4988
+ var NEW_LINE = /\n/gm;
4989
+ var NO_NEW_LINE = 'ɵ';
4990
+ var SOURCE = '__source';
4991
+ var ɵ0$2 = getClosureSafeProperty;
4992
+ var USE_VALUE = getClosureSafeProperty({ provide: String, useValue: ɵ0$2 });
4993
+ /**
4994
+ * Current injector value used by `inject`.
4995
+ * - `undefined`: it is an error to call `inject`
4996
+ * - `null`: `inject` can be called but there is no injector (limp-mode).
4997
+ * - Injector instance: Use the injector for resolution.
4998
+ */
4999
+ var _currentInjector = undefined;
5000
+ function setCurrentInjector(injector) {
5001
+ var former = _currentInjector;
5002
+ _currentInjector = injector;
5003
+ return former;
5004
+ }
5005
+ function injectInjectorOnly(token, flags) {
5006
+ if (flags === void 0) { flags = exports.InjectFlags.Default; }
5007
+ if (_currentInjector === undefined) {
5008
+ throw new Error("inject() must be called from an injection context");
5009
+ }
5010
+ else if (_currentInjector === null) {
5011
+ return injectRootLimpMode(token, undefined, flags);
5012
+ }
5013
+ else {
5014
+ return _currentInjector.get(token, flags & exports.InjectFlags.Optional ? null : undefined, flags);
5015
+ }
5016
+ }
5017
+ function ɵɵinject(token, flags) {
5018
+ if (flags === void 0) { flags = exports.InjectFlags.Default; }
5019
+ return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);
5020
+ }
5021
+ /**
5022
+ * Throws an error indicating that a factory function could not be generated by the compiler for a
5023
+ * particular class.
5024
+ *
5025
+ * This instruction allows the actual error message to be optimized away when ngDevMode is turned
5026
+ * off, saving bytes of generated code while still providing a good experience in dev mode.
5027
+ *
5028
+ * The name of the class is not mentioned here, but will be in the generated factory function name
5029
+ * and thus in the stack trace.
5030
+ *
5031
+ * @codeGenApi
5032
+ */
5033
+ function ɵɵinvalidFactoryDep(index) {
5034
+ var msg = ngDevMode ?
5035
+ "This constructor is not compatible with Angular Dependency Injection because its dependency at index " + index + " of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease 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." :
5036
+ 'invalid';
5037
+ throw new Error(msg);
5038
+ }
5039
+ /**
5040
+ * Injects a token from the currently active injector.
5041
+ *
5042
+ * Must be used in the context of a factory function such as one defined for an
5043
+ * `InjectionToken`. Throws an error if not called from such a context.
5044
+ *
5045
+ * Within such a factory function, using this function to request injection of a dependency
5046
+ * is faster and more type-safe than providing an additional array of dependencies
5047
+ * (as has been common with `useFactory` providers).
5048
+ *
5049
+ * @param token The injection token for the dependency to be injected.
5050
+ * @param flags Optional flags that control how injection is executed.
5051
+ * The flags correspond to injection strategies that can be specified with
5052
+ * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.
5053
+ * @returns True if injection is successful, null otherwise.
5054
+ *
5055
+ * @usageNotes
5056
+ *
5057
+ * ### Example
5058
+ *
5059
+ * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
5060
+ *
5061
+ * @publicApi
5062
+ */
5063
+ var inject = ɵɵinject;
5064
+ function injectArgs(types) {
5065
+ var args = [];
5066
+ for (var i = 0; i < types.length; i++) {
5067
+ var arg = resolveForwardRef(types[i]);
5068
+ if (Array.isArray(arg)) {
5069
+ if (arg.length === 0) {
5070
+ throw new Error('Arguments array must have arguments.');
5071
+ }
5072
+ var type = undefined;
5073
+ var flags = exports.InjectFlags.Default;
5074
+ for (var j = 0; j < arg.length; j++) {
5075
+ var meta = arg[j];
5076
+ var flag = getInjectFlag(meta);
5077
+ if (typeof flag === 'number') {
5078
+ // Special case when we handle @Inject decorator.
5079
+ if (flag === -1 /* Inject */) {
5080
+ type = meta.token;
5081
+ }
5082
+ else {
5083
+ flags |= flag;
5084
+ }
5085
+ }
5086
+ else {
5087
+ type = meta;
5088
+ }
5089
+ }
5090
+ args.push(ɵɵinject(type, flags));
5091
+ }
5092
+ else {
5093
+ args.push(ɵɵinject(arg));
5094
+ }
5095
+ }
5096
+ return args;
5097
+ }
5098
+ /**
5099
+ * Attaches a given InjectFlag to a given decorator using monkey-patching.
5100
+ * Since DI decorators can be used in providers `deps` array (when provider is configured using
5101
+ * `useFactory`) without initialization (e.g. `Host`) and as an instance (e.g. `new Host()`), we
5102
+ * attach the flag to make it available both as a static property and as a field on decorator
5103
+ * instance.
5104
+ *
5105
+ * @param decorator Provided DI decorator.
5106
+ * @param flag InjectFlag that should be applied.
5107
+ */
5108
+ function attachInjectFlag(decorator, flag) {
5109
+ decorator[DI_DECORATOR_FLAG] = flag;
5110
+ decorator.prototype[DI_DECORATOR_FLAG] = flag;
5111
+ return decorator;
5112
+ }
5113
+ /**
5114
+ * Reads monkey-patched property that contains InjectFlag attached to a decorator.
5115
+ *
5116
+ * @param token Token that may contain monkey-patched DI flags property.
5117
+ */
5118
+ function getInjectFlag(token) {
5119
+ return token[DI_DECORATOR_FLAG];
5120
+ }
5121
+ function catchInjectorError(e, token, injectorErrorName, source) {
5122
+ var tokenPath = e[NG_TEMP_TOKEN_PATH];
5123
+ if (token[SOURCE]) {
5124
+ tokenPath.unshift(token[SOURCE]);
5125
+ }
5126
+ e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source);
5127
+ e[NG_TOKEN_PATH] = tokenPath;
5128
+ e[NG_TEMP_TOKEN_PATH] = null;
5129
+ throw e;
5130
+ }
5131
+ function formatError(text, obj, injectorErrorName, source) {
5132
+ if (source === void 0) { source = null; }
5133
+ text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;
5134
+ var context = stringify(obj);
5135
+ if (Array.isArray(obj)) {
5136
+ context = obj.map(stringify).join(' -> ');
5137
+ }
5138
+ else if (typeof obj === 'object') {
5139
+ var parts = [];
5140
+ for (var key in obj) {
5141
+ if (obj.hasOwnProperty(key)) {
5142
+ var value = obj[key];
5143
+ parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));
5144
+ }
5145
+ }
5146
+ context = "{" + parts.join(', ') + "}";
5147
+ }
5148
+ return "" + injectorErrorName + (source ? '(' + source + ')' : '') + "[" + context + "]: " + text.replace(NEW_LINE, '\n ');
5149
+ }
5150
+
5151
+ /**
5152
+ * @license
5153
+ * Copyright Google LLC All Rights Reserved.
5154
+ *
5155
+ * Use of this source code is governed by an MIT-style license that can be
5156
+ * found in the LICENSE file at https://angular.io/license
5157
+ */
5158
+ var ɵ0$3 = function (token) { return ({ token: token }); };
4939
5159
  /**
4940
5160
  * Inject decorator and metadata.
4941
5161
  *
4942
5162
  * @Annotation
4943
5163
  * @publicApi
4944
5164
  */
4945
- var Inject = makeParamDecorator('Inject', ɵ0$2);
5165
+ var Inject = attachInjectFlag(
5166
+ // Disable tslint because `DecoratorFlags` is a const enum which gets inlined.
5167
+ // tslint:disable-next-line: no-toplevel-property-access
5168
+ makeParamDecorator('Inject', ɵ0$3), -1 /* Inject */);
4946
5169
  /**
4947
5170
  * Optional decorator and metadata.
4948
5171
  *
4949
5172
  * @Annotation
4950
5173
  * @publicApi
4951
5174
  */
4952
- var Optional = makeParamDecorator('Optional');
5175
+ var Optional =
5176
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
5177
+ // tslint:disable-next-line: no-toplevel-property-access
5178
+ attachInjectFlag(makeParamDecorator('Optional'), 8 /* Optional */);
4953
5179
  /**
4954
5180
  * Self decorator and metadata.
4955
5181
  *
4956
5182
  * @Annotation
4957
5183
  * @publicApi
4958
5184
  */
4959
- var Self = makeParamDecorator('Self');
5185
+ var Self =
5186
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
5187
+ // tslint:disable-next-line: no-toplevel-property-access
5188
+ attachInjectFlag(makeParamDecorator('Self'), 2 /* Self */);
4960
5189
  /**
4961
5190
  * `SkipSelf` decorator and metadata.
4962
5191
  *
4963
5192
  * @Annotation
4964
5193
  * @publicApi
4965
5194
  */
4966
- var SkipSelf = makeParamDecorator('SkipSelf');
5195
+ var SkipSelf =
5196
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
5197
+ // tslint:disable-next-line: no-toplevel-property-access
5198
+ attachInjectFlag(makeParamDecorator('SkipSelf'), 4 /* SkipSelf */);
4967
5199
  /**
4968
5200
  * Host decorator and metadata.
4969
5201
  *
4970
5202
  * @Annotation
4971
5203
  * @publicApi
4972
5204
  */
4973
- var Host = makeParamDecorator('Host');
5205
+ var Host =
5206
+ // Disable tslint because `InternalInjectFlags` is a const enum which gets inlined.
5207
+ // tslint:disable-next-line: no-toplevel-property-access
5208
+ attachInjectFlag(makeParamDecorator('Host'), 1 /* Host */);
4974
5209
 
4975
5210
  /**
4976
5211
  * @license
@@ -5166,162 +5401,6 @@
5166
5401
  componentDefPendingResolution.delete(type);
5167
5402
  }
5168
5403
 
5169
- /**
5170
- * @license
5171
- * Copyright Google LLC All Rights Reserved.
5172
- *
5173
- * Use of this source code is governed by an MIT-style license that can be
5174
- * found in the LICENSE file at https://angular.io/license
5175
- */
5176
- var _THROW_IF_NOT_FOUND = {};
5177
- var THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;
5178
- var NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';
5179
- var NG_TOKEN_PATH = 'ngTokenPath';
5180
- var NEW_LINE = /\n/gm;
5181
- var NO_NEW_LINE = 'ɵ';
5182
- var SOURCE = '__source';
5183
- var ɵ0$3 = getClosureSafeProperty;
5184
- var USE_VALUE = getClosureSafeProperty({ provide: String, useValue: ɵ0$3 });
5185
- /**
5186
- * Current injector value used by `inject`.
5187
- * - `undefined`: it is an error to call `inject`
5188
- * - `null`: `inject` can be called but there is no injector (limp-mode).
5189
- * - Injector instance: Use the injector for resolution.
5190
- */
5191
- var _currentInjector = undefined;
5192
- function setCurrentInjector(injector) {
5193
- var former = _currentInjector;
5194
- _currentInjector = injector;
5195
- return former;
5196
- }
5197
- function injectInjectorOnly(token, flags) {
5198
- if (flags === void 0) { flags = exports.InjectFlags.Default; }
5199
- if (_currentInjector === undefined) {
5200
- throw new Error("inject() must be called from an injection context");
5201
- }
5202
- else if (_currentInjector === null) {
5203
- return injectRootLimpMode(token, undefined, flags);
5204
- }
5205
- else {
5206
- return _currentInjector.get(token, flags & exports.InjectFlags.Optional ? null : undefined, flags);
5207
- }
5208
- }
5209
- function ɵɵinject(token, flags) {
5210
- if (flags === void 0) { flags = exports.InjectFlags.Default; }
5211
- return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);
5212
- }
5213
- /**
5214
- * Throws an error indicating that a factory function could not be generated by the compiler for a
5215
- * particular class.
5216
- *
5217
- * This instruction allows the actual error message to be optimized away when ngDevMode is turned
5218
- * off, saving bytes of generated code while still providing a good experience in dev mode.
5219
- *
5220
- * The name of the class is not mentioned here, but will be in the generated factory function name
5221
- * and thus in the stack trace.
5222
- *
5223
- * @codeGenApi
5224
- */
5225
- function ɵɵinvalidFactoryDep(index) {
5226
- var msg = ngDevMode ?
5227
- "This constructor is not compatible with Angular Dependency Injection because its dependency at index " + index + " of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease 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." :
5228
- 'invalid';
5229
- throw new Error(msg);
5230
- }
5231
- /**
5232
- * Injects a token from the currently active injector.
5233
- *
5234
- * Must be used in the context of a factory function such as one defined for an
5235
- * `InjectionToken`. Throws an error if not called from such a context.
5236
- *
5237
- * Within such a factory function, using this function to request injection of a dependency
5238
- * is faster and more type-safe than providing an additional array of dependencies
5239
- * (as has been common with `useFactory` providers).
5240
- *
5241
- * @param token The injection token for the dependency to be injected.
5242
- * @param flags Optional flags that control how injection is executed.
5243
- * The flags correspond to injection strategies that can be specified with
5244
- * parameter decorators `@Host`, `@Self`, `@SkipSef`, and `@Optional`.
5245
- * @returns True if injection is successful, null otherwise.
5246
- *
5247
- * @usageNotes
5248
- *
5249
- * ### Example
5250
- *
5251
- * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
5252
- *
5253
- * @publicApi
5254
- */
5255
- var inject = ɵɵinject;
5256
- function injectArgs(types) {
5257
- var args = [];
5258
- for (var i = 0; i < types.length; i++) {
5259
- var arg = resolveForwardRef(types[i]);
5260
- if (Array.isArray(arg)) {
5261
- if (arg.length === 0) {
5262
- throw new Error('Arguments array must have arguments.');
5263
- }
5264
- var type = undefined;
5265
- var flags = exports.InjectFlags.Default;
5266
- for (var j = 0; j < arg.length; j++) {
5267
- var meta = arg[j];
5268
- if (meta instanceof Optional || meta.ngMetadataName === 'Optional' || meta === Optional) {
5269
- flags |= exports.InjectFlags.Optional;
5270
- }
5271
- else if (meta instanceof SkipSelf || meta.ngMetadataName === 'SkipSelf' || meta === SkipSelf) {
5272
- flags |= exports.InjectFlags.SkipSelf;
5273
- }
5274
- else if (meta instanceof Self || meta.ngMetadataName === 'Self' || meta === Self) {
5275
- flags |= exports.InjectFlags.Self;
5276
- }
5277
- else if (meta instanceof Host || meta.ngMetadataName === 'Host' || meta === Host) {
5278
- flags |= exports.InjectFlags.Host;
5279
- }
5280
- else if (meta instanceof Inject || meta === Inject) {
5281
- type = meta.token;
5282
- }
5283
- else {
5284
- type = meta;
5285
- }
5286
- }
5287
- args.push(ɵɵinject(type, flags));
5288
- }
5289
- else {
5290
- args.push(ɵɵinject(arg));
5291
- }
5292
- }
5293
- return args;
5294
- }
5295
- function catchInjectorError(e, token, injectorErrorName, source) {
5296
- var tokenPath = e[NG_TEMP_TOKEN_PATH];
5297
- if (token[SOURCE]) {
5298
- tokenPath.unshift(token[SOURCE]);
5299
- }
5300
- e.message = formatError('\n' + e.message, tokenPath, injectorErrorName, source);
5301
- e[NG_TOKEN_PATH] = tokenPath;
5302
- e[NG_TEMP_TOKEN_PATH] = null;
5303
- throw e;
5304
- }
5305
- function formatError(text, obj, injectorErrorName, source) {
5306
- if (source === void 0) { source = null; }
5307
- text = text && text.charAt(0) === '\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;
5308
- var context = stringify(obj);
5309
- if (Array.isArray(obj)) {
5310
- context = obj.map(stringify).join(' -> ');
5311
- }
5312
- else if (typeof obj === 'object') {
5313
- var parts = [];
5314
- for (var key in obj) {
5315
- if (obj.hasOwnProperty(key)) {
5316
- var value = obj[key];
5317
- parts.push(key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));
5318
- }
5319
- }
5320
- context = "{" + parts.join(', ') + "}";
5321
- }
5322
- return "" + injectorErrorName + (source ? '(' + source + ')' : '') + "[" + context + "]: " + text.replace(NEW_LINE, '\n ');
5323
- }
5324
-
5325
5404
  /**
5326
5405
  * The Trusted Types policy, or null if Trusted Types are not
5327
5406
  * enabled/supported, or undefined if the policy has not been created yet.
@@ -6498,14 +6577,26 @@
6498
6577
  * Use of this source code is governed by an MIT-style license that can be
6499
6578
  * found in the LICENSE file at https://angular.io/license
6500
6579
  */
6501
- var END_COMMENT = /-->/g;
6502
- var END_COMMENT_ESCAPED = '-\u200B-\u200B>';
6503
6580
  /**
6504
- * Escape the content of the strings so that it can be safely inserted into a comment node.
6581
+ * Disallowed strings in the comment.
6582
+ *
6583
+ * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
6584
+ */
6585
+ var COMMENT_DISALLOWED = /^>|^->|<!--|-->|--!>|<!-$/g;
6586
+ /**
6587
+ * Delimiter in the disallowed strings which needs to be wrapped with zero with character.
6588
+ */
6589
+ var COMMENT_DELIMITER = /(<|>)/;
6590
+ var COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B';
6591
+ /**
6592
+ * Escape the content of comment strings so that it can be safely inserted into a comment node.
6505
6593
  *
6506
6594
  * The issue is that HTML does not specify any way to escape comment end text inside the comment.
6507
- * `<!-- The way you close a comment is with "-->". -->`. Above the `"-->"` is meant to be text not
6508
- * an end to the comment. This can be created programmatically through DOM APIs.
6595
+ * Consider: `<!-- The way you close a comment is with ">", and "->" at the beginning or by "-->" or
6596
+ * "--!>" at the end. -->`. Above the `"-->"` is meant to be text not an end to the comment. This
6597
+ * can be created programmatically through DOM APIs. (`<!--` are also disallowed.)
6598
+ *
6599
+ * see: https://html.spec.whatwg.org/multipage/syntax.html#comments
6509
6600
  *
6510
6601
  * ```
6511
6602
  * div.innerHTML = div.innerHTML
@@ -6516,15 +6607,16 @@
6516
6607
  * opening up the application for XSS attack. (In SSR we programmatically create comment nodes which
6517
6608
  * may contain such text and expect them to be safe.)
6518
6609
  *
6519
- * This function escapes the comment text by looking for the closing char sequence `-->` and replace
6520
- * it with `-_-_>` where the `_` is a zero width space `\u200B`. The result is that if a comment
6521
- * contains `-->` text it will render normally but it will not cause the HTML parser to close the
6522
- * comment.
6610
+ * This function escapes the comment text by looking for comment delimiters (`<` and `>`) and
6611
+ * surrounding them with `_>_` where the `_` is a zero width space `\u200B`. The result is that if a
6612
+ * comment contains any of the comment start/end delimiters (such as `<!--`, `-->` or `--!>`) the
6613
+ * text it will render normally but it will not cause the HTML parser to close/open the comment.
6523
6614
  *
6524
- * @param value text to make safe for comment node by escaping the comment close character sequence
6615
+ * @param value text to make safe for comment node by escaping the comment open/close character
6616
+ * sequence.
6525
6617
  */
6526
6618
  function escapeCommentText(value) {
6527
- return value.replace(END_COMMENT, END_COMMENT_ESCAPED);
6619
+ return value.replace(COMMENT_DISALLOWED, function (text) { return text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED); });
6528
6620
  }
6529
6621
 
6530
6622
  /**
@@ -8928,8 +9020,21 @@
8928
9020
  TNode.prototype.debugNodeInjectorPath = function (lView) {
8929
9021
  var path = [];
8930
9022
  var injectorIndex = getInjectorIndex(this, lView);
8931
- ngDevMode && assertNodeInjector(lView, injectorIndex);
9023
+ if (injectorIndex === -1) {
9024
+ // Looks like the current `TNode` does not have `NodeInjector` associated with it => look for
9025
+ // parent NodeInjector.
9026
+ var parentLocation = getParentInjectorLocation(this, lView);
9027
+ if (parentLocation !== NO_PARENT_INJECTOR) {
9028
+ // We found a parent, so start searching from the parent location.
9029
+ injectorIndex = getParentInjectorIndex(parentLocation);
9030
+ lView = getParentInjectorView(parentLocation, lView);
9031
+ }
9032
+ else {
9033
+ // No parents have been found, so there are no `NodeInjector`s to consult.
9034
+ }
9035
+ }
8932
9036
  while (injectorIndex !== -1) {
9037
+ ngDevMode && assertNodeInjector(lView, injectorIndex);
8933
9038
  var tNode = lView[TVIEW].data[injectorIndex + 8 /* TNODE */];
8934
9039
  path.push(buildDebugNode(tNode, lView));
8935
9040
  var parentLocation = lView[injectorIndex + 8 /* PARENT */];
@@ -9386,11 +9491,15 @@
9386
9491
  return {
9387
9492
  html: toHtml(native),
9388
9493
  type: toTNodeTypeAsString(tNode.type),
9494
+ tNode: tNode,
9389
9495
  native: native,
9390
9496
  children: toDebugNodes(tNode.child, lView),
9391
9497
  factories: factories,
9392
9498
  instances: instances,
9393
- injector: buildNodeInjectorDebug(tNode, tView, lView)
9499
+ injector: buildNodeInjectorDebug(tNode, tView, lView),
9500
+ get injectorResolutionPath() {
9501
+ return tNode.debugNodeInjectorPath(lView);
9502
+ },
9394
9503
  };
9395
9504
  }
9396
9505
  function buildNodeInjectorDebug(tNode, tView, lView) {
@@ -9434,6 +9543,9 @@
9434
9543
  * @param idx
9435
9544
  */
9436
9545
  function toBloom(array, idx) {
9546
+ if (idx < 0) {
9547
+ return 'NO_NODE_INJECTOR';
9548
+ }
9437
9549
  return binary(array, idx + 7) + "_" + binary(array, idx + 6) + "_" + binary(array, idx + 5) + "_" + binary(array, idx + 4) + "_" + binary(array, idx + 3) + "_" + binary(array, idx + 2) + "_" + binary(array, idx + 1) + "_" + binary(array, idx + 0);
9438
9550
  }
9439
9551
  var LContainerDebug = /** @class */ (function () {
@@ -12723,7 +12835,7 @@
12723
12835
  ngDevMode && assertIndexInRange(rootView, index);
12724
12836
  rootView[index] = rNode;
12725
12837
  // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
12726
- // the same time we want to communicate the the debug `TNode` that this is a special `TNode`
12838
+ // the same time we want to communicate the debug `TNode` that this is a special `TNode`
12727
12839
  // representing a host element.
12728
12840
  var tNode = getOrCreateTNode(tView, index, 2 /* Element */, '#host', null);
12729
12841
  var mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
@@ -21699,6 +21811,15 @@
21699
21811
  * @nocollapse
21700
21812
  */
21701
21813
  ElementRef.__NG_ELEMENT_ID__ = SWITCH_ELEMENT_REF_FACTORY;
21814
+ /**
21815
+ * Unwraps `ElementRef` and return the `nativeElement`.
21816
+ *
21817
+ * @param value value to unwrap
21818
+ * @returns `nativeElement` if `ElementRef` otherwise returns value as is.
21819
+ */
21820
+ function unwrapElementRef(value) {
21821
+ return value instanceof ElementRef ? value.nativeElement : value;
21822
+ }
21702
21823
 
21703
21824
  /**
21704
21825
  * @license
@@ -21812,7 +21933,7 @@
21812
21933
  /**
21813
21934
  * @publicApi
21814
21935
  */
21815
- var VERSION = new Version('11.1.0-next.5');
21936
+ var VERSION = new Version('11.1.2');
21816
21937
 
21817
21938
  /**
21818
21939
  * @license
@@ -26425,36 +26546,36 @@
26425
26546
  EventEmitter_.prototype.emit = function (value) {
26426
26547
  _super.prototype.next.call(this, value);
26427
26548
  };
26428
- EventEmitter_.prototype.subscribe = function (generatorOrNext, error, complete) {
26549
+ EventEmitter_.prototype.subscribe = function (observerOrNext, error, complete) {
26429
26550
  var schedulerFn;
26430
26551
  var errorFn = function (err) { return null; };
26431
26552
  var completeFn = function () { return null; };
26432
- if (generatorOrNext && typeof generatorOrNext === 'object') {
26553
+ if (observerOrNext && typeof observerOrNext === 'object') {
26433
26554
  schedulerFn = this.__isAsync ? function (value) {
26434
- setTimeout(function () { return generatorOrNext.next(value); });
26555
+ setTimeout(function () { return observerOrNext.next(value); });
26435
26556
  } : function (value) {
26436
- generatorOrNext.next(value);
26557
+ observerOrNext.next(value);
26437
26558
  };
26438
- if (generatorOrNext.error) {
26559
+ if (observerOrNext.error) {
26439
26560
  errorFn = this.__isAsync ? function (err) {
26440
- setTimeout(function () { return generatorOrNext.error(err); });
26561
+ setTimeout(function () { return observerOrNext.error(err); });
26441
26562
  } : function (err) {
26442
- generatorOrNext.error(err);
26563
+ observerOrNext.error(err);
26443
26564
  };
26444
26565
  }
26445
- if (generatorOrNext.complete) {
26566
+ if (observerOrNext.complete) {
26446
26567
  completeFn = this.__isAsync ? function () {
26447
- setTimeout(function () { return generatorOrNext.complete(); });
26568
+ setTimeout(function () { return observerOrNext.complete(); });
26448
26569
  } : function () {
26449
- generatorOrNext.complete();
26570
+ observerOrNext.complete();
26450
26571
  };
26451
26572
  }
26452
26573
  }
26453
26574
  else {
26454
26575
  schedulerFn = this.__isAsync ? function (value) {
26455
- setTimeout(function () { return generatorOrNext(value); });
26576
+ setTimeout(function () { return observerOrNext(value); });
26456
26577
  } : function (value) {
26457
- generatorOrNext(value);
26578
+ observerOrNext(value);
26458
26579
  };
26459
26580
  if (error) {
26460
26581
  errorFn = this.__isAsync ? function (err) {
@@ -26472,8 +26593,8 @@
26472
26593
  }
26473
26594
  }
26474
26595
  var sink = _super.prototype.subscribe.call(this, schedulerFn, errorFn, completeFn);
26475
- if (generatorOrNext instanceof rxjs.Subscription) {
26476
- generatorOrNext.add(sink);
26596
+ if (observerOrNext instanceof rxjs.Subscription) {
26597
+ observerOrNext.add(sink);
26477
26598
  }
26478
26599
  return sink;
26479
26600
  };
@@ -26521,11 +26642,22 @@
26521
26642
  * @publicApi
26522
26643
  */
26523
26644
  var QueryList = /** @class */ (function () {
26524
- function QueryList() {
26645
+ /**
26646
+ * @param emitDistinctChangesOnly Whether `QueryList.changes` should fire only when actual change
26647
+ * has occurred. Or if it should fire when query is recomputed. (recomputing could resolve in
26648
+ * the same result) This is set to `false` for backwards compatibility but will be changed to
26649
+ * true in v12.
26650
+ */
26651
+ function QueryList(_emitDistinctChangesOnly) {
26652
+ if (_emitDistinctChangesOnly === void 0) { _emitDistinctChangesOnly = false; }
26653
+ this._emitDistinctChangesOnly = _emitDistinctChangesOnly;
26525
26654
  this.dirty = true;
26526
26655
  this._results = [];
26527
- this.changes = new EventEmitter();
26656
+ this._changesDetected = false;
26657
+ this._changes = null;
26528
26658
  this.length = 0;
26659
+ this.first = undefined;
26660
+ this.last = undefined;
26529
26661
  // This function should be declared on the prototype, but doing so there will cause the class
26530
26662
  // declaration to have side-effects and become not tree-shakable. For this reason we do it in
26531
26663
  // the constructor.
@@ -26535,6 +26667,16 @@
26535
26667
  if (!proto[symbol])
26536
26668
  proto[symbol] = symbolIterator;
26537
26669
  }
26670
+ Object.defineProperty(QueryList.prototype, "changes", {
26671
+ /**
26672
+ * Returns `Observable` of `QueryList` notifying the subscriber of changes.
26673
+ */
26674
+ get: function () {
26675
+ return this._changes || (this._changes = new EventEmitter());
26676
+ },
26677
+ enumerable: false,
26678
+ configurable: true
26679
+ });
26538
26680
  /**
26539
26681
  * Returns the QueryList entry at `index`.
26540
26682
  */
@@ -26598,19 +26740,31 @@
26598
26740
  * occurs.
26599
26741
  *
26600
26742
  * @param resultsTree The query results to store
26743
+ * @param identityAccessor Optional function for extracting stable object identity from a value
26744
+ * in the array. This function is executed for each element of the query result list while
26745
+ * comparing current query list with the new one (provided as a first argument of the `reset`
26746
+ * function) to detect if the lists are different. If the function is not provided, elements
26747
+ * are compared as is (without any pre-processing).
26601
26748
  */
26602
- QueryList.prototype.reset = function (resultsTree) {
26603
- this._results = flatten(resultsTree);
26604
- this.dirty = false;
26605
- this.length = this._results.length;
26606
- this.last = this._results[this.length - 1];
26607
- this.first = this._results[0];
26749
+ QueryList.prototype.reset = function (resultsTree, identityAccessor) {
26750
+ // Cast to `QueryListInternal` so that we can mutate fields which are readonly for the usage of
26751
+ // QueryList (but not for QueryList itself.)
26752
+ var self = this;
26753
+ self.dirty = false;
26754
+ var newResultFlat = flatten(resultsTree);
26755
+ if (this._changesDetected = !arrayEquals(self._results, newResultFlat, identityAccessor)) {
26756
+ self._results = newResultFlat;
26757
+ self.length = newResultFlat.length;
26758
+ self.last = newResultFlat[this.length - 1];
26759
+ self.first = newResultFlat[0];
26760
+ }
26608
26761
  };
26609
26762
  /**
26610
26763
  * Triggers a change event by emitting on the `changes` {@link EventEmitter}.
26611
26764
  */
26612
26765
  QueryList.prototype.notifyOnChanges = function () {
26613
- this.changes.emit(this);
26766
+ if (this._changes && (this._changesDetected || !this._emitDistinctChangesOnly))
26767
+ this._changes.emit(this);
26614
26768
  };
26615
26769
  /** internal */
26616
26770
  QueryList.prototype.setDirty = function () {
@@ -26706,11 +26860,10 @@
26706
26860
  return LQueries_;
26707
26861
  }());
26708
26862
  var TQueryMetadata_ = /** @class */ (function () {
26709
- function TQueryMetadata_(predicate, descendants, isStatic, read) {
26863
+ function TQueryMetadata_(predicate, flags, read) {
26710
26864
  if (read === void 0) { read = null; }
26711
26865
  this.predicate = predicate;
26712
- this.descendants = descendants;
26713
- this.isStatic = isStatic;
26866
+ this.flags = flags;
26714
26867
  this.read = read;
26715
26868
  }
26716
26869
  return TQueryMetadata_;
@@ -26811,7 +26964,8 @@
26811
26964
  return null;
26812
26965
  };
26813
26966
  TQuery_.prototype.isApplyingToNode = function (tNode) {
26814
- if (this._appliesToNextNode && this.metadata.descendants === false) {
26967
+ if (this._appliesToNextNode &&
26968
+ (this.metadata.flags & 1 /* descendants */) !== 1 /* descendants */) {
26815
26969
  var declarationNodeIdx = this._declarationNodeIndex;
26816
26970
  var parent = tNode.parent;
26817
26971
  // Determine if a given TNode is a "direct" child of a node on which a content query was
@@ -27024,7 +27178,9 @@
27024
27178
  var queryIndex = getCurrentQueryIndex();
27025
27179
  setCurrentQueryIndex(queryIndex + 1);
27026
27180
  var tQuery = getTQuery(tView, queryIndex);
27027
- if (queryList.dirty && (isCreationMode(lView) === tQuery.metadata.isStatic)) {
27181
+ if (queryList.dirty &&
27182
+ (isCreationMode(lView) ===
27183
+ ((tQuery.metadata.flags & 2 /* isStatic */) === 2 /* isStatic */))) {
27028
27184
  if (tQuery.matches === null) {
27029
27185
  queryList.reset([]);
27030
27186
  }
@@ -27032,45 +27188,32 @@
27032
27188
  var result = tQuery.crossesNgTemplate ?
27033
27189
  collectQueryResults(tView, lView, queryIndex, []) :
27034
27190
  materializeViewResults(tView, lView, tQuery, queryIndex);
27035
- queryList.reset(result);
27191
+ queryList.reset(result, unwrapElementRef);
27036
27192
  queryList.notifyOnChanges();
27037
27193
  }
27038
27194
  return true;
27039
27195
  }
27040
27196
  return false;
27041
27197
  }
27042
- /**
27043
- * Creates new QueryList for a static view query.
27044
- *
27045
- * @param predicate The type for which the query will search
27046
- * @param descend Whether or not to descend into children
27047
- * @param read What to save in the query
27048
- *
27049
- * @codeGenApi
27050
- */
27051
- function ɵɵstaticViewQuery(predicate, descend, read) {
27052
- viewQueryInternal(getTView(), getLView(), predicate, descend, read, true);
27053
- }
27054
27198
  /**
27055
27199
  * Creates new QueryList, stores the reference in LView and returns QueryList.
27056
27200
  *
27057
27201
  * @param predicate The type for which the query will search
27058
- * @param descend Whether or not to descend into children
27202
+ * @param flags Flags associated with the query
27059
27203
  * @param read What to save in the query
27060
27204
  *
27061
27205
  * @codeGenApi
27062
27206
  */
27063
- function ɵɵviewQuery(predicate, descend, read) {
27064
- viewQueryInternal(getTView(), getLView(), predicate, descend, read, false);
27065
- }
27066
- function viewQueryInternal(tView, lView, predicate, descend, read, isStatic) {
27207
+ function ɵɵviewQuery(predicate, flags, read) {
27208
+ ngDevMode && assertNumber(flags, 'Expecting flags');
27209
+ var tView = getTView();
27067
27210
  if (tView.firstCreatePass) {
27068
- createTQuery(tView, new TQueryMetadata_(predicate, descend, isStatic, read), -1);
27069
- if (isStatic) {
27211
+ createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1);
27212
+ if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {
27070
27213
  tView.staticViewQueries = true;
27071
27214
  }
27072
27215
  }
27073
- createLQuery(tView, lView);
27216
+ createLQuery(tView, getLView(), flags);
27074
27217
  }
27075
27218
  /**
27076
27219
  * Registers a QueryList, associated with a content query, for later refresh (part of a view
@@ -27078,39 +27221,24 @@
27078
27221
  *
27079
27222
  * @param directiveIndex Current directive index
27080
27223
  * @param predicate The type for which the query will search
27081
- * @param descend Whether or not to descend into children
27224
+ * @param flags Flags associated with the query
27082
27225
  * @param read What to save in the query
27083
27226
  * @returns QueryList<T>
27084
27227
  *
27085
27228
  * @codeGenApi
27086
27229
  */
27087
- function ɵɵcontentQuery(directiveIndex, predicate, descend, read) {
27088
- contentQueryInternal(getTView(), getLView(), predicate, descend, read, false, getCurrentTNode(), directiveIndex);
27089
- }
27090
- /**
27091
- * Registers a QueryList, associated with a static content query, for later refresh
27092
- * (part of a view refresh).
27093
- *
27094
- * @param directiveIndex Current directive index
27095
- * @param predicate The type for which the query will search
27096
- * @param descend Whether or not to descend into children
27097
- * @param read What to save in the query
27098
- * @returns QueryList<T>
27099
- *
27100
- * @codeGenApi
27101
- */
27102
- function ɵɵstaticContentQuery(directiveIndex, predicate, descend, read) {
27103
- contentQueryInternal(getTView(), getLView(), predicate, descend, read, true, getCurrentTNode(), directiveIndex);
27104
- }
27105
- function contentQueryInternal(tView, lView, predicate, descend, read, isStatic, tNode, directiveIndex) {
27230
+ function ɵɵcontentQuery(directiveIndex, predicate, flags, read) {
27231
+ ngDevMode && assertNumber(flags, 'Expecting flags');
27232
+ var tView = getTView();
27106
27233
  if (tView.firstCreatePass) {
27107
- createTQuery(tView, new TQueryMetadata_(predicate, descend, isStatic, read), tNode.index);
27234
+ var tNode = getCurrentTNode();
27235
+ createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index);
27108
27236
  saveContentQueryAndDirectiveIndex(tView, directiveIndex);
27109
- if (isStatic) {
27237
+ if ((flags & 2 /* isStatic */) === 2 /* isStatic */) {
27110
27238
  tView.staticContentQueries = true;
27111
27239
  }
27112
27240
  }
27113
- createLQuery(tView, lView);
27241
+ createLQuery(tView, getLView(), flags);
27114
27242
  }
27115
27243
  /**
27116
27244
  * Loads a QueryList corresponding to the current view or content query.
@@ -27126,8 +27254,8 @@
27126
27254
  ngDevMode && assertIndexInRange(lView[QUERIES].queries, queryIndex);
27127
27255
  return lView[QUERIES].queries[queryIndex].queryList;
27128
27256
  }
27129
- function createLQuery(tView, lView) {
27130
- var queryList = new QueryList();
27257
+ function createLQuery(tView, lView, flags) {
27258
+ var queryList = new QueryList((flags & 4 /* emitDistinctChangesOnly */) === 4 /* emitDistinctChangesOnly */);
27131
27259
  storeCleanupWithContext(tView, lView, queryList, queryList.destroy);
27132
27260
  if (lView[QUERIES] === null)
27133
27261
  lView[QUERIES] = new LQueries_();
@@ -27276,8 +27404,6 @@
27276
27404
  'ɵɵpipe': ɵɵpipe,
27277
27405
  'ɵɵqueryRefresh': ɵɵqueryRefresh,
27278
27406
  'ɵɵviewQuery': ɵɵviewQuery,
27279
- 'ɵɵstaticViewQuery': ɵɵstaticViewQuery,
27280
- 'ɵɵstaticContentQuery': ɵɵstaticContentQuery,
27281
27407
  'ɵɵloadQuery': ɵɵloadQuery,
27282
27408
  'ɵɵcontentQuery': ɵɵcontentQuery,
27283
27409
  'ɵɵreference': ɵɵreference,
@@ -28043,7 +28169,8 @@
28043
28169
  descendants: ann.descendants,
28044
28170
  first: ann.first,
28045
28171
  read: ann.read ? ann.read : null,
28046
- static: !!ann.static
28172
+ static: !!ann.static,
28173
+ emitDistinctChangesOnly: !!ann.emitDistinctChangesOnly,
28047
28174
  };
28048
28175
  }
28049
28176
  function extractQueriesMetadata(type, propMetadata, isQueryAnn) {
@@ -28629,7 +28756,7 @@
28629
28756
  * found in the LICENSE file at https://angular.io/license
28630
28757
  */
28631
28758
  /**
28632
- * Combination of NgModuleFactory and ComponentFactorys.
28759
+ * Combination of NgModuleFactory and ComponentFactories.
28633
28760
  *
28634
28761
  * @publicApi
28635
28762
  */
@@ -31579,8 +31706,8 @@
31579
31706
  ngContent: null
31580
31707
  };
31581
31708
  }
31582
- function createQuery() {
31583
- return new QueryList();
31709
+ function createQuery(emitDistinctChangesOnly) {
31710
+ return new QueryList(emitDistinctChangesOnly);
31584
31711
  }
31585
31712
  function dirtyParentQueries(view) {
31586
31713
  var queryIds = view.def.nodeMatchedQueries;
@@ -31632,7 +31759,7 @@
31632
31759
  newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query, []);
31633
31760
  directiveInstance = view.component;
31634
31761
  }
31635
- queryList.reset(newValues);
31762
+ queryList.reset(newValues, unwrapElementRef);
31636
31763
  var bindings = nodeDef.query.bindings;
31637
31764
  var notify = false;
31638
31765
  for (var i = 0; i < bindings.length; i++) {
@@ -32386,7 +32513,8 @@
32386
32513
  break;
32387
32514
  case 67108864 /* TypeContentQuery */:
32388
32515
  case 134217728 /* TypeViewQuery */:
32389
- nodeData = createQuery();
32516
+ nodeData = createQuery((nodeDef.flags & -2147483648 /* EmitDistinctChangesOnly */) ===
32517
+ -2147483648 /* EmitDistinctChangesOnly */);
32390
32518
  break;
32391
32519
  case 8 /* TypeNgContent */:
32392
32520
  appendNgContent(view, renderHost, nodeDef);
@@ -33747,7 +33875,7 @@
33747
33875
  exports.platformCore = platformCore;
33748
33876
  exports.resolveForwardRef = resolveForwardRef;
33749
33877
  exports.setTestabilityGetter = setTestabilityGetter;
33750
- exports.ɵ0 = ɵ0$2;
33878
+ exports.ɵ0 = ɵ0$3;
33751
33879
  exports.ɵALLOW_MULTIPLE_PLATFORMS = ALLOW_MULTIPLE_PLATFORMS;
33752
33880
  exports.ɵAPP_ID_RANDOM_PROVIDER = APP_ID_RANDOM_PROVIDER;
33753
33881
  exports.ɵCREATE_ATTRIBUTE_DECORATOR__POST_R3__ = CREATE_ATTRIBUTE_DECORATOR__POST_R3__;
@@ -33796,53 +33924,54 @@
33796
33924
  exports.ɵand = anchorDef;
33797
33925
  exports.ɵangular_packages_core_core_a = isForwardRef;
33798
33926
  exports.ɵangular_packages_core_core_b = injectInjectorOnly;
33799
- exports.ɵangular_packages_core_core_ba = USD_CURRENCY_CODE;
33800
- exports.ɵangular_packages_core_core_bb = _def;
33801
- exports.ɵangular_packages_core_core_bc = DebugContext;
33802
- exports.ɵangular_packages_core_core_bd = NgOnChangesFeatureImpl;
33803
- exports.ɵangular_packages_core_core_be = SCHEDULER;
33804
- exports.ɵangular_packages_core_core_bf = injectAttributeImpl;
33805
- exports.ɵangular_packages_core_core_bg = getLView;
33806
- exports.ɵangular_packages_core_core_bh = getBindingRoot;
33807
- exports.ɵangular_packages_core_core_bi = nextContextImpl;
33808
- exports.ɵangular_packages_core_core_bk = pureFunction1Internal;
33809
- exports.ɵangular_packages_core_core_bl = pureFunction2Internal;
33810
- exports.ɵangular_packages_core_core_bm = pureFunction3Internal;
33811
- exports.ɵangular_packages_core_core_bn = pureFunction4Internal;
33812
- exports.ɵangular_packages_core_core_bo = pureFunctionVInternal;
33813
- exports.ɵangular_packages_core_core_bp = getUrlSanitizer;
33814
- exports.ɵangular_packages_core_core_bq = makePropDecorator;
33815
- exports.ɵangular_packages_core_core_br = makeParamDecorator;
33816
- exports.ɵangular_packages_core_core_bs = getClosureSafeProperty;
33817
- exports.ɵangular_packages_core_core_bt = NullInjector;
33818
- exports.ɵangular_packages_core_core_bu = getInjectImplementation;
33819
- exports.ɵangular_packages_core_core_bw = getNativeByTNode;
33820
- exports.ɵangular_packages_core_core_by = getRootContext;
33821
- exports.ɵangular_packages_core_core_bz = i18nPostprocess;
33822
- exports.ɵangular_packages_core_core_c = ReflectiveInjector_;
33823
- exports.ɵangular_packages_core_core_d = ReflectiveDependency;
33824
- exports.ɵangular_packages_core_core_e = resolveReflectiveProviders;
33825
- exports.ɵangular_packages_core_core_f = _appIdRandomProviderFactory;
33826
- exports.ɵangular_packages_core_core_g = injectRenderer2;
33827
- exports.ɵangular_packages_core_core_h = injectElementRef;
33828
- exports.ɵangular_packages_core_core_i = createElementRef;
33829
- exports.ɵangular_packages_core_core_j = getModuleFactory__PRE_R3__;
33830
- exports.ɵangular_packages_core_core_k = injectTemplateRef;
33831
- exports.ɵangular_packages_core_core_l = createTemplateRef;
33832
- exports.ɵangular_packages_core_core_m = injectViewContainerRef;
33833
- exports.ɵangular_packages_core_core_n = DebugNode__PRE_R3__;
33834
- exports.ɵangular_packages_core_core_o = DebugElement__PRE_R3__;
33835
- exports.ɵangular_packages_core_core_p = getDebugNodeR2__PRE_R3__;
33836
- exports.ɵangular_packages_core_core_q = injectChangeDetectorRef;
33837
- exports.ɵangular_packages_core_core_r = DefaultIterableDifferFactory;
33838
- exports.ɵangular_packages_core_core_s = DefaultKeyValueDifferFactory;
33839
- exports.ɵangular_packages_core_core_t = defaultIterableDiffersFactory;
33840
- exports.ɵangular_packages_core_core_u = defaultKeyValueDiffersFactory;
33841
- exports.ɵangular_packages_core_core_v = _iterableDiffersFactory;
33842
- exports.ɵangular_packages_core_core_w = _keyValueDiffersFactory;
33843
- exports.ɵangular_packages_core_core_x = _localeFactory;
33844
- exports.ɵangular_packages_core_core_y = APPLICATION_MODULE_PROVIDERS;
33845
- exports.ɵangular_packages_core_core_z = zoneSchedulerFactory;
33927
+ exports.ɵangular_packages_core_core_ba = zoneSchedulerFactory;
33928
+ exports.ɵangular_packages_core_core_bb = USD_CURRENCY_CODE;
33929
+ exports.ɵangular_packages_core_core_bc = _def;
33930
+ exports.ɵangular_packages_core_core_bd = DebugContext;
33931
+ exports.ɵangular_packages_core_core_be = NgOnChangesFeatureImpl;
33932
+ exports.ɵangular_packages_core_core_bf = SCHEDULER;
33933
+ exports.ɵangular_packages_core_core_bg = injectAttributeImpl;
33934
+ exports.ɵangular_packages_core_core_bh = getLView;
33935
+ exports.ɵangular_packages_core_core_bi = getBindingRoot;
33936
+ exports.ɵangular_packages_core_core_bj = nextContextImpl;
33937
+ exports.ɵangular_packages_core_core_bl = pureFunction1Internal;
33938
+ exports.ɵangular_packages_core_core_bm = pureFunction2Internal;
33939
+ exports.ɵangular_packages_core_core_bn = pureFunction3Internal;
33940
+ exports.ɵangular_packages_core_core_bo = pureFunction4Internal;
33941
+ exports.ɵangular_packages_core_core_bp = pureFunctionVInternal;
33942
+ exports.ɵangular_packages_core_core_bq = getUrlSanitizer;
33943
+ exports.ɵangular_packages_core_core_br = makePropDecorator;
33944
+ exports.ɵangular_packages_core_core_bs = makeParamDecorator;
33945
+ exports.ɵangular_packages_core_core_bv = getClosureSafeProperty;
33946
+ exports.ɵangular_packages_core_core_bw = NullInjector;
33947
+ exports.ɵangular_packages_core_core_bx = getInjectImplementation;
33948
+ exports.ɵangular_packages_core_core_bz = getNativeByTNode;
33949
+ exports.ɵangular_packages_core_core_c = attachInjectFlag;
33950
+ exports.ɵangular_packages_core_core_cb = getRootContext;
33951
+ exports.ɵangular_packages_core_core_cc = i18nPostprocess;
33952
+ exports.ɵangular_packages_core_core_d = ReflectiveInjector_;
33953
+ exports.ɵangular_packages_core_core_e = ReflectiveDependency;
33954
+ exports.ɵangular_packages_core_core_f = resolveReflectiveProviders;
33955
+ exports.ɵangular_packages_core_core_g = _appIdRandomProviderFactory;
33956
+ exports.ɵangular_packages_core_core_h = injectRenderer2;
33957
+ exports.ɵangular_packages_core_core_i = injectElementRef;
33958
+ exports.ɵangular_packages_core_core_j = createElementRef;
33959
+ exports.ɵangular_packages_core_core_k = getModuleFactory__PRE_R3__;
33960
+ exports.ɵangular_packages_core_core_l = injectTemplateRef;
33961
+ exports.ɵangular_packages_core_core_m = createTemplateRef;
33962
+ exports.ɵangular_packages_core_core_n = injectViewContainerRef;
33963
+ exports.ɵangular_packages_core_core_o = DebugNode__PRE_R3__;
33964
+ exports.ɵangular_packages_core_core_p = DebugElement__PRE_R3__;
33965
+ exports.ɵangular_packages_core_core_q = getDebugNodeR2__PRE_R3__;
33966
+ exports.ɵangular_packages_core_core_r = injectChangeDetectorRef;
33967
+ exports.ɵangular_packages_core_core_s = DefaultIterableDifferFactory;
33968
+ exports.ɵangular_packages_core_core_t = DefaultKeyValueDifferFactory;
33969
+ exports.ɵangular_packages_core_core_u = defaultIterableDiffersFactory;
33970
+ exports.ɵangular_packages_core_core_v = defaultKeyValueDiffersFactory;
33971
+ exports.ɵangular_packages_core_core_w = _iterableDiffersFactory;
33972
+ exports.ɵangular_packages_core_core_x = _keyValueDiffersFactory;
33973
+ exports.ɵangular_packages_core_core_y = _localeFactory;
33974
+ exports.ɵangular_packages_core_core_z = APPLICATION_MODULE_PROVIDERS;
33846
33975
  exports.ɵbypassSanitizationTrustHtml = bypassSanitizationTrustHtml;
33847
33976
  exports.ɵbypassSanitizationTrustResourceUrl = bypassSanitizationTrustResourceUrl;
33848
33977
  exports.ɵbypassSanitizationTrustScript = bypassSanitizationTrustScript;
@@ -34037,8 +34166,6 @@
34037
34166
  exports.ɵɵsanitizeUrlOrResourceUrl = ɵɵsanitizeUrlOrResourceUrl;
34038
34167
  exports.ɵɵsetComponentScope = ɵɵsetComponentScope;
34039
34168
  exports.ɵɵsetNgModuleScope = ɵɵsetNgModuleScope;
34040
- exports.ɵɵstaticContentQuery = ɵɵstaticContentQuery;
34041
- exports.ɵɵstaticViewQuery = ɵɵstaticViewQuery;
34042
34169
  exports.ɵɵstyleMap = ɵɵstyleMap;
34043
34170
  exports.ɵɵstyleMapInterpolate1 = ɵɵstyleMapInterpolate1;
34044
34171
  exports.ɵɵstyleMapInterpolate2 = ɵɵstyleMapInterpolate2;