lingo.dev 0.130.0 → 0.130.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.cjs CHANGED
@@ -26,20 +26,20 @@ function getSettings(explicitApiKey) {
26
26
  _envVarsInfo();
27
27
  return {
28
28
  auth: {
29
- apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access', _38 => _38.auth, 'optionalAccess', _39 => _39.apiKey]) || defaults2.auth.apiKey,
30
- apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access', _40 => _40.auth, 'optionalAccess', _41 => _41.apiUrl]) || defaults2.auth.apiUrl,
31
- webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access', _42 => _42.auth, 'optionalAccess', _43 => _43.webUrl]) || defaults2.auth.webUrl,
29
+ apiKey: explicitApiKey || env.LINGODOTDEV_API_KEY || _optionalChain([systemFile, 'access', _39 => _39.auth, 'optionalAccess', _40 => _40.apiKey]) || defaults2.auth.apiKey,
30
+ apiUrl: env.LINGODOTDEV_API_URL || _optionalChain([systemFile, 'access', _41 => _41.auth, 'optionalAccess', _42 => _42.apiUrl]) || defaults2.auth.apiUrl,
31
+ webUrl: env.LINGODOTDEV_WEB_URL || _optionalChain([systemFile, 'access', _43 => _43.auth, 'optionalAccess', _44 => _44.webUrl]) || defaults2.auth.webUrl,
32
32
  vnext: {
33
- apiKey: env.LINGO_API_KEY || _optionalChain([systemFile, 'access', _44 => _44.auth, 'optionalAccess', _45 => _45.vnext, 'optionalAccess', _46 => _46.apiKey])
33
+ apiKey: env.LINGO_API_KEY || _optionalChain([systemFile, 'access', _45 => _45.auth, 'optionalAccess', _46 => _46.vnext, 'optionalAccess', _47 => _47.apiKey])
34
34
  }
35
35
  },
36
36
  llm: {
37
- openaiApiKey: env.OPENAI_API_KEY || _optionalChain([systemFile, 'access', _47 => _47.llm, 'optionalAccess', _48 => _48.openaiApiKey]),
38
- anthropicApiKey: env.ANTHROPIC_API_KEY || _optionalChain([systemFile, 'access', _49 => _49.llm, 'optionalAccess', _50 => _50.anthropicApiKey]),
39
- groqApiKey: env.GROQ_API_KEY || _optionalChain([systemFile, 'access', _51 => _51.llm, 'optionalAccess', _52 => _52.groqApiKey]),
40
- googleApiKey: env.GOOGLE_API_KEY || _optionalChain([systemFile, 'access', _53 => _53.llm, 'optionalAccess', _54 => _54.googleApiKey]),
41
- openrouterApiKey: env.OPENROUTER_API_KEY || _optionalChain([systemFile, 'access', _55 => _55.llm, 'optionalAccess', _56 => _56.openrouterApiKey]),
42
- mistralApiKey: env.MISTRAL_API_KEY || _optionalChain([systemFile, 'access', _57 => _57.llm, 'optionalAccess', _58 => _58.mistralApiKey])
37
+ openaiApiKey: env.OPENAI_API_KEY || _optionalChain([systemFile, 'access', _48 => _48.llm, 'optionalAccess', _49 => _49.openaiApiKey]),
38
+ anthropicApiKey: env.ANTHROPIC_API_KEY || _optionalChain([systemFile, 'access', _50 => _50.llm, 'optionalAccess', _51 => _51.anthropicApiKey]),
39
+ groqApiKey: env.GROQ_API_KEY || _optionalChain([systemFile, 'access', _52 => _52.llm, 'optionalAccess', _53 => _53.groqApiKey]),
40
+ googleApiKey: env.GOOGLE_API_KEY || _optionalChain([systemFile, 'access', _54 => _54.llm, 'optionalAccess', _55 => _55.googleApiKey]),
41
+ openrouterApiKey: env.OPENROUTER_API_KEY || _optionalChain([systemFile, 'access', _56 => _56.llm, 'optionalAccess', _57 => _57.openrouterApiKey]),
42
+ mistralApiKey: env.MISTRAL_API_KEY || _optionalChain([systemFile, 'access', _58 => _58.llm, 'optionalAccess', _59 => _59.mistralApiKey])
43
43
  }
44
44
  };
45
45
  }
@@ -155,43 +155,43 @@ Please use LINGODOTDEV_API_KEY instead.
155
155
  function _envVarsInfo() {
156
156
  const env = _loadEnv();
157
157
  const systemFile = _loadSystemFile();
158
- if (env.LINGODOTDEV_API_KEY && _optionalChain([systemFile, 'access', _59 => _59.auth, 'optionalAccess', _60 => _60.apiKey])) {
158
+ if (env.LINGODOTDEV_API_KEY && _optionalChain([systemFile, 'access', _60 => _60.auth, 'optionalAccess', _61 => _61.apiKey])) {
159
159
  console.info(
160
160
  "\x1B[36m%s\x1B[0m",
161
161
  `\u2139\uFE0F Using LINGODOTDEV_API_KEY env var instead of credentials from user config`
162
162
  );
163
163
  }
164
- if (env.OPENAI_API_KEY && _optionalChain([systemFile, 'access', _61 => _61.llm, 'optionalAccess', _62 => _62.openaiApiKey])) {
164
+ if (env.OPENAI_API_KEY && _optionalChain([systemFile, 'access', _62 => _62.llm, 'optionalAccess', _63 => _63.openaiApiKey])) {
165
165
  console.info(
166
166
  "\x1B[36m%s\x1B[0m",
167
167
  `\u2139\uFE0F Using OPENAI_API_KEY env var instead of key from user config.`
168
168
  );
169
169
  }
170
- if (env.ANTHROPIC_API_KEY && _optionalChain([systemFile, 'access', _63 => _63.llm, 'optionalAccess', _64 => _64.anthropicApiKey])) {
170
+ if (env.ANTHROPIC_API_KEY && _optionalChain([systemFile, 'access', _64 => _64.llm, 'optionalAccess', _65 => _65.anthropicApiKey])) {
171
171
  console.info(
172
172
  "\x1B[36m%s\x1B[0m",
173
173
  `\u2139\uFE0F Using ANTHROPIC_API_KEY env var instead of key from user config`
174
174
  );
175
175
  }
176
- if (env.GROQ_API_KEY && _optionalChain([systemFile, 'access', _65 => _65.llm, 'optionalAccess', _66 => _66.groqApiKey])) {
176
+ if (env.GROQ_API_KEY && _optionalChain([systemFile, 'access', _66 => _66.llm, 'optionalAccess', _67 => _67.groqApiKey])) {
177
177
  console.info(
178
178
  "\x1B[36m%s\x1B[0m",
179
179
  `\u2139\uFE0F Using GROQ_API_KEY env var instead of key from user config`
180
180
  );
181
181
  }
182
- if (env.GOOGLE_API_KEY && _optionalChain([systemFile, 'access', _67 => _67.llm, 'optionalAccess', _68 => _68.googleApiKey])) {
182
+ if (env.GOOGLE_API_KEY && _optionalChain([systemFile, 'access', _68 => _68.llm, 'optionalAccess', _69 => _69.googleApiKey])) {
183
183
  console.info(
184
184
  "\x1B[36m%s\x1B[0m",
185
185
  `\u2139\uFE0F Using GOOGLE_API_KEY env var instead of key from user config`
186
186
  );
187
187
  }
188
- if (env.OPENROUTER_API_KEY && _optionalChain([systemFile, 'access', _69 => _69.llm, 'optionalAccess', _70 => _70.openrouterApiKey])) {
188
+ if (env.OPENROUTER_API_KEY && _optionalChain([systemFile, 'access', _70 => _70.llm, 'optionalAccess', _71 => _71.openrouterApiKey])) {
189
189
  console.info(
190
190
  "\x1B[36m%s\x1B[0m",
191
191
  `\u2139\uFE0F Using OPENROUTER_API_KEY env var instead of key from user config`
192
192
  );
193
193
  }
194
- if (env.MISTRAL_API_KEY && _optionalChain([systemFile, 'access', _71 => _71.llm, 'optionalAccess', _72 => _72.mistralApiKey])) {
194
+ if (env.MISTRAL_API_KEY && _optionalChain([systemFile, 'access', _72 => _72.llm, 'optionalAccess', _73 => _73.mistralApiKey])) {
195
195
  console.info(
196
196
  "\x1B[36m%s\x1B[0m",
197
197
  `\u2139\uFE0F Using MISTRAL_API_KEY env var instead of key from user config`
@@ -209,7 +209,7 @@ function _envVarsInfo() {
209
209
  `\u2139\uFE0F Using LINGODOTDEV_WEB_URL: ${env.LINGODOTDEV_WEB_URL}`
210
210
  );
211
211
  }
212
- if (env.LINGO_API_KEY && _optionalChain([systemFile, 'access', _73 => _73.auth, 'optionalAccess', _74 => _74.vnext, 'optionalAccess', _75 => _75.apiKey])) {
212
+ if (env.LINGO_API_KEY && _optionalChain([systemFile, 'access', _74 => _74.auth, 'optionalAccess', _75 => _75.vnext, 'optionalAccess', _76 => _76.apiKey])) {
213
213
  console.info(
214
214
  "\x1B[36m%s\x1B[0m",
215
215
  `\u2139\uFE0F Using LINGO_API_KEY env var instead of key from user config`
@@ -280,10 +280,10 @@ var LocalizationError = (_class5 = class extends Error {
280
280
  constructor(message, context) {
281
281
  super(message);_class5.prototype.__init5.call(this);;
282
282
  this.name = "LocalizationError";
283
- this.bucket = _optionalChain([context, 'optionalAccess', _76 => _76.bucket]);
284
- this.sourceLocale = _optionalChain([context, 'optionalAccess', _77 => _77.sourceLocale]);
285
- this.targetLocale = _optionalChain([context, 'optionalAccess', _78 => _78.targetLocale]);
286
- this.pathPattern = _optionalChain([context, 'optionalAccess', _79 => _79.pathPattern]);
283
+ this.bucket = _optionalChain([context, 'optionalAccess', _77 => _77.bucket]);
284
+ this.sourceLocale = _optionalChain([context, 'optionalAccess', _78 => _78.sourceLocale]);
285
+ this.targetLocale = _optionalChain([context, 'optionalAccess', _79 => _79.targetLocale]);
286
+ this.pathPattern = _optionalChain([context, 'optionalAccess', _80 => _80.pathPattern]);
287
287
  }
288
288
  }, _class5);
289
289
  var BucketProcessingError = (_class6 = class extends Error {
@@ -419,7 +419,7 @@ function createAuthenticator(params) {
419
419
  });
420
420
  if (res.ok) {
421
421
  const payload = await res.json();
422
- if (!_optionalChain([payload, 'optionalAccess', _80 => _80.email])) {
422
+ if (!_optionalChain([payload, 'optionalAccess', _81 => _81.email])) {
423
423
  return null;
424
424
  }
425
425
  return {
@@ -620,7 +620,7 @@ async function renderSummary(results) {
620
620
  if (succeededResults.length > 0) {
621
621
  console.log(_chalk2.default.hex(colors.green)("\n[Processed Files]"));
622
622
  for (const result of succeededResults) {
623
- const displayPath = _optionalChain([result, 'access', _81 => _81.pathPattern, 'optionalAccess', _82 => _82.replace, 'call', _83 => _83("[locale]", result.targetLocale)]) || "unknown";
623
+ const displayPath = _optionalChain([result, 'access', _82 => _82.pathPattern, 'optionalAccess', _83 => _83.replace, 'call', _84 => _84("[locale]", result.targetLocale)]) || "unknown";
624
624
  console.log(
625
625
  ` \u2713 ${_chalk2.default.dim(displayPath)} ${_chalk2.default.hex(colors.yellow)(`(${result.sourceLocale} \u2192 ${result.targetLocale})`)}`
626
626
  );
@@ -629,7 +629,7 @@ async function renderSummary(results) {
629
629
  if (skippedResults.length > 0) {
630
630
  console.log(_chalk2.default.hex(colors.blue)("\n[Cached Files]"));
631
631
  for (const result of skippedResults) {
632
- const displayPath = _optionalChain([result, 'access', _84 => _84.pathPattern, 'optionalAccess', _85 => _85.replace, 'call', _86 => _86("[locale]", result.targetLocale)]) || "unknown";
632
+ const displayPath = _optionalChain([result, 'access', _85 => _85.pathPattern, 'optionalAccess', _86 => _86.replace, 'call', _87 => _87("[locale]", result.targetLocale)]) || "unknown";
633
633
  console.log(
634
634
  ` \u26A1 ${_chalk2.default.dim(displayPath)} ${_chalk2.default.hex(colors.yellow)(`(${result.sourceLocale} \u2192 ${result.targetLocale})`)}`
635
635
  );
@@ -638,12 +638,12 @@ async function renderSummary(results) {
638
638
  if (failedResults.length > 0) {
639
639
  console.log(_chalk2.default.hex(colors.orange)("\n[Failed Files]"));
640
640
  for (const result of failedResults) {
641
- const displayPath = _optionalChain([result, 'access', _87 => _87.pathPattern, 'optionalAccess', _88 => _88.replace, 'call', _89 => _89("[locale]", result.targetLocale)]) || "unknown";
641
+ const displayPath = _optionalChain([result, 'access', _88 => _88.pathPattern, 'optionalAccess', _89 => _89.replace, 'call', _90 => _90("[locale]", result.targetLocale)]) || "unknown";
642
642
  console.log(
643
643
  ` \u274C ${_chalk2.default.dim(displayPath)} ${_chalk2.default.hex(colors.yellow)(`(${result.sourceLocale} \u2192 ${result.targetLocale})`)}`
644
644
  );
645
645
  console.log(
646
- ` ${_chalk2.default.hex(colors.white)(String(_optionalChain([result, 'access', _90 => _90.error, 'optionalAccess', _91 => _91.message]) || "Unknown error"))}`
646
+ ` ${_chalk2.default.hex(colors.white)(String(_optionalChain([result, 'access', _91 => _91.error, 'optionalAccess', _92 => _92.message]) || "Unknown error"))}`
647
647
  );
648
648
  }
649
649
  }
@@ -1337,7 +1337,7 @@ var init_default = new (0, _interactivecommander.InteractiveCommand)().command("
1337
1337
  });
1338
1338
  const auth2 = await newAuthenticator.whoami();
1339
1339
  if (auth2) {
1340
- _ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess', _92 => _92.email])}`);
1340
+ _ora2.default.call(void 0, ).succeed(`Authenticated as ${_optionalChain([auth2, 'optionalAccess', _93 => _93.email])}`);
1341
1341
  } else {
1342
1342
  _ora2.default.call(void 0, ).fail("Authentication failed.");
1343
1343
  }
@@ -1428,7 +1428,7 @@ function getBuckets(i18nConfig) {
1428
1428
  const includeItems = bucketEntry.include.map(
1429
1429
  (item) => resolveBucketItem(item)
1430
1430
  );
1431
- const excludeItems = _optionalChain([bucketEntry, 'access', _93 => _93.exclude, 'optionalAccess', _94 => _94.map, 'call', _95 => _95(
1431
+ const excludeItems = _optionalChain([bucketEntry, 'access', _94 => _94.exclude, 'optionalAccess', _95 => _95.map, 'call', _96 => _96(
1432
1432
  (item) => resolveBucketItem(item)
1433
1433
  )]);
1434
1434
  const config = {
@@ -1451,6 +1451,9 @@ function getBuckets(i18nConfig) {
1451
1451
  if (bucketEntry.ignoredKeys) {
1452
1452
  config.ignoredKeys = bucketEntry.ignoredKeys;
1453
1453
  }
1454
+ if (bucketEntry.preservedKeys) {
1455
+ config.preservedKeys = bucketEntry.preservedKeys;
1456
+ }
1454
1457
  return config;
1455
1458
  }
1456
1459
  );
@@ -1466,7 +1469,7 @@ function extractPathPatterns(sourceLocale, include, exclude) {
1466
1469
  delimiter: pattern.delimiter
1467
1470
  }))
1468
1471
  );
1469
- const excludedPatterns = _optionalChain([exclude, 'optionalAccess', _96 => _96.flatMap, 'call', _97 => _97(
1472
+ const excludedPatterns = _optionalChain([exclude, 'optionalAccess', _97 => _97.flatMap, 'call', _98 => _98(
1470
1473
  (pattern) => expandPlaceholderedGlob(
1471
1474
  pattern.path,
1472
1475
  __spec.resolveOverriddenLocale.call(void 0, sourceLocale, pattern.delimiter)
@@ -1632,12 +1635,12 @@ function composeLoaders(...loaders) {
1632
1635
  return {
1633
1636
  init: async () => {
1634
1637
  for (const loader of loaders) {
1635
- await _optionalChain([loader, 'access', _98 => _98.init, 'optionalCall', _99 => _99()]);
1638
+ await _optionalChain([loader, 'access', _99 => _99.init, 'optionalCall', _100 => _100()]);
1636
1639
  }
1637
1640
  },
1638
1641
  setDefaultLocale(locale) {
1639
1642
  for (const loader of loaders) {
1640
- _optionalChain([loader, 'access', _100 => _100.setDefaultLocale, 'optionalCall', _101 => _101(locale)]);
1643
+ _optionalChain([loader, 'access', _101 => _101.setDefaultLocale, 'optionalCall', _102 => _102(locale)]);
1641
1644
  }
1642
1645
  return this;
1643
1646
  },
@@ -1658,7 +1661,7 @@ function composeLoaders(...loaders) {
1658
1661
  pullHints: async (originalInput) => {
1659
1662
  let result = originalInput;
1660
1663
  for (let i = 0; i < loaders.length; i++) {
1661
- const subResult = await _optionalChain([loaders, 'access', _102 => _102[i], 'access', _103 => _103.pullHints, 'optionalCall', _104 => _104(result)]);
1664
+ const subResult = await _optionalChain([loaders, 'access', _103 => _103[i], 'access', _104 => _104.pullHints, 'optionalCall', _105 => _105(result)]);
1662
1665
  if (subResult) {
1663
1666
  result = subResult;
1664
1667
  }
@@ -1682,7 +1685,7 @@ function createLoader(lDefinition) {
1682
1685
  if (state.initCtx) {
1683
1686
  return state.initCtx;
1684
1687
  }
1685
- state.initCtx = await _optionalChain([lDefinition, 'access', _105 => _105.init, 'optionalCall', _106 => _106()]);
1688
+ state.initCtx = await _optionalChain([lDefinition, 'access', _106 => _106.init, 'optionalCall', _107 => _107()]);
1686
1689
  return state.initCtx;
1687
1690
  },
1688
1691
  setDefaultLocale(locale) {
@@ -1693,7 +1696,7 @@ function createLoader(lDefinition) {
1693
1696
  return this;
1694
1697
  },
1695
1698
  async pullHints(originalInput) {
1696
- return _optionalChain([lDefinition, 'access', _107 => _107.pullHints, 'optionalCall', _108 => _108(originalInput || state.originalInput)]);
1699
+ return _optionalChain([lDefinition, 'access', _108 => _108.pullHints, 'optionalCall', _109 => _109(originalInput || state.originalInput)]);
1697
1700
  },
1698
1701
  async pull(locale, input2) {
1699
1702
  if (!state.defaultLocale) {
@@ -1949,7 +1952,7 @@ function updateContext(contextStack, line, parsedJson, arrayObjectCount) {
1949
1952
  if (closeBrackets > openBrackets) {
1950
1953
  for (let i = 0; i < closeBrackets - openBrackets; i++) {
1951
1954
  const popped = contextStack.pop();
1952
- if (_optionalChain([popped, 'optionalAccess', _109 => _109.isArray])) {
1955
+ if (_optionalChain([popped, 'optionalAccess', _110 => _110.isArray])) {
1953
1956
  const depth = contextStack.length;
1954
1957
  delete arrayObjectCount[depth];
1955
1958
  }
@@ -2032,7 +2035,7 @@ function createDenormalizeLoader(options) {
2032
2035
  const preservedObjects = {};
2033
2036
  const nonPreservedInput = {};
2034
2037
  for (const [key, value] of Object.entries(inputDenormalized)) {
2035
- if (_optionalChain([options, 'optionalAccess', _110 => _110.shouldPreserveObject, 'optionalCall', _111 => _111(value)])) {
2038
+ if (_optionalChain([options, 'optionalAccess', _111 => _111.shouldPreserveObject, 'optionalCall', _112 => _112(value)])) {
2036
2039
  preservedObjects[key] = value;
2037
2040
  } else {
2038
2041
  nonPreservedInput[key] = value;
@@ -2065,7 +2068,7 @@ function createNormalizeLoader() {
2065
2068
  return normalized;
2066
2069
  },
2067
2070
  push: async (locale, data, originalInput) => {
2068
- const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _112 => _112.keysMap]), () => ( {}));
2071
+ const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _113 => _113.keysMap]), () => ( {}));
2069
2072
  const input2 = mapDenormalizedKeys(data, keysMap);
2070
2073
  const denormalized = _flat.unflatten.call(void 0, input2, {
2071
2074
  delimiter: "/",
@@ -2166,7 +2169,7 @@ function createTextFileLoader(pathPattern) {
2166
2169
  const trimmedResult = result.trim();
2167
2170
  return trimmedResult;
2168
2171
  },
2169
- async push(locale, data, _37, originalLocale) {
2172
+ async push(locale, data, _38, originalLocale) {
2170
2173
  const draftPath = pathPattern.replaceAll("[locale]", locale);
2171
2174
  const finalPath = path15.default.resolve(draftPath);
2172
2175
  const dirPath = path15.default.dirname(finalPath);
@@ -2199,8 +2202,8 @@ async function getTrailingNewLine(pathPattern, locale, originalLocale) {
2199
2202
  if (!templateData) {
2200
2203
  templateData = await readFileForLocale(pathPattern, originalLocale);
2201
2204
  }
2202
- if (_optionalChain([templateData, 'optionalAccess', _113 => _113.match, 'call', _114 => _114(/[\r\n]$/)])) {
2203
- const ending = _optionalChain([templateData, 'optionalAccess', _115 => _115.includes, 'call', _116 => _116("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _117 => _117.includes, 'call', _118 => _118("\r")]) ? "\r" : "\n";
2205
+ if (_optionalChain([templateData, 'optionalAccess', _114 => _114.match, 'call', _115 => _115(/[\r\n]$/)])) {
2206
+ const ending = _optionalChain([templateData, 'optionalAccess', _116 => _116.includes, 'call', _117 => _117("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _118 => _118.includes, 'call', _119 => _119("\r")]) ? "\r" : "\n";
2204
2207
  return ending;
2205
2208
  }
2206
2209
  return "";
@@ -2475,15 +2478,15 @@ function createAilLoader() {
2475
2478
  }
2476
2479
  const entries = dictionary.ENTRY || [];
2477
2480
  for (const entry of entries) {
2478
- const id = _optionalChain([entry, 'access', _119 => _119.$, 'optionalAccess', _120 => _120.id]);
2481
+ const id = _optionalChain([entry, 'access', _120 => _120.$, 'optionalAccess', _121 => _121.id]);
2479
2482
  if (!id) {
2480
2483
  continue;
2481
2484
  }
2482
2485
  const strings = entry.STRING || [];
2483
2486
  const sourceString = strings.find(
2484
- (s) => _optionalChain([s, 'access', _121 => _121.$, 'optionalAccess', _122 => _122.lang]) === locale
2487
+ (s) => _optionalChain([s, 'access', _122 => _122.$, 'optionalAccess', _123 => _123.lang]) === locale
2485
2488
  );
2486
- if (_optionalChain([sourceString, 'optionalAccess', _123 => _123.$, 'access', _124 => _124.value])) {
2489
+ if (_optionalChain([sourceString, 'optionalAccess', _124 => _124.$, 'access', _125 => _125.value])) {
2487
2490
  result[id] = sourceString.$.value;
2488
2491
  }
2489
2492
  }
@@ -2525,7 +2528,7 @@ function createAilLoader() {
2525
2528
  }
2526
2529
  const entries = dictionary.ENTRY || [];
2527
2530
  for (const [id, value] of Object.entries(data)) {
2528
- let entry = entries.find((e) => _optionalChain([e, 'access', _125 => _125.$, 'optionalAccess', _126 => _126.id]) === id);
2531
+ let entry = entries.find((e) => _optionalChain([e, 'access', _126 => _126.$, 'optionalAccess', _127 => _127.id]) === id);
2529
2532
  if (!entry) {
2530
2533
  entry = {
2531
2534
  $: { id },
@@ -2537,7 +2540,7 @@ function createAilLoader() {
2537
2540
  entry.STRING = [];
2538
2541
  }
2539
2542
  let targetString = entry.STRING.find(
2540
- (s) => _optionalChain([s, 'access', _127 => _127.$, 'optionalAccess', _128 => _128.lang]) === locale
2543
+ (s) => _optionalChain([s, 'access', _128 => _128.$, 'optionalAccess', _129 => _129.lang]) === locale
2541
2544
  );
2542
2545
  if (targetString) {
2543
2546
  targetString.$.value = value;
@@ -2668,7 +2671,7 @@ async function parseAndroidDocument(input2) {
2668
2671
  const resourceNodes = [];
2669
2672
  let metaIndex = 0;
2670
2673
  for (const child of resourcesNode.$$) {
2671
- const elementName = _optionalChain([child, 'optionalAccess', _129 => _129["#name"]]);
2674
+ const elementName = _optionalChain([child, 'optionalAccess', _130 => _130["#name"]]);
2672
2675
  if (!isResourceElementName(elementName)) {
2673
2676
  continue;
2674
2677
  }
@@ -2676,11 +2679,11 @@ async function parseAndroidDocument(input2) {
2676
2679
  if (!meta || meta.type !== elementName) {
2677
2680
  continue;
2678
2681
  }
2679
- const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _130 => _130.$, 'optionalAccess', _131 => _131.name]), () => ( meta.name));
2682
+ const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _131 => _131.$, 'optionalAccess', _132 => _132.name]), () => ( meta.name));
2680
2683
  if (!name) {
2681
2684
  continue;
2682
2685
  }
2683
- const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess', _132 => _132.$, 'optionalAccess', _133 => _133.translatable]), () => ( ""))).toLowerCase() !== "false";
2686
+ const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess', _133 => _133.$, 'optionalAccess', _134 => _134.translatable]), () => ( ""))).toLowerCase() !== "false";
2684
2687
  switch (meta.type) {
2685
2688
  case "string": {
2686
2689
  resourceNodes.push({
@@ -2693,7 +2696,7 @@ async function parseAndroidDocument(input2) {
2693
2696
  break;
2694
2697
  }
2695
2698
  case "string-array": {
2696
- const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _134 => _134.item]), () => ( []));
2699
+ const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _135 => _135.item]), () => ( []));
2697
2700
  const items = [];
2698
2701
  const templateItems = meta.items;
2699
2702
  for (let i = 0; i < Math.max(itemNodes.length, templateItems.length); i++) {
@@ -2717,7 +2720,7 @@ async function parseAndroidDocument(input2) {
2717
2720
  break;
2718
2721
  }
2719
2722
  case "plurals": {
2720
- const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _135 => _135.item]), () => ( []));
2723
+ const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _136 => _136.item]), () => ( []));
2721
2724
  const templateItems = meta.items;
2722
2725
  const items = [];
2723
2726
  for (const templateItem of templateItems) {
@@ -2726,7 +2729,7 @@ async function parseAndroidDocument(input2) {
2726
2729
  continue;
2727
2730
  }
2728
2731
  const nodeItem = itemNodes.find(
2729
- (item) => _optionalChain([item, 'optionalAccess', _136 => _136.$, 'optionalAccess', _137 => _137.quantity]) === quantity
2732
+ (item) => _optionalChain([item, 'optionalAccess', _137 => _137.$, 'optionalAccess', _138 => _138.quantity]) === quantity
2730
2733
  );
2731
2734
  if (!nodeItem) {
2732
2735
  continue;
@@ -3000,7 +3003,7 @@ function cloneResourceNode(resource) {
3000
3003
  const nodeClone = deepClone(resource.node);
3001
3004
  const itemNodes = _nullishCoalesce(nodeClone.item, () => ( []));
3002
3005
  const items = itemNodes.map((itemNode, index) => {
3003
- const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access', _138 => _138.items, 'access', _139 => _139[index], 'optionalAccess', _140 => _140.meta]), () => ( _optionalChain([resource, 'access', _141 => _141.items, 'access', _142 => _142[resource.items.length - 1], 'optionalAccess', _143 => _143.meta]))), () => ( makeTextMeta([])));
3006
+ const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access', _139 => _139.items, 'access', _140 => _140[index], 'optionalAccess', _141 => _141.meta]), () => ( _optionalChain([resource, 'access', _142 => _142.items, 'access', _143 => _143[resource.items.length - 1], 'optionalAccess', _144 => _144.meta]))), () => ( makeTextMeta([])));
3004
3007
  return {
3005
3008
  node: itemNode,
3006
3009
  meta: cloneTextMeta(templateMeta)
@@ -3020,7 +3023,7 @@ function cloneResourceNode(resource) {
3020
3023
  const items = [];
3021
3024
  for (const templateItem of resource.items) {
3022
3025
  const cloneNode = itemNodes.find(
3023
- (item) => _optionalChain([item, 'optionalAccess', _144 => _144.$, 'optionalAccess', _145 => _145.quantity]) === templateItem.quantity
3026
+ (item) => _optionalChain([item, 'optionalAccess', _145 => _145.$, 'optionalAccess', _146 => _146.quantity]) === templateItem.quantity
3024
3027
  );
3025
3028
  if (!cloneNode) {
3026
3029
  continue;
@@ -3276,8 +3279,8 @@ function cloneDocumentStructure(document) {
3276
3279
  resourceNodes.map((r) => resourceLookupKey(r.type, r.name))
3277
3280
  );
3278
3281
  let filtered = resourcesClone.$$.filter((child) => {
3279
- const elementName = _optionalChain([child, 'optionalAccess', _146 => _146["#name"]]);
3280
- const name = _optionalChain([child, 'optionalAccess', _147 => _147.$, 'optionalAccess', _148 => _148.name]);
3282
+ const elementName = _optionalChain([child, 'optionalAccess', _147 => _147["#name"]]);
3283
+ const name = _optionalChain([child, 'optionalAccess', _148 => _148.$, 'optionalAccess', _149 => _149.name]);
3281
3284
  if (!isResourceElementName(elementName) || !name) {
3282
3285
  return true;
3283
3286
  }
@@ -3286,7 +3289,7 @@ function cloneDocumentStructure(document) {
3286
3289
  const cleaned = [];
3287
3290
  let lastWasWhitespace = false;
3288
3291
  for (const child of filtered) {
3289
- const isWhitespace = _optionalChain([child, 'optionalAccess', _149 => _149["#name"]]) === "__text__" && (!child._ || child._.trim() === "");
3292
+ const isWhitespace = _optionalChain([child, 'optionalAccess', _150 => _150["#name"]]) === "__text__" && (!child._ || child._.trim() === "");
3290
3293
  if (isWhitespace) {
3291
3294
  if (!lastWasWhitespace) {
3292
3295
  cleaned.push(child);
@@ -3308,8 +3311,8 @@ function buildResourceLookup(resources) {
3308
3311
  const lookup = /* @__PURE__ */ new Map();
3309
3312
  const children = Array.isArray(resources.$$) ? resources.$$ : [];
3310
3313
  for (const child of children) {
3311
- const type = _optionalChain([child, 'optionalAccess', _150 => _150["#name"]]);
3312
- const name = _optionalChain([child, 'optionalAccess', _151 => _151.$, 'optionalAccess', _152 => _152.name]);
3314
+ const type = _optionalChain([child, 'optionalAccess', _151 => _151["#name"]]);
3315
+ const name = _optionalChain([child, 'optionalAccess', _152 => _152.$, 'optionalAccess', _153 => _153.name]);
3313
3316
  if (!type || !name || !isResourceElementName(type)) {
3314
3317
  continue;
3315
3318
  }
@@ -3338,7 +3341,7 @@ function cloneResourceNodeFromLookup(resource, lookup) {
3338
3341
  }
3339
3342
  case "string-array": {
3340
3343
  const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
3341
- (child) => _optionalChain([child, 'optionalAccess', _153 => _153["#name"]]) === "item"
3344
+ (child) => _optionalChain([child, 'optionalAccess', _154 => _154["#name"]]) === "item"
3342
3345
  );
3343
3346
  node.item = childItems;
3344
3347
  if (childItems.length < resource.items.length) {
@@ -3367,12 +3370,12 @@ function cloneResourceNodeFromLookup(resource, lookup) {
3367
3370
  }
3368
3371
  case "plurals": {
3369
3372
  const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
3370
- (child) => _optionalChain([child, 'optionalAccess', _154 => _154["#name"]]) === "item"
3373
+ (child) => _optionalChain([child, 'optionalAccess', _155 => _155["#name"]]) === "item"
3371
3374
  );
3372
3375
  node.item = childItems;
3373
3376
  const itemMap = /* @__PURE__ */ new Map();
3374
3377
  for (const item of childItems) {
3375
- if (_optionalChain([item, 'optionalAccess', _155 => _155.$, 'optionalAccess', _156 => _156.quantity])) {
3378
+ if (_optionalChain([item, 'optionalAccess', _156 => _156.$, 'optionalAccess', _157 => _157.quantity])) {
3376
3379
  itemMap.set(item.$.quantity, item);
3377
3380
  }
3378
3381
  }
@@ -3662,7 +3665,7 @@ var _sync3 = require('csv-stringify/sync');
3662
3665
 
3663
3666
  function detectKeyColumnName(csvString) {
3664
3667
  const row = _sync.parse.call(void 0, csvString)[0];
3665
- const firstColumn = _optionalChain([row, 'optionalAccess', _157 => _157[0], 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]);
3668
+ const firstColumn = _optionalChain([row, 'optionalAccess', _158 => _158[0], 'optionalAccess', _159 => _159.trim, 'call', _160 => _160()]);
3666
3669
  return firstColumn || "KEY";
3667
3670
  }
3668
3671
  function createCsvLoader() {
@@ -3991,7 +3994,7 @@ function createHtmlLoader() {
3991
3994
  const attrs = BASE_LOCALIZABLE_ATTRIBUTES[tagName];
3992
3995
  if (!attrs) return;
3993
3996
  for (const attr of attrs) {
3994
- const value = _optionalChain([element, 'access', _160 => _160.attribs, 'optionalAccess', _161 => _161[attr]]);
3997
+ const value = _optionalChain([element, 'access', _161 => _161.attribs, 'optionalAccess', _162 => _162[attr]]);
3995
3998
  if (value && value.trim()) {
3996
3999
  result[`${path20}#${attr}`] = value.trim();
3997
4000
  }
@@ -4158,7 +4161,7 @@ function createMarkdownLoader() {
4158
4161
  yaml: yamlEngine
4159
4162
  }
4160
4163
  });
4161
- const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()]), () => ( ""))).filter(Boolean);
4164
+ const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _163 => _163.trim, 'call', _164 => _164()]), () => ( ""))).filter(Boolean);
4162
4165
  return {
4163
4166
  ...Object.fromEntries(
4164
4167
  sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
@@ -4177,7 +4180,7 @@ function createMarkdownLoader() {
4177
4180
  );
4178
4181
  let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(
4179
4182
  ([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())
4180
- ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _164 => _164.trim, 'call', _165 => _165()]), () => ( ""))).filter(Boolean).join("\n\n");
4183
+ ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]), () => ( ""))).filter(Boolean).join("\n\n");
4181
4184
  if (Object.keys(frontmatter).length > 0) {
4182
4185
  content = `
4183
4186
  ${content}`;
@@ -4202,7 +4205,7 @@ function createMarkdocLoader() {
4202
4205
  const result = {};
4203
4206
  const counters = {};
4204
4207
  traverseAndExtract(ast, "", result, counters);
4205
- if (_optionalChain([ast, 'access', _166 => _166.attributes, 'optionalAccess', _167 => _167.frontmatter])) {
4208
+ if (_optionalChain([ast, 'access', _167 => _167.attributes, 'optionalAccess', _168 => _168.frontmatter])) {
4206
4209
  const frontmatter = _yaml2.default.parse(ast.attributes.frontmatter);
4207
4210
  Object.entries(frontmatter).forEach(([key, value]) => {
4208
4211
  if (typeof value === "string") {
@@ -4248,7 +4251,7 @@ function traverseAndExtract(node, path20, result, counters, parentType) {
4248
4251
  if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
4249
4252
  semanticType = nodeSemanticType;
4250
4253
  }
4251
- if (node.type === "text" && _optionalChain([node, 'access', _168 => _168.attributes, 'optionalAccess', _169 => _169.content])) {
4254
+ if (node.type === "text" && _optionalChain([node, 'access', _169 => _169.attributes, 'optionalAccess', _170 => _170.content])) {
4252
4255
  const content = node.attributes.content;
4253
4256
  if (typeof content === "string" && content.trim()) {
4254
4257
  if (semanticType) {
@@ -4275,7 +4278,7 @@ function buildPathMap(node, path20, counters, pathMap, parentType) {
4275
4278
  if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
4276
4279
  semanticType = nodeSemanticType;
4277
4280
  }
4278
- if (node.type === "text" && _optionalChain([node, 'access', _170 => _170.attributes, 'optionalAccess', _171 => _171.content])) {
4281
+ if (node.type === "text" && _optionalChain([node, 'access', _171 => _171.attributes, 'optionalAccess', _172 => _172.content])) {
4279
4282
  const content = node.attributes.content;
4280
4283
  if (typeof content === "string" && content.trim()) {
4281
4284
  if (semanticType) {
@@ -4298,7 +4301,7 @@ function applyTranslations(node, path20, data, pathMap) {
4298
4301
  if (!node || typeof node !== "object") {
4299
4302
  return;
4300
4303
  }
4301
- if (node.type === "text" && _optionalChain([node, 'access', _172 => _172.attributes, 'optionalAccess', _173 => _173.content])) {
4304
+ if (node.type === "text" && _optionalChain([node, 'access', _173 => _173.attributes, 'optionalAccess', _174 => _174.content])) {
4302
4305
  const content = node.attributes.content;
4303
4306
  if (typeof content === "string") {
4304
4307
  const contentPath = path20 ? `${path20}/attributes/content` : "attributes/content";
@@ -4600,7 +4603,7 @@ function createPropertiesLoader() {
4600
4603
  return result;
4601
4604
  },
4602
4605
  async push(locale, payload) {
4603
- const result = Object.entries(payload).filter(([_37, value]) => value != null).map(([key, value]) => `${key}=${value}`).join("\n");
4606
+ const result = Object.entries(payload).filter(([_38, value]) => value != null).map(([key, value]) => `${key}=${value}`).join("\n");
4604
4607
  return result;
4605
4608
  }
4606
4609
  });
@@ -4611,7 +4614,7 @@ function isSkippableLine(line) {
4611
4614
  function parsePropertyLine(line) {
4612
4615
  const [key, ...valueParts] = line.split("=");
4613
4616
  return {
4614
- key: _optionalChain([key, 'optionalAccess', _174 => _174.trim, 'call', _175 => _175()]) || "",
4617
+ key: _optionalChain([key, 'optionalAccess', _175 => _175.trim, 'call', _176 => _176()]) || "",
4615
4618
  value: valueParts.join("=").trim()
4616
4619
  };
4617
4620
  }
@@ -4903,7 +4906,7 @@ var Parser3 = class {
4903
4906
  }
4904
4907
  }
4905
4908
  expect(type) {
4906
- if (_optionalChain([this, 'access', _176 => _176.current, 'call', _177 => _177(), 'optionalAccess', _178 => _178.type]) === type) {
4909
+ if (_optionalChain([this, 'access', _177 => _177.current, 'call', _178 => _178(), 'optionalAccess', _179 => _179.type]) === type) {
4907
4910
  this.advance();
4908
4911
  return true;
4909
4912
  }
@@ -4922,7 +4925,7 @@ function createXcodeStringsLoader() {
4922
4925
  return result;
4923
4926
  },
4924
4927
  async push(locale, payload) {
4925
- const lines = Object.entries(payload).filter(([_37, value]) => value != null).map(([key, value]) => {
4928
+ const lines = Object.entries(payload).filter(([_38, value]) => value != null).map(([key, value]) => {
4926
4929
  const escapedValue = escapeString(value);
4927
4930
  return `"${key}" = "${escapedValue}";`;
4928
4931
  });
@@ -4980,7 +4983,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4980
4983
  if (rootTranslationEntity.shouldTranslate === false) {
4981
4984
  continue;
4982
4985
  }
4983
- const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _179 => _179.localizations, 'optionalAccess', _180 => _180[locale]]);
4986
+ const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _180 => _180.localizations, 'optionalAccess', _181 => _181[locale]]);
4984
4987
  if (langTranslationEntity) {
4985
4988
  if ("stringUnit" in langTranslationEntity) {
4986
4989
  resultData[translationKey] = langTranslationEntity.stringUnit.value;
@@ -4994,7 +4997,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4994
4997
  resultData[translationKey] = {};
4995
4998
  const pluralForms = langTranslationEntity.variations.plural;
4996
4999
  for (const form in pluralForms) {
4997
- if (_optionalChain([pluralForms, 'access', _181 => _181[form], 'optionalAccess', _182 => _182.stringUnit, 'optionalAccess', _183 => _183.value])) {
5000
+ if (_optionalChain([pluralForms, 'access', _182 => _182[form], 'optionalAccess', _183 => _183.stringUnit, 'optionalAccess', _184 => _184.value])) {
4998
5001
  resultData[translationKey][form] = pluralForms[form].stringUnit.value;
4999
5002
  }
5000
5003
  }
@@ -5020,7 +5023,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
5020
5023
  const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
5021
5024
  if (typeof value === "string") {
5022
5025
  langDataToMerge.strings[key] = {
5023
- extractionState: _optionalChain([originalInput, 'optionalAccess', _184 => _184.strings, 'optionalAccess', _185 => _185[key], 'optionalAccess', _186 => _186.extractionState]),
5026
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _185 => _185.strings, 'optionalAccess', _186 => _186[key], 'optionalAccess', _187 => _187.extractionState]),
5024
5027
  localizations: {
5025
5028
  [locale]: {
5026
5029
  stringUnit: {
@@ -5035,7 +5038,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
5035
5038
  }
5036
5039
  } else if (Array.isArray(value)) {
5037
5040
  langDataToMerge.strings[key] = {
5038
- extractionState: _optionalChain([originalInput, 'optionalAccess', _187 => _187.strings, 'optionalAccess', _188 => _188[key], 'optionalAccess', _189 => _189.extractionState]),
5041
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _188 => _188.strings, 'optionalAccess', _189 => _189[key], 'optionalAccess', _190 => _190.extractionState]),
5039
5042
  localizations: {
5040
5043
  [locale]: {
5041
5044
  stringSet: {
@@ -5093,7 +5096,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
5093
5096
  for (const [locale, localization] of Object.entries(
5094
5097
  entity.localizations
5095
5098
  )) {
5096
- if (_optionalChain([localization, 'access', _190 => _190.variations, 'optionalAccess', _191 => _191.plural])) {
5099
+ if (_optionalChain([localization, 'access', _191 => _191.variations, 'optionalAccess', _192 => _192.plural])) {
5097
5100
  const pluralForms = localization.variations.plural;
5098
5101
  for (const form in pluralForms) {
5099
5102
  const pluralKey = `${translationKey}/${form}`;
@@ -5113,7 +5116,7 @@ function _removeLocale(input2, locale) {
5113
5116
  const { strings } = input2;
5114
5117
  const newStrings = _lodash2.default.cloneDeep(strings);
5115
5118
  for (const [key, value] of Object.entries(newStrings)) {
5116
- if (_optionalChain([value, 'access', _192 => _192.localizations, 'optionalAccess', _193 => _193[locale]])) {
5119
+ if (_optionalChain([value, 'access', _193 => _193.localizations, 'optionalAccess', _194 => _194[locale]])) {
5117
5120
  delete value.localizations[locale];
5118
5121
  }
5119
5122
  }
@@ -5244,7 +5247,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5244
5247
  if (rootTranslationEntity.shouldTranslate === false) {
5245
5248
  continue;
5246
5249
  }
5247
- const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _194 => _194.localizations, 'optionalAccess', _195 => _195[locale]]);
5250
+ const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _195 => _195.localizations, 'optionalAccess', _196 => _196[locale]]);
5248
5251
  if (langTranslationEntity) {
5249
5252
  if (!resultData[translationKey]) {
5250
5253
  resultData[translationKey] = {};
@@ -5256,7 +5259,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5256
5259
  for (const [subName, subData] of Object.entries(
5257
5260
  langTranslationEntity.substitutions
5258
5261
  )) {
5259
- const pluralForms = _optionalChain([subData, 'access', _196 => _196.variations, 'optionalAccess', _197 => _197.plural]);
5262
+ const pluralForms = _optionalChain([subData, 'access', _197 => _197.variations, 'optionalAccess', _198 => _198.plural]);
5260
5263
  if (pluralForms) {
5261
5264
  const forms = {};
5262
5265
  for (const [form, formData] of Object.entries(pluralForms)) {
@@ -5281,7 +5284,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5281
5284
  const pluralForms = langTranslationEntity.variations.plural;
5282
5285
  const forms = {};
5283
5286
  for (const [form, formData] of Object.entries(pluralForms)) {
5284
- if (_optionalChain([formData, 'optionalAccess', _198 => _198.stringUnit, 'optionalAccess', _199 => _199.value])) {
5287
+ if (_optionalChain([formData, 'optionalAccess', _199 => _199.stringUnit, 'optionalAccess', _200 => _200.value])) {
5285
5288
  forms[form] = formData.stringUnit.value;
5286
5289
  }
5287
5290
  }
@@ -5324,7 +5327,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5324
5327
  for (const [subName, subData] of Object.entries(
5325
5328
  keyData.substitutions
5326
5329
  )) {
5327
- const pluralValue = _optionalChain([subData, 'optionalAccess', _200 => _200.variations, 'optionalAccess', _201 => _201.plural]);
5330
+ const pluralValue = _optionalChain([subData, 'optionalAccess', _201 => _201.variations, 'optionalAccess', _202 => _202.plural]);
5328
5331
  if (pluralValue && isIcuPluralString(pluralValue)) {
5329
5332
  try {
5330
5333
  const pluralForms = parseIcuPluralString(pluralValue, locale);
@@ -5337,8 +5340,8 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5337
5340
  }
5338
5341
  };
5339
5342
  }
5340
- const sourceLocale = _optionalChain([originalInput, 'optionalAccess', _202 => _202.sourceLanguage]) || "en";
5341
- const origFormatSpec = _optionalChain([originalInput, 'optionalAccess', _203 => _203.strings, 'optionalAccess', _204 => _204[baseKey], 'optionalAccess', _205 => _205.localizations, 'optionalAccess', _206 => _206[sourceLocale], 'optionalAccess', _207 => _207.substitutions, 'optionalAccess', _208 => _208[subName], 'optionalAccess', _209 => _209.formatSpecifier]) || subName;
5343
+ const sourceLocale = _optionalChain([originalInput, 'optionalAccess', _203 => _203.sourceLanguage]) || "en";
5344
+ const origFormatSpec = _optionalChain([originalInput, 'optionalAccess', _204 => _204.strings, 'optionalAccess', _205 => _205[baseKey], 'optionalAccess', _206 => _206.localizations, 'optionalAccess', _207 => _207[sourceLocale], 'optionalAccess', _208 => _208.substitutions, 'optionalAccess', _209 => _209[subName], 'optionalAccess', _210 => _210.formatSpecifier]) || subName;
5342
5345
  subs[subName] = {
5343
5346
  formatSpecifier: origFormatSpec,
5344
5347
  variations: {
@@ -5363,7 +5366,7 @@ ${error instanceof Error ? error.message : String(error)}`
5363
5366
  values: keyData.stringSet
5364
5367
  };
5365
5368
  }
5366
- if ("variations" in keyData && _optionalChain([keyData, 'access', _210 => _210.variations, 'optionalAccess', _211 => _211.plural])) {
5369
+ if ("variations" in keyData && _optionalChain([keyData, 'access', _211 => _211.variations, 'optionalAccess', _212 => _212.plural])) {
5367
5370
  const pluralValue = keyData.variations.plural;
5368
5371
  if (isIcuPluralString(pluralValue)) {
5369
5372
  try {
@@ -5390,7 +5393,7 @@ ${error instanceof Error ? error.message : String(error)}`
5390
5393
  }
5391
5394
  if (Object.keys(localizationData).length > 0) {
5392
5395
  langDataToMerge.strings[baseKey] = {
5393
- extractionState: _optionalChain([originalInput, 'optionalAccess', _212 => _212.strings, 'optionalAccess', _213 => _213[baseKey], 'optionalAccess', _214 => _214.extractionState]),
5396
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _213 => _213.strings, 'optionalAccess', _214 => _214[baseKey], 'optionalAccess', _215 => _215.extractionState]),
5394
5397
  localizations: {
5395
5398
  [locale]: localizationData
5396
5399
  }
@@ -5427,12 +5430,12 @@ function createUnlocalizableLoader(returnUnlocalizedKeys = false) {
5427
5430
  const unlocalizableKeys = _getUnlocalizableKeys(input2);
5428
5431
  const result = _lodash2.default.omitBy(
5429
5432
  input2,
5430
- (_37, key) => unlocalizableKeys.includes(key)
5433
+ (_38, key) => unlocalizableKeys.includes(key)
5431
5434
  );
5432
5435
  if (returnUnlocalizedKeys) {
5433
5436
  result.unlocalizable = _lodash2.default.omitBy(
5434
5437
  input2,
5435
- (_37, key) => !unlocalizableKeys.includes(key)
5438
+ (_38, key) => !unlocalizableKeys.includes(key)
5436
5439
  );
5437
5440
  }
5438
5441
  return result;
@@ -5442,7 +5445,7 @@ function createUnlocalizableLoader(returnUnlocalizedKeys = false) {
5442
5445
  const result = _lodash2.default.merge(
5443
5446
  {},
5444
5447
  data,
5445
- _lodash2.default.omitBy(originalInput, (_37, key) => !unlocalizableKeys.includes(key))
5448
+ _lodash2.default.omitBy(originalInput, (_38, key) => !unlocalizableKeys.includes(key))
5446
5449
  );
5447
5450
  return result;
5448
5451
  }
@@ -5473,7 +5476,7 @@ function _getUnlocalizableKeys(input2) {
5473
5476
  }
5474
5477
  }
5475
5478
  return false;
5476
- }).map(([key, _37]) => key);
5479
+ }).map(([key, _38]) => key);
5477
5480
  }
5478
5481
 
5479
5482
  // src/cli/loaders/formatters/prettier.ts
@@ -5613,8 +5616,8 @@ async function formatDataWithBiome(data, filePath, options) {
5613
5616
  });
5614
5617
  return formatted.content;
5615
5618
  } catch (error) {
5616
- const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _215 => _215.stackTrace, 'optionalAccess', _216 => _216.toString, 'call', _217 => _217(), 'access', _218 => _218.split, 'call', _219 => _219("\n"), 'access', _220 => _220[0]]) : "";
5617
- if (_optionalChain([errorMessage, 'optionalAccess', _221 => _221.includes, 'call', _222 => _222("does not exist in the workspace")])) {
5619
+ const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _216 => _216.stackTrace, 'optionalAccess', _217 => _217.toString, 'call', _218 => _218(), 'access', _219 => _219.split, 'call', _220 => _220("\n"), 'access', _221 => _221[0]]) : "";
5620
+ if (_optionalChain([errorMessage, 'optionalAccess', _222 => _222.includes, 'call', _223 => _223("does not exist in the workspace")])) {
5618
5621
  } else {
5619
5622
  console.log(`\u26A0\uFE0F Biome skipped ${path15.default.basename(filePath)}`);
5620
5623
  if (errorMessage) {
@@ -5661,7 +5664,7 @@ function createPoDataLoader(params) {
5661
5664
  Object.entries(entries).forEach(([msgid, entry]) => {
5662
5665
  if (msgid && entry.msgid) {
5663
5666
  const context = entry.msgctxt || "";
5664
- const fullEntry = _optionalChain([parsedPo, 'access', _223 => _223.translations, 'access', _224 => _224[context], 'optionalAccess', _225 => _225[msgid]]);
5667
+ const fullEntry = _optionalChain([parsedPo, 'access', _224 => _224.translations, 'access', _225 => _225[context], 'optionalAccess', _226 => _226[msgid]]);
5665
5668
  if (fullEntry) {
5666
5669
  result[msgid] = fullEntry;
5667
5670
  }
@@ -5671,8 +5674,8 @@ function createPoDataLoader(params) {
5671
5674
  return result;
5672
5675
  },
5673
5676
  async push(locale, data, originalInput, originalLocale, pullInput) {
5674
- const currentSections = _optionalChain([pullInput, 'optionalAccess', _226 => _226.split, 'call', _227 => _227("\n\n"), 'access', _228 => _228.filter, 'call', _229 => _229(Boolean)]) || [];
5675
- const originalSections = _optionalChain([originalInput, 'optionalAccess', _230 => _230.split, 'call', _231 => _231("\n\n"), 'access', _232 => _232.filter, 'call', _233 => _233(Boolean)]) || [];
5677
+ const currentSections = _optionalChain([pullInput, 'optionalAccess', _227 => _227.split, 'call', _228 => _228("\n\n"), 'access', _229 => _229.filter, 'call', _230 => _230(Boolean)]) || [];
5678
+ const originalSections = _optionalChain([originalInput, 'optionalAccess', _231 => _231.split, 'call', _232 => _232("\n\n"), 'access', _233 => _233.filter, 'call', _234 => _234(Boolean)]) || [];
5676
5679
  const result = originalSections.map((section) => {
5677
5680
  const sectionPo = _gettextparser2.default.po.parse(section);
5678
5681
  if (Object.keys(sectionPo.translations).length === 0) {
@@ -5743,8 +5746,8 @@ function createPoContentLoader() {
5743
5746
  {
5744
5747
  ...entry,
5745
5748
  msgstr: [
5746
- _optionalChain([data, 'access', _234 => _234[entry.msgid], 'optionalAccess', _235 => _235.singular]),
5747
- _optionalChain([data, 'access', _236 => _236[entry.msgid], 'optionalAccess', _237 => _237.plural]) || null
5749
+ _optionalChain([data, 'access', _235 => _235[entry.msgid], 'optionalAccess', _236 => _236.singular]),
5750
+ _optionalChain([data, 'access', _237 => _237[entry.msgid], 'optionalAccess', _238 => _238.plural]) || null
5748
5751
  ].filter(Boolean)
5749
5752
  }
5750
5753
  ]).fromPairs().value();
@@ -5866,7 +5869,7 @@ function pullV1(xliffElement, locale, originalLocale) {
5866
5869
  let key = getTransUnitKey(unit);
5867
5870
  if (!key) return;
5868
5871
  if (seenKeys.has(key)) {
5869
- const id = _optionalChain([unit, 'access', _238 => _238.getAttribute, 'call', _239 => _239("id"), 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
5872
+ const id = _optionalChain([unit, 'access', _239 => _239.getAttribute, 'call', _240 => _240("id"), 'optionalAccess', _241 => _241.trim, 'call', _242 => _242()]);
5870
5873
  if (id) {
5871
5874
  key = `${key}#${id}`;
5872
5875
  } else {
@@ -5914,7 +5917,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
5914
5917
  let key = getTransUnitKey(unit);
5915
5918
  if (!key) return;
5916
5919
  if (seenKeys.has(key)) {
5917
- const id = _optionalChain([unit, 'access', _242 => _242.getAttribute, 'call', _243 => _243("id"), 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
5920
+ const id = _optionalChain([unit, 'access', _243 => _243.getAttribute, 'call', _244 => _244("id"), 'optionalAccess', _245 => _245.trim, 'call', _246 => _246()]);
5918
5921
  if (id) {
5919
5922
  key = `${key}#${id}`;
5920
5923
  } else {
@@ -5956,7 +5959,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
5956
5959
  const translationKeys = new Set(Object.keys(translations));
5957
5960
  existingUnits.forEach((unit, key) => {
5958
5961
  if (!translationKeys.has(key)) {
5959
- _optionalChain([unit, 'access', _246 => _246.parentNode, 'optionalAccess', _247 => _247.removeChild, 'call', _248 => _248(unit)]);
5962
+ _optionalChain([unit, 'access', _247 => _247.parentNode, 'optionalAccess', _248 => _248.removeChild, 'call', _249 => _249(unit)]);
5960
5963
  }
5961
5964
  });
5962
5965
  return serializeWithDeclaration(
@@ -5999,18 +6002,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
5999
6002
  Array.from(container.children).forEach((child) => {
6000
6003
  const tagName = child.tagName;
6001
6004
  if (tagName === "unit") {
6002
- const unitId = _optionalChain([child, 'access', _249 => _249.getAttribute, 'call', _250 => _250("id"), 'optionalAccess', _251 => _251.trim, 'call', _252 => _252()]);
6005
+ const unitId = _optionalChain([child, 'access', _250 => _250.getAttribute, 'call', _251 => _251("id"), 'optionalAccess', _252 => _252.trim, 'call', _253 => _253()]);
6003
6006
  if (!unitId) return;
6004
6007
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
6005
6008
  const segment = child.querySelector("segment");
6006
- const source = _optionalChain([segment, 'optionalAccess', _253 => _253.querySelector, 'call', _254 => _254("source")]);
6009
+ const source = _optionalChain([segment, 'optionalAccess', _254 => _254.querySelector, 'call', _255 => _255("source")]);
6007
6010
  if (source) {
6008
6011
  result[key] = extractTextContent(source);
6009
6012
  } else {
6010
6013
  result[key] = unitId;
6011
6014
  }
6012
6015
  } else if (tagName === "group") {
6013
- const groupId = _optionalChain([child, 'access', _255 => _255.getAttribute, 'call', _256 => _256("id"), 'optionalAccess', _257 => _257.trim, 'call', _258 => _258()]);
6016
+ const groupId = _optionalChain([child, 'access', _256 => _256.getAttribute, 'call', _257 => _257("id"), 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]);
6014
6017
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
6015
6018
  traverseUnitsV2(child, fileId, newPath, result);
6016
6019
  }
@@ -6046,12 +6049,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
6046
6049
  Array.from(container.children).forEach((child) => {
6047
6050
  const tagName = child.tagName;
6048
6051
  if (tagName === "unit") {
6049
- const unitId = _optionalChain([child, 'access', _259 => _259.getAttribute, 'call', _260 => _260("id"), 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
6052
+ const unitId = _optionalChain([child, 'access', _260 => _260.getAttribute, 'call', _261 => _261("id"), 'optionalAccess', _262 => _262.trim, 'call', _263 => _263()]);
6050
6053
  if (!unitId) return;
6051
6054
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
6052
6055
  index.set(key, child);
6053
6056
  } else if (tagName === "group") {
6054
- const groupId = _optionalChain([child, 'access', _263 => _263.getAttribute, 'call', _264 => _264("id"), 'optionalAccess', _265 => _265.trim, 'call', _266 => _266()]);
6057
+ const groupId = _optionalChain([child, 'access', _264 => _264.getAttribute, 'call', _265 => _265("id"), 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()]);
6055
6058
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
6056
6059
  indexUnitsV2(child, fileId, newPath, index);
6057
6060
  }
@@ -6072,9 +6075,9 @@ function updateUnitV2(unit, value) {
6072
6075
  setTextContent(source, value);
6073
6076
  }
6074
6077
  function getTransUnitKey(transUnit) {
6075
- const resname = _optionalChain([transUnit, 'access', _267 => _267.getAttribute, 'call', _268 => _268("resname"), 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()]);
6078
+ const resname = _optionalChain([transUnit, 'access', _268 => _268.getAttribute, 'call', _269 => _269("resname"), 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]);
6076
6079
  if (resname) return resname;
6077
- const id = _optionalChain([transUnit, 'access', _271 => _271.getAttribute, 'call', _272 => _272("id"), 'optionalAccess', _273 => _273.trim, 'call', _274 => _274()]);
6080
+ const id = _optionalChain([transUnit, 'access', _272 => _272.getAttribute, 'call', _273 => _273("id"), 'optionalAccess', _274 => _274.trim, 'call', _275 => _275()]);
6078
6081
  if (id) return id;
6079
6082
  const sourceElement = transUnit.querySelector("source");
6080
6083
  if (sourceElement) {
@@ -6131,7 +6134,7 @@ function formatXml(xml) {
6131
6134
  if (cdataNode) {
6132
6135
  return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
6133
6136
  }
6134
- const textContent2 = _optionalChain([element, 'access', _275 => _275.textContent, 'optionalAccess', _276 => _276.trim, 'call', _277 => _277()]) || "";
6137
+ const textContent2 = _optionalChain([element, 'access', _276 => _276.textContent, 'optionalAccess', _277 => _277.trim, 'call', _278 => _278()]) || "";
6135
6138
  const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
6136
6139
  if (hasOnlyText && textContent2) {
6137
6140
  return `${indent2}${openTag}${textContent2}</${tagName}>`;
@@ -6424,7 +6427,7 @@ function createDatoClient(params) {
6424
6427
  ids: !records.length ? void 0 : records.join(",")
6425
6428
  }
6426
6429
  }).catch(
6427
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _278 => _278.response, 'optionalAccess', _279 => _279.body, 'optionalAccess', _280 => _280.data, 'optionalAccess', _281 => _281[0]]) || error)
6430
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _279 => _279.response, 'optionalAccess', _280 => _280.body, 'optionalAccess', _281 => _281.data, 'optionalAccess', _282 => _282[0]]) || error)
6428
6431
  );
6429
6432
  },
6430
6433
  findRecordsForModel: async (modelId, records) => {
@@ -6435,10 +6438,10 @@ function createDatoClient(params) {
6435
6438
  filter: {
6436
6439
  type: modelId,
6437
6440
  only_valid: "true",
6438
- ids: !_optionalChain([records, 'optionalAccess', _282 => _282.length]) ? void 0 : records.join(",")
6441
+ ids: !_optionalChain([records, 'optionalAccess', _283 => _283.length]) ? void 0 : records.join(",")
6439
6442
  }
6440
6443
  }).catch(
6441
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _283 => _283.response, 'optionalAccess', _284 => _284.body, 'optionalAccess', _285 => _285.data, 'optionalAccess', _286 => _286[0]]) || error)
6444
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _284 => _284.response, 'optionalAccess', _285 => _285.body, 'optionalAccess', _286 => _286.data, 'optionalAccess', _287 => _287[0]]) || error)
6442
6445
  );
6443
6446
  return result;
6444
6447
  } catch (_error) {
@@ -6454,10 +6457,10 @@ function createDatoClient(params) {
6454
6457
  updateRecord: async (id, payload) => {
6455
6458
  try {
6456
6459
  await dato.items.update(id, payload).catch(
6457
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _287 => _287.response, 'optionalAccess', _288 => _288.body, 'optionalAccess', _289 => _289.data, 'optionalAccess', _290 => _290[0]]) || error)
6460
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _288 => _288.response, 'optionalAccess', _289 => _289.body, 'optionalAccess', _290 => _290.data, 'optionalAccess', _291 => _291[0]]) || error)
6458
6461
  );
6459
6462
  } catch (_error) {
6460
- if (_optionalChain([_error, 'optionalAccess', _291 => _291.attributes, 'optionalAccess', _292 => _292.details, 'optionalAccess', _293 => _293.message])) {
6463
+ if (_optionalChain([_error, 'optionalAccess', _292 => _292.attributes, 'optionalAccess', _293 => _293.details, 'optionalAccess', _294 => _294.message])) {
6461
6464
  throw new Error(
6462
6465
  [
6463
6466
  `${_error.attributes.details.message}`,
@@ -6479,10 +6482,10 @@ function createDatoClient(params) {
6479
6482
  enableFieldLocalization: async (args) => {
6480
6483
  try {
6481
6484
  await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
6482
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _294 => _294.response, 'optionalAccess', _295 => _295.body, 'optionalAccess', _296 => _296.data, 'optionalAccess', _297 => _297[0]]) || error)
6485
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _295 => _295.response, 'optionalAccess', _296 => _296.body, 'optionalAccess', _297 => _297.data, 'optionalAccess', _298 => _298[0]]) || error)
6483
6486
  );
6484
6487
  } catch (_error) {
6485
- if (_optionalChain([_error, 'optionalAccess', _298 => _298.attributes, 'optionalAccess', _299 => _299.code]) === "NOT_FOUND") {
6488
+ if (_optionalChain([_error, 'optionalAccess', _299 => _299.attributes, 'optionalAccess', _300 => _300.code]) === "NOT_FOUND") {
6486
6489
  throw new Error(
6487
6490
  [
6488
6491
  `Field "${args.fieldId}" not found in model "${args.modelId}".`,
@@ -6490,7 +6493,7 @@ function createDatoClient(params) {
6490
6493
  ].join("\n\n")
6491
6494
  );
6492
6495
  }
6493
- if (_optionalChain([_error, 'optionalAccess', _300 => _300.attributes, 'optionalAccess', _301 => _301.details, 'optionalAccess', _302 => _302.message])) {
6496
+ if (_optionalChain([_error, 'optionalAccess', _301 => _301.attributes, 'optionalAccess', _302 => _302.details, 'optionalAccess', _303 => _303.message])) {
6494
6497
  throw new Error(
6495
6498
  [
6496
6499
  `${_error.attributes.details.message}`,
@@ -6568,7 +6571,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
6568
6571
  const records = await dato.findRecordsForModel(modelId);
6569
6572
  const recordChoices = createRecordChoices(
6570
6573
  records,
6571
- _optionalChain([config, 'access', _303 => _303.models, 'access', _304 => _304[modelId], 'optionalAccess', _305 => _305.records]) || [],
6574
+ _optionalChain([config, 'access', _304 => _304.models, 'access', _305 => _305[modelId], 'optionalAccess', _306 => _306.records]) || [],
6572
6575
  project
6573
6576
  );
6574
6577
  const selectedRecords = await promptRecordSelection(
@@ -6587,14 +6590,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
6587
6590
  },
6588
6591
  async pull(locale, input2, initCtx) {
6589
6592
  const result = {};
6590
- for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _306 => _306.models]) || {})) {
6591
- let records = _optionalChain([initCtx, 'optionalAccess', _307 => _307.models, 'access', _308 => _308[modelId], 'access', _309 => _309.records]) || [];
6593
+ for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _307 => _307.models]) || {})) {
6594
+ let records = _optionalChain([initCtx, 'optionalAccess', _308 => _308.models, 'access', _309 => _309[modelId], 'access', _310 => _310.records]) || [];
6592
6595
  const recordIds = records.map((record) => record.id);
6593
6596
  records = await dato.findRecords(recordIds);
6594
6597
  console.log(`Fetched ${records.length} records for model ${modelId}`);
6595
6598
  if (records.length > 0) {
6596
6599
  result[modelId] = {
6597
- fields: _optionalChain([initCtx, 'optionalAccess', _310 => _310.models, 'optionalAccess', _311 => _311[modelId], 'optionalAccess', _312 => _312.fields]) || [],
6600
+ fields: _optionalChain([initCtx, 'optionalAccess', _311 => _311.models, 'optionalAccess', _312 => _312[modelId], 'optionalAccess', _313 => _313.fields]) || [],
6598
6601
  records
6599
6602
  };
6600
6603
  }
@@ -6657,7 +6660,7 @@ function createRecordChoices(records, selectedIds = [], project) {
6657
6660
  return records.map((record) => ({
6658
6661
  name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
6659
6662
  value: record.id,
6660
- checked: _optionalChain([selectedIds, 'optionalAccess', _313 => _313.includes, 'call', _314 => _314(record.id)])
6663
+ checked: _optionalChain([selectedIds, 'optionalAccess', _314 => _314.includes, 'call', _315 => _315(record.id)])
6661
6664
  }));
6662
6665
  }
6663
6666
  async function promptRecordSelection(modelName, choices) {
@@ -6976,7 +6979,7 @@ function createVttLoader() {
6976
6979
  if (!input2) {
6977
6980
  return "";
6978
6981
  }
6979
- const vtt = _optionalChain([_nodewebvtt2.default, 'access', _315 => _315.parse, 'call', _316 => _316(input2), 'optionalAccess', _317 => _317.cues]);
6982
+ const vtt = _optionalChain([_nodewebvtt2.default, 'access', _316 => _316.parse, 'call', _317 => _317(input2), 'optionalAccess', _318 => _318.cues]);
6980
6983
  if (Object.keys(vtt).length === 0) {
6981
6984
  return {};
6982
6985
  } else {
@@ -7030,7 +7033,7 @@ function variableExtractLoader(params) {
7030
7033
  for (let i = 0; i < matches.length; i++) {
7031
7034
  const match2 = matches[i];
7032
7035
  const currentValue = result[key].value;
7033
- const newValue = _optionalChain([currentValue, 'optionalAccess', _318 => _318.replace, 'call', _319 => _319(match2, `{variable:${i}}`)]);
7036
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _319 => _319.replace, 'call', _320 => _320(match2, `{variable:${i}}`)]);
7034
7037
  result[key].value = newValue;
7035
7038
  result[key].variables[i] = match2;
7036
7039
  }
@@ -7045,7 +7048,7 @@ function variableExtractLoader(params) {
7045
7048
  const variable = valueObj.variables[i];
7046
7049
  const currentValue = result[key];
7047
7050
  if (typeof currentValue === "string") {
7048
- const newValue = _optionalChain([currentValue, 'optionalAccess', _320 => _320.replaceAll, 'call', _321 => _321(
7051
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _321 => _321.replaceAll, 'call', _322 => _322(
7049
7052
  `{variable:${i}}`,
7050
7053
  variable
7051
7054
  )]);
@@ -7249,7 +7252,7 @@ function createVueJsonLoader() {
7249
7252
  return createLoader({
7250
7253
  pull: async (locale, input2, ctx) => {
7251
7254
  const parsed = parseVueFile(input2);
7252
- return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _322 => _322.i18n, 'optionalAccess', _323 => _323[locale]]), () => ( {}));
7255
+ return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _323 => _323.i18n, 'optionalAccess', _324 => _324[locale]]), () => ( {}));
7253
7256
  },
7254
7257
  push: async (locale, data, originalInput) => {
7255
7258
  const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
@@ -7434,7 +7437,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
7434
7437
  objectExpression.properties.forEach((prop) => {
7435
7438
  if (!t.isObjectProperty(prop)) return;
7436
7439
  const key = getPropertyKey(prop);
7437
- const incomingVal = _optionalChain([data, 'optionalAccess', _324 => _324[key]]);
7440
+ const incomingVal = _optionalChain([data, 'optionalAccess', _325 => _325[key]]);
7438
7441
  if (incomingVal === void 0) {
7439
7442
  return;
7440
7443
  }
@@ -7470,7 +7473,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
7470
7473
  let modified = false;
7471
7474
  arrayExpression.elements.forEach((element, index) => {
7472
7475
  if (!element) return;
7473
- const incomingVal = _optionalChain([incoming, 'optionalAccess', _325 => _325[index]]);
7476
+ const incomingVal = _optionalChain([incoming, 'optionalAccess', _326 => _326[index]]);
7474
7477
  if (incomingVal === void 0) return;
7475
7478
  if (t.isStringLiteral(element) && typeof incomingVal === "string") {
7476
7479
  if (element.value !== incomingVal) {
@@ -7964,7 +7967,7 @@ var AST = class _AST {
7964
7967
  const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
7965
7968
  if (this.isStart() && !this.type)
7966
7969
  ret.unshift([]);
7967
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _326 => _326.#parent, 'optionalAccess', _327 => _327.type]) === "!")) {
7970
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _327 => _327.#parent, 'optionalAccess', _328 => _328.type]) === "!")) {
7968
7971
  ret.push({});
7969
7972
  }
7970
7973
  return ret;
@@ -7972,7 +7975,7 @@ var AST = class _AST {
7972
7975
  isStart() {
7973
7976
  if (this.#root === this)
7974
7977
  return true;
7975
- if (!_optionalChain([this, 'access', _328 => _328.#parent, 'optionalAccess', _329 => _329.isStart, 'call', _330 => _330()]))
7978
+ if (!_optionalChain([this, 'access', _329 => _329.#parent, 'optionalAccess', _330 => _330.isStart, 'call', _331 => _331()]))
7976
7979
  return false;
7977
7980
  if (this.#parentIndex === 0)
7978
7981
  return true;
@@ -7988,12 +7991,12 @@ var AST = class _AST {
7988
7991
  isEnd() {
7989
7992
  if (this.#root === this)
7990
7993
  return true;
7991
- if (_optionalChain([this, 'access', _331 => _331.#parent, 'optionalAccess', _332 => _332.type]) === "!")
7994
+ if (_optionalChain([this, 'access', _332 => _332.#parent, 'optionalAccess', _333 => _333.type]) === "!")
7992
7995
  return true;
7993
- if (!_optionalChain([this, 'access', _333 => _333.#parent, 'optionalAccess', _334 => _334.isEnd, 'call', _335 => _335()]))
7996
+ if (!_optionalChain([this, 'access', _334 => _334.#parent, 'optionalAccess', _335 => _335.isEnd, 'call', _336 => _336()]))
7994
7997
  return false;
7995
7998
  if (!this.type)
7996
- return _optionalChain([this, 'access', _336 => _336.#parent, 'optionalAccess', _337 => _337.isEnd, 'call', _338 => _338()]);
7999
+ return _optionalChain([this, 'access', _337 => _337.#parent, 'optionalAccess', _338 => _338.isEnd, 'call', _339 => _339()]);
7997
8000
  const pl = this.#parent ? this.#parent.#parts.length : 0;
7998
8001
  return this.#parentIndex === pl - 1;
7999
8002
  }
@@ -8215,7 +8218,7 @@ var AST = class _AST {
8215
8218
  if (!this.type) {
8216
8219
  const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
8217
8220
  const src = this.#parts.map((p) => {
8218
- const [re, _37, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
8221
+ const [re, _38, hasMagic, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
8219
8222
  this.#hasMagic = this.#hasMagic || hasMagic;
8220
8223
  this.#uflag = this.#uflag || uflag;
8221
8224
  return re;
@@ -8238,7 +8241,7 @@ var AST = class _AST {
8238
8241
  }
8239
8242
  }
8240
8243
  let end = "";
8241
- if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _339 => _339.#parent, 'optionalAccess', _340 => _340.type]) === "!") {
8244
+ if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _340 => _340.#parent, 'optionalAccess', _341 => _341.type]) === "!") {
8242
8245
  end = "(?:$|\\/)";
8243
8246
  }
8244
8247
  const final2 = start2 + src + end;
@@ -8288,7 +8291,7 @@ var AST = class _AST {
8288
8291
  if (typeof p === "string") {
8289
8292
  throw new Error("string type in extglob ast??");
8290
8293
  }
8291
- const [re, _37, _hasMagic, uflag] = p.toRegExpSource(dot);
8294
+ const [re, _38, _hasMagic, uflag] = p.toRegExpSource(dot);
8292
8295
  this.#uflag = this.#uflag || uflag;
8293
8296
  return re;
8294
8297
  }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
@@ -8533,7 +8536,7 @@ var Minimatch = class {
8533
8536
  }
8534
8537
  return false;
8535
8538
  }
8536
- debug(..._37) {
8539
+ debug(..._38) {
8537
8540
  }
8538
8541
  make() {
8539
8542
  const pattern = this.pattern;
@@ -8555,7 +8558,7 @@ var Minimatch = class {
8555
8558
  const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
8556
8559
  this.globParts = this.preprocess(rawGlobParts);
8557
8560
  this.debug(this.pattern, this.globParts);
8558
- let set = this.globParts.map((s, _37, __) => {
8561
+ let set = this.globParts.map((s, _38, __) => {
8559
8562
  if (this.isWindows && this.windowsNoMagicRoot) {
8560
8563
  const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
8561
8564
  const isDrive = /^[a-z]:/i.test(s[0]);
@@ -9339,7 +9342,7 @@ function createMdxSectionsSplit2Loader() {
9339
9342
  const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
9340
9343
  const result = {
9341
9344
  frontmatter: data.frontmatter,
9342
- codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _341 => _341.codePlaceholders]) || {},
9345
+ codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _342 => _342.codePlaceholders]) || {},
9343
9346
  content
9344
9347
  };
9345
9348
  return result;
@@ -9422,6 +9425,26 @@ function createIgnoredKeysLoader(ignoredKeys) {
9422
9425
  });
9423
9426
  }
9424
9427
 
9428
+ // src/cli/loaders/preserved-keys.ts
9429
+
9430
+ function createPreservedKeysLoader(preservedKeys) {
9431
+ return createLoader({
9432
+ pull: async (_locale, data) => {
9433
+ return _lodash2.default.pickBy(
9434
+ data,
9435
+ (_value, key) => !matchesKeyPattern(key, preservedKeys)
9436
+ );
9437
+ },
9438
+ push: async (_locale, data, originalInput, _originalLocale, pullInput) => {
9439
+ const preservedSubObject = _lodash2.default.chain(originalInput).pickBy((_value, key) => matchesKeyPattern(key, preservedKeys)).mapValues((sourceValue, key) => {
9440
+ const targetValue = _optionalChain([pullInput, 'optionalAccess', _343 => _343[key]]);
9441
+ return targetValue !== void 0 ? targetValue : sourceValue;
9442
+ }).value();
9443
+ return _lodash2.default.merge({}, data, preservedSubObject);
9444
+ }
9445
+ });
9446
+ }
9447
+
9425
9448
  // src/cli/loaders/ejs.ts
9426
9449
  function parseEjsForTranslation(input2) {
9427
9450
  const translatable = {};
@@ -9582,7 +9605,7 @@ function createTwigLoader() {
9582
9605
  };
9583
9606
  }
9584
9607
  function postprocessTwig(text, twigBlocks) {
9585
- return text.replace(/__TWIG_BLOCK_(\d+)__/g, (_37, index) => {
9608
+ return text.replace(/__TWIG_BLOCK_(\d+)__/g, (_38, index) => {
9586
9609
  return twigBlocks[parseInt(index, 10)] || "";
9587
9610
  });
9588
9611
  }
@@ -9609,7 +9632,7 @@ function createTwigLoader() {
9609
9632
  const attrs = LOCALIZABLE_ATTRIBUTES2[tagName];
9610
9633
  if (!attrs) return;
9611
9634
  for (const attr of attrs) {
9612
- const value = _optionalChain([element, 'access', _342 => _342.attribs, 'optionalAccess', _343 => _343[attr]]);
9635
+ const value = _optionalChain([element, 'access', _344 => _344.attribs, 'optionalAccess', _345 => _345[attr]]);
9613
9636
  if (value && value.trim()) {
9614
9637
  const restoredValue = postprocessTwig(value.trim(), twigBlocks);
9615
9638
  result[`${path20}#${attr}`] = restoredValue;
@@ -9820,7 +9843,7 @@ function createTxtLoader() {
9820
9843
  const sortedEntries = Object.entries(payload).sort(
9821
9844
  ([a], [b]) => parseInt(a) - parseInt(b)
9822
9845
  );
9823
- return sortedEntries.map(([_37, value]) => value).join("\n");
9846
+ return sortedEntries.map(([_38, value]) => value).join("\n");
9824
9847
  }
9825
9848
  });
9826
9849
  }
@@ -9930,7 +9953,7 @@ function dedupeHeaders(headers) {
9930
9953
  function createCsvPerLocaleLoader() {
9931
9954
  return createLoader({
9932
9955
  async pull(_locale, input2) {
9933
- if (!_optionalChain([input2, 'optionalAccess', _344 => _344.trim, 'call', _345 => _345()])) return {};
9956
+ if (!_optionalChain([input2, 'optionalAccess', _346 => _346.trim, 'call', _347 => _347()])) return {};
9934
9957
  const parsed = _sync.parse.call(void 0, input2, {
9935
9958
  skip_empty_lines: true,
9936
9959
  columns: (headers) => {
@@ -9977,7 +10000,7 @@ function normalizeCsvPatterns(patterns) {
9977
10000
  return `*/${pattern}`;
9978
10001
  });
9979
10002
  }
9980
- function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys, lockedPatterns, ignoredKeys) {
10003
+ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys, lockedPatterns, ignoredKeys, preservedKeys) {
9981
10004
  switch (bucketType) {
9982
10005
  default:
9983
10006
  throw new Error(`Unsupported bucket type: ${bucketType}`);
@@ -9990,6 +10013,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
9990
10013
  createFlatLoader(),
9991
10014
  createLockedKeysLoader(lockedKeys || []),
9992
10015
  createIgnoredKeysLoader(ignoredKeys || []),
10016
+ createPreservedKeysLoader(preservedKeys || []),
9993
10017
  createSyncLoader(),
9994
10018
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
9995
10019
  );
@@ -10002,6 +10026,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10002
10026
  createFlatLoader(),
10003
10027
  createLockedKeysLoader(lockedKeys || []),
10004
10028
  createIgnoredKeysLoader(ignoredKeys || []),
10029
+ createPreservedKeysLoader(preservedKeys || []),
10005
10030
  createSyncLoader(),
10006
10031
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10007
10032
  );
@@ -10014,6 +10039,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10014
10039
  createFlatLoader(),
10015
10040
  createLockedKeysLoader(lockedKeys || []),
10016
10041
  createIgnoredKeysLoader(ignoredKeys || []),
10042
+ createPreservedKeysLoader(preservedKeys || []),
10017
10043
  createSyncLoader(),
10018
10044
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10019
10045
  );
@@ -10026,6 +10052,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10026
10052
  createFlatLoader(),
10027
10053
  createLockedKeysLoader(normalizeCsvPatterns(lockedKeys || [])),
10028
10054
  createIgnoredKeysLoader(normalizeCsvPatterns(ignoredKeys || [])),
10055
+ createPreservedKeysLoader(normalizeCsvPatterns(preservedKeys || [])),
10029
10056
  createSyncLoader(),
10030
10057
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10031
10058
  );
@@ -10037,6 +10064,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10037
10064
  createHtmlLoader(),
10038
10065
  createLockedKeysLoader(lockedKeys || []),
10039
10066
  createIgnoredKeysLoader(ignoredKeys || []),
10067
+ createPreservedKeysLoader(preservedKeys || []),
10040
10068
  createSyncLoader(),
10041
10069
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10042
10070
  );
@@ -10047,6 +10075,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10047
10075
  createEjsLoader(),
10048
10076
  createLockedKeysLoader(lockedKeys || []),
10049
10077
  createIgnoredKeysLoader(ignoredKeys || []),
10078
+ createPreservedKeysLoader(preservedKeys || []),
10050
10079
  createSyncLoader(),
10051
10080
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10052
10081
  );
@@ -10061,6 +10090,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10061
10090
  createInjectLocaleLoader(options.injectLocale),
10062
10091
  createLockedKeysLoader(lockedKeys || []),
10063
10092
  createIgnoredKeysLoader(ignoredKeys || []),
10093
+ createPreservedKeysLoader(preservedKeys || []),
10064
10094
  createSyncLoader(),
10065
10095
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10066
10096
  );
@@ -10074,6 +10104,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10074
10104
  createInjectLocaleLoader(options.injectLocale),
10075
10105
  createLockedKeysLoader(lockedKeys || []),
10076
10106
  createIgnoredKeysLoader(ignoredKeys || []),
10107
+ createPreservedKeysLoader(preservedKeys || []),
10077
10108
  createSyncLoader(),
10078
10109
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10079
10110
  );
@@ -10087,6 +10118,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10087
10118
  createInjectLocaleLoader(options.injectLocale),
10088
10119
  createLockedKeysLoader(lockedKeys || []),
10089
10120
  createIgnoredKeysLoader(ignoredKeys || []),
10121
+ createPreservedKeysLoader(preservedKeys || []),
10090
10122
  createSyncLoader(),
10091
10123
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10092
10124
  );
@@ -10098,6 +10130,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10098
10130
  createMarkdownLoader(),
10099
10131
  createLockedKeysLoader(lockedKeys || []),
10100
10132
  createIgnoredKeysLoader(ignoredKeys || []),
10133
+ createPreservedKeysLoader(preservedKeys || []),
10101
10134
  createSyncLoader(),
10102
10135
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10103
10136
  );
@@ -10110,6 +10143,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10110
10143
  createEnsureKeyOrderLoader(),
10111
10144
  createLockedKeysLoader(lockedKeys || []),
10112
10145
  createIgnoredKeysLoader(ignoredKeys || []),
10146
+ createPreservedKeysLoader(preservedKeys || []),
10113
10147
  createSyncLoader(),
10114
10148
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10115
10149
  );
@@ -10126,6 +10160,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10126
10160
  createEnsureKeyOrderLoader(),
10127
10161
  createLockedKeysLoader(lockedKeys || []),
10128
10162
  createIgnoredKeysLoader(ignoredKeys || []),
10163
+ createPreservedKeysLoader(preservedKeys || []),
10129
10164
  createSyncLoader(),
10130
10165
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10131
10166
  );
@@ -10137,6 +10172,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10137
10172
  createMjmlLoader(),
10138
10173
  createLockedKeysLoader(lockedKeys || []),
10139
10174
  createIgnoredKeysLoader(ignoredKeys || []),
10175
+ createPreservedKeysLoader(preservedKeys || []),
10140
10176
  createSyncLoader(),
10141
10177
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10142
10178
  );
@@ -10149,6 +10185,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10149
10185
  createEnsureKeyOrderLoader(),
10150
10186
  createLockedKeysLoader(lockedKeys || []),
10151
10187
  createIgnoredKeysLoader(ignoredKeys || []),
10188
+ createPreservedKeysLoader(preservedKeys || []),
10152
10189
  createSyncLoader(),
10153
10190
  createVariableLoader({ type: "python" }),
10154
10191
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
@@ -10160,6 +10197,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10160
10197
  createPropertiesLoader(),
10161
10198
  createLockedKeysLoader(lockedKeys || []),
10162
10199
  createIgnoredKeysLoader(ignoredKeys || []),
10200
+ createPreservedKeysLoader(preservedKeys || []),
10163
10201
  createSyncLoader(),
10164
10202
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10165
10203
  );
@@ -10170,6 +10208,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10170
10208
  createXcodeStringsLoader(),
10171
10209
  createLockedKeysLoader(lockedKeys || []),
10172
10210
  createIgnoredKeysLoader(ignoredKeys || []),
10211
+ createPreservedKeysLoader(preservedKeys || []),
10173
10212
  createSyncLoader(),
10174
10213
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10175
10214
  );
@@ -10182,6 +10221,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10182
10221
  createEnsureKeyOrderLoader(),
10183
10222
  createLockedKeysLoader(lockedKeys || []),
10184
10223
  createIgnoredKeysLoader(ignoredKeys || []),
10224
+ createPreservedKeysLoader(preservedKeys || []),
10185
10225
  createSyncLoader(),
10186
10226
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10187
10227
  );
@@ -10196,6 +10236,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10196
10236
  createEnsureKeyOrderLoader(),
10197
10237
  createLockedKeysLoader(encodeKeys(lockedKeys || [])),
10198
10238
  createIgnoredKeysLoader(encodeKeys(ignoredKeys || [])),
10239
+ createPreservedKeysLoader(encodeKeys(preservedKeys || [])),
10199
10240
  createSyncLoader(),
10200
10241
  createVariableLoader({ type: "ieee" }),
10201
10242
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
@@ -10211,6 +10252,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10211
10252
  createEnsureKeyOrderLoader(),
10212
10253
  createLockedKeysLoader(encodeKeys(lockedKeys || [])),
10213
10254
  createIgnoredKeysLoader(encodeKeys(ignoredKeys || [])),
10255
+ createPreservedKeysLoader(encodeKeys(preservedKeys || [])),
10214
10256
  createSyncLoader(),
10215
10257
  createVariableLoader({ type: "ieee" }),
10216
10258
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
@@ -10225,6 +10267,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10225
10267
  createEnsureKeyOrderLoader(),
10226
10268
  createLockedKeysLoader(lockedKeys || []),
10227
10269
  createIgnoredKeysLoader(ignoredKeys || []),
10270
+ createPreservedKeysLoader(preservedKeys || []),
10228
10271
  createSyncLoader(),
10229
10272
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10230
10273
  );
@@ -10239,6 +10282,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10239
10282
  createEnsureKeyOrderLoader(),
10240
10283
  createLockedKeysLoader(lockedKeys || []),
10241
10284
  createIgnoredKeysLoader(ignoredKeys || []),
10285
+ createPreservedKeysLoader(preservedKeys || []),
10242
10286
  createSyncLoader(),
10243
10287
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10244
10288
  );
@@ -10253,6 +10297,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10253
10297
  createFlatLoader(),
10254
10298
  createLockedKeysLoader(lockedKeys || []),
10255
10299
  createIgnoredKeysLoader(ignoredKeys || []),
10300
+ createPreservedKeysLoader(preservedKeys || []),
10256
10301
  createSyncLoader(),
10257
10302
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10258
10303
  );
@@ -10265,6 +10310,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10265
10310
  createEnsureKeyOrderLoader(),
10266
10311
  createLockedKeysLoader(lockedKeys || []),
10267
10312
  createIgnoredKeysLoader(ignoredKeys || []),
10313
+ createPreservedKeysLoader(preservedKeys || []),
10268
10314
  createSyncLoader(),
10269
10315
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10270
10316
  );
@@ -10277,6 +10323,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10277
10323
  createEnsureKeyOrderLoader(),
10278
10324
  createLockedKeysLoader(lockedKeys || []),
10279
10325
  createIgnoredKeysLoader(ignoredKeys || []),
10326
+ createPreservedKeysLoader(preservedKeys || []),
10280
10327
  createSyncLoader(),
10281
10328
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10282
10329
  );
@@ -10287,6 +10334,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10287
10334
  createSrtLoader(),
10288
10335
  createLockedKeysLoader(lockedKeys || []),
10289
10336
  createIgnoredKeysLoader(ignoredKeys || []),
10337
+ createPreservedKeysLoader(preservedKeys || []),
10290
10338
  createSyncLoader(),
10291
10339
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10292
10340
  );
@@ -10298,6 +10346,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10298
10346
  createEnsureKeyOrderLoader(),
10299
10347
  createLockedKeysLoader(lockedKeys || []),
10300
10348
  createIgnoredKeysLoader(ignoredKeys || []),
10349
+ createPreservedKeysLoader(preservedKeys || []),
10301
10350
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10302
10351
  );
10303
10352
  case "vtt":
@@ -10307,6 +10356,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10307
10356
  createVttLoader(),
10308
10357
  createLockedKeysLoader(lockedKeys || []),
10309
10358
  createIgnoredKeysLoader(ignoredKeys || []),
10359
+ createPreservedKeysLoader(preservedKeys || []),
10310
10360
  createSyncLoader(),
10311
10361
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10312
10362
  );
@@ -10320,6 +10370,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10320
10370
  createEnsureKeyOrderLoader(),
10321
10371
  createLockedKeysLoader(lockedKeys || []),
10322
10372
  createIgnoredKeysLoader(ignoredKeys || []),
10373
+ createPreservedKeysLoader(preservedKeys || []),
10323
10374
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10324
10375
  );
10325
10376
  case "vue-json":
@@ -10332,6 +10383,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10332
10383
  createEnsureKeyOrderLoader(),
10333
10384
  createLockedKeysLoader(lockedKeys || []),
10334
10385
  createIgnoredKeysLoader(ignoredKeys || []),
10386
+ createPreservedKeysLoader(preservedKeys || []),
10335
10387
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10336
10388
  );
10337
10389
  case "typescript":
@@ -10349,6 +10401,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10349
10401
  createSyncLoader(),
10350
10402
  createLockedKeysLoader(lockedKeys || []),
10351
10403
  createIgnoredKeysLoader(ignoredKeys || []),
10404
+ createPreservedKeysLoader(preservedKeys || []),
10352
10405
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10353
10406
  );
10354
10407
  case "twig":
@@ -10358,6 +10411,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10358
10411
  createTwigLoader(),
10359
10412
  createLockedKeysLoader(lockedKeys || []),
10360
10413
  createIgnoredKeysLoader(ignoredKeys || []),
10414
+ createPreservedKeysLoader(preservedKeys || []),
10361
10415
  createSyncLoader(),
10362
10416
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10363
10417
  );
@@ -10368,6 +10422,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10368
10422
  createTxtLoader(),
10369
10423
  createLockedKeysLoader(lockedKeys || []),
10370
10424
  createIgnoredKeysLoader(ignoredKeys || []),
10425
+ createPreservedKeysLoader(preservedKeys || []),
10371
10426
  createSyncLoader(),
10372
10427
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10373
10428
  );
@@ -10383,6 +10438,7 @@ function createBucketLoader(bucketType, bucketPathPattern, options, lockedKeys,
10383
10438
  createInjectLocaleLoader(options.injectLocale),
10384
10439
  createLockedKeysLoader(lockedKeys || []),
10385
10440
  createIgnoredKeysLoader(ignoredKeys || []),
10441
+ createPreservedKeysLoader(preservedKeys || []),
10386
10442
  createSyncLoader(),
10387
10443
  createUnlocalizableLoader(options.returnUnlocalizedKeys)
10388
10444
  );
@@ -10760,7 +10816,7 @@ function createBasicTranslator(model, systemPrompt, settings = {}) {
10760
10816
  ]
10761
10817
  });
10762
10818
  const result = JSON.parse(response.text);
10763
- return _optionalChain([result, 'optionalAccess', _346 => _346.data]) || {};
10819
+ return _optionalChain([result, 'optionalAccess', _348 => _348.data]) || {};
10764
10820
  }
10765
10821
  }
10766
10822
  function extractPayloadChunks(payload) {
@@ -10843,7 +10899,7 @@ function getPureModelProvider(provider) {
10843
10899
 
10844
10900
  ${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
10845
10901
  `;
10846
- switch (_optionalChain([provider, 'optionalAccess', _347 => _347.id])) {
10902
+ switch (_optionalChain([provider, 'optionalAccess', _349 => _349.id])) {
10847
10903
  case "openai": {
10848
10904
  if (!process.env.OPENAI_API_KEY) {
10849
10905
  throw new Error(
@@ -10901,7 +10957,7 @@ function getPureModelProvider(provider) {
10901
10957
  })(provider.model);
10902
10958
  }
10903
10959
  default: {
10904
- throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _348 => _348.id])));
10960
+ throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _350 => _350.id])));
10905
10961
  }
10906
10962
  }
10907
10963
  }
@@ -10990,7 +11046,7 @@ function parseGitUrl(url) {
10990
11046
  }
10991
11047
  const sshMatch = cleanUrl.match(/[@:]([^:/@]+\/[^:/@]+)$/);
10992
11048
  const httpsMatch = cleanUrl.match(/\/([^/]+\/[^/]+)$/);
10993
- const repoPath = _optionalChain([sshMatch, 'optionalAccess', _349 => _349[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _350 => _350[1]]);
11049
+ const repoPath = _optionalChain([sshMatch, 'optionalAccess', _351 => _351[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _352 => _352[1]]);
10994
11050
  if (!repoPath) return null;
10995
11051
  const org = extractOrg(repoPath);
10996
11052
  if (!org) return null;
@@ -11446,7 +11502,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11446
11502
  validateParams(i18nConfig, flags);
11447
11503
  ora.succeed("Localization configuration is valid");
11448
11504
  ora.start("Connecting to Lingo.dev Localization Engine...");
11449
- const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _351 => _351.provider]);
11505
+ const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _353 => _353.provider]);
11450
11506
  if (isByokMode) {
11451
11507
  email = null;
11452
11508
  ora.succeed("Using external provider (BYOK mode)");
@@ -11460,16 +11516,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11460
11516
  flags
11461
11517
  });
11462
11518
  let buckets = getBuckets(i18nConfig);
11463
- if (_optionalChain([flags, 'access', _352 => _352.bucket, 'optionalAccess', _353 => _353.length])) {
11519
+ if (_optionalChain([flags, 'access', _354 => _354.bucket, 'optionalAccess', _355 => _355.length])) {
11464
11520
  buckets = buckets.filter(
11465
11521
  (bucket) => flags.bucket.includes(bucket.type)
11466
11522
  );
11467
11523
  }
11468
11524
  ora.succeed("Buckets retrieved");
11469
- if (_optionalChain([flags, 'access', _354 => _354.file, 'optionalAccess', _355 => _355.length])) {
11525
+ if (_optionalChain([flags, 'access', _356 => _356.file, 'optionalAccess', _357 => _357.length])) {
11470
11526
  buckets = buckets.map((bucket) => {
11471
11527
  const paths = bucket.paths.filter(
11472
- (path20) => flags.file.find((file) => _optionalChain([path20, 'access', _356 => _356.pathPattern, 'optionalAccess', _357 => _357.includes, 'call', _358 => _358(file)]))
11528
+ (path20) => flags.file.find((file) => _optionalChain([path20, 'access', _358 => _358.pathPattern, 'optionalAccess', _359 => _359.includes, 'call', _360 => _360(file)]))
11473
11529
  );
11474
11530
  return { ...bucket, paths };
11475
11531
  }).filter((bucket) => bucket.paths.length > 0);
@@ -11490,7 +11546,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11490
11546
  });
11491
11547
  }
11492
11548
  }
11493
- const targetLocales = _optionalChain([flags, 'access', _359 => _359.locale, 'optionalAccess', _360 => _360.length]) ? flags.locale : i18nConfig.locale.targets;
11549
+ const targetLocales = _optionalChain([flags, 'access', _361 => _361.locale, 'optionalAccess', _362 => _362.length]) ? flags.locale : i18nConfig.locale.targets;
11494
11550
  ora.start("Setting up localization cache...");
11495
11551
  const checkLockfileProcessor = createDeltaProcessor("");
11496
11552
  const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
@@ -11667,7 +11723,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11667
11723
  if (flags.key) {
11668
11724
  processableData = _lodash2.default.pickBy(
11669
11725
  processableData,
11670
- (_37, key) => key === flags.key
11726
+ (_38, key) => key === flags.key
11671
11727
  );
11672
11728
  }
11673
11729
  if (flags.verbose) {
@@ -11776,7 +11832,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11776
11832
  }
11777
11833
  const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
11778
11834
  const checksums = await deltaProcessor.createChecksums(sourceData);
11779
- if (!_optionalChain([flags, 'access', _361 => _361.locale, 'optionalAccess', _362 => _362.length])) {
11835
+ if (!_optionalChain([flags, 'access', _363 => _363.locale, 'optionalAccess', _364 => _364.length])) {
11780
11836
  await deltaProcessor.saveChecksums(checksums);
11781
11837
  }
11782
11838
  }
@@ -11903,12 +11959,12 @@ function validateParams(i18nConfig, flags) {
11903
11959
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
11904
11960
  docUrl: "bucketNotFound"
11905
11961
  });
11906
- } else if (_optionalChain([flags, 'access', _363 => _363.locale, 'optionalAccess', _364 => _364.some, 'call', _365 => _365((locale) => !i18nConfig.locale.targets.includes(locale))])) {
11962
+ } else if (_optionalChain([flags, 'access', _365 => _365.locale, 'optionalAccess', _366 => _366.some, 'call', _367 => _367((locale) => !i18nConfig.locale.targets.includes(locale))])) {
11907
11963
  throw new ValidationError({
11908
11964
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
11909
11965
  docUrl: "localeTargetNotFound"
11910
11966
  });
11911
- } else if (_optionalChain([flags, 'access', _366 => _366.bucket, 'optionalAccess', _367 => _367.some, 'call', _368 => _368(
11967
+ } else if (_optionalChain([flags, 'access', _368 => _368.bucket, 'optionalAccess', _369 => _369.some, 'call', _370 => _370(
11912
11968
  (bucket) => !i18nConfig.buckets[bucket]
11913
11969
  )])) {
11914
11970
  throw new ValidationError({
@@ -12306,7 +12362,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
12306
12362
  const response = await engine.whoami();
12307
12363
  return {
12308
12364
  authenticated: !!response,
12309
- username: _optionalChain([response, 'optionalAccess', _369 => _369.email])
12365
+ username: _optionalChain([response, 'optionalAccess', _371 => _371.email])
12310
12366
  };
12311
12367
  } catch (error) {
12312
12368
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -12448,7 +12504,7 @@ function countWordsInRecord2(payload) {
12448
12504
  }
12449
12505
  function createLingoDotDevVNextLocalizer(processId) {
12450
12506
  const settings = getSettings(void 0);
12451
- const apiKey = process.env.LINGO_API_KEY || _optionalChain([settings, 'access', _370 => _370.auth, 'access', _371 => _371.vnext, 'optionalAccess', _372 => _372.apiKey]);
12507
+ const apiKey = process.env.LINGO_API_KEY || _optionalChain([settings, 'access', _372 => _372.auth, 'access', _373 => _373.vnext, 'optionalAccess', _374 => _374.apiKey]);
12452
12508
  if (!apiKey) {
12453
12509
  throw new Error(
12454
12510
  _dedent2.default`
@@ -12475,7 +12531,7 @@ function createLingoDotDevVNextLocalizer(processId) {
12475
12531
  const response = await engine.whoami();
12476
12532
  return {
12477
12533
  authenticated: !!response,
12478
- username: _optionalChain([response, 'optionalAccess', _373 => _373.email])
12534
+ username: _optionalChain([response, 'optionalAccess', _375 => _375.email])
12479
12535
  };
12480
12536
  } catch (error) {
12481
12537
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -12591,7 +12647,7 @@ function createExplicitLocalizer(provider) {
12591
12647
  }
12592
12648
  function createAiSdkLocalizer(params) {
12593
12649
  const skipAuth = params.skipAuth === true;
12594
- const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _374 => _374.apiKeyName]), () => ( ""))];
12650
+ const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _376 => _376.apiKeyName]), () => ( ""))];
12595
12651
  if (!skipAuth && (!apiKey || !params.apiKeyName)) {
12596
12652
  throw new Error(
12597
12653
  _dedent2.default`
@@ -12870,8 +12926,8 @@ async function setup(input2) {
12870
12926
  throw new Error(
12871
12927
  "No buckets found in i18n.json. Please add at least one bucket containing i18n content."
12872
12928
  );
12873
- } else if (_optionalChain([ctx, 'access', _375 => _375.flags, 'access', _376 => _376.bucket, 'optionalAccess', _377 => _377.some, 'call', _378 => _378(
12874
- (bucket) => !_optionalChain([ctx, 'access', _379 => _379.config, 'optionalAccess', _380 => _380.buckets, 'access', _381 => _381[bucket]])
12929
+ } else if (_optionalChain([ctx, 'access', _377 => _377.flags, 'access', _378 => _378.bucket, 'optionalAccess', _379 => _379.some, 'call', _380 => _380(
12930
+ (bucket) => !_optionalChain([ctx, 'access', _381 => _381.config, 'optionalAccess', _382 => _382.buckets, 'access', _383 => _383[bucket]])
12875
12931
  )])) {
12876
12932
  throw new Error(
12877
12933
  `One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
@@ -12883,8 +12939,8 @@ async function setup(input2) {
12883
12939
  {
12884
12940
  title: "Selecting localization provider",
12885
12941
  task: async (ctx, task) => {
12886
- const provider = ctx.flags.pseudo ? "pseudo" : _optionalChain([ctx, 'access', _382 => _382.config, 'optionalAccess', _383 => _383.provider]);
12887
- const vNext = _optionalChain([ctx, 'access', _384 => _384.config, 'optionalAccess', _385 => _385.vNext]);
12942
+ const provider = ctx.flags.pseudo ? "pseudo" : _optionalChain([ctx, 'access', _384 => _384.config, 'optionalAccess', _385 => _385.provider]);
12943
+ const vNext = _optionalChain([ctx, 'access', _386 => _386.config, 'optionalAccess', _387 => _387.vNext]);
12888
12944
  ctx.localizer = createLocalizer(provider, ctx.flags.apiKey, vNext);
12889
12945
  if (!ctx.localizer) {
12890
12946
  throw new Error(
@@ -12896,7 +12952,7 @@ async function setup(input2) {
12896
12952
  },
12897
12953
  {
12898
12954
  title: "Checking authentication",
12899
- enabled: (ctx) => (_optionalChain([ctx, 'access', _386 => _386.localizer, 'optionalAccess', _387 => _387.id]) === "Lingo.dev" || _optionalChain([ctx, 'access', _388 => _388.localizer, 'optionalAccess', _389 => _389.id]) === "Lingo.dev vNext") && !ctx.flags.pseudo,
12955
+ enabled: (ctx) => (_optionalChain([ctx, 'access', _388 => _388.localizer, 'optionalAccess', _389 => _389.id]) === "Lingo.dev" || _optionalChain([ctx, 'access', _390 => _390.localizer, 'optionalAccess', _391 => _391.id]) === "Lingo.dev vNext") && !ctx.flags.pseudo,
12900
12956
  task: async (ctx, task) => {
12901
12957
  const authStatus = await ctx.localizer.checkAuth();
12902
12958
  if (!authStatus.authenticated) {
@@ -12909,7 +12965,7 @@ async function setup(input2) {
12909
12965
  },
12910
12966
  {
12911
12967
  title: "Validating configuration",
12912
- enabled: (ctx) => _optionalChain([ctx, 'access', _390 => _390.localizer, 'optionalAccess', _391 => _391.id]) !== "Lingo.dev" && _optionalChain([ctx, 'access', _392 => _392.localizer, 'optionalAccess', _393 => _393.id]) !== "Lingo.dev vNext",
12968
+ enabled: (ctx) => _optionalChain([ctx, 'access', _392 => _392.localizer, 'optionalAccess', _393 => _393.id]) !== "Lingo.dev" && _optionalChain([ctx, 'access', _394 => _394.localizer, 'optionalAccess', _395 => _395.id]) !== "Lingo.dev vNext",
12913
12969
  task: async (ctx, task) => {
12914
12970
  const validationStatus = await ctx.localizer.validateSettings();
12915
12971
  if (!validationStatus.valid) {
@@ -13059,6 +13115,7 @@ async function plan(input2) {
13059
13115
  lockedKeys: bucket.lockedKeys || [],
13060
13116
  lockedPatterns: bucket.lockedPatterns || [],
13061
13117
  ignoredKeys: bucket.ignoredKeys || [],
13118
+ preservedKeys: bucket.preservedKeys || [],
13062
13119
  onlyKeys: input2.flags.key || [],
13063
13120
  formatter: input2.config.formatter
13064
13121
  });
@@ -13139,7 +13196,7 @@ async function execute(input2) {
13139
13196
  const workerTasks = [];
13140
13197
  for (let i = 0; i < workersCount; i++) {
13141
13198
  const assignedTasks = ctx.tasks.filter(
13142
- (_37, idx) => idx % workersCount === i
13199
+ (_38, idx) => idx % workersCount === i
13143
13200
  );
13144
13201
  workerTasks.push(
13145
13202
  createWorkerTask({
@@ -13211,7 +13268,8 @@ function createLoaderForTask(assignedTask) {
13211
13268
  },
13212
13269
  assignedTask.lockedKeys,
13213
13270
  assignedTask.lockedPatterns,
13214
- assignedTask.ignoredKeys
13271
+ assignedTask.ignoredKeys,
13272
+ assignedTask.preservedKeys
13215
13273
  );
13216
13274
  bucketLoader.setDefaultLocale(assignedTask.sourceLocale);
13217
13275
  return bucketLoader;
@@ -13252,7 +13310,7 @@ function createWorkerTask(args) {
13252
13310
  const processableData = _lodash2.default.chain(sourceData).entries().filter(
13253
13311
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
13254
13312
  ).filter(
13255
- ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _394 => _394.onlyKeys, 'optionalAccess', _395 => _395.some, 'call', _396 => _396(
13313
+ ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _396 => _396.onlyKeys, 'optionalAccess', _397 => _397.some, 'call', _398 => _398(
13256
13314
  (pattern) => minimatch(key, pattern)
13257
13315
  )])
13258
13316
  ).fromPairs().value();
@@ -13321,7 +13379,7 @@ function createWorkerTask(args) {
13321
13379
  finalRenamedTargetData
13322
13380
  );
13323
13381
  const checksums = await deltaProcessor.createChecksums(sourceData);
13324
- if (!_optionalChain([args, 'access', _397 => _397.ctx, 'access', _398 => _398.flags, 'access', _399 => _399.targetLocale, 'optionalAccess', _400 => _400.length])) {
13382
+ if (!_optionalChain([args, 'access', _399 => _399.ctx, 'access', _400 => _400.flags, 'access', _401 => _401.targetLocale, 'optionalAccess', _402 => _402.length])) {
13325
13383
  await deltaProcessor.saveChecksums(checksums);
13326
13384
  }
13327
13385
  });
@@ -13527,10 +13585,10 @@ var flagsSchema2 = _zod.z.object({
13527
13585
  async function frozen(input2) {
13528
13586
  console.log(_chalk2.default.hex(colors.orange)("[Frozen]"));
13529
13587
  let buckets = getBuckets(input2.config);
13530
- if (_optionalChain([input2, 'access', _401 => _401.flags, 'access', _402 => _402.bucket, 'optionalAccess', _403 => _403.length])) {
13588
+ if (_optionalChain([input2, 'access', _403 => _403.flags, 'access', _404 => _404.bucket, 'optionalAccess', _405 => _405.length])) {
13531
13589
  buckets = buckets.filter((b) => input2.flags.bucket.includes(b.type));
13532
13590
  }
13533
- if (_optionalChain([input2, 'access', _404 => _404.flags, 'access', _405 => _405.file, 'optionalAccess', _406 => _406.length])) {
13591
+ if (_optionalChain([input2, 'access', _406 => _406.flags, 'access', _407 => _407.file, 'optionalAccess', _408 => _408.length])) {
13534
13592
  buckets = buckets.map((bucket) => {
13535
13593
  const paths = bucket.paths.filter(
13536
13594
  (p) => input2.flags.file.some(
@@ -13566,7 +13624,8 @@ async function frozen(input2) {
13566
13624
  },
13567
13625
  bucket.lockedKeys,
13568
13626
  bucket.lockedPatterns,
13569
- bucket.ignoredKeys
13627
+ bucket.ignoredKeys,
13628
+ bucket.preservedKeys
13570
13629
  );
13571
13630
  loader.setDefaultLocale(resolvedSourceLocale);
13572
13631
  await loader.init();
@@ -13602,7 +13661,8 @@ async function frozen(input2) {
13602
13661
  },
13603
13662
  bucket.lockedKeys,
13604
13663
  bucket.lockedPatterns,
13605
- bucket.ignoredKeys
13664
+ bucket.ignoredKeys,
13665
+ bucket.preservedKeys
13606
13666
  );
13607
13667
  loader.setDefaultLocale(resolvedSourceLocale);
13608
13668
  await loader.init();
@@ -13667,13 +13727,13 @@ async function frozen(input2) {
13667
13727
 
13668
13728
  // src/cli/cmd/run/_utils.ts
13669
13729
  async function determineEmail(ctx) {
13670
- const isByokMode = !!_optionalChain([ctx, 'access', _407 => _407.config, 'optionalAccess', _408 => _408.provider]);
13730
+ const isByokMode = !!_optionalChain([ctx, 'access', _409 => _409.config, 'optionalAccess', _410 => _410.provider]);
13671
13731
  if (isByokMode) {
13672
13732
  return null;
13673
13733
  } else {
13674
13734
  try {
13675
- const authStatus = await _optionalChain([ctx, 'access', _409 => _409.localizer, 'optionalAccess', _410 => _410.checkAuth, 'call', _411 => _411()]);
13676
- return _optionalChain([authStatus, 'optionalAccess', _412 => _412.username]) || null;
13735
+ const authStatus = await _optionalChain([ctx, 'access', _411 => _411.localizer, 'optionalAccess', _412 => _412.checkAuth, 'call', _413 => _413()]);
13736
+ return _optionalChain([authStatus, 'optionalAccess', _414 => _414.username]) || null;
13677
13737
  } catch (e4) {
13678
13738
  return null;
13679
13739
  }
@@ -13896,7 +13956,7 @@ var InBranchFlow = class extends IntegrationFlow {
13896
13956
  }
13897
13957
  _child_process.execSync.call(void 0, `git config commit.gpgsign true`);
13898
13958
  }
13899
- _optionalChain([this, 'access', _413 => _413.platformKit, 'optionalAccess', _414 => _414.gitConfig, 'call', _415 => _415()]);
13959
+ _optionalChain([this, 'access', _415 => _415.platformKit, 'optionalAccess', _416 => _416.gitConfig, 'call', _417 => _417()]);
13900
13960
  _child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
13901
13961
  _child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
13902
13962
  if (!processOwnCommits) {
@@ -13928,7 +13988,7 @@ var InBranchFlow = class extends IntegrationFlow {
13928
13988
  // src/cli/cmd/ci/flows/pull-request.ts
13929
13989
  var PullRequestFlow = class extends InBranchFlow {
13930
13990
  async preRun() {
13931
- const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _416 => _416()]);
13991
+ const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _418 => _418()]);
13932
13992
  if (!canContinue) {
13933
13993
  return false;
13934
13994
  }
@@ -14201,10 +14261,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
14201
14261
  repo_slug: this.platformConfig.repositoryName,
14202
14262
  state: "OPEN"
14203
14263
  }).then(({ data: { values } }) => {
14204
- return _optionalChain([values, 'optionalAccess', _417 => _417.find, 'call', _418 => _418(
14205
- ({ source, destination }) => _optionalChain([source, 'optionalAccess', _419 => _419.branch, 'optionalAccess', _420 => _420.name]) === branch && _optionalChain([destination, 'optionalAccess', _421 => _421.branch, 'optionalAccess', _422 => _422.name]) === this.platformConfig.baseBranchName
14264
+ return _optionalChain([values, 'optionalAccess', _419 => _419.find, 'call', _420 => _420(
14265
+ ({ source, destination }) => _optionalChain([source, 'optionalAccess', _421 => _421.branch, 'optionalAccess', _422 => _422.name]) === branch && _optionalChain([destination, 'optionalAccess', _423 => _423.branch, 'optionalAccess', _424 => _424.name]) === this.platformConfig.baseBranchName
14206
14266
  )]);
14207
- }).then((pr) => _optionalChain([pr, 'optionalAccess', _423 => _423.id]));
14267
+ }).then((pr) => _optionalChain([pr, 'optionalAccess', _425 => _425.id]));
14208
14268
  }
14209
14269
  async closePullRequest({ pullRequestNumber }) {
14210
14270
  await this.bb.repositories.declinePullRequest({
@@ -14300,7 +14360,7 @@ var GitHubPlatformKit = class extends PlatformKit {
14300
14360
  repo: this.platformConfig.repositoryName,
14301
14361
  base: this.platformConfig.baseBranchName,
14302
14362
  state: "open"
14303
- }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _424 => _424.number]));
14363
+ }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _426 => _426.number]));
14304
14364
  }
14305
14365
  async closePullRequest({ pullRequestNumber }) {
14306
14366
  await this.octokit.rest.pulls.update({
@@ -14427,7 +14487,7 @@ var GitlabPlatformKit = class extends PlatformKit {
14427
14487
  sourceBranch: branch,
14428
14488
  state: "opened"
14429
14489
  });
14430
- return _optionalChain([mergeRequests, 'access', _425 => _425[0], 'optionalAccess', _426 => _426.iid]);
14490
+ return _optionalChain([mergeRequests, 'access', _427 => _427[0], 'optionalAccess', _428 => _428.iid]);
14431
14491
  }
14432
14492
  async closePullRequest({
14433
14493
  pullRequestNumber
@@ -14542,7 +14602,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
14542
14602
  }
14543
14603
  const env = {
14544
14604
  LINGODOTDEV_API_KEY: settings.auth.apiKey,
14545
- LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _427 => _427.pullRequest, 'optionalAccess', _428 => _428.toString, 'call', _429 => _429()]) || "false",
14605
+ LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _429 => _429.pullRequest, 'optionalAccess', _430 => _430.toString, 'call', _431 => _431()]) || "false",
14546
14606
  ...options.commitMessage && {
14547
14607
  LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
14548
14608
  },
@@ -14571,7 +14631,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
14571
14631
  const { isPullRequestMode } = platformKit.config;
14572
14632
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
14573
14633
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
14574
- const canRun = await _optionalChain([flow, 'access', _430 => _430.preRun, 'optionalCall', _431 => _431()]);
14634
+ const canRun = await _optionalChain([flow, 'access', _432 => _432.preRun, 'optionalCall', _433 => _433()]);
14575
14635
  if (canRun === false) {
14576
14636
  return;
14577
14637
  }
@@ -14581,7 +14641,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
14581
14641
  if (!hasChanges) {
14582
14642
  return;
14583
14643
  }
14584
- await _optionalChain([flow, 'access', _432 => _432.postRun, 'optionalCall', _433 => _433()]);
14644
+ await _optionalChain([flow, 'access', _434 => _434.postRun, 'optionalCall', _435 => _435()]);
14585
14645
  });
14586
14646
  function parseBooleanArg(val) {
14587
14647
  if (val === true) return true;
@@ -14618,8 +14678,8 @@ function exitGracefully(elapsedMs = 0) {
14618
14678
  }
14619
14679
  }
14620
14680
  function checkForPendingOperations() {
14621
- const activeHandles = _optionalChain([process, 'access', _434 => _434._getActiveHandles, 'optionalCall', _435 => _435()]) || [];
14622
- const activeRequests = _optionalChain([process, 'access', _436 => _436._getActiveRequests, 'optionalCall', _437 => _437()]) || [];
14681
+ const activeHandles = _optionalChain([process, 'access', _436 => _436._getActiveHandles, 'optionalCall', _437 => _437()]) || [];
14682
+ const activeRequests = _optionalChain([process, 'access', _438 => _438._getActiveRequests, 'optionalCall', _439 => _439()]) || [];
14623
14683
  const nonStandardHandles = activeHandles.filter((handle) => {
14624
14684
  if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
14625
14685
  return false;
@@ -14689,17 +14749,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
14689
14749
  });
14690
14750
  await new Promise((resolve) => setTimeout(resolve, 50));
14691
14751
  let buckets = getBuckets(i18nConfig);
14692
- if (_optionalChain([flags, 'access', _438 => _438.bucket, 'optionalAccess', _439 => _439.length])) {
14752
+ if (_optionalChain([flags, 'access', _440 => _440.bucket, 'optionalAccess', _441 => _441.length])) {
14693
14753
  buckets = buckets.filter(
14694
14754
  (bucket) => flags.bucket.includes(bucket.type)
14695
14755
  );
14696
14756
  }
14697
14757
  ora.succeed("Buckets retrieved");
14698
- if (_optionalChain([flags, 'access', _440 => _440.file, 'optionalAccess', _441 => _441.length])) {
14758
+ if (_optionalChain([flags, 'access', _442 => _442.file, 'optionalAccess', _443 => _443.length])) {
14699
14759
  buckets = buckets.map((bucket) => {
14700
14760
  const paths = bucket.paths.filter(
14701
14761
  (path20) => flags.file.find(
14702
- (file) => _optionalChain([path20, 'access', _442 => _442.pathPattern, 'optionalAccess', _443 => _443.includes, 'call', _444 => _444(file)]) || _optionalChain([path20, 'access', _445 => _445.pathPattern, 'optionalAccess', _446 => _446.match, 'call', _447 => _447(file)]) || minimatch(path20.pathPattern, file)
14762
+ (file) => _optionalChain([path20, 'access', _444 => _444.pathPattern, 'optionalAccess', _445 => _445.includes, 'call', _446 => _446(file)]) || _optionalChain([path20, 'access', _447 => _447.pathPattern, 'optionalAccess', _448 => _448.match, 'call', _449 => _449(file)]) || minimatch(path20.pathPattern, file)
14703
14763
  )
14704
14764
  );
14705
14765
  return { ...bucket, paths };
@@ -14719,7 +14779,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
14719
14779
  });
14720
14780
  }
14721
14781
  }
14722
- const targetLocales = _optionalChain([flags, 'access', _448 => _448.locale, 'optionalAccess', _449 => _449.length]) ? flags.locale : i18nConfig.locale.targets;
14782
+ const targetLocales = _optionalChain([flags, 'access', _450 => _450.locale, 'optionalAccess', _451 => _451.length]) ? flags.locale : i18nConfig.locale.targets;
14723
14783
  let totalSourceKeyCount = 0;
14724
14784
  let uniqueKeysToTranslate = 0;
14725
14785
  let totalExistingTranslations = 0;
@@ -15129,12 +15189,12 @@ function validateParams2(i18nConfig, flags) {
15129
15189
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
15130
15190
  docUrl: "bucketNotFound"
15131
15191
  });
15132
- } else if (_optionalChain([flags, 'access', _450 => _450.locale, 'optionalAccess', _451 => _451.some, 'call', _452 => _452((locale) => !i18nConfig.locale.targets.includes(locale))])) {
15192
+ } else if (_optionalChain([flags, 'access', _452 => _452.locale, 'optionalAccess', _453 => _453.some, 'call', _454 => _454((locale) => !i18nConfig.locale.targets.includes(locale))])) {
15133
15193
  throw new CLIError({
15134
15194
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
15135
15195
  docUrl: "localeTargetNotFound"
15136
15196
  });
15137
- } else if (_optionalChain([flags, 'access', _453 => _453.bucket, 'optionalAccess', _454 => _454.some, 'call', _455 => _455(
15197
+ } else if (_optionalChain([flags, 'access', _455 => _455.bucket, 'optionalAccess', _456 => _456.some, 'call', _457 => _457(
15138
15198
  (bucket) => !i18nConfig.buckets[bucket]
15139
15199
  )])) {
15140
15200
  throw new CLIError({
@@ -15226,7 +15286,7 @@ async function renderHero2() {
15226
15286
  // package.json
15227
15287
  var package_default = {
15228
15288
  name: "lingo.dev",
15229
- version: "0.130.0",
15289
+ version: "0.130.2",
15230
15290
  description: "Lingo.dev CLI",
15231
15291
  private: false,
15232
15292
  repository: {
@@ -15530,7 +15590,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
15530
15590
  if (options.file && options.file.length) {
15531
15591
  buckets = buckets.map((bucket) => {
15532
15592
  const paths = bucket.paths.filter(
15533
- (bucketPath) => _optionalChain([options, 'access', _456 => _456.file, 'optionalAccess', _457 => _457.some, 'call', _458 => _458((f) => bucketPath.pathPattern.includes(f))])
15593
+ (bucketPath) => _optionalChain([options, 'access', _458 => _458.file, 'optionalAccess', _459 => _459.some, 'call', _460 => _460((f) => bucketPath.pathPattern.includes(f))])
15534
15594
  );
15535
15595
  return { ...bucket, paths };
15536
15596
  }).filter((bucket) => bucket.paths.length > 0);