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

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.
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
63
63
  });
64
64
  };
65
65
 
66
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
66
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
67
67
  var control_flow_migration_exports = {};
68
68
  __export(control_flow_migration_exports, {
69
69
  default: () => control_flow_migration_default
@@ -72,22 +72,22 @@ module.exports = __toCommonJS(control_flow_migration_exports);
72
72
  var import_schematics = require("@angular-devkit/schematics");
73
73
  var import_path3 = require("path");
74
74
 
75
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
75
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
76
76
  var import_typescript2 = __toESM(require("typescript"), 1);
77
77
 
78
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
78
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
79
79
  var import_typescript = __toESM(require("typescript"), 1);
80
80
 
81
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
81
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
82
82
  function normalizePath(path2) {
83
83
  return path2.replace(/\\/g, "/");
84
84
  }
85
85
 
86
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
86
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
87
87
  var import_path = require("path");
88
88
  var import_typescript4 = __toESM(require("typescript"), 1);
89
89
 
90
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
90
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
91
91
  var path = __toESM(require("path"), 1);
92
92
  var import_typescript3 = __toESM(require("typescript"), 1);
93
93
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -104,7 +104,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
104
104
  return import_typescript3.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
105
105
  }
106
106
 
107
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
107
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
108
108
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
109
109
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
110
110
  return import_typescript4.default.createProgram(rootNames, options, host);
@@ -137,7 +137,7 @@ function canMigrateFile(basePath, sourceFile, program) {
137
137
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
138
138
  }
139
139
 
140
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/selector.mjs
140
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
141
141
  var _SELECTOR_REGEXP = new RegExp(
142
142
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
143
143
  "g"
@@ -445,7 +445,7 @@ var SelectorContext = class {
445
445
  }
446
446
  };
447
447
 
448
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/core.mjs
448
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
449
449
  var ViewEncapsulation;
450
450
  (function(ViewEncapsulation2) {
451
451
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
@@ -507,7 +507,7 @@ function parseSelectorToR3Selector(selector) {
507
507
  return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
508
508
  }
509
509
 
510
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
510
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
511
511
  var textEncoder;
512
512
  function computeDigest(message) {
513
513
  return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
@@ -747,7 +747,7 @@ function wordAt(bytes, index, endian) {
747
747
  return word;
748
748
  }
749
749
 
750
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
750
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
751
751
  var TypeModifier;
752
752
  (function(TypeModifier2) {
753
753
  TypeModifier2[TypeModifier2["None"] = 0] = "None";
@@ -1702,7 +1702,7 @@ function serializeTags(tags) {
1702
1702
  return out;
1703
1703
  }
1704
1704
 
1705
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1705
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1706
1706
  var CONSTANT_PREFIX = "_c";
1707
1707
  var UNKNOWN_VALUE_KEY = variable("<unknown>");
1708
1708
  var KEY_CONTEXT = {};
@@ -1885,7 +1885,7 @@ function isLongStringLiteral(expr) {
1885
1885
  return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
1886
1886
  }
1887
1887
 
1888
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1888
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1889
1889
  var CORE = "@angular/core";
1890
1890
  var _Identifiers = class {
1891
1891
  };
@@ -2518,7 +2518,7 @@ var Identifiers = _Identifiers;
2518
2518
  _Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
2519
2519
  })();
2520
2520
 
2521
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/util.mjs
2521
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
2522
2522
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2523
2523
  function dashCaseToCamelCase(input) {
2524
2524
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
@@ -2606,7 +2606,7 @@ function partitionArray(arr, conditionFn) {
2606
2606
  return [truthy, falsy];
2607
2607
  }
2608
2608
 
2609
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2609
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2610
2610
  var VERSION = 3;
2611
2611
  var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
2612
2612
  var SourceMapGenerator = class {
@@ -2735,7 +2735,7 @@ function toBase64Digit(value) {
2735
2735
  return B64_DIGITS[value];
2736
2736
  }
2737
2737
 
2738
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2739
2739
  var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
2740
2740
  var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
2741
2741
  var _INDENT_WITH = " ";
@@ -3220,7 +3220,7 @@ function _createIndent(count) {
3220
3220
  return res;
3221
3221
  }
3222
3222
 
3223
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/util.mjs
3223
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
3224
3224
  function typeWithParameters(type, numParams) {
3225
3225
  if (numParams === 0) {
3226
3226
  return expressionType(type);
@@ -3285,7 +3285,7 @@ function generateForwardRef(expr) {
3285
3285
  return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
3286
3286
  }
3287
3287
 
3288
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3288
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3289
3289
  var R3FactoryDelegateType;
3290
3290
  (function(R3FactoryDelegateType2) {
3291
3291
  R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
@@ -3430,7 +3430,7 @@ function getInjectFn(target) {
3430
3430
  }
3431
3431
  }
3432
3432
 
3433
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
3433
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
3434
3434
  var TagContentType;
3435
3435
  (function(TagContentType2) {
3436
3436
  TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
@@ -3463,7 +3463,7 @@ function mergeNsAndName(prefix, localName) {
3463
3463
  return prefix ? `:${prefix}:${localName}` : localName;
3464
3464
  }
3465
3465
 
3466
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3466
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3467
3467
  var Comment = class {
3468
3468
  constructor(value, sourceSpan) {
3469
3469
  this.value = value;
@@ -3844,7 +3844,7 @@ function visitAll(visitor, nodes) {
3844
3844
  return result;
3845
3845
  }
3846
3846
 
3847
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3847
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3848
3848
  var Message = class {
3849
3849
  constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
3850
3850
  this.nodes = nodes;
@@ -4004,7 +4004,7 @@ var LocalizeMessageStringVisitor = class {
4004
4004
  }
4005
4005
  };
4006
4006
 
4007
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4007
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4008
4008
  var _Visitor = class {
4009
4009
  visitTag(tag) {
4010
4010
  const strAttrs = this._serializeAttributes(tag.attrs);
@@ -4032,12 +4032,12 @@ ${doctype.dtd}
4032
4032
  };
4033
4033
  var _visitor = new _Visitor();
4034
4034
 
4035
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4035
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4036
4036
  function toPublicName(internalName) {
4037
4037
  return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
4038
4038
  }
4039
4039
 
4040
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4040
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4041
4041
  var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
4042
4042
  var TRANSLATION_VAR_PREFIX = "i18n_";
4043
4043
  var I18N_ATTR = "i18n";
@@ -4139,7 +4139,7 @@ function declareI18nVariable(variable2) {
4139
4139
  return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
4140
4140
  }
4141
4141
 
4142
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4142
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4143
4143
  var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
4144
4144
  var TEMPORARY_NAME = "_t";
4145
4145
  var CONTEXT_NAME = "ctx";
@@ -4379,7 +4379,7 @@ function getInstructionStatements(instructions) {
4379
4379
  return statements;
4380
4380
  }
4381
4381
 
4382
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4382
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4383
4383
  function compileInjectable(meta, resolveForwardRefs) {
4384
4384
  let result = null;
4385
4385
  const factoryMeta = {
@@ -4464,7 +4464,7 @@ function createFactoryFunction(type) {
4464
4464
  return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
4465
4465
  }
4466
4466
 
4467
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/assertions.mjs
4467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
4468
4468
  var UNUSABLE_INTERPOLATION_REGEXPS = [
4469
4469
  /^\s*$/,
4470
4470
  /[<>]/,
@@ -4486,7 +4486,7 @@ function assertInterpolationSymbols(identifier, value) {
4486
4486
  }
4487
4487
  }
4488
4488
 
4489
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4489
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4490
4490
  var InterpolationConfig = class {
4491
4491
  static fromArray(markers) {
4492
4492
  if (!markers) {
@@ -4503,7 +4503,7 @@ var InterpolationConfig = class {
4503
4503
  var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
4504
4504
  var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
4505
4505
 
4506
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/chars.mjs
4506
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
4507
4507
  var $EOF = 0;
4508
4508
  var $BSPACE = 8;
4509
4509
  var $TAB = 9;
@@ -4585,7 +4585,7 @@ function isQuote(code) {
4585
4585
  return code === $SQ || code === $DQ || code === $BT;
4586
4586
  }
4587
4587
 
4588
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/parse_util.mjs
4588
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
4589
4589
  var ParseLocation = class {
4590
4590
  constructor(file, offset, line, col) {
4591
4591
  this.file = file;
@@ -4732,7 +4732,7 @@ function sanitizeIdentifier(name) {
4732
4732
  return name.replace(/\W/g, "_");
4733
4733
  }
4734
4734
 
4735
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4735
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4736
4736
  var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
4737
4737
  var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4738
4738
  constructor() {
@@ -4825,7 +4825,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4825
4825
  }
4826
4826
  };
4827
4827
 
4828
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4828
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4829
4829
  var policy;
4830
4830
  function getPolicy() {
4831
4831
  if (policy === void 0) {
@@ -4863,7 +4863,7 @@ function newTrustedFunctionForJIT(...args) {
4863
4863
  return fn2.bind(_global);
4864
4864
  }
4865
4865
 
4866
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4866
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4867
4867
  var JitEvaluator = class {
4868
4868
  evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
4869
4869
  const converter = new JitEmitterVisitor(refResolver);
@@ -4954,7 +4954,7 @@ function isUseStrictStatement(statement) {
4954
4954
  return statement.isEquivalent(literal("use strict").toStmt());
4955
4955
  }
4956
4956
 
4957
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4957
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4958
4958
  function compileInjector(meta) {
4959
4959
  const definitionMap = new DefinitionMap();
4960
4960
  if (meta.providers !== null) {
@@ -4971,7 +4971,7 @@ function createInjectorType(meta) {
4971
4971
  return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
4972
4972
  }
4973
4973
 
4974
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4974
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4975
4975
  var R3JitReflector = class {
4976
4976
  constructor(context) {
4977
4977
  this.context = context;
@@ -4987,7 +4987,7 @@ var R3JitReflector = class {
4987
4987
  }
4988
4988
  };
4989
4989
 
4990
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4990
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4991
4991
  var R3SelectorScopeMode;
4992
4992
  (function(R3SelectorScopeMode2) {
4993
4993
  R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
@@ -5128,7 +5128,7 @@ function tupleOfTypes(types) {
5128
5128
  return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
5129
5129
  }
5130
5130
 
5131
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5131
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5132
5132
  function compilePipeFromMetadata(metadata) {
5133
5133
  const definitionMapValues = [];
5134
5134
  definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
@@ -5149,7 +5149,7 @@ function createPipeType(metadata) {
5149
5149
  ]));
5150
5150
  }
5151
5151
 
5152
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5152
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5153
5153
  var R3TemplateDependencyKind;
5154
5154
  (function(R3TemplateDependencyKind2) {
5155
5155
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
@@ -5157,7 +5157,7 @@ var R3TemplateDependencyKind;
5157
5157
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
5158
5158
  })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
5159
5159
 
5160
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5160
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5161
5161
  var ParserError = class {
5162
5162
  constructor(message, input, errLocation, ctxLocation) {
5163
5163
  this.input = input;
@@ -5823,7 +5823,7 @@ var BoundElementProperty = class {
5823
5823
  }
5824
5824
  };
5825
5825
 
5826
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5826
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5827
5827
  var _EventHandlerVars = class {
5828
5828
  };
5829
5829
  var EventHandlerVars = _EventHandlerVars;
@@ -6464,7 +6464,7 @@ var BuiltinFunctionCall = class extends Call {
6464
6464
  }
6465
6465
  };
6466
6466
 
6467
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6468
6468
  var _SECURITY_SCHEMA;
6469
6469
  function SECURITY_SCHEMA() {
6470
6470
  if (!_SECURITY_SCHEMA) {
@@ -6522,7 +6522,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
6522
6522
  return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
6523
6523
  }
6524
6524
 
6525
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6525
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6526
6526
  var animationKeywords = /* @__PURE__ */ new Set([
6527
6527
  "inherit",
6528
6528
  "initial",
@@ -6993,7 +6993,7 @@ function repeatGroups(groups, multiples) {
6993
6993
  }
6994
6994
  }
6995
6995
 
6996
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6996
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6997
6997
  var OpKind;
6998
6998
  (function(OpKind2) {
6999
6999
  OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
@@ -7040,6 +7040,7 @@ var OpKind;
7040
7040
  OpKind2[OpKind2["IcuStart"] = 41] = "IcuStart";
7041
7041
  OpKind2[OpKind2["IcuEnd"] = 42] = "IcuEnd";
7042
7042
  OpKind2[OpKind2["I18nContext"] = 43] = "I18nContext";
7043
+ OpKind2[OpKind2["I18nAttributes"] = 44] = "I18nAttributes";
7043
7044
  })(OpKind || (OpKind = {}));
7044
7045
  var ExpressionKind;
7045
7046
  (function(ExpressionKind2) {
@@ -7116,6 +7117,11 @@ var I18nParamResolutionTime;
7116
7117
  I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
7117
7118
  I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
7118
7119
  })(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
7120
+ var I18nExpressionFor;
7121
+ (function(I18nExpressionFor2) {
7122
+ I18nExpressionFor2[I18nExpressionFor2["I18nText"] = 0] = "I18nText";
7123
+ I18nExpressionFor2[I18nExpressionFor2["I18nAttribute"] = 1] = "I18nAttribute";
7124
+ })(I18nExpressionFor || (I18nExpressionFor = {}));
7119
7125
  var I18nParamValueFlags;
7120
7126
  (function(I18nParamValueFlags2) {
7121
7127
  I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
@@ -7151,9 +7157,16 @@ var I18nContextKind;
7151
7157
  (function(I18nContextKind2) {
7152
7158
  I18nContextKind2[I18nContextKind2["RootI18n"] = 0] = "RootI18n";
7153
7159
  I18nContextKind2[I18nContextKind2["Icu"] = 1] = "Icu";
7160
+ I18nContextKind2[I18nContextKind2["Attr"] = 2] = "Attr";
7154
7161
  })(I18nContextKind || (I18nContextKind = {}));
7162
+ var TemplateKind;
7163
+ (function(TemplateKind2) {
7164
+ TemplateKind2[TemplateKind2["NgTemplate"] = 0] = "NgTemplate";
7165
+ TemplateKind2[TemplateKind2["Structural"] = 1] = "Structural";
7166
+ TemplateKind2[TemplateKind2["Block"] = 2] = "Block";
7167
+ })(TemplateKind || (TemplateKind = {}));
7155
7168
 
7156
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7169
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7157
7170
  var ConsumesSlot = Symbol("ConsumesSlot");
7158
7171
  var DependsOnSlotContext = Symbol("DependsOnSlotContext");
7159
7172
  var ConsumesVarsTrait = Symbol("ConsumesVars");
@@ -7185,7 +7198,7 @@ function hasUsesVarOffsetTrait(expr) {
7185
7198
  return expr[UsesVarOffset] === true;
7186
7199
  }
7187
7200
 
7188
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7201
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7189
7202
  function createStatementOp(statement) {
7190
7203
  return __spreadValues({
7191
7204
  kind: OpKind.Statement,
@@ -7207,23 +7220,26 @@ var NEW_OP = {
7207
7220
  next: null
7208
7221
  };
7209
7222
 
7210
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7211
- function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
7223
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7224
+ function createInterpolateTextOp(xref, interpolation, sourceSpan) {
7212
7225
  return __spreadValues(__spreadValues(__spreadValues({
7213
7226
  kind: OpKind.InterpolateText,
7214
7227
  target: xref,
7215
7228
  interpolation,
7216
- i18nPlaceholders,
7217
7229
  sourceSpan
7218
7230
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7219
7231
  }
7220
7232
  var Interpolation2 = class {
7221
- constructor(strings, expressions) {
7233
+ constructor(strings, expressions, i18nPlaceholders) {
7222
7234
  this.strings = strings;
7223
7235
  this.expressions = expressions;
7236
+ this.i18nPlaceholders = i18nPlaceholders;
7237
+ if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) {
7238
+ throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`);
7239
+ }
7224
7240
  }
7225
7241
  };
7226
- function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isTemplate, sourceSpan) {
7242
+ function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7227
7243
  return __spreadValues({
7228
7244
  kind: OpKind.Binding,
7229
7245
  bindingKind: kind,
@@ -7233,11 +7249,12 @@ function createBindingOp(target, kind, name, expression, unit, securityContext,
7233
7249
  unit,
7234
7250
  securityContext,
7235
7251
  isTextAttribute,
7236
- isTemplate,
7252
+ isStructuralTemplate,
7253
+ i18nContext,
7237
7254
  sourceSpan
7238
7255
  }, NEW_OP);
7239
7256
  }
7240
- function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isTemplate, sourceSpan) {
7257
+ function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplate, i18nContext, sourceSpan) {
7241
7258
  return __spreadValues(__spreadValues(__spreadValues({
7242
7259
  kind: OpKind.Property,
7243
7260
  target,
@@ -7246,7 +7263,8 @@ function createPropertyOp(target, name, expression, isAnimationTrigger, security
7246
7263
  isAnimationTrigger,
7247
7264
  securityContext,
7248
7265
  sanitizer: null,
7249
- isTemplate,
7266
+ isStructuralTemplate,
7267
+ i18nContext,
7250
7268
  sourceSpan
7251
7269
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7252
7270
  }
@@ -7285,7 +7303,7 @@ function createClassMapOp(xref, expression, sourceSpan) {
7285
7303
  sourceSpan
7286
7304
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7287
7305
  }
7288
- function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isTemplate, sourceSpan) {
7306
+ function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7289
7307
  return __spreadValues(__spreadValues(__spreadValues({
7290
7308
  kind: OpKind.Attribute,
7291
7309
  target,
@@ -7294,7 +7312,8 @@ function createAttributeOp(target, name, expression, securityContext, isTextAttr
7294
7312
  securityContext,
7295
7313
  sanitizer: null,
7296
7314
  isTextAttribute,
7297
- isTemplate,
7315
+ isStructuralTemplate,
7316
+ i18nContext,
7298
7317
  sourceSpan
7299
7318
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7300
7319
  }
@@ -7335,28 +7354,31 @@ function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
7335
7354
  sourceSpan
7336
7355
  }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7337
7356
  }
7338
- function createI18nExpressionOp(context, target, handle, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
7357
+ function createI18nExpressionOp(context, target, i18nOwner, handle, expression, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
7339
7358
  return __spreadValues(__spreadValues(__spreadValues({
7340
7359
  kind: OpKind.I18nExpression,
7341
7360
  context,
7342
7361
  target,
7362
+ i18nOwner,
7343
7363
  handle,
7344
7364
  expression,
7345
7365
  i18nPlaceholder,
7346
7366
  resolutionTime,
7367
+ usage,
7368
+ name,
7347
7369
  sourceSpan
7348
7370
  }, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7349
7371
  }
7350
- function createI18nApplyOp(target, handle, sourceSpan) {
7372
+ function createI18nApplyOp(owner, handle, sourceSpan) {
7351
7373
  return __spreadValues({
7352
7374
  kind: OpKind.I18nApply,
7353
- target,
7375
+ owner,
7354
7376
  handle,
7355
7377
  sourceSpan
7356
7378
  }, NEW_OP);
7357
7379
  }
7358
7380
 
7359
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7381
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7360
7382
  var _a;
7361
7383
  var _b;
7362
7384
  var _c;
@@ -8126,6 +8148,7 @@ function transformExpressionsInOp(op, transform2, flags) {
8126
8148
  case OpKind.ProjectionDef:
8127
8149
  case OpKind.Template:
8128
8150
  case OpKind.Text:
8151
+ case OpKind.I18nAttributes:
8129
8152
  break;
8130
8153
  default:
8131
8154
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -8137,6 +8160,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
8137
8160
  } else if (expr instanceof BinaryOperatorExpr) {
8138
8161
  expr.lhs = transformExpressionsInExpression(expr.lhs, transform2, flags);
8139
8162
  expr.rhs = transformExpressionsInExpression(expr.rhs, transform2, flags);
8163
+ } else if (expr instanceof UnaryOperatorExpr) {
8164
+ expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
8140
8165
  } else if (expr instanceof ReadPropExpr) {
8141
8166
  expr.receiver = transformExpressionsInExpression(expr.receiver, transform2, flags);
8142
8167
  } else if (expr instanceof ReadKeyExpr) {
@@ -8176,6 +8201,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
8176
8201
  for (let i = 0; i < expr.expressions.length; i++) {
8177
8202
  expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
8178
8203
  }
8204
+ } else if (expr instanceof NotExpr) {
8205
+ expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
8179
8206
  } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
8180
8207
  } else {
8181
8208
  throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
@@ -8207,7 +8234,7 @@ function isStringLiteral(expr) {
8207
8234
  return expr instanceof LiteralExpr && typeof expr.value === "string";
8208
8235
  }
8209
8236
 
8210
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8237
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8211
8238
  var _OpList = class {
8212
8239
  constructor() {
8213
8240
  this.debugListId = _OpList.nextListId++;
@@ -8398,14 +8425,14 @@ var OpList = _OpList;
8398
8425
  _OpList.nextListId = 0;
8399
8426
  })();
8400
8427
 
8401
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8428
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8402
8429
  var SlotHandle = class {
8403
8430
  constructor() {
8404
8431
  this.slot = null;
8405
8432
  }
8406
8433
  };
8407
8434
 
8408
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8435
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8409
8436
  var elementContainerOpKinds = /* @__PURE__ */ new Set([
8410
8437
  OpKind.Element,
8411
8438
  OpKind.ElementStart,
@@ -8431,10 +8458,11 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
8431
8458
  sourceSpan
8432
8459
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8433
8460
  }
8434
- function createTemplateOp(xref, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8461
+ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8435
8462
  return __spreadValues(__spreadValues({
8436
8463
  kind: OpKind.Template,
8437
8464
  xref,
8465
+ templateKind,
8438
8466
  attributes: null,
8439
8467
  tag,
8440
8468
  handle: new SlotHandle(),
@@ -8535,25 +8563,27 @@ function createProjectionDefOp(def) {
8535
8563
  def
8536
8564
  }, NEW_OP);
8537
8565
  }
8538
- function createProjectionOp(xref, selector, sourceSpan) {
8566
+ function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceSpan) {
8539
8567
  return __spreadValues(__spreadValues({
8540
8568
  kind: OpKind.Projection,
8541
8569
  xref,
8542
8570
  handle: new SlotHandle(),
8543
8571
  selector,
8572
+ i18nPlaceholder,
8544
8573
  projectionSlotIndex: 0,
8545
- attributes: [],
8574
+ attributes,
8546
8575
  localRefs: [],
8547
8576
  sourceSpan
8548
8577
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8549
8578
  }
8550
- function createExtractedAttributeOp(target, bindingKind, name, expression) {
8579
+ function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext) {
8551
8580
  return __spreadValues({
8552
8581
  kind: OpKind.ExtractedAttribute,
8553
8582
  target,
8554
8583
  bindingKind,
8555
8584
  name,
8556
- expression
8585
+ expression,
8586
+ i18nContext
8557
8587
  }, NEW_OP);
8558
8588
  }
8559
8589
  function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
@@ -8590,10 +8620,11 @@ function createDeferOnOp(defer2, trigger, prefetch, sourceSpan) {
8590
8620
  sourceSpan
8591
8621
  }, NEW_OP);
8592
8622
  }
8593
- function createI18nMessageOp(xref, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
8623
+ function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
8594
8624
  return __spreadValues({
8595
8625
  kind: OpKind.I18nMessage,
8596
8626
  xref,
8627
+ i18nContext,
8597
8628
  i18nBlock,
8598
8629
  message,
8599
8630
  messagePlaceholder,
@@ -8638,6 +8669,9 @@ function createIcuEndOp(xref) {
8638
8669
  }, NEW_OP);
8639
8670
  }
8640
8671
  function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
8672
+ if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {
8673
+ throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");
8674
+ }
8641
8675
  return __spreadValues({
8642
8676
  kind: OpKind.I18nContext,
8643
8677
  contextKind,
@@ -8649,22 +8683,32 @@ function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan)
8649
8683
  postprocessingParams: /* @__PURE__ */ new Map()
8650
8684
  }, NEW_OP);
8651
8685
  }
8686
+ function createI18nAttributesOp(xref, handle, target) {
8687
+ return __spreadValues(__spreadValues({
8688
+ kind: OpKind.I18nAttributes,
8689
+ xref,
8690
+ handle,
8691
+ target,
8692
+ i18nAttributesConfig: null
8693
+ }, NEW_OP), TRAIT_CONSUMES_SLOT);
8694
+ }
8652
8695
 
8653
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8654
- function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
8696
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8697
+ function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, sourceSpan) {
8655
8698
  return __spreadValues(__spreadValues({
8656
8699
  kind: OpKind.HostProperty,
8657
8700
  name,
8658
8701
  expression,
8659
8702
  isAnimationTrigger,
8703
+ i18nContext,
8660
8704
  sourceSpan
8661
8705
  }, TRAIT_CONSUMES_VARS), NEW_OP);
8662
8706
  }
8663
8707
 
8664
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8708
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8665
8709
  var CTX_REF = "CTX_REF_MARKER";
8666
8710
 
8667
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8711
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8668
8712
  var CompilationJobKind;
8669
8713
  (function(CompilationJobKind2) {
8670
8714
  CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
@@ -8771,7 +8815,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
8771
8815
  }
8772
8816
  };
8773
8817
 
8774
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8818
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8775
8819
  function deleteAnyCasts(job) {
8776
8820
  for (const unit of job.units) {
8777
8821
  for (const op of unit.ops()) {
@@ -8789,7 +8833,7 @@ function removeAnys(e) {
8789
8833
  return e;
8790
8834
  }
8791
8835
 
8792
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8836
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8793
8837
  function applyI18nExpressions(job) {
8794
8838
  const i18nContexts = /* @__PURE__ */ new Map();
8795
8839
  for (const unit of job.units) {
@@ -8802,7 +8846,7 @@ function applyI18nExpressions(job) {
8802
8846
  for (const unit of job.units) {
8803
8847
  for (const op of unit.update) {
8804
8848
  if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) {
8805
- OpList.insertAfter(createI18nApplyOp(op.target, op.handle, null), op);
8849
+ OpList.insertAfter(createI18nApplyOp(op.i18nOwner, op.handle, null), op);
8806
8850
  }
8807
8851
  }
8808
8852
  }
@@ -8814,13 +8858,25 @@ function needsApplication(i18nContexts, op) {
8814
8858
  }
8815
8859
  const context = i18nContexts.get(op.context);
8816
8860
  const nextContext2 = i18nContexts.get(op.next.context);
8817
- if (context.i18nBlock !== nextContext2.i18nBlock) {
8861
+ if (context === void 0) {
8862
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context");
8863
+ }
8864
+ if (nextContext2 === void 0) {
8865
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context");
8866
+ }
8867
+ if (context.i18nBlock !== null) {
8868
+ if (context.i18nBlock !== nextContext2.i18nBlock) {
8869
+ return true;
8870
+ }
8871
+ return false;
8872
+ }
8873
+ if (op.i18nOwner !== op.next.i18nOwner) {
8818
8874
  return true;
8819
8875
  }
8820
8876
  return false;
8821
8877
  }
8822
8878
 
8823
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8879
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8824
8880
  function assignI18nSlotDependencies(job) {
8825
8881
  const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
8826
8882
  let lastSlotConsumer = null;
@@ -8835,20 +8891,47 @@ function assignI18nSlotDependencies(job) {
8835
8891
  currentI18nOp = op;
8836
8892
  break;
8837
8893
  case OpKind.I18nEnd:
8894
+ if (currentI18nOp === null) {
8895
+ throw new Error("AssertionError: Expected an active I18n block while calculating last slot consumers");
8896
+ }
8897
+ if (lastSlotConsumer === null) {
8898
+ throw new Error("AssertionError: Expected a last slot consumer while calculating last slot consumers");
8899
+ }
8838
8900
  i18nLastSlotConsumers.set(currentI18nOp.xref, lastSlotConsumer);
8839
8901
  currentI18nOp = null;
8840
8902
  break;
8841
8903
  }
8842
8904
  }
8905
+ let opsToMove = [];
8906
+ let moveAfterTarget = null;
8907
+ let previousTarget = null;
8843
8908
  for (const op of unit.update) {
8844
- if (op.kind === OpKind.I18nExpression) {
8845
- op.target = i18nLastSlotConsumers.get(op.target);
8909
+ if (hasDependsOnSlotContextTrait(op)) {
8910
+ if (moveAfterTarget !== null && previousTarget === moveAfterTarget && op.target !== previousTarget) {
8911
+ OpList.insertBefore(opsToMove, op);
8912
+ moveAfterTarget = null;
8913
+ opsToMove = [];
8914
+ }
8915
+ previousTarget = op.target;
8846
8916
  }
8917
+ if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nText) {
8918
+ OpList.remove(op);
8919
+ opsToMove.push(op);
8920
+ const target = i18nLastSlotConsumers.get(op.i18nOwner);
8921
+ if (target === void 0) {
8922
+ throw new Error("AssertionError: Expected to find a last slot consumer for an I18nExpressionOp");
8923
+ }
8924
+ op.target = target;
8925
+ moveAfterTarget = op.target;
8926
+ }
8927
+ }
8928
+ if (moveAfterTarget !== null) {
8929
+ unit.update.push(opsToMove);
8847
8930
  }
8848
8931
  }
8849
8932
  }
8850
8933
 
8851
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8934
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8852
8935
  function createOpXrefMap(unit) {
8853
8936
  const map = /* @__PURE__ */ new Map();
8854
8937
  for (const op of unit.create) {
@@ -8860,7 +8943,7 @@ function createOpXrefMap(unit) {
8860
8943
  return map;
8861
8944
  }
8862
8945
 
8863
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8946
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8864
8947
  function extractAttributes(job) {
8865
8948
  for (const unit of job.units) {
8866
8949
  const elements = createOpXrefMap(unit);
@@ -8871,18 +8954,26 @@ function extractAttributes(job) {
8871
8954
  break;
8872
8955
  case OpKind.Property:
8873
8956
  if (!op.isAnimationTrigger) {
8874
- OpList.insertBefore(createExtractedAttributeOp(op.target, op.isTemplate ? BindingKind.Template : BindingKind.Property, op.name, null), lookupElement(elements, op.target));
8957
+ let bindingKind;
8958
+ if (op.i18nContext !== null) {
8959
+ bindingKind = BindingKind.I18n;
8960
+ } else if (op.isStructuralTemplate) {
8961
+ bindingKind = BindingKind.Template;
8962
+ } else {
8963
+ bindingKind = BindingKind.Property;
8964
+ }
8965
+ OpList.insertBefore(createExtractedAttributeOp(op.target, bindingKind, op.name, null, null), lookupElement(elements, op.target));
8875
8966
  }
8876
8967
  break;
8877
8968
  case OpKind.StyleProp:
8878
8969
  case OpKind.ClassProp:
8879
8970
  if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr2) {
8880
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null), lookupElement(elements, op.target));
8971
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null), lookupElement(elements, op.target));
8881
8972
  }
8882
8973
  break;
8883
8974
  case OpKind.Listener:
8884
8975
  if (!op.isAnimationListener) {
8885
- const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null);
8976
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null);
8886
8977
  if (job.kind === CompilationJobKind.Host) {
8887
8978
  unit.create.push(extractedAttributeOp);
8888
8979
  } else {
@@ -8916,7 +9007,7 @@ function extractAttributeOp(unit, op, elements) {
8916
9007
  }
8917
9008
  }
8918
9009
  if (extractable) {
8919
- const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression);
9010
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext);
8920
9011
  if (unit.job.kind === CompilationJobKind.Host) {
8921
9012
  unit.create.push(extractedAttributeOp);
8922
9013
  } else {
@@ -8927,7 +9018,7 @@ function extractAttributeOp(unit, op, elements) {
8927
9018
  }
8928
9019
  }
8929
9020
 
8930
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
9021
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8931
9022
  function lookupElement2(elements, xref) {
8932
9023
  const el = elements.get(xref);
8933
9024
  if (el === void 0) {
@@ -8957,15 +9048,15 @@ function specializeBindings(job) {
8957
9048
  const target = lookupElement2(elements, op.target);
8958
9049
  target.nonBindable = true;
8959
9050
  } else {
8960
- OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isTemplate, op.sourceSpan));
9051
+ OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
8961
9052
  }
8962
9053
  break;
8963
9054
  case BindingKind.Property:
8964
9055
  case BindingKind.Animation:
8965
9056
  if (job.kind === CompilationJobKind.Host) {
8966
- OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.sourceSpan));
9057
+ OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.sourceSpan));
8967
9058
  } else {
8968
- OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isTemplate, op.sourceSpan));
9059
+ OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
8969
9060
  }
8970
9061
  break;
8971
9062
  case BindingKind.I18n:
@@ -8977,7 +9068,7 @@ function specializeBindings(job) {
8977
9068
  }
8978
9069
  }
8979
9070
 
8980
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
9071
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8981
9072
  var CHAINABLE = /* @__PURE__ */ new Set([
8982
9073
  Identifiers.attribute,
8983
9074
  Identifiers.classProp,
@@ -9043,7 +9134,7 @@ function chainOperationsInList(opList) {
9043
9134
  }
9044
9135
  }
9045
9136
 
9046
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
9137
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
9047
9138
  function collapseSingletonInterpolations(job) {
9048
9139
  for (const unit of job.units) {
9049
9140
  for (const op of unit.update) {
@@ -9055,7 +9146,7 @@ function collapseSingletonInterpolations(job) {
9055
9146
  }
9056
9147
  }
9057
9148
 
9058
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9149
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9059
9150
  function generateConditionalExpressions(job) {
9060
9151
  for (const unit of job.units) {
9061
9152
  for (const op of unit.ops()) {
@@ -9092,7 +9183,7 @@ function generateConditionalExpressions(job) {
9092
9183
  }
9093
9184
  }
9094
9185
 
9095
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9186
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9096
9187
  var BINARY_OPERATORS = /* @__PURE__ */ new Map([
9097
9188
  ["&&", BinaryOperator.And],
9098
9189
  [">", BinaryOperator.Bigger],
@@ -9142,7 +9233,7 @@ function literalOrArrayLiteral(value) {
9142
9233
  return literal(value);
9143
9234
  }
9144
9235
 
9145
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9236
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9146
9237
  function collectElementConsts(job) {
9147
9238
  const allElementAttributes = /* @__PURE__ */ new Map();
9148
9239
  for (const unit of job.units) {
@@ -9228,7 +9319,7 @@ var ElementAttributes = class {
9228
9319
  array.push(...getAttributeNameLiterals(name));
9229
9320
  if (kind === BindingKind.Attribute || kind === BindingKind.StyleProperty) {
9230
9321
  if (value === null) {
9231
- throw Error("Attribute & style element attributes must have a value");
9322
+ throw Error("Attribute, i18n attribute, & style element attributes must have a value");
9232
9323
  }
9233
9324
  array.push(value);
9234
9325
  }
@@ -9276,7 +9367,48 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9276
9367
  return literalArr(attrArray);
9277
9368
  }
9278
9369
 
9279
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9370
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.mjs
9371
+ function convertI18nBindings(job) {
9372
+ const i18nAttributesByElem = /* @__PURE__ */ new Map();
9373
+ for (const unit of job.units) {
9374
+ for (const op of unit.create) {
9375
+ if (op.kind === OpKind.I18nAttributes) {
9376
+ i18nAttributesByElem.set(op.target, op);
9377
+ }
9378
+ }
9379
+ for (const op of unit.update) {
9380
+ switch (op.kind) {
9381
+ case OpKind.Property:
9382
+ case OpKind.Attribute:
9383
+ if (op.i18nContext === null) {
9384
+ continue;
9385
+ }
9386
+ if (!(op.expression instanceof Interpolation2)) {
9387
+ continue;
9388
+ }
9389
+ const i18nAttributesForElem = i18nAttributesByElem.get(op.target);
9390
+ if (i18nAttributesForElem === void 0) {
9391
+ throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");
9392
+ }
9393
+ if (i18nAttributesForElem.target !== op.target) {
9394
+ throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element");
9395
+ }
9396
+ const ops = [];
9397
+ for (let i = 0; i < op.expression.expressions.length; i++) {
9398
+ const expr = op.expression.expressions[i];
9399
+ if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {
9400
+ throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`);
9401
+ }
9402
+ ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
9403
+ }
9404
+ OpList.replaceWithMany(op, ops);
9405
+ break;
9406
+ }
9407
+ }
9408
+ }
9409
+ }
9410
+
9411
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9280
9412
  function createDeferDepsFns(job) {
9281
9413
  for (const unit of job.units) {
9282
9414
  for (const op of unit.create) {
@@ -9304,7 +9436,7 @@ function createDeferDepsFns(job) {
9304
9436
  }
9305
9437
  }
9306
9438
 
9307
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9439
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9308
9440
  function createI18nContexts(job) {
9309
9441
  const rootContexts = /* @__PURE__ */ new Map();
9310
9442
  let currentI18nOp = null;
@@ -9348,7 +9480,7 @@ function createI18nContexts(job) {
9348
9480
  }
9349
9481
  }
9350
9482
 
9351
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9483
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9352
9484
  function configureDeferInstructions(job) {
9353
9485
  for (const unit of job.units) {
9354
9486
  for (const op of unit.create) {
@@ -9365,7 +9497,7 @@ function configureDeferInstructions(job) {
9365
9497
  }
9366
9498
  }
9367
9499
 
9368
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9500
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9369
9501
  function resolveDeferTargetNames(job) {
9370
9502
  const scopes = /* @__PURE__ */ new Map();
9371
9503
  function getScopeForView2(view) {
@@ -9459,7 +9591,7 @@ var Scope = class {
9459
9591
  }
9460
9592
  };
9461
9593
 
9462
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9594
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9463
9595
  var REPLACEMENTS = /* @__PURE__ */ new Map([
9464
9596
  [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9465
9597
  [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
@@ -9486,7 +9618,7 @@ function collapseEmptyInstructions(job) {
9486
9618
  }
9487
9619
  }
9488
9620
 
9489
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9621
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9490
9622
  function expandSafeReads(job) {
9491
9623
  for (const unit of job.units) {
9492
9624
  for (const op of unit.ops()) {
@@ -9622,7 +9754,7 @@ function ternaryTransform(e) {
9622
9754
  return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
9623
9755
  }
9624
9756
 
9625
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9757
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9626
9758
  var ESCAPE = "\uFFFD";
9627
9759
  var ELEMENT_MARKER = "#";
9628
9760
  var TEMPLATE_MARKER = "*";
@@ -9646,6 +9778,15 @@ function extractI18nMessages(job) {
9646
9778
  }
9647
9779
  }
9648
9780
  }
9781
+ for (const unit of job.units) {
9782
+ for (const op of unit.create) {
9783
+ if (op.kind !== OpKind.I18nContext || op.contextKind !== I18nContextKind.Attr) {
9784
+ continue;
9785
+ }
9786
+ const i18nMessageOp = createI18nMessage(job, op);
9787
+ unit.create.push(i18nMessageOp);
9788
+ }
9789
+ }
9649
9790
  const i18nBlockMessages = /* @__PURE__ */ new Map();
9650
9791
  for (const unit of job.units) {
9651
9792
  for (const op of unit.create) {
@@ -9668,6 +9809,9 @@ function extractI18nMessages(job) {
9668
9809
  }
9669
9810
  const i18nContext = i18nContexts.get(op.context);
9670
9811
  if (i18nContext.contextKind === I18nContextKind.Icu) {
9812
+ if (i18nContext.i18nBlock === null) {
9813
+ throw Error("ICU context should have its i18n block set.");
9814
+ }
9671
9815
  const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
9672
9816
  unit.create.push(subMessage);
9673
9817
  const rootI18nId = i18nBlocks.get(i18nContext.i18nBlock).root;
@@ -9684,69 +9828,54 @@ function extractI18nMessages(job) {
9684
9828
  }
9685
9829
  }
9686
9830
  function createI18nMessage(job, context, messagePlaceholder) {
9687
- let [formattedParams, needsPostprocessing] = formatParams(context.params);
9688
- const [formattedPostprocessingParams] = formatParams(context.postprocessingParams);
9689
- needsPostprocessing || (needsPostprocessing = formattedPostprocessingParams.size > 0);
9690
- return createI18nMessageOp(job.allocateXrefId(), context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
9831
+ let formattedParams = formatParams(context.params);
9832
+ const formattedPostprocessingParams = formatParams(context.postprocessingParams);
9833
+ let needsPostprocessing = formattedPostprocessingParams.size > 0;
9834
+ for (const values of context.params.values()) {
9835
+ if (values.length > 1) {
9836
+ needsPostprocessing = true;
9837
+ }
9838
+ }
9839
+ return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
9691
9840
  }
9692
9841
  function formatParams(params) {
9693
9842
  const formattedParams = /* @__PURE__ */ new Map();
9694
- let needsPostprocessing = false;
9695
9843
  for (const [placeholder, placeholderValues] of params) {
9696
- const [serializedValues, paramNeedsPostprocessing] = formatParamValues(placeholderValues);
9697
- needsPostprocessing || (needsPostprocessing = paramNeedsPostprocessing);
9844
+ const serializedValues = formatParamValues(placeholderValues);
9698
9845
  if (serializedValues !== null) {
9699
9846
  formattedParams.set(placeholder, literal(serializedValues));
9700
9847
  }
9701
9848
  }
9702
- return [formattedParams, needsPostprocessing];
9849
+ return formattedParams;
9703
9850
  }
9704
9851
  function formatParamValues(values) {
9705
9852
  if (values.length === 0) {
9706
- return [null, false];
9853
+ return null;
9707
9854
  }
9708
- collapseElementTemplatePairs(values);
9709
9855
  const serializedValues = values.map((value) => formatValue(value));
9710
- return serializedValues.length === 1 ? [serializedValues[0], false] : [`${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`, true];
9856
+ return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
9711
9857
  }
9712
- function collapseElementTemplatePairs(values) {
9713
- var _a2;
9714
- const valueIndiciesBySubTemplateIndex = /* @__PURE__ */ new Map();
9715
- for (let i = 0; i < values.length; i++) {
9716
- const value = values[i];
9717
- if (value.subTemplateIndex !== null && value.flags & (I18nParamValueFlags.ElementTag | I18nParamValueFlags.TemplateTag)) {
9718
- const valueIndicies = (_a2 = valueIndiciesBySubTemplateIndex.get(value.subTemplateIndex)) != null ? _a2 : [];
9719
- valueIndicies.push(i);
9720
- valueIndiciesBySubTemplateIndex.set(value.subTemplateIndex, valueIndicies);
9721
- }
9722
- }
9723
- for (const [subTemplateIndex, valueIndicies] of valueIndiciesBySubTemplateIndex) {
9724
- if (valueIndicies.length > 1) {
9725
- const elementIndex = valueIndicies.find((index) => values[index].flags & I18nParamValueFlags.ElementTag);
9726
- const templateIndex = valueIndicies.find((index) => values[index].flags & I18nParamValueFlags.TemplateTag);
9727
- if (elementIndex !== void 0 && templateIndex !== void 0) {
9728
- const elementValue = values[elementIndex];
9729
- const templateValue = values[templateIndex];
9730
- let compundValue;
9731
- if (elementValue.flags & I18nParamValueFlags.OpenTag && elementValue.flags & I18nParamValueFlags.CloseTag) {
9732
- compundValue = `${formatValue(templateValue)}${formatValue(elementValue)}${formatValue(templateValue)}`;
9733
- } else if (elementValue.flags & I18nParamValueFlags.OpenTag) {
9734
- compundValue = `${formatValue(templateValue)}${formatValue(elementValue)}`;
9735
- } else {
9736
- compundValue = `${formatValue(elementValue)}${formatValue(templateValue)}`;
9737
- }
9738
- values.splice(elementIndex, 1, { value: compundValue, subTemplateIndex, flags: I18nParamValueFlags.None });
9739
- values.splice(templateIndex, 1, null);
9740
- }
9858
+ function formatValue(value) {
9859
+ if (value.flags & I18nParamValueFlags.ElementTag && value.flags & I18nParamValueFlags.TemplateTag) {
9860
+ if (typeof value.value !== "object") {
9861
+ throw Error("AssertionError: Expected i18n param value to have an element and template slot");
9741
9862
  }
9742
- }
9743
- for (let i = values.length - 1; i >= 0; i--) {
9744
- if (values[i] === null) {
9745
- values.splice(i, 1);
9863
+ const elementValue = formatValue(__spreadProps(__spreadValues({}, value), {
9864
+ value: value.value.element,
9865
+ flags: value.flags & ~I18nParamValueFlags.TemplateTag
9866
+ }));
9867
+ const templateValue = formatValue(__spreadProps(__spreadValues({}, value), {
9868
+ value: value.value.template,
9869
+ flags: value.flags & ~I18nParamValueFlags.ElementTag
9870
+ }));
9871
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9872
+ return `${templateValue}${elementValue}${templateValue}`;
9746
9873
  }
9874
+ return value.flags & I18nParamValueFlags.CloseTag ? `${elementValue}${templateValue}` : `${templateValue}${elementValue}`;
9875
+ }
9876
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9877
+ return `${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.CloseTag }))}${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.OpenTag }))}`;
9747
9878
  }
9748
- }
9749
- function formatValue(value) {
9750
9879
  if (value.flags === I18nParamValueFlags.None) {
9751
9880
  return `${value.value}`;
9752
9881
  }
@@ -9761,13 +9890,10 @@ function formatValue(value) {
9761
9890
  closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
9762
9891
  }
9763
9892
  const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
9764
- if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9765
- return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9766
- }
9767
9893
  return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9768
9894
  }
9769
9895
 
9770
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9896
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9771
9897
  function generateAdvance(job) {
9772
9898
  for (const unit of job.units) {
9773
9899
  const slotMap = /* @__PURE__ */ new Map();
@@ -9784,7 +9910,7 @@ function generateAdvance(job) {
9784
9910
  if (!hasDependsOnSlotContextTrait(op)) {
9785
9911
  continue;
9786
9912
  } else if (!slotMap.has(op.target)) {
9787
- throw new Error(`AssertionError: reference to unknown slot for var ${op.target}`);
9913
+ throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`);
9788
9914
  }
9789
9915
  const slot = slotMap.get(op.target);
9790
9916
  if (slotContext !== slot) {
@@ -9799,7 +9925,7 @@ function generateAdvance(job) {
9799
9925
  }
9800
9926
  }
9801
9927
 
9802
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9928
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9803
9929
  function generateProjectionDefs(job) {
9804
9930
  const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
9805
9931
  const selectors = [];
@@ -9823,7 +9949,7 @@ function generateProjectionDefs(job) {
9823
9949
  }
9824
9950
  }
9825
9951
 
9826
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9952
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9827
9953
  function generateVariables(job) {
9828
9954
  recursivelyProcessView(job.root, null);
9829
9955
  }
@@ -9911,7 +10037,7 @@ function generateVariablesInScopeForView(view, scope) {
9911
10037
  return newOps;
9912
10038
  }
9913
10039
 
9914
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
10040
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
9915
10041
  function collectConstExpressions(job) {
9916
10042
  for (const unit of job.units) {
9917
10043
  for (const op of unit.ops()) {
@@ -9925,7 +10051,7 @@ function collectConstExpressions(job) {
9925
10051
  }
9926
10052
  }
9927
10053
 
9928
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
10054
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9929
10055
  var STYLE_DOT = "style.";
9930
10056
  var CLASS_DOT = "class.";
9931
10057
  var STYLE_BANG = "style!";
@@ -9983,7 +10109,7 @@ function parseProperty(name) {
9983
10109
  return { property: property2, suffix };
9984
10110
  }
9985
10111
 
9986
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/map_util.mjs
10112
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9987
10113
  function mapLiteral(obj, quoted = false) {
9988
10114
  return literalMap(Object.keys(obj).map((key) => ({
9989
10115
  key,
@@ -9992,7 +10118,7 @@ function mapLiteral(obj, quoted = false) {
9992
10118
  })));
9993
10119
  }
9994
10120
 
9995
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
10121
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9996
10122
  var IcuSerializerVisitor = class {
9997
10123
  visitText(text2) {
9998
10124
  return text2.value;
@@ -10026,7 +10152,7 @@ function serializeIcuNode(icu) {
10026
10152
  return icu.visit(serializer);
10027
10153
  }
10028
10154
 
10029
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10155
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10030
10156
  var TokenType;
10031
10157
  (function(TokenType2) {
10032
10158
  TokenType2[TokenType2["Character"] = 0] = "Character";
@@ -10387,7 +10513,7 @@ function parseIntAutoRadix(text2) {
10387
10513
  return result;
10388
10514
  }
10389
10515
 
10390
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10516
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10391
10517
  var SplitInterpolation = class {
10392
10518
  constructor(strings, expressions, offsets) {
10393
10519
  this.strings = strings;
@@ -11281,7 +11407,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
11281
11407
  return offsetMap;
11282
11408
  }
11283
11409
 
11284
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11410
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11285
11411
  var NodeWithI18n = class {
11286
11412
  constructor(sourceSpan, i18n2) {
11287
11413
  this.sourceSpan = sourceSpan;
@@ -11433,11 +11559,11 @@ var RecursiveVisitor = class {
11433
11559
  }
11434
11560
  };
11435
11561
 
11436
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11562
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11437
11563
  var ElementSchemaRegistry = class {
11438
11564
  };
11439
11565
 
11440
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11566
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11441
11567
  var BOOLEAN = "boolean";
11442
11568
  var NUMBER = "number";
11443
11569
  var STRING = "string";
@@ -11790,7 +11916,7 @@ function _isPixelDimensionStyle(prop) {
11790
11916
  }
11791
11917
  }
11792
11918
 
11793
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11919
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11794
11920
  var HtmlTagDefinition = class {
11795
11921
  constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
11796
11922
  this.closedByChildren = {};
@@ -11908,7 +12034,7 @@ function getHtmlTagDefinition(tagName) {
11908
12034
  return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
11909
12035
  }
11910
12036
 
11911
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
12037
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11912
12038
  var TAG_TO_PLACEHOLDER_NAMES = {
11913
12039
  "A": "LINK",
11914
12040
  "B": "BOLD_TEXT",
@@ -12030,7 +12156,7 @@ var PlaceholderRegistry = class {
12030
12156
  }
12031
12157
  };
12032
12158
 
12033
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12159
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12034
12160
  var _expParser = new Parser(new Lexer());
12035
12161
  function createI18nMessageFactory(interpolationConfig, containerBlocks) {
12036
12162
  const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
@@ -12209,14 +12335,14 @@ function extractPlaceholderName(input) {
12209
12335
  return input.split(_CUSTOM_PH_EXP)[2];
12210
12336
  }
12211
12337
 
12212
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12338
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12213
12339
  var I18nError = class extends ParseError {
12214
12340
  constructor(span, msg) {
12215
12341
  super(span, msg);
12216
12342
  }
12217
12343
  };
12218
12344
 
12219
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12345
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12220
12346
  var NAMED_ENTITIES = {
12221
12347
  "AElig": "\xC6",
12222
12348
  "AMP": "&",
@@ -14347,7 +14473,7 @@ var NAMED_ENTITIES = {
14347
14473
  var NGSP_UNICODE = "\uE500";
14348
14474
  NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
14349
14475
 
14350
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14476
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14351
14477
  var TokenError = class extends ParseError {
14352
14478
  constructor(errorMsg, tokenType, span) {
14353
14479
  super(span, errorMsg);
@@ -15268,7 +15394,7 @@ var CursorError = class {
15268
15394
  }
15269
15395
  };
15270
15396
 
15271
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15397
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15272
15398
  var TreeError = class extends ParseError {
15273
15399
  static create(elementName, span, msg) {
15274
15400
  return new TreeError(elementName, span, msg);
@@ -15652,7 +15778,7 @@ function decodeEntity(match, entity) {
15652
15778
  return match;
15653
15779
  }
15654
15780
 
15655
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15781
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15656
15782
  var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
15657
15783
  "iframe|srcdoc",
15658
15784
  "*|innerhtml",
@@ -15667,7 +15793,7 @@ function isTrustedTypesSink(tagName, propName) {
15667
15793
  return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
15668
15794
  }
15669
15795
 
15670
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15796
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15671
15797
  var setI18nRefs = (htmlNode, i18nNode) => {
15672
15798
  if (htmlNode instanceof NodeWithI18n) {
15673
15799
  if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
@@ -15824,7 +15950,7 @@ function i18nMetaToJSDoc(meta) {
15824
15950
  return jsDocComment(tags);
15825
15951
  }
15826
15952
 
15827
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15953
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15828
15954
  var GOOG_GET_MSG = "goog.getMsg";
15829
15955
  function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
15830
15956
  const messageString = serializeI18nMessageForGetMsg(message);
@@ -15875,7 +16001,7 @@ function serializeI18nMessageForGetMsg(message) {
15875
16001
  return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
15876
16002
  }
15877
16003
 
15878
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
16004
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15879
16005
  function createLocalizeStatements(variable2, message, params) {
15880
16006
  const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
15881
16007
  const sourceSpan = getSourceSpan(message);
@@ -15964,59 +16090,136 @@ function createEmptyMessagePart(location) {
15964
16090
  return new LiteralPiece("", new ParseSourceSpan(location, location));
15965
16091
  }
15966
16092
 
15967
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
16093
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
15968
16094
  var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
15969
16095
  var TRANSLATION_VAR_PREFIX2 = "i18n_";
16096
+ var I18N_ICU_MAPPING_PREFIX2 = "I18N_EXP_";
16097
+ var ESCAPE2 = "\uFFFD";
15970
16098
  function collectI18nConsts(job) {
16099
+ var _a2;
15971
16100
  const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
15972
- const messageConstIndices = /* @__PURE__ */ new Map();
16101
+ const extractedAttributesByI18nContext = /* @__PURE__ */ new Map();
16102
+ const i18nAttributesByElement = /* @__PURE__ */ new Map();
16103
+ const i18nExpressionsByElement = /* @__PURE__ */ new Map();
15973
16104
  const messages = /* @__PURE__ */ new Map();
16105
+ for (const unit of job.units) {
16106
+ for (const op of unit.ops()) {
16107
+ if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) {
16108
+ extractedAttributesByI18nContext.set(op.i18nContext, op);
16109
+ } else if (op.kind === OpKind.I18nAttributes) {
16110
+ i18nAttributesByElement.set(op.target, op);
16111
+ } else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) {
16112
+ const expressions = (_a2 = i18nExpressionsByElement.get(op.target)) != null ? _a2 : [];
16113
+ expressions.push(op);
16114
+ i18nExpressionsByElement.set(op.target, expressions);
16115
+ } else if (op.kind === OpKind.I18nMessage) {
16116
+ messages.set(op.xref, op);
16117
+ }
16118
+ }
16119
+ }
16120
+ const i18nValuesByContext = /* @__PURE__ */ new Map();
16121
+ const messageConstIndices = /* @__PURE__ */ new Map();
15974
16122
  for (const unit of job.units) {
15975
16123
  for (const op of unit.create) {
15976
16124
  if (op.kind === OpKind.I18nMessage) {
15977
- messages.set(op.xref, op);
16125
+ if (op.messagePlaceholder === null) {
16126
+ const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
16127
+ if (op.i18nBlock !== null) {
16128
+ const i18nConst = job.addConst(mainVar, statements);
16129
+ messageConstIndices.set(op.i18nBlock, i18nConst);
16130
+ } else {
16131
+ job.constsInitializers.push(...statements);
16132
+ i18nValuesByContext.set(op.i18nContext, mainVar);
16133
+ const attributeForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
16134
+ if (attributeForMessage !== void 0) {
16135
+ attributeForMessage.expression = mainVar;
16136
+ }
16137
+ }
16138
+ }
15978
16139
  OpList.remove(op);
15979
16140
  }
15980
16141
  }
15981
16142
  }
15982
- for (const op of messages.values()) {
15983
- if (op.kind === OpKind.I18nMessage && op.messagePlaceholder === null) {
15984
- const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
15985
- messageConstIndices.set(op.i18nBlock, job.addConst(mainVar, statements));
16143
+ for (const unit of job.units) {
16144
+ for (const elem of unit.create) {
16145
+ if (isElementOrContainerOp(elem)) {
16146
+ const i18nAttributes2 = i18nAttributesByElement.get(elem.xref);
16147
+ if (i18nAttributes2 === void 0) {
16148
+ continue;
16149
+ }
16150
+ let i18nExpressions = i18nExpressionsByElement.get(elem.xref);
16151
+ if (i18nExpressions === void 0) {
16152
+ throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction");
16153
+ }
16154
+ const seenPropertyNames = /* @__PURE__ */ new Set();
16155
+ i18nExpressions = i18nExpressions.filter((i18nExpr) => {
16156
+ const seen = seenPropertyNames.has(i18nExpr.name);
16157
+ seenPropertyNames.add(i18nExpr.name);
16158
+ return !seen;
16159
+ });
16160
+ const i18nAttributeConfig = i18nExpressions.flatMap((i18nExpr) => {
16161
+ const i18nExprValue = i18nValuesByContext.get(i18nExpr.context);
16162
+ if (i18nExprValue === void 0) {
16163
+ throw new Error("AssertionError: Could not find i18n expression's value");
16164
+ }
16165
+ return [literal(i18nExpr.name), i18nExprValue];
16166
+ });
16167
+ i18nAttributes2.i18nAttributesConfig = job.addConst(new LiteralArrayExpr(i18nAttributeConfig));
16168
+ }
15986
16169
  }
15987
16170
  }
15988
16171
  for (const unit of job.units) {
15989
16172
  for (const op of unit.create) {
15990
16173
  if (op.kind === OpKind.I18nStart) {
15991
- op.messageIndex = messageConstIndices.get(op.root);
16174
+ const msgIndex = messageConstIndices.get(op.root);
16175
+ if (msgIndex === void 0) {
16176
+ throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?");
16177
+ }
16178
+ op.messageIndex = msgIndex;
15992
16179
  }
15993
16180
  }
15994
16181
  }
15995
16182
  }
15996
16183
  function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
16184
+ var _a2;
15997
16185
  const statements = [];
16186
+ const subMessagePlaceholders = /* @__PURE__ */ new Map();
15998
16187
  for (const subMessageId of messageOp.subMessages) {
15999
16188
  const subMessage = messages.get(subMessageId);
16000
16189
  const { mainVar: subMessageVar, statements: subMessageStatements } = collectMessage(job, fileBasedI18nSuffix, messages, subMessage);
16001
16190
  statements.push(...subMessageStatements);
16002
- messageOp.params.set(subMessage.messagePlaceholder, subMessageVar);
16191
+ const subMessages = (_a2 = subMessagePlaceholders.get(subMessage.messagePlaceholder)) != null ? _a2 : [];
16192
+ subMessages.push(subMessageVar);
16193
+ subMessagePlaceholders.set(subMessage.messagePlaceholder, subMessages);
16003
16194
  }
16195
+ addSubMessageParams(messageOp, subMessagePlaceholders);
16004
16196
  messageOp.params = new Map([...messageOp.params.entries()].sort());
16005
- assertAllParamsResolved(messageOp);
16006
16197
  const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
16007
16198
  const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
16008
16199
  let transformFn = void 0;
16009
16200
  if (messageOp.needsPostprocessing) {
16010
- messageOp.postprocessingParams = new Map([...messageOp.postprocessingParams.entries()].sort());
16201
+ const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());
16202
+ const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(postprocessingParams, false);
16011
16203
  const extraTransformFnParams = [];
16012
16204
  if (messageOp.postprocessingParams.size > 0) {
16013
- extraTransformFnParams.push(literalMap([...messageOp.postprocessingParams].map(([key, value]) => ({ key, value, quoted: true }))));
16205
+ extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams, true));
16014
16206
  }
16015
16207
  transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
16016
16208
  }
16017
16209
  statements.push(...getTranslationDeclStmts(messageOp.message, mainVar, closureVar, messageOp.params, transformFn));
16018
16210
  return { mainVar, statements };
16019
16211
  }
16212
+ function addSubMessageParams(messageOp, subMessagePlaceholders) {
16213
+ for (const [placeholder, subMessages] of subMessagePlaceholders) {
16214
+ if (subMessages.length === 1) {
16215
+ messageOp.params.set(placeholder, subMessages[0]);
16216
+ } else {
16217
+ messageOp.params.set(placeholder, literal(`${ESCAPE2}${I18N_ICU_MAPPING_PREFIX2}${placeholder}${ESCAPE2}`));
16218
+ messageOp.postprocessingParams.set(placeholder, literalArr(subMessages));
16219
+ messageOp.needsPostprocessing = true;
16220
+ }
16221
+ }
16222
+ }
16020
16223
  function getTranslationDeclStmts(message, variable2, closureVar, params, transformFn) {
16021
16224
  const paramsObject = Object.fromEntries(params);
16022
16225
  const statements = [
@@ -16044,23 +16247,9 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
16044
16247
  }
16045
16248
  return variable(name);
16046
16249
  }
16047
- function assertAllParamsResolved(op) {
16048
- for (let placeholder in op.message.placeholders) {
16049
- placeholder = placeholder.trimEnd();
16050
- if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
16051
- throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
16052
- }
16053
- }
16054
- for (let placeholder in op.message.placeholderToMessage) {
16055
- placeholder = placeholder.trimEnd();
16056
- if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
16057
- throw Error(`Failed to resolve i18n message placeholder: ${placeholder}`);
16058
- }
16059
- }
16060
- }
16061
16250
 
16062
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16063
- function extractI18nText(job) {
16251
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16252
+ function convertI18nText(job) {
16064
16253
  var _a2;
16065
16254
  for (const unit of job.units) {
16066
16255
  let currentI18n = null;
@@ -16109,7 +16298,7 @@ function extractI18nText(job) {
16109
16298
  const ops = [];
16110
16299
  for (let i = 0; i < op.interpolation.expressions.length; i++) {
16111
16300
  const expr = op.interpolation.expressions[i];
16112
- ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.handle, expr, op.i18nPlaceholders[i], resolutionTime, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
16301
+ ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, op.interpolation.i18nPlaceholders[i], resolutionTime, I18nExpressionFor.I18nText, "", (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
16113
16302
  }
16114
16303
  OpList.replaceWithMany(op, ops);
16115
16304
  break;
@@ -16118,7 +16307,7 @@ function extractI18nText(job) {
16118
16307
  }
16119
16308
  }
16120
16309
 
16121
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16310
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16122
16311
  function liftLocalRefs(job) {
16123
16312
  for (const unit of job.units) {
16124
16313
  for (const op of unit.create) {
@@ -16148,7 +16337,7 @@ function serializeLocalRefs(refs) {
16148
16337
  return literalArr(constRefs);
16149
16338
  }
16150
16339
 
16151
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16340
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16152
16341
  function emitNamespaceChanges(job) {
16153
16342
  for (const unit of job.units) {
16154
16343
  let activeNamespace = Namespace.HTML;
@@ -16164,7 +16353,7 @@ function emitNamespaceChanges(job) {
16164
16353
  }
16165
16354
  }
16166
16355
 
16167
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16356
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16168
16357
  function parse(value) {
16169
16358
  const styles = [];
16170
16359
  let i = 0;
@@ -16225,7 +16414,7 @@ function hyphenate2(value) {
16225
16414
  }).toLowerCase();
16226
16415
  }
16227
16416
 
16228
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16417
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16229
16418
  function nameFunctionsAndVariables(job) {
16230
16419
  addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
16231
16420
  }
@@ -16340,7 +16529,7 @@ function stripImportant(name) {
16340
16529
  return name;
16341
16530
  }
16342
16531
 
16343
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16532
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16344
16533
  function mergeNextContextExpressions(job) {
16345
16534
  for (const unit of job.units) {
16346
16535
  for (const op of unit.create) {
@@ -16386,7 +16575,7 @@ function mergeNextContextsInOps(ops) {
16386
16575
  }
16387
16576
  }
16388
16577
 
16389
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16578
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16390
16579
  var CONTAINER_TAG = "ng-container";
16391
16580
  function generateNgContainerOps(job) {
16392
16581
  for (const unit of job.units) {
@@ -16403,7 +16592,7 @@ function generateNgContainerOps(job) {
16403
16592
  }
16404
16593
  }
16405
16594
 
16406
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16595
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16407
16596
  function lookupElement3(elements, xref) {
16408
16597
  const el = elements.get(xref);
16409
16598
  if (el === void 0) {
@@ -16433,7 +16622,7 @@ function disableBindings(job) {
16433
16622
  }
16434
16623
  }
16435
16624
 
16436
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16625
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16437
16626
  function generateNullishCoalesceExpressions(job) {
16438
16627
  for (const unit of job.units) {
16439
16628
  for (const op of unit.ops()) {
@@ -16449,7 +16638,7 @@ function generateNullishCoalesceExpressions(job) {
16449
16638
  }
16450
16639
  }
16451
16640
 
16452
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16641
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16453
16642
  function kindTest(kind) {
16454
16643
  return (op) => op.kind === kind;
16455
16644
  }
@@ -16523,7 +16712,7 @@ function keepLast(ops) {
16523
16712
  return ops.slice(ops.length - 1);
16524
16713
  }
16525
16714
 
16526
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16715
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16527
16716
  function parseExtractedStyles(job) {
16528
16717
  for (const unit of job.units) {
16529
16718
  for (const op of unit.create) {
@@ -16531,13 +16720,13 @@ function parseExtractedStyles(job) {
16531
16720
  if (op.name === "style") {
16532
16721
  const parsedStyles = parse(op.expression.value);
16533
16722
  for (let i = 0; i < parsedStyles.length - 1; i += 2) {
16534
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1])), op);
16723
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null), op);
16535
16724
  }
16536
16725
  OpList.remove(op);
16537
16726
  } else if (op.name === "class") {
16538
16727
  const parsedClasses = op.expression.value.trim().split(/\s+/g);
16539
16728
  for (const parsedClass of parsedClasses) {
16540
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null), op);
16729
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null), op);
16541
16730
  }
16542
16731
  OpList.remove(op);
16543
16732
  }
@@ -16546,22 +16735,32 @@ function parseExtractedStyles(job) {
16546
16735
  }
16547
16736
  }
16548
16737
 
16549
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16550
16739
  function removeContentSelectors(job) {
16551
16740
  for (const unit of job.units) {
16552
16741
  const elements = createOpXrefMap(unit);
16553
- for (const op of unit.update) {
16742
+ for (const op of unit.ops()) {
16554
16743
  switch (op.kind) {
16555
16744
  case OpKind.Binding:
16556
16745
  const target = lookupInXrefMap(elements, op.target);
16557
- if (op.name.toLowerCase() === "select" && target.kind === OpKind.Projection) {
16746
+ if (isSelectAttribute(op.name) && target.kind === OpKind.Projection) {
16558
16747
  OpList.remove(op);
16559
16748
  }
16560
16749
  break;
16750
+ case OpKind.Projection:
16751
+ for (let i = op.attributes.length - 2; i >= 0; i -= 2) {
16752
+ if (isSelectAttribute(op.attributes[i])) {
16753
+ op.attributes.splice(i, 2);
16754
+ }
16755
+ }
16756
+ break;
16561
16757
  }
16562
16758
  }
16563
16759
  }
16564
16760
  }
16761
+ function isSelectAttribute(name) {
16762
+ return name.toLowerCase() === "select";
16763
+ }
16565
16764
  function lookupInXrefMap(map, xref) {
16566
16765
  const el = map.get(xref);
16567
16766
  if (el === void 0) {
@@ -16570,7 +16769,7 @@ function lookupInXrefMap(map, xref) {
16570
16769
  return el;
16571
16770
  }
16572
16771
 
16573
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16772
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16574
16773
  function createPipes(job) {
16575
16774
  for (const unit of job.units) {
16576
16775
  processPipeBindingsInView(unit);
@@ -16618,7 +16817,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
16618
16817
  throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
16619
16818
  }
16620
16819
 
16621
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16820
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16622
16821
  function createVariadicPipes(job) {
16623
16822
  for (const unit of job.units) {
16624
16823
  for (const op of unit.update) {
@@ -16635,7 +16834,7 @@ function createVariadicPipes(job) {
16635
16834
  }
16636
16835
  }
16637
16836
 
16638
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16837
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16639
16838
  function propagateI18nBlocks(job) {
16640
16839
  propagateI18nBlocksToTemplates(job.root, 0);
16641
16840
  }
@@ -16648,6 +16847,9 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
16648
16847
  i18nBlock = op;
16649
16848
  break;
16650
16849
  case OpKind.I18nEnd:
16850
+ if (i18nBlock.subTemplateIndex === null) {
16851
+ subTemplateIndex = 0;
16852
+ }
16651
16853
  i18nBlock = null;
16652
16854
  break;
16653
16855
  case OpKind.Template:
@@ -16673,7 +16875,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
16673
16875
  }
16674
16876
  }
16675
16877
 
16676
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16878
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16677
16879
  function extractPureFunctions(job) {
16678
16880
  for (const view of job.units) {
16679
16881
  for (const op of view.ops()) {
@@ -16715,7 +16917,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
16715
16917
  }
16716
16918
  };
16717
16919
 
16718
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16920
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16719
16921
  function generatePureLiteralStructures(job) {
16720
16922
  for (const unit of job.units) {
16721
16923
  for (const op of unit.update) {
@@ -16762,7 +16964,7 @@ function transformLiteralMap(expr) {
16762
16964
  return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
16763
16965
  }
16764
16966
 
16765
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16967
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16766
16968
  function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
16767
16969
  return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
16768
16970
  }
@@ -16977,6 +17179,10 @@ function i18n(slot, constIndex, subTemplateIndex) {
16977
17179
  function i18nEnd() {
16978
17180
  return call(Identifiers.i18nEnd, [], null);
16979
17181
  }
17182
+ function i18nAttributes(slot, i18nAttributesConfig) {
17183
+ const args = [literal(slot), literal(i18nAttributesConfig)];
17184
+ return call(Identifiers.i18nAttributes, args, null);
17185
+ }
16980
17186
  function property(name, expression, sanitizer, sourceSpan) {
16981
17187
  const args = [literal(name), expression];
16982
17188
  if (sanitizer !== null) {
@@ -17273,7 +17479,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
17273
17479
  return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
17274
17480
  }
17275
17481
 
17276
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17482
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17277
17483
  var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
17278
17484
  [SanitizerFn.Html, Identifiers.sanitizeHtml],
17279
17485
  [SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
@@ -17323,6 +17529,12 @@ function reifyCreateOperations(unit, ops) {
17323
17529
  case OpKind.I18n:
17324
17530
  OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex));
17325
17531
  break;
17532
+ case OpKind.I18nAttributes:
17533
+ if (op.i18nAttributesConfig === null) {
17534
+ throw new Error(`AssertionError: i18nAttributesConfig was not set`);
17535
+ }
17536
+ OpList.replace(op, i18nAttributes(op.handle.slot, op.i18nAttributesConfig));
17537
+ break;
17326
17538
  case OpKind.Template:
17327
17539
  if (!(unit instanceof ViewCompilationUnit)) {
17328
17540
  throw new Error(`AssertionError: must be compiling a component`);
@@ -17602,7 +17814,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
17602
17814
  return fn(params, handlerStmts, void 0, void 0, name);
17603
17815
  }
17604
17816
 
17605
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17817
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17606
17818
  function removeEmptyBindings(job) {
17607
17819
  for (const unit of job.units) {
17608
17820
  for (const op of unit.update) {
@@ -17623,7 +17835,7 @@ function removeEmptyBindings(job) {
17623
17835
  }
17624
17836
  }
17625
17837
 
17626
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17838
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17627
17839
  function removeI18nContexts(job) {
17628
17840
  for (const unit of job.units) {
17629
17841
  for (const op of unit.create) {
@@ -17639,7 +17851,29 @@ function removeI18nContexts(job) {
17639
17851
  }
17640
17852
  }
17641
17853
 
17642
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17854
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.mjs
17855
+ function removeUnusedI18nAttributesOps(job) {
17856
+ for (const unit of job.units) {
17857
+ const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
17858
+ for (const op of unit.update) {
17859
+ switch (op.kind) {
17860
+ case OpKind.I18nExpression:
17861
+ ownersWithI18nExpressions.add(op.i18nOwner);
17862
+ }
17863
+ }
17864
+ for (const op of unit.create) {
17865
+ switch (op.kind) {
17866
+ case OpKind.I18nAttributes:
17867
+ if (ownersWithI18nExpressions.has(op.xref)) {
17868
+ continue;
17869
+ }
17870
+ OpList.remove(op);
17871
+ }
17872
+ }
17873
+ }
17874
+ }
17875
+
17876
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17643
17877
  function generateRepeaterDerivedVars(job) {
17644
17878
  const repeaters = /* @__PURE__ */ new Map();
17645
17879
  for (const unit of job.units) {
@@ -17671,7 +17905,7 @@ function generateRepeaterDerivedVars(job) {
17671
17905
  }
17672
17906
  }
17673
17907
 
17674
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17908
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17675
17909
  function resolveContexts(job) {
17676
17910
  for (const unit of job.units) {
17677
17911
  processLexicalScope(unit, unit.create);
@@ -17712,7 +17946,7 @@ function processLexicalScope(view, ops) {
17712
17946
  }
17713
17947
  }
17714
17948
 
17715
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17949
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17716
17950
  function resolveDollarEvent(job) {
17717
17951
  for (const unit of job.units) {
17718
17952
  transformDollarEvent(unit, unit.create);
@@ -17733,7 +17967,7 @@ function transformDollarEvent(unit, ops) {
17733
17967
  }
17734
17968
  }
17735
17969
 
17736
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17970
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17737
17971
  function resolveI18nElementPlaceholders(job) {
17738
17972
  const i18nContexts = /* @__PURE__ */ new Map();
17739
17973
  const elements = /* @__PURE__ */ new Map();
@@ -17751,8 +17985,9 @@ function resolveI18nElementPlaceholders(job) {
17751
17985
  }
17752
17986
  resolvePlaceholdersForView(job, job.root, i18nContexts, elements);
17753
17987
  }
17754
- function resolvePlaceholdersForView(job, unit, i18nContexts, elements) {
17988
+ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingStructuralDirective) {
17755
17989
  let currentOps = null;
17990
+ let pendingStructuralDirectiveCloses = /* @__PURE__ */ new Map();
17756
17991
  for (const op of unit.create) {
17757
17992
  switch (op.kind) {
17758
17993
  case OpKind.I18nStart:
@@ -17769,50 +18004,99 @@ function resolvePlaceholdersForView(job, unit, i18nContexts, elements) {
17769
18004
  if (currentOps === null) {
17770
18005
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17771
18006
  }
17772
- const { startName, closeName } = op.i18nPlaceholder;
17773
- let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
17774
- if (closeName === "") {
17775
- flags |= I18nParamValueFlags.CloseTag;
18007
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18008
+ if (pendingStructuralDirective && op.i18nPlaceholder.closeName) {
18009
+ pendingStructuralDirectiveCloses.set(op.xref, pendingStructuralDirective);
17776
18010
  }
17777
- addParam(currentOps.i18nContext.params, startName, op.handle.slot, currentOps.i18nBlock.subTemplateIndex, flags);
18011
+ pendingStructuralDirective = void 0;
17778
18012
  }
17779
18013
  break;
17780
18014
  case OpKind.ElementEnd:
17781
18015
  const startOp = elements.get(op.xref);
17782
18016
  if (startOp && startOp.i18nPlaceholder !== void 0) {
17783
18017
  if (currentOps === null) {
17784
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17785
- }
17786
- const { closeName } = startOp.i18nPlaceholder;
17787
- if (closeName !== "") {
17788
- addParam(currentOps.i18nContext.params, closeName, startOp.handle.slot, currentOps.i18nBlock.subTemplateIndex, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
18018
+ throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block");
17789
18019
  }
18020
+ recordElementClose(startOp, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirectiveCloses.get(op.xref));
18021
+ pendingStructuralDirectiveCloses.delete(op.xref);
17790
18022
  }
17791
18023
  break;
17792
- case OpKind.Template:
18024
+ case OpKind.Projection:
17793
18025
  if (op.i18nPlaceholder !== void 0) {
17794
18026
  if (currentOps === null) {
17795
18027
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17796
18028
  }
17797
- let startFlags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
17798
- const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentOps.i18nBlock, op);
17799
- const { startName, closeName } = op.i18nPlaceholder;
17800
- const isSelfClosing = closeName === "";
17801
- if (isSelfClosing) {
17802
- startFlags |= I18nParamValueFlags.CloseTag;
17803
- }
17804
- addParam(currentOps.i18nContext.params, startName, op.handle.slot, subTemplateIndex, startFlags);
18029
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18030
+ recordElementClose(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18031
+ pendingStructuralDirective = void 0;
18032
+ }
18033
+ break;
18034
+ case OpKind.Template:
18035
+ if (op.i18nPlaceholder === void 0) {
17805
18036
  resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
17806
- if (!isSelfClosing) {
17807
- addParam(currentOps.i18nContext.params, closeName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
17808
- }
17809
18037
  } else {
17810
- resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18038
+ if (currentOps === null) {
18039
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
18040
+ }
18041
+ if (op.templateKind === TemplateKind.Structural) {
18042
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements, op);
18043
+ } else {
18044
+ recordTemplateStart(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18045
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18046
+ recordTemplateClose(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18047
+ pendingStructuralDirective = void 0;
18048
+ }
17811
18049
  }
17812
18050
  break;
17813
18051
  }
17814
18052
  }
17815
18053
  }
18054
+ function recordElementStart(op, i18nContext, i18nBlock, structuralDirective) {
18055
+ const { startName, closeName } = op.i18nPlaceholder;
18056
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
18057
+ let value = op.handle.slot;
18058
+ if (structuralDirective !== void 0) {
18059
+ flags |= I18nParamValueFlags.TemplateTag;
18060
+ value = { element: value, template: structuralDirective.handle.slot };
18061
+ }
18062
+ if (!closeName) {
18063
+ flags |= I18nParamValueFlags.CloseTag;
18064
+ }
18065
+ addParam(i18nContext.params, startName, value, i18nBlock.subTemplateIndex, flags);
18066
+ }
18067
+ function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) {
18068
+ const { closeName } = op.i18nPlaceholder;
18069
+ if (closeName) {
18070
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag;
18071
+ let value = op.handle.slot;
18072
+ if (structuralDirective !== void 0) {
18073
+ flags |= I18nParamValueFlags.TemplateTag;
18074
+ value = { element: value, template: structuralDirective.handle.slot };
18075
+ }
18076
+ addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);
18077
+ }
18078
+ }
18079
+ function recordTemplateStart(job, op, i18nContext, i18nBlock, structuralDirective) {
18080
+ let { startName, closeName } = op.i18nPlaceholder;
18081
+ let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
18082
+ if (!closeName) {
18083
+ flags |= I18nParamValueFlags.CloseTag;
18084
+ }
18085
+ if (structuralDirective !== void 0) {
18086
+ addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
18087
+ }
18088
+ addParam(i18nContext.params, startName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18089
+ }
18090
+ function recordTemplateClose(job, op, i18nContext, i18nBlock, structuralDirective) {
18091
+ const { startName, closeName } = op.i18nPlaceholder;
18092
+ const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
18093
+ if (closeName) {
18094
+ addParam(i18nContext.params, closeName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18095
+ if (structuralDirective !== void 0) {
18096
+ addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
18097
+ }
18098
+ }
18099
+ }
17816
18100
  function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
17817
18101
  for (const childOp of job.views.get(op.xref).create) {
17818
18102
  if (childOp.kind === OpKind.I18nStart) {
@@ -17828,8 +18112,9 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
17828
18112
  params.set(placeholder, values);
17829
18113
  }
17830
18114
 
17831
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
18115
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
17832
18116
  function resolveI18nExpressionPlaceholders(job) {
18117
+ var _a2;
17833
18118
  const subTemplateIndicies = /* @__PURE__ */ new Map();
17834
18119
  const i18nContexts = /* @__PURE__ */ new Map();
17835
18120
  for (const unit of job.units) {
@@ -17845,12 +18130,13 @@ function resolveI18nExpressionPlaceholders(job) {
17845
18130
  }
17846
18131
  }
17847
18132
  const expressionIndices = /* @__PURE__ */ new Map();
18133
+ const referenceIndex = (op) => op.usage === I18nExpressionFor.I18nText ? op.i18nOwner : op.context;
17848
18134
  for (const unit of job.units) {
17849
18135
  for (const op of unit.update) {
17850
18136
  if (op.kind === OpKind.I18nExpression) {
17851
18137
  const i18nContext = i18nContexts.get(op.context);
17852
- const index = expressionIndices.get(op.target) || 0;
17853
- const subTemplateIndex = subTemplateIndicies.get(op.target);
18138
+ const index = expressionIndices.get(referenceIndex(op)) || 0;
18139
+ const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
17854
18140
  const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
17855
18141
  const values = params.get(op.i18nPlaceholder) || [];
17856
18142
  values.push({
@@ -17859,13 +18145,13 @@ function resolveI18nExpressionPlaceholders(job) {
17859
18145
  flags: I18nParamValueFlags.ExpressionIndex
17860
18146
  });
17861
18147
  params.set(op.i18nPlaceholder, values);
17862
- expressionIndices.set(op.target, index + 1);
18148
+ expressionIndices.set(referenceIndex(op), index + 1);
17863
18149
  }
17864
18150
  }
17865
18151
  }
17866
18152
  }
17867
18153
 
17868
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
18154
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
17869
18155
  function resolveI18nIcuPlaceholders(job) {
17870
18156
  for (const unit of job.units) {
17871
18157
  for (const op of unit.create) {
@@ -17909,7 +18195,7 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
17909
18195
  }
17910
18196
  };
17911
18197
 
17912
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
18198
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17913
18199
  function resolveNames(job) {
17914
18200
  for (const unit of job.units) {
17915
18201
  processLexicalScope2(unit, unit.create, null);
@@ -17973,7 +18259,7 @@ function processLexicalScope2(unit, ops, savedView) {
17973
18259
  }
17974
18260
  }
17975
18261
 
17976
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
18262
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17977
18263
  var sanitizers = /* @__PURE__ */ new Map([
17978
18264
  [SecurityContext.HTML, SanitizerFn.Html],
17979
18265
  [SecurityContext.SCRIPT, SanitizerFn.Script],
@@ -18010,7 +18296,7 @@ function isIframeElement(op) {
18010
18296
  return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
18011
18297
  }
18012
18298
 
18013
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
18299
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
18014
18300
  function saveAndRestoreView(job) {
18015
18301
  for (const unit of job.units) {
18016
18302
  unit.create.prepend([
@@ -18055,7 +18341,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
18055
18341
  }
18056
18342
  }
18057
18343
 
18058
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18344
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18059
18345
  function allocateSlots(job) {
18060
18346
  const slotMap = /* @__PURE__ */ new Map();
18061
18347
  for (const unit of job.units) {
@@ -18080,7 +18366,7 @@ function allocateSlots(job) {
18080
18366
  }
18081
18367
  }
18082
18368
 
18083
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18369
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18084
18370
  function specializeStyleBindings(job) {
18085
18371
  for (const unit of job.units) {
18086
18372
  for (const op of unit.update) {
@@ -18110,7 +18396,7 @@ function specializeStyleBindings(job) {
18110
18396
  }
18111
18397
  }
18112
18398
 
18113
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18399
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18114
18400
  function generateTemporaryVariables(job) {
18115
18401
  for (const unit of job.units) {
18116
18402
  unit.create.prepend(generateTemporaries(unit.create));
@@ -18168,7 +18454,7 @@ function assignName(names, expr) {
18168
18454
  expr.name = name;
18169
18455
  }
18170
18456
 
18171
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18457
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18172
18458
  function generateTrackFns(job) {
18173
18459
  for (const unit of job.units) {
18174
18460
  for (const op of unit.create) {
@@ -18198,7 +18484,7 @@ function generateTrackFns(job) {
18198
18484
  }
18199
18485
  }
18200
18486
 
18201
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18487
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18202
18488
  function optimizeTrackFns(job) {
18203
18489
  for (const unit of job.units) {
18204
18490
  for (const op of unit.create) {
@@ -18245,7 +18531,7 @@ function isTrackByFunctionCall(rootView, expr) {
18245
18531
  return true;
18246
18532
  }
18247
18533
 
18248
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18534
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18249
18535
  function generateTrackVariables(job) {
18250
18536
  for (const unit of job.units) {
18251
18537
  for (const op of unit.create) {
@@ -18266,7 +18552,7 @@ function generateTrackVariables(job) {
18266
18552
  }
18267
18553
  }
18268
18554
 
18269
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18555
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18270
18556
  function countVariables(job) {
18271
18557
  for (const unit of job.units) {
18272
18558
  let varCount = 0;
@@ -18371,7 +18657,7 @@ function isSingletonInterpolation(expr) {
18371
18657
  return true;
18372
18658
  }
18373
18659
 
18374
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18660
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18375
18661
  function optimizeVariables(job) {
18376
18662
  for (const unit of job.units) {
18377
18663
  inlineAlwaysInlineVariables(unit.create);
@@ -18621,7 +18907,7 @@ function allowConservativeInlining(decl, target) {
18621
18907
  }
18622
18908
  }
18623
18909
 
18624
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18910
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18625
18911
  function wrapI18nIcus(job) {
18626
18912
  for (const unit of job.units) {
18627
18913
  let currentI18nOp = null;
@@ -18651,16 +18937,16 @@ function wrapI18nIcus(job) {
18651
18937
  }
18652
18938
  }
18653
18939
 
18654
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18940
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18655
18941
  var phases = [
18656
18942
  { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
18657
18943
  { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
18658
18944
  { kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
18659
- { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
18660
- { kind: CompilationJobKind.Both, fn: specializeBindings },
18661
18945
  { kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
18662
18946
  { kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
18663
18947
  { kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
18948
+ { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
18949
+ { kind: CompilationJobKind.Both, fn: specializeBindings },
18664
18950
  { kind: CompilationJobKind.Both, fn: extractAttributes },
18665
18951
  { kind: CompilationJobKind.Both, fn: parseExtractedStyles },
18666
18952
  { kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
@@ -18669,7 +18955,10 @@ var phases = [
18669
18955
  { kind: CompilationJobKind.Tmpl, fn: generateConditionalExpressions },
18670
18956
  { kind: CompilationJobKind.Tmpl, fn: createPipes },
18671
18957
  { kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
18672
- { kind: CompilationJobKind.Tmpl, fn: extractI18nText },
18958
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nText },
18959
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nBindings },
18960
+ { kind: CompilationJobKind.Tmpl, fn: removeUnusedI18nAttributesOps },
18961
+ { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
18673
18962
  { kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
18674
18963
  { kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
18675
18964
  { kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
@@ -18699,7 +18988,6 @@ var phases = [
18699
18988
  { kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
18700
18989
  { kind: CompilationJobKind.Tmpl, fn: collectConstExpressions },
18701
18990
  { kind: CompilationJobKind.Both, fn: collectElementConsts },
18702
- { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
18703
18991
  { kind: CompilationJobKind.Tmpl, fn: removeI18nContexts },
18704
18992
  { kind: CompilationJobKind.Both, fn: countVariables },
18705
18993
  { kind: CompilationJobKind.Tmpl, fn: generateAdvance },
@@ -18815,7 +19103,7 @@ function emitHostBindingFunction(job) {
18815
19103
  );
18816
19104
  }
18817
19105
 
18818
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
19106
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18819
19107
  var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
18820
19108
  function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
18821
19109
  const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
@@ -18840,7 +19128,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
18840
19128
  let expression;
18841
19129
  const ast = property2.expression.ast;
18842
19130
  if (ast instanceof Interpolation) {
18843
- expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)));
19131
+ expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)), []);
18844
19132
  } else {
18845
19133
  expression = convertAst(ast, job, property2.sourceSpan);
18846
19134
  }
@@ -18852,7 +19140,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
18852
19140
  if (property2.isAnimation) {
18853
19141
  bindingKind = BindingKind.Animation;
18854
19142
  }
18855
- job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, property2.sourceSpan));
19143
+ job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, null, property2.sourceSpan));
18856
19144
  }
18857
19145
  function ingestHostAttribute(job, name, value) {
18858
19146
  const attrBinding = createBindingOp(
@@ -18864,6 +19152,7 @@ function ingestHostAttribute(job, name, value) {
18864
19152
  SecurityContext.NONE,
18865
19153
  true,
18866
19154
  false,
19155
+ null,
18867
19156
  null
18868
19157
  );
18869
19158
  job.root.update.push(attrBinding);
@@ -18933,24 +19222,29 @@ function ingestTemplate(unit, tmpl) {
18933
19222
  const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
18934
19223
  const namespace = namespaceForKey(namespacePrefix);
18935
19224
  const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
18936
- const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
18937
- unit.create.push(tplOp);
18938
- ingestBindings(unit, tplOp, tmpl);
18939
- ingestReferences(tplOp, tmpl);
19225
+ const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
19226
+ const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
19227
+ unit.create.push(templateOp);
19228
+ ingestBindings(unit, templateOp, tmpl);
19229
+ ingestReferences(templateOp, tmpl);
18940
19230
  ingestNodes(childView, tmpl.children);
18941
19231
  for (const { name, value } of tmpl.variables) {
18942
19232
  childView.contextVariables.set(name, value !== "" ? value : "$implicit");
18943
19233
  }
18944
- if (isPlainTemplate(tmpl) && tmpl.i18n instanceof Message) {
19234
+ if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) {
18945
19235
  const id = unit.job.allocateXrefId();
18946
19236
  OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
18947
19237
  OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
18948
19238
  }
18949
19239
  }
18950
19240
  function ingestContent(unit, content) {
18951
- const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.sourceSpan);
19241
+ if (content.i18n !== void 0 && !(content.i18n instanceof TagPlaceholder)) {
19242
+ throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
19243
+ }
19244
+ const attrs = content.attributes.flatMap((a) => [a.name, a.value]);
19245
+ const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, attrs, content.sourceSpan);
18952
19246
  for (const attr of content.attributes) {
18953
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
19247
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
18954
19248
  }
18955
19249
  unit.create.push(op);
18956
19250
  }
@@ -18978,9 +19272,10 @@ function ingestBoundText(unit, text2, i18nPlaceholders) {
18978
19272
  const textXref = unit.job.allocateXrefId();
18979
19273
  unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
18980
19274
  const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
18981
- unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan))), i18nPlaceholders, text2.sourceSpan));
19275
+ unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text2.sourceSpan));
18982
19276
  }
18983
19277
  function ingestIfBlock(unit, ifBlock) {
19278
+ var _a2;
18984
19279
  let firstXref = null;
18985
19280
  let firstSlotHandle = null;
18986
19281
  let conditions = [];
@@ -18994,14 +19289,21 @@ function ingestIfBlock(unit, ifBlock) {
18994
19289
  if (ifCase.expressionAlias !== null) {
18995
19290
  cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
18996
19291
  }
18997
- const tmplOp = createTemplateOp(cView.xref, tagName, "Conditional", Namespace.HTML, void 0, ifCase.sourceSpan);
18998
- unit.create.push(tmplOp);
19292
+ let ifCaseI18nMeta = void 0;
19293
+ if (ifCase.i18n !== void 0) {
19294
+ if (!(ifCase.i18n instanceof BlockPlaceholder)) {
19295
+ throw Error(`Unhandled i18n metadata type for if block: ${(_a2 = ifCase.i18n) == null ? void 0 : _a2.constructor.name}`);
19296
+ }
19297
+ ifCaseI18nMeta = ifCase.i18n;
19298
+ }
19299
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.sourceSpan);
19300
+ unit.create.push(templateOp);
18999
19301
  if (firstXref === null) {
19000
19302
  firstXref = cView.xref;
19001
- firstSlotHandle = tmplOp.handle;
19303
+ firstSlotHandle = templateOp.handle;
19002
19304
  }
19003
19305
  const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
19004
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle, ifCase.expressionAlias);
19306
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias);
19005
19307
  conditions.push(conditionalCaseExpr);
19006
19308
  ingestNodes(cView, ifCase.children);
19007
19309
  }
@@ -19009,19 +19311,27 @@ function ingestIfBlock(unit, ifBlock) {
19009
19311
  unit.update.push(conditional2);
19010
19312
  }
19011
19313
  function ingestSwitchBlock(unit, switchBlock) {
19314
+ var _a2;
19012
19315
  let firstXref = null;
19013
19316
  let firstSlotHandle = null;
19014
19317
  let conditions = [];
19015
19318
  for (const switchCase of switchBlock.cases) {
19016
19319
  const cView = unit.job.allocateView(unit.xref);
19017
- const tmplOp = createTemplateOp(cView.xref, null, "Case", Namespace.HTML, void 0, switchCase.sourceSpan);
19018
- unit.create.push(tmplOp);
19320
+ let switchCaseI18nMeta = void 0;
19321
+ if (switchCase.i18n !== void 0) {
19322
+ if (!(switchCase.i18n instanceof BlockPlaceholder)) {
19323
+ throw Error(`Unhandled i18n metadata type for switch block: ${(_a2 = switchCase.i18n) == null ? void 0 : _a2.constructor.name}`);
19324
+ }
19325
+ switchCaseI18nMeta = switchCase.i18n;
19326
+ }
19327
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.sourceSpan);
19328
+ unit.create.push(templateOp);
19019
19329
  if (firstXref === null) {
19020
19330
  firstXref = cView.xref;
19021
- firstSlotHandle = tmplOp.handle;
19331
+ firstSlotHandle = templateOp.handle;
19022
19332
  }
19023
19333
  const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
19024
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle);
19334
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle);
19025
19335
  conditions.push(conditionalCaseExpr);
19026
19336
  ingestNodes(cView, switchCase.children);
19027
19337
  }
@@ -19034,7 +19344,7 @@ function ingestDeferView(unit, suffix, children, sourceSpan) {
19034
19344
  }
19035
19345
  const secondaryView = unit.job.allocateView(unit.xref);
19036
19346
  ingestNodes(secondaryView, children);
19037
- const templateOp = createTemplateOp(secondaryView.xref, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
19347
+ const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
19038
19348
  unit.create.push(templateOp);
19039
19349
  return templateOp;
19040
19350
  }
@@ -19120,17 +19430,12 @@ function ingestDeferBlock(unit, deferBlock) {
19120
19430
  unit.update.push(deferWhenOps);
19121
19431
  }
19122
19432
  function ingestIcu(unit, icu) {
19123
- var _a2, _b2;
19433
+ var _a2;
19124
19434
  if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
19125
19435
  const xref = unit.job.allocateXrefId();
19126
19436
  const icuNode = icu.i18n.nodes[0];
19127
19437
  unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
19128
- const expressionPlaceholder = (_a2 = icuNode.expressionPlaceholder) == null ? void 0 : _a2.trimEnd();
19129
- if (expressionPlaceholder === void 0 || icu.vars[expressionPlaceholder] === void 0) {
19130
- throw Error("ICU should have a text binding");
19131
- }
19132
- ingestBoundText(unit, icu.vars[expressionPlaceholder], [expressionPlaceholder]);
19133
- for (const [placeholder, text2] of Object.entries(icu.placeholders)) {
19438
+ for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
19134
19439
  if (text2 instanceof BoundText) {
19135
19440
  ingestBoundText(unit, text2, [placeholder]);
19136
19441
  } else {
@@ -19139,7 +19444,7 @@ function ingestIcu(unit, icu) {
19139
19444
  }
19140
19445
  unit.create.push(createIcuEndOp(xref));
19141
19446
  } else {
19142
- throw Error(`Unhandled i18n metadata type for ICU: ${(_b2 = icu.i18n) == null ? void 0 : _b2.constructor.name}`);
19447
+ throw Error(`Unhandled i18n metadata type for ICU: ${(_a2 = icu.i18n) == null ? void 0 : _a2.constructor.name}`);
19143
19448
  }
19144
19449
  }
19145
19450
  function ingestForBlock(unit, forBlock) {
@@ -19214,6 +19519,15 @@ function convertAst(ast, job, baseSourceSpan) {
19214
19519
  }
19215
19520
  } else if (ast instanceof LiteralPrimitive) {
19216
19521
  return literal(ast.value, void 0, convertSourceSpan(ast.span, baseSourceSpan));
19522
+ } else if (ast instanceof Unary) {
19523
+ switch (ast.operator) {
19524
+ case "+":
19525
+ return new UnaryOperatorExpr(UnaryOperator.Plus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
19526
+ case "-":
19527
+ return new UnaryOperatorExpr(UnaryOperator.Minus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
19528
+ default:
19529
+ throw new Error(`AssertionError: unknown unary operator ${ast.operator}`);
19530
+ }
19217
19531
  } else if (ast instanceof Binary) {
19218
19532
  const operator = BINARY_OPERATORS.get(ast.operation);
19219
19533
  if (operator === void 0) {
@@ -19251,6 +19565,8 @@ function convertAst(ast, job, baseSourceSpan) {
19251
19565
  return new SafeInvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map((a) => convertAst(a, job, baseSourceSpan)));
19252
19566
  } else if (ast instanceof EmptyExpr) {
19253
19567
  return new EmptyExpr2(convertSourceSpan(ast.span, baseSourceSpan));
19568
+ } else if (ast instanceof PrefixNot) {
19569
+ return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
19254
19570
  } else {
19255
19571
  throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan == null ? void 0 : baseSourceSpan.start.file.url}"`);
19256
19572
  }
@@ -19261,6 +19577,7 @@ function isPlainTemplate(tmpl) {
19261
19577
  }
19262
19578
  function ingestBindings(unit, op, element2) {
19263
19579
  let flags = BindingFlags.None;
19580
+ let hasI18nAttributes = false;
19264
19581
  if (element2 instanceof Template) {
19265
19582
  flags |= BindingFlags.OnNgTemplateElement;
19266
19583
  if (element2 instanceof Template && isPlainTemplate(element2)) {
@@ -19269,17 +19586,21 @@ function ingestBindings(unit, op, element2) {
19269
19586
  const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
19270
19587
  for (const attr of element2.templateAttrs) {
19271
19588
  if (attr instanceof TextAttribute) {
19272
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue);
19589
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue, attr.i18n);
19590
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19273
19591
  } else {
19274
- ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags);
19592
+ ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags, attr.i18n);
19593
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19275
19594
  }
19276
19595
  }
19277
19596
  }
19278
19597
  for (const attr of element2.attributes) {
19279
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue);
19598
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue, attr.i18n);
19599
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19280
19600
  }
19281
19601
  for (const input of element2.inputs) {
19282
- ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags);
19602
+ ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags, input.i18n);
19603
+ hasI18nAttributes || (hasI18nAttributes = input.i18n !== void 0);
19283
19604
  }
19284
19605
  for (const output of element2.outputs) {
19285
19606
  let listenerOp;
@@ -19289,7 +19610,7 @@ function ingestBindings(unit, op, element2) {
19289
19610
  }
19290
19611
  }
19291
19612
  if (element2 instanceof Template && !isPlainTemplate(element2)) {
19292
- unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null));
19613
+ unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null));
19293
19614
  continue;
19294
19615
  }
19295
19616
  listenerOp = createListenerOp(op.xref, op.handle, output.name, op.tag, output.phase, false, output.sourceSpan);
@@ -19315,6 +19636,9 @@ function ingestBindings(unit, op, element2) {
19315
19636
  listenerOp.handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
19316
19637
  unit.create.push(listenerOp);
19317
19638
  }
19639
+ if (hasI18nAttributes) {
19640
+ unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
19641
+ }
19318
19642
  }
19319
19643
  var BINDING_KINDS = /* @__PURE__ */ new Map([
19320
19644
  [0, BindingKind.Property],
@@ -19331,24 +19655,36 @@ var BindingFlags;
19331
19655
  BindingFlags2[BindingFlags2["IsStructuralTemplateAttribute"] = 4] = "IsStructuralTemplateAttribute";
19332
19656
  BindingFlags2[BindingFlags2["OnNgTemplateElement"] = 8] = "OnNgTemplateElement";
19333
19657
  })(BindingFlags || (BindingFlags = {}));
19334
- function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags) {
19658
+ function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags, i18nMeta) {
19335
19659
  if (value instanceof ASTWithSource) {
19336
19660
  value = value.ast;
19337
19661
  }
19662
+ let i18nContext = null;
19663
+ if (i18nMeta !== void 0) {
19664
+ if (!(i18nMeta instanceof Message)) {
19665
+ throw Error(`Unhandled i18n metadata type for binding: ${i18nMeta.constructor.name}`);
19666
+ }
19667
+ i18nContext = view.job.allocateXrefId();
19668
+ view.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, i18nMeta, null));
19669
+ }
19338
19670
  if (flags & BindingFlags.OnNgTemplateElement && !(flags & BindingFlags.BindingTargetsTemplate) && type === 0) {
19339
- view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null));
19671
+ view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null, i18nContext));
19340
19672
  return;
19341
19673
  }
19342
19674
  let expression;
19343
19675
  if (value instanceof Interpolation) {
19344
- expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)));
19676
+ let i18nPlaceholders = [];
19677
+ if (i18nMeta !== void 0) {
19678
+ i18nPlaceholders = Object.keys(i18nMeta.placeholders);
19679
+ }
19680
+ expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)), i18nPlaceholders);
19345
19681
  } else if (value instanceof AST) {
19346
19682
  expression = convertAst(value, view.job, null);
19347
19683
  } else {
19348
19684
  expression = value;
19349
19685
  }
19350
19686
  const kind = BINDING_KINDS.get(type);
19351
- view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), sourceSpan));
19687
+ view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), i18nContext, sourceSpan));
19352
19688
  }
19353
19689
  function ingestReferences(op, element2) {
19354
19690
  assertIsArray(op.localRefs);
@@ -19388,7 +19724,7 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19388
19724
  }
19389
19725
  if (root !== null) {
19390
19726
  for (const attr of root.attributes) {
19391
- ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
19727
+ ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
19392
19728
  }
19393
19729
  const tagName = root instanceof Element ? root.name : root.tagName;
19394
19730
  return tagName === "ng-template" ? null : tagName;
@@ -19396,10 +19732,10 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19396
19732
  return null;
19397
19733
  }
19398
19734
 
19399
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19735
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19400
19736
  var USE_TEMPLATE_PIPELINE = false;
19401
19737
 
19402
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19403
19739
  var IMPORTANT_FLAG = "!important";
19404
19740
  var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
19405
19741
  var StylingBuilder = class {
@@ -19732,7 +20068,7 @@ function isEmptyExpression(ast) {
19732
20068
  return ast instanceof EmptyExpr;
19733
20069
  }
19734
20070
 
19735
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20071
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19736
20072
  var HtmlParser = class extends Parser2 {
19737
20073
  constructor() {
19738
20074
  super(getHtmlTagDefinition);
@@ -19742,7 +20078,7 @@ var HtmlParser = class extends Parser2 {
19742
20078
  }
19743
20079
  };
19744
20080
 
19745
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20081
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19746
20082
  var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
19747
20083
  var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
19748
20084
  var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
@@ -19808,7 +20144,7 @@ function visitAllWithSiblings(visitor, nodes) {
19808
20144
  return result;
19809
20145
  }
19810
20146
 
19811
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20147
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19812
20148
  var PROPERTY_PARTS_SEPARATOR = ".";
19813
20149
  var ATTRIBUTE_PREFIX = "attr";
19814
20150
  var CLASS_PREFIX = "class";
@@ -20128,7 +20464,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
20128
20464
  return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
20129
20465
  }
20130
20466
 
20131
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20132
20468
  function isStyleUrlResolvable(url) {
20133
20469
  if (url == null || url.length === 0 || url[0] == "/")
20134
20470
  return false;
@@ -20137,7 +20473,7 @@ function isStyleUrlResolvable(url) {
20137
20473
  }
20138
20474
  var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
20139
20475
 
20140
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20476
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20141
20477
  var NG_CONTENT_SELECT_ATTR = "select";
20142
20478
  var LINK_ELEMENT = "link";
20143
20479
  var LINK_STYLE_REL_ATTR = "rel";
@@ -20207,7 +20543,7 @@ function normalizeNgContentSelect(selectAttr) {
20207
20543
  return selectAttr;
20208
20544
  }
20209
20545
 
20210
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20546
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20211
20547
  var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
20212
20548
  var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
20213
20549
  var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
@@ -20498,7 +20834,7 @@ function stripOptionalParentheses(param, errors) {
20498
20834
  return expression.slice(start, end);
20499
20835
  }
20500
20836
 
20501
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20837
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20502
20838
  var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
20503
20839
  var SEPARATOR_PATTERN = /^\s$/;
20504
20840
  var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
@@ -20762,7 +21098,7 @@ function parseDeferredTime(value) {
20762
21098
  return parseFloat(time) * (units === "s" ? 1e3 : 1);
20763
21099
  }
20764
21100
 
20765
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
21101
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20766
21102
  var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
20767
21103
  var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
20768
21104
  var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
@@ -20897,7 +21233,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
20897
21233
  return { triggers, prefetchTriggers };
20898
21234
  }
20899
21235
 
20900
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
21236
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20901
21237
  var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
20902
21238
  var KW_BIND_IDX = 1;
20903
21239
  var KW_LET_IDX = 2;
@@ -21328,7 +21664,7 @@ function textContents(node) {
21328
21664
  }
21329
21665
  }
21330
21666
 
21331
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21667
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21332
21668
  var TagType;
21333
21669
  (function(TagType2) {
21334
21670
  TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
@@ -21473,7 +21809,7 @@ function serializePlaceholderValue(value) {
21473
21809
  }
21474
21810
  }
21475
21811
 
21476
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21812
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21477
21813
  var NG_CONTENT_SELECT_ATTR2 = "select";
21478
21814
  var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
21479
21815
  var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
@@ -23150,7 +23486,7 @@ function createClosureModeGuard2() {
23150
23486
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
23151
23487
  }
23152
23488
 
23153
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23489
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23154
23490
  var ATTR_REGEX = /attr\.([^\]]+)/;
23155
23491
  var COMPONENT_VARIABLE = "%COMP%";
23156
23492
  var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
@@ -23483,6 +23819,8 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23483
23819
  }
23484
23820
  return emitHostBindingFunction(hostJob);
23485
23821
  }
23822
+ let bindingId = 0;
23823
+ const getNextBindingId = () => `${bindingId++}`;
23486
23824
  const bindingContext = variable(CONTEXT_NAME);
23487
23825
  const styleBuilder = new StylingBuilder(bindingContext);
23488
23826
  const { styleAttr, classAttr } = hostBindingsMetadata.specialAttributes;
@@ -23532,7 +23870,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23532
23870
  const syntheticHostBindings = [];
23533
23871
  for (const binding of allOtherBindings) {
23534
23872
  const value = binding.expression.visit(getValueConverter());
23535
- const bindingExpr = bindingFn(bindingContext, value);
23873
+ const bindingExpr = bindingFn(bindingContext, value, getNextBindingId);
23536
23874
  const { bindingName, instruction, isAttribute } = getBindingNameAndInstruction(binding);
23537
23875
  const securityContexts = bindingParser.calcPossibleSecurityContexts(selector, bindingName, isAttribute).filter((context) => context !== SecurityContext.NONE);
23538
23876
  let sanitizerFn = null;
@@ -23577,9 +23915,11 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23577
23915
  styleBuilder.buildUpdateLevelInstructions(getValueConverter()).forEach((instruction) => {
23578
23916
  for (const call2 of instruction.calls) {
23579
23917
  totalHostVarsCount += Math.max(call2.allocateBindingSlots - MIN_STYLING_BINDING_SLOTS_REQUIRED, 0);
23918
+ const { params, stmts } = convertStylingCall(call2, bindingContext, bindingFn, getNextBindingId);
23919
+ updateVariables.push(...stmts);
23580
23920
  updateInstructions.push({
23581
23921
  reference: instruction.reference,
23582
- paramsOrFn: convertStylingCall(call2, bindingContext, bindingFn),
23922
+ paramsOrFn: params,
23583
23923
  span: null
23584
23924
  });
23585
23925
  }
@@ -23601,11 +23941,19 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23601
23941
  }
23602
23942
  return null;
23603
23943
  }
23604
- function bindingFn(implicit, value) {
23605
- return convertPropertyBinding(null, implicit, value, "b");
23944
+ function bindingFn(implicit, value, getNextBindingIdFn) {
23945
+ return convertPropertyBinding(null, implicit, value, getNextBindingIdFn());
23606
23946
  }
23607
- function convertStylingCall(call2, bindingContext, bindingFn2) {
23608
- return call2.params((value) => bindingFn2(bindingContext, value).currValExpr);
23947
+ function convertStylingCall(call2, bindingContext, bindingFn2, getNextBindingIdFn) {
23948
+ const stmts = [];
23949
+ const params = call2.params((value) => {
23950
+ const result = bindingFn2(bindingContext, value, getNextBindingIdFn);
23951
+ if (Array.isArray(result.stmts) && result.stmts.length > 0) {
23952
+ stmts.push(...result.stmts);
23953
+ }
23954
+ return result.currValExpr;
23955
+ });
23956
+ return { params, stmts };
23609
23957
  }
23610
23958
  function getBindingNameAndInstruction(binding) {
23611
23959
  let bindingName = binding.name;
@@ -23752,7 +24100,7 @@ function createHostDirectivesMappingArray(mapping) {
23752
24100
  return elements.length > 0 ? literalArr(elements) : null;
23753
24101
  }
23754
24102
 
23755
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
24103
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23756
24104
  var R3TargetBinder = class {
23757
24105
  constructor(directiveMatcher) {
23758
24106
  this.directiveMatcher = directiveMatcher;
@@ -24357,11 +24705,11 @@ function extractScopedNodeEntities(rootScope) {
24357
24705
  return templateEntities;
24358
24706
  }
24359
24707
 
24360
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24708
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24361
24709
  var ResourceLoader = class {
24362
24710
  };
24363
24711
 
24364
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24712
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24365
24713
  var CompilerFacadeImpl = class {
24366
24714
  constructor(jitEvaluator = new JitEvaluator()) {
24367
24715
  this.jitEvaluator = jitEvaluator;
@@ -24913,17 +25261,17 @@ function publishFacade(global) {
24913
25261
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
24914
25262
  }
24915
25263
 
24916
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
24917
- var VERSION2 = new Version("17.1.0-next.2");
25264
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
25265
+ var VERSION2 = new Version("17.1.0-next.3");
24918
25266
 
24919
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25267
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24920
25268
  var _VisitorMode;
24921
25269
  (function(_VisitorMode2) {
24922
25270
  _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
24923
25271
  _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
24924
25272
  })(_VisitorMode || (_VisitorMode = {}));
24925
25273
 
24926
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
25274
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24927
25275
  var XmlTagDefinition = class {
24928
25276
  constructor() {
24929
25277
  this.closedByParent = false;
@@ -24945,7 +25293,7 @@ var XmlTagDefinition = class {
24945
25293
  };
24946
25294
  var _TAG_DEFINITION = new XmlTagDefinition();
24947
25295
 
24948
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
25296
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24949
25297
  var FactoryTarget2;
24950
25298
  (function(FactoryTarget3) {
24951
25299
  FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
@@ -24955,10 +25303,10 @@ var FactoryTarget2;
24955
25303
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
24956
25304
  })(FactoryTarget2 || (FactoryTarget2 = {}));
24957
25305
 
24958
- // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler.mjs
25306
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
24959
25307
  publishFacade(_global);
24960
25308
 
24961
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
25309
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
24962
25310
  var ngtemplate = "ng-template";
24963
25311
  var boundngifelse = "[ngIfElse]";
24964
25312
  var boundngifthenelse = "[ngIfThenElse]";
@@ -25005,12 +25353,13 @@ var commonModulePipes = [
25005
25353
  "titlecase"
25006
25354
  ].map((name) => pipeMatchRegExpFor(name));
25007
25355
  var ElementToMigrate = class {
25008
- constructor(el, attr, elseAttr = void 0, thenAttr = void 0, forAttrs = void 0) {
25356
+ constructor(el, attr, elseAttr = void 0, thenAttr = void 0, forAttrs = void 0, aliasAttrs = void 0) {
25009
25357
  __publicField(this, "el");
25010
25358
  __publicField(this, "attr");
25011
25359
  __publicField(this, "elseAttr");
25012
25360
  __publicField(this, "thenAttr");
25013
25361
  __publicField(this, "forAttrs");
25362
+ __publicField(this, "aliasAttrs");
25014
25363
  __publicField(this, "nestCount", 0);
25015
25364
  __publicField(this, "hasLineBreaks", false);
25016
25365
  this.el = el;
@@ -25018,6 +25367,7 @@ var ElementToMigrate = class {
25018
25367
  this.elseAttr = elseAttr;
25019
25368
  this.thenAttr = thenAttr;
25020
25369
  this.forAttrs = forAttrs;
25370
+ this.aliasAttrs = aliasAttrs;
25021
25371
  }
25022
25372
  getCondition() {
25023
25373
  const chunks = this.attr.value.split(";");
@@ -25035,7 +25385,11 @@ var ElementToMigrate = class {
25035
25385
  getTemplateName(targetStr, secondStr) {
25036
25386
  const targetLocation = this.attr.value.indexOf(targetStr);
25037
25387
  const secondTargetLocation = secondStr ? this.attr.value.indexOf(secondStr) : void 0;
25038
- return this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation).replace(":", "").trim().split(";")[0].trim();
25388
+ let templateName = this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation);
25389
+ if (templateName.startsWith(":")) {
25390
+ templateName = templateName.slice(1).trim();
25391
+ }
25392
+ return templateName.split(";")[0].trim();
25039
25393
  }
25040
25394
  getValueEnd(offset) {
25041
25395
  return (this.attr.valueSpan ? this.attr.valueSpan.end.offset + 1 : this.attr.keySpan.end.offset) - offset;
@@ -25171,15 +25525,14 @@ var ElementCollector = class extends RecursiveVisitor {
25171
25525
  const elseAttr = el.attrs.find((x) => x.name === boundngifelse);
25172
25526
  const thenAttr = el.attrs.find((x) => x.name === boundngifthenelse || x.name === boundngifthen);
25173
25527
  const forAttrs = attr.name === nakedngfor ? this.getForAttrs(el) : void 0;
25174
- this.elements.push(new ElementToMigrate(el, attr, elseAttr, thenAttr, forAttrs));
25528
+ const aliasAttrs = this.getAliasAttrs(el);
25529
+ this.elements.push(new ElementToMigrate(el, attr, elseAttr, thenAttr, forAttrs, aliasAttrs));
25175
25530
  }
25176
25531
  }
25177
25532
  }
25178
25533
  super.visitElement(el, null);
25179
25534
  }
25180
25535
  getForAttrs(el) {
25181
- const aliases = /* @__PURE__ */ new Map();
25182
- let item = "";
25183
25536
  let trackBy = "";
25184
25537
  let forOf = "";
25185
25538
  for (const attr of el.attrs) {
@@ -25189,6 +25542,13 @@ var ElementCollector = class extends RecursiveVisitor {
25189
25542
  if (attr.name === "[ngForOf]") {
25190
25543
  forOf = attr.value;
25191
25544
  }
25545
+ }
25546
+ return { forOf, trackBy };
25547
+ }
25548
+ getAliasAttrs(el) {
25549
+ const aliases = /* @__PURE__ */ new Map();
25550
+ let item = "";
25551
+ for (const attr of el.attrs) {
25192
25552
  if (attr.name.startsWith("let-")) {
25193
25553
  if (attr.value === "") {
25194
25554
  item = attr.name.replace("let-", "");
@@ -25197,7 +25557,7 @@ var ElementCollector = class extends RecursiveVisitor {
25197
25557
  }
25198
25558
  }
25199
25559
  }
25200
- return { forOf, trackBy, item, aliases };
25560
+ return { item, aliases };
25201
25561
  }
25202
25562
  };
25203
25563
  var TemplateCollector = class extends RecursiveVisitor {
@@ -25229,7 +25589,7 @@ var TemplateCollector = class extends RecursiveVisitor {
25229
25589
  }
25230
25590
  };
25231
25591
 
25232
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25592
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25233
25593
  var import_path2 = require("path");
25234
25594
  var import_typescript5 = __toESM(require("typescript"), 1);
25235
25595
  var importRemovals = [
@@ -25281,9 +25641,7 @@ function updateImportClause(clause, removeCommonModule) {
25281
25641
  return clause;
25282
25642
  }
25283
25643
  function updateClassImports(propAssignment, removeCommonModule) {
25284
- const printer = import_typescript5.default.createPrinter({
25285
- removeComments: true
25286
- });
25644
+ const printer = import_typescript5.default.createPrinter();
25287
25645
  const importList = propAssignment.initializer;
25288
25646
  const removals = removeCommonModule ? importWithCommonRemovals : importRemovals;
25289
25647
  const elements = importList.elements.filter((el) => !removals.includes(el.getText()));
@@ -25413,7 +25771,7 @@ function getTemplates(template2) {
25413
25771
  visitAll2(visitor, parsed.rootNodes);
25414
25772
  for (let [key, tmpl] of visitor.templates) {
25415
25773
  const escapeKey = escapeRegExp(key.slice(1));
25416
- const regex = new RegExp(`[^a-zA-Z0-9-<']${escapeKey}\\W`, "gm");
25774
+ const regex = new RegExp(`[^a-zA-Z0-9-<(']${escapeKey}\\W`, "gm");
25417
25775
  const matches = template2.match(regex);
25418
25776
  tmpl.count = (_a2 = matches == null ? void 0 : matches.length) != null ? _a2 : 0;
25419
25777
  tmpl.generateContents(template2);
@@ -25422,6 +25780,13 @@ function getTemplates(template2) {
25422
25780
  }
25423
25781
  return /* @__PURE__ */ new Map();
25424
25782
  }
25783
+ function updateTemplates(template2, templates) {
25784
+ const updatedTemplates = getTemplates(template2);
25785
+ for (let [key, tmpl] of updatedTemplates) {
25786
+ templates.set(key, tmpl);
25787
+ }
25788
+ return templates;
25789
+ }
25425
25790
  function wrapIntoI18nContainer(i18nAttr, content) {
25426
25791
  const { start, middle, end } = generatei18nContainer(i18nAttr, content);
25427
25792
  return `${start}${middle}${end}`;
@@ -25434,8 +25799,8 @@ function processNgTemplates(template2) {
25434
25799
  try {
25435
25800
  const templates = getTemplates(template2);
25436
25801
  for (const [name, t] of templates) {
25437
- const replaceRegex = new RegExp(`${name}\\|`, "g");
25438
- const forRegex = new RegExp(`${name}\\#`, "g");
25802
+ const replaceRegex = new RegExp(`\u03B8${name.slice(1)}\\\u03B4`, "g");
25803
+ const forRegex = new RegExp(`\u03B8${name.slice(1)}\\\u03C6`, "g");
25439
25804
  const forMatches = [...template2.matchAll(forRegex)];
25440
25805
  const matches = [...forMatches, ...template2.matchAll(replaceRegex)];
25441
25806
  let safeToRemove = true;
@@ -25458,13 +25823,26 @@ function processNgTemplates(template2) {
25458
25823
  if (t.count === matches.length + 1 && safeToRemove) {
25459
25824
  template2 = template2.replace(t.contents, "");
25460
25825
  }
25826
+ updateTemplates(template2, templates);
25461
25827
  }
25462
25828
  }
25829
+ template2 = replaceRemainingPlaceholders(template2);
25463
25830
  return { migrated: template2, err: void 0 };
25464
25831
  } catch (err) {
25465
25832
  return { migrated: template2, err };
25466
25833
  }
25467
25834
  }
25835
+ function replaceRemainingPlaceholders(template2) {
25836
+ const replaceRegex = new RegExp(`\u03B8.*\u03B4`, "g");
25837
+ const placeholders = [...template2.matchAll(replaceRegex)];
25838
+ let migrated = template2;
25839
+ for (let ph of placeholders) {
25840
+ const placeholder = ph[0];
25841
+ const name = placeholder.slice(1, placeholder.length - 1);
25842
+ migrated = template2.replace(placeholder, `<ng-template [ngTemplateOutlet]="${name}"></ng-template>`);
25843
+ }
25844
+ return migrated;
25845
+ }
25468
25846
  function canRemoveCommonModule(template2) {
25469
25847
  const parsed = parseTemplate2(template2);
25470
25848
  let removeCommonModule = false;
@@ -25497,10 +25875,29 @@ function getOriginals(etm, tmpl, offset) {
25497
25875
  return { start, end: "", childLength: 0 };
25498
25876
  }
25499
25877
  function isI18nTemplate(etm, i18nAttr) {
25500
- return etm.el.name === "ng-template" && i18nAttr !== void 0 && (etm.el.attrs.length === 2 || etm.el.attrs.length === 3 && etm.elseAttr !== void 0);
25878
+ let attrCount = countAttributes(etm);
25879
+ const safeToRemove = etm.el.attrs.length === attrCount + (i18nAttr !== void 0 ? 1 : 0);
25880
+ return etm.el.name === "ng-template" && i18nAttr !== void 0 && safeToRemove;
25501
25881
  }
25502
25882
  function isRemovableContainer(etm) {
25503
- return (etm.el.name === "ng-container" || etm.el.name === "ng-template") && (etm.el.attrs.length === 1 || etm.forAttrs !== void 0 || etm.el.attrs.length === 2 && etm.elseAttr !== void 0 || etm.el.attrs.length === 3 && etm.elseAttr !== void 0 && etm.thenAttr !== void 0);
25883
+ let attrCount = countAttributes(etm);
25884
+ const safeToRemove = etm.el.attrs.length === attrCount;
25885
+ return (etm.el.name === "ng-container" || etm.el.name === "ng-template") && safeToRemove;
25886
+ }
25887
+ function countAttributes(etm) {
25888
+ var _a2, _b2, _c2, _d2, _e2;
25889
+ let attrCount = 1;
25890
+ if (etm.elseAttr !== void 0) {
25891
+ attrCount++;
25892
+ }
25893
+ if (etm.thenAttr !== void 0) {
25894
+ attrCount++;
25895
+ }
25896
+ attrCount += (_b2 = (_a2 = etm.aliasAttrs) == null ? void 0 : _a2.aliases.size) != null ? _b2 : 0;
25897
+ attrCount += ((_c2 = etm.aliasAttrs) == null ? void 0 : _c2.item) ? 1 : 0;
25898
+ attrCount += ((_d2 = etm.forAttrs) == null ? void 0 : _d2.trackBy) ? 1 : 0;
25899
+ attrCount += ((_e2 = etm.forAttrs) == null ? void 0 : _e2.forOf) ? 1 : 0;
25900
+ return attrCount;
25504
25901
  }
25505
25902
  function getMainBlock(etm, tmpl, offset) {
25506
25903
  const i18nAttr = etm.el.attrs.find((x) => x.name === "i18n");
@@ -25519,11 +25916,12 @@ function getMainBlock(etm, tmpl, offset) {
25519
25916
  const valEnd = etm.getValueEnd(offset);
25520
25917
  const { childStart, childEnd } = etm.hasChildren() ? etm.getChildSpan(offset) : { childStart: valEnd, childEnd: valEnd };
25521
25918
  let start = tmpl.slice(etm.start(offset), attrStart) + tmpl.slice(valEnd, childStart);
25919
+ const middle = tmpl.slice(childStart, childEnd);
25920
+ let end = tmpl.slice(childEnd, etm.end(offset));
25522
25921
  if (etm.shouldRemoveElseAttr()) {
25523
25922
  start = start.replace(etm.getElseAttrStr(), "");
25923
+ end = end.replace(etm.getElseAttrStr(), "");
25524
25924
  }
25525
- const middle = tmpl.slice(childStart, childEnd);
25526
- const end = tmpl.slice(childEnd, etm.end(offset));
25527
25925
  return { start, middle, end };
25528
25926
  }
25529
25927
  var selfClosingList = "input|br|img|base|wbr|area|col|embed|hr|link|meta|param|source|track";
@@ -25586,7 +25984,7 @@ function forEachClass(sourceFile, callback) {
25586
25984
  });
25587
25985
  }
25588
25986
 
25589
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
25987
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
25590
25988
  var boundcase = "[ngSwitchCase]";
25591
25989
  var switchcase = "*ngSwitchCase";
25592
25990
  var nakedcase = "ngSwitchCase";
@@ -25664,7 +26062,7 @@ function migrateNgSwitchDefault(etm, tmpl, offset) {
25664
26062
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25665
26063
  }
25666
26064
 
25667
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
26065
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
25668
26066
  var ngfor = "*ngFor";
25669
26067
  var nakedngfor2 = "ngFor";
25670
26068
  var fors = [
@@ -25738,7 +26136,7 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25738
26136
  trackBy = `${trackByFn}($index, ${loopVar})`;
25739
26137
  }
25740
26138
  if (part.startsWith("template:")) {
25741
- tmplPlaceholder = `#${part.split(":")[1].trim()}#`;
26139
+ tmplPlaceholder = `\u03B8${part.split(":")[1].trim()}\u03C6`;
25742
26140
  }
25743
26141
  if (part.match(aliasWithEqualRegexp)) {
25744
26142
  const aliasParts = part.split("=");
@@ -25778,9 +26176,10 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25778
26176
  }
25779
26177
  function migrateBoundNgFor(etm, tmpl, offset) {
25780
26178
  const forAttrs = etm.forAttrs;
25781
- const aliasMap = forAttrs.aliases;
26179
+ const aliasAttrs = etm.aliasAttrs;
26180
+ const aliasMap = aliasAttrs.aliases;
25782
26181
  const originals = getOriginals(etm, tmpl, offset);
25783
- const condition = `${forAttrs.item} of ${forAttrs.forOf}`;
26182
+ const condition = `${aliasAttrs.item} of ${forAttrs.forOf}`;
25784
26183
  const aliases = [];
25785
26184
  let aliasedIndex = "$index";
25786
26185
  for (const [key, val] of aliasMap) {
@@ -25790,9 +26189,9 @@ function migrateBoundNgFor(etm, tmpl, offset) {
25790
26189
  }
25791
26190
  }
25792
26191
  const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
25793
- let trackBy = forAttrs.item;
26192
+ let trackBy = aliasAttrs.item;
25794
26193
  if (forAttrs.trackBy !== "") {
25795
- trackBy = `${forAttrs.trackBy.trim()}(${aliasedIndex}, ${forAttrs.item})`;
26194
+ trackBy = `${forAttrs.trackBy.trim()}(${aliasedIndex}, ${aliasAttrs.item})`;
25796
26195
  }
25797
26196
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25798
26197
  const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {
@@ -25837,7 +26236,7 @@ function getNgForParts(expression) {
25837
26236
  return parts;
25838
26237
  }
25839
26238
 
25840
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
26239
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
25841
26240
  var ngif = "*ngIf";
25842
26241
  var boundngif = "[ngIf]";
25843
26242
  var nakedngif = "ngIf";
@@ -25876,20 +26275,32 @@ function migrateIf(template2) {
25876
26275
  return { migrated: result, errors, changed };
25877
26276
  }
25878
26277
  function migrateNgIf(etm, tmpl, offset) {
25879
- const matchThen = etm.attr.value.match(/;?\s*then/gm);
25880
- const matchElse = etm.attr.value.match(/;?\s*else/gm);
26278
+ const matchThen = etm.attr.value.match(/[^\w\d];?\s*then/gm);
26279
+ const matchElse = etm.attr.value.match(/[^\w\d];?\s*else/gm);
25881
26280
  if (etm.thenAttr !== void 0 || etm.elseAttr !== void 0) {
25882
26281
  return buildBoundIfElseBlock(etm, tmpl, offset);
25883
- } else if (matchThen && matchThen.length > 0) {
26282
+ } else if (matchThen && matchThen.length > 0 && matchElse && matchElse.length > 0) {
25884
26283
  return buildStandardIfThenElseBlock(etm, tmpl, matchThen[0], matchElse[0], offset);
26284
+ } else if (matchThen && matchThen.length > 0) {
26285
+ return buildStandardIfThenBlock(etm, tmpl, matchThen[0], offset);
25885
26286
  } else if (matchElse && matchElse.length > 0) {
25886
26287
  return buildStandardIfElseBlock(etm, tmpl, matchElse[0], offset);
25887
26288
  }
25888
26289
  return buildIfBlock(etm, tmpl, offset);
25889
26290
  }
25890
26291
  function buildIfBlock(etm, tmpl, offset) {
26292
+ const aliasAttrs = etm.aliasAttrs;
26293
+ const aliases = [...aliasAttrs.aliases.keys()];
26294
+ if (aliasAttrs.item) {
26295
+ aliases.push(aliasAttrs.item);
26296
+ }
25891
26297
  const lbString = etm.hasLineBreaks ? "\n" : "";
25892
- const condition = etm.attr.value.replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26298
+ let condition = etm.attr.value.replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26299
+ if (aliases.length > 1 || aliases.length === 1 && condition.indexOf("; as") > -1) {
26300
+ throw new Error("Found more than one alias on your ngIf. Remove one of them and re-run the migration.");
26301
+ } else if (aliases.length === 1) {
26302
+ condition += `; as ${aliases[0]}`;
26303
+ }
25893
26304
  const originals = getOriginals(etm, tmpl, offset);
25894
26305
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25895
26306
  const startBlock = `@if (${condition}) {${lbString}${start}`;
@@ -25902,14 +26313,24 @@ function buildIfBlock(etm, tmpl, offset) {
25902
26313
  }
25903
26314
  function buildStandardIfElseBlock(etm, tmpl, elseString, offset) {
25904
26315
  const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25905
- const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
26316
+ const elsePlaceholder = `\u03B8${etm.getTemplateName(elseString)}\u03B4`;
25906
26317
  return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
25907
26318
  }
25908
26319
  function buildBoundIfElseBlock(etm, tmpl, offset) {
25909
- const condition = etm.attr.value.replace(" as ", "; as ");
25910
- const elsePlaceholder = `#${etm.elseAttr.value}|`;
26320
+ const aliasAttrs = etm.aliasAttrs;
26321
+ const aliases = [...aliasAttrs.aliases.keys()];
26322
+ if (aliasAttrs.item) {
26323
+ aliases.push(aliasAttrs.item);
26324
+ }
26325
+ let condition = etm.attr.value.replace(" as ", "; as ");
26326
+ if (aliases.length > 1 || aliases.length === 1 && condition.indexOf("; as") > -1) {
26327
+ throw new Error("Found more than one alias on your ngIf. Remove one of them and re-run the migration.");
26328
+ } else if (aliases.length === 1) {
26329
+ condition += `; as ${aliases[0]}`;
26330
+ }
26331
+ const elsePlaceholder = `\u03B8${etm.elseAttr.value}\u03B4`;
25911
26332
  if (etm.thenAttr !== void 0) {
25912
- const thenPlaceholder = `#${etm.thenAttr.value}|`;
26333
+ const thenPlaceholder = `\u03B8${etm.thenAttr.value}\u03B4`;
25913
26334
  return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
25914
26335
  }
25915
26336
  return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
@@ -25931,10 +26352,15 @@ function buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset) {
25931
26352
  }
25932
26353
  function buildStandardIfThenElseBlock(etm, tmpl, thenString, elseString, offset) {
25933
26354
  const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25934
- const thenPlaceholder = `#${etm.getTemplateName(thenString, elseString)}|`;
25935
- const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
26355
+ const thenPlaceholder = `\u03B8${etm.getTemplateName(thenString, elseString)}\u03B4`;
26356
+ const elsePlaceholder = `\u03B8${etm.getTemplateName(elseString)}\u03B4`;
25936
26357
  return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
25937
26358
  }
26359
+ function buildStandardIfThenBlock(etm, tmpl, thenString, offset) {
26360
+ const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26361
+ const thenPlaceholder = `\u03B8${etm.getTemplateName(thenString)}\u03B4`;
26362
+ return buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset);
26363
+ }
25938
26364
  function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset) {
25939
26365
  const lbString = etm.hasLineBreaks ? "\n" : "";
25940
26366
  const originals = getOriginals(etm, tmpl, offset);
@@ -25949,8 +26375,21 @@ function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceho
25949
26375
  const post = originals.end.length - postBlock.length;
25950
26376
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25951
26377
  }
26378
+ function buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset) {
26379
+ const lbString = etm.hasLineBreaks ? "\n" : "";
26380
+ const originals = getOriginals(etm, tmpl, offset);
26381
+ const startBlock = `@if (${condition}) {${lbString}`;
26382
+ const postBlock = thenPlaceholder + `${lbString}}`;
26383
+ const ifThenBlock = startBlock + postBlock;
26384
+ const tmplStart = tmpl.slice(0, etm.start(offset));
26385
+ const tmplEnd = tmpl.slice(etm.end(offset));
26386
+ const updatedTmpl = tmplStart + ifThenBlock + tmplEnd;
26387
+ const pre = originals.start.length + originals.childLength - startBlock.length;
26388
+ const post = originals.end.length - postBlock.length;
26389
+ return { tmpl: updatedTmpl, offsets: { pre, post } };
26390
+ }
25952
26391
 
25953
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
26392
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
25954
26393
  var ngswitch = "[ngSwitch]";
25955
26394
  var switches = [
25956
26395
  ngswitch
@@ -26000,7 +26439,7 @@ function migrateNgSwitch(etm, tmpl, offset) {
26000
26439
  return { tmpl: updatedTmpl, offsets: { pre, post } };
26001
26440
  }
26002
26441
 
26003
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
26442
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
26004
26443
  function migrateTemplate(template2, templateType, node, file, format = true, analyzedFiles) {
26005
26444
  let errors = [];
26006
26445
  let migrated = template2;
@@ -26035,7 +26474,7 @@ function migrateTemplate(template2, templateType, node, file, format = true, ana
26035
26474
  return { migrated, errors };
26036
26475
  }
26037
26476
 
26038
- // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
26477
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
26039
26478
  function control_flow_migration_default(options) {
26040
26479
  return (tree, context) => __async(this, null, function* () {
26041
26480
  const basePath = process.cwd();