lingo.dev 0.117.1 → 0.117.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.cjs CHANGED
@@ -2088,14 +2088,180 @@ function createYamlLoader() {
2088
2088
  return _yaml2.default.parse(input2) || {};
2089
2089
  },
2090
2090
  async push(locale, payload, originalInput) {
2091
- return _yaml2.default.stringify(payload, {
2092
- lineWidth: -1,
2093
- defaultKeyType: getKeyType(originalInput),
2094
- defaultStringType: getStringType(originalInput)
2095
- });
2091
+ if (!originalInput || !originalInput.trim()) {
2092
+ return _yaml2.default.stringify(payload, {
2093
+ lineWidth: -1,
2094
+ defaultKeyType: "PLAIN",
2095
+ defaultStringType: "PLAIN"
2096
+ });
2097
+ }
2098
+ try {
2099
+ const sourceDoc = _yaml2.default.parseDocument(originalInput);
2100
+ const outputDoc = _yaml2.default.parseDocument(
2101
+ _yaml2.default.stringify(payload, {
2102
+ lineWidth: -1,
2103
+ defaultKeyType: "PLAIN"
2104
+ })
2105
+ );
2106
+ const isRootKeyFormat = detectRootKeyFormat(sourceDoc, outputDoc);
2107
+ const metadata = extractQuotingMetadata(sourceDoc, isRootKeyFormat);
2108
+ applyQuotingMetadata(outputDoc, metadata, isRootKeyFormat);
2109
+ return outputDoc.toString({ lineWidth: -1 });
2110
+ } catch (error) {
2111
+ console.warn("Failed to preserve YAML formatting:", error);
2112
+ return _yaml2.default.stringify(payload, {
2113
+ lineWidth: -1,
2114
+ defaultKeyType: getKeyType(originalInput),
2115
+ defaultStringType: getStringType(originalInput)
2116
+ });
2117
+ }
2096
2118
  }
2097
2119
  });
2098
2120
  }
2121
+ function detectRootKeyFormat(sourceDoc, outputDoc) {
2122
+ const sourceRoot = sourceDoc.contents;
2123
+ const outputRoot = outputDoc.contents;
2124
+ if (!isYAMLMap(sourceRoot) || !isYAMLMap(outputRoot)) {
2125
+ return false;
2126
+ }
2127
+ const sourceMap = sourceRoot;
2128
+ const outputMap = outputRoot;
2129
+ if (!sourceMap.items || sourceMap.items.length !== 1 || !outputMap.items || outputMap.items.length !== 1) {
2130
+ return false;
2131
+ }
2132
+ const sourceRootKey = getKeyValue(sourceMap.items[0].key);
2133
+ const outputRootKey = getKeyValue(outputMap.items[0].key);
2134
+ if (sourceRootKey !== outputRootKey && typeof sourceRootKey === "string" && typeof outputRootKey === "string") {
2135
+ return true;
2136
+ }
2137
+ return false;
2138
+ }
2139
+ function extractQuotingMetadata(doc, skipRootKey) {
2140
+ const metadata = {
2141
+ keys: /* @__PURE__ */ new Map(),
2142
+ values: /* @__PURE__ */ new Map()
2143
+ };
2144
+ const root = doc.contents;
2145
+ if (!root) return metadata;
2146
+ let startNode = root;
2147
+ if (skipRootKey && isYAMLMap(root)) {
2148
+ const rootMap = root;
2149
+ if (rootMap.items && rootMap.items.length === 1) {
2150
+ startNode = rootMap.items[0].value;
2151
+ }
2152
+ }
2153
+ walkAndExtract(startNode, [], metadata);
2154
+ return metadata;
2155
+ }
2156
+ function walkAndExtract(node, path19, metadata) {
2157
+ if (isScalar(node)) {
2158
+ if (node.type && node.type !== "PLAIN") {
2159
+ metadata.values.set(path19.join("."), node.type);
2160
+ }
2161
+ } else if (isYAMLMap(node)) {
2162
+ if (node.items && Array.isArray(node.items)) {
2163
+ for (const pair of node.items) {
2164
+ if (pair && pair.key) {
2165
+ const key = getKeyValue(pair.key);
2166
+ if (key !== null && key !== void 0) {
2167
+ const keyPath = [...path19, String(key)].join(".");
2168
+ if (pair.key.type && pair.key.type !== "PLAIN") {
2169
+ metadata.keys.set(keyPath, pair.key.type);
2170
+ }
2171
+ if (pair.value) {
2172
+ walkAndExtract(pair.value, [...path19, String(key)], metadata);
2173
+ }
2174
+ }
2175
+ }
2176
+ }
2177
+ }
2178
+ } else if (isYAMLSeq(node)) {
2179
+ if (node.items && Array.isArray(node.items)) {
2180
+ for (let i = 0; i < node.items.length; i++) {
2181
+ if (node.items[i]) {
2182
+ walkAndExtract(node.items[i], [...path19, String(i)], metadata);
2183
+ }
2184
+ }
2185
+ }
2186
+ }
2187
+ }
2188
+ function applyQuotingMetadata(doc, metadata, skipRootKey) {
2189
+ const root = doc.contents;
2190
+ if (!root) return;
2191
+ let startNode = root;
2192
+ if (skipRootKey && isYAMLMap(root)) {
2193
+ const rootMap = root;
2194
+ if (rootMap.items && rootMap.items.length === 1) {
2195
+ startNode = rootMap.items[0].value;
2196
+ }
2197
+ }
2198
+ walkAndApply(startNode, [], metadata);
2199
+ }
2200
+ function walkAndApply(node, path19, metadata) {
2201
+ if (isScalar(node)) {
2202
+ const pathKey = path19.join(".");
2203
+ const quoteType = metadata.values.get(pathKey);
2204
+ if (quoteType) {
2205
+ node.type = quoteType;
2206
+ }
2207
+ } else if (isYAMLMap(node)) {
2208
+ if (node.items && Array.isArray(node.items)) {
2209
+ for (const pair of node.items) {
2210
+ if (pair && pair.key) {
2211
+ const key = getKeyValue(pair.key);
2212
+ if (key !== null && key !== void 0) {
2213
+ const keyPath = [...path19, String(key)].join(".");
2214
+ const keyQuoteType = metadata.keys.get(keyPath);
2215
+ if (keyQuoteType) {
2216
+ pair.key.type = keyQuoteType;
2217
+ }
2218
+ if (pair.value) {
2219
+ walkAndApply(pair.value, [...path19, String(key)], metadata);
2220
+ }
2221
+ }
2222
+ }
2223
+ }
2224
+ }
2225
+ } else if (isYAMLSeq(node)) {
2226
+ if (node.items && Array.isArray(node.items)) {
2227
+ for (let i = 0; i < node.items.length; i++) {
2228
+ if (node.items[i]) {
2229
+ walkAndApply(node.items[i], [...path19, String(i)], metadata);
2230
+ }
2231
+ }
2232
+ }
2233
+ }
2234
+ }
2235
+ function isScalar(node) {
2236
+ if (_optionalChain([node, 'optionalAccess', _112 => _112.constructor, 'optionalAccess', _113 => _113.name]) === "Scalar") {
2237
+ return true;
2238
+ }
2239
+ return node && typeof node === "object" && "value" in node && ("type" in node || "format" in node);
2240
+ }
2241
+ function isYAMLMap(node) {
2242
+ if (_optionalChain([node, 'optionalAccess', _114 => _114.constructor, 'optionalAccess', _115 => _115.name]) === "YAMLMap") {
2243
+ return true;
2244
+ }
2245
+ return node && typeof node === "object" && "items" in node && Array.isArray(node.items) && !("value" in node);
2246
+ }
2247
+ function isYAMLSeq(node) {
2248
+ if (_optionalChain([node, 'optionalAccess', _116 => _116.constructor, 'optionalAccess', _117 => _117.name]) === "YAMLSeq") {
2249
+ return true;
2250
+ }
2251
+ return node && typeof node === "object" && "items" in node && Array.isArray(node.items) && !("type" in node) && !("value" in node);
2252
+ }
2253
+ function getKeyValue(key) {
2254
+ if (key === null || key === void 0) {
2255
+ return null;
2256
+ }
2257
+ if (typeof key === "object" && "value" in key) {
2258
+ return key.value;
2259
+ }
2260
+ if (typeof key === "string" || typeof key === "number") {
2261
+ return key;
2262
+ }
2263
+ return null;
2264
+ }
2099
2265
  function getKeyType(yamlString) {
2100
2266
  if (yamlString) {
2101
2267
  const lines = yamlString.split("\n");
@@ -2275,7 +2441,7 @@ async function parseAndroidDocument(input2) {
2275
2441
  const resourceNodes = [];
2276
2442
  let metaIndex = 0;
2277
2443
  for (const child of resourcesNode.$$) {
2278
- const elementName = _optionalChain([child, 'optionalAccess', _112 => _112["#name"]]);
2444
+ const elementName = _optionalChain([child, 'optionalAccess', _118 => _118["#name"]]);
2279
2445
  if (!isResourceElementName(elementName)) {
2280
2446
  continue;
2281
2447
  }
@@ -2283,11 +2449,11 @@ async function parseAndroidDocument(input2) {
2283
2449
  if (!meta || meta.type !== elementName) {
2284
2450
  continue;
2285
2451
  }
2286
- const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _113 => _113.$, 'optionalAccess', _114 => _114.name]), () => ( meta.name));
2452
+ const name = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _119 => _119.$, 'optionalAccess', _120 => _120.name]), () => ( meta.name));
2287
2453
  if (!name) {
2288
2454
  continue;
2289
2455
  }
2290
- const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess', _115 => _115.$, 'optionalAccess', _116 => _116.translatable]), () => ( ""))).toLowerCase() !== "false";
2456
+ const translatable = (_nullishCoalesce(_optionalChain([child, 'optionalAccess', _121 => _121.$, 'optionalAccess', _122 => _122.translatable]), () => ( ""))).toLowerCase() !== "false";
2291
2457
  switch (meta.type) {
2292
2458
  case "string": {
2293
2459
  resourceNodes.push({
@@ -2300,7 +2466,7 @@ async function parseAndroidDocument(input2) {
2300
2466
  break;
2301
2467
  }
2302
2468
  case "string-array": {
2303
- const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _117 => _117.item]), () => ( []));
2469
+ const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _123 => _123.item]), () => ( []));
2304
2470
  const items = [];
2305
2471
  const templateItems = meta.items;
2306
2472
  for (let i = 0; i < Math.max(itemNodes.length, templateItems.length); i++) {
@@ -2324,7 +2490,7 @@ async function parseAndroidDocument(input2) {
2324
2490
  break;
2325
2491
  }
2326
2492
  case "plurals": {
2327
- const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _118 => _118.item]), () => ( []));
2493
+ const itemNodes = _nullishCoalesce(_optionalChain([child, 'optionalAccess', _124 => _124.item]), () => ( []));
2328
2494
  const templateItems = meta.items;
2329
2495
  const items = [];
2330
2496
  for (const templateItem of templateItems) {
@@ -2333,7 +2499,7 @@ async function parseAndroidDocument(input2) {
2333
2499
  continue;
2334
2500
  }
2335
2501
  const nodeItem = itemNodes.find(
2336
- (item) => _optionalChain([item, 'optionalAccess', _119 => _119.$, 'optionalAccess', _120 => _120.quantity]) === quantity
2502
+ (item) => _optionalChain([item, 'optionalAccess', _125 => _125.$, 'optionalAccess', _126 => _126.quantity]) === quantity
2337
2503
  );
2338
2504
  if (!nodeItem) {
2339
2505
  continue;
@@ -2614,7 +2780,7 @@ function cloneResourceNode(resource) {
2614
2780
  const nodeClone = deepClone(resource.node);
2615
2781
  const itemNodes = _nullishCoalesce(nodeClone.item, () => ( []));
2616
2782
  const items = itemNodes.map((itemNode, index) => {
2617
- const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access', _121 => _121.items, 'access', _122 => _122[index], 'optionalAccess', _123 => _123.meta]), () => ( _optionalChain([resource, 'access', _124 => _124.items, 'access', _125 => _125[resource.items.length - 1], 'optionalAccess', _126 => _126.meta]))), () => ( makeTextMeta([])));
2783
+ const templateMeta = _nullishCoalesce(_nullishCoalesce(_optionalChain([resource, 'access', _127 => _127.items, 'access', _128 => _128[index], 'optionalAccess', _129 => _129.meta]), () => ( _optionalChain([resource, 'access', _130 => _130.items, 'access', _131 => _131[resource.items.length - 1], 'optionalAccess', _132 => _132.meta]))), () => ( makeTextMeta([])));
2618
2784
  return {
2619
2785
  node: itemNode,
2620
2786
  meta: cloneTextMeta(templateMeta)
@@ -2634,7 +2800,7 @@ function cloneResourceNode(resource) {
2634
2800
  const items = [];
2635
2801
  for (const templateItem of resource.items) {
2636
2802
  const cloneNode = itemNodes.find(
2637
- (item) => _optionalChain([item, 'optionalAccess', _127 => _127.$, 'optionalAccess', _128 => _128.quantity]) === templateItem.quantity
2803
+ (item) => _optionalChain([item, 'optionalAccess', _133 => _133.$, 'optionalAccess', _134 => _134.quantity]) === templateItem.quantity
2638
2804
  );
2639
2805
  if (!cloneNode) {
2640
2806
  continue;
@@ -2890,8 +3056,8 @@ function cloneDocumentStructure(document) {
2890
3056
  resourceNodes.map((r) => resourceLookupKey(r.type, r.name))
2891
3057
  );
2892
3058
  let filtered = resourcesClone.$$.filter((child) => {
2893
- const elementName = _optionalChain([child, 'optionalAccess', _129 => _129["#name"]]);
2894
- const name = _optionalChain([child, 'optionalAccess', _130 => _130.$, 'optionalAccess', _131 => _131.name]);
3059
+ const elementName = _optionalChain([child, 'optionalAccess', _135 => _135["#name"]]);
3060
+ const name = _optionalChain([child, 'optionalAccess', _136 => _136.$, 'optionalAccess', _137 => _137.name]);
2895
3061
  if (!isResourceElementName(elementName) || !name) {
2896
3062
  return true;
2897
3063
  }
@@ -2900,7 +3066,7 @@ function cloneDocumentStructure(document) {
2900
3066
  const cleaned = [];
2901
3067
  let lastWasWhitespace = false;
2902
3068
  for (const child of filtered) {
2903
- const isWhitespace = _optionalChain([child, 'optionalAccess', _132 => _132["#name"]]) === "__text__" && (!child._ || child._.trim() === "");
3069
+ const isWhitespace = _optionalChain([child, 'optionalAccess', _138 => _138["#name"]]) === "__text__" && (!child._ || child._.trim() === "");
2904
3070
  if (isWhitespace) {
2905
3071
  if (!lastWasWhitespace) {
2906
3072
  cleaned.push(child);
@@ -2922,8 +3088,8 @@ function buildResourceLookup(resources) {
2922
3088
  const lookup = /* @__PURE__ */ new Map();
2923
3089
  const children = Array.isArray(resources.$$) ? resources.$$ : [];
2924
3090
  for (const child of children) {
2925
- const type = _optionalChain([child, 'optionalAccess', _133 => _133["#name"]]);
2926
- const name = _optionalChain([child, 'optionalAccess', _134 => _134.$, 'optionalAccess', _135 => _135.name]);
3091
+ const type = _optionalChain([child, 'optionalAccess', _139 => _139["#name"]]);
3092
+ const name = _optionalChain([child, 'optionalAccess', _140 => _140.$, 'optionalAccess', _141 => _141.name]);
2927
3093
  if (!type || !name || !isResourceElementName(type)) {
2928
3094
  continue;
2929
3095
  }
@@ -2952,7 +3118,7 @@ function cloneResourceNodeFromLookup(resource, lookup) {
2952
3118
  }
2953
3119
  case "string-array": {
2954
3120
  const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
2955
- (child) => _optionalChain([child, 'optionalAccess', _136 => _136["#name"]]) === "item"
3121
+ (child) => _optionalChain([child, 'optionalAccess', _142 => _142["#name"]]) === "item"
2956
3122
  );
2957
3123
  node.item = childItems;
2958
3124
  if (childItems.length < resource.items.length) {
@@ -2981,12 +3147,12 @@ function cloneResourceNodeFromLookup(resource, lookup) {
2981
3147
  }
2982
3148
  case "plurals": {
2983
3149
  const childItems = (Array.isArray(node.$$) ? node.$$ : []).filter(
2984
- (child) => _optionalChain([child, 'optionalAccess', _137 => _137["#name"]]) === "item"
3150
+ (child) => _optionalChain([child, 'optionalAccess', _143 => _143["#name"]]) === "item"
2985
3151
  );
2986
3152
  node.item = childItems;
2987
3153
  const itemMap = /* @__PURE__ */ new Map();
2988
3154
  for (const item of childItems) {
2989
- if (_optionalChain([item, 'optionalAccess', _138 => _138.$, 'optionalAccess', _139 => _139.quantity])) {
3155
+ if (_optionalChain([item, 'optionalAccess', _144 => _144.$, 'optionalAccess', _145 => _145.quantity])) {
2990
3156
  itemMap.set(item.$.quantity, item);
2991
3157
  }
2992
3158
  }
@@ -3276,7 +3442,7 @@ var _sync3 = require('csv-stringify/sync');
3276
3442
 
3277
3443
  function detectKeyColumnName(csvString) {
3278
3444
  const row = _sync.parse.call(void 0, csvString)[0];
3279
- const firstColumn = _optionalChain([row, 'optionalAccess', _140 => _140[0], 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]);
3445
+ const firstColumn = _optionalChain([row, 'optionalAccess', _146 => _146[0], 'optionalAccess', _147 => _147.trim, 'call', _148 => _148()]);
3280
3446
  return firstColumn || "KEY";
3281
3447
  }
3282
3448
  function createCsvLoader() {
@@ -3378,7 +3544,7 @@ function createHtmlLoader() {
3378
3544
  break;
3379
3545
  }
3380
3546
  const siblings = Array.from(parent.childNodes).filter(
3381
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _143 => _143.textContent, 'optionalAccess', _144 => _144.trim, 'call', _145 => _145()])
3547
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _149 => _149.textContent, 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()])
3382
3548
  );
3383
3549
  const index = siblings.indexOf(current);
3384
3550
  if (index !== -1) {
@@ -3414,15 +3580,15 @@ function createHtmlLoader() {
3414
3580
  }
3415
3581
  });
3416
3582
  Array.from(element.childNodes).filter(
3417
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _146 => _146.textContent, 'optionalAccess', _147 => _147.trim, 'call', _148 => _148()])
3583
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _152 => _152.textContent, 'optionalAccess', _153 => _153.trim, 'call', _154 => _154()])
3418
3584
  ).forEach(processNode);
3419
3585
  }
3420
3586
  };
3421
3587
  Array.from(document.head.childNodes).filter(
3422
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _149 => _149.textContent, 'optionalAccess', _150 => _150.trim, 'call', _151 => _151()])
3588
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _155 => _155.textContent, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()])
3423
3589
  ).forEach(processNode);
3424
3590
  Array.from(document.body.childNodes).filter(
3425
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _152 => _152.textContent, 'optionalAccess', _153 => _153.trim, 'call', _154 => _154()])
3591
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _158 => _158.textContent, 'optionalAccess', _159 => _159.trim, 'call', _160 => _160()])
3426
3592
  ).forEach(processNode);
3427
3593
  return result;
3428
3594
  },
@@ -3447,7 +3613,7 @@ function createHtmlLoader() {
3447
3613
  for (let i = 0; i < indices.length; i++) {
3448
3614
  const index = parseInt(indices[i]);
3449
3615
  const siblings = Array.from(parent.childNodes).filter(
3450
- (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _155 => _155.textContent, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()])
3616
+ (n) => n.nodeType === 1 || n.nodeType === 3 && _optionalChain([n, 'access', _161 => _161.textContent, 'optionalAccess', _162 => _162.trim, 'call', _163 => _163()])
3451
3617
  );
3452
3618
  if (index >= siblings.length) {
3453
3619
  if (i === indices.length - 1) {
@@ -3498,7 +3664,7 @@ function createMarkdownLoader() {
3498
3664
  yaml: yamlEngine
3499
3665
  }
3500
3666
  });
3501
- const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _158 => _158.trim, 'call', _159 => _159()]), () => ( ""))).filter(Boolean);
3667
+ const sections = content.split(SECTION_REGEX).map((section) => _nullishCoalesce(_optionalChain([section, 'optionalAccess', _164 => _164.trim, 'call', _165 => _165()]), () => ( ""))).filter(Boolean);
3502
3668
  return {
3503
3669
  ...Object.fromEntries(
3504
3670
  sections.map((section, index) => [`${MD_SECTION_PREFIX}${index}`, section]).filter(([, section]) => Boolean(section))
@@ -3517,7 +3683,7 @@ function createMarkdownLoader() {
3517
3683
  );
3518
3684
  let content = Object.entries(data).filter(([key]) => key.startsWith(MD_SECTION_PREFIX)).sort(
3519
3685
  ([a], [b]) => Number(a.split("-").pop()) - Number(b.split("-").pop())
3520
- ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _160 => _160.trim, 'call', _161 => _161()]), () => ( ""))).filter(Boolean).join("\n\n");
3686
+ ).map(([, value]) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _166 => _166.trim, 'call', _167 => _167()]), () => ( ""))).filter(Boolean).join("\n\n");
3521
3687
  if (Object.keys(frontmatter).length > 0) {
3522
3688
  content = `
3523
3689
  ${content}`;
@@ -3542,7 +3708,7 @@ function createMarkdocLoader() {
3542
3708
  const result = {};
3543
3709
  const counters = {};
3544
3710
  traverseAndExtract(ast, "", result, counters);
3545
- if (_optionalChain([ast, 'access', _162 => _162.attributes, 'optionalAccess', _163 => _163.frontmatter])) {
3711
+ if (_optionalChain([ast, 'access', _168 => _168.attributes, 'optionalAccess', _169 => _169.frontmatter])) {
3546
3712
  const frontmatter = _yaml2.default.parse(ast.attributes.frontmatter);
3547
3713
  Object.entries(frontmatter).forEach(([key, value]) => {
3548
3714
  if (typeof value === "string") {
@@ -3588,7 +3754,7 @@ function traverseAndExtract(node, path19, result, counters, parentType) {
3588
3754
  if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
3589
3755
  semanticType = nodeSemanticType;
3590
3756
  }
3591
- if (node.type === "text" && _optionalChain([node, 'access', _164 => _164.attributes, 'optionalAccess', _165 => _165.content])) {
3757
+ if (node.type === "text" && _optionalChain([node, 'access', _170 => _170.attributes, 'optionalAccess', _171 => _171.content])) {
3592
3758
  const content = node.attributes.content;
3593
3759
  if (typeof content === "string" && content.trim()) {
3594
3760
  if (semanticType) {
@@ -3615,7 +3781,7 @@ function buildPathMap(node, path19, counters, pathMap, parentType) {
3615
3781
  if (nodeSemanticType && !["text", "strong", "em", "inline", "link"].includes(nodeSemanticType)) {
3616
3782
  semanticType = nodeSemanticType;
3617
3783
  }
3618
- if (node.type === "text" && _optionalChain([node, 'access', _166 => _166.attributes, 'optionalAccess', _167 => _167.content])) {
3784
+ if (node.type === "text" && _optionalChain([node, 'access', _172 => _172.attributes, 'optionalAccess', _173 => _173.content])) {
3619
3785
  const content = node.attributes.content;
3620
3786
  if (typeof content === "string" && content.trim()) {
3621
3787
  if (semanticType) {
@@ -3638,7 +3804,7 @@ function applyTranslations(node, path19, data, pathMap) {
3638
3804
  if (!node || typeof node !== "object") {
3639
3805
  return;
3640
3806
  }
3641
- if (node.type === "text" && _optionalChain([node, 'access', _168 => _168.attributes, 'optionalAccess', _169 => _169.content])) {
3807
+ if (node.type === "text" && _optionalChain([node, 'access', _174 => _174.attributes, 'optionalAccess', _175 => _175.content])) {
3642
3808
  const content = node.attributes.content;
3643
3809
  if (typeof content === "string") {
3644
3810
  const contentPath = path19 ? `${path19}/attributes/content` : "attributes/content";
@@ -3688,7 +3854,7 @@ function isSkippableLine(line) {
3688
3854
  function parsePropertyLine(line) {
3689
3855
  const [key, ...valueParts] = line.split("=");
3690
3856
  return {
3691
- key: _optionalChain([key, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || "",
3857
+ key: _optionalChain([key, 'optionalAccess', _176 => _176.trim, 'call', _177 => _177()]) || "",
3692
3858
  value: valueParts.join("=").trim()
3693
3859
  };
3694
3860
  }
@@ -3980,7 +4146,7 @@ var Parser = class {
3980
4146
  }
3981
4147
  }
3982
4148
  expect(type) {
3983
- if (_optionalChain([this, 'access', _172 => _172.current, 'call', _173 => _173(), 'optionalAccess', _174 => _174.type]) === type) {
4149
+ if (_optionalChain([this, 'access', _178 => _178.current, 'call', _179 => _179(), 'optionalAccess', _180 => _180.type]) === type) {
3984
4150
  this.advance();
3985
4151
  return true;
3986
4152
  }
@@ -4057,7 +4223,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4057
4223
  if (rootTranslationEntity.shouldTranslate === false) {
4058
4224
  continue;
4059
4225
  }
4060
- const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _175 => _175.localizations, 'optionalAccess', _176 => _176[locale]]);
4226
+ const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _181 => _181.localizations, 'optionalAccess', _182 => _182[locale]]);
4061
4227
  if (langTranslationEntity) {
4062
4228
  if ("stringUnit" in langTranslationEntity) {
4063
4229
  resultData[translationKey] = langTranslationEntity.stringUnit.value;
@@ -4071,7 +4237,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4071
4237
  resultData[translationKey] = {};
4072
4238
  const pluralForms = langTranslationEntity.variations.plural;
4073
4239
  for (const form in pluralForms) {
4074
- if (_optionalChain([pluralForms, 'access', _177 => _177[form], 'optionalAccess', _178 => _178.stringUnit, 'optionalAccess', _179 => _179.value])) {
4240
+ if (_optionalChain([pluralForms, 'access', _183 => _183[form], 'optionalAccess', _184 => _184.stringUnit, 'optionalAccess', _185 => _185.value])) {
4075
4241
  resultData[translationKey][form] = pluralForms[form].stringUnit.value;
4076
4242
  }
4077
4243
  }
@@ -4097,7 +4263,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4097
4263
  const hasDoNotTranslateFlag = originalInput && originalInput.strings && originalInput.strings[key] && originalInput.strings[key].shouldTranslate === false;
4098
4264
  if (typeof value === "string") {
4099
4265
  langDataToMerge.strings[key] = {
4100
- extractionState: _optionalChain([originalInput, 'optionalAccess', _180 => _180.strings, 'optionalAccess', _181 => _181[key], 'optionalAccess', _182 => _182.extractionState]),
4266
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _186 => _186.strings, 'optionalAccess', _187 => _187[key], 'optionalAccess', _188 => _188.extractionState]),
4101
4267
  localizations: {
4102
4268
  [locale]: {
4103
4269
  stringUnit: {
@@ -4112,7 +4278,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4112
4278
  }
4113
4279
  } else if (Array.isArray(value)) {
4114
4280
  langDataToMerge.strings[key] = {
4115
- extractionState: _optionalChain([originalInput, 'optionalAccess', _183 => _183.strings, 'optionalAccess', _184 => _184[key], 'optionalAccess', _185 => _185.extractionState]),
4281
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _189 => _189.strings, 'optionalAccess', _190 => _190[key], 'optionalAccess', _191 => _191.extractionState]),
4116
4282
  localizations: {
4117
4283
  [locale]: {
4118
4284
  stringSet: {
@@ -4170,7 +4336,7 @@ function createXcodeXcstringsLoader(defaultLocale) {
4170
4336
  for (const [locale, localization] of Object.entries(
4171
4337
  entity.localizations
4172
4338
  )) {
4173
- if (_optionalChain([localization, 'access', _186 => _186.variations, 'optionalAccess', _187 => _187.plural])) {
4339
+ if (_optionalChain([localization, 'access', _192 => _192.variations, 'optionalAccess', _193 => _193.plural])) {
4174
4340
  const pluralForms = localization.variations.plural;
4175
4341
  for (const form in pluralForms) {
4176
4342
  const pluralKey = `${translationKey}/${form}`;
@@ -4190,7 +4356,7 @@ function _removeLocale(input2, locale) {
4190
4356
  const { strings } = input2;
4191
4357
  const newStrings = _lodash2.default.cloneDeep(strings);
4192
4358
  for (const [key, value] of Object.entries(newStrings)) {
4193
- if (_optionalChain([value, 'access', _188 => _188.localizations, 'optionalAccess', _189 => _189[locale]])) {
4359
+ if (_optionalChain([value, 'access', _194 => _194.localizations, 'optionalAccess', _195 => _195[locale]])) {
4194
4360
  delete value.localizations[locale];
4195
4361
  }
4196
4362
  }
@@ -4321,7 +4487,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
4321
4487
  if (rootTranslationEntity.shouldTranslate === false) {
4322
4488
  continue;
4323
4489
  }
4324
- const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _190 => _190.localizations, 'optionalAccess', _191 => _191[locale]]);
4490
+ const langTranslationEntity = _optionalChain([rootTranslationEntity, 'optionalAccess', _196 => _196.localizations, 'optionalAccess', _197 => _197[locale]]);
4325
4491
  if (langTranslationEntity) {
4326
4492
  if (!resultData[translationKey]) {
4327
4493
  resultData[translationKey] = {};
@@ -4333,7 +4499,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
4333
4499
  for (const [subName, subData] of Object.entries(
4334
4500
  langTranslationEntity.substitutions
4335
4501
  )) {
4336
- const pluralForms = _optionalChain([subData, 'access', _192 => _192.variations, 'optionalAccess', _193 => _193.plural]);
4502
+ const pluralForms = _optionalChain([subData, 'access', _198 => _198.variations, 'optionalAccess', _199 => _199.plural]);
4337
4503
  if (pluralForms) {
4338
4504
  const forms = {};
4339
4505
  for (const [form, formData] of Object.entries(pluralForms)) {
@@ -4358,7 +4524,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
4358
4524
  const pluralForms = langTranslationEntity.variations.plural;
4359
4525
  const forms = {};
4360
4526
  for (const [form, formData] of Object.entries(pluralForms)) {
4361
- if (_optionalChain([formData, 'optionalAccess', _194 => _194.stringUnit, 'optionalAccess', _195 => _195.value])) {
4527
+ if (_optionalChain([formData, 'optionalAccess', _200 => _200.stringUnit, 'optionalAccess', _201 => _201.value])) {
4362
4528
  forms[form] = formData.stringUnit.value;
4363
4529
  }
4364
4530
  }
@@ -4401,7 +4567,7 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
4401
4567
  for (const [subName, subData] of Object.entries(
4402
4568
  keyData.substitutions
4403
4569
  )) {
4404
- const pluralValue = _optionalChain([subData, 'optionalAccess', _196 => _196.variations, 'optionalAccess', _197 => _197.plural]);
4570
+ const pluralValue = _optionalChain([subData, 'optionalAccess', _202 => _202.variations, 'optionalAccess', _203 => _203.plural]);
4405
4571
  if (pluralValue && isIcuPluralString(pluralValue)) {
4406
4572
  try {
4407
4573
  const pluralForms = parseIcuPluralString(pluralValue, locale);
@@ -4414,8 +4580,8 @@ function createXcodeXcstringsV2Loader(defaultLocale) {
4414
4580
  }
4415
4581
  };
4416
4582
  }
4417
- const sourceLocale = _optionalChain([originalInput, 'optionalAccess', _198 => _198.sourceLanguage]) || "en";
4418
- const origFormatSpec = _optionalChain([originalInput, 'optionalAccess', _199 => _199.strings, 'optionalAccess', _200 => _200[baseKey], 'optionalAccess', _201 => _201.localizations, 'optionalAccess', _202 => _202[sourceLocale], 'optionalAccess', _203 => _203.substitutions, 'optionalAccess', _204 => _204[subName], 'optionalAccess', _205 => _205.formatSpecifier]) || subName;
4583
+ const sourceLocale = _optionalChain([originalInput, 'optionalAccess', _204 => _204.sourceLanguage]) || "en";
4584
+ const origFormatSpec = _optionalChain([originalInput, 'optionalAccess', _205 => _205.strings, 'optionalAccess', _206 => _206[baseKey], 'optionalAccess', _207 => _207.localizations, 'optionalAccess', _208 => _208[sourceLocale], 'optionalAccess', _209 => _209.substitutions, 'optionalAccess', _210 => _210[subName], 'optionalAccess', _211 => _211.formatSpecifier]) || subName;
4419
4585
  subs[subName] = {
4420
4586
  formatSpecifier: origFormatSpec,
4421
4587
  variations: {
@@ -4440,7 +4606,7 @@ ${error instanceof Error ? error.message : String(error)}`
4440
4606
  values: keyData.stringSet
4441
4607
  };
4442
4608
  }
4443
- if ("variations" in keyData && _optionalChain([keyData, 'access', _206 => _206.variations, 'optionalAccess', _207 => _207.plural])) {
4609
+ if ("variations" in keyData && _optionalChain([keyData, 'access', _212 => _212.variations, 'optionalAccess', _213 => _213.plural])) {
4444
4610
  const pluralValue = keyData.variations.plural;
4445
4611
  if (isIcuPluralString(pluralValue)) {
4446
4612
  try {
@@ -4467,7 +4633,7 @@ ${error instanceof Error ? error.message : String(error)}`
4467
4633
  }
4468
4634
  if (Object.keys(localizationData).length > 0) {
4469
4635
  langDataToMerge.strings[baseKey] = {
4470
- extractionState: _optionalChain([originalInput, 'optionalAccess', _208 => _208.strings, 'optionalAccess', _209 => _209[baseKey], 'optionalAccess', _210 => _210.extractionState]),
4636
+ extractionState: _optionalChain([originalInput, 'optionalAccess', _214 => _214.strings, 'optionalAccess', _215 => _215[baseKey], 'optionalAccess', _216 => _216.extractionState]),
4471
4637
  localizations: {
4472
4638
  [locale]: localizationData
4473
4639
  }
@@ -4690,8 +4856,8 @@ async function formatDataWithBiome(data, filePath, options) {
4690
4856
  });
4691
4857
  return formatted.content;
4692
4858
  } catch (error) {
4693
- const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _211 => _211.stackTrace, 'optionalAccess', _212 => _212.toString, 'call', _213 => _213(), 'access', _214 => _214.split, 'call', _215 => _215("\n"), 'access', _216 => _216[0]]) : "";
4694
- if (_optionalChain([errorMessage, 'optionalAccess', _217 => _217.includes, 'call', _218 => _218("does not exist in the workspace")])) {
4859
+ const errorMessage = error instanceof Error ? error.message || _optionalChain([error, 'access', _217 => _217.stackTrace, 'optionalAccess', _218 => _218.toString, 'call', _219 => _219(), 'access', _220 => _220.split, 'call', _221 => _221("\n"), 'access', _222 => _222[0]]) : "";
4860
+ if (_optionalChain([errorMessage, 'optionalAccess', _223 => _223.includes, 'call', _224 => _224("does not exist in the workspace")])) {
4695
4861
  } else {
4696
4862
  console.log(`\u26A0\uFE0F Biome skipped ${path14.default.basename(filePath)}`);
4697
4863
  if (errorMessage) {
@@ -4738,7 +4904,7 @@ function createPoDataLoader(params) {
4738
4904
  Object.entries(entries).forEach(([msgid, entry]) => {
4739
4905
  if (msgid && entry.msgid) {
4740
4906
  const context = entry.msgctxt || "";
4741
- const fullEntry = _optionalChain([parsedPo, 'access', _219 => _219.translations, 'access', _220 => _220[context], 'optionalAccess', _221 => _221[msgid]]);
4907
+ const fullEntry = _optionalChain([parsedPo, 'access', _225 => _225.translations, 'access', _226 => _226[context], 'optionalAccess', _227 => _227[msgid]]);
4742
4908
  if (fullEntry) {
4743
4909
  result[msgid] = fullEntry;
4744
4910
  }
@@ -4748,8 +4914,8 @@ function createPoDataLoader(params) {
4748
4914
  return result;
4749
4915
  },
4750
4916
  async push(locale, data, originalInput, originalLocale, pullInput) {
4751
- const currentSections = _optionalChain([pullInput, 'optionalAccess', _222 => _222.split, 'call', _223 => _223("\n\n"), 'access', _224 => _224.filter, 'call', _225 => _225(Boolean)]) || [];
4752
- const originalSections = _optionalChain([originalInput, 'optionalAccess', _226 => _226.split, 'call', _227 => _227("\n\n"), 'access', _228 => _228.filter, 'call', _229 => _229(Boolean)]) || [];
4917
+ const currentSections = _optionalChain([pullInput, 'optionalAccess', _228 => _228.split, 'call', _229 => _229("\n\n"), 'access', _230 => _230.filter, 'call', _231 => _231(Boolean)]) || [];
4918
+ const originalSections = _optionalChain([originalInput, 'optionalAccess', _232 => _232.split, 'call', _233 => _233("\n\n"), 'access', _234 => _234.filter, 'call', _235 => _235(Boolean)]) || [];
4753
4919
  const result = originalSections.map((section) => {
4754
4920
  const sectionPo = _gettextparser2.default.po.parse(section);
4755
4921
  if (Object.keys(sectionPo.translations).length === 0) {
@@ -4818,8 +4984,8 @@ function createPoContentLoader() {
4818
4984
  {
4819
4985
  ...entry,
4820
4986
  msgstr: [
4821
- _optionalChain([data, 'access', _230 => _230[entry.msgid], 'optionalAccess', _231 => _231.singular]),
4822
- _optionalChain([data, 'access', _232 => _232[entry.msgid], 'optionalAccess', _233 => _233.plural]) || null
4987
+ _optionalChain([data, 'access', _236 => _236[entry.msgid], 'optionalAccess', _237 => _237.singular]),
4988
+ _optionalChain([data, 'access', _238 => _238[entry.msgid], 'optionalAccess', _239 => _239.plural]) || null
4823
4989
  ].filter(Boolean)
4824
4990
  }
4825
4991
  ]).fromPairs().value();
@@ -4941,7 +5107,7 @@ function pullV1(xliffElement, locale, originalLocale) {
4941
5107
  let key = getTransUnitKey(unit);
4942
5108
  if (!key) return;
4943
5109
  if (seenKeys.has(key)) {
4944
- const id = _optionalChain([unit, 'access', _234 => _234.getAttribute, 'call', _235 => _235("id"), 'optionalAccess', _236 => _236.trim, 'call', _237 => _237()]);
5110
+ const id = _optionalChain([unit, 'access', _240 => _240.getAttribute, 'call', _241 => _241("id"), 'optionalAccess', _242 => _242.trim, 'call', _243 => _243()]);
4945
5111
  if (id) {
4946
5112
  key = `${key}#${id}`;
4947
5113
  } else {
@@ -4989,7 +5155,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
4989
5155
  let key = getTransUnitKey(unit);
4990
5156
  if (!key) return;
4991
5157
  if (seenKeys.has(key)) {
4992
- const id = _optionalChain([unit, 'access', _238 => _238.getAttribute, 'call', _239 => _239("id"), 'optionalAccess', _240 => _240.trim, 'call', _241 => _241()]);
5158
+ const id = _optionalChain([unit, 'access', _244 => _244.getAttribute, 'call', _245 => _245("id"), 'optionalAccess', _246 => _246.trim, 'call', _247 => _247()]);
4993
5159
  if (id) {
4994
5160
  key = `${key}#${id}`;
4995
5161
  } else {
@@ -5031,7 +5197,7 @@ function pushV1(dom, xliffElement, locale, translations, originalLocale, origina
5031
5197
  const translationKeys = new Set(Object.keys(translations));
5032
5198
  existingUnits.forEach((unit, key) => {
5033
5199
  if (!translationKeys.has(key)) {
5034
- _optionalChain([unit, 'access', _242 => _242.parentNode, 'optionalAccess', _243 => _243.removeChild, 'call', _244 => _244(unit)]);
5200
+ _optionalChain([unit, 'access', _248 => _248.parentNode, 'optionalAccess', _249 => _249.removeChild, 'call', _250 => _250(unit)]);
5035
5201
  }
5036
5202
  });
5037
5203
  return serializeWithDeclaration(
@@ -5074,18 +5240,18 @@ function traverseUnitsV2(container, fileId, currentPath, result) {
5074
5240
  Array.from(container.children).forEach((child) => {
5075
5241
  const tagName = child.tagName;
5076
5242
  if (tagName === "unit") {
5077
- const unitId = _optionalChain([child, 'access', _245 => _245.getAttribute, 'call', _246 => _246("id"), 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]);
5243
+ const unitId = _optionalChain([child, 'access', _251 => _251.getAttribute, 'call', _252 => _252("id"), 'optionalAccess', _253 => _253.trim, 'call', _254 => _254()]);
5078
5244
  if (!unitId) return;
5079
5245
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
5080
5246
  const segment = child.querySelector("segment");
5081
- const source = _optionalChain([segment, 'optionalAccess', _249 => _249.querySelector, 'call', _250 => _250("source")]);
5247
+ const source = _optionalChain([segment, 'optionalAccess', _255 => _255.querySelector, 'call', _256 => _256("source")]);
5082
5248
  if (source) {
5083
5249
  result[key] = extractTextContent(source);
5084
5250
  } else {
5085
5251
  result[key] = unitId;
5086
5252
  }
5087
5253
  } else if (tagName === "group") {
5088
- const groupId = _optionalChain([child, 'access', _251 => _251.getAttribute, 'call', _252 => _252("id"), 'optionalAccess', _253 => _253.trim, 'call', _254 => _254()]);
5254
+ const groupId = _optionalChain([child, 'access', _257 => _257.getAttribute, 'call', _258 => _258("id"), 'optionalAccess', _259 => _259.trim, 'call', _260 => _260()]);
5089
5255
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
5090
5256
  traverseUnitsV2(child, fileId, newPath, result);
5091
5257
  }
@@ -5121,12 +5287,12 @@ function indexUnitsV2(container, fileId, currentPath, index) {
5121
5287
  Array.from(container.children).forEach((child) => {
5122
5288
  const tagName = child.tagName;
5123
5289
  if (tagName === "unit") {
5124
- const unitId = _optionalChain([child, 'access', _255 => _255.getAttribute, 'call', _256 => _256("id"), 'optionalAccess', _257 => _257.trim, 'call', _258 => _258()]);
5290
+ const unitId = _optionalChain([child, 'access', _261 => _261.getAttribute, 'call', _262 => _262("id"), 'optionalAccess', _263 => _263.trim, 'call', _264 => _264()]);
5125
5291
  if (!unitId) return;
5126
5292
  const key = `resources/${fileId}/${currentPath}${unitId}/source`;
5127
5293
  index.set(key, child);
5128
5294
  } else if (tagName === "group") {
5129
- const groupId = _optionalChain([child, 'access', _259 => _259.getAttribute, 'call', _260 => _260("id"), 'optionalAccess', _261 => _261.trim, 'call', _262 => _262()]);
5295
+ const groupId = _optionalChain([child, 'access', _265 => _265.getAttribute, 'call', _266 => _266("id"), 'optionalAccess', _267 => _267.trim, 'call', _268 => _268()]);
5130
5296
  const newPath = groupId ? `${currentPath}${groupId}/groupUnits/` : currentPath;
5131
5297
  indexUnitsV2(child, fileId, newPath, index);
5132
5298
  }
@@ -5147,9 +5313,9 @@ function updateUnitV2(unit, value) {
5147
5313
  setTextContent(source, value);
5148
5314
  }
5149
5315
  function getTransUnitKey(transUnit) {
5150
- const resname = _optionalChain([transUnit, 'access', _263 => _263.getAttribute, 'call', _264 => _264("resname"), 'optionalAccess', _265 => _265.trim, 'call', _266 => _266()]);
5316
+ const resname = _optionalChain([transUnit, 'access', _269 => _269.getAttribute, 'call', _270 => _270("resname"), 'optionalAccess', _271 => _271.trim, 'call', _272 => _272()]);
5151
5317
  if (resname) return resname;
5152
- const id = _optionalChain([transUnit, 'access', _267 => _267.getAttribute, 'call', _268 => _268("id"), 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()]);
5318
+ const id = _optionalChain([transUnit, 'access', _273 => _273.getAttribute, 'call', _274 => _274("id"), 'optionalAccess', _275 => _275.trim, 'call', _276 => _276()]);
5153
5319
  if (id) return id;
5154
5320
  const sourceElement = transUnit.querySelector("source");
5155
5321
  if (sourceElement) {
@@ -5206,7 +5372,7 @@ function formatXml(xml) {
5206
5372
  if (cdataNode) {
5207
5373
  return `${indent2}${openTag}<![CDATA[${cdataNode.nodeValue}]]></${tagName}>`;
5208
5374
  }
5209
- const textContent = _optionalChain([element, 'access', _271 => _271.textContent, 'optionalAccess', _272 => _272.trim, 'call', _273 => _273()]) || "";
5375
+ const textContent = _optionalChain([element, 'access', _277 => _277.textContent, 'optionalAccess', _278 => _278.trim, 'call', _279 => _279()]) || "";
5210
5376
  const hasOnlyText = element.childNodes.length === 1 && element.childNodes[0].nodeType === 3;
5211
5377
  if (hasOnlyText && textContent) {
5212
5378
  return `${indent2}${openTag}${textContent}</${tagName}>`;
@@ -5499,7 +5665,7 @@ function createDatoClient(params) {
5499
5665
  ids: !records.length ? void 0 : records.join(",")
5500
5666
  }
5501
5667
  }).catch(
5502
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _274 => _274.response, 'optionalAccess', _275 => _275.body, 'optionalAccess', _276 => _276.data, 'optionalAccess', _277 => _277[0]]) || error)
5668
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _280 => _280.response, 'optionalAccess', _281 => _281.body, 'optionalAccess', _282 => _282.data, 'optionalAccess', _283 => _283[0]]) || error)
5503
5669
  );
5504
5670
  },
5505
5671
  findRecordsForModel: async (modelId, records) => {
@@ -5510,10 +5676,10 @@ function createDatoClient(params) {
5510
5676
  filter: {
5511
5677
  type: modelId,
5512
5678
  only_valid: "true",
5513
- ids: !_optionalChain([records, 'optionalAccess', _278 => _278.length]) ? void 0 : records.join(",")
5679
+ ids: !_optionalChain([records, 'optionalAccess', _284 => _284.length]) ? void 0 : records.join(",")
5514
5680
  }
5515
5681
  }).catch(
5516
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _279 => _279.response, 'optionalAccess', _280 => _280.body, 'optionalAccess', _281 => _281.data, 'optionalAccess', _282 => _282[0]]) || error)
5682
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _285 => _285.response, 'optionalAccess', _286 => _286.body, 'optionalAccess', _287 => _287.data, 'optionalAccess', _288 => _288[0]]) || error)
5517
5683
  );
5518
5684
  return result;
5519
5685
  } catch (_error) {
@@ -5529,10 +5695,10 @@ function createDatoClient(params) {
5529
5695
  updateRecord: async (id, payload) => {
5530
5696
  try {
5531
5697
  await dato.items.update(id, payload).catch(
5532
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _283 => _283.response, 'optionalAccess', _284 => _284.body, 'optionalAccess', _285 => _285.data, 'optionalAccess', _286 => _286[0]]) || error)
5698
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _289 => _289.response, 'optionalAccess', _290 => _290.body, 'optionalAccess', _291 => _291.data, 'optionalAccess', _292 => _292[0]]) || error)
5533
5699
  );
5534
5700
  } catch (_error) {
5535
- if (_optionalChain([_error, 'optionalAccess', _287 => _287.attributes, 'optionalAccess', _288 => _288.details, 'optionalAccess', _289 => _289.message])) {
5701
+ if (_optionalChain([_error, 'optionalAccess', _293 => _293.attributes, 'optionalAccess', _294 => _294.details, 'optionalAccess', _295 => _295.message])) {
5536
5702
  throw new Error(
5537
5703
  [
5538
5704
  `${_error.attributes.details.message}`,
@@ -5554,10 +5720,10 @@ function createDatoClient(params) {
5554
5720
  enableFieldLocalization: async (args) => {
5555
5721
  try {
5556
5722
  await dato.fields.update(`${args.modelId}::${args.fieldId}`, { localized: true }).catch(
5557
- (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _290 => _290.response, 'optionalAccess', _291 => _291.body, 'optionalAccess', _292 => _292.data, 'optionalAccess', _293 => _293[0]]) || error)
5723
+ (error) => Promise.reject(_optionalChain([error, 'optionalAccess', _296 => _296.response, 'optionalAccess', _297 => _297.body, 'optionalAccess', _298 => _298.data, 'optionalAccess', _299 => _299[0]]) || error)
5558
5724
  );
5559
5725
  } catch (_error) {
5560
- if (_optionalChain([_error, 'optionalAccess', _294 => _294.attributes, 'optionalAccess', _295 => _295.code]) === "NOT_FOUND") {
5726
+ if (_optionalChain([_error, 'optionalAccess', _300 => _300.attributes, 'optionalAccess', _301 => _301.code]) === "NOT_FOUND") {
5561
5727
  throw new Error(
5562
5728
  [
5563
5729
  `Field "${args.fieldId}" not found in model "${args.modelId}".`,
@@ -5565,7 +5731,7 @@ function createDatoClient(params) {
5565
5731
  ].join("\n\n")
5566
5732
  );
5567
5733
  }
5568
- if (_optionalChain([_error, 'optionalAccess', _296 => _296.attributes, 'optionalAccess', _297 => _297.details, 'optionalAccess', _298 => _298.message])) {
5734
+ if (_optionalChain([_error, 'optionalAccess', _302 => _302.attributes, 'optionalAccess', _303 => _303.details, 'optionalAccess', _304 => _304.message])) {
5569
5735
  throw new Error(
5570
5736
  [
5571
5737
  `${_error.attributes.details.message}`,
@@ -5643,7 +5809,7 @@ function createDatoApiLoader(config, onConfigUpdate) {
5643
5809
  const records = await dato.findRecordsForModel(modelId);
5644
5810
  const recordChoices = createRecordChoices(
5645
5811
  records,
5646
- _optionalChain([config, 'access', _299 => _299.models, 'access', _300 => _300[modelId], 'optionalAccess', _301 => _301.records]) || [],
5812
+ _optionalChain([config, 'access', _305 => _305.models, 'access', _306 => _306[modelId], 'optionalAccess', _307 => _307.records]) || [],
5647
5813
  project
5648
5814
  );
5649
5815
  const selectedRecords = await promptRecordSelection(
@@ -5662,14 +5828,14 @@ function createDatoApiLoader(config, onConfigUpdate) {
5662
5828
  },
5663
5829
  async pull(locale, input2, initCtx) {
5664
5830
  const result = {};
5665
- for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _302 => _302.models]) || {})) {
5666
- let records = _optionalChain([initCtx, 'optionalAccess', _303 => _303.models, 'access', _304 => _304[modelId], 'access', _305 => _305.records]) || [];
5831
+ for (const modelId of _lodash2.default.keys(_optionalChain([initCtx, 'optionalAccess', _308 => _308.models]) || {})) {
5832
+ let records = _optionalChain([initCtx, 'optionalAccess', _309 => _309.models, 'access', _310 => _310[modelId], 'access', _311 => _311.records]) || [];
5667
5833
  const recordIds = records.map((record) => record.id);
5668
5834
  records = await dato.findRecords(recordIds);
5669
5835
  console.log(`Fetched ${records.length} records for model ${modelId}`);
5670
5836
  if (records.length > 0) {
5671
5837
  result[modelId] = {
5672
- fields: _optionalChain([initCtx, 'optionalAccess', _306 => _306.models, 'optionalAccess', _307 => _307[modelId], 'optionalAccess', _308 => _308.fields]) || [],
5838
+ fields: _optionalChain([initCtx, 'optionalAccess', _312 => _312.models, 'optionalAccess', _313 => _313[modelId], 'optionalAccess', _314 => _314.fields]) || [],
5673
5839
  records
5674
5840
  };
5675
5841
  }
@@ -5732,7 +5898,7 @@ function createRecordChoices(records, selectedIds = [], project) {
5732
5898
  return records.map((record) => ({
5733
5899
  name: `${record.id} - https://${project.internal_domain}/editor/item_types/${record.item_type.id}/items/${record.id}`,
5734
5900
  value: record.id,
5735
- checked: _optionalChain([selectedIds, 'optionalAccess', _309 => _309.includes, 'call', _310 => _310(record.id)])
5901
+ checked: _optionalChain([selectedIds, 'optionalAccess', _315 => _315.includes, 'call', _316 => _316(record.id)])
5736
5902
  }));
5737
5903
  }
5738
5904
  async function promptRecordSelection(modelName, choices) {
@@ -6051,7 +6217,7 @@ function createVttLoader() {
6051
6217
  if (!input2) {
6052
6218
  return "";
6053
6219
  }
6054
- const vtt = _optionalChain([_nodewebvtt2.default, 'access', _311 => _311.parse, 'call', _312 => _312(input2), 'optionalAccess', _313 => _313.cues]);
6220
+ const vtt = _optionalChain([_nodewebvtt2.default, 'access', _317 => _317.parse, 'call', _318 => _318(input2), 'optionalAccess', _319 => _319.cues]);
6055
6221
  if (Object.keys(vtt).length === 0) {
6056
6222
  return {};
6057
6223
  } else {
@@ -6105,7 +6271,7 @@ function variableExtractLoader(params) {
6105
6271
  for (let i = 0; i < matches.length; i++) {
6106
6272
  const match2 = matches[i];
6107
6273
  const currentValue = result[key].value;
6108
- const newValue = _optionalChain([currentValue, 'optionalAccess', _314 => _314.replace, 'call', _315 => _315(match2, `{variable:${i}}`)]);
6274
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _320 => _320.replace, 'call', _321 => _321(match2, `{variable:${i}}`)]);
6109
6275
  result[key].value = newValue;
6110
6276
  result[key].variables[i] = match2;
6111
6277
  }
@@ -6120,7 +6286,7 @@ function variableExtractLoader(params) {
6120
6286
  const variable = valueObj.variables[i];
6121
6287
  const currentValue = result[key];
6122
6288
  if (typeof currentValue === "string") {
6123
- const newValue = _optionalChain([currentValue, 'optionalAccess', _316 => _316.replaceAll, 'call', _317 => _317(
6289
+ const newValue = _optionalChain([currentValue, 'optionalAccess', _322 => _322.replaceAll, 'call', _323 => _323(
6124
6290
  `{variable:${i}}`,
6125
6291
  variable
6126
6292
  )]);
@@ -6324,7 +6490,7 @@ function createVueJsonLoader() {
6324
6490
  return createLoader({
6325
6491
  pull: async (locale, input2, ctx) => {
6326
6492
  const parsed = parseVueFile(input2);
6327
- return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _318 => _318.i18n, 'optionalAccess', _319 => _319[locale]]), () => ( {}));
6493
+ return _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _324 => _324.i18n, 'optionalAccess', _325 => _325[locale]]), () => ( {}));
6328
6494
  },
6329
6495
  push: async (locale, data, originalInput) => {
6330
6496
  const parsed = parseVueFile(_nullishCoalesce(originalInput, () => ( "")));
@@ -6509,7 +6675,7 @@ function updateStringsInObjectExpression(objectExpression, data) {
6509
6675
  objectExpression.properties.forEach((prop) => {
6510
6676
  if (!t.isObjectProperty(prop)) return;
6511
6677
  const key = getPropertyKey(prop);
6512
- const incomingVal = _optionalChain([data, 'optionalAccess', _320 => _320[key]]);
6678
+ const incomingVal = _optionalChain([data, 'optionalAccess', _326 => _326[key]]);
6513
6679
  if (incomingVal === void 0) {
6514
6680
  return;
6515
6681
  }
@@ -6545,7 +6711,7 @@ function updateStringsInArrayExpression(arrayExpression, incoming) {
6545
6711
  let modified = false;
6546
6712
  arrayExpression.elements.forEach((element, index) => {
6547
6713
  if (!element) return;
6548
- const incomingVal = _optionalChain([incoming, 'optionalAccess', _321 => _321[index]]);
6714
+ const incomingVal = _optionalChain([incoming, 'optionalAccess', _327 => _327[index]]);
6549
6715
  if (incomingVal === void 0) return;
6550
6716
  if (t.isStringLiteral(element) && typeof incomingVal === "string") {
6551
6717
  if (element.value !== incomingVal) {
@@ -7039,7 +7205,7 @@ var AST = class _AST {
7039
7205
  const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
7040
7206
  if (this.isStart() && !this.type)
7041
7207
  ret.unshift([]);
7042
- if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _322 => _322.#parent, 'optionalAccess', _323 => _323.type]) === "!")) {
7208
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && _optionalChain([this, 'access', _328 => _328.#parent, 'optionalAccess', _329 => _329.type]) === "!")) {
7043
7209
  ret.push({});
7044
7210
  }
7045
7211
  return ret;
@@ -7047,7 +7213,7 @@ var AST = class _AST {
7047
7213
  isStart() {
7048
7214
  if (this.#root === this)
7049
7215
  return true;
7050
- if (!_optionalChain([this, 'access', _324 => _324.#parent, 'optionalAccess', _325 => _325.isStart, 'call', _326 => _326()]))
7216
+ if (!_optionalChain([this, 'access', _330 => _330.#parent, 'optionalAccess', _331 => _331.isStart, 'call', _332 => _332()]))
7051
7217
  return false;
7052
7218
  if (this.#parentIndex === 0)
7053
7219
  return true;
@@ -7063,12 +7229,12 @@ var AST = class _AST {
7063
7229
  isEnd() {
7064
7230
  if (this.#root === this)
7065
7231
  return true;
7066
- if (_optionalChain([this, 'access', _327 => _327.#parent, 'optionalAccess', _328 => _328.type]) === "!")
7232
+ if (_optionalChain([this, 'access', _333 => _333.#parent, 'optionalAccess', _334 => _334.type]) === "!")
7067
7233
  return true;
7068
- if (!_optionalChain([this, 'access', _329 => _329.#parent, 'optionalAccess', _330 => _330.isEnd, 'call', _331 => _331()]))
7234
+ if (!_optionalChain([this, 'access', _335 => _335.#parent, 'optionalAccess', _336 => _336.isEnd, 'call', _337 => _337()]))
7069
7235
  return false;
7070
7236
  if (!this.type)
7071
- return _optionalChain([this, 'access', _332 => _332.#parent, 'optionalAccess', _333 => _333.isEnd, 'call', _334 => _334()]);
7237
+ return _optionalChain([this, 'access', _338 => _338.#parent, 'optionalAccess', _339 => _339.isEnd, 'call', _340 => _340()]);
7072
7238
  const pl = this.#parent ? this.#parent.#parts.length : 0;
7073
7239
  return this.#parentIndex === pl - 1;
7074
7240
  }
@@ -7313,7 +7479,7 @@ var AST = class _AST {
7313
7479
  }
7314
7480
  }
7315
7481
  let end = "";
7316
- if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _335 => _335.#parent, 'optionalAccess', _336 => _336.type]) === "!") {
7482
+ if (this.isEnd() && this.#root.#filledNegs && _optionalChain([this, 'access', _341 => _341.#parent, 'optionalAccess', _342 => _342.type]) === "!") {
7317
7483
  end = "(?:$|\\/)";
7318
7484
  }
7319
7485
  const final2 = start2 + src + end;
@@ -8414,7 +8580,7 @@ function createMdxSectionsSplit2Loader() {
8414
8580
  const content = _lodash2.default.chain(data.sections).values().join("\n\n").value();
8415
8581
  const result = {
8416
8582
  frontmatter: data.frontmatter,
8417
- codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _337 => _337.codePlaceholders]) || {},
8583
+ codePlaceholders: _optionalChain([pullInput, 'optionalAccess', _343 => _343.codePlaceholders]) || {},
8418
8584
  content
8419
8585
  };
8420
8586
  return result;
@@ -9514,7 +9680,7 @@ function createBasicTranslator(model, systemPrompt, settings = {}) {
9514
9680
  ]
9515
9681
  });
9516
9682
  const result = JSON.parse(response.text);
9517
- return _optionalChain([result, 'optionalAccess', _338 => _338.data]) || {};
9683
+ return _optionalChain([result, 'optionalAccess', _344 => _344.data]) || {};
9518
9684
  }
9519
9685
  }
9520
9686
  function extractPayloadChunks(payload) {
@@ -9597,7 +9763,7 @@ function getPureModelProvider(provider) {
9597
9763
 
9598
9764
  ${_chalk2.default.hex(colors.blue)("Docs: https://lingo.dev/go/docs")}
9599
9765
  `;
9600
- switch (_optionalChain([provider, 'optionalAccess', _339 => _339.id])) {
9766
+ switch (_optionalChain([provider, 'optionalAccess', _345 => _345.id])) {
9601
9767
  case "openai": {
9602
9768
  if (!process.env.OPENAI_API_KEY) {
9603
9769
  throw new Error(
@@ -9655,7 +9821,7 @@ function getPureModelProvider(provider) {
9655
9821
  })(provider.model);
9656
9822
  }
9657
9823
  default: {
9658
- throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _340 => _340.id])));
9824
+ throw new Error(createUnsupportedProviderErrorMessage(_optionalChain([provider, 'optionalAccess', _346 => _346.id])));
9659
9825
  }
9660
9826
  }
9661
9827
  }
@@ -9941,7 +10107,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
9941
10107
  validateParams(i18nConfig, flags);
9942
10108
  ora.succeed("Localization configuration is valid");
9943
10109
  ora.start("Connecting to Lingo.dev Localization Engine...");
9944
- const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _341 => _341.provider]);
10110
+ const isByokMode = !!_optionalChain([i18nConfig, 'optionalAccess', _347 => _347.provider]);
9945
10111
  if (isByokMode) {
9946
10112
  authId = null;
9947
10113
  ora.succeed("Using external provider (BYOK mode)");
@@ -9955,16 +10121,16 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
9955
10121
  flags
9956
10122
  });
9957
10123
  let buckets = getBuckets(i18nConfig);
9958
- if (_optionalChain([flags, 'access', _342 => _342.bucket, 'optionalAccess', _343 => _343.length])) {
10124
+ if (_optionalChain([flags, 'access', _348 => _348.bucket, 'optionalAccess', _349 => _349.length])) {
9959
10125
  buckets = buckets.filter(
9960
10126
  (bucket) => flags.bucket.includes(bucket.type)
9961
10127
  );
9962
10128
  }
9963
10129
  ora.succeed("Buckets retrieved");
9964
- if (_optionalChain([flags, 'access', _344 => _344.file, 'optionalAccess', _345 => _345.length])) {
10130
+ if (_optionalChain([flags, 'access', _350 => _350.file, 'optionalAccess', _351 => _351.length])) {
9965
10131
  buckets = buckets.map((bucket) => {
9966
10132
  const paths = bucket.paths.filter(
9967
- (path19) => flags.file.find((file) => _optionalChain([path19, 'access', _346 => _346.pathPattern, 'optionalAccess', _347 => _347.includes, 'call', _348 => _348(file)]))
10133
+ (path19) => flags.file.find((file) => _optionalChain([path19, 'access', _352 => _352.pathPattern, 'optionalAccess', _353 => _353.includes, 'call', _354 => _354(file)]))
9968
10134
  );
9969
10135
  return { ...bucket, paths };
9970
10136
  }).filter((bucket) => bucket.paths.length > 0);
@@ -9985,7 +10151,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
9985
10151
  });
9986
10152
  }
9987
10153
  }
9988
- const targetLocales = _optionalChain([flags, 'access', _349 => _349.locale, 'optionalAccess', _350 => _350.length]) ? flags.locale : i18nConfig.locale.targets;
10154
+ const targetLocales = _optionalChain([flags, 'access', _355 => _355.locale, 'optionalAccess', _356 => _356.length]) ? flags.locale : i18nConfig.locale.targets;
9989
10155
  ora.start("Setting up localization cache...");
9990
10156
  const checkLockfileProcessor = createDeltaProcessor("");
9991
10157
  const lockfileExists = await checkLockfileProcessor.checkIfLockExists();
@@ -10270,7 +10436,7 @@ var i18n_default = new (0, _interactivecommander.Command)().command("i18n").desc
10270
10436
  }
10271
10437
  const deltaProcessor = createDeltaProcessor(bucketPath.pathPattern);
10272
10438
  const checksums = await deltaProcessor.createChecksums(sourceData);
10273
- if (!_optionalChain([flags, 'access', _351 => _351.locale, 'optionalAccess', _352 => _352.length])) {
10439
+ if (!_optionalChain([flags, 'access', _357 => _357.locale, 'optionalAccess', _358 => _358.length])) {
10274
10440
  await deltaProcessor.saveChecksums(checksums);
10275
10441
  }
10276
10442
  }
@@ -10394,12 +10560,12 @@ function validateParams(i18nConfig, flags) {
10394
10560
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
10395
10561
  docUrl: "bucketNotFound"
10396
10562
  });
10397
- } else if (_optionalChain([flags, 'access', _353 => _353.locale, 'optionalAccess', _354 => _354.some, 'call', _355 => _355((locale) => !i18nConfig.locale.targets.includes(locale))])) {
10563
+ } else if (_optionalChain([flags, 'access', _359 => _359.locale, 'optionalAccess', _360 => _360.some, 'call', _361 => _361((locale) => !i18nConfig.locale.targets.includes(locale))])) {
10398
10564
  throw new ValidationError({
10399
10565
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
10400
10566
  docUrl: "localeTargetNotFound"
10401
10567
  });
10402
- } else if (_optionalChain([flags, 'access', _356 => _356.bucket, 'optionalAccess', _357 => _357.some, 'call', _358 => _358(
10568
+ } else if (_optionalChain([flags, 'access', _362 => _362.bucket, 'optionalAccess', _363 => _363.some, 'call', _364 => _364(
10403
10569
  (bucket) => !i18nConfig.buckets[bucket]
10404
10570
  )])) {
10405
10571
  throw new ValidationError({
@@ -10933,7 +11099,7 @@ function createLingoDotDevLocalizer(explicitApiKey) {
10933
11099
  const response = await engine.whoami();
10934
11100
  return {
10935
11101
  authenticated: !!response,
10936
- username: _optionalChain([response, 'optionalAccess', _359 => _359.email])
11102
+ username: _optionalChain([response, 'optionalAccess', _365 => _365.email])
10937
11103
  };
10938
11104
  } catch (error) {
10939
11105
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -11049,7 +11215,7 @@ function createExplicitLocalizer(provider) {
11049
11215
  }
11050
11216
  function createAiSdkLocalizer(params) {
11051
11217
  const skipAuth = params.skipAuth === true;
11052
- const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _360 => _360.apiKeyName]), () => ( ""))];
11218
+ const apiKey = process.env[_nullishCoalesce(_optionalChain([params, 'optionalAccess', _366 => _366.apiKeyName]), () => ( ""))];
11053
11219
  if (!skipAuth && !apiKey || !params.apiKeyName) {
11054
11220
  throw new Error(
11055
11221
  _dedent2.default`
@@ -11183,8 +11349,8 @@ async function setup(input2) {
11183
11349
  throw new Error(
11184
11350
  "No buckets found in i18n.json. Please add at least one bucket containing i18n content."
11185
11351
  );
11186
- } else if (_optionalChain([ctx, 'access', _361 => _361.flags, 'access', _362 => _362.bucket, 'optionalAccess', _363 => _363.some, 'call', _364 => _364(
11187
- (bucket) => !_optionalChain([ctx, 'access', _365 => _365.config, 'optionalAccess', _366 => _366.buckets, 'access', _367 => _367[bucket]])
11352
+ } else if (_optionalChain([ctx, 'access', _367 => _367.flags, 'access', _368 => _368.bucket, 'optionalAccess', _369 => _369.some, 'call', _370 => _370(
11353
+ (bucket) => !_optionalChain([ctx, 'access', _371 => _371.config, 'optionalAccess', _372 => _372.buckets, 'access', _373 => _373[bucket]])
11188
11354
  )])) {
11189
11355
  throw new Error(
11190
11356
  `One or more specified buckets do not exist in i18n.json. Please add them to the list first and try again.`
@@ -11197,7 +11363,7 @@ async function setup(input2) {
11197
11363
  title: "Selecting localization provider",
11198
11364
  task: async (ctx, task) => {
11199
11365
  ctx.localizer = createLocalizer(
11200
- _optionalChain([ctx, 'access', _368 => _368.config, 'optionalAccess', _369 => _369.provider]),
11366
+ _optionalChain([ctx, 'access', _374 => _374.config, 'optionalAccess', _375 => _375.provider]),
11201
11367
  ctx.flags.apiKey
11202
11368
  );
11203
11369
  if (!ctx.localizer) {
@@ -11210,7 +11376,7 @@ async function setup(input2) {
11210
11376
  },
11211
11377
  {
11212
11378
  title: "Checking authentication",
11213
- enabled: (ctx) => _optionalChain([ctx, 'access', _370 => _370.localizer, 'optionalAccess', _371 => _371.id]) === "Lingo.dev",
11379
+ enabled: (ctx) => _optionalChain([ctx, 'access', _376 => _376.localizer, 'optionalAccess', _377 => _377.id]) === "Lingo.dev",
11214
11380
  task: async (ctx, task) => {
11215
11381
  const authStatus = await ctx.localizer.checkAuth();
11216
11382
  if (!authStatus.authenticated) {
@@ -11223,7 +11389,7 @@ async function setup(input2) {
11223
11389
  },
11224
11390
  {
11225
11391
  title: "Validating configuration",
11226
- enabled: (ctx) => _optionalChain([ctx, 'access', _372 => _372.localizer, 'optionalAccess', _373 => _373.id]) !== "Lingo.dev",
11392
+ enabled: (ctx) => _optionalChain([ctx, 'access', _378 => _378.localizer, 'optionalAccess', _379 => _379.id]) !== "Lingo.dev",
11227
11393
  task: async (ctx, task) => {
11228
11394
  const validationStatus = await ctx.localizer.validateSettings();
11229
11395
  if (!validationStatus.valid) {
@@ -11554,7 +11720,7 @@ function createWorkerTask(args) {
11554
11720
  const processableData = _lodash2.default.chain(sourceData).entries().filter(
11555
11721
  ([key, value]) => delta.added.includes(key) || delta.updated.includes(key) || !!args.ctx.flags.force
11556
11722
  ).filter(
11557
- ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _374 => _374.onlyKeys, 'optionalAccess', _375 => _375.some, 'call', _376 => _376(
11723
+ ([key]) => !assignedTask.onlyKeys.length || _optionalChain([assignedTask, 'access', _380 => _380.onlyKeys, 'optionalAccess', _381 => _381.some, 'call', _382 => _382(
11558
11724
  (pattern) => minimatch(key, pattern)
11559
11725
  )])
11560
11726
  ).fromPairs().value();
@@ -11622,7 +11788,7 @@ function createWorkerTask(args) {
11622
11788
  finalRenamedTargetData
11623
11789
  );
11624
11790
  const checksums = await deltaProcessor.createChecksums(sourceData);
11625
- if (!_optionalChain([args, 'access', _377 => _377.ctx, 'access', _378 => _378.flags, 'access', _379 => _379.targetLocale, 'optionalAccess', _380 => _380.length])) {
11791
+ if (!_optionalChain([args, 'access', _383 => _383.ctx, 'access', _384 => _384.flags, 'access', _385 => _385.targetLocale, 'optionalAccess', _386 => _386.length])) {
11626
11792
  await deltaProcessor.saveChecksums(checksums);
11627
11793
  }
11628
11794
  });
@@ -11827,10 +11993,10 @@ var flagsSchema2 = _zod.z.object({
11827
11993
  async function frozen(input2) {
11828
11994
  console.log(_chalk2.default.hex(colors.orange)("[Frozen]"));
11829
11995
  let buckets = getBuckets(input2.config);
11830
- if (_optionalChain([input2, 'access', _381 => _381.flags, 'access', _382 => _382.bucket, 'optionalAccess', _383 => _383.length])) {
11996
+ if (_optionalChain([input2, 'access', _387 => _387.flags, 'access', _388 => _388.bucket, 'optionalAccess', _389 => _389.length])) {
11831
11997
  buckets = buckets.filter((b) => input2.flags.bucket.includes(b.type));
11832
11998
  }
11833
- if (_optionalChain([input2, 'access', _384 => _384.flags, 'access', _385 => _385.file, 'optionalAccess', _386 => _386.length])) {
11999
+ if (_optionalChain([input2, 'access', _390 => _390.flags, 'access', _391 => _391.file, 'optionalAccess', _392 => _392.length])) {
11834
12000
  buckets = buckets.map((bucket) => {
11835
12001
  const paths = bucket.paths.filter(
11836
12002
  (p) => input2.flags.file.some(
@@ -11967,13 +12133,13 @@ async function frozen(input2) {
11967
12133
 
11968
12134
  // src/cli/cmd/run/_utils.ts
11969
12135
  async function determineAuthId(ctx) {
11970
- const isByokMode = !!_optionalChain([ctx, 'access', _387 => _387.config, 'optionalAccess', _388 => _388.provider]);
12136
+ const isByokMode = !!_optionalChain([ctx, 'access', _393 => _393.config, 'optionalAccess', _394 => _394.provider]);
11971
12137
  if (isByokMode) {
11972
12138
  return null;
11973
12139
  } else {
11974
12140
  try {
11975
- const authStatus = await _optionalChain([ctx, 'access', _389 => _389.localizer, 'optionalAccess', _390 => _390.checkAuth, 'call', _391 => _391()]);
11976
- return _optionalChain([authStatus, 'optionalAccess', _392 => _392.username]) || null;
12141
+ const authStatus = await _optionalChain([ctx, 'access', _395 => _395.localizer, 'optionalAccess', _396 => _396.checkAuth, 'call', _397 => _397()]);
12142
+ return _optionalChain([authStatus, 'optionalAccess', _398 => _398.username]) || null;
11977
12143
  } catch (e3) {
11978
12144
  return null;
11979
12145
  }
@@ -12171,7 +12337,7 @@ var InBranchFlow = class extends IntegrationFlow {
12171
12337
  _child_process.execSync.call(void 0, `git config --global safe.directory ${process.cwd()}`);
12172
12338
  _child_process.execSync.call(void 0, `git config user.name "${gitConfig.userName}"`);
12173
12339
  _child_process.execSync.call(void 0, `git config user.email "${gitConfig.userEmail}"`);
12174
- _optionalChain([this, 'access', _393 => _393.platformKit, 'optionalAccess', _394 => _394.gitConfig, 'call', _395 => _395()]);
12340
+ _optionalChain([this, 'access', _399 => _399.platformKit, 'optionalAccess', _400 => _400.gitConfig, 'call', _401 => _401()]);
12175
12341
  _child_process.execSync.call(void 0, `git fetch origin ${baseBranchName}`, { stdio: "inherit" });
12176
12342
  _child_process.execSync.call(void 0, `git checkout ${baseBranchName} --`, { stdio: "inherit" });
12177
12343
  if (!processOwnCommits) {
@@ -12203,7 +12369,7 @@ var InBranchFlow = class extends IntegrationFlow {
12203
12369
  // src/cli/cmd/ci/flows/pull-request.ts
12204
12370
  var PullRequestFlow = class extends InBranchFlow {
12205
12371
  async preRun() {
12206
- const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _396 => _396()]);
12372
+ const canContinue = await _optionalChain([super.preRun.bind(this), 'optionalCall', _402 => _402()]);
12207
12373
  if (!canContinue) {
12208
12374
  return false;
12209
12375
  }
@@ -12470,10 +12636,10 @@ var BitbucketPlatformKit = class extends PlatformKit {
12470
12636
  repo_slug: this.platformConfig.repositoryName,
12471
12637
  state: "OPEN"
12472
12638
  }).then(({ data: { values } }) => {
12473
- return _optionalChain([values, 'optionalAccess', _397 => _397.find, 'call', _398 => _398(
12474
- ({ source, destination }) => _optionalChain([source, 'optionalAccess', _399 => _399.branch, 'optionalAccess', _400 => _400.name]) === branch && _optionalChain([destination, 'optionalAccess', _401 => _401.branch, 'optionalAccess', _402 => _402.name]) === this.platformConfig.baseBranchName
12639
+ return _optionalChain([values, 'optionalAccess', _403 => _403.find, 'call', _404 => _404(
12640
+ ({ source, destination }) => _optionalChain([source, 'optionalAccess', _405 => _405.branch, 'optionalAccess', _406 => _406.name]) === branch && _optionalChain([destination, 'optionalAccess', _407 => _407.branch, 'optionalAccess', _408 => _408.name]) === this.platformConfig.baseBranchName
12475
12641
  )]);
12476
- }).then((pr) => _optionalChain([pr, 'optionalAccess', _403 => _403.id]));
12642
+ }).then((pr) => _optionalChain([pr, 'optionalAccess', _409 => _409.id]));
12477
12643
  }
12478
12644
  async closePullRequest({ pullRequestNumber }) {
12479
12645
  await this.bb.repositories.declinePullRequest({
@@ -12569,7 +12735,7 @@ var GitHubPlatformKit = class extends PlatformKit {
12569
12735
  repo: this.platformConfig.repositoryName,
12570
12736
  base: this.platformConfig.baseBranchName,
12571
12737
  state: "open"
12572
- }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _404 => _404.number]));
12738
+ }).then(({ data }) => data[0]).then((pr) => _optionalChain([pr, 'optionalAccess', _410 => _410.number]));
12573
12739
  }
12574
12740
  async closePullRequest({ pullRequestNumber }) {
12575
12741
  await this.octokit.rest.pulls.update({
@@ -12696,7 +12862,7 @@ var GitlabPlatformKit = class extends PlatformKit {
12696
12862
  sourceBranch: branch,
12697
12863
  state: "opened"
12698
12864
  });
12699
- return _optionalChain([mergeRequests, 'access', _405 => _405[0], 'optionalAccess', _406 => _406.iid]);
12865
+ return _optionalChain([mergeRequests, 'access', _411 => _411[0], 'optionalAccess', _412 => _412.iid]);
12700
12866
  }
12701
12867
  async closePullRequest({
12702
12868
  pullRequestNumber
@@ -12808,7 +12974,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
12808
12974
  }
12809
12975
  const env = {
12810
12976
  LINGODOTDEV_API_KEY: settings.auth.apiKey,
12811
- LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _407 => _407.pullRequest, 'optionalAccess', _408 => _408.toString, 'call', _409 => _409()]) || "false",
12977
+ LINGODOTDEV_PULL_REQUEST: _optionalChain([options, 'access', _413 => _413.pullRequest, 'optionalAccess', _414 => _414.toString, 'call', _415 => _415()]) || "false",
12812
12978
  ...options.commitMessage && {
12813
12979
  LINGODOTDEV_COMMIT_MESSAGE: options.commitMessage
12814
12980
  },
@@ -12834,7 +13000,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
12834
13000
  const { isPullRequestMode } = platformKit.config;
12835
13001
  ora.info(`Pull request mode: ${isPullRequestMode ? "on" : "off"}`);
12836
13002
  const flow = isPullRequestMode ? new PullRequestFlow(ora, platformKit) : new InBranchFlow(ora, platformKit);
12837
- const canRun = await _optionalChain([flow, 'access', _410 => _410.preRun, 'optionalCall', _411 => _411()]);
13003
+ const canRun = await _optionalChain([flow, 'access', _416 => _416.preRun, 'optionalCall', _417 => _417()]);
12838
13004
  if (canRun === false) {
12839
13005
  return;
12840
13006
  }
@@ -12844,7 +13010,7 @@ var ci_default = new (0, _interactivecommander.Command)().command("ci").descript
12844
13010
  if (!hasChanges) {
12845
13011
  return;
12846
13012
  }
12847
- await _optionalChain([flow, 'access', _412 => _412.postRun, 'optionalCall', _413 => _413()]);
13013
+ await _optionalChain([flow, 'access', _418 => _418.postRun, 'optionalCall', _419 => _419()]);
12848
13014
  });
12849
13015
  function parseBooleanArg(val) {
12850
13016
  if (val === true) return true;
@@ -12881,8 +13047,8 @@ function exitGracefully(elapsedMs = 0) {
12881
13047
  }
12882
13048
  }
12883
13049
  function checkForPendingOperations() {
12884
- const activeHandles = _optionalChain([process, 'access', _414 => _414._getActiveHandles, 'optionalCall', _415 => _415()]) || [];
12885
- const activeRequests = _optionalChain([process, 'access', _416 => _416._getActiveRequests, 'optionalCall', _417 => _417()]) || [];
13050
+ const activeHandles = _optionalChain([process, 'access', _420 => _420._getActiveHandles, 'optionalCall', _421 => _421()]) || [];
13051
+ const activeRequests = _optionalChain([process, 'access', _422 => _422._getActiveRequests, 'optionalCall', _423 => _423()]) || [];
12886
13052
  const nonStandardHandles = activeHandles.filter((handle) => {
12887
13053
  if (handle === process.stdin || handle === process.stdout || handle === process.stderr) {
12888
13054
  return false;
@@ -12951,17 +13117,17 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
12951
13117
  flags
12952
13118
  });
12953
13119
  let buckets = getBuckets(i18nConfig);
12954
- if (_optionalChain([flags, 'access', _418 => _418.bucket, 'optionalAccess', _419 => _419.length])) {
13120
+ if (_optionalChain([flags, 'access', _424 => _424.bucket, 'optionalAccess', _425 => _425.length])) {
12955
13121
  buckets = buckets.filter(
12956
13122
  (bucket) => flags.bucket.includes(bucket.type)
12957
13123
  );
12958
13124
  }
12959
13125
  ora.succeed("Buckets retrieved");
12960
- if (_optionalChain([flags, 'access', _420 => _420.file, 'optionalAccess', _421 => _421.length])) {
13126
+ if (_optionalChain([flags, 'access', _426 => _426.file, 'optionalAccess', _427 => _427.length])) {
12961
13127
  buckets = buckets.map((bucket) => {
12962
13128
  const paths = bucket.paths.filter(
12963
13129
  (path19) => flags.file.find(
12964
- (file) => _optionalChain([path19, 'access', _422 => _422.pathPattern, 'optionalAccess', _423 => _423.includes, 'call', _424 => _424(file)]) || _optionalChain([path19, 'access', _425 => _425.pathPattern, 'optionalAccess', _426 => _426.match, 'call', _427 => _427(file)]) || minimatch(path19.pathPattern, file)
13130
+ (file) => _optionalChain([path19, 'access', _428 => _428.pathPattern, 'optionalAccess', _429 => _429.includes, 'call', _430 => _430(file)]) || _optionalChain([path19, 'access', _431 => _431.pathPattern, 'optionalAccess', _432 => _432.match, 'call', _433 => _433(file)]) || minimatch(path19.pathPattern, file)
12965
13131
  )
12966
13132
  );
12967
13133
  return { ...bucket, paths };
@@ -12981,7 +13147,7 @@ var status_default = new (0, _interactivecommander.Command)().command("status").
12981
13147
  });
12982
13148
  }
12983
13149
  }
12984
- const targetLocales = _optionalChain([flags, 'access', _428 => _428.locale, 'optionalAccess', _429 => _429.length]) ? flags.locale : i18nConfig.locale.targets;
13150
+ const targetLocales = _optionalChain([flags, 'access', _434 => _434.locale, 'optionalAccess', _435 => _435.length]) ? flags.locale : i18nConfig.locale.targets;
12985
13151
  let totalSourceKeyCount = 0;
12986
13152
  let uniqueKeysToTranslate = 0;
12987
13153
  let totalExistingTranslations = 0;
@@ -13389,12 +13555,12 @@ function validateParams2(i18nConfig, flags) {
13389
13555
  message: "No buckets found in i18n.json. Please add at least one bucket containing i18n content.",
13390
13556
  docUrl: "bucketNotFound"
13391
13557
  });
13392
- } else if (_optionalChain([flags, 'access', _430 => _430.locale, 'optionalAccess', _431 => _431.some, 'call', _432 => _432((locale) => !i18nConfig.locale.targets.includes(locale))])) {
13558
+ } else if (_optionalChain([flags, 'access', _436 => _436.locale, 'optionalAccess', _437 => _437.some, 'call', _438 => _438((locale) => !i18nConfig.locale.targets.includes(locale))])) {
13393
13559
  throw new CLIError({
13394
13560
  message: `One or more specified locales do not exist in i18n.json locale.targets. Please add them to the list and try again.`,
13395
13561
  docUrl: "localeTargetNotFound"
13396
13562
  });
13397
- } else if (_optionalChain([flags, 'access', _433 => _433.bucket, 'optionalAccess', _434 => _434.some, 'call', _435 => _435(
13563
+ } else if (_optionalChain([flags, 'access', _439 => _439.bucket, 'optionalAccess', _440 => _440.some, 'call', _441 => _441(
13398
13564
  (bucket) => !i18nConfig.buckets[bucket]
13399
13565
  )])) {
13400
13566
  throw new CLIError({
@@ -13486,7 +13652,7 @@ async function renderHero2() {
13486
13652
  // package.json
13487
13653
  var package_default = {
13488
13654
  name: "lingo.dev",
13489
- version: "0.117.1",
13655
+ version: "0.117.3",
13490
13656
  description: "Lingo.dev CLI",
13491
13657
  private: false,
13492
13658
  publishConfig: {
@@ -13778,7 +13944,7 @@ var purge_default = new (0, _interactivecommander.Command)().command("purge").de
13778
13944
  if (options.file && options.file.length) {
13779
13945
  buckets = buckets.map((bucket) => {
13780
13946
  const paths = bucket.paths.filter(
13781
- (bucketPath) => _optionalChain([options, 'access', _436 => _436.file, 'optionalAccess', _437 => _437.some, 'call', _438 => _438((f) => bucketPath.pathPattern.includes(f))])
13947
+ (bucketPath) => _optionalChain([options, 'access', _442 => _442.file, 'optionalAccess', _443 => _443.some, 'call', _444 => _444((f) => bucketPath.pathPattern.includes(f))])
13782
13948
  );
13783
13949
  return { ...bucket, paths };
13784
13950
  }).filter((bucket) => bucket.paths.length > 0);