@angular/core 17.0.6 → 17.0.7
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.
- package/esm2022/primitives/signals/src/signal.mjs +2 -9
- package/esm2022/src/application/application_config.mjs +21 -0
- package/esm2022/src/application/application_init.mjs +188 -0
- package/esm2022/src/application/application_module.mjs +29 -0
- package/esm2022/src/application/application_ref.mjs +509 -0
- package/esm2022/src/application/application_tokens.mjs +121 -0
- package/esm2022/src/application/create_application.mjs +102 -0
- package/esm2022/src/change_detection/scheduling.mjs +103 -0
- package/esm2022/src/core.mjs +10 -7
- package/esm2022/src/core_private_export.mjs +5 -3
- package/esm2022/src/core_reactivity_export_internal.mjs +2 -2
- package/esm2022/src/core_render3_private_export.mjs +2 -2
- package/esm2022/src/error_handler.mjs +15 -1
- package/esm2022/src/hydration/annotate.mjs +1 -1
- package/esm2022/src/hydration/api.mjs +2 -2
- package/esm2022/src/hydration/cleanup.mjs +1 -1
- package/esm2022/src/image_performance_warning.mjs +2 -2
- package/esm2022/src/linker/query_list.mjs +8 -6
- package/esm2022/src/metadata/do_bootstrap.mjs +1 -1
- package/esm2022/src/platform/platform.mjs +135 -0
- package/esm2022/src/platform/platform_core_providers.mjs +15 -0
- package/esm2022/src/platform/platform_ref.mjs +179 -0
- package/esm2022/src/render3/instructions/change_detection.mjs +2 -4
- package/esm2022/src/render3/list_reconciliation.mjs +58 -24
- package/esm2022/src/render3/util/change_detection_utils.mjs +3 -1
- package/esm2022/src/render3/util/misc_utils.mjs +2 -2
- package/esm2022/src/render3/view_ref.mjs +7 -1
- package/esm2022/src/transfer_state.mjs +2 -2
- package/esm2022/src/util/performance.mjs +2 -2
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/src/zone/ng_zone.mjs +10 -1
- package/esm2022/testing/src/component_fixture.mjs +20 -36
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed.mjs +5 -6
- package/fesm2022/core.mjs +1305 -1272
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +2 -9
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +46 -64
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +13 -14
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +627 -476
- package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
- package/schematics/migrations/compiler-options/bundle.js +13 -13
- package/schematics/migrations/transfer-state/bundle.js +13 -13
- package/schematics/ng-generate/control-flow-migration/bundle.js +783 -528
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
- package/schematics/ng-generate/standalone-migration/bundle.js +932 -758
- package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
- package/testing/index.d.ts +6 -10
- package/esm2022/src/application_config.mjs +0 -21
- package/esm2022/src/application_init.mjs +0 -188
- package/esm2022/src/application_module.mjs +0 -29
- package/esm2022/src/application_ref.mjs +0 -997
- package/esm2022/src/application_tokens.mjs +0 -121
- package/esm2022/src/platform_core_providers.mjs +0 -15
|
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
// bazel-out/
|
|
66
|
+
// bazel-out/darwin_arm64-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/
|
|
75
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
|
|
76
76
|
var import_typescript2 = __toESM(require("typescript"), 1);
|
|
77
77
|
|
|
78
|
-
// bazel-out/
|
|
78
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
|
|
79
79
|
var import_typescript = __toESM(require("typescript"), 1);
|
|
80
80
|
|
|
81
|
-
// bazel-out/
|
|
81
|
+
// bazel-out/darwin_arm64-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/
|
|
86
|
+
// bazel-out/darwin_arm64-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/
|
|
90
|
+
// bazel-out/darwin_arm64-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/
|
|
107
|
+
// bazel-out/darwin_arm64-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/
|
|
140
|
+
// bazel-out/darwin_arm64-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/
|
|
448
|
+
// bazel-out/darwin_arm64-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/
|
|
510
|
+
// bazel-out/darwin_arm64-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/
|
|
750
|
+
// bazel-out/darwin_arm64-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/
|
|
1705
|
+
// bazel-out/darwin_arm64-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/
|
|
1888
|
+
// bazel-out/darwin_arm64-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/
|
|
2521
|
+
// bazel-out/darwin_arm64-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/
|
|
2609
|
+
// bazel-out/darwin_arm64-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/
|
|
2738
|
+
// bazel-out/darwin_arm64-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/
|
|
3223
|
+
// bazel-out/darwin_arm64-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/
|
|
3288
|
+
// bazel-out/darwin_arm64-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/
|
|
3433
|
+
// bazel-out/darwin_arm64-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/
|
|
3466
|
+
// bazel-out/darwin_arm64-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/
|
|
3847
|
+
// bazel-out/darwin_arm64-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/
|
|
4007
|
+
// bazel-out/darwin_arm64-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/
|
|
4035
|
+
// bazel-out/darwin_arm64-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/
|
|
4040
|
+
// bazel-out/darwin_arm64-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/
|
|
4142
|
+
// bazel-out/darwin_arm64-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/
|
|
4382
|
+
// bazel-out/darwin_arm64-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/
|
|
4467
|
+
// bazel-out/darwin_arm64-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/
|
|
4489
|
+
// bazel-out/darwin_arm64-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/
|
|
4506
|
+
// bazel-out/darwin_arm64-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/
|
|
4588
|
+
// bazel-out/darwin_arm64-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/
|
|
4735
|
+
// bazel-out/darwin_arm64-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/
|
|
4828
|
+
// bazel-out/darwin_arm64-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/
|
|
4866
|
+
// bazel-out/darwin_arm64-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/
|
|
4957
|
+
// bazel-out/darwin_arm64-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/
|
|
4974
|
+
// bazel-out/darwin_arm64-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/
|
|
4990
|
+
// bazel-out/darwin_arm64-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/
|
|
5131
|
+
// bazel-out/darwin_arm64-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/
|
|
5152
|
+
// bazel-out/darwin_arm64-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/
|
|
5160
|
+
// bazel-out/darwin_arm64-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/
|
|
5826
|
+
// bazel-out/darwin_arm64-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/
|
|
6467
|
+
// bazel-out/darwin_arm64-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/
|
|
6525
|
+
// bazel-out/darwin_arm64-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/
|
|
6996
|
+
// bazel-out/darwin_arm64-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";
|
|
@@ -7065,10 +7065,11 @@ var ExpressionKind;
|
|
|
7065
7065
|
ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
|
|
7066
7066
|
ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
|
|
7067
7067
|
ExpressionKind2[ExpressionKind2["SanitizerExpr"] = 20] = "SanitizerExpr";
|
|
7068
|
-
ExpressionKind2[ExpressionKind2["
|
|
7069
|
-
ExpressionKind2[ExpressionKind2["
|
|
7070
|
-
ExpressionKind2[ExpressionKind2["
|
|
7071
|
-
ExpressionKind2[ExpressionKind2["
|
|
7068
|
+
ExpressionKind2[ExpressionKind2["TrustedValueFnExpr"] = 21] = "TrustedValueFnExpr";
|
|
7069
|
+
ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 22] = "SlotLiteralExpr";
|
|
7070
|
+
ExpressionKind2[ExpressionKind2["ConditionalCase"] = 23] = "ConditionalCase";
|
|
7071
|
+
ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 24] = "DerivedRepeaterVar";
|
|
7072
|
+
ExpressionKind2[ExpressionKind2["ConstCollected"] = 25] = "ConstCollected";
|
|
7072
7073
|
})(ExpressionKind || (ExpressionKind = {}));
|
|
7073
7074
|
var VariableFlags;
|
|
7074
7075
|
(function(VariableFlags2) {
|
|
@@ -7087,15 +7088,6 @@ var CompatibilityMode;
|
|
|
7087
7088
|
CompatibilityMode2[CompatibilityMode2["Normal"] = 0] = "Normal";
|
|
7088
7089
|
CompatibilityMode2[CompatibilityMode2["TemplateDefinitionBuilder"] = 1] = "TemplateDefinitionBuilder";
|
|
7089
7090
|
})(CompatibilityMode || (CompatibilityMode = {}));
|
|
7090
|
-
var SanitizerFn;
|
|
7091
|
-
(function(SanitizerFn2) {
|
|
7092
|
-
SanitizerFn2[SanitizerFn2["Html"] = 0] = "Html";
|
|
7093
|
-
SanitizerFn2[SanitizerFn2["Script"] = 1] = "Script";
|
|
7094
|
-
SanitizerFn2[SanitizerFn2["Style"] = 2] = "Style";
|
|
7095
|
-
SanitizerFn2[SanitizerFn2["Url"] = 3] = "Url";
|
|
7096
|
-
SanitizerFn2[SanitizerFn2["ResourceUrl"] = 4] = "ResourceUrl";
|
|
7097
|
-
SanitizerFn2[SanitizerFn2["IframeAttribute"] = 5] = "IframeAttribute";
|
|
7098
|
-
})(SanitizerFn || (SanitizerFn = {}));
|
|
7099
7091
|
var DeferSecondaryKind;
|
|
7100
7092
|
(function(DeferSecondaryKind2) {
|
|
7101
7093
|
DeferSecondaryKind2[DeferSecondaryKind2["Loading"] = 0] = "Loading";
|
|
@@ -7166,7 +7158,7 @@ var TemplateKind;
|
|
|
7166
7158
|
TemplateKind2[TemplateKind2["Block"] = 2] = "Block";
|
|
7167
7159
|
})(TemplateKind || (TemplateKind = {}));
|
|
7168
7160
|
|
|
7169
|
-
// bazel-out/
|
|
7161
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
|
|
7170
7162
|
var ConsumesSlot = Symbol("ConsumesSlot");
|
|
7171
7163
|
var DependsOnSlotContext = Symbol("DependsOnSlotContext");
|
|
7172
7164
|
var ConsumesVarsTrait = Symbol("ConsumesVars");
|
|
@@ -7198,7 +7190,7 @@ function hasUsesVarOffsetTrait(expr) {
|
|
|
7198
7190
|
return expr[UsesVarOffset] === true;
|
|
7199
7191
|
}
|
|
7200
7192
|
|
|
7201
|
-
// bazel-out/
|
|
7193
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
|
|
7202
7194
|
function createStatementOp(statement) {
|
|
7203
7195
|
return __spreadValues({
|
|
7204
7196
|
kind: OpKind.Statement,
|
|
@@ -7220,7 +7212,7 @@ var NEW_OP = {
|
|
|
7220
7212
|
next: null
|
|
7221
7213
|
};
|
|
7222
7214
|
|
|
7223
|
-
// bazel-out/
|
|
7215
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
|
|
7224
7216
|
function createInterpolateTextOp(xref, interpolation, sourceSpan) {
|
|
7225
7217
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7226
7218
|
kind: OpKind.InterpolateText,
|
|
@@ -7239,7 +7231,7 @@ var Interpolation2 = class {
|
|
|
7239
7231
|
}
|
|
7240
7232
|
}
|
|
7241
7233
|
};
|
|
7242
|
-
function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute,
|
|
7234
|
+
function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
|
|
7243
7235
|
return __spreadValues({
|
|
7244
7236
|
kind: OpKind.Binding,
|
|
7245
7237
|
bindingKind: kind,
|
|
@@ -7249,12 +7241,14 @@ function createBindingOp(target, kind, name, expression, unit, securityContext,
|
|
|
7249
7241
|
unit,
|
|
7250
7242
|
securityContext,
|
|
7251
7243
|
isTextAttribute,
|
|
7252
|
-
|
|
7253
|
-
|
|
7244
|
+
isStructuralTemplateAttribute,
|
|
7245
|
+
templateKind,
|
|
7246
|
+
i18nContext: null,
|
|
7247
|
+
i18nMessage,
|
|
7254
7248
|
sourceSpan
|
|
7255
7249
|
}, NEW_OP);
|
|
7256
7250
|
}
|
|
7257
|
-
function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext,
|
|
7251
|
+
function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) {
|
|
7258
7252
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7259
7253
|
kind: OpKind.Property,
|
|
7260
7254
|
target,
|
|
@@ -7263,8 +7257,10 @@ function createPropertyOp(target, name, expression, isAnimationTrigger, security
|
|
|
7263
7257
|
isAnimationTrigger,
|
|
7264
7258
|
securityContext,
|
|
7265
7259
|
sanitizer: null,
|
|
7266
|
-
|
|
7260
|
+
isStructuralTemplateAttribute,
|
|
7261
|
+
templateKind,
|
|
7267
7262
|
i18nContext,
|
|
7263
|
+
i18nMessage,
|
|
7268
7264
|
sourceSpan
|
|
7269
7265
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
7270
7266
|
}
|
|
@@ -7303,7 +7299,7 @@ function createClassMapOp(xref, expression, sourceSpan) {
|
|
|
7303
7299
|
sourceSpan
|
|
7304
7300
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
7305
7301
|
}
|
|
7306
|
-
function createAttributeOp(target, name, expression, securityContext, isTextAttribute,
|
|
7302
|
+
function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
|
|
7307
7303
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7308
7304
|
kind: OpKind.Attribute,
|
|
7309
7305
|
target,
|
|
@@ -7312,8 +7308,10 @@ function createAttributeOp(target, name, expression, securityContext, isTextAttr
|
|
|
7312
7308
|
securityContext,
|
|
7313
7309
|
sanitizer: null,
|
|
7314
7310
|
isTextAttribute,
|
|
7315
|
-
|
|
7316
|
-
|
|
7311
|
+
isStructuralTemplateAttribute,
|
|
7312
|
+
templateKind,
|
|
7313
|
+
i18nContext: null,
|
|
7314
|
+
i18nMessage,
|
|
7317
7315
|
sourceSpan
|
|
7318
7316
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
7319
7317
|
}
|
|
@@ -7378,7 +7376,7 @@ function createI18nApplyOp(owner, handle, sourceSpan) {
|
|
|
7378
7376
|
}, NEW_OP);
|
|
7379
7377
|
}
|
|
7380
7378
|
|
|
7381
|
-
// bazel-out/
|
|
7379
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
|
|
7382
7380
|
var _a;
|
|
7383
7381
|
var _b;
|
|
7384
7382
|
var _c;
|
|
@@ -7909,26 +7907,6 @@ var ReadTemporaryExpr = class extends ExpressionBase {
|
|
|
7909
7907
|
return r;
|
|
7910
7908
|
}
|
|
7911
7909
|
};
|
|
7912
|
-
var SanitizerExpr = class extends ExpressionBase {
|
|
7913
|
-
constructor(fn2) {
|
|
7914
|
-
super();
|
|
7915
|
-
this.fn = fn2;
|
|
7916
|
-
this.kind = ExpressionKind.SanitizerExpr;
|
|
7917
|
-
}
|
|
7918
|
-
visitExpression(visitor, context) {
|
|
7919
|
-
}
|
|
7920
|
-
isEquivalent(e) {
|
|
7921
|
-
return e instanceof SanitizerExpr && e.fn === this.fn;
|
|
7922
|
-
}
|
|
7923
|
-
isConstant() {
|
|
7924
|
-
return true;
|
|
7925
|
-
}
|
|
7926
|
-
clone() {
|
|
7927
|
-
return new SanitizerExpr(this.fn);
|
|
7928
|
-
}
|
|
7929
|
-
transformInternalExpressions() {
|
|
7930
|
-
}
|
|
7931
|
-
};
|
|
7932
7910
|
var SlotLiteralExpr = class extends ExpressionBase {
|
|
7933
7911
|
constructor(slot) {
|
|
7934
7912
|
super();
|
|
@@ -8047,7 +8025,6 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
8047
8025
|
case OpKind.ClassProp:
|
|
8048
8026
|
case OpKind.ClassMap:
|
|
8049
8027
|
case OpKind.Binding:
|
|
8050
|
-
case OpKind.HostProperty:
|
|
8051
8028
|
if (op.expression instanceof Interpolation2) {
|
|
8052
8029
|
transformExpressionsInInterpolation(op.expression, transform2, flags);
|
|
8053
8030
|
} else {
|
|
@@ -8055,6 +8032,7 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
8055
8032
|
}
|
|
8056
8033
|
break;
|
|
8057
8034
|
case OpKind.Property:
|
|
8035
|
+
case OpKind.HostProperty:
|
|
8058
8036
|
case OpKind.Attribute:
|
|
8059
8037
|
if (op.expression instanceof Interpolation2) {
|
|
8060
8038
|
transformExpressionsInInterpolation(op.expression, transform2, flags);
|
|
@@ -8096,6 +8074,7 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
8096
8074
|
break;
|
|
8097
8075
|
case OpKind.ExtractedAttribute:
|
|
8098
8076
|
op.expression = op.expression && transformExpressionsInExpression(op.expression, transform2, flags);
|
|
8077
|
+
op.trustedValueFn = op.trustedValueFn && transformExpressionsInExpression(op.trustedValueFn, transform2, flags);
|
|
8099
8078
|
break;
|
|
8100
8079
|
case OpKind.RepeaterCreate:
|
|
8101
8080
|
op.track = transformExpressionsInExpression(op.track, transform2, flags);
|
|
@@ -8203,6 +8182,10 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
8203
8182
|
}
|
|
8204
8183
|
} else if (expr instanceof NotExpr) {
|
|
8205
8184
|
expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
|
|
8185
|
+
} else if (expr instanceof TaggedTemplateExpr) {
|
|
8186
|
+
expr.tag = transformExpressionsInExpression(expr.tag, transform2, flags);
|
|
8187
|
+
expr.template.expressions = expr.template.expressions.map((e) => transformExpressionsInExpression(e, transform2, flags));
|
|
8188
|
+
} else if (expr instanceof WrappedNodeExpr) {
|
|
8206
8189
|
} else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
|
|
8207
8190
|
} else {
|
|
8208
8191
|
throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
|
|
@@ -8234,7 +8217,7 @@ function isStringLiteral(expr) {
|
|
|
8234
8217
|
return expr instanceof LiteralExpr && typeof expr.value === "string";
|
|
8235
8218
|
}
|
|
8236
8219
|
|
|
8237
|
-
// bazel-out/
|
|
8220
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
|
|
8238
8221
|
var _OpList = class {
|
|
8239
8222
|
constructor() {
|
|
8240
8223
|
this.debugListId = _OpList.nextListId++;
|
|
@@ -8425,14 +8408,14 @@ var OpList = _OpList;
|
|
|
8425
8408
|
_OpList.nextListId = 0;
|
|
8426
8409
|
})();
|
|
8427
8410
|
|
|
8428
|
-
// bazel-out/
|
|
8411
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
|
|
8429
8412
|
var SlotHandle = class {
|
|
8430
8413
|
constructor() {
|
|
8431
8414
|
this.slot = null;
|
|
8432
8415
|
}
|
|
8433
8416
|
};
|
|
8434
8417
|
|
|
8435
|
-
// bazel-out/
|
|
8418
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
|
|
8436
8419
|
var elementContainerOpKinds = /* @__PURE__ */ new Set([
|
|
8437
8420
|
OpKind.Element,
|
|
8438
8421
|
OpKind.ElementStart,
|
|
@@ -8476,7 +8459,7 @@ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace
|
|
|
8476
8459
|
sourceSpan
|
|
8477
8460
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
8478
8461
|
}
|
|
8479
|
-
function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, sourceSpan) {
|
|
8462
|
+
function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, i18nPlaceholder, emptyI18nPlaceholder, sourceSpan) {
|
|
8480
8463
|
return __spreadProps(__spreadValues(__spreadValues({
|
|
8481
8464
|
kind: OpKind.RepeaterCreate,
|
|
8482
8465
|
attributes: null,
|
|
@@ -8494,6 +8477,8 @@ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, so
|
|
|
8494
8477
|
vars: null,
|
|
8495
8478
|
varNames,
|
|
8496
8479
|
usesComponentInstance: false,
|
|
8480
|
+
i18nPlaceholder,
|
|
8481
|
+
emptyI18nPlaceholder,
|
|
8497
8482
|
sourceSpan
|
|
8498
8483
|
}, TRAIT_CONSUMES_SLOT), NEW_OP), {
|
|
8499
8484
|
numSlotsUsed: emptyView === null ? 2 : 3
|
|
@@ -8527,7 +8512,9 @@ function createTextOp(xref, initialValue, sourceSpan) {
|
|
|
8527
8512
|
sourceSpan
|
|
8528
8513
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
8529
8514
|
}
|
|
8530
|
-
function createListenerOp(target, targetSlot, name, tag, animationPhase, hostListener, sourceSpan) {
|
|
8515
|
+
function createListenerOp(target, targetSlot, name, tag, handlerOps, animationPhase, eventTarget, hostListener, sourceSpan) {
|
|
8516
|
+
const handlerList = new OpList();
|
|
8517
|
+
handlerList.push(handlerOps);
|
|
8531
8518
|
return __spreadValues({
|
|
8532
8519
|
kind: OpKind.Listener,
|
|
8533
8520
|
target,
|
|
@@ -8535,11 +8522,12 @@ function createListenerOp(target, targetSlot, name, tag, animationPhase, hostLis
|
|
|
8535
8522
|
tag,
|
|
8536
8523
|
hostListener,
|
|
8537
8524
|
name,
|
|
8538
|
-
handlerOps:
|
|
8525
|
+
handlerOps: handlerList,
|
|
8539
8526
|
handlerFnName: null,
|
|
8540
8527
|
consumesDollarEvent: false,
|
|
8541
8528
|
isAnimationListener: animationPhase !== null,
|
|
8542
8529
|
animationPhase,
|
|
8530
|
+
eventTarget,
|
|
8543
8531
|
sourceSpan
|
|
8544
8532
|
}, NEW_OP);
|
|
8545
8533
|
}
|
|
@@ -8576,14 +8564,17 @@ function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceS
|
|
|
8576
8564
|
sourceSpan
|
|
8577
8565
|
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
8578
8566
|
}
|
|
8579
|
-
function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext) {
|
|
8567
|
+
function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext, i18nMessage, securityContext) {
|
|
8580
8568
|
return __spreadValues({
|
|
8581
8569
|
kind: OpKind.ExtractedAttribute,
|
|
8582
8570
|
target,
|
|
8583
8571
|
bindingKind,
|
|
8584
8572
|
name,
|
|
8585
8573
|
expression,
|
|
8586
|
-
i18nContext
|
|
8574
|
+
i18nContext,
|
|
8575
|
+
i18nMessage,
|
|
8576
|
+
securityContext,
|
|
8577
|
+
trustedValueFn: null
|
|
8587
8578
|
}, NEW_OP);
|
|
8588
8579
|
}
|
|
8589
8580
|
function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
|
|
@@ -8693,22 +8684,24 @@ function createI18nAttributesOp(xref, handle, target) {
|
|
|
8693
8684
|
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
8694
8685
|
}
|
|
8695
8686
|
|
|
8696
|
-
// bazel-out/
|
|
8697
|
-
function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, sourceSpan) {
|
|
8687
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
|
|
8688
|
+
function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, securityContext, sourceSpan) {
|
|
8698
8689
|
return __spreadValues(__spreadValues({
|
|
8699
8690
|
kind: OpKind.HostProperty,
|
|
8700
8691
|
name,
|
|
8701
8692
|
expression,
|
|
8702
8693
|
isAnimationTrigger,
|
|
8703
8694
|
i18nContext,
|
|
8695
|
+
securityContext,
|
|
8696
|
+
sanitizer: null,
|
|
8704
8697
|
sourceSpan
|
|
8705
8698
|
}, TRAIT_CONSUMES_VARS), NEW_OP);
|
|
8706
8699
|
}
|
|
8707
8700
|
|
|
8708
|
-
// bazel-out/
|
|
8701
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
|
|
8709
8702
|
var CTX_REF = "CTX_REF_MARKER";
|
|
8710
8703
|
|
|
8711
|
-
// bazel-out/
|
|
8704
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
|
|
8712
8705
|
var CompilationJobKind;
|
|
8713
8706
|
(function(CompilationJobKind2) {
|
|
8714
8707
|
CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
|
|
@@ -8815,7 +8808,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
|
|
|
8815
8808
|
}
|
|
8816
8809
|
};
|
|
8817
8810
|
|
|
8818
|
-
// bazel-out/
|
|
8811
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
|
|
8819
8812
|
function deleteAnyCasts(job) {
|
|
8820
8813
|
for (const unit of job.units) {
|
|
8821
8814
|
for (const op of unit.ops()) {
|
|
@@ -8833,7 +8826,7 @@ function removeAnys(e) {
|
|
|
8833
8826
|
return e;
|
|
8834
8827
|
}
|
|
8835
8828
|
|
|
8836
|
-
// bazel-out/
|
|
8829
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
|
|
8837
8830
|
function applyI18nExpressions(job) {
|
|
8838
8831
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
8839
8832
|
for (const unit of job.units) {
|
|
@@ -8876,62 +8869,52 @@ function needsApplication(i18nContexts, op) {
|
|
|
8876
8869
|
return false;
|
|
8877
8870
|
}
|
|
8878
8871
|
|
|
8879
|
-
// bazel-out/
|
|
8872
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
|
|
8880
8873
|
function assignI18nSlotDependencies(job) {
|
|
8881
|
-
const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
|
|
8882
|
-
let lastSlotConsumer = null;
|
|
8883
|
-
let currentI18nOp = null;
|
|
8884
8874
|
for (const unit of job.units) {
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8875
|
+
let updateOp = unit.update.head;
|
|
8876
|
+
let i18nExpressionsInProgress = [];
|
|
8877
|
+
let state = null;
|
|
8878
|
+
for (const createOp of unit.create) {
|
|
8879
|
+
if (createOp.kind === OpKind.I18nStart) {
|
|
8880
|
+
state = {
|
|
8881
|
+
blockXref: createOp.xref,
|
|
8882
|
+
lastSlotConsumer: createOp.xref
|
|
8883
|
+
};
|
|
8884
|
+
} else if (createOp.kind === OpKind.I18nEnd) {
|
|
8885
|
+
for (const op of i18nExpressionsInProgress) {
|
|
8886
|
+
op.target = state.lastSlotConsumer;
|
|
8887
|
+
OpList.insertBefore(op, updateOp);
|
|
8888
|
+
}
|
|
8889
|
+
i18nExpressionsInProgress.length = 0;
|
|
8890
|
+
state = null;
|
|
8888
8891
|
}
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
if (
|
|
8895
|
-
|
|
8892
|
+
if (hasConsumesSlotTrait(createOp)) {
|
|
8893
|
+
if (state !== null) {
|
|
8894
|
+
state.lastSlotConsumer = createOp.xref;
|
|
8895
|
+
}
|
|
8896
|
+
while (true) {
|
|
8897
|
+
if (updateOp.next === null) {
|
|
8898
|
+
break;
|
|
8896
8899
|
}
|
|
8897
|
-
if (
|
|
8898
|
-
|
|
8900
|
+
if (state !== null && updateOp.kind === OpKind.I18nExpression && updateOp.usage === I18nExpressionFor.I18nText && updateOp.i18nOwner === state.blockXref) {
|
|
8901
|
+
const opToRemove = updateOp;
|
|
8902
|
+
updateOp = updateOp.next;
|
|
8903
|
+
OpList.remove(opToRemove);
|
|
8904
|
+
i18nExpressionsInProgress.push(opToRemove);
|
|
8905
|
+
continue;
|
|
8899
8906
|
}
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
}
|
|
8905
|
-
let opsToMove = [];
|
|
8906
|
-
let moveAfterTarget = null;
|
|
8907
|
-
let previousTarget = null;
|
|
8908
|
-
for (const op of unit.update) {
|
|
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;
|
|
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");
|
|
8907
|
+
if (hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) {
|
|
8908
|
+
break;
|
|
8909
|
+
}
|
|
8910
|
+
updateOp = updateOp.next;
|
|
8923
8911
|
}
|
|
8924
|
-
op.target = target;
|
|
8925
|
-
moveAfterTarget = op.target;
|
|
8926
8912
|
}
|
|
8927
8913
|
}
|
|
8928
|
-
if (moveAfterTarget !== null) {
|
|
8929
|
-
unit.update.push(opsToMove);
|
|
8930
|
-
}
|
|
8931
8914
|
}
|
|
8932
8915
|
}
|
|
8933
8916
|
|
|
8934
|
-
// bazel-out/
|
|
8917
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
|
|
8935
8918
|
function createOpXrefMap(unit) {
|
|
8936
8919
|
const map = /* @__PURE__ */ new Map();
|
|
8937
8920
|
for (const op of unit.create) {
|
|
@@ -8943,7 +8926,7 @@ function createOpXrefMap(unit) {
|
|
|
8943
8926
|
return map;
|
|
8944
8927
|
}
|
|
8945
8928
|
|
|
8946
|
-
// bazel-out/
|
|
8929
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
|
|
8947
8930
|
function extractAttributes(job) {
|
|
8948
8931
|
for (const unit of job.units) {
|
|
8949
8932
|
const elements = createOpXrefMap(unit);
|
|
@@ -8955,25 +8938,52 @@ function extractAttributes(job) {
|
|
|
8955
8938
|
case OpKind.Property:
|
|
8956
8939
|
if (!op.isAnimationTrigger) {
|
|
8957
8940
|
let bindingKind;
|
|
8958
|
-
if (op.
|
|
8941
|
+
if (op.i18nMessage !== null && op.templateKind === null) {
|
|
8959
8942
|
bindingKind = BindingKind.I18n;
|
|
8960
|
-
} else if (op.
|
|
8943
|
+
} else if (op.isStructuralTemplateAttribute) {
|
|
8961
8944
|
bindingKind = BindingKind.Template;
|
|
8962
8945
|
} else {
|
|
8963
8946
|
bindingKind = BindingKind.Property;
|
|
8964
8947
|
}
|
|
8965
|
-
OpList.insertBefore(
|
|
8948
|
+
OpList.insertBefore(
|
|
8949
|
+
createExtractedAttributeOp(
|
|
8950
|
+
op.target,
|
|
8951
|
+
bindingKind,
|
|
8952
|
+
op.name,
|
|
8953
|
+
null,
|
|
8954
|
+
null,
|
|
8955
|
+
null,
|
|
8956
|
+
op.securityContext
|
|
8957
|
+
),
|
|
8958
|
+
lookupElement(elements, op.target)
|
|
8959
|
+
);
|
|
8966
8960
|
}
|
|
8967
8961
|
break;
|
|
8968
8962
|
case OpKind.StyleProp:
|
|
8969
8963
|
case OpKind.ClassProp:
|
|
8970
8964
|
if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr2) {
|
|
8971
|
-
OpList.insertBefore(createExtractedAttributeOp(
|
|
8965
|
+
OpList.insertBefore(createExtractedAttributeOp(
|
|
8966
|
+
op.target,
|
|
8967
|
+
BindingKind.Property,
|
|
8968
|
+
op.name,
|
|
8969
|
+
null,
|
|
8970
|
+
null,
|
|
8971
|
+
null,
|
|
8972
|
+
SecurityContext.STYLE
|
|
8973
|
+
), lookupElement(elements, op.target));
|
|
8972
8974
|
}
|
|
8973
8975
|
break;
|
|
8974
8976
|
case OpKind.Listener:
|
|
8975
8977
|
if (!op.isAnimationListener) {
|
|
8976
|
-
const extractedAttributeOp = createExtractedAttributeOp(
|
|
8978
|
+
const extractedAttributeOp = createExtractedAttributeOp(
|
|
8979
|
+
op.target,
|
|
8980
|
+
BindingKind.Property,
|
|
8981
|
+
op.name,
|
|
8982
|
+
null,
|
|
8983
|
+
null,
|
|
8984
|
+
null,
|
|
8985
|
+
SecurityContext.NONE
|
|
8986
|
+
);
|
|
8977
8987
|
if (job.kind === CompilationJobKind.Host) {
|
|
8978
8988
|
unit.create.push(extractedAttributeOp);
|
|
8979
8989
|
} else {
|
|
@@ -9007,7 +9017,7 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
9007
9017
|
}
|
|
9008
9018
|
}
|
|
9009
9019
|
if (extractable) {
|
|
9010
|
-
const extractedAttributeOp = createExtractedAttributeOp(op.target, op.
|
|
9020
|
+
const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplateAttribute ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext, op.i18nMessage, op.securityContext);
|
|
9011
9021
|
if (unit.job.kind === CompilationJobKind.Host) {
|
|
9012
9022
|
unit.create.push(extractedAttributeOp);
|
|
9013
9023
|
} else {
|
|
@@ -9018,7 +9028,7 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
9018
9028
|
}
|
|
9019
9029
|
}
|
|
9020
9030
|
|
|
9021
|
-
// bazel-out/
|
|
9031
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
|
|
9022
9032
|
function lookupElement2(elements, xref) {
|
|
9023
9033
|
const el = elements.get(xref);
|
|
9024
9034
|
if (el === void 0) {
|
|
@@ -9048,15 +9058,15 @@ function specializeBindings(job) {
|
|
|
9048
9058
|
const target = lookupElement2(elements, op.target);
|
|
9049
9059
|
target.nonBindable = true;
|
|
9050
9060
|
} else {
|
|
9051
|
-
OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.
|
|
9061
|
+
OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
|
|
9052
9062
|
}
|
|
9053
9063
|
break;
|
|
9054
9064
|
case BindingKind.Property:
|
|
9055
9065
|
case BindingKind.Animation:
|
|
9056
9066
|
if (job.kind === CompilationJobKind.Host) {
|
|
9057
|
-
OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.sourceSpan));
|
|
9067
|
+
OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.securityContext, op.sourceSpan));
|
|
9058
9068
|
} else {
|
|
9059
|
-
OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.
|
|
9069
|
+
OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan));
|
|
9060
9070
|
}
|
|
9061
9071
|
break;
|
|
9062
9072
|
case BindingKind.I18n:
|
|
@@ -9068,7 +9078,7 @@ function specializeBindings(job) {
|
|
|
9068
9078
|
}
|
|
9069
9079
|
}
|
|
9070
9080
|
|
|
9071
|
-
// bazel-out/
|
|
9081
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
|
|
9072
9082
|
var CHAINABLE = /* @__PURE__ */ new Set([
|
|
9073
9083
|
Identifiers.attribute,
|
|
9074
9084
|
Identifiers.classProp,
|
|
@@ -9134,7 +9144,7 @@ function chainOperationsInList(opList) {
|
|
|
9134
9144
|
}
|
|
9135
9145
|
}
|
|
9136
9146
|
|
|
9137
|
-
// bazel-out/
|
|
9147
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
|
|
9138
9148
|
function collapseSingletonInterpolations(job) {
|
|
9139
9149
|
for (const unit of job.units) {
|
|
9140
9150
|
for (const op of unit.update) {
|
|
@@ -9146,7 +9156,7 @@ function collapseSingletonInterpolations(job) {
|
|
|
9146
9156
|
}
|
|
9147
9157
|
}
|
|
9148
9158
|
|
|
9149
|
-
// bazel-out/
|
|
9159
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
|
|
9150
9160
|
function generateConditionalExpressions(job) {
|
|
9151
9161
|
for (const unit of job.units) {
|
|
9152
9162
|
for (const op of unit.ops()) {
|
|
@@ -9183,7 +9193,7 @@ function generateConditionalExpressions(job) {
|
|
|
9183
9193
|
}
|
|
9184
9194
|
}
|
|
9185
9195
|
|
|
9186
|
-
// bazel-out/
|
|
9196
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
|
|
9187
9197
|
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
9188
9198
|
["&&", BinaryOperator.And],
|
|
9189
9199
|
[">", BinaryOperator.Bigger],
|
|
@@ -9233,7 +9243,7 @@ function literalOrArrayLiteral(value) {
|
|
|
9233
9243
|
return literal(value);
|
|
9234
9244
|
}
|
|
9235
9245
|
|
|
9236
|
-
// bazel-out/
|
|
9246
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
|
|
9237
9247
|
function collectElementConsts(job) {
|
|
9238
9248
|
const allElementAttributes = /* @__PURE__ */ new Map();
|
|
9239
9249
|
for (const unit of job.units) {
|
|
@@ -9241,7 +9251,7 @@ function collectElementConsts(job) {
|
|
|
9241
9251
|
if (op.kind === OpKind.ExtractedAttribute) {
|
|
9242
9252
|
const attributes = allElementAttributes.get(op.target) || new ElementAttributes();
|
|
9243
9253
|
allElementAttributes.set(op.target, attributes);
|
|
9244
|
-
attributes.add(op.bindingKind, op.name, op.expression);
|
|
9254
|
+
attributes.add(op.bindingKind, op.name, op.expression, op.trustedValueFn);
|
|
9245
9255
|
OpList.remove(op);
|
|
9246
9256
|
}
|
|
9247
9257
|
}
|
|
@@ -9303,7 +9313,7 @@ var ElementAttributes = class {
|
|
|
9303
9313
|
var _a2;
|
|
9304
9314
|
return (_a2 = this.byKind.get(BindingKind.I18n)) != null ? _a2 : FLYWEIGHT_ARRAY;
|
|
9305
9315
|
}
|
|
9306
|
-
add(kind, name, value) {
|
|
9316
|
+
add(kind, name, value, trustedValueFn) {
|
|
9307
9317
|
var _a2;
|
|
9308
9318
|
if (this.known.has(name)) {
|
|
9309
9319
|
return;
|
|
@@ -9321,7 +9331,14 @@ var ElementAttributes = class {
|
|
|
9321
9331
|
if (value === null) {
|
|
9322
9332
|
throw Error("Attribute, i18n attribute, & style element attributes must have a value");
|
|
9323
9333
|
}
|
|
9324
|
-
|
|
9334
|
+
if (trustedValueFn !== null) {
|
|
9335
|
+
if (!isStringLiteral(value)) {
|
|
9336
|
+
throw Error("AssertionError: extracted attribute value should be string literal");
|
|
9337
|
+
}
|
|
9338
|
+
array.push(taggedTemplate(trustedValueFn, new TemplateLiteral([new TemplateLiteralElement(value.value)], []), void 0, value.sourceSpan));
|
|
9339
|
+
} else {
|
|
9340
|
+
array.push(value);
|
|
9341
|
+
}
|
|
9325
9342
|
}
|
|
9326
9343
|
}
|
|
9327
9344
|
arrayFor(kind) {
|
|
@@ -9367,7 +9384,7 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
|
|
|
9367
9384
|
return literalArr(attrArray);
|
|
9368
9385
|
}
|
|
9369
9386
|
|
|
9370
|
-
// bazel-out/
|
|
9387
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.mjs
|
|
9371
9388
|
function convertI18nBindings(job) {
|
|
9372
9389
|
const i18nAttributesByElem = /* @__PURE__ */ new Map();
|
|
9373
9390
|
for (const unit of job.units) {
|
|
@@ -9408,7 +9425,7 @@ function convertI18nBindings(job) {
|
|
|
9408
9425
|
}
|
|
9409
9426
|
}
|
|
9410
9427
|
|
|
9411
|
-
// bazel-out/
|
|
9428
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
|
|
9412
9429
|
function createDeferDepsFns(job) {
|
|
9413
9430
|
for (const unit of job.units) {
|
|
9414
9431
|
for (const op of unit.create) {
|
|
@@ -9436,11 +9453,12 @@ function createDeferDepsFns(job) {
|
|
|
9436
9453
|
}
|
|
9437
9454
|
}
|
|
9438
9455
|
|
|
9439
|
-
// bazel-out/
|
|
9456
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
|
|
9440
9457
|
function createI18nContexts(job) {
|
|
9441
9458
|
const rootContexts = /* @__PURE__ */ new Map();
|
|
9442
9459
|
let currentI18nOp = null;
|
|
9443
9460
|
let xref;
|
|
9461
|
+
const messageToContext = /* @__PURE__ */ new Map();
|
|
9444
9462
|
for (const unit of job.units) {
|
|
9445
9463
|
for (const op of unit.create) {
|
|
9446
9464
|
switch (op.kind) {
|
|
@@ -9470,6 +9488,24 @@ function createI18nContexts(job) {
|
|
|
9470
9488
|
break;
|
|
9471
9489
|
}
|
|
9472
9490
|
}
|
|
9491
|
+
for (const op of unit.ops()) {
|
|
9492
|
+
switch (op.kind) {
|
|
9493
|
+
case OpKind.Binding:
|
|
9494
|
+
case OpKind.Property:
|
|
9495
|
+
case OpKind.Attribute:
|
|
9496
|
+
case OpKind.ExtractedAttribute:
|
|
9497
|
+
if (!op.i18nMessage) {
|
|
9498
|
+
continue;
|
|
9499
|
+
}
|
|
9500
|
+
if (!messageToContext.has(op.i18nMessage)) {
|
|
9501
|
+
const i18nContext = job.allocateXrefId();
|
|
9502
|
+
unit.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, op.i18nMessage, null));
|
|
9503
|
+
messageToContext.set(op.i18nMessage, i18nContext);
|
|
9504
|
+
}
|
|
9505
|
+
op.i18nContext = messageToContext.get(op.i18nMessage);
|
|
9506
|
+
break;
|
|
9507
|
+
}
|
|
9508
|
+
}
|
|
9473
9509
|
}
|
|
9474
9510
|
for (const unit of job.units) {
|
|
9475
9511
|
for (const op of unit.create) {
|
|
@@ -9480,7 +9516,7 @@ function createI18nContexts(job) {
|
|
|
9480
9516
|
}
|
|
9481
9517
|
}
|
|
9482
9518
|
|
|
9483
|
-
// bazel-out/
|
|
9519
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
|
|
9484
9520
|
function configureDeferInstructions(job) {
|
|
9485
9521
|
for (const unit of job.units) {
|
|
9486
9522
|
for (const op of unit.create) {
|
|
@@ -9497,7 +9533,7 @@ function configureDeferInstructions(job) {
|
|
|
9497
9533
|
}
|
|
9498
9534
|
}
|
|
9499
9535
|
|
|
9500
|
-
// bazel-out/
|
|
9536
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
|
|
9501
9537
|
function resolveDeferTargetNames(job) {
|
|
9502
9538
|
const scopes = /* @__PURE__ */ new Map();
|
|
9503
9539
|
function getScopeForView2(view) {
|
|
@@ -9591,7 +9627,7 @@ var Scope = class {
|
|
|
9591
9627
|
}
|
|
9592
9628
|
};
|
|
9593
9629
|
|
|
9594
|
-
// bazel-out/
|
|
9630
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
|
|
9595
9631
|
var REPLACEMENTS = /* @__PURE__ */ new Map([
|
|
9596
9632
|
[OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
|
|
9597
9633
|
[OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
|
|
@@ -9618,7 +9654,7 @@ function collapseEmptyInstructions(job) {
|
|
|
9618
9654
|
}
|
|
9619
9655
|
}
|
|
9620
9656
|
|
|
9621
|
-
// bazel-out/
|
|
9657
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
|
|
9622
9658
|
function expandSafeReads(job) {
|
|
9623
9659
|
for (const unit of job.units) {
|
|
9624
9660
|
for (const op of unit.ops()) {
|
|
@@ -9754,7 +9790,7 @@ function ternaryTransform(e) {
|
|
|
9754
9790
|
return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
|
|
9755
9791
|
}
|
|
9756
9792
|
|
|
9757
|
-
// bazel-out/
|
|
9793
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
|
|
9758
9794
|
var ESCAPE = "\uFFFD";
|
|
9759
9795
|
var ELEMENT_MARKER = "#";
|
|
9760
9796
|
var TEMPLATE_MARKER = "*";
|
|
@@ -9893,7 +9929,7 @@ function formatValue(value) {
|
|
|
9893
9929
|
return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
|
|
9894
9930
|
}
|
|
9895
9931
|
|
|
9896
|
-
// bazel-out/
|
|
9932
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
|
|
9897
9933
|
function generateAdvance(job) {
|
|
9898
9934
|
for (const unit of job.units) {
|
|
9899
9935
|
const slotMap = /* @__PURE__ */ new Map();
|
|
@@ -9925,7 +9961,7 @@ function generateAdvance(job) {
|
|
|
9925
9961
|
}
|
|
9926
9962
|
}
|
|
9927
9963
|
|
|
9928
|
-
// bazel-out/
|
|
9964
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
|
|
9929
9965
|
function generateProjectionDefs(job) {
|
|
9930
9966
|
const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
|
|
9931
9967
|
const selectors = [];
|
|
@@ -9949,7 +9985,7 @@ function generateProjectionDefs(job) {
|
|
|
9949
9985
|
}
|
|
9950
9986
|
}
|
|
9951
9987
|
|
|
9952
|
-
// bazel-out/
|
|
9988
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
|
|
9953
9989
|
function generateVariables(job) {
|
|
9954
9990
|
recursivelyProcessView(job.root, null);
|
|
9955
9991
|
}
|
|
@@ -9958,8 +9994,13 @@ function recursivelyProcessView(view, parentScope) {
|
|
|
9958
9994
|
for (const op of view.create) {
|
|
9959
9995
|
switch (op.kind) {
|
|
9960
9996
|
case OpKind.Template:
|
|
9997
|
+
recursivelyProcessView(view.job.views.get(op.xref), scope);
|
|
9998
|
+
break;
|
|
9961
9999
|
case OpKind.RepeaterCreate:
|
|
9962
10000
|
recursivelyProcessView(view.job.views.get(op.xref), scope);
|
|
10001
|
+
if (op.emptyView) {
|
|
10002
|
+
recursivelyProcessView(view.job.views.get(op.emptyView), scope);
|
|
10003
|
+
}
|
|
9963
10004
|
break;
|
|
9964
10005
|
case OpKind.Listener:
|
|
9965
10006
|
op.handlerOps.prepend(generateVariablesInScopeForView(view, scope));
|
|
@@ -10037,7 +10078,7 @@ function generateVariablesInScopeForView(view, scope) {
|
|
|
10037
10078
|
return newOps;
|
|
10038
10079
|
}
|
|
10039
10080
|
|
|
10040
|
-
// bazel-out/
|
|
10081
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
|
|
10041
10082
|
function collectConstExpressions(job) {
|
|
10042
10083
|
for (const unit of job.units) {
|
|
10043
10084
|
for (const op of unit.ops()) {
|
|
@@ -10051,7 +10092,7 @@ function collectConstExpressions(job) {
|
|
|
10051
10092
|
}
|
|
10052
10093
|
}
|
|
10053
10094
|
|
|
10054
|
-
// bazel-out/
|
|
10095
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
|
|
10055
10096
|
var STYLE_DOT = "style.";
|
|
10056
10097
|
var CLASS_DOT = "class.";
|
|
10057
10098
|
var STYLE_BANG = "style!";
|
|
@@ -10109,7 +10150,7 @@ function parseProperty(name) {
|
|
|
10109
10150
|
return { property: property2, suffix };
|
|
10110
10151
|
}
|
|
10111
10152
|
|
|
10112
|
-
// bazel-out/
|
|
10153
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/map_util.mjs
|
|
10113
10154
|
function mapLiteral(obj, quoted = false) {
|
|
10114
10155
|
return literalMap(Object.keys(obj).map((key) => ({
|
|
10115
10156
|
key,
|
|
@@ -10118,7 +10159,7 @@ function mapLiteral(obj, quoted = false) {
|
|
|
10118
10159
|
})));
|
|
10119
10160
|
}
|
|
10120
10161
|
|
|
10121
|
-
// bazel-out/
|
|
10162
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
|
|
10122
10163
|
var IcuSerializerVisitor = class {
|
|
10123
10164
|
visitText(text2) {
|
|
10124
10165
|
return text2.value;
|
|
@@ -10152,7 +10193,7 @@ function serializeIcuNode(icu) {
|
|
|
10152
10193
|
return icu.visit(serializer);
|
|
10153
10194
|
}
|
|
10154
10195
|
|
|
10155
|
-
// bazel-out/
|
|
10196
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
|
|
10156
10197
|
var TokenType;
|
|
10157
10198
|
(function(TokenType2) {
|
|
10158
10199
|
TokenType2[TokenType2["Character"] = 0] = "Character";
|
|
@@ -10513,7 +10554,7 @@ function parseIntAutoRadix(text2) {
|
|
|
10513
10554
|
return result;
|
|
10514
10555
|
}
|
|
10515
10556
|
|
|
10516
|
-
// bazel-out/
|
|
10557
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
|
|
10517
10558
|
var SplitInterpolation = class {
|
|
10518
10559
|
constructor(strings, expressions, offsets) {
|
|
10519
10560
|
this.strings = strings;
|
|
@@ -11407,7 +11448,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
|
|
|
11407
11448
|
return offsetMap;
|
|
11408
11449
|
}
|
|
11409
11450
|
|
|
11410
|
-
// bazel-out/
|
|
11451
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
|
|
11411
11452
|
var NodeWithI18n = class {
|
|
11412
11453
|
constructor(sourceSpan, i18n2) {
|
|
11413
11454
|
this.sourceSpan = sourceSpan;
|
|
@@ -11559,11 +11600,11 @@ var RecursiveVisitor = class {
|
|
|
11559
11600
|
}
|
|
11560
11601
|
};
|
|
11561
11602
|
|
|
11562
|
-
// bazel-out/
|
|
11603
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
|
|
11563
11604
|
var ElementSchemaRegistry = class {
|
|
11564
11605
|
};
|
|
11565
11606
|
|
|
11566
|
-
// bazel-out/
|
|
11607
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
|
|
11567
11608
|
var BOOLEAN = "boolean";
|
|
11568
11609
|
var NUMBER = "number";
|
|
11569
11610
|
var STRING = "string";
|
|
@@ -11916,7 +11957,7 @@ function _isPixelDimensionStyle(prop) {
|
|
|
11916
11957
|
}
|
|
11917
11958
|
}
|
|
11918
11959
|
|
|
11919
|
-
// bazel-out/
|
|
11960
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
|
|
11920
11961
|
var HtmlTagDefinition = class {
|
|
11921
11962
|
constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
|
|
11922
11963
|
this.closedByChildren = {};
|
|
@@ -12034,7 +12075,7 @@ function getHtmlTagDefinition(tagName) {
|
|
|
12034
12075
|
return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
|
|
12035
12076
|
}
|
|
12036
12077
|
|
|
12037
|
-
// bazel-out/
|
|
12078
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
|
|
12038
12079
|
var TAG_TO_PLACEHOLDER_NAMES = {
|
|
12039
12080
|
"A": "LINK",
|
|
12040
12081
|
"B": "BOLD_TEXT",
|
|
@@ -12156,7 +12197,7 @@ var PlaceholderRegistry = class {
|
|
|
12156
12197
|
}
|
|
12157
12198
|
};
|
|
12158
12199
|
|
|
12159
|
-
// bazel-out/
|
|
12200
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
|
|
12160
12201
|
var _expParser = new Parser(new Lexer());
|
|
12161
12202
|
function createI18nMessageFactory(interpolationConfig, containerBlocks) {
|
|
12162
12203
|
const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
|
|
@@ -12335,14 +12376,14 @@ function extractPlaceholderName(input) {
|
|
|
12335
12376
|
return input.split(_CUSTOM_PH_EXP)[2];
|
|
12336
12377
|
}
|
|
12337
12378
|
|
|
12338
|
-
// bazel-out/
|
|
12379
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
|
|
12339
12380
|
var I18nError = class extends ParseError {
|
|
12340
12381
|
constructor(span, msg) {
|
|
12341
12382
|
super(span, msg);
|
|
12342
12383
|
}
|
|
12343
12384
|
};
|
|
12344
12385
|
|
|
12345
|
-
// bazel-out/
|
|
12386
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
|
|
12346
12387
|
var NAMED_ENTITIES = {
|
|
12347
12388
|
"AElig": "\xC6",
|
|
12348
12389
|
"AMP": "&",
|
|
@@ -14473,7 +14514,7 @@ var NAMED_ENTITIES = {
|
|
|
14473
14514
|
var NGSP_UNICODE = "\uE500";
|
|
14474
14515
|
NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
|
|
14475
14516
|
|
|
14476
|
-
// bazel-out/
|
|
14517
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
|
|
14477
14518
|
var TokenError = class extends ParseError {
|
|
14478
14519
|
constructor(errorMsg, tokenType, span) {
|
|
14479
14520
|
super(span, errorMsg);
|
|
@@ -15394,7 +15435,7 @@ var CursorError = class {
|
|
|
15394
15435
|
}
|
|
15395
15436
|
};
|
|
15396
15437
|
|
|
15397
|
-
// bazel-out/
|
|
15438
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
|
|
15398
15439
|
var TreeError = class extends ParseError {
|
|
15399
15440
|
static create(elementName, span, msg) {
|
|
15400
15441
|
return new TreeError(elementName, span, msg);
|
|
@@ -15778,7 +15819,7 @@ function decodeEntity(match, entity) {
|
|
|
15778
15819
|
return match;
|
|
15779
15820
|
}
|
|
15780
15821
|
|
|
15781
|
-
// bazel-out/
|
|
15822
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
|
|
15782
15823
|
var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
|
|
15783
15824
|
"iframe|srcdoc",
|
|
15784
15825
|
"*|innerhtml",
|
|
@@ -15793,7 +15834,7 @@ function isTrustedTypesSink(tagName, propName) {
|
|
|
15793
15834
|
return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
|
|
15794
15835
|
}
|
|
15795
15836
|
|
|
15796
|
-
// bazel-out/
|
|
15837
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
|
|
15797
15838
|
var setI18nRefs = (htmlNode, i18nNode) => {
|
|
15798
15839
|
if (htmlNode instanceof NodeWithI18n) {
|
|
15799
15840
|
if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
|
|
@@ -15950,7 +15991,7 @@ function i18nMetaToJSDoc(meta) {
|
|
|
15950
15991
|
return jsDocComment(tags);
|
|
15951
15992
|
}
|
|
15952
15993
|
|
|
15953
|
-
// bazel-out/
|
|
15994
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
|
|
15954
15995
|
var GOOG_GET_MSG = "goog.getMsg";
|
|
15955
15996
|
function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
|
|
15956
15997
|
const messageString = serializeI18nMessageForGetMsg(message);
|
|
@@ -16001,7 +16042,7 @@ function serializeI18nMessageForGetMsg(message) {
|
|
|
16001
16042
|
return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
|
|
16002
16043
|
}
|
|
16003
16044
|
|
|
16004
|
-
// bazel-out/
|
|
16045
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
|
|
16005
16046
|
function createLocalizeStatements(variable2, message, params) {
|
|
16006
16047
|
const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
|
|
16007
16048
|
const sourceSpan = getSourceSpan(message);
|
|
@@ -16090,13 +16131,13 @@ function createEmptyMessagePart(location) {
|
|
|
16090
16131
|
return new LiteralPiece("", new ParseSourceSpan(location, location));
|
|
16091
16132
|
}
|
|
16092
16133
|
|
|
16093
|
-
// bazel-out/
|
|
16134
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
|
|
16094
16135
|
var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
|
|
16095
16136
|
var TRANSLATION_VAR_PREFIX2 = "i18n_";
|
|
16096
16137
|
var I18N_ICU_MAPPING_PREFIX2 = "I18N_EXP_";
|
|
16097
16138
|
var ESCAPE2 = "\uFFFD";
|
|
16098
16139
|
function collectI18nConsts(job) {
|
|
16099
|
-
var _a2;
|
|
16140
|
+
var _a2, _b2;
|
|
16100
16141
|
const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
|
|
16101
16142
|
const extractedAttributesByI18nContext = /* @__PURE__ */ new Map();
|
|
16102
16143
|
const i18nAttributesByElement = /* @__PURE__ */ new Map();
|
|
@@ -16105,11 +16146,13 @@ function collectI18nConsts(job) {
|
|
|
16105
16146
|
for (const unit of job.units) {
|
|
16106
16147
|
for (const op of unit.ops()) {
|
|
16107
16148
|
if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) {
|
|
16108
|
-
extractedAttributesByI18nContext.
|
|
16149
|
+
const attributes = (_a2 = extractedAttributesByI18nContext.get(op.i18nContext)) != null ? _a2 : [];
|
|
16150
|
+
attributes.push(op);
|
|
16151
|
+
extractedAttributesByI18nContext.set(op.i18nContext, attributes);
|
|
16109
16152
|
} else if (op.kind === OpKind.I18nAttributes) {
|
|
16110
16153
|
i18nAttributesByElement.set(op.target, op);
|
|
16111
16154
|
} else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) {
|
|
16112
|
-
const expressions = (
|
|
16155
|
+
const expressions = (_b2 = i18nExpressionsByElement.get(op.target)) != null ? _b2 : [];
|
|
16113
16156
|
expressions.push(op);
|
|
16114
16157
|
i18nExpressionsByElement.set(op.target, expressions);
|
|
16115
16158
|
} else if (op.kind === OpKind.I18nMessage) {
|
|
@@ -16130,9 +16173,11 @@ function collectI18nConsts(job) {
|
|
|
16130
16173
|
} else {
|
|
16131
16174
|
job.constsInitializers.push(...statements);
|
|
16132
16175
|
i18nValuesByContext.set(op.i18nContext, mainVar);
|
|
16133
|
-
const
|
|
16134
|
-
if (
|
|
16135
|
-
|
|
16176
|
+
const attributesForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
|
|
16177
|
+
if (attributesForMessage !== void 0) {
|
|
16178
|
+
for (const attr of attributesForMessage) {
|
|
16179
|
+
attr.expression = mainVar.clone();
|
|
16180
|
+
}
|
|
16136
16181
|
}
|
|
16137
16182
|
}
|
|
16138
16183
|
}
|
|
@@ -16248,7 +16293,7 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
|
|
|
16248
16293
|
return variable(name);
|
|
16249
16294
|
}
|
|
16250
16295
|
|
|
16251
|
-
// bazel-out/
|
|
16296
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
|
|
16252
16297
|
function convertI18nText(job) {
|
|
16253
16298
|
var _a2;
|
|
16254
16299
|
for (const unit of job.units) {
|
|
@@ -16307,7 +16352,7 @@ function convertI18nText(job) {
|
|
|
16307
16352
|
}
|
|
16308
16353
|
}
|
|
16309
16354
|
|
|
16310
|
-
// bazel-out/
|
|
16355
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
|
|
16311
16356
|
function liftLocalRefs(job) {
|
|
16312
16357
|
for (const unit of job.units) {
|
|
16313
16358
|
for (const op of unit.create) {
|
|
@@ -16337,7 +16382,7 @@ function serializeLocalRefs(refs) {
|
|
|
16337
16382
|
return literalArr(constRefs);
|
|
16338
16383
|
}
|
|
16339
16384
|
|
|
16340
|
-
// bazel-out/
|
|
16385
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
|
|
16341
16386
|
function emitNamespaceChanges(job) {
|
|
16342
16387
|
for (const unit of job.units) {
|
|
16343
16388
|
let activeNamespace = Namespace.HTML;
|
|
@@ -16353,7 +16398,7 @@ function emitNamespaceChanges(job) {
|
|
|
16353
16398
|
}
|
|
16354
16399
|
}
|
|
16355
16400
|
|
|
16356
|
-
// bazel-out/
|
|
16401
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
|
|
16357
16402
|
function parse(value) {
|
|
16358
16403
|
const styles = [];
|
|
16359
16404
|
let i = 0;
|
|
@@ -16414,7 +16459,7 @@ function hyphenate2(value) {
|
|
|
16414
16459
|
}).toLowerCase();
|
|
16415
16460
|
}
|
|
16416
16461
|
|
|
16417
|
-
// bazel-out/
|
|
16462
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
|
|
16418
16463
|
function nameFunctionsAndVariables(job) {
|
|
16419
16464
|
addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
|
|
16420
16465
|
}
|
|
@@ -16529,7 +16574,7 @@ function stripImportant(name) {
|
|
|
16529
16574
|
return name;
|
|
16530
16575
|
}
|
|
16531
16576
|
|
|
16532
|
-
// bazel-out/
|
|
16577
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
|
|
16533
16578
|
function mergeNextContextExpressions(job) {
|
|
16534
16579
|
for (const unit of job.units) {
|
|
16535
16580
|
for (const op of unit.create) {
|
|
@@ -16575,7 +16620,7 @@ function mergeNextContextsInOps(ops) {
|
|
|
16575
16620
|
}
|
|
16576
16621
|
}
|
|
16577
16622
|
|
|
16578
|
-
// bazel-out/
|
|
16623
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
|
|
16579
16624
|
var CONTAINER_TAG = "ng-container";
|
|
16580
16625
|
function generateNgContainerOps(job) {
|
|
16581
16626
|
for (const unit of job.units) {
|
|
@@ -16592,7 +16637,7 @@ function generateNgContainerOps(job) {
|
|
|
16592
16637
|
}
|
|
16593
16638
|
}
|
|
16594
16639
|
|
|
16595
|
-
// bazel-out/
|
|
16640
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
|
|
16596
16641
|
function lookupElement3(elements, xref) {
|
|
16597
16642
|
const el = elements.get(xref);
|
|
16598
16643
|
if (el === void 0) {
|
|
@@ -16622,7 +16667,7 @@ function disableBindings(job) {
|
|
|
16622
16667
|
}
|
|
16623
16668
|
}
|
|
16624
16669
|
|
|
16625
|
-
// bazel-out/
|
|
16670
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
|
|
16626
16671
|
function generateNullishCoalesceExpressions(job) {
|
|
16627
16672
|
for (const unit of job.units) {
|
|
16628
16673
|
for (const op of unit.ops()) {
|
|
@@ -16638,7 +16683,7 @@ function generateNullishCoalesceExpressions(job) {
|
|
|
16638
16683
|
}
|
|
16639
16684
|
}
|
|
16640
16685
|
|
|
16641
|
-
// bazel-out/
|
|
16686
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
|
|
16642
16687
|
function kindTest(kind) {
|
|
16643
16688
|
return (op) => op.kind === kind;
|
|
16644
16689
|
}
|
|
@@ -16712,7 +16757,7 @@ function keepLast(ops) {
|
|
|
16712
16757
|
return ops.slice(ops.length - 1);
|
|
16713
16758
|
}
|
|
16714
16759
|
|
|
16715
|
-
// bazel-out/
|
|
16760
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
|
|
16716
16761
|
function parseExtractedStyles(job) {
|
|
16717
16762
|
for (const unit of job.units) {
|
|
16718
16763
|
for (const op of unit.create) {
|
|
@@ -16720,13 +16765,13 @@ function parseExtractedStyles(job) {
|
|
|
16720
16765
|
if (op.name === "style") {
|
|
16721
16766
|
const parsedStyles = parse(op.expression.value);
|
|
16722
16767
|
for (let i = 0; i < parsedStyles.length - 1; i += 2) {
|
|
16723
|
-
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null), op);
|
|
16768
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null, null, SecurityContext.STYLE), op);
|
|
16724
16769
|
}
|
|
16725
16770
|
OpList.remove(op);
|
|
16726
16771
|
} else if (op.name === "class") {
|
|
16727
16772
|
const parsedClasses = op.expression.value.trim().split(/\s+/g);
|
|
16728
16773
|
for (const parsedClass of parsedClasses) {
|
|
16729
|
-
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null), op);
|
|
16774
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null, null, SecurityContext.NONE), op);
|
|
16730
16775
|
}
|
|
16731
16776
|
OpList.remove(op);
|
|
16732
16777
|
}
|
|
@@ -16735,7 +16780,7 @@ function parseExtractedStyles(job) {
|
|
|
16735
16780
|
}
|
|
16736
16781
|
}
|
|
16737
16782
|
|
|
16738
|
-
// bazel-out/
|
|
16783
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
|
|
16739
16784
|
function removeContentSelectors(job) {
|
|
16740
16785
|
for (const unit of job.units) {
|
|
16741
16786
|
const elements = createOpXrefMap(unit);
|
|
@@ -16769,7 +16814,7 @@ function lookupInXrefMap(map, xref) {
|
|
|
16769
16814
|
return el;
|
|
16770
16815
|
}
|
|
16771
16816
|
|
|
16772
|
-
// bazel-out/
|
|
16817
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
|
|
16773
16818
|
function createPipes(job) {
|
|
16774
16819
|
for (const unit of job.units) {
|
|
16775
16820
|
processPipeBindingsInView(unit);
|
|
@@ -16817,7 +16862,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
|
|
|
16817
16862
|
throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
|
|
16818
16863
|
}
|
|
16819
16864
|
|
|
16820
|
-
// bazel-out/
|
|
16865
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
|
|
16821
16866
|
function createVariadicPipes(job) {
|
|
16822
16867
|
for (const unit of job.units) {
|
|
16823
16868
|
for (const op of unit.update) {
|
|
@@ -16834,7 +16879,7 @@ function createVariadicPipes(job) {
|
|
|
16834
16879
|
}
|
|
16835
16880
|
}
|
|
16836
16881
|
|
|
16837
|
-
// bazel-out/
|
|
16882
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
|
|
16838
16883
|
function propagateI18nBlocks(job) {
|
|
16839
16884
|
propagateI18nBlocksToTemplates(job.root, 0);
|
|
16840
16885
|
}
|
|
@@ -16853,19 +16898,29 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
|
|
|
16853
16898
|
i18nBlock = null;
|
|
16854
16899
|
break;
|
|
16855
16900
|
case OpKind.Template:
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
|
|
16862
|
-
|
|
16901
|
+
subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
|
|
16902
|
+
break;
|
|
16903
|
+
case OpKind.RepeaterCreate:
|
|
16904
|
+
const forView = unit.job.views.get(op.xref);
|
|
16905
|
+
subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex);
|
|
16906
|
+
if (op.emptyView !== null) {
|
|
16907
|
+
subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
|
|
16863
16908
|
}
|
|
16864
|
-
|
|
16909
|
+
break;
|
|
16865
16910
|
}
|
|
16866
16911
|
}
|
|
16867
16912
|
return subTemplateIndex;
|
|
16868
16913
|
}
|
|
16914
|
+
function propagateI18nBlocksForView(view, i18nBlock, i18nPlaceholder, subTemplateIndex) {
|
|
16915
|
+
if (i18nPlaceholder !== void 0) {
|
|
16916
|
+
if (i18nBlock === null) {
|
|
16917
|
+
throw Error("Expected template with i18n placeholder to be in an i18n block.");
|
|
16918
|
+
}
|
|
16919
|
+
subTemplateIndex++;
|
|
16920
|
+
wrapTemplateWithI18n(view, i18nBlock);
|
|
16921
|
+
}
|
|
16922
|
+
return propagateI18nBlocksToTemplates(view, subTemplateIndex);
|
|
16923
|
+
}
|
|
16869
16924
|
function wrapTemplateWithI18n(unit, parentI18n) {
|
|
16870
16925
|
var _a2;
|
|
16871
16926
|
if (((_a2 = unit.create.head.next) == null ? void 0 : _a2.kind) !== OpKind.I18nStart) {
|
|
@@ -16875,7 +16930,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
|
|
|
16875
16930
|
}
|
|
16876
16931
|
}
|
|
16877
16932
|
|
|
16878
|
-
// bazel-out/
|
|
16933
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
|
|
16879
16934
|
function extractPureFunctions(job) {
|
|
16880
16935
|
for (const view of job.units) {
|
|
16881
16936
|
for (const op of view.ops()) {
|
|
@@ -16917,7 +16972,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
|
|
|
16917
16972
|
}
|
|
16918
16973
|
};
|
|
16919
16974
|
|
|
16920
|
-
// bazel-out/
|
|
16975
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
|
|
16921
16976
|
function generatePureLiteralStructures(job) {
|
|
16922
16977
|
for (const unit of job.units) {
|
|
16923
16978
|
for (const op of unit.update) {
|
|
@@ -16964,7 +17019,7 @@ function transformLiteralMap(expr) {
|
|
|
16964
17019
|
return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
|
|
16965
17020
|
}
|
|
16966
17021
|
|
|
16967
|
-
// bazel-out/
|
|
17022
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
|
|
16968
17023
|
function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
|
|
16969
17024
|
return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
|
|
16970
17025
|
}
|
|
@@ -17022,17 +17077,13 @@ function disableBindings2() {
|
|
|
17022
17077
|
function enableBindings() {
|
|
17023
17078
|
return call(Identifiers.enableBindings, [], null);
|
|
17024
17079
|
}
|
|
17025
|
-
function listener(name, handlerFn, sourceSpan) {
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
}
|
|
17031
|
-
|
|
17032
|
-
return call(Identifiers.syntheticHostListener, [
|
|
17033
|
-
literal(name),
|
|
17034
|
-
handlerFn
|
|
17035
|
-
], sourceSpan);
|
|
17080
|
+
function listener(name, handlerFn, eventTargetResolver, syntheticHost, sourceSpan) {
|
|
17081
|
+
const args = [literal(name), handlerFn];
|
|
17082
|
+
if (eventTargetResolver !== null) {
|
|
17083
|
+
args.push(literal(false));
|
|
17084
|
+
args.push(importExpr(eventTargetResolver));
|
|
17085
|
+
}
|
|
17086
|
+
return call(syntheticHost ? Identifiers.syntheticHostListener : Identifiers.listener, args, sourceSpan);
|
|
17036
17087
|
}
|
|
17037
17088
|
function pipe(slot, name) {
|
|
17038
17089
|
return call(Identifiers.pipe, [
|
|
@@ -17291,8 +17342,12 @@ function classMapInterpolate(strings, expressions, sourceSpan) {
|
|
|
17291
17342
|
const interpolationArgs = collateInterpolationArgs(strings, expressions);
|
|
17292
17343
|
return callVariadicInstruction(CLASS_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan);
|
|
17293
17344
|
}
|
|
17294
|
-
function hostProperty(name, expression, sourceSpan) {
|
|
17295
|
-
|
|
17345
|
+
function hostProperty(name, expression, sanitizer, sourceSpan) {
|
|
17346
|
+
const args = [literal(name), expression];
|
|
17347
|
+
if (sanitizer !== null) {
|
|
17348
|
+
args.push(sanitizer);
|
|
17349
|
+
}
|
|
17350
|
+
return call(Identifiers.hostProperty, args, sourceSpan);
|
|
17296
17351
|
}
|
|
17297
17352
|
function syntheticHostProperty(name, expression, sourceSpan) {
|
|
17298
17353
|
return call(Identifiers.syntheticHostProperty, [literal(name), expression], sourceSpan);
|
|
@@ -17479,14 +17534,11 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
|
|
|
17479
17534
|
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
|
|
17480
17535
|
}
|
|
17481
17536
|
|
|
17482
|
-
// bazel-out/
|
|
17483
|
-
var
|
|
17484
|
-
[
|
|
17485
|
-
[
|
|
17486
|
-
[
|
|
17487
|
-
[SanitizerFn.Script, Identifiers.sanitizeScript],
|
|
17488
|
-
[SanitizerFn.Style, Identifiers.sanitizeStyle],
|
|
17489
|
-
[SanitizerFn.Url, Identifiers.sanitizeUrl]
|
|
17537
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
|
|
17538
|
+
var GLOBAL_TARGET_RESOLVERS = /* @__PURE__ */ new Map([
|
|
17539
|
+
["window", Identifiers.resolveWindow],
|
|
17540
|
+
["document", Identifiers.resolveDocument],
|
|
17541
|
+
["body", Identifiers.resolveBody]
|
|
17490
17542
|
]);
|
|
17491
17543
|
function reify(job) {
|
|
17492
17544
|
for (const unit of job.units) {
|
|
@@ -17556,8 +17608,11 @@ function reifyCreateOperations(unit, ops) {
|
|
|
17556
17608
|
break;
|
|
17557
17609
|
case OpKind.Listener:
|
|
17558
17610
|
const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent);
|
|
17559
|
-
const
|
|
17560
|
-
|
|
17611
|
+
const eventTargetResolver = op.eventTarget ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget) : null;
|
|
17612
|
+
if (eventTargetResolver === void 0) {
|
|
17613
|
+
throw new Error(`AssertionError: unknown event target ${op.eventTarget}`);
|
|
17614
|
+
}
|
|
17615
|
+
OpList.replace(op, listener(op.name, listenerFn, eventTargetResolver, op.hostListener && op.isAnimationListener, op.sourceSpan));
|
|
17561
17616
|
break;
|
|
17562
17617
|
case OpKind.Variable:
|
|
17563
17618
|
if (op.variable.name === null) {
|
|
@@ -17712,7 +17767,7 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
17712
17767
|
if (op.isAnimationTrigger) {
|
|
17713
17768
|
OpList.replace(op, syntheticHostProperty(op.name, op.expression, op.sourceSpan));
|
|
17714
17769
|
} else {
|
|
17715
|
-
OpList.replace(op, hostProperty(op.name, op.expression, op.sourceSpan));
|
|
17770
|
+
OpList.replace(op, hostProperty(op.name, op.expression, op.sanitizer, op.sourceSpan));
|
|
17716
17771
|
}
|
|
17717
17772
|
}
|
|
17718
17773
|
break;
|
|
@@ -17790,8 +17845,6 @@ function reifyIrExpression(expr) {
|
|
|
17790
17845
|
return pipeBind(expr.targetSlot.slot, expr.varOffset, expr.args);
|
|
17791
17846
|
case ExpressionKind.PipeBindingVariadic:
|
|
17792
17847
|
return pipeBindV(expr.targetSlot.slot, expr.varOffset, expr.args);
|
|
17793
|
-
case ExpressionKind.SanitizerExpr:
|
|
17794
|
-
return importExpr(sanitizerIdentifierMap.get(expr.fn));
|
|
17795
17848
|
case ExpressionKind.SlotLiteralExpr:
|
|
17796
17849
|
return literal(expr.slot.slot);
|
|
17797
17850
|
default:
|
|
@@ -17814,7 +17867,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
|
|
|
17814
17867
|
return fn(params, handlerStmts, void 0, void 0, name);
|
|
17815
17868
|
}
|
|
17816
17869
|
|
|
17817
|
-
// bazel-out/
|
|
17870
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
|
|
17818
17871
|
function removeEmptyBindings(job) {
|
|
17819
17872
|
for (const unit of job.units) {
|
|
17820
17873
|
for (const op of unit.update) {
|
|
@@ -17835,7 +17888,7 @@ function removeEmptyBindings(job) {
|
|
|
17835
17888
|
}
|
|
17836
17889
|
}
|
|
17837
17890
|
|
|
17838
|
-
// bazel-out/
|
|
17891
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
|
|
17839
17892
|
function removeI18nContexts(job) {
|
|
17840
17893
|
for (const unit of job.units) {
|
|
17841
17894
|
for (const op of unit.create) {
|
|
@@ -17851,7 +17904,7 @@ function removeI18nContexts(job) {
|
|
|
17851
17904
|
}
|
|
17852
17905
|
}
|
|
17853
17906
|
|
|
17854
|
-
// bazel-out/
|
|
17907
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.mjs
|
|
17855
17908
|
function removeUnusedI18nAttributesOps(job) {
|
|
17856
17909
|
for (const unit of job.units) {
|
|
17857
17910
|
const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
|
|
@@ -17873,7 +17926,7 @@ function removeUnusedI18nAttributesOps(job) {
|
|
|
17873
17926
|
}
|
|
17874
17927
|
}
|
|
17875
17928
|
|
|
17876
|
-
// bazel-out/
|
|
17929
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
|
|
17877
17930
|
function generateRepeaterDerivedVars(job) {
|
|
17878
17931
|
const repeaters = /* @__PURE__ */ new Map();
|
|
17879
17932
|
for (const unit of job.units) {
|
|
@@ -17905,7 +17958,7 @@ function generateRepeaterDerivedVars(job) {
|
|
|
17905
17958
|
}
|
|
17906
17959
|
}
|
|
17907
17960
|
|
|
17908
|
-
// bazel-out/
|
|
17961
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
|
|
17909
17962
|
function resolveContexts(job) {
|
|
17910
17963
|
for (const unit of job.units) {
|
|
17911
17964
|
processLexicalScope(unit, unit.create);
|
|
@@ -17946,7 +17999,7 @@ function processLexicalScope(view, ops) {
|
|
|
17946
17999
|
}
|
|
17947
18000
|
}
|
|
17948
18001
|
|
|
17949
|
-
// bazel-out/
|
|
18002
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
|
|
17950
18003
|
function resolveDollarEvent(job) {
|
|
17951
18004
|
for (const unit of job.units) {
|
|
17952
18005
|
transformDollarEvent(unit, unit.create);
|
|
@@ -17967,7 +18020,7 @@ function transformDollarEvent(unit, ops) {
|
|
|
17967
18020
|
}
|
|
17968
18021
|
}
|
|
17969
18022
|
|
|
17970
|
-
// bazel-out/
|
|
18023
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
|
|
17971
18024
|
function resolveI18nElementPlaceholders(job) {
|
|
17972
18025
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
17973
18026
|
const elements = /* @__PURE__ */ new Map();
|
|
@@ -18032,18 +18085,52 @@ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingSt
|
|
|
18032
18085
|
}
|
|
18033
18086
|
break;
|
|
18034
18087
|
case OpKind.Template:
|
|
18088
|
+
const view = job.views.get(op.xref);
|
|
18035
18089
|
if (op.i18nPlaceholder === void 0) {
|
|
18036
|
-
resolvePlaceholdersForView(job,
|
|
18090
|
+
resolvePlaceholdersForView(job, view, i18nContexts, elements);
|
|
18037
18091
|
} else {
|
|
18038
18092
|
if (currentOps === null) {
|
|
18039
18093
|
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
18040
18094
|
}
|
|
18041
18095
|
if (op.templateKind === TemplateKind.Structural) {
|
|
18042
|
-
resolvePlaceholdersForView(job,
|
|
18096
|
+
resolvePlaceholdersForView(job, view, i18nContexts, elements, op);
|
|
18097
|
+
} else {
|
|
18098
|
+
recordTemplateStart(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18099
|
+
resolvePlaceholdersForView(job, view, i18nContexts, elements);
|
|
18100
|
+
recordTemplateClose(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18101
|
+
pendingStructuralDirective = void 0;
|
|
18102
|
+
}
|
|
18103
|
+
}
|
|
18104
|
+
break;
|
|
18105
|
+
case OpKind.RepeaterCreate:
|
|
18106
|
+
if (pendingStructuralDirective !== void 0) {
|
|
18107
|
+
throw Error("AssertionError: Unexpected structural directive associated with @for block");
|
|
18108
|
+
}
|
|
18109
|
+
const forSlot = op.handle.slot + 1;
|
|
18110
|
+
const forView = job.views.get(op.xref);
|
|
18111
|
+
if (op.i18nPlaceholder === void 0) {
|
|
18112
|
+
resolvePlaceholdersForView(job, forView, i18nContexts, elements);
|
|
18113
|
+
} else {
|
|
18114
|
+
if (currentOps === null) {
|
|
18115
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
18116
|
+
}
|
|
18117
|
+
recordTemplateStart(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18118
|
+
resolvePlaceholdersForView(job, forView, i18nContexts, elements);
|
|
18119
|
+
recordTemplateClose(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18120
|
+
pendingStructuralDirective = void 0;
|
|
18121
|
+
}
|
|
18122
|
+
if (op.emptyView !== null) {
|
|
18123
|
+
const emptySlot = op.handle.slot + 2;
|
|
18124
|
+
const emptyView = job.views.get(op.emptyView);
|
|
18125
|
+
if (op.emptyI18nPlaceholder === void 0) {
|
|
18126
|
+
resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);
|
|
18043
18127
|
} else {
|
|
18044
|
-
|
|
18045
|
-
|
|
18046
|
-
|
|
18128
|
+
if (currentOps === null) {
|
|
18129
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
18130
|
+
}
|
|
18131
|
+
recordTemplateStart(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18132
|
+
resolvePlaceholdersForView(job, emptyView, i18nContexts, elements);
|
|
18133
|
+
recordTemplateClose(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18047
18134
|
pendingStructuralDirective = void 0;
|
|
18048
18135
|
}
|
|
18049
18136
|
}
|
|
@@ -18076,8 +18163,8 @@ function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) {
|
|
|
18076
18163
|
addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);
|
|
18077
18164
|
}
|
|
18078
18165
|
}
|
|
18079
|
-
function recordTemplateStart(job,
|
|
18080
|
-
let { startName, closeName } =
|
|
18166
|
+
function recordTemplateStart(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
|
|
18167
|
+
let { startName, closeName } = i18nPlaceholder;
|
|
18081
18168
|
let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
|
|
18082
18169
|
if (!closeName) {
|
|
18083
18170
|
flags |= I18nParamValueFlags.CloseTag;
|
|
@@ -18085,20 +18172,20 @@ function recordTemplateStart(job, op, i18nContext, i18nBlock, structuralDirectiv
|
|
|
18085
18172
|
if (structuralDirective !== void 0) {
|
|
18086
18173
|
addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
|
|
18087
18174
|
}
|
|
18088
|
-
addParam(i18nContext.params, startName,
|
|
18175
|
+
addParam(i18nContext.params, startName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
|
|
18089
18176
|
}
|
|
18090
|
-
function recordTemplateClose(job,
|
|
18091
|
-
const { startName, closeName } =
|
|
18177
|
+
function recordTemplateClose(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
|
|
18178
|
+
const { startName, closeName } = i18nPlaceholder;
|
|
18092
18179
|
const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
|
|
18093
18180
|
if (closeName) {
|
|
18094
|
-
addParam(i18nContext.params, closeName,
|
|
18181
|
+
addParam(i18nContext.params, closeName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
|
|
18095
18182
|
if (structuralDirective !== void 0) {
|
|
18096
18183
|
addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
|
|
18097
18184
|
}
|
|
18098
18185
|
}
|
|
18099
18186
|
}
|
|
18100
|
-
function getSubTemplateIndexForTemplateTag(job, i18nOp,
|
|
18101
|
-
for (const childOp of
|
|
18187
|
+
function getSubTemplateIndexForTemplateTag(job, i18nOp, view) {
|
|
18188
|
+
for (const childOp of view.create) {
|
|
18102
18189
|
if (childOp.kind === OpKind.I18nStart) {
|
|
18103
18190
|
return childOp.subTemplateIndex;
|
|
18104
18191
|
}
|
|
@@ -18112,7 +18199,7 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
|
|
|
18112
18199
|
params.set(placeholder, values);
|
|
18113
18200
|
}
|
|
18114
18201
|
|
|
18115
|
-
// bazel-out/
|
|
18202
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
|
|
18116
18203
|
function resolveI18nExpressionPlaceholders(job) {
|
|
18117
18204
|
var _a2;
|
|
18118
18205
|
const subTemplateIndicies = /* @__PURE__ */ new Map();
|
|
@@ -18151,7 +18238,7 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
18151
18238
|
}
|
|
18152
18239
|
}
|
|
18153
18240
|
|
|
18154
|
-
// bazel-out/
|
|
18241
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
|
|
18155
18242
|
function resolveI18nIcuPlaceholders(job) {
|
|
18156
18243
|
for (const unit of job.units) {
|
|
18157
18244
|
for (const op of unit.create) {
|
|
@@ -18195,7 +18282,7 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
|
|
|
18195
18282
|
}
|
|
18196
18283
|
};
|
|
18197
18284
|
|
|
18198
|
-
// bazel-out/
|
|
18285
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
|
|
18199
18286
|
function resolveNames(job) {
|
|
18200
18287
|
for (const unit of job.units) {
|
|
18201
18288
|
processLexicalScope2(unit, unit.create, null);
|
|
@@ -18259,31 +18346,55 @@ function processLexicalScope2(unit, ops, savedView) {
|
|
|
18259
18346
|
}
|
|
18260
18347
|
}
|
|
18261
18348
|
|
|
18262
|
-
// bazel-out/
|
|
18263
|
-
var
|
|
18264
|
-
[SecurityContext.HTML,
|
|
18265
|
-
[SecurityContext.
|
|
18266
|
-
[SecurityContext.
|
|
18267
|
-
[SecurityContext.
|
|
18268
|
-
[SecurityContext.
|
|
18349
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
|
|
18350
|
+
var sanitizerFns = /* @__PURE__ */ new Map([
|
|
18351
|
+
[SecurityContext.HTML, Identifiers.sanitizeHtml],
|
|
18352
|
+
[SecurityContext.RESOURCE_URL, Identifiers.sanitizeResourceUrl],
|
|
18353
|
+
[SecurityContext.SCRIPT, Identifiers.sanitizeScript],
|
|
18354
|
+
[SecurityContext.STYLE, Identifiers.sanitizeStyle],
|
|
18355
|
+
[SecurityContext.URL, Identifiers.sanitizeUrl]
|
|
18356
|
+
]);
|
|
18357
|
+
var trustedValueFns = /* @__PURE__ */ new Map([
|
|
18358
|
+
[SecurityContext.HTML, Identifiers.trustConstantHtml],
|
|
18359
|
+
[SecurityContext.RESOURCE_URL, Identifiers.trustConstantResourceUrl]
|
|
18269
18360
|
]);
|
|
18270
18361
|
function resolveSanitizers(job) {
|
|
18362
|
+
var _a2, _b2;
|
|
18271
18363
|
for (const unit of job.units) {
|
|
18272
18364
|
const elements = createOpXrefMap(unit);
|
|
18273
|
-
|
|
18365
|
+
if (job.kind !== CompilationJobKind.Host) {
|
|
18366
|
+
for (const op of unit.create) {
|
|
18367
|
+
if (op.kind === OpKind.ExtractedAttribute) {
|
|
18368
|
+
const trustedValueFn = (_a2 = trustedValueFns.get(getOnlySecurityContext(op.securityContext))) != null ? _a2 : null;
|
|
18369
|
+
op.trustedValueFn = trustedValueFn !== null ? importExpr(trustedValueFn) : null;
|
|
18370
|
+
}
|
|
18371
|
+
}
|
|
18372
|
+
}
|
|
18274
18373
|
for (const op of unit.update) {
|
|
18275
18374
|
switch (op.kind) {
|
|
18276
18375
|
case OpKind.Property:
|
|
18277
18376
|
case OpKind.Attribute:
|
|
18278
|
-
|
|
18279
|
-
|
|
18377
|
+
case OpKind.HostProperty:
|
|
18378
|
+
let sanitizerFn = null;
|
|
18379
|
+
if (Array.isArray(op.securityContext) && op.securityContext.length === 2 && op.securityContext.indexOf(SecurityContext.URL) > -1 && op.securityContext.indexOf(SecurityContext.RESOURCE_URL) > -1) {
|
|
18380
|
+
sanitizerFn = Identifiers.sanitizeUrlOrResourceUrl;
|
|
18381
|
+
} else {
|
|
18382
|
+
sanitizerFn = (_b2 = sanitizerFns.get(getOnlySecurityContext(op.securityContext))) != null ? _b2 : null;
|
|
18383
|
+
}
|
|
18384
|
+
op.sanitizer = sanitizerFn !== null ? importExpr(sanitizerFn) : null;
|
|
18280
18385
|
if (op.sanitizer === null) {
|
|
18281
|
-
|
|
18282
|
-
if (
|
|
18283
|
-
|
|
18386
|
+
let isIframe = false;
|
|
18387
|
+
if (job.kind === CompilationJobKind.Host || op.kind === OpKind.HostProperty) {
|
|
18388
|
+
isIframe = true;
|
|
18389
|
+
} else {
|
|
18390
|
+
const ownerOp = elements.get(op.target);
|
|
18391
|
+
if (ownerOp === void 0 || !isElementOrContainerOp(ownerOp)) {
|
|
18392
|
+
throw Error("Property should have an element-like owner");
|
|
18393
|
+
}
|
|
18394
|
+
isIframe = isIframeElement(ownerOp);
|
|
18284
18395
|
}
|
|
18285
|
-
if (
|
|
18286
|
-
op.sanitizer =
|
|
18396
|
+
if (isIframe && isIframeSecuritySensitiveAttr(op.name)) {
|
|
18397
|
+
op.sanitizer = importExpr(Identifiers.validateIframeAttribute);
|
|
18287
18398
|
}
|
|
18288
18399
|
}
|
|
18289
18400
|
break;
|
|
@@ -18295,8 +18406,17 @@ function isIframeElement(op) {
|
|
|
18295
18406
|
var _a2;
|
|
18296
18407
|
return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
|
|
18297
18408
|
}
|
|
18409
|
+
function getOnlySecurityContext(securityContext) {
|
|
18410
|
+
if (Array.isArray(securityContext)) {
|
|
18411
|
+
if (securityContext.length > 1) {
|
|
18412
|
+
throw Error(`AssertionError: Ambiguous security context`);
|
|
18413
|
+
}
|
|
18414
|
+
return securityContext[0] || SecurityContext.NONE;
|
|
18415
|
+
}
|
|
18416
|
+
return securityContext;
|
|
18417
|
+
}
|
|
18298
18418
|
|
|
18299
|
-
// bazel-out/
|
|
18419
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
|
|
18300
18420
|
function saveAndRestoreView(job) {
|
|
18301
18421
|
for (const unit of job.units) {
|
|
18302
18422
|
unit.create.prepend([
|
|
@@ -18341,7 +18461,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
|
|
|
18341
18461
|
}
|
|
18342
18462
|
}
|
|
18343
18463
|
|
|
18344
|
-
// bazel-out/
|
|
18464
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
|
|
18345
18465
|
function allocateSlots(job) {
|
|
18346
18466
|
const slotMap = /* @__PURE__ */ new Map();
|
|
18347
18467
|
for (const unit of job.units) {
|
|
@@ -18366,7 +18486,7 @@ function allocateSlots(job) {
|
|
|
18366
18486
|
}
|
|
18367
18487
|
}
|
|
18368
18488
|
|
|
18369
|
-
// bazel-out/
|
|
18489
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
|
|
18370
18490
|
function specializeStyleBindings(job) {
|
|
18371
18491
|
for (const unit of job.units) {
|
|
18372
18492
|
for (const op of unit.update) {
|
|
@@ -18396,7 +18516,7 @@ function specializeStyleBindings(job) {
|
|
|
18396
18516
|
}
|
|
18397
18517
|
}
|
|
18398
18518
|
|
|
18399
|
-
// bazel-out/
|
|
18519
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
|
|
18400
18520
|
function generateTemporaryVariables(job) {
|
|
18401
18521
|
for (const unit of job.units) {
|
|
18402
18522
|
unit.create.prepend(generateTemporaries(unit.create));
|
|
@@ -18454,7 +18574,7 @@ function assignName(names, expr) {
|
|
|
18454
18574
|
expr.name = name;
|
|
18455
18575
|
}
|
|
18456
18576
|
|
|
18457
|
-
// bazel-out/
|
|
18577
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
|
|
18458
18578
|
function generateTrackFns(job) {
|
|
18459
18579
|
for (const unit of job.units) {
|
|
18460
18580
|
for (const op of unit.create) {
|
|
@@ -18484,7 +18604,7 @@ function generateTrackFns(job) {
|
|
|
18484
18604
|
}
|
|
18485
18605
|
}
|
|
18486
18606
|
|
|
18487
|
-
// bazel-out/
|
|
18607
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
|
|
18488
18608
|
function optimizeTrackFns(job) {
|
|
18489
18609
|
for (const unit of job.units) {
|
|
18490
18610
|
for (const op of unit.create) {
|
|
@@ -18531,7 +18651,7 @@ function isTrackByFunctionCall(rootView, expr) {
|
|
|
18531
18651
|
return true;
|
|
18532
18652
|
}
|
|
18533
18653
|
|
|
18534
|
-
// bazel-out/
|
|
18654
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
|
|
18535
18655
|
function generateTrackVariables(job) {
|
|
18536
18656
|
for (const unit of job.units) {
|
|
18537
18657
|
for (const op of unit.create) {
|
|
@@ -18552,7 +18672,7 @@ function generateTrackVariables(job) {
|
|
|
18552
18672
|
}
|
|
18553
18673
|
}
|
|
18554
18674
|
|
|
18555
|
-
// bazel-out/
|
|
18675
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
|
|
18556
18676
|
function countVariables(job) {
|
|
18557
18677
|
for (const unit of job.units) {
|
|
18558
18678
|
let varCount = 0;
|
|
@@ -18657,7 +18777,7 @@ function isSingletonInterpolation(expr) {
|
|
|
18657
18777
|
return true;
|
|
18658
18778
|
}
|
|
18659
18779
|
|
|
18660
|
-
// bazel-out/
|
|
18780
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
|
|
18661
18781
|
function optimizeVariables(job) {
|
|
18662
18782
|
for (const unit of job.units) {
|
|
18663
18783
|
inlineAlwaysInlineVariables(unit.create);
|
|
@@ -18907,7 +19027,7 @@ function allowConservativeInlining(decl, target) {
|
|
|
18907
19027
|
}
|
|
18908
19028
|
}
|
|
18909
19029
|
|
|
18910
|
-
// bazel-out/
|
|
19030
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
|
|
18911
19031
|
function wrapI18nIcus(job) {
|
|
18912
19032
|
for (const unit of job.units) {
|
|
18913
19033
|
let currentI18nOp = null;
|
|
@@ -18937,17 +19057,17 @@ function wrapI18nIcus(job) {
|
|
|
18937
19057
|
}
|
|
18938
19058
|
}
|
|
18939
19059
|
|
|
18940
|
-
// bazel-out/
|
|
19060
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
|
|
18941
19061
|
var phases = [
|
|
18942
19062
|
{ kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
|
|
18943
19063
|
{ kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
|
|
18944
19064
|
{ kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
|
|
18945
19065
|
{ kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
|
|
18946
19066
|
{ kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
|
|
18947
|
-
{ kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
|
|
18948
19067
|
{ kind: CompilationJobKind.Both, fn: specializeStyleBindings },
|
|
18949
19068
|
{ kind: CompilationJobKind.Both, fn: specializeBindings },
|
|
18950
19069
|
{ kind: CompilationJobKind.Both, fn: extractAttributes },
|
|
19070
|
+
{ kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
|
|
18951
19071
|
{ kind: CompilationJobKind.Both, fn: parseExtractedStyles },
|
|
18952
19072
|
{ kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
|
|
18953
19073
|
{ kind: CompilationJobKind.Both, fn: collapseSingletonInterpolations },
|
|
@@ -18965,7 +19085,7 @@ var phases = [
|
|
|
18965
19085
|
{ kind: CompilationJobKind.Tmpl, fn: generateProjectionDefs },
|
|
18966
19086
|
{ kind: CompilationJobKind.Tmpl, fn: generateVariables },
|
|
18967
19087
|
{ kind: CompilationJobKind.Tmpl, fn: saveAndRestoreView },
|
|
18968
|
-
{ kind: CompilationJobKind.
|
|
19088
|
+
{ kind: CompilationJobKind.Both, fn: deleteAnyCasts },
|
|
18969
19089
|
{ kind: CompilationJobKind.Both, fn: resolveDollarEvent },
|
|
18970
19090
|
{ kind: CompilationJobKind.Tmpl, fn: generateRepeaterDerivedVars },
|
|
18971
19091
|
{ kind: CompilationJobKind.Tmpl, fn: generateTrackVariables },
|
|
@@ -18973,7 +19093,7 @@ var phases = [
|
|
|
18973
19093
|
{ kind: CompilationJobKind.Tmpl, fn: resolveDeferTargetNames },
|
|
18974
19094
|
{ kind: CompilationJobKind.Tmpl, fn: optimizeTrackFns },
|
|
18975
19095
|
{ kind: CompilationJobKind.Both, fn: resolveContexts },
|
|
18976
|
-
{ kind: CompilationJobKind.
|
|
19096
|
+
{ kind: CompilationJobKind.Both, fn: resolveSanitizers },
|
|
18977
19097
|
{ kind: CompilationJobKind.Tmpl, fn: liftLocalRefs },
|
|
18978
19098
|
{ kind: CompilationJobKind.Both, fn: generateNullishCoalesceExpressions },
|
|
18979
19099
|
{ kind: CompilationJobKind.Both, fn: expandSafeReads },
|
|
@@ -19103,8 +19223,10 @@ function emitHostBindingFunction(job) {
|
|
|
19103
19223
|
);
|
|
19104
19224
|
}
|
|
19105
19225
|
|
|
19106
|
-
// bazel-out/
|
|
19226
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
|
|
19107
19227
|
var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
|
|
19228
|
+
var domSchema = new DomElementSchemaRegistry();
|
|
19229
|
+
var NG_TEMPLATE_TAG_NAME = "ng-template";
|
|
19108
19230
|
function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
|
|
19109
19231
|
const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
|
|
19110
19232
|
ingestNodes(job.root, template2);
|
|
@@ -19114,17 +19236,27 @@ function ingestHostBinding(input, bindingParser, constantPool) {
|
|
|
19114
19236
|
var _a2, _b2, _c2;
|
|
19115
19237
|
const job = new HostBindingCompilationJob(input.componentName, constantPool, compatibilityMode);
|
|
19116
19238
|
for (const property2 of (_a2 = input.properties) != null ? _a2 : []) {
|
|
19117
|
-
|
|
19239
|
+
let bindingKind = BindingKind.Property;
|
|
19240
|
+
if (property2.name.startsWith("attr.")) {
|
|
19241
|
+
property2.name = property2.name.substring("attr.".length);
|
|
19242
|
+
bindingKind = BindingKind.Attribute;
|
|
19243
|
+
}
|
|
19244
|
+
if (property2.isAnimation) {
|
|
19245
|
+
bindingKind = BindingKind.Animation;
|
|
19246
|
+
}
|
|
19247
|
+
const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, property2.name, bindingKind === BindingKind.Attribute).filter((context) => context !== SecurityContext.NONE);
|
|
19248
|
+
ingestHostProperty(job, property2, bindingKind, false, securityContexts);
|
|
19118
19249
|
}
|
|
19119
19250
|
for (const [name, expr] of (_b2 = Object.entries(input.attributes)) != null ? _b2 : []) {
|
|
19120
|
-
|
|
19251
|
+
const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, name, true).filter((context) => context !== SecurityContext.NONE);
|
|
19252
|
+
ingestHostAttribute(job, name, expr, securityContexts);
|
|
19121
19253
|
}
|
|
19122
19254
|
for (const event of (_c2 = input.events) != null ? _c2 : []) {
|
|
19123
19255
|
ingestHostEvent(job, event);
|
|
19124
19256
|
}
|
|
19125
19257
|
return job;
|
|
19126
19258
|
}
|
|
19127
|
-
function ingestHostProperty(job, property2, isTextAttribute) {
|
|
19259
|
+
function ingestHostProperty(job, property2, bindingKind, isTextAttribute, securityContexts) {
|
|
19128
19260
|
let expression;
|
|
19129
19261
|
const ast = property2.expression.ast;
|
|
19130
19262
|
if (ast instanceof Interpolation) {
|
|
@@ -19132,33 +19264,27 @@ function ingestHostProperty(job, property2, isTextAttribute) {
|
|
|
19132
19264
|
} else {
|
|
19133
19265
|
expression = convertAst(ast, job, property2.sourceSpan);
|
|
19134
19266
|
}
|
|
19135
|
-
|
|
19136
|
-
if (property2.name.startsWith("attr.")) {
|
|
19137
|
-
property2.name = property2.name.substring("attr.".length);
|
|
19138
|
-
bindingKind = BindingKind.Attribute;
|
|
19139
|
-
}
|
|
19140
|
-
if (property2.isAnimation) {
|
|
19141
|
-
bindingKind = BindingKind.Animation;
|
|
19142
|
-
}
|
|
19143
|
-
job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, null, property2.sourceSpan));
|
|
19267
|
+
job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, securityContexts, isTextAttribute, false, null, null, property2.sourceSpan));
|
|
19144
19268
|
}
|
|
19145
|
-
function ingestHostAttribute(job, name, value) {
|
|
19269
|
+
function ingestHostAttribute(job, name, value, securityContexts) {
|
|
19146
19270
|
const attrBinding = createBindingOp(
|
|
19147
19271
|
job.root.xref,
|
|
19148
19272
|
BindingKind.Attribute,
|
|
19149
19273
|
name,
|
|
19150
19274
|
value,
|
|
19151
19275
|
null,
|
|
19152
|
-
|
|
19276
|
+
securityContexts,
|
|
19153
19277
|
true,
|
|
19154
19278
|
false,
|
|
19155
19279
|
null,
|
|
19280
|
+
null,
|
|
19156
19281
|
null
|
|
19157
19282
|
);
|
|
19158
19283
|
job.root.update.push(attrBinding);
|
|
19159
19284
|
}
|
|
19160
19285
|
function ingestHostEvent(job, event) {
|
|
19161
|
-
const
|
|
19286
|
+
const [phase, target] = event.type === 0 ? [null, event.targetOrPhase] : [event.targetOrPhase, null];
|
|
19287
|
+
const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, [], phase, target, true, event.sourceSpan);
|
|
19162
19288
|
eventBinding.handlerOps.push(createStatementOp(new ReturnStatement(convertAst(event.handler.ast, job, event.sourceSpan), event.handlerSpan)));
|
|
19163
19289
|
job.root.create.push(eventBinding);
|
|
19164
19290
|
}
|
|
@@ -19198,14 +19324,17 @@ function ingestElement(unit, element2) {
|
|
|
19198
19324
|
const [namespaceKey, elementName] = splitNsName(element2.name);
|
|
19199
19325
|
const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan);
|
|
19200
19326
|
unit.create.push(startOp);
|
|
19201
|
-
|
|
19327
|
+
ingestElementBindings(unit, startOp, element2);
|
|
19202
19328
|
ingestReferences(startOp, element2);
|
|
19329
|
+
let i18nBlockId = null;
|
|
19330
|
+
if (element2.i18n instanceof Message) {
|
|
19331
|
+
i18nBlockId = unit.job.allocateXrefId();
|
|
19332
|
+
unit.create.push(createI18nStartOp(i18nBlockId, element2.i18n));
|
|
19333
|
+
}
|
|
19203
19334
|
ingestNodes(unit, element2.children);
|
|
19204
19335
|
const endOp = createElementEndOp(id, (_a2 = element2.endSourceSpan) != null ? _a2 : element2.startSourceSpan);
|
|
19205
19336
|
unit.create.push(endOp);
|
|
19206
|
-
if (
|
|
19207
|
-
const i18nBlockId = unit.job.allocateXrefId();
|
|
19208
|
-
OpList.insertAfter(createI18nStartOp(i18nBlockId, element2.i18n), startOp);
|
|
19337
|
+
if (i18nBlockId !== null) {
|
|
19209
19338
|
OpList.insertBefore(createI18nEndOp(i18nBlockId), endOp);
|
|
19210
19339
|
}
|
|
19211
19340
|
}
|
|
@@ -19225,7 +19354,7 @@ function ingestTemplate(unit, tmpl) {
|
|
|
19225
19354
|
const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
|
|
19226
19355
|
const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
|
|
19227
19356
|
unit.create.push(templateOp);
|
|
19228
|
-
|
|
19357
|
+
ingestTemplateBindings(unit, templateOp, tmpl, templateKind);
|
|
19229
19358
|
ingestReferences(templateOp, tmpl);
|
|
19230
19359
|
ingestNodes(childView, tmpl.children);
|
|
19231
19360
|
for (const { name, value } of tmpl.variables) {
|
|
@@ -19244,7 +19373,8 @@ function ingestContent(unit, content) {
|
|
|
19244
19373
|
const attrs = content.attributes.flatMap((a) => [a.name, a.value]);
|
|
19245
19374
|
const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, attrs, content.sourceSpan);
|
|
19246
19375
|
for (const attr of content.attributes) {
|
|
19247
|
-
|
|
19376
|
+
const securityContext = domSchema.securityContext(content.name, attr.name, true);
|
|
19377
|
+
unit.update.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
|
|
19248
19378
|
}
|
|
19249
19379
|
unit.create.push(op);
|
|
19250
19380
|
}
|
|
@@ -19338,35 +19468,38 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
19338
19468
|
const conditional2 = createConditionalOp(firstXref, firstSlotHandle, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan);
|
|
19339
19469
|
unit.update.push(conditional2);
|
|
19340
19470
|
}
|
|
19341
|
-
function ingestDeferView(unit, suffix, children, sourceSpan) {
|
|
19471
|
+
function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
|
|
19472
|
+
if (i18nMeta !== void 0 && !(i18nMeta instanceof BlockPlaceholder)) {
|
|
19473
|
+
throw Error("Unhandled i18n metadata type for defer block");
|
|
19474
|
+
}
|
|
19342
19475
|
if (children === void 0) {
|
|
19343
19476
|
return null;
|
|
19344
19477
|
}
|
|
19345
19478
|
const secondaryView = unit.job.allocateView(unit.xref);
|
|
19346
19479
|
ingestNodes(secondaryView, children);
|
|
19347
|
-
const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML,
|
|
19480
|
+
const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, i18nMeta, sourceSpan);
|
|
19348
19481
|
unit.create.push(templateOp);
|
|
19349
19482
|
return templateOp;
|
|
19350
19483
|
}
|
|
19351
19484
|
function ingestDeferBlock(unit, deferBlock) {
|
|
19352
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
19485
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
19353
19486
|
const blockMeta = unit.job.deferBlocksMeta.get(deferBlock);
|
|
19354
19487
|
if (blockMeta === void 0) {
|
|
19355
19488
|
throw new Error(`AssertionError: unable to find metadata for deferred block`);
|
|
19356
19489
|
}
|
|
19357
|
-
const main = ingestDeferView(unit, "", deferBlock.children, deferBlock.sourceSpan);
|
|
19358
|
-
const loading = ingestDeferView(unit, "Loading", (_a2 = deferBlock.loading) == null ? void 0 : _a2.
|
|
19359
|
-
const placeholder = ingestDeferView(unit, "Placeholder", (
|
|
19360
|
-
const error2 = ingestDeferView(unit, "Error", (
|
|
19490
|
+
const main = ingestDeferView(unit, "", deferBlock.i18n, deferBlock.children, deferBlock.sourceSpan);
|
|
19491
|
+
const loading = ingestDeferView(unit, "Loading", (_a2 = deferBlock.loading) == null ? void 0 : _a2.i18n, (_b2 = deferBlock.loading) == null ? void 0 : _b2.children, (_c2 = deferBlock.loading) == null ? void 0 : _c2.sourceSpan);
|
|
19492
|
+
const placeholder = ingestDeferView(unit, "Placeholder", (_d2 = deferBlock.placeholder) == null ? void 0 : _d2.i18n, (_e2 = deferBlock.placeholder) == null ? void 0 : _e2.children, (_f2 = deferBlock.placeholder) == null ? void 0 : _f2.sourceSpan);
|
|
19493
|
+
const error2 = ingestDeferView(unit, "Error", (_g = deferBlock.error) == null ? void 0 : _g.i18n, (_h = deferBlock.error) == null ? void 0 : _h.children, (_i = deferBlock.error) == null ? void 0 : _i.sourceSpan);
|
|
19361
19494
|
const deferXref = unit.job.allocateXrefId();
|
|
19362
19495
|
const deferOp = createDeferOp(deferXref, main.xref, main.handle, blockMeta, deferBlock.sourceSpan);
|
|
19363
|
-
deferOp.placeholderView = (
|
|
19364
|
-
deferOp.placeholderSlot = (
|
|
19365
|
-
deferOp.loadingSlot = (
|
|
19366
|
-
deferOp.errorSlot = (
|
|
19367
|
-
deferOp.placeholderMinimumTime = (
|
|
19368
|
-
deferOp.loadingMinimumTime = (
|
|
19369
|
-
deferOp.loadingAfterTime = (
|
|
19496
|
+
deferOp.placeholderView = (_j = placeholder == null ? void 0 : placeholder.xref) != null ? _j : null;
|
|
19497
|
+
deferOp.placeholderSlot = (_k = placeholder == null ? void 0 : placeholder.handle) != null ? _k : null;
|
|
19498
|
+
deferOp.loadingSlot = (_l = loading == null ? void 0 : loading.handle) != null ? _l : null;
|
|
19499
|
+
deferOp.errorSlot = (_m = error2 == null ? void 0 : error2.handle) != null ? _m : null;
|
|
19500
|
+
deferOp.placeholderMinimumTime = (_o = (_n = deferBlock.placeholder) == null ? void 0 : _n.minimumTime) != null ? _o : null;
|
|
19501
|
+
deferOp.loadingMinimumTime = (_q = (_p = deferBlock.loading) == null ? void 0 : _p.minimumTime) != null ? _q : null;
|
|
19502
|
+
deferOp.loadingAfterTime = (_s = (_r = deferBlock.loading) == null ? void 0 : _r.afterTime) != null ? _s : null;
|
|
19370
19503
|
unit.create.push(deferOp);
|
|
19371
19504
|
let prefetch = false;
|
|
19372
19505
|
let deferOnOps = [];
|
|
@@ -19448,7 +19581,7 @@ function ingestIcu(unit, icu) {
|
|
|
19448
19581
|
}
|
|
19449
19582
|
}
|
|
19450
19583
|
function ingestForBlock(unit, forBlock) {
|
|
19451
|
-
var _a2;
|
|
19584
|
+
var _a2, _b2, _c2;
|
|
19452
19585
|
const repeaterView = unit.job.allocateView(unit.xref);
|
|
19453
19586
|
const createRepeaterAlias = (ident, repeaterVar) => {
|
|
19454
19587
|
repeaterView.aliases.add({
|
|
@@ -19482,8 +19615,16 @@ function ingestForBlock(unit, forBlock) {
|
|
|
19482
19615
|
$odd: forBlock.contextVariables.$odd.name,
|
|
19483
19616
|
$implicit: forBlock.item.name
|
|
19484
19617
|
};
|
|
19618
|
+
if (forBlock.i18n !== void 0 && !(forBlock.i18n instanceof BlockPlaceholder)) {
|
|
19619
|
+
throw Error("AssertionError: Unhandled i18n metadata type or @for");
|
|
19620
|
+
}
|
|
19621
|
+
if (((_a2 = forBlock.empty) == null ? void 0 : _a2.i18n) !== void 0 && !(forBlock.empty.i18n instanceof BlockPlaceholder)) {
|
|
19622
|
+
throw Error("AssertionError: Unhandled i18n metadata type or @empty");
|
|
19623
|
+
}
|
|
19624
|
+
const i18nPlaceholder = forBlock.i18n;
|
|
19625
|
+
const emptyI18nPlaceholder = (_b2 = forBlock.empty) == null ? void 0 : _b2.i18n;
|
|
19485
19626
|
const tagName = ingestControlFlowInsertionPoint(unit, repeaterView.xref, forBlock);
|
|
19486
|
-
const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (
|
|
19627
|
+
const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_c2 = emptyView == null ? void 0 : emptyView.xref) != null ? _c2 : null, tagName, track, varNames, i18nPlaceholder, emptyI18nPlaceholder, forBlock.sourceSpan);
|
|
19487
19628
|
unit.create.push(repeaterCreate2);
|
|
19488
19629
|
const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan));
|
|
19489
19630
|
const repeater2 = createRepeaterOp(repeaterCreate2.xref, repeaterCreate2.handle, expression, forBlock.sourceSpan);
|
|
@@ -19571,120 +19712,128 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
19571
19712
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan == null ? void 0 : baseSourceSpan.start.file.url}"`);
|
|
19572
19713
|
}
|
|
19573
19714
|
}
|
|
19715
|
+
function convertAstWithInterpolation(job, value, i18nMeta) {
|
|
19716
|
+
var _a2, _b2;
|
|
19717
|
+
let expression;
|
|
19718
|
+
if (value instanceof Interpolation) {
|
|
19719
|
+
expression = new Interpolation2(value.strings, value.expressions.map((e) => convertAst(e, job, null)), Object.keys((_b2 = (_a2 = asMessage(i18nMeta)) == null ? void 0 : _a2.placeholders) != null ? _b2 : {}));
|
|
19720
|
+
} else if (value instanceof AST) {
|
|
19721
|
+
expression = convertAst(value, job, null);
|
|
19722
|
+
} else {
|
|
19723
|
+
expression = literal(value);
|
|
19724
|
+
}
|
|
19725
|
+
return expression;
|
|
19726
|
+
}
|
|
19727
|
+
var BINDING_KINDS = /* @__PURE__ */ new Map([
|
|
19728
|
+
[0, BindingKind.Property],
|
|
19729
|
+
[1, BindingKind.Attribute],
|
|
19730
|
+
[2, BindingKind.ClassName],
|
|
19731
|
+
[3, BindingKind.StyleProperty],
|
|
19732
|
+
[4, BindingKind.Animation]
|
|
19733
|
+
]);
|
|
19574
19734
|
function isPlainTemplate(tmpl) {
|
|
19575
19735
|
var _a2;
|
|
19576
|
-
return splitNsName((_a2 = tmpl.tagName) != null ? _a2 : "")[1] ===
|
|
19577
|
-
}
|
|
19578
|
-
function
|
|
19579
|
-
|
|
19580
|
-
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
flags |= BindingFlags.BindingTargetsTemplate;
|
|
19585
|
-
}
|
|
19586
|
-
const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
|
|
19587
|
-
for (const attr of element2.templateAttrs) {
|
|
19588
|
-
if (attr instanceof TextAttribute) {
|
|
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);
|
|
19591
|
-
} else {
|
|
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);
|
|
19594
|
-
}
|
|
19595
|
-
}
|
|
19736
|
+
return splitNsName((_a2 = tmpl.tagName) != null ? _a2 : "")[1] === NG_TEMPLATE_TAG_NAME;
|
|
19737
|
+
}
|
|
19738
|
+
function asMessage(i18nMeta) {
|
|
19739
|
+
if (i18nMeta == null) {
|
|
19740
|
+
return null;
|
|
19741
|
+
}
|
|
19742
|
+
if (!(i18nMeta instanceof Message)) {
|
|
19743
|
+
throw Error(`Expected i18n meta to be a Message, but got: ${i18nMeta.constructor.name}`);
|
|
19596
19744
|
}
|
|
19745
|
+
return i18nMeta;
|
|
19746
|
+
}
|
|
19747
|
+
function ingestElementBindings(unit, op, element2) {
|
|
19748
|
+
var _a2;
|
|
19749
|
+
let bindings = new Array();
|
|
19597
19750
|
for (const attr of element2.attributes) {
|
|
19598
|
-
|
|
19599
|
-
|
|
19751
|
+
const securityContext = domSchema.securityContext(element2.name, attr.name, true);
|
|
19752
|
+
bindings.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, convertAstWithInterpolation(unit.job, attr.value, attr.i18n), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
|
|
19600
19753
|
}
|
|
19601
19754
|
for (const input of element2.inputs) {
|
|
19602
|
-
|
|
19603
|
-
hasI18nAttributes || (hasI18nAttributes = input.i18n !== void 0);
|
|
19755
|
+
bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, (_a2 = asMessage(input.i18n)) != null ? _a2 : null, input.sourceSpan));
|
|
19604
19756
|
}
|
|
19757
|
+
unit.create.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.ExtractedAttribute));
|
|
19758
|
+
unit.update.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.Binding));
|
|
19605
19759
|
for (const output of element2.outputs) {
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
if (output.phase === null) {
|
|
19609
|
-
throw Error("Animation listener should have a phase");
|
|
19610
|
-
}
|
|
19611
|
-
}
|
|
19612
|
-
if (element2 instanceof Template && !isPlainTemplate(element2)) {
|
|
19613
|
-
unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null));
|
|
19614
|
-
continue;
|
|
19760
|
+
if (output.type === 1 && output.phase === null) {
|
|
19761
|
+
throw Error("Animation listener should have a phase");
|
|
19615
19762
|
}
|
|
19616
|
-
|
|
19617
|
-
|
|
19618
|
-
|
|
19619
|
-
|
|
19620
|
-
|
|
19621
|
-
|
|
19622
|
-
|
|
19623
|
-
|
|
19763
|
+
unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
|
|
19764
|
+
}
|
|
19765
|
+
if (bindings.some((b) => b == null ? void 0 : b.i18nMessage) !== null) {
|
|
19766
|
+
unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
|
|
19767
|
+
}
|
|
19768
|
+
}
|
|
19769
|
+
function ingestTemplateBindings(unit, op, template2, templateKind) {
|
|
19770
|
+
let bindings = new Array();
|
|
19771
|
+
for (const attr of template2.templateAttrs) {
|
|
19772
|
+
if (attr instanceof TextAttribute) {
|
|
19773
|
+
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
|
|
19774
|
+
bindings.push(createTemplateBinding(unit, op.xref, 1, attr.name, attr.value, null, securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan));
|
|
19624
19775
|
} else {
|
|
19625
|
-
|
|
19776
|
+
bindings.push(createTemplateBinding(unit, op.xref, attr.type, attr.name, astOf(attr.value), attr.unit, attr.securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan));
|
|
19626
19777
|
}
|
|
19627
|
-
|
|
19628
|
-
|
|
19778
|
+
}
|
|
19779
|
+
for (const attr of template2.attributes) {
|
|
19780
|
+
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
|
|
19781
|
+
bindings.push(createTemplateBinding(unit, op.xref, 1, attr.name, attr.value, null, securityContext, false, templateKind, asMessage(attr.i18n), attr.sourceSpan));
|
|
19782
|
+
}
|
|
19783
|
+
for (const input of template2.inputs) {
|
|
19784
|
+
bindings.push(createTemplateBinding(unit, op.xref, input.type, input.name, astOf(input.value), input.unit, input.securityContext, false, templateKind, asMessage(input.i18n), input.sourceSpan));
|
|
19785
|
+
}
|
|
19786
|
+
unit.create.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.ExtractedAttribute));
|
|
19787
|
+
unit.update.push(bindings.filter((b) => (b == null ? void 0 : b.kind) === OpKind.Binding));
|
|
19788
|
+
for (const output of template2.outputs) {
|
|
19789
|
+
if (output.type === 1 && output.phase === null) {
|
|
19790
|
+
throw Error("Animation listener should have a phase");
|
|
19791
|
+
}
|
|
19792
|
+
if (templateKind === TemplateKind.NgTemplate) {
|
|
19793
|
+
unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan));
|
|
19629
19794
|
}
|
|
19630
|
-
|
|
19631
|
-
|
|
19632
|
-
|
|
19633
|
-
const stmtOp = createStatementOp(new ExpressionStatement(expr, expr.sourceSpan));
|
|
19634
|
-
listenerOp.handlerOps.push(stmtOp);
|
|
19795
|
+
if (templateKind === TemplateKind.Structural && output.type !== 1) {
|
|
19796
|
+
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, output.name, false);
|
|
19797
|
+
unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null, null, securityContext));
|
|
19635
19798
|
}
|
|
19636
|
-
listenerOp.handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
|
|
19637
|
-
unit.create.push(listenerOp);
|
|
19638
19799
|
}
|
|
19639
|
-
if (
|
|
19800
|
+
if (bindings.some((b) => b == null ? void 0 : b.i18nMessage) !== null) {
|
|
19640
19801
|
unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
|
|
19641
19802
|
}
|
|
19642
19803
|
}
|
|
19643
|
-
|
|
19644
|
-
|
|
19645
|
-
|
|
19646
|
-
|
|
19647
|
-
|
|
19648
|
-
|
|
19649
|
-
|
|
19650
|
-
|
|
19651
|
-
(function(BindingFlags2) {
|
|
19652
|
-
BindingFlags2[BindingFlags2["None"] = 0] = "None";
|
|
19653
|
-
BindingFlags2[BindingFlags2["TextValue"] = 1] = "TextValue";
|
|
19654
|
-
BindingFlags2[BindingFlags2["BindingTargetsTemplate"] = 2] = "BindingTargetsTemplate";
|
|
19655
|
-
BindingFlags2[BindingFlags2["IsStructuralTemplateAttribute"] = 4] = "IsStructuralTemplateAttribute";
|
|
19656
|
-
BindingFlags2[BindingFlags2["OnNgTemplateElement"] = 8] = "OnNgTemplateElement";
|
|
19657
|
-
})(BindingFlags || (BindingFlags = {}));
|
|
19658
|
-
function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags, i18nMeta) {
|
|
19659
|
-
if (value instanceof ASTWithSource) {
|
|
19660
|
-
value = value.ast;
|
|
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}`);
|
|
19804
|
+
function createTemplateBinding(view, xref, type, name, value, unit, securityContext, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) {
|
|
19805
|
+
const isTextBinding = typeof value === "string";
|
|
19806
|
+
if (templateKind === TemplateKind.Structural) {
|
|
19807
|
+
if (!isStructuralTemplateAttribute && (type === 0 || type === 2 || type === 3)) {
|
|
19808
|
+
return createExtractedAttributeOp(xref, BindingKind.Property, name, null, null, i18nMessage, securityContext);
|
|
19809
|
+
}
|
|
19810
|
+
if (!isTextBinding && (type === 1 || type === 4)) {
|
|
19811
|
+
return null;
|
|
19666
19812
|
}
|
|
19667
|
-
i18nContext = view.job.allocateXrefId();
|
|
19668
|
-
view.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, i18nMeta, null));
|
|
19669
|
-
}
|
|
19670
|
-
if (flags & BindingFlags.OnNgTemplateElement && !(flags & BindingFlags.BindingTargetsTemplate) && type === 0) {
|
|
19671
|
-
view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null, i18nContext));
|
|
19672
|
-
return;
|
|
19673
19813
|
}
|
|
19674
|
-
let
|
|
19675
|
-
if (
|
|
19676
|
-
|
|
19677
|
-
|
|
19678
|
-
i18nPlaceholders = Object.keys(i18nMeta.placeholders);
|
|
19814
|
+
let bindingType = BINDING_KINDS.get(type);
|
|
19815
|
+
if (templateKind === TemplateKind.NgTemplate) {
|
|
19816
|
+
if (type === 2 || type === 3 || type === 1 && !isTextBinding) {
|
|
19817
|
+
bindingType = BindingKind.Property;
|
|
19679
19818
|
}
|
|
19680
|
-
expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)), i18nPlaceholders);
|
|
19681
|
-
} else if (value instanceof AST) {
|
|
19682
|
-
expression = convertAst(value, view.job, null);
|
|
19683
|
-
} else {
|
|
19684
|
-
expression = value;
|
|
19685
19819
|
}
|
|
19686
|
-
|
|
19687
|
-
|
|
19820
|
+
return createBindingOp(xref, bindingType, name, convertAstWithInterpolation(view.job, value, i18nMessage), unit, securityContext, isTextBinding, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan);
|
|
19821
|
+
}
|
|
19822
|
+
function makeListenerHandlerOps(unit, handler, handlerSpan) {
|
|
19823
|
+
handler = astOf(handler);
|
|
19824
|
+
const handlerOps = new Array();
|
|
19825
|
+
let handlerExprs = handler instanceof Chain ? handler.expressions : [handler];
|
|
19826
|
+
if (handlerExprs.length === 0) {
|
|
19827
|
+
throw new Error("Expected listener to have non-empty expression list.");
|
|
19828
|
+
}
|
|
19829
|
+
const expressions = handlerExprs.map((expr) => convertAst(expr, unit.job, handlerSpan));
|
|
19830
|
+
const returnExpr = expressions.pop();
|
|
19831
|
+
handlerOps.push(...expressions.map((e) => createStatementOp(new ExpressionStatement(e, e.sourceSpan))));
|
|
19832
|
+
handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
|
|
19833
|
+
return handlerOps;
|
|
19834
|
+
}
|
|
19835
|
+
function astOf(ast) {
|
|
19836
|
+
return ast instanceof ASTWithSource ? ast.ast : ast;
|
|
19688
19837
|
}
|
|
19689
19838
|
function ingestReferences(op, element2) {
|
|
19690
19839
|
assertIsArray(op.localRefs);
|
|
@@ -19724,18 +19873,19 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
19724
19873
|
}
|
|
19725
19874
|
if (root !== null) {
|
|
19726
19875
|
for (const attr of root.attributes) {
|
|
19727
|
-
|
|
19876
|
+
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
|
|
19877
|
+
unit.update.push(createBindingOp(xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
|
|
19728
19878
|
}
|
|
19729
19879
|
const tagName = root instanceof Element ? root.name : root.tagName;
|
|
19730
|
-
return tagName ===
|
|
19880
|
+
return tagName === NG_TEMPLATE_TAG_NAME ? null : tagName;
|
|
19731
19881
|
}
|
|
19732
19882
|
return null;
|
|
19733
19883
|
}
|
|
19734
19884
|
|
|
19735
|
-
// bazel-out/
|
|
19885
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
|
|
19736
19886
|
var USE_TEMPLATE_PIPELINE = false;
|
|
19737
19887
|
|
|
19738
|
-
// bazel-out/
|
|
19888
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
|
|
19739
19889
|
var IMPORTANT_FLAG = "!important";
|
|
19740
19890
|
var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
|
|
19741
19891
|
var StylingBuilder = class {
|
|
@@ -20068,7 +20218,7 @@ function isEmptyExpression(ast) {
|
|
|
20068
20218
|
return ast instanceof EmptyExpr;
|
|
20069
20219
|
}
|
|
20070
20220
|
|
|
20071
|
-
// bazel-out/
|
|
20221
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
|
|
20072
20222
|
var HtmlParser = class extends Parser2 {
|
|
20073
20223
|
constructor() {
|
|
20074
20224
|
super(getHtmlTagDefinition);
|
|
@@ -20078,7 +20228,7 @@ var HtmlParser = class extends Parser2 {
|
|
|
20078
20228
|
}
|
|
20079
20229
|
};
|
|
20080
20230
|
|
|
20081
|
-
// bazel-out/
|
|
20231
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
|
|
20082
20232
|
var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
|
|
20083
20233
|
var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
|
|
20084
20234
|
var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
|
|
@@ -20144,7 +20294,7 @@ function visitAllWithSiblings(visitor, nodes) {
|
|
|
20144
20294
|
return result;
|
|
20145
20295
|
}
|
|
20146
20296
|
|
|
20147
|
-
// bazel-out/
|
|
20297
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
|
|
20148
20298
|
var PROPERTY_PARTS_SEPARATOR = ".";
|
|
20149
20299
|
var ATTRIBUTE_PREFIX = "attr";
|
|
20150
20300
|
var CLASS_PREFIX = "class";
|
|
@@ -20464,7 +20614,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
|
|
|
20464
20614
|
return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
|
|
20465
20615
|
}
|
|
20466
20616
|
|
|
20467
|
-
// bazel-out/
|
|
20617
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
|
|
20468
20618
|
function isStyleUrlResolvable(url) {
|
|
20469
20619
|
if (url == null || url.length === 0 || url[0] == "/")
|
|
20470
20620
|
return false;
|
|
@@ -20473,7 +20623,7 @@ function isStyleUrlResolvable(url) {
|
|
|
20473
20623
|
}
|
|
20474
20624
|
var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
|
|
20475
20625
|
|
|
20476
|
-
// bazel-out/
|
|
20626
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
|
|
20477
20627
|
var NG_CONTENT_SELECT_ATTR = "select";
|
|
20478
20628
|
var LINK_ELEMENT = "link";
|
|
20479
20629
|
var LINK_STYLE_REL_ATTR = "rel";
|
|
@@ -20543,7 +20693,7 @@ function normalizeNgContentSelect(selectAttr) {
|
|
|
20543
20693
|
return selectAttr;
|
|
20544
20694
|
}
|
|
20545
20695
|
|
|
20546
|
-
// bazel-out/
|
|
20696
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
|
|
20547
20697
|
var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
|
|
20548
20698
|
var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
|
|
20549
20699
|
var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
|
|
@@ -20834,7 +20984,7 @@ function stripOptionalParentheses(param, errors) {
|
|
|
20834
20984
|
return expression.slice(start, end);
|
|
20835
20985
|
}
|
|
20836
20986
|
|
|
20837
|
-
// bazel-out/
|
|
20987
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
|
|
20838
20988
|
var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
|
|
20839
20989
|
var SEPARATOR_PATTERN = /^\s$/;
|
|
20840
20990
|
var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
|
|
@@ -21098,7 +21248,7 @@ function parseDeferredTime(value) {
|
|
|
21098
21248
|
return parseFloat(time) * (units === "s" ? 1e3 : 1);
|
|
21099
21249
|
}
|
|
21100
21250
|
|
|
21101
|
-
// bazel-out/
|
|
21251
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
|
|
21102
21252
|
var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
|
|
21103
21253
|
var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
|
|
21104
21254
|
var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
|
|
@@ -21233,7 +21383,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
|
|
|
21233
21383
|
return { triggers, prefetchTriggers };
|
|
21234
21384
|
}
|
|
21235
21385
|
|
|
21236
|
-
// bazel-out/
|
|
21386
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
|
|
21237
21387
|
var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
|
|
21238
21388
|
var KW_BIND_IDX = 1;
|
|
21239
21389
|
var KW_LET_IDX = 2;
|
|
@@ -21664,7 +21814,7 @@ function textContents(node) {
|
|
|
21664
21814
|
}
|
|
21665
21815
|
}
|
|
21666
21816
|
|
|
21667
|
-
// bazel-out/
|
|
21817
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
|
|
21668
21818
|
var TagType;
|
|
21669
21819
|
(function(TagType2) {
|
|
21670
21820
|
TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
|
|
@@ -21809,21 +21959,21 @@ function serializePlaceholderValue(value) {
|
|
|
21809
21959
|
}
|
|
21810
21960
|
}
|
|
21811
21961
|
|
|
21812
|
-
// bazel-out/
|
|
21962
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
|
|
21813
21963
|
var NG_CONTENT_SELECT_ATTR2 = "select";
|
|
21814
21964
|
var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
|
|
21815
21965
|
var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
|
|
21816
|
-
var
|
|
21817
|
-
var
|
|
21966
|
+
var NG_TEMPLATE_TAG_NAME2 = "ng-template";
|
|
21967
|
+
var GLOBAL_TARGET_RESOLVERS2 = /* @__PURE__ */ new Map([["window", Identifiers.resolveWindow], ["document", Identifiers.resolveDocument], ["body", Identifiers.resolveBody]]);
|
|
21818
21968
|
var LEADING_TRIVIA_CHARS = [" ", "\n", "\r", " "];
|
|
21819
21969
|
function renderFlagCheckIfStmt(flags, statements) {
|
|
21820
21970
|
return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null, false), statements);
|
|
21821
21971
|
}
|
|
21822
21972
|
function prepareEventListenerParameters(eventAst, handlerName = null, scope = null) {
|
|
21823
21973
|
const { type, name, target, phase, handler } = eventAst;
|
|
21824
|
-
if (target && !
|
|
21974
|
+
if (target && !GLOBAL_TARGET_RESOLVERS2.has(target)) {
|
|
21825
21975
|
throw new Error(`Unexpected global target '${target}' defined for '${name}' event.
|
|
21826
|
-
Supported list of global targets: ${Array.from(
|
|
21976
|
+
Supported list of global targets: ${Array.from(GLOBAL_TARGET_RESOLVERS2.keys())}.`);
|
|
21827
21977
|
}
|
|
21828
21978
|
const eventArgumentName = "$event";
|
|
21829
21979
|
const implicitReceiverAccesses = /* @__PURE__ */ new Set();
|
|
@@ -21856,7 +22006,7 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
|
|
|
21856
22006
|
if (target) {
|
|
21857
22007
|
params.push(
|
|
21858
22008
|
literal(false),
|
|
21859
|
-
importExpr(
|
|
22009
|
+
importExpr(GLOBAL_TARGET_RESOLVERS2.get(target))
|
|
21860
22010
|
);
|
|
21861
22011
|
}
|
|
21862
22012
|
return params;
|
|
@@ -22402,10 +22552,10 @@ var TemplateDefinitionBuilder = class {
|
|
|
22402
22552
|
var _a2;
|
|
22403
22553
|
const tagNameWithoutNamespace = template2.tagName ? splitNsName(template2.tagName)[1] : template2.tagName;
|
|
22404
22554
|
const contextNameSuffix = template2.tagName ? "_" + sanitizeIdentifier(template2.tagName) : "";
|
|
22405
|
-
const attrsExprs = this.getAttributeExpressions(
|
|
22555
|
+
const attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME2, template2.attributes, template2.inputs, template2.outputs, void 0, template2.templateAttrs);
|
|
22406
22556
|
const templateIndex = this.createEmbeddedTemplateFn(tagNameWithoutNamespace, template2.children, contextNameSuffix, template2.sourceSpan, template2.variables, attrsExprs, template2.references, template2.i18n);
|
|
22407
22557
|
this.templatePropertyBindings(templateIndex, template2.templateAttrs);
|
|
22408
|
-
if (tagNameWithoutNamespace ===
|
|
22558
|
+
if (tagNameWithoutNamespace === NG_TEMPLATE_TAG_NAME2) {
|
|
22409
22559
|
const [i18nInputs, inputs] = partitionArray(template2.inputs, hasI18nMeta);
|
|
22410
22560
|
if (i18nInputs.length > 0) {
|
|
22411
22561
|
this.i18nAttributesInstruction(templateIndex, i18nInputs, (_a2 = template2.startSourceSpan) != null ? _a2 : template2.sourceSpan);
|
|
@@ -22646,8 +22796,8 @@ var TemplateDefinitionBuilder = class {
|
|
|
22646
22796
|
}
|
|
22647
22797
|
if (root !== null) {
|
|
22648
22798
|
const name = root instanceof Element ? root.name : root.tagName;
|
|
22649
|
-
tagName = name ===
|
|
22650
|
-
attrsExprs = this.getAttributeExpressions(
|
|
22799
|
+
tagName = name === NG_TEMPLATE_TAG_NAME2 ? null : name;
|
|
22800
|
+
attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME2, root.attributes, root.inputs, []);
|
|
22651
22801
|
}
|
|
22652
22802
|
return { tagName, attrsExprs };
|
|
22653
22803
|
}
|
|
@@ -23486,7 +23636,7 @@ function createClosureModeGuard2() {
|
|
|
23486
23636
|
return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
|
|
23487
23637
|
}
|
|
23488
23638
|
|
|
23489
|
-
// bazel-out/
|
|
23639
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
|
|
23490
23640
|
var ATTR_REGEX = /attr\.([^\]]+)/;
|
|
23491
23641
|
var COMPONENT_VARIABLE = "%COMP%";
|
|
23492
23642
|
var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
|
@@ -23807,6 +23957,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
23807
23957
|
}
|
|
23808
23958
|
const hostJob = ingestHostBinding({
|
|
23809
23959
|
componentName: name,
|
|
23960
|
+
componentSelector: selector,
|
|
23810
23961
|
properties: bindings,
|
|
23811
23962
|
events: eventBindings,
|
|
23812
23963
|
attributes: hostBindingsMetadata.attributes
|
|
@@ -24100,7 +24251,7 @@ function createHostDirectivesMappingArray(mapping) {
|
|
|
24100
24251
|
return elements.length > 0 ? literalArr(elements) : null;
|
|
24101
24252
|
}
|
|
24102
24253
|
|
|
24103
|
-
// bazel-out/
|
|
24254
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
|
|
24104
24255
|
var R3TargetBinder = class {
|
|
24105
24256
|
constructor(directiveMatcher) {
|
|
24106
24257
|
this.directiveMatcher = directiveMatcher;
|
|
@@ -24705,11 +24856,11 @@ function extractScopedNodeEntities(rootScope) {
|
|
|
24705
24856
|
return templateEntities;
|
|
24706
24857
|
}
|
|
24707
24858
|
|
|
24708
|
-
// bazel-out/
|
|
24859
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/resource_loader.mjs
|
|
24709
24860
|
var ResourceLoader = class {
|
|
24710
24861
|
};
|
|
24711
24862
|
|
|
24712
|
-
// bazel-out/
|
|
24863
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
|
|
24713
24864
|
var CompilerFacadeImpl = class {
|
|
24714
24865
|
constructor(jitEvaluator = new JitEvaluator()) {
|
|
24715
24866
|
this.jitEvaluator = jitEvaluator;
|
|
@@ -25261,17 +25412,17 @@ function publishFacade(global) {
|
|
|
25261
25412
|
ng.\u0275compilerFacade = new CompilerFacadeImpl();
|
|
25262
25413
|
}
|
|
25263
25414
|
|
|
25264
|
-
// bazel-out/
|
|
25265
|
-
var VERSION2 = new Version("17.0.
|
|
25415
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
25416
|
+
var VERSION2 = new Version("17.0.7");
|
|
25266
25417
|
|
|
25267
|
-
// bazel-out/
|
|
25418
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
25268
25419
|
var _VisitorMode;
|
|
25269
25420
|
(function(_VisitorMode2) {
|
|
25270
25421
|
_VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
|
|
25271
25422
|
_VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
|
|
25272
25423
|
})(_VisitorMode || (_VisitorMode = {}));
|
|
25273
25424
|
|
|
25274
|
-
// bazel-out/
|
|
25425
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
|
|
25275
25426
|
var XmlTagDefinition = class {
|
|
25276
25427
|
constructor() {
|
|
25277
25428
|
this.closedByParent = false;
|
|
@@ -25293,7 +25444,7 @@ var XmlTagDefinition = class {
|
|
|
25293
25444
|
};
|
|
25294
25445
|
var _TAG_DEFINITION = new XmlTagDefinition();
|
|
25295
25446
|
|
|
25296
|
-
// bazel-out/
|
|
25447
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
|
|
25297
25448
|
var FactoryTarget2;
|
|
25298
25449
|
(function(FactoryTarget3) {
|
|
25299
25450
|
FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
|
|
@@ -25303,15 +25454,19 @@ var FactoryTarget2;
|
|
|
25303
25454
|
FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
|
|
25304
25455
|
})(FactoryTarget2 || (FactoryTarget2 = {}));
|
|
25305
25456
|
|
|
25306
|
-
// bazel-out/
|
|
25457
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler.mjs
|
|
25307
25458
|
publishFacade(_global);
|
|
25308
25459
|
|
|
25309
|
-
// bazel-out/
|
|
25460
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
|
|
25310
25461
|
var ngtemplate = "ng-template";
|
|
25311
25462
|
var boundngifelse = "[ngIfElse]";
|
|
25312
25463
|
var boundngifthenelse = "[ngIfThenElse]";
|
|
25313
25464
|
var boundngifthen = "[ngIfThen]";
|
|
25314
25465
|
var nakedngfor = "ngFor";
|
|
25466
|
+
var startMarker = "\u25EC";
|
|
25467
|
+
var endMarker = "\u2722";
|
|
25468
|
+
var startI18nMarker = "\u2688";
|
|
25469
|
+
var endI18nMarker = "\u2689";
|
|
25315
25470
|
function allFormsOf(selector) {
|
|
25316
25471
|
return [
|
|
25317
25472
|
selector,
|
|
@@ -25464,6 +25619,7 @@ var AnalyzedFile = class {
|
|
|
25464
25619
|
constructor() {
|
|
25465
25620
|
__publicField(this, "ranges", []);
|
|
25466
25621
|
__publicField(this, "removeCommonModule", false);
|
|
25622
|
+
__publicField(this, "canRemoveImports", false);
|
|
25467
25623
|
__publicField(this, "sourceFilePath", "");
|
|
25468
25624
|
}
|
|
25469
25625
|
getSortedRanges() {
|
|
@@ -25511,6 +25667,18 @@ var CommonCollector = class extends RecursiveVisitor {
|
|
|
25511
25667
|
return commonModulePipes.some((regexp) => regexp.test(input));
|
|
25512
25668
|
}
|
|
25513
25669
|
};
|
|
25670
|
+
var i18nCollector = class extends RecursiveVisitor {
|
|
25671
|
+
constructor() {
|
|
25672
|
+
super(...arguments);
|
|
25673
|
+
__publicField(this, "elements", []);
|
|
25674
|
+
}
|
|
25675
|
+
visitElement(el) {
|
|
25676
|
+
if (el.attrs.find((a) => a.name === "i18n") !== void 0) {
|
|
25677
|
+
this.elements.push(el);
|
|
25678
|
+
}
|
|
25679
|
+
super.visitElement(el, null);
|
|
25680
|
+
}
|
|
25681
|
+
};
|
|
25514
25682
|
var ElementCollector = class extends RecursiveVisitor {
|
|
25515
25683
|
constructor(_attributes = []) {
|
|
25516
25684
|
super();
|
|
@@ -25589,7 +25757,7 @@ var TemplateCollector = class extends RecursiveVisitor {
|
|
|
25589
25757
|
}
|
|
25590
25758
|
};
|
|
25591
25759
|
|
|
25592
|
-
// bazel-out/
|
|
25760
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
|
|
25593
25761
|
var import_path2 = require("path");
|
|
25594
25762
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
25595
25763
|
var importRemovals = [
|
|
@@ -25604,6 +25772,11 @@ var importRemovals = [
|
|
|
25604
25772
|
"NgSwitchDefault"
|
|
25605
25773
|
];
|
|
25606
25774
|
var importWithCommonRemovals = [...importRemovals, "CommonModule"];
|
|
25775
|
+
var startMarkerRegex = new RegExp(startMarker, "gm");
|
|
25776
|
+
var endMarkerRegex = new RegExp(endMarker, "gm");
|
|
25777
|
+
var startI18nMarkerRegex = new RegExp(startI18nMarker, "gm");
|
|
25778
|
+
var endI18nMarkerRegex = new RegExp(endI18nMarker, "gm");
|
|
25779
|
+
var replaceMarkerRegex = new RegExp(`${startMarker}|${endMarker}`, "gm");
|
|
25607
25780
|
function analyze(sourceFile, analyzedFiles) {
|
|
25608
25781
|
forEachClass(sourceFile, (node) => {
|
|
25609
25782
|
if (import_typescript5.default.isClassDeclaration(node)) {
|
|
@@ -25724,12 +25897,13 @@ function parseTemplate2(template2) {
|
|
|
25724
25897
|
preserveLineEndings: true
|
|
25725
25898
|
});
|
|
25726
25899
|
if (parsed.errors && parsed.errors.length > 0) {
|
|
25727
|
-
|
|
25900
|
+
const errors = parsed.errors.map((e) => ({ type: "parse", error: e }));
|
|
25901
|
+
return { tree: void 0, errors };
|
|
25728
25902
|
}
|
|
25729
25903
|
} catch (e) {
|
|
25730
|
-
return
|
|
25904
|
+
return { tree: void 0, errors: [{ type: "parse", error: e }] };
|
|
25731
25905
|
}
|
|
25732
|
-
return parsed;
|
|
25906
|
+
return { tree: parsed, errors: [] };
|
|
25733
25907
|
}
|
|
25734
25908
|
function calculateNesting(visitor, hasLineBreaks2) {
|
|
25735
25909
|
let nestedQueue = [];
|
|
@@ -25766,9 +25940,9 @@ function reduceNestingOffset(el, nestLevel, offset, postOffsets) {
|
|
|
25766
25940
|
function getTemplates(template2) {
|
|
25767
25941
|
var _a2;
|
|
25768
25942
|
const parsed = parseTemplate2(template2);
|
|
25769
|
-
if (parsed !==
|
|
25943
|
+
if (parsed.tree !== void 0) {
|
|
25770
25944
|
const visitor = new TemplateCollector();
|
|
25771
|
-
visitAll2(visitor, parsed.rootNodes);
|
|
25945
|
+
visitAll2(visitor, parsed.tree.rootNodes);
|
|
25772
25946
|
for (let [key, tmpl] of visitor.templates) {
|
|
25773
25947
|
const escapeKey = escapeRegExp(key.slice(1));
|
|
25774
25948
|
const regex = new RegExp(`[^a-zA-Z0-9-<(']${escapeKey}\\W`, "gm");
|
|
@@ -25821,7 +25995,7 @@ function processNgTemplates(template2) {
|
|
|
25821
25995
|
template2 = template2.replace(replaceRegex, t.children);
|
|
25822
25996
|
}
|
|
25823
25997
|
if (t.count === matches.length + 1 && safeToRemove) {
|
|
25824
|
-
template2 = template2.replace(t.contents,
|
|
25998
|
+
template2 = template2.replace(t.contents, `${startMarker}${endMarker}`);
|
|
25825
25999
|
}
|
|
25826
26000
|
updateTemplates(template2, templates);
|
|
25827
26001
|
}
|
|
@@ -25835,20 +26009,19 @@ function processNgTemplates(template2) {
|
|
|
25835
26009
|
function replaceRemainingPlaceholders(template2) {
|
|
25836
26010
|
const replaceRegex = new RegExp(`\u03B8.*\u03B4`, "g");
|
|
25837
26011
|
const placeholders = [...template2.matchAll(replaceRegex)];
|
|
25838
|
-
let migrated = template2;
|
|
25839
26012
|
for (let ph of placeholders) {
|
|
25840
26013
|
const placeholder = ph[0];
|
|
25841
26014
|
const name = placeholder.slice(1, placeholder.length - 1);
|
|
25842
|
-
|
|
26015
|
+
template2 = template2.replace(placeholder, `<ng-template [ngTemplateOutlet]="${name}"></ng-template>`);
|
|
25843
26016
|
}
|
|
25844
|
-
return
|
|
26017
|
+
return template2;
|
|
25845
26018
|
}
|
|
25846
26019
|
function canRemoveCommonModule(template2) {
|
|
25847
26020
|
const parsed = parseTemplate2(template2);
|
|
25848
26021
|
let removeCommonModule = false;
|
|
25849
|
-
if (parsed !==
|
|
26022
|
+
if (parsed.tree !== void 0) {
|
|
25850
26023
|
const visitor = new CommonCollector();
|
|
25851
|
-
visitAll2(visitor, parsed.rootNodes);
|
|
26024
|
+
visitAll2(visitor, parsed.tree.rootNodes);
|
|
25852
26025
|
removeCommonModule = visitor.count === 0;
|
|
25853
26026
|
}
|
|
25854
26027
|
return removeCommonModule;
|
|
@@ -25869,10 +26042,21 @@ function getOriginals(etm, tmpl, offset) {
|
|
|
25869
26042
|
const start2 = tmpl.slice(etm.el.sourceSpan.start.offset - offset, etm.el.children[0].sourceSpan.start.offset - offset);
|
|
25870
26043
|
const end = tmpl.slice(etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset, etm.el.sourceSpan.end.offset - offset);
|
|
25871
26044
|
const childLength = childEnd - childStart;
|
|
25872
|
-
return {
|
|
26045
|
+
return {
|
|
26046
|
+
start: start2,
|
|
26047
|
+
end,
|
|
26048
|
+
childLength,
|
|
26049
|
+
children: getOriginalChildren(etm.el.children, tmpl, offset),
|
|
26050
|
+
childNodes: etm.el.children
|
|
26051
|
+
};
|
|
25873
26052
|
}
|
|
25874
26053
|
const start = tmpl.slice(etm.el.sourceSpan.start.offset - offset, etm.el.sourceSpan.end.offset - offset);
|
|
25875
|
-
return { start, end: "", childLength: 0 };
|
|
26054
|
+
return { start, end: "", childLength: 0, children: [], childNodes: [] };
|
|
26055
|
+
}
|
|
26056
|
+
function getOriginalChildren(children, tmpl, offset) {
|
|
26057
|
+
return children.map((child) => {
|
|
26058
|
+
return tmpl.slice(child.sourceSpan.start.offset - offset, child.sourceSpan.end.offset - offset);
|
|
26059
|
+
});
|
|
25876
26060
|
}
|
|
25877
26061
|
function isI18nTemplate(etm, i18nAttr) {
|
|
25878
26062
|
let attrCount = countAttributes(etm);
|
|
@@ -25906,6 +26090,8 @@ function getMainBlock(etm, tmpl, offset) {
|
|
|
25906
26090
|
if (etm.hasChildren()) {
|
|
25907
26091
|
const { childStart: childStart2, childEnd: childEnd2 } = etm.getChildSpan(offset);
|
|
25908
26092
|
middle2 = tmpl.slice(childStart2, childEnd2);
|
|
26093
|
+
} else {
|
|
26094
|
+
middle2 = startMarker + endMarker;
|
|
25909
26095
|
}
|
|
25910
26096
|
return { start: "", middle: middle2, end: "" };
|
|
25911
26097
|
} else if (isI18nTemplate(etm, i18nAttr)) {
|
|
@@ -25924,9 +26110,29 @@ function getMainBlock(etm, tmpl, offset) {
|
|
|
25924
26110
|
}
|
|
25925
26111
|
return { start, middle, end };
|
|
25926
26112
|
}
|
|
26113
|
+
function generateI18nMarkers(tmpl) {
|
|
26114
|
+
let parsed = parseTemplate2(tmpl);
|
|
26115
|
+
if (parsed.tree !== void 0) {
|
|
26116
|
+
const visitor = new i18nCollector();
|
|
26117
|
+
visitAll2(visitor, parsed.tree.rootNodes);
|
|
26118
|
+
for (const [ix, el] of visitor.elements.entries()) {
|
|
26119
|
+
const offset = ix * 2;
|
|
26120
|
+
if (el.children.length > 0) {
|
|
26121
|
+
tmpl = addI18nMarkers(tmpl, el, offset);
|
|
26122
|
+
}
|
|
26123
|
+
}
|
|
26124
|
+
}
|
|
26125
|
+
return tmpl;
|
|
26126
|
+
}
|
|
26127
|
+
function addI18nMarkers(tmpl, el, offset) {
|
|
26128
|
+
const startPos = el.children[0].sourceSpan.start.offset + offset;
|
|
26129
|
+
const endPos = el.children[el.children.length - 1].sourceSpan.end.offset + offset;
|
|
26130
|
+
return tmpl.slice(0, startPos) + startI18nMarker + tmpl.slice(startPos, endPos) + endI18nMarker + tmpl.slice(endPos);
|
|
26131
|
+
}
|
|
25927
26132
|
var selfClosingList = "input|br|img|base|wbr|area|col|embed|hr|link|meta|param|source|track";
|
|
25928
26133
|
function formatTemplate(tmpl, templateType) {
|
|
25929
26134
|
if (tmpl.indexOf("\n") > -1) {
|
|
26135
|
+
tmpl = generateI18nMarkers(tmpl);
|
|
25930
26136
|
let openSelfClosingEl = false;
|
|
25931
26137
|
const openBlockRegex = /^\s*\@(if|switch|case|default|for)|^\s*\}\s\@else/;
|
|
25932
26138
|
const openElRegex = /^\s*<([a-z0-9]+)(?![^>]*\/>)[^>]*>?/;
|
|
@@ -25941,8 +26147,20 @@ function formatTemplate(tmpl, templateType) {
|
|
|
25941
26147
|
const formatted = [];
|
|
25942
26148
|
let indent = "";
|
|
25943
26149
|
let mindent = "";
|
|
26150
|
+
let depth = 0;
|
|
26151
|
+
let i18nDepth = 0;
|
|
26152
|
+
let inMigratedBlock = false;
|
|
26153
|
+
let inI18nBlock = false;
|
|
25944
26154
|
for (let [index, line] of lines.entries()) {
|
|
25945
|
-
|
|
26155
|
+
depth += [...line.matchAll(startMarkerRegex)].length - [...line.matchAll(endMarkerRegex)].length;
|
|
26156
|
+
inMigratedBlock = depth > 0;
|
|
26157
|
+
i18nDepth += [...line.matchAll(startI18nMarkerRegex)].length - [...line.matchAll(endI18nMarkerRegex)].length;
|
|
26158
|
+
let lineWasMigrated = false;
|
|
26159
|
+
if (line.match(replaceMarkerRegex)) {
|
|
26160
|
+
line = line.replace(replaceMarkerRegex, "");
|
|
26161
|
+
lineWasMigrated = true;
|
|
26162
|
+
}
|
|
26163
|
+
if (line.trim() === "" && index !== 0 && index !== lines.length - 1 && (inMigratedBlock || lineWasMigrated)) {
|
|
25946
26164
|
continue;
|
|
25947
26165
|
}
|
|
25948
26166
|
if (templateType === "template" && index <= 1) {
|
|
@@ -25952,7 +26170,8 @@ function formatTemplate(tmpl, templateType) {
|
|
|
25952
26170
|
if ((closeBlockRegex.test(line) || closeElRegex.test(line) && (!singleLineElRegex.test(line) && !closeMultiLineElRegex.test(line))) && indent !== "") {
|
|
25953
26171
|
indent = indent.slice(2);
|
|
25954
26172
|
}
|
|
25955
|
-
|
|
26173
|
+
const newLine = inI18nBlock ? line : mindent + (line.trim() !== "" ? indent : "") + line.trim();
|
|
26174
|
+
formatted.push(newLine);
|
|
25956
26175
|
if (closeMultiLineElRegex.test(line)) {
|
|
25957
26176
|
indent = indent.slice(2);
|
|
25958
26177
|
if (openSelfClosingEl) {
|
|
@@ -25970,6 +26189,7 @@ function formatTemplate(tmpl, templateType) {
|
|
|
25970
26189
|
openSelfClosingEl = true;
|
|
25971
26190
|
indent += " ";
|
|
25972
26191
|
}
|
|
26192
|
+
inI18nBlock = i18nDepth > 0;
|
|
25973
26193
|
}
|
|
25974
26194
|
tmpl = formatted.join("\n");
|
|
25975
26195
|
}
|
|
@@ -25984,7 +26204,7 @@ function forEachClass(sourceFile, callback) {
|
|
|
25984
26204
|
});
|
|
25985
26205
|
}
|
|
25986
26206
|
|
|
25987
|
-
// bazel-out/
|
|
26207
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
|
|
25988
26208
|
var boundcase = "[ngSwitchCase]";
|
|
25989
26209
|
var switchcase = "*ngSwitchCase";
|
|
25990
26210
|
var nakedcase = "ngSwitchCase";
|
|
@@ -26000,12 +26220,12 @@ var cases = [
|
|
|
26000
26220
|
function migrateCase(template2) {
|
|
26001
26221
|
let errors = [];
|
|
26002
26222
|
let parsed = parseTemplate2(template2);
|
|
26003
|
-
if (parsed ===
|
|
26223
|
+
if (parsed.tree === void 0) {
|
|
26004
26224
|
return { migrated: template2, errors, changed: false };
|
|
26005
26225
|
}
|
|
26006
26226
|
let result = template2;
|
|
26007
26227
|
const visitor = new ElementCollector(cases);
|
|
26008
|
-
visitAll2(visitor, parsed.rootNodes);
|
|
26228
|
+
visitAll2(visitor, parsed.tree.rootNodes);
|
|
26009
26229
|
calculateNesting(visitor, hasLineBreaks(template2));
|
|
26010
26230
|
let offset = 0;
|
|
26011
26231
|
let nestLevel = -1;
|
|
@@ -26040,8 +26260,8 @@ function migrateNgSwitchCase(etm, tmpl, offset) {
|
|
|
26040
26260
|
const condition = etm.attr.value;
|
|
26041
26261
|
const originals = getOriginals(etm, tmpl, offset);
|
|
26042
26262
|
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
26043
|
-
const startBlock = `${leadingSpace}@case (${condition}) {${leadingSpace}${lbString}${start}`;
|
|
26044
|
-
const endBlock = `${end}${lbString}${leadingSpace}}`;
|
|
26263
|
+
const startBlock = `${startMarker}${leadingSpace}@case (${condition}) {${leadingSpace}${lbString}${start}`;
|
|
26264
|
+
const endBlock = `${end}${lbString}${leadingSpace}}${endMarker}`;
|
|
26045
26265
|
const defaultBlock = startBlock + middle + endBlock;
|
|
26046
26266
|
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
|
|
26047
26267
|
const pre = originals.start.length - startBlock.length;
|
|
@@ -26053,8 +26273,8 @@ function migrateNgSwitchDefault(etm, tmpl, offset) {
|
|
|
26053
26273
|
const leadingSpace = etm.hasLineBreaks ? "" : " ";
|
|
26054
26274
|
const originals = getOriginals(etm, tmpl, offset);
|
|
26055
26275
|
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
26056
|
-
const startBlock = `${leadingSpace}@default {${leadingSpace}${lbString}${start}`;
|
|
26057
|
-
const endBlock = `${end}${lbString}${leadingSpace}}`;
|
|
26276
|
+
const startBlock = `${startMarker}${leadingSpace}@default {${leadingSpace}${lbString}${start}`;
|
|
26277
|
+
const endBlock = `${end}${lbString}${leadingSpace}}${endMarker}`;
|
|
26058
26278
|
const defaultBlock = startBlock + middle + endBlock;
|
|
26059
26279
|
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
|
|
26060
26280
|
const pre = originals.start.length - startBlock.length;
|
|
@@ -26062,7 +26282,7 @@ function migrateNgSwitchDefault(etm, tmpl, offset) {
|
|
|
26062
26282
|
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
26063
26283
|
}
|
|
26064
26284
|
|
|
26065
|
-
// bazel-out/
|
|
26285
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
|
|
26066
26286
|
var ngfor = "*ngFor";
|
|
26067
26287
|
var nakedngfor2 = "ngFor";
|
|
26068
26288
|
var fors = [
|
|
@@ -26081,12 +26301,12 @@ var stringPairs = /* @__PURE__ */ new Map([
|
|
|
26081
26301
|
function migrateFor(template2) {
|
|
26082
26302
|
let errors = [];
|
|
26083
26303
|
let parsed = parseTemplate2(template2);
|
|
26084
|
-
if (parsed ===
|
|
26304
|
+
if (parsed.tree === void 0) {
|
|
26085
26305
|
return { migrated: template2, errors, changed: false };
|
|
26086
26306
|
}
|
|
26087
26307
|
let result = template2;
|
|
26088
26308
|
const visitor = new ElementCollector(fors);
|
|
26089
|
-
visitAll2(visitor, parsed.rootNodes);
|
|
26309
|
+
visitAll2(visitor, parsed.tree.rootNodes);
|
|
26090
26310
|
calculateNesting(visitor, hasLineBreaks(template2));
|
|
26091
26311
|
let offset = 0;
|
|
26092
26312
|
let nestLevel = -1;
|
|
@@ -26157,8 +26377,8 @@ function migrateStandardNgFor(etm, tmpl, offset) {
|
|
|
26157
26377
|
trackBy = trackBy.replace("$index", aliasedIndex);
|
|
26158
26378
|
}
|
|
26159
26379
|
const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
|
|
26160
|
-
let startBlock =
|
|
26161
|
-
let endBlock = `${lbString}}`;
|
|
26380
|
+
let startBlock = `${startMarker}@for (${condition}; track ${trackBy}${aliasStr}) {${lbString}`;
|
|
26381
|
+
let endBlock = `${lbString}}${endMarker}`;
|
|
26162
26382
|
let forBlock = "";
|
|
26163
26383
|
if (tmplPlaceholder !== "") {
|
|
26164
26384
|
startBlock = startBlock + tmplPlaceholder;
|
|
@@ -26194,10 +26414,10 @@ function migrateBoundNgFor(etm, tmpl, offset) {
|
|
|
26194
26414
|
trackBy = `${forAttrs.trackBy.trim()}(${aliasedIndex}, ${aliasAttrs.item})`;
|
|
26195
26415
|
}
|
|
26196
26416
|
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
26197
|
-
const startBlock =
|
|
26417
|
+
const startBlock = `${startMarker}@for (${condition}; track ${trackBy}${aliasStr}) {
|
|
26198
26418
|
${start}`;
|
|
26199
26419
|
const endBlock = `${end}
|
|
26200
|
-
}`;
|
|
26420
|
+
}${endMarker}`;
|
|
26201
26421
|
const forBlock = startBlock + middle + endBlock;
|
|
26202
26422
|
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + forBlock + tmpl.slice(etm.end(offset));
|
|
26203
26423
|
const pre = originals.start.length - startBlock.length;
|
|
@@ -26236,7 +26456,7 @@ function getNgForParts(expression) {
|
|
|
26236
26456
|
return parts;
|
|
26237
26457
|
}
|
|
26238
26458
|
|
|
26239
|
-
// bazel-out/
|
|
26459
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
|
|
26240
26460
|
var ngif = "*ngIf";
|
|
26241
26461
|
var boundngif = "[ngIf]";
|
|
26242
26462
|
var nakedngif = "ngIf";
|
|
@@ -26248,12 +26468,12 @@ var ifs = [
|
|
|
26248
26468
|
function migrateIf(template2) {
|
|
26249
26469
|
let errors = [];
|
|
26250
26470
|
let parsed = parseTemplate2(template2);
|
|
26251
|
-
if (parsed ===
|
|
26471
|
+
if (parsed.tree === void 0) {
|
|
26252
26472
|
return { migrated: template2, errors, changed: false };
|
|
26253
26473
|
}
|
|
26254
26474
|
let result = template2;
|
|
26255
26475
|
const visitor = new ElementCollector(ifs);
|
|
26256
|
-
visitAll2(visitor, parsed.rootNodes);
|
|
26476
|
+
visitAll2(visitor, parsed.tree.rootNodes);
|
|
26257
26477
|
calculateNesting(visitor, hasLineBreaks(template2));
|
|
26258
26478
|
let offset = 0;
|
|
26259
26479
|
let nestLevel = -1;
|
|
@@ -26303,8 +26523,8 @@ function buildIfBlock(etm, tmpl, offset) {
|
|
|
26303
26523
|
}
|
|
26304
26524
|
const originals = getOriginals(etm, tmpl, offset);
|
|
26305
26525
|
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
26306
|
-
const startBlock =
|
|
26307
|
-
const endBlock = `${end}${lbString}}`;
|
|
26526
|
+
const startBlock = `${startMarker}@if (${condition}) {${lbString}${start}`;
|
|
26527
|
+
const endBlock = `${end}${lbString}}${endMarker}`;
|
|
26308
26528
|
const ifBlock = startBlock + middle + endBlock;
|
|
26309
26529
|
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + ifBlock + tmpl.slice(etm.end(offset));
|
|
26310
26530
|
const pre = originals.start.length - startBlock.length;
|
|
@@ -26328,9 +26548,9 @@ function buildBoundIfElseBlock(etm, tmpl, offset) {
|
|
|
26328
26548
|
} else if (aliases.length === 1) {
|
|
26329
26549
|
condition += `; as ${aliases[0]}`;
|
|
26330
26550
|
}
|
|
26331
|
-
const elsePlaceholder = `\u03B8${etm.elseAttr.value}\u03B4`;
|
|
26551
|
+
const elsePlaceholder = `\u03B8${etm.elseAttr.value.trim()}\u03B4`;
|
|
26332
26552
|
if (etm.thenAttr !== void 0) {
|
|
26333
|
-
const thenPlaceholder = `\u03B8${etm.thenAttr.value}\u03B4`;
|
|
26553
|
+
const thenPlaceholder = `\u03B8${etm.thenAttr.value.trim()}\u03B4`;
|
|
26334
26554
|
return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
|
|
26335
26555
|
}
|
|
26336
26556
|
return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
|
|
@@ -26339,9 +26559,9 @@ function buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset) {
|
|
|
26339
26559
|
const lbString = etm.hasLineBreaks ? "\n" : "";
|
|
26340
26560
|
const originals = getOriginals(etm, tmpl, offset);
|
|
26341
26561
|
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
26342
|
-
const startBlock =
|
|
26562
|
+
const startBlock = `${startMarker}@if (${condition}) {${lbString}${start}`;
|
|
26343
26563
|
const elseBlock = `${end}${lbString}} @else {${lbString}`;
|
|
26344
|
-
const postBlock = elseBlock + elsePlaceholder + `${lbString}}`;
|
|
26564
|
+
const postBlock = elseBlock + elsePlaceholder + `${lbString}}${endMarker}`;
|
|
26345
26565
|
const ifElseBlock = startBlock + middle + postBlock;
|
|
26346
26566
|
const tmplStart = tmpl.slice(0, etm.start(offset));
|
|
26347
26567
|
const tmplEnd = tmpl.slice(etm.end(offset));
|
|
@@ -26364,9 +26584,9 @@ function buildStandardIfThenBlock(etm, tmpl, thenString, offset) {
|
|
|
26364
26584
|
function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset) {
|
|
26365
26585
|
const lbString = etm.hasLineBreaks ? "\n" : "";
|
|
26366
26586
|
const originals = getOriginals(etm, tmpl, offset);
|
|
26367
|
-
const startBlock =
|
|
26587
|
+
const startBlock = `${startMarker}@if (${condition}) {${lbString}`;
|
|
26368
26588
|
const elseBlock = `${lbString}} @else {${lbString}`;
|
|
26369
|
-
const postBlock = thenPlaceholder + elseBlock + elsePlaceholder + `${lbString}}`;
|
|
26589
|
+
const postBlock = thenPlaceholder + elseBlock + elsePlaceholder + `${lbString}}${endMarker}`;
|
|
26370
26590
|
const ifThenElseBlock = startBlock + postBlock;
|
|
26371
26591
|
const tmplStart = tmpl.slice(0, etm.start(offset));
|
|
26372
26592
|
const tmplEnd = tmpl.slice(etm.end(offset));
|
|
@@ -26378,8 +26598,8 @@ function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceho
|
|
|
26378
26598
|
function buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset) {
|
|
26379
26599
|
const lbString = etm.hasLineBreaks ? "\n" : "";
|
|
26380
26600
|
const originals = getOriginals(etm, tmpl, offset);
|
|
26381
|
-
const startBlock =
|
|
26382
|
-
const postBlock = thenPlaceholder + `${lbString}}`;
|
|
26601
|
+
const startBlock = `${startMarker}@if (${condition}) {${lbString}`;
|
|
26602
|
+
const postBlock = thenPlaceholder + `${lbString}}${endMarker}`;
|
|
26383
26603
|
const ifThenBlock = startBlock + postBlock;
|
|
26384
26604
|
const tmplStart = tmpl.slice(0, etm.start(offset));
|
|
26385
26605
|
const tmplEnd = tmpl.slice(etm.end(offset));
|
|
@@ -26389,7 +26609,7 @@ function buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset) {
|
|
|
26389
26609
|
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
26390
26610
|
}
|
|
26391
26611
|
|
|
26392
|
-
// bazel-out/
|
|
26612
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
|
|
26393
26613
|
var ngswitch = "[ngSwitch]";
|
|
26394
26614
|
var switches = [
|
|
26395
26615
|
ngswitch
|
|
@@ -26397,12 +26617,12 @@ var switches = [
|
|
|
26397
26617
|
function migrateSwitch(template2) {
|
|
26398
26618
|
let errors = [];
|
|
26399
26619
|
let parsed = parseTemplate2(template2);
|
|
26400
|
-
if (parsed ===
|
|
26620
|
+
if (parsed.tree === void 0) {
|
|
26401
26621
|
return { migrated: template2, errors, changed: false };
|
|
26402
26622
|
}
|
|
26403
26623
|
let result = template2;
|
|
26404
26624
|
const visitor = new ElementCollector(switches);
|
|
26405
|
-
visitAll2(visitor, parsed.rootNodes);
|
|
26625
|
+
visitAll2(visitor, parsed.tree.rootNodes);
|
|
26406
26626
|
calculateNesting(visitor, hasLineBreaks(template2));
|
|
26407
26627
|
let offset = 0;
|
|
26408
26628
|
let nestLevel = -1;
|
|
@@ -26425,13 +26645,31 @@ function migrateSwitch(template2) {
|
|
|
26425
26645
|
const changed = visitor.elements.length > 0;
|
|
26426
26646
|
return { migrated: result, errors, changed };
|
|
26427
26647
|
}
|
|
26648
|
+
function assertValidSwitchStructure(children) {
|
|
26649
|
+
for (const child of children) {
|
|
26650
|
+
if (child instanceof Text4 && child.value.trim() !== "") {
|
|
26651
|
+
throw new Error(`Text node: "${child.value}" would result in invalid migrated @switch block structure. @switch can only have @case or @default as children.`);
|
|
26652
|
+
} else if (child instanceof Element2) {
|
|
26653
|
+
let hasCase = false;
|
|
26654
|
+
for (const attr of child.attrs) {
|
|
26655
|
+
if (cases.includes(attr.name)) {
|
|
26656
|
+
hasCase = true;
|
|
26657
|
+
}
|
|
26658
|
+
}
|
|
26659
|
+
if (!hasCase) {
|
|
26660
|
+
throw new Error(`Element node: "${child.name}" would result in invalid migrated @switch block structure. @switch can only have @case or @default as children.`);
|
|
26661
|
+
}
|
|
26662
|
+
}
|
|
26663
|
+
}
|
|
26664
|
+
}
|
|
26428
26665
|
function migrateNgSwitch(etm, tmpl, offset) {
|
|
26429
26666
|
const lbString = etm.hasLineBreaks ? "\n" : "";
|
|
26430
26667
|
const condition = etm.attr.value;
|
|
26431
26668
|
const originals = getOriginals(etm, tmpl, offset);
|
|
26669
|
+
assertValidSwitchStructure(originals.childNodes);
|
|
26432
26670
|
const { start, middle, end } = getMainBlock(etm, tmpl, offset);
|
|
26433
|
-
const startBlock = `${start}${lbString}@switch (${condition}) {`;
|
|
26434
|
-
const endBlock = `}${lbString}${end}`;
|
|
26671
|
+
const startBlock = `${startMarker}${start}${lbString}@switch (${condition}) {`;
|
|
26672
|
+
const endBlock = `}${lbString}${end}${endMarker}`;
|
|
26435
26673
|
const switchBlock = startBlock + middle + endBlock;
|
|
26436
26674
|
const updatedTmpl = tmpl.slice(0, etm.start(offset)) + switchBlock + tmpl.slice(etm.end(offset));
|
|
26437
26675
|
const pre = originals.start.length - startBlock.length;
|
|
@@ -26439,7 +26677,7 @@ function migrateNgSwitch(etm, tmpl, offset) {
|
|
|
26439
26677
|
return { tmpl: updatedTmpl, offsets: { pre, post } };
|
|
26440
26678
|
}
|
|
26441
26679
|
|
|
26442
|
-
// bazel-out/
|
|
26680
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
|
|
26443
26681
|
function migrateTemplate(template2, templateType, node, file, format = true, analyzedFiles) {
|
|
26444
26682
|
let errors = [];
|
|
26445
26683
|
let migrated = template2;
|
|
@@ -26447,6 +26685,9 @@ function migrateTemplate(template2, templateType, node, file, format = true, ana
|
|
|
26447
26685
|
const ifResult = migrateIf(template2);
|
|
26448
26686
|
const forResult = migrateFor(ifResult.migrated);
|
|
26449
26687
|
const switchResult = migrateSwitch(forResult.migrated);
|
|
26688
|
+
if (switchResult.errors.length > 0) {
|
|
26689
|
+
return { migrated: template2, errors: switchResult.errors };
|
|
26690
|
+
}
|
|
26450
26691
|
const caseResult = migrateCase(switchResult.migrated);
|
|
26451
26692
|
const templateResult = processNgTemplates(caseResult.migrated);
|
|
26452
26693
|
if (templateResult.err !== void 0) {
|
|
@@ -26454,13 +26695,27 @@ function migrateTemplate(template2, templateType, node, file, format = true, ana
|
|
|
26454
26695
|
}
|
|
26455
26696
|
migrated = templateResult.migrated;
|
|
26456
26697
|
const changed = ifResult.changed || forResult.changed || switchResult.changed || caseResult.changed;
|
|
26698
|
+
if (changed) {
|
|
26699
|
+
const parsed = parseTemplate2(migrated);
|
|
26700
|
+
if (parsed.errors.length > 0) {
|
|
26701
|
+
const parsingError = {
|
|
26702
|
+
type: "parse",
|
|
26703
|
+
error: new Error(`The migration resulted in invalid HTML for ${file.sourceFilePath}. Please check the template for valid HTML structures and run the migration again.`)
|
|
26704
|
+
};
|
|
26705
|
+
return { migrated: template2, errors: [parsingError] };
|
|
26706
|
+
}
|
|
26707
|
+
}
|
|
26457
26708
|
if (format && changed) {
|
|
26458
26709
|
migrated = formatTemplate(migrated, templateType);
|
|
26459
26710
|
}
|
|
26711
|
+
const markerRegex = new RegExp(`${startMarker}|${endMarker}|${startI18nMarker}|${endI18nMarker}`, "gm");
|
|
26712
|
+
migrated = migrated.replace(markerRegex, "");
|
|
26460
26713
|
file.removeCommonModule = canRemoveCommonModule(template2);
|
|
26714
|
+
file.canRemoveImports = true;
|
|
26461
26715
|
if (templateType === "templateUrl" && analyzedFiles !== null && analyzedFiles.has(file.sourceFilePath)) {
|
|
26462
26716
|
const componentFile = analyzedFiles.get(file.sourceFilePath);
|
|
26463
26717
|
componentFile.removeCommonModule = file.removeCommonModule;
|
|
26718
|
+
componentFile.canRemoveImports = file.canRemoveImports;
|
|
26464
26719
|
}
|
|
26465
26720
|
errors = [
|
|
26466
26721
|
...ifResult.errors,
|
|
@@ -26468,13 +26723,13 @@ function migrateTemplate(template2, templateType, node, file, format = true, ana
|
|
|
26468
26723
|
...switchResult.errors,
|
|
26469
26724
|
...caseResult.errors
|
|
26470
26725
|
];
|
|
26471
|
-
} else {
|
|
26726
|
+
} else if (file.canRemoveImports) {
|
|
26472
26727
|
migrated = removeImports(template2, node, file.removeCommonModule);
|
|
26473
26728
|
}
|
|
26474
26729
|
return { migrated, errors };
|
|
26475
26730
|
}
|
|
26476
26731
|
|
|
26477
|
-
// bazel-out/
|
|
26732
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
|
|
26478
26733
|
function control_flow_migration_default(options) {
|
|
26479
26734
|
return (tree, context) => __async(this, null, function* () {
|
|
26480
26735
|
const basePath = process.cwd();
|