@angular/core 17.0.0-next.8 → 17.0.0-rc.1

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 (68) hide show
  1. package/esm2022/src/application_init.mjs +3 -2
  2. package/esm2022/src/application_ref.mjs +4 -3
  3. package/esm2022/src/application_tokens.mjs +1 -11
  4. package/esm2022/src/core.mjs +2 -2
  5. package/esm2022/src/core_private_export.mjs +5 -4
  6. package/esm2022/src/core_render3_private_export.mjs +2 -2
  7. package/esm2022/src/debug/debug_node.mjs +5 -9
  8. package/esm2022/src/defer/cleanup.mjs +40 -0
  9. package/esm2022/src/defer/discovery.mjs +47 -0
  10. package/esm2022/src/defer/dom_triggers.mjs +256 -0
  11. package/esm2022/src/defer/idle_scheduler.mjs +112 -0
  12. package/esm2022/src/defer/instructions.mjs +662 -0
  13. package/esm2022/src/defer/interfaces.mjs +81 -0
  14. package/esm2022/src/defer/timer_scheduler.mjs +201 -0
  15. package/esm2022/src/defer/utils.mjs +122 -0
  16. package/esm2022/src/di/r3_injector.mjs +6 -1
  17. package/esm2022/src/errors.mjs +1 -1
  18. package/esm2022/src/hydration/api.mjs +2 -4
  19. package/esm2022/src/hydration/skip_hydration.mjs +7 -7
  20. package/esm2022/src/hydration/utils.mjs +2 -2
  21. package/esm2022/src/linker/view_container_ref.mjs +4 -6
  22. package/esm2022/src/metadata/directives.mjs +1 -1
  23. package/esm2022/src/render/api.mjs +1 -1
  24. package/esm2022/src/render3/after_render_hooks.mjs +55 -21
  25. package/esm2022/src/render3/debug/injector_profiler.mjs +26 -8
  26. package/esm2022/src/render3/index.mjs +3 -2
  27. package/esm2022/src/render3/instructions/all.mjs +2 -2
  28. package/esm2022/src/render3/instructions/change_detection.mjs +24 -3
  29. package/esm2022/src/render3/instructions/control_flow.mjs +25 -15
  30. package/esm2022/src/render3/interfaces/container.mjs +1 -4
  31. package/esm2022/src/render3/interfaces/definition.mjs +2 -4
  32. package/esm2022/src/render3/interfaces/i18n.mjs +1 -4
  33. package/esm2022/src/render3/interfaces/injector.mjs +1 -4
  34. package/esm2022/src/render3/interfaces/node.mjs +1 -4
  35. package/esm2022/src/render3/interfaces/projection.mjs +2 -4
  36. package/esm2022/src/render3/interfaces/query.mjs +2 -4
  37. package/esm2022/src/render3/interfaces/renderer.mjs +2 -4
  38. package/esm2022/src/render3/interfaces/renderer_dom.mjs +2 -4
  39. package/esm2022/src/render3/interfaces/view.mjs +1 -4
  40. package/esm2022/src/render3/list_reconciliation.mjs +58 -34
  41. package/esm2022/src/render3/reactive_lview_consumer.mjs +2 -7
  42. package/esm2022/src/render3/util/injector_discovery_utils.mjs +26 -2
  43. package/esm2022/src/render3/util/view_utils.mjs +1 -4
  44. package/esm2022/src/version.mjs +1 -1
  45. package/esm2022/testing/src/defer.mjs +6 -3
  46. package/esm2022/testing/src/logger.mjs +3 -3
  47. package/fesm2022/core.mjs +1015 -932
  48. package/fesm2022/core.mjs.map +1 -1
  49. package/fesm2022/primitives/signals.mjs +1 -1
  50. package/fesm2022/rxjs-interop.mjs +1 -1
  51. package/fesm2022/testing.mjs +6 -3
  52. package/fesm2022/testing.mjs.map +1 -1
  53. package/index.d.ts +54 -18
  54. package/package.json +1 -1
  55. package/primitives/signals/index.d.ts +1 -1
  56. package/rxjs-interop/index.d.ts +1 -1
  57. package/schematics/migrations/block-template-entities/bundle.js +1051 -467
  58. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  59. package/schematics/migrations/compiler-options/bundle.js +13 -13
  60. package/schematics/migrations/transfer-state/bundle.js +13 -13
  61. package/schematics/ng-generate/control-flow-migration/bundle.js +1284 -612
  62. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  63. package/schematics/ng-generate/standalone-migration/bundle.js +1300 -708
  64. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  65. package/testing/index.d.ts +1 -1
  66. package/esm2022/src/render3/instructions/defer.mjs +0 -1225
  67. package/esm2022/src/render3/instructions/defer_events.mjs +0 -174
  68. package/esm2022/src/render3/interfaces/defer.mjs +0 -79
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
63
63
  });
64
64
  };
65
65
 
66
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
66
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
67
67
  var block_template_entities_exports = {};
68
68
  __export(block_template_entities_exports, {
69
69
  default: () => block_template_entities_default
@@ -72,7 +72,7 @@ module.exports = __toCommonJS(block_template_entities_exports);
72
72
  var import_schematics = require("@angular-devkit/schematics");
73
73
  var import_path3 = require("path");
74
74
 
75
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
75
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
76
76
  var import_core = require("@angular-devkit/core");
77
77
  function getProjectTsConfigPaths(tree) {
78
78
  return __async(this, null, function* () {
@@ -152,11 +152,11 @@ function getWorkspace(tree) {
152
152
  });
153
153
  }
154
154
 
155
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
155
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
156
156
  var import_path = require("path");
157
157
  var import_typescript2 = __toESM(require("typescript"), 1);
158
158
 
159
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
159
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
160
160
  var path = __toESM(require("path"), 1);
161
161
  var import_typescript = __toESM(require("typescript"), 1);
162
162
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -173,7 +173,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
173
173
  return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
174
174
  }
175
175
 
176
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
176
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
177
177
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
178
178
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
179
179
  return import_typescript2.default.createProgram(rootNames, options, host);
@@ -206,7 +206,7 @@ function canMigrateFile(basePath, sourceFile, program) {
206
206
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
207
207
  }
208
208
 
209
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/selector.mjs
209
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
210
210
  var _SELECTOR_REGEXP = new RegExp(
211
211
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
212
212
  "g"
@@ -514,7 +514,7 @@ var SelectorContext = class {
514
514
  }
515
515
  };
516
516
 
517
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/core.mjs
517
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
518
518
  var ViewEncapsulation;
519
519
  (function(ViewEncapsulation2) {
520
520
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
@@ -576,7 +576,7 @@ function parseSelectorToR3Selector(selector) {
576
576
  return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
577
577
  }
578
578
 
579
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
579
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
580
580
  var textEncoder;
581
581
  function computeDigest(message) {
582
582
  return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
@@ -813,7 +813,7 @@ function wordAt(bytes, index, endian) {
813
813
  return word;
814
814
  }
815
815
 
816
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
816
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
817
817
  var TypeModifier;
818
818
  (function(TypeModifier2) {
819
819
  TypeModifier2[TypeModifier2["None"] = 0] = "None";
@@ -1768,7 +1768,7 @@ function serializeTags(tags) {
1768
1768
  return out;
1769
1769
  }
1770
1770
 
1771
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1771
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1772
1772
  var CONSTANT_PREFIX = "_c";
1773
1773
  var UNKNOWN_VALUE_KEY = variable("<unknown>");
1774
1774
  var KEY_CONTEXT = {};
@@ -1951,7 +1951,7 @@ function isLongStringLiteral(expr) {
1951
1951
  return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
1952
1952
  }
1953
1953
 
1954
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1954
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1955
1955
  var CORE = "@angular/core";
1956
1956
  var _Identifiers = class {
1957
1957
  };
@@ -2584,7 +2584,7 @@ var Identifiers = _Identifiers;
2584
2584
  _Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
2585
2585
  })();
2586
2586
 
2587
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/util.mjs
2587
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
2588
2588
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2589
2589
  function dashCaseToCamelCase(input) {
2590
2590
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
@@ -2672,7 +2672,7 @@ function partitionArray(arr, conditionFn) {
2672
2672
  return [truthy, falsy];
2673
2673
  }
2674
2674
 
2675
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2675
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2676
2676
  var VERSION = 3;
2677
2677
  var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
2678
2678
  var SourceMapGenerator = class {
@@ -2801,7 +2801,7 @@ function toBase64Digit(value) {
2801
2801
  return B64_DIGITS[value];
2802
2802
  }
2803
2803
 
2804
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2804
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2805
2805
  var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
2806
2806
  var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
2807
2807
  var _INDENT_WITH = " ";
@@ -3286,7 +3286,7 @@ function _createIndent(count) {
3286
3286
  return res;
3287
3287
  }
3288
3288
 
3289
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/util.mjs
3289
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
3290
3290
  function typeWithParameters(type, numParams) {
3291
3291
  if (numParams === 0) {
3292
3292
  return expressionType(type);
@@ -3351,7 +3351,7 @@ function generateForwardRef(expr) {
3351
3351
  return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
3352
3352
  }
3353
3353
 
3354
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3354
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3355
3355
  var R3FactoryDelegateType;
3356
3356
  (function(R3FactoryDelegateType2) {
3357
3357
  R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
@@ -3496,7 +3496,7 @@ function getInjectFn(target) {
3496
3496
  }
3497
3497
  }
3498
3498
 
3499
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3499
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3500
3500
  var Comment = class {
3501
3501
  constructor(value, sourceSpan) {
3502
3502
  this.value = value;
@@ -3785,9 +3785,10 @@ var IfBlockBranch = class {
3785
3785
  }
3786
3786
  };
3787
3787
  var UnknownBlock = class {
3788
- constructor(name, sourceSpan) {
3788
+ constructor(name, sourceSpan, nameSpan) {
3789
3789
  this.name = name;
3790
3790
  this.sourceSpan = sourceSpan;
3791
+ this.nameSpan = nameSpan;
3791
3792
  }
3792
3793
  visit(visitor) {
3793
3794
  return visitor.visitUnknownBlock(this);
@@ -3876,7 +3877,7 @@ function visitAll(visitor, nodes) {
3876
3877
  return result;
3877
3878
  }
3878
3879
 
3879
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3880
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3880
3881
  var Message = class {
3881
3882
  constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
3882
3883
  this.nodes = nodes;
@@ -3995,7 +3996,7 @@ var LocalizeMessageStringVisitor = class {
3995
3996
  }
3996
3997
  };
3997
3998
 
3998
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
3999
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
3999
4000
  var _Visitor = class {
4000
4001
  visitTag(tag) {
4001
4002
  const strAttrs = this._serializeAttributes(tag.attrs);
@@ -4023,12 +4024,12 @@ ${doctype.dtd}
4023
4024
  };
4024
4025
  var _visitor = new _Visitor();
4025
4026
 
4026
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4027
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4027
4028
  function toPublicName(internalName) {
4028
4029
  return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
4029
4030
  }
4030
4031
 
4031
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4032
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4032
4033
  var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
4033
4034
  var TRANSLATION_VAR_PREFIX = "i18n_";
4034
4035
  var I18N_ATTR = "i18n";
@@ -4130,7 +4131,7 @@ function declareI18nVariable(variable2) {
4130
4131
  return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
4131
4132
  }
4132
4133
 
4133
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4134
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4134
4135
  var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
4135
4136
  var TEMPORARY_NAME = "_t";
4136
4137
  var CONTEXT_NAME = "ctx";
@@ -4353,7 +4354,7 @@ function getInstructionStatements(instructions) {
4353
4354
  return statements;
4354
4355
  }
4355
4356
 
4356
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4357
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4357
4358
  function compileInjectable(meta, resolveForwardRefs) {
4358
4359
  let result = null;
4359
4360
  const factoryMeta = {
@@ -4438,7 +4439,7 @@ function createFactoryFunction(type) {
4438
4439
  return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
4439
4440
  }
4440
4441
 
4441
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/assertions.mjs
4442
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
4442
4443
  var UNUSABLE_INTERPOLATION_REGEXPS = [
4443
4444
  /^\s*$/,
4444
4445
  /[<>]/,
@@ -4460,7 +4461,7 @@ function assertInterpolationSymbols(identifier, value) {
4460
4461
  }
4461
4462
  }
4462
4463
 
4463
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/interpolation_config.mjs
4464
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/interpolation_config.mjs
4464
4465
  var InterpolationConfig = class {
4465
4466
  static fromArray(markers) {
4466
4467
  if (!markers) {
@@ -4476,7 +4477,7 @@ var InterpolationConfig = class {
4476
4477
  };
4477
4478
  var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
4478
4479
 
4479
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/chars.mjs
4480
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
4480
4481
  var $EOF = 0;
4481
4482
  var $BSPACE = 8;
4482
4483
  var $TAB = 9;
@@ -4558,7 +4559,7 @@ function isQuote(code) {
4558
4559
  return code === $SQ || code === $DQ || code === $BT;
4559
4560
  }
4560
4561
 
4561
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/parse_util.mjs
4562
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
4562
4563
  var ParseLocation = class {
4563
4564
  constructor(file, offset, line, col) {
4564
4565
  this.file = file;
@@ -4705,7 +4706,7 @@ function sanitizeIdentifier(name) {
4705
4706
  return name.replace(/\W/g, "_");
4706
4707
  }
4707
4708
 
4708
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4709
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4709
4710
  var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
4710
4711
  var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4711
4712
  constructor() {
@@ -4798,7 +4799,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4798
4799
  }
4799
4800
  };
4800
4801
 
4801
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4802
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4802
4803
  var policy;
4803
4804
  function getPolicy() {
4804
4805
  if (policy === void 0) {
@@ -4836,7 +4837,7 @@ function newTrustedFunctionForJIT(...args) {
4836
4837
  return fn2.bind(_global);
4837
4838
  }
4838
4839
 
4839
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4840
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4840
4841
  var JitEvaluator = class {
4841
4842
  evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
4842
4843
  const converter = new JitEmitterVisitor(refResolver);
@@ -4927,7 +4928,7 @@ function isUseStrictStatement(statement) {
4927
4928
  return statement.isEquivalent(literal("use strict").toStmt());
4928
4929
  }
4929
4930
 
4930
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4931
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4931
4932
  function compileInjector(meta) {
4932
4933
  const definitionMap = new DefinitionMap();
4933
4934
  if (meta.providers !== null) {
@@ -4944,7 +4945,7 @@ function createInjectorType(meta) {
4944
4945
  return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
4945
4946
  }
4946
4947
 
4947
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4948
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4948
4949
  var R3JitReflector = class {
4949
4950
  constructor(context) {
4950
4951
  this.context = context;
@@ -4960,7 +4961,7 @@ var R3JitReflector = class {
4960
4961
  }
4961
4962
  };
4962
4963
 
4963
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4964
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4964
4965
  var R3SelectorScopeMode;
4965
4966
  (function(R3SelectorScopeMode2) {
4966
4967
  R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
@@ -5101,7 +5102,7 @@ function tupleOfTypes(types) {
5101
5102
  return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
5102
5103
  }
5103
5104
 
5104
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5105
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5105
5106
  function compilePipeFromMetadata(metadata) {
5106
5107
  const definitionMapValues = [];
5107
5108
  definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
@@ -5122,7 +5123,7 @@ function createPipeType(metadata) {
5122
5123
  ]));
5123
5124
  }
5124
5125
 
5125
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5126
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5126
5127
  var R3TemplateDependencyKind;
5127
5128
  (function(R3TemplateDependencyKind2) {
5128
5129
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
@@ -5130,7 +5131,7 @@ var R3TemplateDependencyKind;
5130
5131
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
5131
5132
  })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
5132
5133
 
5133
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5134
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5134
5135
  var ParserError = class {
5135
5136
  constructor(message, input, errLocation, ctxLocation) {
5136
5137
  this.input = input;
@@ -5796,7 +5797,7 @@ var BoundElementProperty = class {
5796
5797
  }
5797
5798
  };
5798
5799
 
5799
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5800
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5800
5801
  var _EventHandlerVars = class {
5801
5802
  };
5802
5803
  var EventHandlerVars = _EventHandlerVars;
@@ -6437,7 +6438,7 @@ var BuiltinFunctionCall = class extends Call {
6437
6438
  }
6438
6439
  };
6439
6440
 
6440
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6441
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6441
6442
  var _SECURITY_SCHEMA;
6442
6443
  function SECURITY_SCHEMA() {
6443
6444
  if (!_SECURITY_SCHEMA) {
@@ -6495,7 +6496,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
6495
6496
  return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
6496
6497
  }
6497
6498
 
6498
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6499
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6499
6500
  var animationKeywords = /* @__PURE__ */ new Set([
6500
6501
  "inherit",
6501
6502
  "initial",
@@ -6742,7 +6743,7 @@ var ShadowCss = class {
6742
6743
  while ((res = sep.exec(selector)) !== null) {
6743
6744
  const separator = res[1];
6744
6745
  const part2 = selector.slice(startIndex, res.index).trim();
6745
- if (part2.match(_placeholderRe) && ((_a2 = selector[res.index + 1]) == null ? void 0 : _a2.match(/[a-fA-F\d]/))) {
6746
+ if (part2.match(/__esc-ph-(\d+)__/) && ((_a2 = selector[res.index + 1]) == null ? void 0 : _a2.match(/[a-fA-F\d]/))) {
6746
6747
  continue;
6747
6748
  }
6748
6749
  shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
@@ -6764,7 +6765,12 @@ var SafeSelector = class {
6764
6765
  this.placeholders = [];
6765
6766
  this.index = 0;
6766
6767
  selector = this._escapeRegexMatches(selector, /(\[[^\]]*\])/g);
6767
- selector = this._escapeRegexMatches(selector, /(\\.)/g);
6768
+ selector = selector.replace(/(\\.)/g, (_, keep) => {
6769
+ const replaceBy = `__esc-ph-${this.index}__`;
6770
+ this.placeholders.push(keep);
6771
+ this.index++;
6772
+ return replaceBy;
6773
+ });
6768
6774
  this._content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
6769
6775
  const replaceBy = `__ph-${this.index}__`;
6770
6776
  this.placeholders.push(exp);
@@ -6773,7 +6779,7 @@ var SafeSelector = class {
6773
6779
  });
6774
6780
  }
6775
6781
  restore(content) {
6776
- return content.replace(_placeholderRe, (_ph, index) => this.placeholders[+index]);
6782
+ return content.replace(/__(?:ph|esc-ph)-(\d+)__/g, (_ph, index) => this.placeholders[+index]);
6777
6783
  }
6778
6784
  content() {
6779
6785
  return this._content;
@@ -6814,7 +6820,6 @@ var _commentRe = /\/\*[\s\S]*?\*\//g;
6814
6820
  var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=/g;
6815
6821
  var COMMENT_PLACEHOLDER = "%COMMENT%";
6816
6822
  var _commentWithHashPlaceHolderRe = new RegExp(COMMENT_PLACEHOLDER, "g");
6817
- var _placeholderRe = /__ph-(\d+)__/g;
6818
6823
  var BLOCK_PLACEHOLDER = "%BLOCK%";
6819
6824
  var _ruleRe = new RegExp(`(\\s*(?:${COMMENT_PLACEHOLDER}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`, "g");
6820
6825
  var CONTENT_PAIRS = /* @__PURE__ */ new Map([["{", "}"]]);
@@ -6962,7 +6967,7 @@ function repeatGroups(groups, multiples) {
6962
6967
  }
6963
6968
  }
6964
6969
 
6965
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6970
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6966
6971
  var OpKind;
6967
6972
  (function(OpKind2) {
6968
6973
  OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
@@ -6999,42 +7004,54 @@ var OpKind;
6999
7004
  OpKind2[OpKind2["Namespace"] = 31] = "Namespace";
7000
7005
  OpKind2[OpKind2["ProjectionDef"] = 32] = "ProjectionDef";
7001
7006
  OpKind2[OpKind2["Projection"] = 33] = "Projection";
7002
- OpKind2[OpKind2["I18nStart"] = 34] = "I18nStart";
7003
- OpKind2[OpKind2["I18n"] = 35] = "I18n";
7004
- OpKind2[OpKind2["I18nEnd"] = 36] = "I18nEnd";
7005
- OpKind2[OpKind2["I18nExpression"] = 37] = "I18nExpression";
7006
- OpKind2[OpKind2["I18nApply"] = 38] = "I18nApply";
7007
+ OpKind2[OpKind2["RepeaterCreate"] = 34] = "RepeaterCreate";
7008
+ OpKind2[OpKind2["Repeater"] = 35] = "Repeater";
7009
+ OpKind2[OpKind2["I18nStart"] = 36] = "I18nStart";
7010
+ OpKind2[OpKind2["I18n"] = 37] = "I18n";
7011
+ OpKind2[OpKind2["I18nEnd"] = 38] = "I18nEnd";
7012
+ OpKind2[OpKind2["I18nExpression"] = 39] = "I18nExpression";
7013
+ OpKind2[OpKind2["I18nApply"] = 40] = "I18nApply";
7014
+ OpKind2[OpKind2["Icu"] = 41] = "Icu";
7015
+ OpKind2[OpKind2["IcuUpdate"] = 42] = "IcuUpdate";
7007
7016
  })(OpKind || (OpKind = {}));
7008
7017
  var ExpressionKind;
7009
7018
  (function(ExpressionKind2) {
7010
7019
  ExpressionKind2[ExpressionKind2["LexicalRead"] = 0] = "LexicalRead";
7011
7020
  ExpressionKind2[ExpressionKind2["Context"] = 1] = "Context";
7012
- ExpressionKind2[ExpressionKind2["ReadVariable"] = 2] = "ReadVariable";
7013
- ExpressionKind2[ExpressionKind2["NextContext"] = 3] = "NextContext";
7014
- ExpressionKind2[ExpressionKind2["Reference"] = 4] = "Reference";
7015
- ExpressionKind2[ExpressionKind2["GetCurrentView"] = 5] = "GetCurrentView";
7016
- ExpressionKind2[ExpressionKind2["RestoreView"] = 6] = "RestoreView";
7017
- ExpressionKind2[ExpressionKind2["ResetView"] = 7] = "ResetView";
7018
- ExpressionKind2[ExpressionKind2["PureFunctionExpr"] = 8] = "PureFunctionExpr";
7019
- ExpressionKind2[ExpressionKind2["PureFunctionParameterExpr"] = 9] = "PureFunctionParameterExpr";
7020
- ExpressionKind2[ExpressionKind2["PipeBinding"] = 10] = "PipeBinding";
7021
- ExpressionKind2[ExpressionKind2["PipeBindingVariadic"] = 11] = "PipeBindingVariadic";
7022
- ExpressionKind2[ExpressionKind2["SafePropertyRead"] = 12] = "SafePropertyRead";
7023
- ExpressionKind2[ExpressionKind2["SafeKeyedRead"] = 13] = "SafeKeyedRead";
7024
- ExpressionKind2[ExpressionKind2["SafeInvokeFunction"] = 14] = "SafeInvokeFunction";
7025
- ExpressionKind2[ExpressionKind2["SafeTernaryExpr"] = 15] = "SafeTernaryExpr";
7026
- ExpressionKind2[ExpressionKind2["EmptyExpr"] = 16] = "EmptyExpr";
7027
- ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 17] = "AssignTemporaryExpr";
7028
- ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 18] = "ReadTemporaryExpr";
7029
- ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 19] = "SanitizerExpr";
7030
- ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 20] = "SlotLiteralExpr";
7031
- ExpressionKind2[ExpressionKind2["ConditionalCase"] = 21] = "ConditionalCase";
7021
+ ExpressionKind2[ExpressionKind2["TrackContext"] = 2] = "TrackContext";
7022
+ ExpressionKind2[ExpressionKind2["ReadVariable"] = 3] = "ReadVariable";
7023
+ ExpressionKind2[ExpressionKind2["NextContext"] = 4] = "NextContext";
7024
+ ExpressionKind2[ExpressionKind2["Reference"] = 5] = "Reference";
7025
+ ExpressionKind2[ExpressionKind2["GetCurrentView"] = 6] = "GetCurrentView";
7026
+ ExpressionKind2[ExpressionKind2["RestoreView"] = 7] = "RestoreView";
7027
+ ExpressionKind2[ExpressionKind2["ResetView"] = 8] = "ResetView";
7028
+ ExpressionKind2[ExpressionKind2["PureFunctionExpr"] = 9] = "PureFunctionExpr";
7029
+ ExpressionKind2[ExpressionKind2["PureFunctionParameterExpr"] = 10] = "PureFunctionParameterExpr";
7030
+ ExpressionKind2[ExpressionKind2["PipeBinding"] = 11] = "PipeBinding";
7031
+ ExpressionKind2[ExpressionKind2["PipeBindingVariadic"] = 12] = "PipeBindingVariadic";
7032
+ ExpressionKind2[ExpressionKind2["SafePropertyRead"] = 13] = "SafePropertyRead";
7033
+ ExpressionKind2[ExpressionKind2["SafeKeyedRead"] = 14] = "SafeKeyedRead";
7034
+ ExpressionKind2[ExpressionKind2["SafeInvokeFunction"] = 15] = "SafeInvokeFunction";
7035
+ ExpressionKind2[ExpressionKind2["SafeTernaryExpr"] = 16] = "SafeTernaryExpr";
7036
+ ExpressionKind2[ExpressionKind2["EmptyExpr"] = 17] = "EmptyExpr";
7037
+ ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
7038
+ ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
7039
+ ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 20] = "SanitizerExpr";
7040
+ ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 21] = "SlotLiteralExpr";
7041
+ ExpressionKind2[ExpressionKind2["ConditionalCase"] = 22] = "ConditionalCase";
7042
+ ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 23] = "DerivedRepeaterVar";
7032
7043
  })(ExpressionKind || (ExpressionKind = {}));
7044
+ var VariableFlags;
7045
+ (function(VariableFlags2) {
7046
+ VariableFlags2[VariableFlags2["None"] = 0] = "None";
7047
+ VariableFlags2[VariableFlags2["AlwaysInline"] = 1] = "AlwaysInline";
7048
+ })(VariableFlags || (VariableFlags = {}));
7033
7049
  var SemanticVariableKind;
7034
7050
  (function(SemanticVariableKind2) {
7035
7051
  SemanticVariableKind2[SemanticVariableKind2["Context"] = 0] = "Context";
7036
7052
  SemanticVariableKind2[SemanticVariableKind2["Identifier"] = 1] = "Identifier";
7037
7053
  SemanticVariableKind2[SemanticVariableKind2["SavedView"] = 2] = "SavedView";
7054
+ SemanticVariableKind2[SemanticVariableKind2["Alias"] = 3] = "Alias";
7038
7055
  })(SemanticVariableKind || (SemanticVariableKind = {}));
7039
7056
  var CompatibilityMode;
7040
7057
  (function(CompatibilityMode2) {
@@ -7066,8 +7083,13 @@ var BindingKind;
7066
7083
  BindingKind2[BindingKind2["I18n"] = 5] = "I18n";
7067
7084
  BindingKind2[BindingKind2["Animation"] = 6] = "Animation";
7068
7085
  })(BindingKind || (BindingKind = {}));
7086
+ var I18nParamResolutionTime;
7087
+ (function(I18nParamResolutionTime2) {
7088
+ I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
7089
+ I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
7090
+ })(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
7069
7091
 
7070
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7092
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7071
7093
  var ConsumesSlot = Symbol("ConsumesSlot");
7072
7094
  var DependsOnSlotContext = Symbol("DependsOnSlotContext");
7073
7095
  var UsesSlotIndex = Symbol("UsesSlotIndex");
@@ -7116,19 +7138,20 @@ function hasConstTrait(value) {
7116
7138
  return value[HasConst] === true;
7117
7139
  }
7118
7140
 
7119
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7141
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7120
7142
  function createStatementOp(statement) {
7121
7143
  return __spreadValues({
7122
7144
  kind: OpKind.Statement,
7123
7145
  statement
7124
7146
  }, NEW_OP);
7125
7147
  }
7126
- function createVariableOp(xref, variable2, initializer) {
7148
+ function createVariableOp(xref, variable2, initializer, flags) {
7127
7149
  return __spreadValues({
7128
7150
  kind: OpKind.Variable,
7129
7151
  xref,
7130
7152
  variable: variable2,
7131
- initializer
7153
+ initializer,
7154
+ flags
7132
7155
  }, NEW_OP);
7133
7156
  }
7134
7157
  var NEW_OP = {
@@ -7137,7 +7160,7 @@ var NEW_OP = {
7137
7160
  next: null
7138
7161
  };
7139
7162
 
7140
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7163
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7141
7164
  function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
7142
7165
  return __spreadValues(__spreadValues(__spreadValues({
7143
7166
  kind: OpKind.InterpolateText,
@@ -7246,13 +7269,22 @@ function createConditionalOp(target, test, conditions, sourceSpan) {
7246
7269
  contextValue: null
7247
7270
  }, NEW_OP), TRAIT_USES_SLOT_INDEX), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
7248
7271
  }
7249
- function createI18nExpressionOp(owner, expression, i18nPlaceholder, sourceSpan) {
7272
+ function createRepeaterOp(repeaterCreate2, collection, sourceSpan) {
7273
+ return __spreadValues(__spreadValues({
7274
+ kind: OpKind.Repeater,
7275
+ target: repeaterCreate2,
7276
+ collection,
7277
+ sourceSpan
7278
+ }, NEW_OP), TRAIT_USES_SLOT_INDEX);
7279
+ }
7280
+ function createI18nExpressionOp(owner, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
7250
7281
  return __spreadValues(__spreadValues(__spreadValues({
7251
7282
  kind: OpKind.I18nExpression,
7252
7283
  owner,
7253
7284
  target: owner,
7254
7285
  expression,
7255
7286
  i18nPlaceholder,
7287
+ resolutionTime,
7256
7288
  sourceSpan
7257
7289
  }, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7258
7290
  }
@@ -7263,8 +7295,15 @@ function createI18nApplyOp(target, sourceSpan) {
7263
7295
  sourceSpan
7264
7296
  }, NEW_OP), TRAIT_USES_SLOT_INDEX);
7265
7297
  }
7298
+ function createIcuUpdateOp(xref, sourceSpan) {
7299
+ return __spreadValues({
7300
+ kind: OpKind.IcuUpdate,
7301
+ xref,
7302
+ sourceSpan
7303
+ }, NEW_OP);
7304
+ }
7266
7305
 
7267
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7306
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7268
7307
  var _a;
7269
7308
  var _b;
7270
7309
  var _c;
@@ -7291,8 +7330,8 @@ var LexicalReadExpr = class extends ExpressionBase {
7291
7330
  }
7292
7331
  visitExpression(visitor, context) {
7293
7332
  }
7294
- isEquivalent() {
7295
- return false;
7333
+ isEquivalent(other) {
7334
+ return this.name === other.name;
7296
7335
  }
7297
7336
  isConstant() {
7298
7337
  return false;
@@ -7352,6 +7391,26 @@ var ContextExpr = class extends ExpressionBase {
7352
7391
  return new ContextExpr(this.view);
7353
7392
  }
7354
7393
  };
7394
+ var TrackContextExpr = class extends ExpressionBase {
7395
+ constructor(view) {
7396
+ super();
7397
+ this.view = view;
7398
+ this.kind = ExpressionKind.TrackContext;
7399
+ }
7400
+ visitExpression() {
7401
+ }
7402
+ isEquivalent(e) {
7403
+ return e instanceof TrackContextExpr && e.view === this.view;
7404
+ }
7405
+ isConstant() {
7406
+ return false;
7407
+ }
7408
+ transformInternalExpressions() {
7409
+ }
7410
+ clone() {
7411
+ return new TrackContextExpr(this.view);
7412
+ }
7413
+ };
7355
7414
  var NextContextExpr = class extends ExpressionBase {
7356
7415
  constructor() {
7357
7416
  super();
@@ -7866,6 +7925,34 @@ var ConditionalCaseExpr = class extends ExpressionBase {
7866
7925
  }
7867
7926
  }
7868
7927
  };
7928
+ var DerivedRepeaterVarIdentity;
7929
+ (function(DerivedRepeaterVarIdentity2) {
7930
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["First"] = 0] = "First";
7931
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Last"] = 1] = "Last";
7932
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Even"] = 2] = "Even";
7933
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Odd"] = 3] = "Odd";
7934
+ })(DerivedRepeaterVarIdentity || (DerivedRepeaterVarIdentity = {}));
7935
+ var DerivedRepeaterVarExpr = class extends ExpressionBase {
7936
+ constructor(xref, identity) {
7937
+ super();
7938
+ this.xref = xref;
7939
+ this.identity = identity;
7940
+ this.kind = ExpressionKind.DerivedRepeaterVar;
7941
+ }
7942
+ transformInternalExpressions(transform2, flags) {
7943
+ }
7944
+ visitExpression(visitor, context) {
7945
+ }
7946
+ isEquivalent(e) {
7947
+ return e instanceof DerivedRepeaterVarExpr && e.identity === this.identity && e.xref === this.xref;
7948
+ }
7949
+ isConstant() {
7950
+ return false;
7951
+ }
7952
+ clone() {
7953
+ return new DerivedRepeaterVarExpr(this.xref, this.identity);
7954
+ }
7955
+ };
7869
7956
  function visitExpressionsInOp(op, visitor) {
7870
7957
  transformExpressionsInOp(op, (expr, flags) => {
7871
7958
  visitor(expr, flags);
@@ -7945,6 +8032,15 @@ function transformExpressionsInOp(op, transform2, flags) {
7945
8032
  transformExpressionsInStatement(statement, transform2, flags);
7946
8033
  }
7947
8034
  break;
8035
+ case OpKind.RepeaterCreate:
8036
+ op.track = transformExpressionsInExpression(op.track, transform2, flags);
8037
+ if (op.trackByFn !== null) {
8038
+ op.trackByFn = transformExpressionsInExpression(op.trackByFn, transform2, flags);
8039
+ }
8040
+ break;
8041
+ case OpKind.Repeater:
8042
+ op.collection = transformExpressionsInExpression(op.collection, transform2, flags);
8043
+ break;
7948
8044
  case OpKind.I18n:
7949
8045
  case OpKind.I18nStart:
7950
8046
  for (const [placeholder, expression] of op.params) {
@@ -7971,6 +8067,8 @@ function transformExpressionsInOp(op, transform2, flags) {
7971
8067
  case OpKind.Advance:
7972
8068
  case OpKind.Namespace:
7973
8069
  case OpKind.I18nApply:
8070
+ case OpKind.Icu:
8071
+ case OpKind.IcuUpdate:
7974
8072
  break;
7975
8073
  default:
7976
8074
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -8052,7 +8150,7 @@ function isStringLiteral(expr) {
8052
8150
  return expr instanceof LiteralExpr && typeof expr.value === "string";
8053
8151
  }
8054
8152
 
8055
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8153
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8056
8154
  var _OpList = class {
8057
8155
  constructor() {
8058
8156
  this.debugListId = _OpList.nextListId++;
@@ -8243,14 +8341,14 @@ var OpList = _OpList;
8243
8341
  _OpList.nextListId = 0;
8244
8342
  })();
8245
8343
 
8246
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8344
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8247
8345
  var elementContainerOpKinds = /* @__PURE__ */ new Set([
8248
8346
  OpKind.Element,
8249
8347
  OpKind.ElementStart,
8250
8348
  OpKind.Container,
8251
8349
  OpKind.ContainerStart,
8252
8350
  OpKind.Template,
8253
- OpKind.Projection
8351
+ OpKind.RepeaterCreate
8254
8352
  ]);
8255
8353
  function isElementOrContainerOp(op) {
8256
8354
  return elementContainerOpKinds.has(op.kind);
@@ -8284,6 +8382,27 @@ function createTemplateOp(xref, tag, namespace, generatedInBlock, i18nPlaceholde
8284
8382
  sourceSpan
8285
8383
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8286
8384
  }
8385
+ function createRepeaterCreateOp(primaryView, emptyView, track, varNames, sourceSpan) {
8386
+ return __spreadProps(__spreadValues(__spreadValues({
8387
+ kind: OpKind.RepeaterCreate,
8388
+ attributes: null,
8389
+ xref: primaryView,
8390
+ emptyView,
8391
+ track,
8392
+ trackByFn: null,
8393
+ tag: "For",
8394
+ namespace: Namespace.HTML,
8395
+ nonBindable: false,
8396
+ localRefs: [],
8397
+ decls: null,
8398
+ vars: null,
8399
+ varNames,
8400
+ usesComponentInstance: false,
8401
+ sourceSpan
8402
+ }, TRAIT_CONSUMES_SLOT), NEW_OP), {
8403
+ numSlotsUsed: emptyView === null ? 2 : 3
8404
+ });
8405
+ }
8287
8406
  function createElementEndOp(xref, sourceSpan) {
8288
8407
  return __spreadValues({
8289
8408
  kind: OpKind.ElementEnd,
@@ -8351,16 +8470,15 @@ function createProjectionDefOp(def) {
8351
8470
  def
8352
8471
  }, NEW_OP);
8353
8472
  }
8354
- function createProjectionOp(xref, selector) {
8473
+ function createProjectionOp(xref, selector, sourceSpan) {
8355
8474
  return __spreadValues(__spreadValues({
8356
8475
  kind: OpKind.Projection,
8357
8476
  xref,
8358
8477
  selector,
8359
8478
  projectionSlotIndex: 0,
8360
- attributes: null,
8479
+ attributes: [],
8361
8480
  localRefs: [],
8362
- nonBindable: false,
8363
- sourceSpan: null
8481
+ sourceSpan
8364
8482
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8365
8483
  }
8366
8484
  function createExtractedAttributeOp(target, bindingKind, name, expression) {
@@ -8415,8 +8533,10 @@ function createI18nStartOp(xref, message, root) {
8415
8533
  root: root != null ? root : xref,
8416
8534
  message,
8417
8535
  params: /* @__PURE__ */ new Map(),
8536
+ postprocessingParams: /* @__PURE__ */ new Map(),
8418
8537
  messageIndex: null,
8419
- subTemplateIndex: null
8538
+ subTemplateIndex: null,
8539
+ needsPostprocessing: false
8420
8540
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8421
8541
  }
8422
8542
  function createI18nEndOp(xref) {
@@ -8425,6 +8545,14 @@ function createI18nEndOp(xref) {
8425
8545
  xref
8426
8546
  }, NEW_OP);
8427
8547
  }
8548
+ function createIcuOp(xref, message, sourceSpan) {
8549
+ return __spreadValues({
8550
+ kind: OpKind.Icu,
8551
+ xref,
8552
+ message,
8553
+ sourceSpan
8554
+ }, NEW_OP);
8555
+ }
8428
8556
  function literalOrArrayLiteral(value) {
8429
8557
  if (Array.isArray(value)) {
8430
8558
  return literalArr(value.map(literalOrArrayLiteral));
@@ -8432,7 +8560,7 @@ function literalOrArrayLiteral(value) {
8432
8560
  return literal(value, INFERRED_TYPE);
8433
8561
  }
8434
8562
 
8435
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8563
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8436
8564
  function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
8437
8565
  return __spreadValues(__spreadValues({
8438
8566
  kind: OpKind.HostProperty,
@@ -8443,10 +8571,10 @@ function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan)
8443
8571
  }, TRAIT_CONSUMES_VARS), NEW_OP);
8444
8572
  }
8445
8573
 
8446
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8574
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8447
8575
  var CTX_REF = "CTX_REF_MARKER";
8448
8576
 
8449
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8577
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8450
8578
  var CompilationJobKind;
8451
8579
  (function(CompilationJobKind2) {
8452
8580
  CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
@@ -8529,6 +8657,7 @@ var ViewCompilationUnit = class extends CompilationUnit {
8529
8657
  this.job = job;
8530
8658
  this.parent = parent;
8531
8659
  this.contextVariables = /* @__PURE__ */ new Map();
8660
+ this.aliases = /* @__PURE__ */ new Set();
8532
8661
  this.decls = null;
8533
8662
  }
8534
8663
  };
@@ -8551,107 +8680,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
8551
8680
  }
8552
8681
  };
8553
8682
 
8554
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
8555
- function phaseVarCounting(job) {
8556
- for (const unit of job.units) {
8557
- let varCount = 0;
8558
- for (const op of unit.ops()) {
8559
- if (hasConsumesVarsTrait(op)) {
8560
- varCount += varsUsedByOp(op);
8561
- }
8562
- }
8563
- for (const op of unit.ops()) {
8564
- visitExpressionsInOp(op, (expr) => {
8565
- if (!isIrExpression(expr)) {
8566
- return;
8567
- }
8568
- if (hasUsesVarOffsetTrait(expr)) {
8569
- expr.varOffset = varCount;
8570
- }
8571
- if (hasConsumesVarsTrait(expr)) {
8572
- varCount += varsUsedByIrExpression(expr);
8573
- }
8574
- });
8575
- }
8576
- unit.vars = varCount;
8577
- }
8578
- if (job instanceof ComponentCompilationJob) {
8579
- for (const unit of job.units) {
8580
- for (const op of unit.create) {
8581
- if (op.kind !== OpKind.Template) {
8582
- continue;
8583
- }
8584
- const childView = job.views.get(op.xref);
8585
- op.vars = childView.vars;
8586
- }
8587
- }
8588
- }
8589
- }
8590
- function varsUsedByOp(op) {
8591
- let slots;
8592
- switch (op.kind) {
8593
- case OpKind.Property:
8594
- case OpKind.HostProperty:
8595
- case OpKind.Attribute:
8596
- slots = 1;
8597
- if (op.expression instanceof Interpolation2) {
8598
- slots += op.expression.expressions.length;
8599
- }
8600
- return slots;
8601
- case OpKind.StyleProp:
8602
- case OpKind.ClassProp:
8603
- case OpKind.StyleMap:
8604
- case OpKind.ClassMap:
8605
- slots = 2;
8606
- if (op.expression instanceof Interpolation2) {
8607
- slots += op.expression.expressions.length;
8608
- }
8609
- return slots;
8610
- case OpKind.InterpolateText:
8611
- return op.interpolation.expressions.length;
8612
- case OpKind.I18nExpression:
8613
- case OpKind.Conditional:
8614
- return 1;
8615
- default:
8616
- throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
8617
- }
8618
- }
8619
- function varsUsedByIrExpression(expr) {
8620
- switch (expr.kind) {
8621
- case ExpressionKind.PureFunctionExpr:
8622
- return 1 + expr.args.length;
8623
- case ExpressionKind.PipeBinding:
8624
- return 1 + expr.args.length;
8625
- case ExpressionKind.PipeBindingVariadic:
8626
- return 1 + expr.numArgs;
8627
- default:
8628
- throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
8629
- }
8630
- }
8631
-
8632
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/align_pipe_variadic_var_offset.mjs
8633
- function phaseAlignPipeVariadicVarOffset(job) {
8634
- for (const unit of job.units) {
8635
- for (const op of unit.update) {
8636
- visitExpressionsInOp(op, (expr) => {
8637
- if (!(expr instanceof PipeBindingVariadicExpr)) {
8638
- return expr;
8639
- }
8640
- if (!(expr.args instanceof PureFunctionExpr)) {
8641
- return expr;
8642
- }
8643
- if (expr.varOffset === null || expr.args.varOffset === null) {
8644
- throw new Error(`Must run after variable counting`);
8645
- }
8646
- expr.varOffset = expr.args.varOffset;
8647
- expr.args.varOffset = expr.varOffset + varsUsedByIrExpression(expr);
8648
- return void 0;
8649
- });
8650
- }
8651
- }
8652
- }
8653
-
8654
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8683
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8655
8684
  function phaseFindAnyCasts(job) {
8656
8685
  for (const unit of job.units) {
8657
8686
  for (const op of unit.ops()) {
@@ -8669,7 +8698,7 @@ function removeAnys(e) {
8669
8698
  return e;
8670
8699
  }
8671
8700
 
8672
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8701
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8673
8702
  function phaseApplyI18nExpressions(job) {
8674
8703
  for (const unit of job.units) {
8675
8704
  for (const op of unit.update) {
@@ -8690,7 +8719,7 @@ function needsApplication(op) {
8690
8719
  return false;
8691
8720
  }
8692
8721
 
8693
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8722
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8694
8723
  function phaseAssignI18nSlotDependencies(job) {
8695
8724
  const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
8696
8725
  let lastSlotConsumer = null;
@@ -8711,22 +8740,34 @@ function phaseAssignI18nSlotDependencies(job) {
8711
8740
  }
8712
8741
  }
8713
8742
 
8714
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8715
- function getElementsByXrefId(unit) {
8716
- const elements = /* @__PURE__ */ new Map();
8743
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
8744
+ function phaseCollapseSingletonInterpolations(job) {
8745
+ for (const unit of job.units) {
8746
+ for (const op of unit.update) {
8747
+ const eligibleOpKind = op.kind === OpKind.Attribute;
8748
+ if (eligibleOpKind && op.expression instanceof Interpolation2 && op.expression.strings.length === 2 && op.expression.strings.every((s) => s === "")) {
8749
+ op.expression = op.expression.expressions[0];
8750
+ }
8751
+ }
8752
+ }
8753
+ }
8754
+
8755
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8756
+ function createOpXrefMap(unit) {
8757
+ const map = /* @__PURE__ */ new Map();
8717
8758
  for (const op of unit.create) {
8718
- if (!isElementOrContainerOp(op)) {
8759
+ if (!hasConsumesSlotTrait(op)) {
8719
8760
  continue;
8720
8761
  }
8721
- elements.set(op.xref, op);
8762
+ map.set(op.xref, op);
8722
8763
  }
8723
- return elements;
8764
+ return map;
8724
8765
  }
8725
8766
 
8726
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8767
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8727
8768
  function phaseAttributeExtraction(job) {
8728
8769
  for (const unit of job.units) {
8729
- const elements = getElementsByXrefId(unit);
8770
+ const elements = createOpXrefMap(unit);
8730
8771
  for (const op of unit.ops()) {
8731
8772
  switch (op.kind) {
8732
8773
  case OpKind.Attribute:
@@ -8790,7 +8831,7 @@ function extractAttributeOp(unit, op, elements) {
8790
8831
  }
8791
8832
  }
8792
8833
 
8793
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8834
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8794
8835
  function lookupElement2(elements, xref) {
8795
8836
  const el = elements.get(xref);
8796
8837
  if (el === void 0) {
@@ -8840,7 +8881,7 @@ function phaseBindingSpecialization(job) {
8840
8881
  }
8841
8882
  }
8842
8883
 
8843
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8884
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8844
8885
  var CHAINABLE = /* @__PURE__ */ new Set([
8845
8886
  Identifiers.attribute,
8846
8887
  Identifiers.classProp,
@@ -8906,7 +8947,7 @@ function chainOperationsInList(opList) {
8906
8947
  }
8907
8948
  }
8908
8949
 
8909
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
8950
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
8910
8951
  function phaseConditionals(job) {
8911
8952
  for (const unit of job.units) {
8912
8953
  for (const op of unit.ops()) {
@@ -8938,11 +8979,12 @@ function phaseConditionals(job) {
8938
8979
  test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.target), test);
8939
8980
  }
8940
8981
  op.processed = test;
8982
+ op.conditions = [];
8941
8983
  }
8942
8984
  }
8943
8985
  }
8944
8986
 
8945
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
8987
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
8946
8988
  var TagContentType;
8947
8989
  (function(TagContentType2) {
8948
8990
  TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
@@ -8975,7 +9017,7 @@ function mergeNsAndName(prefix, localName) {
8975
9017
  return prefix ? `:${prefix}:${localName}` : localName;
8976
9018
  }
8977
9019
 
8978
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9020
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
8979
9021
  var BINARY_OPERATORS = /* @__PURE__ */ new Map([
8980
9022
  ["&&", BinaryOperator.And],
8981
9023
  [">", BinaryOperator.Bigger],
@@ -9025,7 +9067,7 @@ function literalOrArrayLiteral2(value) {
9025
9067
  return literal(value, INFERRED_TYPE);
9026
9068
  }
9027
9069
 
9028
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9070
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9029
9071
  function phaseConstCollection(job) {
9030
9072
  const allElementAttributes = /* @__PURE__ */ new Map();
9031
9073
  for (const unit of job.units) {
@@ -9159,7 +9201,7 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9159
9201
  return literalArr(attrArray);
9160
9202
  }
9161
9203
 
9162
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9204
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9163
9205
  var REPLACEMENTS = /* @__PURE__ */ new Map([
9164
9206
  [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9165
9207
  [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
@@ -9186,7 +9228,7 @@ function phaseEmptyElements(job) {
9186
9228
  }
9187
9229
  }
9188
9230
 
9189
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9231
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9190
9232
  function phaseExpandSafeReads(job) {
9191
9233
  for (const unit of job.units) {
9192
9234
  for (const op of unit.ops()) {
@@ -9322,7 +9364,39 @@ function ternaryTransform(e) {
9322
9364
  return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
9323
9365
  }
9324
9366
 
9325
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9367
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
9368
+ function phaseRepeaterDerivedVars(job) {
9369
+ const repeaters = /* @__PURE__ */ new Map();
9370
+ for (const unit of job.units) {
9371
+ for (const op of unit.ops()) {
9372
+ if (op.kind === OpKind.RepeaterCreate) {
9373
+ repeaters.set(op.xref, op);
9374
+ }
9375
+ }
9376
+ }
9377
+ for (const unit of job.units) {
9378
+ for (const op of unit.ops()) {
9379
+ transformExpressionsInOp(op, (expr) => {
9380
+ if (!(expr instanceof DerivedRepeaterVarExpr)) {
9381
+ return expr;
9382
+ }
9383
+ const repeaterOp = repeaters.get(expr.xref);
9384
+ switch (expr.identity) {
9385
+ case DerivedRepeaterVarIdentity.First:
9386
+ return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), literal(0));
9387
+ case DerivedRepeaterVarIdentity.Last:
9388
+ return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), new BinaryOperatorExpr(BinaryOperator.Minus, new LexicalReadExpr(repeaterOp.varNames.$count), literal(1)));
9389
+ case DerivedRepeaterVarIdentity.Even:
9390
+ return new BinaryOperatorExpr(BinaryOperator.Identical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
9391
+ case DerivedRepeaterVarIdentity.Odd:
9392
+ return new BinaryOperatorExpr(BinaryOperator.NotIdentical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
9393
+ }
9394
+ }, VisitorContextFlag.None);
9395
+ }
9396
+ }
9397
+ }
9398
+
9399
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9326
9400
  function phaseGenerateAdvance(job) {
9327
9401
  for (const unit of job.units) {
9328
9402
  const slotMap = /* @__PURE__ */ new Map();
@@ -9354,7 +9428,7 @@ function phaseGenerateAdvance(job) {
9354
9428
  }
9355
9429
  }
9356
9430
 
9357
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9431
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9358
9432
  function phaseGenerateProjectionDef(job) {
9359
9433
  const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
9360
9434
  const selectors = [];
@@ -9378,7 +9452,7 @@ function phaseGenerateProjectionDef(job) {
9378
9452
  }
9379
9453
  }
9380
9454
 
9381
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9455
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9382
9456
  function phaseGenerateVariables(job) {
9383
9457
  recursivelyProcessView(job.root, null);
9384
9458
  }
@@ -9387,6 +9461,7 @@ function recursivelyProcessView(view, parentScope) {
9387
9461
  for (const op of view.create) {
9388
9462
  switch (op.kind) {
9389
9463
  case OpKind.Template:
9464
+ case OpKind.RepeaterCreate:
9390
9465
  recursivelyProcessView(view.job.views.get(op.xref), scope);
9391
9466
  break;
9392
9467
  case OpKind.Listener:
@@ -9406,6 +9481,7 @@ function getScopeForView(view, parent) {
9406
9481
  view: view.xref
9407
9482
  },
9408
9483
  contextVariables: /* @__PURE__ */ new Map(),
9484
+ aliases: view.aliases,
9409
9485
  references: [],
9410
9486
  parent
9411
9487
  };
@@ -9418,7 +9494,6 @@ function getScopeForView(view, parent) {
9418
9494
  }
9419
9495
  for (const op of view.create) {
9420
9496
  switch (op.kind) {
9421
- case OpKind.Element:
9422
9497
  case OpKind.ElementStart:
9423
9498
  case OpKind.Template:
9424
9499
  if (!Array.isArray(op.localRefs)) {
@@ -9444,15 +9519,19 @@ function getScopeForView(view, parent) {
9444
9519
  function generateVariablesInScopeForView(view, scope) {
9445
9520
  const newOps = [];
9446
9521
  if (scope.view !== view.xref) {
9447
- newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr()));
9522
+ newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr(), VariableFlags.None));
9448
9523
  }
9449
- for (const [name, value] of view.job.views.get(scope.view).contextVariables) {
9524
+ const scopeView = view.job.views.get(scope.view);
9525
+ for (const [name, value] of scopeView.contextVariables) {
9450
9526
  const context = new ContextExpr(scope.view);
9451
9527
  const variable2 = value === CTX_REF ? context : new ReadPropExpr(context, value);
9452
- newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable2));
9528
+ newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable2, VariableFlags.None));
9529
+ }
9530
+ for (const alias of scopeView.aliases) {
9531
+ newOps.push(createVariableOp(view.job.allocateXrefId(), alias, alias.expression.clone(), VariableFlags.AlwaysInline));
9453
9532
  }
9454
9533
  for (const ref of scope.references) {
9455
- newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.offset)));
9534
+ newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.offset), VariableFlags.None));
9456
9535
  }
9457
9536
  if (scope.parent !== null) {
9458
9537
  newOps.push(...generateVariablesInScopeForView(view, scope.parent));
@@ -9460,7 +9539,7 @@ function generateVariablesInScopeForView(view, scope) {
9460
9539
  return newOps;
9461
9540
  }
9462
9541
 
9463
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_trait_collection.mjs
9542
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_trait_collection.mjs
9464
9543
  function phaseConstTraitCollection(job) {
9465
9544
  const collectGlobalConsts = (e) => {
9466
9545
  if (e instanceof ExpressionBase && hasConstTrait(e)) {
@@ -9481,7 +9560,7 @@ function phaseConstTraitCollection(job) {
9481
9560
  }
9482
9561
  }
9483
9562
 
9484
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9563
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9485
9564
  var STYLE_DOT = "style.";
9486
9565
  var CLASS_DOT = "class.";
9487
9566
  var STYLE_BANG = "style!";
@@ -9539,7 +9618,7 @@ function parseProperty(name) {
9539
9618
  return { property: property2, suffix };
9540
9619
  }
9541
9620
 
9542
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
9621
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
9543
9622
  function phaseI18nConstCollection(job) {
9544
9623
  const messageConstIndices = {};
9545
9624
  for (const unit of job.units) {
@@ -9552,14 +9631,14 @@ function phaseI18nConstCollection(job) {
9552
9631
  }
9553
9632
  for (const unit of job.units) {
9554
9633
  for (const op of unit.create) {
9555
- if (op.kind === OpKind.I18nStart || op.kind === OpKind.I18n) {
9634
+ if (op.kind === OpKind.I18nStart) {
9556
9635
  op.messageIndex = messageConstIndices[op.root];
9557
9636
  }
9558
9637
  }
9559
9638
  }
9560
9639
  }
9561
9640
 
9562
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9641
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9563
9642
  function mapLiteral(obj, quoted = false) {
9564
9643
  return literalMap(Object.keys(obj).map((key) => ({
9565
9644
  key,
@@ -9568,7 +9647,7 @@ function mapLiteral(obj, quoted = false) {
9568
9647
  })));
9569
9648
  }
9570
9649
 
9571
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9650
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9572
9651
  var IcuSerializerVisitor = class {
9573
9652
  visitText(text2) {
9574
9653
  return text2.value;
@@ -9599,7 +9678,7 @@ function serializeIcuNode(icu) {
9599
9678
  return icu.visit(serializer);
9600
9679
  }
9601
9680
 
9602
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
9681
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
9603
9682
  var TokenType;
9604
9683
  (function(TokenType2) {
9605
9684
  TokenType2[TokenType2["Character"] = 0] = "Character";
@@ -9960,7 +10039,7 @@ function parseIntAutoRadix(text2) {
9960
10039
  return result;
9961
10040
  }
9962
10041
 
9963
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10042
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
9964
10043
  var SplitInterpolation = class {
9965
10044
  constructor(strings, expressions, offsets) {
9966
10045
  this.strings = strings;
@@ -10854,7 +10933,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
10854
10933
  return offsetMap;
10855
10934
  }
10856
10935
 
10857
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
10936
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
10858
10937
  var NodeWithI18n = class {
10859
10938
  constructor(sourceSpan, i18n2) {
10860
10939
  this.sourceSpan = sourceSpan;
@@ -10931,11 +11010,12 @@ var Comment2 = class {
10931
11010
  }
10932
11011
  };
10933
11012
  var Block = class {
10934
- constructor(name, parameters, children, sourceSpan, startSourceSpan, endSourceSpan = null) {
11013
+ constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null) {
10935
11014
  this.name = name;
10936
11015
  this.parameters = parameters;
10937
11016
  this.children = children;
10938
11017
  this.sourceSpan = sourceSpan;
11018
+ this.nameSpan = nameSpan;
10939
11019
  this.startSourceSpan = startSourceSpan;
10940
11020
  this.endSourceSpan = endSourceSpan;
10941
11021
  }
@@ -11005,11 +11085,11 @@ var RecursiveVisitor = class {
11005
11085
  }
11006
11086
  };
11007
11087
 
11008
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11088
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11009
11089
  var ElementSchemaRegistry = class {
11010
11090
  };
11011
11091
 
11012
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11092
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11013
11093
  var BOOLEAN = "boolean";
11014
11094
  var NUMBER = "number";
11015
11095
  var STRING = "string";
@@ -11362,7 +11442,7 @@ function _isPixelDimensionStyle(prop) {
11362
11442
  }
11363
11443
  }
11364
11444
 
11365
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11445
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11366
11446
  var HtmlTagDefinition = class {
11367
11447
  constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
11368
11448
  this.closedByChildren = {};
@@ -11395,7 +11475,7 @@ function getHtmlTagDefinition(tagName) {
11395
11475
  var _a2, _b2;
11396
11476
  if (!TAG_DEFINITIONS) {
11397
11477
  DEFAULT_TAG_DEFINITION = new HtmlTagDefinition({ canSelfClose: true });
11398
- TAG_DEFINITIONS = {
11478
+ TAG_DEFINITIONS = Object.assign(/* @__PURE__ */ Object.create(null), {
11399
11479
  "base": new HtmlTagDefinition({ isVoid: true }),
11400
11480
  "meta": new HtmlTagDefinition({ isVoid: true }),
11401
11481
  "area": new HtmlTagDefinition({ isVoid: true }),
@@ -11470,9 +11550,9 @@ function getHtmlTagDefinition(tagName) {
11470
11550
  contentType: { default: TagContentType.ESCAPABLE_RAW_TEXT, svg: TagContentType.PARSABLE_DATA }
11471
11551
  }),
11472
11552
  "textarea": new HtmlTagDefinition({ contentType: TagContentType.ESCAPABLE_RAW_TEXT, ignoreFirstLf: true })
11473
- };
11553
+ });
11474
11554
  new DomElementSchemaRegistry().allKnownElementNames().forEach((knownTagName) => {
11475
- if (!TAG_DEFINITIONS.hasOwnProperty(knownTagName) && getNsPrefix(knownTagName) === null) {
11555
+ if (!TAG_DEFINITIONS[knownTagName] && getNsPrefix(knownTagName) === null) {
11476
11556
  TAG_DEFINITIONS[knownTagName] = new HtmlTagDefinition({ canSelfClose: false });
11477
11557
  }
11478
11558
  });
@@ -11480,7 +11560,7 @@ function getHtmlTagDefinition(tagName) {
11480
11560
  return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
11481
11561
  }
11482
11562
 
11483
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11563
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11484
11564
  var TAG_TO_PLACEHOLDER_NAMES = {
11485
11565
  "A": "LINK",
11486
11566
  "B": "BOLD_TEXT",
@@ -11574,7 +11654,7 @@ var PlaceholderRegistry = class {
11574
11654
  }
11575
11655
  };
11576
11656
 
11577
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
11657
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
11578
11658
  var _expParser = new Parser(new Lexer());
11579
11659
  function createI18nMessageFactory(interpolationConfig) {
11580
11660
  const visitor = new _I18nVisitor(_expParser, interpolationConfig);
@@ -11736,14 +11816,14 @@ function extractPlaceholderName(input) {
11736
11816
  return input.split(_CUSTOM_PH_EXP)[2];
11737
11817
  }
11738
11818
 
11739
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
11819
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
11740
11820
  var I18nError = class extends ParseError {
11741
11821
  constructor(span, msg) {
11742
11822
  super(span, msg);
11743
11823
  }
11744
11824
  };
11745
11825
 
11746
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
11826
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
11747
11827
  var NAMED_ENTITIES = {
11748
11828
  "AElig": "\xC6",
11749
11829
  "AMP": "&",
@@ -13874,7 +13954,7 @@ var NAMED_ENTITIES = {
13874
13954
  var NGSP_UNICODE = "\uE500";
13875
13955
  NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
13876
13956
 
13877
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
13957
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
13878
13958
  var TokenError = class extends ParseError {
13879
13959
  constructor(errorMsg, tokenType, span) {
13880
13960
  super(span, errorMsg);
@@ -14508,7 +14588,7 @@ var _Tokenizer = class {
14508
14588
  return true;
14509
14589
  }
14510
14590
  }
14511
- if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this._isBlockStart() || this._cursor.peek() === $RBRACE)) {
14591
+ if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this._cursor.peek() === $AT || this._cursor.peek() === $RBRACE)) {
14512
14592
  return true;
14513
14593
  }
14514
14594
  return false;
@@ -14524,16 +14604,6 @@ var _Tokenizer = class {
14524
14604
  }
14525
14605
  return false;
14526
14606
  }
14527
- _isBlockStart() {
14528
- if (this._tokenizeBlocks && this._cursor.peek() === $AT) {
14529
- const tmp = this._cursor.clone();
14530
- tmp.advance();
14531
- if (isBlockNameChar(tmp.peek())) {
14532
- return true;
14533
- }
14534
- }
14535
- return false;
14536
- }
14537
14607
  _readUntil(char) {
14538
14608
  const start = this._cursor.clone();
14539
14609
  this._attemptUntilChar(char);
@@ -14805,7 +14875,7 @@ var CursorError = class {
14805
14875
  }
14806
14876
  };
14807
14877
 
14808
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
14878
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
14809
14879
  var TreeError = class extends ParseError {
14810
14880
  static create(elementName, span, msg) {
14811
14881
  return new TreeError(elementName, span, msg);
@@ -15118,7 +15188,7 @@ var _TreeBuilder = class {
15118
15188
  const end = this._peek.sourceSpan.fullStart;
15119
15189
  const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
15120
15190
  const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
15121
- const block = new Block(token.parts[0], parameters, [], span, startSpan);
15191
+ const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
15122
15192
  this._pushContainer(block, false);
15123
15193
  }
15124
15194
  _consumeBlockClose(token) {
@@ -15135,7 +15205,7 @@ var _TreeBuilder = class {
15135
15205
  const end = this._peek.sourceSpan.fullStart;
15136
15206
  const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
15137
15207
  const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart);
15138
- const block = new Block(token.parts[0], parameters, [], span, startSpan);
15208
+ const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan);
15139
15209
  this._pushContainer(block, false);
15140
15210
  this._popContainer(null, Block, null);
15141
15211
  this.errors.push(TreeError.create(token.parts[0], span, `Incomplete block "${token.parts[0]}". If you meant to write the @ character, you should use the "&#64;" HTML entity instead.`));
@@ -15189,7 +15259,7 @@ function decodeEntity(match, entity) {
15189
15259
  return match;
15190
15260
  }
15191
15261
 
15192
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15262
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15193
15263
  var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
15194
15264
  "iframe|srcdoc",
15195
15265
  "*|innerhtml",
@@ -15204,7 +15274,7 @@ function isTrustedTypesSink(tagName, propName) {
15204
15274
  return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
15205
15275
  }
15206
15276
 
15207
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15277
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15208
15278
  var setI18nRefs = (htmlNode, i18nNode) => {
15209
15279
  if (htmlNode instanceof NodeWithI18n) {
15210
15280
  if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
@@ -15360,7 +15430,7 @@ function i18nMetaToJSDoc(meta) {
15360
15430
  return jsDocComment(tags);
15361
15431
  }
15362
15432
 
15363
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15433
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15364
15434
  var GOOG_GET_MSG = "goog.getMsg";
15365
15435
  function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
15366
15436
  const messageString = serializeI18nMessageForGetMsg(message);
@@ -15408,7 +15478,7 @@ function serializeI18nMessageForGetMsg(message) {
15408
15478
  return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
15409
15479
  }
15410
15480
 
15411
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15481
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15412
15482
  function createLocalizeStatements(variable2, message, params) {
15413
15483
  const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
15414
15484
  const sourceSpan = getSourceSpan(message);
@@ -15491,19 +15561,27 @@ function createEmptyMessagePart(location) {
15491
15561
  return new LiteralPiece("", new ParseSourceSpan(location, location));
15492
15562
  }
15493
15563
 
15494
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_message_extraction.mjs
15564
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_message_extraction.mjs
15495
15565
  var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
15496
15566
  var TRANSLATION_VAR_PREFIX2 = "i18n_";
15497
15567
  function phaseI18nMessageExtraction(job) {
15498
15568
  const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
15499
15569
  for (const unit of job.units) {
15500
15570
  for (const op of unit.create) {
15501
- if (op.kind === OpKind.I18nStart || op.kind === OpKind.I18n) {
15571
+ if (op.kind === OpKind.I18nStart) {
15502
15572
  if (op.xref === op.root) {
15503
15573
  const params = new Map([...op.params.entries()].sort());
15504
15574
  const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
15505
15575
  const closureVar = i18nGenerateClosureVar(job.pool, op.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
15506
- const statements = getTranslationDeclStmts(op.message, mainVar, closureVar, params, void 0);
15576
+ let transformFn = void 0;
15577
+ if (op.needsPostprocessing) {
15578
+ const extraTransformFnParams = [];
15579
+ if (op.postprocessingParams.size > 0) {
15580
+ extraTransformFnParams.push(literalMap([...op.postprocessingParams.entries()].map(([key, value]) => ({ key, value, quoted: true }))));
15581
+ }
15582
+ transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
15583
+ }
15584
+ const statements = getTranslationDeclStmts(op.message, mainVar, closureVar, params, transformFn);
15507
15585
  unit.create.push(createExtractedMessageOp(op.xref, mainVar, statements));
15508
15586
  }
15509
15587
  }
@@ -15538,7 +15616,7 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
15538
15616
  return variable(name);
15539
15617
  }
15540
15618
 
15541
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
15619
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
15542
15620
  function phaseI18nTextExtraction(job) {
15543
15621
  var _a2;
15544
15622
  for (const unit of job.units) {
@@ -15571,7 +15649,7 @@ function phaseI18nTextExtraction(job) {
15571
15649
  for (let i = 0; i < op.interpolation.expressions.length; i++) {
15572
15650
  const expr = op.interpolation.expressions[i];
15573
15651
  const placeholder = op.i18nPlaceholders[i];
15574
- ops.push(createI18nExpressionOp(i18nBlockId, expr, placeholder, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
15652
+ ops.push(createI18nExpressionOp(i18nBlockId, expr, placeholder.name, I18nParamResolutionTime.Creation, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
15575
15653
  }
15576
15654
  if (ops.length > 0) {
15577
15655
  }
@@ -15582,13 +15660,52 @@ function phaseI18nTextExtraction(job) {
15582
15660
  }
15583
15661
  }
15584
15662
 
15585
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
15663
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/icu_extraction.mjs
15664
+ function phaseIcuExtraction(job) {
15665
+ for (const unit of job.units) {
15666
+ const icus = /* @__PURE__ */ new Map();
15667
+ let currentI18nId = null;
15668
+ for (const op of unit.create) {
15669
+ switch (op.kind) {
15670
+ case OpKind.I18nStart:
15671
+ currentI18nId = op.xref;
15672
+ break;
15673
+ case OpKind.I18nEnd:
15674
+ currentI18nId = null;
15675
+ break;
15676
+ case OpKind.Icu:
15677
+ if (currentI18nId === null) {
15678
+ throw Error("Unexpected ICU outside of an i18n block.");
15679
+ }
15680
+ icus.set(op.xref, { message: op.message, i18nBlockId: currentI18nId });
15681
+ OpList.remove(op);
15682
+ break;
15683
+ }
15684
+ }
15685
+ for (const op of unit.update) {
15686
+ switch (op.kind) {
15687
+ case OpKind.IcuUpdate:
15688
+ const { message, i18nBlockId } = icus.get(op.xref);
15689
+ const icuNode = message.nodes.find((n) => n instanceof Icu2);
15690
+ if (icuNode === void 0) {
15691
+ throw Error("Could not find ICU in i18n AST");
15692
+ }
15693
+ if (icuNode.expressionPlaceholder === void 0) {
15694
+ throw Error("ICU is missing an i18n placeholder");
15695
+ }
15696
+ OpList.replace(op, createI18nExpressionOp(i18nBlockId, new LexicalReadExpr(icuNode.expression), icuNode.expressionPlaceholder, I18nParamResolutionTime.Postproccessing, null));
15697
+ break;
15698
+ }
15699
+ }
15700
+ }
15701
+ }
15702
+
15703
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
15586
15704
  function phaseLocalRefs(job) {
15587
15705
  for (const unit of job.units) {
15588
15706
  for (const op of unit.create) {
15589
15707
  switch (op.kind) {
15590
15708
  case OpKind.ElementStart:
15591
- case OpKind.Element:
15592
15709
  case OpKind.Template:
15593
15710
  if (!Array.isArray(op.localRefs)) {
15594
15711
  throw new Error(`AssertionError: expected localRefs to be an array still`);
@@ -15613,12 +15730,12 @@ function serializeLocalRefs(refs) {
15613
15730
  return literalArr(constRefs);
15614
15731
  }
15615
15732
 
15616
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
15733
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
15617
15734
  function phaseNamespace(job) {
15618
15735
  for (const unit of job.units) {
15619
15736
  let activeNamespace = Namespace.HTML;
15620
15737
  for (const op of unit.create) {
15621
- if (op.kind !== OpKind.Element && op.kind !== OpKind.ElementStart) {
15738
+ if (op.kind !== OpKind.ElementStart) {
15622
15739
  continue;
15623
15740
  }
15624
15741
  if (op.namespace !== activeNamespace) {
@@ -15629,7 +15746,7 @@ function phaseNamespace(job) {
15629
15746
  }
15630
15747
  }
15631
15748
 
15632
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
15749
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
15633
15750
  function parse(value) {
15634
15751
  const styles = [];
15635
15752
  let i = 0;
@@ -15690,7 +15807,7 @@ function hyphenate2(value) {
15690
15807
  }).toLowerCase();
15691
15808
  }
15692
15809
 
15693
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
15810
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
15694
15811
  function phaseNaming(cpl) {
15695
15812
  addNamesToView(cpl.root, cpl.componentName, { index: 0 }, cpl.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
15696
15813
  }
@@ -15729,6 +15846,20 @@ function addNamesToView(unit, baseName, state, compatibility) {
15729
15846
  case OpKind.Variable:
15730
15847
  varNames.set(op.xref, getVariableName(op.variable, state));
15731
15848
  break;
15849
+ case OpKind.RepeaterCreate:
15850
+ if (!(unit instanceof ViewCompilationUnit)) {
15851
+ throw new Error(`AssertionError: must be compiling a component`);
15852
+ }
15853
+ if (op.slot === null) {
15854
+ throw new Error(`Expected slot to be assigned`);
15855
+ }
15856
+ if (op.emptyView !== null) {
15857
+ const emptyView = unit.job.views.get(op.emptyView);
15858
+ addNamesToView(emptyView, `${baseName}_${prefixWithNamespace(`${op.tag}Empty`, op.namespace)}_${op.slot + 2}`, state, compatibility);
15859
+ }
15860
+ const repeaterToken = op.tag === null ? "" : "_" + prefixWithNamespace(op.tag, op.namespace);
15861
+ addNamesToView(unit.job.views.get(op.xref), `${baseName}${repeaterToken}_${op.slot + 1}`, state, compatibility);
15862
+ break;
15732
15863
  case OpKind.Template:
15733
15864
  if (!(unit instanceof ViewCompilationUnit)) {
15734
15865
  throw new Error(`AssertionError: must be compiling a component`);
@@ -15737,7 +15868,8 @@ function addNamesToView(unit, baseName, state, compatibility) {
15737
15868
  if (op.slot === null) {
15738
15869
  throw new Error(`Expected slot to be assigned`);
15739
15870
  }
15740
- addNamesToView(childView, `${baseName}_${prefixWithNamespace(op.tag, op.namespace)}_${op.slot}`, state, compatibility);
15871
+ const tagToken = op.tag === null ? "" : "_" + prefixWithNamespace(op.tag, op.namespace);
15872
+ addNamesToView(childView, `${baseName}${tagToken}_${op.slot}`, state, compatibility);
15741
15873
  break;
15742
15874
  case OpKind.StyleProp:
15743
15875
  op.name = normalizeStylePropName(op.name);
@@ -15771,10 +15903,10 @@ function getVariableName(variable2, state) {
15771
15903
  variable2.name = `ctx_r${state.index++}`;
15772
15904
  break;
15773
15905
  case SemanticVariableKind.Identifier:
15774
- variable2.name = `${variable2.identifier}_${state.index++}`;
15906
+ variable2.name = `${variable2.identifier}_r${++state.index}`;
15775
15907
  break;
15776
15908
  default:
15777
- variable2.name = `_r${state.index++}`;
15909
+ variable2.name = `_r${++state.index}`;
15778
15910
  break;
15779
15911
  }
15780
15912
  }
@@ -15791,7 +15923,7 @@ function stripImportant(name) {
15791
15923
  return name;
15792
15924
  }
15793
15925
 
15794
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
15926
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
15795
15927
  function phaseMergeNextContext(job) {
15796
15928
  for (const unit of job.units) {
15797
15929
  for (const op of unit.create) {
@@ -15837,16 +15969,12 @@ function mergeNextContextsInOps(ops) {
15837
15969
  }
15838
15970
  }
15839
15971
 
15840
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
15972
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
15841
15973
  var CONTAINER_TAG = "ng-container";
15842
15974
  function phaseNgContainer(job) {
15843
15975
  for (const unit of job.units) {
15844
15976
  const updatedElementXrefs = /* @__PURE__ */ new Set();
15845
15977
  for (const op of unit.create) {
15846
- if (op.kind === OpKind.Element && op.tag === CONTAINER_TAG) {
15847
- op.kind = OpKind.Container;
15848
- updatedElementXrefs.add(op.xref);
15849
- }
15850
15978
  if (op.kind === OpKind.ElementStart && op.tag === CONTAINER_TAG) {
15851
15979
  op.kind = OpKind.ContainerStart;
15852
15980
  updatedElementXrefs.add(op.xref);
@@ -15858,7 +15986,7 @@ function phaseNgContainer(job) {
15858
15986
  }
15859
15987
  }
15860
15988
 
15861
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
15989
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
15862
15990
  function lookupElement3(elements, xref) {
15863
15991
  const el = elements.get(xref);
15864
15992
  if (el === void 0) {
@@ -15888,7 +16016,7 @@ function phaseNonbindable(job) {
15888
16016
  }
15889
16017
  }
15890
16018
 
15891
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16019
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
15892
16020
  function phaseNullishCoalescing(job) {
15893
16021
  for (const unit of job.units) {
15894
16022
  for (const op of unit.ops()) {
@@ -15904,24 +16032,30 @@ function phaseNullishCoalescing(job) {
15904
16032
  }
15905
16033
  }
15906
16034
 
15907
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16035
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
15908
16036
  function kindTest(kind) {
15909
16037
  return (op) => op.kind === kind;
15910
16038
  }
16039
+ function kindWithInterpolationTest(kind, interpolation) {
16040
+ return (op) => {
16041
+ return op.kind === kind && interpolation === op.expression instanceof Interpolation2;
16042
+ };
16043
+ }
15911
16044
  var CREATE_ORDERING = [
15912
16045
  { test: (op) => op.kind === OpKind.Listener && op.hostListener && op.isAnimationListener },
15913
16046
  { test: (op) => op.kind === OpKind.Listener && !(op.hostListener && op.isAnimationListener) }
15914
16047
  ];
15915
16048
  var UPDATE_ORDERING = [
15916
- { test: (op) => op.kind === OpKind.HostProperty && op.expression instanceof Interpolation2 },
15917
- { test: (op) => op.kind === OpKind.HostProperty && !(op.expression instanceof Interpolation2) },
16049
+ { test: kindWithInterpolationTest(OpKind.HostProperty, true) },
16050
+ { test: kindWithInterpolationTest(OpKind.HostProperty, false) },
15918
16051
  { test: kindTest(OpKind.StyleMap), transform: keepLast },
15919
16052
  { test: kindTest(OpKind.ClassMap), transform: keepLast },
15920
16053
  { test: kindTest(OpKind.StyleProp) },
15921
16054
  { test: kindTest(OpKind.ClassProp) },
15922
- { test: (op) => op.kind === OpKind.Property && op.expression instanceof Interpolation2 },
15923
- { test: (op) => op.kind === OpKind.Property && !(op.expression instanceof Interpolation2) },
15924
- { test: kindTest(OpKind.Attribute) }
16055
+ { test: kindWithInterpolationTest(OpKind.Property, true) },
16056
+ { test: kindWithInterpolationTest(OpKind.Attribute, true) },
16057
+ { test: kindWithInterpolationTest(OpKind.Property, false) },
16058
+ { test: kindWithInterpolationTest(OpKind.Attribute, false) }
15925
16059
  ];
15926
16060
  var handledOpKinds = /* @__PURE__ */ new Set([
15927
16061
  OpKind.Listener,
@@ -15935,29 +16069,27 @@ var handledOpKinds = /* @__PURE__ */ new Set([
15935
16069
  ]);
15936
16070
  function phaseOrdering(job) {
15937
16071
  for (const unit of job.units) {
15938
- let opsToOrder = [];
15939
- for (const op of unit.create) {
15940
- if (handledOpKinds.has(op.kind)) {
15941
- opsToOrder.push(op);
15942
- OpList.remove(op);
15943
- } else {
15944
- OpList.insertBefore(reorder(opsToOrder, CREATE_ORDERING), op);
15945
- opsToOrder = [];
15946
- }
15947
- }
15948
- unit.create.push(reorder(opsToOrder, CREATE_ORDERING));
15949
- opsToOrder = [];
15950
- for (const op of unit.update) {
15951
- if (handledOpKinds.has(op.kind)) {
15952
- opsToOrder.push(op);
15953
- OpList.remove(op);
15954
- } else {
15955
- OpList.insertBefore(reorder(opsToOrder, UPDATE_ORDERING), op);
15956
- opsToOrder = [];
15957
- }
16072
+ orderWithin(unit.create, CREATE_ORDERING);
16073
+ orderWithin(unit.update, UPDATE_ORDERING);
16074
+ }
16075
+ }
16076
+ function orderWithin(opList, ordering) {
16077
+ let opsToOrder = [];
16078
+ let firstTargetInGroup = null;
16079
+ for (const op of opList) {
16080
+ const currentTarget = hasDependsOnSlotContextTrait(op) ? op.target : null;
16081
+ if (!handledOpKinds.has(op.kind) || currentTarget !== firstTargetInGroup && (firstTargetInGroup !== null && currentTarget !== null)) {
16082
+ OpList.insertBefore(reorder(opsToOrder, ordering), op);
16083
+ opsToOrder = [];
16084
+ firstTargetInGroup = null;
16085
+ }
16086
+ if (handledOpKinds.has(op.kind)) {
16087
+ opsToOrder.push(op);
16088
+ OpList.remove(op);
16089
+ firstTargetInGroup = currentTarget != null ? currentTarget : firstTargetInGroup;
15958
16090
  }
15959
- unit.update.push(reorder(opsToOrder, UPDATE_ORDERING));
15960
16091
  }
16092
+ opList.push(reorder(opsToOrder, ordering));
15961
16093
  }
15962
16094
  function reorder(ops, ordering) {
15963
16095
  const groups = Array.from(ordering, () => new Array());
@@ -15974,7 +16106,7 @@ function keepLast(ops) {
15974
16106
  return ops.slice(ops.length - 1);
15975
16107
  }
15976
16108
 
15977
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16109
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
15978
16110
  function phaseParseExtractedStyles(cpl) {
15979
16111
  for (const unit of cpl.units) {
15980
16112
  for (const op of unit.create) {
@@ -15997,31 +16129,31 @@ function phaseParseExtractedStyles(cpl) {
15997
16129
  }
15998
16130
  }
15999
16131
 
16000
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16132
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16001
16133
  function phaseRemoveContentSelectors(job) {
16002
16134
  for (const unit of job.units) {
16003
- const elements = getElementsByXrefId(unit);
16135
+ const elements = createOpXrefMap(unit);
16004
16136
  for (const op of unit.update) {
16005
16137
  switch (op.kind) {
16006
16138
  case OpKind.Binding:
16007
- const target = lookupElement4(elements, op.target);
16139
+ const target = lookupInXrefMap(elements, op.target);
16008
16140
  if (op.name.toLowerCase() === "select" && target.kind === OpKind.Projection) {
16009
16141
  OpList.remove(op);
16010
16142
  }
16011
- continue;
16143
+ break;
16012
16144
  }
16013
16145
  }
16014
16146
  }
16015
16147
  }
16016
- function lookupElement4(elements, xref) {
16017
- const el = elements.get(xref);
16148
+ function lookupInXrefMap(map, xref) {
16149
+ const el = map.get(xref);
16018
16150
  if (el === void 0) {
16019
- throw new Error("All attributes should have an element-like target.");
16151
+ throw new Error("All attributes should have an slottable target.");
16020
16152
  }
16021
16153
  return el;
16022
16154
  }
16023
16155
 
16024
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16156
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16025
16157
  function phasePipeCreation(job) {
16026
16158
  for (const unit of job.units) {
16027
16159
  processPipeBindingsInView(unit);
@@ -16039,10 +16171,14 @@ function processPipeBindingsInView(unit) {
16039
16171
  if (flags & VisitorContextFlag.InChildOperation) {
16040
16172
  throw new Error(`AssertionError: pipe bindings should not appear in child expressions`);
16041
16173
  }
16042
- if (!hasDependsOnSlotContextTrait(updateOp)) {
16174
+ if (!hasDependsOnSlotContextTrait(updateOp) && !hasUsesSlotIndexTrait(updateOp)) {
16043
16175
  throw new Error(`AssertionError: pipe binding associated with non-slot operation ${OpKind[updateOp.kind]}`);
16044
16176
  }
16045
- addPipeToCreationBlock(unit, updateOp.target, expr);
16177
+ if (unit.job.compatibility) {
16178
+ addPipeToCreationBlock(unit, updateOp.target, expr);
16179
+ } else {
16180
+ unit.create.push(createPipeOp(expr.target, expr.name));
16181
+ }
16046
16182
  });
16047
16183
  }
16048
16184
  }
@@ -16064,7 +16200,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
16064
16200
  throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
16065
16201
  }
16066
16202
 
16067
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16203
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16068
16204
  function phasePipeVariadic(job) {
16069
16205
  for (const unit of job.units) {
16070
16206
  for (const op of unit.update) {
@@ -16081,7 +16217,7 @@ function phasePipeVariadic(job) {
16081
16217
  }
16082
16218
  }
16083
16219
 
16084
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16220
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16085
16221
  function phasePropagateI18nBlocks(job) {
16086
16222
  propagateI18nBlocksToTemplates(job.root, 0);
16087
16223
  }
@@ -16118,36 +16254,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
16118
16254
  }
16119
16255
  }
16120
16256
 
16121
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_placeholders.mjs
16122
- function phasePropagateI18nPlaceholders(job) {
16123
- const i18nOps = /* @__PURE__ */ new Map();
16124
- for (const unit of job.units) {
16125
- for (const op of unit.create) {
16126
- if (op.kind === OpKind.I18nStart) {
16127
- i18nOps.set(op.xref, op);
16128
- }
16129
- }
16130
- }
16131
- for (const op of i18nOps.values()) {
16132
- if (op.xref !== op.root) {
16133
- const rootOp = i18nOps.get(op.root);
16134
- for (const [placeholder, value] of op.params) {
16135
- rootOp.params.set(placeholder, value);
16136
- }
16137
- }
16138
- }
16139
- for (const op of i18nOps.values()) {
16140
- if (op.xref === op.root) {
16141
- for (const placeholder in op.message.placeholders) {
16142
- if (!op.params.has(placeholder)) {
16143
- throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
16144
- }
16145
- }
16146
- }
16147
- }
16148
- }
16149
-
16150
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16257
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16151
16258
  function phasePureFunctionExtraction(job) {
16152
16259
  for (const view of job.units) {
16153
16260
  for (const op of view.ops()) {
@@ -16189,7 +16296,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
16189
16296
  }
16190
16297
  };
16191
16298
 
16192
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16299
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16193
16300
  function phasePureLiteralStructures(job) {
16194
16301
  for (const view of job.units) {
16195
16302
  for (const op of view.update) {
@@ -16236,7 +16343,7 @@ function transformLiteralMap(expr) {
16236
16343
  return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
16237
16344
  }
16238
16345
 
16239
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16346
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16240
16347
  function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
16241
16348
  return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
16242
16349
  }
@@ -16272,7 +16379,7 @@ function elementContainerEnd() {
16272
16379
  }
16273
16380
  function template(slot, templateFnRef, decls, vars, tag, constIndex, sourceSpan) {
16274
16381
  const args = [literal(slot), templateFnRef, literal(decls), literal(vars)];
16275
- if (tag !== null) {
16382
+ if (tag !== null || constIndex !== null) {
16276
16383
  args.push(literal(tag));
16277
16384
  if (constIndex !== null) {
16278
16385
  args.push(literal(constIndex));
@@ -16368,15 +16475,15 @@ function deferOn(sourceSpan) {
16368
16475
  function projectionDef(def) {
16369
16476
  return call(Identifiers.projectionDef, def ? [def] : [], null);
16370
16477
  }
16371
- function projection(slot, projectionSlotIndex, attributes) {
16478
+ function projection(slot, projectionSlotIndex, attributes, sourceSpan) {
16372
16479
  const args = [literal(slot)];
16373
- if (projectionSlotIndex !== 0 || attributes !== null) {
16480
+ if (projectionSlotIndex !== 0 || attributes.length > 0) {
16374
16481
  args.push(literal(projectionSlotIndex));
16375
- if (attributes != null) {
16376
- args.push(literal(attributes));
16482
+ if (attributes.length > 0) {
16483
+ args.push(literalArr(attributes.map((attr) => literal(attr))));
16377
16484
  }
16378
16485
  }
16379
- return call(Identifiers.projection, args, null);
16486
+ return call(Identifiers.projection, args, sourceSpan);
16380
16487
  }
16381
16488
  function i18nStart(slot, constIndex, subTemplateIndex) {
16382
16489
  const args = [literal(slot), literal(constIndex)];
@@ -16385,6 +16492,27 @@ function i18nStart(slot, constIndex, subTemplateIndex) {
16385
16492
  }
16386
16493
  return call(Identifiers.i18nStart, args, null);
16387
16494
  }
16495
+ function repeaterCreate(slot, viewFnName, decls, vars, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, sourceSpan) {
16496
+ let args = [
16497
+ literal(slot),
16498
+ variable(viewFnName),
16499
+ literal(decls),
16500
+ literal(vars),
16501
+ trackByFn
16502
+ ];
16503
+ if (trackByUsesComponentInstance || emptyViewFnName !== null) {
16504
+ args.push(literal(trackByUsesComponentInstance));
16505
+ if (emptyViewFnName !== null) {
16506
+ args.push(variable(emptyViewFnName));
16507
+ args.push(literal(emptyDecls));
16508
+ args.push(literal(emptyVars));
16509
+ }
16510
+ }
16511
+ return call(Identifiers.repeaterCreate, args, sourceSpan);
16512
+ }
16513
+ function repeater(metadataSlot, collection, sourceSpan) {
16514
+ return call(Identifiers.repeater, [literal(metadataSlot), collection], sourceSpan);
16515
+ }
16388
16516
  function i18n(slot, constIndex, subTemplateIndex) {
16389
16517
  const args = [literal(slot), literal(constIndex)];
16390
16518
  if (subTemplateIndex) {
@@ -16691,7 +16819,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
16691
16819
  return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
16692
16820
  }
16693
16821
 
16694
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
16822
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
16695
16823
  var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
16696
16824
  [SanitizerFn.Html, Identifiers.sanitizeHtml],
16697
16825
  [SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
@@ -16797,7 +16925,35 @@ function reifyCreateOperations(unit, ops) {
16797
16925
  if (op.slot === null) {
16798
16926
  throw new Error("No slot was assigned for project instruction");
16799
16927
  }
16800
- OpList.replace(op, projection(op.slot, op.projectionSlotIndex, op.attributes));
16928
+ OpList.replace(op, projection(op.slot, op.projectionSlotIndex, op.attributes, op.sourceSpan));
16929
+ break;
16930
+ case OpKind.RepeaterCreate:
16931
+ if (op.slot === null) {
16932
+ throw new Error("No slot was assigned for repeater instruction");
16933
+ }
16934
+ if (!(unit instanceof ViewCompilationUnit)) {
16935
+ throw new Error(`AssertionError: must be compiling a component`);
16936
+ }
16937
+ const repeaterView = unit.job.views.get(op.xref);
16938
+ if (repeaterView.fnName === null) {
16939
+ throw new Error(`AssertionError: expected repeater primary view to have been named`);
16940
+ }
16941
+ let emptyViewFnName = null;
16942
+ let emptyDecls = null;
16943
+ let emptyVars = null;
16944
+ if (op.emptyView !== null) {
16945
+ const emptyView = unit.job.views.get(op.emptyView);
16946
+ if (emptyView === void 0) {
16947
+ throw new Error("AssertionError: repeater had empty view xref, but empty view was not found");
16948
+ }
16949
+ if (emptyView.fnName === null || emptyView.decls === null || emptyView.vars === null) {
16950
+ throw new Error(`AssertionError: expected repeater empty view to have been named and counted`);
16951
+ }
16952
+ emptyViewFnName = emptyView.fnName;
16953
+ emptyDecls = emptyView.decls;
16954
+ emptyVars = emptyView.vars;
16955
+ }
16956
+ OpList.replace(op, repeaterCreate(op.slot, repeaterView.fnName, op.decls, op.vars, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.sourceSpan));
16801
16957
  break;
16802
16958
  case OpKind.Statement:
16803
16959
  break;
@@ -16886,6 +17042,9 @@ function reifyUpdateOperations(_unit, ops) {
16886
17042
  }
16887
17043
  OpList.replace(op, conditional(op.targetSlot, op.processed, op.contextValue, op.sourceSpan));
16888
17044
  break;
17045
+ case OpKind.Repeater:
17046
+ OpList.replace(op, repeater(op.targetSlot, op.collection, op.sourceSpan));
17047
+ break;
16889
17048
  case OpKind.Statement:
16890
17049
  break;
16891
17050
  default:
@@ -16963,7 +17122,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
16963
17122
  return fn(params, handlerStmts, void 0, void 0, name);
16964
17123
  }
16965
17124
 
16966
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17125
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
16967
17126
  function phaseRemoveEmptyBindings(job) {
16968
17127
  for (const unit of job.units) {
16969
17128
  for (const op of unit.update) {
@@ -16984,7 +17143,7 @@ function phaseRemoveEmptyBindings(job) {
16984
17143
  }
16985
17144
  }
16986
17145
 
16987
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17146
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
16988
17147
  function phaseResolveContexts(cpl) {
16989
17148
  for (const unit of cpl.units) {
16990
17149
  processLexicalScope(unit, unit.create);
@@ -17008,6 +17167,9 @@ function processLexicalScope(view, ops) {
17008
17167
  break;
17009
17168
  }
17010
17169
  }
17170
+ if (view === view.job.root) {
17171
+ scope.set(view.xref, variable("ctx"));
17172
+ }
17011
17173
  for (const op of ops) {
17012
17174
  transformExpressionsInOp(op, (expr) => {
17013
17175
  if (expr instanceof ContextExpr) {
@@ -17022,7 +17184,7 @@ function processLexicalScope(view, ops) {
17022
17184
  }
17023
17185
  }
17024
17186
 
17025
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17187
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17026
17188
  function phaseResolveDollarEvent(job) {
17027
17189
  for (const unit of job.units) {
17028
17190
  resolveDollarEvent(unit, unit.create);
@@ -17043,7 +17205,7 @@ function resolveDollarEvent(unit, ops) {
17043
17205
  }
17044
17206
  }
17045
17207
 
17046
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_placeholders.mjs
17208
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_placeholders.mjs
17047
17209
  var ESCAPE = "\uFFFD";
17048
17210
  var ELEMENT_MARKER = "#";
17049
17211
  var TEMPLATE_MARKER = "*";
@@ -17057,24 +17219,51 @@ var I18nParamValueFlags;
17057
17219
  I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
17058
17220
  I18nParamValueFlags2[I18nParamValueFlags2["ElementTag"] = 1] = "ElementTag";
17059
17221
  I18nParamValueFlags2[I18nParamValueFlags2["TemplateTag"] = 2] = "TemplateTag";
17060
- I18nParamValueFlags2[I18nParamValueFlags2["CloseTag"] = 4] = "CloseTag";
17222
+ I18nParamValueFlags2[I18nParamValueFlags2["OpenTag"] = 4] = "OpenTag";
17223
+ I18nParamValueFlags2[I18nParamValueFlags2["CloseTag"] = 8] = "CloseTag";
17061
17224
  })(I18nParamValueFlags || (I18nParamValueFlags = {}));
17062
17225
  var I18nPlaceholderParams = class {
17063
17226
  constructor() {
17064
17227
  this.values = /* @__PURE__ */ new Map();
17065
17228
  }
17066
- addValue(placeholder, value, subTemplateIndex, flags) {
17229
+ addValue(placeholder, value, subTemplateIndex, resolutionTime, flags) {
17067
17230
  var _a2;
17068
17231
  const placeholderValues = (_a2 = this.values.get(placeholder)) != null ? _a2 : [];
17069
- placeholderValues.push({ value, subTemplateIndex, flags });
17232
+ placeholderValues.push({ value, subTemplateIndex, resolutionTime, flags });
17070
17233
  this.values.set(placeholder, placeholderValues);
17071
17234
  }
17072
17235
  saveToOp(op) {
17073
17236
  for (const [placeholder, placeholderValues] of this.values) {
17074
- op.params.set(placeholder, literal(this.serializeValues(placeholderValues)));
17237
+ const creationValues = placeholderValues.filter(({ resolutionTime }) => resolutionTime === I18nParamResolutionTime.Creation);
17238
+ if (creationValues.length > 1) {
17239
+ op.needsPostprocessing = true;
17240
+ }
17241
+ const serializedCreationValues = this.serializeValues(creationValues);
17242
+ if (serializedCreationValues !== null) {
17243
+ op.params.set(placeholder, literal(serializedCreationValues));
17244
+ }
17245
+ const serializedPostprocessingValues = this.serializeValues(placeholderValues.filter(({ resolutionTime }) => resolutionTime === I18nParamResolutionTime.Postproccessing));
17246
+ if (serializedPostprocessingValues !== null) {
17247
+ op.needsPostprocessing = true;
17248
+ op.postprocessingParams.set(placeholder, literal(serializedPostprocessingValues));
17249
+ }
17250
+ }
17251
+ }
17252
+ merge(other) {
17253
+ for (const [placeholder, otherValues] of other.values) {
17254
+ const currentValues = this.values.get(placeholder) || [];
17255
+ const flags = otherValues[0].flags;
17256
+ if (flags & I18nParamValueFlags.CloseTag && !(flags & I18nParamValueFlags.OpenTag)) {
17257
+ this.values.set(placeholder, [...otherValues, ...currentValues]);
17258
+ } else {
17259
+ this.values.set(placeholder, [...currentValues, ...otherValues]);
17260
+ }
17075
17261
  }
17076
17262
  }
17077
17263
  serializeValues(values) {
17264
+ if (values.length === 0) {
17265
+ return null;
17266
+ }
17078
17267
  const serializedValues = values.map((value) => this.serializeValue(value));
17079
17268
  return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
17080
17269
  }
@@ -17090,36 +17279,77 @@ var I18nPlaceholderParams = class {
17090
17279
  closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
17091
17280
  }
17092
17281
  const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
17282
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
17283
+ return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
17284
+ }
17093
17285
  return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
17094
17286
  }
17095
17287
  };
17096
17288
  function phaseResolveI18nPlaceholders(job) {
17289
+ const params = /* @__PURE__ */ new Map();
17290
+ const i18nOps = /* @__PURE__ */ new Map();
17291
+ resolvePlaceholders(job, params, i18nOps);
17292
+ propagatePlaceholders(params, i18nOps);
17293
+ for (const [xref, i18nOpParams] of params) {
17294
+ i18nOpParams.saveToOp(i18nOps.get(xref));
17295
+ }
17296
+ for (const op of i18nOps.values()) {
17297
+ if (op.xref === op.root) {
17298
+ for (const placeholder in op.message.placeholders) {
17299
+ if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
17300
+ throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
17301
+ }
17302
+ }
17303
+ }
17304
+ }
17305
+ }
17306
+ function resolvePlaceholders(job, params, i18nOps) {
17097
17307
  for (const unit of job.units) {
17098
- const i18nOps = /* @__PURE__ */ new Map();
17099
- const params = /* @__PURE__ */ new Map();
17308
+ const elements = /* @__PURE__ */ new Map();
17100
17309
  let currentI18nOp = null;
17101
17310
  for (const op of unit.create) {
17102
17311
  switch (op.kind) {
17103
17312
  case OpKind.I18nStart:
17104
- case OpKind.I18n:
17105
17313
  i18nOps.set(op.xref, op);
17106
17314
  currentI18nOp = op.kind === OpKind.I18nStart ? op : null;
17107
17315
  break;
17108
17316
  case OpKind.I18nEnd:
17109
17317
  currentI18nOp = null;
17110
17318
  break;
17111
- case OpKind.Element:
17112
17319
  case OpKind.ElementStart:
17113
- case OpKind.Template:
17114
17320
  if (op.i18nPlaceholder !== void 0) {
17115
17321
  if (currentI18nOp === null) {
17116
17322
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17117
17323
  }
17324
+ elements.set(op.xref, op);
17118
17325
  const { startName, closeName } = op.i18nPlaceholder;
17119
- const subTemplateIndex = getSubTemplateIndexForTag(job, currentI18nOp, op);
17120
- const flags = op.kind === OpKind.Template ? I18nParamValueFlags.TemplateTag : I18nParamValueFlags.ElementTag;
17121
- addParam(params, currentI18nOp, startName, op.slot, subTemplateIndex, flags);
17122
- addParam(params, currentI18nOp, closeName, op.slot, subTemplateIndex, flags | I18nParamValueFlags.CloseTag);
17326
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
17327
+ if (closeName === "") {
17328
+ flags |= I18nParamValueFlags.CloseTag;
17329
+ }
17330
+ addParam(params, currentI18nOp, startName, op.slot, currentI18nOp.subTemplateIndex, I18nParamResolutionTime.Creation, flags);
17331
+ }
17332
+ break;
17333
+ case OpKind.ElementEnd:
17334
+ const startOp = elements.get(op.xref);
17335
+ if (startOp && startOp.i18nPlaceholder !== void 0) {
17336
+ if (currentI18nOp === null) {
17337
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
17338
+ }
17339
+ const { closeName } = startOp.i18nPlaceholder;
17340
+ if (closeName !== "") {
17341
+ addParam(params, currentI18nOp, closeName, startOp.slot, currentI18nOp.subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
17342
+ }
17343
+ }
17344
+ break;
17345
+ case OpKind.Template:
17346
+ if (op.i18nPlaceholder !== void 0) {
17347
+ if (currentI18nOp === null) {
17348
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
17349
+ }
17350
+ const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentI18nOp, op);
17351
+ addParam(params, currentI18nOp, op.i18nPlaceholder.startName, op.slot, subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.TemplateTag);
17352
+ addParam(params, currentI18nOp, op.i18nPlaceholder.closeName, op.slot, subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
17123
17353
  }
17124
17354
  break;
17125
17355
  }
@@ -17132,33 +17362,36 @@ function phaseResolveI18nPlaceholders(job) {
17132
17362
  if (!i18nOp) {
17133
17363
  throw Error("Cannot find corresponding i18nStart for i18nExpr");
17134
17364
  }
17135
- addParam(params, i18nOp, op.i18nPlaceholder.name, index++, i18nOp.subTemplateIndex);
17365
+ addParam(params, i18nOp, op.i18nPlaceholder, index++, i18nOp.subTemplateIndex, op.resolutionTime);
17136
17366
  i18nBlockPlaceholderIndices.set(op.owner, index);
17137
17367
  }
17138
17368
  }
17139
- for (const [xref, i18nOpParams] of params) {
17140
- i18nOpParams.saveToOp(i18nOps.get(xref));
17141
- }
17142
17369
  }
17143
17370
  }
17144
- function addParam(params, i18nOp, placeholder, value, subTemplateIndex, flags = I18nParamValueFlags.None) {
17145
- var _a2;
17146
- const i18nOpParams = (_a2 = params.get(i18nOp.xref)) != null ? _a2 : new I18nPlaceholderParams();
17147
- i18nOpParams.addValue(placeholder, value, subTemplateIndex, flags);
17371
+ function addParam(params, i18nOp, placeholder, value, subTemplateIndex, resolutionTime, flags = I18nParamValueFlags.None) {
17372
+ const i18nOpParams = params.get(i18nOp.xref) || new I18nPlaceholderParams();
17373
+ i18nOpParams.addValue(placeholder, value, subTemplateIndex, resolutionTime, flags);
17148
17374
  params.set(i18nOp.xref, i18nOpParams);
17149
17375
  }
17150
- function getSubTemplateIndexForTag(job, i18nOp, op) {
17151
- if (op.kind === OpKind.Template) {
17152
- for (const childOp of job.views.get(op.xref).create) {
17153
- if (childOp.kind === OpKind.I18nStart) {
17154
- return childOp.subTemplateIndex;
17155
- }
17376
+ function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
17377
+ for (const childOp of job.views.get(op.xref).create) {
17378
+ if (childOp.kind === OpKind.I18nStart) {
17379
+ return childOp.subTemplateIndex;
17156
17380
  }
17157
17381
  }
17158
17382
  return i18nOp.subTemplateIndex;
17159
17383
  }
17384
+ function propagatePlaceholders(params, i18nOps) {
17385
+ for (const [xref, opParams] of params) {
17386
+ const op = i18nOps.get(xref);
17387
+ if (op.xref !== op.root) {
17388
+ const rootParams = params.get(op.root) || new I18nPlaceholderParams();
17389
+ rootParams.merge(opParams);
17390
+ }
17391
+ }
17392
+ }
17160
17393
 
17161
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17394
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17162
17395
  function phaseResolveNames(cpl) {
17163
17396
  for (const unit of cpl.units) {
17164
17397
  processLexicalScope2(unit, unit.create, null);
@@ -17172,6 +17405,7 @@ function processLexicalScope2(unit, ops, savedView) {
17172
17405
  case OpKind.Variable:
17173
17406
  switch (op.variable.kind) {
17174
17407
  case SemanticVariableKind.Identifier:
17408
+ case SemanticVariableKind.Alias:
17175
17409
  if (scope.has(op.variable.identifier)) {
17176
17410
  continue;
17177
17411
  }
@@ -17221,7 +17455,7 @@ function processLexicalScope2(unit, ops, savedView) {
17221
17455
  }
17222
17456
  }
17223
17457
 
17224
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17458
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17225
17459
  var sanitizers = /* @__PURE__ */ new Map([
17226
17460
  [SecurityContext.HTML, SanitizerFn.Html],
17227
17461
  [SecurityContext.SCRIPT, SanitizerFn.Script],
@@ -17231,7 +17465,7 @@ var sanitizers = /* @__PURE__ */ new Map([
17231
17465
  ]);
17232
17466
  function phaseResolveSanitizers(job) {
17233
17467
  for (const unit of job.units) {
17234
- const elements = getElementsByXrefId(unit);
17468
+ const elements = createOpXrefMap(unit);
17235
17469
  let sanitizerFn;
17236
17470
  for (const op of unit.update) {
17237
17471
  switch (op.kind) {
@@ -17241,7 +17475,7 @@ function phaseResolveSanitizers(job) {
17241
17475
  op.sanitizer = sanitizerFn ? new SanitizerExpr(sanitizerFn) : null;
17242
17476
  if (op.sanitizer === null) {
17243
17477
  const ownerOp = elements.get(op.target);
17244
- if (ownerOp === void 0) {
17478
+ if (ownerOp === void 0 || !isElementOrContainerOp(ownerOp)) {
17245
17479
  throw Error("Property should have an element-like owner");
17246
17480
  }
17247
17481
  if (isIframeElement(ownerOp) && isIframeSecuritySensitiveAttr(op.name)) {
@@ -17254,10 +17488,11 @@ function phaseResolveSanitizers(job) {
17254
17488
  }
17255
17489
  }
17256
17490
  function isIframeElement(op) {
17257
- return (op.kind === OpKind.Element || op.kind === OpKind.ElementStart) && op.tag.toLowerCase() === "iframe";
17491
+ var _a2;
17492
+ return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
17258
17493
  }
17259
17494
 
17260
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
17495
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
17261
17496
  function phaseSaveRestoreView(job) {
17262
17497
  for (const view of job.views.values()) {
17263
17498
  view.create.prepend([
@@ -17265,7 +17500,7 @@ function phaseSaveRestoreView(job) {
17265
17500
  kind: SemanticVariableKind.SavedView,
17266
17501
  name: null,
17267
17502
  view: view.xref
17268
- }, new GetCurrentViewExpr())
17503
+ }, new GetCurrentViewExpr(), VariableFlags.None)
17269
17504
  ]);
17270
17505
  for (const op of view.create) {
17271
17506
  if (op.kind !== OpKind.Listener) {
@@ -17293,7 +17528,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
17293
17528
  kind: SemanticVariableKind.Context,
17294
17529
  name: null,
17295
17530
  view: unit.xref
17296
- }, new RestoreViewExpr(unit.xref))
17531
+ }, new RestoreViewExpr(unit.xref), VariableFlags.None)
17297
17532
  ]);
17298
17533
  for (const handlerOp of op.handlerOps) {
17299
17534
  if (handlerOp.kind === OpKind.Statement && handlerOp.statement instanceof ReturnStatement) {
@@ -17302,7 +17537,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
17302
17537
  }
17303
17538
  }
17304
17539
 
17305
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
17540
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
17306
17541
  function phaseSlotAllocation(job) {
17307
17542
  const slotMap = /* @__PURE__ */ new Map();
17308
17543
  for (const unit of job.units) {
@@ -17319,11 +17554,11 @@ function phaseSlotAllocation(job) {
17319
17554
  }
17320
17555
  for (const unit of job.units) {
17321
17556
  for (const op of unit.ops()) {
17322
- if (op.kind === OpKind.Template) {
17557
+ if (op.kind === OpKind.Template || op.kind === OpKind.RepeaterCreate) {
17323
17558
  const childView = job.views.get(op.xref);
17324
17559
  op.decls = childView.decls;
17325
17560
  }
17326
- if (hasUsesSlotIndexTrait(op) && op.targetSlot === null) {
17561
+ if (hasUsesSlotIndexTrait(op) && op.target !== null && op.targetSlot === null) {
17327
17562
  if (!slotMap.has(op.target)) {
17328
17563
  throw new Error(`AssertionError: no slot allocated for ${OpKind[op.kind]} target ${op.target}`);
17329
17564
  }
@@ -17345,7 +17580,7 @@ function phaseSlotAllocation(job) {
17345
17580
  }
17346
17581
  }
17347
17582
 
17348
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
17583
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
17349
17584
  function phaseStyleBindingSpecialization(cpl) {
17350
17585
  for (const unit of cpl.units) {
17351
17586
  for (const op of unit.update) {
@@ -17375,7 +17610,7 @@ function phaseStyleBindingSpecialization(cpl) {
17375
17610
  }
17376
17611
  }
17377
17612
 
17378
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
17613
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
17379
17614
  function phaseTemporaryVariables(cpl) {
17380
17615
  for (const unit of cpl.units) {
17381
17616
  unit.create.prepend(generateTemporaries(unit.create));
@@ -17433,9 +17668,121 @@ function assignName(names, expr) {
17433
17668
  expr.name = name;
17434
17669
  }
17435
17670
 
17436
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
17671
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
17672
+ function phaseVarCounting(job) {
17673
+ for (const unit of job.units) {
17674
+ let varCount = 0;
17675
+ for (const op of unit.ops()) {
17676
+ if (hasConsumesVarsTrait(op)) {
17677
+ varCount += varsUsedByOp(op);
17678
+ }
17679
+ }
17680
+ for (const op of unit.ops()) {
17681
+ visitExpressionsInOp(op, (expr) => {
17682
+ if (!isIrExpression(expr)) {
17683
+ return;
17684
+ }
17685
+ if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && expr instanceof PureFunctionExpr) {
17686
+ return;
17687
+ }
17688
+ if (hasUsesVarOffsetTrait(expr)) {
17689
+ expr.varOffset = varCount;
17690
+ }
17691
+ if (hasConsumesVarsTrait(expr)) {
17692
+ varCount += varsUsedByIrExpression(expr);
17693
+ }
17694
+ });
17695
+ }
17696
+ if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
17697
+ for (const op of unit.ops()) {
17698
+ visitExpressionsInOp(op, (expr) => {
17699
+ if (!isIrExpression(expr) || !(expr instanceof PureFunctionExpr)) {
17700
+ return;
17701
+ }
17702
+ if (hasUsesVarOffsetTrait(expr)) {
17703
+ expr.varOffset = varCount;
17704
+ }
17705
+ if (hasConsumesVarsTrait(expr)) {
17706
+ varCount += varsUsedByIrExpression(expr);
17707
+ }
17708
+ });
17709
+ }
17710
+ }
17711
+ unit.vars = varCount;
17712
+ }
17713
+ if (job instanceof ComponentCompilationJob) {
17714
+ for (const unit of job.units) {
17715
+ for (const op of unit.create) {
17716
+ if (op.kind !== OpKind.Template && op.kind !== OpKind.RepeaterCreate) {
17717
+ continue;
17718
+ }
17719
+ const childView = job.views.get(op.xref);
17720
+ op.vars = childView.vars;
17721
+ }
17722
+ }
17723
+ }
17724
+ }
17725
+ function varsUsedByOp(op) {
17726
+ let slots;
17727
+ switch (op.kind) {
17728
+ case OpKind.Property:
17729
+ case OpKind.HostProperty:
17730
+ case OpKind.Attribute:
17731
+ slots = 1;
17732
+ if (op.expression instanceof Interpolation2 && !isSingletonInterpolation(op.expression)) {
17733
+ slots += op.expression.expressions.length;
17734
+ }
17735
+ return slots;
17736
+ case OpKind.StyleProp:
17737
+ case OpKind.ClassProp:
17738
+ case OpKind.StyleMap:
17739
+ case OpKind.ClassMap:
17740
+ slots = 2;
17741
+ if (op.expression instanceof Interpolation2) {
17742
+ slots += op.expression.expressions.length;
17743
+ }
17744
+ return slots;
17745
+ case OpKind.InterpolateText:
17746
+ return op.interpolation.expressions.length;
17747
+ case OpKind.I18nExpression:
17748
+ case OpKind.Conditional:
17749
+ return 1;
17750
+ default:
17751
+ throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
17752
+ }
17753
+ }
17754
+ function varsUsedByIrExpression(expr) {
17755
+ switch (expr.kind) {
17756
+ case ExpressionKind.PureFunctionExpr:
17757
+ return 1 + expr.args.length;
17758
+ case ExpressionKind.PipeBinding:
17759
+ return 1 + expr.args.length;
17760
+ case ExpressionKind.PipeBindingVariadic:
17761
+ return 1 + expr.numArgs;
17762
+ default:
17763
+ throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`);
17764
+ }
17765
+ }
17766
+ function isSingletonInterpolation(expr) {
17767
+ if (expr.expressions.length !== 1 || expr.strings.length !== 2) {
17768
+ return false;
17769
+ }
17770
+ if (expr.strings[0] !== "" || expr.strings[1] !== "") {
17771
+ return false;
17772
+ }
17773
+ return true;
17774
+ }
17775
+
17776
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
17437
17777
  function phaseVariableOptimization(job) {
17438
17778
  for (const unit of job.units) {
17779
+ inlineAlwaysInlineVariables(unit.create);
17780
+ inlineAlwaysInlineVariables(unit.update);
17781
+ for (const op of unit.create) {
17782
+ if (op.kind === OpKind.Listener) {
17783
+ inlineAlwaysInlineVariables(op.handlerOps);
17784
+ }
17785
+ }
17439
17786
  optimizeVariablesInOpList(unit.create, job.compatibility);
17440
17787
  optimizeVariablesInOpList(unit.update, job.compatibility);
17441
17788
  for (const op of unit.create) {
@@ -17452,6 +17799,29 @@ var Fence;
17452
17799
  Fence2[Fence2["ViewContextWrite"] = 3] = "ViewContextWrite";
17453
17800
  Fence2[Fence2["SideEffectful"] = 4] = "SideEffectful";
17454
17801
  })(Fence || (Fence = {}));
17802
+ function inlineAlwaysInlineVariables(ops) {
17803
+ const vars = /* @__PURE__ */ new Map();
17804
+ for (const op of ops) {
17805
+ if (op.kind === OpKind.Variable && op.flags & VariableFlags.AlwaysInline) {
17806
+ visitExpressionsInOp(op, (expr) => {
17807
+ if (isIrExpression(expr) && fencesForIrExpression(expr) !== Fence.None) {
17808
+ throw new Error(`AssertionError: A context-sensitive variable was marked AlwaysInline`);
17809
+ }
17810
+ });
17811
+ vars.set(op.xref, op);
17812
+ }
17813
+ transformExpressionsInOp(op, (expr) => {
17814
+ if (expr instanceof ReadVariableExpr && vars.has(expr.xref)) {
17815
+ const varOp = vars.get(expr.xref);
17816
+ return varOp.initializer.clone();
17817
+ }
17818
+ return expr;
17819
+ }, VisitorContextFlag.None);
17820
+ }
17821
+ for (const op of vars.values()) {
17822
+ OpList.remove(op);
17823
+ }
17824
+ }
17455
17825
  function optimizeVariablesInOpList(ops, compatibility) {
17456
17826
  const varDecls = /* @__PURE__ */ new Map();
17457
17827
  const varUsages = /* @__PURE__ */ new Map();
@@ -17491,7 +17861,10 @@ function optimizeVariablesInOpList(ops, compatibility) {
17491
17861
  }
17492
17862
  const toInline = [];
17493
17863
  for (const [id, count] of varUsages) {
17494
- if (count !== 1) {
17864
+ const decl = varDecls.get(id);
17865
+ const varInfo = opMap.get(decl);
17866
+ const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
17867
+ if (count !== 1 || isAlwaysInline) {
17495
17868
  continue;
17496
17869
  }
17497
17870
  if (varRemoteUsages.has(id)) {
@@ -17503,6 +17876,10 @@ function optimizeVariablesInOpList(ops, compatibility) {
17503
17876
  while (candidate = toInline.pop()) {
17504
17877
  const decl = varDecls.get(candidate);
17505
17878
  const varInfo = opMap.get(decl);
17879
+ const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
17880
+ if (isAlwaysInline) {
17881
+ throw new Error(`AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.`);
17882
+ }
17506
17883
  for (let targetOp = decl.next; targetOp.kind !== OpKind.ListEnd; targetOp = targetOp.next) {
17507
17884
  const opInfo = opMap.get(targetOp);
17508
17885
  if (opInfo.variablesUsed.has(candidate)) {
@@ -17646,7 +18023,129 @@ function allowConservativeInlining(decl, target) {
17646
18023
  }
17647
18024
  }
17648
18025
 
17649
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18026
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18027
+ function phaseWrapIcus(job) {
18028
+ for (const unit of job.units) {
18029
+ let currentI18nOp = null;
18030
+ for (const op of unit.create) {
18031
+ switch (op.kind) {
18032
+ case OpKind.I18nStart:
18033
+ currentI18nOp = op;
18034
+ break;
18035
+ case OpKind.I18nEnd:
18036
+ currentI18nOp = null;
18037
+ break;
18038
+ case OpKind.Icu:
18039
+ if (currentI18nOp === null) {
18040
+ const id = job.allocateXrefId();
18041
+ OpList.insertBefore(createI18nStartOp(id, op.message), op);
18042
+ OpList.insertAfter(createI18nEndOp(id), op);
18043
+ }
18044
+ break;
18045
+ }
18046
+ }
18047
+ }
18048
+ }
18049
+
18050
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18051
+ function phaseTrackVariables(job) {
18052
+ for (const unit of job.units) {
18053
+ for (const op of unit.create) {
18054
+ if (op.kind !== OpKind.RepeaterCreate) {
18055
+ continue;
18056
+ }
18057
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
18058
+ if (expr instanceof LexicalReadExpr) {
18059
+ if (expr.name === op.varNames.$index) {
18060
+ return variable("$index");
18061
+ } else if (expr.name === op.varNames.$implicit) {
18062
+ return variable("$item");
18063
+ }
18064
+ }
18065
+ return expr;
18066
+ }, VisitorContextFlag.None);
18067
+ }
18068
+ }
18069
+ }
18070
+
18071
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18072
+ function phaseTrackFnGeneration(job) {
18073
+ for (const unit of job.units) {
18074
+ for (const op of unit.create) {
18075
+ if (op.kind !== OpKind.RepeaterCreate) {
18076
+ continue;
18077
+ }
18078
+ if (op.trackByFn !== null) {
18079
+ continue;
18080
+ }
18081
+ let usesComponentContext = false;
18082
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
18083
+ if (expr instanceof TrackContextExpr) {
18084
+ usesComponentContext = true;
18085
+ return variable("this");
18086
+ }
18087
+ return expr;
18088
+ }, VisitorContextFlag.None);
18089
+ let fn2;
18090
+ const fnParams = [new FnParam("$index"), new FnParam("$item")];
18091
+ if (usesComponentContext) {
18092
+ fn2 = new FunctionExpr(fnParams, [new ReturnStatement(op.track)]);
18093
+ } else {
18094
+ fn2 = arrowFn(fnParams, op.track);
18095
+ }
18096
+ op.trackByFn = job.pool.getSharedFunctionReference(fn2, "_forTrack");
18097
+ }
18098
+ }
18099
+ }
18100
+
18101
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18102
+ function phaseTrackFnOptimization(job) {
18103
+ for (const unit of job.units) {
18104
+ for (const op of unit.create) {
18105
+ if (op.kind !== OpKind.RepeaterCreate) {
18106
+ continue;
18107
+ }
18108
+ if (op.track instanceof ReadVarExpr && op.track.name === "$index") {
18109
+ op.trackByFn = importExpr(Identifiers.repeaterTrackByIndex);
18110
+ } else if (op.track instanceof ReadVarExpr && op.track.name === "$item") {
18111
+ op.trackByFn = importExpr(Identifiers.repeaterTrackByIdentity);
18112
+ } else if (isTrackByFunctionCall(job.root.xref, op.track)) {
18113
+ if (op.track.receiver.receiver.view === unit.xref) {
18114
+ op.trackByFn = op.track.receiver;
18115
+ } else {
18116
+ op.trackByFn = importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name);
18117
+ op.track = op.trackByFn;
18118
+ }
18119
+ } else {
18120
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
18121
+ if (expr instanceof ContextExpr) {
18122
+ op.usesComponentInstance = true;
18123
+ return new TrackContextExpr(expr.view);
18124
+ }
18125
+ return expr;
18126
+ }, VisitorContextFlag.None);
18127
+ }
18128
+ }
18129
+ }
18130
+ }
18131
+ function isTrackByFunctionCall(rootView, expr) {
18132
+ if (!(expr instanceof InvokeFunctionExpr) || expr.args.length !== 2) {
18133
+ return false;
18134
+ }
18135
+ if (!(expr.receiver instanceof ReadPropExpr && expr.receiver.receiver instanceof ContextExpr) || expr.receiver.receiver.view !== rootView) {
18136
+ return false;
18137
+ }
18138
+ const [arg0, arg1] = expr.args;
18139
+ if (!(arg0 instanceof ReadVarExpr) || arg0.name !== "$index") {
18140
+ return false;
18141
+ }
18142
+ if (!(arg1 instanceof ReadVarExpr) || arg1.name !== "$item") {
18143
+ return false;
18144
+ }
18145
+ return true;
18146
+ }
18147
+
18148
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
17650
18149
  var phases = [
17651
18150
  { kind: CompilationJobKind.Tmpl, fn: phaseRemoveContentSelectors },
17652
18151
  { kind: CompilationJobKind.Host, fn: phaseHostStylePropertyParsing },
@@ -17654,12 +18153,16 @@ var phases = [
17654
18153
  { kind: CompilationJobKind.Both, fn: phaseStyleBindingSpecialization },
17655
18154
  { kind: CompilationJobKind.Both, fn: phaseBindingSpecialization },
17656
18155
  { kind: CompilationJobKind.Tmpl, fn: phasePropagateI18nBlocks },
18156
+ { kind: CompilationJobKind.Tmpl, fn: phaseWrapIcus },
17657
18157
  { kind: CompilationJobKind.Both, fn: phaseAttributeExtraction },
17658
18158
  { kind: CompilationJobKind.Both, fn: phaseParseExtractedStyles },
17659
18159
  { kind: CompilationJobKind.Tmpl, fn: phaseRemoveEmptyBindings },
18160
+ { kind: CompilationJobKind.Both, fn: phaseCollapseSingletonInterpolations },
18161
+ { kind: CompilationJobKind.Both, fn: phaseOrdering },
17660
18162
  { kind: CompilationJobKind.Tmpl, fn: phaseConditionals },
17661
18163
  { kind: CompilationJobKind.Tmpl, fn: phasePipeCreation },
17662
18164
  { kind: CompilationJobKind.Tmpl, fn: phaseI18nTextExtraction },
18165
+ { kind: CompilationJobKind.Tmpl, fn: phaseIcuExtraction },
17663
18166
  { kind: CompilationJobKind.Tmpl, fn: phaseApplyI18nExpressions },
17664
18167
  { kind: CompilationJobKind.Tmpl, fn: phasePipeVariadic },
17665
18168
  { kind: CompilationJobKind.Both, fn: phasePureLiteralStructures },
@@ -17668,7 +18171,10 @@ var phases = [
17668
18171
  { kind: CompilationJobKind.Tmpl, fn: phaseSaveRestoreView },
17669
18172
  { kind: CompilationJobKind.Tmpl, fn: phaseFindAnyCasts },
17670
18173
  { kind: CompilationJobKind.Both, fn: phaseResolveDollarEvent },
18174
+ { kind: CompilationJobKind.Tmpl, fn: phaseRepeaterDerivedVars },
18175
+ { kind: CompilationJobKind.Tmpl, fn: phaseTrackVariables },
17671
18176
  { kind: CompilationJobKind.Both, fn: phaseResolveNames },
18177
+ { kind: CompilationJobKind.Tmpl, fn: phaseTrackFnOptimization },
17672
18178
  { kind: CompilationJobKind.Both, fn: phaseResolveContexts },
17673
18179
  { kind: CompilationJobKind.Tmpl, fn: phaseResolveSanitizers },
17674
18180
  { kind: CompilationJobKind.Tmpl, fn: phaseLocalRefs },
@@ -17677,7 +18183,7 @@ var phases = [
17677
18183
  { kind: CompilationJobKind.Both, fn: phaseTemporaryVariables },
17678
18184
  { kind: CompilationJobKind.Tmpl, fn: phaseSlotAllocation },
17679
18185
  { kind: CompilationJobKind.Tmpl, fn: phaseResolveI18nPlaceholders },
17680
- { kind: CompilationJobKind.Tmpl, fn: phasePropagateI18nPlaceholders },
18186
+ { kind: CompilationJobKind.Tmpl, fn: phaseTrackFnGeneration },
17681
18187
  { kind: CompilationJobKind.Tmpl, fn: phaseI18nMessageExtraction },
17682
18188
  { kind: CompilationJobKind.Tmpl, fn: phaseI18nConstCollection },
17683
18189
  { kind: CompilationJobKind.Tmpl, fn: phaseConstTraitCollection },
@@ -17692,8 +18198,6 @@ var phases = [
17692
18198
  { kind: CompilationJobKind.Tmpl, fn: phaseEmptyElements },
17693
18199
  { kind: CompilationJobKind.Tmpl, fn: phaseNonbindable },
17694
18200
  { kind: CompilationJobKind.Both, fn: phasePureFunctionExtraction },
17695
- { kind: CompilationJobKind.Tmpl, fn: phaseAlignPipeVariadicVarOffset },
17696
- { kind: CompilationJobKind.Both, fn: phaseOrdering },
17697
18201
  { kind: CompilationJobKind.Both, fn: phaseReify },
17698
18202
  { kind: CompilationJobKind.Both, fn: phaseChaining }
17699
18203
  ];
@@ -17799,7 +18303,7 @@ function emitHostBindingFunction(job) {
17799
18303
  );
17800
18304
  }
17801
18305
 
17802
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18306
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
17803
18307
  var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
17804
18308
  function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds) {
17805
18309
  const cpl = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds);
@@ -17875,6 +18379,10 @@ function ingestNodes(unit, template2) {
17875
18379
  ingestSwitchBlock(unit, node);
17876
18380
  } else if (node instanceof DeferredBlock) {
17877
18381
  ingestDeferBlock(unit, node);
18382
+ } else if (node instanceof Icu) {
18383
+ ingestIcu(unit, node);
18384
+ } else if (node instanceof ForLoopBlock) {
18385
+ ingestForBlock(unit, node);
17878
18386
  } else {
17879
18387
  throw new Error(`Unsupported template node: ${node.constructor.name}`);
17880
18388
  }
@@ -17914,22 +18422,22 @@ function ingestTemplate(unit, tmpl) {
17914
18422
  [namespacePrefix, tagNameWithoutNamespace] = splitNsName(tmpl.tagName);
17915
18423
  }
17916
18424
  const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
17917
- const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace != null ? tagNameWithoutNamespace : "ng-template", namespaceForKey(namespacePrefix), false, i18nPlaceholder, tmpl.startSourceSpan);
18425
+ const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace, namespaceForKey(namespacePrefix), false, i18nPlaceholder, tmpl.startSourceSpan);
17918
18426
  unit.create.push(tplOp);
17919
18427
  ingestBindings(unit, tplOp, tmpl);
17920
18428
  ingestReferences(tplOp, tmpl);
17921
18429
  ingestNodes(childView, tmpl.children);
17922
18430
  for (const { name, value } of tmpl.variables) {
17923
- childView.contextVariables.set(name, value);
18431
+ childView.contextVariables.set(name, value !== "" ? value : "$implicit");
17924
18432
  }
17925
- if (tmpl.i18n instanceof Message) {
18433
+ if (isPlainTemplate(tmpl) && tmpl.i18n instanceof Message) {
17926
18434
  const id = unit.job.allocateXrefId();
17927
18435
  OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
17928
18436
  OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
17929
18437
  }
17930
18438
  }
17931
18439
  function ingestContent(unit, content) {
17932
- const op = createProjectionOp(unit.job.allocateXrefId(), content.selector);
18440
+ const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.sourceSpan);
17933
18441
  for (const attr of content.attributes) {
17934
18442
  ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
17935
18443
  }
@@ -18032,6 +18540,57 @@ function ingestDeferBlock(unit, deferBlock) {
18032
18540
  const deferOnOp = createDeferOnOp(unit.job.allocateXrefId(), null);
18033
18541
  unit.create.push(deferOnOp);
18034
18542
  }
18543
+ function ingestIcu(unit, icu) {
18544
+ var _a2;
18545
+ if (icu.i18n instanceof Message) {
18546
+ const xref = unit.job.allocateXrefId();
18547
+ unit.create.push(createIcuOp(xref, icu.i18n, null));
18548
+ unit.update.push(createIcuUpdateOp(xref, null));
18549
+ } else {
18550
+ throw Error(`Unhandled i18n metadata type for ICU: ${(_a2 = icu.i18n) == null ? void 0 : _a2.constructor.name}`);
18551
+ }
18552
+ }
18553
+ function ingestForBlock(unit, forBlock) {
18554
+ var _a2;
18555
+ const repeaterView = unit.job.allocateView(unit.xref);
18556
+ const createRepeaterAlias = (ident, repeaterVar) => {
18557
+ repeaterView.aliases.add({
18558
+ kind: SemanticVariableKind.Alias,
18559
+ name: null,
18560
+ identifier: ident,
18561
+ expression: new DerivedRepeaterVarExpr(repeaterView.xref, repeaterVar)
18562
+ });
18563
+ };
18564
+ repeaterView.contextVariables.set(forBlock.item.name, forBlock.item.value);
18565
+ repeaterView.contextVariables.set(forBlock.contextVariables.$index.name, forBlock.contextVariables.$index.value);
18566
+ repeaterView.contextVariables.set(forBlock.contextVariables.$count.name, forBlock.contextVariables.$count.value);
18567
+ createRepeaterAlias(forBlock.contextVariables.$first.name, DerivedRepeaterVarIdentity.First);
18568
+ createRepeaterAlias(forBlock.contextVariables.$last.name, DerivedRepeaterVarIdentity.Last);
18569
+ createRepeaterAlias(forBlock.contextVariables.$even.name, DerivedRepeaterVarIdentity.Even);
18570
+ createRepeaterAlias(forBlock.contextVariables.$odd.name, DerivedRepeaterVarIdentity.Odd);
18571
+ const sourceSpan = convertSourceSpan(forBlock.trackBy.span, forBlock.sourceSpan);
18572
+ const track = convertAst(forBlock.trackBy, unit.job, sourceSpan);
18573
+ ingestNodes(repeaterView, forBlock.children);
18574
+ let emptyView = null;
18575
+ if (forBlock.empty !== null) {
18576
+ emptyView = unit.job.allocateView(unit.xref);
18577
+ ingestNodes(emptyView, forBlock.empty.children);
18578
+ }
18579
+ const varNames = {
18580
+ $index: forBlock.contextVariables.$index.name,
18581
+ $count: forBlock.contextVariables.$count.name,
18582
+ $first: forBlock.contextVariables.$first.name,
18583
+ $last: forBlock.contextVariables.$last.name,
18584
+ $even: forBlock.contextVariables.$even.name,
18585
+ $odd: forBlock.contextVariables.$odd.name,
18586
+ $implicit: forBlock.item.name
18587
+ };
18588
+ const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_a2 = emptyView == null ? void 0 : emptyView.xref) != null ? _a2 : null, track, varNames, forBlock.sourceSpan);
18589
+ unit.create.push(repeaterCreate2);
18590
+ const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan));
18591
+ const repeater2 = createRepeaterOp(repeaterCreate2.xref, expression, forBlock.sourceSpan);
18592
+ unit.update.push(repeater2);
18593
+ }
18035
18594
  function convertAst(ast, job, baseSourceSpan) {
18036
18595
  if (ast instanceof ASTWithSource) {
18037
18596
  return convertAst(ast.ast, job, baseSourceSpan);
@@ -18094,13 +18653,15 @@ function convertAst(ast, job, baseSourceSpan) {
18094
18653
  throw new Error(`Unhandled expression type: ${ast.constructor.name}`);
18095
18654
  }
18096
18655
  }
18097
- function ingestBindings(unit, op, element2) {
18656
+ function isPlainTemplate(tmpl) {
18098
18657
  var _a2;
18658
+ return splitNsName((_a2 = tmpl.tagName) != null ? _a2 : "")[1] === "ng-template";
18659
+ }
18660
+ function ingestBindings(unit, op, element2) {
18099
18661
  let flags = BindingFlags.None;
18100
- const isPlainTemplate = element2 instanceof Template && splitNsName((_a2 = element2.tagName) != null ? _a2 : "")[1] === "ng-template";
18101
18662
  if (element2 instanceof Template) {
18102
18663
  flags |= BindingFlags.OnNgTemplateElement;
18103
- if (isPlainTemplate) {
18664
+ if (element2 instanceof Template && isPlainTemplate(element2)) {
18104
18665
  flags |= BindingFlags.BindingTargetsTemplate;
18105
18666
  }
18106
18667
  const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
@@ -18125,7 +18686,7 @@ function ingestBindings(unit, op, element2) {
18125
18686
  throw Error("Animation listener should have a phase");
18126
18687
  }
18127
18688
  }
18128
- if (element2 instanceof Template && !isPlainTemplate) {
18689
+ if (element2 instanceof Template && !isPlainTemplate(element2)) {
18129
18690
  unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null));
18130
18691
  continue;
18131
18692
  }
@@ -18211,10 +18772,10 @@ function convertSourceSpan(span, baseSourceSpan) {
18211
18772
  return new ParseSourceSpan(start, end, fullStart);
18212
18773
  }
18213
18774
 
18214
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
18775
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
18215
18776
  var USE_TEMPLATE_PIPELINE = false;
18216
18777
 
18217
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
18778
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
18218
18779
  var IMPORTANT_FLAG = "!important";
18219
18780
  var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
18220
18781
  var StylingBuilder = class {
@@ -18547,7 +19108,7 @@ function isEmptyExpression(ast) {
18547
19108
  return ast instanceof EmptyExpr;
18548
19109
  }
18549
19110
 
18550
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19111
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
18551
19112
  var HtmlParser = class extends Parser2 {
18552
19113
  constructor() {
18553
19114
  super(getHtmlTagDefinition);
@@ -18557,7 +19118,7 @@ var HtmlParser = class extends Parser2 {
18557
19118
  }
18558
19119
  };
18559
19120
 
18560
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19121
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
18561
19122
  var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
18562
19123
  var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
18563
19124
  var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
@@ -18599,7 +19160,7 @@ var WhitespaceVisitor = class {
18599
19160
  return expansionCase;
18600
19161
  }
18601
19162
  visitBlock(block, context) {
18602
- return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan);
19163
+ return new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan);
18603
19164
  }
18604
19165
  visitBlockParameter(parameter, context) {
18605
19166
  return parameter;
@@ -18623,7 +19184,7 @@ function visitAllWithSiblings(visitor, nodes) {
18623
19184
  return result;
18624
19185
  }
18625
19186
 
18626
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19187
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
18627
19188
  var PROPERTY_PARTS_SEPARATOR = ".";
18628
19189
  var ATTRIBUTE_PREFIX = "attr";
18629
19190
  var CLASS_PREFIX = "class";
@@ -18943,7 +19504,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
18943
19504
  return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
18944
19505
  }
18945
19506
 
18946
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
19507
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
18947
19508
  function isStyleUrlResolvable(url) {
18948
19509
  if (url == null || url.length === 0 || url[0] == "/")
18949
19510
  return false;
@@ -18952,7 +19513,7 @@ function isStyleUrlResolvable(url) {
18952
19513
  }
18953
19514
  var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
18954
19515
 
18955
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
19516
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
18956
19517
  var NG_CONTENT_SELECT_ATTR = "select";
18957
19518
  var LINK_ELEMENT = "link";
18958
19519
  var LINK_STYLE_REL_ATTR = "rel";
@@ -19022,7 +19583,7 @@ function normalizeNgContentSelect(selectAttr) {
19022
19583
  return selectAttr;
19023
19584
  }
19024
19585
 
19025
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
19586
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
19026
19587
  var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+(.*)/;
19027
19588
  var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
19028
19589
  var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
@@ -19107,7 +19668,7 @@ function createSwitchBlock(ast, visitor, bindingParser) {
19107
19668
  continue;
19108
19669
  }
19109
19670
  if ((node.name !== "case" || node.parameters.length === 0) && node.name !== "default") {
19110
- unknownBlocks.push(new UnknownBlock(node.name, node.sourceSpan));
19671
+ unknownBlocks.push(new UnknownBlock(node.name, node.sourceSpan, node.nameSpan));
19111
19672
  continue;
19112
19673
  }
19113
19674
  const expression = node.name === "case" ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;
@@ -19311,7 +19872,7 @@ function stripOptionalParentheses(param, errors) {
19311
19872
  return expression.slice(start, end);
19312
19873
  }
19313
19874
 
19314
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
19875
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
19315
19876
  var TIME_PATTERN = /^\d+(ms|s)?$/;
19316
19877
  var SEPARATOR_PATTERN = /^\s$/;
19317
19878
  var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
@@ -19559,7 +20120,7 @@ function parseDeferredTime(value) {
19559
20120
  return parseInt(time) * (units === "s" ? 1e3 : 1);
19560
20121
  }
19561
20122
 
19562
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20123
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
19563
20124
  var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
19564
20125
  var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
19565
20126
  var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
@@ -19694,7 +20255,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
19694
20255
  return { triggers, prefetchTriggers };
19695
20256
  }
19696
20257
 
19697
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20258
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
19698
20259
  var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
19699
20260
  var KW_BIND_IDX = 1;
19700
20261
  var KW_LET_IDX = 2;
@@ -19912,7 +20473,7 @@ var HtmlAstToIvyAst = class {
19912
20473
  errorMessage = `Unrecognized block @${block.name}.`;
19913
20474
  }
19914
20475
  result = {
19915
- node: new UnknownBlock(block.name, block.sourceSpan),
20476
+ node: new UnknownBlock(block.name, block.sourceSpan, block.nameSpan),
19916
20477
  errors: [new ParseError(block.sourceSpan, errorMessage)]
19917
20478
  };
19918
20479
  break;
@@ -20125,7 +20686,7 @@ function textContents(node) {
20125
20686
  }
20126
20687
  }
20127
20688
 
20128
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
20689
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
20129
20690
  var TagType;
20130
20691
  (function(TagType2) {
20131
20692
  TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
@@ -20260,7 +20821,7 @@ function serializePlaceholderValue(value) {
20260
20821
  }
20261
20822
  }
20262
20823
 
20263
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
20824
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
20264
20825
  var NG_CONTENT_SELECT_ATTR2 = "select";
20265
20826
  var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
20266
20827
  var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
@@ -21890,7 +22451,7 @@ function createClosureModeGuard2() {
21890
22451
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
21891
22452
  }
21892
22453
 
21893
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
22454
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
21894
22455
  var ATTR_REGEX = /attr\.([^\]]+)/;
21895
22456
  var COMPONENT_VARIABLE = "%COMP%";
21896
22457
  var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
@@ -22492,7 +23053,7 @@ function createHostDirectivesMappingArray(mapping) {
22492
23053
  return elements.length > 0 ? literalArr(elements) : null;
22493
23054
  }
22494
23055
 
22495
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23056
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
22496
23057
  var R3TargetBinder = class {
22497
23058
  constructor(directiveMatcher) {
22498
23059
  this.directiveMatcher = directiveMatcher;
@@ -23084,11 +23645,11 @@ function extractScopedNodeEntities(rootScope) {
23084
23645
  return templateEntities;
23085
23646
  }
23086
23647
 
23087
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/resource_loader.mjs
23648
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
23088
23649
  var ResourceLoader = class {
23089
23650
  };
23090
23651
 
23091
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
23652
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
23092
23653
  var CompilerFacadeImpl = class {
23093
23654
  constructor(jitEvaluator = new JitEvaluator()) {
23094
23655
  this.jitEvaluator = jitEvaluator;
@@ -23640,17 +24201,17 @@ function publishFacade(global) {
23640
24201
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
23641
24202
  }
23642
24203
 
23643
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
23644
- var VERSION2 = new Version("17.0.0-next.8");
24204
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
24205
+ var VERSION2 = new Version("17.0.0-rc.1");
23645
24206
 
23646
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24207
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
23647
24208
  var _VisitorMode;
23648
24209
  (function(_VisitorMode2) {
23649
24210
  _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
23650
24211
  _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
23651
24212
  })(_VisitorMode || (_VisitorMode = {}));
23652
24213
 
23653
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24214
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
23654
24215
  var XmlTagDefinition = class {
23655
24216
  constructor() {
23656
24217
  this.closedByParent = false;
@@ -23672,7 +24233,7 @@ var XmlTagDefinition = class {
23672
24233
  };
23673
24234
  var _TAG_DEFINITION = new XmlTagDefinition();
23674
24235
 
23675
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24236
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
23676
24237
  var FactoryTarget2;
23677
24238
  (function(FactoryTarget3) {
23678
24239
  FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
@@ -23682,16 +24243,17 @@ var FactoryTarget2;
23682
24243
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
23683
24244
  })(FactoryTarget2 || (FactoryTarget2 = {}));
23684
24245
 
23685
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/compiler.mjs
24246
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
23686
24247
  publishFacade(_global);
23687
24248
 
23688
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/util.mjs
24249
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/util.mjs
23689
24250
  var import_path2 = require("path");
23690
24251
  var import_typescript3 = __toESM(require("typescript"), 1);
23691
24252
  var REPLACEMENTS2 = {
23692
24253
  "@": "&#64;",
23693
24254
  "}": "&#125;"
23694
24255
  };
24256
+ var CONTROL_FLOW_CHARS_PATTERN = /@|}/;
23695
24257
  var AnalyzedFile = class {
23696
24258
  constructor() {
23697
24259
  __publicField(this, "ranges", []);
@@ -23712,17 +24274,14 @@ var AnalyzedFile = class {
23712
24274
  }
23713
24275
  };
23714
24276
  function analyze(sourceFile, analyzedFiles) {
23715
- var _a2;
23716
- for (const node of sourceFile.statements) {
23717
- if (!import_typescript3.default.isClassDeclaration(node)) {
23718
- continue;
23719
- }
24277
+ forEachClass(sourceFile, (node) => {
24278
+ var _a2;
23720
24279
  const decorator = (_a2 = import_typescript3.default.getDecorators(node)) == null ? void 0 : _a2.find((dec) => {
23721
24280
  return import_typescript3.default.isCallExpression(dec.expression) && import_typescript3.default.isIdentifier(dec.expression.expression) && dec.expression.expression.text === "Component";
23722
24281
  });
23723
24282
  const metadata = decorator && decorator.expression.arguments.length > 0 && import_typescript3.default.isObjectLiteralExpression(decorator.expression.arguments[0]) ? decorator.expression.arguments[0] : null;
23724
24283
  if (!metadata) {
23725
- continue;
24284
+ return;
23726
24285
  }
23727
24286
  for (const prop of metadata.properties) {
23728
24287
  if (!import_typescript3.default.isPropertyAssignment(prop) || !import_typescript3.default.isStringLiteralLike(prop.initializer) || !import_typescript3.default.isIdentifier(prop.name) && !import_typescript3.default.isStringLiteralLike(prop.name)) {
@@ -23738,33 +24297,39 @@ function analyze(sourceFile, analyzedFiles) {
23738
24297
  break;
23739
24298
  }
23740
24299
  }
23741
- }
24300
+ });
23742
24301
  }
23743
24302
  function migrateTemplate(template2) {
24303
+ if (!CONTROL_FLOW_CHARS_PATTERN.test(template2)) {
24304
+ return null;
24305
+ }
24306
+ let rootNodes = null;
23744
24307
  try {
23745
24308
  const parsed = new HtmlParser().parse(template2, "", {
23746
24309
  tokenizeExpansionForms: true,
23747
24310
  tokenizeBlocks: false
23748
24311
  });
23749
- if (parsed.errors && parsed.errors.length > 0) {
23750
- return null;
23751
- }
23752
- let result = template2;
23753
- const visitor = new TextRangeCollector();
23754
- visitAll2(visitor, parsed.rootNodes);
23755
- const sortedRanges = visitor.textRanges.sort(([aStart], [bStart]) => bStart - aStart);
23756
- for (const [start, end] of sortedRanges) {
23757
- const text2 = result.slice(start, end);
23758
- let replaced = "";
23759
- for (const char of text2) {
23760
- replaced += REPLACEMENTS2[char] || char;
23761
- }
23762
- result = result.slice(0, start) + replaced + result.slice(end);
24312
+ if (parsed.errors.length === 0) {
24313
+ rootNodes = parsed.rootNodes;
23763
24314
  }
23764
- return result;
23765
24315
  } catch (e) {
24316
+ }
24317
+ if (rootNodes === null) {
23766
24318
  return null;
23767
24319
  }
24320
+ let result = template2;
24321
+ const visitor = new TextRangeCollector();
24322
+ visitAll2(visitor, rootNodes);
24323
+ const sortedRanges = visitor.textRanges.sort(([aStart], [bStart]) => bStart - aStart);
24324
+ for (const [start, end] of sortedRanges) {
24325
+ const text2 = result.slice(start, end);
24326
+ let replaced = "";
24327
+ for (const char of text2) {
24328
+ replaced += REPLACEMENTS2[char] || char;
24329
+ }
24330
+ result = result.slice(0, start) + replaced + result.slice(end);
24331
+ }
24332
+ return result;
23768
24333
  }
23769
24334
  var TextRangeCollector = class extends RecursiveVisitor {
23770
24335
  constructor() {
@@ -23780,8 +24345,16 @@ var TextRangeCollector = class extends RecursiveVisitor {
23780
24345
  super.visitText(text2, null);
23781
24346
  }
23782
24347
  };
24348
+ function forEachClass(sourceFile, callback) {
24349
+ sourceFile.forEachChild(function walk(node) {
24350
+ if (import_typescript3.default.isClassDeclaration(node)) {
24351
+ callback(node);
24352
+ }
24353
+ node.forEachChild(walk);
24354
+ });
24355
+ }
23783
24356
 
23784
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
24357
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
23785
24358
  function block_template_entities_default() {
23786
24359
  return (tree) => __async(this, null, function* () {
23787
24360
  const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
@@ -23805,6 +24378,9 @@ function runBlockTemplateEntitiesMigration(tree, tsconfigPath, basePath) {
23805
24378
  for (const [path2, file] of analysis) {
23806
24379
  const ranges = file.getSortedRanges();
23807
24380
  const relativePath = (0, import_path3.relative)(basePath, path2);
24381
+ if (!tree.exists(relativePath)) {
24382
+ continue;
24383
+ }
23808
24384
  const content = tree.readText(relativePath);
23809
24385
  const update = tree.beginUpdate(relativePath);
23810
24386
  for (const [start, end] of ranges) {
@@ -23821,6 +24397,14 @@ function runBlockTemplateEntitiesMigration(tree, tsconfigPath, basePath) {
23821
24397
  }
23822
24398
  // Annotate the CommonJS export names for ESM import in node:
23823
24399
  0 && (module.exports = {});
24400
+ /**
24401
+ *
24402
+ * @license
24403
+ * Copyright Google LLC All Rights Reserved.
24404
+ *
24405
+ * Use of this source code is governed by an MIT-style license that can be
24406
+ * found in the LICENSE file at https://angular.io/license
24407
+ */
23824
24408
  /**
23825
24409
  * @license
23826
24410
  * Copyright Google LLC All Rights Reserved.