@angular/localize 15.0.0-next.6 → 15.0.0-rc.0

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 (36) hide show
  1. package/esm2020/init/index.mjs +1 -1
  2. package/esm2020/localize.mjs +1 -2
  3. package/fesm2015/init.mjs +1 -1
  4. package/fesm2015/init.mjs.map +1 -1
  5. package/fesm2015/localize.mjs +1 -1
  6. package/fesm2015/localize.mjs.map +1 -1
  7. package/fesm2020/init.mjs +1 -1
  8. package/fesm2020/init.mjs.map +1 -1
  9. package/fesm2020/localize.mjs +1 -1
  10. package/fesm2020/localize.mjs.map +1 -1
  11. package/index.d.ts +6 -484
  12. package/init/index.d.ts +16 -103
  13. package/localize.d.ts +107 -0
  14. package/package.json +3 -3
  15. package/private.d.ts +10 -0
  16. package/schematics/ng-add/index.d.ts +1 -2
  17. package/schematics/ng-add/index.js +44 -66
  18. package/src/localize/index.d.ts +10 -0
  19. package/src/localize/src/global.d.ts +17 -0
  20. package/src/localize/src/localize.d.ts +139 -0
  21. package/src/translate.d.ts +62 -0
  22. package/src/utils/index.d.ts +11 -0
  23. package/src/utils/src/constants.d.ts +58 -0
  24. package/src/utils/src/messages.d.ts +240 -0
  25. package/src/utils/src/translations.d.ts +59 -0
  26. package/tools/bundles/{chunk-B2TZRIF5.js → chunk-G27PJM3A.js} +18 -18
  27. package/tools/bundles/{chunk-B2TZRIF5.js.map → chunk-G27PJM3A.js.map} +0 -0
  28. package/tools/bundles/{chunk-HS5BMNX3.js → chunk-KDBNAH7Y.js} +18 -18
  29. package/tools/bundles/{chunk-HS5BMNX3.js.map → chunk-KDBNAH7Y.js.map} +0 -0
  30. package/tools/bundles/{chunk-N3C6NOYD.js → chunk-NGRPHNS5.js} +5 -5
  31. package/tools/bundles/{chunk-N3C6NOYD.js.map → chunk-NGRPHNS5.js.map} +0 -0
  32. package/tools/bundles/index.js +4 -4
  33. package/tools/bundles/src/extract/cli.js +5 -5
  34. package/tools/bundles/src/migrate/cli.js +5 -5
  35. package/tools/bundles/src/translate/cli.js +11 -11
  36. package/tools/bundles_metadata.json +1 -1
@@ -0,0 +1,240 @@
1
+ /// <amd-module name="@angular/localize/src/utils/src/messages" />
2
+ /**
3
+ * Re-export this helper function so that users of `@angular/localize` don't need to actively import
4
+ * from `@angular/compiler`.
5
+ */
6
+ export { computeMsgId } from '@angular/compiler';
7
+ /**
8
+ * A string containing a translation source message.
9
+ *
10
+ * I.E. the message that indicates what will be translated from.
11
+ *
12
+ * Uses `{$placeholder-name}` to indicate a placeholder.
13
+ */
14
+ export declare type SourceMessage = string;
15
+ /**
16
+ * A string containing a translation target message.
17
+ *
18
+ * I.E. the message that indicates what will be translated to.
19
+ *
20
+ * Uses `{$placeholder-name}` to indicate a placeholder.
21
+ */
22
+ export declare type TargetMessage = string;
23
+ /**
24
+ * A string that uniquely identifies a message, to be used for matching translations.
25
+ */
26
+ export declare type MessageId = string;
27
+ /**
28
+ * Declares a copy of the `AbsoluteFsPath` branded type in `@angular/compiler-cli` to avoid an
29
+ * import into `@angular/compiler-cli`. The compiler-cli's declaration files are not necessarily
30
+ * compatible with web environments that use `@angular/localize`, and would inadvertently include
31
+ * `typescript` declaration files in any compilation unit that uses `@angular/localize` (which
32
+ * increases parsing time and memory usage during builds) using a default import that only
33
+ * type-checks when `allowSyntheticDefaultImports` is enabled.
34
+ *
35
+ * @see https://github.com/angular/angular/issues/45179
36
+ */
37
+ declare type AbsoluteFsPathLocalizeCopy = string & {
38
+ _brand: 'AbsoluteFsPath';
39
+ };
40
+ /**
41
+ * The location of the message in the source file.
42
+ *
43
+ * The `line` and `column` values for the `start` and `end` properties are zero-based.
44
+ */
45
+ export interface SourceLocation {
46
+ start: {
47
+ line: number;
48
+ column: number;
49
+ };
50
+ end: {
51
+ line: number;
52
+ column: number;
53
+ };
54
+ file: AbsoluteFsPathLocalizeCopy;
55
+ text?: string;
56
+ }
57
+ /**
58
+ * Additional information that can be associated with a message.
59
+ */
60
+ export interface MessageMetadata {
61
+ /**
62
+ * A human readable rendering of the message
63
+ */
64
+ text: string;
65
+ /**
66
+ * Legacy message ids, if provided.
67
+ *
68
+ * In legacy message formats the message id can only be computed directly from the original
69
+ * template source.
70
+ *
71
+ * Since this information is not available in `$localize` calls, the legacy message ids may be
72
+ * attached by the compiler to the `$localize` metablock so it can be used if needed at the point
73
+ * of translation if the translations are encoded using the legacy message id.
74
+ */
75
+ legacyIds?: string[];
76
+ /**
77
+ * The id of the `message` if a custom one was specified explicitly.
78
+ *
79
+ * This id overrides any computed or legacy ids.
80
+ */
81
+ customId?: string;
82
+ /**
83
+ * The meaning of the `message`, used to distinguish identical `messageString`s.
84
+ */
85
+ meaning?: string;
86
+ /**
87
+ * The description of the `message`, used to aid translation.
88
+ */
89
+ description?: string;
90
+ /**
91
+ * The location of the message in the source.
92
+ */
93
+ location?: SourceLocation;
94
+ }
95
+ /**
96
+ * Information parsed from a `$localize` tagged string that is used to translate it.
97
+ *
98
+ * For example:
99
+ *
100
+ * ```
101
+ * const name = 'Jo Bloggs';
102
+ * $localize`Hello ${name}:title@@ID:!`;
103
+ * ```
104
+ *
105
+ * May be parsed into:
106
+ *
107
+ * ```
108
+ * {
109
+ * id: '6998194507597730591',
110
+ * substitutions: { title: 'Jo Bloggs' },
111
+ * messageString: 'Hello {$title}!',
112
+ * placeholderNames: ['title'],
113
+ * associatedMessageIds: { title: 'ID' },
114
+ * }
115
+ * ```
116
+ */
117
+ export interface ParsedMessage extends MessageMetadata {
118
+ /**
119
+ * The key used to look up the appropriate translation target.
120
+ */
121
+ id: MessageId;
122
+ /**
123
+ * A mapping of placeholder names to substitution values.
124
+ */
125
+ substitutions: Record<string, any>;
126
+ /**
127
+ * An optional mapping of placeholder names to associated MessageIds.
128
+ * This can be used to match ICU placeholders to the message that contains the ICU.
129
+ */
130
+ associatedMessageIds?: Record<string, MessageId>;
131
+ /**
132
+ * An optional mapping of placeholder names to source locations
133
+ */
134
+ substitutionLocations?: Record<string, SourceLocation | undefined>;
135
+ /**
136
+ * The static parts of the message.
137
+ */
138
+ messageParts: string[];
139
+ /**
140
+ * An optional mapping of message parts to source locations
141
+ */
142
+ messagePartLocations?: (SourceLocation | undefined)[];
143
+ /**
144
+ * The names of the placeholders that will be replaced with substitutions.
145
+ */
146
+ placeholderNames: string[];
147
+ }
148
+ /**
149
+ * Parse a `$localize` tagged string into a structure that can be used for translation or
150
+ * extraction.
151
+ *
152
+ * See `ParsedMessage` for an example.
153
+ */
154
+ export declare function parseMessage(messageParts: TemplateStringsArray, expressions?: readonly any[], location?: SourceLocation, messagePartLocations?: (SourceLocation | undefined)[], expressionLocations?: (SourceLocation | undefined)[]): ParsedMessage;
155
+ /**
156
+ * Parse the given message part (`cooked` + `raw`) to extract the message metadata from the text.
157
+ *
158
+ * If the message part has a metadata block this function will extract the `meaning`,
159
+ * `description`, `customId` and `legacyId` (if provided) from the block. These metadata properties
160
+ * are serialized in the string delimited by `|`, `@@` and `␟` respectively.
161
+ *
162
+ * (Note that `␟` is the `LEGACY_ID_INDICATOR` - see `constants.ts`.)
163
+ *
164
+ * For example:
165
+ *
166
+ * ```ts
167
+ * `:meaning|description@@custom-id:`
168
+ * `:meaning|@@custom-id:`
169
+ * `:meaning|description:`
170
+ * `:description@@custom-id:`
171
+ * `:meaning|:`
172
+ * `:description:`
173
+ * `:@@custom-id:`
174
+ * `:meaning|description@@custom-id␟legacy-id-1␟legacy-id-2:`
175
+ * ```
176
+ *
177
+ * @param cooked The cooked version of the message part to parse.
178
+ * @param raw The raw version of the message part to parse.
179
+ * @returns A object containing any metadata that was parsed from the message part.
180
+ */
181
+ export declare function parseMetadata(cooked: string, raw: string): MessageMetadata;
182
+ /**
183
+ * Parse the given message part (`cooked` + `raw`) to extract any placeholder metadata from the
184
+ * text.
185
+ *
186
+ * If the message part has a metadata block this function will extract the `placeholderName` and
187
+ * `associatedMessageId` (if provided) from the block.
188
+ *
189
+ * These metadata properties are serialized in the string delimited by `@@`.
190
+ *
191
+ * For example:
192
+ *
193
+ * ```ts
194
+ * `:placeholder-name@@associated-id:`
195
+ * ```
196
+ *
197
+ * @param cooked The cooked version of the message part to parse.
198
+ * @param raw The raw version of the message part to parse.
199
+ * @returns A object containing the metadata (`placeholderName` and `associatedMessageId`) of the
200
+ * preceding placeholder, along with the static text that follows.
201
+ */
202
+ export declare function parsePlaceholder(cooked: string, raw: string): {
203
+ messagePart: string;
204
+ placeholderName?: string;
205
+ associatedMessageId?: string;
206
+ };
207
+ /**
208
+ * Split a message part (`cooked` + `raw`) into an optional delimited "block" off the front and the
209
+ * rest of the text of the message part.
210
+ *
211
+ * Blocks appear at the start of message parts. They are delimited by a colon `:` character at the
212
+ * start and end of the block.
213
+ *
214
+ * If the block is in the first message part then it will be metadata about the whole message:
215
+ * meaning, description, id. Otherwise it will be metadata about the immediately preceding
216
+ * substitution: placeholder name.
217
+ *
218
+ * Since blocks are optional, it is possible that the content of a message block actually starts
219
+ * with a block marker. In this case the marker must be escaped `\:`.
220
+ *
221
+ * @param cooked The cooked version of the message part to parse.
222
+ * @param raw The raw version of the message part to parse.
223
+ * @returns An object containing the `text` of the message part and the text of the `block`, if it
224
+ * exists.
225
+ * @throws an error if the `block` is unterminated
226
+ */
227
+ export declare function splitBlock(cooked: string, raw: string): {
228
+ text: string;
229
+ block?: string;
230
+ };
231
+ /**
232
+ * Find the end of a "marked block" indicated by the first non-escaped colon.
233
+ *
234
+ * @param cooked The cooked string (where escaped chars have been processed)
235
+ * @param raw The raw string (where escape sequences are still in place)
236
+ *
237
+ * @returns the index of the end of block marker
238
+ * @throws an error if the block is unterminated
239
+ */
240
+ export declare function findEndOfBlock(cooked: string, raw: string): number;
@@ -0,0 +1,59 @@
1
+ /// <amd-module name="@angular/localize/src/utils/src/translations" />
2
+ import { MessageId, MessageMetadata, ParsedMessage, TargetMessage } from './messages';
3
+ /**
4
+ * A translation message that has been processed to extract the message parts and placeholders.
5
+ */
6
+ export interface ParsedTranslation extends MessageMetadata {
7
+ messageParts: TemplateStringsArray;
8
+ placeholderNames: string[];
9
+ }
10
+ /**
11
+ * The internal structure used by the runtime localization to translate messages.
12
+ */
13
+ export declare type ParsedTranslations = Record<MessageId, ParsedTranslation>;
14
+ export declare class MissingTranslationError extends Error {
15
+ readonly parsedMessage: ParsedMessage;
16
+ private readonly type;
17
+ constructor(parsedMessage: ParsedMessage);
18
+ }
19
+ export declare function isMissingTranslationError(e: any): e is MissingTranslationError;
20
+ /**
21
+ * Translate the text of the `$localize` tagged-string (i.e. `messageParts` and
22
+ * `substitutions`) using the given `translations`.
23
+ *
24
+ * The tagged-string is parsed to extract its `messageId` which is used to find an appropriate
25
+ * `ParsedTranslation`. If this doesn't match and there are legacy ids then try matching a
26
+ * translation using those.
27
+ *
28
+ * If one is found then it is used to translate the message into a new set of `messageParts` and
29
+ * `substitutions`.
30
+ * The translation may reorder (or remove) substitutions as appropriate.
31
+ *
32
+ * If there is no translation with a matching message id then an error is thrown.
33
+ * If a translation contains a placeholder that is not found in the message being translated then an
34
+ * error is thrown.
35
+ */
36
+ export declare function translate(translations: Record<string, ParsedTranslation>, messageParts: TemplateStringsArray, substitutions: readonly any[]): [TemplateStringsArray, readonly any[]];
37
+ /**
38
+ * Parse the `messageParts` and `placeholderNames` out of a target `message`.
39
+ *
40
+ * Used by `loadTranslations()` to convert target message strings into a structure that is more
41
+ * appropriate for doing translation.
42
+ *
43
+ * @param message the message to be parsed.
44
+ */
45
+ export declare function parseTranslation(messageString: TargetMessage): ParsedTranslation;
46
+ /**
47
+ * Create a `ParsedTranslation` from a set of `messageParts` and `placeholderNames`.
48
+ *
49
+ * @param messageParts The message parts to appear in the ParsedTranslation.
50
+ * @param placeholderNames The names of the placeholders to intersperse between the `messageParts`.
51
+ */
52
+ export declare function makeParsedTranslation(messageParts: string[], placeholderNames?: string[]): ParsedTranslation;
53
+ /**
54
+ * Create the specialized array that is passed to tagged-string tag functions.
55
+ *
56
+ * @param cooked The message parts with their escape codes processed.
57
+ * @param raw The message parts with their escaped codes as-is.
58
+ */
59
+ export declare function makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
@@ -15,9 +15,9 @@ import {
15
15
  unwrapMessagePartsFromLocalizeCall,
16
16
  unwrapMessagePartsFromTemplateLiteral,
17
17
  unwrapSubstitutionsFromLocalizeCall
18
- } from "./chunk-N3C6NOYD.js";
18
+ } from "./chunk-NGRPHNS5.js";
19
19
 
20
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/duplicates.mjs
20
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/duplicates.mjs
21
21
  function checkDuplicateMessages(fs, messages, duplicateMessageHandling, basePath) {
22
22
  const diagnostics = new Diagnostics();
23
23
  if (duplicateMessageHandling === "ignore")
@@ -51,10 +51,10 @@ function serializeMessage(fs, basePath, message) {
51
51
  }
52
52
  }
53
53
 
54
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/extraction.mjs
54
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/extraction.mjs
55
55
  import { SourceFileLoader } from "@angular/compiler-cli/private/localize";
56
56
 
57
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/source_files/es2015_extract_plugin.mjs
57
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/source_files/es2015_extract_plugin.mjs
58
58
  import { \u0275parseMessage } from "@angular/localize";
59
59
  function makeEs2015ExtractPlugin(fs, messages, localizeName = "$localize") {
60
60
  return {
@@ -74,7 +74,7 @@ function makeEs2015ExtractPlugin(fs, messages, localizeName = "$localize") {
74
74
  };
75
75
  }
76
76
 
77
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/source_files/es5_extract_plugin.mjs
77
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/source_files/es5_extract_plugin.mjs
78
78
  import { \u0275parseMessage as \u0275parseMessage2 } from "@angular/localize";
79
79
  function makeEs5ExtractPlugin(fs, messages, localizeName = "$localize") {
80
80
  return {
@@ -102,7 +102,7 @@ function makeEs5ExtractPlugin(fs, messages, localizeName = "$localize") {
102
102
  };
103
103
  }
104
104
 
105
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/extraction.mjs
105
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/extraction.mjs
106
106
  var MessageExtractor = class {
107
107
  constructor(fs, logger, { basePath, useSourceMaps = true, localizeName = "$localize" }) {
108
108
  this.fs = fs;
@@ -169,7 +169,7 @@ var MessageExtractor = class {
169
169
  }
170
170
  };
171
171
 
172
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/utils.mjs
172
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/utils.mjs
173
173
  function consolidateMessages(messages, getMessageId2) {
174
174
  const messageGroups = /* @__PURE__ */ new Map();
175
175
  for (const message of messages) {
@@ -210,7 +210,7 @@ function compareLocations({ location: location1 }, { location: location2 }) {
210
210
  return 0;
211
211
  }
212
212
 
213
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/arb_translation_serializer.mjs
213
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/arb_translation_serializer.mjs
214
214
  var ArbTranslationSerializer = class {
215
215
  constructor(sourceLocale, basePath, fs) {
216
216
  this.sourceLocale = sourceLocale;
@@ -271,7 +271,7 @@ function getMessageId(message) {
271
271
  return message.customId || message.id;
272
272
  }
273
273
 
274
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/json_translation_serializer.mjs
274
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/json_translation_serializer.mjs
275
275
  var SimpleJsonTranslationSerializer = class {
276
276
  constructor(sourceLocale) {
277
277
  this.sourceLocale = sourceLocale;
@@ -285,7 +285,7 @@ var SimpleJsonTranslationSerializer = class {
285
285
  }
286
286
  };
287
287
 
288
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/legacy_message_id_migration_serializer.mjs
288
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/legacy_message_id_migration_serializer.mjs
289
289
  var LegacyMessageIdMigrationSerializer = class {
290
290
  constructor(_diagnostics) {
291
291
  this._diagnostics = _diagnostics;
@@ -314,7 +314,7 @@ function shouldMigrate(message) {
314
314
  return !message.customId && !!message.legacyIds && message.legacyIds.length > 0;
315
315
  }
316
316
 
317
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/format_options.mjs
317
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/format_options.mjs
318
318
  function validateOptions(name, validOptions, options) {
319
319
  const validOptionsMap = new Map(validOptions);
320
320
  for (const option in options) {
@@ -334,10 +334,10 @@ function parseFormatOptions(optionString = "{}") {
334
334
  return JSON.parse(optionString);
335
335
  }
336
336
 
337
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff1_translation_serializer.mjs
337
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff1_translation_serializer.mjs
338
338
  import { getFileSystem } from "@angular/compiler-cli/private/localize";
339
339
 
340
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/icu_parsing.mjs
340
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/icu_parsing.mjs
341
341
  function extractIcuPlaceholders(text) {
342
342
  const state = new StateStack();
343
343
  const pieces = new IcuPieces();
@@ -434,7 +434,7 @@ function assert(test, message) {
434
434
  }
435
435
  }
436
436
 
437
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xml_file.mjs
437
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xml_file.mjs
438
438
  var XmlFile = class {
439
439
  constructor() {
440
440
  this.output = '<?xml version="1.0" encoding="UTF-8" ?>\n';
@@ -516,7 +516,7 @@ function escapeXml(text) {
516
516
  return _ESCAPED_CHARS.reduce((text2, entry) => text2.replace(entry[0], entry[1]), text);
517
517
  }
518
518
 
519
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff1_translation_serializer.mjs
519
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff1_translation_serializer.mjs
520
520
  var LEGACY_XLIFF_MESSAGE_LENGTH = 40;
521
521
  var Xliff1TranslationSerializer = class {
522
522
  constructor(sourceLocale, basePath, useLegacyIds, formatOptions = {}, fs = getFileSystem()) {
@@ -664,7 +664,7 @@ var TAG_MAP = {
664
664
  "UNORDERED_LIST": "ul"
665
665
  };
666
666
 
667
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff2_translation_serializer.mjs
667
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xliff2_translation_serializer.mjs
668
668
  import { getFileSystem as getFileSystem2 } from "@angular/compiler-cli/private/localize";
669
669
  var MAX_LEGACY_XLIFF_2_MESSAGE_LENGTH = 20;
670
670
  var Xliff2TranslationSerializer = class {
@@ -806,7 +806,7 @@ function getTypeForPlaceholder(placeholder) {
806
806
  }
807
807
  }
808
808
 
809
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.mjs
809
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.mjs
810
810
  import { getFileSystem as getFileSystem3 } from "@angular/compiler-cli/private/localize";
811
811
  var XmbTranslationSerializer = class {
812
812
  constructor(basePath, useLegacyIds, fs = getFileSystem3()) {
@@ -899,4 +899,4 @@ export {
899
899
  * Use of this source code is governed by an MIT-style license that can be
900
900
  * found in the LICENSE file at https://angular.io/license
901
901
  */
902
- //# sourceMappingURL=chunk-B2TZRIF5.js.map
902
+ //# sourceMappingURL=chunk-G27PJM3A.js.map
@@ -13,9 +13,9 @@ import {
13
13
  unwrapMessagePartsFromLocalizeCall,
14
14
  unwrapMessagePartsFromTemplateLiteral,
15
15
  unwrapSubstitutionsFromLocalizeCall
16
- } from "./chunk-N3C6NOYD.js";
16
+ } from "./chunk-NGRPHNS5.js";
17
17
 
18
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/source_files/es2015_translate_plugin.mjs
18
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/source_files/es2015_translate_plugin.mjs
19
19
  import { getFileSystem } from "@angular/compiler-cli/private/localize";
20
20
  function makeEs2015TranslatePlugin(diagnostics, translations, { missingTranslation = "error", localizeName = "$localize" } = {}, fs = getFileSystem()) {
21
21
  return {
@@ -40,7 +40,7 @@ function makeEs2015TranslatePlugin(diagnostics, translations, { missingTranslati
40
40
  };
41
41
  }
42
42
 
43
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/source_files/es5_translate_plugin.mjs
43
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/source_files/es5_translate_plugin.mjs
44
44
  import { getFileSystem as getFileSystem2 } from "@angular/compiler-cli/private/localize";
45
45
  function makeEs5TranslatePlugin(diagnostics, translations, { missingTranslation = "error", localizeName = "$localize" } = {}, fs = getFileSystem2()) {
46
46
  return {
@@ -66,7 +66,7 @@ function makeEs5TranslatePlugin(diagnostics, translations, { missingTranslation
66
66
  };
67
67
  }
68
68
 
69
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/source_files/locale_plugin.mjs
69
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/source_files/locale_plugin.mjs
70
70
  function makeLocalePlugin(locale, { localizeName = "$localize" } = {}) {
71
71
  return {
72
72
  visitor: {
@@ -105,7 +105,7 @@ function isLocalizeGuard(expression, localizeName) {
105
105
  return left.isUnaryExpression({ operator: "typeof" }) && isLocalize(left.get("argument"), localizeName) && right.isStringLiteral({ value: "undefined" }) || right.isUnaryExpression({ operator: "typeof" }) && isLocalize(right.get("argument"), localizeName) && left.isStringLiteral({ value: "undefined" });
106
106
  }
107
107
 
108
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/arb_translation_parser.mjs
108
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/arb_translation_parser.mjs
109
109
  import { \u0275parseTranslation } from "@angular/localize";
110
110
  var ArbTranslationParser = class {
111
111
  analyze(_filePath, contents) {
@@ -144,7 +144,7 @@ var ArbTranslationParser = class {
144
144
  }
145
145
  };
146
146
 
147
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/simple_json_translation_parser.mjs
147
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/simple_json_translation_parser.mjs
148
148
  import { \u0275parseTranslation as \u0275parseTranslation2 } from "@angular/localize";
149
149
  import { extname } from "path";
150
150
  var SimpleJsonTranslationParser = class {
@@ -189,10 +189,10 @@ var SimpleJsonTranslationParser = class {
189
189
  }
190
190
  };
191
191
 
192
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.mjs
192
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.mjs
193
193
  import { ParseErrorLevel as ParseErrorLevel3, visitAll as visitAll2 } from "@angular/compiler";
194
194
 
195
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/base_visitor.mjs
195
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/base_visitor.mjs
196
196
  var BaseVisitor = class {
197
197
  visitElement(_element, _context) {
198
198
  }
@@ -208,10 +208,10 @@ var BaseVisitor = class {
208
208
  }
209
209
  };
210
210
 
211
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
211
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
212
212
  import { Element as Element2, visitAll } from "@angular/compiler";
213
213
 
214
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_parse_error.mjs
214
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_parse_error.mjs
215
215
  import { ParseErrorLevel } from "@angular/compiler";
216
216
  var TranslationParseError = class extends Error {
217
217
  constructor(span, msg, level = ParseErrorLevel.ERROR) {
@@ -233,7 +233,7 @@ At ${span.start}${span.details ? `, ${span.details}` : ""}:
233
233
  return msg;
234
234
  }
235
235
 
236
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_utils.mjs
236
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/translation_utils.mjs
237
237
  import { Element, ParseError, ParseErrorLevel as ParseErrorLevel2, XmlParser } from "@angular/compiler";
238
238
  function getAttrOrThrow(element, attrName) {
239
239
  const attrValue = getAttribute(element, attrName);
@@ -309,7 +309,7 @@ function addErrorsToBundle(bundle, errors) {
309
309
  }
310
310
  }
311
311
 
312
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
312
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/message_serializer.mjs
313
313
  var MessageSerializer = class extends BaseVisitor {
314
314
  constructor(renderer, config) {
315
315
  super();
@@ -371,7 +371,7 @@ var MessageSerializer = class extends BaseVisitor {
371
371
  }
372
372
  };
373
373
 
374
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/target_message_renderer.mjs
374
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/message_serialization/target_message_renderer.mjs
375
375
  import { \u0275makeParsedTranslation } from "@angular/localize";
376
376
  var TargetMessageRenderer = class {
377
377
  constructor() {
@@ -429,7 +429,7 @@ var TargetMessageRenderer = class {
429
429
  }
430
430
  };
431
431
 
432
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/serialize_translation_message.mjs
432
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/serialize_translation_message.mjs
433
433
  function serializeTranslationMessage(element, config) {
434
434
  const { rootNodes, errors: parseErrors } = parseInnerRange(element);
435
435
  try {
@@ -441,7 +441,7 @@ function serializeTranslationMessage(element, config) {
441
441
  }
442
442
  }
443
443
 
444
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.mjs
444
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff1_translation_parser.mjs
445
445
  var Xliff1TranslationParser = class {
446
446
  analyze(filePath, contents) {
447
447
  return canParseXml(filePath, contents, "xliff", { version: "1.2" });
@@ -518,7 +518,7 @@ var XliffTranslationVisitor = class extends BaseVisitor {
518
518
  }
519
519
  };
520
520
 
521
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff2_translation_parser.mjs
521
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xliff2_translation_parser.mjs
522
522
  import { Element as Element3, ParseErrorLevel as ParseErrorLevel4, visitAll as visitAll3 } from "@angular/compiler";
523
523
  var Xliff2TranslationParser = class {
524
524
  analyze(filePath, contents) {
@@ -597,7 +597,7 @@ function isFileElement(node) {
597
597
  return node instanceof Element3 && node.name === "file";
598
598
  }
599
599
 
600
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xtb_translation_parser.mjs
600
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/translate/translation_files/translation_parsers/xtb_translation_parser.mjs
601
601
  import { ParseErrorLevel as ParseErrorLevel5, visitAll as visitAll4 } from "@angular/compiler";
602
602
  import { extname as extname2 } from "path";
603
603
  var XtbTranslationParser = class {
@@ -675,4 +675,4 @@ export {
675
675
  * Use of this source code is governed by an MIT-style license that can be
676
676
  * found in the LICENSE file at https://angular.io/license
677
677
  */
678
- //# sourceMappingURL=chunk-HS5BMNX3.js.map
678
+ //# sourceMappingURL=chunk-KDBNAH7Y.js.map
@@ -2,7 +2,7 @@
2
2
  import {createRequire as __cjsCompatRequire} from 'module';
3
3
  const require = __cjsCompatRequire(import.meta.url);
4
4
 
5
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/diagnostics.mjs
5
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/diagnostics.mjs
6
6
  var Diagnostics = class {
7
7
  constructor() {
8
8
  this.messages = [];
@@ -37,11 +37,11 @@ var Diagnostics = class {
37
37
  }
38
38
  };
39
39
 
40
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/source_file_utils.mjs
40
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/source_file_utils.mjs
41
41
  import { getFileSystem } from "@angular/compiler-cli/private/localize";
42
42
  import { \u0275isMissingTranslationError, \u0275makeTemplateObject, \u0275translate } from "@angular/localize";
43
43
 
44
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/babel_core.mjs
44
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/babel_core.mjs
45
45
  import * as _babelNamespace from "@babel/core";
46
46
  import _babelDefault from "@babel/core";
47
47
  var _a;
@@ -56,7 +56,7 @@ var transformSync = babel.transformSync;
56
56
  var parseSync = babel.parseSync;
57
57
  var transformFromAstSync = babel.transformFromAstSync;
58
58
 
59
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/src/source_file_utils.mjs
59
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/src/source_file_utils.mjs
60
60
  function isLocalize(expression, localizeName) {
61
61
  return isNamedIdentifier(expression, localizeName) && isGlobalIdentifier(expression);
62
62
  }
@@ -340,4 +340,4 @@ export {
340
340
  * Use of this source code is governed by an MIT-style license that can be
341
341
  * found in the LICENSE file at https://angular.io/license
342
342
  */
343
- //# sourceMappingURL=chunk-N3C6NOYD.js.map
343
+ //# sourceMappingURL=chunk-NGRPHNS5.js.map
@@ -11,7 +11,7 @@ import {
11
11
  Xliff2TranslationSerializer,
12
12
  XmbTranslationSerializer,
13
13
  checkDuplicateMessages
14
- } from "./chunk-B2TZRIF5.js";
14
+ } from "./chunk-G27PJM3A.js";
15
15
  import {
16
16
  ArbTranslationParser,
17
17
  SimpleJsonTranslationParser,
@@ -21,7 +21,7 @@ import {
21
21
  makeEs2015TranslatePlugin,
22
22
  makeEs5TranslatePlugin,
23
23
  makeLocalePlugin
24
- } from "./chunk-HS5BMNX3.js";
24
+ } from "./chunk-KDBNAH7Y.js";
25
25
  import {
26
26
  Diagnostics,
27
27
  buildLocalizeReplacement,
@@ -31,9 +31,9 @@ import {
31
31
  unwrapMessagePartsFromLocalizeCall,
32
32
  unwrapMessagePartsFromTemplateLiteral,
33
33
  unwrapSubstitutionsFromLocalizeCall
34
- } from "./chunk-N3C6NOYD.js";
34
+ } from "./chunk-NGRPHNS5.js";
35
35
 
36
- // bazel-out/k8-fastbuild/bin/packages/localize/tools/index.mjs
36
+ // bazel-out/darwin-fastbuild/bin/packages/localize/tools/index.mjs
37
37
  import { NodeJSFileSystem, setFileSystem } from "@angular/compiler-cli/private/localize";
38
38
  setFileSystem(new NodeJSFileSystem());
39
39
  export {