@angular/compiler-cli 13.0.3 → 13.1.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/bundles/chunk-4EDYFHXN.js +681 -0
  2. package/bundles/chunk-4EDYFHXN.js.map +6 -0
  3. package/bundles/chunk-7HBAJSZA.js +5106 -0
  4. package/bundles/chunk-7HBAJSZA.js.map +6 -0
  5. package/bundles/chunk-7HVF6UHR.js +380 -0
  6. package/bundles/chunk-7HVF6UHR.js.map +6 -0
  7. package/bundles/chunk-COAETSNP.js +7531 -0
  8. package/bundles/chunk-COAETSNP.js.map +6 -0
  9. package/bundles/chunk-EP5JHXG2.js +448 -0
  10. package/bundles/chunk-EP5JHXG2.js.map +6 -0
  11. package/bundles/chunk-GLCRIILX.js +206 -0
  12. package/bundles/chunk-GLCRIILX.js.map +6 -0
  13. package/bundles/chunk-HDZS2JG2.js +1265 -0
  14. package/bundles/chunk-HDZS2JG2.js.map +6 -0
  15. package/bundles/chunk-IESRH26X.js +5684 -0
  16. package/bundles/chunk-IESRH26X.js.map +6 -0
  17. package/bundles/chunk-JJMLEEKA.js +382 -0
  18. package/bundles/chunk-JJMLEEKA.js.map +6 -0
  19. package/bundles/chunk-MFCLQBFK.js +968 -0
  20. package/bundles/chunk-MFCLQBFK.js.map +6 -0
  21. package/bundles/chunk-QDWL7SZJ.js +29 -0
  22. package/bundles/chunk-QDWL7SZJ.js.map +6 -0
  23. package/bundles/chunk-QL6ZC3U3.js +424 -0
  24. package/bundles/chunk-QL6ZC3U3.js.map +6 -0
  25. package/bundles/chunk-SKBLJA43.js +56 -0
  26. package/bundles/chunk-SKBLJA43.js.map +6 -0
  27. package/bundles/chunk-UIKTHF6Z.js +2177 -0
  28. package/bundles/chunk-UIKTHF6Z.js.map +6 -0
  29. package/bundles/chunk-UMUIU7TE.js +116 -0
  30. package/bundles/chunk-UMUIU7TE.js.map +6 -0
  31. package/bundles/chunk-XA5IZLLC.js +68 -0
  32. package/bundles/chunk-XA5IZLLC.js.map +6 -0
  33. package/bundles/index.js +67 -20229
  34. package/bundles/index.js.map +2 -2
  35. package/bundles/linker/babel/index.js +17 -1980
  36. package/bundles/linker/babel/index.js.map +2 -2
  37. package/bundles/linker/index.js +12 -1833
  38. package/bundles/linker/index.js.map +2 -2
  39. package/bundles/ngcc/index.js +24 -16040
  40. package/bundles/ngcc/index.js.map +2 -2
  41. package/bundles/ngcc/main-ngcc.js +16 -16124
  42. package/bundles/ngcc/main-ngcc.js.map +2 -2
  43. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +27 -13782
  44. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +2 -2
  45. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +10 -309
  46. package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +2 -2
  47. package/bundles/private/bazel.js +4 -81
  48. package/bundles/private/bazel.js.map +2 -2
  49. package/bundles/private/localize.js +27 -870
  50. package/bundles/private/localize.js.map +2 -2
  51. package/bundles/private/migrations.js +13 -2178
  52. package/bundles/private/migrations.js.map +2 -2
  53. package/bundles/private/tooling.js +7 -931
  54. package/bundles/private/tooling.js.map +2 -2
  55. package/bundles/src/bin/ng_xi18n.js +20 -20378
  56. package/bundles/src/bin/ng_xi18n.js.map +2 -2
  57. package/bundles/src/bin/ngc.js +15 -20392
  58. package/bundles/src/bin/ngc.js.map +2 -2
  59. package/bundles_metadata.json +1 -1
  60. package/index.d.ts +0 -1
  61. package/ngcc/src/packages/build_marker.d.ts +1 -1
  62. package/package.json +3 -3
  63. package/src/ngtsc/core/src/host.d.ts +2 -1
  64. package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +2 -1
  65. package/src/ngtsc/reflection/src/host.d.ts +1 -1
  66. package/src/ngtsc/util/src/typescript.d.ts +10 -0
  67. package/src/transformers/compiler_host.d.ts +1 -97
  68. package/src/transformers/program.d.ts +0 -19
  69. package/src/transformers/util.d.ts +1 -18
  70. package/src/{diagnostics/typescript_version.d.ts → version_helpers.d.ts} +1 -1
  71. package/src/diagnostics/translate_diagnostics.d.ts +0 -18
  72. package/src/language_services.d.ts +0 -11
  73. package/src/metadata/bundle_index_host.d.ts +0 -16
  74. package/src/metadata/bundler.d.ts +0 -66
  75. package/src/metadata/collector.d.ts +0 -44
  76. package/src/metadata/evaluator.d.ts +0 -58
  77. package/src/metadata/index.d.ts +0 -11
  78. package/src/metadata/index_writer.d.ts +0 -10
  79. package/src/metadata/schema.d.ts +0 -182
  80. package/src/metadata/symbols.d.ts +0 -22
  81. package/src/transformers/inline_resources.d.ts +0 -26
  82. package/src/transformers/lower_expressions.d.ts +0 -30
  83. package/src/transformers/metadata_cache.d.ts +0 -27
  84. package/src/transformers/metadata_reader.d.ts +0 -19
  85. package/src/transformers/node_emitter.d.ts +0 -105
  86. package/src/transformers/node_emitter_transform.d.ts +0 -19
  87. package/src/transformers/r3_metadata_transform.d.ts +0 -16
  88. package/src/transformers/r3_transform.d.ts +0 -16
@@ -3,1833 +3,19 @@
3
3
  const require = __cjsCompatRequire(import.meta.url);
4
4
  const __ESM_IMPORT_META_URL__ = import.meta.url;
5
5
 
6
- var __defProp = Object.defineProperty;
7
- var __defProps = Object.defineProperties;
8
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
-
26
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/fatal_linker_error.mjs
27
- var FatalLinkerError = class extends Error {
28
- constructor(node, message) {
29
- super(message);
30
- this.node = node;
31
- this.type = "FatalLinkerError";
32
- }
33
- };
34
- function isFatalLinkerError(e) {
35
- return e && e.type === "FatalLinkerError";
36
- }
37
-
38
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/ast/utils.mjs
39
- function assert(node, predicate, expected) {
40
- if (!predicate(node)) {
41
- throw new FatalLinkerError(node, `Unsupported syntax, expected ${expected}.`);
42
- }
43
- }
44
-
45
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/ast/ast_value.mjs
46
- import {
47
- WrappedNodeExpr
48
- } from "@angular/compiler";
49
- var AstObject = class {
50
- constructor(expression, obj, host) {
51
- this.expression = expression;
52
- this.obj = obj;
53
- this.host = host;
54
- }
55
- static parse(expression, host) {
56
- const obj = host.parseObjectLiteral(expression);
57
- return new AstObject(expression, obj, host);
58
- }
59
- has(propertyName) {
60
- return this.obj.has(propertyName);
61
- }
62
- getNumber(propertyName) {
63
- return this.host.parseNumericLiteral(this.getRequiredProperty(propertyName));
64
- }
65
- getString(propertyName) {
66
- return this.host.parseStringLiteral(this.getRequiredProperty(propertyName));
67
- }
68
- getBoolean(propertyName) {
69
- return this.host.parseBooleanLiteral(this.getRequiredProperty(propertyName));
70
- }
71
- getObject(propertyName) {
72
- const expr = this.getRequiredProperty(propertyName);
73
- const obj = this.host.parseObjectLiteral(expr);
74
- return new AstObject(expr, obj, this.host);
75
- }
76
- getArray(propertyName) {
77
- const arr = this.host.parseArrayLiteral(this.getRequiredProperty(propertyName));
78
- return arr.map((entry) => new AstValue(entry, this.host));
79
- }
80
- getOpaque(propertyName) {
81
- return new WrappedNodeExpr(this.getRequiredProperty(propertyName));
82
- }
83
- getNode(propertyName) {
84
- return this.getRequiredProperty(propertyName);
85
- }
86
- getValue(propertyName) {
87
- return new AstValue(this.getRequiredProperty(propertyName), this.host);
88
- }
89
- toLiteral(mapper) {
90
- const result = {};
91
- for (const [key, expression] of this.obj) {
92
- result[key] = mapper(new AstValue(expression, this.host));
93
- }
94
- return result;
95
- }
96
- toMap(mapper) {
97
- const result = new Map();
98
- for (const [key, expression] of this.obj) {
99
- result.set(key, mapper(new AstValue(expression, this.host)));
100
- }
101
- return result;
102
- }
103
- getRequiredProperty(propertyName) {
104
- if (!this.obj.has(propertyName)) {
105
- throw new FatalLinkerError(this.expression, `Expected property '${propertyName}' to be present.`);
106
- }
107
- return this.obj.get(propertyName);
108
- }
109
- };
110
- var AstValue = class {
111
- constructor(expression, host) {
112
- this.expression = expression;
113
- this.host = host;
114
- }
115
- getSymbolName() {
116
- return this.host.getSymbolName(this.expression);
117
- }
118
- isNumber() {
119
- return this.host.isNumericLiteral(this.expression);
120
- }
121
- getNumber() {
122
- return this.host.parseNumericLiteral(this.expression);
123
- }
124
- isString() {
125
- return this.host.isStringLiteral(this.expression);
126
- }
127
- getString() {
128
- return this.host.parseStringLiteral(this.expression);
129
- }
130
- isBoolean() {
131
- return this.host.isBooleanLiteral(this.expression);
132
- }
133
- getBoolean() {
134
- return this.host.parseBooleanLiteral(this.expression);
135
- }
136
- isObject() {
137
- return this.host.isObjectLiteral(this.expression);
138
- }
139
- getObject() {
140
- return AstObject.parse(this.expression, this.host);
141
- }
142
- isArray() {
143
- return this.host.isArrayLiteral(this.expression);
144
- }
145
- getArray() {
146
- const arr = this.host.parseArrayLiteral(this.expression);
147
- return arr.map((entry) => new AstValue(entry, this.host));
148
- }
149
- isFunction() {
150
- return this.host.isFunctionExpression(this.expression);
151
- }
152
- getFunctionReturnValue() {
153
- return new AstValue(this.host.parseReturnValue(this.expression), this.host);
154
- }
155
- isCallExpression() {
156
- return this.host.isCallExpression(this.expression);
157
- }
158
- getCallee() {
159
- return new AstValue(this.host.parseCallee(this.expression), this.host);
160
- }
161
- getArguments() {
162
- const args = this.host.parseArguments(this.expression);
163
- return args.map((arg) => new AstValue(arg, this.host));
164
- }
165
- getOpaque() {
166
- return new WrappedNodeExpr(this.expression);
167
- }
168
- getRange() {
169
- return this.host.getRange(this.expression);
170
- }
171
- };
172
-
173
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
174
- import { ConstantPool } from "@angular/compiler";
175
-
176
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/linker_import_generator.mjs
177
- var LinkerImportGenerator = class {
178
- constructor(ngImport) {
179
- this.ngImport = ngImport;
180
- }
181
- generateNamespaceImport(moduleName) {
182
- this.assertModuleName(moduleName);
183
- return this.ngImport;
184
- }
185
- generateNamedImport(moduleName, originalSymbol) {
186
- this.assertModuleName(moduleName);
187
- return { moduleImport: this.ngImport, symbol: originalSymbol };
188
- }
189
- assertModuleName(moduleName) {
190
- if (moduleName !== "@angular/core") {
191
- throw new FatalLinkerError(this.ngImport, `Unable to import from anything other than '@angular/core'`);
192
- }
193
- }
194
- };
195
-
196
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope.mjs
197
- var EmitScope = class {
198
- constructor(ngImport, translator) {
199
- this.ngImport = ngImport;
200
- this.translator = translator;
201
- this.constantPool = new ConstantPool();
202
- }
203
- translateDefinition(definition) {
204
- return this.translator.translateExpression(definition, new LinkerImportGenerator(this.ngImport));
205
- }
206
- getConstantStatements() {
207
- const importGenerator = new LinkerImportGenerator(this.ngImport);
208
- return this.constantPool.statements.map((statement) => this.translator.translateStatement(statement, importGenerator));
209
- }
210
- };
211
-
212
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope.mjs
213
- var IifeEmitScope = class extends EmitScope {
214
- constructor(ngImport, translator, factory) {
215
- super(ngImport, translator);
216
- this.factory = factory;
217
- }
218
- translateDefinition(definition) {
219
- const constantStatements = super.getConstantStatements();
220
- const returnStatement = this.factory.createReturnStatement(super.translateDefinition(definition));
221
- const body = this.factory.createBlock([...constantStatements, returnStatement]);
222
- const fn = this.factory.createFunctionExpression(null, [], body);
223
- return this.factory.createCallExpression(fn, [], false);
224
- }
225
- getConstantStatements() {
226
- throw new Error("BUG - IifeEmitScope should not expose any constant statements");
227
- }
228
- };
229
-
230
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
231
- import semver from "semver";
232
-
233
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/get_source_file.mjs
234
- function createGetSourceFile(sourceUrl, code, loader) {
235
- if (loader === null) {
236
- return () => null;
237
- } else {
238
- let sourceFile = void 0;
239
- return () => {
240
- if (sourceFile === void 0) {
241
- sourceFile = loader.loadSourceFile(sourceUrl, code);
242
- }
243
- return sourceFile;
244
- };
245
- }
246
- }
247
-
248
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1.mjs
249
- import { compileClassMetadata } from "@angular/compiler";
250
- var PartialClassMetadataLinkerVersion1 = class {
251
- linkPartialDeclaration(constantPool, metaObj) {
252
- const meta = toR3ClassMetadata(metaObj);
253
- return compileClassMetadata(meta);
254
- }
255
- };
256
- function toR3ClassMetadata(metaObj) {
257
- return {
258
- type: metaObj.getOpaque("type"),
259
- decorators: metaObj.getOpaque("decorators"),
260
- ctorParameters: metaObj.has("ctorParameters") ? metaObj.getOpaque("ctorParameters") : null,
261
- propDecorators: metaObj.has("propDecorators") ? metaObj.getOpaque("propDecorators") : null
262
- };
263
- }
264
-
265
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
266
- import { ChangeDetectionStrategy, compileComponentFromMetadata, DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig, makeBindingParser as makeBindingParser2, parseTemplate, ViewEncapsulation } from "@angular/compiler";
267
-
268
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
269
- import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSourceFile, ParseSourceSpan } from "@angular/compiler";
270
-
271
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/util.mjs
272
- import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
273
- function wrapReference(wrapped) {
274
- return { value: wrapped, type: wrapped };
275
- }
276
- function parseEnum(value, Enum) {
277
- const symbolName = value.getSymbolName();
278
- if (symbolName === null) {
279
- throw new FatalLinkerError(value.expression, "Expected value to have a symbol name");
280
- }
281
- const enumValue = Enum[symbolName];
282
- if (enumValue === void 0) {
283
- throw new FatalLinkerError(value.expression, `Unsupported enum value for ${Enum}`);
284
- }
285
- return enumValue;
286
- }
287
- function getDependency(depObj) {
288
- const isAttribute = depObj.has("attribute") && depObj.getBoolean("attribute");
289
- const token = depObj.getOpaque("token");
290
- const attributeNameType = isAttribute ? o2.literal("unknown") : null;
291
- return {
292
- token,
293
- attributeNameType,
294
- host: depObj.has("host") && depObj.getBoolean("host"),
295
- optional: depObj.has("optional") && depObj.getBoolean("optional"),
296
- self: depObj.has("self") && depObj.getBoolean("self"),
297
- skipSelf: depObj.has("skipSelf") && depObj.getBoolean("skipSelf")
298
- };
299
- }
300
- function extractForwardRef(expr) {
301
- if (!expr.isCallExpression()) {
302
- return createMayBeForwardRefExpression(expr.getOpaque(), 0);
303
- }
304
- const callee = expr.getCallee();
305
- if (callee.getSymbolName() !== "forwardRef") {
306
- throw new FatalLinkerError(callee.expression, "Unsupported expression, expected a `forwardRef()` call or a type reference");
307
- }
308
- const args = expr.getArguments();
309
- if (args.length !== 1) {
310
- throw new FatalLinkerError(expr, "Unsupported `forwardRef(fn)` call, expected a single argument");
311
- }
312
- const wrapperFn = args[0];
313
- if (!wrapperFn.isFunction()) {
314
- throw new FatalLinkerError(wrapperFn, "Unsupported `forwardRef(fn)` call, expected its argument to be a function");
315
- }
316
- return createMayBeForwardRefExpression(wrapperFn.getFunctionReturnValue().getOpaque(), 2);
317
- }
318
-
319
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.mjs
320
- var PartialDirectiveLinkerVersion1 = class {
321
- constructor(sourceUrl, code) {
322
- this.sourceUrl = sourceUrl;
323
- this.code = code;
324
- }
325
- linkPartialDeclaration(constantPool, metaObj) {
326
- const meta = toR3DirectiveMeta(metaObj, this.code, this.sourceUrl);
327
- const def = compileDirectiveFromMetadata(meta, constantPool, makeBindingParser());
328
- return def.expression;
329
- }
330
- };
331
- function toR3DirectiveMeta(metaObj, code, sourceUrl) {
332
- const typeExpr = metaObj.getValue("type");
333
- const typeName = typeExpr.getSymbolName();
334
- if (typeName === null) {
335
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
336
- }
337
- return {
338
- typeSourceSpan: createSourceSpan(typeExpr.getRange(), code, sourceUrl),
339
- type: wrapReference(typeExpr.getOpaque()),
340
- typeArgumentCount: 0,
341
- internalType: metaObj.getOpaque("type"),
342
- deps: null,
343
- host: toHostMetadata(metaObj),
344
- inputs: metaObj.has("inputs") ? metaObj.getObject("inputs").toLiteral(toInputMapping) : {},
345
- outputs: metaObj.has("outputs") ? metaObj.getObject("outputs").toLiteral((value) => value.getString()) : {},
346
- queries: metaObj.has("queries") ? metaObj.getArray("queries").map((entry) => toQueryMetadata(entry.getObject())) : [],
347
- viewQueries: metaObj.has("viewQueries") ? metaObj.getArray("viewQueries").map((entry) => toQueryMetadata(entry.getObject())) : [],
348
- providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
349
- fullInheritance: false,
350
- selector: metaObj.has("selector") ? metaObj.getString("selector") : null,
351
- exportAs: metaObj.has("exportAs") ? metaObj.getArray("exportAs").map((entry) => entry.getString()) : null,
352
- lifecycle: {
353
- usesOnChanges: metaObj.has("usesOnChanges") ? metaObj.getBoolean("usesOnChanges") : false
354
- },
355
- name: typeName,
356
- usesInheritance: metaObj.has("usesInheritance") ? metaObj.getBoolean("usesInheritance") : false
357
- };
358
- }
359
- function toInputMapping(value) {
360
- if (value.isString()) {
361
- return value.getString();
362
- }
363
- const values = value.getArray().map((innerValue) => innerValue.getString());
364
- if (values.length !== 2) {
365
- throw new FatalLinkerError(value.expression, "Unsupported input, expected a string or an array containing exactly two strings");
366
- }
367
- return values;
368
- }
369
- function toHostMetadata(metaObj) {
370
- if (!metaObj.has("host")) {
371
- return {
372
- attributes: {},
373
- listeners: {},
374
- properties: {},
375
- specialAttributes: {}
376
- };
377
- }
378
- const host = metaObj.getObject("host");
379
- const specialAttributes = {};
380
- if (host.has("styleAttribute")) {
381
- specialAttributes.styleAttr = host.getString("styleAttribute");
382
- }
383
- if (host.has("classAttribute")) {
384
- specialAttributes.classAttr = host.getString("classAttribute");
385
- }
386
- return {
387
- attributes: host.has("attributes") ? host.getObject("attributes").toLiteral((value) => value.getOpaque()) : {},
388
- listeners: host.has("listeners") ? host.getObject("listeners").toLiteral((value) => value.getString()) : {},
389
- properties: host.has("properties") ? host.getObject("properties").toLiteral((value) => value.getString()) : {},
390
- specialAttributes
391
- };
392
- }
393
- function toQueryMetadata(obj) {
394
- let predicate;
395
- const predicateExpr = obj.getValue("predicate");
396
- if (predicateExpr.isArray()) {
397
- predicate = predicateExpr.getArray().map((entry) => entry.getString());
398
- } else {
399
- predicate = extractForwardRef(predicateExpr);
400
- }
401
- return {
402
- propertyName: obj.getString("propertyName"),
403
- first: obj.has("first") ? obj.getBoolean("first") : false,
404
- predicate,
405
- descendants: obj.has("descendants") ? obj.getBoolean("descendants") : false,
406
- emitDistinctChangesOnly: obj.has("emitDistinctChangesOnly") ? obj.getBoolean("emitDistinctChangesOnly") : true,
407
- read: obj.has("read") ? obj.getOpaque("read") : null,
408
- static: obj.has("static") ? obj.getBoolean("static") : false
409
- };
410
- }
411
- function createSourceSpan(range, code, sourceUrl) {
412
- const sourceFile = new ParseSourceFile(code, sourceUrl);
413
- const startLocation = new ParseLocation(sourceFile, range.startPos, range.startLine, range.startCol);
414
- return new ParseSourceSpan(startLocation, startLocation.moveBy(range.endPos - range.startPos));
415
- }
416
-
417
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1.mjs
418
- var PartialComponentLinkerVersion1 = class {
419
- constructor(getSourceFile2, sourceUrl, code) {
420
- this.getSourceFile = getSourceFile2;
421
- this.sourceUrl = sourceUrl;
422
- this.code = code;
423
- }
424
- linkPartialDeclaration(constantPool, metaObj) {
425
- const meta = this.toR3ComponentMeta(metaObj);
426
- const def = compileComponentFromMetadata(meta, constantPool, makeBindingParser2());
427
- return def.expression;
428
- }
429
- toR3ComponentMeta(metaObj) {
430
- const interpolation = parseInterpolationConfig(metaObj);
431
- const templateSource = metaObj.getValue("template");
432
- const isInline = metaObj.has("isInline") ? metaObj.getBoolean("isInline") : false;
433
- const templateInfo = this.getTemplateInfo(templateSource, isInline);
434
- const template = parseTemplate(templateInfo.code, templateInfo.sourceUrl, {
435
- escapedString: templateInfo.isEscaped,
436
- interpolationConfig: interpolation,
437
- range: templateInfo.range,
438
- enableI18nLegacyMessageIdFormat: false,
439
- preserveWhitespaces: metaObj.has("preserveWhitespaces") ? metaObj.getBoolean("preserveWhitespaces") : false,
440
- i18nNormalizeLineEndingsInICUs: isInline
441
- });
442
- if (template.errors !== null) {
443
- const errors = template.errors.map((err) => err.toString()).join("\n");
444
- throw new FatalLinkerError(templateSource.expression, `Errors found in the template:
445
- ${errors}`);
446
- }
447
- let declarationListEmitMode = 0;
448
- const collectUsedDirectives = (directives2) => {
449
- return directives2.map((directive) => {
450
- const directiveExpr = directive.getObject();
451
- const type = directiveExpr.getValue("type");
452
- const selector = directiveExpr.getString("selector");
453
- const { expression: typeExpr, forwardRef } = extractForwardRef(type);
454
- if (forwardRef === 2) {
455
- declarationListEmitMode = 1;
456
- }
457
- return {
458
- type: typeExpr,
459
- selector,
460
- inputs: directiveExpr.has("inputs") ? directiveExpr.getArray("inputs").map((input) => input.getString()) : [],
461
- outputs: directiveExpr.has("outputs") ? directiveExpr.getArray("outputs").map((input) => input.getString()) : [],
462
- exportAs: directiveExpr.has("exportAs") ? directiveExpr.getArray("exportAs").map((exportAs) => exportAs.getString()) : null
463
- };
464
- });
465
- };
466
- let directives = [];
467
- if (metaObj.has("components")) {
468
- directives.push(...collectUsedDirectives(metaObj.getArray("components")));
469
- }
470
- if (metaObj.has("directives")) {
471
- directives.push(...collectUsedDirectives(metaObj.getArray("directives")));
472
- }
473
- let pipes = new Map();
474
- if (metaObj.has("pipes")) {
475
- pipes = metaObj.getObject("pipes").toMap((pipe) => {
476
- const { expression: pipeType, forwardRef } = extractForwardRef(pipe);
477
- if (forwardRef === 2) {
478
- declarationListEmitMode = 1;
479
- }
480
- return pipeType;
481
- });
482
- }
483
- return __spreadProps(__spreadValues({}, toR3DirectiveMeta(metaObj, this.code, this.sourceUrl)), {
484
- viewProviders: metaObj.has("viewProviders") ? metaObj.getOpaque("viewProviders") : null,
485
- template: {
486
- nodes: template.nodes,
487
- ngContentSelectors: template.ngContentSelectors
488
- },
489
- declarationListEmitMode,
490
- styles: metaObj.has("styles") ? metaObj.getArray("styles").map((entry) => entry.getString()) : [],
491
- encapsulation: metaObj.has("encapsulation") ? parseEncapsulation(metaObj.getValue("encapsulation")) : ViewEncapsulation.Emulated,
492
- interpolation,
493
- changeDetection: metaObj.has("changeDetection") ? parseChangeDetectionStrategy(metaObj.getValue("changeDetection")) : ChangeDetectionStrategy.Default,
494
- animations: metaObj.has("animations") ? metaObj.getOpaque("animations") : null,
495
- relativeContextFilePath: this.sourceUrl,
496
- i18nUseExternalIds: false,
497
- pipes,
498
- directives
499
- });
500
- }
501
- getTemplateInfo(templateNode, isInline) {
502
- const range = templateNode.getRange();
503
- if (!isInline) {
504
- const externalTemplate = this.tryExternalTemplate(range);
505
- if (externalTemplate !== null) {
506
- return externalTemplate;
507
- }
508
- }
509
- return this.templateFromPartialCode(templateNode, range);
510
- }
511
- tryExternalTemplate(range) {
512
- const sourceFile = this.getSourceFile();
513
- if (sourceFile === null) {
514
- return null;
515
- }
516
- const pos = sourceFile.getOriginalLocation(range.startLine, range.startCol);
517
- if (pos === null || pos.file === this.sourceUrl || /\.[jt]s$/.test(pos.file) || pos.line !== 0 || pos.column !== 0) {
518
- return null;
519
- }
520
- const templateContents = sourceFile.sources.find((src) => (src == null ? void 0 : src.sourcePath) === pos.file).contents;
521
- return {
522
- code: templateContents,
523
- sourceUrl: pos.file,
524
- range: { startPos: 0, startLine: 0, startCol: 0, endPos: templateContents.length },
525
- isEscaped: false
526
- };
527
- }
528
- templateFromPartialCode(templateNode, { startPos, endPos, startLine, startCol }) {
529
- if (!/["'`]/.test(this.code[startPos]) || this.code[startPos] !== this.code[endPos - 1]) {
530
- throw new FatalLinkerError(templateNode.expression, `Expected the template string to be wrapped in quotes but got: ${this.code.substring(startPos, endPos)}`);
531
- }
532
- return {
533
- code: this.code,
534
- sourceUrl: this.sourceUrl,
535
- range: { startPos: startPos + 1, endPos: endPos - 1, startLine, startCol: startCol + 1 },
536
- isEscaped: true
537
- };
538
- }
539
- };
540
- function parseInterpolationConfig(metaObj) {
541
- if (!metaObj.has("interpolation")) {
542
- return DEFAULT_INTERPOLATION_CONFIG;
543
- }
544
- const interpolationExpr = metaObj.getValue("interpolation");
545
- const values = interpolationExpr.getArray().map((entry) => entry.getString());
546
- if (values.length !== 2) {
547
- throw new FatalLinkerError(interpolationExpr.expression, "Unsupported interpolation config, expected an array containing exactly two strings");
548
- }
549
- return InterpolationConfig.fromArray(values);
550
- }
551
- function parseEncapsulation(encapsulation) {
552
- const symbolName = encapsulation.getSymbolName();
553
- if (symbolName === null) {
554
- throw new FatalLinkerError(encapsulation.expression, "Expected encapsulation to have a symbol name");
555
- }
556
- const enumValue = ViewEncapsulation[symbolName];
557
- if (enumValue === void 0) {
558
- throw new FatalLinkerError(encapsulation.expression, "Unsupported encapsulation");
559
- }
560
- return enumValue;
561
- }
562
- function parseChangeDetectionStrategy(changeDetectionStrategy) {
563
- const symbolName = changeDetectionStrategy.getSymbolName();
564
- if (symbolName === null) {
565
- throw new FatalLinkerError(changeDetectionStrategy.expression, "Expected change detection strategy to have a symbol name");
566
- }
567
- const enumValue = ChangeDetectionStrategy[symbolName];
568
- if (enumValue === void 0) {
569
- throw new FatalLinkerError(changeDetectionStrategy.expression, "Unsupported change detection strategy");
570
- }
571
- return enumValue;
572
- }
573
-
574
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_factory_linker_1.mjs
575
- import { compileFactoryFunction, FactoryTarget } from "@angular/compiler";
576
- var PartialFactoryLinkerVersion1 = class {
577
- linkPartialDeclaration(constantPool, metaObj) {
578
- const meta = toR3FactoryMeta(metaObj);
579
- const def = compileFactoryFunction(meta);
580
- return def.expression;
581
- }
582
- };
583
- function toR3FactoryMeta(metaObj) {
584
- const typeExpr = metaObj.getValue("type");
585
- const typeName = typeExpr.getSymbolName();
586
- if (typeName === null) {
587
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
588
- }
589
- return {
590
- name: typeName,
591
- type: wrapReference(typeExpr.getOpaque()),
592
- internalType: metaObj.getOpaque("type"),
593
- typeArgumentCount: 0,
594
- target: parseEnum(metaObj.getValue("target"), FactoryTarget),
595
- deps: getDependencies(metaObj, "deps")
596
- };
597
- }
598
- function getDependencies(metaObj, propName) {
599
- if (!metaObj.has(propName)) {
600
- return null;
601
- }
602
- const deps = metaObj.getValue(propName);
603
- if (deps.isArray()) {
604
- return deps.getArray().map((dep) => getDependency(dep.getObject()));
605
- }
606
- if (deps.isString()) {
607
- return "invalid";
608
- }
609
- return null;
610
- }
611
-
612
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injectable_linker_1.mjs
613
- import { compileInjectable, createMayBeForwardRefExpression as createMayBeForwardRefExpression2, outputAst as o3 } from "@angular/compiler";
614
- var PartialInjectableLinkerVersion1 = class {
615
- linkPartialDeclaration(constantPool, metaObj) {
616
- const meta = toR3InjectableMeta(metaObj);
617
- const def = compileInjectable(meta, false);
618
- return def.expression;
619
- }
620
- };
621
- function toR3InjectableMeta(metaObj) {
622
- const typeExpr = metaObj.getValue("type");
623
- const typeName = typeExpr.getSymbolName();
624
- if (typeName === null) {
625
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
626
- }
627
- const meta = {
628
- name: typeName,
629
- type: wrapReference(typeExpr.getOpaque()),
630
- internalType: typeExpr.getOpaque(),
631
- typeArgumentCount: 0,
632
- providedIn: metaObj.has("providedIn") ? extractForwardRef(metaObj.getValue("providedIn")) : createMayBeForwardRefExpression2(o3.literal(null), 0)
633
- };
634
- if (metaObj.has("useClass")) {
635
- meta.useClass = extractForwardRef(metaObj.getValue("useClass"));
636
- }
637
- if (metaObj.has("useFactory")) {
638
- meta.useFactory = metaObj.getOpaque("useFactory");
639
- }
640
- if (metaObj.has("useExisting")) {
641
- meta.useExisting = extractForwardRef(metaObj.getValue("useExisting"));
642
- }
643
- if (metaObj.has("useValue")) {
644
- meta.useValue = extractForwardRef(metaObj.getValue("useValue"));
645
- }
646
- if (metaObj.has("deps")) {
647
- meta.deps = metaObj.getArray("deps").map((dep) => getDependency(dep.getObject()));
648
- }
649
- return meta;
650
- }
651
-
652
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1.mjs
653
- import { compileInjector } from "@angular/compiler";
654
- var PartialInjectorLinkerVersion1 = class {
655
- linkPartialDeclaration(constantPool, metaObj) {
656
- const meta = toR3InjectorMeta(metaObj);
657
- const def = compileInjector(meta);
658
- return def.expression;
659
- }
660
- };
661
- function toR3InjectorMeta(metaObj) {
662
- const typeExpr = metaObj.getValue("type");
663
- const typeName = typeExpr.getSymbolName();
664
- if (typeName === null) {
665
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
666
- }
667
- return {
668
- name: typeName,
669
- type: wrapReference(typeExpr.getOpaque()),
670
- internalType: metaObj.getOpaque("type"),
671
- providers: metaObj.has("providers") ? metaObj.getOpaque("providers") : null,
672
- imports: metaObj.has("imports") ? metaObj.getArray("imports").map((i) => i.getOpaque()) : []
673
- };
674
- }
675
-
676
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1.mjs
677
- import { compileNgModule } from "@angular/compiler";
678
- var PartialNgModuleLinkerVersion1 = class {
679
- constructor(emitInline) {
680
- this.emitInline = emitInline;
681
- }
682
- linkPartialDeclaration(constantPool, metaObj) {
683
- const meta = toR3NgModuleMeta(metaObj, this.emitInline);
684
- const def = compileNgModule(meta);
685
- return def.expression;
686
- }
687
- };
688
- function toR3NgModuleMeta(metaObj, emitInline) {
689
- const wrappedType = metaObj.getOpaque("type");
690
- const meta = {
691
- type: wrapReference(wrappedType),
692
- internalType: wrappedType,
693
- adjacentType: wrappedType,
694
- bootstrap: [],
695
- declarations: [],
696
- imports: [],
697
- exports: [],
698
- emitInline,
699
- containsForwardDecls: false,
700
- schemas: [],
701
- id: metaObj.has("id") ? metaObj.getOpaque("id") : null
702
- };
703
- if (metaObj.has("bootstrap")) {
704
- const bootstrap = metaObj.getValue("bootstrap");
705
- if (bootstrap.isFunction()) {
706
- meta.containsForwardDecls = true;
707
- meta.bootstrap = wrapReferences(unwrapForwardRefs(bootstrap));
708
- } else
709
- meta.bootstrap = wrapReferences(bootstrap);
710
- }
711
- if (metaObj.has("declarations")) {
712
- const declarations = metaObj.getValue("declarations");
713
- if (declarations.isFunction()) {
714
- meta.containsForwardDecls = true;
715
- meta.declarations = wrapReferences(unwrapForwardRefs(declarations));
716
- } else
717
- meta.declarations = wrapReferences(declarations);
718
- }
719
- if (metaObj.has("imports")) {
720
- const imports = metaObj.getValue("imports");
721
- if (imports.isFunction()) {
722
- meta.containsForwardDecls = true;
723
- meta.imports = wrapReferences(unwrapForwardRefs(imports));
724
- } else
725
- meta.imports = wrapReferences(imports);
726
- }
727
- if (metaObj.has("exports")) {
728
- const exports = metaObj.getValue("exports");
729
- if (exports.isFunction()) {
730
- meta.containsForwardDecls = true;
731
- meta.exports = wrapReferences(unwrapForwardRefs(exports));
732
- } else
733
- meta.exports = wrapReferences(exports);
734
- }
735
- if (metaObj.has("schemas")) {
736
- const schemas = metaObj.getValue("schemas");
737
- meta.schemas = wrapReferences(schemas);
738
- }
739
- return meta;
740
- }
741
- function unwrapForwardRefs(field) {
742
- return field.getFunctionReturnValue();
743
- }
744
- function wrapReferences(values) {
745
- return values.getArray().map((i) => wrapReference(i.getOpaque()));
746
- }
747
-
748
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1.mjs
749
- import { compilePipeFromMetadata } from "@angular/compiler";
750
- var PartialPipeLinkerVersion1 = class {
751
- constructor() {
752
- }
753
- linkPartialDeclaration(constantPool, metaObj) {
754
- const meta = toR3PipeMeta(metaObj);
755
- const def = compilePipeFromMetadata(meta);
756
- return def.expression;
757
- }
758
- };
759
- function toR3PipeMeta(metaObj) {
760
- const typeExpr = metaObj.getValue("type");
761
- const typeName = typeExpr.getSymbolName();
762
- if (typeName === null) {
763
- throw new FatalLinkerError(typeExpr.expression, "Unsupported type, its name could not be determined");
764
- }
765
- const pure = metaObj.has("pure") ? metaObj.getBoolean("pure") : true;
766
- return {
767
- name: typeName,
768
- type: wrapReference(typeExpr.getOpaque()),
769
- internalType: metaObj.getOpaque("type"),
770
- typeArgumentCount: 0,
771
- deps: null,
772
- pipeName: metaObj.getString("name"),
773
- pure
774
- };
775
- }
776
-
777
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.mjs
778
- var \u0275\u0275ngDeclareDirective = "\u0275\u0275ngDeclareDirective";
779
- var \u0275\u0275ngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
780
- var \u0275\u0275ngDeclareComponent = "\u0275\u0275ngDeclareComponent";
781
- var \u0275\u0275ngDeclareFactory = "\u0275\u0275ngDeclareFactory";
782
- var \u0275\u0275ngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
783
- var \u0275\u0275ngDeclareInjector = "\u0275\u0275ngDeclareInjector";
784
- var \u0275\u0275ngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
785
- var \u0275\u0275ngDeclarePipe = "\u0275\u0275ngDeclarePipe";
786
- var declarationFunctions = [
787
- \u0275\u0275ngDeclareDirective,
788
- \u0275\u0275ngDeclareClassMetadata,
789
- \u0275\u0275ngDeclareComponent,
790
- \u0275\u0275ngDeclareFactory,
791
- \u0275\u0275ngDeclareInjectable,
792
- \u0275\u0275ngDeclareInjector,
793
- \u0275\u0275ngDeclareNgModule,
794
- \u0275\u0275ngDeclarePipe
795
- ];
796
- function createLinkerMap(environment, sourceUrl, code) {
797
- const linkers = new Map();
798
- const LATEST_VERSION_RANGE = getRange("<=", "13.0.3");
799
- linkers.set(\u0275\u0275ngDeclareDirective, [
800
- { range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(sourceUrl, code) }
801
- ]);
802
- linkers.set(\u0275\u0275ngDeclareClassMetadata, [
803
- { range: LATEST_VERSION_RANGE, linker: new PartialClassMetadataLinkerVersion1() }
804
- ]);
805
- linkers.set(\u0275\u0275ngDeclareComponent, [
806
- {
807
- range: LATEST_VERSION_RANGE,
808
- linker: new PartialComponentLinkerVersion1(createGetSourceFile(sourceUrl, code, environment.sourceFileLoader), sourceUrl, code)
809
- }
810
- ]);
811
- linkers.set(\u0275\u0275ngDeclareFactory, [
812
- { range: LATEST_VERSION_RANGE, linker: new PartialFactoryLinkerVersion1() }
813
- ]);
814
- linkers.set(\u0275\u0275ngDeclareInjectable, [
815
- { range: LATEST_VERSION_RANGE, linker: new PartialInjectableLinkerVersion1() }
816
- ]);
817
- linkers.set(\u0275\u0275ngDeclareInjector, [
818
- { range: LATEST_VERSION_RANGE, linker: new PartialInjectorLinkerVersion1() }
819
- ]);
820
- linkers.set(\u0275\u0275ngDeclareNgModule, [
821
- {
822
- range: LATEST_VERSION_RANGE,
823
- linker: new PartialNgModuleLinkerVersion1(environment.options.linkerJitMode)
824
- }
825
- ]);
826
- linkers.set(\u0275\u0275ngDeclarePipe, [
827
- { range: LATEST_VERSION_RANGE, linker: new PartialPipeLinkerVersion1() }
828
- ]);
829
- return linkers;
830
- }
831
- var PartialLinkerSelector = class {
832
- constructor(linkers, logger, unknownDeclarationVersionHandling) {
833
- this.linkers = linkers;
834
- this.logger = logger;
835
- this.unknownDeclarationVersionHandling = unknownDeclarationVersionHandling;
836
- }
837
- supportsDeclaration(functionName) {
838
- return this.linkers.has(functionName);
839
- }
840
- getLinker(functionName, minVersion, version) {
841
- if (!this.linkers.has(functionName)) {
842
- throw new Error(`Unknown partial declaration function ${functionName}.`);
843
- }
844
- const linkerRanges = this.linkers.get(functionName);
845
- if (version === "13.0.3") {
846
- return linkerRanges[linkerRanges.length - 1].linker;
847
- }
848
- const declarationRange = getRange(">=", minVersion);
849
- for (const { range: linkerRange, linker } of linkerRanges) {
850
- if (semver.intersects(declarationRange, linkerRange)) {
851
- return linker;
852
- }
853
- }
854
- const message = `This application depends upon a library published using Angular version ${version}, which requires Angular version ${minVersion} or newer to work correctly.
855
- Consider upgrading your application to use a more recent version of Angular.`;
856
- if (this.unknownDeclarationVersionHandling === "error") {
857
- throw new Error(message);
858
- } else if (this.unknownDeclarationVersionHandling === "warn") {
859
- this.logger.warn(`${message}
860
- Attempting to continue using this version of Angular.`);
861
- }
862
- return linkerRanges[linkerRanges.length - 1].linker;
863
- }
864
- };
865
- function getRange(comparator, versionStr) {
866
- const version = new semver.SemVer(versionStr);
867
- version.prerelease = [];
868
- return new semver.Range(`${comparator}${version.format()}`);
869
- }
870
-
871
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/file_linker.mjs
872
- var FileLinker = class {
873
- constructor(linkerEnvironment, sourceUrl, code) {
874
- this.linkerEnvironment = linkerEnvironment;
875
- this.emitScopes = new Map();
876
- this.linkerSelector = new PartialLinkerSelector(createLinkerMap(this.linkerEnvironment, sourceUrl, code), this.linkerEnvironment.logger, this.linkerEnvironment.options.unknownDeclarationVersionHandling);
877
- }
878
- isPartialDeclaration(calleeName) {
879
- return this.linkerSelector.supportsDeclaration(calleeName);
880
- }
881
- linkPartialDeclaration(declarationFn, args, declarationScope) {
882
- if (args.length !== 1) {
883
- throw new Error(`Invalid function call: It should have only a single object literal argument, but contained ${args.length}.`);
884
- }
885
- const metaObj = AstObject.parse(args[0], this.linkerEnvironment.host);
886
- const ngImport = metaObj.getNode("ngImport");
887
- const emitScope = this.getEmitScope(ngImport, declarationScope);
888
- const minVersion = metaObj.getString("minVersion");
889
- const version = metaObj.getString("version");
890
- const linker = this.linkerSelector.getLinker(declarationFn, minVersion, version);
891
- const definition = linker.linkPartialDeclaration(emitScope.constantPool, metaObj);
892
- return emitScope.translateDefinition(definition);
893
- }
894
- getConstantStatements() {
895
- const results = [];
896
- for (const [constantScope, emitScope] of this.emitScopes.entries()) {
897
- const statements = emitScope.getConstantStatements();
898
- results.push({ constantScope, statements });
899
- }
900
- return results;
901
- }
902
- getEmitScope(ngImport, declarationScope) {
903
- const constantScope = declarationScope.getConstantScopeRef(ngImport);
904
- if (constantScope === null) {
905
- return new IifeEmitScope(ngImport, this.linkerEnvironment.translator, this.linkerEnvironment.factory);
906
- }
907
- if (!this.emitScopes.has(constantScope)) {
908
- this.emitScopes.set(constantScope, new EmitScope(ngImport, this.linkerEnvironment.translator));
909
- }
910
- return this.emitScopes.get(constantScope);
911
- }
912
- };
913
-
914
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/content_origin.mjs
915
- var ContentOrigin;
916
- (function(ContentOrigin2) {
917
- ContentOrigin2[ContentOrigin2["Provided"] = 0] = "Provided";
918
- ContentOrigin2[ContentOrigin2["Inline"] = 1] = "Inline";
919
- ContentOrigin2[ContentOrigin2["FileSystem"] = 2] = "FileSystem";
920
- })(ContentOrigin || (ContentOrigin = {}));
921
-
922
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
923
- import mapHelpers from "convert-source-map";
924
- import { decode, encode } from "sourcemap-codec";
925
-
926
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/segment_marker.mjs
927
- function compareSegments(a, b) {
928
- return a.position - b.position;
929
- }
930
- function offsetSegment(startOfLinePositions, marker, offset) {
931
- if (offset === 0) {
932
- return marker;
933
- }
934
- let line = marker.line;
935
- const position = marker.position + offset;
936
- while (line < startOfLinePositions.length - 1 && startOfLinePositions[line + 1] <= position) {
937
- line++;
938
- }
939
- while (line > 0 && startOfLinePositions[line] > position) {
940
- line--;
941
- }
942
- const column = position - startOfLinePositions[line];
943
- return { line, column, position, next: void 0 };
944
- }
945
-
946
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file.mjs
947
- function removeSourceMapComments(contents) {
948
- return mapHelpers.removeMapFileComments(mapHelpers.removeComments(contents)).replace(/\n\n$/, "\n");
949
- }
950
- var SourceFile = class {
951
- constructor(sourcePath, contents, rawMap, sources, fs3) {
952
- this.sourcePath = sourcePath;
953
- this.contents = contents;
954
- this.rawMap = rawMap;
955
- this.sources = sources;
956
- this.fs = fs3;
957
- this.contents = removeSourceMapComments(contents);
958
- this.startOfLinePositions = computeStartOfLinePositions(this.contents);
959
- this.flattenedMappings = this.flattenMappings();
960
- }
961
- renderFlattenedSourceMap() {
962
- const sources = new IndexedMap();
963
- const names = new IndexedSet();
964
- const mappings = [];
965
- const sourcePathDir = this.fs.dirname(this.sourcePath);
966
- const relativeSourcePathCache = new Cache((input) => this.fs.relative(sourcePathDir, input));
967
- for (const mapping of this.flattenedMappings) {
968
- const sourceIndex = sources.set(relativeSourcePathCache.get(mapping.originalSource.sourcePath), mapping.originalSource.contents);
969
- const mappingArray = [
970
- mapping.generatedSegment.column,
971
- sourceIndex,
972
- mapping.originalSegment.line,
973
- mapping.originalSegment.column
974
- ];
975
- if (mapping.name !== void 0) {
976
- const nameIndex = names.add(mapping.name);
977
- mappingArray.push(nameIndex);
978
- }
979
- const line = mapping.generatedSegment.line;
980
- while (line >= mappings.length) {
981
- mappings.push([]);
982
- }
983
- mappings[line].push(mappingArray);
984
- }
985
- const sourceMap = {
986
- version: 3,
987
- file: this.fs.relative(sourcePathDir, this.sourcePath),
988
- sources: sources.keys,
989
- names: names.values,
990
- mappings: encode(mappings),
991
- sourcesContent: sources.values
992
- };
993
- return sourceMap;
994
- }
995
- getOriginalLocation(line, column) {
996
- if (this.flattenedMappings.length === 0) {
997
- return null;
998
- }
999
- let position;
1000
- if (line < this.startOfLinePositions.length) {
1001
- position = this.startOfLinePositions[line] + column;
1002
- } else {
1003
- position = this.contents.length;
1004
- }
1005
- const locationSegment = { line, column, position, next: void 0 };
1006
- let mappingIndex = findLastMappingIndexBefore(this.flattenedMappings, locationSegment, false, 0);
1007
- if (mappingIndex < 0) {
1008
- mappingIndex = 0;
1009
- }
1010
- const { originalSegment, originalSource, generatedSegment } = this.flattenedMappings[mappingIndex];
1011
- const offset = locationSegment.position - generatedSegment.position;
1012
- const offsetOriginalSegment = offsetSegment(originalSource.startOfLinePositions, originalSegment, offset);
1013
- return {
1014
- file: originalSource.sourcePath,
1015
- line: offsetOriginalSegment.line,
1016
- column: offsetOriginalSegment.column
1017
- };
1018
- }
1019
- flattenMappings() {
1020
- const mappings = parseMappings(this.rawMap && this.rawMap.map, this.sources, this.startOfLinePositions);
1021
- ensureOriginalSegmentLinks(mappings);
1022
- const flattenedMappings = [];
1023
- for (let mappingIndex = 0; mappingIndex < mappings.length; mappingIndex++) {
1024
- const aToBmapping = mappings[mappingIndex];
1025
- const bSource = aToBmapping.originalSource;
1026
- if (bSource.flattenedMappings.length === 0) {
1027
- flattenedMappings.push(aToBmapping);
1028
- continue;
1029
- }
1030
- const incomingStart = aToBmapping.originalSegment;
1031
- const incomingEnd = incomingStart.next;
1032
- let outgoingStartIndex = findLastMappingIndexBefore(bSource.flattenedMappings, incomingStart, false, 0);
1033
- if (outgoingStartIndex < 0) {
1034
- outgoingStartIndex = 0;
1035
- }
1036
- const outgoingEndIndex = incomingEnd !== void 0 ? findLastMappingIndexBefore(bSource.flattenedMappings, incomingEnd, true, outgoingStartIndex) : bSource.flattenedMappings.length - 1;
1037
- for (let bToCmappingIndex = outgoingStartIndex; bToCmappingIndex <= outgoingEndIndex; bToCmappingIndex++) {
1038
- const bToCmapping = bSource.flattenedMappings[bToCmappingIndex];
1039
- flattenedMappings.push(mergeMappings(this, aToBmapping, bToCmapping));
1040
- }
1041
- }
1042
- return flattenedMappings;
1043
- }
1044
- };
1045
- function findLastMappingIndexBefore(mappings, marker, exclusive, lowerIndex) {
1046
- let upperIndex = mappings.length - 1;
1047
- const test = exclusive ? -1 : 0;
1048
- if (compareSegments(mappings[lowerIndex].generatedSegment, marker) > test) {
1049
- return -1;
1050
- }
1051
- let matchingIndex = -1;
1052
- while (lowerIndex <= upperIndex) {
1053
- const index = upperIndex + lowerIndex >> 1;
1054
- if (compareSegments(mappings[index].generatedSegment, marker) <= test) {
1055
- matchingIndex = index;
1056
- lowerIndex = index + 1;
1057
- } else {
1058
- upperIndex = index - 1;
1059
- }
1060
- }
1061
- return matchingIndex;
1062
- }
1063
- function mergeMappings(generatedSource, ab, bc) {
1064
- const name = bc.name || ab.name;
1065
- const diff = compareSegments(bc.generatedSegment, ab.originalSegment);
1066
- if (diff > 0) {
1067
- return {
1068
- name,
1069
- generatedSegment: offsetSegment(generatedSource.startOfLinePositions, ab.generatedSegment, diff),
1070
- originalSource: bc.originalSource,
1071
- originalSegment: bc.originalSegment
1072
- };
1073
- } else {
1074
- return {
1075
- name,
1076
- generatedSegment: ab.generatedSegment,
1077
- originalSource: bc.originalSource,
1078
- originalSegment: offsetSegment(bc.originalSource.startOfLinePositions, bc.originalSegment, -diff)
1079
- };
1080
- }
1081
- }
1082
- function parseMappings(rawMap, sources, generatedSourceStartOfLinePositions) {
1083
- if (rawMap === null) {
1084
- return [];
1085
- }
1086
- const rawMappings = decode(rawMap.mappings);
1087
- if (rawMappings === null) {
1088
- return [];
1089
- }
1090
- const mappings = [];
1091
- for (let generatedLine = 0; generatedLine < rawMappings.length; generatedLine++) {
1092
- const generatedLineMappings = rawMappings[generatedLine];
1093
- for (const rawMapping of generatedLineMappings) {
1094
- if (rawMapping.length >= 4) {
1095
- const originalSource = sources[rawMapping[1]];
1096
- if (originalSource === null || originalSource === void 0) {
1097
- continue;
1098
- }
1099
- const generatedColumn = rawMapping[0];
1100
- const name = rawMapping.length === 5 ? rawMap.names[rawMapping[4]] : void 0;
1101
- const line = rawMapping[2];
1102
- const column = rawMapping[3];
1103
- const generatedSegment = {
1104
- line: generatedLine,
1105
- column: generatedColumn,
1106
- position: generatedSourceStartOfLinePositions[generatedLine] + generatedColumn,
1107
- next: void 0
1108
- };
1109
- const originalSegment = {
1110
- line,
1111
- column,
1112
- position: originalSource.startOfLinePositions[line] + column,
1113
- next: void 0
1114
- };
1115
- mappings.push({ name, generatedSegment, originalSegment, originalSource });
1116
- }
1117
- }
1118
- }
1119
- return mappings;
1120
- }
1121
- function extractOriginalSegments(mappings) {
1122
- const originalSegments = new Map();
1123
- for (const mapping of mappings) {
1124
- const originalSource = mapping.originalSource;
1125
- if (!originalSegments.has(originalSource)) {
1126
- originalSegments.set(originalSource, []);
1127
- }
1128
- const segments = originalSegments.get(originalSource);
1129
- segments.push(mapping.originalSegment);
1130
- }
1131
- originalSegments.forEach((segmentMarkers) => segmentMarkers.sort(compareSegments));
1132
- return originalSegments;
1133
- }
1134
- function ensureOriginalSegmentLinks(mappings) {
1135
- const segmentsBySource = extractOriginalSegments(mappings);
1136
- segmentsBySource.forEach((markers) => {
1137
- for (let i = 0; i < markers.length - 1; i++) {
1138
- markers[i].next = markers[i + 1];
1139
- }
1140
- });
1141
- }
1142
- function computeStartOfLinePositions(str) {
1143
- const NEWLINE_MARKER_OFFSET = 1;
1144
- const lineLengths = computeLineLengths(str);
1145
- const startPositions = [0];
1146
- for (let i = 0; i < lineLengths.length - 1; i++) {
1147
- startPositions.push(startPositions[i] + lineLengths[i] + NEWLINE_MARKER_OFFSET);
1148
- }
1149
- return startPositions;
1150
- }
1151
- function computeLineLengths(str) {
1152
- return str.split(/\n/).map((s) => s.length);
1153
- }
1154
- var IndexedMap = class {
1155
- constructor() {
1156
- this.map = new Map();
1157
- this.keys = [];
1158
- this.values = [];
1159
- }
1160
- set(key, value) {
1161
- if (this.map.has(key)) {
1162
- return this.map.get(key);
1163
- }
1164
- const index = this.values.push(value) - 1;
1165
- this.keys.push(key);
1166
- this.map.set(key, index);
1167
- return index;
1168
- }
1169
- };
1170
- var IndexedSet = class {
1171
- constructor() {
1172
- this.map = new Map();
1173
- this.values = [];
1174
- }
1175
- add(value) {
1176
- if (this.map.has(value)) {
1177
- return this.map.get(value);
1178
- }
1179
- const index = this.values.push(value) - 1;
1180
- this.map.set(value, index);
1181
- return index;
1182
- }
1183
- };
1184
- var Cache = class {
1185
- constructor(computeFn) {
1186
- this.computeFn = computeFn;
1187
- this.map = new Map();
1188
- }
1189
- get(input) {
1190
- if (!this.map.has(input)) {
1191
- this.map.set(input, this.computeFn(input));
1192
- }
1193
- return this.map.get(input);
1194
- }
1195
- };
1196
-
1197
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/sourcemaps/src/source_file_loader.mjs
1198
- import mapHelpers2 from "convert-source-map";
1199
- var SCHEME_MATCHER = /^([a-z][a-z0-9.-]*):\/\//i;
1200
- var SourceFileLoader = class {
1201
- constructor(fs3, logger, schemeMap) {
1202
- this.fs = fs3;
1203
- this.logger = logger;
1204
- this.schemeMap = schemeMap;
1205
- this.currentPaths = [];
1206
- }
1207
- loadSourceFile(sourcePath, contents = null, mapAndPath = null) {
1208
- const contentsOrigin = contents !== null ? ContentOrigin.Provided : ContentOrigin.FileSystem;
1209
- const sourceMapInfo = mapAndPath && __spreadValues({ origin: ContentOrigin.Provided }, mapAndPath);
1210
- return this.loadSourceFileInternal(sourcePath, contents, contentsOrigin, sourceMapInfo);
1211
- }
1212
- loadSourceFileInternal(sourcePath, contents, sourceOrigin, sourceMapInfo) {
1213
- const previousPaths = this.currentPaths.slice();
1214
- try {
1215
- if (contents === null) {
1216
- if (!this.fs.exists(sourcePath)) {
1217
- return null;
1218
- }
1219
- contents = this.readSourceFile(sourcePath);
1220
- }
1221
- if (sourceMapInfo === null) {
1222
- sourceMapInfo = this.loadSourceMap(sourcePath, contents, sourceOrigin);
1223
- }
1224
- let sources = [];
1225
- if (sourceMapInfo !== null) {
1226
- const basePath = sourceMapInfo.mapPath || sourcePath;
1227
- sources = this.processSources(basePath, sourceMapInfo);
1228
- }
1229
- return new SourceFile(sourcePath, contents, sourceMapInfo, sources, this.fs);
1230
- } catch (e) {
1231
- this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1232
- return null;
1233
- } finally {
1234
- this.currentPaths = previousPaths;
1235
- }
1236
- }
1237
- loadSourceMap(sourcePath, sourceContents, sourceOrigin) {
1238
- const lastLine = this.getLastNonEmptyLine(sourceContents);
1239
- const inline = mapHelpers2.commentRegex.exec(lastLine);
1240
- if (inline !== null) {
1241
- return {
1242
- map: mapHelpers2.fromComment(inline.pop()).sourcemap,
1243
- mapPath: null,
1244
- origin: ContentOrigin.Inline
1245
- };
1246
- }
1247
- if (sourceOrigin === ContentOrigin.Inline) {
1248
- return null;
1249
- }
1250
- const external = mapHelpers2.mapFileCommentRegex.exec(lastLine);
1251
- if (external) {
1252
- try {
1253
- const fileName = external[1] || external[2];
1254
- const externalMapPath = this.fs.resolve(this.fs.dirname(sourcePath), fileName);
1255
- return {
1256
- map: this.readRawSourceMap(externalMapPath),
1257
- mapPath: externalMapPath,
1258
- origin: ContentOrigin.FileSystem
1259
- };
1260
- } catch (e) {
1261
- this.logger.warn(`Unable to fully load ${sourcePath} for source-map flattening: ${e.message}`);
1262
- return null;
1263
- }
1264
- }
1265
- const impliedMapPath = this.fs.resolve(sourcePath + ".map");
1266
- if (this.fs.exists(impliedMapPath)) {
1267
- return {
1268
- map: this.readRawSourceMap(impliedMapPath),
1269
- mapPath: impliedMapPath,
1270
- origin: ContentOrigin.FileSystem
1271
- };
1272
- }
1273
- return null;
1274
- }
1275
- processSources(basePath, { map, origin: sourceMapOrigin }) {
1276
- const sourceRoot = this.fs.resolve(this.fs.dirname(basePath), this.replaceSchemeWithPath(map.sourceRoot || ""));
1277
- return map.sources.map((source, index) => {
1278
- const path = this.fs.resolve(sourceRoot, this.replaceSchemeWithPath(source));
1279
- const content = map.sourcesContent && map.sourcesContent[index] || null;
1280
- const sourceOrigin = content !== null && sourceMapOrigin !== ContentOrigin.Provided ? ContentOrigin.Inline : ContentOrigin.FileSystem;
1281
- return this.loadSourceFileInternal(path, content, sourceOrigin, null);
1282
- });
1283
- }
1284
- readSourceFile(sourcePath) {
1285
- this.trackPath(sourcePath);
1286
- return this.fs.readFile(sourcePath);
1287
- }
1288
- readRawSourceMap(mapPath) {
1289
- this.trackPath(mapPath);
1290
- return JSON.parse(this.fs.readFile(mapPath));
1291
- }
1292
- trackPath(path) {
1293
- if (this.currentPaths.includes(path)) {
1294
- throw new Error(`Circular source file mapping dependency: ${this.currentPaths.join(" -> ")} -> ${path}`);
1295
- }
1296
- this.currentPaths.push(path);
1297
- }
1298
- getLastNonEmptyLine(contents) {
1299
- let trailingWhitespaceIndex = contents.length - 1;
1300
- while (trailingWhitespaceIndex > 0 && (contents[trailingWhitespaceIndex] === "\n" || contents[trailingWhitespaceIndex] === "\r")) {
1301
- trailingWhitespaceIndex--;
1302
- }
1303
- let lastRealLineIndex = contents.lastIndexOf("\n", trailingWhitespaceIndex - 1);
1304
- if (lastRealLineIndex === -1) {
1305
- lastRealLineIndex = 0;
1306
- }
1307
- return contents.substr(lastRealLineIndex + 1);
1308
- }
1309
- replaceSchemeWithPath(path) {
1310
- return path.replace(SCHEME_MATCHER, (_, scheme) => this.schemeMap[scheme.toLowerCase()] || "");
1311
- }
1312
- };
1313
-
1314
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_options.mjs
1315
- var DEFAULT_LINKER_OPTIONS = {
1316
- sourceMapping: true,
1317
- linkerJitMode: false,
1318
- unknownDeclarationVersionHandling: "error"
1319
- };
1320
-
1321
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/context.mjs
1322
- var Context = class {
1323
- constructor(isStatement) {
1324
- this.isStatement = isStatement;
1325
- }
1326
- get withExpressionMode() {
1327
- return this.isStatement ? new Context(false) : this;
1328
- }
1329
- get withStatementMode() {
1330
- return !this.isStatement ? new Context(true) : this;
1331
- }
1332
- };
1333
-
1334
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/import_manager.mjs
1335
- import ts6 from "typescript";
1336
-
1337
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/alias.mjs
1338
- import { ExternalExpr as ExternalExpr2 } from "@angular/compiler";
1339
-
1340
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1341
- import { ExternalExpr, ExternalReference, WrappedNodeExpr as WrappedNodeExpr2 } from "@angular/compiler";
1342
- import ts4 from "typescript";
1343
-
1344
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/compiler_host.mjs
1345
- import {
1346
- EOL
1347
- } from "os";
1348
- import ts from "typescript";
1349
-
1350
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/invalid_file_system.mjs
1351
- var InvalidFileSystem = class {
1352
- exists(path) {
1353
- throw makeError();
1354
- }
1355
- readFile(path) {
1356
- throw makeError();
1357
- }
1358
- readFileBuffer(path) {
1359
- throw makeError();
1360
- }
1361
- writeFile(path, data, exclusive) {
1362
- throw makeError();
1363
- }
1364
- removeFile(path) {
1365
- throw makeError();
1366
- }
1367
- symlink(target, path) {
1368
- throw makeError();
1369
- }
1370
- readdir(path) {
1371
- throw makeError();
1372
- }
1373
- lstat(path) {
1374
- throw makeError();
1375
- }
1376
- stat(path) {
1377
- throw makeError();
1378
- }
1379
- pwd() {
1380
- throw makeError();
1381
- }
1382
- chdir(path) {
1383
- throw makeError();
1384
- }
1385
- extname(path) {
1386
- throw makeError();
1387
- }
1388
- copyFile(from, to) {
1389
- throw makeError();
1390
- }
1391
- moveFile(from, to) {
1392
- throw makeError();
1393
- }
1394
- ensureDir(path) {
1395
- throw makeError();
1396
- }
1397
- removeDeep(path) {
1398
- throw makeError();
1399
- }
1400
- isCaseSensitive() {
1401
- throw makeError();
1402
- }
1403
- resolve(...paths) {
1404
- throw makeError();
1405
- }
1406
- dirname(file) {
1407
- throw makeError();
1408
- }
1409
- join(basePath, ...paths) {
1410
- throw makeError();
1411
- }
1412
- isRoot(path) {
1413
- throw makeError();
1414
- }
1415
- isRooted(path) {
1416
- throw makeError();
1417
- }
1418
- relative(from, to) {
1419
- throw makeError();
1420
- }
1421
- basename(filePath, extension) {
1422
- throw makeError();
1423
- }
1424
- realpath(filePath) {
1425
- throw makeError();
1426
- }
1427
- getDefaultLibLocation() {
1428
- throw makeError();
1429
- }
1430
- normalize(path) {
1431
- throw makeError();
1432
- }
1433
- };
1434
- function makeError() {
1435
- return new Error("FileSystem has not been configured. Please call `setFileSystem()` before calling this method.");
1436
- }
1437
-
1438
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/helpers.mjs
1439
- var fs = new InvalidFileSystem();
1440
- var ABSOLUTE_PATH = Symbol("AbsolutePath");
1441
-
1442
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/file_system/src/node_js_file_system.mjs
1443
6
  import {
1444
- copyFileSync,
1445
- existsSync,
1446
- lstatSync,
1447
- mkdirSync,
1448
- readFileSync,
1449
- readdirSync,
1450
- realpathSync,
1451
- renameSync,
1452
- rmdirSync,
1453
- statSync,
1454
- symlinkSync,
1455
- unlinkSync,
1456
- writeFileSync
1457
- } from "fs";
1458
- import module from "module";
1459
- import {
1460
- basename,
1461
- dirname as dirname2,
1462
- extname,
1463
- isAbsolute,
1464
- join,
1465
- relative as relative2,
1466
- resolve as resolve2
1467
- } from "path";
1468
- import { fileURLToPath } from "url";
1469
- var isCommonJS = typeof __filename !== "undefined";
1470
- var currentFileUrl = isCommonJS ? null : __ESM_IMPORT_META_URL__;
1471
- var currentFileName = isCommonJS ? __filename : fileURLToPath(currentFileUrl);
1472
-
1473
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/util/src/typescript.mjs
1474
- import ts2 from "typescript";
1475
-
1476
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/find_export.mjs
1477
- import ts3 from "typescript";
1478
-
1479
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
1480
- var ImportFlags;
1481
- (function(ImportFlags2) {
1482
- ImportFlags2[ImportFlags2["None"] = 0] = "None";
1483
- ImportFlags2[ImportFlags2["ForceNewImport"] = 1] = "ForceNewImport";
1484
- ImportFlags2[ImportFlags2["NoAliasing"] = 2] = "NoAliasing";
1485
- ImportFlags2[ImportFlags2["AllowTypeImports"] = 4] = "AllowTypeImports";
1486
- })(ImportFlags || (ImportFlags = {}));
1487
-
1488
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/core.mjs
1489
- var CORE_SUPPORTED_SYMBOLS = new Map([
1490
- ["\u0275\u0275defineInjectable", "\u0275\u0275defineInjectable"],
1491
- ["\u0275\u0275defineInjector", "\u0275\u0275defineInjector"],
1492
- ["\u0275\u0275defineNgModule", "\u0275\u0275defineNgModule"],
1493
- ["\u0275\u0275setNgModuleScope", "\u0275\u0275setNgModuleScope"],
1494
- ["\u0275\u0275inject", "\u0275\u0275inject"],
1495
- ["\u0275\u0275FactoryDeclaration", "\u0275\u0275FactoryDeclaration"],
1496
- ["\u0275setClassMetadata", "setClassMetadata"],
1497
- ["\u0275\u0275InjectableDeclaration", "\u0275\u0275InjectableDeclaration"],
1498
- ["\u0275\u0275InjectorDeclaration", "\u0275\u0275InjectorDeclaration"],
1499
- ["\u0275\u0275NgModuleDeclaration", "\u0275\u0275NgModuleDeclaration"],
1500
- ["\u0275NgModuleFactory", "NgModuleFactory"],
1501
- ["\u0275noSideEffects", "\u0275noSideEffects"]
1502
- ]);
1503
-
1504
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
1505
- import ts5 from "typescript";
1506
- var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
1507
-
1508
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/translator.mjs
1509
- import {
1510
- BinaryOperator,
1511
- ConditionalExpr,
1512
- StmtModifier,
1513
- UnaryOperator
1514
- } from "@angular/compiler";
1515
- var UNARY_OPERATORS = new Map([
1516
- [UnaryOperator.Minus, "-"],
1517
- [UnaryOperator.Plus, "+"]
1518
- ]);
1519
- var BINARY_OPERATORS = new Map([
1520
- [BinaryOperator.And, "&&"],
1521
- [BinaryOperator.Bigger, ">"],
1522
- [BinaryOperator.BiggerEquals, ">="],
1523
- [BinaryOperator.BitwiseAnd, "&"],
1524
- [BinaryOperator.Divide, "/"],
1525
- [BinaryOperator.Equals, "=="],
1526
- [BinaryOperator.Identical, "==="],
1527
- [BinaryOperator.Lower, "<"],
1528
- [BinaryOperator.LowerEquals, "<="],
1529
- [BinaryOperator.Minus, "-"],
1530
- [BinaryOperator.Modulo, "%"],
1531
- [BinaryOperator.Multiply, "*"],
1532
- [BinaryOperator.NotEquals, "!="],
1533
- [BinaryOperator.NotIdentical, "!=="],
1534
- [BinaryOperator.Or, "||"],
1535
- [BinaryOperator.Plus, "+"],
1536
- [BinaryOperator.NullishCoalesce, "??"]
1537
- ]);
1538
- var ExpressionTranslatorVisitor = class {
1539
- constructor(factory, imports, options) {
1540
- this.factory = factory;
1541
- this.imports = imports;
1542
- this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
1543
- this.downlevelVariableDeclarations = options.downlevelVariableDeclarations === true;
1544
- this.recordWrappedNode = options.recordWrappedNode || (() => {
1545
- });
1546
- }
1547
- visitDeclareVarStmt(stmt, context) {
1548
- var _a;
1549
- const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(StmtModifier.Final) ? "const" : "let";
1550
- return this.attachComments(this.factory.createVariableDeclaration(stmt.name, (_a = stmt.value) == null ? void 0 : _a.visitExpression(this, context.withExpressionMode), varType), stmt.leadingComments);
1551
- }
1552
- visitDeclareFunctionStmt(stmt, context) {
1553
- return this.attachComments(this.factory.createFunctionDeclaration(stmt.name, stmt.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(stmt.statements, context.withStatementMode))), stmt.leadingComments);
1554
- }
1555
- visitExpressionStmt(stmt, context) {
1556
- return this.attachComments(this.factory.createExpressionStatement(stmt.expr.visitExpression(this, context.withStatementMode)), stmt.leadingComments);
1557
- }
1558
- visitReturnStmt(stmt, context) {
1559
- return this.attachComments(this.factory.createReturnStatement(stmt.value.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1560
- }
1561
- visitDeclareClassStmt(_stmt, _context) {
1562
- throw new Error("Method not implemented.");
1563
- }
1564
- visitIfStmt(stmt, context) {
1565
- return this.attachComments(this.factory.createIfStatement(stmt.condition.visitExpression(this, context), this.factory.createBlock(this.visitStatements(stmt.trueCase, context.withStatementMode)), stmt.falseCase.length > 0 ? this.factory.createBlock(this.visitStatements(stmt.falseCase, context.withStatementMode)) : null), stmt.leadingComments);
1566
- }
1567
- visitTryCatchStmt(_stmt, _context) {
1568
- throw new Error("Method not implemented.");
1569
- }
1570
- visitThrowStmt(stmt, context) {
1571
- return this.attachComments(this.factory.createThrowStatement(stmt.error.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
1572
- }
1573
- visitReadVarExpr(ast, _context) {
1574
- const identifier = this.factory.createIdentifier(ast.name);
1575
- this.setSourceMapRange(identifier, ast.sourceSpan);
1576
- return identifier;
1577
- }
1578
- visitWriteVarExpr(expr, context) {
1579
- const assignment = this.factory.createAssignment(this.setSourceMapRange(this.factory.createIdentifier(expr.name), expr.sourceSpan), expr.value.visitExpression(this, context));
1580
- return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1581
- }
1582
- visitWriteKeyExpr(expr, context) {
1583
- const exprContext = context.withExpressionMode;
1584
- const target = this.factory.createElementAccess(expr.receiver.visitExpression(this, exprContext), expr.index.visitExpression(this, exprContext));
1585
- const assignment = this.factory.createAssignment(target, expr.value.visitExpression(this, exprContext));
1586
- return context.isStatement ? assignment : this.factory.createParenthesizedExpression(assignment);
1587
- }
1588
- visitWritePropExpr(expr, context) {
1589
- const target = this.factory.createPropertyAccess(expr.receiver.visitExpression(this, context), expr.name);
1590
- return this.factory.createAssignment(target, expr.value.visitExpression(this, context));
1591
- }
1592
- visitInvokeFunctionExpr(ast, context) {
1593
- return this.setSourceMapRange(this.factory.createCallExpression(ast.fn.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)), ast.pure), ast.sourceSpan);
1594
- }
1595
- visitTaggedTemplateExpr(ast, context) {
1596
- return this.setSourceMapRange(this.createTaggedTemplateExpression(ast.tag.visitExpression(this, context), {
1597
- elements: ast.template.elements.map((e) => {
1598
- var _a;
1599
- return createTemplateElement({
1600
- cooked: e.text,
1601
- raw: e.rawText,
1602
- range: (_a = e.sourceSpan) != null ? _a : ast.sourceSpan
1603
- });
1604
- }),
1605
- expressions: ast.template.expressions.map((e) => e.visitExpression(this, context))
1606
- }), ast.sourceSpan);
1607
- }
1608
- visitInstantiateExpr(ast, context) {
1609
- return this.factory.createNewExpression(ast.classExpr.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)));
1610
- }
1611
- visitLiteralExpr(ast, _context) {
1612
- return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
1613
- }
1614
- visitLocalizedString(ast, context) {
1615
- const elements = [createTemplateElement(ast.serializeI18nHead())];
1616
- const expressions = [];
1617
- for (let i = 0; i < ast.expressions.length; i++) {
1618
- const placeholder = this.setSourceMapRange(ast.expressions[i].visitExpression(this, context), ast.getPlaceholderSourceSpan(i));
1619
- expressions.push(placeholder);
1620
- elements.push(createTemplateElement(ast.serializeI18nTemplatePart(i + 1)));
1621
- }
1622
- const localizeTag = this.factory.createIdentifier("$localize");
1623
- return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, { elements, expressions }), ast.sourceSpan);
1624
- }
1625
- createTaggedTemplateExpression(tag, template) {
1626
- return this.downlevelTaggedTemplates ? this.createES5TaggedTemplateFunctionCall(tag, template) : this.factory.createTaggedTemplate(tag, template);
1627
- }
1628
- createES5TaggedTemplateFunctionCall(tagHandler, { elements, expressions }) {
1629
- const { moduleImport, symbol } = this.imports.generateNamedImport("tslib", "__makeTemplateObject");
1630
- const __makeTemplateObjectHelper = moduleImport === null ? this.factory.createIdentifier(symbol) : this.factory.createPropertyAccess(moduleImport, symbol);
1631
- const cooked = [];
1632
- const raw = [];
1633
- for (const element of elements) {
1634
- cooked.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.cooked), element.range));
1635
- raw.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.raw), element.range));
1636
- }
1637
- const templateHelperCall = this.factory.createCallExpression(__makeTemplateObjectHelper, [this.factory.createArrayLiteral(cooked), this.factory.createArrayLiteral(raw)], false);
1638
- return this.factory.createCallExpression(tagHandler, [templateHelperCall, ...expressions], false);
1639
- }
1640
- visitExternalExpr(ast, _context) {
1641
- if (ast.value.name === null) {
1642
- if (ast.value.moduleName === null) {
1643
- throw new Error("Invalid import without name nor moduleName");
1644
- }
1645
- return this.imports.generateNamespaceImport(ast.value.moduleName);
1646
- }
1647
- if (ast.value.moduleName !== null) {
1648
- const { moduleImport, symbol } = this.imports.generateNamedImport(ast.value.moduleName, ast.value.name);
1649
- if (moduleImport === null) {
1650
- return this.factory.createIdentifier(symbol);
1651
- } else {
1652
- return this.factory.createPropertyAccess(moduleImport, symbol);
1653
- }
1654
- } else {
1655
- return this.factory.createIdentifier(ast.value.name);
1656
- }
1657
- }
1658
- visitConditionalExpr(ast, context) {
1659
- let cond = ast.condition.visitExpression(this, context);
1660
- if (ast.condition instanceof ConditionalExpr) {
1661
- cond = this.factory.createParenthesizedExpression(cond);
1662
- }
1663
- return this.factory.createConditional(cond, ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context));
1664
- }
1665
- visitNotExpr(ast, context) {
1666
- return this.factory.createUnaryExpression("!", ast.condition.visitExpression(this, context));
1667
- }
1668
- visitAssertNotNullExpr(ast, context) {
1669
- return ast.condition.visitExpression(this, context);
1670
- }
1671
- visitCastExpr(ast, context) {
1672
- return ast.value.visitExpression(this, context);
1673
- }
1674
- visitFunctionExpr(ast, context) {
1675
- var _a;
1676
- return this.factory.createFunctionExpression((_a = ast.name) != null ? _a : null, ast.params.map((param) => param.name), this.factory.createBlock(this.visitStatements(ast.statements, context)));
1677
- }
1678
- visitBinaryOperatorExpr(ast, context) {
1679
- if (!BINARY_OPERATORS.has(ast.operator)) {
1680
- throw new Error(`Unknown binary operator: ${BinaryOperator[ast.operator]}`);
1681
- }
1682
- return this.factory.createBinaryExpression(ast.lhs.visitExpression(this, context), BINARY_OPERATORS.get(ast.operator), ast.rhs.visitExpression(this, context));
1683
- }
1684
- visitReadPropExpr(ast, context) {
1685
- return this.factory.createPropertyAccess(ast.receiver.visitExpression(this, context), ast.name);
1686
- }
1687
- visitReadKeyExpr(ast, context) {
1688
- return this.factory.createElementAccess(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context));
1689
- }
1690
- visitLiteralArrayExpr(ast, context) {
1691
- return this.factory.createArrayLiteral(ast.entries.map((expr) => this.setSourceMapRange(expr.visitExpression(this, context), ast.sourceSpan)));
1692
- }
1693
- visitLiteralMapExpr(ast, context) {
1694
- const properties = ast.entries.map((entry) => {
1695
- return {
1696
- propertyName: entry.key,
1697
- quoted: entry.quoted,
1698
- value: entry.value.visitExpression(this, context)
1699
- };
1700
- });
1701
- return this.setSourceMapRange(this.factory.createObjectLiteral(properties), ast.sourceSpan);
1702
- }
1703
- visitCommaExpr(ast, context) {
1704
- throw new Error("Method not implemented.");
1705
- }
1706
- visitWrappedNodeExpr(ast, _context) {
1707
- this.recordWrappedNode(ast);
1708
- return ast.node;
1709
- }
1710
- visitTypeofExpr(ast, context) {
1711
- return this.factory.createTypeOfExpression(ast.expr.visitExpression(this, context));
1712
- }
1713
- visitUnaryOperatorExpr(ast, context) {
1714
- if (!UNARY_OPERATORS.has(ast.operator)) {
1715
- throw new Error(`Unknown unary operator: ${UnaryOperator[ast.operator]}`);
1716
- }
1717
- return this.factory.createUnaryExpression(UNARY_OPERATORS.get(ast.operator), ast.expr.visitExpression(this, context));
1718
- }
1719
- visitStatements(statements, context) {
1720
- return statements.map((stmt) => stmt.visitStatement(this, context)).filter((stmt) => stmt !== void 0);
1721
- }
1722
- setSourceMapRange(ast, span) {
1723
- return this.factory.setSourceMapRange(ast, createRange(span));
1724
- }
1725
- attachComments(statement, leadingComments) {
1726
- if (leadingComments !== void 0) {
1727
- this.factory.attachComments(statement, leadingComments);
1728
- }
1729
- return statement;
1730
- }
1731
- };
1732
- function createTemplateElement({ cooked, raw, range }) {
1733
- return { cooked, raw, range: createRange(range) };
1734
- }
1735
- function createRange(span) {
1736
- if (span === null) {
1737
- return null;
1738
- }
1739
- const { start, end } = span;
1740
- const { url, content } = start.file;
1741
- if (!url) {
1742
- return null;
1743
- }
1744
- return {
1745
- url,
1746
- content,
1747
- start: { offset: start.offset, line: start.line, column: start.col },
1748
- end: { offset: end.offset, line: end.line, column: end.col }
1749
- };
1750
- }
1751
-
1752
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/type_translator.mjs
1753
- import {
1754
- BuiltinTypeName
1755
- } from "@angular/compiler";
1756
- import ts7 from "typescript";
1757
-
1758
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/ngtsc/translator/src/typescript_ast_factory.mjs
1759
- import ts8 from "typescript";
1760
- var PureAnnotation;
1761
- (function(PureAnnotation2) {
1762
- PureAnnotation2["CLOSURE"] = "* @pureOrBreakMyCode ";
1763
- PureAnnotation2["TERSER"] = "@__PURE__";
1764
- })(PureAnnotation || (PureAnnotation = {}));
1765
- var UNARY_OPERATORS2 = {
1766
- "+": ts8.SyntaxKind.PlusToken,
1767
- "-": ts8.SyntaxKind.MinusToken,
1768
- "!": ts8.SyntaxKind.ExclamationToken
1769
- };
1770
- var BINARY_OPERATORS2 = {
1771
- "&&": ts8.SyntaxKind.AmpersandAmpersandToken,
1772
- ">": ts8.SyntaxKind.GreaterThanToken,
1773
- ">=": ts8.SyntaxKind.GreaterThanEqualsToken,
1774
- "&": ts8.SyntaxKind.AmpersandToken,
1775
- "/": ts8.SyntaxKind.SlashToken,
1776
- "==": ts8.SyntaxKind.EqualsEqualsToken,
1777
- "===": ts8.SyntaxKind.EqualsEqualsEqualsToken,
1778
- "<": ts8.SyntaxKind.LessThanToken,
1779
- "<=": ts8.SyntaxKind.LessThanEqualsToken,
1780
- "-": ts8.SyntaxKind.MinusToken,
1781
- "%": ts8.SyntaxKind.PercentToken,
1782
- "*": ts8.SyntaxKind.AsteriskToken,
1783
- "!=": ts8.SyntaxKind.ExclamationEqualsToken,
1784
- "!==": ts8.SyntaxKind.ExclamationEqualsEqualsToken,
1785
- "||": ts8.SyntaxKind.BarBarToken,
1786
- "+": ts8.SyntaxKind.PlusToken,
1787
- "??": ts8.SyntaxKind.QuestionQuestionToken
1788
- };
1789
- var VAR_TYPES = {
1790
- "const": ts8.NodeFlags.Const,
1791
- "let": ts8.NodeFlags.Let,
1792
- "var": ts8.NodeFlags.None
1793
- };
1794
-
1795
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/translator.mjs
1796
- var Translator = class {
1797
- constructor(factory) {
1798
- this.factory = factory;
1799
- }
1800
- translateExpression(expression, imports, options = {}) {
1801
- return expression.visitExpression(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(false));
1802
- }
1803
- translateStatement(statement, imports, options = {}) {
1804
- return statement.visitStatement(new ExpressionTranslatorVisitor(this.factory, imports, options), new Context(true));
1805
- }
1806
- };
1807
-
1808
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/linker_environment.mjs
1809
- var LinkerEnvironment = class {
1810
- constructor(fileSystem, logger, host, factory, options) {
1811
- this.fileSystem = fileSystem;
1812
- this.logger = logger;
1813
- this.host = host;
1814
- this.factory = factory;
1815
- this.options = options;
1816
- this.translator = new Translator(this.factory);
1817
- this.sourceFileLoader = this.options.sourceMapping ? new SourceFileLoader(this.fileSystem, this.logger, {}) : null;
1818
- }
1819
- static create(fileSystem, logger, host, factory, options) {
1820
- var _a, _b, _c;
1821
- return new LinkerEnvironment(fileSystem, logger, host, factory, {
1822
- sourceMapping: (_a = options.sourceMapping) != null ? _a : DEFAULT_LINKER_OPTIONS.sourceMapping,
1823
- linkerJitMode: (_b = options.linkerJitMode) != null ? _b : DEFAULT_LINKER_OPTIONS.linkerJitMode,
1824
- unknownDeclarationVersionHandling: (_c = options.unknownDeclarationVersionHandling) != null ? _c : DEFAULT_LINKER_OPTIONS.unknownDeclarationVersionHandling
1825
- });
1826
- }
1827
- };
1828
-
1829
- // bazel-out/k8-fastbuild/bin/packages/compiler-cli/linker/src/file_linker/needs_linking.mjs
1830
- function needsLinking(path, source) {
1831
- return declarationFunctions.some((fn) => source.includes(fn));
1832
- }
7
+ DEFAULT_LINKER_OPTIONS,
8
+ FatalLinkerError,
9
+ FileLinker,
10
+ LinkerEnvironment,
11
+ assert,
12
+ isFatalLinkerError,
13
+ needsLinking
14
+ } from "../chunk-MFCLQBFK.js";
15
+ import "../chunk-QL6ZC3U3.js";
16
+ import "../chunk-HDZS2JG2.js";
17
+ import "../chunk-EP5JHXG2.js";
18
+ import "../chunk-XA5IZLLC.js";
1833
19
  export {
1834
20
  DEFAULT_LINKER_OPTIONS,
1835
21
  FatalLinkerError,
@@ -1839,11 +25,4 @@ export {
1839
25
  isFatalLinkerError,
1840
26
  needsLinking
1841
27
  };
1842
- /**
1843
- * @license
1844
- * Copyright Google LLC All Rights Reserved.
1845
- *
1846
- * Use of this source code is governed by an MIT-style license that can be
1847
- * found in the LICENSE file at https://angular.io/license
1848
- */
1849
28
  //# sourceMappingURL=index.js.map