@extend-ai/react-xlsx 0.20.0 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +1 -0
  2. package/dist/{chart-renderer-AAVZ34BF.cjs → chart-renderer-3QDNTMRN.cjs} +526 -604
  3. package/dist/chart-renderer-3QDNTMRN.cjs.map +1 -0
  4. package/dist/{chart-renderer-RXO7WP4Q.js → chart-renderer-7DTEXXG6.js} +19 -97
  5. package/dist/chart-renderer-7DTEXXG6.js.map +1 -0
  6. package/dist/{chart-renderer-KGLAI4DN.js → chart-renderer-F355CYSE.js} +13 -92
  7. package/dist/chart-renderer-F355CYSE.js.map +1 -0
  8. package/dist/{chart-renderer-NM5UVCTO.cjs → chart-renderer-LGW4EH4M.cjs} +287 -366
  9. package/dist/chart-renderer-LGW4EH4M.cjs.map +1 -0
  10. package/dist/{chunk-WSQDFXDW.js → chunk-3LMOGW6A.js} +22 -6
  11. package/dist/chunk-3LMOGW6A.js.map +1 -0
  12. package/dist/chunk-A4S3AMON.js +108 -0
  13. package/dist/chunk-A4S3AMON.js.map +1 -0
  14. package/dist/{chunk-T5WZHPIN.cjs → chunk-AD4CGQN2.cjs} +2 -2
  15. package/dist/{chunk-T5WZHPIN.cjs.map → chunk-AD4CGQN2.cjs.map} +1 -1
  16. package/dist/chunk-AJT23BDP.js +111 -0
  17. package/dist/chunk-AJT23BDP.js.map +1 -0
  18. package/dist/{chunk-CJBI5F6V.cjs → chunk-AZWBTFJI.cjs} +12 -93
  19. package/dist/chunk-AZWBTFJI.cjs.map +1 -0
  20. package/dist/{chunk-6K3NSKDJ.cjs → chunk-D2UA4P6N.cjs} +15 -4
  21. package/dist/chunk-D2UA4P6N.cjs.map +1 -0
  22. package/dist/{chunk-QN3D3JS2.js → chunk-GXYDJPHM.js} +162 -40
  23. package/dist/chunk-GXYDJPHM.js.map +1 -0
  24. package/dist/chunk-IDNIGBUM.cjs +108 -0
  25. package/dist/chunk-IDNIGBUM.cjs.map +1 -0
  26. package/dist/{chunk-3JTCYAUX.js → chunk-IYGZTLDY.js} +14 -3
  27. package/dist/chunk-IYGZTLDY.js.map +1 -0
  28. package/dist/chunk-M55TBS4X.cjs +111 -0
  29. package/dist/chunk-M55TBS4X.cjs.map +1 -0
  30. package/dist/{chunk-MCFUTO4J.cjs → chunk-OCF75R75.cjs} +25 -9
  31. package/dist/chunk-OCF75R75.cjs.map +1 -0
  32. package/dist/{chunk-NBH72POD.js → chunk-PUI6QI4U.js} +11 -92
  33. package/dist/chunk-PUI6QI4U.js.map +1 -0
  34. package/dist/{chunk-2YBG7XQ3.cjs → chunk-ZJ76CZAL.cjs} +1683 -1561
  35. package/dist/chunk-ZJ76CZAL.cjs.map +1 -0
  36. package/dist/index.cjs +626 -529
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +13 -0
  39. package/dist/index.d.ts +13 -0
  40. package/dist/index.js +124 -27
  41. package/dist/index.js.map +1 -1
  42. package/dist/{internal-DrXSHYJZ.d.cts → internal-BJsg5os3.d.cts} +13 -0
  43. package/dist/{internal-DrXSHYJZ.d.ts → internal-BJsg5os3.d.ts} +13 -0
  44. package/dist/internal.cjs +6 -5
  45. package/dist/internal.cjs.map +1 -1
  46. package/dist/internal.d.cts +1 -1
  47. package/dist/internal.d.ts +1 -1
  48. package/dist/internal.js +4 -3
  49. package/dist/preact-LICENSE.txt +21 -0
  50. package/dist/region-map-geography-24TXETDP.cjs +184 -0
  51. package/dist/region-map-geography-24TXETDP.cjs.map +1 -0
  52. package/dist/region-map-geography-OR6DHAF7.js +182 -0
  53. package/dist/region-map-geography-OR6DHAF7.js.map +1 -0
  54. package/dist/shared-chart-3STFRVWT.js +215 -0
  55. package/dist/shared-chart-3STFRVWT.js.map +1 -0
  56. package/dist/shared-chart-BFQNYOIQ.js +221 -0
  57. package/dist/shared-chart-BFQNYOIQ.js.map +1 -0
  58. package/dist/shared-chart-DVC5S2P6.cjs +222 -0
  59. package/dist/shared-chart-DVC5S2P6.cjs.map +1 -0
  60. package/dist/shared-chart-MFQSQG4K.cjs +216 -0
  61. package/dist/shared-chart-MFQSQG4K.cjs.map +1 -0
  62. package/dist/{spreadsheet-font-assets-4AHYDTAQ.cjs → spreadsheet-font-assets-6FKCVICP.cjs} +2 -2
  63. package/dist/{spreadsheet-font-assets-4AHYDTAQ.cjs.map → spreadsheet-font-assets-6FKCVICP.cjs.map} +1 -1
  64. package/dist/{surface-regl-AY7JZVYY.cjs → surface-regl-BBJ6OIKK.cjs} +15 -13
  65. package/dist/surface-regl-BBJ6OIKK.cjs.map +1 -0
  66. package/dist/{surface-regl-TJUWTLAZ.js → surface-regl-R2N54JT2.js} +7 -5
  67. package/dist/{surface-regl-TJUWTLAZ.js.map → surface-regl-R2N54JT2.js.map} +1 -1
  68. package/dist/{surface-regl-5Z6IVOID.cjs → surface-regl-SUJ2TFZA.cjs} +2 -2
  69. package/dist/{surface-regl-5Z6IVOID.cjs.map → surface-regl-SUJ2TFZA.cjs.map} +1 -1
  70. package/dist/us-atlas-LICENSE.txt +13 -0
  71. package/dist/vanilla.cjs +6 -5
  72. package/dist/vanilla.cjs.map +1 -1
  73. package/dist/vanilla.d.cts +2 -2
  74. package/dist/vanilla.d.ts +2 -2
  75. package/dist/vanilla.js +4 -3
  76. package/dist/world-atlas-LICENSE.txt +13 -0
  77. package/dist/xlsx-worker.js +82 -1
  78. package/dist/xlsx-worker.js.map +1 -1
  79. package/package.json +7 -6
  80. package/dist/chart-renderer-AAVZ34BF.cjs.map +0 -1
  81. package/dist/chart-renderer-KGLAI4DN.js.map +0 -1
  82. package/dist/chart-renderer-NM5UVCTO.cjs.map +0 -1
  83. package/dist/chart-renderer-RXO7WP4Q.js.map +0 -1
  84. package/dist/chunk-2YBG7XQ3.cjs.map +0 -1
  85. package/dist/chunk-3JTCYAUX.js.map +0 -1
  86. package/dist/chunk-6K3NSKDJ.cjs.map +0 -1
  87. package/dist/chunk-CJBI5F6V.cjs.map +0 -1
  88. package/dist/chunk-MCFUTO4J.cjs.map +0 -1
  89. package/dist/chunk-NBH72POD.js.map +0 -1
  90. package/dist/chunk-QN3D3JS2.js.map +0 -1
  91. package/dist/chunk-WSQDFXDW.js.map +0 -1
  92. package/dist/region-map-geography-6TGXBY3V.cjs +0 -184
  93. package/dist/region-map-geography-6TGXBY3V.cjs.map +0 -1
  94. package/dist/region-map-geography-YD54DI3H.js +0 -182
  95. package/dist/region-map-geography-YD54DI3H.js.map +0 -1
  96. package/dist/surface-regl-AY7JZVYY.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
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 _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;require('./chunk-6K3NSKDJ.cjs');
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 _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;require('./chunk-D2UA4P6N.cjs');
2
2
 
3
3
 
4
4
 
@@ -6,7 +6,70 @@
6
6
  var _chunk5ERNVHSOcjs = require('./chunk-5ERNVHSO.cjs');
7
7
 
8
8
 
9
- var _chunkT5WZHPINcjs = require('./chunk-T5WZHPIN.cjs');
9
+ var _chunkAD4CGQN2cjs = require('./chunk-AD4CGQN2.cjs');
10
+
11
+ // src/number-locale.ts
12
+ var separators = /* @__PURE__ */ new Map();
13
+ function parseLocaleNumber(text, locale) {
14
+ if (locale === "en-US") return void 0;
15
+ const parts = new Intl.NumberFormat(locale).formatToParts(12345.6);
16
+ const decimal = _nullishCoalesce(_optionalChain([parts, 'access', _2 => _2.find, 'call', _3 => _3((part) => part.type === "decimal"), 'optionalAccess', _4 => _4.value]), () => ( "."));
17
+ const group = _nullishCoalesce(_optionalChain([parts, 'access', _5 => _5.find, 'call', _6 => _6((part) => part.type === "group"), 'optionalAccess', _7 => _7.value]), () => ( ","));
18
+ let normalized = text.trim();
19
+ const percent = normalized.endsWith("%");
20
+ if (percent) normalized = normalized.slice(0, -1).trim();
21
+ normalized = group.trim() === "" ? normalized.replace(/[ \u00a0\u202f]/g, "") : normalized.split(group).join("");
22
+ normalized = normalized.replace(decimal, ".");
23
+ if (!/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/.test(normalized)) return void 0;
24
+ const value = Number(normalized) / (percent ? 100 : 1);
25
+ return Number.isFinite(value) ? value : void 0;
26
+ }
27
+ function localizeCellNumber(worksheet, row, col, text, locale = "en-US") {
28
+ if (locale === "en-US" || !text) return text;
29
+ const value = worksheet.getCalculatedValueAt(row, col);
30
+ try {
31
+ if (!value.is_number) return text;
32
+ } finally {
33
+ value.free();
34
+ }
35
+ const style = worksheet.getCellStyleAt(row, col);
36
+ const format = _optionalChain([style, 'optionalAccess', _8 => _8.numberFormat]);
37
+ if (_optionalChain([format, 'optionalAccess', _9 => _9.isDateFormat])) return text;
38
+ let symbols = separators.get(locale);
39
+ if (!symbols) {
40
+ const parts = new Intl.NumberFormat(locale).formatToParts(12345.6);
41
+ symbols = {
42
+ decimal: _nullishCoalesce(_optionalChain([parts, 'access', _10 => _10.find, 'call', _11 => _11((part) => part.type === "decimal"), 'optionalAccess', _12 => _12.value]), () => ( ".")),
43
+ group: _nullishCoalesce(_optionalChain([parts, 'access', _13 => _13.find, 'call', _14 => _14((part) => part.type === "group"), 'optionalAccess', _15 => _15.value]), () => ( ","))
44
+ };
45
+ if (separators.size >= 100) separators.clear();
46
+ separators.set(locale, symbols);
47
+ }
48
+ if (symbols.decimal === "." && symbols.group === ",") return text;
49
+ const protectedPositions = /* @__PURE__ */ new Set();
50
+ const code = _nullishCoalesce(_optionalChain([format, 'optionalAccess', _16 => _16.formatString]), () => ( ""));
51
+ const literalPattern = /"[^"]*"|\\.|\[[^\]]*\]/g;
52
+ const firstPlaceholder = code.replace(literalPattern, (token) => " ".repeat(token.length)).search(/[0#?]/);
53
+ const literals = [...code.matchAll(literalPattern)];
54
+ let suffixEnd = text.length;
55
+ let prefixStart = 0;
56
+ const protect = (token, suffix) => {
57
+ const literal = token.startsWith('"') ? token.slice(1, -1) : token.startsWith("\\") ? token.slice(1) : token.startsWith("[$") ? token.slice(2, -1).split("-")[0] : "";
58
+ if (!literal) return;
59
+ const offset = suffix ? text.lastIndexOf(literal, suffixEnd - literal.length) : text.indexOf(literal, prefixStart);
60
+ if (offset >= 0) {
61
+ for (let i = offset; i < offset + literal.length; i++) protectedPositions.add(i);
62
+ if (suffix) suffixEnd = offset;
63
+ else prefixStart = offset + literal.length;
64
+ }
65
+ };
66
+ for (const token of literals.filter((token2) => token2.index < firstPlaceholder)) protect(token[0], false);
67
+ for (const token of literals.filter((token2) => token2.index >= firstPlaceholder).reverse()) protect(token[0], true);
68
+ return text.replace(
69
+ /\d[\d,]*(?:\.\d*)?|\.\d+/g,
70
+ (number, offset) => number.replace(/[.,]/g, (separator, index) => protectedPositions.has(offset + index) ? separator : separator === "." ? symbols.decimal : symbols.group)
71
+ );
72
+ }
10
73
 
11
74
  // src/spreadsheet-fonts.ts
12
75
  var fontLoadPromise;
@@ -15,7 +78,7 @@ function loadSpreadsheetFonts() {
15
78
  if (typeof document === "undefined" || typeof FontFace === "undefined") {
16
79
  return Promise.resolve();
17
80
  }
18
- return fontLoadPromise ??= Promise.resolve().then(() => _interopRequireWildcard(require("./spreadsheet-font-assets-4AHYDTAQ.cjs"))).then(async ({ spreadsheetFontFaces }) => {
81
+ return fontLoadPromise ??= Promise.resolve().then(() => _interopRequireWildcard(require("./spreadsheet-font-assets-6FKCVICP.cjs"))).then(async ({ spreadsheetFontFaces }) => {
19
82
  await Promise.allSettled(spreadsheetFontFaces.map(async ({ source, ...descriptors }) => {
20
83
  const face = new FontFace(SPREADSHEET_FALLBACK_FONT, `url(${JSON.stringify(source)})`, descriptors);
21
84
  await face.load();
@@ -122,19 +185,19 @@ function splitTopLevelSeriesArguments(value) {
122
185
  }
123
186
  function readSeriesNameFormula(series) {
124
187
  const raw = series.raw && typeof series.raw === "object" ? series.raw : null;
125
- return typeof _optionalChain([raw, 'optionalAccess', _2 => _2.name]) === "string" && raw.name.length > 0 ? raw.name : null;
188
+ return typeof _optionalChain([raw, 'optionalAccess', _17 => _17.name]) === "string" && raw.name.length > 0 ? raw.name : null;
126
189
  }
127
190
  function buildChartSeriesFormula(chart, seriesIndex) {
128
- const series = _optionalChain([chart, 'optionalAccess', _3 => _3.series, 'access', _4 => _4[seriesIndex]]);
191
+ const series = _optionalChain([chart, 'optionalAccess', _18 => _18.series, 'access', _19 => _19[seriesIndex]]);
129
192
  if (!chart || !series) {
130
193
  return "";
131
194
  }
132
195
  const nameFormula = readSeriesNameFormula(series);
133
196
  const nameArgument = _nullishCoalesce(nameFormula, () => ( quoteSeriesFormulaString(_nullishCoalesce(series.name, () => ( `Series ${seriesIndex + 1}`)))));
134
- const categoryArgument = _nullishCoalesce(_optionalChain([series, 'access', _5 => _5.categoriesRef, 'optionalAccess', _6 => _6.formula]), () => ( ""));
135
- const valueArgument = _nullishCoalesce(_optionalChain([series, 'access', _7 => _7.valuesRef, 'optionalAccess', _8 => _8.formula]), () => ( ""));
197
+ const categoryArgument = _nullishCoalesce(_optionalChain([series, 'access', _20 => _20.categoriesRef, 'optionalAccess', _21 => _21.formula]), () => ( ""));
198
+ const valueArgument = _nullishCoalesce(_optionalChain([series, 'access', _22 => _22.valuesRef, 'optionalAccess', _23 => _23.formula]), () => ( ""));
136
199
  const orderArgument = String(seriesIndex + 1);
137
- const bubbleArgument = _optionalChain([series, 'access', _9 => _9.bubbleSizeRef, 'optionalAccess', _10 => _10.formula]);
200
+ const bubbleArgument = _optionalChain([series, 'access', _24 => _24.bubbleSizeRef, 'optionalAccess', _25 => _25.formula]);
138
201
  return [
139
202
  `=SERIES(${nameArgument}`,
140
203
  categoryArgument,
@@ -151,7 +214,7 @@ function parseChartSeriesFormula(formula, chart) {
151
214
  return null;
152
215
  }
153
216
  const args = splitTopLevelSeriesArguments(match[1]);
154
- const isBubble = _optionalChain([chart, 'optionalAccess', _11 => _11.chartType]) === "Bubble";
217
+ const isBubble = _optionalChain([chart, 'optionalAccess', _26 => _26.chartType]) === "Bubble";
155
218
  if (args.length < 4 || args.length > 5 || isBubble && args.length !== 5) {
156
219
  return null;
157
220
  }
@@ -202,7 +265,7 @@ function applyChartSeriesFormula(chart, seriesIndex, formula, workbook) {
202
265
  const nextSeries = {
203
266
  ...currentSeries,
204
267
  bubbleSizeRef,
205
- bubbleSizes: workbook && _optionalChain([bubbleSizeRef, 'optionalAccess', _12 => _12.formula]) ? resolveReferenceValues(workbook, chart.workbookSheetIndex, bubbleSizeRef, "value").map((value) => typeof value === "number" && Number.isFinite(value) ? value : null) : currentSeries.bubbleSizes,
268
+ bubbleSizes: workbook && _optionalChain([bubbleSizeRef, 'optionalAccess', _27 => _27.formula]) ? resolveReferenceValues(workbook, chart.workbookSheetIndex, bubbleSizeRef, "value").map((value) => typeof value === "number" && Number.isFinite(value) ? value : null) : currentSeries.bubbleSizes,
206
269
  categories: workbook ? resolveReferenceValues(workbook, chart.workbookSheetIndex, categoriesRef, "category") : currentSeries.categories,
207
270
  categoriesRef,
208
271
  name: _nullishCoalesce(parsed.nameLiteral, () => ( (parsed.nameFormula && workbook ? resolveSeriesName(workbook, chart.workbookSheetIndex, parsed.nameFormula) : _nullishCoalesce(parsed.nameFormula, () => ( currentSeries.name))))),
@@ -276,11 +339,11 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
276
339
  return void 0;
277
340
  }
278
341
  const srgbMatch = fragment.match(/<a:srgbClr\b[^>]*\bval="([0-9a-fA-F]{6,8})"/i);
279
- if (_optionalChain([srgbMatch, 'optionalAccess', _13 => _13[1]])) {
342
+ if (_optionalChain([srgbMatch, 'optionalAccess', _28 => _28[1]])) {
280
343
  return _nullishCoalesce(normalizeHexColor(srgbMatch[1]), () => ( void 0));
281
344
  }
282
345
  const schemeMatch = _nullishCoalesce(fragment.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*>([\s\S]*?)<\/a:schemeClr>/i), () => ( fragment.match(/<a:schemeClr\b[^>]*\bval="([^"]+)"[^>]*/i)));
283
- if (!_optionalChain([schemeMatch, 'optionalAccess', _14 => _14[1]])) {
346
+ if (!_optionalChain([schemeMatch, 'optionalAccess', _29 => _29[1]])) {
284
347
  return void 0;
285
348
  }
286
349
  const baseColor = resolveThemeColor(schemeMatch[1], themePalette);
@@ -291,7 +354,7 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
291
354
  let lightnessModifier = 1;
292
355
  let lightnessOffset = 0;
293
356
  for (const match of transforms.matchAll(/<a:(lumMod|lumOff|tint|shade)\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/gi)) {
294
- const transform = _optionalChain([match, 'access', _15 => _15[1], 'optionalAccess', _16 => _16.toLowerCase, 'call', _17 => _17()]);
357
+ const transform = _optionalChain([match, 'access', _30 => _30[1], 'optionalAccess', _31 => _31.toLowerCase, 'call', _32 => _32()]);
295
358
  const rawValue = Number(_nullishCoalesce(match[2], () => ( Number.NaN)));
296
359
  if (!transform || !Number.isFinite(rawValue)) {
297
360
  continue;
@@ -309,7 +372,7 @@ function resolveColorFromXmlFragment(fragment, themePalette) {
309
372
  return _nullishCoalesce(applyLightnessTransform(baseColor, lightnessModifier, lightnessOffset), () => ( void 0));
310
373
  }
311
374
  function readHexColorFromXmlFragment(fragment, preferLine = false, themePalette) {
312
- const source = preferLine ? _nullishCoalesce(_optionalChain([fragment, 'access', _18 => _18.match, 'call', _19 => _19(/<a:ln\b[\s\S]*?<\/a:ln>/i), 'optionalAccess', _20 => _20[0]]), () => ( "")) : _nullishCoalesce(_optionalChain([fragment, 'access', _21 => _21.match, 'call', _22 => _22(/<a:solidFill\b[\s\S]*?<\/a:solidFill>/i), 'optionalAccess', _23 => _23[0]]), () => ( ""));
375
+ const source = preferLine ? _nullishCoalesce(_optionalChain([fragment, 'access', _33 => _33.match, 'call', _34 => _34(/<a:ln\b[\s\S]*?<\/a:ln>/i), 'optionalAccess', _35 => _35[0]]), () => ( "")) : _nullishCoalesce(_optionalChain([fragment, 'access', _36 => _36.match, 'call', _37 => _37(/<a:solidFill\b[\s\S]*?<\/a:solidFill>/i), 'optionalAccess', _38 => _38[0]]), () => ( ""));
313
376
  return resolveColorFromXmlFragment(source, themePalette);
314
377
  }
315
378
  function parseFallbackSeriesStylesFromChartXml(chartXml, themePalette) {
@@ -318,7 +381,7 @@ function parseFallbackSeriesStylesFromChartXml(chartXml, themePalette) {
318
381
  return [];
319
382
  }
320
383
  return seriesBlocks.map((seriesBlock) => {
321
- const shapeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _24 => _24.match, 'call', _25 => _25(/<c:spPr\b[\s\S]*?<\/c:spPr>/i), 'optionalAccess', _26 => _26[0]]), () => ( ""));
384
+ const shapeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _39 => _39.match, 'call', _40 => _40(/<c:spPr\b[\s\S]*?<\/c:spPr>/i), 'optionalAccess', _41 => _41[0]]), () => ( ""));
322
385
  return {
323
386
  color: readHexColorFromXmlFragment(shapeBlock, false, themePalette),
324
387
  lineColor: readHexColorFromXmlFragment(shapeBlock, true, themePalette)
@@ -362,12 +425,12 @@ function parseFallbackPointStylesFromChartXml(chartXml, themePalette) {
362
425
  const styles = [];
363
426
  for (const pointBlock of pointBlocks) {
364
427
  const indexMatch = pointBlock.match(/<c:idx\b[^>]*\bval="(-?\d+)"/i);
365
- const index = _optionalChain([indexMatch, 'optionalAccess', _27 => _27[1]]) ? Number(indexMatch[1]) : Number.NaN;
428
+ const index = _optionalChain([indexMatch, 'optionalAccess', _42 => _42[1]]) ? Number(indexMatch[1]) : Number.NaN;
366
429
  if (!Number.isFinite(index)) {
367
430
  continue;
368
431
  }
369
432
  const explosionMatch = pointBlock.match(/<c:explosion\b[^>]*\bval="(-?\d+(?:\.\d+)?)"/i);
370
- const explosionValue = _optionalChain([explosionMatch, 'optionalAccess', _28 => _28[1]]) ? Number(explosionMatch[1]) : Number.NaN;
433
+ const explosionValue = _optionalChain([explosionMatch, 'optionalAccess', _43 => _43[1]]) ? Number(explosionMatch[1]) : Number.NaN;
371
434
  styles.push({
372
435
  color: readHexColorFromXmlFragment(pointBlock, false, themePalette),
373
436
  explosion: Number.isFinite(explosionValue) ? explosionValue : void 0,
@@ -384,7 +447,7 @@ function parseNumericPointCacheFromXmlFragment(fragment) {
384
447
  return [];
385
448
  }
386
449
  const explicitPointCountMatch = fragment.match(/<c:ptCount\b[^>]*\bval="(\d+)"/i);
387
- const explicitPointCount = _optionalChain([explicitPointCountMatch, 'optionalAccess', _29 => _29[1]]) ? Number(explicitPointCountMatch[1]) : Number.NaN;
450
+ const explicitPointCount = _optionalChain([explicitPointCountMatch, 'optionalAccess', _44 => _44[1]]) ? Number(explicitPointCountMatch[1]) : Number.NaN;
388
451
  const maxIndex = pointMatches.reduce((max, match) => {
389
452
  const current = Number(_nullishCoalesce(match[1], () => ( Number.NaN)));
390
453
  return Number.isFinite(current) ? Math.max(max, current) : max;
@@ -412,7 +475,7 @@ function parseFallbackBubbleSizesFromChartXml(chartXml) {
412
475
  return [];
413
476
  }
414
477
  return seriesBlocks.map((seriesBlock) => {
415
- const bubbleSizeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _30 => _30.match, 'call', _31 => _31(/<c:bubbleSize\b[\s\S]*?<\/c:bubbleSize>/i), 'optionalAccess', _32 => _32[0]]), () => ( ""));
478
+ const bubbleSizeBlock = _nullishCoalesce(_optionalChain([seriesBlock, 'access', _45 => _45.match, 'call', _46 => _46(/<c:bubbleSize\b[\s\S]*?<\/c:bubbleSize>/i), 'optionalAccess', _47 => _47[0]]), () => ( ""));
416
479
  if (!bubbleSizeBlock) {
417
480
  return [];
418
481
  }
@@ -534,17 +597,17 @@ function resolveThemeColor(name, themePalette) {
534
597
  return null;
535
598
  }
536
599
  const index = THEME_COLOR_INDEX_BY_NAME[name];
537
- return index === void 0 ? null : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _33 => _33.colorsByIndex, 'access', _34 => _34[index]]), () => ( null));
600
+ return index === void 0 ? null : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _48 => _48.colorsByIndex, 'access', _49 => _49[index]]), () => ( null));
538
601
  }
539
602
  function resolveThemeTypeface(typeface, themePalette) {
540
603
  if (!typeface) {
541
604
  return null;
542
605
  }
543
606
  if (typeface === "+mn-lt" || typeface === "+mn-ea" || typeface === "+mn-cs") {
544
- return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _35 => _35.minorLatinFont]), () => ( null));
607
+ return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _50 => _50.minorLatinFont]), () => ( null));
545
608
  }
546
609
  if (typeface === "+mj-lt" || typeface === "+mj-ea" || typeface === "+mj-cs") {
547
- return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _36 => _36.majorLatinFont]), () => ( null));
610
+ return _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _51 => _51.majorLatinFont]), () => ( null));
548
611
  }
549
612
  return typeface;
550
613
  }
@@ -556,8 +619,8 @@ function readChartTextTypeface(textPropertiesNode, themePalette) {
556
619
  if (!defaultRunProperties) {
557
620
  return null;
558
621
  }
559
- const typeface = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _37 => _37(defaultRunProperties, "latin"), 'optionalAccess', _38 => _38.getAttribute, 'call', _39 => _39("typeface")]), () => ( _optionalChain([getFirstLocalChild, 'call', _40 => _40(defaultRunProperties, "ea"), 'optionalAccess', _41 => _41.getAttribute, 'call', _42 => _42("typeface")]))), () => ( _optionalChain([getFirstLocalChild, 'call', _43 => _43(defaultRunProperties, "cs"), 'optionalAccess', _44 => _44.getAttribute, 'call', _45 => _45("typeface")]))), () => ( null));
560
- const resolved = _nullishCoalesce(_optionalChain([resolveThemeTypeface, 'call', _46 => _46(typeface, themePalette), 'optionalAccess', _47 => _47.trim, 'call', _48 => _48()]), () => ( ""));
622
+ const typeface = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _52 => _52(defaultRunProperties, "latin"), 'optionalAccess', _53 => _53.getAttribute, 'call', _54 => _54("typeface")]), () => ( _optionalChain([getFirstLocalChild, 'call', _55 => _55(defaultRunProperties, "ea"), 'optionalAccess', _56 => _56.getAttribute, 'call', _57 => _57("typeface")]))), () => ( _optionalChain([getFirstLocalChild, 'call', _58 => _58(defaultRunProperties, "cs"), 'optionalAccess', _59 => _59.getAttribute, 'call', _60 => _60("typeface")]))), () => ( null));
623
+ const resolved = _nullishCoalesce(_optionalChain([resolveThemeTypeface, 'call', _61 => _61(typeface, themePalette), 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]), () => ( ""));
561
624
  return resolved.length > 0 ? resolved : null;
562
625
  }
563
626
  function resolveChartColorNode(node, themePalette) {
@@ -639,7 +702,7 @@ function resolveChartFillColor(shapeNode, themePalette) {
639
702
  return resolveChartColorNode(midpointStop.colorNode, themePalette);
640
703
  }
641
704
  function resolveChartLineStyle(shapeNode, themePalette) {
642
- const lineNode = _optionalChain([shapeNode, 'optionalAccess', _49 => _49.localName]) === "ln" ? shapeNode : shapeNode ? getFirstLocalChild(shapeNode, "ln") : null;
705
+ const lineNode = _optionalChain([shapeNode, 'optionalAccess', _64 => _64.localName]) === "ln" ? shapeNode : shapeNode ? getFirstLocalChild(shapeNode, "ln") : null;
643
706
  if (!lineNode) {
644
707
  return { color: null, hidden: false, widthPx: void 0 };
645
708
  }
@@ -685,7 +748,7 @@ function normalizeLegendPosition(position) {
685
748
  }
686
749
  function readChartNumericAttribute(parent, localName) {
687
750
  const node = parent ? getFirstLocalChild(parent, localName) : null;
688
- const value = Number(_nullishCoalesce(_optionalChain([node, 'optionalAccess', _50 => _50.getAttribute, 'call', _51 => _51("val")]), () => ( Number.NaN)));
751
+ const value = Number(_nullishCoalesce(_optionalChain([node, 'optionalAccess', _65 => _65.getAttribute, 'call', _66 => _66("val")]), () => ( Number.NaN)));
689
752
  return Number.isFinite(value) ? value : void 0;
690
753
  }
691
754
  function readChartBooleanAttribute(parent, localName) {
@@ -710,7 +773,7 @@ function readChartLabelFontSizePt(textPropertiesNode) {
710
773
  return void 0;
711
774
  }
712
775
  const runPropertiesNode = _nullishCoalesce(getFirstLocalDescendant(textPropertiesNode, "defRPr"), () => ( getFirstLocalDescendant(textPropertiesNode, "rPr")));
713
- const rawSize = Number(_nullishCoalesce(_optionalChain([runPropertiesNode, 'optionalAccess', _52 => _52.getAttribute, 'call', _53 => _53("sz")]), () => ( Number.NaN)));
776
+ const rawSize = Number(_nullishCoalesce(_optionalChain([runPropertiesNode, 'optionalAccess', _67 => _67.getAttribute, 'call', _68 => _68("sz")]), () => ( Number.NaN)));
714
777
  if (!Number.isFinite(rawSize) || rawSize <= 0) {
715
778
  return void 0;
716
779
  }
@@ -756,7 +819,7 @@ function parseChartDataLabelsFromXml(labelsNode) {
756
819
  showSeriesName: readChartBooleanAttribute(labelsNode, "showSerName"),
757
820
  showValue: readChartBooleanAttribute(labelsNode, "showVal")
758
821
  };
759
- const hasValue = labels.showBubbleSize !== void 0 || labels.showCategoryName !== void 0 || labels.showLegendKey !== void 0 || labels.showPercent !== void 0 || (_nullishCoalesce(_optionalChain([labels, 'access', _54 => _54.pointLabels, 'optionalAccess', _55 => _55.length]), () => ( 0))) > 0 || labels.showSeriesName !== void 0 || labels.showValue !== void 0;
822
+ const hasValue = labels.showBubbleSize !== void 0 || labels.showCategoryName !== void 0 || labels.showLegendKey !== void 0 || labels.showPercent !== void 0 || (_nullishCoalesce(_optionalChain([labels, 'access', _69 => _69.pointLabels, 'optionalAccess', _70 => _70.length]), () => ( 0))) > 0 || labels.showSeriesName !== void 0 || labels.showValue !== void 0;
760
823
  return hasValue ? labels : null;
761
824
  }
762
825
  function readChartRelationships(archive, chartPath) {
@@ -786,7 +849,7 @@ function readChartColorPalette(archive, colorStylePath, themePalette) {
786
849
  return [];
787
850
  }
788
851
  const colorStyleDocument = parseXml(colorStyleXml);
789
- if (!_optionalChain([colorStyleDocument, 'optionalAccess', _56 => _56.documentElement])) {
852
+ if (!_optionalChain([colorStyleDocument, 'optionalAccess', _71 => _71.documentElement])) {
790
853
  return [];
791
854
  }
792
855
  return Array.from(colorStyleDocument.documentElement.childNodes).filter((child) => isElementNode(child) && child.localName !== "variation").map((child) => _nullishCoalesce(resolveChartColorNode(child, themePalette), () => ( resolveChartColorNode(findFirstChartColorElement(child), themePalette)))).filter((color) => typeof color === "string");
@@ -802,7 +865,7 @@ function readChartStyleAppearance(archive, stylePath, themePalette) {
802
865
  }
803
866
  const dataPointNode = getFirstLocalDescendant(styleDocument, "dataPoint");
804
867
  const fillRefNode = dataPointNode ? getFirstLocalChild(dataPointNode, "fillRef") : null;
805
- const index = Number(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _57 => _57.getAttribute, 'call', _58 => _58("idx")]), () => ( Number.NaN)));
868
+ const index = Number(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _72 => _72.getAttribute, 'call', _73 => _73("idx")]), () => ( Number.NaN)));
806
869
  const chartAreaNode = getFirstLocalDescendant(styleDocument, "chartArea");
807
870
  const chartAreaShapeProperties = chartAreaNode ? getFirstLocalChild(chartAreaNode, "spPr") : null;
808
871
  const chartAreaFontRef = chartAreaNode ? getFirstLocalChild(chartAreaNode, "fontRef") : null;
@@ -826,29 +889,29 @@ function readChartStyleAppearance(archive, stylePath, themePalette) {
826
889
  };
827
890
  }
828
891
  function buildThemeSeriesPalette(themePalette) {
829
- const themeColors = [4, 5, 6, 7, 8, 9].map((index) => _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _59 => _59.colorsByIndex, 'access', _60 => _60[index]]), () => ( null))).filter((color) => Boolean(color));
892
+ const themeColors = [4, 5, 6, 7, 8, 9].map((index) => _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _74 => _74.colorsByIndex, 'access', _75 => _75[index]]), () => ( null))).filter((color) => Boolean(color));
830
893
  return themeColors.length > 0 ? themeColors : SERIES_COLORS;
831
894
  }
832
895
  function applyBuiltinSurfaceDefaults(chart, themePalette) {
833
896
  if (chart.chartType !== "Surface") {
834
897
  return;
835
898
  }
836
- const builtin = _optionalChain([chart, 'access', _61 => _61.raw, 'optionalAccess', _62 => _62.hasCustomChartColorStyle]) !== true ? _chunk5ERNVHSOcjs.getBuiltinChartSurfaceStyle.call(void 0, chart.chartStyleId) : void 0;
837
- const colors = _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _63 => _63.colorsByIndex]), () => ( {}));
838
- const wallFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _64 => _64.wall, 'access', _65 => _65.fill]), colors), () => ( (chart.wireframe ? "#d0d0d0" : "#d9d9df")));
839
- const floorFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _66 => _66.floor, 'access', _67 => _67.fill]), colors), () => ( wallFill));
840
- const gridlineColor = _chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _68 => _68.majorGridline]), colors);
899
+ const builtin = _optionalChain([chart, 'access', _76 => _76.raw, 'optionalAccess', _77 => _77.hasCustomChartColorStyle]) !== true ? _chunk5ERNVHSOcjs.getBuiltinChartSurfaceStyle.call(void 0, chart.chartStyleId) : void 0;
900
+ const colors = _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _78 => _78.colorsByIndex]), () => ( {}));
901
+ const wallFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _79 => _79.wall, 'access', _80 => _80.fill]), colors), () => ( (chart.wireframe ? "#d0d0d0" : "#d9d9df")));
902
+ const floorFill = _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _81 => _81.floor, 'access', _82 => _82.fill]), colors), () => ( wallFill));
903
+ const gridlineColor = _chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _optionalChain([builtin, 'optionalAccess', _83 => _83.majorGridline]), colors);
841
904
  for (const axis of [chart.categoryAxis, chart.valueAxis, chart.seriesAxis]) {
842
905
  if (axis && !axis.majorGridlineColor) axis.majorGridlineColor = gridlineColor;
843
906
  }
844
907
  const wallLine = chart.wireframe ? "#a6a6a6" : "#a8adb7";
845
- const previousDefaults = _optionalChain([chart, 'access', _69 => _69.raw, 'optionalAccess', _70 => _70.builtinSurfaceDefaults]);
908
+ const previousDefaults = _optionalChain([chart, 'access', _84 => _84.raw, 'optionalAccess', _85 => _85.builtinSurfaceDefaults]);
846
909
  const nextDefaults = {};
847
910
  for (const key of ["floor", "sideWall", "backWall"]) {
848
911
  const wall = _nullishCoalesce(chart[key], () => ( {}));
849
- const previous = _optionalChain([previousDefaults, 'optionalAccess', _71 => _71[key]]);
850
- const fillIsDefault = wall.fillColor === void 0 || wall.fillColor === _optionalChain([previous, 'optionalAccess', _72 => _72.fillColor]);
851
- const lineIsDefault = wall.lineColor === void 0 || wall.lineColor === _optionalChain([previous, 'optionalAccess', _73 => _73.lineColor]);
912
+ const previous = _optionalChain([previousDefaults, 'optionalAccess', _86 => _86[key]]);
913
+ const fillIsDefault = wall.fillColor === void 0 || wall.fillColor === _optionalChain([previous, 'optionalAccess', _87 => _87.fillColor]);
914
+ const lineIsDefault = wall.lineColor === void 0 || wall.lineColor === _optionalChain([previous, 'optionalAccess', _88 => _88.lineColor]);
852
915
  const fillColor = fillIsDefault ? key === "floor" ? floorFill : wallFill : wall.fillColor;
853
916
  const lineColor = lineIsDefault ? wallLine : wall.lineColor;
854
917
  chart[key] = { ...wall, fillColor, lineColor };
@@ -864,8 +927,8 @@ function applyBuiltinSurfaceDefaults(chart, themePalette) {
864
927
  }
865
928
  function applyBuiltinChartDefaults(chart, themePalette) {
866
929
  const darkBuiltInStyle = typeof chart.chartStyleId === "number" && chart.chartStyleId >= 140 && chart.chartStyleId < 150;
867
- const textColor = _nullishCoalesce(_nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _74 => _74.colorsByIndex, 'access', _75 => _75[1]]), () => ( _optionalChain([themePalette, 'optionalAccess', _76 => _76.colorsByIndex, 'access', _77 => _77[3]]))), () => ( null));
868
- const minorTypeface = _optionalChain([themePalette, 'optionalAccess', _78 => _78.minorLatinFont, 'optionalAccess', _79 => _79.trim, 'call', _80 => _80()]) || void 0;
930
+ const textColor = _nullishCoalesce(_nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _89 => _89.colorsByIndex, 'access', _90 => _90[1]]), () => ( _optionalChain([themePalette, 'optionalAccess', _91 => _91.colorsByIndex, 'access', _92 => _92[3]]))), () => ( null));
931
+ const minorTypeface = _optionalChain([themePalette, 'optionalAccess', _93 => _93.minorLatinFont, 'optionalAccess', _94 => _94.trim, 'call', _95 => _95()]) || void 0;
869
932
  const derivedAxisColor = textColor ? applyLightnessTransform(textColor, 0.35, 0.55) : null;
870
933
  const derivedBorderColor = textColor ? applyLightnessTransform(textColor, chart.is3d ? 0.28 : 0.22, chart.is3d ? 0.6 : 0.7) : null;
871
934
  if (darkBuiltInStyle) {
@@ -883,10 +946,10 @@ function applyBuiltinChartDefaults(chart, themePalette) {
883
946
  chart.axisLineColor = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(chart.axisLineColor, () => ( derivedAxisColor)), () => ( textColor)), () => ( void 0));
884
947
  chart.fontFamily = _nullishCoalesce(chart.fontFamily, () => ( minorTypeface));
885
948
  chart.titleFontFamily = _nullishCoalesce(_nullishCoalesce(chart.titleFontFamily, () => ( chart.fontFamily)), () => ( minorTypeface));
886
- const themeColors = _optionalChain([themePalette, 'optionalAccess', _81 => _81.colorsByIndex]);
887
- const useBuiltin = _optionalChain([chart, 'access', _82 => _82.raw, 'optionalAccess', _83 => _83.hasCustomChartColorStyle]) !== true && themeColors && _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, 0, 1) !== void 0;
888
- const colorCount = Math.max(1, chart.series.length, _nullishCoalesce(_optionalChain([chart, 'access', _84 => _84.typeGroups, 'optionalAccess', _85 => _85.reduce, 'call', _86 => _86((total, group) => total + group.series.length, 0)]), () => ( 0)));
889
- const seriesPalette = useBuiltin && chart.chartType !== "Surface" ? Array.from({ length: colorCount }, (_, index) => _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, index, colorCount), themeColors), () => ( SERIES_COLORS[index % SERIES_COLORS.length]))) : _optionalChain([chart, 'access', _87 => _87.chartColorPalette, 'optionalAccess', _88 => _88.length]) ? chart.chartColorPalette : buildThemeSeriesPalette(themePalette);
949
+ const themeColors = _optionalChain([themePalette, 'optionalAccess', _96 => _96.colorsByIndex]);
950
+ const useBuiltin = _optionalChain([chart, 'access', _97 => _97.raw, 'optionalAccess', _98 => _98.hasCustomChartColorStyle]) !== true && themeColors && _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, 0, 1) !== void 0;
951
+ const colorCount = Math.max(1, chart.series.length, _nullishCoalesce(_optionalChain([chart, 'access', _99 => _99.typeGroups, 'optionalAccess', _100 => _100.reduce, 'call', _101 => _101((total, group) => total + group.series.length, 0)]), () => ( 0)));
952
+ const seriesPalette = useBuiltin && chart.chartType !== "Surface" ? Array.from({ length: colorCount }, (_, index) => _nullishCoalesce(_chunk5ERNVHSOcjs.resolveBuiltinChartColor.call(void 0, _chunk5ERNVHSOcjs.getBuiltinChartColor.call(void 0, chart.chartStyleId, index, colorCount), themeColors), () => ( SERIES_COLORS[index % SERIES_COLORS.length]))) : _optionalChain([chart, 'access', _102 => _102.chartColorPalette, 'optionalAccess', _103 => _103.length]) ? chart.chartColorPalette : buildThemeSeriesPalette(themePalette);
890
953
  chart.chartColorPalette = seriesPalette;
891
954
  chart.raw = { ...chart.raw, builtinThemeColors: useBuiltin ? themeColors : void 0 };
892
955
  const applySeriesDefaults = (series, index) => {
@@ -896,7 +959,7 @@ function applyBuiltinChartDefaults(chart, themePalette) {
896
959
  const generated = {};
897
960
  const resolveColor = (key, explicit, fallback) => {
898
961
  const value = series[key];
899
- if (!explicit && (value == null || value === _optionalChain([previous, 'optionalAccess', _89 => _89[key]]) || (key === "color" || key === "lineColor") && useBuiltin && _optionalChain([chart, 'access', _90 => _90.raw, 'optionalAccess', _91 => _91.xmlChartType]))) {
962
+ if (!explicit && (value == null || value === _optionalChain([previous, 'optionalAccess', _104 => _104[key]]) || (key === "color" || key === "lineColor") && useBuiltin && _optionalChain([chart, 'access', _105 => _105.raw, 'optionalAccess', _106 => _106.xmlChartType]))) {
900
963
  generated[key] = fallback;
901
964
  return fallback;
902
965
  }
@@ -919,7 +982,7 @@ function applyBuiltinChartDefaults(chart, themePalette) {
919
982
  };
920
983
  chart.series = chart.series.map(applySeriesDefaults);
921
984
  let groupSeriesOffset = 0;
922
- chart.typeGroups = _optionalChain([chart, 'access', _92 => _92.typeGroups, 'optionalAccess', _93 => _93.map, 'call', _94 => _94((group) => {
985
+ chart.typeGroups = _optionalChain([chart, 'access', _107 => _107.typeGroups, 'optionalAccess', _108 => _108.map, 'call', _109 => _109((group) => {
923
986
  const series = group.series.map((entry, index) => applySeriesDefaults(entry, groupSeriesOffset + index));
924
987
  groupSeriesOffset += group.series.length;
925
988
  return { ...group, series };
@@ -973,7 +1036,7 @@ function parseChartCacheValues(parentNode, cacheName, mode) {
973
1036
  const rawIndex = Number(_nullishCoalesce(pointNode.getAttribute("idx"), () => ( Number.NaN)));
974
1037
  return {
975
1038
  index: Number.isFinite(rawIndex) ? rawIndex : 0,
976
- value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _95 => _95(pointNode, "v"), 'optionalAccess', _96 => _96.textContent]), () => ( ""))
1039
+ value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _110 => _110(pointNode, "v"), 'optionalAccess', _111 => _111.textContent]), () => ( ""))
977
1040
  };
978
1041
  }).sort((left, right) => left.index - right.index);
979
1042
  if (pointNodes.length === 0) {
@@ -1014,7 +1077,7 @@ function parseChartMultiLevelCacheValues(parentNode, mode) {
1014
1077
  const rawIndex = Number(_nullishCoalesce(pointNode.getAttribute("idx"), () => ( Number.NaN)));
1015
1078
  return {
1016
1079
  index: Number.isFinite(rawIndex) ? rawIndex : 0,
1017
- value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _97 => _97(pointNode, "v"), 'optionalAccess', _98 => _98.textContent]), () => ( ""))
1080
+ value: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _112 => _112(pointNode, "v"), 'optionalAccess', _113 => _113.textContent]), () => ( ""))
1018
1081
  };
1019
1082
  }).sort((left, right) => left.index - right.index);
1020
1083
  if (pointNodes.length === 0) {
@@ -1051,7 +1114,7 @@ function applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette) {
1051
1114
  const fillColor = resolveChartFillColor(shapeProperties, themePalette);
1052
1115
  const markerSize = readChartNumericAttribute(markerNode, "size");
1053
1116
  const markerSymbolNode = markerNode ? getFirstLocalChild(markerNode, "symbol") : null;
1054
- const markerSymbol = _nullishCoalesce(_optionalChain([markerSymbolNode, 'optionalAccess', _99 => _99.getAttribute, 'call', _100 => _100("val")]), () => ( (markerNode || chart.chartType === "Scatter" || ["marker", "lineMarker", "smoothMarker"].includes(_nullishCoalesce(chart.scatterStyle, () => ( ""))) || readChartBooleanAttribute(chartTypeNode, "marker") === true ? "auto" : series.markerSymbol)));
1117
+ const markerSymbol = _nullishCoalesce(_optionalChain([markerSymbolNode, 'optionalAccess', _114 => _114.getAttribute, 'call', _115 => _115("val")]), () => ( (markerNode || chart.chartType === "Scatter" || ["marker", "lineMarker", "smoothMarker"].includes(_nullishCoalesce(chart.scatterStyle, () => ( ""))) || readChartBooleanAttribute(chartTypeNode, "marker") === true ? "auto" : series.markerSymbol)));
1055
1118
  const pointStyles = parseChartPointStyles(seriesNode, themePalette);
1056
1119
  const seriesExplosion = readChartNumericAttribute(seriesNode, "explosion");
1057
1120
  const invertNegativeStyle = parseInvertNegativeStyle(seriesNode, themePalette);
@@ -1061,12 +1124,12 @@ function applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette) {
1061
1124
  const cachedValues = isScatterChart ? parseChartCacheValues(getFirstLocalChild(seriesNode, "yVal"), "numCache", "value") : parseChartCacheValues(getFirstLocalChild(seriesNode, "val"), "numCache", "value");
1062
1125
  const cachedBubbleSizes = chart.chartType === "Bubble" ? parseChartCacheValues(getFirstLocalChild(seriesNode, "bubbleSize"), "numCache", "value") : null;
1063
1126
  const existingShapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : null;
1064
- const rawFillColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _101 => _101.solidFillHex]) === "string" ? normalizeHexColor(existingShapeProperties.solidFillHex) : null;
1065
- const rawLineColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _102 => _102.lineColorHex]) === "string" ? normalizeHexColor(existingShapeProperties.lineColorHex) : null;
1127
+ const rawFillColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _116 => _116.solidFillHex]) === "string" ? normalizeHexColor(existingShapeProperties.solidFillHex) : null;
1128
+ const rawLineColor = typeof _optionalChain([existingShapeProperties, 'optionalAccess', _117 => _117.lineColorHex]) === "string" ? normalizeHexColor(existingShapeProperties.lineColorHex) : null;
1066
1129
  const resolvedLineColor = lineStyle.hidden ? void 0 : _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( lineStyle.color)), () => ( rawFillColor)), () => ( fillColor)), () => ( series.lineColor)), () => ( series.color));
1067
- const hasCategoryReference = typeof _optionalChain([series, 'access', _103 => _103.categoriesRef, 'optionalAccess', _104 => _104.formula]) === "string" && series.categoriesRef.formula.length > 0;
1068
- const hasValueReference = typeof _optionalChain([series, 'access', _105 => _105.valuesRef, 'optionalAccess', _106 => _106.formula]) === "string" && series.valuesRef.formula.length > 0;
1069
- const hasBubbleSizeReference = typeof _optionalChain([series, 'access', _107 => _107.bubbleSizeRef, 'optionalAccess', _108 => _108.formula]) === "string" && series.bubbleSizeRef.formula.length > 0;
1130
+ const hasCategoryReference = typeof _optionalChain([series, 'access', _118 => _118.categoriesRef, 'optionalAccess', _119 => _119.formula]) === "string" && series.categoriesRef.formula.length > 0;
1131
+ const hasValueReference = typeof _optionalChain([series, 'access', _120 => _120.valuesRef, 'optionalAccess', _121 => _121.formula]) === "string" && series.valuesRef.formula.length > 0;
1132
+ const hasBubbleSizeReference = typeof _optionalChain([series, 'access', _122 => _122.bubbleSizeRef, 'optionalAccess', _123 => _123.formula]) === "string" && series.bubbleSizeRef.formula.length > 0;
1070
1133
  return {
1071
1134
  ...series,
1072
1135
  bubbleSizes: !hasBubbleSizeReference && cachedBubbleSizes ? cachedBubbleSizes.map((value) => typeof value === "number" && Number.isFinite(value) ? value : null) : series.bubbleSizes,
@@ -1143,10 +1206,10 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1143
1206
  for (const fallbackStyle of fallbackPointStyles) {
1144
1207
  const existing = existingByIndex.get(fallbackStyle.index);
1145
1208
  existingByIndex.set(fallbackStyle.index, {
1146
- color: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _109 => _109.color]), () => ( fallbackStyle.color)),
1147
- explosion: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _110 => _110.explosion]), () => ( fallbackStyle.explosion)),
1209
+ color: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _124 => _124.color]), () => ( fallbackStyle.color)),
1210
+ explosion: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _125 => _125.explosion]), () => ( fallbackStyle.explosion)),
1148
1211
  index: fallbackStyle.index,
1149
- lineColor: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _111 => _111.lineColor]), () => ( fallbackStyle.lineColor))
1212
+ lineColor: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _126 => _126.lineColor]), () => ( fallbackStyle.lineColor))
1150
1213
  });
1151
1214
  }
1152
1215
  return {
@@ -1174,7 +1237,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1174
1237
  };
1175
1238
  const applyRelationshipStyles = () => {
1176
1239
  chart.chartColorPalette = readChartColorPalette(archive, relationships.get(CHART_COLOR_STYLE_REL_TYPE), themePalette);
1177
- chart.raw = { ...chart.raw, hasCustomChartColorStyle: Boolean(_optionalChain([chart, 'access', _112 => _112.chartColorPalette, 'optionalAccess', _113 => _113.length])) };
1240
+ chart.raw = { ...chart.raw, hasCustomChartColorStyle: Boolean(_optionalChain([chart, 'access', _127 => _127.chartColorPalette, 'optionalAccess', _128 => _128.length])) };
1178
1241
  const styleAppearance2 = readChartStyleAppearance(
1179
1242
  archive,
1180
1243
  relationships.get(CHART_STYLE_REL_TYPE),
@@ -1190,7 +1253,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1190
1253
  return styleAppearance2;
1191
1254
  };
1192
1255
  const applyModernChartExStyles = () => {
1193
- const modernPlotAreaNode = _optionalChain([chartDocument, 'optionalAccess', _114 => _114.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "plotArea") : null;
1256
+ const modernPlotAreaNode = _optionalChain([chartDocument, 'optionalAccess', _129 => _129.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "plotArea") : null;
1194
1257
  if (!modernPlotAreaNode) {
1195
1258
  return;
1196
1259
  }
@@ -1272,12 +1335,12 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1272
1335
  const nextTypeGroups = chart.typeGroups.map((group) => ({ ...group, series: [...group.series] }));
1273
1336
  const columnGroupIndex = nextTypeGroups.findIndex((group) => group.chartType === "ColumnClustered");
1274
1337
  if (columnGroupIndex >= 0) {
1275
- const originalColumnSeries = _nullishCoalesce(_optionalChain([nextTypeGroups, 'access', _115 => _115[columnGroupIndex], 'optionalAccess', _116 => _116.series, 'access', _117 => _117[0]]), () => ( null));
1338
+ const originalColumnSeries = _nullishCoalesce(_optionalChain([nextTypeGroups, 'access', _130 => _130[columnGroupIndex], 'optionalAccess', _131 => _131.series, 'access', _132 => _132[0]]), () => ( null));
1276
1339
  const binnedColumnSeries = replaceColumnSeries(originalColumnSeries);
1277
1340
  if (binnedColumnSeries) {
1278
1341
  nextTypeGroups[columnGroupIndex].series = [binnedColumnSeries];
1279
1342
  const lineGroupIndex = nextTypeGroups.findIndex((group) => group.chartType === "Line");
1280
- if (lineGroupIndex >= 0 && _optionalChain([nextTypeGroups, 'access', _118 => _118[lineGroupIndex], 'optionalAccess', _119 => _119.series, 'access', _120 => _120[0]])) {
1343
+ if (lineGroupIndex >= 0 && _optionalChain([nextTypeGroups, 'access', _133 => _133[lineGroupIndex], 'optionalAccess', _134 => _134.series, 'access', _135 => _135[0]])) {
1281
1344
  const originalLineSeries = nextTypeGroups[lineGroupIndex].series[0];
1282
1345
  const recomputedLine = buildChartExParetoLineSeries(
1283
1346
  binnedColumnSeries,
@@ -1320,7 +1383,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1320
1383
  const chartDocument = parseXml(chartXml);
1321
1384
  const chartNode = chartDocument ? getFirstLocalDescendant(chartDocument, "chart") : null;
1322
1385
  const plotAreaNode = chartNode ? getFirstLocalChild(chartNode, "plotArea") : null;
1323
- const styleIdNode = _optionalChain([chartDocument, 'optionalAccess', _121 => _121.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "style") : null;
1386
+ const styleIdNode = _optionalChain([chartDocument, 'optionalAccess', _136 => _136.documentElement]) ? getFirstLocalDescendant(chartDocument.documentElement, "style") : null;
1324
1387
  const chartTypeNode = findPrimaryChartTypeNode(plotAreaNode);
1325
1388
  if (!chartNode || !chartTypeNode) {
1326
1389
  applyRelationshipStyles();
@@ -1343,8 +1406,8 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1343
1406
  switch (chartTypeNode.localName) {
1344
1407
  case "barChart":
1345
1408
  case "bar3DChart": {
1346
- const grouping = _optionalChain([getFirstLocalChild, 'call', _122 => _122(chartTypeNode, "grouping"), 'optionalAccess', _123 => _123.getAttribute, 'call', _124 => _124("val")]);
1347
- const barDir = _optionalChain([getFirstLocalChild, 'call', _125 => _125(chartTypeNode, "barDir"), 'optionalAccess', _126 => _126.getAttribute, 'call', _127 => _127("val")]);
1409
+ const grouping = _optionalChain([getFirstLocalChild, 'call', _137 => _137(chartTypeNode, "grouping"), 'optionalAccess', _138 => _138.getAttribute, 'call', _139 => _139("val")]);
1410
+ const barDir = _optionalChain([getFirstLocalChild, 'call', _140 => _140(chartTypeNode, "barDir"), 'optionalAccess', _141 => _141.getAttribute, 'call', _142 => _142("val")]);
1348
1411
  const isHorizontalBar = barDir === "bar";
1349
1412
  chart.is3d = chartTypeNode.localName === "bar3DChart" ? true : chart.is3d;
1350
1413
  if (grouping === "percentStacked") {
@@ -1358,7 +1421,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1358
1421
  }
1359
1422
  case "areaChart":
1360
1423
  case "area3DChart": {
1361
- const grouping = _optionalChain([getFirstLocalChild, 'call', _128 => _128(chartTypeNode, "grouping"), 'optionalAccess', _129 => _129.getAttribute, 'call', _130 => _130("val")]);
1424
+ const grouping = _optionalChain([getFirstLocalChild, 'call', _143 => _143(chartTypeNode, "grouping"), 'optionalAccess', _144 => _144.getAttribute, 'call', _145 => _145("val")]);
1362
1425
  chart.is3d = chartTypeNode.localName === "area3DChart" ? true : chart.is3d;
1363
1426
  if (grouping === "stacked") {
1364
1427
  chart.chartType = "AreaStacked";
@@ -1371,7 +1434,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1371
1434
  }
1372
1435
  case "lineChart":
1373
1436
  case "line3DChart": {
1374
- const grouping = _optionalChain([getFirstLocalChild, 'call', _131 => _131(chartTypeNode, "grouping"), 'optionalAccess', _132 => _132.getAttribute, 'call', _133 => _133("val")]);
1437
+ const grouping = _optionalChain([getFirstLocalChild, 'call', _146 => _146(chartTypeNode, "grouping"), 'optionalAccess', _147 => _147.getAttribute, 'call', _148 => _148("val")]);
1375
1438
  chart.is3d = chartTypeNode.localName === "line3DChart" ? true : chart.is3d;
1376
1439
  if (grouping === "stacked") {
1377
1440
  chart.chartType = "LineStacked";
@@ -1396,7 +1459,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1396
1459
  chart.chartType = "BarOfPie";
1397
1460
  break;
1398
1461
  case "scatterChart":
1399
- chart.chartType = resolveScatterChartType(_optionalChain([getFirstLocalChild, 'call', _134 => _134(chartTypeNode, "scatterStyle"), 'optionalAccess', _135 => _135.getAttribute, 'call', _136 => _136("val")]));
1462
+ chart.chartType = resolveScatterChartType(_optionalChain([getFirstLocalChild, 'call', _149 => _149(chartTypeNode, "scatterStyle"), 'optionalAccess', _150 => _150.getAttribute, 'call', _151 => _151("val")]));
1400
1463
  break;
1401
1464
  case "radarChart":
1402
1465
  chart.chartType = "Radar";
@@ -1419,19 +1482,19 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1419
1482
  break;
1420
1483
  }
1421
1484
  const legendNode = getFirstLocalChild(chartNode, "legend");
1422
- const legendPosition = legendNode ? _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _137 => _137(legendNode, "legendPos"), 'optionalAccess', _138 => _138.getAttribute, 'call', _139 => _139("val")]), () => ( void 0)) : void 0;
1423
- const legendOverlay = legendNode ? _optionalChain([getFirstLocalChild, 'call', _140 => _140(legendNode, "overlay"), 'optionalAccess', _141 => _141.getAttribute, 'call', _142 => _142("val")]) : void 0;
1485
+ const legendPosition = legendNode ? _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _152 => _152(legendNode, "legendPos"), 'optionalAccess', _153 => _153.getAttribute, 'call', _154 => _154("val")]), () => ( void 0)) : void 0;
1486
+ const legendOverlay = legendNode ? _optionalChain([getFirstLocalChild, 'call', _155 => _155(legendNode, "overlay"), 'optionalAccess', _156 => _156.getAttribute, 'call', _157 => _157("val")]) : void 0;
1424
1487
  chart.legend = legendNode ? {
1425
1488
  overlay: legendOverlay === "1",
1426
1489
  position: normalizeLegendPosition(legendPosition),
1427
- raw: _optionalChain([chart, 'access', _143 => _143.legend, 'optionalAccess', _144 => _144.raw])
1490
+ raw: _optionalChain([chart, 'access', _158 => _158.legend, 'optionalAccess', _159 => _159.raw])
1428
1491
  } : chart.legend;
1429
1492
  const plotVisibleOnly = readChartBooleanAttribute(chartNode, "plotVisOnly");
1430
1493
  if (plotVisibleOnly !== void 0) {
1431
1494
  chart.plotVisibleOnly = plotVisibleOnly;
1432
1495
  }
1433
- chart.displayBlanksAs = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _145 => _145(chartNode, "dispBlanksAs"), 'optionalAccess', _146 => _146.getAttribute, 'call', _147 => _147("val")]), () => ( chart.displayBlanksAs));
1434
- const styleId = Number(_nullishCoalesce(_optionalChain([styleIdNode, 'optionalAccess', _148 => _148.getAttribute, 'call', _149 => _149("val")]), () => ( Number.NaN)));
1496
+ chart.displayBlanksAs = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _160 => _160(chartNode, "dispBlanksAs"), 'optionalAccess', _161 => _161.getAttribute, 'call', _162 => _162("val")]), () => ( chart.displayBlanksAs));
1497
+ const styleId = Number(_nullishCoalesce(_optionalChain([styleIdNode, 'optionalAccess', _163 => _163.getAttribute, 'call', _164 => _164("val")]), () => ( Number.NaN)));
1435
1498
  chart.chartStyleId = Number.isFinite(styleId) ? styleId : chart.chartStyleId;
1436
1499
  chart.firstSliceAngle = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "firstSliceAng"), () => ( chart.firstSliceAngle));
1437
1500
  chart.gapWidth = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "gapWidth"), () => ( chart.gapWidth));
@@ -1441,9 +1504,9 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1441
1504
  const bubble3dNode = getFirstLocalChild(chartTypeNode, "bubble3D");
1442
1505
  chart.bubble3d = bubble3dNode ? bubble3dNode.getAttribute("val") !== "0" : chart.bubble3d;
1443
1506
  chart.holeSize = _nullishCoalesce(readChartNumericAttribute(chartTypeNode, "holeSize"), () => ( chart.holeSize));
1444
- chart.radarStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _150 => _150(chartTypeNode, "radarStyle"), 'optionalAccess', _151 => _151.getAttribute, 'call', _152 => _152("val")]), () => ( chart.radarStyle));
1445
- chart.scatterStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _153 => _153(chartTypeNode, "scatterStyle"), 'optionalAccess', _154 => _154.getAttribute, 'call', _155 => _155("val")]), () => ( chart.scatterStyle));
1446
- chart.shape3d = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _156 => _156(chartTypeNode, "shape"), 'optionalAccess', _157 => _157.getAttribute, 'call', _158 => _158("val")]), () => ( chart.shape3d));
1507
+ chart.radarStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _165 => _165(chartTypeNode, "radarStyle"), 'optionalAccess', _166 => _166.getAttribute, 'call', _167 => _167("val")]), () => ( chart.radarStyle));
1508
+ chart.scatterStyle = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _168 => _168(chartTypeNode, "scatterStyle"), 'optionalAccess', _169 => _169.getAttribute, 'call', _170 => _170("val")]), () => ( chart.scatterStyle));
1509
+ chart.shape3d = _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _171 => _171(chartTypeNode, "shape"), 'optionalAccess', _172 => _172.getAttribute, 'call', _173 => _173("val")]), () => ( chart.shape3d));
1447
1510
  const wireframeNode = getFirstLocalChild(chartTypeNode, "wireframe");
1448
1511
  chart.wireframe = wireframeNode ? wireframeNode.getAttribute("val") !== "0" : chart.wireframe;
1449
1512
  const chartTypeDataLabels = parseChartDataLabelsFromXml(getFirstLocalChild(chartTypeNode, "dLbls"));
@@ -1451,7 +1514,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1451
1514
  const seriesDataLabels = parseChartDataLabelsFromXml(getFirstLocalChild(firstSeriesNode, "dLbls"));
1452
1515
  chart.dataLabels = _nullishCoalesce(_nullishCoalesce(chartTypeDataLabels, () => ( seriesDataLabels)), () => ( chart.dataLabels));
1453
1516
  const seriesSp3dNode = firstSeriesNode ? getFirstLocalDescendant(firstSeriesNode, "sp3d") : null;
1454
- chart.surfaceMaterial = _nullishCoalesce(_optionalChain([seriesSp3dNode, 'optionalAccess', _159 => _159.getAttribute, 'call', _160 => _160("prstMaterial")]), () => ( chart.surfaceMaterial));
1517
+ chart.surfaceMaterial = _nullishCoalesce(_optionalChain([seriesSp3dNode, 'optionalAccess', _174 => _174.getAttribute, 'call', _175 => _175("prstMaterial")]), () => ( chart.surfaceMaterial));
1455
1518
  const bandFormatsNode = _nullishCoalesce(getLocalChildren(chartTypeNode, "bandFmts")[0], () => ( null));
1456
1519
  const bandFormatNodes = bandFormatsNode ? getLocalChildren(bandFormatsNode, "bandFmt") : [];
1457
1520
  const bandFormatColors = /* @__PURE__ */ Object.create(null);
@@ -1466,7 +1529,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1466
1529
  const fillColor = getFirstLocalChild(shapeProperties, "noFill") ? "transparent" : resolveChartFillColor(shapeProperties, themePalette);
1467
1530
  const lineStyle = resolveChartLineStyle(shapeProperties, themePalette);
1468
1531
  const lineColor = lineStyle.hidden ? "transparent" : lineStyle.color;
1469
- const lineWidth = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _161 => _161(shapeProperties, "ln"), 'optionalAccess', _162 => _162.getAttribute, 'call', _163 => _163("w")]), () => ( Number.NaN)));
1532
+ const lineWidth = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _176 => _176(shapeProperties, "ln"), 'optionalAccess', _177 => _177.getAttribute, 'call', _178 => _178("w")]), () => ( Number.NaN)));
1470
1533
  if (fillColor) bandFormatColors[index] = fillColor;
1471
1534
  if (lineColor) bandFormatLineColors[index] = lineColor;
1472
1535
  if (Number.isFinite(lineWidth) && lineWidth >= 0) bandFormatLineWidths[index] = lineWidth / EMU_PER_PIXEL;
@@ -1476,16 +1539,16 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1476
1539
  bandFormatColors: Object.keys(bandFormatColors).length > 0 ? bandFormatColors : void 0,
1477
1540
  bandFormatLineColors: Object.keys(bandFormatLineColors).length > 0 ? bandFormatLineColors : void 0,
1478
1541
  bandFormatLineWidths: Object.keys(bandFormatLineWidths).length > 0 ? bandFormatLineWidths : void 0,
1479
- date1904: readChartBooleanAttribute(_nullishCoalesce(_optionalChain([chartDocument, 'optionalAccess', _164 => _164.documentElement]), () => ( null)), "date1904"),
1542
+ date1904: readChartBooleanAttribute(_nullishCoalesce(_optionalChain([chartDocument, 'optionalAccess', _179 => _179.documentElement]), () => ( null)), "date1904"),
1480
1543
  titleOverlay: readChartBooleanAttribute(getFirstLocalChild(chartNode, "title"), "overlay"),
1481
1544
  bubble3d: chart.bubble3d,
1482
- grouping: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _165 => _165(chartTypeNode, "grouping"), 'optionalAccess', _166 => _166.getAttribute, 'call', _167 => _167("val")]), () => ( void 0)),
1483
- ofPieType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _168 => _168(chartTypeNode, "ofPieType"), 'optionalAccess', _169 => _169.getAttribute, 'call', _170 => _170("val")]), () => ( void 0)),
1484
- shape: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _171 => _171(chartTypeNode, "shape"), 'optionalAccess', _172 => _172.getAttribute, 'call', _173 => _173("val")]), () => ( void 0)),
1545
+ grouping: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _180 => _180(chartTypeNode, "grouping"), 'optionalAccess', _181 => _181.getAttribute, 'call', _182 => _182("val")]), () => ( void 0)),
1546
+ ofPieType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _183 => _183(chartTypeNode, "ofPieType"), 'optionalAccess', _184 => _184.getAttribute, 'call', _185 => _185("val")]), () => ( void 0)),
1547
+ shape: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _186 => _186(chartTypeNode, "shape"), 'optionalAccess', _187 => _187.getAttribute, 'call', _188 => _188("val")]), () => ( void 0)),
1485
1548
  secondPieSize: readChartNumericAttribute(chartTypeNode, "secondPieSize"),
1486
1549
  scatterStyle: chart.scatterStyle,
1487
1550
  splitPos: readChartNumericAttribute(chartTypeNode, "splitPos"),
1488
- splitType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _174 => _174(chartTypeNode, "splitType"), 'optionalAccess', _175 => _175.getAttribute, 'call', _176 => _176("val")]), () => ( void 0)),
1551
+ splitType: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _189 => _189(chartTypeNode, "splitType"), 'optionalAccess', _190 => _190.getAttribute, 'call', _191 => _191("val")]), () => ( void 0)),
1489
1552
  xmlChartType: chartTypeNode.localName
1490
1553
  };
1491
1554
  const view3dNode = getFirstLocalDescendant(chartNode, "view3D");
@@ -1494,7 +1557,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1494
1557
  depthPercent: readChartNumericAttribute(view3dNode, "depthPercent"),
1495
1558
  heightPercent: readChartNumericAttribute(view3dNode, "hPercent"),
1496
1559
  perspective: readChartNumericAttribute(view3dNode, "perspective"),
1497
- rAngAx: _optionalChain([getFirstLocalChild, 'call', _177 => _177(view3dNode, "rAngAx"), 'optionalAccess', _178 => _178.getAttribute, 'call', _179 => _179("val")]) === "1",
1560
+ rAngAx: _optionalChain([getFirstLocalChild, 'call', _192 => _192(view3dNode, "rAngAx"), 'optionalAccess', _193 => _193.getAttribute, 'call', _194 => _194("val")]) === "1",
1498
1561
  rotX: readChartNumericAttribute(view3dNode, "rotX"),
1499
1562
  rotY: readChartNumericAttribute(view3dNode, "rotY")
1500
1563
  };
@@ -1503,7 +1566,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1503
1566
  const wall = readChartWallFromXml(getFirstLocalChild(chartNode, key), themePalette);
1504
1567
  if (wall) {
1505
1568
  chart[key] = wall;
1506
- const defaults = _optionalChain([chart, 'access', _180 => _180.raw, 'optionalAccess', _181 => _181.builtinSurfaceDefaults]);
1569
+ const defaults = _optionalChain([chart, 'access', _195 => _195.raw, 'optionalAccess', _196 => _196.builtinSurfaceDefaults]);
1507
1570
  if (defaults) chart.raw = { ...chart.raw, builtinSurfaceDefaults: { ...defaults, [key]: void 0 } };
1508
1571
  }
1509
1572
  }
@@ -1512,7 +1575,7 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1512
1575
  const titleTypeface = readChartTextTypeface(getFirstLocalDescendant(chartNode, "title"), themePalette);
1513
1576
  chart.fontFamily = _nullishCoalesce(chartTextTypeface, () => ( chart.fontFamily));
1514
1577
  chart.titleFontFamily = _nullishCoalesce(_nullishCoalesce(titleTypeface, () => ( chart.titleFontFamily)), () => ( chart.fontFamily));
1515
- const chartAreaShapeProperties = _optionalChain([chartDocument, 'optionalAccess', _182 => _182.documentElement]) ? getFirstLocalChild(chartDocument.documentElement, "spPr") : null;
1578
+ const chartAreaShapeProperties = _optionalChain([chartDocument, 'optionalAccess', _197 => _197.documentElement]) ? getFirstLocalChild(chartDocument.documentElement, "spPr") : null;
1516
1579
  const plotAreaShapeProperties = getFirstLocalChild(plotArea, "spPr");
1517
1580
  const chartAreaNoFill = chartAreaShapeProperties ? getFirstLocalChild(chartAreaShapeProperties, "noFill") != null : false;
1518
1581
  const plotAreaNoFill = plotAreaShapeProperties ? getFirstLocalChild(plotAreaShapeProperties, "noFill") != null : false;
@@ -1551,11 +1614,11 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1551
1614
  let valueAxisNode = _nullishCoalesce(valueAxisNodes[0], () => ( null));
1552
1615
  if (!categoryAxisNode && isScatterLikeChart && valueAxisNodes.length >= 2) {
1553
1616
  categoryAxisNode = _nullishCoalesce(valueAxisNodes.find((axisNode) => {
1554
- const position = _optionalChain([getFirstLocalChild, 'call', _183 => _183(axisNode, "axPos"), 'optionalAccess', _184 => _184.getAttribute, 'call', _185 => _185("val")]);
1617
+ const position = _optionalChain([getFirstLocalChild, 'call', _198 => _198(axisNode, "axPos"), 'optionalAccess', _199 => _199.getAttribute, 'call', _200 => _200("val")]);
1555
1618
  return position === "b" || position === "t";
1556
1619
  }), () => ( valueAxisNodes[0]));
1557
1620
  valueAxisNode = _nullishCoalesce(_nullishCoalesce(valueAxisNodes.find((axisNode) => {
1558
- const position = _optionalChain([getFirstLocalChild, 'call', _186 => _186(axisNode, "axPos"), 'optionalAccess', _187 => _187.getAttribute, 'call', _188 => _188("val")]);
1621
+ const position = _optionalChain([getFirstLocalChild, 'call', _201 => _201(axisNode, "axPos"), 'optionalAccess', _202 => _202.getAttribute, 'call', _203 => _203("val")]);
1559
1622
  return position === "l" || position === "r";
1560
1623
  }), () => ( valueAxisNodes[1])), () => ( valueAxisNodes[0]));
1561
1624
  }
@@ -1569,6 +1632,21 @@ function applyChartStyleFromXml(chart, chartPath, archive, themePalette) {
1569
1632
  chart.axes = [...chart.axes, seriesAxis];
1570
1633
  }
1571
1634
  }
1635
+ const kind = chartTypeNode.localName === "lineChart" && chart.chartType === "Line" ? "line" : chartTypeNode.localName === "barChart" && chart.chartType === "ColumnClustered" ? "bar" : null;
1636
+ const groupCount = Array.from(plotArea.children).filter((entry) => entry.localName.endsWith("Chart")).length;
1637
+ if (kind && groupCount === 1 && !chart.is3d && !plotArea.querySelector("trendline, errBars, dropLines, hiLowLines, upDownBars, dateAx, multiLvlStrRef, pictureOptions") && getLocalChildren(chartTypeNode, "ser").length === chart.series.length) {
1638
+ chart.renderSource = {
1639
+ kind,
1640
+ xml: chartXml,
1641
+ themeColors: themePalette ? Object.fromEntries(Object.entries(THEME_COLOR_INDEX_BY_NAME).flatMap(([key, index]) => {
1642
+ const color = themePalette.colorsByIndex[index];
1643
+ return color ? [[key, color]] : [];
1644
+ })) : void 0,
1645
+ themeOverrideXml: _nullishCoalesce(readArchiveText(archive, relationships.get("http://schemas.openxmlformats.org/officeDocument/2006/relationships/themeOverride")), () => ( void 0)),
1646
+ styleXml: _nullishCoalesce(readArchiveText(archive, relationships.get(CHART_STYLE_REL_TYPE)), () => ( void 0)),
1647
+ colorStyleXml: _nullishCoalesce(readArchiveText(archive, relationships.get(CHART_COLOR_STYLE_REL_TYPE)), () => ( void 0))
1648
+ };
1649
+ }
1572
1650
  applyChartSeriesStyleFromXml(chart, chartTypeNode, themePalette);
1573
1651
  applyFallbackSeriesStyles();
1574
1652
  applyBuiltinChartDefaults(chart, themePalette);
@@ -1636,15 +1714,15 @@ function serializeXml(document2) {
1636
1714
  return new XMLSerializer().serializeToString(document2);
1637
1715
  }
1638
1716
  function getLocalChildren(parent, localName) {
1639
- return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _189 => _189.childNodes]), () => ( []))).filter(
1717
+ return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _204 => _204.childNodes]), () => ( []))).filter(
1640
1718
  (node) => node.nodeType === Node.ELEMENT_NODE && node.localName === localName
1641
1719
  );
1642
1720
  }
1643
1721
  function removeLocalChildren(parent, localName) {
1644
- getLocalChildren(parent, localName).forEach((node) => _optionalChain([node, 'access', _190 => _190.parentNode, 'optionalAccess', _191 => _191.removeChild, 'call', _192 => _192(node)]));
1722
+ getLocalChildren(parent, localName).forEach((node) => _optionalChain([node, 'access', _205 => _205.parentNode, 'optionalAccess', _206 => _206.removeChild, 'call', _207 => _207(node)]));
1645
1723
  }
1646
1724
  function getLocalDescendants(parent, localName) {
1647
- return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _193 => _193.getElementsByTagName, 'call', _194 => _194("*")]), () => ( []))).filter(
1725
+ return Array.from(_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _208 => _208.getElementsByTagName, 'call', _209 => _209("*")]), () => ( []))).filter(
1648
1726
  (node) => node.localName === localName
1649
1727
  );
1650
1728
  }
@@ -1757,7 +1835,7 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
1757
1835
  return {
1758
1836
  range: null,
1759
1837
  sheet: workbook.getSheet(fallbackSheetIndex),
1760
- sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _195 => _195.getSheet, 'call', _196 => _196(fallbackSheetIndex), 'optionalAccess', _197 => _197.name]), () => ( ""))
1838
+ sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _210 => _210.getSheet, 'call', _211 => _211(fallbackSheetIndex), 'optionalAccess', _212 => _212.name]), () => ( ""))
1761
1839
  };
1762
1840
  }
1763
1841
  const trimmedFormula = formula.trim();
@@ -1775,7 +1853,7 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
1775
1853
  return {
1776
1854
  range: parseA1Range(trimmedFormula),
1777
1855
  sheet: workbook.getSheet(fallbackSheetIndex),
1778
- sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _198 => _198.getSheet, 'call', _199 => _199(fallbackSheetIndex), 'optionalAccess', _200 => _200.name]), () => ( ""))
1856
+ sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _213 => _213.getSheet, 'call', _214 => _214(fallbackSheetIndex), 'optionalAccess', _215 => _215.name]), () => ( ""))
1779
1857
  };
1780
1858
  }
1781
1859
  try {
@@ -1788,12 +1866,12 @@ function resolveReferenceSheet(workbook, fallbackSheetIndex, formula) {
1788
1866
  return {
1789
1867
  range: parseA1Range(split.range),
1790
1868
  sheet: workbook.getSheet(fallbackSheetIndex),
1791
- sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _201 => _201.getSheet, 'call', _202 => _202(fallbackSheetIndex), 'optionalAccess', _203 => _203.name]), () => ( ""))
1869
+ sheetName: _nullishCoalesce(_optionalChain([workbook, 'access', _216 => _216.getSheet, 'call', _217 => _217(fallbackSheetIndex), 'optionalAccess', _218 => _218.name]), () => ( ""))
1792
1870
  };
1793
1871
  }
1794
1872
  }
1795
1873
  function resolveChartReferenceLabel(workbook, fallbackSheetIndex, reference, fallbackLabel) {
1796
- if (!_optionalChain([reference, 'optionalAccess', _204 => _204.formula])) {
1874
+ if (!_optionalChain([reference, 'optionalAccess', _219 => _219.formula])) {
1797
1875
  return fallbackLabel;
1798
1876
  }
1799
1877
  const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
@@ -1815,7 +1893,7 @@ function resolveChartReferenceLabel(workbook, fallbackSheetIndex, reference, fal
1815
1893
  return firstDisplay.length > 0 ? firstDisplay : fallbackLabel;
1816
1894
  }
1817
1895
  function resolveReferenceRowPaths(workbook, fallbackSheetIndex, reference) {
1818
- if (!_optionalChain([reference, 'optionalAccess', _205 => _205.formula])) {
1896
+ if (!_optionalChain([reference, 'optionalAccess', _220 => _220.formula])) {
1819
1897
  return [];
1820
1898
  }
1821
1899
  const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
@@ -1869,11 +1947,11 @@ function normalizeChartExAxis(raw) {
1869
1947
  id: typeof axis.id === "number" && Number.isFinite(axis.id) ? axis.id : void 0,
1870
1948
  crossId: typeof axis.crossId === "number" && Number.isFinite(axis.crossId) ? axis.crossId : void 0,
1871
1949
  majorGridlines: axis.majorGridlines != null ? true : void 0,
1872
- majorUnit: typeof _optionalChain([scaling, 'optionalAccess', _206 => _206.majorUnit]) === "number" ? scaling.majorUnit : void 0,
1873
- max: typeof _optionalChain([scaling, 'optionalAccess', _207 => _207.max]) === "number" ? scaling.max : void 0,
1874
- min: typeof _optionalChain([scaling, 'optionalAccess', _208 => _208.min]) === "number" ? scaling.min : void 0,
1950
+ majorUnit: typeof _optionalChain([scaling, 'optionalAccess', _221 => _221.majorUnit]) === "number" ? scaling.majorUnit : void 0,
1951
+ max: typeof _optionalChain([scaling, 'optionalAccess', _222 => _222.max]) === "number" ? scaling.max : void 0,
1952
+ min: typeof _optionalChain([scaling, 'optionalAccess', _223 => _223.min]) === "number" ? scaling.min : void 0,
1875
1953
  minorGridlines: axis.minorGridlines != null ? true : void 0,
1876
- minorUnit: typeof _optionalChain([scaling, 'optionalAccess', _209 => _209.minorUnit]) === "number" ? scaling.minorUnit : void 0,
1954
+ minorUnit: typeof _optionalChain([scaling, 'optionalAccess', _224 => _224.minorUnit]) === "number" ? scaling.minorUnit : void 0,
1877
1955
  numberFormat: numberFormat ? {
1878
1956
  formatCode: typeof numberFormat.formatCode === "string" ? numberFormat.formatCode : void 0,
1879
1957
  sourceLinked: typeof numberFormat.sourceLinked === "boolean" ? numberFormat.sourceLinked : void 0
@@ -1965,13 +2043,13 @@ function buildChartExHistogramBins(values, rawSeries, sortByFrequency) {
1965
2043
  return [];
1966
2044
  }
1967
2045
  const rawRecord = rawSeries && typeof rawSeries === "object" ? rawSeries : null;
1968
- const layoutProperties = _optionalChain([rawRecord, 'optionalAccess', _210 => _210.layoutProperties]) && typeof rawRecord.layoutProperties === "object" ? rawRecord.layoutProperties : null;
1969
- const rawBinning = _optionalChain([layoutProperties, 'optionalAccess', _211 => _211.binning]) && typeof layoutProperties.binning === "object" ? layoutProperties.binning : null;
2046
+ const layoutProperties = _optionalChain([rawRecord, 'optionalAccess', _225 => _225.layoutProperties]) && typeof rawRecord.layoutProperties === "object" ? rawRecord.layoutProperties : null;
2047
+ const rawBinning = _optionalChain([layoutProperties, 'optionalAccess', _226 => _226.binning]) && typeof layoutProperties.binning === "object" ? layoutProperties.binning : null;
1970
2048
  const minValue = Math.min(...values);
1971
2049
  const maxValue = Math.max(...values);
1972
- const explicitWidth = typeof _optionalChain([rawBinning, 'optionalAccess', _212 => _212.binSize]) === "number" && Number.isFinite(rawBinning.binSize) && rawBinning.binSize > 0 ? rawBinning.binSize : void 0;
1973
- const explicitCount = typeof _optionalChain([rawBinning, 'optionalAccess', _213 => _213.binCount]) === "number" && Number.isFinite(rawBinning.binCount) && rawBinning.binCount > 0 ? rawBinning.binCount : typeof _optionalChain([rawBinning, 'optionalAccess', _214 => _214.count]) === "number" && Number.isFinite(rawBinning.count) && rawBinning.count > 0 ? rawBinning.count : void 0;
1974
- const closedRight = _optionalChain([rawBinning, 'optionalAccess', _215 => _215.intervalClosed]) === "r" || _optionalChain([rawBinning, 'optionalAccess', _216 => _216.intervalClosed]) === "right";
2050
+ const explicitWidth = typeof _optionalChain([rawBinning, 'optionalAccess', _227 => _227.binSize]) === "number" && Number.isFinite(rawBinning.binSize) && rawBinning.binSize > 0 ? rawBinning.binSize : void 0;
2051
+ const explicitCount = typeof _optionalChain([rawBinning, 'optionalAccess', _228 => _228.binCount]) === "number" && Number.isFinite(rawBinning.binCount) && rawBinning.binCount > 0 ? rawBinning.binCount : typeof _optionalChain([rawBinning, 'optionalAccess', _229 => _229.count]) === "number" && Number.isFinite(rawBinning.count) && rawBinning.count > 0 ? rawBinning.count : void 0;
2052
+ const closedRight = _optionalChain([rawBinning, 'optionalAccess', _230 => _230.intervalClosed]) === "r" || _optionalChain([rawBinning, 'optionalAccess', _231 => _231.intervalClosed]) === "right";
1975
2053
  const mean = values.reduce((sum, value) => sum + value, 0) / values.length;
1976
2054
  const variance = values.reduce((sum, value) => sum + (value - mean) ** 2, 0) / Math.max(1, values.length);
1977
2055
  const standardDeviation = Math.sqrt(Math.max(0, variance));
@@ -2022,7 +2100,7 @@ function buildChartExHistogramSeries(series, rawSeries, sortByFrequency) {
2022
2100
  const layout = resolveChartExSeriesLayout(rawSeries);
2023
2101
  const rawRecord = rawSeries && typeof rawSeries === "object" ? rawSeries : null;
2024
2102
  const hasBinning = Boolean(
2025
- layout === "clusteredColumn" && _optionalChain([rawRecord, 'optionalAccess', _217 => _217.layoutProperties]) && typeof rawRecord.layoutProperties === "object" && rawRecord.layoutProperties.binning != null
2103
+ layout === "clusteredColumn" && _optionalChain([rawRecord, 'optionalAccess', _232 => _232.layoutProperties]) && typeof rawRecord.layoutProperties === "object" && rawRecord.layoutProperties.binning != null
2026
2104
  );
2027
2105
  if (!hasBinning) {
2028
2106
  return series;
@@ -2063,7 +2141,7 @@ function buildChartExParetoLineSeries(series, sourceRaw, index) {
2063
2141
  markerLineColor: void 0,
2064
2142
  markerSize: 7,
2065
2143
  markerSymbol: "circle",
2066
- name: typeof _optionalChain([sourceRaw, 'optionalAccess', _218 => _218.text]) === "string" ? sourceRaw.text : "Pareto",
2144
+ name: typeof _optionalChain([sourceRaw, 'optionalAccess', _233 => _233.text]) === "string" ? sourceRaw.text : "Pareto",
2067
2145
  raw: {
2068
2146
  ..._nullishCoalesce(series.raw, () => ( {})),
2069
2147
  chartExLayout: "paretoLine",
@@ -2134,11 +2212,11 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
2134
2212
  const series = raw && typeof raw === "object" ? raw : {};
2135
2213
  const dataId = typeof series.dataId === "number" ? series.dataId : null;
2136
2214
  const dataEntry = dataId != null ? _nullishCoalesce(dataById.get(dataId), () => ( null)) : null;
2137
- const dimensions = Array.isArray(_optionalChain([dataEntry, 'optionalAccess', _219 => _219.dimensions])) ? dataEntry.dimensions.filter((value) => Boolean(value && typeof value === "object")) : [];
2215
+ const dimensions = Array.isArray(_optionalChain([dataEntry, 'optionalAccess', _234 => _234.dimensions])) ? dataEntry.dimensions.filter((value) => Boolean(value && typeof value === "object")) : [];
2138
2216
  const categoryDimension = _nullishCoalesce(_nullishCoalesce(dimensions.find((dimension) => dimension.dimType === "cat"), () => ( dimensions.find((dimension) => dimension.dimType === "name"))), () => ( null));
2139
2217
  const valueDimension = _nullishCoalesce(_nullishCoalesce(dimensions.find((dimension) => dimension.dimType === "val" || dimension.dimType === "y" || dimension.dimType === "colorVal" || dimension.dimType === "size"), () => ( dimensions.find((dimension) => dimension !== categoryDimension))), () => ( categoryDimension));
2140
- const categoryDimensionFormula = typeof _optionalChain([categoryDimension, 'optionalAccess', _220 => _220.formula]) === "string" ? categoryDimension.formula : void 0;
2141
- const valueDimensionFormula = typeof _optionalChain([valueDimension, 'optionalAccess', _221 => _221.formula]) === "string" ? valueDimension.formula : void 0;
2218
+ const categoryDimensionFormula = typeof _optionalChain([categoryDimension, 'optionalAccess', _235 => _235.formula]) === "string" ? categoryDimension.formula : void 0;
2219
+ const valueDimensionFormula = typeof _optionalChain([valueDimension, 'optionalAccess', _236 => _236.formula]) === "string" ? valueDimension.formula : void 0;
2142
2220
  const fallbackCategoryRef = (chartType === "Sunburst" || chartType === "Treemap") && !categoryDimension && typeof valueDimensionFormula === "string" ? resolveChartExFallbackCategoryReference(workbook, workbookSheetIndex, valueDimensionFormula) : null;
2143
2221
  const categoriesRef = categoryDimension ? normalizeChartReference({
2144
2222
  formula: categoryDimensionFormula
@@ -2146,7 +2224,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
2146
2224
  const valuesRef = valueDimension ? normalizeChartReference({
2147
2225
  formula: valueDimensionFormula
2148
2226
  }) : null;
2149
- const isCategoricalMap = chartType === "RegionMap" && _optionalChain([valueDimension, 'optionalAccess', _222 => _222.dimType]) === "colorStr";
2227
+ const isCategoricalMap = chartType === "RegionMap" && _optionalChain([valueDimension, 'optionalAccess', _237 => _237.dimType]) === "colorStr";
2150
2228
  const resolvedValueCells = resolveReferenceValues(workbook, workbookSheetIndex, valuesRef, isCategoricalMap ? "category" : "value");
2151
2229
  const values = resolvedValueCells.map((value) => typeof value === "number" && Number.isFinite(value) ? value : null);
2152
2230
  const colorStrings = isCategoricalMap ? resolvedValueCells.map((value) => {
@@ -2164,8 +2242,8 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
2164
2242
  const hierarchyCategories = chartType === "Sunburst" || chartType === "Treemap" ? resolveReferenceRowPaths(workbook, workbookSheetIndex, categoriesRef) : [];
2165
2243
  const seriesTextFormula = resolveChartExTextFormula(series.text);
2166
2244
  const shapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : void 0;
2167
- const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _223 => _223.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
2168
- const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _224 => _224.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
2245
+ const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _238 => _238.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
2246
+ const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _239 => _239.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
2169
2247
  return {
2170
2248
  bubbleSizeRef: null,
2171
2249
  bubbleSizes: [],
@@ -2179,7 +2257,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
2179
2257
  id: `${chartId}-series-${index}`,
2180
2258
  invertIfNegative: void 0,
2181
2259
  lineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
2182
- lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _225 => _225.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
2260
+ lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _240 => _240.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
2183
2261
  marker: void 0,
2184
2262
  markerColor: _nullishCoalesce(rawFillColor, () => ( void 0)),
2185
2263
  markerLineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
@@ -2193,7 +2271,7 @@ function normalizeChartExSeries(workbook, workbookSheetIndex, chartId, raw, data
2193
2271
  chartExColorStrings: colorStrings,
2194
2272
  chartExHierarchyCategories: hierarchyCategories,
2195
2273
  data: dataEntry,
2196
- dimType: typeof _optionalChain([valueDimension, 'optionalAccess', _226 => _226.dimType]) === "string" ? valueDimension.dimType : void 0
2274
+ dimType: typeof _optionalChain([valueDimension, 'optionalAccess', _241 => _241.dimType]) === "string" ? valueDimension.dimType : void 0
2197
2275
  },
2198
2276
  shapeProperties,
2199
2277
  smooth: void 0,
@@ -2205,7 +2283,7 @@ function collapseChartExPointSeries(chartType, series) {
2205
2283
  if (chartType !== "Funnel" && chartType !== "Waterfall") {
2206
2284
  if ((chartType === "Sunburst" || chartType === "Treemap") && series.length > 1 && series.every((entry) => {
2207
2285
  const raw = entry.raw && typeof entry.raw === "object" ? entry.raw : null;
2208
- return _optionalChain([raw, 'optionalAccess', _227 => _227.dimType]) === "size";
2286
+ return _optionalChain([raw, 'optionalAccess', _242 => _242.dimType]) === "size";
2209
2287
  })) {
2210
2288
  const primarySeries2 = _nullishCoalesce(_nullishCoalesce(series.find((entry) => entry.hidden !== true), () => ( series[0])), () => ( null));
2211
2289
  if (!primarySeries2) {
@@ -2425,8 +2503,8 @@ function cellValueToDisplay(value) {
2425
2503
  return String(value);
2426
2504
  }
2427
2505
  function resolveReferenceValues(workbook, fallbackSheetIndex, reference, mode) {
2428
- if (!_optionalChain([reference, 'optionalAccess', _228 => _228.formula])) {
2429
- return _nullishCoalesce(_optionalChain([reference, 'optionalAccess', _229 => _229.values]), () => ( []));
2506
+ if (!_optionalChain([reference, 'optionalAccess', _243 => _243.formula])) {
2507
+ return _nullishCoalesce(_optionalChain([reference, 'optionalAccess', _244 => _244.values]), () => ( []));
2430
2508
  }
2431
2509
  const resolved = resolveReferenceSheet(workbook, fallbackSheetIndex, reference.formula);
2432
2510
  if (!resolved.sheet || !resolved.range) {
@@ -2524,30 +2602,30 @@ function readChartAxisFromXml(axisNode, themePalette) {
2524
2602
  const scalingNode = getFirstLocalChild(axisNode, "scaling");
2525
2603
  return {
2526
2604
  crossId: readChartNumericAttribute(axisNode, "crossAx"),
2527
- crosses: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _230 => _230(axisNode, "crosses"), 'optionalAccess', _231 => _231.getAttribute, 'call', _232 => _232("val")]), () => ( void 0)),
2528
- crossBetween: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _233 => _233(axisNode, "crossBetween"), 'optionalAccess', _234 => _234.getAttribute, 'call', _235 => _235("val")]), () => ( void 0)),
2529
- delete: _optionalChain([getFirstLocalChild, 'call', _236 => _236(axisNode, "delete"), 'optionalAccess', _237 => _237.getAttribute, 'call', _238 => _238("val")]) === "1" ? true : _optionalChain([getFirstLocalChild, 'call', _239 => _239(axisNode, "delete"), 'optionalAccess', _240 => _240.getAttribute, 'call', _241 => _241("val")]) === "0" ? false : void 0,
2605
+ crosses: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _245 => _245(axisNode, "crosses"), 'optionalAccess', _246 => _246.getAttribute, 'call', _247 => _247("val")]), () => ( void 0)),
2606
+ crossBetween: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _248 => _248(axisNode, "crossBetween"), 'optionalAccess', _249 => _249.getAttribute, 'call', _250 => _250("val")]), () => ( void 0)),
2607
+ delete: _optionalChain([getFirstLocalChild, 'call', _251 => _251(axisNode, "delete"), 'optionalAccess', _252 => _252.getAttribute, 'call', _253 => _253("val")]) === "1" ? true : _optionalChain([getFirstLocalChild, 'call', _254 => _254(axisNode, "delete"), 'optionalAccess', _255 => _255.getAttribute, 'call', _256 => _256("val")]) === "0" ? false : void 0,
2530
2608
  id: readChartNumericAttribute(axisNode, "axId"),
2531
- labelPosition: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _242 => _242(axisNode, "tickLblPos"), 'optionalAccess', _243 => _243.getAttribute, 'call', _244 => _244("val")]), () => ( void 0)),
2609
+ labelPosition: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _257 => _257(axisNode, "tickLblPos"), 'optionalAccess', _258 => _258.getAttribute, 'call', _259 => _259("val")]), () => ( void 0)),
2532
2610
  logBase: readChartNumericAttribute(getFirstLocalChild(axisNode, "scaling"), "logBase"),
2533
- orientation: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _245 => _245(_nullishCoalesce(scalingNode, () => ( axisNode)), "orientation"), 'optionalAccess', _246 => _246.getAttribute, 'call', _247 => _247("val")]), () => ( void 0)),
2611
+ orientation: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _260 => _260(_nullishCoalesce(scalingNode, () => ( axisNode)), "orientation"), 'optionalAccess', _261 => _261.getAttribute, 'call', _262 => _262("val")]), () => ( void 0)),
2534
2612
  majorGridlines: Boolean(getFirstLocalChild(axisNode, "majorGridlines")),
2535
2613
  majorGridlineColor: (() => {
2536
2614
  const style = resolveChartLineStyle(getFirstLocalChild(getFirstLocalChild(axisNode, "majorGridlines"), "spPr"), themePalette);
2537
2615
  return style.hidden ? "transparent" : _nullishCoalesce(style.color, () => ( void 0));
2538
2616
  })(),
2539
- majorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _248 => _248(axisNode, "majorTickMark"), 'optionalAccess', _249 => _249.getAttribute, 'call', _250 => _250("val")]), () => ( void 0)),
2617
+ majorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _263 => _263(axisNode, "majorTickMark"), 'optionalAccess', _264 => _264.getAttribute, 'call', _265 => _265("val")]), () => ( void 0)),
2540
2618
  majorUnit: readChartNumericAttribute(axisNode, "majorUnit"),
2541
2619
  max: readChartNumericAttribute(scalingNode, "max"),
2542
2620
  min: readChartNumericAttribute(scalingNode, "min"),
2543
2621
  minorGridlines: Boolean(getFirstLocalChild(axisNode, "minorGridlines")),
2544
- minorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _251 => _251(axisNode, "minorTickMark"), 'optionalAccess', _252 => _252.getAttribute, 'call', _253 => _253("val")]), () => ( void 0)),
2622
+ minorTickMark: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _266 => _266(axisNode, "minorTickMark"), 'optionalAccess', _267 => _267.getAttribute, 'call', _268 => _268("val")]), () => ( void 0)),
2545
2623
  minorUnit: readChartNumericAttribute(axisNode, "minorUnit"),
2546
2624
  numberFormat: numFmt ? {
2547
2625
  formatCode: _nullishCoalesce(numFmt.getAttribute("formatCode"), () => ( void 0)),
2548
2626
  sourceLinked: numFmt.getAttribute("sourceLinked") === "1" ? true : numFmt.getAttribute("sourceLinked") === "0" ? false : void 0
2549
2627
  } : void 0,
2550
- position: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _254 => _254(axisNode, "axPos"), 'optionalAccess', _255 => _255.getAttribute, 'call', _256 => _256("val")]), () => ( void 0)),
2628
+ position: _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _269 => _269(axisNode, "axPos"), 'optionalAccess', _270 => _270.getAttribute, 'call', _271 => _271("val")]), () => ( void 0)),
2551
2629
  tickLabelSkip: readChartNumericAttribute(axisNode, "tickLblSkip"),
2552
2630
  tickMarkSkip: readChartNumericAttribute(axisNode, "tickMarkSkip")
2553
2631
  };
@@ -2637,10 +2715,10 @@ function normalizeChartAnchor(raw) {
2637
2715
  if (anchor.type === "oneCell") {
2638
2716
  return {
2639
2717
  from: {
2640
- col: typeof _optionalChain([from, 'optionalAccess', _257 => _257.col]) === "number" ? from.col : 0,
2641
- colOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _258 => _258.colOffsetEmu]) === "number" ? from.colOffsetEmu : 0,
2642
- row: typeof _optionalChain([from, 'optionalAccess', _259 => _259.row]) === "number" ? from.row : 0,
2643
- rowOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _260 => _260.rowOffsetEmu]) === "number" ? from.rowOffsetEmu : 0
2718
+ col: typeof _optionalChain([from, 'optionalAccess', _272 => _272.col]) === "number" ? from.col : 0,
2719
+ colOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _273 => _273.colOffsetEmu]) === "number" ? from.colOffsetEmu : 0,
2720
+ row: typeof _optionalChain([from, 'optionalAccess', _274 => _274.row]) === "number" ? from.row : 0,
2721
+ rowOffsetEmu: typeof _optionalChain([from, 'optionalAccess', _275 => _275.rowOffsetEmu]) === "number" ? from.rowOffsetEmu : 0
2644
2722
  },
2645
2723
  kind: "one-cell",
2646
2724
  sizeEmu: {
@@ -2663,14 +2741,14 @@ function normalizeChartAnchor(raw) {
2663
2741
  };
2664
2742
  }
2665
2743
  const to = anchor.to && typeof anchor.to === "object" ? anchor.to : null;
2666
- const fromColValue = _optionalChain([from, 'optionalAccess', _261 => _261.col]);
2667
- const fromColOffsetValue = _optionalChain([from, 'optionalAccess', _262 => _262.colOffsetEmu]);
2668
- const fromRowValue = _optionalChain([from, 'optionalAccess', _263 => _263.row]);
2669
- const fromRowOffsetValue = _optionalChain([from, 'optionalAccess', _264 => _264.rowOffsetEmu]);
2670
- const toColValue = _optionalChain([to, 'optionalAccess', _265 => _265.col]);
2671
- const toColOffsetValue = _optionalChain([to, 'optionalAccess', _266 => _266.colOffsetEmu]);
2672
- const toRowValue = _optionalChain([to, 'optionalAccess', _267 => _267.row]);
2673
- const toRowOffsetValue = _optionalChain([to, 'optionalAccess', _268 => _268.rowOffsetEmu]);
2744
+ const fromColValue = _optionalChain([from, 'optionalAccess', _276 => _276.col]);
2745
+ const fromColOffsetValue = _optionalChain([from, 'optionalAccess', _277 => _277.colOffsetEmu]);
2746
+ const fromRowValue = _optionalChain([from, 'optionalAccess', _278 => _278.row]);
2747
+ const fromRowOffsetValue = _optionalChain([from, 'optionalAccess', _279 => _279.rowOffsetEmu]);
2748
+ const toColValue = _optionalChain([to, 'optionalAccess', _280 => _280.col]);
2749
+ const toColOffsetValue = _optionalChain([to, 'optionalAccess', _281 => _281.colOffsetEmu]);
2750
+ const toRowValue = _optionalChain([to, 'optionalAccess', _282 => _282.row]);
2751
+ const toRowOffsetValue = _optionalChain([to, 'optionalAccess', _283 => _283.rowOffsetEmu]);
2674
2752
  const fromCol = typeof fromColValue === "number" ? fromColValue : 0;
2675
2753
  const fromColOffsetEmu = typeof fromColOffsetValue === "number" ? fromColOffsetValue : 0;
2676
2754
  const fromRow = typeof fromRowValue === "number" ? fromRowValue : 0;
@@ -2699,10 +2777,10 @@ function parseMarkerNode(node) {
2699
2777
  if (!node) {
2700
2778
  return null;
2701
2779
  }
2702
- const col = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _269 => _269(node, "col"), 'optionalAccess', _270 => _270.textContent]), () => ( Number.NaN)));
2703
- const row = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _271 => _271(node, "row"), 'optionalAccess', _272 => _272.textContent]), () => ( Number.NaN)));
2704
- const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _273 => _273(node, "colOff"), 'optionalAccess', _274 => _274.textContent]), () => ( 0)));
2705
- const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _275 => _275(node, "rowOff"), 'optionalAccess', _276 => _276.textContent]), () => ( 0)));
2780
+ const col = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _284 => _284(node, "col"), 'optionalAccess', _285 => _285.textContent]), () => ( Number.NaN)));
2781
+ const row = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _286 => _286(node, "row"), 'optionalAccess', _287 => _287.textContent]), () => ( Number.NaN)));
2782
+ const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _288 => _288(node, "colOff"), 'optionalAccess', _289 => _289.textContent]), () => ( 0)));
2783
+ const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _290 => _290(node, "rowOff"), 'optionalAccess', _291 => _291.textContent]), () => ( 0)));
2706
2784
  if (!Number.isFinite(col) || !Number.isFinite(row)) {
2707
2785
  return null;
2708
2786
  }
@@ -2722,8 +2800,8 @@ function parseChartAnchorNode(anchorNode) {
2722
2800
  if (anchorNode.localName === "oneCellAnchor") {
2723
2801
  const from = parseMarkerNode(getFirstLocalChild(anchorNode, "from"));
2724
2802
  const ext2 = getFirstLocalChild(anchorNode, "ext");
2725
- const cx2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _277 => _277.getAttribute, 'call', _278 => _278("cx")]), () => ( Number.NaN)));
2726
- const cy2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _279 => _279.getAttribute, 'call', _280 => _280("cy")]), () => ( Number.NaN)));
2803
+ const cx2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _292 => _292.getAttribute, 'call', _293 => _293("cx")]), () => ( Number.NaN)));
2804
+ const cy2 = Number(_nullishCoalesce(_optionalChain([ext2, 'optionalAccess', _294 => _294.getAttribute, 'call', _295 => _295("cy")]), () => ( Number.NaN)));
2727
2805
  return from && Number.isFinite(cx2) && Number.isFinite(cy2) ? {
2728
2806
  from,
2729
2807
  kind: "one-cell",
@@ -2735,10 +2813,10 @@ function parseChartAnchorNode(anchorNode) {
2735
2813
  }
2736
2814
  const pos = getFirstLocalChild(anchorNode, "pos");
2737
2815
  const ext = getFirstLocalChild(anchorNode, "ext");
2738
- const x = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _281 => _281.getAttribute, 'call', _282 => _282("x")]), () => ( Number.NaN)));
2739
- const y = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _283 => _283.getAttribute, 'call', _284 => _284("y")]), () => ( Number.NaN)));
2740
- const cx = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _285 => _285.getAttribute, 'call', _286 => _286("cx")]), () => ( Number.NaN)));
2741
- const cy = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _287 => _287.getAttribute, 'call', _288 => _288("cy")]), () => ( Number.NaN)));
2816
+ const x = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _296 => _296.getAttribute, 'call', _297 => _297("x")]), () => ( Number.NaN)));
2817
+ const y = Number(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _298 => _298.getAttribute, 'call', _299 => _299("y")]), () => ( Number.NaN)));
2818
+ const cx = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _300 => _300.getAttribute, 'call', _301 => _301("cx")]), () => ( Number.NaN)));
2819
+ const cy = Number(_nullishCoalesce(_optionalChain([ext, 'optionalAccess', _302 => _302.getAttribute, 'call', _303 => _303("cy")]), () => ( Number.NaN)));
2742
2820
  return Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(cx) && Number.isFinite(cy) ? {
2743
2821
  kind: "absolute",
2744
2822
  positionEmu: {
@@ -2764,8 +2842,8 @@ function normalizeChartSeries(workbook, workbookSheetIndex, chartId, raw, index)
2764
2842
  const categoriesRef = normalizeChartReference(series.categories);
2765
2843
  const valuesRef = normalizeChartReference(series.values);
2766
2844
  const shapeProperties = series.shapeProperties && typeof series.shapeProperties === "object" ? series.shapeProperties : void 0;
2767
- const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _289 => _289.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
2768
- const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _290 => _290.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
2845
+ const rawFillColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _304 => _304.solidFillHex]) === "string" ? normalizeHexColor(shapeProperties.solidFillHex) : null;
2846
+ const rawLineColor = typeof _optionalChain([shapeProperties, 'optionalAccess', _305 => _305.lineColorHex]) === "string" ? normalizeHexColor(shapeProperties.lineColorHex) : null;
2769
2847
  const bubbleSizeRef = normalizeChartReference(_nullishCoalesce(_nullishCoalesce(series.bubbleSize, () => ( series.bubbleSizes)), () => ( series.bubbles)));
2770
2848
  return {
2771
2849
  bubbleSizeRef,
@@ -2778,7 +2856,7 @@ function normalizeChartSeries(workbook, workbookSheetIndex, chartId, raw, index)
2778
2856
  id: `${chartId}-series-${index}`,
2779
2857
  invertIfNegative: typeof series.invertIfNegative === "boolean" ? series.invertIfNegative : void 0,
2780
2858
  lineColor: _nullishCoalesce(_nullishCoalesce(rawLineColor, () => ( rawFillColor)), () => ( void 0)),
2781
- lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _291 => _291.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
2859
+ lineWidthPx: typeof _optionalChain([shapeProperties, 'optionalAccess', _306 => _306.lineWidth]) === "number" ? Math.max(1, Number(shapeProperties.lineWidth) / EMU_PER_PIXEL) : void 0,
2782
2860
  marker: series.marker && typeof series.marker === "object" ? series.marker : void 0,
2783
2861
  markerColor: void 0,
2784
2862
  markerLineColor: void 0,
@@ -2908,7 +2986,7 @@ function collectChartOriginsForSheet(archive, origin) {
2908
2986
  for (const anchorNode of anchorNodes) {
2909
2987
  const graphicFrame = getFirstLocalDescendant(anchorNode, "graphicFrame");
2910
2988
  const chartNode = graphicFrame ? getFirstLocalDescendant(graphicFrame, "chart") : null;
2911
- const relationshipId = _nullishCoalesce(_nullishCoalesce(_optionalChain([chartNode, 'optionalAccess', _292 => _292.getAttributeNS, 'call', _293 => _293("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id")]), () => ( _optionalChain([chartNode, 'optionalAccess', _294 => _294.getAttribute, 'call', _295 => _295("r:id")]))), () => ( _optionalChain([chartNode, 'optionalAccess', _296 => _296.getAttribute, 'call', _297 => _297("id")])));
2989
+ const relationshipId = _nullishCoalesce(_nullishCoalesce(_optionalChain([chartNode, 'optionalAccess', _307 => _307.getAttributeNS, 'call', _308 => _308("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id")]), () => ( _optionalChain([chartNode, 'optionalAccess', _309 => _309.getAttribute, 'call', _310 => _310("r:id")]))), () => ( _optionalChain([chartNode, 'optionalAccess', _311 => _311.getAttribute, 'call', _312 => _312("id")])));
2912
2990
  if (!relationshipId) {
2913
2991
  continue;
2914
2992
  }
@@ -3012,7 +3090,7 @@ function loadWorkbookChartAssets(workbook, imageAssets, visibleSheetIndexByWorkb
3012
3090
  is3d: typeof chart.is3D === "boolean" ? chart.is3D : void 0,
3013
3091
  legend: normalizeLegend(chart.legend) ? {
3014
3092
  ...normalizeLegend(chart.legend),
3015
- position: normalizeLegendPosition(_optionalChain([normalizeLegend, 'call', _298 => _298(chart.legend), 'optionalAccess', _299 => _299.position]))
3093
+ position: normalizeLegendPosition(_optionalChain([normalizeLegend, 'call', _313 => _313(chart.legend), 'optionalAccess', _314 => _314.position]))
3016
3094
  } : null,
3017
3095
  name: typeof drawing.name === "string" ? drawing.name : void 0,
3018
3096
  overlap: typeof chart.overlap === "number" ? chart.overlap : void 0,
@@ -3063,7 +3141,7 @@ function loadWorkbookChartAssets(workbook, imageAssets, visibleSheetIndexByWorkb
3063
3141
  visibleSheetIndex,
3064
3142
  rawChartEx,
3065
3143
  chartExIndex,
3066
- _nullishCoalesce(_optionalChain([imageAssets, 'optionalAccess', _300 => _300.themePalette]), () => ( null))
3144
+ _nullishCoalesce(_optionalChain([imageAssets, 'optionalAccess', _315 => _315.themePalette]), () => ( null))
3067
3145
  );
3068
3146
  });
3069
3147
  return [...classicCharts, ...modernCharts];
@@ -3141,7 +3219,7 @@ function updateAnchorNode(anchorNode, anchor) {
3141
3219
  function setChartTitle(chartNode, value) {
3142
3220
  const existing = getFirstLocalChild(chartNode, "title");
3143
3221
  if (!value) {
3144
- _optionalChain([existing, 'optionalAccess', _301 => _301.remove, 'call', _302 => _302()]);
3222
+ _optionalChain([existing, 'optionalAccess', _316 => _316.remove, 'call', _317 => _317()]);
3145
3223
  return;
3146
3224
  }
3147
3225
  const titleNode = _nullishCoalesce(existing, () => ( chartNode.insertBefore(
@@ -3175,7 +3253,7 @@ function setRefFormula(parent, refNodeName, formula) {
3175
3253
  }
3176
3254
  function setSeriesText(seriesNode, series) {
3177
3255
  const raw = series.raw && typeof series.raw === "object" ? series.raw : null;
3178
- const nameFormula = typeof _optionalChain([raw, 'optionalAccess', _303 => _303.name]) === "string" && raw.name.length > 0 ? raw.name : void 0;
3256
+ const nameFormula = typeof _optionalChain([raw, 'optionalAccess', _318 => _318.name]) === "string" && raw.name.length > 0 ? raw.name : void 0;
3179
3257
  if (!nameFormula && series.name === void 0) {
3180
3258
  return;
3181
3259
  }
@@ -3200,12 +3278,12 @@ function updateSeriesNodes(plotAreaNode, chart) {
3200
3278
  return;
3201
3279
  }
3202
3280
  setSeriesText(seriesNode, series);
3203
- if (_optionalChain([series, 'access', _304 => _304.categoriesRef, 'optionalAccess', _305 => _305.formula])) {
3281
+ if (_optionalChain([series, 'access', _319 => _319.categoriesRef, 'optionalAccess', _320 => _320.formula])) {
3204
3282
  const target = _nullishCoalesce(_nullishCoalesce(getFirstLocalChild(seriesNode, "xVal"), () => ( getFirstLocalChild(seriesNode, "cat"))), () => ( (chart.chartType === "Scatter" || chart.chartType === "ScatterLines" || chart.chartType === "ScatterSmooth" || chart.chartType === "Bubble" ? ensureChild(seriesNode, "xVal") : ensureChild(seriesNode, "cat"))));
3205
3283
  const categoryRefName = target.localName === "xVal" || getFirstLocalChild(target, "numRef") ? "numRef" : "strRef";
3206
3284
  setRefFormula(target, categoryRefName, series.categoriesRef.formula);
3207
3285
  }
3208
- if (_optionalChain([series, 'access', _306 => _306.valuesRef, 'optionalAccess', _307 => _307.formula])) {
3286
+ if (_optionalChain([series, 'access', _321 => _321.valuesRef, 'optionalAccess', _322 => _322.formula])) {
3209
3287
  const target = _nullishCoalesce(_nullishCoalesce(getFirstLocalChild(seriesNode, "yVal"), () => ( getFirstLocalChild(seriesNode, "val"))), () => ( (chart.chartType === "Scatter" || chart.chartType === "ScatterLines" || chart.chartType === "ScatterSmooth" || chart.chartType === "Bubble" ? ensureChild(seriesNode, "yVal") : ensureChild(seriesNode, "val"))));
3210
3288
  setRefFormula(target, "numRef", series.valuesRef.formula);
3211
3289
  }
@@ -3227,14 +3305,14 @@ function updateAxisNode(axisNode, axis) {
3227
3305
  }
3228
3306
  if (axis.position) {
3229
3307
  setLeafValue(ensureChild(axisNode, "axPos"), "val", axis.position);
3230
- _optionalChain([getFirstLocalChild, 'call', _308 => _308(axisNode, "axPos"), 'optionalAccess', _309 => _309.setAttribute, 'call', _310 => _310("val", axis.position)]);
3308
+ _optionalChain([getFirstLocalChild, 'call', _323 => _323(axisNode, "axPos"), 'optionalAccess', _324 => _324.setAttribute, 'call', _325 => _325("val", axis.position)]);
3231
3309
  }
3232
3310
  if (axis.majorGridlines !== void 0) {
3233
3311
  const gridlines = getFirstLocalChild(axisNode, "majorGridlines");
3234
3312
  if (axis.majorGridlines && !gridlines) {
3235
3313
  axisNode.appendChild(axisNode.ownerDocument.createElementNS(CHART_NS, "c:majorGridlines"));
3236
3314
  } else if (!axis.majorGridlines) {
3237
- _optionalChain([gridlines, 'optionalAccess', _311 => _311.remove, 'call', _312 => _312()]);
3315
+ _optionalChain([gridlines, 'optionalAccess', _326 => _326.remove, 'call', _327 => _327()]);
3238
3316
  }
3239
3317
  }
3240
3318
  if (axis.minorGridlines !== void 0) {
@@ -3242,28 +3320,28 @@ function updateAxisNode(axisNode, axis) {
3242
3320
  if (axis.minorGridlines && !gridlines) {
3243
3321
  axisNode.appendChild(axisNode.ownerDocument.createElementNS(CHART_NS, "c:minorGridlines"));
3244
3322
  } else if (!axis.minorGridlines) {
3245
- _optionalChain([gridlines, 'optionalAccess', _313 => _313.remove, 'call', _314 => _314()]);
3323
+ _optionalChain([gridlines, 'optionalAccess', _328 => _328.remove, 'call', _329 => _329()]);
3246
3324
  }
3247
3325
  }
3248
3326
  if (axis.majorTickMark) {
3249
- _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _315 => _315(axisNode, "majorTickMark"), 'optionalAccess', _316 => _316.setAttribute, 'call', _317 => _317("val", axis.majorTickMark)]), () => ( setBooleanValue(axisNode, "majorTickMark", false).setAttribute("val", axis.majorTickMark)));
3327
+ _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _330 => _330(axisNode, "majorTickMark"), 'optionalAccess', _331 => _331.setAttribute, 'call', _332 => _332("val", axis.majorTickMark)]), () => ( setBooleanValue(axisNode, "majorTickMark", false).setAttribute("val", axis.majorTickMark)));
3250
3328
  }
3251
3329
  if (axis.minorTickMark) {
3252
- _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _318 => _318(axisNode, "minorTickMark"), 'optionalAccess', _319 => _319.setAttribute, 'call', _320 => _320("val", axis.minorTickMark)]), () => ( setBooleanValue(axisNode, "minorTickMark", false).setAttribute("val", axis.minorTickMark)));
3330
+ _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _333 => _333(axisNode, "minorTickMark"), 'optionalAccess', _334 => _334.setAttribute, 'call', _335 => _335("val", axis.minorTickMark)]), () => ( setBooleanValue(axisNode, "minorTickMark", false).setAttribute("val", axis.minorTickMark)));
3253
3331
  }
3254
3332
  if (axis.labelPosition) {
3255
- _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _321 => _321(axisNode, "tickLblPos"), 'optionalAccess', _322 => _322.setAttribute, 'call', _323 => _323("val", axis.labelPosition)]), () => ( setBooleanValue(axisNode, "tickLblPos", false).setAttribute("val", axis.labelPosition)));
3333
+ _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _336 => _336(axisNode, "tickLblPos"), 'optionalAccess', _337 => _337.setAttribute, 'call', _338 => _338("val", axis.labelPosition)]), () => ( setBooleanValue(axisNode, "tickLblPos", false).setAttribute("val", axis.labelPosition)));
3256
3334
  }
3257
3335
  if (axis.crosses) {
3258
- _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _324 => _324(axisNode, "crosses"), 'optionalAccess', _325 => _325.setAttribute, 'call', _326 => _326("val", axis.crosses)]), () => ( setBooleanValue(axisNode, "crosses", false).setAttribute("val", axis.crosses)));
3336
+ _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _339 => _339(axisNode, "crosses"), 'optionalAccess', _340 => _340.setAttribute, 'call', _341 => _341("val", axis.crosses)]), () => ( setBooleanValue(axisNode, "crosses", false).setAttribute("val", axis.crosses)));
3259
3337
  }
3260
3338
  if (axis.crossBetween) {
3261
- _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _327 => _327(axisNode, "crossBetween"), 'optionalAccess', _328 => _328.setAttribute, 'call', _329 => _329("val", axis.crossBetween)]), () => ( setBooleanValue(axisNode, "crossBetween", false).setAttribute("val", axis.crossBetween)));
3339
+ _nullishCoalesce(_optionalChain([getFirstLocalChild, 'call', _342 => _342(axisNode, "crossBetween"), 'optionalAccess', _343 => _343.setAttribute, 'call', _344 => _344("val", axis.crossBetween)]), () => ( setBooleanValue(axisNode, "crossBetween", false).setAttribute("val", axis.crossBetween)));
3262
3340
  }
3263
3341
  if (axis.delete !== void 0) {
3264
3342
  setBooleanValue(axisNode, "delete", axis.delete);
3265
3343
  }
3266
- if (_optionalChain([axis, 'access', _330 => _330.numberFormat, 'optionalAccess', _331 => _331.formatCode])) {
3344
+ if (_optionalChain([axis, 'access', _345 => _345.numberFormat, 'optionalAccess', _346 => _346.formatCode])) {
3267
3345
  const numFmt = ensureChild(axisNode, "numFmt");
3268
3346
  numFmt.setAttribute("formatCode", axis.numberFormat.formatCode);
3269
3347
  if (axis.numberFormat.sourceLinked !== void 0) {
@@ -3319,7 +3397,7 @@ function updateWorkbookChartAnchor(imageAssets, chartAssets, chartId, anchor) {
3319
3397
  }
3320
3398
  function updateWorkbookChartDefinition(imageAssets, chartAssets, chartId, patch) {
3321
3399
  const origin = chartAssets.chartOriginsById.get(chartId);
3322
- if (!_optionalChain([origin, 'optionalAccess', _332 => _332.chartPath])) {
3400
+ if (!_optionalChain([origin, 'optionalAccess', _347 => _347.chartPath])) {
3323
3401
  return false;
3324
3402
  }
3325
3403
  const chartXml = readArchiveText(imageAssets.archive, origin.chartPath);
@@ -3478,7 +3556,7 @@ function resolveWorkbookColor(color, themePalette) {
3478
3556
  }
3479
3557
  const themeValue = _nullishCoalesce(color.theme, () => ( color.themeIndex));
3480
3558
  const numericTheme = typeof themeValue === "number" ? themeValue : typeof themeValue === "string" && themeValue.trim().length > 0 ? Number(themeValue) : Number.NaN;
3481
- const themeColor = Number.isFinite(numericTheme) ? _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _333 => _333.colorsByIndex, 'access', _334 => _334[numericTheme]]), () => ( null)) : null;
3559
+ const themeColor = Number.isFinite(numericTheme) ? _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _348 => _348.colorsByIndex, 'access', _349 => _349[numericTheme]]), () => ( null)) : null;
3482
3560
  if (!themeColor) {
3483
3561
  return null;
3484
3562
  }
@@ -3520,7 +3598,7 @@ function resolveWorkbookFillStyle(fill, themePalette) {
3520
3598
  if (stops.length > 0) {
3521
3599
  const gradientType = typeof fill.gradientType === "string" ? fill.gradientType : "linear";
3522
3600
  if (gradientType === "path") {
3523
- const backgroundColor = _nullishCoalesce(_optionalChain([stops, 'access', _335 => _335[stops.length - 1], 'optionalAccess', _336 => _336.color]), () => ( null));
3601
+ const backgroundColor = _nullishCoalesce(_optionalChain([stops, 'access', _350 => _350[stops.length - 1], 'optionalAccess', _351 => _351.color]), () => ( null));
3524
3602
  return {
3525
3603
  backgroundColor,
3526
3604
  backgroundImage: `radial-gradient(circle at center, ${stops.map((stop) => `${stop.color} ${Math.max(0, Math.min(100, stop.position * 100))}%`).join(", ")})`
@@ -3529,7 +3607,7 @@ function resolveWorkbookFillStyle(fill, themePalette) {
3529
3607
  const degree = typeof fill.degree === "number" ? fill.degree : Number(_nullishCoalesce(fill.degree, () => ( 0)));
3530
3608
  const cssAngle = Number.isFinite(degree) ? 90 - degree : 90;
3531
3609
  return {
3532
- backgroundColor: _nullishCoalesce(_optionalChain([stops, 'access', _337 => _337[stops.length - 1], 'optionalAccess', _338 => _338.color]), () => ( null)),
3610
+ backgroundColor: _nullishCoalesce(_optionalChain([stops, 'access', _352 => _352[stops.length - 1], 'optionalAccess', _353 => _353.color]), () => ( null)),
3533
3611
  backgroundImage: `linear-gradient(${cssAngle}deg, ${stops.map((stop) => `${stop.color} ${Math.max(0, Math.min(100, stop.position * 100))}%`).join(", ")})`
3534
3612
  };
3535
3613
  }
@@ -3826,7 +3904,7 @@ function readFeaturePropertyBagCheckboxComplements(archive) {
3826
3904
  return /* @__PURE__ */ new Set();
3827
3905
  }
3828
3906
  const document2 = parseXml2(xml);
3829
- if (!_optionalChain([document2, 'optionalAccess', _339 => _339.documentElement])) {
3907
+ if (!_optionalChain([document2, 'optionalAccess', _354 => _354.documentElement])) {
3830
3908
  return /* @__PURE__ */ new Set();
3831
3909
  }
3832
3910
  const bagNodes = getChildElements(document2.documentElement, "bag");
@@ -3911,7 +3989,7 @@ function resolveContentType(contentTypes, path) {
3911
3989
  if (override) {
3912
3990
  return override;
3913
3991
  }
3914
- const extension = _optionalChain([normalized, 'access', _340 => _340.split, 'call', _341 => _341("."), 'access', _342 => _342.pop, 'call', _343 => _343(), 'optionalAccess', _344 => _344.toLowerCase, 'call', _345 => _345()]);
3992
+ const extension = _optionalChain([normalized, 'access', _355 => _355.split, 'call', _356 => _356("."), 'access', _357 => _357.pop, 'call', _358 => _358(), 'optionalAccess', _359 => _359.toLowerCase, 'call', _360 => _360()]);
3915
3993
  if (!extension) {
3916
3994
  return "application/octet-stream";
3917
3995
  }
@@ -4008,15 +4086,15 @@ function parseWorkbookTheme(archive) {
4008
4086
  const key = colorNode.localName;
4009
4087
  const srgbNode = getFirstChild(colorNode, "srgbClr");
4010
4088
  const sysNode = getFirstChild(colorNode, "sysClr");
4011
- const hex = _nullishCoalesce(_optionalChain([srgbNode, 'optionalAccess', _346 => _346.getAttribute, 'call', _347 => _347("val")]), () => ( _optionalChain([sysNode, 'optionalAccess', _348 => _348.getAttribute, 'call', _349 => _349("lastClr")])));
4089
+ const hex = _nullishCoalesce(_optionalChain([srgbNode, 'optionalAccess', _361 => _361.getAttribute, 'call', _362 => _362("val")]), () => ( _optionalChain([sysNode, 'optionalAccess', _363 => _363.getAttribute, 'call', _364 => _364("lastClr")])));
4012
4090
  if (hex) {
4013
4091
  colors.set(key, normalizeHexColor3(hex));
4014
4092
  }
4015
4093
  }
4016
4094
  }
4017
4095
  const fontSchemeNode = _nullishCoalesce(getLocalElements(themeDocument, "fontScheme")[0], () => ( null));
4018
- const majorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _350 => _350(getFirstChild(fontSchemeNode, "majorFont"), "latin"), 'optionalAccess', _351 => _351.getAttribute, 'call', _352 => _352("typeface")]), () => ( null));
4019
- const minorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _353 => _353(getFirstChild(fontSchemeNode, "minorFont"), "latin"), 'optionalAccess', _354 => _354.getAttribute, 'call', _355 => _355("typeface")]), () => ( null));
4096
+ const majorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _365 => _365(getFirstChild(fontSchemeNode, "majorFont"), "latin"), 'optionalAccess', _366 => _366.getAttribute, 'call', _367 => _367("typeface")]), () => ( null));
4097
+ const minorLatinFont = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _368 => _368(getFirstChild(fontSchemeNode, "minorFont"), "latin"), 'optionalAccess', _369 => _369.getAttribute, 'call', _370 => _370("typeface")]), () => ( null));
4020
4098
  colors.set("bg1", _nullishCoalesce(_nullishCoalesce(colors.get("lt1"), () => ( defaultTheme.colors.get("bg1"))), () => ( "#ffffff")));
4021
4099
  colors.set("tx1", _nullishCoalesce(_nullishCoalesce(colors.get("dk1"), () => ( defaultTheme.colors.get("tx1"))), () => ( "#000000")));
4022
4100
  colors.set("bg2", _nullishCoalesce(_nullishCoalesce(colors.get("lt2"), () => ( defaultTheme.colors.get("bg2"))), () => ( "#e7e6e6")));
@@ -4076,8 +4154,8 @@ function parseSheetSparklines(document2, themePalette) {
4076
4154
  continue;
4077
4155
  }
4078
4156
  for (const sparklineNode of getChildElements(sparklineCollectionNode, "sparkline")) {
4079
- const formula = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _356 => _356(sparklineNode, "f"), 'optionalAccess', _357 => _357.textContent]), () => ( ""));
4080
- const targetReference = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _358 => _358(sparklineNode, "sqref"), 'optionalAccess', _359 => _359.textContent]), () => ( ""));
4157
+ const formula = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _371 => _371(sparklineNode, "f"), 'optionalAccess', _372 => _372.textContent]), () => ( ""));
4158
+ const targetReference = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _373 => _373(sparklineNode, "sqref"), 'optionalAccess', _374 => _374.textContent]), () => ( ""));
4081
4159
  const range = parseFormulaRangeReference(formula);
4082
4160
  const target = parseFormulaCellReference(targetReference);
4083
4161
  if (!range || !target) {
@@ -4112,15 +4190,15 @@ function parseSpreadsheetFont(node) {
4112
4190
  font[property] = hasEnabledSpreadsheetFlag(flag);
4113
4191
  }
4114
4192
  }
4115
- const size = _optionalChain([getFirstChild, 'call', _360 => _360(node, "sz"), 'optionalAccess', _361 => _361.getAttribute, 'call', _362 => _362("val")]);
4116
- const name = _optionalChain([getFirstChild, 'call', _363 => _363(node, "name"), 'optionalAccess', _364 => _364.getAttribute, 'call', _365 => _365("val")]);
4117
- const family = _optionalChain([getFirstChild, 'call', _366 => _366(node, "family"), 'optionalAccess', _367 => _367.getAttribute, 'call', _368 => _368("val")]);
4118
- const scheme = _optionalChain([getFirstChild, 'call', _369 => _369(node, "scheme"), 'optionalAccess', _370 => _370.getAttribute, 'call', _371 => _371("val")]);
4119
- const charset = _optionalChain([getFirstChild, 'call', _372 => _372(node, "charset"), 'optionalAccess', _373 => _373.getAttribute, 'call', _374 => _374("val")]);
4120
- const verticalAlign = _optionalChain([getFirstChild, 'call', _375 => _375(node, "vertAlign"), 'optionalAccess', _376 => _376.getAttribute, 'call', _377 => _377("val")]);
4193
+ const size = _optionalChain([getFirstChild, 'call', _375 => _375(node, "sz"), 'optionalAccess', _376 => _376.getAttribute, 'call', _377 => _377("val")]);
4194
+ const name = _optionalChain([getFirstChild, 'call', _378 => _378(node, "name"), 'optionalAccess', _379 => _379.getAttribute, 'call', _380 => _380("val")]);
4195
+ const family = _optionalChain([getFirstChild, 'call', _381 => _381(node, "family"), 'optionalAccess', _382 => _382.getAttribute, 'call', _383 => _383("val")]);
4196
+ const scheme = _optionalChain([getFirstChild, 'call', _384 => _384(node, "scheme"), 'optionalAccess', _385 => _385.getAttribute, 'call', _386 => _386("val")]);
4197
+ const charset = _optionalChain([getFirstChild, 'call', _387 => _387(node, "charset"), 'optionalAccess', _388 => _388.getAttribute, 'call', _389 => _389("val")]);
4198
+ const verticalAlign = _optionalChain([getFirstChild, 'call', _390 => _390(node, "vertAlign"), 'optionalAccess', _391 => _391.getAttribute, 'call', _392 => _392("val")]);
4121
4199
  const color = parseSpreadsheetColor(getFirstChild(node, "color"));
4122
4200
  if (getFirstChild(node, "u")) {
4123
- font.underline = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _378 => _378(node, "u"), 'optionalAccess', _379 => _379.getAttribute, 'call', _380 => _380("val")]), () => ( "single"));
4201
+ font.underline = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _393 => _393(node, "u"), 'optionalAccess', _394 => _394.getAttribute, 'call', _395 => _395("val")]), () => ( "single"));
4124
4202
  }
4125
4203
  if (size !== null && size !== void 0) {
4126
4204
  font.size = Number(size);
@@ -4311,8 +4389,8 @@ function parseResolvedXfStyle(xfNode, fonts, fills, borders, checkboxComplementI
4311
4389
  style.alignment = alignment;
4312
4390
  }
4313
4391
  const xfComplementNode = getFirstDescendant(xfNode, "xfComplement");
4314
- const xfComplementIndex = Number(_nullishCoalesce(_optionalChain([xfComplementNode, 'optionalAccess', _381 => _381.getAttribute, 'call', _382 => _382("i")]), () => ( Number.NaN)));
4315
- if (Number.isFinite(xfComplementIndex) && _optionalChain([checkboxComplementIndices, 'optionalAccess', _383 => _383.has, 'call', _384 => _384(xfComplementIndex)])) {
4392
+ const xfComplementIndex = Number(_nullishCoalesce(_optionalChain([xfComplementNode, 'optionalAccess', _396 => _396.getAttribute, 'call', _397 => _397("i")]), () => ( Number.NaN)));
4393
+ if (Number.isFinite(xfComplementIndex) && _optionalChain([checkboxComplementIndices, 'optionalAccess', _398 => _398.has, 'call', _399 => _399(xfComplementIndex)])) {
4316
4394
  style.cellControl = { kind: "checkbox" };
4317
4395
  }
4318
4396
  return style;
@@ -4406,7 +4484,7 @@ function parseWorkbookStyles(archive) {
4406
4484
  });
4407
4485
  tableStyleByName[name] = elements;
4408
4486
  });
4409
- const normalFont = _nullishCoalesce(_nullishCoalesce(_optionalChain([namedCellStyleByName, 'access', _385 => _385.Normal, 'optionalAccess', _386 => _386.font]), () => ( _optionalChain([styleById, 'access', _387 => _387[0], 'optionalAccess', _388 => _388.font]))), () => ( fonts[0]));
4487
+ const normalFont = _nullishCoalesce(_nullishCoalesce(_optionalChain([namedCellStyleByName, 'access', _400 => _400.Normal, 'optionalAccess', _401 => _401.font]), () => ( _optionalChain([styleById, 'access', _402 => _402[0], 'optionalAccess', _403 => _403.font]))), () => ( fonts[0]));
4410
4488
  const defaultFont = normalFont ? {
4411
4489
  family: typeof normalFont.name === "string" ? normalFont.name : void 0,
4412
4490
  sizePt: typeof normalFont.size === "number" ? normalFont.size : void 0
@@ -4436,7 +4514,7 @@ function parseConditionalFormatValueObject(node) {
4436
4514
  if (!type) {
4437
4515
  return null;
4438
4516
  }
4439
- const rawValue = _nullishCoalesce(_nullishCoalesce(node.getAttribute("val"), () => ( _optionalChain([getFirstChild, 'call', _389 => _389(node, "f"), 'optionalAccess', _390 => _390.textContent]))), () => ( void 0));
4517
+ const rawValue = _nullishCoalesce(_nullishCoalesce(node.getAttribute("val"), () => ( _optionalChain([getFirstChild, 'call', _404 => _404(node, "f"), 'optionalAccess', _405 => _405.textContent]))), () => ( void 0));
4440
4518
  const numericValue = rawValue !== void 0 ? Number(rawValue) : Number.NaN;
4441
4519
  return {
4442
4520
  type,
@@ -4485,7 +4563,7 @@ function parseStandardConditionalFormatRule(cfRuleNode, ranges, differentialStyl
4485
4563
  if (cfvos.length === 0) {
4486
4564
  return null;
4487
4565
  }
4488
- const extId = _optionalChain([getFirstDescendant, 'call', _391 => _391(cfRuleNode, "id"), 'optionalAccess', _392 => _392.textContent, 'optionalAccess', _393 => _393.trim, 'call', _394 => _394()]) || void 0;
4566
+ const extId = _optionalChain([getFirstDescendant, 'call', _406 => _406(cfRuleNode, "id"), 'optionalAccess', _407 => _407.textContent, 'optionalAccess', _408 => _408.trim, 'call', _409 => _409()]) || void 0;
4489
4567
  return {
4490
4568
  cfvos,
4491
4569
  color: parseSpreadsheetColor(getFirstChild(dataBarNode, "color")),
@@ -4661,7 +4739,7 @@ function parseConditionalFormatRules(document2, differentialStyles = []) {
4661
4739
  const extendedRules = [];
4662
4740
  getLocalElements(document2, "conditionalFormatting").forEach((conditionalFormattingNode) => {
4663
4741
  const isExtended = conditionalFormattingNode.namespaceURI !== SPREADSHEET_NS;
4664
- const ranges = isExtended ? parseSqrefRanges(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _395 => _395(conditionalFormattingNode, "sqref"), 'optionalAccess', _396 => _396.textContent]), () => ( ""))) : parseSqrefRanges(conditionalFormattingNode.getAttribute("sqref"));
4742
+ const ranges = isExtended ? parseSqrefRanges(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _410 => _410(conditionalFormattingNode, "sqref"), 'optionalAccess', _411 => _411.textContent]), () => ( ""))) : parseSqrefRanges(conditionalFormattingNode.getAttribute("sqref"));
4665
4743
  getChildElements(conditionalFormattingNode, "cfRule").forEach((cfRuleNode) => {
4666
4744
  const parsedRule = isExtended ? parseExtendedConditionalFormatRule(cfRuleNode, ranges) : parseStandardConditionalFormatRule(cfRuleNode, ranges, differentialStyles);
4667
4745
  if (parsedRule) {
@@ -4708,11 +4786,11 @@ function parseSheetState(archive, path, options) {
4708
4786
  if (!document2) {
4709
4787
  return null;
4710
4788
  }
4711
- const includeCachedFormulaValues = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _397 => _397.includeCachedFormulaValues]), () => ( true));
4712
- const autoFilterRanges = parseSqrefRanges(_optionalChain([getLocalElements, 'call', _398 => _398(document2, "autoFilter"), 'access', _399 => _399[0], 'optionalAccess', _400 => _400.getAttribute, 'call', _401 => _401("ref")]));
4789
+ const includeCachedFormulaValues = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _412 => _412.includeCachedFormulaValues]), () => ( true));
4790
+ const autoFilterRanges = parseSqrefRanges(_optionalChain([getLocalElements, 'call', _413 => _413(document2, "autoFilter"), 'access', _414 => _414[0], 'optionalAccess', _415 => _415.getAttribute, 'call', _416 => _416("ref")]));
4713
4791
  const cachedFormulaValues = {};
4714
- const conditionalFormatRules = parseConditionalFormatRules(document2, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _402 => _402.differentialStyles]), () => ( [])));
4715
- const sparklines = parseSheetSparklines(document2, _optionalChain([options, 'optionalAccess', _403 => _403.themePalette]));
4792
+ const conditionalFormatRules = parseConditionalFormatRules(document2, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _417 => _417.differentialStyles]), () => ( [])));
4793
+ const sparklines = parseSheetSparklines(document2, _optionalChain([options, 'optionalAccess', _418 => _418.themePalette]));
4716
4794
  const sheetFormatNode = _nullishCoalesce(getLocalElements(document2, "sheetFormatPr")[0], () => ( null));
4717
4795
  const sheetViewNode = _nullishCoalesce(getLocalElements(document2, "sheetView")[0], () => ( null));
4718
4796
  const rowHeightOverridesPx = {};
@@ -4725,15 +4803,15 @@ function parseSheetState(archive, path, options) {
4725
4803
  let maxContentCol = -1;
4726
4804
  let maxContentRow = -1;
4727
4805
  const columnWidthCharacterWidthPx = measureColumnCharacterWidthPx(
4728
- _optionalChain([options, 'optionalAccess', _404 => _404.defaultFont, 'optionalAccess', _405 => _405.family]),
4729
- _optionalChain([options, 'optionalAccess', _406 => _406.defaultFont, 'optionalAccess', _407 => _407.sizePt])
4806
+ _optionalChain([options, 'optionalAccess', _419 => _419.defaultFont, 'optionalAccess', _420 => _420.family]),
4807
+ _optionalChain([options, 'optionalAccess', _421 => _421.defaultFont, 'optionalAccess', _422 => _422.sizePt])
4730
4808
  );
4731
- const defaultRowHeight = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _408 => _408.getAttribute, 'call', _409 => _409("defaultRowHeight")]), () => ( 15)));
4809
+ const defaultRowHeight = Number(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _423 => _423.getAttribute, 'call', _424 => _424("defaultRowHeight")]), () => ( 15)));
4732
4810
  const defaultColWidth = Number(
4733
- _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _410 => _410.getAttribute, 'call', _411 => _411("defaultColWidth")]), () => ( _optionalChain([sheetFormatNode, 'optionalAccess', _412 => _412.getAttribute, 'call', _413 => _413("baseColWidth")]))), () => ( 8.43))
4811
+ _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetFormatNode, 'optionalAccess', _425 => _425.getAttribute, 'call', _426 => _426("defaultColWidth")]), () => ( _optionalChain([sheetFormatNode, 'optionalAccess', _427 => _427.getAttribute, 'call', _428 => _428("baseColWidth")]))), () => ( 8.43))
4734
4812
  );
4735
4813
  const rawZoomScale = Number(
4736
- _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _414 => _414.getAttribute, 'call', _415 => _415("zoomScale")]), () => ( _optionalChain([sheetViewNode, 'optionalAccess', _416 => _416.getAttribute, 'call', _417 => _417("zoomScaleNormal")]))), () => ( Number.NaN))
4814
+ _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _429 => _429.getAttribute, 'call', _430 => _430("zoomScale")]), () => ( _optionalChain([sheetViewNode, 'optionalAccess', _431 => _431.getAttribute, 'call', _432 => _432("zoomScaleNormal")]))), () => ( Number.NaN))
4737
4815
  );
4738
4816
  const zoomScale = Number.isFinite(rawZoomScale) && rawZoomScale > 0 ? rawZoomScale : 100;
4739
4817
  const trackContentCell = (cellRef) => {
@@ -4829,7 +4907,7 @@ function parseSheetState(archive, path, options) {
4829
4907
  hiddenRows: [],
4830
4908
  rowHeightOverridesPx,
4831
4909
  rowStyleIds,
4832
- showGridLines: (_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _418 => _418.getAttribute, 'call', _419 => _419("showGridLines")]), () => ( "1"))) !== "0",
4910
+ showGridLines: (_nullishCoalesce(_optionalChain([sheetViewNode, 'optionalAccess', _433 => _433.getAttribute, 'call', _434 => _434("showGridLines")]), () => ( "1"))) !== "0",
4833
4911
  sparklines,
4834
4912
  zoomScale
4835
4913
  };
@@ -4964,9 +5042,9 @@ function resolvePreferredTextTypeface(node, theme) {
4964
5042
  if (!node) {
4965
5043
  return void 0;
4966
5044
  }
4967
- const latin = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _420 => _420(node, "latin"), 'optionalAccess', _421 => _421.getAttribute, 'call', _422 => _422("typeface")]), () => ( null));
4968
- const eastAsian = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _423 => _423(node, "ea"), 'optionalAccess', _424 => _424.getAttribute, 'call', _425 => _425("typeface")]), () => ( null));
4969
- const complexScript = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _426 => _426(node, "cs"), 'optionalAccess', _427 => _427.getAttribute, 'call', _428 => _428("typeface")]), () => ( null));
5045
+ const latin = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _435 => _435(node, "latin"), 'optionalAccess', _436 => _436.getAttribute, 'call', _437 => _437("typeface")]), () => ( null));
5046
+ const eastAsian = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _438 => _438(node, "ea"), 'optionalAccess', _439 => _439.getAttribute, 'call', _440 => _440("typeface")]), () => ( null));
5047
+ const complexScript = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _441 => _441(node, "cs"), 'optionalAccess', _442 => _442.getAttribute, 'call', _443 => _443("typeface")]), () => ( null));
4970
5048
  const candidates = [latin, eastAsian, complexScript];
4971
5049
  const explicit = candidates.find((candidate) => candidate && !isThemeTypeface(candidate));
4972
5050
  if (explicit) {
@@ -4977,14 +5055,14 @@ function resolvePreferredTextTypeface(node, theme) {
4977
5055
  function parseShapeTextStyle(node, theme, fallbackColor) {
4978
5056
  if (!node) {
4979
5057
  return {
4980
- color: _optionalChain([fallbackColor, 'optionalAccess', _429 => _429.color])
5058
+ color: _optionalChain([fallbackColor, 'optionalAccess', _444 => _444.color])
4981
5059
  };
4982
5060
  }
4983
5061
  const fillColor = _nullishCoalesce(_nullishCoalesce(resolveFillColor(node, theme), () => ( fallbackColor)), () => ( null));
4984
5062
  const underlineValue = node.getAttribute("u");
4985
5063
  return {
4986
5064
  bold: node.getAttribute("b") === "1" || void 0,
4987
- color: _optionalChain([fillColor, 'optionalAccess', _430 => _430.color]),
5065
+ color: _optionalChain([fillColor, 'optionalAccess', _445 => _445.color]),
4988
5066
  fontFamily: resolvePreferredTextTypeface(node, theme),
4989
5067
  fontSizePt: node.getAttribute("sz") ? Number(node.getAttribute("sz")) / 100 : void 0,
4990
5068
  italic: node.getAttribute("i") === "1" || void 0,
@@ -5010,10 +5088,10 @@ function parseMarker(node) {
5010
5088
  if (!node) {
5011
5089
  return null;
5012
5090
  }
5013
- const col = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _431 => _431(node, "col"), 'optionalAccess', _432 => _432.textContent]), () => ( 0)));
5014
- const row = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _433 => _433(node, "row"), 'optionalAccess', _434 => _434.textContent]), () => ( 0)));
5015
- const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _435 => _435(node, "colOff"), 'optionalAccess', _436 => _436.textContent]), () => ( 0)));
5016
- const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _437 => _437(node, "rowOff"), 'optionalAccess', _438 => _438.textContent]), () => ( 0)));
5091
+ const col = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _446 => _446(node, "col"), 'optionalAccess', _447 => _447.textContent]), () => ( 0)));
5092
+ const row = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _448 => _448(node, "row"), 'optionalAccess', _449 => _449.textContent]), () => ( 0)));
5093
+ const colOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _450 => _450(node, "colOff"), 'optionalAccess', _451 => _451.textContent]), () => ( 0)));
5094
+ const rowOffsetEmu = Number(_nullishCoalesce(_optionalChain([getFirstChild, 'call', _452 => _452(node, "rowOff"), 'optionalAccess', _453 => _453.textContent]), () => ( 0)));
5017
5095
  return {
5018
5096
  col,
5019
5097
  colOffsetEmu,
@@ -5149,15 +5227,15 @@ function resolveDukeDrawingColor(color, themePalette) {
5149
5227
  function resolveDukeDrawingText(text, themePalette) {
5150
5228
  const caption = mapDukeDrawingText(text);
5151
5229
  const label = normalizeControlLabel(text.runs.map((run) => run.text).join(""));
5152
- const firstStyledRun = _optionalChain([text, 'access', _439 => _439.runs, 'access', _440 => _440.find, 'call', _441 => _441((run) => run.font), 'optionalAccess', _442 => _442.font]);
5230
+ const firstStyledRun = _optionalChain([text, 'access', _454 => _454.runs, 'access', _455 => _455.find, 'call', _456 => _456((run) => run.font), 'optionalAccess', _457 => _457.font]);
5153
5231
  const horizontalAlignment = text.horizontalAlignment;
5154
5232
  return {
5155
5233
  caption,
5156
- fontFamily: _optionalChain([firstStyledRun, 'optionalAccess', _443 => _443.name]),
5157
- fontSizePt: _optionalChain([firstStyledRun, 'optionalAccess', _444 => _444.size]),
5234
+ fontFamily: _optionalChain([firstStyledRun, 'optionalAccess', _458 => _458.name]),
5235
+ fontSizePt: _optionalChain([firstStyledRun, 'optionalAccess', _459 => _459.size]),
5158
5236
  label,
5159
5237
  textAlign: horizontalAlignment === "left" || horizontalAlignment === "center" || horizontalAlignment === "right" ? horizontalAlignment : void 0,
5160
- textColor: resolveDukeDrawingColor(_optionalChain([firstStyledRun, 'optionalAccess', _445 => _445.color]), themePalette)
5238
+ textColor: resolveDukeDrawingColor(_optionalChain([firstStyledRun, 'optionalAccess', _460 => _460.color]), themePalette)
5161
5239
  };
5162
5240
  }
5163
5241
  function mapDukeFormControlKind(kind, themePalette) {
@@ -5342,13 +5420,13 @@ function resolveSheetColumnWidthPx(sheetState, col) {
5342
5420
  if (col < 0) {
5343
5421
  return 0;
5344
5422
  }
5345
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _446 => _446.colWidthOverridesPx, 'access', _447 => _447[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _448 => _448.defaultColWidthPx]))), () => ( emuToPixels(DEFAULT_COL_WIDTH_EMU)));
5423
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _461 => _461.colWidthOverridesPx, 'access', _462 => _462[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _463 => _463.defaultColWidthPx]))), () => ( emuToPixels(DEFAULT_COL_WIDTH_EMU)));
5346
5424
  }
5347
5425
  function resolveSheetRowHeightPx(sheetState, row) {
5348
5426
  if (row < 0) {
5349
5427
  return 0;
5350
5428
  }
5351
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _449 => _449.rowHeightOverridesPx, 'access', _450 => _450[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _451 => _451.defaultRowHeightPx]))), () => ( emuToPixels(DEFAULT_ROW_HEIGHT_EMU)));
5429
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _464 => _464.rowHeightOverridesPx, 'access', _465 => _465[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _466 => _466.defaultRowHeightPx]))), () => ( emuToPixels(DEFAULT_ROW_HEIGHT_EMU)));
5352
5430
  }
5353
5431
  function sumSheetColumnWidthsEmu(sheetState, beforeCol) {
5354
5432
  let total = 0;
@@ -5438,10 +5516,10 @@ function parseGroupTransform(groupNode, parentGroup, fallbackAnchor, sheetState)
5438
5516
  const rootScaleY = rect.cy !== 0 ? anchorRect.cy / rect.cy : 1;
5439
5517
  const useRectFrameForRoot = !parentGroup && (rootScaleX < 0.85 || rootScaleX > 1.15 || rootScaleY < 0.85 || rootScaleY > 1.15);
5440
5518
  const absoluteRect = parentGroup ? applyGroupTransform(rect, parentGroup) : rootRectMatchesAnchorOrigin ? rect : anchorRect;
5441
- const childRectX = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _452 => _452.getAttribute, 'call', _453 => _453("x")]), () => ( 0))) : useRectFrameForRoot ? rect.x : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _454 => _454.getAttribute, 'call', _455 => _455("x")]), () => ( 0)));
5442
- const childRectY = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _456 => _456.getAttribute, 'call', _457 => _457("y")]), () => ( 0))) : useRectFrameForRoot ? rect.y : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _458 => _458.getAttribute, 'call', _459 => _459("y")]), () => ( 0)));
5443
- const childRectCx = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _460 => _460.getAttribute, 'call', _461 => _461("cx")]), () => ( rect.cx))) : useRectFrameForRoot ? rect.cx : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _462 => _462.getAttribute, 'call', _463 => _463("cx")]), () => ( rect.cx)));
5444
- const childRectCy = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _464 => _464.getAttribute, 'call', _465 => _465("cy")]), () => ( rect.cy))) : useRectFrameForRoot ? rect.cy : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _466 => _466.getAttribute, 'call', _467 => _467("cy")]), () => ( rect.cy)));
5519
+ const childRectX = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _467 => _467.getAttribute, 'call', _468 => _468("x")]), () => ( 0))) : useRectFrameForRoot ? rect.x : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _469 => _469.getAttribute, 'call', _470 => _470("x")]), () => ( 0)));
5520
+ const childRectY = parentGroup ? Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _471 => _471.getAttribute, 'call', _472 => _472("y")]), () => ( 0))) : useRectFrameForRoot ? rect.y : Number(_nullishCoalesce(_optionalChain([chOffNode, 'optionalAccess', _473 => _473.getAttribute, 'call', _474 => _474("y")]), () => ( 0)));
5521
+ const childRectCx = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _475 => _475.getAttribute, 'call', _476 => _476("cx")]), () => ( rect.cx))) : useRectFrameForRoot ? rect.cx : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _477 => _477.getAttribute, 'call', _478 => _478("cx")]), () => ( rect.cx)));
5522
+ const childRectCy = parentGroup ? Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _479 => _479.getAttribute, 'call', _480 => _480("cy")]), () => ( rect.cy))) : useRectFrameForRoot ? rect.cy : Number(_nullishCoalesce(_optionalChain([chExtNode, 'optionalAccess', _481 => _481.getAttribute, 'call', _482 => _482("cy")]), () => ( rect.cy)));
5445
5523
  return {
5446
5524
  chCx: childRectCx,
5447
5525
  chCy: childRectCy,
@@ -5449,8 +5527,8 @@ function parseGroupTransform(groupNode, parentGroup, fallbackAnchor, sheetState)
5449
5527
  chY: childRectY,
5450
5528
  cx: absoluteRect.cx,
5451
5529
  cy: absoluteRect.cy,
5452
- scaleX: childRectCx !== 0 ? absoluteRect.cx / childRectCx : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _468 => _468.scaleX]), () => ( 1)),
5453
- scaleY: childRectCy !== 0 ? absoluteRect.cy / childRectCy : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _469 => _469.scaleY]), () => ( 1)),
5530
+ scaleX: childRectCx !== 0 ? absoluteRect.cx / childRectCx : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _483 => _483.scaleX]), () => ( 1)),
5531
+ scaleY: childRectCy !== 0 ? absoluteRect.cy / childRectCy : _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _484 => _484.scaleY]), () => ( 1)),
5454
5532
  x: absoluteRect.x,
5455
5533
  y: absoluteRect.y
5456
5534
  };
@@ -5459,8 +5537,8 @@ function anchorFromNodeOrFallback(node, fallbackAnchor, parentGroup) {
5459
5537
  const xfrmNode = getFirstDescendant(node, "xfrm");
5460
5538
  const rect = parseTransformRect(xfrmNode);
5461
5539
  if (rect) {
5462
- const scaleX = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _470 => _470.scaleX]), () => ( 1));
5463
- const scaleY = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _471 => _471.scaleY]), () => ( 1));
5540
+ const scaleX = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _485 => _485.scaleX]), () => ( 1));
5541
+ const scaleY = _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _486 => _486.scaleY]), () => ( 1));
5464
5542
  return {
5465
5543
  anchor: parentGroup ? rectToAbsoluteAnchor(applyGroupTransform(rect, parentGroup)) : fallbackAnchor,
5466
5544
  flipH: rect.flipH,
@@ -5475,8 +5553,8 @@ function anchorFromNodeOrFallback(node, fallbackAnchor, parentGroup) {
5475
5553
  flipH: false,
5476
5554
  flipV: false,
5477
5555
  rotationDeg: 0,
5478
- scaleX: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _472 => _472.scaleX]), () => ( 1)),
5479
- scaleY: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _473 => _473.scaleY]), () => ( 1))
5556
+ scaleX: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _487 => _487.scaleX]), () => ( 1)),
5557
+ scaleY: _nullishCoalesce(_optionalChain([parentGroup, 'optionalAccess', _488 => _488.scaleY]), () => ( 1))
5480
5558
  };
5481
5559
  }
5482
5560
  function mapParagraphAlign(value) {
@@ -5533,15 +5611,15 @@ function parseShapeStroke(node, styleNode, theme) {
5533
5611
  if (lineNode && getFirstChild(lineNode, "noFill")) {
5534
5612
  return { none: true };
5535
5613
  }
5536
- const color = _nullishCoalesce(resolveFillColor(lineNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([lineRefNode, 'optionalAccess', _474 => _474.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
5537
- const widthEmu = Number(_nullishCoalesce(_optionalChain([lineNode, 'optionalAccess', _475 => _475.getAttribute, 'call', _476 => _476("w")]), () => ( 0)));
5614
+ const color = _nullishCoalesce(resolveFillColor(lineNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([lineRefNode, 'optionalAccess', _489 => _489.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
5615
+ const widthEmu = Number(_nullishCoalesce(_optionalChain([lineNode, 'optionalAccess', _490 => _490.getAttribute, 'call', _491 => _491("w")]), () => ( 0)));
5538
5616
  return {
5539
- color: _optionalChain([color, 'optionalAccess', _477 => _477.color]),
5540
- dash: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _478 => _478(_nullishCoalesce(lineNode, () => ( node)), "prstDash"), 'optionalAccess', _479 => _479.getAttribute, 'call', _480 => _480("val")]), () => ( void 0)),
5541
- headEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _481 => _481(_nullishCoalesce(lineNode, () => ( node)), "headEnd"), 'optionalAccess', _482 => _482.getAttribute, 'call', _483 => _483("type")]), () => ( void 0)),
5617
+ color: _optionalChain([color, 'optionalAccess', _492 => _492.color]),
5618
+ dash: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _493 => _493(_nullishCoalesce(lineNode, () => ( node)), "prstDash"), 'optionalAccess', _494 => _494.getAttribute, 'call', _495 => _495("val")]), () => ( void 0)),
5619
+ headEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _496 => _496(_nullishCoalesce(lineNode, () => ( node)), "headEnd"), 'optionalAccess', _497 => _497.getAttribute, 'call', _498 => _498("type")]), () => ( void 0)),
5542
5620
  none: false,
5543
- opacity: _optionalChain([color, 'optionalAccess', _484 => _484.opacity]),
5544
- tailEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _485 => _485(_nullishCoalesce(lineNode, () => ( node)), "tailEnd"), 'optionalAccess', _486 => _486.getAttribute, 'call', _487 => _487("type")]), () => ( void 0)),
5621
+ opacity: _optionalChain([color, 'optionalAccess', _499 => _499.opacity]),
5622
+ tailEndType: _nullishCoalesce(_optionalChain([getFirstChild, 'call', _500 => _500(_nullishCoalesce(lineNode, () => ( node)), "tailEnd"), 'optionalAccess', _501 => _501.getAttribute, 'call', _502 => _502("type")]), () => ( void 0)),
5545
5623
  widthPx: widthEmu > 0 ? emuToPixels(widthEmu) : void 0
5546
5624
  };
5547
5625
  }
@@ -5555,7 +5633,7 @@ function parseShapeFill(node, styleNode, theme, geometry) {
5555
5633
  return { none: true };
5556
5634
  }
5557
5635
  const fillRefNode = styleNode ? getFirstChild(styleNode, "fillRef") : null;
5558
- const fillColor = _nullishCoalesce(resolveFillColor(shapePropsNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _488 => _488.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
5636
+ const fillColor = _nullishCoalesce(resolveFillColor(shapePropsNode, theme), () => ( resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([fillRefNode, 'optionalAccess', _503 => _503.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme)));
5559
5637
  if (!fillColor) {
5560
5638
  return void 0;
5561
5639
  }
@@ -5652,12 +5730,12 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
5652
5730
  return [];
5653
5731
  }
5654
5732
  const defaultFontRef = styleNode ? getFirstChild(styleNode, "fontRef") : null;
5655
- const defaultFontColor = resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([defaultFontRef, 'optionalAccess', _489 => _489.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme);
5733
+ const defaultFontColor = resolveColorValue(_nullishCoalesce(Array.from(_nullishCoalesce(_optionalChain([defaultFontRef, 'optionalAccess', _504 => _504.childNodes]), () => ( []))).filter(isElementNode2)[0], () => ( null)), theme);
5656
5734
  const listStyleNode = getFirstChild(txBodyNode, "lstStyle");
5657
5735
  const paragraphs = [];
5658
5736
  getChildElements(txBodyNode, "p").forEach((paragraphNode) => {
5659
5737
  const paragraphProps = getFirstChild(paragraphNode, "pPr");
5660
- const paragraphLevel = Number(_nullishCoalesce(_optionalChain([paragraphProps, 'optionalAccess', _490 => _490.getAttribute, 'call', _491 => _491("lvl")]), () => ( 0)));
5738
+ const paragraphLevel = Number(_nullishCoalesce(_optionalChain([paragraphProps, 'optionalAccess', _505 => _505.getAttribute, 'call', _506 => _506("lvl")]), () => ( 0)));
5661
5739
  const listLevelProps = getFirstChild(_nullishCoalesce(listStyleNode, () => ( txBodyNode)), `lvl${paragraphLevel + 1}pPr`);
5662
5740
  const inheritedStyle = mergeShapeTextStyles(
5663
5741
  parseShapeTextStyle(getFirstChild(_nullishCoalesce(listLevelProps, () => ( txBodyNode)), "defRPr"), theme, defaultFontColor),
@@ -5675,7 +5753,7 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
5675
5753
  return;
5676
5754
  }
5677
5755
  sawRenderableChild = true;
5678
- const text = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _492 => _492(child, "t"), 'optionalAccess', _493 => _493.textContent]), () => ( ""));
5756
+ const text = _nullishCoalesce(_optionalChain([getFirstChild, 'call', _507 => _507(child, "t"), 'optionalAccess', _508 => _508.textContent]), () => ( ""));
5679
5757
  const runProps = getFirstChild(child, "rPr");
5680
5758
  const runStyle = mergeShapeTextStyles(
5681
5759
  inheritedStyle,
@@ -5706,7 +5784,7 @@ function parseShapeParagraphs(shapeNode, styleNode, theme) {
5706
5784
  });
5707
5785
  }
5708
5786
  paragraphs.push({
5709
- align: mapParagraphAlign(_optionalChain([paragraphProps, 'optionalAccess', _494 => _494.getAttribute, 'call', _495 => _495("algn")])),
5787
+ align: mapParagraphAlign(_optionalChain([paragraphProps, 'optionalAccess', _509 => _509.getAttribute, 'call', _510 => _510("algn")])),
5710
5788
  runs
5711
5789
  });
5712
5790
  });
@@ -5718,26 +5796,26 @@ function parseTextBox(shapeNode) {
5718
5796
  return void 0;
5719
5797
  }
5720
5798
  const bodyProps = getFirstChild(txBodyNode, "bodyPr");
5721
- const leftInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _496 => _496.getAttribute, 'call', _497 => _497("lIns")]), () => ( 91440))));
5722
- const rightInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _498 => _498.getAttribute, 'call', _499 => _499("rIns")]), () => ( 91440))));
5723
- const topInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _500 => _500.getAttribute, 'call', _501 => _501("tIns")]), () => ( 45720))));
5724
- const bottomInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _502 => _502.getAttribute, 'call', _503 => _503("bIns")]), () => ( 45720))));
5799
+ const leftInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _511 => _511.getAttribute, 'call', _512 => _512("lIns")]), () => ( 91440))));
5800
+ const rightInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _513 => _513.getAttribute, 'call', _514 => _514("rIns")]), () => ( 91440))));
5801
+ const topInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _515 => _515.getAttribute, 'call', _516 => _516("tIns")]), () => ( 45720))));
5802
+ const bottomInset = emuToPixels(Number(_nullishCoalesce(_optionalChain([bodyProps, 'optionalAccess', _517 => _517.getAttribute, 'call', _518 => _518("bIns")]), () => ( 45720))));
5725
5803
  return {
5726
- horizontalAlign: _optionalChain([bodyProps, 'optionalAccess', _504 => _504.getAttribute, 'call', _505 => _505("anchorCtr")]) === "1" ? "center" : "left",
5804
+ horizontalAlign: _optionalChain([bodyProps, 'optionalAccess', _519 => _519.getAttribute, 'call', _520 => _520("anchorCtr")]) === "1" ? "center" : "left",
5727
5805
  insetPx: {
5728
5806
  bottom: bottomInset,
5729
5807
  left: leftInset,
5730
5808
  right: rightInset,
5731
5809
  top: topInset
5732
5810
  },
5733
- verticalAlign: mapVerticalAnchor(_optionalChain([bodyProps, 'optionalAccess', _506 => _506.getAttribute, 'call', _507 => _507("anchor")]))
5811
+ verticalAlign: mapVerticalAnchor(_optionalChain([bodyProps, 'optionalAccess', _521 => _521.getAttribute, 'call', _522 => _522("anchor")]))
5734
5812
  };
5735
5813
  }
5736
5814
  function getHyperlinkTarget(node, drawingRelationships) {
5737
5815
  const hyperlinkNode = node ? getFirstDescendant(node, "hlinkClick") : null;
5738
5816
  const hyperlinkTargetNode = _nullishCoalesce(hyperlinkNode, () => ( node));
5739
5817
  const hyperlinkId = hyperlinkTargetNode ? getRelationshipId(hyperlinkTargetNode) : null;
5740
- return hyperlinkId ? _nullishCoalesce(_optionalChain([drawingRelationships, 'access', _508 => _508.get, 'call', _509 => _509(hyperlinkId), 'optionalAccess', _510 => _510.target]), () => ( void 0)) : void 0;
5818
+ return hyperlinkId ? _nullishCoalesce(_optionalChain([drawingRelationships, 'access', _523 => _523.get, 'call', _524 => _524(hyperlinkId), 'optionalAccess', _525 => _525.target]), () => ( void 0)) : void 0;
5741
5819
  }
5742
5820
  function parsePictureNode(pictureNode, fallbackAnchor, drawingRelationships, archive, contentTypes, objectUrls, workbookSheetIndex, imageId, zIndex, parentGroup) {
5743
5821
  const blipNode = getFirstDescendant(pictureNode, "blip");
@@ -5759,12 +5837,12 @@ function parsePictureNode(pictureNode, fallbackAnchor, drawingRelationships, arc
5759
5837
  return {
5760
5838
  image: {
5761
5839
  anchor: transform.anchor,
5762
- description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _511 => _511.getAttribute, 'call', _512 => _512("descr")]), () => ( void 0)),
5840
+ description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _526 => _526.getAttribute, 'call', _527 => _527("descr")]), () => ( void 0)),
5763
5841
  hyperlink: getHyperlinkTarget(_nullishCoalesce(nonVisualProps, () => ( pictureNode)), drawingRelationships),
5764
5842
  id: imageId,
5765
5843
  mediaPath: mediaRelationship.target,
5766
5844
  mimeType: resolveContentType(contentTypes, mediaRelationship.target),
5767
- name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _513 => _513.getAttribute, 'call', _514 => _514("name")]), () => ( void 0)),
5845
+ name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _528 => _528.getAttribute, 'call', _529 => _529("name")]), () => ( void 0)),
5768
5846
  sheetIndex: workbookSheetIndex,
5769
5847
  src: createImageSource(mediaBytes, resolveContentType(contentTypes, mediaRelationship.target), objectUrls),
5770
5848
  workbookSheetIndex,
@@ -5777,28 +5855,28 @@ function parseShapeNode(shapeNode, fallbackAnchor, drawingRelationships, theme,
5777
5855
  const nonVisualProps = getFirstDescendant(shapeNode, "cNvPr");
5778
5856
  const styleNode = getFirstChild(shapeNode, "style");
5779
5857
  const transform = anchorFromNodeOrFallback(shapeNode, fallbackAnchor, parentGroup);
5780
- const geometry = _nullishCoalesce(_optionalChain([getFirstDescendant, 'call', _515 => _515(shapeNode, "prstGeom"), 'optionalAccess', _516 => _516.getAttribute, 'call', _517 => _517("prst")]), () => ( (getFirstDescendant(shapeNode, "custGeom") ? "custom" : "rect")));
5858
+ const geometry = _nullishCoalesce(_optionalChain([getFirstDescendant, 'call', _530 => _530(shapeNode, "prstGeom"), 'optionalAccess', _531 => _531.getAttribute, 'call', _532 => _532("prst")]), () => ( (getFirstDescendant(shapeNode, "custGeom") ? "custom" : "rect")));
5781
5859
  const customPath = geometry === "custom" ? parseCustomGeometryPath(shapeNode) : void 0;
5782
5860
  const geometryAdjustments = parseShapeGeometryAdjustments(shapeNode);
5783
5861
  return {
5784
5862
  anchor: transform.anchor,
5785
- description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _518 => _518.getAttribute, 'call', _519 => _519("descr")]), () => ( void 0)),
5863
+ description: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _533 => _533.getAttribute, 'call', _534 => _534("descr")]), () => ( void 0)),
5786
5864
  fill: parseShapeFill(shapeNode, styleNode, theme, geometry),
5787
5865
  flipH: transform.flipH,
5788
5866
  flipV: transform.flipV,
5789
5867
  geometry,
5790
5868
  geometryAdjustments,
5791
- hidden: _optionalChain([nonVisualProps, 'optionalAccess', _520 => _520.getAttribute, 'call', _521 => _521("hidden")]) === "1" || void 0,
5869
+ hidden: _optionalChain([nonVisualProps, 'optionalAccess', _535 => _535.getAttribute, 'call', _536 => _536("hidden")]) === "1" || void 0,
5792
5870
  hyperlink: getHyperlinkTarget(_nullishCoalesce(nonVisualProps, () => ( shapeNode)), drawingRelationships),
5793
5871
  id: shapeId,
5794
- name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _522 => _522.getAttribute, 'call', _523 => _523("name")]), () => ( void 0)),
5872
+ name: _nullishCoalesce(_optionalChain([nonVisualProps, 'optionalAccess', _537 => _537.getAttribute, 'call', _538 => _538("name")]), () => ( void 0)),
5795
5873
  paragraphs: parseShapeParagraphs(shapeNode, styleNode, theme),
5796
5874
  rotationDeg: transform.rotationDeg,
5797
5875
  scaleX: transform.scaleX,
5798
5876
  scaleY: transform.scaleY,
5799
5877
  sheetIndex: workbookSheetIndex,
5800
- svgPath: _optionalChain([customPath, 'optionalAccess', _524 => _524.path]),
5801
- svgViewBox: _optionalChain([customPath, 'optionalAccess', _525 => _525.viewBox]),
5878
+ svgPath: _optionalChain([customPath, 'optionalAccess', _539 => _539.path]),
5879
+ svgViewBox: _optionalChain([customPath, 'optionalAccess', _540 => _540.viewBox]),
5802
5880
  stroke: parseShapeStroke(shapeNode, styleNode, theme),
5803
5881
  textBox: parseTextBox(shapeNode),
5804
5882
  workbookSheetIndex,
@@ -6107,7 +6185,7 @@ function updateWorkbookImageAnchor(assets, imageId, anchor) {
6107
6185
  if (!origin) {
6108
6186
  return false;
6109
6187
  }
6110
- const attachments = _nullishCoalesce(_optionalChain([assets, 'access', _526 => _526.sheetOrigins, 'access', _527 => _527[origin.workbookSheetIndex], 'optionalAccess', _528 => _528.attachments]), () => ( []));
6188
+ const attachments = _nullishCoalesce(_optionalChain([assets, 'access', _541 => _541.sheetOrigins, 'access', _542 => _542[origin.workbookSheetIndex], 'optionalAccess', _543 => _543.attachments]), () => ( []));
6111
6189
  for (const attachment of attachments) {
6112
6190
  if (attachment.drawingPath !== origin.drawingPath) {
6113
6191
  continue;
@@ -6217,7 +6295,7 @@ function mergeContentTypeForPath(targetDocument, originalDocument, partPath) {
6217
6295
  return;
6218
6296
  }
6219
6297
  }
6220
- const extension = _optionalChain([normalizedPartName, 'access', _529 => _529.split, 'call', _530 => _530("."), 'access', _531 => _531.pop, 'call', _532 => _532(), 'optionalAccess', _533 => _533.toLowerCase, 'call', _534 => _534()]);
6298
+ const extension = _optionalChain([normalizedPartName, 'access', _544 => _544.split, 'call', _545 => _545("."), 'access', _546 => _546.pop, 'call', _547 => _547(), 'optionalAccess', _548 => _548.toLowerCase, 'call', _549 => _549()]);
6221
6299
  if (!extension) {
6222
6300
  return;
6223
6301
  }
@@ -6320,7 +6398,7 @@ function mergeWorkbookImageAssets(savedBytes, sourceAssets, sheetOrigins) {
6320
6398
  }
6321
6399
  };
6322
6400
  sheetOrigins.forEach((origin, workbookSheetIndex) => {
6323
- if (!_optionalChain([origin, 'optionalAccess', _535 => _535.attachments, 'access', _536 => _536.length])) {
6401
+ if (!_optionalChain([origin, 'optionalAccess', _550 => _550.attachments, 'access', _551 => _551.length])) {
6324
6402
  return;
6325
6403
  }
6326
6404
  const currentSheet = workbookSheets[workbookSheetIndex];
@@ -6349,7 +6427,7 @@ function mergeWorkbookImageAssets(savedBytes, sourceAssets, sheetOrigins) {
6349
6427
  relationshipNode.setAttribute("Id", relationshipId);
6350
6428
  relationshipNode.setAttribute("Type", DRAWING_REL_TYPE);
6351
6429
  relationshipNode.setAttribute("Target", relativeArchivePath(currentSheet.path, attachment.drawingPath));
6352
- _optionalChain([relDocument, 'access', _537 => _537.documentElement, 'optionalAccess', _538 => _538.appendChild, 'call', _539 => _539(relationshipNode)]);
6430
+ _optionalChain([relDocument, 'access', _552 => _552.documentElement, 'optionalAccess', _553 => _553.appendChild, 'call', _554 => _554(relationshipNode)]);
6353
6431
  appendSheetDrawingReference(sheetDocument, relationshipId);
6354
6432
  });
6355
6433
  archive[currentSheet.path] = _fflate.strToU8.call(void 0, serializeXml2(sheetDocument));
@@ -6520,7 +6598,7 @@ function collectReferencedSheetNames(workbook) {
6520
6598
  continue;
6521
6599
  }
6522
6600
  for (const cell of cells) {
6523
- const formula = _optionalChain([cell, 'optionalAccess', _540 => _540.formula]);
6601
+ const formula = _optionalChain([cell, 'optionalAccess', _555 => _555.formula]);
6524
6602
  if (!formula) {
6525
6603
  continue;
6526
6604
  }
@@ -6567,7 +6645,7 @@ function collectFormulaCellsWithSavedValues(workbook) {
6567
6645
  continue;
6568
6646
  }
6569
6647
  for (const cell of cells) {
6570
- if (typeof _optionalChain([cell, 'optionalAccess', _541 => _541.row]) !== "number" || typeof _optionalChain([cell, 'optionalAccess', _542 => _542.col]) !== "number") {
6648
+ if (typeof _optionalChain([cell, 'optionalAccess', _556 => _556.row]) !== "number" || typeof _optionalChain([cell, 'optionalAccess', _557 => _557.col]) !== "number") {
6571
6649
  continue;
6572
6650
  }
6573
6651
  let saved;
@@ -6777,7 +6855,7 @@ var XlsxWorkerClient = (_class = class {
6777
6855
  __init5() {this.startupTimer = null}
6778
6856
  constructor() {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
6779
6857
  try {
6780
- this.worker = new Worker(new URL("./xlsx-worker.js", _chunkT5WZHPINcjs.importMetaUrl), { type: "module" });
6858
+ this.worker = new Worker(new URL("./xlsx-worker.js", _chunkAD4CGQN2cjs.importMetaUrl), { type: "module" });
6781
6859
  } catch (e12) {
6782
6860
  throw new XlsxWorkerUnavailableError("The workbook worker could not be started.");
6783
6861
  }
@@ -6821,10 +6899,10 @@ var XlsxWorkerClient = (_class = class {
6821
6899
  type: "load"
6822
6900
  }, [workerBuffer]);
6823
6901
  }
6824
- getCellSnapshot(workbookSheetIndex, row, col) {
6902
+ getCellSnapshot(workbookSheetIndex, row, col, locale) {
6825
6903
  return this.request({
6826
6904
  id: 0,
6827
- payload: { col, row, workbookSheetIndex },
6905
+ payload: { col, row, workbookSheetIndex, locale },
6828
6906
  type: "getCellSnapshot"
6829
6907
  });
6830
6908
  }
@@ -6841,10 +6919,10 @@ var XlsxWorkerClient = (_class = class {
6841
6919
  type: "parseCharts"
6842
6920
  }, [workerBuffer]);
6843
6921
  }
6844
- getRowsBatch(workbookSheetIndex, startRow, rowCount) {
6922
+ getRowsBatch(workbookSheetIndex, startRow, rowCount, locale) {
6845
6923
  return this.request({
6846
6924
  id: 0,
6847
- payload: { rowCount, startRow, workbookSheetIndex },
6925
+ payload: { rowCount, startRow, workbookSheetIndex, locale },
6848
6926
  type: "getRowsBatch"
6849
6927
  });
6850
6928
  }
@@ -7132,14 +7210,14 @@ function clampZoomScale(zoomScale) {
7132
7210
  return Math.min(MAX_ZOOM_SCALE, Math.max(MIN_ZOOM_SCALE, Math.round(zoomScale)));
7133
7211
  }
7134
7212
  function resolveDefaultZoomScale(activeTab, activeSheet) {
7135
- if (_optionalChain([activeTab, 'optionalAccess', _543 => _543.kind]) !== "sheet") {
7213
+ if (_optionalChain([activeTab, 'optionalAccess', _558 => _558.kind]) !== "sheet") {
7136
7214
  return DEFAULT_ZOOM_SCALE;
7137
7215
  }
7138
- return clampZoomScale(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _544 => _544.zoomScale]), () => ( DEFAULT_ZOOM_SCALE)));
7216
+ return clampZoomScale(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _559 => _559.zoomScale]), () => ( DEFAULT_ZOOM_SCALE)));
7139
7217
  }
7140
7218
  function resolveWorksheetZoomScale(worksheet, sheetState) {
7141
7219
  const candidates = [
7142
- typeof _optionalChain([sheetState, 'optionalAccess', _545 => _545.zoomScale]) === "number" ? sheetState.zoomScale : void 0,
7220
+ typeof _optionalChain([sheetState, 'optionalAccess', _560 => _560.zoomScale]) === "number" ? sheetState.zoomScale : void 0,
7143
7221
  typeof worksheet.zoomScale === "number" ? worksheet.zoomScale : void 0
7144
7222
  ];
7145
7223
  const value = candidates.find((entry) => typeof entry === "number" && Number.isFinite(entry) && entry > 0);
@@ -7258,18 +7336,18 @@ function resolveDisplayFileName(src, fileName) {
7258
7336
  }
7259
7337
  function resolveSheetDisplayUsedRange(usedRange, sheetState) {
7260
7338
  const [minRow, minCol, maxRow, maxCol] = usedRange;
7261
- const maxContentRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _546 => _546.maxContentRow]), () => ( -1));
7262
- const maxContentCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _547 => _547.maxContentCol]), () => ( -1));
7263
- const maxVerticalMergeEndRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _548 => _548.maxVerticalMergeEndRow]), () => ( -1));
7264
- const maxHorizontalMergeEndCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _549 => _549.maxHorizontalMergeEndCol]), () => ( -1));
7339
+ const maxContentRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _561 => _561.maxContentRow]), () => ( -1));
7340
+ const maxContentCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _562 => _562.maxContentCol]), () => ( -1));
7341
+ const maxVerticalMergeEndRow = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _563 => _563.maxVerticalMergeEndRow]), () => ( -1));
7342
+ const maxHorizontalMergeEndCol = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _564 => _564.maxHorizontalMergeEndCol]), () => ( -1));
7265
7343
  const maxMeaningfulRow = Math.max(maxContentRow, maxVerticalMergeEndRow);
7266
7344
  const maxMeaningfulCol = Math.max(maxContentCol, maxHorizontalMergeEndCol);
7267
7345
  if (maxMeaningfulRow < 0 && maxMeaningfulCol < 0) {
7268
7346
  return usedRange;
7269
7347
  }
7270
7348
  return [
7271
- _optionalChain([sheetState, 'optionalAccess', _550 => _550.minContentRow]) !== void 0 && sheetState.minContentRow >= 0 ? Math.min(minRow, sheetState.minContentRow) : minRow,
7272
- _optionalChain([sheetState, 'optionalAccess', _551 => _551.minContentCol]) !== void 0 && sheetState.minContentCol >= 0 ? Math.min(minCol, sheetState.minContentCol) : minCol,
7349
+ _optionalChain([sheetState, 'optionalAccess', _565 => _565.minContentRow]) !== void 0 && sheetState.minContentRow >= 0 ? Math.min(minRow, sheetState.minContentRow) : minRow,
7350
+ _optionalChain([sheetState, 'optionalAccess', _566 => _566.minContentCol]) !== void 0 && sheetState.minContentCol >= 0 ? Math.min(minCol, sheetState.minContentCol) : minCol,
7273
7351
  maxMeaningfulRow >= 0 ? maxContentRow >= 0 ? Math.min(maxRow, maxMeaningfulRow) : Math.max(maxRow, maxMeaningfulRow) : maxRow,
7274
7352
  maxMeaningfulCol >= 0 ? maxContentCol >= 0 ? Math.min(maxCol, maxMeaningfulCol) : Math.max(maxCol, maxMeaningfulCol) : maxCol
7275
7353
  ];
@@ -7278,18 +7356,18 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
7278
7356
  const sheets = [];
7279
7357
  for (let index = 0; index < workbook.sheetCount; index += 1) {
7280
7358
  const worksheet = workbook.getSheet(index);
7281
- const sheetState = _nullishCoalesce(_optionalChain([sheetStatesByWorkbookSheetIndex, 'optionalAccess', _552 => _552[index]]), () => ( null));
7359
+ const sheetState = _nullishCoalesce(_optionalChain([sheetStatesByWorkbookSheetIndex, 'optionalAccess', _567 => _567[index]]), () => ( null));
7282
7360
  const mergeMetadata = resolveWorksheetMergeMetadata(worksheet);
7283
7361
  const effectiveSheetState = {
7284
7362
  ...sheetState,
7285
7363
  ...mergeMetadata
7286
7364
  };
7287
- const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _553 => _553.defaultColWidthPx]), () => ( resolveWorksheetDefaultColumnWidthPixels(
7365
+ const defaultColWidthPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _568 => _568.defaultColWidthPx]), () => ( resolveWorksheetDefaultColumnWidthPixels(
7288
7366
  worksheet,
7289
- _optionalChain([sheetState, 'optionalAccess', _554 => _554.columnWidthCharacterWidthPx]),
7367
+ _optionalChain([sheetState, 'optionalAccess', _569 => _569.columnWidthCharacterWidthPx]),
7290
7368
  DEFAULT_COL_WIDTH
7291
7369
  )));
7292
- const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _555 => _555.defaultRowHeightPx]), () => ( resolveWorksheetDefaultRowHeightPixels(
7370
+ const defaultRowHeightPx = _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _570 => _570.defaultRowHeightPx]), () => ( resolveWorksheetDefaultRowHeightPixels(
7293
7371
  worksheet,
7294
7372
  DEFAULT_ROW_HEIGHT
7295
7373
  )));
@@ -7300,26 +7378,26 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
7300
7378
  const resolveColumnWidthPx = (col) => {
7301
7379
  const width = worksheet.getColumnWidth(col);
7302
7380
  if (width !== void 0 && width !== null) {
7303
- return resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _556 => _556.columnWidthCharacterWidthPx]));
7381
+ return resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _571 => _571.columnWidthCharacterWidthPx]));
7304
7382
  }
7305
- return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _557 => _557.colWidthOverridesPx, 'optionalAccess', _558 => _558[col]]), () => ( defaultColWidthPx));
7383
+ return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _572 => _572.colWidthOverridesPx, 'optionalAccess', _573 => _573[col]]), () => ( defaultColWidthPx));
7306
7384
  };
7307
7385
  const resolveRowHeightPx = (row) => {
7308
7386
  const height = worksheet.getRowHeight(row);
7309
7387
  if (height !== void 0 && height !== null) {
7310
7388
  return Math.max(Math.round(height * 1.33), MIN_ROW_HEIGHT_PX2);
7311
7389
  }
7312
- return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _559 => _559.rowHeightOverridesPx, 'optionalAccess', _560 => _560[row]]), () => ( defaultRowHeightPx));
7390
+ return _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _574 => _574.rowHeightOverridesPx, 'optionalAccess', _575 => _575[row]]), () => ( defaultRowHeightPx));
7313
7391
  };
7314
7392
  const usedRange = worksheet.usedRange();
7315
7393
  if (!usedRange) {
7316
7394
  sheets.push({
7317
- autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _561 => _561.autoFilterRanges]), () => ( [])),
7318
- cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _562 => _562.cachedFormulaValues]), () => ( {})),
7319
- columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _563 => _563.columnWidthCharacterWidthPx]),
7320
- colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _564 => _564.colWidthOverridesPx]), () => ( {})),
7321
- colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _565 => _565.colStyleIds]), () => ( {})),
7322
- conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _566 => _566.conditionalFormatRules]), () => ( [])),
7395
+ autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _576 => _576.autoFilterRanges]), () => ( [])),
7396
+ cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _577 => _577.cachedFormulaValues]), () => ( {})),
7397
+ columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _578 => _578.columnWidthCharacterWidthPx]),
7398
+ colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _579 => _579.colWidthOverridesPx]), () => ( {})),
7399
+ colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _580 => _580.colStyleIds]), () => ( {})),
7400
+ conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _581 => _581.conditionalFormatRules]), () => ( [])),
7323
7401
  dataValidations: parseWorksheetDataValidations(worksheet),
7324
7402
  defaultColWidthPx,
7325
7403
  defaultRowHeightPx,
@@ -7340,17 +7418,17 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
7340
7418
  namedCellStyleByName: _nullishCoalesce(namedCellStyleByName, () => ( {})),
7341
7419
  rowCount: 0,
7342
7420
  colCount: 0,
7343
- rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _567 => _567.rowHeightOverridesPx]), () => ( {})),
7344
- rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _568 => _568.rowStyleIds]), () => ( {})),
7345
- cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _569 => _569.cellStyleIds]), () => ( {})),
7421
+ rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _582 => _582.rowHeightOverridesPx]), () => ( {})),
7422
+ rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _583 => _583.rowStyleIds]), () => ( {})),
7423
+ cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _584 => _584.cellStyleIds]), () => ( {})),
7346
7424
  styleById: _nullishCoalesce(styleById, () => ( {})),
7347
- sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _570 => _570.sparklines]), () => ( [])),
7425
+ sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _585 => _585.sparklines]), () => ( [])),
7348
7426
  tableStyleByName: _nullishCoalesce(tableStyleByName, () => ( {})),
7349
7427
  visibleRows: [],
7350
7428
  visibleCols: [],
7351
7429
  colWidths: [],
7352
7430
  rowHeights: [],
7353
- showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _571 => _571.showGridLines]), () => ( true)),
7431
+ showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _586 => _586.showGridLines]), () => ( true)),
7354
7432
  themePalette: _nullishCoalesce(themePalette, () => ( { colorsByIndex: {} })),
7355
7433
  workbookSheetIndex: index,
7356
7434
  zoomScale: resolveWorksheetZoomScale(worksheet, sheetState)
@@ -7403,12 +7481,12 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
7403
7481
  return colWidthsCache;
7404
7482
  };
7405
7483
  const sheet = {
7406
- autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _572 => _572.autoFilterRanges]), () => ( [])),
7407
- cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _573 => _573.cachedFormulaValues]), () => ( {})),
7408
- columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _574 => _574.columnWidthCharacterWidthPx]),
7409
- colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _575 => _575.colWidthOverridesPx]), () => ( {})),
7410
- colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _576 => _576.colStyleIds]), () => ( {})),
7411
- conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _577 => _577.conditionalFormatRules]), () => ( [])),
7484
+ autoFilterRanges: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _587 => _587.autoFilterRanges]), () => ( [])),
7485
+ cachedFormulaValues: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _588 => _588.cachedFormulaValues]), () => ( {})),
7486
+ columnWidthCharacterWidthPx: _optionalChain([sheetState, 'optionalAccess', _589 => _589.columnWidthCharacterWidthPx]),
7487
+ colWidthOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _590 => _590.colWidthOverridesPx]), () => ( {})),
7488
+ colStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _591 => _591.colStyleIds]), () => ( {})),
7489
+ conditionalFormatRules: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _592 => _592.conditionalFormatRules]), () => ( [])),
7412
7490
  dataValidations: parseWorksheetDataValidations(worksheet),
7413
7491
  defaultColWidthPx,
7414
7492
  defaultRowHeightPx,
@@ -7427,12 +7505,12 @@ function buildSheetList(workbook, sheetStatesByWorkbookSheetIndex, themePalette,
7427
7505
  name: worksheet.name,
7428
7506
  visibility,
7429
7507
  namedCellStyleByName: _nullishCoalesce(namedCellStyleByName, () => ( {})),
7430
- rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _578 => _578.rowHeightOverridesPx]), () => ( {})),
7431
- rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _579 => _579.rowStyleIds]), () => ( {})),
7432
- cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _580 => _580.cellStyleIds]), () => ( {})),
7433
- showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _581 => _581.showGridLines]), () => ( true)),
7508
+ rowHeightOverridesPx: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _593 => _593.rowHeightOverridesPx]), () => ( {})),
7509
+ rowStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _594 => _594.rowStyleIds]), () => ( {})),
7510
+ cellStyleIds: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _595 => _595.cellStyleIds]), () => ( {})),
7511
+ showGridLines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _596 => _596.showGridLines]), () => ( true)),
7434
7512
  styleById: _nullishCoalesce(styleById, () => ( {})),
7435
- sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _582 => _582.sparklines]), () => ( [])),
7513
+ sparklines: _nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _597 => _597.sparklines]), () => ( [])),
7436
7514
  tableStyleByName: _nullishCoalesce(tableStyleByName, () => ( {})),
7437
7515
  themePalette: _nullishCoalesce(themePalette, () => ( { colorsByIndex: {} })),
7438
7516
  workbookSheetIndex: index,
@@ -7553,15 +7631,15 @@ function resolveWorkbookReference(workbook, defaultWorkbookSheetIndex, rawRefere
7553
7631
  }
7554
7632
  }
7555
7633
  function parseColorHex(hex) {
7556
- const normalized = _optionalChain([hex, 'optionalAccess', _583 => _583.replace, 'call', _584 => _584(/^#/, "")]);
7634
+ const normalized = _optionalChain([hex, 'optionalAccess', _598 => _598.replace, 'call', _599 => _599(/^#/, "")]);
7557
7635
  return normalized && /^[0-9a-f]{6}$/i.test(normalized) ? [0, 2, 4].map((offset) => Number.parseInt(normalized.slice(offset, offset + 2), 16)) : null;
7558
7636
  }
7559
7637
  function xlsxColorToDukeColor(color) {
7560
7638
  if (!color) {
7561
7639
  return void 0;
7562
7640
  }
7563
- const normalizedHex = _optionalChain([color, 'access', _585 => _585.hex, 'optionalAccess', _586 => _586.replace, 'call', _587 => _587(/^#/, "")]);
7564
- const colorType = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(color.colorType, () => ( (_optionalChain([normalizedHex, 'optionalAccess', _588 => _588.length]) === 8 ? "argb" : _optionalChain([normalizedHex, 'optionalAccess', _589 => _589.length]) === 6 ? "rgb" : void 0))), () => ( (color.r !== void 0 && color.g !== void 0 && color.b !== void 0 ? color.a !== void 0 ? "argb" : "rgb" : void 0))), () => ( (color.themeIndex !== void 0 ? "theme" : color.paletteIndex !== void 0 ? "indexed" : void 0)));
7641
+ const normalizedHex = _optionalChain([color, 'access', _600 => _600.hex, 'optionalAccess', _601 => _601.replace, 'call', _602 => _602(/^#/, "")]);
7642
+ const colorType = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(color.colorType, () => ( (_optionalChain([normalizedHex, 'optionalAccess', _603 => _603.length]) === 8 ? "argb" : _optionalChain([normalizedHex, 'optionalAccess', _604 => _604.length]) === 6 ? "rgb" : void 0))), () => ( (color.r !== void 0 && color.g !== void 0 && color.b !== void 0 ? color.a !== void 0 ? "argb" : "rgb" : void 0))), () => ( (color.themeIndex !== void 0 ? "theme" : color.paletteIndex !== void 0 ? "indexed" : void 0)));
7565
7643
  switch (colorType) {
7566
7644
  case "auto":
7567
7645
  return { colorType: "auto" };
@@ -7570,7 +7648,7 @@ function xlsxColorToDukeColor(color) {
7570
7648
  return channels ? { b: channels[2], colorType: "rgb", g: channels[1], r: channels[0] } : void 0;
7571
7649
  }
7572
7650
  case "argb": {
7573
- const normalized = _optionalChain([color, 'access', _590 => _590.hex, 'optionalAccess', _591 => _591.replace, 'call', _592 => _592(/^#/, "")]);
7651
+ const normalized = _optionalChain([color, 'access', _605 => _605.hex, 'optionalAccess', _606 => _606.replace, 'call', _607 => _607(/^#/, "")]);
7574
7652
  const channels = normalized && /^[0-9a-f]{8}$/i.test(normalized) ? [0, 2, 4, 6].map((offset) => Number.parseInt(normalized.slice(offset, offset + 2), 16)) : color.a !== void 0 && color.r !== void 0 && color.g !== void 0 && color.b !== void 0 ? [color.a, color.r, color.g, color.b] : null;
7575
7653
  return channels ? { a: channels[0], b: channels[3], colorType: "argb", g: channels[2], r: channels[1] } : void 0;
7576
7654
  }
@@ -7693,7 +7771,7 @@ function reconcileCheckedOptionButtons(worksheet) {
7693
7771
  const checkedPaths = worksheet.formControls.flatMap((control) => control.formControl.kind.kind === "optionButton" && control.formControl.kind.state === "checked" ? [control.drawingPath] : []);
7694
7772
  for (const path of checkedPaths) {
7695
7773
  const current = worksheet.formControls.find((control) => control.drawingPath.length === path.length && control.drawingPath.every((segment, index) => segment === path[index]));
7696
- if (_optionalChain([current, 'optionalAccess', _593 => _593.formControl, 'access', _594 => _594.kind, 'access', _595 => _595.kind]) === "optionButton" && current.formControl.kind.state === "checked") {
7774
+ if (_optionalChain([current, 'optionalAccess', _608 => _608.formControl, 'access', _609 => _609.kind, 'access', _610 => _610.kind]) === "optionButton" && current.formControl.kind.state === "checked") {
7697
7775
  worksheet.setFormControlCheckState(current.drawingPath, "checked");
7698
7776
  }
7699
7777
  }
@@ -7722,8 +7800,8 @@ function formControlInteractionChanged(current, next) {
7722
7800
  }
7723
7801
  function parseWorksheetFreezePanes(worksheet) {
7724
7802
  const rawFreezePanes = worksheet.freezePanes;
7725
- const row = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _596 => _596.row]) === "number" && rawFreezePanes.row >= 0 ? rawFreezePanes.row : null;
7726
- const col = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _597 => _597.col]) === "number" && rawFreezePanes.col >= 0 ? rawFreezePanes.col : null;
7803
+ const row = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _611 => _611.row]) === "number" && rawFreezePanes.row >= 0 ? rawFreezePanes.row : null;
7804
+ const col = typeof _optionalChain([rawFreezePanes, 'optionalAccess', _612 => _612.col]) === "number" && rawFreezePanes.col >= 0 ? rawFreezePanes.col : null;
7727
7805
  if (row === null && col === null) {
7728
7806
  return null;
7729
7807
  }
@@ -7790,7 +7868,7 @@ function rangesIntersect(a, b) {
7790
7868
  return a.start.row <= b.end.row && a.end.row >= b.start.row && a.start.col <= b.end.col && a.end.col >= b.start.col;
7791
7869
  }
7792
7870
  function mapWorksheetTables(worksheet, autoFilterRanges = []) {
7793
- const rawTables = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _598 => _598.tables]), () => ( []));
7871
+ const rawTables = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _613 => _613.tables]), () => ( []));
7794
7872
  const mappedTables = rawTables.flatMap((table, index) => {
7795
7873
  const rawColumns = Array.isArray(table.columns) ? table.columns : [];
7796
7874
  const rawName = typeof table.name === "string" ? table.name : `Table${index + 1}`;
@@ -7887,7 +7965,7 @@ function pxToSheetRowHeight(heightPx) {
7887
7965
  return Math.max(heightPx, MIN_ROW_HEIGHT_PX2) / 1.33;
7888
7966
  }
7889
7967
  function cssColor(color) {
7890
- if (!_optionalChain([color, 'optionalAccess', _599 => _599.hex])) {
7968
+ if (!_optionalChain([color, 'optionalAccess', _614 => _614.hex])) {
7891
7969
  return null;
7892
7970
  }
7893
7971
  const hex = String(color.hex);
@@ -7968,7 +8046,7 @@ function cloneCellStyle(style) {
7968
8046
  return style;
7969
8047
  }
7970
8048
  }
7971
- function coerceUserEnteredValue(value) {
8049
+ function coerceUserEnteredValue(value, locale = "en-US") {
7972
8050
  const trimmed = value.trim();
7973
8051
  if (!trimmed) {
7974
8052
  return "";
@@ -7979,6 +8057,8 @@ function coerceUserEnteredValue(value) {
7979
8057
  if (/^(true|false)$/i.test(trimmed)) {
7980
8058
  return trimmed.toLowerCase() === "true";
7981
8059
  }
8060
+ const localizedNumber = parseLocaleNumber(trimmed, locale);
8061
+ if (localizedNumber !== void 0) return localizedNumber;
7982
8062
  if (/^[+-]?(?:\d+\.?\d*|\.\d+)$/.test(trimmed)) {
7983
8063
  const parsed = Number(trimmed);
7984
8064
  if (Number.isFinite(parsed)) {
@@ -8021,7 +8101,7 @@ function isAbortError(error) {
8021
8101
  }
8022
8102
  async function resolveWorkbookBuffer({ file, src }, signal) {
8023
8103
  let buffer;
8024
- if (_optionalChain([signal, 'optionalAccess', _600 => _600.aborted])) {
8104
+ if (_optionalChain([signal, 'optionalAccess', _615 => _615.aborted])) {
8025
8105
  throw createAbortError2();
8026
8106
  }
8027
8107
  if (file) {
@@ -8077,7 +8157,7 @@ function scheduleLowPriorityTask(task) {
8077
8157
  task();
8078
8158
  }, { timeout: 120 });
8079
8159
  return () => {
8080
- _optionalChain([idleWindow, 'access', _601 => _601.cancelIdleCallback, 'optionalCall', _602 => _602(idleHandle)]);
8160
+ _optionalChain([idleWindow, 'access', _616 => _616.cancelIdleCallback, 'optionalCall', _617 => _617(idleHandle)]);
8081
8161
  };
8082
8162
  }
8083
8163
  const timeoutHandle = window.setTimeout(task, 0);
@@ -8090,7 +8170,7 @@ function inferImageMimeType(source) {
8090
8170
  return source.slice(5, separatorIndex);
8091
8171
  }
8092
8172
  }
8093
- const normalized = _nullishCoalesce(_optionalChain([source, 'access', _603 => _603.split, 'call', _604 => _604("?"), 'access', _605 => _605[0], 'optionalAccess', _606 => _606.toLowerCase, 'call', _607 => _607()]), () => ( ""));
8173
+ const normalized = _nullishCoalesce(_optionalChain([source, 'access', _618 => _618.split, 'call', _619 => _619("?"), 'access', _620 => _620[0], 'optionalAccess', _621 => _621.toLowerCase, 'call', _622 => _622()]), () => ( ""));
8094
8174
  if (normalized.endsWith(".gif")) {
8095
8175
  return "image/gif";
8096
8176
  }
@@ -8243,7 +8323,7 @@ function mergeParsedAndApiImages(parsedImages, apiImages, hiddenAnchorKeys) {
8243
8323
  if (apiImages.length === 0) {
8244
8324
  return visibleParsedImages;
8245
8325
  }
8246
- const normalizeTextKey = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _608 => _608.trim, 'call', _609 => _609(), 'access', _610 => _610.toLowerCase, 'call', _611 => _611()]), () => ( ""));
8326
+ const normalizeTextKey = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _623 => _623.trim, 'call', _624 => _624(), 'access', _625 => _625.toLowerCase, 'call', _626 => _626()]), () => ( ""));
8247
8327
  const imageKeys = (image) => {
8248
8328
  const keys = [
8249
8329
  `${normalizeTextKey(image.mediaPath)}|${normalizeTextKey(image.name)}|${imageAnchorKey(image.anchor)}`,
@@ -8398,6 +8478,7 @@ function useXlsxViewerController(options) {
8398
8478
  deferLoadingAboveBytes = DEFAULT_DEFER_LOADING_ABOVE_BYTES,
8399
8479
  file,
8400
8480
  fileName,
8481
+ locale = "en-US",
8401
8482
  maxFileSizeBytes = DEFAULT_MAX_FILE_SIZE_BYTES,
8402
8483
  readOnly: requestedReadOnly = false,
8403
8484
  readOnlyAboveBytes = 0,
@@ -8456,7 +8537,7 @@ function useXlsxViewerController(options) {
8456
8537
  const shouldForceReadOnlyForBuffer = React.useCallback((bufferByteLength) => !requestedReadOnly && readOnlyAboveBytes > 0 && bufferByteLength > readOnlyAboveBytes, [readOnlyAboveBytes, requestedReadOnly]);
8457
8538
  const shouldUseWorkerForReadOnlyLoad = React.useCallback((willForceReadOnly) => workerSupported && (willForceReadOnly || canUseWorkerForRequestedReadOnly), [canUseWorkerForRequestedReadOnly, workerSupported]);
8458
8539
  const disposeWorkerClient = React.useCallback(() => {
8459
- _optionalChain([workerClientRef, 'access', _612 => _612.current, 'optionalAccess', _613 => _613.dispose, 'call', _614 => _614()]);
8540
+ _optionalChain([workerClientRef, 'access', _627 => _627.current, 'optionalAccess', _628 => _628.dispose, 'call', _629 => _629()]);
8460
8541
  workerClientRef.current = null;
8461
8542
  }, []);
8462
8543
  const getWorkerClient = React.useCallback(() => {
@@ -8475,7 +8556,7 @@ function useXlsxViewerController(options) {
8475
8556
  }, []);
8476
8557
  const clearChartAssets = React.useCallback(() => {
8477
8558
  chartLoadRequestTokenRef.current += 1;
8478
- _optionalChain([chartDisplayFallbackCleanupRef, 'access', _615 => _615.current, 'optionalCall', _616 => _616()]);
8559
+ _optionalChain([chartDisplayFallbackCleanupRef, 'access', _630 => _630.current, 'optionalCall', _631 => _631()]);
8479
8560
  chartDisplayFallbackCleanupRef.current = null;
8480
8561
  chartAssetsRef.current = null;
8481
8562
  setChartsByWorkbookSheetIndex([]);
@@ -8486,16 +8567,16 @@ function useXlsxViewerController(options) {
8486
8567
  const setImageAssets = React.useCallback((assets) => {
8487
8568
  revokeWorkbookImageAssets(imageAssetsRef.current);
8488
8569
  imageAssetsRef.current = assets;
8489
- sheetOriginsRef.current = _nullishCoalesce(_optionalChain([assets, 'optionalAccess', _617 => _617.sheetOrigins, 'access', _618 => _618.slice, 'call', _619 => _619()]), () => ( []));
8490
- setFormControlsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _620 => _620.formControlsByWorkbookSheetIndex]), () => ( [])));
8491
- setImagesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _621 => _621.imagesByWorkbookSheetIndex]), () => ( [])));
8492
- setShapesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _622 => _622.shapesByWorkbookSheetIndex]), () => ( [])));
8570
+ sheetOriginsRef.current = _nullishCoalesce(_optionalChain([assets, 'optionalAccess', _632 => _632.sheetOrigins, 'access', _633 => _633.slice, 'call', _634 => _634()]), () => ( []));
8571
+ setFormControlsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _635 => _635.formControlsByWorkbookSheetIndex]), () => ( [])));
8572
+ setImagesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _636 => _636.imagesByWorkbookSheetIndex]), () => ( [])));
8573
+ setShapesByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _637 => _637.shapesByWorkbookSheetIndex]), () => ( [])));
8493
8574
  }, []);
8494
8575
  const setChartAssets = React.useCallback((assets) => {
8495
8576
  chartAssetsRef.current = assets;
8496
- setChartsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _623 => _623.chartsByWorkbookSheetIndex]), () => ( [])));
8497
- setChartsheets(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _624 => _624.chartsheets]), () => ( [])));
8498
- setTabs(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _625 => _625.tabs]), () => ( [])));
8577
+ setChartsByWorkbookSheetIndex(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _638 => _638.chartsByWorkbookSheetIndex]), () => ( [])));
8578
+ setChartsheets(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _639 => _639.chartsheets]), () => ( [])));
8579
+ setTabs(_nullishCoalesce(_optionalChain([assets, 'optionalAccess', _640 => _640.tabs]), () => ( [])));
8499
8580
  setIsChartsLoading(false);
8500
8581
  }, []);
8501
8582
  const shouldFallbackFromWorkerError = React.useCallback((error2) => {
@@ -8557,7 +8638,7 @@ function useXlsxViewerController(options) {
8557
8638
  setIsChartsLoading(true);
8558
8639
  const requestToken = chartLoadRequestTokenRef.current + 1;
8559
8640
  chartLoadRequestTokenRef.current = requestToken;
8560
- _optionalChain([chartDisplayFallbackCleanupRef, 'access', _626 => _626.current, 'optionalCall', _627 => _627()]);
8641
+ _optionalChain([chartDisplayFallbackCleanupRef, 'access', _641 => _641.current, 'optionalCall', _642 => _642()]);
8561
8642
  chartDisplayFallbackCleanupRef.current = null;
8562
8643
  let fallbackTriggered = false;
8563
8644
  const triggerFallback = () => {
@@ -8656,11 +8737,11 @@ function useXlsxViewerController(options) {
8656
8737
  };
8657
8738
  }, [skipXmlParsing]);
8658
8739
  const refreshWorkbookState = React.useCallback((targetWorkbook) => {
8659
- const currentFormControls = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _628 => _628.current, 'optionalAccess', _629 => _629.formControlsByWorkbookSheetIndex]), () => ( []));
8740
+ const currentFormControls = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _643 => _643.current, 'optionalAccess', _644 => _644.formControlsByWorkbookSheetIndex]), () => ( []));
8660
8741
  const nextFormControls = refreshWorkbookFormControls(
8661
8742
  targetWorkbook,
8662
8743
  currentFormControls,
8663
- _optionalChain([imageAssetsRef, 'access', _630 => _630.current, 'optionalAccess', _631 => _631.themePalette])
8744
+ _optionalChain([imageAssetsRef, 'access', _645 => _645.current, 'optionalAccess', _646 => _646.themePalette])
8664
8745
  );
8665
8746
  if (imageAssetsRef.current) {
8666
8747
  imageAssetsRef.current.formControlsByWorkbookSheetIndex = nextFormControls;
@@ -8668,11 +8749,11 @@ function useXlsxViewerController(options) {
8668
8749
  setFormControlsByWorkbookSheetIndex(nextFormControls);
8669
8750
  const nextSheets = buildSheetList(
8670
8751
  targetWorkbook,
8671
- _optionalChain([imageAssetsRef, 'access', _632 => _632.current, 'optionalAccess', _633 => _633.sheetStatesByWorkbookSheetIndex]),
8672
- _optionalChain([imageAssetsRef, 'access', _634 => _634.current, 'optionalAccess', _635 => _635.themePalette]),
8673
- _optionalChain([imageAssetsRef, 'access', _636 => _636.current, 'optionalAccess', _637 => _637.styleById]),
8674
- _optionalChain([imageAssetsRef, 'access', _638 => _638.current, 'optionalAccess', _639 => _639.namedCellStyleByName]),
8675
- _optionalChain([imageAssetsRef, 'access', _640 => _640.current, 'optionalAccess', _641 => _641.tableStyleByName]),
8752
+ _optionalChain([imageAssetsRef, 'access', _647 => _647.current, 'optionalAccess', _648 => _648.sheetStatesByWorkbookSheetIndex]),
8753
+ _optionalChain([imageAssetsRef, 'access', _649 => _649.current, 'optionalAccess', _650 => _650.themePalette]),
8754
+ _optionalChain([imageAssetsRef, 'access', _651 => _651.current, 'optionalAccess', _652 => _652.styleById]),
8755
+ _optionalChain([imageAssetsRef, 'access', _653 => _653.current, 'optionalAccess', _654 => _654.namedCellStyleByName]),
8756
+ _optionalChain([imageAssetsRef, 'access', _655 => _655.current, 'optionalAccess', _656 => _656.tableStyleByName]),
8676
8757
  showHiddenSheets
8677
8758
  );
8678
8759
  setSheets(nextSheets);
@@ -8687,7 +8768,7 @@ function useXlsxViewerController(options) {
8687
8768
  setRevision((current) => current + 1);
8688
8769
  }, [setChartAssets, showHiddenSheets]);
8689
8770
  React.useEffect(() => () => {
8690
- _optionalChain([chartDisplayFallbackCleanupRef, 'access', _642 => _642.current, 'optionalCall', _643 => _643()]);
8771
+ _optionalChain([chartDisplayFallbackCleanupRef, 'access', _657 => _657.current, 'optionalCall', _658 => _658()]);
8691
8772
  chartDisplayFallbackCleanupRef.current = null;
8692
8773
  revokeWorkbookImageAssets(imageAssetsRef.current);
8693
8774
  disposeWorkerClient();
@@ -8768,7 +8849,7 @@ function useXlsxViewerController(options) {
8768
8849
  }
8769
8850
  buffer = normalizeWorkbookArrayBuffer(buffer);
8770
8851
  const preflight = preflightWorkbookBuffer(buffer);
8771
- if (_optionalChain([preflight, 'optionalAccess', _644 => _644.tooLarge])) {
8852
+ if (_optionalChain([preflight, 'optionalAccess', _659 => _659.tooLarge])) {
8772
8853
  throw createWorkbookTooLargeError(preflight);
8773
8854
  }
8774
8855
  const shouldForceReadOnly = shouldForceReadOnlyForBuffer(buffer.byteLength);
@@ -8888,10 +8969,10 @@ function useXlsxViewerController(options) {
8888
8969
  showHiddenSheets
8889
8970
  ]);
8890
8971
  const activeTab = _nullishCoalesce(tabs[activeTabIndex], () => ( null));
8891
- const activeSheet = _optionalChain([activeTab, 'optionalAccess', _645 => _645.kind]) === "sheet" ? _nullishCoalesce(sheets[_nullishCoalesce(activeTab.sheetIndex, () => ( -1))], () => ( null)) : null;
8972
+ const activeSheet = _optionalChain([activeTab, 'optionalAccess', _660 => _660.kind]) === "sheet" ? _nullishCoalesce(sheets[_nullishCoalesce(activeTab.sheetIndex, () => ( -1))], () => ( null)) : null;
8892
8973
  const deferredMetadataCell = React.useDeferredValue(activeCell);
8893
8974
  const deferredMetadataSheet = React.useDeferredValue(activeSheet);
8894
- const activeZoomTabKey = _nullishCoalesce(_optionalChain([activeTab, 'optionalAccess', _646 => _646.id]), () => ( DEFAULT_ZOOM_TAB_KEY));
8975
+ const activeZoomTabKey = _nullishCoalesce(_optionalChain([activeTab, 'optionalAccess', _661 => _661.id]), () => ( DEFAULT_ZOOM_TAB_KEY));
8895
8976
  const defaultZoomScale = React.useMemo(
8896
8977
  () => resolveDefaultZoomScale(activeTab, activeSheet),
8897
8978
  [activeSheet, activeTab]
@@ -8917,7 +8998,7 @@ function useXlsxViewerController(options) {
8917
8998
  return currentIndex;
8918
8999
  }
8919
9000
  const targetSheet = sheets[index];
8920
- const tabIndex = tabs.findIndex((tab) => tab.kind === "sheet" && tab.workbookSheetIndex === _optionalChain([targetSheet, 'optionalAccess', _647 => _647.workbookSheetIndex]));
9001
+ const tabIndex = tabs.findIndex((tab) => tab.kind === "sheet" && tab.workbookSheetIndex === _optionalChain([targetSheet, 'optionalAccess', _662 => _662.workbookSheetIndex]));
8921
9002
  if (tabIndex >= 0) {
8922
9003
  setActiveTabIndexState(tabIndex);
8923
9004
  }
@@ -8930,7 +9011,7 @@ function useXlsxViewerController(options) {
8930
9011
  return currentIndex;
8931
9012
  }
8932
9013
  const targetTab = tabs[index];
8933
- if (_optionalChain([targetTab, 'optionalAccess', _648 => _648.kind]) === "sheet" && typeof targetTab.sheetIndex === "number") {
9014
+ if (_optionalChain([targetTab, 'optionalAccess', _663 => _663.kind]) === "sheet" && typeof targetTab.sheetIndex === "number") {
8934
9015
  setActiveSheetIndexState(targetTab.sheetIndex);
8935
9016
  }
8936
9017
  return index;
@@ -8948,7 +9029,7 @@ function useXlsxViewerController(options) {
8948
9029
  if (!parsed) {
8949
9030
  return false;
8950
9031
  }
8951
- const requestedSheetName = _optionalChain([parsed, 'access', _649 => _649.sheetName, 'optionalAccess', _650 => _650.toLowerCase, 'call', _651 => _651()]);
9032
+ const requestedSheetName = _optionalChain([parsed, 'access', _664 => _664.sheetName, 'optionalAccess', _665 => _665.toLowerCase, 'call', _666 => _666()]);
8952
9033
  const sheetIndex = requestedSheetName === void 0 ? _nullishCoalesce(options2.sheetIndex, () => ( activeSheetIndex)) : sheets.findIndex((sheet2) => sheet2.name.toLowerCase() === requestedSheetName);
8953
9034
  const sheet = Number.isInteger(sheetIndex) ? sheets[sheetIndex] : void 0;
8954
9035
  if (!sheet) {
@@ -8965,7 +9046,7 @@ function useXlsxViewerController(options) {
8965
9046
  });
8966
9047
  }
8967
9048
  setHighlightedRanges(nextHighlights);
8968
- if (_optionalChain([nextHighlights, 'access', _652 => _652[0], 'optionalAccess', _653 => _653.autoScroll])) {
9049
+ if (_optionalChain([nextHighlights, 'access', _667 => _667[0], 'optionalAccess', _668 => _668.autoScroll])) {
8969
9050
  setActiveSheetIndex(firstSheetIndex);
8970
9051
  }
8971
9052
  return true;
@@ -9030,7 +9111,7 @@ function useXlsxViewerController(options) {
9030
9111
  return;
9031
9112
  }
9032
9113
  const preflight = preflightWorkbookBuffer(deferredBuffer);
9033
- if (_optionalChain([preflight, 'optionalAccess', _654 => _654.tooLarge])) {
9114
+ if (_optionalChain([preflight, 'optionalAccess', _669 => _669.tooLarge])) {
9034
9115
  deferredBufferRef.current = null;
9035
9116
  setDeferredLoadFileSize(null);
9036
9117
  setWorkbook(null);
@@ -9202,8 +9283,8 @@ function useXlsxViewerController(options) {
9202
9283
  }
9203
9284
  }, [activeSheetIndex, sheets, workbook]);
9204
9285
  const tables = React.useMemo(
9205
- () => isWorkerBacked ? _nullishCoalesce(workerTablesByWorkbookSheetIndex[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _655 => _655.workbookSheetIndex]), () => ( -1))], () => ( [])) : mapWorksheetTables(getActiveWorksheet(), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _656 => _656.autoFilterRanges]), () => ( []))),
9206
- [_optionalChain([activeSheet, 'optionalAccess', _657 => _657.autoFilterRanges]), _optionalChain([activeSheet, 'optionalAccess', _658 => _658.workbookSheetIndex]), getActiveWorksheet, isWorkerBacked, revision, workerTablesByWorkbookSheetIndex]
9286
+ () => isWorkerBacked ? _nullishCoalesce(workerTablesByWorkbookSheetIndex[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _670 => _670.workbookSheetIndex]), () => ( -1))], () => ( [])) : mapWorksheetTables(getActiveWorksheet(), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _671 => _671.autoFilterRanges]), () => ( []))),
9287
+ [_optionalChain([activeSheet, 'optionalAccess', _672 => _672.autoFilterRanges]), _optionalChain([activeSheet, 'optionalAccess', _673 => _673.workbookSheetIndex]), getActiveWorksheet, isWorkerBacked, revision, workerTablesByWorkbookSheetIndex]
9207
9288
  );
9208
9289
  const getCellSnapshotAsync = React.useCallback((workbookSheetIndex, row, col) => {
9209
9290
  if (!isWorkerBacked) {
@@ -9212,14 +9293,14 @@ function useXlsxViewerController(options) {
9212
9293
  formula: ""
9213
9294
  });
9214
9295
  }
9215
- return getWorkerClient().getCellSnapshot(workbookSheetIndex, row, col);
9216
- }, [getWorkerClient, isWorkerBacked]);
9296
+ return getWorkerClient().getCellSnapshot(workbookSheetIndex, row, col, locale);
9297
+ }, [getWorkerClient, isWorkerBacked, locale]);
9217
9298
  const getRowsBatchAsync = React.useCallback((workbookSheetIndex, startRow, rowCount) => {
9218
9299
  if (!isWorkerBacked) {
9219
9300
  return Promise.resolve(null);
9220
9301
  }
9221
- return getWorkerClient().getRowsBatch(workbookSheetIndex, startRow, rowCount);
9222
- }, [getWorkerClient, isWorkerBacked]);
9302
+ return getWorkerClient().getRowsBatch(workbookSheetIndex, startRow, rowCount, locale);
9303
+ }, [getWorkerClient, isWorkerBacked, locale]);
9223
9304
  const visibleSheetIndexByWorkbookSheetIndex = React.useMemo(
9224
9305
  () => new Map(sheets.map((sheet, index) => [sheet.workbookSheetIndex, index])),
9225
9306
  [sheets]
@@ -9270,9 +9351,9 @@ function useXlsxViewerController(options) {
9270
9351
  }, [publicChartById]);
9271
9352
  const getChartsheetById = React.useCallback((id) => _nullishCoalesce(chartsheets.find((chartsheet) => chartsheet.id === id), () => ( null)), [chartsheets]);
9272
9353
  const charts = React.useMemo(() => {
9273
- if (_optionalChain([activeTab, 'optionalAccess', _659 => _659.kind]) === "chartsheet" && typeof activeTab.chartsheetIndex === "number") {
9354
+ if (_optionalChain([activeTab, 'optionalAccess', _674 => _674.kind]) === "chartsheet" && typeof activeTab.chartsheetIndex === "number") {
9274
9355
  const chartsheet = chartsheets[activeTab.chartsheetIndex];
9275
- return (_nullishCoalesce(_optionalChain([chartsheet, 'optionalAccess', _660 => _660.chartIds]), () => ( []))).map((id) => getChartById(id)).filter((value) => Boolean(value));
9356
+ return (_nullishCoalesce(_optionalChain([chartsheet, 'optionalAccess', _675 => _675.chartIds]), () => ( []))).map((id) => getChartById(id)).filter((value) => Boolean(value));
9276
9357
  }
9277
9358
  return getSheetCharts(activeSheetIndex);
9278
9359
  }, [activeSheetIndex, activeTab, chartsheets, getChartById, getSheetCharts]);
@@ -9321,7 +9402,7 @@ function useXlsxViewerController(options) {
9321
9402
  }, [selectedChartId]);
9322
9403
  const selectChartElement = React.useCallback((selection2) => {
9323
9404
  setSelectedImageId(null);
9324
- setSelectedChartId(_nullishCoalesce(_optionalChain([selection2, 'optionalAccess', _661 => _661.chartId]), () => ( null)));
9405
+ setSelectedChartId(_nullishCoalesce(_optionalChain([selection2, 'optionalAccess', _676 => _676.chartId]), () => ( null)));
9325
9406
  setSelectedChartElement(selection2);
9326
9407
  }, []);
9327
9408
  const getSheetImages = React.useCallback((sheetIndex = activeSheetIndex) => {
@@ -9348,11 +9429,11 @@ function useXlsxViewerController(options) {
9348
9429
  return [];
9349
9430
  }
9350
9431
  const control2 = (_nullishCoalesce(formControlsByWorkbookSheetIndex[targetSheet.workbookSheetIndex], () => ( []))).find((entry) => entry.controlIndex === controlIndex);
9351
- return _nullishCoalesce(_optionalChain([control2, 'optionalAccess', _662 => _662.items, 'optionalAccess', _663 => _663.slice, 'call', _664 => _664()]), () => ( []));
9432
+ return _nullishCoalesce(_optionalChain([control2, 'optionalAccess', _677 => _677.items, 'optionalAccess', _678 => _678.slice, 'call', _679 => _679()]), () => ( []));
9352
9433
  }
9353
9434
  const control = target.worksheet.formControls[controlIndex];
9354
- const kind = _optionalChain([control, 'optionalAccess', _665 => _665.formControl, 'access', _666 => _666.kind]);
9355
- const inputRange = _optionalChain([kind, 'optionalAccess', _667 => _667.kind]) === "listBox" || _optionalChain([kind, 'optionalAccess', _668 => _668.kind]) === "dropdown" ? kind.inputRange : void 0;
9435
+ const kind = _optionalChain([control, 'optionalAccess', _680 => _680.formControl, 'access', _681 => _681.kind]);
9436
+ const inputRange = _optionalChain([kind, 'optionalAccess', _682 => _682.kind]) === "listBox" || _optionalChain([kind, 'optionalAccess', _683 => _683.kind]) === "dropdown" ? kind.inputRange : void 0;
9356
9437
  if (!inputRange) {
9357
9438
  return [];
9358
9439
  }
@@ -9384,7 +9465,7 @@ function useXlsxViewerController(options) {
9384
9465
  const shapes = React.useMemo(() => getSheetShapes(activeSheetIndex), [activeSheetIndex, getSheetShapes]);
9385
9466
  const getImageById = React.useCallback((id) => {
9386
9467
  for (const sheetImages of imagesByWorkbookSheetIndex) {
9387
- const match = _optionalChain([sheetImages, 'optionalAccess', _669 => _669.find, 'call', _670 => _670((image) => image.id === id)]);
9468
+ const match = _optionalChain([sheetImages, 'optionalAccess', _684 => _684.find, 'call', _685 => _685((image) => image.id === id)]);
9388
9469
  if (match) {
9389
9470
  return mapPublicImage(match);
9390
9471
  }
@@ -9404,35 +9485,35 @@ function useXlsxViewerController(options) {
9404
9485
  setSelectedImageId(null);
9405
9486
  }, []);
9406
9487
  const getColumnWidthPx = React.useCallback((worksheet, col) => {
9407
- const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _671 => _671.current, 'optionalAccess', _672 => _672.sheetStatesByWorkbookSheetIndex, 'access', _673 => _673[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _674 => _674.workbookSheetIndex]), () => ( -1))]]), () => ( null));
9488
+ const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _686 => _686.current, 'optionalAccess', _687 => _687.sheetStatesByWorkbookSheetIndex, 'access', _688 => _688[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _689 => _689.workbookSheetIndex]), () => ( -1))]]), () => ( null));
9408
9489
  const width = worksheet.getColumnWidth(col);
9409
- const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _675 => _675.showGridLines]), () => ( true));
9490
+ const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _690 => _690.showGridLines]), () => ( true));
9410
9491
  if (width !== void 0 && width !== null) {
9411
9492
  return resolveRenderedSheetAxisPixels(
9412
- resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _676 => _676.columnWidthCharacterWidthPx])),
9493
+ resolveSheetColumnWidthPixels(width, _optionalChain([sheetState, 'optionalAccess', _691 => _691.columnWidthCharacterWidthPx])),
9413
9494
  showGridLines
9414
9495
  );
9415
9496
  }
9416
9497
  return resolveRenderedSheetAxisPixels(
9417
- _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _677 => _677.colWidthOverridesPx, 'optionalAccess', _678 => _678[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _679 => _679.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH)),
9498
+ _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _692 => _692.colWidthOverridesPx, 'optionalAccess', _693 => _693[col]]), () => ( _optionalChain([sheetState, 'optionalAccess', _694 => _694.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH)),
9418
9499
  showGridLines
9419
9500
  );
9420
- }, [_optionalChain([activeSheet, 'optionalAccess', _680 => _680.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _681 => _681.workbookSheetIndex])]);
9501
+ }, [_optionalChain([activeSheet, 'optionalAccess', _695 => _695.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _696 => _696.workbookSheetIndex])]);
9421
9502
  const getRowHeightPx = React.useCallback((worksheet, row) => {
9422
- const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _682 => _682.current, 'optionalAccess', _683 => _683.sheetStatesByWorkbookSheetIndex, 'access', _684 => _684[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _685 => _685.workbookSheetIndex]), () => ( -1))]]), () => ( null));
9503
+ const sheetState = _nullishCoalesce(_optionalChain([imageAssetsRef, 'access', _697 => _697.current, 'optionalAccess', _698 => _698.sheetStatesByWorkbookSheetIndex, 'access', _699 => _699[_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _700 => _700.workbookSheetIndex]), () => ( -1))]]), () => ( null));
9423
9504
  const height = worksheet.getRowHeight(row);
9424
- const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _686 => _686.showGridLines]), () => ( true));
9505
+ const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _701 => _701.showGridLines]), () => ( true));
9425
9506
  if (height !== void 0 && height !== null) {
9426
9507
  return resolveRenderedSheetAxisPixels(resolveSheetRowHeightPixels(height), showGridLines);
9427
9508
  }
9428
9509
  return resolveRenderedSheetAxisPixels(
9429
- _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _687 => _687.rowHeightOverridesPx, 'optionalAccess', _688 => _688[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _689 => _689.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT)),
9510
+ _nullishCoalesce(_nullishCoalesce(_optionalChain([sheetState, 'optionalAccess', _702 => _702.rowHeightOverridesPx, 'optionalAccess', _703 => _703[row]]), () => ( _optionalChain([sheetState, 'optionalAccess', _704 => _704.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT)),
9430
9511
  showGridLines
9431
9512
  );
9432
- }, [_optionalChain([activeSheet, 'optionalAccess', _690 => _690.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _691 => _691.workbookSheetIndex])]);
9513
+ }, [_optionalChain([activeSheet, 'optionalAccess', _705 => _705.showGridLines]), _optionalChain([activeSheet, 'optionalAccess', _706 => _706.workbookSheetIndex])]);
9433
9514
  const getCellDisplayValue2 = React.useCallback((cell) => {
9434
9515
  if (cell && activeSheet) {
9435
- const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
9516
+ const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${locale}:${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
9436
9517
  if (workerSnapshot) {
9437
9518
  return workerSnapshot.displayValue;
9438
9519
  }
@@ -9442,10 +9523,10 @@ function useXlsxViewerController(options) {
9442
9523
  return "";
9443
9524
  }
9444
9525
  const formula = worksheet.getFormulaAt(cell.row, cell.col);
9445
- const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _692 => _692.cachedFormulaValues, 'optionalAccess', _693 => _693[cellAddressToA1(cell)]]) : void 0;
9526
+ const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _707 => _707.cachedFormulaValues, 'optionalAccess', _708 => _708[cellAddressToA1(cell)]]) : void 0;
9446
9527
  const formatted = worksheet.getFormattedValueAt(cell.row, cell.col);
9447
9528
  if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
9448
- return decodeHtmlEntities(formatted);
9529
+ return localizeCellNumber(worksheet, cell.row, cell.col, decodeHtmlEntities(formatted), locale);
9449
9530
  }
9450
9531
  const calculated = worksheet.getCalculatedValueAt(cell.row, cell.col);
9451
9532
  if (formula && cachedFormulaValue !== void 0 && calculated.is_error) {
@@ -9458,10 +9539,10 @@ function useXlsxViewerController(options) {
9458
9539
  return "";
9459
9540
  }
9460
9541
  return calculated.toString();
9461
- }, [activeSheet, getActiveWorksheet]);
9542
+ }, [activeSheet, getActiveWorksheet, locale]);
9462
9543
  const getCellFormula = React.useCallback((cell) => {
9463
9544
  if (cell && activeSheet) {
9464
- const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
9545
+ const workerSnapshot = workerCellSnapshotCacheRef.current.get(`${locale}:${activeSheet.workbookSheetIndex}:${cell.row}:${cell.col}`);
9465
9546
  if (workerSnapshot) {
9466
9547
  return workerSnapshot.formula;
9467
9548
  }
@@ -9471,7 +9552,7 @@ function useXlsxViewerController(options) {
9471
9552
  return "";
9472
9553
  }
9473
9554
  return _nullishCoalesce(worksheet.getFormulaAt(cell.row, cell.col), () => ( ""));
9474
- }, [activeSheet, getActiveWorksheet]);
9555
+ }, [activeSheet, getActiveWorksheet, locale]);
9475
9556
  const getClipboardData = React.useCallback(() => {
9476
9557
  const worksheet = getActiveWorksheet();
9477
9558
  const targetRange = _nullishCoalesce(selection, () => ( (activeCell ? { start: activeCell, end: activeCell } : null)));
@@ -9504,9 +9585,9 @@ function useXlsxViewerController(options) {
9504
9585
  "white-space:pre-wrap",
9505
9586
  "vertical-align:top"
9506
9587
  ];
9507
- const fill = _optionalChain([rawStyle, 'optionalAccess', _694 => _694.fill]);
9588
+ const fill = _optionalChain([rawStyle, 'optionalAccess', _709 => _709.fill]);
9508
9589
  if (fill) {
9509
- const fillStyle = resolveWorkbookFillStyle(fill, _optionalChain([activeSheet, 'optionalAccess', _695 => _695.themePalette]));
9590
+ const fillStyle = resolveWorkbookFillStyle(fill, _optionalChain([activeSheet, 'optionalAccess', _710 => _710.themePalette]));
9510
9591
  if (fillStyle.backgroundColor && fillStyle.backgroundColor.toLowerCase() !== "#ffffff") {
9511
9592
  cellStyles.push(`background-color:${fillStyle.backgroundColor}`);
9512
9593
  }
@@ -9514,7 +9595,7 @@ function useXlsxViewerController(options) {
9514
9595
  cellStyles.push(`background-image:${fillStyle.backgroundImage}`);
9515
9596
  }
9516
9597
  }
9517
- const font = _optionalChain([rawStyle, 'optionalAccess', _696 => _696.font]);
9598
+ const font = _optionalChain([rawStyle, 'optionalAccess', _711 => _711.font]);
9518
9599
  if (font) {
9519
9600
  if (font.bold) {
9520
9601
  cellStyles.push("font-weight:700");
@@ -9528,7 +9609,7 @@ function useXlsxViewerController(options) {
9528
9609
  if (font.strikethrough) {
9529
9610
  cellStyles.push("text-decoration:line-through");
9530
9611
  }
9531
- const fontColor = resolveWorkbookColor(font.color, _optionalChain([activeSheet, 'optionalAccess', _697 => _697.themePalette]));
9612
+ const fontColor = resolveWorkbookColor(font.color, _optionalChain([activeSheet, 'optionalAccess', _712 => _712.themePalette]));
9532
9613
  if (fontColor) {
9533
9614
  cellStyles.push(`color:${fontColor}`);
9534
9615
  }
@@ -9536,29 +9617,29 @@ function useXlsxViewerController(options) {
9536
9617
  cellStyles.push(`font-size:${font.size}pt`);
9537
9618
  }
9538
9619
  }
9539
- const alignment = _optionalChain([rawStyle, 'optionalAccess', _698 => _698.alignment]);
9540
- if (_optionalChain([alignment, 'optionalAccess', _699 => _699.horizontal]) && alignment.horizontal !== "general") {
9620
+ const alignment = _optionalChain([rawStyle, 'optionalAccess', _713 => _713.alignment]);
9621
+ if (_optionalChain([alignment, 'optionalAccess', _714 => _714.horizontal]) && alignment.horizontal !== "general") {
9541
9622
  cellStyles.push(`text-align:${String(alignment.horizontal)}`);
9542
9623
  }
9543
- if (_optionalChain([alignment, 'optionalAccess', _700 => _700.wrapText])) {
9624
+ if (_optionalChain([alignment, 'optionalAccess', _715 => _715.wrapText])) {
9544
9625
  cellStyles.push("white-space:pre-wrap");
9545
9626
  cellStyles.push("word-break:break-word");
9546
9627
  }
9547
- const border = _optionalChain([rawStyle, 'optionalAccess', _701 => _701.border]);
9548
- if (_optionalChain([border, 'optionalAccess', _702 => _702.top, 'optionalAccess', _703 => _703.style]) && border.top.style !== "none") {
9628
+ const border = _optionalChain([rawStyle, 'optionalAccess', _716 => _716.border]);
9629
+ if (_optionalChain([border, 'optionalAccess', _717 => _717.top, 'optionalAccess', _718 => _718.style]) && border.top.style !== "none") {
9549
9630
  cellStyles.push(`border-top:${mapBorder(border.top)}`);
9550
9631
  }
9551
- if (_optionalChain([border, 'optionalAccess', _704 => _704.right, 'optionalAccess', _705 => _705.style]) && border.right.style !== "none") {
9632
+ if (_optionalChain([border, 'optionalAccess', _719 => _719.right, 'optionalAccess', _720 => _720.style]) && border.right.style !== "none") {
9552
9633
  cellStyles.push(`border-right:${mapBorder(border.right)}`);
9553
9634
  }
9554
- if (_optionalChain([border, 'optionalAccess', _706 => _706.bottom, 'optionalAccess', _707 => _707.style]) && border.bottom.style !== "none") {
9635
+ if (_optionalChain([border, 'optionalAccess', _721 => _721.bottom, 'optionalAccess', _722 => _722.style]) && border.bottom.style !== "none") {
9555
9636
  cellStyles.push(`border-bottom:${mapBorder(border.bottom)}`);
9556
9637
  }
9557
- if (_optionalChain([border, 'optionalAccess', _708 => _708.left, 'optionalAccess', _709 => _709.style]) && border.left.style !== "none") {
9638
+ if (_optionalChain([border, 'optionalAccess', _723 => _723.left, 'optionalAccess', _724 => _724.style]) && border.left.style !== "none") {
9558
9639
  cellStyles.push(`border-left:${mapBorder(border.left)}`);
9559
9640
  }
9560
- const rowSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _710 => _710.rowSpan]), () => ( 1)), normalized.end.row - row + 1);
9561
- const colSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _711 => _711.colSpan]), () => ( 1)), normalized.end.col - col + 1);
9641
+ const rowSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _725 => _725.rowSpan]), () => ( 1)), normalized.end.row - row + 1);
9642
+ const colSpan = Math.min(_nullishCoalesce(_optionalChain([merge, 'optionalAccess', _726 => _726.colSpan]), () => ( 1)), normalized.end.col - col + 1);
9562
9643
  payload.cells.push({
9563
9644
  colOffset: col - normalized.start.col,
9564
9645
  formula,
@@ -9591,7 +9672,7 @@ function useXlsxViewerController(options) {
9591
9672
  if (!isWorkerBacked || !deferredMetadataSheet || !deferredMetadataCell) {
9592
9673
  return;
9593
9674
  }
9594
- const cacheKey = `${deferredMetadataSheet.workbookSheetIndex}:${deferredMetadataCell.row}:${deferredMetadataCell.col}`;
9675
+ const cacheKey = `${locale}:${deferredMetadataSheet.workbookSheetIndex}:${deferredMetadataCell.row}:${deferredMetadataCell.col}`;
9595
9676
  if (workerCellSnapshotCacheRef.current.has(cacheKey)) {
9596
9677
  return;
9597
9678
  }
@@ -9615,7 +9696,7 @@ function useXlsxViewerController(options) {
9615
9696
  return () => {
9616
9697
  isCurrent = false;
9617
9698
  };
9618
- }, [deferredMetadataCell, deferredMetadataSheet, getCellSnapshotAsync, isWorkerBacked]);
9699
+ }, [deferredMetadataCell, deferredMetadataSheet, getCellSnapshotAsync, isWorkerBacked, locale]);
9619
9700
  const activeCellAddress = React.useMemo(() => activeCell ? cellAddressToA1(activeCell) : null, [activeCell]);
9620
9701
  const selectedRangeAddress = React.useMemo(() => selection ? rangeToA1(selection) : null, [selection]);
9621
9702
  const selectedValue = React.useMemo(
@@ -9774,10 +9855,10 @@ function useXlsxViewerController(options) {
9774
9855
  target.worksheet.addDrawing(xlsxFormControlInputToDukeDrawing(input));
9775
9856
  const controlIndex = target.worksheet.formControlCount - 1;
9776
9857
  const addedControl = target.worksheet.formControls[controlIndex];
9777
- const addedKind = _optionalChain([addedControl, 'optionalAccess', _712 => _712.formControl, 'access', _713 => _713.kind]);
9778
- if (addedControl && (_optionalChain([addedKind, 'optionalAccess', _714 => _714.kind]) === "checkbox" || _optionalChain([addedKind, 'optionalAccess', _715 => _715.kind]) === "optionButton")) {
9858
+ const addedKind = _optionalChain([addedControl, 'optionalAccess', _727 => _727.formControl, 'access', _728 => _728.kind]);
9859
+ if (addedControl && (_optionalChain([addedKind, 'optionalAccess', _729 => _729.kind]) === "checkbox" || _optionalChain([addedKind, 'optionalAccess', _730 => _730.kind]) === "optionButton")) {
9779
9860
  target.worksheet.setFormControlCheckState(addedControl.drawingPath, addedKind.state);
9780
- } else if (_optionalChain([addedKind, 'optionalAccess', _716 => _716.kind]) === "groupBox") {
9861
+ } else if (_optionalChain([addedKind, 'optionalAccess', _731 => _731.kind]) === "groupBox") {
9781
9862
  reconcileCheckedOptionButtons(target.worksheet);
9782
9863
  } else if (addedKind && "cellLink" in addedKind && addedKind.cellLink) {
9783
9864
  workbook.syncFormControls();
@@ -9788,7 +9869,7 @@ function useXlsxViewerController(options) {
9788
9869
  }, [activeSheetIndex, getFormControlWorksheet, maybeRecalculateWorkbook, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
9789
9870
  const updateFormControl = React.useCallback((controlIndex, patch, sheetIndex = activeSheetIndex) => {
9790
9871
  const target = getFormControlWorksheet(sheetIndex);
9791
- const currentControl = _optionalChain([target, 'optionalAccess', _717 => _717.worksheet, 'access', _718 => _718.formControls, 'access', _719 => _719[controlIndex]]);
9872
+ const currentControl = _optionalChain([target, 'optionalAccess', _732 => _732.worksheet, 'access', _733 => _733.formControls, 'access', _734 => _734[controlIndex]]);
9792
9873
  if (readOnly || !workbook || !target || !currentControl) {
9793
9874
  return false;
9794
9875
  }
@@ -9808,8 +9889,8 @@ function useXlsxViewerController(options) {
9808
9889
  legacyObjectType: _nullishCoalesce(nextKind.legacyObjectType, () => ( currentControl.formControl.kind.legacyObjectType))
9809
9890
  };
9810
9891
  }
9811
- const patchedRawObj = _optionalChain([patch, 'access', _720 => _720.kind, 'optionalAccess', _721 => _721.kind]) === "editbox" || _optionalChain([patch, 'access', _722 => _722.kind, 'optionalAccess', _723 => _723.kind]) === "unknown" ? patch.kind.rawObj : void 0;
9812
- const patchedRawProperties = _optionalChain([patch, 'access', _724 => _724.kind, 'optionalAccess', _725 => _725.kind]) === "editbox" || _optionalChain([patch, 'access', _726 => _726.kind, 'optionalAccess', _727 => _727.kind]) === "unknown" ? patch.kind.rawProperties : void 0;
9892
+ const patchedRawObj = _optionalChain([patch, 'access', _735 => _735.kind, 'optionalAccess', _736 => _736.kind]) === "editbox" || _optionalChain([patch, 'access', _737 => _737.kind, 'optionalAccess', _738 => _738.kind]) === "unknown" ? patch.kind.rawObj : void 0;
9893
+ const patchedRawProperties = _optionalChain([patch, 'access', _739 => _739.kind, 'optionalAccess', _740 => _740.kind]) === "editbox" || _optionalChain([patch, 'access', _741 => _741.kind, 'optionalAccess', _742 => _742.kind]) === "unknown" ? patch.kind.rawProperties : void 0;
9813
9894
  const nextInput = {
9814
9895
  altText: "altText" in patch ? patch.altText : currentControl.altText,
9815
9896
  anchor: nextAnchor,
@@ -9830,10 +9911,10 @@ function useXlsxViewerController(options) {
9830
9911
  };
9831
9912
  target.worksheet.setDrawing(currentControl.drawingPath, nextInput);
9832
9913
  const updatedControl = target.worksheet.formControls[controlIndex];
9833
- const updatedKind = _optionalChain([updatedControl, 'optionalAccess', _728 => _728.formControl, 'access', _729 => _729.kind]);
9914
+ const updatedKind = _optionalChain([updatedControl, 'optionalAccess', _743 => _743.formControl, 'access', _744 => _744.kind]);
9834
9915
  const interactionChanged = updatedKind ? formControlInteractionChanged(currentControl.formControl.kind, updatedKind) : false;
9835
9916
  const groupTopologyChanged = patch.anchor !== void 0 || updatedKind !== void 0 && updatedKind.kind !== currentControl.formControl.kind.kind && (updatedKind.kind === "groupBox" || currentControl.formControl.kind.kind === "groupBox");
9836
- if (interactionChanged && updatedControl && (_optionalChain([updatedKind, 'optionalAccess', _730 => _730.kind]) === "checkbox" || _optionalChain([updatedKind, 'optionalAccess', _731 => _731.kind]) === "optionButton")) {
9917
+ if (interactionChanged && updatedControl && (_optionalChain([updatedKind, 'optionalAccess', _745 => _745.kind]) === "checkbox" || _optionalChain([updatedKind, 'optionalAccess', _746 => _746.kind]) === "optionButton")) {
9837
9918
  target.worksheet.setFormControlCheckState(updatedControl.drawingPath, updatedKind.state);
9838
9919
  } else if (groupTopologyChanged) {
9839
9920
  reconcileCheckedOptionButtons(target.worksheet);
@@ -9945,7 +10026,7 @@ function useXlsxViewerController(options) {
9945
10026
  const comparedText = left.sortText.localeCompare(right.sortText, void 0, { numeric: true, sensitivity: "base" });
9946
10027
  return direction === "ascending" ? comparedText : -comparedText;
9947
10028
  });
9948
- if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access', _732 => _732[index], 'optionalAccess', _733 => _733.index]))) {
10029
+ if (sortedRows.every((row, index) => row.index === _optionalChain([rows, 'access', _747 => _747[index], 'optionalAccess', _748 => _748.index]))) {
9949
10030
  setSortState({ columnIndex, direction, tableName: targetTable.name });
9950
10031
  return;
9951
10032
  }
@@ -10014,9 +10095,9 @@ function useXlsxViewerController(options) {
10014
10095
  if (!workbook) {
10015
10096
  return;
10016
10097
  }
10017
- const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _734 => _734.name]), () => ( "sheet"));
10098
+ const activeSheetName = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _749 => _749.name]), () => ( "sheet"));
10018
10099
  downloadText(workbook.saveCsvString(), `${fileStem(displayFileName)}-${activeSheetName}.csv`, CSV_MIME_TYPE);
10019
- }, [_optionalChain([activeSheet, 'optionalAccess', _735 => _735.name]), displayFileName, workbook]);
10100
+ }, [_optionalChain([activeSheet, 'optionalAccess', _750 => _750.name]), displayFileName, workbook]);
10020
10101
  const recalculate = React.useCallback(() => {
10021
10102
  if (!workbook) {
10022
10103
  return;
@@ -10180,10 +10261,10 @@ function useXlsxViewerController(options) {
10180
10261
  const currentChart = getChartById(id);
10181
10262
  console.info("[react-xlsx debug] currentChart", {
10182
10263
  activeWorkbookSheetIndex: activeSheet.workbookSheetIndex,
10183
- editable: _optionalChain([currentChart, 'optionalAccess', _736 => _736.editable]),
10264
+ editable: _optionalChain([currentChart, 'optionalAccess', _751 => _751.editable]),
10184
10265
  found: Boolean(currentChart),
10185
10266
  originCount: hydratedChartAssets.chartOriginsById.size,
10186
- workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess', _737 => _737.workbookSheetIndex])
10267
+ workbookSheetIndex: _optionalChain([currentChart, 'optionalAccess', _752 => _752.workbookSheetIndex])
10187
10268
  });
10188
10269
  if (!currentChart || currentChart.editable === false || currentChart.workbookSheetIndex !== activeSheet.workbookSheetIndex) {
10189
10270
  return;
@@ -10191,8 +10272,8 @@ function useXlsxViewerController(options) {
10191
10272
  const nextAnchor = rectToImageAnchor(rect, currentChart.anchor, {
10192
10273
  contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
10193
10274
  contentOffsetTop: GRID_HEADER_HEIGHT,
10194
- getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _738 => _738.columnWidths, 'access', _739 => _739[col]]), () => ( getColumnWidthPx(worksheet, col))),
10195
- getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _740 => _740.rowHeights, 'access', _741 => _741[row]]), () => ( getRowHeightPx(worksheet, row)))
10275
+ getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _753 => _753.columnWidths, 'access', _754 => _754[col]]), () => ( getColumnWidthPx(worksheet, col))),
10276
+ getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _755 => _755.rowHeights, 'access', _756 => _756[row]]), () => ( getRowHeightPx(worksheet, row)))
10196
10277
  });
10197
10278
  recordHistoryBeforeMutation();
10198
10279
  const didUpdateAnchor = updateWorkbookChartAnchor(imageAssetsRef.current, hydratedChartAssets, id, nextAnchor);
@@ -10223,8 +10304,8 @@ function useXlsxViewerController(options) {
10223
10304
  const nextAnchor = rectToImageAnchor(rect, currentImage.anchor, {
10224
10305
  contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
10225
10306
  contentOffsetTop: GRID_HEADER_HEIGHT,
10226
- getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _742 => _742.columnWidths, 'access', _743 => _743[col]]), () => ( getColumnWidthPx(worksheet, col))),
10227
- getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _744 => _744.rowHeights, 'access', _745 => _745[row]]), () => ( getRowHeightPx(worksheet, row)))
10307
+ getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _757 => _757.columnWidths, 'access', _758 => _758[col]]), () => ( getColumnWidthPx(worksheet, col))),
10308
+ getRowHeightPx: (row) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _759 => _759.rowHeights, 'access', _760 => _760[row]]), () => ( getRowHeightPx(worksheet, row)))
10228
10309
  });
10229
10310
  recordHistoryBeforeMutation();
10230
10311
  if (!updateWorkbookImageAnchor(imageAssetsRef.current, id, nextAnchor)) {
@@ -10364,7 +10445,11 @@ function useXlsxViewerController(options) {
10364
10445
  if (imageAssetsRef.current && hydratedChartAssets) {
10365
10446
  updateWorkbookChartDefinition(imageAssetsRef.current, hydratedChartAssets, id, patch);
10366
10447
  }
10367
- setChartsByWorkbookSheetIndex((current) => current.map((sheetCharts) => sheetCharts.map((chart) => chart.id === id ? { ...chart, ...patch } : chart)));
10448
+ setChartsByWorkbookSheetIndex((current) => current.map((sheetCharts) => sheetCharts.map((chart) => {
10449
+ if (chart.id !== id) return chart;
10450
+ const appearanceUnchanged = Object.keys(patch).every((key) => key === "anchor" || key === "title");
10451
+ return { ...chart, renderSource: appearanceUnchanged ? chart.renderSource : void 0, ...patch };
10452
+ })));
10368
10453
  setRevision((current) => current + 1);
10369
10454
  }, [ensureChartAssetsHydrated, getChartById, readOnly, recordHistoryBeforeMutation, sheets, workbook]);
10370
10455
  const setChartSeriesFormula = React.useCallback((chartId, seriesIndex, formula) => {
@@ -10379,7 +10464,7 @@ function useXlsxViewerController(options) {
10379
10464
  if (!nextChart) {
10380
10465
  return false;
10381
10466
  }
10382
- updateChart(chartId, { series: nextChart.series });
10467
+ updateChart(chartId, { series: nextChart.series, renderSource: chart.renderSource });
10383
10468
  const selectedSeries = nextChart.series[seriesIndex];
10384
10469
  if (selectedSeries) {
10385
10470
  setSelectedChartElement((current) => current && current.chartId === chartId && current.kind !== "chart" ? {
@@ -10395,7 +10480,7 @@ function useXlsxViewerController(options) {
10395
10480
  setSelectedChartElement(null);
10396
10481
  setSelectedImageId(null);
10397
10482
  setActiveCell(cell);
10398
- if (_optionalChain([options2, 'optionalAccess', _746 => _746.extend]) && selectionAnchorRef.current) {
10483
+ if (_optionalChain([options2, 'optionalAccess', _761 => _761.extend]) && selectionAnchorRef.current) {
10399
10484
  setSelection(normalizeRange({ start: selectionAnchorRef.current, end: cell }));
10400
10485
  return;
10401
10486
  }
@@ -10472,7 +10557,8 @@ function useXlsxViewerController(options) {
10472
10557
  if (!before) {
10473
10558
  return;
10474
10559
  }
10475
- const nextValue = coerceUserEnteredValue(value);
10560
+ if (locale !== "en-US" && value === getCellDisplayValue2(cell)) return;
10561
+ const nextValue = coerceUserEnteredValue(value, locale);
10476
10562
  worksheet.setCell(cellAddressToA1(cell), nextValue);
10477
10563
  const after = captureCellMutationState(cell);
10478
10564
  if (!after) {
@@ -10481,7 +10567,7 @@ function useXlsxViewerController(options) {
10481
10567
  maybeRecalculateWorkbook(workbook);
10482
10568
  refreshWorkbookState(workbook);
10483
10569
  recordCellEditHistory(cell, before, after);
10484
- }, [captureCellMutationState, getActiveWorksheet, maybeRecalculateWorkbook, readOnly, recordCellEditHistory, refreshWorkbookState, workbook]);
10570
+ }, [captureCellMutationState, getActiveWorksheet, getCellDisplayValue2, locale, maybeRecalculateWorkbook, readOnly, recordCellEditHistory, refreshWorkbookState, workbook]);
10485
10571
  const setCellFormula = React.useCallback((cell, formula) => {
10486
10572
  const worksheet = getActiveWorksheet();
10487
10573
  if (readOnly || !worksheet || !workbook) {
@@ -10535,7 +10621,7 @@ function useXlsxViewerController(options) {
10535
10621
  setCellFormula(activeCell, formula);
10536
10622
  }, [activeCell, setCellFormula]);
10537
10623
  const setSelectedFormula = React.useCallback((formula) => {
10538
- if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _747 => _747.kind]) === "chartSeries") {
10624
+ if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _762 => _762.kind]) === "chartSeries") {
10539
10625
  return setChartSeriesFormula(selectedFormulaTarget.chartId, selectedFormulaTarget.seriesIndex, formula);
10540
10626
  }
10541
10627
  if (!activeCell) {
@@ -10697,7 +10783,7 @@ function useXlsxViewerController(options) {
10697
10783
  return;
10698
10784
  }
10699
10785
  recordHistoryBeforeMutation();
10700
- const baseName = _optionalChain([name, 'optionalAccess', _748 => _748.trim, 'call', _749 => _749()]) || "Sheet";
10786
+ const baseName = _optionalChain([name, 'optionalAccess', _763 => _763.trim, 'call', _764 => _764()]) || "Sheet";
10701
10787
  let candidate = baseName;
10702
10788
  let counter = 2;
10703
10789
  while (workbook.sheetIndex(candidate) !== void 0) {
@@ -10717,11 +10803,11 @@ function useXlsxViewerController(options) {
10717
10803
  }
10718
10804
  const nextSheets = buildSheetList(
10719
10805
  workbook,
10720
- _optionalChain([imageAssetsRef, 'access', _750 => _750.current, 'optionalAccess', _751 => _751.sheetStatesByWorkbookSheetIndex]),
10721
- _optionalChain([imageAssetsRef, 'access', _752 => _752.current, 'optionalAccess', _753 => _753.themePalette]),
10722
- _optionalChain([imageAssetsRef, 'access', _754 => _754.current, 'optionalAccess', _755 => _755.styleById]),
10723
- _optionalChain([imageAssetsRef, 'access', _756 => _756.current, 'optionalAccess', _757 => _757.namedCellStyleByName]),
10724
- _optionalChain([imageAssetsRef, 'access', _758 => _758.current, 'optionalAccess', _759 => _759.tableStyleByName]),
10806
+ _optionalChain([imageAssetsRef, 'access', _765 => _765.current, 'optionalAccess', _766 => _766.sheetStatesByWorkbookSheetIndex]),
10807
+ _optionalChain([imageAssetsRef, 'access', _767 => _767.current, 'optionalAccess', _768 => _768.themePalette]),
10808
+ _optionalChain([imageAssetsRef, 'access', _769 => _769.current, 'optionalAccess', _770 => _770.styleById]),
10809
+ _optionalChain([imageAssetsRef, 'access', _771 => _771.current, 'optionalAccess', _772 => _772.namedCellStyleByName]),
10810
+ _optionalChain([imageAssetsRef, 'access', _773 => _773.current, 'optionalAccess', _774 => _774.tableStyleByName]),
10725
10811
  showHiddenSheets
10726
10812
  );
10727
10813
  setSheets(nextSheets);
@@ -10731,7 +10817,7 @@ function useXlsxViewerController(options) {
10731
10817
  }
10732
10818
  const nextIndex = nextSheets.findIndex((sheet) => sheet.name === candidate);
10733
10819
  setActiveSheetIndexState(nextIndex >= 0 ? nextIndex : 0);
10734
- const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess', _760 => _760.tabs, 'access', _761 => _761.findIndex, 'call', _762 => _762((tab) => tab.kind === "sheet" && tab.name === candidate)]), () => ( -1));
10820
+ const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess', _775 => _775.tabs, 'access', _776 => _776.findIndex, 'call', _777 => _777((tab) => tab.kind === "sheet" && tab.name === candidate)]), () => ( -1));
10735
10821
  if (nextTabIndex >= 0) {
10736
10822
  setActiveTabIndexState(nextTabIndex);
10737
10823
  }
@@ -10757,11 +10843,11 @@ function useXlsxViewerController(options) {
10757
10843
  }
10758
10844
  const nextSheets = buildSheetList(
10759
10845
  workbook,
10760
- _optionalChain([imageAssetsRef, 'access', _763 => _763.current, 'optionalAccess', _764 => _764.sheetStatesByWorkbookSheetIndex]),
10761
- _optionalChain([imageAssetsRef, 'access', _765 => _765.current, 'optionalAccess', _766 => _766.themePalette]),
10762
- _optionalChain([imageAssetsRef, 'access', _767 => _767.current, 'optionalAccess', _768 => _768.styleById]),
10763
- _optionalChain([imageAssetsRef, 'access', _769 => _769.current, 'optionalAccess', _770 => _770.namedCellStyleByName]),
10764
- _optionalChain([imageAssetsRef, 'access', _771 => _771.current, 'optionalAccess', _772 => _772.tableStyleByName]),
10846
+ _optionalChain([imageAssetsRef, 'access', _778 => _778.current, 'optionalAccess', _779 => _779.sheetStatesByWorkbookSheetIndex]),
10847
+ _optionalChain([imageAssetsRef, 'access', _780 => _780.current, 'optionalAccess', _781 => _781.themePalette]),
10848
+ _optionalChain([imageAssetsRef, 'access', _782 => _782.current, 'optionalAccess', _783 => _783.styleById]),
10849
+ _optionalChain([imageAssetsRef, 'access', _784 => _784.current, 'optionalAccess', _785 => _785.namedCellStyleByName]),
10850
+ _optionalChain([imageAssetsRef, 'access', _786 => _786.current, 'optionalAccess', _787 => _787.tableStyleByName]),
10765
10851
  showHiddenSheets
10766
10852
  );
10767
10853
  setSheets(nextSheets);
@@ -10789,7 +10875,7 @@ function useXlsxViewerController(options) {
10789
10875
  }, [readOnly, recordHistoryBeforeMutation, selection, workbook]);
10790
10876
  const pasteText = React.useCallback((text) => {
10791
10877
  const worksheet = getActiveWorksheet();
10792
- const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _773 => _773.start]))), () => ( null));
10878
+ const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _788 => _788.start]))), () => ( null));
10793
10879
  if (readOnly || !worksheet || !workbook || !targetCell || !text) {
10794
10880
  return false;
10795
10881
  }
@@ -10822,7 +10908,7 @@ function useXlsxViewerController(options) {
10822
10908
  cell: nextCell
10823
10909
  });
10824
10910
  } else {
10825
- const nextValue = coerceUserEnteredValue(rawValue);
10911
+ const nextValue = coerceUserEnteredValue(rawValue, locale);
10826
10912
  worksheet.setCell(cellAddressToA1(nextCell), nextValue);
10827
10913
  const after = captureCellMutationState(nextCell);
10828
10914
  if (!after) {
@@ -10850,10 +10936,10 @@ function useXlsxViewerController(options) {
10850
10936
  selectionAnchorRef.current = targetCell;
10851
10937
  recordRangeEditHistory(mutations, nextRange, targetCell);
10852
10938
  return true;
10853
- }, [activeCell, captureCellMutationState, getActiveWorksheet, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
10939
+ }, [activeCell, captureCellMutationState, getActiveWorksheet, locale, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, workbook]);
10854
10940
  const pasteStructuredClipboardData = React.useCallback((serializedPayload) => {
10855
10941
  const worksheet = getActiveWorksheet();
10856
- const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _774 => _774.start]))), () => ( null));
10942
+ const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _789 => _789.start]))), () => ( null));
10857
10943
  if (readOnly || !worksheet || !workbook || !targetCell || !serializedPayload) {
10858
10944
  return false;
10859
10945
  }
@@ -11123,6 +11209,7 @@ function useXlsxViewerController(options) {
11123
11209
  deferredLoadFileSize,
11124
11210
  defineNamedRange,
11125
11211
  displayFileName,
11212
+ locale,
11126
11213
  download,
11127
11214
  exportCsv,
11128
11215
  exportXlsx,
@@ -11246,6 +11333,7 @@ function useXlsxViewerController(options) {
11246
11333
  deferredLoadFileSize,
11247
11334
  defineNamedRange,
11248
11335
  displayFileName,
11336
+ locale,
11249
11337
  download,
11250
11338
  error,
11251
11339
  exportCsv,
@@ -11926,7 +12014,7 @@ function parseCanvasGradientStops(value) {
11926
12014
  if (!match) {
11927
12015
  return null;
11928
12016
  }
11929
- const color = _optionalChain([match, 'access', _775 => _775[1], 'optionalAccess', _776 => _776.trim, 'call', _777 => _777()]);
12017
+ const color = _optionalChain([match, 'access', _790 => _790[1], 'optionalAccess', _791 => _791.trim, 'call', _792 => _792()]);
11930
12018
  const percent = match[2] ? Number.parseFloat(match[2]) : Number.NaN;
11931
12019
  if (!color) {
11932
12020
  return null;
@@ -11942,7 +12030,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
11942
12030
  if (linearMatch) {
11943
12031
  const parts = splitCssGradientArgs(_nullishCoalesce(linearMatch[1], () => ( "")));
11944
12032
  if (parts.length >= 2) {
11945
- const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _778 => _778[0], 'optionalAccess', _779 => _779.trim, 'call', _780 => _780()]), () => ( "180deg"));
12033
+ const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _793 => _793[0], 'optionalAccess', _794 => _794.trim, 'call', _795 => _795()]), () => ( "180deg"));
11946
12034
  const angleMatch = rawAngle.match(/(-?\d*\.?\d+)deg/i);
11947
12035
  const cssAngle = angleMatch ? Number.parseFloat(_nullishCoalesce(angleMatch[1], () => ( "180"))) : 180;
11948
12036
  const radians = (90 - cssAngle) * Math.PI / 180;
@@ -11972,7 +12060,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
11972
12060
  const radialMatch = backgroundImage.match(/^radial-gradient\((.*)\)$/i);
11973
12061
  if (radialMatch) {
11974
12062
  const parts = splitCssGradientArgs(_nullishCoalesce(radialMatch[1], () => ( "")));
11975
- const stopParts = _optionalChain([parts, 'access', _781 => _781[0], 'optionalAccess', _782 => _782.startsWith, 'call', _783 => _783("circle")]) ? parts.slice(1) : parts;
12063
+ const stopParts = _optionalChain([parts, 'access', _796 => _796[0], 'optionalAccess', _797 => _797.startsWith, 'call', _798 => _798("circle")]) ? parts.slice(1) : parts;
11976
12064
  const gradient = context.createRadialGradient(
11977
12065
  rect.left + rect.width / 2,
11978
12066
  rect.top + rect.height / 2,
@@ -12085,7 +12173,7 @@ function resolveDarkModeSurface(themePalette, palette) {
12085
12173
  return "hsl(225 4% 6%)";
12086
12174
  }
12087
12175
  function resolveSheetSurface(sheet, palette) {
12088
- return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _784 => _784.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _785 => _785.themePalette, 'access', _786 => _786.colorsByIndex, 'access', _787 => _787[0]]), () => ( SHEET_SURFACE));
12176
+ return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _799 => _799.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _800 => _800.themePalette, 'access', _801 => _801.colorsByIndex, 'access', _802 => _802[0]]), () => ( SHEET_SURFACE));
12089
12177
  }
12090
12178
  function normalizeRange2(range) {
12091
12179
  return {
@@ -12117,7 +12205,7 @@ function buildVisibleAxisIndices(precomputed, displayLimit, maxUsedIndex, hidden
12117
12205
  const visible2 = [];
12118
12206
  const usedLimit = Math.min(displayLimit, Math.max(0, maxUsedIndex + 1));
12119
12207
  for (let index = 0; index < usedLimit; index += 1) {
12120
- if (!_optionalChain([hiddenIndices, 'optionalAccess', _788 => _788.has, 'call', _789 => _789(index)])) {
12208
+ if (!_optionalChain([hiddenIndices, 'optionalAccess', _803 => _803.has, 'call', _804 => _804(index)])) {
12121
12209
  visible2.push(index);
12122
12210
  }
12123
12211
  }
@@ -12159,7 +12247,7 @@ function clampPercent(value, fallback) {
12159
12247
  return Math.max(0, Math.min(100, value));
12160
12248
  }
12161
12249
  function resolveShapeAdjustment(shape, name, fallback) {
12162
- const rawValue = _optionalChain([shape, 'access', _790 => _790.geometryAdjustments, 'optionalAccess', _791 => _791[name]]);
12250
+ const rawValue = _optionalChain([shape, 'access', _805 => _805.geometryAdjustments, 'optionalAccess', _806 => _806[name]]);
12163
12251
  if (typeof rawValue !== "number") {
12164
12252
  return fallback;
12165
12253
  }
@@ -13059,8 +13147,8 @@ function normalizeThumbnailResolution(resolution) {
13059
13147
  }
13060
13148
  const resolvedObject = typeof resolution === "object" && resolution ? resolution : void 0;
13061
13149
  return {
13062
- maxHeight: _optionalChain([resolvedObject, 'optionalAccess', _792 => _792.maxHeight]) && Number.isFinite(resolvedObject.maxHeight) && resolvedObject.maxHeight > 0 ? resolvedObject.maxHeight : THUMBNAIL_DEFAULT_MAX_DIMENSION,
13063
- maxWidth: _optionalChain([resolvedObject, 'optionalAccess', _793 => _793.maxWidth]) && Number.isFinite(resolvedObject.maxWidth) && resolvedObject.maxWidth > 0 ? resolvedObject.maxWidth : THUMBNAIL_DEFAULT_MAX_DIMENSION
13150
+ maxHeight: _optionalChain([resolvedObject, 'optionalAccess', _807 => _807.maxHeight]) && Number.isFinite(resolvedObject.maxHeight) && resolvedObject.maxHeight > 0 ? resolvedObject.maxHeight : THUMBNAIL_DEFAULT_MAX_DIMENSION,
13151
+ maxWidth: _optionalChain([resolvedObject, 'optionalAccess', _808 => _808.maxWidth]) && Number.isFinite(resolvedObject.maxWidth) && resolvedObject.maxWidth > 0 ? resolvedObject.maxWidth : THUMBNAIL_DEFAULT_MAX_DIMENSION
13064
13152
  };
13065
13153
  }
13066
13154
  function resolveThumbnailOutputSize(sourceWidth, sourceHeight, resolution) {
@@ -13379,24 +13467,24 @@ function escapeCssFontFamily(name) {
13379
13467
  return /[\s"'(),]/.test(name) ? `"${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : name;
13380
13468
  }
13381
13469
  function resolveSpreadsheetThemeFont(font, themePalette) {
13382
- const scheme = typeof _optionalChain([font, 'optionalAccess', _794 => _794.scheme]) === "string" ? font.scheme : null;
13470
+ const scheme = typeof _optionalChain([font, 'optionalAccess', _809 => _809.scheme]) === "string" ? font.scheme : null;
13383
13471
  if (scheme === "major") {
13384
- return _optionalChain([themePalette, 'optionalAccess', _795 => _795.majorLatinFont]);
13472
+ return _optionalChain([themePalette, 'optionalAccess', _810 => _810.majorLatinFont]);
13385
13473
  }
13386
13474
  if (scheme === "minor") {
13387
- return _optionalChain([themePalette, 'optionalAccess', _796 => _796.minorLatinFont]);
13475
+ return _optionalChain([themePalette, 'optionalAccess', _811 => _811.minorLatinFont]);
13388
13476
  }
13389
13477
  return void 0;
13390
13478
  }
13391
13479
  function buildSpreadsheetFontFamily(font, themePalette) {
13392
13480
  const candidates = [
13393
- typeof _optionalChain([font, 'optionalAccess', _797 => _797.name]) === "string" ? font.name.trim() : "",
13394
- _nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _798 => _798(font, themePalette), 'optionalAccess', _799 => _799.trim, 'call', _800 => _800()]), () => ( ""))
13481
+ typeof _optionalChain([font, 'optionalAccess', _812 => _812.name]) === "string" ? font.name.trim() : "",
13482
+ _nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _813 => _813(font, themePalette), 'optionalAccess', _814 => _814.trim, 'call', _815 => _815()]), () => ( ""))
13395
13483
  ].filter((value, index, array) => value.length > 0 && array.indexOf(value) === index);
13396
13484
  if (candidates.length === 0) {
13397
13485
  return void 0;
13398
13486
  }
13399
- const primaryFont = _optionalChain([candidates, 'access', _801 => _801[0], 'optionalAccess', _802 => _802.toLowerCase, 'call', _803 => _803()]);
13487
+ const primaryFont = _optionalChain([candidates, 'access', _816 => _816[0], 'optionalAccess', _817 => _817.toLowerCase, 'call', _818 => _818()]);
13400
13488
  if (primaryFont === "calibri") {
13401
13489
  return [
13402
13490
  "Calibri",
@@ -13429,17 +13517,17 @@ function resolveSpreadsheetLineHeight(fontSizePt) {
13429
13517
  }
13430
13518
  function buildGridlineShadow(color, options) {
13431
13519
  const parts = [];
13432
- if (_optionalChain([options, 'optionalAccess', _804 => _804.right]) !== false) {
13520
+ if (_optionalChain([options, 'optionalAccess', _819 => _819.right]) !== false) {
13433
13521
  parts.push(`inset -1px 0 0 ${color}`);
13434
13522
  }
13435
- if (_optionalChain([options, 'optionalAccess', _805 => _805.bottom]) !== false) {
13523
+ if (_optionalChain([options, 'optionalAccess', _820 => _820.bottom]) !== false) {
13436
13524
  parts.push(`inset 0 -1px 0 ${color}`);
13437
13525
  }
13438
13526
  return parts.join(", ");
13439
13527
  }
13440
13528
  function buildCellStyle(style, palette, themePalette, options) {
13441
- const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _806 => _806.showGridLines]), () => ( true));
13442
- const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _807 => _807.colorsByIndex, 'access', _808 => _808[0]]), () => ( SHEET_SURFACE));
13529
+ const showGridLines = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _821 => _821.showGridLines]), () => ( true));
13530
+ const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _822 => _822.colorsByIndex, 'access', _823 => _823[0]]), () => ( SHEET_SURFACE));
13443
13531
  const gridlineShadow = showGridLines ? buildGridlineShadow(palette.border) : void 0;
13444
13532
  const css = {
13445
13533
  backgroundColor: baseSurface,
@@ -13452,7 +13540,7 @@ function buildCellStyle(style, palette, themePalette, options) {
13452
13540
  lineHeight: String(resolveSpreadsheetLineHeight(11)),
13453
13541
  overflow: "hidden",
13454
13542
  padding: DEFAULT_CELL_PADDING,
13455
- textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _809 => _809.generalAlignment]), () => ( "left")),
13543
+ textAlign: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _824 => _824.generalAlignment]), () => ( "left")),
13456
13544
  textOverflow: "clip",
13457
13545
  verticalAlign: "bottom",
13458
13546
  whiteSpace: "nowrap"
@@ -13536,24 +13624,24 @@ function buildCellStyle(style, palette, themePalette, options) {
13536
13624
  }
13537
13625
  const border = style.border;
13538
13626
  if (border) {
13539
- const hasRightBorder = Boolean(_optionalChain([border, 'access', _810 => _810.right, 'optionalAccess', _811 => _811.style]) && border.right.style !== "none");
13540
- const hasBottomBorder = Boolean(_optionalChain([border, 'access', _812 => _812.bottom, 'optionalAccess', _813 => _813.style]) && border.bottom.style !== "none");
13627
+ const hasRightBorder = Boolean(_optionalChain([border, 'access', _825 => _825.right, 'optionalAccess', _826 => _826.style]) && border.right.style !== "none");
13628
+ const hasBottomBorder = Boolean(_optionalChain([border, 'access', _827 => _827.bottom, 'optionalAccess', _828 => _828.style]) && border.bottom.style !== "none");
13541
13629
  if (showGridLines && (hasRightBorder || hasBottomBorder)) {
13542
13630
  css.boxShadow = buildGridlineShadow(palette.border, {
13543
13631
  bottom: !hasBottomBorder,
13544
13632
  right: !hasRightBorder
13545
13633
  }) || void 0;
13546
13634
  }
13547
- if (_optionalChain([border, 'access', _814 => _814.top, 'optionalAccess', _815 => _815.style]) && border.top.style !== "none") {
13635
+ if (_optionalChain([border, 'access', _829 => _829.top, 'optionalAccess', _830 => _830.style]) && border.top.style !== "none") {
13548
13636
  css.borderTop = mapBorder2(border.top, themePalette);
13549
13637
  }
13550
- if (_optionalChain([border, 'access', _816 => _816.right, 'optionalAccess', _817 => _817.style]) && border.right.style !== "none") {
13638
+ if (_optionalChain([border, 'access', _831 => _831.right, 'optionalAccess', _832 => _832.style]) && border.right.style !== "none") {
13551
13639
  css.borderRight = mapBorder2(border.right, themePalette);
13552
13640
  }
13553
- if (_optionalChain([border, 'access', _818 => _818.bottom, 'optionalAccess', _819 => _819.style]) && border.bottom.style !== "none") {
13641
+ if (_optionalChain([border, 'access', _833 => _833.bottom, 'optionalAccess', _834 => _834.style]) && border.bottom.style !== "none") {
13554
13642
  css.borderBottom = mapBorder2(border.bottom, themePalette);
13555
13643
  }
13556
- if (_optionalChain([border, 'access', _820 => _820.left, 'optionalAccess', _821 => _821.style]) && border.left.style !== "none") {
13644
+ if (_optionalChain([border, 'access', _835 => _835.left, 'optionalAccess', _836 => _836.style]) && border.left.style !== "none") {
13557
13645
  css.borderLeft = mapBorder2(border.left, themePalette);
13558
13646
  }
13559
13647
  }
@@ -13578,12 +13666,12 @@ function measureTextWidth(value, style) {
13578
13666
  context.font = buildCanvasFont(style);
13579
13667
  return measureCanvasTextWidth(context, value);
13580
13668
  }
13581
- function getCellDisplayValue(worksheet, row, col, activeSheet) {
13669
+ function getCellDisplayValue(worksheet, row, col, activeSheet, locale = "en-US") {
13582
13670
  const formula = worksheet.getFormulaAt(row, col);
13583
- const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _822 => _822.cachedFormulaValues, 'optionalAccess', _823 => _823[cellAddressToA12({ row, col })]]) : void 0;
13671
+ const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _837 => _837.cachedFormulaValues, 'optionalAccess', _838 => _838[cellAddressToA12({ row, col })]]) : void 0;
13584
13672
  const formatted = worksheet.getFormattedValueAt(row, col);
13585
13673
  if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
13586
- return decodeHtmlEntities2(formatted);
13674
+ return localizeCellNumber(worksheet, row, col, decodeHtmlEntities2(formatted), locale);
13587
13675
  }
13588
13676
  const cellValue = worksheet.getCalculatedValueAt(row, col);
13589
13677
  if (formula && cachedFormulaValue !== void 0 && cellValue.is_error) {
@@ -13633,6 +13721,7 @@ function getBatchedCellNumericValue(cell) {
13633
13721
  if (!cell) {
13634
13722
  return null;
13635
13723
  }
13724
+ if (cell.numericValue !== void 0) return cell.numericValue;
13636
13725
  const text = cell.value.trim();
13637
13726
  if (text.length === 0) {
13638
13727
  return null;
@@ -13826,7 +13915,7 @@ function normalizeBatchedMergeSpan(value) {
13826
13915
  }
13827
13916
  function normalizeBatchedCellValue(rawValue, formula, row, col, activeSheet) {
13828
13917
  const value = typeof rawValue === "string" ? decodeHtmlEntities2(rawValue) : rawValue === null || rawValue === void 0 ? "" : String(rawValue);
13829
- const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _824 => _824.cachedFormulaValues, 'optionalAccess', _825 => _825[cellAddressToA12({ row, col })]]) : void 0;
13918
+ const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _839 => _839.cachedFormulaValues, 'optionalAccess', _840 => _840[cellAddressToA12({ row, col })]]) : void 0;
13830
13919
  if (formula && cachedFormulaValue !== void 0 && value.startsWith("#")) {
13831
13920
  return cachedFormulaValue;
13832
13921
  }
@@ -13848,6 +13937,7 @@ function buildWorksheetBatchWindow(rows, activeSheet, startRow, endRow) {
13848
13937
  const formula = typeof cellEntry.formula === "string" ? cellEntry.formula : null;
13849
13938
  cells.set(`${row}:${col}`, {
13850
13939
  formula,
13940
+ numericValue: typeof cellEntry.numericValue === "number" ? cellEntry.numericValue : cellEntry.numericValue === null ? null : void 0,
13851
13941
  generalAlignment: cellEntry.generalAlignment === "right" || cellEntry.generalAlignment === "center" ? cellEntry.generalAlignment : "left",
13852
13942
  hyperlink: normalizeBatchedHyperlink(cellEntry.hyperlink),
13853
13943
  isMergedSecondary: cellEntry.isMergedSecondary === true,
@@ -13872,31 +13962,31 @@ function mergeResolvedCellStyle(base, overlay, options) {
13872
13962
  ..._nullishCoalesce(base, () => ( {})),
13873
13963
  ..._nullishCoalesce(overlay, () => ( {}))
13874
13964
  };
13875
- const baseAlignment = _optionalChain([base, 'optionalAccess', _826 => _826.alignment]);
13876
- const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _827 => _827.alignment]);
13965
+ const baseAlignment = _optionalChain([base, 'optionalAccess', _841 => _841.alignment]);
13966
+ const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _842 => _842.alignment]);
13877
13967
  if (baseAlignment || overlayAlignment) {
13878
13968
  nextStyle.alignment = {
13879
13969
  ..._nullishCoalesce(baseAlignment, () => ( {})),
13880
13970
  ..._nullishCoalesce(overlayAlignment, () => ( {}))
13881
13971
  };
13882
13972
  }
13883
- const baseBorder = _optionalChain([base, 'optionalAccess', _828 => _828.border]);
13884
- const overlayBorder = _optionalChain([overlay, 'optionalAccess', _829 => _829.border]);
13973
+ const baseBorder = _optionalChain([base, 'optionalAccess', _843 => _843.border]);
13974
+ const overlayBorder = _optionalChain([overlay, 'optionalAccess', _844 => _844.border]);
13885
13975
  if (baseBorder || overlayBorder) {
13886
- nextStyle.border = _optionalChain([options, 'optionalAccess', _830 => _830.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
13976
+ nextStyle.border = _optionalChain([options, 'optionalAccess', _845 => _845.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
13887
13977
  ..._nullishCoalesce(baseBorder, () => ( {})),
13888
13978
  ..._nullishCoalesce(overlayBorder, () => ( {}))
13889
13979
  };
13890
13980
  }
13891
- const baseFill = _optionalChain([base, 'optionalAccess', _831 => _831.fill]);
13892
- const overlayFill = _optionalChain([overlay, 'optionalAccess', _832 => _832.fill]);
13981
+ const baseFill = _optionalChain([base, 'optionalAccess', _846 => _846.fill]);
13982
+ const overlayFill = _optionalChain([overlay, 'optionalAccess', _847 => _847.fill]);
13893
13983
  if (baseFill || overlayFill) {
13894
- nextStyle.fill = _optionalChain([options, 'optionalAccess', _833 => _833.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
13984
+ nextStyle.fill = _optionalChain([options, 'optionalAccess', _848 => _848.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
13895
13985
  }
13896
- const baseFont = _optionalChain([base, 'optionalAccess', _834 => _834.font]);
13897
- const overlayFont = _optionalChain([overlay, 'optionalAccess', _835 => _835.font]);
13986
+ const baseFont = _optionalChain([base, 'optionalAccess', _849 => _849.font]);
13987
+ const overlayFont = _optionalChain([overlay, 'optionalAccess', _850 => _850.font]);
13898
13988
  if (baseFont || overlayFont) {
13899
- nextStyle.font = _optionalChain([options, 'optionalAccess', _836 => _836.replaceXfSubtrees]) && overlayFont ? overlayFont : {
13989
+ nextStyle.font = _optionalChain([options, 'optionalAccess', _851 => _851.replaceXfSubtrees]) && overlayFont ? overlayFont : {
13900
13990
  ..._nullishCoalesce(baseFont, () => ( {})),
13901
13991
  ..._nullishCoalesce(overlayFont, () => ( {}))
13902
13992
  };
@@ -14252,11 +14342,11 @@ function resolveConditionalFormulaComparable(formula, worksheet, sheet, batchedC
14252
14342
  return literal;
14253
14343
  }
14254
14344
  const splitReference = splitSheetFormulaReference(normalized);
14255
- const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _837 => _837.sheetName]), () => ( null));
14256
- if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _838 => _838.name]) && targetSheetName !== sheet.name) {
14345
+ const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _852 => _852.sheetName]), () => ( null));
14346
+ if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _853 => _853.name]) && targetSheetName !== sheet.name) {
14257
14347
  return literal;
14258
14348
  }
14259
- const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _839 => _839.range]), () => ( normalized));
14349
+ const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _854 => _854.range]), () => ( normalized));
14260
14350
  const cell = parseA1CellReference3(cellRef.replace(/\$/g, ""));
14261
14351
  if (!cell) {
14262
14352
  return literal;
@@ -14288,8 +14378,8 @@ function normalizeConditionalTextOperand(value) {
14288
14378
  }
14289
14379
  function resolveConditionalStyledRuleMatch(rule, numericValue, textValue, worksheet, sheet, batchedCells) {
14290
14380
  const normalizedRuleType = rule.ruleType.trim().toLowerCase();
14291
- const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _840 => _840.formulas, 'optionalAccess', _841 => _841[0]]), () => ( "")), worksheet, sheet, batchedCells);
14292
- const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _842 => _842.formulas, 'optionalAccess', _843 => _843[1]]), () => ( "")), worksheet, sheet, batchedCells);
14381
+ const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _855 => _855.formulas, 'optionalAccess', _856 => _856[0]]), () => ( "")), worksheet, sheet, batchedCells);
14382
+ const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _857 => _857.formulas, 'optionalAccess', _858 => _858[1]]), () => ( "")), worksheet, sheet, batchedCells);
14293
14383
  if (normalizedRuleType === "cellis") {
14294
14384
  return resolveConditionalCellIsMatch(_nullishCoalesce(rule.operator, () => ( "equal")), left, right, numericValue, textValue);
14295
14385
  }
@@ -14320,7 +14410,7 @@ function getStyledConditionalRules(rules) {
14320
14410
  return styledRules;
14321
14411
  }
14322
14412
  function resolveConditionalCellStyleForCell(row, col, sheet, readNumericValue, readTextValue, worksheet, batchedCells) {
14323
- const rules = _optionalChain([sheet, 'optionalAccess', _844 => _844.conditionalFormatRules]);
14413
+ const rules = _optionalChain([sheet, 'optionalAccess', _859 => _859.conditionalFormatRules]);
14324
14414
  if (!sheet || !rules || rules.length === 0) {
14325
14415
  return null;
14326
14416
  }
@@ -14524,11 +14614,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
14524
14614
  if (shape.paragraphs.length === 0) {
14525
14615
  return;
14526
14616
  }
14527
- const inset = _optionalChain([shape, 'access', _845 => _845.textBox, 'optionalAccess', _846 => _846.insetPx]);
14528
- const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _847 => _847.left]), () => ( 6))) * zoomFactor;
14529
- const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _848 => _848.right]), () => ( 6))) * zoomFactor;
14530
- const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _849 => _849.top]), () => ( 4))) * zoomFactor;
14531
- const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _850 => _850.bottom]), () => ( 4))) * zoomFactor;
14617
+ const inset = _optionalChain([shape, 'access', _860 => _860.textBox, 'optionalAccess', _861 => _861.insetPx]);
14618
+ const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _862 => _862.left]), () => ( 6))) * zoomFactor;
14619
+ const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _863 => _863.right]), () => ( 6))) * zoomFactor;
14620
+ const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _864 => _864.top]), () => ( 4))) * zoomFactor;
14621
+ const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _865 => _865.bottom]), () => ( 4))) * zoomFactor;
14532
14622
  const textLeft = left + paddingLeft;
14533
14623
  const textTop = top + paddingTop;
14534
14624
  const textWidth = Math.max(0, width - paddingLeft - paddingRight);
@@ -14550,9 +14640,9 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
14550
14640
  });
14551
14641
  const totalTextHeight = lineMetrics.reduce((total, metric) => total + metric.lineHeight, 0);
14552
14642
  let y = textTop;
14553
- if (_optionalChain([shape, 'access', _851 => _851.textBox, 'optionalAccess', _852 => _852.verticalAlign]) === "middle") {
14643
+ if (_optionalChain([shape, 'access', _866 => _866.textBox, 'optionalAccess', _867 => _867.verticalAlign]) === "middle") {
14554
14644
  y = textTop + Math.max(0, (textHeight - totalTextHeight) / 2);
14555
- } else if (_optionalChain([shape, 'access', _853 => _853.textBox, 'optionalAccess', _854 => _854.verticalAlign]) === "bottom") {
14645
+ } else if (_optionalChain([shape, 'access', _868 => _868.textBox, 'optionalAccess', _869 => _869.verticalAlign]) === "bottom") {
14556
14646
  y = textTop + Math.max(0, textHeight - totalTextHeight);
14557
14647
  }
14558
14648
  context.save();
@@ -14563,7 +14653,7 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
14563
14653
  shape.paragraphs.forEach((paragraph, paragraphIndex) => {
14564
14654
  const metric = _nullishCoalesce(lineMetrics[paragraphIndex], () => ( { lineHeight: 14 * zoomFactor, widthPx: 0 }));
14565
14655
  let x = textLeft;
14566
- const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _855 => _855.textBox, 'optionalAccess', _856 => _856.horizontalAlign]))), () => ( "left"));
14656
+ const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _870 => _870.textBox, 'optionalAccess', _871 => _871.horizontalAlign]))), () => ( "left"));
14567
14657
  if (align === "center") {
14568
14658
  x = textLeft + Math.max(0, (textWidth - metric.widthPx) / 2);
14569
14659
  } else if (align === "right") {
@@ -14592,11 +14682,11 @@ function drawStaticShapeText(context, shape, left, top, width, height, zoomFacto
14592
14682
  context.restore();
14593
14683
  }
14594
14684
  function drawStaticShape(context, shape, rect, zoomFactor) {
14595
- const fillColor = _optionalChain([shape, 'access', _857 => _857.fill, 'optionalAccess', _858 => _858.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _859 => _859.fill, 'optionalAccess', _860 => _860.color]), () => ( "transparent"));
14596
- const strokeColor = _optionalChain([shape, 'access', _861 => _861.stroke, 'optionalAccess', _862 => _862.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _863 => _863.stroke, 'optionalAccess', _864 => _864.color]), () => ( "transparent"));
14597
- const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _865 => _865.stroke, 'optionalAccess', _866 => _866.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
14685
+ const fillColor = _optionalChain([shape, 'access', _872 => _872.fill, 'optionalAccess', _873 => _873.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _874 => _874.fill, 'optionalAccess', _875 => _875.color]), () => ( "transparent"));
14686
+ const strokeColor = _optionalChain([shape, 'access', _876 => _876.stroke, 'optionalAccess', _877 => _877.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _878 => _878.stroke, 'optionalAccess', _879 => _879.color]), () => ( "transparent"));
14687
+ const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _880 => _880.stroke, 'optionalAccess', _881 => _881.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
14598
14688
  const vectorShape = resolveShapeVector(shape);
14599
- const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _867 => _867.fill, 'optionalAccess', _868 => _868.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _869 => _869.stroke, 'optionalAccess', _870 => _870.opacity]), () => ( 1)));
14689
+ const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _882 => _882.fill, 'optionalAccess', _883 => _883.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _884 => _884.stroke, 'optionalAccess', _885 => _885.opacity]), () => ( 1)));
14600
14690
  context.save();
14601
14691
  context.translate(rect.left + rect.width / 2, rect.top + rect.height / 2);
14602
14692
  if (shape.rotationDeg) {
@@ -14607,7 +14697,7 @@ function drawStaticShape(context, shape, rect, zoomFactor) {
14607
14697
  context.lineWidth = lineWidth;
14608
14698
  context.strokeStyle = strokeColor;
14609
14699
  context.fillStyle = fillColor;
14610
- applyCanvasShapeDash(context, _optionalChain([shape, 'access', _871 => _871.stroke, 'optionalAccess', _872 => _872.dash]), lineWidth);
14700
+ applyCanvasShapeDash(context, _optionalChain([shape, 'access', _886 => _886.stroke, 'optionalAccess', _887 => _887.dash]), lineWidth);
14611
14701
  const localLeft = -rect.width / 2;
14612
14702
  const localTop = -rect.height / 2;
14613
14703
  if (vectorShape && typeof Path2D !== "undefined") {
@@ -14744,7 +14834,7 @@ function drawStaticFormControl(context, control, rect, palette, zoomFactor, shee
14744
14834
  context.restore();
14745
14835
  }
14746
14836
  function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCache) {
14747
- const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _873 => _873.conditionalFormatRules]), () => ( []));
14837
+ const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _888 => _888.conditionalFormatRules]), () => ( []));
14748
14838
  const matchingRule = rules.find(
14749
14839
  (rule) => rule.kind === "dataBar" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
14750
14840
  );
@@ -14782,23 +14872,23 @@ function resolveConditionalDataBarForCell(row, col, worksheet, sheet, metricsCac
14782
14872
  const span = maxValue - minValue;
14783
14873
  const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
14784
14874
  const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
14785
- const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess', _874 => _874.themePalette]));
14875
+ const color = resolveWorkbookColor(matchingRule.color, _optionalChain([sheet, 'optionalAccess', _889 => _889.themePalette]));
14786
14876
  if (!color || widthPercent <= 0) {
14787
14877
  return null;
14788
14878
  }
14789
14879
  return {
14790
- axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _875 => _875.themePalette])), () => ( void 0)),
14880
+ axisColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _890 => _890.themePalette])), () => ( void 0)),
14791
14881
  border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
14792
- borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _876 => _876.themePalette])), () => ( void 0)),
14882
+ borderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _891 => _891.themePalette])), () => ( void 0)),
14793
14883
  color,
14794
14884
  gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
14795
- negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _877 => _877.themePalette])), () => ( void 0)),
14796
- negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _878 => _878.themePalette])), () => ( void 0)),
14885
+ negativeBorderColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _892 => _892.themePalette])), () => ( void 0)),
14886
+ negativeFillColor: _nullishCoalesce(resolveWorkbookColor(matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _893 => _893.themePalette])), () => ( void 0)),
14797
14887
  widthPercent
14798
14888
  };
14799
14889
  }
14800
14890
  function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metricsCache) {
14801
- const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _879 => _879.conditionalFormatRules]), () => ( []));
14891
+ const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _894 => _894.conditionalFormatRules]), () => ( []));
14802
14892
  const matchingRule = rules.find(
14803
14893
  (rule) => rule.kind === "colorScale" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
14804
14894
  );
@@ -14826,7 +14916,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
14826
14916
  });
14827
14917
  metricsCache.set(cacheKey, ruleValues);
14828
14918
  }
14829
- const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess', _880 => _880.themePalette]))).filter((color) => typeof color === "string");
14919
+ const colors = matchingRule.colors.map((color) => resolveWorkbookColor(color, _optionalChain([sheet, 'optionalAccess', _895 => _895.themePalette]))).filter((color) => typeof color === "string");
14830
14920
  const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
14831
14921
  if (colors.length < 2 || thresholds.length < 2) {
14832
14922
  return null;
@@ -14845,7 +14935,7 @@ function resolveConditionalColorScaleForCell(row, col, worksheet, sheet, metrics
14845
14935
  return { color: resolvedColor };
14846
14936
  }
14847
14937
  function resolveConditionalIconForCell(row, col, worksheet, sheet, metricsCache) {
14848
- const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _881 => _881.conditionalFormatRules]), () => ( []));
14938
+ const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _896 => _896.conditionalFormatRules]), () => ( []));
14849
14939
  const matchingRule = rules.find(
14850
14940
  (rule) => rule.kind === "iconSet" && rule.ranges.some((range) => isCellInRange({ row, col }, range))
14851
14941
  );
@@ -15132,7 +15222,7 @@ function GridRow({
15132
15222
  whiteSpace: "nowrap",
15133
15223
  width: "max-content"
15134
15224
  } : null;
15135
- const title = [_optionalChain([cellData, 'access', _882 => _882.hyperlink, 'optionalAccess', _883 => _883.tooltip]), _optionalChain([cellData, 'access', _884 => _884.validation, 'optionalAccess', _885 => _885.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
15225
+ const title = [_optionalChain([cellData, 'access', _897 => _897.hyperlink, 'optionalAccess', _898 => _898.tooltip]), _optionalChain([cellData, 'access', _899 => _899.validation, 'optionalAccess', _900 => _900.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
15136
15226
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
15137
15227
  "td",
15138
15228
  {
@@ -15316,8 +15406,8 @@ var MemoGridRow = React4.memo(GridRow, (prev, next) => {
15316
15406
  if (prev.actualRow !== next.actualRow || prev.rowHeight !== next.rowHeight || prev.headerLabelLiveScale !== next.headerLabelLiveScale || prev.palette !== next.palette || prev.readOnly !== next.readOnly || prev.visibleCols !== next.visibleCols || prev.leadingSpacerWidth !== next.leadingSpacerWidth || prev.rowHeaderWidth !== next.rowHeaderWidth || prev.stickyLeftByCol !== next.stickyLeftByCol || prev.stickyTop !== next.stickyTop || prev.trailingSpacerWidth !== next.trailingSpacerWidth || prev.zoomFactor !== next.zoomFactor || prev.getCellData !== next.getCellData || prev.onCellClick !== next.onCellClick || prev.onCellDoubleClick !== next.onCellDoubleClick || prev.onCellPointerDown !== next.onCellPointerDown || prev.onEditingBlur !== next.onEditingBlur || prev.onEditingCancel !== next.onEditingCancel || prev.onEditingCommit !== next.onEditingCommit || prev.onEditingNavigate !== next.onEditingNavigate || prev.onEditingValueChange !== next.onEditingValueChange || prev.onRowHeaderRef !== next.onRowHeaderRef || prev.onRowPointerDown !== next.onRowPointerDown || prev.onRowResizePointerDown !== next.onRowResizePointerDown || prev.renderCellAdornment !== next.renderCellAdornment) {
15317
15407
  return false;
15318
15408
  }
15319
- const prevEditingCol = _optionalChain([prev, 'access', _886 => _886.editingCell, 'optionalAccess', _887 => _887.row]) === prev.actualRow ? prev.editingCell.col : -1;
15320
- const nextEditingCol = _optionalChain([next, 'access', _888 => _888.editingCell, 'optionalAccess', _889 => _889.row]) === next.actualRow ? next.editingCell.col : -1;
15409
+ const prevEditingCol = _optionalChain([prev, 'access', _901 => _901.editingCell, 'optionalAccess', _902 => _902.row]) === prev.actualRow ? prev.editingCell.col : -1;
15410
+ const nextEditingCol = _optionalChain([next, 'access', _903 => _903.editingCell, 'optionalAccess', _904 => _904.row]) === next.actualRow ? next.editingCell.col : -1;
15321
15411
  if (prevEditingCol !== nextEditingCol) {
15322
15412
  return false;
15323
15413
  }
@@ -15733,6 +15823,7 @@ function useXlsxViewerThumbnails(options = {}) {
15733
15823
  getSheetFormControls,
15734
15824
  getSheetImages,
15735
15825
  getSheetShapes,
15826
+ locale,
15736
15827
  workbook,
15737
15828
  sheets
15738
15829
  } = useXlsxViewer();
@@ -15754,6 +15845,11 @@ function useXlsxViewerThumbnails(options = {}) {
15754
15845
  isMountedRef.current = false;
15755
15846
  };
15756
15847
  }, []);
15848
+ React4.useEffect(() => {
15849
+ workerThumbnailRowBatchCacheRef.current.clear();
15850
+ workerThumbnailRowBatchRequestRef.current.clear();
15851
+ setWorkerThumbnailRowBatchVersion((version) => version + 1);
15852
+ }, [locale]);
15757
15853
  React4.useEffect(() => {
15758
15854
  const currentSheets = new Set(sheets);
15759
15855
  for (const sheet of workerThumbnailRowBatchCacheRef.current.keys()) {
@@ -15778,8 +15874,8 @@ function useXlsxViewerThumbnails(options = {}) {
15778
15874
  const pendingRequest = workerThumbnailRowBatchRequestRef.current.get(sheet);
15779
15875
  if (!pendingRequest) {
15780
15876
  const request = {
15781
- endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _890 => _890.endRow]), () => ( endRow))),
15782
- startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _891 => _891.startRow]), () => ( startRow)))
15877
+ endRow: Math.max(endRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _905 => _905.endRow]), () => ( endRow))),
15878
+ startRow: Math.min(startRow, _nullishCoalesce(_optionalChain([cachedBatch, 'optionalAccess', _906 => _906.startRow]), () => ( startRow)))
15783
15879
  };
15784
15880
  workerThumbnailRowBatchRequestRef.current.set(sheet, request);
15785
15881
  void getRowsBatchAsync(
@@ -15843,7 +15939,7 @@ function useXlsxViewerThumbnails(options = {}) {
15843
15939
  }, []);
15844
15940
  const thumbnails = React4.useMemo(() => {
15845
15941
  return sheets.map((sheet, sheetIndex) => {
15846
- const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess', _892 => _892.getSheet, 'call', _893 => _893(sheet.workbookSheetIndex)]), () => ( null));
15942
+ const worksheet = _nullishCoalesce(_optionalChain([workbook, 'optionalAccess', _907 => _907.getSheet, 'call', _908 => _908(sheet.workbookSheetIndex)]), () => ( null));
15847
15943
  const sheetImages = getSheetImages(sheetIndex).filter((image) => image.src).sort((left, right) => left.zIndex - right.zIndex);
15848
15944
  const sheetShapes = getSheetShapes(sheetIndex);
15849
15945
  const sheetFormControls = getSheetFormControls(sheetIndex).filter((control) => !control.hidden);
@@ -15859,18 +15955,18 @@ function useXlsxViewerThumbnails(options = {}) {
15859
15955
  minRow: 0
15860
15956
  }));
15861
15957
  return {
15862
- maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _894 => _894.maxCol]), () => ( drawingBound.maxCol)), drawingBound.maxCol),
15863
- maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _895 => _895.maxRow]), () => ( drawingBound.maxRow)), drawingBound.maxRow),
15864
- minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _896 => _896.minCol]), () => ( drawingBound.minCol)), drawingBound.minCol),
15865
- minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _897 => _897.minRow]), () => ( drawingBound.minRow)), drawingBound.minRow)
15958
+ maxCol: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _909 => _909.maxCol]), () => ( drawingBound.maxCol)), drawingBound.maxCol),
15959
+ maxRow: Math.max(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _910 => _910.maxRow]), () => ( drawingBound.maxRow)), drawingBound.maxRow),
15960
+ minCol: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _911 => _911.minCol]), () => ( drawingBound.minCol)), drawingBound.minCol),
15961
+ minRow: Math.min(_nullishCoalesce(_optionalChain([bounds, 'optionalAccess', _912 => _912.minRow]), () => ( drawingBound.minRow)), drawingBound.minRow)
15866
15962
  };
15867
15963
  }, null);
15868
15964
  const sheetMinUsedRow = (_nullishCoalesce(sheet.maxUsedRow, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedRow, () => ( 0))) ? _nullishCoalesce(sheet.minUsedRow, () => ( 0)) : void 0;
15869
15965
  const sheetMinUsedCol = (_nullishCoalesce(sheet.maxUsedCol, () => ( -1))) >= (_nullishCoalesce(sheet.minUsedCol, () => ( 0))) ? _nullishCoalesce(sheet.minUsedCol, () => ( 0)) : void 0;
15870
- const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess', _898 => _898.minRow]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _899 => _899.minRow]), () => ( sheetMinUsedRow)), () => ( 0))));
15871
- const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess', _900 => _900.minCol]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _901 => _901.minCol]), () => ( sheetMinUsedCol)), () => ( 0))));
15872
- const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _902 => _902.maxRow]), () => ( -1)));
15873
- const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _903 => _903.maxCol]), () => ( -1)));
15966
+ const effectiveMinUsedRow = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedRow, () => ( _optionalChain([drawingBounds, 'optionalAccess', _913 => _913.minRow]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _914 => _914.minRow]), () => ( sheetMinUsedRow)), () => ( 0))));
15967
+ const effectiveMinUsedCol = Math.max(0, Math.min(_nullishCoalesce(_nullishCoalesce(sheetMinUsedCol, () => ( _optionalChain([drawingBounds, 'optionalAccess', _915 => _915.minCol]))), () => ( 0)), _nullishCoalesce(_nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _916 => _916.minCol]), () => ( sheetMinUsedCol)), () => ( 0))));
15968
+ const effectiveMaxUsedRow = Math.max(_nullishCoalesce(sheet.maxUsedRow, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _917 => _917.maxRow]), () => ( -1)));
15969
+ const effectiveMaxUsedCol = Math.max(_nullishCoalesce(sheet.maxUsedCol, () => ( -1)), _nullishCoalesce(_optionalChain([drawingBounds, 'optionalAccess', _918 => _918.maxCol]), () => ( -1)));
15874
15970
  const showGridLines = _nullishCoalesce(sheet.showGridLines, () => ( true));
15875
15971
  const hiddenRowSet = new Set(_nullishCoalesce(sheet.hiddenRows, () => ( [])));
15876
15972
  const hiddenColSet = new Set(_nullishCoalesce(sheet.hiddenCols, () => ( [])));
@@ -16083,8 +16179,8 @@ function useXlsxViewerThumbnails(options = {}) {
16083
16179
  return cached;
16084
16180
  }
16085
16181
  const batchCoversRow = workerRowBatch ? row >= workerRowBatch.startRow && row <= workerRowBatch.endRow : false;
16086
- const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess', _904 => _904.cells, 'access', _905 => _905.get, 'call', _906 => _906(cacheKey)]) : void 0;
16087
- if (_optionalChain([batchedCell, 'optionalAccess', _907 => _907.isMergedSecondary]) || _optionalChain([worksheet, 'optionalAccess', _908 => _908.isMergedSecondary, 'call', _909 => _909(row, col)])) {
16182
+ const batchedCell = batchCoversRow ? _optionalChain([workerRowBatch, 'optionalAccess', _919 => _919.cells, 'access', _920 => _920.get, 'call', _921 => _921(cacheKey)]) : void 0;
16183
+ if (_optionalChain([batchedCell, 'optionalAccess', _922 => _922.isMergedSecondary]) || _optionalChain([worksheet, 'optionalAccess', _923 => _923.isMergedSecondary, 'call', _924 => _924(row, col)])) {
16088
16184
  const mergedSecondaryData = {
16089
16185
  isMergedSecondary: true,
16090
16186
  style: {},
@@ -16093,23 +16189,23 @@ function useXlsxViewerThumbnails(options = {}) {
16093
16189
  cellRenderCache.set(cacheKey, mergedSecondaryData);
16094
16190
  return mergedSecondaryData;
16095
16191
  }
16096
- const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess', _910 => _910.mergeSpan]);
16192
+ const merge = worksheet ? worksheet.getMergeSpan(row, col) : _optionalChain([batchedCell, 'optionalAccess', _925 => _925.mergeSpan]);
16097
16193
  const inheritedStyle = resolveInheritedCellStyle2(sheet, row, col);
16098
- const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _911 => _911.style]), () => ( null));
16194
+ const worksheetStyle = worksheet ? _nullishCoalesce(worksheet.getCellStyleAt(row, col), () => ( null)) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _926 => _926.style]), () => ( null));
16099
16195
  const mergedStyle = mergeResolvedCellStyle(inheritedStyle, worksheetStyle, { replaceXfSubtrees: true });
16100
16196
  const conditionalCellStyle = resolveConditionalCellStyleForCell(
16101
16197
  row,
16102
16198
  col,
16103
16199
  sheet,
16104
16200
  () => worksheet ? getCellNumericValue(worksheet, row, col) : getBatchedCellNumericValue(batchedCell),
16105
- () => worksheet ? getCellDisplayValue(worksheet, row, col, sheet) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _912 => _912.value]), () => ( "")),
16201
+ () => worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _927 => _927.value]), () => ( "")),
16106
16202
  worksheet,
16107
- _optionalChain([workerRowBatch, 'optionalAccess', _913 => _913.cells])
16203
+ _optionalChain([workerRowBatch, 'optionalAccess', _928 => _928.cells])
16108
16204
  );
16109
16205
  const finalResolvedStyle = mergeResolvedCellStyle(mergedStyle, conditionalCellStyle);
16110
- const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _914 => _914.alignment]);
16206
+ const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _929 => _929.alignment]);
16111
16207
  const sparkline = _nullishCoalesce(sparklineByCell.get(cacheKey), () => ( null));
16112
- const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess', _915 => _915.cells, 'access', _916 => _916.get, 'call', _917 => _917(`${targetRow}:${targetCol}`)]));
16208
+ const getNumericValue = (targetRow, targetCol) => worksheet ? getCellNumericValue(worksheet, targetRow, targetCol) : getBatchedCellNumericValue(_optionalChain([workerRowBatch, 'optionalAccess', _930 => _930.cells, 'access', _931 => _931.get, 'call', _932 => _932(`${targetRow}:${targetCol}`)]));
16113
16209
  const sparklineValues = sparkline ? sparkline.range.start.row === sparkline.range.end.row ? Array.from(
16114
16210
  { length: Math.abs(sparkline.range.end.col - sparkline.range.start.col) + 1 },
16115
16211
  (_, index) => getNumericValue(
@@ -16123,23 +16219,23 @@ function useXlsxViewerThumbnails(options = {}) {
16123
16219
  sparkline.range.start.col
16124
16220
  )
16125
16221
  ) : null;
16126
- const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _918 => _918.cellControl]) ? worksheet ? getCellBooleanValue(worksheet, row, col) : getBatchedCellBooleanValue(batchedCell) : null;
16222
+ const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _933 => _933.cellControl]) ? worksheet ? getCellBooleanValue(worksheet, row, col) : getBatchedCellBooleanValue(batchedCell) : null;
16127
16223
  const nextData = {
16128
16224
  canvas: void 0,
16129
16225
  checkboxState,
16130
- colSpan: _optionalChain([merge, 'optionalAccess', _919 => _919.colSpan]),
16226
+ colSpan: _optionalChain([merge, 'optionalAccess', _934 => _934.colSpan]),
16131
16227
  conditionalColorScale: worksheet ? resolveConditionalColorScaleForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
16132
16228
  conditionalDataBar: worksheet ? resolveConditionalDataBarForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
16133
16229
  conditionalIcon: worksheet ? resolveConditionalIconForCell(row, col, worksheet, sheet, conditionalFormatMetricsCache) : null,
16134
16230
  isMergedSecondary: false,
16135
- rowSpan: _optionalChain([merge, 'optionalAccess', _920 => _920.rowSpan]),
16231
+ rowSpan: _optionalChain([merge, 'optionalAccess', _935 => _935.rowSpan]),
16136
16232
  sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
16137
16233
  style: buildCellStyle(finalResolvedStyle, palette, sheet.themePalette, {
16138
- generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess', _921 => _921.generalAlignment]),
16234
+ generalAlignment: worksheet ? getCellGeneralAlignment(worksheet, row, col) : _optionalChain([batchedCell, 'optionalAccess', _936 => _936.generalAlignment]),
16139
16235
  showGridLines
16140
16236
  }),
16141
- textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _922 => _922.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _923 => _923.textRotation])))),
16142
- value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _924 => _924.value]), () => ( ""))
16237
+ textRotationDeg: resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _937 => _937.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _938 => _938.textRotation])))),
16238
+ value: sparkline ? "" : checkboxState !== null ? "" : worksheet ? getCellDisplayValue(worksheet, row, col, sheet, locale) : _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _939 => _939.value]), () => ( ""))
16143
16239
  };
16144
16240
  nextData.canvas = buildCanvasCellStyleCache(nextData.style);
16145
16241
  cellRenderCache.set(cacheKey, nextData);
@@ -16157,11 +16253,11 @@ function useXlsxViewerThumbnails(options = {}) {
16157
16253
  let height = rowItem.size;
16158
16254
  for (let colOffset = 1; colOffset < colSpan; colOffset += 1) {
16159
16255
  const nextCol = colItemByActual.get(colItem.actualIndex + colOffset);
16160
- width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess', _925 => _925.size]), () => ( 0));
16256
+ width += _nullishCoalesce(_optionalChain([nextCol, 'optionalAccess', _940 => _940.size]), () => ( 0));
16161
16257
  }
16162
16258
  for (let rowOffset = 1; rowOffset < rowSpan; rowOffset += 1) {
16163
16259
  const nextRow = rowItemByActual.get(rowItem.actualIndex + rowOffset);
16164
- height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess', _926 => _926.size]), () => ( 0));
16260
+ height += _nullishCoalesce(_optionalChain([nextRow, 'optionalAccess', _941 => _941.size]), () => ( 0));
16165
16261
  }
16166
16262
  const rect = {
16167
16263
  height,
@@ -16171,7 +16267,7 @@ function useXlsxViewerThumbnails(options = {}) {
16171
16267
  };
16172
16268
  const canvasCellStyle = _nullishCoalesce(cellData.canvas, () => ( buildCanvasCellStyleCache(cellData.style)));
16173
16269
  const gradientFill = typeof cellData.style.backgroundImage === "string" ? resolveCanvasGradientFill(context, rect, cellData.style.backgroundImage) : null;
16174
- const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _927 => _927.conditionalColorScale, 'optionalAccess', _928 => _928.color]), () => ( (typeof cellData.style.backgroundColor === "string" ? cellData.style.backgroundColor : thumbnailSheetSurface)));
16270
+ const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _942 => _942.conditionalColorScale, 'optionalAccess', _943 => _943.color]), () => ( (typeof cellData.style.backgroundColor === "string" ? cellData.style.backgroundColor : thumbnailSheetSurface)));
16175
16271
  context.fillStyle = _nullishCoalesce(gradientFill, () => ( fillColor));
16176
16272
  context.fillRect(rect.left, rect.top, rect.width, rect.height);
16177
16273
  if (cellData.conditionalDataBar) {
@@ -16411,10 +16507,11 @@ function useXlsxViewerThumbnails(options = {}) {
16411
16507
  sheets,
16412
16508
  thumbnailImageLoadVersion,
16413
16509
  workerThumbnailRowBatchVersion,
16510
+ locale,
16414
16511
  workbook
16415
16512
  ]);
16416
16513
  const paintThumbnail = React4.useCallback(
16417
- (sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access', _929 => _929[sheetIndex], 'optionalAccess', _930 => _930.paint, 'call', _931 => _931(canvas)]), () => ( false)),
16514
+ (sheetIndex, canvas) => _nullishCoalesce(_optionalChain([thumbnails, 'access', _944 => _944[sheetIndex], 'optionalAccess', _945 => _945.paint, 'call', _946 => _946(canvas)]), () => ( false)),
16418
16515
  [thumbnails]
16419
16516
  );
16420
16517
  return React4.useMemo(
@@ -16473,7 +16570,7 @@ var SlotStore = (_class2 = class {constructor() { _class2.prototype.__init8.call
16473
16570
  }
16474
16571
  destroy() {
16475
16572
  this.destroyed = true;
16476
- _optionalChain([this, 'access', _932 => _932.observer, 'optionalAccess', _933 => _933.disconnect, 'call', _934 => _934()]);
16573
+ _optionalChain([this, 'access', _947 => _947.observer, 'optionalAccess', _948 => _948.disconnect, 'call', _949 => _949()]);
16477
16574
  this.observer = null;
16478
16575
  this.slots.clear();
16479
16576
  this.listeners.clear();
@@ -16515,7 +16612,7 @@ function RuntimeContent({ content }) {
16515
16612
  };
16516
16613
  }, []);
16517
16614
  React5.useLayoutEffect(() => {
16518
- _optionalChain([rootRef, 'access', _935 => _935.current, 'optionalAccess', _936 => _936.update, 'call', _937 => _937(content)]);
16615
+ _optionalChain([rootRef, 'access', _950 => _950.current, 'optionalAccess', _951 => _951.update, 'call', _952 => _952(content)]);
16519
16616
  }, [content]);
16520
16617
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ref: hostRef, style: { display: "contents" } });
16521
16618
  }
@@ -16577,7 +16674,7 @@ function BoundViewer({ props, controller }) {
16577
16674
  }, [slots]);
16578
16675
  React5.useLayoutEffect(() => {
16579
16676
  const host = hostRef.current;
16580
- if (host) _optionalChain([viewerRef, 'access', _938 => _938.current, 'optionalAccess', _939 => _939.update, 'call', _940 => _940(renderOptions(props, controller, slots, host.ownerDocument))]);
16677
+ if (host) _optionalChain([viewerRef, 'access', _953 => _953.current, 'optionalAccess', _954 => _954.update, 'call', _955 => _955(renderOptions(props, controller, slots, host.ownerDocument))]);
16581
16678
  }, [controller, props, slots]);
16582
16679
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ViewerAppearanceContext.Provider, { value: {
16583
16680
  headerBackgroundColor: props.headerBackgroundColor,