lingo.dev 0.117.21 → 0.117.23

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
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6;
2
2
 
3
- var _chunkHTMTB46Pcjs = require('./chunk-HTMTB46P.cjs');
3
+ var _chunkEHIR4A2Gcjs = require('./chunk-EHIR4A2G.cjs');
4
4
 
5
5
  // src/cli/index.ts
6
6
  var _dotenv = require('dotenv'); var _dotenv2 = _interopRequireDefault(_dotenv);
@@ -1718,6 +1718,7 @@ function extractCommentsFromJsonc(jsoncString) {
1718
1718
  return {};
1719
1719
  }
1720
1720
  const contextStack = [];
1721
+ let arrayObjectCount = {};
1721
1722
  for (let i = 0; i < lines.length; i++) {
1722
1723
  const line = lines[i];
1723
1724
  const trimmedLine = line.trim();
@@ -1729,11 +1730,11 @@ function extractCommentsFromJsonc(jsoncString) {
1729
1730
  const keyMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:/);
1730
1731
  if (keyMatch) {
1731
1732
  const key = keyMatch[1];
1732
- const path19 = contextStack.map((ctx) => ctx.key).filter(Boolean);
1733
+ const path19 = contextStack.map((ctx) => ctx.arrayIndex !== void 0 ? String(ctx.arrayIndex) : ctx.key).filter(Boolean);
1733
1734
  keyInfo = { key, path: path19 };
1734
1735
  }
1735
1736
  } else {
1736
- keyInfo = findAssociatedKey(lines, commentData.lineIndex, contextStack);
1737
+ keyInfo = findAssociatedKey(lines, commentData.lineIndex, contextStack, arrayObjectCount);
1737
1738
  }
1738
1739
  if (keyInfo && keyInfo.key) {
1739
1740
  setCommentAtPath(comments, keyInfo.path, keyInfo.key, commentData.hint);
@@ -1741,7 +1742,7 @@ function extractCommentsFromJsonc(jsoncString) {
1741
1742
  i = commentData.endIndex;
1742
1743
  continue;
1743
1744
  }
1744
- updateContext(contextStack, line, result);
1745
+ updateContext(contextStack, line, result, arrayObjectCount);
1745
1746
  }
1746
1747
  return comments;
1747
1748
  }
@@ -1805,34 +1806,84 @@ function extractBlockComment(lines, startIndex) {
1805
1806
  endIndex
1806
1807
  };
1807
1808
  }
1808
- function findAssociatedKey(lines, commentLineIndex, contextStack) {
1809
+ function findAssociatedKey(lines, commentLineIndex, contextStack, arrayObjectCount) {
1809
1810
  for (let i = commentLineIndex + 1; i < lines.length; i++) {
1810
1811
  const line = lines[i].trim();
1811
- if (!line || line.startsWith("//") || line.startsWith("/*") || line === "{" || line === "}") {
1812
+ if (!line || line.startsWith("//") || line.startsWith("/*")) {
1813
+ continue;
1814
+ }
1815
+ if (line === "{" && contextStack.length > 0) {
1816
+ const parent = contextStack[contextStack.length - 1];
1817
+ if (parent.isArray) {
1818
+ const depth = contextStack.length - 1;
1819
+ const arrayIndex = arrayObjectCount[depth] || 0;
1820
+ for (let j = i + 1; j < lines.length; j++) {
1821
+ const innerLine = lines[j].trim();
1822
+ if (!innerLine || innerLine.startsWith("//") || innerLine.startsWith("/*")) continue;
1823
+ const keyMatch2 = innerLine.match(/^\s*["']?([^"':,\s]+)["']?\s*:/);
1824
+ if (keyMatch2) {
1825
+ const key = keyMatch2[1];
1826
+ const path19 = contextStack.map((ctx) => ctx.arrayIndex !== void 0 ? String(ctx.arrayIndex) : ctx.key).filter(Boolean);
1827
+ path19.push(String(arrayIndex));
1828
+ return { key, path: path19 };
1829
+ }
1830
+ if (innerLine === "}") break;
1831
+ }
1832
+ }
1833
+ }
1834
+ if (line === "{" || line === "}") {
1812
1835
  continue;
1813
1836
  }
1814
1837
  const keyMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:/);
1815
1838
  if (keyMatch) {
1816
1839
  const key = keyMatch[1];
1817
- const path19 = contextStack.map((ctx) => ctx.key).filter(Boolean);
1840
+ const path19 = contextStack.map((ctx) => ctx.arrayIndex !== void 0 ? String(ctx.arrayIndex) : ctx.key).filter(Boolean);
1818
1841
  return { key, path: path19 };
1819
1842
  }
1820
1843
  }
1821
1844
  return { key: null, path: [] };
1822
1845
  }
1823
- function updateContext(contextStack, line, parsedJson) {
1846
+ function updateContext(contextStack, line, parsedJson, arrayObjectCount) {
1847
+ const trimmed = line.trim();
1848
+ const arrayMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:\s*\[/);
1849
+ if (arrayMatch) {
1850
+ const depth = contextStack.length;
1851
+ arrayObjectCount[depth] = 0;
1852
+ contextStack.push({ key: arrayMatch[1], isArray: true });
1853
+ return;
1854
+ }
1824
1855
  const openBraces = (line.match(/\{/g) || []).length;
1825
1856
  const closeBraces = (line.match(/\}/g) || []).length;
1826
1857
  if (openBraces > closeBraces) {
1827
1858
  const keyMatch = line.match(/^\s*["']?([^"':,\s]+)["']?\s*:\s*\{/);
1828
1859
  if (keyMatch) {
1829
1860
  contextStack.push({ key: keyMatch[1], isArray: false });
1861
+ } else if (trimmed === "{" && contextStack.length > 0) {
1862
+ const parent = contextStack[contextStack.length - 1];
1863
+ if (parent.isArray) {
1864
+ const depth = contextStack.length - 1;
1865
+ const arrayIndex = arrayObjectCount[depth] || 0;
1866
+ contextStack.push({ key: "", isArray: false, arrayIndex });
1867
+ arrayObjectCount[depth]++;
1868
+ }
1830
1869
  }
1831
- } else if (closeBraces > openBraces) {
1870
+ }
1871
+ const openBrackets = (line.match(/\[/g) || []).length;
1872
+ const closeBrackets = (line.match(/\]/g) || []).length;
1873
+ if (closeBraces > openBraces) {
1832
1874
  for (let i = 0; i < closeBraces - openBraces; i++) {
1833
1875
  contextStack.pop();
1834
1876
  }
1835
1877
  }
1878
+ if (closeBrackets > openBrackets) {
1879
+ for (let i = 0; i < closeBrackets - openBrackets; i++) {
1880
+ const popped = contextStack.pop();
1881
+ if (_optionalChain([popped, 'optionalAccess', _103 => _103.isArray])) {
1882
+ const depth = contextStack.length;
1883
+ delete arrayObjectCount[depth];
1884
+ }
1885
+ }
1886
+ }
1836
1887
  }
1837
1888
  function setCommentAtPath(comments, path19, key, hint) {
1838
1889
  let current = comments;
@@ -1910,7 +1961,7 @@ function createDenormalizeLoader(options) {
1910
1961
  const preservedObjects = {};
1911
1962
  const nonPreservedInput = {};
1912
1963
  for (const [key, value] of Object.entries(inputDenormalized)) {
1913
- if (_optionalChain([options, 'optionalAccess', _103 => _103.shouldPreserveObject, 'optionalCall', _104 => _104(value)])) {
1964
+ if (_optionalChain([options, 'optionalAccess', _104 => _104.shouldPreserveObject, 'optionalCall', _105 => _105(value)])) {
1914
1965
  preservedObjects[key] = value;
1915
1966
  } else {
1916
1967
  nonPreservedInput[key] = value;
@@ -1943,7 +1994,7 @@ function createNormalizeLoader() {
1943
1994
  return normalized;
1944
1995
  },
1945
1996
  push: async (locale, data, originalInput) => {
1946
- const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _105 => _105.keysMap]), () => ( {}));
1997
+ const keysMap = _nullishCoalesce(_optionalChain([originalInput, 'optionalAccess', _106 => _106.keysMap]), () => ( {}));
1947
1998
  const input2 = mapDenormalizedKeys(data, keysMap);
1948
1999
  const denormalized = _flat.unflatten.call(void 0, input2, {
1949
2000
  delimiter: "/",
@@ -2077,8 +2128,8 @@ async function getTrailingNewLine(pathPattern, locale, originalLocale) {
2077
2128
  if (!templateData) {
2078
2129
  templateData = await readFileForLocale(pathPattern, originalLocale);
2079
2130
  }
2080
- if (_optionalChain([templateData, 'optionalAccess', _106 => _106.match, 'call', _107 => _107(/[\r\n]$/)])) {
2081
- const ending = _optionalChain([templateData, 'optionalAccess', _108 => _108.includes, 'call', _109 => _109("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _110 => _110.includes, 'call', _111 => _111("\r")]) ? "\r" : "\n";
2131
+ if (_optionalChain([templateData, 'optionalAccess', _107 => _107.match, 'call', _108 => _108(/[\r\n]$/)])) {
2132
+ const ending = _optionalChain([templateData, 'optionalAccess', _109 => _109.includes, 'call', _110 => _110("\r\n")]) ? "\r\n" : _optionalChain([templateData, 'optionalAccess', _111 => _111.includes, 'call', _112 => _112("\r")]) ? "\r" : "\n";
2082
2133
  return ending;
2083
2134
  }
2084
2135
  return "";
@@ -2353,15 +2404,15 @@ function createAilLoader() {
2353
2404
  }
2354
2405
  const entries = dictionary.ENTRY || [];
2355
2406
  for (const entry of entries) {
2356
- const id = _optionalChain([entry, 'access', _112 => _112.$, 'optionalAccess', _113 => _113.id]);
2407
+ const id = _optionalChain([entry, 'access', _113 => _113.$, 'optionalAccess', _114 => _114.id]);
2357
2408
  if (!id) {
2358
2409
  continue;
2359
2410
  }
2360
2411
  const strings = entry.STRING || [];
2361
2412
  const sourceString = strings.find(
2362
- (s) => _optionalChain([s, 'access', _114 => _114.$, 'optionalAccess', _115 => _115.lang]) === locale
2413
+ (s) => _optionalChain([s, 'access', _115 => _115.$, 'optionalAccess', _116 => _116.lang]) === locale
2363
2414
  );
2364
- if (_optionalChain([sourceString, 'optionalAccess', _116 => _116.$, 'access', _117 => _117.value])) {
2415
+ if (_optionalChain([sourceString, 'optionalAccess', _117 => _117.$, 'access', _118 => _118.value])) {
2365
2416
  result[id] = sourceString.$.value;
2366
2417
  }
2367
2418
  }
@@ -2403,7 +2454,7 @@ function createAilLoader() {
2403
2454
  }
2404
2455
  const entries = dictionary.ENTRY || [];
2405
2456
  for (const [id, value] of Object.entries(data)) {
2406
- let entry = entries.find((e) => _optionalChain([e, 'access', _118 => _118.$, 'optionalAccess', _119 => _119.id]) === id);
2457
+ let entry = entries.find((e) => _optionalChain([e, 'access', _119 => _119.$, 'optionalAccess', _120 => _120.id]) === id);
2407
2458
  if (!entry) {
2408
2459
  entry = {
2409
2460
  $: { id },
@@ -2415,7 +2466,7 @@ function createAilLoader() {
2415
2466
  entry.STRING = [];
2416
2467
  }
2417
2468
  let targetString = entry.STRING.find(
2418
- (s) => _optionalChain([s, 'access', _120 => _120.$, 'optionalAccess', _121 => _121.lang]) === locale
2469
+ (s) => _optionalChain([s, 'access', _121 => _121.$, 'optionalAccess', _122 => _122.lang]) === locale
2419
2470
  );
2420
2471
  if (targetString) {
2421
2472
  targetString.$.value = value;
@@ -2442,7 +2493,7 @@ function createAilLoader() {
2442
2493
  // src/cli/loaders/android.ts
2443
2494
  var _module = require('module');
2444
2495
 
2445
- var require2 = _module.createRequire.call(void 0, _chunkHTMTB46Pcjs.importMetaUrl);
2496
+ var require2 = _module.createRequire.call(void 0, _chunkEHIR4A2Gcjs.importMetaUrl);
2446
2497
  var sax = require2("sax");
2447
2498
  var defaultAndroidResourcesXml = `<?xml version="1.0" encoding="utf-8"?>
2448
2499
  <resources>
@@ -2546,7 +2597,7 @@ async function parseAndroidDocument(input2) {
2546
2597
  const resourceNodes = [];
2547
2598
  let metaIndex = 0;
2548
2599
  for (const child of resourcesNode.$$) {
2549
- const elementName = _optionalChain([child, 'optionalAccess', _122 => _122["#name"]]);
2600
+ const elementName = _optionalChain([child, 'optionalAccess', _123 => _123["#name"]]);
2550
2601
  if (!isResourceElementName(elementName)) {
2551
2602
  continue;
2552
2603
  }
@@ -2554,11 +2605,11 @@ async function parseAndroidDocument(input2) {
2554
2605
  if (!meta || meta.type !== elementName) {
2555
2606
  continue;
2556
2607
  }
2557
- const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _123 => _123.$, 'optionalAccess', _124 => _124.name]), () => ( meta.name));
2608
+ const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _124 => _124.$, 'optionalAccess', _125 => _125.name]), () => ( meta.name));
2558
2609
  if (!name) {
2559
2610
  continue;
2560
2611
  }
2561
- const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess', _125 => _125.$, 'optionalAccess', _126 => _126.translatable]), () => ( ""))).toLowerCase() !== "false";
2612
+ const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess', _126 => _126.$, 'optionalAccess', _127 => _127.translatable]), () => ( ""))).toLowerCase() !== "false";
2562
2613
  switch (meta.type) {
2563
2614
  case "string": {
2564
2615
  resourceNodes.push({
@@ -2571,7 +2622,7 @@ async function parseAndroidDocument(input2) {
2571
2622
  break;
2572
2623
  }
2573
2624
  case "string-array": {
2574
- const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _127 => _127.item]), () => ( []));
2625
+ const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _128 => _128.item]), () => ( []));
2575
2626
  const items = [];
2576
2627
  const templateItems = meta.items;
2577
2628
  for (let i = 0; i < Math.max(itemNodes.length, templateItems.length); i++) {
@@ -2595,7 +2646,7 @@ async function parseAndroidDocument(input2) {
2595
2646
  break;
2596
2647
  }
2597
2648
  case "plurals": {
2598
- const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _128 => _128.item]), () => ( []));
2649
+ const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _129 => _129.item]), () => ( []));
2599
2650
  const templateItems = meta.items;
2600
2651
  const items = [];
2601
2652
  for (const templateItem of templateItems) {
@@ -2604,7 +2655,7 @@ async function parseAndroidDocument(input2) {
2604
2655
  continue;
2605
2656
  }
2606
2657
  const nodeItem = itemNodes.find(
2607
- (item) => _optionalChain([item, 'optionalAccess', _129 => _129.$, 'optionalAccess', _130 => _130.quantity]) === quantity
2658
+ (item) => _optionalChain([item, 'optionalAccess', _130 => _130.$, 'optionalAccess', _131 => _131.quantity]) === quantity
2608
2659
  );
2609
2660
  if (!nodeItem) {
2610
2661
  continue;
@@ -2878,7 +2929,7 @@ function cloneResourceNode(resource) {
2878
2929
  const nodeClone = deepClone(resource.node);
2879
2930
  const itemNodes = _nullishCoalesce(nodeClone.item, () => ( []));
2880
2931
  const items = itemNodes.map((itemNode, index) => {
2881
- const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access', _131 => _131.items, 'access', _132 => _132[index], 'optionalAccess', _133 => _133.meta]), () => ( _optionalChain([resource, 'access', _134 => _134.items, 'access', _135 => _135[resource.items.length - 1], 'optionalAccess', _136 => _136.meta]))), () => ( makeTextMeta([])));
2932
+ const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access', _132 => _132.items, 'access', _133 => _133[index], 'optionalAccess', _134 => _134.meta]), () => ( _optionalChain([resource, 'access', _135 => _135.items, 'access', _136 => _136[resource.items.length - 1], 'optionalAccess', _137 => _137.meta]))), () => ( makeTextMeta([])));
2882
2933
  return {
2883
2934
  node: itemNode,
2884
2935
  meta: cloneTextMeta(templateMeta)
@@ -2898,7 +2949,7 @@ function cloneResourceNode(resource) {
2898
2949
  const items = [];
2899
2950
  for (const templateItem of resource.items) {
2900
2951
  const cloneNode = itemNodes.find(
2901
- (item) => _optionalChain([item, 'optionalAccess', _137 => _137.$, 'optionalAccess', _138 => _138.quantity]) === templateItem.quantity
2952
+ (item) => _optionalChain([item, 'optionalAccess', _138 => _138.$, 'optionalAccess', _139 => _139.quantity]) === templateItem.quantity
2902
2953
  );
2903
2954
  if (!cloneNode) {
2904
2955
  continue;
@@ -3154,8 +3205,8 @@ function cloneDocumentStructure(document) {
3154
3205
  resourceNodes.map((r) => resourceLookupKey(r.type, r.name))
3155
3206
  );
3156
3207
  let filtered = resourcesClone.$$.filter((child) => {
3157
- const elementName = _optionalChain([child, 'optionalAccess', _139 => _139["#name"]]);
3158
- const name = _optionalChain([child, 'optionalAccess', _140 => _140.$, 'optionalAccess', _141 => _141.name]);
3208
+ const elementName = _optionalChain([child, 'optionalAccess', _140 => _140["#name"]]);
3209
+ const name = _optionalChain([child, 'optionalAccess', _141 => _141.$, 'optionalAccess', _142 => _142.name]);
3159
3210
  if (!isResourceElementName(elementName) || !name) {
3160
3211
  return true;
3161
3212
  }
@@ -3164,7 +3215,7 @@ function cloneDocumentStructure(document) {
3164
3215
  const cleaned = [];
3165
3216
  let lastWasWhitespace = false;
3166
3217
  for (const child of filtered) {
3167
- const isWhitespace = _optionalChain([child, 'optionalAccess', _142 => _142["#name"]]) === "__text__" && (!child._ || child._.trim() === "");
3218
+ const isWhitespace = _optionalChain([child, 'optionalAccess', _143 => _143["#name"]]) === "__text__" && (!child._ || child._.trim() === "");
3168
3219
  if (isWhitespace) {
3169
3220
  if (!lastWasWhitespace) {
3170
3221
  cleaned.push(child);
@@ -3186,8 +3237,8 @@ function buildResourceLookup(resources) {
3186
3237
  const lookup = /* @__PURE__ */ new Map();
3187
3238
  const children = Array.isArray(resources.$$) ? resources.$$ : [];
3188
3239
  for (const child of children) {
3189
- const type = _optionalChain([child, 'optionalAccess', _143 => _143["#name"]]);
3190
- const name = _optionalChain([child, 'optionalAccess', _144 => _144.$, 'optionalAccess', _145 => _145.name]);
3240
+ const type = _optionalChain([child, 'optionalAccess', _144 => _144["#name"]]);
3241
+ const name = _optionalChain([child, 'optionalAccess', _145 => _145.$, 'optionalAccess', _146 => _146.name]);
3191
3242
  if (!type || !name || !isResourceElementName(type)) {
3192
3243
  continue;
3193
3244
  }
@@ -3216,7 +3267,7 @@ function cloneResourceNodeFromLookup(resource, lookup) {
3216
3267
  }
3217
3268
  case "string-array": {
3218
3269
  const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
3219
- (child) => _optionalChain([child, 'optionalAccess', _146 => _146["#name"]]) === "item"
3270
+ (child) => _optionalChain([child, 'optionalAccess', _147 => _147["#name"]]) === "item"
3220
3271
  );
3221
3272
  node.item = childItems;
3222
3273
  if (childItems.length < resource.items.length) {
@@ -3245,12 +3296,12 @@ function cloneResourceNodeFromLookup(resource, lookup) {
3245
3296
  }
3246
3297
  case "plurals": {
3247
3298
  const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
3248
- (child) => _optionalChain([child, 'optionalAccess', _147 => _147["#name"]]) === "item"
3299
+ (child) => _optionalChain([child, 'optionalAccess', _148 => _148["#name"]]) === "item"
3249
3300
  );
3250
3301
  node.item = childItems;
3251
3302
  const itemMap = /* @__PURE__ */ new Map();
3252
3303
  for (const item of childItems) {
3253
- if (_optionalChain([item, 'optionalAccess', _148 => _148.$, 'optionalAccess', _149 => _149.quantity])) {
3304
+ if (_optionalChain([item, 'optionalAccess', _149 => _149.$, 'optionalAccess', _150 => _150.quantity])) {
3254
3305
  itemMap.set(item.$.quantity, item);
3255
3306
  }
3256
3307
  }
@@ -3540,7 +3591,7 @@ var _sync3 = require('csv-stringify/sync');
3540
3591
 
3541
3592
  function detectKeyColumnName(csvString) {
3542
3593
  const row = _sync.parse.call(void 0, csvString)[0];
3543
- const firstColumn = _optionalChain([row, 'optionalAccess', _150 => _150[0], 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]);
3594
+ const firstColumn = _optionalChain([row, 'optionalAccess', _151 => _151[0], 'optionalAccess', _152 => _152.trim, 'call', _153 => _153()]);
3544
3595
  return firstColumn || "KEY";
3545
3596
  }
3546
3597
  function createCsvLoader() {
@@ -3770,7 +3821,7 @@ function createHtmlLoader() {
3770
3821
  const attrs = LOCALIZABLE_ATTRIBUTES2[tagName];
3771
3822
  if (!attrs) return;
3772
3823
  for (const attr of attrs) {
3773
- const value = _optionalChain([element, 'access', _153 => _153.attribs, 'optionalAccess', _154 => _154[attr]]);
3824
+ const value = _optionalChain([element, 'access', _154 => _154.attribs, 'optionalAccess', _155 => _155[attr]]);
3774
3825
  if (value && value.trim()) {
3775
3826
  result[`${path19}#${attr}`] = value.trim();
3776
3827
  }
@@ -3962,7 +4013,7 @@ function createMarkdownLoader() {
3962
4013
  yaml: yamlEngine
3963
4014
  }
3964
4015
  });
3965
- const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _155 => _155.trim, 'call', _156 => _156()]), () => ( ""))).filter(Boolean);
4016
+ const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]), () => ( ""))).filter(Boolean);
3966
4017
  return {
3967
4018
  ...Object.fromEntries(
3968
4019
  sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
@@ -3981,7 +4032,7 @@ function createMarkdownLoader() {
3981
4032
  );
3982
4033
  let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(
3983
4034
  ([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())
3984
- ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _157 => _157.trim, 'call', _158 => _158()]), () => ( ""))).filter(Boolean).join("\n\n");
4035
+ ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]), () => ( ""))).filter(Boolean).join("\n\n");
3985
4036
  if (Object.keys(frontmatter).length > 0) {
3986
4037
  content = `
3987
4038
  ${content}`;
@@ -4006,7 +4057,7 @@ function createMarkdocLoader() {
4006
4057
  const result = {};
4007
4058
  const counters = {};
4008
4059
  traverseAndExtract(ast, "", result, counters);
4009
- if (_optionalChain([ast, 'access', _159 => _159.attributes, 'optionalAccess', _160 => _160.frontmatter])) {
4060
+ if (_optionalChain([ast, 'access', _160 => _160.attributes, 'optionalAccess', _161 => _161.frontmatter])) {
4010
4061
  const frontmatter = _yaml2.default.parse(ast.attributes.frontmatter);
4011
4062
  Object.entries(frontmatter).forEach(([key, value]) => {
4012
4063
  if (typeof value === "string") {
@@ -4052,7 +4103,7 @@ function traverseAndExtract(node, path19, result, counters, parentType) {
4052
4103
  if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
4053
4104
  semanticType = nodeSemanticType;
4054
4105
  }
4055
- if (node.type === "text" && _optionalChain([node, 'access', _161 => _161.attributes, 'optionalAccess', _162 => _162.content])) {
4106
+ if (node.type === "text" && _optionalChain([node, 'access', _162 => _162.attributes, 'optionalAccess', _163 => _163.content])) {
4056
4107
  const content = node.attributes.content;
4057
4108
  if (typeof content === "string" && content.trim()) {
4058
4109
  if (semanticType) {
@@ -4079,7 +4130,7 @@ function buildPathMap(node, path19, counters, pathMap, parentType) {
4079
4130
  if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
4080
4131
  semanticType = nodeSemanticType;
4081
4132
  }
4082
- if (node.type === "text" && _optionalChain([node, 'access', _163 => _163.attributes, 'optionalAccess', _164 => _164.content])) {
4133
+ if (node.type === "text" && _optionalChain([node, 'access', _164 => _164.attributes, 'optionalAccess', _165 => _165.content])) {
4083
4134
  const content = node.attributes.content;
4084
4135
  if (typeof content === "string" && content.trim()) {
4085
4136
  if (semanticType) {
@@ -4102,7 +4153,7 @@ function applyTranslations(node, path19, data, pathMap) {
4102
4153
  if (!node || typeof node !== "object") {
4103
4154
  return;
4104
4155
  }
4105
- if (node.type === "text" && _optionalChain([node, 'access', _165 => _165.attributes, 'optionalAccess', _166 => _166.content])) {
4156
+ if (node.type === "text" && _optionalChain([node, 'access', _166 => _166.attributes, 'optionalAccess', _167 => _167.content])) {
4106
4157
  const content = node.attributes.content;
4107
4158
  if (typeof content === "string") {
4108
4159
  const contentPath = path19 ? `${path19}/attributes/content` : "attributes/content";
@@ -4415,7 +4466,7 @@ function isSkippableLine(line) {
4415
4466
  function parsePropertyLine(line) {
4416
4467
  const [key, ...valueParts] = line.split("=");
4417
4468
  return {
4418
- key: _optionalChain([key, 'optionalAccess', _167 => _167.trim, 'call', _168 => _168()]) || "",
4469
+ key: _optionalChain([key, 'optionalAccess', _168 => _168.trim, 'call', _169 => _169()]) || "",
4419
4470
  value: valueParts.join("=").trim()
4420
4471
  };
4421
4472
  }
@@ -4707,7 +4758,7 @@ var Parser3 = class {
4707
4758
  }
4708
4759
  }
4709
4760
  expect(type) {
4710
- if (_optionalChain([this, 'access', _169 => _169.current, 'call', _170 => _170(), 'optionalAccess', _171 => _171.type]) === type) {
4761
+ if (_optionalChain([this, 'access', _170 => _170.current, 'call', _171 => _171(), 'optionalAccess', _172 => _172.type]) === type) {
4711
4762
  this.advance();
4712
4763
  return true;
4713
4764
  }
@@ -4784,7 +4835,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4784
4835
  if (rootTranslationEntity.shouldTranslate === false) {
4785
4836
  continue;
4786
4837
  }
4787
- const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _172 => _172.localizations, 'optionalAccess', _173 => _173[locale]]);
4838
+ const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _173 => _173.localizations, 'optionalAccess', _174 => _174[locale]]);
4788
4839
  if (langTranslationEntity) {
4789
4840
  if ("stringUnit" in langTranslationEntity) {
4790
4841
  resultData[translationKey] = langTranslationEntity.stringUnit.value;
@@ -4798,7 +4849,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4798
4849
  resultData[translationKey] = {};
4799
4850
  const pluralForms = langTranslationEntity.variations.plural;
4800
4851
  for (const form in pluralForms) {
4801
- if (_optionalChain([pluralForms, 'access', _174 => _174[form], 'optionalAccess', _175 => _175.stringUnit, 'optionalAccess', _176 => _176.value])) {
4852
+ if (_optionalChain([pluralForms, 'access', _175 => _175[form], 'optionalAccess', _176 => _176.stringUnit, 'optionalAccess', _177 => _177.value])) {
4802
4853
  resultData[translationKey][form] = pluralForms[form].stringUnit.value;
4803
4854
  }
4804
4855
  }
@@ -4824,7 +4875,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4824
4875
  const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
4825
4876
  if (typeof value === "string") {
4826
4877
  langDataToMerge.strings[key] = {
4827
- extractionState: _optionalChain([originalInput, 'optionalAccess', _177 => _177.strings, 'optionalAccess', _178 => _178[key], 'optionalAccess', _179 => _179.extractionState]),
4878
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _178 => _178.strings, 'optionalAccess', _179 => _179[key], 'optionalAccess', _180 => _180.extractionState]),
4828
4879
  localizations: {
4829
4880
  [locale]: {
4830
4881
  stringUnit: {
@@ -4839,7 +4890,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4839
4890
  }
4840
4891
  } else if (Array.isArray(value)) {
4841
4892
  langDataToMerge.strings[key] = {
4842
- extractionState: _optionalChain([originalInput, 'optionalAccess', _180 => _180.strings, 'optionalAccess', _181 => _181[key], 'optionalAccess', _182 => _182.extractionState]),
4893
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _181 => _181.strings, 'optionalAccess', _182 => _182[key], 'optionalAccess', _183 => _183.extractionState]),
4843
4894
  localizations: {
4844
4895
  [locale]: {
4845
4896
  stringSet: {
@@ -4897,7 +4948,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4897
4948
  for (const [locale, localization] of Object.entries(
4898
4949
  entity.localizations
4899
4950
  )) {
4900
- if (_optionalChain([localization, 'access', _183 => _183.variations, 'optionalAccess', _184 => _184.plural])) {
4951
+ if (_optionalChain([localization, 'access', _184 => _184.variations, 'optionalAccess', _185 => _185.plural])) {
4901
4952
  const pluralForms = localization.variations.plural;
4902
4953
  for (const form in pluralForms) {
4903
4954
  const pluralKey = `${translationKey}/${form}`;
@@ -4917,7 +4968,7 @@ function _removeLocale(input2, locale) {
4917
4968
  const { strings } = input2;
4918
4969
  const newStrings = _lodash2.default.cloneDeep(strings);
4919
4970
  for (const [key, value] of Object.entries(newStrings)) {
4920
- if (_optionalChain([value, 'access', _185 => _185.localizations, 'optionalAccess', _186 => _186[locale]])) {
4971
+ if (_optionalChain([value, 'access', _186 => _186.localizations, 'optionalAccess', _187 => _187[locale]])) {
4921
4972
  delete value.localizations[locale];
4922
4973
  }
4923
4974
  }
@@ -5048,7 +5099,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5048
5099
  if (rootTranslationEntity.shouldTranslate === false) {
5049
5100
  continue;
5050
5101
  }
5051
- const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _187 => _187.localizations, 'optionalAccess', _188 => _188[locale]]);
5102
+ const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _188 => _188.localizations, 'optionalAccess', _189 => _189[locale]]);
5052
5103
  if (langTranslationEntity) {
5053
5104
  if (!resultData[translationKey]) {
5054
5105
  resultData[translationKey] = {};
@@ -5060,7 +5111,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5060
5111
  for (const [subName, subData] of Object.entries(
5061
5112
  langTranslationEntity.substitutions
5062
5113
  )) {
5063
- const pluralForms = _optionalChain([subData, 'access', _189 => _189.variations, 'optionalAccess', _190 => _190.plural]);
5114
+ const pluralForms = _optionalChain([subData, 'access', _190 => _190.variations, 'optionalAccess', _191 => _191.plural]);
5064
5115
  if (pluralForms) {
5065
5116
  const forms = {};
5066
5117
  for (const [form, formData] of Object.entries(pluralForms)) {
@@ -5085,7 +5136,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5085
5136
  const pluralForms = langTranslationEntity.variations.plural;
5086
5137
  const forms = {};
5087
5138
  for (const [form, formData] of Object.entries(pluralForms)) {
5088
- if (_optionalChain([formData, 'optionalAccess', _191 => _191.stringUnit, 'optionalAccess', _192 => _192.value])) {
5139
+ if (_optionalChain([formData, 'optionalAccess', _192 => _192.stringUnit, 'optionalAccess', _193 => _193.value])) {
5089
5140
  forms[form] = formData.stringUnit.value;
5090
5141
  }
5091
5142
  }
@@ -5128,7 +5179,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5128
5179
  for (const [subName, subData] of Object.entries(
5129
5180
  keyData.substitutions
5130
5181
  )) {
5131
- const pluralValue = _optionalChain([subData, 'optionalAccess', _193 => _193.variations, 'optionalAccess', _194 => _194.plural]);
5182
+ const pluralValue = _optionalChain([subData, 'optionalAccess', _194 => _194.variations, 'optionalAccess', _195 => _195.plural]);
5132
5183
  if (pluralValue && isIcuPluralString(pluralValue)) {
5133
5184
  try {
5134
5185
  const pluralForms = parseIcuPluralString(pluralValue, locale);
@@ -5141,8 +5192,8 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
5141
5192
  }
5142
5193
  };
5143
5194
  }
5144
- const sourceLocale = _optionalChain([originalInput, 'optionalAccess', _195 => _195.sourceLanguage]) || "en";
5145
- const origFormatSpec = _optionalChain([originalInput, 'optionalAccess', _196 => _196.strings, 'optionalAccess', _197 => _197[baseKey], 'optionalAccess', _198 => _198.localizations, 'optionalAccess', _199 => _199[sourceLocale], 'optionalAccess', _200 => _200.substitutions, 'optionalAccess', _201 => _201[subName], 'optionalAccess', _202 => _202.formatSpecifier]) || subName;
5195
+ const sourceLocale = _optionalChain([originalInput, 'optionalAccess', _196 => _196.sourceLanguage]) || "en";
5196
+ const origFormatSpec = _optionalChain([originalInput, 'optionalAccess', _197 => _197.strings, 'optionalAccess', _198 => _198[baseKey], 'optionalAccess', _199 => _199.localizations, 'optionalAccess', _200 => _200[sourceLocale], 'optionalAccess', _201 => _201.substitutions, 'optionalAccess', _202 => _202[subName], 'optionalAccess', _203 => _203.formatSpecifier]) || subName;
5146
5197
  subs[subName] = {
5147
5198
  formatSpecifier: origFormatSpec,
5148
5199
  variations: {
@@ -5167,7 +5218,7 @@ ${error instanceof Error ? error.message : String(error)}`
5167
5218
  values: keyData.stringSet
5168
5219
  };
5169
5220
  }
5170
- if ("variations" in keyData && _optionalChain([keyData, 'access', _203 => _203.variations, 'optionalAccess', _204 => _204.plural])) {
5221
+ if ("variations" in keyData && _optionalChain([keyData, 'access', _204 => _204.variations, 'optionalAccess', _205 => _205.plural])) {
5171
5222
  const pluralValue = keyData.variations.plural;
5172
5223
  if (isIcuPluralString(pluralValue)) {
5173
5224
  try {
@@ -5194,7 +5245,7 @@ ${error instanceof Error ? error.message : String(error)}`
5194
5245
  }
5195
5246
  if (Object.keys(localizationData).length > 0) {
5196
5247
  langDataToMerge.strings[baseKey] = {
5197
- extractionState: _optionalChain([originalInput, 'optionalAccess', _205 => _205.strings, 'optionalAccess', _206 => _206[baseKey], 'optionalAccess', _207 => _207.extractionState]),
5248
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _206 => _206.strings, 'optionalAccess', _207 => _207[baseKey], 'optionalAccess', _208 => _208.extractionState]),
5198
5249
  localizations: {
5199
5250
  [locale]: localizationData
5200
5251
  }
@@ -5417,8 +5468,8 @@ async function formatDataWithBiome(data, filePath, options) {
5417
5468
  });
5418
5469
  return formatted.content;
5419
5470
  } catch (error) {
5420
- const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _208 => _208.stackTrace, 'optionalAccess', _209 => _209.toString, 'call', _210 => _210(), 'access', _211 => _211.split, 'call', _212 => _212("\n"), 'access', _213 => _213[0]]) : "";
5421
- if (_optionalChain([errorMessage, 'optionalAccess', _214 => _214.includes, 'call', _215 => _215("does not exist in the workspace")])) {
5471
+ const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _209 => _209.stackTrace, 'optionalAccess', _210 => _210.toString, 'call', _211 => _211(), 'access', _212 => _212.split, 'call', _213 => _213("\n"), 'access', _214 => _214[0]]) : "";
5472
+ if (_optionalChain([errorMessage, 'optionalAccess', _215 => _215.includes, 'call', _216 => _216("does not exist in the workspace")])) {
5422
5473
  } else {
5423
5474
  console.log(`\u26A0\uFE0F Biome skipped ${path14.default.basename(filePath)}`);
5424
5475
  if (errorMessage) {
@@ -5465,7 +5516,7 @@ function createPoDataLoader(params) {
5465
5516
  Object.entries(entries).forEach(([msgid, entry]) => {
5466
5517
  if (msgid && entry.msgid) {
5467
5518
  const context = entry.msgctxt || "";
5468
- const fullEntry = _optionalChain([parsedPo, 'access', _216 => _216.translations, 'access', _217 => _217[context], 'optionalAccess', _218 => _218[msgid]]);
5519
+ const fullEntry = _optionalChain([parsedPo, 'access', _217 => _217.translations, 'access', _218 => _218[context], 'optionalAccess', _219 => _219[msgid]]);
5469
5520
  if (fullEntry) {
5470
5521
  result[msgid] = fullEntry;
5471
5522
  }
@@ -5475,8 +5526,8 @@ function createPoDataLoader(params) {
5475
5526
  return result;
5476
5527
  },
5477
5528
  async push(locale, data, originalInput, originalLocale, pullInput) {
5478
- const currentSections = _optionalChain([pullInput, 'optionalAccess', _219 => _219.split, 'call', _220 => _220("\n\n"), 'access', _221 => _221.filter, 'call', _222 => _222(Boolean)]) || [];
5479
- const originalSections = _optionalChain([originalInput, 'optionalAccess', _223 => _223.split, 'call', _224 => _224("\n\n"), 'access', _225 => _225.filter, 'call', _226 => _226(Boolean)]) || [];
5529
+ const currentSections = _optionalChain([pullInput, 'optionalAccess', _220 => _220.split, 'call', _221 => _221("\n\n"), 'access', _222 => _222.filter, 'call', _223 => _223(Boolean)]) || [];
5530
+ const originalSections = _optionalChain([originalInput, 'optionalAccess', _224 => _224.split, 'call', _225 => _225("\n\n"), 'access', _226 => _226.filter, 'call', _227 => _227(Boolean)]) || [];
5480
5531
  const result = originalSections.map((section) => {
5481
5532
  const sectionPo = _gettextparser2.default.po.parse(section);
5482
5533
  if (Object.keys(sectionPo.translations).length === 0) {
@@ -5547,8 +5598,8 @@ function createPoContentLoader() {
5547
5598
  {
5548
5599
  ...entry,
5549
5600
  msgstr: [
5550
- _optionalChain([data, 'access', _227 => _227[entry.msgid], 'optionalAccess', _228 => _228.singular]),
5551
- _optionalChain([data, 'access', _229 => _229[entry.msgid], 'optionalAccess', _230 => _230.plural]) || null
5601
+ _optionalChain([data, 'access', _228 => _228[entry.msgid], 'optionalAccess', _229 => _229.singular]),
5602
+ _optionalChain([data, 'access', _230 => _230[entry.msgid], 'optionalAccess', _231 => _231.plural]) || null
5552
5603
  ].filter(Boolean)
5553
5604
  }
5554
5605
  ]).fromPairs().value();
@@ -5670,7 +5721,7 @@ function pullV1(xliffElement, locale, originalLocale) {
5670
5721
  let key = getTransUnitKey(unit);
5671
5722
  if (!key) return;
5672
5723
  if (seenKeys.has(key)) {
5673
- const id = _optionalChain([unit, 'access', _231 => _231.getAttribute, 'call', _232 => _232("id"), 'optionalAccess', _233 => _233.trim, 'call', _234 => _234()]);
5724
+ const id = _optionalChain([unit, 'access', _232 => _232.getAttribute, 'call', _233 => _233("id"), 'optionalAccess', _234 => _234.trim, 'call', _235 => _235()]);
5674
5725
  if (id) {
5675
5726
  key = `${key}#${id}`;
5676
5727
  } else {
@@ -5718,7 +5769,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
5718
5769
  let key = getTransUnitKey(unit);
5719
5770
  if (!key) return;
5720
5771
  if (seenKeys.has(key)) {
5721
- const id = _optionalChain([unit, 'access', _235 => _235.getAttribute, 'call', _236 => _236("id"), 'optionalAccess', _237 => _237.trim, 'call', _238 => _238()]);
5772
+ const id = _optionalChain([unit, 'access', _236 => _236.getAttribute, 'call', _237 => _237("id"), 'optionalAccess', _238 => _238.trim, 'call', _239 => _239()]);
5722
5773
  if (id) {
5723
5774
  key = `${key}#${id}`;
5724
5775
  } else {
@@ -5760,7 +5811,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
5760
5811
  const translationKeys = new Set(Object.keys(translations));
5761
5812
  existingUnits.forEach((unit, key) => {
5762
5813
  if (!translationKeys.has(key)) {
5763
- _optionalChain([unit, 'access', _239 => _239.parentNode, 'optionalAccess', _240 => _240.removeChild, 'call', _241 => _241(unit)]);
5814
+ _optionalChain([unit, 'access', _240 => _240.parentNode, 'optionalAccess', _241 => _241.removeChild, 'call', _242 => _242(unit)]);
5764
5815
  }
5765
5816
  });
5766
5817
  return serializeWithDeclaration(
@@ -5803,18 +5854,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
5803
5854
  Array.from(container.children).forEach((child) => {
5804
5855
  const tagName = child.tagName;
5805
5856
  if (tagName === "unit") {
5806
- const unitId = _optionalChain([child, 'access', _242 => _242.getAttribute, 'call', _243 => _243("id"), 'optionalAccess', _244 => _244.trim, 'call', _245 => _245()]);
5857
+ const unitId = _optionalChain([child, 'access', _243 => _243.getAttribute, 'call', _244 => _244("id"), 'optionalAccess', _245 => _245.trim, 'call', _246 => _246()]);
5807
5858
  if (!unitId) return;
5808
5859
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
5809
5860
  const segment = child.querySelector("segment");
5810
- const source = _optionalChain([segment, 'optionalAccess', _246 => _246.querySelector, 'call', _247 => _247("source")]);
5861
+ const source = _optionalChain([segment, 'optionalAccess', _247 => _247.querySelector, 'call', _248 => _248("source")]);
5811
5862
  if (source) {
5812
5863
  result[key] = extractTextContent(source);
5813
5864
  } else {
5814
5865
  result[key] = unitId;
5815
5866
  }
5816
5867
  } else if (tagName === "group") {
5817
- const groupId = _optionalChain([child, 'access', _248 => _248.getAttribute, 'call', _249 => _249("id"), 'optionalAccess', _250 => _250.trim, 'call', _251 => _251()]);
5868
+ const groupId = _optionalChain([child, 'access', _249 => _249.getAttribute, 'call', _250 => _250("id"), 'optionalAccess', _251 => _251.trim, 'call', _252 => _252()]);
5818
5869
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
5819
5870
  traverseUnitsV2(child, fileId, newPath, result);
5820
5871
  }
@@ -5850,12 +5901,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
5850
5901
  Array.from(container.children).forEach((child) => {
5851
5902
  const tagName = child.tagName;
5852
5903
  if (tagName === "unit") {
5853
- const unitId = _optionalChain([child, 'access', _252 => _252.getAttribute, 'call', _253 => _253("id"), 'optionalAccess', _254 => _254.trim, 'call', _255 => _255()]);
5904
+ const unitId = _optionalChain([child, 'access', _253 => _253.getAttribute, 'call', _254 => _254("id"), 'optionalAccess', _255 => _255.trim, 'call', _256 => _256()]);
5854
5905
  if (!unitId) return;
5855
5906
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
5856
5907
  index.set(key, child);
5857
5908
  } else if (tagName === "group") {
5858
- const groupId = _optionalChain([child, 'access', _256 => _256.getAttribute, 'call', _257 => _257("id"), 'optionalAccess', _258 => _258.trim, 'call', _259 => _259()]);
5909
+ const groupId = _optionalChain([child, 'access', _257 => _257.getAttribute, 'call', _258 => _258("id"), 'optionalAccess', _259 => _259.trim, 'call', _260 => _260()]);
5859
5910
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
5860
5911
  indexUnitsV2(child, fileId, newPath, index);
5861
5912
  }
@@ -5876,9 +5927,9 @@ function updateUnitV2(unit, value) {
5876
5927
  setTextContent(source, value);
5877
5928
  }
5878
5929
  function getTransUnitKey(transUnit) {
5879
- const resname = _optionalChain([transUnit, 'access', _260 => _260.getAttribute, 'call', _261 => _261("resname"), 'optionalAccess', _262 => _262.trim, 'call', _263 => _263()]);
5930
+ const resname = _optionalChain([transUnit, 'access', _261 => _261.getAttribute, 'call', _262 => _262("resname"), 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()]);
5880
5931
  if (resname) return resname;
5881
- const id = _optionalChain([transUnit, 'access', _264 => _264.getAttribute, 'call', _265 => _265("id"), 'optionalAccess', _266 => _266.trim, 'call', _267 => _267()]);
5932
+ const id = _optionalChain([transUnit, 'access', _265 => _265.getAttribute, 'call', _266 => _266("id"), 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]);
5882
5933
  if (id) return id;
5883
5934
  const sourceElement = transUnit.querySelector("source");
5884
5935
  if (sourceElement) {
@@ -5935,7 +5986,7 @@ function formatXml(xml) {
5935
5986
  if (cdataNode) {
5936
5987
  return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
5937
5988
  }
5938
- const textContent3 = _optionalChain([element, 'access', _268 => _268.textContent, 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()]) || "";
5989
+ const textContent3 = _optionalChain([element, 'access', _269 => _269.textContent, 'optionalAccess', _270 => _270.trim, 'call', _271 => _271()]) || "";
5939
5990
  const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
5940
5991
  if (hasOnlyText && textContent3) {
5941
5992
  return `${indent2}${openTag}${textContent3}</${tagName}>`;
@@ -6228,7 +6279,7 @@ function createDatoClient(params) {
6228
6279
  ids: !records.length ? void 0 : records.join(",")
6229
6280
  }
6230
6281
  }).catch(
6231
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _271 => _271.response, 'optionalAccess', _272 => _272.body, 'optionalAccess', _273 => _273.data, 'optionalAccess', _274 => _274[0]]) || error)
6282
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _272 => _272.response, 'optionalAccess', _273 => _273.body, 'optionalAccess', _274 => _274.data, 'optionalAccess', _275 => _275[0]]) || error)
6232
6283
  );
6233
6284
  },
6234
6285
  findRecordsForModel: async (modelId, records) => {
@@ -6239,10 +6290,10 @@ function createDatoClient(params) {
6239
6290
  filter: {
6240
6291
  type: modelId,
6241
6292
  only_valid: "true",
6242
- ids: !_optionalChain([records, 'optionalAccess', _275 => _275.length]) ? void 0 : records.join(",")
6293
+ ids: !_optionalChain([records, 'optionalAccess', _276 => _276.length]) ? void 0 : records.join(",")
6243
6294
  }
6244
6295
  }).catch(
6245
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _276 => _276.response, 'optionalAccess', _277 => _277.body, 'optionalAccess', _278 => _278.data, 'optionalAccess', _279 => _279[0]]) || error)
6296
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _277 => _277.response, 'optionalAccess', _278 => _278.body, 'optionalAccess', _279 => _279.data, 'optionalAccess', _280 => _280[0]]) || error)
6246
6297
  );
6247
6298
  return result;
6248
6299
  } catch (_error) {
@@ -6258,10 +6309,10 @@ function createDatoClient(params) {
6258
6309
  updateRecord: async (id, payload) => {
6259
6310
  try {
6260
6311
  await dato.items.update(id, payload).catch(
6261
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _280 => _280.response, 'optionalAccess', _281 => _281.body, 'optionalAccess', _282 => _282.data, 'optionalAccess', _283 => _283[0]]) || error)
6312
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _281 => _281.response, 'optionalAccess', _282 => _282.body, 'optionalAccess', _283 => _283.data, 'optionalAccess', _284 => _284[0]]) || error)
6262
6313
  );
6263
6314
  } catch (_error) {
6264
- if (_optionalChain([_error, 'optionalAccess', _284 => _284.attributes, 'optionalAccess', _285 => _285.details, 'optionalAccess', _286 => _286.message])) {
6315
+ if (_optionalChain([_error, 'optionalAccess', _285 => _285.attributes, 'optionalAccess', _286 => _286.details, 'optionalAccess', _287 => _287.message])) {
6265
6316
  throw new Error(
6266
6317
  [
6267
6318
  `${_error.attributes.details.message}`,
@@ -6283,10 +6334,10 @@ function createDatoClient(params) {
6283
6334
  enableFieldLocalization: async (args) => {
6284
6335
  try {
6285
6336
  await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
6286
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _287 => _287.response, 'optionalAccess', _288 => _288.body, 'optionalAccess', _289 => _289.data, 'optionalAccess', _290 => _290[0]]) || error)
6337
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _288 => _288.response, 'optionalAccess', _289 => _289.body, 'optionalAccess', _290 => _290.data, 'optionalAccess', _291 => _291[0]]) || error)
6287
6338
  );
6288
6339
  } catch (_error) {
6289
- if (_optionalChain([_error, 'optionalAccess', _291 => _291.attributes, 'optionalAccess', _292 => _292.code]) === "NOT_FOUND") {
6340
+ if (_optionalChain([_error, 'optionalAccess', _292 => _292.attributes, 'optionalAccess', _293 => _293.code]) === "NOT_FOUND") {
6290
6341
  throw new Error(
6291
6342
  [
6292
6343
  `Field "${args.fieldId}" not found in model "${args.modelId}".`,
@@ -6294,7 +6345,7 @@ function createDatoClient(params) {
6294
6345
  ].join("\n\n")
6295
6346
  );
6296
6347
  }
6297
- if (_optionalChain([_error, 'optionalAccess', _293 => _293.attributes, 'optionalAccess', _294 => _294.details, 'optionalAccess', _295 => _295.message])) {
6348
+ if (_optionalChain([_error, 'optionalAccess', _294 => _294.attributes, 'optionalAccess', _295 => _295.details, 'optionalAccess', _296 => _296.message])) {
6298
6349
  throw new Error(
6299
6350
  [
6300
6351
  `${_error.attributes.details.message}`,
@@ -6372,7 +6423,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
6372
6423
  const records = await dato.findRecordsForModel(modelId);
6373
6424
  const recordChoices = createRecordChoices(
6374
6425
  records,
6375
- _optionalChain([config, 'access', _296 => _296.models, 'access', _297 => _297[modelId], 'optionalAccess', _298 => _298.records]) || [],
6426
+ _optionalChain([config, 'access', _297 => _297.models, 'access', _298 => _298[modelId], 'optionalAccess', _299 => _299.records]) || [],
6376
6427
  project
6377
6428
  );
6378
6429
  const selectedRecords = await promptRecordSelection(
@@ -6391,14 +6442,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
6391
6442
  },
6392
6443
  async pull(locale, input2, initCtx) {
6393
6444
  const result = {};
6394
- for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _299 => _299.models]) || {})) {
6395
- let records = _optionalChain([initCtx, 'optionalAccess', _300 => _300.models, 'access', _301 => _301[modelId], 'access', _302 => _302.records]) || [];
6445
+ for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _300 => _300.models]) || {})) {
6446
+ let records = _optionalChain([initCtx, 'optionalAccess', _301 => _301.models, 'access', _302 => _302[modelId], 'access', _303 => _303.records]) || [];
6396
6447
  const recordIds = records.map((record) => record.id);
6397
6448
  records = await dato.findRecords(recordIds);
6398
6449
  console.log(`Fetched ${records.length} records for model ${modelId}`);
6399
6450
  if (records.length > 0) {
6400
6451
  result[modelId] = {
6401
- fields: _optionalChain([initCtx, 'optionalAccess', _303 => _303.models, 'optionalAccess', _304 => _304[modelId], 'optionalAccess', _305 => _305.fields]) || [],
6452
+ fields: _optionalChain([initCtx, 'optionalAccess', _304 => _304.models, 'optionalAccess', _305 => _305[modelId], 'optionalAccess', _306 => _306.fields]) || [],
6402
6453
  records
6403
6454
  };
6404
6455
  }
@@ -6461,7 +6512,7 @@ function createRecordChoices(records, selectedIds = [], project) {
6461
6512
  return records.map((record) => ({
6462
6513
  name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
6463
6514
  value: record.id,
6464
- checked: _optionalChain([selectedIds, 'optionalAccess', _306 => _306.includes, 'call', _307 => _307(record.id)])
6515
+ checked: _optionalChain([selectedIds, 'optionalAccess', _307 => _307.includes, 'call', _308 => _308(record.id)])
6465
6516
  }));
6466
6517
  }
6467
6518
  async function promptRecordSelection(modelName, choices) {
@@ -6780,7 +6831,7 @@ function createVttLoader() {
6780
6831
  if (!input2) {
6781
6832
  return "";
6782
6833
  }
6783
- const vtt = _optionalChain([_nodewebvtt2.default, 'access', _308 => _308.parse, 'call', _309 => _309(input2), 'optionalAccess', _310 => _310.cues]);
6834
+ const vtt = _optionalChain([_nodewebvtt2.default, 'access', _309 => _309.parse, 'call', _310 => _310(input2), 'optionalAccess', _311 => _311.cues]);
6784
6835
  if (Object.keys(vtt).length === 0) {
6785
6836
  return {};
6786
6837
  } else {
@@ -6834,7 +6885,7 @@ function variableExtractLoader(params) {
6834
6885
  for (let i = 0; i < matches.length; i++) {
6835
6886
  const match2 = matches[i];
6836
6887
  const currentValue = result[key].value;
6837
- const newValue = _optionalChain([currentValue, 'optionalAccess', _311 => _311.replace, 'call', _312 => _312(match2, `{variable:${i}}`)]);
6888
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _312 => _312.replace, 'call', _313 => _313(match2, `{variable:${i}}`)]);
6838
6889
  result[key].value = newValue;
6839
6890
  result[key].variables[i] = match2;
6840
6891
  }
@@ -6849,7 +6900,7 @@ function variableExtractLoader(params) {
6849
6900
  const variable = valueObj.variables[i];
6850
6901
  const currentValue = result[key];
6851
6902
  if (typeof currentValue === "string") {
6852
- const newValue = _optionalChain([currentValue, 'optionalAccess', _313 => _313.replaceAll, 'call', _314 => _314(
6903
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _314 => _314.replaceAll, 'call', _315 => _315(
6853
6904
  `{variable:${i}}`,
6854
6905
  variable
6855
6906
  )]);
@@ -7053,7 +7104,7 @@ function createVueJsonLoader() {
7053
7104
  return createLoader({
7054
7105
  pull: async (locale, input2, ctx) => {
7055
7106
  const parsed = parseVueFile(input2);
7056
- return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _315 => _315.i18n, 'optionalAccess', _316 => _316[locale]]), () => ( {}));
7107
+ return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _316 => _316.i18n, 'optionalAccess', _317 => _317[locale]]), () => ( {}));
7057
7108
  },
7058
7109
  push: async (locale, data, originalInput) => {
7059
7110
  const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
@@ -7238,7 +7289,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
7238
7289
  objectExpression.properties.forEach((prop) => {
7239
7290
  if (!t.isObjectProperty(prop)) return;
7240
7291
  const key = getPropertyKey(prop);
7241
- const incomingVal = _optionalChain([data, 'optionalAccess', _317 => _317[key]]);
7292
+ const incomingVal = _optionalChain([data, 'optionalAccess', _318 => _318[key]]);
7242
7293
  if (incomingVal === void 0) {
7243
7294
  return;
7244
7295
  }
@@ -7274,7 +7325,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
7274
7325
  let modified = false;
7275
7326
  arrayExpression.elements.forEach((element, index) => {
7276
7327
  if (!element) return;
7277
- const incomingVal = _optionalChain([incoming, 'optionalAccess', _318 => _318[index]]);
7328
+ const incomingVal = _optionalChain([incoming, 'optionalAccess', _319 => _319[index]]);
7278
7329
  if (incomingVal === void 0) return;
7279
7330
  if (t.isStringLiteral(element) && typeof incomingVal === "string") {
7280
7331
  if (element.value !== incomingVal) {
@@ -7768,7 +7819,7 @@ var AST = class _AST {
7768
7819
  const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
7769
7820
  if (this.isStart() && !this.type)
7770
7821
  ret.unshift([]);
7771
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _319 => _319.#parent, 'optionalAccess', _320 => _320.type]) === "!")) {
7822
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _320 => _320.#parent, 'optionalAccess', _321 => _321.type]) === "!")) {
7772
7823
  ret.push({});
7773
7824
  }
7774
7825
  return ret;
@@ -7776,7 +7827,7 @@ var AST = class _AST {
7776
7827
  isStart() {
7777
7828
  if (this.#root === this)
7778
7829
  return true;
7779
- if (!_optionalChain([this, 'access', _321 => _321.#parent, 'optionalAccess', _322 => _322.isStart, 'call', _323 => _323()]))
7830
+ if (!_optionalChain([this, 'access', _322 => _322.#parent, 'optionalAccess', _323 => _323.isStart, 'call', _324 => _324()]))
7780
7831
  return false;
7781
7832
  if (this.#parentIndex === 0)
7782
7833
  return true;
@@ -7792,12 +7843,12 @@ var AST = class _AST {
7792
7843
  isEnd() {
7793
7844
  if (this.#root === this)
7794
7845
  return true;
7795
- if (_optionalChain([this, 'access', _324 => _324.#parent, 'optionalAccess', _325 => _325.type]) === "!")
7846
+ if (_optionalChain([this, 'access', _325 => _325.#parent, 'optionalAccess', _326 => _326.type]) === "!")
7796
7847
  return true;
7797
- if (!_optionalChain([this, 'access', _326 => _326.#parent, 'optionalAccess', _327 => _327.isEnd, 'call', _328 => _328()]))
7848
+ if (!_optionalChain([this, 'access', _327 => _327.#parent, 'optionalAccess', _328 => _328.isEnd, 'call', _329 => _329()]))
7798
7849
  return false;
7799
7850
  if (!this.type)
7800
- return _optionalChain([this, 'access', _329 => _329.#parent, 'optionalAccess', _330 => _330.isEnd, 'call', _331 => _331()]);
7851
+ return _optionalChain([this, 'access', _330 => _330.#parent, 'optionalAccess', _331 => _331.isEnd, 'call', _332 => _332()]);
7801
7852
  const pl = this.#parent ? this.#parent.#parts.length : 0;
7802
7853
  return this.#parentIndex === pl - 1;
7803
7854
  }
@@ -8042,7 +8093,7 @@ var AST = class _AST {
8042
8093
  }
8043
8094
  }
8044
8095
  let end = "";
8045
- if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _332 => _332.#parent, 'optionalAccess', _333 => _333.type]) === "!") {
8096
+ if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _333 => _333.#parent, 'optionalAccess', _334 => _334.type]) === "!") {
8046
8097
  end = "(?:$|\\/)";
8047
8098
  }
8048
8099
  const final2 = start2 + src + end;
@@ -8215,7 +8266,7 @@ var path13 = {
8215
8266
  };
8216
8267
  var sep = defaultPlatform === "win32" ? path13.win32.sep : path13.posix.sep;
8217
8268
  minimatch.sep = sep;
8218
- var GLOBSTAR = Symbol("globstar **");
8269
+ var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
8219
8270
  minimatch.GLOBSTAR = GLOBSTAR;
8220
8271
  var qmark2 = "[^/]";
8221
8272
  var star2 = qmark2 + "*?";
@@ -9143,7 +9194,7 @@ function createMdxSectionsSplit2Loader() {
9143
9194
  const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
9144
9195
  const result = {
9145
9196
  frontmatter: data.frontmatter,
9146
- codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _334 => _334.codePlaceholders]) || {},
9197
+ codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _335 => _335.codePlaceholders]) || {},
9147
9198
  content
9148
9199
  };
9149
9200
  return result;
@@ -9538,7 +9589,7 @@ function createTwigLoader() {
9538
9589
  const attrs = LOCALIZABLE_ATTRIBUTES2[tagName];
9539
9590
  if (!attrs) return;
9540
9591
  for (const attr of attrs) {
9541
- const value = _optionalChain([element, 'access', _335 => _335.attribs, 'optionalAccess', _336 => _336[attr]]);
9592
+ const value = _optionalChain([element, 'access', _336 => _336.attribs, 'optionalAccess', _337 => _337[attr]]);
9542
9593
  if (value && value.trim()) {
9543
9594
  const restoredValue = postprocessTwig(value.trim(), twigBlocks);
9544
9595
  result[`${path19}#${attr}`] = restoredValue;
@@ -10641,7 +10692,7 @@ function createBasicTranslator(model, systemPrompt, settings = {}) {
10641
10692
  ]
10642
10693
  });
10643
10694
  const result = JSON.parse(response.text);
10644
- return _optionalChain([result, 'optionalAccess', _337 => _337.data]) || {};
10695
+ return _optionalChain([result, 'optionalAccess', _338 => _338.data]) || {};
10645
10696
  }
10646
10697
  }
10647
10698
  function extractPayloadChunks(payload) {
@@ -10724,7 +10775,7 @@ function getPureModelProvider(provider) {
10724
10775
 
10725
10776
  ${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
10726
10777
  `;
10727
- switch (_optionalChain([provider, 'optionalAccess', _338 => _338.id])) {
10778
+ switch (_optionalChain([provider, 'optionalAccess', _339 => _339.id])) {
10728
10779
  case "openai": {
10729
10780
  if (!process.env.OPENAI_API_KEY) {
10730
10781
  throw new Error(
@@ -10782,7 +10833,7 @@ function getPureModelProvider(provider) {
10782
10833
  })(provider.model);
10783
10834
  }
10784
10835
  default: {
10785
- throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _339 => _339.id])));
10836
+ throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _340 => _340.id])));
10786
10837
  }
10787
10838
  }
10788
10839
  }
@@ -10861,7 +10912,7 @@ function parseGitUrl(url) {
10861
10912
  }
10862
10913
  const sshMatch = cleanUrl.match(/[@:]([^:/@]+\/[^:/@]+)$/);
10863
10914
  const httpsMatch = cleanUrl.match(/\/([^/]+\/[^/]+)$/);
10864
- const repoPath = _optionalChain([sshMatch, 'optionalAccess', _340 => _340[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _341 => _341[1]]);
10915
+ const repoPath = _optionalChain([sshMatch, 'optionalAccess', _341 => _341[1]]) || _optionalChain([httpsMatch, 'optionalAccess', _342 => _342[1]]);
10865
10916
  if (!repoPath) return null;
10866
10917
  if (platform) {
10867
10918
  return `${platform}:${repoPath}`;
@@ -11170,7 +11221,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11170
11221
  validateParams(i18nConfig, flags);
11171
11222
  ora.succeed("Localization configuration is valid");
11172
11223
  ora.start("Connecting to Lingo.dev Localization Engine...");
11173
- const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _342 => _342.provider]);
11224
+ const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _343 => _343.provider]);
11174
11225
  if (isByokMode) {
11175
11226
  authId = null;
11176
11227
  ora.succeed("Using external provider (BYOK mode)");
@@ -11184,16 +11235,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11184
11235
  flags
11185
11236
  });
11186
11237
  let buckets = getBuckets(i18nConfig);
11187
- if (_optionalChain([flags, 'access', _343 => _343.bucket, 'optionalAccess', _344 => _344.length])) {
11238
+ if (_optionalChain([flags, 'access', _344 => _344.bucket, 'optionalAccess', _345 => _345.length])) {
11188
11239
  buckets = buckets.filter(
11189
11240
  (bucket) => flags.bucket.includes(bucket.type)
11190
11241
  );
11191
11242
  }
11192
11243
  ora.succeed("Buckets retrieved");
11193
- if (_optionalChain([flags, 'access', _345 => _345.file, 'optionalAccess', _346 => _346.length])) {
11244
+ if (_optionalChain([flags, 'access', _346 => _346.file, 'optionalAccess', _347 => _347.length])) {
11194
11245
  buckets = buckets.map((bucket) => {
11195
11246
  const paths = bucket.paths.filter(
11196
- (path19) => flags.file.find((file) => _optionalChain([path19, 'access', _347 => _347.pathPattern, 'optionalAccess', _348 => _348.includes, 'call', _349 => _349(file)]))
11247
+ (path19) => flags.file.find((file) => _optionalChain([path19, 'access', _348 => _348.pathPattern, 'optionalAccess', _349 => _349.includes, 'call', _350 => _350(file)]))
11197
11248
  );
11198
11249
  return { ...bucket, paths };
11199
11250
  }).filter((bucket) => bucket.paths.length > 0);
@@ -11214,7 +11265,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11214
11265
  });
11215
11266
  }
11216
11267
  }
11217
- const targetLocales = _optionalChain([flags, 'access', _350 => _350.locale, 'optionalAccess', _351 => _351.length]) ? flags.locale : i18nConfig.locale.targets;
11268
+ const targetLocales = _optionalChain([flags, 'access', _351 => _351.locale, 'optionalAccess', _352 => _352.length]) ? flags.locale : i18nConfig.locale.targets;
11218
11269
  ora.start("Setting up localization cache...");
11219
11270
  const checkLockfileProcessor = createDeltaProcessor("");
11220
11271
  const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
@@ -11499,7 +11550,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
11499
11550
  }
11500
11551
  const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
11501
11552
  const checksums = await deltaProcessor.createChecksums(sourceData);
11502
- if (!_optionalChain([flags, 'access', _352 => _352.locale, 'optionalAccess', _353 => _353.length])) {
11553
+ if (!_optionalChain([flags, 'access', _353 => _353.locale, 'optionalAccess', _354 => _354.length])) {
11503
11554
  await deltaProcessor.saveChecksums(checksums);
11504
11555
  }
11505
11556
  }
@@ -11626,12 +11677,12 @@ function validateParams(i18nConfig, flags) {
11626
11677
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
11627
11678
  docUrl: "bucketNotFound"
11628
11679
  });
11629
- } else if (_optionalChain([flags, 'access', _354 => _354.locale, 'optionalAccess', _355 => _355.some, 'call', _356 => _356((locale) => !i18nConfig.locale.targets.includes(locale))])) {
11680
+ } else if (_optionalChain([flags, 'access', _355 => _355.locale, 'optionalAccess', _356 => _356.some, 'call', _357 => _357((locale) => !i18nConfig.locale.targets.includes(locale))])) {
11630
11681
  throw new ValidationError({
11631
11682
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
11632
11683
  docUrl: "localeTargetNotFound"
11633
11684
  });
11634
- } else if (_optionalChain([flags, 'access', _357 => _357.bucket, 'optionalAccess', _358 => _358.some, 'call', _359 => _359(
11685
+ } else if (_optionalChain([flags, 'access', _358 => _358.bucket, 'optionalAccess', _359 => _359.some, 'call', _360 => _360(
11635
11686
  (bucket) => !i18nConfig.buckets[bucket]
11636
11687
  )])) {
11637
11688
  throw new ValidationError({
@@ -12165,7 +12216,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
12165
12216
  const response = await engine.whoami();
12166
12217
  return {
12167
12218
  authenticated: !!response,
12168
- username: _optionalChain([response, 'optionalAccess', _360 => _360.email])
12219
+ username: _optionalChain([response, 'optionalAccess', _361 => _361.email])
12169
12220
  };
12170
12221
  } catch (error) {
12171
12222
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -12281,7 +12332,7 @@ function createExplicitLocalizer(provider) {
12281
12332
  }
12282
12333
  function createAiSdkLocalizer(params) {
12283
12334
  const skipAuth = params.skipAuth === true;
12284
- const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _361 => _361.apiKeyName]), () => ( ""))];
12335
+ const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _362 => _362.apiKeyName]), () => ( ""))];
12285
12336
  if (!skipAuth && !apiKey || !params.apiKeyName) {
12286
12337
  throw new Error(
12287
12338
  _dedent2.default`
@@ -12415,8 +12466,8 @@ async function setup(input2) {
12415
12466
  throw new Error(
12416
12467
  "No buckets found in i18n.json. Please add at least one bucket containing i18n content."
12417
12468
  );
12418
- } else if (_optionalChain([ctx, 'access', _362 => _362.flags, 'access', _363 => _363.bucket, 'optionalAccess', _364 => _364.some, 'call', _365 => _365(
12419
- (bucket) => !_optionalChain([ctx, 'access', _366 => _366.config, 'optionalAccess', _367 => _367.buckets, 'access', _368 => _368[bucket]])
12469
+ } else if (_optionalChain([ctx, 'access', _363 => _363.flags, 'access', _364 => _364.bucket, 'optionalAccess', _365 => _365.some, 'call', _366 => _366(
12470
+ (bucket) => !_optionalChain([ctx, 'access', _367 => _367.config, 'optionalAccess', _368 => _368.buckets, 'access', _369 => _369[bucket]])
12420
12471
  )])) {
12421
12472
  throw new Error(
12422
12473
  `One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
@@ -12429,7 +12480,7 @@ async function setup(input2) {
12429
12480
  title: "Selecting localization provider",
12430
12481
  task: async (ctx, task) => {
12431
12482
  ctx.localizer = createLocalizer(
12432
- _optionalChain([ctx, 'access', _369 => _369.config, 'optionalAccess', _370 => _370.provider]),
12483
+ _optionalChain([ctx, 'access', _370 => _370.config, 'optionalAccess', _371 => _371.provider]),
12433
12484
  ctx.flags.apiKey
12434
12485
  );
12435
12486
  if (!ctx.localizer) {
@@ -12442,7 +12493,7 @@ async function setup(input2) {
12442
12493
  },
12443
12494
  {
12444
12495
  title: "Checking authentication",
12445
- enabled: (ctx) => _optionalChain([ctx, 'access', _371 => _371.localizer, 'optionalAccess', _372 => _372.id]) === "Lingo.dev",
12496
+ enabled: (ctx) => _optionalChain([ctx, 'access', _372 => _372.localizer, 'optionalAccess', _373 => _373.id]) === "Lingo.dev",
12446
12497
  task: async (ctx, task) => {
12447
12498
  const authStatus = await ctx.localizer.checkAuth();
12448
12499
  if (!authStatus.authenticated) {
@@ -12455,7 +12506,7 @@ async function setup(input2) {
12455
12506
  },
12456
12507
  {
12457
12508
  title: "Validating configuration",
12458
- enabled: (ctx) => _optionalChain([ctx, 'access', _373 => _373.localizer, 'optionalAccess', _374 => _374.id]) !== "Lingo.dev",
12509
+ enabled: (ctx) => _optionalChain([ctx, 'access', _374 => _374.localizer, 'optionalAccess', _375 => _375.id]) !== "Lingo.dev",
12459
12510
  task: async (ctx, task) => {
12460
12511
  const validationStatus = await ctx.localizer.validateSettings();
12461
12512
  if (!validationStatus.valid) {
@@ -12786,7 +12837,7 @@ function createWorkerTask(args) {
12786
12837
  const processableData = _lodash2.default.chain(sourceData).entries().filter(
12787
12838
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
12788
12839
  ).filter(
12789
- ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _375 => _375.onlyKeys, 'optionalAccess', _376 => _376.some, 'call', _377 => _377(
12840
+ ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _376 => _376.onlyKeys, 'optionalAccess', _377 => _377.some, 'call', _378 => _378(
12790
12841
  (pattern) => minimatch(key, pattern)
12791
12842
  )])
12792
12843
  ).fromPairs().value();
@@ -12854,7 +12905,7 @@ function createWorkerTask(args) {
12854
12905
  finalRenamedTargetData
12855
12906
  );
12856
12907
  const checksums = await deltaProcessor.createChecksums(sourceData);
12857
- if (!_optionalChain([args, 'access', _378 => _378.ctx, 'access', _379 => _379.flags, 'access', _380 => _380.targetLocale, 'optionalAccess', _381 => _381.length])) {
12908
+ if (!_optionalChain([args, 'access', _379 => _379.ctx, 'access', _380 => _380.flags, 'access', _381 => _381.targetLocale, 'optionalAccess', _382 => _382.length])) {
12858
12909
  await deltaProcessor.saveChecksums(checksums);
12859
12910
  }
12860
12911
  });
@@ -13059,10 +13110,10 @@ var flagsSchema2 = _zod.z.object({
13059
13110
  async function frozen(input2) {
13060
13111
  console.log(_chalk2.default.hex(colors.orange)("[Frozen]"));
13061
13112
  let buckets = getBuckets(input2.config);
13062
- if (_optionalChain([input2, 'access', _382 => _382.flags, 'access', _383 => _383.bucket, 'optionalAccess', _384 => _384.length])) {
13113
+ if (_optionalChain([input2, 'access', _383 => _383.flags, 'access', _384 => _384.bucket, 'optionalAccess', _385 => _385.length])) {
13063
13114
  buckets = buckets.filter((b) => input2.flags.bucket.includes(b.type));
13064
13115
  }
13065
- if (_optionalChain([input2, 'access', _385 => _385.flags, 'access', _386 => _386.file, 'optionalAccess', _387 => _387.length])) {
13116
+ if (_optionalChain([input2, 'access', _386 => _386.flags, 'access', _387 => _387.file, 'optionalAccess', _388 => _388.length])) {
13066
13117
  buckets = buckets.map((bucket) => {
13067
13118
  const paths = bucket.paths.filter(
13068
13119
  (p) => input2.flags.file.some(
@@ -13199,13 +13250,13 @@ async function frozen(input2) {
13199
13250
 
13200
13251
  // src/cli/cmd/run/_utils.ts
13201
13252
  async function determineAuthId(ctx) {
13202
- const isByokMode = !!_optionalChain([ctx, 'access', _388 => _388.config, 'optionalAccess', _389 => _389.provider]);
13253
+ const isByokMode = !!_optionalChain([ctx, 'access', _389 => _389.config, 'optionalAccess', _390 => _390.provider]);
13203
13254
  if (isByokMode) {
13204
13255
  return null;
13205
13256
  } else {
13206
13257
  try {
13207
- const authStatus = await _optionalChain([ctx, 'access', _390 => _390.localizer, 'optionalAccess', _391 => _391.checkAuth, 'call', _392 => _392()]);
13208
- return _optionalChain([authStatus, 'optionalAccess', _393 => _393.username]) || null;
13258
+ const authStatus = await _optionalChain([ctx, 'access', _391 => _391.localizer, 'optionalAccess', _392 => _392.checkAuth, 'call', _393 => _393()]);
13259
+ return _optionalChain([authStatus, 'optionalAccess', _394 => _394.username]) || null;
13209
13260
  } catch (e4) {
13210
13261
  return null;
13211
13262
  }
@@ -13213,7 +13264,7 @@ async function determineAuthId(ctx) {
13213
13264
  }
13214
13265
 
13215
13266
  // src/cli/cmd/run/index.ts
13216
- var __dirname = path14.default.dirname(_url.fileURLToPath.call(void 0, _chunkHTMTB46Pcjs.importMetaUrl));
13267
+ var __dirname = path14.default.dirname(_url.fileURLToPath.call(void 0, _chunkEHIR4A2Gcjs.importMetaUrl));
13217
13268
  function playSound(type) {
13218
13269
  const platform = _os2.default.platform();
13219
13270
  return new Promise((resolve) => {
@@ -13405,7 +13456,7 @@ var InBranchFlow = class extends IntegrationFlow {
13405
13456
  _child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
13406
13457
  _child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
13407
13458
  _child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
13408
- _optionalChain([this, 'access', _394 => _394.platformKit, 'optionalAccess', _395 => _395.gitConfig, 'call', _396 => _396()]);
13459
+ _optionalChain([this, 'access', _395 => _395.platformKit, 'optionalAccess', _396 => _396.gitConfig, 'call', _397 => _397()]);
13409
13460
  _child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
13410
13461
  _child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
13411
13462
  if (!processOwnCommits) {
@@ -13437,7 +13488,7 @@ var InBranchFlow = class extends IntegrationFlow {
13437
13488
  // src/cli/cmd/ci/flows/pull-request.ts
13438
13489
  var PullRequestFlow = class extends InBranchFlow {
13439
13490
  async preRun() {
13440
- const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _397 => _397()]);
13491
+ const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _398 => _398()]);
13441
13492
  if (!canContinue) {
13442
13493
  return false;
13443
13494
  }
@@ -13704,10 +13755,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
13704
13755
  repo_slug: this.platformConfig.repositoryName,
13705
13756
  state: "OPEN"
13706
13757
  }).then(({ data: { values } }) => {
13707
- return _optionalChain([values, 'optionalAccess', _398 => _398.find, 'call', _399 => _399(
13708
- ({ source, destination }) => _optionalChain([source, 'optionalAccess', _400 => _400.branch, 'optionalAccess', _401 => _401.name]) === branch && _optionalChain([destination, 'optionalAccess', _402 => _402.branch, 'optionalAccess', _403 => _403.name]) === this.platformConfig.baseBranchName
13758
+ return _optionalChain([values, 'optionalAccess', _399 => _399.find, 'call', _400 => _400(
13759
+ ({ source, destination }) => _optionalChain([source, 'optionalAccess', _401 => _401.branch, 'optionalAccess', _402 => _402.name]) === branch && _optionalChain([destination, 'optionalAccess', _403 => _403.branch, 'optionalAccess', _404 => _404.name]) === this.platformConfig.baseBranchName
13709
13760
  )]);
13710
- }).then((pr) => _optionalChain([pr, 'optionalAccess', _404 => _404.id]));
13761
+ }).then((pr) => _optionalChain([pr, 'optionalAccess', _405 => _405.id]));
13711
13762
  }
13712
13763
  async closePullRequest({ pullRequestNumber }) {
13713
13764
  await this.bb.repositories.declinePullRequest({
@@ -13803,7 +13854,7 @@ var GitHubPlatformKit = class extends PlatformKit {
13803
13854
  repo: this.platformConfig.repositoryName,
13804
13855
  base: this.platformConfig.baseBranchName,
13805
13856
  state: "open"
13806
- }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _405 => _405.number]));
13857
+ }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _406 => _406.number]));
13807
13858
  }
13808
13859
  async closePullRequest({ pullRequestNumber }) {
13809
13860
  await this.octokit.rest.pulls.update({
@@ -13930,7 +13981,7 @@ var GitlabPlatformKit = class extends PlatformKit {
13930
13981
  sourceBranch: branch,
13931
13982
  state: "opened"
13932
13983
  });
13933
- return _optionalChain([mergeRequests, 'access', _406 => _406[0], 'optionalAccess', _407 => _407.iid]);
13984
+ return _optionalChain([mergeRequests, 'access', _407 => _407[0], 'optionalAccess', _408 => _408.iid]);
13934
13985
  }
13935
13986
  async closePullRequest({
13936
13987
  pullRequestNumber
@@ -14042,7 +14093,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
14042
14093
  }
14043
14094
  const env = {
14044
14095
  LINGODOTDEV_API_KEY: settings.auth.apiKey,
14045
- LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _408 => _408.pullRequest, 'optionalAccess', _409 => _409.toString, 'call', _410 => _410()]) || "false",
14096
+ LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _409 => _409.pullRequest, 'optionalAccess', _410 => _410.toString, 'call', _411 => _411()]) || "false",
14046
14097
  ...options.commitMessage && {
14047
14098
  LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
14048
14099
  },
@@ -14068,7 +14119,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
14068
14119
  const { isPullRequestMode } = platformKit.config;
14069
14120
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
14070
14121
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
14071
- const canRun = await _optionalChain([flow, 'access', _411 => _411.preRun, 'optionalCall', _412 => _412()]);
14122
+ const canRun = await _optionalChain([flow, 'access', _412 => _412.preRun, 'optionalCall', _413 => _413()]);
14072
14123
  if (canRun === false) {
14073
14124
  return;
14074
14125
  }
@@ -14078,7 +14129,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
14078
14129
  if (!hasChanges) {
14079
14130
  return;
14080
14131
  }
14081
- await _optionalChain([flow, 'access', _413 => _413.postRun, 'optionalCall', _414 => _414()]);
14132
+ await _optionalChain([flow, 'access', _414 => _414.postRun, 'optionalCall', _415 => _415()]);
14082
14133
  });
14083
14134
  function parseBooleanArg(val) {
14084
14135
  if (val === true) return true;
@@ -14115,8 +14166,8 @@ function exitGracefully(elapsedMs = 0) {
14115
14166
  }
14116
14167
  }
14117
14168
  function checkForPendingOperations() {
14118
- const activeHandles = _optionalChain([process, 'access', _415 => _415._getActiveHandles, 'optionalCall', _416 => _416()]) || [];
14119
- const activeRequests = _optionalChain([process, 'access', _417 => _417._getActiveRequests, 'optionalCall', _418 => _418()]) || [];
14169
+ const activeHandles = _optionalChain([process, 'access', _416 => _416._getActiveHandles, 'optionalCall', _417 => _417()]) || [];
14170
+ const activeRequests = _optionalChain([process, 'access', _418 => _418._getActiveRequests, 'optionalCall', _419 => _419()]) || [];
14120
14171
  const nonStandardHandles = activeHandles.filter((handle) => {
14121
14172
  if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
14122
14173
  return false;
@@ -14185,17 +14236,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
14185
14236
  flags
14186
14237
  });
14187
14238
  let buckets = getBuckets(i18nConfig);
14188
- if (_optionalChain([flags, 'access', _419 => _419.bucket, 'optionalAccess', _420 => _420.length])) {
14239
+ if (_optionalChain([flags, 'access', _420 => _420.bucket, 'optionalAccess', _421 => _421.length])) {
14189
14240
  buckets = buckets.filter(
14190
14241
  (bucket) => flags.bucket.includes(bucket.type)
14191
14242
  );
14192
14243
  }
14193
14244
  ora.succeed("Buckets retrieved");
14194
- if (_optionalChain([flags, 'access', _421 => _421.file, 'optionalAccess', _422 => _422.length])) {
14245
+ if (_optionalChain([flags, 'access', _422 => _422.file, 'optionalAccess', _423 => _423.length])) {
14195
14246
  buckets = buckets.map((bucket) => {
14196
14247
  const paths = bucket.paths.filter(
14197
14248
  (path19) => flags.file.find(
14198
- (file) => _optionalChain([path19, 'access', _423 => _423.pathPattern, 'optionalAccess', _424 => _424.includes, 'call', _425 => _425(file)]) || _optionalChain([path19, 'access', _426 => _426.pathPattern, 'optionalAccess', _427 => _427.match, 'call', _428 => _428(file)]) || minimatch(path19.pathPattern, file)
14249
+ (file) => _optionalChain([path19, 'access', _424 => _424.pathPattern, 'optionalAccess', _425 => _425.includes, 'call', _426 => _426(file)]) || _optionalChain([path19, 'access', _427 => _427.pathPattern, 'optionalAccess', _428 => _428.match, 'call', _429 => _429(file)]) || minimatch(path19.pathPattern, file)
14199
14250
  )
14200
14251
  );
14201
14252
  return { ...bucket, paths };
@@ -14215,7 +14266,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
14215
14266
  });
14216
14267
  }
14217
14268
  }
14218
- const targetLocales = _optionalChain([flags, 'access', _429 => _429.locale, 'optionalAccess', _430 => _430.length]) ? flags.locale : i18nConfig.locale.targets;
14269
+ const targetLocales = _optionalChain([flags, 'access', _430 => _430.locale, 'optionalAccess', _431 => _431.length]) ? flags.locale : i18nConfig.locale.targets;
14219
14270
  let totalSourceKeyCount = 0;
14220
14271
  let uniqueKeysToTranslate = 0;
14221
14272
  let totalExistingTranslations = 0;
@@ -14625,12 +14676,12 @@ function validateParams2(i18nConfig, flags) {
14625
14676
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
14626
14677
  docUrl: "bucketNotFound"
14627
14678
  });
14628
- } else if (_optionalChain([flags, 'access', _431 => _431.locale, 'optionalAccess', _432 => _432.some, 'call', _433 => _433((locale) => !i18nConfig.locale.targets.includes(locale))])) {
14679
+ } else if (_optionalChain([flags, 'access', _432 => _432.locale, 'optionalAccess', _433 => _433.some, 'call', _434 => _434((locale) => !i18nConfig.locale.targets.includes(locale))])) {
14629
14680
  throw new CLIError({
14630
14681
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
14631
14682
  docUrl: "localeTargetNotFound"
14632
14683
  });
14633
- } else if (_optionalChain([flags, 'access', _434 => _434.bucket, 'optionalAccess', _435 => _435.some, 'call', _436 => _436(
14684
+ } else if (_optionalChain([flags, 'access', _435 => _435.bucket, 'optionalAccess', _436 => _436.some, 'call', _437 => _437(
14634
14685
  (bucket) => !i18nConfig.buckets[bucket]
14635
14686
  )])) {
14636
14687
  throw new CLIError({
@@ -14722,7 +14773,7 @@ async function renderHero2() {
14722
14773
  // package.json
14723
14774
  var package_default = {
14724
14775
  name: "lingo.dev",
14725
- version: "0.117.21",
14776
+ version: "0.117.23",
14726
14777
  description: "Lingo.dev CLI",
14727
14778
  private: false,
14728
14779
  repository: {
@@ -15024,7 +15075,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
15024
15075
  if (options.file && options.file.length) {
15025
15076
  buckets = buckets.map((bucket) => {
15026
15077
  const paths = bucket.paths.filter(
15027
- (bucketPath) => _optionalChain([options, 'access', _437 => _437.file, 'optionalAccess', _438 => _438.some, 'call', _439 => _439((f) => bucketPath.pathPattern.includes(f))])
15078
+ (bucketPath) => _optionalChain([options, 'access', _438 => _438.file, 'optionalAccess', _439 => _439.some, 'call', _440 => _440((f) => bucketPath.pathPattern.includes(f))])
15028
15079
  );
15029
15080
  return { ...bucket, paths };
15030
15081
  }).filter((bucket) => bucket.paths.length > 0);