@extend-ai/react-xlsx 0.24.0 → 0.24.1

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 (38) hide show
  1. package/README.md +8 -4
  2. package/dist/{chunk-DGNSB5M5.cjs → chunk-WW6G674Q.cjs} +728 -618
  3. package/dist/chunk-WW6G674Q.cjs.map +1 -0
  4. package/dist/{chunk-C4WTJIRG.js → chunk-XUHSQ3GF.js} +146 -36
  5. package/dist/chunk-XUHSQ3GF.js.map +1 -0
  6. package/dist/index.cjs +344 -234
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +9 -1
  9. package/dist/index.d.ts +9 -1
  10. package/dist/index.js +146 -36
  11. package/dist/index.js.map +1 -1
  12. package/dist/{internal-CwTqluL7.d.cts → internal-D5HReXVR.d.cts} +9 -1
  13. package/dist/{internal-CwTqluL7.d.ts → internal-D5HReXVR.d.ts} +9 -1
  14. package/dist/internal.cjs +2 -2
  15. package/dist/internal.d.cts +1 -1
  16. package/dist/internal.d.ts +1 -1
  17. package/dist/internal.js +1 -1
  18. package/dist/vanilla.cjs +2 -2
  19. package/dist/vanilla.d.cts +2 -2
  20. package/dist/vanilla.d.ts +2 -2
  21. package/dist/vanilla.js +1 -1
  22. package/dist/{workbook-runtime-QFXDLSSI.cjs → workbook-runtime-7WEPIK5Y.cjs} +41 -29
  23. package/dist/workbook-runtime-7WEPIK5Y.cjs.map +1 -0
  24. package/dist/{workbook-runtime-56Y3B64Y.js → workbook-runtime-BAAYDYYK.js} +17 -5
  25. package/dist/workbook-runtime-BAAYDYYK.js.map +1 -0
  26. package/dist/{workbook-runtime-7DSKESFL.js → workbook-runtime-FCKPXLTW.js} +17 -5
  27. package/dist/workbook-runtime-FCKPXLTW.js.map +1 -0
  28. package/dist/{workbook-runtime-MEI3CEWO.cjs → workbook-runtime-MOGSEJ5R.cjs} +41 -29
  29. package/dist/workbook-runtime-MOGSEJ5R.cjs.map +1 -0
  30. package/dist/xlsx-worker.js +16 -4
  31. package/dist/xlsx-worker.js.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/chunk-C4WTJIRG.js.map +0 -1
  34. package/dist/chunk-DGNSB5M5.cjs.map +0 -1
  35. package/dist/workbook-runtime-56Y3B64Y.js.map +0 -1
  36. package/dist/workbook-runtime-7DSKESFL.js.map +0 -1
  37. package/dist/workbook-runtime-MEI3CEWO.cjs.map +0 -1
  38. package/dist/workbook-runtime-QFXDLSSI.cjs.map +0 -1
@@ -157,6 +157,80 @@ function* bandIndices(bands) {
157
157
  }
158
158
  }
159
159
 
160
+ // src/read-only-layout.ts
161
+ function changedVisibilityRanges(existing, ranges, hidden, fromSelection) {
162
+ if (!hidden && !existing.size) return [];
163
+ let firstVisible = 0;
164
+ if (!hidden && fromSelection) {
165
+ while (existing.has(firstVisible)) firstVisible++;
166
+ }
167
+ const changed = [];
168
+ for (const range of ranges) {
169
+ const start = firstVisible > 0 && range.start === firstVisible ? 0 : range.start;
170
+ for (let index = start; index <= range.end; index++) {
171
+ if (existing.has(index) !== hidden) {
172
+ changed.push({ start, end: range.end });
173
+ break;
174
+ }
175
+ }
176
+ }
177
+ return changed;
178
+ }
179
+ function nextVisibleIndex(index, limit, isHidden) {
180
+ let next = index;
181
+ while (next < limit && isHidden(next)) next++;
182
+ if (next < limit) return next;
183
+ next = index - 1;
184
+ while (next >= 0 && isHidden(next)) next--;
185
+ return next;
186
+ }
187
+ function visibleAxis(hidden, max, originalIndices, originalSizes, overrides, defaultSize) {
188
+ const indices = [];
189
+ const sizes = [];
190
+ let offset = 0;
191
+ for (let index = 0; index <= max; index++) {
192
+ const originalSize = originalIndices[offset] === index ? originalSizes[offset++] : void 0;
193
+ if (hidden.has(index)) continue;
194
+ indices.push(index);
195
+ sizes.push(_nullishCoalesce(_nullishCoalesce(originalSize, () => ( overrides[index])), () => ( defaultSize)));
196
+ }
197
+ return { indices, sizes };
198
+ }
199
+ function applyReadOnlyLayout(sheet, layout) {
200
+ if (!layout) return sheet;
201
+ const view = { ...sheet };
202
+ if (layout.freezePanes !== void 0) view.freezePanes = layout.freezePanes;
203
+ if (layout.hiddenRows) {
204
+ const rows = visibleAxis(
205
+ layout.hiddenRows,
206
+ sheet.maxUsedRow,
207
+ sheet.visibleRows,
208
+ sheet.rowHeights,
209
+ sheet.rowHeightOverridesPx,
210
+ sheet.defaultRowHeightPx
211
+ );
212
+ view.hiddenRows = Array.from(layout.hiddenRows).sort((a, b) => a - b);
213
+ view.visibleRows = rows.indices;
214
+ view.rowHeights = rows.sizes;
215
+ view.rowCount = rows.indices.length;
216
+ }
217
+ if (layout.hiddenCols) {
218
+ const cols = visibleAxis(
219
+ layout.hiddenCols,
220
+ sheet.maxUsedCol,
221
+ sheet.visibleCols,
222
+ sheet.colWidths,
223
+ sheet.colWidthOverridesPx,
224
+ sheet.defaultColWidthPx
225
+ );
226
+ view.hiddenCols = Array.from(layout.hiddenCols).sort((a, b) => a - b);
227
+ view.visibleCols = cols.indices;
228
+ view.colWidths = cols.sizes;
229
+ view.colCount = cols.indices.length;
230
+ }
231
+ return view;
232
+ }
233
+
160
234
  // src/merged-range-lookup.ts
161
235
  function createMergedRangeLookup(ranges) {
162
236
  const normalizedRanges = [];
@@ -1072,7 +1146,7 @@ var XlsxWorkerClient = (_class = class {
1072
1146
  }
1073
1147
  async getMainRuntime() {
1074
1148
  if (this.disposed) throw createAbortError();
1075
- this.mainRuntime ??= Promise.resolve().then(() => _interopRequireWildcard(require("./workbook-runtime-QFXDLSSI.cjs"))).then(({ createWorkbookRuntime }) => createWorkbookRuntime());
1149
+ this.mainRuntime ??= Promise.resolve().then(() => _interopRequireWildcard(require("./workbook-runtime-7WEPIK5Y.cjs"))).then(({ createWorkbookRuntime }) => createWorkbookRuntime());
1076
1150
  const runtime = await this.mainRuntime;
1077
1151
  if (this.disposed) {
1078
1152
  runtime.dispose();
@@ -2048,6 +2122,8 @@ function downloadUrl(src, fileName) {
2048
2122
  }
2049
2123
  function useXlsxViewerController(options2) {
2050
2124
  const {
2125
+ allowFreezeInReadOnly = false,
2126
+ allowHideInReadOnly = false,
2051
2127
  allowResizeInReadOnly = false,
2052
2128
  deferLoadingAboveBytes = DEFAULT_DEFER_LOADING_ABOVE_BYTES,
2053
2129
  file,
@@ -2066,7 +2142,8 @@ function useXlsxViewerController(options2) {
2066
2142
  const [isLoading, setIsLoading] = _chunkZ4WMURVUcjs.d.call(void 0, Boolean(_nullishCoalesce(file, () => ( src))));
2067
2143
  const [error, setError] = _chunkZ4WMURVUcjs.d.call(void 0, null);
2068
2144
  const [workbook, setWorkbook] = _chunkZ4WMURVUcjs.d.call(void 0, null);
2069
- const [sheets, setSheets] = _chunkZ4WMURVUcjs.d.call(void 0, []);
2145
+ const [readOnlyLayouts, setReadOnlyLayouts] = _chunkZ4WMURVUcjs.d.call(void 0, {});
2146
+ const [workbookSheets, setSheets] = _chunkZ4WMURVUcjs.d.call(void 0, []);
2070
2147
  const [chartsByWorkbookSheetIndex, setChartsByWorkbookSheetIndex] = _chunkZ4WMURVUcjs.d.call(void 0, []);
2071
2148
  const [chartsheets, setChartsheets] = _chunkZ4WMURVUcjs.d.call(void 0, []);
2072
2149
  const [tabs, setTabs] = _chunkZ4WMURVUcjs.d.call(void 0, []);
@@ -2121,6 +2198,7 @@ function useXlsxViewerController(options2) {
2121
2198
  const displayFileName = _chunkZ4WMURVUcjs.T.call(void 0, () => resolveDisplayFileName(src, fileName), [fileName, src]);
2122
2199
  const shouldDeferLoading = deferLoadingAboveBytes > 0;
2123
2200
  const readOnly = requestedReadOnly || forcedReadOnly;
2201
+ const sheets = _chunkZ4WMURVUcjs.T.call(void 0, () => readOnly ? workbookSheets.map((sheet) => applyReadOnlyLayout(sheet, readOnlyLayouts[sheet.workbookSheetIndex])) : workbookSheets, [readOnly, readOnlyLayouts, workbookSheets]);
2124
2202
  const drawingMutationEpoch = _chunkZ4WMURVUcjs.A.call(void 0, 0);
2125
2203
  const drawingMutationState = _chunkZ4WMURVUcjs.A.call(void 0, { workbook, revision, readOnly, activeCell, activeSheetIndex });
2126
2204
  drawingMutationState.current = { workbook, revision, readOnly, activeCell, activeSheetIndex };
@@ -2282,6 +2360,7 @@ function useXlsxViewerController(options2) {
2282
2360
  }, [disposeWorkerClient]);
2283
2361
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
2284
2362
  loadGenerationRef.current += 1;
2363
+ setReadOnlyLayouts({});
2285
2364
  if (!file && !src) {
2286
2365
  disposeWorkerClient();
2287
2366
  setForcedReadOnly(false);
@@ -3573,28 +3652,50 @@ function useXlsxViewerController(options2) {
3573
3652
  }));
3574
3653
  setRevision((current) => current + 1);
3575
3654
  }, [activeSheet]);
3655
+ const canChangeVisibility = Boolean(activeSheet && !isLoading && (readOnly ? allowHideInReadOnly : workbook));
3656
+ const canChangeFreezePanes = Boolean(activeSheet && !isLoading && (readOnly ? allowFreezeInReadOnly : workbook));
3657
+ const activeLayout = activeSheet && readOnly ? readOnlyLayouts[activeSheet.workbookSheetIndex] : void 0;
3658
+ _chunkZ4WMURVUcjs.h.call(void 0, () => {
3659
+ if (!activeCell || !activeLayout) return;
3660
+ const { hiddenRows, hiddenCols } = activeLayout;
3661
+ const row3 = _optionalChain([hiddenRows, 'optionalAccess', _347 => _347.has, 'call', _348 => _348(activeCell.row)]) ? nextVisibleIndex(activeCell.row, _chunkGP5SOQQHcjs.XLSX_MAX_ROWS, (index) => hiddenRows.has(index)) : activeCell.row;
3662
+ const col = _optionalChain([hiddenCols, 'optionalAccess', _349 => _349.has, 'call', _350 => _350(activeCell.col)]) ? nextVisibleIndex(activeCell.col, _chunkGP5SOQQHcjs.XLSX_MAX_COLUMNS, (index) => hiddenCols.has(index)) : activeCell.col;
3663
+ if (row3 === activeCell.row && col === activeCell.col) return;
3664
+ const cell = row3 < 0 || col < 0 ? null : { row: row3, col };
3665
+ setActiveCell(cell);
3666
+ setSelection(cell && { start: cell, end: cell });
3667
+ selectionAnchorRef.current = cell;
3668
+ }, [activeCell, activeLayout, setSelection]);
3576
3669
  const setAxisHidden = _chunkZ4WMURVUcjs.q.call(void 0, (axis, hidden, start, end = start) => {
3577
- if (readOnly || !workbook || !activeSheet) return;
3670
+ if (!canChangeVisibility || !activeSheet) return;
3578
3671
  const limit = axis === "row" ? _chunkGP5SOQQHcjs.XLSX_MAX_ROWS : _chunkGP5SOQQHcjs.XLSX_MAX_COLUMNS;
3579
- const ranges = start === void 0 && end === void 0 ? selectionRanges.map((area) => ({ start: area.start[axis], end: area.end[axis] })) : [{ start: _nullishCoalesce(start, () => ( -1)), end: _nullishCoalesce(end, () => ( -1)) }];
3672
+ const fromSelection = start === void 0 && end === void 0;
3673
+ const ranges = fromSelection ? selectionRanges.map((area) => ({ start: area.start[axis], end: area.end[axis] })) : [{ start: _nullishCoalesce(start, () => ( -1)), end: _nullishCoalesce(end, () => ( -1)) }];
3580
3674
  if (!ranges.length || ranges.some((range) => !Number.isInteger(range.start) || !Number.isInteger(range.end) || range.start < 0 || range.end < range.start || range.end >= limit)) return;
3581
- const worksheet = workbook.getSheet(activeSheet.workbookSheetIndex);
3582
- try {
3583
- const existing = new Set(axis === "row" ? worksheet.hiddenRows : worksheet.hiddenColumns);
3584
- if (!hidden && !existing.size) return;
3585
- if (!hidden && start === void 0 && existing.has(0)) {
3586
- let firstVisible = 0;
3587
- while (existing.has(firstVisible)) firstVisible++;
3588
- for (const range of ranges) {
3589
- if (range.start === firstVisible) range.start = 0;
3590
- }
3591
- }
3592
- const changes = ranges.filter((range) => {
3593
- for (let index = range.start; index <= range.end; index++) {
3594
- if (existing.has(index) !== hidden) return true;
3675
+ const sheetIndex = activeSheet.workbookSheetIndex;
3676
+ if (readOnly) {
3677
+ const key = axis === "row" ? "hiddenRows" : "hiddenCols";
3678
+ setReadOnlyLayouts((current) => {
3679
+ const layout = current[sheetIndex];
3680
+ const existing = _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _351 => _351[key]]), () => ( new Set(activeSheet[key])));
3681
+ const changes = changedVisibilityRanges(existing, ranges, hidden, fromSelection);
3682
+ if (!changes.length) return current;
3683
+ const next = new Set(existing);
3684
+ for (const range of changes) {
3685
+ for (let index = range.start; index <= range.end; index++) {
3686
+ if (hidden) next.add(index);
3687
+ else next.delete(index);
3688
+ }
3595
3689
  }
3596
- return false;
3690
+ return { ...current, [sheetIndex]: { ...layout, [key]: next } };
3597
3691
  });
3692
+ return;
3693
+ }
3694
+ if (!workbook) return;
3695
+ const worksheet = workbook.getSheet(sheetIndex);
3696
+ try {
3697
+ const existing = new Set(axis === "row" ? worksheet.hiddenRows : worksheet.hiddenColumns);
3698
+ const changes = changedVisibilityRanges(existing, ranges, hidden, fromSelection);
3598
3699
  if (!changes.length) return;
3599
3700
  recordHistoryBeforeMutation();
3600
3701
  for (const range of changes) {
@@ -3602,13 +3703,11 @@ function useXlsxViewerController(options2) {
3602
3703
  else worksheet.setColumnsHidden(range.start, range.end, hidden);
3603
3704
  }
3604
3705
  if (hidden && activeCell && changes.some((range) => range.start <= activeCell[axis] && activeCell[axis] <= range.end)) {
3605
- const isHidden = (index2) => axis === "row" ? worksheet.isRowHidden(index2) : worksheet.isColumnHidden(index2);
3606
- let index = activeCell[axis];
3607
- while (index < limit && isHidden(index)) index++;
3608
- if (index === limit) {
3609
- index = activeCell[axis] - 1;
3610
- while (index >= 0 && isHidden(index)) index--;
3611
- }
3706
+ const index = nextVisibleIndex(
3707
+ activeCell[axis],
3708
+ limit,
3709
+ (value) => axis === "row" ? worksheet.isRowHidden(value) : worksheet.isColumnHidden(value)
3710
+ );
3612
3711
  if (index >= 0) {
3613
3712
  const cell = { ...activeCell, [axis]: index };
3614
3713
  setActiveCell(cell);
@@ -3620,28 +3719,35 @@ function useXlsxViewerController(options2) {
3620
3719
  } finally {
3621
3720
  worksheet.free();
3622
3721
  }
3623
- }, [activeCell, activeSheet, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, selectionRanges, setSelection, workbook]);
3722
+ }, [activeCell, activeSheet, canChangeVisibility, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, selectionRanges, setSelection, workbook]);
3624
3723
  const hideRows = _chunkZ4WMURVUcjs.q.call(void 0, (start, end) => setAxisHidden("row", true, start, end), [setAxisHidden]);
3625
3724
  const unhideRows = _chunkZ4WMURVUcjs.q.call(void 0, (start, end) => setAxisHidden("row", false, start, end), [setAxisHidden]);
3626
3725
  const hideColumns = _chunkZ4WMURVUcjs.q.call(void 0, (start, end) => setAxisHidden("col", true, start, end), [setAxisHidden]);
3627
3726
  const unhideColumns = _chunkZ4WMURVUcjs.q.call(void 0, (start, end) => setAxisHidden("col", false, start, end), [setAxisHidden]);
3628
3727
  const setFreezeBoundary = _chunkZ4WMURVUcjs.q.call(void 0, (cell) => {
3629
- if (readOnly || !workbook || !activeSheet) return;
3728
+ if (!canChangeFreezePanes || !activeSheet) return;
3630
3729
  const { row: row3, col } = cell;
3631
3730
  if (!Number.isInteger(row3) || row3 < 0 || row3 >= _chunkGP5SOQQHcjs.XLSX_MAX_ROWS || !Number.isInteger(col) || col < 0 || col >= _chunkGP5SOQQHcjs.XLSX_MAX_COLUMNS) return;
3632
- const worksheet = workbook.getSheet(activeSheet.workbookSheetIndex);
3731
+ const sheetIndex = activeSheet.workbookSheetIndex;
3732
+ if (readOnly) {
3733
+ const freezePanes2 = row3 || col ? { row: row3, col } : null;
3734
+ setReadOnlyLayouts((current) => ({ ...current, [sheetIndex]: { ...current[sheetIndex], freezePanes: freezePanes2 } }));
3735
+ return;
3736
+ }
3737
+ if (!workbook) return;
3738
+ const worksheet = workbook.getSheet(sheetIndex);
3633
3739
  try {
3634
3740
  const current = parseWorksheetFreezePanes(worksheet);
3635
- if (row3 === (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _347 => _347.row]), () => ( 0))) && col === (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _348 => _348.col]), () => ( 0)))) return;
3741
+ if (row3 === (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _352 => _352.row]), () => ( 0))) && col === (_nullishCoalesce(_optionalChain([current, 'optionalAccess', _353 => _353.col]), () => ( 0)))) return;
3636
3742
  recordHistoryBeforeMutation();
3637
3743
  worksheet.setFreezePanes(row3, col);
3638
3744
  refreshWorkbookState(workbook);
3639
3745
  } finally {
3640
3746
  worksheet.free();
3641
3747
  }
3642
- }, [activeSheet, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
3748
+ }, [activeSheet, canChangeFreezePanes, readOnly, recordHistoryBeforeMutation, refreshWorkbookState, workbook]);
3643
3749
  const freezeCell = resolveFreezePanesCell(activeCell, selection);
3644
- const canFreezePanes = Boolean(!readOnly && workbook && activeSheet && freezeCell && (freezeCell.row > 0 || freezeCell.col > 0));
3750
+ const canFreezePanes = Boolean(canChangeFreezePanes && freezeCell && (freezeCell.row > 0 || freezeCell.col > 0));
3645
3751
  const freezePanes = _chunkZ4WMURVUcjs.q.call(void 0, (cell = freezeCell) => {
3646
3752
  if (cell) setFreezeBoundary(cell);
3647
3753
  }, [freezeCell, setFreezeBoundary]);
@@ -3722,10 +3828,10 @@ function useXlsxViewerController(options2) {
3722
3828
  const nextAnchor = _chunkGP5SOQQHcjs.rectToImageAnchor.call(void 0, rect, currentChart.anchor, {
3723
3829
  contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
3724
3830
  contentOffsetTop: GRID_HEADER_HEIGHT,
3725
- getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _349 => _349.columnWidths, 'access', _350 => _350[col]]), () => ( getColumnWidthPx(worksheet, col))),
3726
- getRowHeightPx: (row3) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _351 => _351.rowHeights, 'access', _352 => _352[row3]]), () => ( getRowHeightPx(worksheet, row3)))
3831
+ getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _354 => _354.columnWidths, 'access', _355 => _355[col]]), () => ( getColumnWidthPx(worksheet, col))),
3832
+ getRowHeightPx: (row3) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _356 => _356.rowHeights, 'access', _357 => _357[row3]]), () => ( getRowHeightPx(worksheet, row3)))
3727
3833
  });
3728
- if (_optionalChain([currentChart, 'access', _353 => _353.raw, 'optionalAccess', _354 => _354.pivotSource]) && currentChart.name) {
3834
+ if (_optionalChain([currentChart, 'access', _358 => _358.raw, 'optionalAccess', _359 => _359.pivotSource]) && currentChart.name) {
3729
3835
  commitPivotMutation((target) => _chunkGP5SOQQHcjs.pivotWorkbook.call(void 0, target).updatePivotChart(worksheet.name, currentChart.name, {
3730
3836
  anchor: _chunkGP5SOQQHcjs.xlsxAnchorToDukeDrawingAnchor.call(void 0, nextAnchor)
3731
3837
  }), false);
@@ -3761,8 +3867,8 @@ function useXlsxViewerController(options2) {
3761
3867
  const nextAnchor = _chunkGP5SOQQHcjs.rectToImageAnchor.call(void 0, rect, currentImage.anchor, {
3762
3868
  contentOffsetLeft: GRID_ROW_HEADER_WIDTH,
3763
3869
  contentOffsetTop: GRID_HEADER_HEIGHT,
3764
- getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _355 => _355.columnWidths, 'access', _356 => _356[col]]), () => ( getColumnWidthPx(worksheet, col))),
3765
- getRowHeightPx: (row3) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _357 => _357.rowHeights, 'access', _358 => _358[row3]]), () => ( getRowHeightPx(worksheet, row3)))
3870
+ getColumnWidthPx: (col) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _360 => _360.columnWidths, 'access', _361 => _361[col]]), () => ( getColumnWidthPx(worksheet, col))),
3871
+ getRowHeightPx: (row3) => _nullishCoalesce(_optionalChain([layout, 'optionalAccess', _362 => _362.rowHeights, 'access', _363 => _363[row3]]), () => ( getRowHeightPx(worksheet, row3)))
3766
3872
  });
3767
3873
  recordHistoryBeforeMutation();
3768
3874
  if (!_chunkGP5SOQQHcjs.updateWorkbookImageAnchor.call(void 0, imageAssetsRef.current, id, nextAnchor)) {
@@ -3927,12 +4033,12 @@ function useXlsxViewerController(options2) {
3927
4033
  setSelectedChartId(null);
3928
4034
  setSelectedChartElement(null);
3929
4035
  if (target.kind === "chart") {
3930
- const chart = _optionalChain([chartAssetsRef, 'access', _359 => _359.current, 'optionalAccess', _360 => _360.chartsByWorkbookSheetIndex, 'access', _361 => _361.flat, 'call', _362 => _362(), 'access', _363 => _363.find, 'call', _364 => _364((chart2) => target.path ? chart2.chartPath === target.path : chart2.name === target.name)]);
3931
- setSelectedChartId(_nullishCoalesce(_optionalChain([chart, 'optionalAccess', _365 => _365.id]), () => ( null)));
4036
+ const chart = _optionalChain([chartAssetsRef, 'access', _364 => _364.current, 'optionalAccess', _365 => _365.chartsByWorkbookSheetIndex, 'access', _366 => _366.flat, 'call', _367 => _367(), 'access', _368 => _368.find, 'call', _369 => _369((chart2) => target.path ? chart2.chartPath === target.path : chart2.name === target.name)]);
4037
+ setSelectedChartId(_nullishCoalesce(_optionalChain([chart, 'optionalAccess', _370 => _370.id]), () => ( null)));
3932
4038
  setSelectedChartElement(chart ? { kind: "chart", chartId: chart.id } : null);
3933
4039
  } else if (target.kind === "image") {
3934
- const image = _optionalChain([nextAssets, 'optionalAccess', _366 => _366.imagesByWorkbookSheetIndex, 'access', _367 => _367.flat, 'call', _368 => _368(), 'access', _369 => _369.find, 'call', _370 => _370((image2) => image2.name === target.name)]);
3935
- setSelectedImageId(_nullishCoalesce(_optionalChain([image, 'optionalAccess', _371 => _371.id]), () => ( null)));
4040
+ const image = _optionalChain([nextAssets, 'optionalAccess', _371 => _371.imagesByWorkbookSheetIndex, 'access', _372 => _372.flat, 'call', _373 => _373(), 'access', _374 => _374.find, 'call', _375 => _375((image2) => image2.name === target.name)]);
4041
+ setSelectedImageId(_nullishCoalesce(_optionalChain([image, 'optionalAccess', _376 => _376.id]), () => ( null)));
3936
4042
  }
3937
4043
  return true;
3938
4044
  } catch (cause) {
@@ -3959,7 +4065,7 @@ function useXlsxViewerController(options2) {
3959
4065
  const generation = loadGenerationRef.current;
3960
4066
  const data = input === void 0 ? (await readBrowserClipboard()).drawing : typeof input === "string" ? decodeExcelDrawingClipboard(input) : input.type.startsWith("image/") ? await imageDrawingClipboard(input) : decodeExcelDrawingClipboard(new Uint8Array(await input.arrayBuffer()));
3961
4067
  const latest = drawingMutationState.current;
3962
- if (!data || generation !== loadGenerationRef.current || latest.workbook !== state.workbook || latest.revision !== state.revision || latest.readOnly || latest.activeSheetIndex !== state.activeSheetIndex || _optionalChain([latest, 'access', _372 => _372.activeCell, 'optionalAccess', _373 => _373.row]) !== _optionalChain([state, 'access', _374 => _374.activeCell, 'optionalAccess', _375 => _375.row]) || _optionalChain([latest, 'access', _376 => _376.activeCell, 'optionalAccess', _377 => _377.col]) !== _optionalChain([state, 'access', _378 => _378.activeCell, 'optionalAccess', _379 => _379.col])) return false;
4068
+ if (!data || generation !== loadGenerationRef.current || latest.workbook !== state.workbook || latest.revision !== state.revision || latest.readOnly || latest.activeSheetIndex !== state.activeSheetIndex || _optionalChain([latest, 'access', _377 => _377.activeCell, 'optionalAccess', _378 => _378.row]) !== _optionalChain([state, 'access', _379 => _379.activeCell, 'optionalAccess', _380 => _380.row]) || _optionalChain([latest, 'access', _381 => _381.activeCell, 'optionalAccess', _382 => _382.col]) !== _optionalChain([state, 'access', _383 => _383.activeCell, 'optionalAccess', _384 => _384.col])) return false;
3963
4069
  return pasteDrawing(data);
3964
4070
  }, [activeSheet, pasteDrawing, readOnly, workbook]);
3965
4071
  const arrangeDrawing = _chunkZ4WMURVUcjs.q.call(void 0, async (kind, id, order) => {
@@ -3998,7 +4104,7 @@ function useXlsxViewerController(options2) {
3998
4104
  const chart = getChartById(id);
3999
4105
  const option = chartTypeOptions.find((option2) => option2.id === type);
4000
4106
  if (readOnly || !chart || !option || chartTypeUnavailable(chart, option)) return false;
4001
- if (_optionalChain([chart, 'access', _380 => _380.raw, 'optionalAccess', _381 => _381.pivotSource])) {
4107
+ if (_optionalChain([chart, 'access', _385 => _385.raw, 'optionalAccess', _386 => _386.pivotSource])) {
4002
4108
  if (!workbook || !chart.name) return false;
4003
4109
  commitPivotMutation((target) => _chunkGP5SOQQHcjs.pivotWorkbook.call(void 0, target).updatePivotChart(workbook.getSheet(chart.workbookSheetIndex).name, chart.name, { chartType: option.chartType }), false);
4004
4110
  return true;
@@ -4034,7 +4140,7 @@ function useXlsxViewerController(options2) {
4034
4140
  if (readOnly || !currentChart) {
4035
4141
  return;
4036
4142
  }
4037
- if (_optionalChain([currentChart, 'access', _382 => _382.raw, 'optionalAccess', _383 => _383.pivotSource])) {
4143
+ if (_optionalChain([currentChart, 'access', _387 => _387.raw, 'optionalAccess', _388 => _388.pivotSource])) {
4038
4144
  if (!workbook || !currentChart.name) return;
4039
4145
  if (Object.keys(patch).some((key) => !["title", "chartType", "anchor"].includes(key))) {
4040
4146
  throw new Error("Change PivotChart data through the pivot table field settings.");
@@ -4066,7 +4172,7 @@ function useXlsxViewerController(options2) {
4066
4172
  return false;
4067
4173
  }
4068
4174
  const chart = getChartById(chartId);
4069
- if (!chart || chart.editable === false || _optionalChain([chart, 'access', _384 => _384.raw, 'optionalAccess', _385 => _385.pivotSource])) {
4175
+ if (!chart || chart.editable === false || _optionalChain([chart, 'access', _389 => _389.raw, 'optionalAccess', _390 => _390.pivotSource])) {
4070
4176
  return false;
4071
4177
  }
4072
4178
  const nextChart = _chunkGP5SOQQHcjs.applyChartSeriesFormula.call(void 0, chart, seriesIndex, formula, workbook);
@@ -4088,35 +4194,35 @@ function useXlsxViewerController(options2) {
4088
4194
  }
4089
4195
  return true;
4090
4196
  }, [getChartById, readOnly, updateChart, workbook]);
4091
- const findSelectionMerge = _chunkZ4WMURVUcjs.T.call(void 0, () => createMergedRangeLookup(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _386 => _386.mergedRanges]), () => ( []))), [_optionalChain([activeSheet, 'optionalAccess', _387 => _387.mergedRanges])]);
4197
+ const findSelectionMerge = _chunkZ4WMURVUcjs.T.call(void 0, () => createMergedRangeLookup(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _391 => _391.mergedRanges]), () => ( []))), [_optionalChain([activeSheet, 'optionalAccess', _392 => _392.mergedRanges])]);
4092
4198
  const selectCell = _chunkZ4WMURVUcjs.q.call(void 0, (cell, options3) => {
4093
4199
  const merged = findSelectionMerge(cell);
4094
- const anchorCell = _nullishCoalesce(_optionalChain([merged, 'optionalAccess', _388 => _388.start]), () => ( cell));
4200
+ const anchorCell = _nullishCoalesce(_optionalChain([merged, 'optionalAccess', _393 => _393.start]), () => ( cell));
4095
4201
  setSelectedChartId(null);
4096
4202
  setSelectedChartElement(null);
4097
4203
  setSelectedImageId(null);
4098
4204
  setActiveCell(anchorCell);
4099
- if (_optionalChain([options3, 'optionalAccess', _389 => _389.extend]) && selectionAnchorRef.current) {
4100
- setSelection(expandHighlightedRange(normalizeRange({ start: selectionAnchorRef.current, end: cell }), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _390 => _390.mergedRanges]), () => ( []))));
4205
+ if (_optionalChain([options3, 'optionalAccess', _394 => _394.extend]) && selectionAnchorRef.current) {
4206
+ setSelection(expandHighlightedRange(normalizeRange({ start: selectionAnchorRef.current, end: cell }), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _395 => _395.mergedRanges]), () => ( []))));
4101
4207
  return;
4102
4208
  }
4103
4209
  selectionAnchorRef.current = anchorCell;
4104
4210
  setSelection(_nullishCoalesce(merged, () => ( { start: cell, end: cell })));
4105
- }, [_optionalChain([activeSheet, 'optionalAccess', _391 => _391.mergedRanges]), findSelectionMerge]);
4211
+ }, [_optionalChain([activeSheet, 'optionalAccess', _396 => _396.mergedRanges]), findSelectionMerge]);
4106
4212
  const selectRanges = _chunkZ4WMURVUcjs.q.call(void 0, (ranges, activeCorner = "end") => {
4107
4213
  const areas = ranges.reduce((previous, range) => addSelectionRange(previous, normalizeRange(range)), []);
4108
4214
  const active = areas.at(-1);
4109
4215
  setSelectedChartId(null);
4110
4216
  setSelectedChartElement(null);
4111
4217
  setSelectedImageId(null);
4112
- selectionAnchorRef.current = _nullishCoalesce(_optionalChain([active, 'optionalAccess', _392 => _392.start]), () => ( null));
4113
- const cell = _optionalChain([active, 'optionalAccess', _393 => _393[activeCorner]]);
4114
- setActiveCell(cell ? _nullishCoalesce(_optionalChain([findSelectionMerge, 'call', _394 => _394(cell), 'optionalAccess', _395 => _395.start]), () => ( cell)) : null);
4218
+ selectionAnchorRef.current = _nullishCoalesce(_optionalChain([active, 'optionalAccess', _397 => _397.start]), () => ( null));
4219
+ const cell = _optionalChain([active, 'optionalAccess', _398 => _398[activeCorner]]);
4220
+ setActiveCell(cell ? _nullishCoalesce(_optionalChain([findSelectionMerge, 'call', _399 => _399(cell), 'optionalAccess', _400 => _400.start]), () => ( cell)) : null);
4115
4221
  setSelectionRanges(areas);
4116
4222
  }, [findSelectionMerge]);
4117
4223
  const selectRange = _chunkZ4WMURVUcjs.q.call(void 0, (range) => {
4118
- selectRanges([expandHighlightedRange(normalizeRange(range), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _396 => _396.mergedRanges]), () => ( [])))]);
4119
- }, [_optionalChain([activeSheet, 'optionalAccess', _397 => _397.mergedRanges]), selectRanges]);
4224
+ selectRanges([expandHighlightedRange(normalizeRange(range), _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _401 => _401.mergedRanges]), () => ( [])))]);
4225
+ }, [_optionalChain([activeSheet, 'optionalAccess', _402 => _402.mergedRanges]), selectRanges]);
4120
4226
  const clearSelection = _chunkZ4WMURVUcjs.q.call(void 0, () => {
4121
4227
  selectionAnchorRef.current = null;
4122
4228
  setActiveCell(null);
@@ -4265,7 +4371,7 @@ function useXlsxViewerController(options2) {
4265
4371
  setCellFormula(activeCell, formula);
4266
4372
  }, [activeCell, setCellFormula]);
4267
4373
  const setSelectedFormula = _chunkZ4WMURVUcjs.q.call(void 0, (formula) => {
4268
- if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _398 => _398.kind]) === "chartSeries") {
4374
+ if (_optionalChain([selectedFormulaTarget, 'optionalAccess', _403 => _403.kind]) === "chartSeries") {
4269
4375
  return setChartSeriesFormula(selectedFormulaTarget.chartId, selectedFormulaTarget.seriesIndex, formula);
4270
4376
  }
4271
4377
  if (readOnly || !activeCell || getPivotTableAtCell(activeCell)) {
@@ -4432,7 +4538,7 @@ function useXlsxViewerController(options2) {
4432
4538
  return;
4433
4539
  }
4434
4540
  recordHistoryBeforeMutation();
4435
- const baseName = _optionalChain([name, 'optionalAccess', _399 => _399.trim, 'call', _400 => _400()]) || "Sheet";
4541
+ const baseName = _optionalChain([name, 'optionalAccess', _404 => _404.trim, 'call', _405 => _405()]) || "Sheet";
4436
4542
  let candidate = baseName;
4437
4543
  let counter = 2;
4438
4544
  while (workbook.sheetIndex(candidate) !== void 0) {
@@ -4452,11 +4558,11 @@ function useXlsxViewerController(options2) {
4452
4558
  }
4453
4559
  const nextSheets = buildSheetList(
4454
4560
  workbook,
4455
- _optionalChain([imageAssetsRef, 'access', _401 => _401.current, 'optionalAccess', _402 => _402.sheetStatesByWorkbookSheetIndex]),
4456
- _optionalChain([imageAssetsRef, 'access', _403 => _403.current, 'optionalAccess', _404 => _404.themePalette]),
4457
- _optionalChain([imageAssetsRef, 'access', _405 => _405.current, 'optionalAccess', _406 => _406.styleById]),
4458
- _optionalChain([imageAssetsRef, 'access', _407 => _407.current, 'optionalAccess', _408 => _408.namedCellStyleByName]),
4459
- _optionalChain([imageAssetsRef, 'access', _409 => _409.current, 'optionalAccess', _410 => _410.tableStyleByName]),
4561
+ _optionalChain([imageAssetsRef, 'access', _406 => _406.current, 'optionalAccess', _407 => _407.sheetStatesByWorkbookSheetIndex]),
4562
+ _optionalChain([imageAssetsRef, 'access', _408 => _408.current, 'optionalAccess', _409 => _409.themePalette]),
4563
+ _optionalChain([imageAssetsRef, 'access', _410 => _410.current, 'optionalAccess', _411 => _411.styleById]),
4564
+ _optionalChain([imageAssetsRef, 'access', _412 => _412.current, 'optionalAccess', _413 => _413.namedCellStyleByName]),
4565
+ _optionalChain([imageAssetsRef, 'access', _414 => _414.current, 'optionalAccess', _415 => _415.tableStyleByName]),
4460
4566
  showHiddenSheets
4461
4567
  );
4462
4568
  setSheets(nextSheets);
@@ -4466,7 +4572,7 @@ function useXlsxViewerController(options2) {
4466
4572
  }
4467
4573
  const nextIndex = nextSheets.findIndex((sheet) => sheet.name === candidate);
4468
4574
  setActiveSheetIndexState(nextIndex >= 0 ? nextIndex : 0);
4469
- const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess', _411 => _411.tabs, 'access', _412 => _412.findIndex, 'call', _413 => _413((tab) => tab.kind === "sheet" && tab.name === candidate)]), () => ( -1));
4575
+ const nextTabIndex = _nullishCoalesce(_optionalChain([nextChartAssets, 'optionalAccess', _416 => _416.tabs, 'access', _417 => _417.findIndex, 'call', _418 => _418((tab) => tab.kind === "sheet" && tab.name === candidate)]), () => ( -1));
4470
4576
  if (nextTabIndex >= 0) {
4471
4577
  setActiveTabIndexState(nextTabIndex);
4472
4578
  }
@@ -4493,11 +4599,11 @@ function useXlsxViewerController(options2) {
4493
4599
  }
4494
4600
  const nextSheets = buildSheetList(
4495
4601
  workbook,
4496
- _optionalChain([imageAssetsRef, 'access', _414 => _414.current, 'optionalAccess', _415 => _415.sheetStatesByWorkbookSheetIndex]),
4497
- _optionalChain([imageAssetsRef, 'access', _416 => _416.current, 'optionalAccess', _417 => _417.themePalette]),
4498
- _optionalChain([imageAssetsRef, 'access', _418 => _418.current, 'optionalAccess', _419 => _419.styleById]),
4499
- _optionalChain([imageAssetsRef, 'access', _420 => _420.current, 'optionalAccess', _421 => _421.namedCellStyleByName]),
4500
- _optionalChain([imageAssetsRef, 'access', _422 => _422.current, 'optionalAccess', _423 => _423.tableStyleByName]),
4602
+ _optionalChain([imageAssetsRef, 'access', _419 => _419.current, 'optionalAccess', _420 => _420.sheetStatesByWorkbookSheetIndex]),
4603
+ _optionalChain([imageAssetsRef, 'access', _421 => _421.current, 'optionalAccess', _422 => _422.themePalette]),
4604
+ _optionalChain([imageAssetsRef, 'access', _423 => _423.current, 'optionalAccess', _424 => _424.styleById]),
4605
+ _optionalChain([imageAssetsRef, 'access', _425 => _425.current, 'optionalAccess', _426 => _426.namedCellStyleByName]),
4606
+ _optionalChain([imageAssetsRef, 'access', _427 => _427.current, 'optionalAccess', _428 => _428.tableStyleByName]),
4501
4607
  showHiddenSheets
4502
4608
  );
4503
4609
  setSheets(nextSheets);
@@ -4525,7 +4631,7 @@ function useXlsxViewerController(options2) {
4525
4631
  }, [readOnly, recordHistoryBeforeMutation, selection, selectionRanges, workbook]);
4526
4632
  const pasteText = _chunkZ4WMURVUcjs.q.call(void 0, (text) => {
4527
4633
  const worksheet = getActiveWorksheet();
4528
- const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _424 => _424.start]))), () => ( null));
4634
+ const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _429 => _429.start]))), () => ( null));
4529
4635
  if (readOnly || !worksheet || !workbook || !targetCell || selectionRanges.length > 1 || !text) {
4530
4636
  return false;
4531
4637
  }
@@ -4594,7 +4700,7 @@ function useXlsxViewerController(options2) {
4594
4700
  }, [intersectsPivot, activeCell, captureCellMutationState, getActiveWorksheet, locale, maybeRecalculateWorkbook, readOnly, recordRangeEditHistory, refreshWorkbookState, selection, selectionRanges, workbook]);
4595
4701
  const pasteStructuredClipboardData = _chunkZ4WMURVUcjs.q.call(void 0, (serializedPayload) => {
4596
4702
  const worksheet = getActiveWorksheet();
4597
- const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _425 => _425.start]))), () => ( null));
4703
+ const targetCell = _nullishCoalesce(_nullishCoalesce(activeCell, () => ( _optionalChain([selection, 'optionalAccess', _430 => _430.start]))), () => ( null));
4598
4704
  if (readOnly || !worksheet || !workbook || !targetCell || selectionRanges.length > 1 || !serializedPayload) {
4599
4705
  return false;
4600
4706
  }
@@ -4773,7 +4879,7 @@ function useXlsxViewerController(options2) {
4773
4879
  const generation = loadGenerationRef.current;
4774
4880
  const data = await readBrowserClipboard(clipboardData);
4775
4881
  const latest = drawingMutationState.current;
4776
- if (generation !== loadGenerationRef.current || latest.workbook !== state.workbook || latest.revision !== state.revision || latest.readOnly || latest.activeSheetIndex !== state.activeSheetIndex || _optionalChain([latest, 'access', _426 => _426.activeCell, 'optionalAccess', _427 => _427.row]) !== _optionalChain([state, 'access', _428 => _428.activeCell, 'optionalAccess', _429 => _429.row]) || _optionalChain([latest, 'access', _430 => _430.activeCell, 'optionalAccess', _431 => _431.col]) !== _optionalChain([state, 'access', _432 => _432.activeCell, 'optionalAccess', _433 => _433.col])) return false;
4882
+ if (generation !== loadGenerationRef.current || latest.workbook !== state.workbook || latest.revision !== state.revision || latest.readOnly || latest.activeSheetIndex !== state.activeSheetIndex || _optionalChain([latest, 'access', _431 => _431.activeCell, 'optionalAccess', _432 => _432.row]) !== _optionalChain([state, 'access', _433 => _433.activeCell, 'optionalAccess', _434 => _434.row]) || _optionalChain([latest, 'access', _435 => _435.activeCell, 'optionalAccess', _436 => _436.col]) !== _optionalChain([state, 'access', _437 => _437.activeCell, 'optionalAccess', _438 => _438.col])) return false;
4777
4883
  if (data.drawing) return pasteDrawing(data.drawing);
4778
4884
  if (data.structured && pasteStructuredClipboardData(data.structured)) return true;
4779
4885
  return Boolean(data.text) && pasteText(data.text);
@@ -4931,7 +5037,9 @@ function useXlsxViewerController(options2) {
4931
5037
  revision,
4932
5038
  resizeChartBy,
4933
5039
  resizeImageBy,
4934
- frozenPanes: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _434 => _434.freezePanes]), () => ( null)),
5040
+ frozenPanes: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _439 => _439.freezePanes]), () => ( null)),
5041
+ canChangeFreezePanes,
5042
+ canChangeVisibility,
4935
5043
  canFreezePanes,
4936
5044
  hideRows,
4937
5045
  unhideRows,
@@ -5084,6 +5192,8 @@ function useXlsxViewerController(options2) {
5084
5192
  revision,
5085
5193
  resizeChartBy,
5086
5194
  resizeImageBy,
5195
+ canChangeFreezePanes,
5196
+ canChangeVisibility,
5087
5197
  canFreezePanes,
5088
5198
  hideRows,
5089
5199
  unhideRows,
@@ -5169,8 +5279,8 @@ function visibleOverlayRect(element, clipElement) {
5169
5279
  const win = element.ownerDocument.defaultView;
5170
5280
  let left = Math.max(0, rect.left);
5171
5281
  let top = Math.max(0, rect.top);
5172
- let right = Math.min(_nullishCoalesce(_optionalChain([win, 'optionalAccess', _435 => _435.innerWidth]), () => ( Infinity)), rect.right);
5173
- let bottom = Math.min(_nullishCoalesce(_optionalChain([win, 'optionalAccess', _436 => _436.innerHeight]), () => ( Infinity)), rect.bottom);
5282
+ let right = Math.min(_nullishCoalesce(_optionalChain([win, 'optionalAccess', _440 => _440.innerWidth]), () => ( Infinity)), rect.right);
5283
+ let bottom = Math.min(_nullishCoalesce(_optionalChain([win, 'optionalAccess', _441 => _441.innerHeight]), () => ( Infinity)), rect.bottom);
5174
5284
  if (clipElement) {
5175
5285
  const clip = clipElement.getBoundingClientRect();
5176
5286
  left = Math.max(left, clip.left);
@@ -5179,7 +5289,7 @@ function visibleOverlayRect(element, clipElement) {
5179
5289
  bottom = Math.min(bottom, clip.bottom);
5180
5290
  }
5181
5291
  for (let parent = element.parentElement; parent; parent = parent.parentElement) {
5182
- const style = _optionalChain([win, 'optionalAccess', _437 => _437.getComputedStyle, 'call', _438 => _438(parent)]);
5292
+ const style = _optionalChain([win, 'optionalAccess', _442 => _442.getComputedStyle, 'call', _443 => _443(parent)]);
5183
5293
  if (!style) continue;
5184
5294
  const bounds = parent.getBoundingClientRect();
5185
5295
  if (/auto|scroll|hidden|clip/.test(style.overflowX)) {
@@ -6734,7 +6844,7 @@ function resolveCellTextClipOverscan(overscan, usesWrappedText) {
6734
6844
 
6735
6845
  // src/scroll-display-limit.ts
6736
6846
  function minimumVisibleExtent(minimum, sortedHidden, maximum) {
6737
- if (!_optionalChain([sortedHidden, 'optionalAccess', _439 => _439.length]) || sortedHidden.length === maximum) return minimum;
6847
+ if (!_optionalChain([sortedHidden, 'optionalAccess', _444 => _444.length]) || sortedHidden.length === maximum) return minimum;
6738
6848
  let extent = minimum;
6739
6849
  for (const index of sortedHidden) {
6740
6850
  if (index >= extent || extent >= maximum) break;
@@ -6778,8 +6888,8 @@ function CellEditor({
6778
6888
  const [bounds, setBounds] = _chunkZ4WMURVUcjs.d.call(void 0, { width: 0, height: 0, cellWidth: 0 });
6779
6889
  _chunkZ4WMURVUcjs._.call(void 0, () => {
6780
6890
  const root = rootRef.current;
6781
- const anchor = _optionalChain([root, 'optionalAccess', _440 => _440.parentElement]);
6782
- const viewport = _optionalChain([root, 'optionalAccess', _441 => _441.closest, 'call', _442 => _442('[role="grid"]')]);
6891
+ const anchor = _optionalChain([root, 'optionalAccess', _445 => _445.parentElement]);
6892
+ const viewport = _optionalChain([root, 'optionalAccess', _446 => _446.closest, 'call', _447 => _447('[role="grid"]')]);
6783
6893
  if (!root || !anchor || !viewport) {
6784
6894
  return;
6785
6895
  }
@@ -6836,8 +6946,8 @@ function CellEditor({
6836
6946
  const canvas = canvasRef.current;
6837
6947
  if (canvas && paintCanvasText) {
6838
6948
  const dpr = window.devicePixelRatio || 1;
6839
- const offsetX = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _443 => _443.left]), () => ( 0))) * dpr % 1 / dpr;
6840
- const offsetY = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _444 => _444.top]), () => ( 0))) * dpr % 1 / dpr;
6949
+ const offsetX = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _448 => _448.left]), () => ( 0))) * dpr % 1 / dpr;
6950
+ const offsetY = (_nullishCoalesce(_optionalChain([canvasOffset, 'optionalAccess', _449 => _449.top]), () => ( 0))) * dpr % 1 / dpr;
6841
6951
  const width = rootRect.width / scale;
6842
6952
  const height = rootRect.height / scale;
6843
6953
  canvas.width = Math.ceil((width + offsetX) * dpr);
@@ -6848,11 +6958,11 @@ function CellEditor({
6848
6958
  canvas.style.top = `${-offsetY}px`;
6849
6959
  const context = canvas.getContext("2d");
6850
6960
  if (context) {
6851
- const node = _optionalChain([plainTextRef, 'access', _445 => _445.current, 'optionalAccess', _446 => _446.firstChild]);
6961
+ const node = _optionalChain([plainTextRef, 'access', _450 => _450.current, 'optionalAccess', _451 => _451.firstChild]);
6852
6962
  const lines = [];
6853
6963
  if (node) {
6854
6964
  const range = document.createRange();
6855
- const length = _nullishCoalesce(_optionalChain([node, 'access', _447 => _447.textContent, 'optionalAccess', _448 => _448.length]), () => ( 0));
6965
+ const length = _nullishCoalesce(_optionalChain([node, 'access', _452 => _452.textContent, 'optionalAccess', _453 => _453.length]), () => ( 0));
6856
6966
  let start = 0;
6857
6967
  while (start < length) {
6858
6968
  range.setStart(node, start);
@@ -6966,7 +7076,7 @@ function CellEditor({
6966
7076
  onKeyDown: (event) => {
6967
7077
  event.stopPropagation();
6968
7078
  if (event.nativeEvent.isComposing) return;
6969
- if (event.key === "ArrowDown" && event.altKey && _optionalChain([onFocusOverlay, 'optionalCall', _449 => _449()])) {
7079
+ if (event.key === "ArrowDown" && event.altKey && _optionalChain([onFocusOverlay, 'optionalCall', _454 => _454()])) {
6970
7080
  event.preventDefault();
6971
7081
  } else if (event.key === "Enter" && !event.altKey) {
6972
7082
  event.preventDefault();
@@ -7021,9 +7131,9 @@ function CellEditorOverlay({ editorRef, overlayRef, clipElement, session, render
7021
7131
  latest.current = { onExit, session };
7022
7132
  _chunkZ4WMURVUcjs._.call(void 0, () => {
7023
7133
  const editor = editorRef.current;
7024
- const owner = _optionalChain([editor, 'optionalAccess', _450 => _450.ownerDocument]);
7025
- const win = _optionalChain([owner, 'optionalAccess', _451 => _451.defaultView]);
7026
- const viewport = _optionalChain([editor, 'optionalAccess', _452 => _452.closest, 'call', _453 => _453('[role="grid"]')]);
7134
+ const owner = _optionalChain([editor, 'optionalAccess', _455 => _455.ownerDocument]);
7135
+ const win = _optionalChain([owner, 'optionalAccess', _456 => _456.defaultView]);
7136
+ const viewport = _optionalChain([editor, 'optionalAccess', _457 => _457.closest, 'call', _458 => _458('[role="grid"]')]);
7027
7137
  if (!editor || !owner || !win || !viewport) return;
7028
7138
  const update = () => {
7029
7139
  const bounds = editor.getBoundingClientRect();
@@ -7034,7 +7144,7 @@ function CellEditorOverlay({ editorRef, overlayRef, clipElement, session, render
7034
7144
  };
7035
7145
  const outside = (event) => {
7036
7146
  const target = event.target;
7037
- if (!latest.current.session.signal.aborted && !editor.contains(target) && !_optionalChain([overlayRef, 'access', _454 => _454.current, 'optionalAccess', _455 => _455.contains, 'call', _456 => _456(target)])) {
7147
+ if (!latest.current.session.signal.aborted && !editor.contains(target) && !_optionalChain([overlayRef, 'access', _459 => _459.current, 'optionalAccess', _460 => _460.contains, 'call', _461 => _461(target)])) {
7038
7148
  latest.current.onExit();
7039
7149
  }
7040
7150
  };
@@ -7117,16 +7227,16 @@ function SelectionPopover({ context, suspended, viewportRef, getRects, render, o
7117
7227
  width: Math.max(...rects.map((r) => r.right)) - Math.min(...rects.map((r) => r.left)),
7118
7228
  height: Math.max(...rects.map((r) => r.bottom)) - Math.min(...rects.map((r) => r.top))
7119
7229
  } : null;
7120
- setRect((previous) => _optionalChain([previous, 'optionalAccess', _457 => _457.left]) === _optionalChain([next, 'optionalAccess', _458 => _458.left]) && _optionalChain([previous, 'optionalAccess', _459 => _459.top]) === _optionalChain([next, 'optionalAccess', _460 => _460.top]) && _optionalChain([previous, 'optionalAccess', _461 => _461.width]) === _optionalChain([next, 'optionalAccess', _462 => _462.width]) && _optionalChain([previous, 'optionalAccess', _463 => _463.height]) === _optionalChain([next, 'optionalAccess', _464 => _464.height]) ? previous : next);
7230
+ setRect((previous) => _optionalChain([previous, 'optionalAccess', _462 => _462.left]) === _optionalChain([next, 'optionalAccess', _463 => _463.left]) && _optionalChain([previous, 'optionalAccess', _464 => _464.top]) === _optionalChain([next, 'optionalAccess', _465 => _465.top]) && _optionalChain([previous, 'optionalAccess', _466 => _466.width]) === _optionalChain([next, 'optionalAccess', _467 => _467.width]) && _optionalChain([previous, 'optionalAccess', _468 => _468.height]) === _optionalChain([next, 'optionalAccess', _469 => _469.height]) ? previous : next);
7121
7231
  }, [viewportRef]);
7122
7232
  _chunkZ4WMURVUcjs._.call(void 0, update);
7123
7233
  _chunkZ4WMURVUcjs._.call(void 0, () => {
7124
7234
  const viewport = viewportRef.current;
7125
- const owner = _optionalChain([viewport, 'optionalAccess', _465 => _465.ownerDocument]);
7126
- const win = _optionalChain([owner, 'optionalAccess', _466 => _466.defaultView]);
7235
+ const owner = _optionalChain([viewport, 'optionalAccess', _470 => _470.ownerDocument]);
7236
+ const win = _optionalChain([owner, 'optionalAccess', _471 => _471.defaultView]);
7127
7237
  if (!viewport || !owner || !win) return;
7128
7238
  const outside = (event) => {
7129
- if (!_optionalChain([hostRef, 'access', _467 => _467.current, 'optionalAccess', _468 => _468.contains, 'call', _469 => _469(event.target)])) close();
7239
+ if (!_optionalChain([hostRef, 'access', _472 => _472.current, 'optionalAccess', _473 => _473.contains, 'call', _474 => _474(event.target)])) close();
7130
7240
  };
7131
7241
  const observer = new ResizeObserver(update);
7132
7242
  observer.observe(viewport);
@@ -7205,8 +7315,8 @@ function useCellEditorSession({
7205
7315
  latest.current = { state, sheetIndex, value, isEditing, onChange, onCommit, onCancel };
7206
7316
  const [, refresh] = _chunkZ4WMURVUcjs.y.call(void 0, (revision) => revision + 1, 0);
7207
7317
  _chunkZ4WMURVUcjs._.call(void 0, () => () => {
7208
- _optionalChain([state, 'optionalAccess', _470 => _470.controller, 'access', _471 => _471.abort, 'call', _472 => _472()]);
7209
- if (_optionalChain([state, 'optionalAccess', _473 => _473.beforePreview]) != null && latest.current.state === null && latest.current.isEditing()) {
7318
+ _optionalChain([state, 'optionalAccess', _475 => _475.controller, 'access', _476 => _476.abort, 'call', _477 => _477()]);
7319
+ if (_optionalChain([state, 'optionalAccess', _478 => _478.beforePreview]) != null && latest.current.state === null && latest.current.isEditing()) {
7210
7320
  latest.current.onCancel();
7211
7321
  }
7212
7322
  }, [state]);
@@ -7261,7 +7371,7 @@ function useCellEditorSession({
7261
7371
  }
7262
7372
  };
7263
7373
  }, [state, inputRef]);
7264
- const hasPreview = _chunkZ4WMURVUcjs.q.call(void 0, () => _optionalChain([latest, 'access', _474 => _474.current, 'access', _475 => _475.state, 'optionalAccess', _476 => _476.beforePreview]) != null, []);
7374
+ const hasPreview = _chunkZ4WMURVUcjs.q.call(void 0, () => _optionalChain([latest, 'access', _479 => _479.current, 'access', _480 => _480.state, 'optionalAccess', _481 => _481.beforePreview]) != null, []);
7265
7375
  const session = state && commands && state.context.sheetIndex === sheetIndex ? {
7266
7376
  ...commands,
7267
7377
  context: state.context,
@@ -7303,7 +7413,7 @@ function HeaderSizeDialog({ axis, context, sizes, maxSize, messages, locale, pal
7303
7413
  return Number.isFinite(size) && indices.every((index) => sizes[index] === size) ? String(Math.round(size * 100) / 100) : "";
7304
7414
  });
7305
7415
  const dismiss = () => {
7306
- _optionalChain([dialog, 'access', _477 => _477.current, 'optionalAccess', _478 => _478.close, 'call', _479 => _479()]);
7416
+ _optionalChain([dialog, 'access', _482 => _482.current, 'optionalAccess', _483 => _483.close, 'call', _484 => _484()]);
7307
7417
  close();
7308
7418
  };
7309
7419
  const buttonStyle = {
@@ -7317,8 +7427,8 @@ function HeaderSizeDialog({ axis, context, sizes, maxSize, messages, locale, pal
7317
7427
  color: palette.buttonText
7318
7428
  };
7319
7429
  _chunkZ4WMURVUcjs._.call(void 0, () => {
7320
- _optionalChain([dialog, 'access', _480 => _480.current, 'optionalAccess', _481 => _481.showModal, 'call', _482 => _482()]);
7321
- _optionalChain([input, 'access', _483 => _483.current, 'optionalAccess', _484 => _484.select, 'call', _485 => _485()]);
7430
+ _optionalChain([dialog, 'access', _485 => _485.current, 'optionalAccess', _486 => _486.showModal, 'call', _487 => _487()]);
7431
+ _optionalChain([input, 'access', _488 => _488.current, 'optionalAccess', _489 => _489.select, 'call', _490 => _490()]);
7322
7432
  }, []);
7323
7433
  return _chunkZ4WMURVUcjs.$.call(void 0,
7324
7434
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0,
@@ -7345,7 +7455,7 @@ function HeaderSizeDialog({ axis, context, sizes, maxSize, messages, locale, pal
7345
7455
  },
7346
7456
  children: /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "form", { onSubmit: (event) => {
7347
7457
  event.preventDefault();
7348
- const size = _optionalChain([input, 'access', _486 => _486.current, 'optionalAccess', _487 => _487.valueAsNumber]);
7458
+ const size = _optionalChain([input, 'access', _491 => _491.current, 'optionalAccess', _492 => _492.valueAsNumber]);
7349
7459
  if (size === void 0 || !Number.isFinite(size)) return;
7350
7460
  if (indices.some((index) => Math.abs(sizes[index] - size) >= 5e-3)) resize(indices, size);
7351
7461
  dismiss();
@@ -7464,13 +7574,13 @@ function handleMenuNavigation(event) {
7464
7574
  if (event.key === "Home") next = 0;
7465
7575
  if (event.key === "End") next = items.length - 1;
7466
7576
  if (event.key.length === 1 && !event.altKey && !event.metaKey && !event.ctrlKey && event.key !== " ") {
7467
- next = items.findIndex((_2, i) => _optionalChain([items, 'access', _488 => _488[(current + 1 + i) % items.length], 'access', _489 => _489.textContent, 'optionalAccess', _490 => _490.trim, 'call', _491 => _491(), 'access', _492 => _492.replace, 'call', _493 => _493(/^✓\s*/, ""), 'access', _494 => _494.toLowerCase, 'call', _495 => _495(), 'access', _496 => _496.startsWith, 'call', _497 => _497(event.key.toLowerCase())]));
7577
+ next = items.findIndex((_2, i) => _optionalChain([items, 'access', _493 => _493[(current + 1 + i) % items.length], 'access', _494 => _494.textContent, 'optionalAccess', _495 => _495.trim, 'call', _496 => _496(), 'access', _497 => _497.replace, 'call', _498 => _498(/^✓\s*/, ""), 'access', _499 => _499.toLowerCase, 'call', _500 => _500(), 'access', _501 => _501.startsWith, 'call', _502 => _502(event.key.toLowerCase())]));
7468
7578
  next = next < 0 ? void 0 : (current + 1 + next) % items.length;
7469
7579
  }
7470
7580
  if (next !== void 0) {
7471
7581
  event.preventDefault();
7472
7582
  event.stopPropagation();
7473
- _optionalChain([items, 'access', _498 => _498[next], 'optionalAccess', _499 => _499.focus, 'call', _500 => _500()]);
7583
+ _optionalChain([items, 'access', _503 => _503[next], 'optionalAccess', _504 => _504.focus, 'call', _505 => _505()]);
7474
7584
  }
7475
7585
  }
7476
7586
  function ContextMenuItems({ actions, busy, runAction, contextMenuClassName, contextMenuStyle }) {
@@ -7505,7 +7615,7 @@ function ContextMenuItem({ action, busy, runAction, open, setOpen, contextMenuCl
7505
7615
  const rect = popup.current.getBoundingClientRect();
7506
7616
  setPosition({ left: Math.max(8, anchor.right + rect.width > innerWidth - 8 ? anchor.left - rect.width : anchor.right), top: Math.max(8, Math.min(anchor.top - 4, innerHeight - rect.height - 8)) });
7507
7617
  if (focusOnOpen.current) {
7508
- _optionalChain([menuItems, 'call', _501 => _501(popup.current), 'access', _502 => _502[0], 'optionalAccess', _503 => _503.focus, 'call', _504 => _504()]);
7618
+ _optionalChain([menuItems, 'call', _506 => _506(popup.current), 'access', _507 => _507[0], 'optionalAccess', _508 => _508.focus, 'call', _509 => _509()]);
7509
7619
  focusOnOpen.current = false;
7510
7620
  }
7511
7621
  }, [open]);
@@ -7551,7 +7661,7 @@ function ContextMenuItem({ action, busy, runAction, open, setOpen, contextMenuCl
7551
7661
  event.stopPropagation();
7552
7662
  focusOnOpen.current = true;
7553
7663
  setOpen(true);
7554
- if (open && popup.current) _optionalChain([menuItems, 'call', _505 => _505(popup.current), 'access', _506 => _506[0], 'optionalAccess', _507 => _507.focus, 'call', _508 => _508()]);
7664
+ if (open && popup.current) _optionalChain([menuItems, 'call', _510 => _510(popup.current), 'access', _511 => _511[0], 'optionalAccess', _512 => _512.focus, 'call', _513 => _513()]);
7555
7665
  }
7556
7666
  },
7557
7667
  children: [
@@ -7577,7 +7687,7 @@ function ContextMenuItem({ action, busy, runAction, open, setOpen, contextMenuCl
7577
7687
  event.preventDefault();
7578
7688
  event.stopPropagation();
7579
7689
  setOpen(false);
7580
- _optionalChain([trigger, 'access', _509 => _509.current, 'optionalAccess', _510 => _510.focus, 'call', _511 => _511()]);
7690
+ _optionalChain([trigger, 'access', _514 => _514.current, 'optionalAccess', _515 => _515.focus, 'call', _516 => _516()]);
7581
7691
  } else handleMenuNavigation(event);
7582
7692
  },
7583
7693
  children: /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, ContextMenuItems, { actions: action.children, busy, runAction, contextMenuClassName, contextMenuStyle })
@@ -7661,12 +7771,12 @@ function XlsxContextMenu({
7661
7771
  const [location, setLocation] = _chunkZ4WMURVUcjs.d.call(void 0, position);
7662
7772
  const modifier = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform) ? "\u2318" : "Ctrl+";
7663
7773
  const table = controller.tables.find(({ start, end }) => context.cell.row >= start.row && context.cell.row <= end.row && context.cell.col >= start.col && context.cell.col <= end.col);
7664
- const range = expandHighlightedRange(context.selection, _nullishCoalesce(_optionalChain([controller, 'access', _512 => _512.activeSheet, 'optionalAccess', _513 => _513.mergedRanges]), () => ( [])));
7774
+ const range = expandHighlightedRange(context.selection, _nullishCoalesce(_optionalChain([controller, 'access', _517 => _517.activeSheet, 'optionalAccess', _518 => _518.mergedRanges]), () => ( [])));
7665
7775
  const multiple = range.start.row !== range.end.row || range.start.col !== range.end.col;
7666
7776
  const areas = _nullishCoalesce(context.selectionRanges, () => ( [range]));
7667
7777
  const multiArea = areas.length > 1;
7668
7778
  const canCopy = !multiArea || Boolean(clipboardBands(areas));
7669
- const touchesPivot = areas.some((area) => _chunkGP5SOQQHcjs.findIntersectingPivot.call(void 0, controller.pivotTables, _optionalChain([controller, 'access', _514 => _514.activeSheet, 'optionalAccess', _515 => _515.name]), area));
7779
+ const touchesPivot = areas.some((area) => _chunkGP5SOQQHcjs.findIntersectingPivot.call(void 0, controller.pivotTables, _optionalChain([controller, 'access', _519 => _519.activeSheet, 'optionalAccess', _520 => _520.name]), area));
7670
7780
  const pivot = controller.getPivotTableAtCell(context.cell);
7671
7781
  const cutCopy = [
7672
7782
  ...!controller.readOnly ? [{ id: "cut", label: messages.cut, shortcut: `${modifier}X`, disabled: !canCopy || touchesPivot }] : [],
@@ -7684,7 +7794,7 @@ function XlsxContextMenu({
7684
7794
  label: `${row3 ? messages.rowHeight : messages.columnWidth}\u2026`,
7685
7795
  separatorBefore: true
7686
7796
  }] : [],
7687
- ...!controller.readOnly ? [
7797
+ ..._nullishCoalesce(controller.canChangeVisibility, () => ( !controller.readOnly)) ? [
7688
7798
  { id: row3 ? "hideRows" : "hideColumns", label: messages.hide, separatorBefore: !canResize },
7689
7799
  { id: row3 ? "unhideRows" : "unhideColumns", label: messages.unhide }
7690
7800
  ] : []
@@ -7718,7 +7828,7 @@ function XlsxContextMenu({
7718
7828
  { id: "selectAll", label: messages.selectAll, shortcut: `${modifier}A` }
7719
7829
  ];
7720
7830
  const drawing = _nullishCoalesce(context.chart, () => ( context.image));
7721
- const drawingDisabled = controller.readOnly || _optionalChain([drawing, 'optionalAccess', _516 => _516.editable]) === false;
7831
+ const drawingDisabled = controller.readOnly || _optionalChain([drawing, 'optionalAccess', _521 => _521.editable]) === false;
7722
7832
  const drawings = [...controller.charts, ...controller.images, ...controller.shapes, ...controller.formControls];
7723
7833
  const minOrder = Math.min(...drawings.map((item) => item.zIndex));
7724
7834
  const maxOrder = Math.max(...drawings.map((item) => item.zIndex));
@@ -7790,7 +7900,7 @@ function XlsxContextMenu({
7790
7900
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
7791
7901
  aliveRef.current = true;
7792
7902
  const outside = (event) => {
7793
- if (!_optionalChain([rootRef, 'access', _517 => _517.current, 'optionalAccess', _518 => _518.contains, 'call', _519 => _519(event.target)])) closeMenu(false);
7903
+ if (!_optionalChain([rootRef, 'access', _522 => _522.current, 'optionalAccess', _523 => _523.contains, 'call', _524 => _524(event.target)])) closeMenu(false);
7794
7904
  };
7795
7905
  const dismiss = () => closeMenu(false);
7796
7906
  document.addEventListener("pointerdown", outside, true);
@@ -8002,14 +8112,14 @@ function PivotGroupControls({
8002
8112
  if (readOnly) return null;
8003
8113
  const size = Math.max(14, 14 * zoom);
8004
8114
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: [
8005
- pivots.filter((pivot) => pivot.target.sheet.toLowerCase() === _optionalChain([sheetName, 'optionalAccess', _520 => _520.toLowerCase, 'call', _521 => _521()]) && !pivot.unsupportedFeatures.length).flatMap((pivot) => (_nullishCoalesce(pivot.toggles, () => ( []))).flatMap((toggle) => {
8115
+ pivots.filter((pivot) => pivot.target.sheet.toLowerCase() === _optionalChain([sheetName, 'optionalAccess', _525 => _525.toLowerCase, 'call', _526 => _526()]) && !pivot.unsupportedFeatures.length).flatMap((pivot) => (_nullishCoalesce(pivot.toggles, () => ( []))).flatMap((toggle) => {
8006
8116
  const rect = rectForCell(toggle);
8007
8117
  if (!rect) return [];
8008
8118
  const frozenTop = stickyTop.get(toggle.row);
8009
8119
  const frozenLeft = stickyLeft.get(toggle.col);
8010
8120
  const top = !renderControl && frozenTop !== void 0 ? frozenTop + viewport.top : rect.top;
8011
8121
  const left = !renderControl && frozenLeft !== void 0 ? frozenLeft + viewport.left : rect.left;
8012
- const hasHeader = _optionalChain([pivot, 'access', _522 => _522.headers, 'optionalAccess', _523 => _523.some, 'call', _524 => _524((header) => header.row === toggle.row && header.col === toggle.col)]);
8122
+ const hasHeader = _optionalChain([pivot, 'access', _527 => _527.headers, 'optionalAccess', _528 => _528.some, 'call', _529 => _529((header) => header.row === toggle.row && header.col === toggle.col)]);
8013
8123
  const x2 = left + Math.max(0, rect.width - size - (hasHeader ? size + 6 * zoom : 3 * zoom));
8014
8124
  const y2 = top + Math.max(0, (rect.height - size) / 2);
8015
8125
  if (!renderControl && (x2 < viewport.left + (frozenLeft === void 0 ? frozenRight : 0) || y2 < viewport.top + (frozenTop === void 0 ? frozenBottom : 0) || x2 + size > viewport.left + viewport.width || y2 + size > viewport.top + viewport.height)) return [];
@@ -8088,7 +8198,7 @@ function groupUnit(axis) {
8088
8198
  function axisFor(pivot, header, field) {
8089
8199
  const axes = header.axis === "reportFilters" ? [...pivot.rows, ...pivot.columns] : pivot[header.axis];
8090
8200
  const candidate = header.axis === "reportFilters" ? void 0 : axes[field.depth];
8091
- return _optionalChain([candidate, 'optionalAccess', _525 => _525.field]) === field.field ? candidate : axes.find((axis) => axis.field === field.field && groupUnit(axis) === (_nullishCoalesce(field.groupingUnit, () => ( null))));
8201
+ return _optionalChain([candidate, 'optionalAccess', _530 => _530.field]) === field.field ? candidate : axes.find((axis) => axis.field === field.field && groupUnit(axis) === (_nullishCoalesce(field.groupingUnit, () => ( null))));
8092
8202
  }
8093
8203
  function scoped(filter, field) {
8094
8204
  return filter.field === field.field && (_nullishCoalesce(filter.groupingUnit, () => ( null))) === (_nullishCoalesce(field.groupingUnit, () => ( null)));
@@ -8114,7 +8224,7 @@ function Input({ label, value, onChange, ...props }) {
8114
8224
  function DefaultPivotHeaderPopup({ menu, anchor, colors, popupRef }) {
8115
8225
  const [search, setSearch] = _chunkZ4WMURVUcjs.d.call(void 0, "");
8116
8226
  const existingMembers = menu.filters.find((filter) => filter.kind === "members");
8117
- const [selected, setSelected] = _chunkZ4WMURVUcjs.d.call(void 0, () => new Set(_nullishCoalesce(_optionalChain([existingMembers, 'optionalAccess', _526 => _526.values]), () => ( menu.members.map((member) => member.key)))));
8227
+ const [selected, setSelected] = _chunkZ4WMURVUcjs.d.call(void 0, () => new Set(_nullishCoalesce(_optionalChain([existingMembers, 'optionalAccess', _531 => _531.values]), () => ( menu.members.map((member) => member.key)))));
8118
8228
  const [mode, setMode] = _chunkZ4WMURVUcjs.d.call(void 0, "members");
8119
8229
  const [draft, setDraft] = _chunkZ4WMURVUcjs.d.call(void 0, () => filterDefault(menu.field, "label"));
8120
8230
  const [sortMeasure, setSortMeasure] = _chunkZ4WMURVUcjs.d.call(void 0, "0");
@@ -8122,13 +8232,13 @@ function DefaultPivotHeaderPopup({ menu, anchor, colors, popupRef }) {
8122
8232
  const titleId = _chunkZ4WMURVUcjs.g.call(void 0, );
8123
8233
  const searchRef = _chunkZ4WMURVUcjs.A.call(void 0, null);
8124
8234
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
8125
- _optionalChain([searchRef, 'access', _527 => _527.current, 'optionalAccess', _528 => _528.focus, 'call', _529 => _529()]);
8235
+ _optionalChain([searchRef, 'access', _532 => _532.current, 'optionalAccess', _533 => _533.focus, 'call', _534 => _534()]);
8126
8236
  }, []);
8127
8237
  _chunkZ4WMURVUcjs._.call(void 0, () => {
8128
8238
  const padding = 8;
8129
8239
  const width = Math.max(0, Math.min(308, window.innerWidth - padding * 2));
8130
8240
  const maxHeight = Math.max(0, Math.min(480, window.innerHeight - padding * 2));
8131
- const height = Math.min(_nullishCoalesce(_optionalChain([popupRef, 'access', _530 => _530.current, 'optionalAccess', _531 => _531.getBoundingClientRect, 'call', _532 => _532(), 'access', _533 => _533.height]), () => ( 440)), maxHeight);
8241
+ const height = Math.min(_nullishCoalesce(_optionalChain([popupRef, 'access', _535 => _535.current, 'optionalAccess', _536 => _536.getBoundingClientRect, 'call', _537 => _537(), 'access', _538 => _538.height]), () => ( 440)), maxHeight);
8132
8242
  const below = anchor.bottom + 4;
8133
8243
  const top = below + height <= window.innerHeight - padding ? below : Math.max(padding, anchor.top - height - 4);
8134
8244
  const left = Math.max(padding, Math.min(anchor.right - width, window.innerWidth - width - padding));
@@ -8153,8 +8263,8 @@ function DefaultPivotHeaderPopup({ menu, anchor, colors, popupRef }) {
8153
8263
  return;
8154
8264
  }
8155
8265
  if (event.key !== "Tab") return;
8156
- const targets = _optionalChain([popupRef, 'access', _534 => _534.current, 'optionalAccess', _535 => _535.querySelectorAll, 'call', _536 => _536('button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex="0"]')]);
8157
- if (!_optionalChain([targets, 'optionalAccess', _537 => _537.length])) return;
8266
+ const targets = _optionalChain([popupRef, 'access', _539 => _539.current, 'optionalAccess', _540 => _540.querySelectorAll, 'call', _541 => _541('button:not(:disabled), input:not(:disabled), select:not(:disabled), [tabindex="0"]')]);
8267
+ if (!_optionalChain([targets, 'optionalAccess', _542 => _542.length])) return;
8158
8268
  const first = targets[0];
8159
8269
  const last = targets[targets.length - 1];
8160
8270
  if (event.shiftKey && document.activeElement === first) {
@@ -8305,10 +8415,10 @@ function PivotHeaderControls({ pivots, sheetName, rectForCell, viewport, viewpor
8305
8415
  measure();
8306
8416
  viewportElement.addEventListener("scroll", measure, { passive: true });
8307
8417
  const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
8308
- _optionalChain([observer, 'optionalAccess', _538 => _538.observe, 'call', _539 => _539(viewportElement)]);
8418
+ _optionalChain([observer, 'optionalAccess', _543 => _543.observe, 'call', _544 => _544(viewportElement)]);
8309
8419
  return () => {
8310
8420
  viewportElement.removeEventListener("scroll", measure);
8311
- _optionalChain([observer, 'optionalAccess', _540 => _540.disconnect, 'call', _541 => _541()]);
8421
+ _optionalChain([observer, 'optionalAccess', _545 => _545.disconnect, 'call', _546 => _546()]);
8312
8422
  if (frame !== null) cancelAnimationFrame(frame);
8313
8423
  };
8314
8424
  }, [viewportElement, Boolean(renderControl)]);
@@ -8343,27 +8453,27 @@ function PivotHeaderControls({ pivots, sheetName, rectForCell, viewport, viewpor
8343
8453
  measure();
8344
8454
  window.addEventListener("resize", measure);
8345
8455
  window.addEventListener("scroll", measure, true);
8346
- _optionalChain([viewportElement, 'optionalAccess', _542 => _542.addEventListener, 'call', _543 => _543(VIEWPORT_CHANGE_EVENT, measure)]);
8456
+ _optionalChain([viewportElement, 'optionalAccess', _547 => _547.addEventListener, 'call', _548 => _548(VIEWPORT_CHANGE_EVENT, measure)]);
8347
8457
  const outside = (event) => {
8348
8458
  const target = event.target;
8349
- if (target && (_optionalChain([popupRef, 'access', _544 => _544.current, 'optionalAccess', _545 => _545.contains, 'call', _546 => _546(target)]) || _optionalChain([triggers, 'access', _547 => _547.current, 'access', _548 => _548.get, 'call', _549 => _549(open.key), 'optionalAccess', _550 => _550.contains, 'call', _551 => _551(target)]))) return;
8459
+ if (target && (_optionalChain([popupRef, 'access', _549 => _549.current, 'optionalAccess', _550 => _550.contains, 'call', _551 => _551(target)]) || _optionalChain([triggers, 'access', _552 => _552.current, 'access', _553 => _553.get, 'call', _554 => _554(open.key), 'optionalAccess', _555 => _555.contains, 'call', _556 => _556(target)]))) return;
8350
8460
  setOpen(null);
8351
8461
  };
8352
8462
  document.addEventListener("pointerdown", outside, true);
8353
8463
  return () => {
8354
8464
  window.removeEventListener("resize", measure);
8355
8465
  window.removeEventListener("scroll", measure, true);
8356
- _optionalChain([viewportElement, 'optionalAccess', _552 => _552.removeEventListener, 'call', _553 => _553(VIEWPORT_CHANGE_EVENT, measure)]);
8466
+ _optionalChain([viewportElement, 'optionalAccess', _557 => _557.removeEventListener, 'call', _558 => _558(VIEWPORT_CHANGE_EVENT, measure)]);
8357
8467
  document.removeEventListener("pointerdown", outside, true);
8358
8468
  };
8359
8469
  }, [open, pivots, viewportElement, viewport.left, viewport.top, viewport.width, viewport.height]);
8360
8470
  const close = () => {
8361
- const key = _optionalChain([open, 'optionalAccess', _554 => _554.key]);
8471
+ const key = _optionalChain([open, 'optionalAccess', _559 => _559.key]);
8362
8472
  setOpen(null);
8363
8473
  setError(null);
8364
- if (key) requestAnimationFrame(() => _optionalChain([triggers, 'access', _555 => _555.current, 'access', _556 => _556.get, 'call', _557 => _557(key), 'optionalAccess', _558 => _558.focus, 'call', _559 => _559()]));
8474
+ if (key) requestAnimationFrame(() => _optionalChain([triggers, 'access', _560 => _560.current, 'access', _561 => _561.get, 'call', _562 => _562(key), 'optionalAccess', _563 => _563.focus, 'call', _564 => _564()]));
8365
8475
  };
8366
- return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: pivots.filter((pivot) => pivot.target.sheet.toLowerCase() === _optionalChain([sheetName, 'optionalAccess', _560 => _560.toLowerCase, 'call', _561 => _561()])).flatMap((pivot) => (_nullishCoalesce(pivot.headers, () => ( []))).flatMap((header) => {
8476
+ return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: pivots.filter((pivot) => pivot.target.sheet.toLowerCase() === _optionalChain([sheetName, 'optionalAccess', _565 => _565.toLowerCase, 'call', _566 => _566()])).flatMap((pivot) => (_nullishCoalesce(pivot.headers, () => ( []))).flatMap((header) => {
8367
8477
  if (!header.fields.length) return [];
8368
8478
  const rect = rectForCell(header);
8369
8479
  if (!rect) return [];
@@ -8377,15 +8487,15 @@ function PivotHeaderControls({ pivots, sheetName, rectForCell, viewport, viewpor
8377
8487
  const y2 = top + (experimentalCanvas ? Math.max(0, rect.height - size - zoom) : 3 * zoom);
8378
8488
  if (!renderControl && (x2 < liveViewport.left + (frozenLeft === void 0 ? frozenRight : 0) || y2 < liveViewport.top + (frozenTop === void 0 ? frozenBottom : 0) || x2 + width > liveViewport.left + liveViewport.width || y2 + height > liveViewport.top + liveViewport.height)) return [];
8379
8489
  const key = `${pivot.id}:${header.row}:${header.col}:${header.axis}`;
8380
- const isOpen = _optionalChain([open, 'optionalAccess', _562 => _562.key]) === key;
8490
+ const isOpen = _optionalChain([open, 'optionalAccess', _567 => _567.key]) === key;
8381
8491
  const field = _nullishCoalesce(header.fields.find((field2) => isOpen && field2.depth === open.depth), () => ( header.fields[0]));
8382
8492
  const axis = axisFor(pivot, header, field);
8383
- const members = _optionalChain([axis, 'optionalAccess', _563 => _563.items, 'optionalAccess', _564 => _564.length]) ? axis.items : _nullishCoalesce(_optionalChain([pivot, 'access', _565 => _565.fields, 'access', _566 => _566.find, 'call', _567 => _567((source) => source.index === field.field), 'optionalAccess', _568 => _568.items]), () => ( []));
8493
+ const members = _optionalChain([axis, 'optionalAccess', _568 => _568.items, 'optionalAccess', _569 => _569.length]) ? axis.items : _nullishCoalesce(_optionalChain([pivot, 'access', _570 => _570.fields, 'access', _571 => _571.find, 'call', _572 => _572((source) => source.index === field.field), 'optionalAccess', _573 => _573.items]), () => ( []));
8384
8494
  const filters = pivot.filters.filter((filter) => scoped(filter, field));
8385
8495
  const filtered = header.fields.some((field2) => pivot.filters.some((filter) => scoped(filter, field2)));
8386
- const label = _nullishCoalesce(_optionalChain([openLabel, 'optionalAccess', _569 => _569.replace, 'call', _570 => _570("{column}", header.caption || field.name)]), () => ( `Sort and filter ${header.caption || field.name}`));
8496
+ const label = _nullishCoalesce(_optionalChain([openLabel, 'optionalAccess', _574 => _574.replace, 'call', _575 => _575("{column}", header.caption || field.name)]), () => ( `Sort and filter ${header.caption || field.name}`));
8387
8497
  const locked = readOnly || pivot.unsupportedFeatures.length > 0;
8388
- const direction = _optionalChain([axis, 'optionalAccess', _571 => _571.sort]) === "ascending" || _optionalChain([axis, 'optionalAccess', _572 => _572.sort]) === "valueAscending" ? "ascending" : _optionalChain([axis, 'optionalAccess', _573 => _573.sort]) === "descending" || _optionalChain([axis, 'optionalAccess', _574 => _574.sort]) === "valueDescending" ? "descending" : null;
8498
+ const direction = _optionalChain([axis, 'optionalAccess', _576 => _576.sort]) === "ascending" || _optionalChain([axis, 'optionalAccess', _577 => _577.sort]) === "valueAscending" ? "ascending" : _optionalChain([axis, 'optionalAccess', _578 => _578.sort]) === "descending" || _optionalChain([axis, 'optionalAccess', _579 => _579.sort]) === "valueDescending" ? "descending" : null;
8389
8499
  const foreground = isDark ? _nullishCoalesce(colors.headerText, () => ( colors.text)) : "#667174";
8390
8500
  const triggerContent = experimentalCanvas ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "svg", { "aria-hidden": "true", viewBox: "0 0 16 16", width: size, height: size, style: { display: "block", flexShrink: 0 }, children: [
8391
8501
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "rect", { width: "16", height: "16", fill: isDark ? _nullishCoalesce(colors.headerSurface, () => ( colors.surface)) : "#f8fafb" }),
@@ -8414,7 +8524,7 @@ function PivotHeaderControls({ pivots, sheetName, rectForCell, viewport, viewpor
8414
8524
  field,
8415
8525
  members,
8416
8526
  filters,
8417
- sort: header.axis === "reportFilters" ? null : _nullishCoalesce(_optionalChain([axis, 'optionalAccess', _575 => _575.sort]), () => ( null)),
8527
+ sort: header.axis === "reportFilters" ? null : _nullishCoalesce(_optionalChain([axis, 'optionalAccess', _580 => _580.sort]), () => ( null)),
8418
8528
  readOnly: locked,
8419
8529
  isOpen,
8420
8530
  setField: (depth) => {
@@ -8426,7 +8536,7 @@ function PivotHeaderControls({ pivots, sheetName, rectForCell, viewport, viewpor
8426
8536
  setOpen: (next) => {
8427
8537
  if (next) {
8428
8538
  setOpen({ key, depth: field.depth });
8429
- setAnchor(_nullishCoalesce(_optionalChain([triggers, 'access', _576 => _576.current, 'access', _577 => _577.get, 'call', _578 => _578(key), 'optionalAccess', _579 => _579.getBoundingClientRect, 'call', _580 => _580()]), () => ( null)));
8539
+ setAnchor(_nullishCoalesce(_optionalChain([triggers, 'access', _581 => _581.current, 'access', _582 => _582.get, 'call', _583 => _583(key), 'optionalAccess', _584 => _584.getBoundingClientRect, 'call', _585 => _585()]), () => ( null)));
8430
8540
  setError(null);
8431
8541
  } else setOpen(null);
8432
8542
  },
@@ -8527,7 +8637,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8527
8637
  const [savedDefinition, setSavedDefinition] = _chunkZ4WMURVUcjs.d.call(void 0, "");
8528
8638
  const [pendingFocus, setPendingFocus] = _chunkZ4WMURVUcjs.d.call(void 0, null);
8529
8639
  const sourceNeedsLoad = Boolean(draft && JSON.stringify(draft.source) !== loadedSource);
8530
- const stale = Boolean(dirty && _optionalChain([draft, 'optionalAccess', _581 => _581.id]) && savedDefinition !== JSON.stringify(_nullishCoalesce(viewer.pivotTables.find((pivot) => pivot.id === draft.id), () => ( null))));
8640
+ const stale = Boolean(dirty && _optionalChain([draft, 'optionalAccess', _586 => _586.id]) && savedDefinition !== JSON.stringify(_nullishCoalesce(viewer.pivotTables.find((pivot) => pivot.id === draft.id), () => ( null))));
8531
8641
  const run = _chunkZ4WMURVUcjs.q.call(void 0, (action) => {
8532
8642
  setError(null);
8533
8643
  setStatus(null);
@@ -8552,7 +8662,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8552
8662
  if (options2.initialOpen !== void 0) setOpen(options2.initialOpen);
8553
8663
  }, [viewer.src, viewer.file]);
8554
8664
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
8555
- if (options2.enabled === false || dirty || !_optionalChain([draft, 'optionalAccess', _582 => _582.id])) return;
8665
+ if (options2.enabled === false || dirty || !_optionalChain([draft, 'optionalAccess', _587 => _587.id])) return;
8556
8666
  const current = viewer.pivotTables.find((pivot) => pivot.id === draft.id);
8557
8667
  setDraft(current ? copyPivot(current) : null);
8558
8668
  if (current) {
@@ -8563,19 +8673,19 @@ function usePivotTableEditor(viewer, options2 = {}) {
8563
8673
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
8564
8674
  if (options2.enabled === false || options2.autoSelect === false || dirty || pendingFocus || !viewer.activeCell || !viewer.activeSheet) return;
8565
8675
  const current = viewer.getPivotTableAtCell(viewer.activeCell, viewer.activeSheet.name);
8566
- if (!current || current.id === _optionalChain([draft, 'optionalAccess', _583 => _583.id])) return;
8676
+ if (!current || current.id === _optionalChain([draft, 'optionalAccess', _588 => _588.id])) return;
8567
8677
  setDraft(copyPivot(current));
8568
8678
  setLoadedSource(JSON.stringify(current.source));
8569
8679
  setSavedDefinition(JSON.stringify(current));
8570
8680
  setError(null);
8571
8681
  setStatus(null);
8572
8682
  setDetails(null);
8573
- }, [_optionalChain([viewer, 'access', _584 => _584.activeCell, 'optionalAccess', _585 => _585.row]), _optionalChain([viewer, 'access', _586 => _586.activeCell, 'optionalAccess', _587 => _587.col]), _optionalChain([viewer, 'access', _588 => _588.activeSheet, 'optionalAccess', _589 => _589.name]), viewer.pivotTables, options2.autoSelect, options2.enabled]);
8683
+ }, [_optionalChain([viewer, 'access', _589 => _589.activeCell, 'optionalAccess', _590 => _590.row]), _optionalChain([viewer, 'access', _591 => _591.activeCell, 'optionalAccess', _592 => _592.col]), _optionalChain([viewer, 'access', _593 => _593.activeSheet, 'optionalAccess', _594 => _594.name]), viewer.pivotTables, options2.autoSelect, options2.enabled]);
8574
8684
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
8575
- if (!pendingFocus || _optionalChain([viewer, 'access', _590 => _590.activeSheet, 'optionalAccess', _591 => _591.name, 'access', _592 => _592.toLowerCase, 'call', _593 => _593()]) !== pendingFocus.sheet.toLowerCase()) return;
8685
+ if (!pendingFocus || _optionalChain([viewer, 'access', _595 => _595.activeSheet, 'optionalAccess', _596 => _596.name, 'access', _597 => _597.toLowerCase, 'call', _598 => _598()]) !== pendingFocus.sheet.toLowerCase()) return;
8576
8686
  viewer.selectCell({ row: pendingFocus.row, col: pendingFocus.col });
8577
8687
  setPendingFocus(null);
8578
- }, [pendingFocus, _optionalChain([viewer, 'access', _594 => _594.activeSheet, 'optionalAccess', _595 => _595.name]), viewer.selectCell]);
8688
+ }, [pendingFocus, _optionalChain([viewer, 'access', _599 => _599.activeSheet, 'optionalAccess', _600 => _600.name]), viewer.selectCell]);
8579
8689
  const focus = (pivot) => {
8580
8690
  const sheetIndex = viewer.sheets.findIndex((sheet) => sheet.name.toLowerCase() === pivot.target.sheet.toLowerCase());
8581
8691
  if (sheetIndex >= 0) viewer.setActiveSheetIndex(sheetIndex);
@@ -8595,7 +8705,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8595
8705
  focus(pivot);
8596
8706
  });
8597
8707
  const edit = (change) => {
8598
- if (options2.enabled === false || viewer.readOnly || _optionalChain([draft, 'optionalAccess', _596 => _596.unsupportedFeatures, 'access', _597 => _597.length])) return;
8708
+ if (options2.enabled === false || viewer.readOnly || _optionalChain([draft, 'optionalAccess', _601 => _601.unsupportedFeatures, 'access', _602 => _602.length])) return;
8599
8709
  setDraft((current) => current ? change(current) : current);
8600
8710
  setDirty(true);
8601
8711
  setStatus(null);
@@ -8646,7 +8756,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8646
8756
  if (!draft) return;
8647
8757
  const fields = viewer.getPivotSourceFields(draft.source);
8648
8758
  setLoadedSource(JSON.stringify(draft.source));
8649
- const sameSchema = fields.length === draft.fields.length && fields.every((field, index) => field.name === _optionalChain([draft, 'access', _598 => _598.fields, 'access', _599 => _599[index], 'optionalAccess', _600 => _600.name]));
8759
+ const sameSchema = fields.length === draft.fields.length && fields.every((field, index) => field.name === _optionalChain([draft, 'access', _603 => _603.fields, 'access', _604 => _604[index], 'optionalAccess', _605 => _605.name]));
8650
8760
  edit((pivot) => ({ ...pivot, fields, ...sameSchema ? {} : { rows: [], columns: [], values: [], filters: [], reportFilters: [], calculatedItems: [] } }));
8651
8761
  setStatus(sameSchema ? "Source fields updated." : "Fields loaded. Choose the fields to summarize.");
8652
8762
  });
@@ -8668,7 +8778,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8668
8778
  if (all) {
8669
8779
  const refreshed = viewer.refreshAllPivotTables();
8670
8780
  setStatus(`${refreshed.length} PivotTable${refreshed.length === 1 ? "" : "s"} refreshed.`);
8671
- } else if (_optionalChain([draft, 'optionalAccess', _601 => _601.id])) {
8781
+ } else if (_optionalChain([draft, 'optionalAccess', _606 => _606.id])) {
8672
8782
  const refreshed = viewer.refreshPivotTable(draft.id);
8673
8783
  setDraft(copyPivot(refreshed));
8674
8784
  setLoadedSource(JSON.stringify(refreshed.source));
@@ -8680,7 +8790,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8680
8790
  });
8681
8791
  const remove = () => run(() => {
8682
8792
  if (dirty) throw new Error("Apply or discard your changes before removing the report.");
8683
- if (!_optionalChain([draft, 'optionalAccess', _602 => _602.id])) return;
8793
+ if (!_optionalChain([draft, 'optionalAccess', _607 => _607.id])) return;
8684
8794
  if (viewer.removePivotTable(draft.id)) {
8685
8795
  setDraft(null);
8686
8796
  setDirty(false);
@@ -8689,7 +8799,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8689
8799
  }
8690
8800
  });
8691
8801
  const reset = () => run(() => {
8692
- const saved = viewer.pivotTables.find((pivot) => pivot.id === _optionalChain([draft, 'optionalAccess', _603 => _603.id]));
8802
+ const saved = viewer.pivotTables.find((pivot) => pivot.id === _optionalChain([draft, 'optionalAccess', _608 => _608.id]));
8693
8803
  setDraft(saved ? copyPivot(saved) : null);
8694
8804
  setLoadedSource(saved ? JSON.stringify(saved.source) : "");
8695
8805
  setSavedDefinition(saved ? JSON.stringify(saved) : "");
@@ -8697,8 +8807,8 @@ function usePivotTableEditor(viewer, options2 = {}) {
8697
8807
  setDetails(null);
8698
8808
  });
8699
8809
  const showDetails = () => run(() => {
8700
- if (!_optionalChain([draft, 'optionalAccess', _604 => _604.id]) || !viewer.activeCell) return;
8701
- if (_optionalChain([viewer, 'access', _605 => _605.activeSheet, 'optionalAccess', _606 => _606.name, 'access', _607 => _607.toLowerCase, 'call', _608 => _608()]) !== draft.target.sheet.toLowerCase()) throw new Error("Select a value cell inside this PivotTable first.");
8810
+ if (!_optionalChain([draft, 'optionalAccess', _609 => _609.id]) || !viewer.activeCell) return;
8811
+ if (_optionalChain([viewer, 'access', _610 => _610.activeSheet, 'optionalAccess', _611 => _611.name, 'access', _612 => _612.toLowerCase, 'call', _613 => _613()]) !== draft.target.sheet.toLowerCase()) throw new Error("Select a value cell inside this PivotTable first.");
8702
8812
  setDetails(viewer.pivotDrillDown(draft.id, viewer.activeCell.row, viewer.activeCell.col));
8703
8813
  setDetailContext({ id: draft.id, row: viewer.activeCell.row, col: viewer.activeCell.col });
8704
8814
  setOpen(true);
@@ -8738,7 +8848,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8738
8848
  });
8739
8849
  const removeField = (area, index) => edit((pivot) => area === "values" ? replaceValues(pivot, pivot.values.filter((_2, position) => position !== index)) : { ...pivot, [area]: pivot[area].filter((_2, position) => position !== index) });
8740
8850
  const moveField = (fromArea, fromIndex, toArea, toIndex) => {
8741
- if (fromArea === "values" && toArea !== "values" && _optionalChain([draft, 'optionalAccess', _609 => _609.values, 'access', _610 => _610[fromIndex], 'optionalAccess', _611 => _611.formula, 'optionalAccess', _612 => _612.trim, 'call', _613 => _613()])) {
8851
+ if (fromArea === "values" && toArea !== "values" && _optionalChain([draft, 'optionalAccess', _614 => _614.values, 'access', _615 => _615[fromIndex], 'optionalAccess', _616 => _616.formula, 'optionalAccess', _617 => _617.trim, 'call', _618 => _618()])) {
8742
8852
  run(() => {
8743
8853
  throw new Error("Calculated fields can only be placed in Values.");
8744
8854
  });
@@ -8746,7 +8856,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8746
8856
  }
8747
8857
  edit((pivot) => {
8748
8858
  const entry = pivot[fromArea][fromIndex];
8749
- if (entry === void 0 || fromArea === "values" && toArea !== "values" && typeof entry === "object" && "formula" in entry && _optionalChain([entry, 'access', _614 => _614.formula, 'optionalAccess', _615 => _615.trim, 'call', _616 => _616()])) return pivot;
8859
+ if (entry === void 0 || fromArea === "values" && toArea !== "values" && typeof entry === "object" && "formula" in entry && _optionalChain([entry, 'access', _619 => _619.formula, 'optionalAccess', _620 => _620.trim, 'call', _621 => _621()])) return pivot;
8750
8860
  if (fromArea === toArea) {
8751
8861
  const entries2 = [...pivot[fromArea]];
8752
8862
  entries2.splice(fromIndex, 1);
@@ -8769,7 +8879,7 @@ function usePivotTableEditor(viewer, options2 = {}) {
8769
8879
  return { ...next, [toArea]: entries };
8770
8880
  });
8771
8881
  };
8772
- return { viewer, readOnly: viewer.readOnly || Boolean(_optionalChain([draft, 'optionalAccess', _617 => _617.unsupportedFeatures, 'access', _618 => _618.length])), open, setOpen, draft, dirty, edit, select, create, apply, reset, remove, refresh, readFields, addField, removeField, moveField, details, detailContext, showDetails, clearDetails: () => {
8882
+ return { viewer, readOnly: viewer.readOnly || Boolean(_optionalChain([draft, 'optionalAccess', _622 => _622.unsupportedFeatures, 'access', _623 => _623.length])), open, setOpen, draft, dirty, edit, select, create, apply, reset, remove, refresh, readFields, addField, removeField, moveField, details, detailContext, showDetails, clearDetails: () => {
8773
8883
  setDetails(null);
8774
8884
  setDetailContext(null);
8775
8885
  }, sourceNeedsLoad, stale, error, status, run };
@@ -8790,16 +8900,16 @@ var row2 = { display: "flex", alignItems: "center", gap: 6, minWidth: 0 };
8790
8900
  var hint = { color: "var(--xlsx-pivot-muted)", fontSize: 11, lineHeight: 1.5, margin: 0 };
8791
8901
  var control2 = { boxSizing: "border-box", width: "100%", minWidth: 0, minHeight: 30, border: "1px solid var(--xlsx-pivot-border)", borderRadius: 3, background: "var(--xlsx-pivot-input)", color: "inherit", padding: "4px 7px", font: "inherit" };
8792
8902
  function fieldName(pivot, index) {
8793
- return _nullishCoalesce(_optionalChain([pivot, 'access', _619 => _619.fields, 'access', _620 => _620.find, 'call', _621 => _621((field) => field.index === index), 'optionalAccess', _622 => _622.name]), () => ( `Field ${index + 1}`));
8903
+ return _nullishCoalesce(_optionalChain([pivot, 'access', _624 => _624.fields, 'access', _625 => _625.find, 'call', _626 => _626((field) => field.index === index), 'optionalAccess', _627 => _627.name]), () => ( `Field ${index + 1}`));
8794
8904
  }
8795
8905
  function fieldIndex(pivot, area, index) {
8796
- return area === "reportFilters" ? pivot.reportFilters[index] : _optionalChain([pivot, 'access', _623 => _623[area], 'access', _624 => _624[index], 'optionalAccess', _625 => _625.field]);
8906
+ return area === "reportFilters" ? pivot.reportFilters[index] : _optionalChain([pivot, 'access', _628 => _628[area], 'access', _629 => _629[index], 'optionalAccess', _630 => _630.field]);
8797
8907
  }
8798
8908
  function sourceFieldIndex(pivot, area, index) {
8799
- return area === "values" && _optionalChain([pivot, 'access', _626 => _626.values, 'access', _627 => _627[index], 'optionalAccess', _628 => _628.formula, 'optionalAccess', _629 => _629.trim, 'call', _630 => _630()]) ? void 0 : fieldIndex(pivot, area, index);
8909
+ return area === "values" && _optionalChain([pivot, 'access', _631 => _631.values, 'access', _632 => _632[index], 'optionalAccess', _633 => _633.formula, 'optionalAccess', _634 => _634.trim, 'call', _635 => _635()]) ? void 0 : fieldIndex(pivot, area, index);
8800
8910
  }
8801
8911
  function groupingUnit(axis) {
8802
- return _optionalChain([axis, 'optionalAccess', _631 => _631.grouping]) ? axis.grouping.kind === "date" ? axis.grouping.unit : axis.grouping.kind : null;
8912
+ return _optionalChain([axis, 'optionalAccess', _636 => _636.grouping]) ? axis.grouping.kind === "date" ? axis.grouping.unit : axis.grouping.kind : null;
8803
8913
  }
8804
8914
  function Action({ children: children2, primary, style, ...props }) {
8805
8915
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "button", { type: "button", ...props, style: { ...control2, width: "auto", cursor: props.disabled ? "default" : "pointer", opacity: props.disabled ? 0.55 : 1, ...primary ? { background: "var(--xlsx-pivot-accent)", borderColor: "var(--xlsx-pivot-accent)", color: "#fff" } : {}, ...style }, children: children2 });
@@ -8866,10 +8976,10 @@ function ValueSettings({ pivot, value, onChange }) {
8866
8976
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: [
8867
8977
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Custom name", value: value.name, onChange: (name) => onChange({ ...value, name }) }),
8868
8978
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Summarize values by", value: value.aggregation, options: AGGREGATIONS, onChange: (aggregation) => onChange({ ...value, aggregation }) }),
8869
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Show values as", value: value.showAs, options: SHOW_AS, onChange: (showAs) => onChange({ ...value, showAs, baseField: _nullishCoalesce(value.baseField, () => ( _optionalChain([axes, 'access', _632 => _632[0], 'optionalAccess', _633 => _633.field]))) }) }),
8979
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Show values as", value: value.showAs, options: SHOW_AS, onChange: (showAs) => onChange({ ...value, showAs, baseField: _nullishCoalesce(value.baseField, () => ( _optionalChain([axes, 'access', _637 => _637[0], 'optionalAccess', _638 => _638.field]))) }) }),
8870
8980
  needsBase ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Base field", value: value.baseField == null ? "" : String(value.baseField), placeholder: "Choose a field", options: pivot.fields.filter((field) => axes.some((axis) => axis.field === field.index)).map((field) => [String(field.index), field.name]), onChange: (field) => onChange({ ...value, baseField: Number(field), baseGroupingUnit: null, baseItem: null }) }) : null,
8871
8981
  needsBase && baseAxes.length > 1 ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Base grouping level", value: _nullishCoalesce(_nullishCoalesce(value.baseGroupingUnit, () => ( groupingUnit(base))), () => ( "")), options: baseAxes.map((axis) => [_nullishCoalesce(groupingUnit(axis), () => ( "")), axis.name || groupingUnit(axis) || "Source items"]), onChange: (unit) => onChange({ ...value, baseGroupingUnit: unit || null, baseItem: null }) }) : null,
8872
- needsItem ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Base item", value: _nullishCoalesce(value.baseItem, () => ( "previous")), options: [["previous", "(previous)"], ["next", "(next)"], ...(_optionalChain([base, 'optionalAccess', _634 => _634.items, 'optionalAccess', _635 => _635.length]) ? base.items : _nullishCoalesce(_optionalChain([source, 'optionalAccess', _636 => _636.items]), () => ( []))).map((item) => [item.key, item.caption])], onChange: (baseItem) => onChange({ ...value, baseItem }) }) : null,
8982
+ needsItem ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Base item", value: _nullishCoalesce(value.baseItem, () => ( "previous")), options: [["previous", "(previous)"], ["next", "(next)"], ...(_optionalChain([base, 'optionalAccess', _639 => _639.items, 'optionalAccess', _640 => _640.length]) ? base.items : _nullishCoalesce(_optionalChain([source, 'optionalAccess', _641 => _641.items]), () => ( []))).map((item) => [item.key, item.caption])], onChange: (baseItem) => onChange({ ...value, baseItem }) }) : null,
8873
8983
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Number format", value: _nullishCoalesce(value.numberFormat, () => ( "")), placeholder: "General", onChange: (numberFormat) => onChange({ ...value, numberFormat: numberFormat || null }) }),
8874
8984
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Calculated field formula", value: _nullishCoalesce(value.formula, () => ( "")), placeholder: "Leave blank for a source field", onChange: (formula) => onChange({ ...value, formula: formula || null }) }),
8875
8985
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: "Use field names in formulas. Enclose names containing spaces in single quotes or square brackets." }),
@@ -8880,20 +8990,20 @@ function AxisSettings({ pivot, axis, onChange, onAddDateLevel }) {
8880
8990
  const source = pivot.fields.find((field) => field.index === axis.field);
8881
8991
  const grouping = axis.grouping;
8882
8992
  const updateGrouping = (patch) => onChange({ ...axis, grouping: { ...grouping, ...patch }, items: [], collapsed: [] });
8883
- const availableUnits = DATE_UNITS.filter((unit) => ![...pivot.rows, ...pivot.columns].some((field) => field.field === axis.field && _optionalChain([field, 'access', _637 => _637.grouping, 'optionalAccess', _638 => _638.kind]) === "date" && field.grouping.unit === unit));
8993
+ const availableUnits = DATE_UNITS.filter((unit) => ![...pivot.rows, ...pivot.columns].some((field) => field.field === axis.field && _optionalChain([field, 'access', _642 => _642.grouping, 'optionalAccess', _643 => _643.kind]) === "date" && field.grouping.unit === unit));
8884
8994
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: [
8885
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Custom name", value: _nullishCoalesce(axis.name, () => ( "")), placeholder: _optionalChain([source, 'optionalAccess', _639 => _639.name]), onChange: (name) => onChange({ ...axis, name: name || null }) }),
8995
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Custom name", value: _nullishCoalesce(axis.name, () => ( "")), placeholder: _optionalChain([source, 'optionalAccess', _644 => _644.name]), onChange: (name) => onChange({ ...axis, name: name || null }) }),
8886
8996
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Sort", value: axis.sort, options: [["ascending", "Ascending (A to Z)"], ["descending", "Descending (Z to A)"], ["manual", "Source order"], ["valueAscending", "Smallest to largest by value"], ["valueDescending", "Largest to smallest by value"]], onChange: (sort) => onChange({ ...axis, sort, sortMeasure: _nullishCoalesce(axis.sortMeasure, () => ( 0)) }) }),
8887
8997
  axis.sort.startsWith("value") ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Sort by value", value: String(_nullishCoalesce(axis.sortMeasure, () => ( 0))), options: pivot.values.map((value, index) => [String(index), value.name]), onChange: (sortMeasure) => onChange({ ...axis, sortMeasure: Number(sortMeasure) }) }) : null,
8888
8998
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Check, { label: "Show subtotals", checked: axis.subtotals, onChange: (subtotals) => onChange({ ...axis, subtotals }) }),
8889
8999
  axis.subtotals ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "details", { children: [
8890
9000
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "summary", { style: { cursor: "pointer" }, children: "Custom subtotal functions" }),
8891
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 3, marginTop: 6 }, children: AGGREGATIONS.map(([value, label]) => /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Check, { label, checked: _nullishCoalesce(_optionalChain([axis, 'access', _640 => _640.subtotalFunctions, 'optionalAccess', _641 => _641.includes, 'call', _642 => _642(value)]), () => ( false)), onChange: (checked) => onChange({ ...axis, subtotalFunctions: checked ? [..._nullishCoalesce(axis.subtotalFunctions, () => ( [])), value] : _optionalChain([axis, 'access', _643 => _643.subtotalFunctions, 'optionalAccess', _644 => _644.filter, 'call', _645 => _645((item) => item !== value)]) }) }, value)) }),
9001
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 3, marginTop: 6 }, children: AGGREGATIONS.map(([value, label]) => /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Check, { label, checked: _nullishCoalesce(_optionalChain([axis, 'access', _645 => _645.subtotalFunctions, 'optionalAccess', _646 => _646.includes, 'call', _647 => _647(value)]), () => ( false)), onChange: (checked) => onChange({ ...axis, subtotalFunctions: checked ? [..._nullishCoalesce(axis.subtotalFunctions, () => ( [])), value] : _optionalChain([axis, 'access', _648 => _648.subtotalFunctions, 'optionalAccess', _649 => _649.filter, 'call', _650 => _650((item) => item !== value)]) }) }, value)) }),
8892
9002
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: "Leave unchecked to use the value field\u2019s summary function." })
8893
9003
  ] }) : null,
8894
9004
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Check, { label: "Show items with no data", checked: _nullishCoalesce(axis.showItemsWithNoData, () => ( false)), onChange: (showItemsWithNoData) => onChange({ ...axis, showItemsWithNoData }) }),
8895
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Grouping", value: _nullishCoalesce(_optionalChain([grouping, 'optionalAccess', _646 => _646.kind]), () => ( "none")), options: [["none", "None"], ["number", "Numeric intervals"], ["date", "Date intervals"], ["manual", "Named groups"]], onChange: (kind) => onChange({ ...axis, grouping: kind === "none" ? null : { kind, unit: "months", interval: 1, groups: [] }, items: [], collapsed: [] }) }),
8896
- _optionalChain([grouping, 'optionalAccess', _647 => _647.kind]) === "date" ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Group dates by", value: grouping.unit, options: DATE_UNITS.map((unit) => [unit, unit[0].toUpperCase() + unit.slice(1)]), onChange: (unit) => updateGrouping({ unit }) }) : null,
9005
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Grouping", value: _nullishCoalesce(_optionalChain([grouping, 'optionalAccess', _651 => _651.kind]), () => ( "none")), options: [["none", "None"], ["number", "Numeric intervals"], ["date", "Date intervals"], ["manual", "Named groups"]], onChange: (kind) => onChange({ ...axis, grouping: kind === "none" ? null : { kind, unit: "months", interval: 1, groups: [] }, items: [], collapsed: [] }) }),
9006
+ _optionalChain([grouping, 'optionalAccess', _652 => _652.kind]) === "date" ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Group dates by", value: grouping.unit, options: DATE_UNITS.map((unit) => [unit, unit[0].toUpperCase() + unit.slice(1)]), onChange: (unit) => updateGrouping({ unit }) }) : null,
8897
9007
  grouping && grouping.kind !== "manual" ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: [
8898
9008
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Interval", type: "number", min: 1e-6, step: "any", value: String(grouping.interval), onChange: (interval) => updateGrouping({ interval: Number(interval) }) }),
8899
9009
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: 8 }, children: [
@@ -8902,18 +9012,18 @@ function AxisSettings({ pivot, axis, onChange, onAddDateLevel }) {
8902
9012
  ] }),
8903
9013
  grouping.kind === "date" ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: "Optional bounds use Excel date serial values." }) : null
8904
9014
  ] }) : null,
8905
- _optionalChain([grouping, 'optionalAccess', _648 => _648.kind]) === "date" && availableUnits.length ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Add date grouping level", value: "", placeholder: "Choose a level", options: availableUnits.map((unit) => [unit, unit[0].toUpperCase() + unit.slice(1)]), onChange: (unit) => onAddDateLevel(unit) }) : null,
8906
- _optionalChain([grouping, 'optionalAccess', _649 => _649.kind]) === "manual" ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: [
9015
+ _optionalChain([grouping, 'optionalAccess', _653 => _653.kind]) === "date" && availableUnits.length ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "Add date grouping level", value: "", placeholder: "Choose a level", options: availableUnits.map((unit) => [unit, unit[0].toUpperCase() + unit.slice(1)]), onChange: (unit) => onAddDateLevel(unit) }) : null,
9016
+ _optionalChain([grouping, 'optionalAccess', _654 => _654.kind]) === "manual" ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: [
8907
9017
  grouping.groups.map((group, index) => /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { ...stack2, borderTop: "1px solid var(--xlsx-pivot-border)", paddingTop: 8 }, children: [
8908
9018
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Group name", value: group.name, onChange: (name) => updateGrouping({ groups: grouping.groups.map((item, position) => position === index ? { ...item, name } : item) }) }),
8909
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Members, { items: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _650 => _650.items]), () => ( [])), selected: group.members, onChange: (members) => updateGrouping({ groups: grouping.groups.map((item, position) => position === index ? { ...item, members } : item) }) }),
9019
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Members, { items: _nullishCoalesce(_optionalChain([source, 'optionalAccess', _655 => _655.items]), () => ( [])), selected: group.members, onChange: (members) => updateGrouping({ groups: grouping.groups.map((item, position) => position === index ? { ...item, members } : item) }) }),
8910
9020
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Action, { onClick: () => updateGrouping({ groups: grouping.groups.filter((_2, position) => position !== index) }), children: "Remove group" })
8911
9021
  ] }, index)),
8912
9022
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Action, { onClick: () => updateGrouping({ groups: [...grouping.groups, { name: `Group ${grouping.groups.length + 1}`, members: [] }] }), children: "Add named group" })
8913
9023
  ] }) : null,
8914
9024
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "details", { children: [
8915
9025
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "summary", { style: { cursor: "pointer" }, children: "Collapse members" }),
8916
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { paddingTop: 8 }, children: grouping && !_optionalChain([axis, 'access', _651 => _651.items, 'optionalAccess', _652 => _652.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: "Apply grouping to load its members." }) : /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Members, { label: "Members to collapse", items: _optionalChain([axis, 'access', _653 => _653.items, 'optionalAccess', _654 => _654.length]) ? axis.items : _nullishCoalesce(_optionalChain([source, 'optionalAccess', _655 => _655.items]), () => ( [])), selected: axis.collapsed, onChange: (collapsed) => onChange({ ...axis, collapsed }) }) })
9026
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { paddingTop: 8 }, children: grouping && !_optionalChain([axis, 'access', _656 => _656.items, 'optionalAccess', _657 => _657.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: "Apply grouping to load its members." }) : /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Members, { label: "Members to collapse", items: _optionalChain([axis, 'access', _658 => _658.items, 'optionalAccess', _659 => _659.length]) ? axis.items : _nullishCoalesce(_optionalChain([source, 'optionalAccess', _660 => _660.items]), () => ( [])), selected: axis.collapsed, onChange: (collapsed) => onChange({ ...axis, collapsed }) }) })
8917
9027
  ] })
8918
9028
  ] });
8919
9029
  }
@@ -8921,7 +9031,7 @@ function FieldFilters({ editor, pivot, field, axis }) {
8921
9031
  const source = pivot.fields.find((item) => item.index === field);
8922
9032
  const filterAxis = _nullishCoalesce(axis, () => ( [...pivot.rows, ...pivot.columns].find((item) => item.field === field && item.grouping)));
8923
9033
  const unit = groupingUnit(filterAxis);
8924
- const members = _optionalChain([filterAxis, 'optionalAccess', _656 => _656.items, 'optionalAccess', _657 => _657.length]) ? filterAxis.items : _nullishCoalesce(_optionalChain([source, 'optionalAccess', _658 => _658.items]), () => ( []));
9034
+ const members = _optionalChain([filterAxis, 'optionalAccess', _661 => _661.items, 'optionalAccess', _662 => _662.length]) ? filterAxis.items : _nullishCoalesce(_optionalChain([source, 'optionalAccess', _663 => _663.items]), () => ( []));
8925
9035
  const filters = pivot.filters.map((filter, index) => ({ filter, index })).filter(({ filter }) => filter.field === field && (_nullishCoalesce(filter.groupingUnit, () => ( null))) === unit);
8926
9036
  const kinds = [["members", "Select items"], ["label", "Label filter"], ["value", "Value filter"], ["top10", "Top / bottom filter"]];
8927
9037
  const update = (index, next) => editor.edit((current) => ({ ...current, filters: current.filters.flatMap((filter, position) => position === index ? next ? [next] : [] : [filter]) }));
@@ -8930,10 +9040,10 @@ function FieldFilters({ editor, pivot, field, axis }) {
8930
9040
  "Field filters",
8931
9041
  unit ? ` \xB7 ${unit}` : ""
8932
9042
  ] }),
8933
- _optionalChain([filterAxis, 'optionalAccess', _659 => _659.grouping]) && !_optionalChain([filterAxis, 'access', _660 => _660.items, 'optionalAccess', _661 => _661.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: "Apply grouping before selecting its members." }) : null,
9043
+ _optionalChain([filterAxis, 'optionalAccess', _664 => _664.grouping]) && !_optionalChain([filterAxis, 'access', _665 => _665.items, 'optionalAccess', _666 => _666.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: "Apply grouping before selecting its members." }) : null,
8934
9044
  filters.map(({ filter, index }) => /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { ...stack2, paddingBlock: 8, borderTop: "1px solid var(--xlsx-pivot-border)" }, children: [
8935
9045
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { ...row2, justifyContent: "space-between" }, children: [
8936
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "span", { children: _optionalChain([kinds, 'access', _662 => _662.find, 'call', _663 => _663(([kind]) => kind === filter.kind), 'optionalAccess', _664 => _664[1]]) }),
9046
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "span", { children: _optionalChain([kinds, 'access', _667 => _667.find, 'call', _668 => _668(([kind]) => kind === filter.kind), 'optionalAccess', _669 => _669[1]]) }),
8937
9047
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Action, { "aria-label": `Remove ${filter.kind} filter`, onClick: () => update(index, null), children: "\xD7" })
8938
9048
  ] }),
8939
9049
  filter.kind === "members" ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Members, { items: members, selected: filter.values, onChange: (values) => update(index, { ...filter, values }) }) : null,
@@ -8993,10 +9103,10 @@ function Advanced({ editor, pivot }) {
8993
9103
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Text, { label: "Formula", value: item.formula, onChange: (formula) => update({ calculatedItems: pivot.calculatedItems.map((entry, position) => position === index ? { ...entry, formula } : entry) }) }),
8994
9104
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Action, { onClick: () => update({ calculatedItems: pivot.calculatedItems.filter((_2, position) => position !== index) }), children: "Remove calculated item" })
8995
9105
  ] }, index)),
8996
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Action, { disabled: !pivot.fields.length, onClick: () => update({ calculatedItems: [...pivot.calculatedItems, { field: _nullishCoalesce(_optionalChain([pivot, 'access', _665 => _665.rows, 'access', _666 => _666[0], 'optionalAccess', _667 => _667.field]), () => ( pivot.fields[0].index)), name: `Calculated item ${pivot.calculatedItems.length + 1}`, formula: "0" }] }), children: "Add calculated item" })
9106
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Action, { disabled: !pivot.fields.length, onClick: () => update({ calculatedItems: [...pivot.calculatedItems, { field: _nullishCoalesce(_optionalChain([pivot, 'access', _670 => _670.rows, 'access', _671 => _671[0], 'optionalAccess', _672 => _672.field]), () => ( pivot.fields[0].index)), name: `Calculated item ${pivot.calculatedItems.length + 1}`, formula: "0" }] }), children: "Add calculated item" })
8997
9107
  ] }),
8998
9108
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Section, { title: "PivotChart", children: [
8999
- _optionalChain([pivot, 'access', _668 => _668.charts, 'optionalAccess', _669 => _669.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: [
9109
+ _optionalChain([pivot, 'access', _673 => _673.charts, 'optionalAccess', _674 => _674.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: [
9000
9110
  pivot.charts.length,
9001
9111
  " linked chart",
9002
9112
  pivot.charts.length === 1 ? "" : "s",
@@ -9029,13 +9139,13 @@ function DefaultXlsxPivotTableFieldList({ editor, isDark = false, className, sty
9029
9139
  const titleId = _chunkZ4WMURVUcjs.g.call(void 0, );
9030
9140
  const settingsId = _chunkZ4WMURVUcjs.g.call(void 0, );
9031
9141
  const pivot = editor.draft;
9032
- const disabled = editor.readOnly || Boolean(_optionalChain([pivot, 'optionalAccess', _670 => _670.unsupportedFeatures, 'access', _671 => _671.length])) || editor.sourceNeedsLoad;
9142
+ const disabled = editor.readOnly || Boolean(_optionalChain([pivot, 'optionalAccess', _675 => _675.unsupportedFeatures, 'access', _676 => _676.length])) || editor.sourceNeedsLoad;
9033
9143
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
9034
9144
  setSelected(null);
9035
9145
  setSearch("");
9036
- }, [_optionalChain([pivot, 'optionalAccess', _672 => _672.id])]);
9146
+ }, [_optionalChain([pivot, 'optionalAccess', _677 => _677.id])]);
9037
9147
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
9038
- const parent = _optionalChain([paneRef, 'access', _673 => _673.current, 'optionalAccess', _674 => _674.parentElement]);
9148
+ const parent = _optionalChain([paneRef, 'access', _678 => _678.current, 'optionalAccess', _679 => _679.parentElement]);
9039
9149
  if (!parent) return;
9040
9150
  const viewer = parent.closest(".react-xlsx-viewer");
9041
9151
  const measure = () => {
@@ -9045,16 +9155,16 @@ function DefaultXlsxPivotTableFieldList({ editor, isDark = false, className, sty
9045
9155
  };
9046
9156
  measure();
9047
9157
  const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
9048
- _optionalChain([observer, 'optionalAccess', _675 => _675.observe, 'call', _676 => _676(parent)]);
9049
- if (viewer) _optionalChain([observer, 'optionalAccess', _677 => _677.observe, 'call', _678 => _678(viewer)]);
9158
+ _optionalChain([observer, 'optionalAccess', _680 => _680.observe, 'call', _681 => _681(parent)]);
9159
+ if (viewer) _optionalChain([observer, 'optionalAccess', _682 => _682.observe, 'call', _683 => _683(viewer)]);
9050
9160
  window.addEventListener("resize", measure);
9051
9161
  return () => {
9052
- _optionalChain([observer, 'optionalAccess', _679 => _679.disconnect, 'call', _680 => _680()]);
9162
+ _optionalChain([observer, 'optionalAccess', _684 => _684.disconnect, 'call', _685 => _685()]);
9053
9163
  window.removeEventListener("resize", measure);
9054
9164
  };
9055
9165
  }, []);
9056
9166
  const selectedField = pivot && selected ? fieldIndex(pivot, selected.area, selected.index) : void 0;
9057
- const selectedCalculated = Boolean(pivot && _optionalChain([selected, 'optionalAccess', _681 => _681.area]) === "values" && _optionalChain([pivot, 'access', _682 => _682.values, 'access', _683 => _683[selected.index], 'optionalAccess', _684 => _684.formula, 'optionalAccess', _685 => _685.trim, 'call', _686 => _686()]));
9167
+ const selectedCalculated = Boolean(pivot && _optionalChain([selected, 'optionalAccess', _686 => _686.area]) === "values" && _optionalChain([pivot, 'access', _687 => _687.values, 'access', _688 => _688[selected.index], 'optionalAccess', _689 => _689.formula, 'optionalAccess', _690 => _690.trim, 'call', _691 => _691()]));
9058
9168
  const theme = {
9059
9169
  "--xlsx-pivot-bg": isDark ? "#242729" : "#fafbfa",
9060
9170
  "--xlsx-pivot-input": isDark ? "#303437" : "#ffffff",
@@ -9064,7 +9174,7 @@ function DefaultXlsxPivotTableFieldList({ editor, isDark = false, className, sty
9064
9174
  "--xlsx-pivot-hover": isDark ? "#35483d" : "#edf5ef"
9065
9175
  };
9066
9176
  const move = (from, to, index) => {
9067
- if (from.area === "values" && to !== "values" && _optionalChain([pivot, 'optionalAccess', _687 => _687.values, 'access', _688 => _688[from.index], 'optionalAccess', _689 => _689.formula, 'optionalAccess', _690 => _690.trim, 'call', _691 => _691()])) {
9177
+ if (from.area === "values" && to !== "values" && _optionalChain([pivot, 'optionalAccess', _692 => _692.values, 'access', _693 => _693[from.index], 'optionalAccess', _694 => _694.formula, 'optionalAccess', _695 => _695.trim, 'call', _696 => _696()])) {
9068
9178
  setAnnouncement("Calculated fields stay in the Values area.");
9069
9179
  return;
9070
9180
  }
@@ -9079,7 +9189,7 @@ function DefaultXlsxPivotTableFieldList({ editor, isDark = false, className, sty
9079
9189
  if (disabled) return;
9080
9190
  try {
9081
9191
  const data = JSON.parse(event.dataTransfer.getData(DRAG_TYPE));
9082
- if ("field" in data && Number.isInteger(data.field) && _optionalChain([pivot, 'optionalAccess', _692 => _692.fields, 'access', _693 => _693.some, 'call', _694 => _694((field) => field.index === data.field)])) {
9192
+ if ("field" in data && Number.isInteger(data.field) && _optionalChain([pivot, 'optionalAccess', _697 => _697.fields, 'access', _698 => _698.some, 'call', _699 => _699((field) => field.index === data.field)])) {
9083
9193
  editor.addField(area, data.field);
9084
9194
  setAnnouncement(`Field added to ${AREA_NAMES[area]}.`);
9085
9195
  } else if ("area" in data && AREAS.includes(data.area) && Number.isInteger(data.index) && pivot && data.index >= 0 && data.index < pivot[data.area].length) move(data, area, index);
@@ -9099,14 +9209,14 @@ function DefaultXlsxPivotTableFieldList({ editor, isDark = false, className, sty
9099
9209
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { overflowY: "auto", flex: 1, minHeight: 0 }, children: [
9100
9210
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { ...stack2, padding: 12 }, children: [
9101
9211
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { ...row2, alignItems: "end" }, children: [
9102
- /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "PivotTable", value: _nullishCoalesce(_optionalChain([pivot, 'optionalAccess', _695 => _695.id]), () => ( "")), placeholder: pivot && !pivot.id ? pivot.name : "Choose a PivotTable", options: editor.viewer.pivotTables.map((item) => [item.id, item.name]), onChange: editor.select, disabled: editor.dirty }) }),
9212
+ /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Choice2, { label: "PivotTable", value: _nullishCoalesce(_optionalChain([pivot, 'optionalAccess', _700 => _700.id]), () => ( "")), placeholder: pivot && !pivot.id ? pivot.name : "Choose a PivotTable", options: editor.viewer.pivotTables.map((item) => [item.id, item.name]), onChange: editor.select, disabled: editor.dirty }) }),
9103
9213
  /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, Action, { disabled: editor.viewer.readOnly || editor.dirty, onClick: editor.create, children: "New" })
9104
9214
  ] }),
9105
9215
  editor.error ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { role: "alert", style: { margin: 0, color: isDark ? "#ffb7b0" : "#a12622", overflowWrap: "anywhere" }, children: editor.error }) : null,
9106
9216
  editor.status ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { role: "status", style: hint, children: editor.status }) : null,
9107
9217
  editor.stale ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { role: "alert", style: hint, children: "The worksheet changed while you were editing. Discard these changes to load the current PivotTable." }) : null,
9108
9218
  editor.sourceNeedsLoad ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { role: "status", style: hint, children: "The source changed. Load its fields under Source and location." }) : null,
9109
- _optionalChain([pivot, 'optionalAccess', _696 => _696.unsupportedFeatures, 'access', _697 => _697.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: [
9219
+ _optionalChain([pivot, 'optionalAccess', _701 => _701.unsupportedFeatures, 'access', _702 => _702.length]) ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "p", { style: hint, children: [
9110
9220
  "This PivotTable is preserved for Excel. Editing is unavailable for: ",
9111
9221
  pivot.unsupportedFeatures.join(", "),
9112
9222
  "."
@@ -9148,7 +9258,7 @@ function DefaultXlsxPivotTableFieldList({ editor, isDark = false, className, sty
9148
9258
  pivot[area].map((_2, index) => {
9149
9259
  const field = fieldIndex(pivot, area, index);
9150
9260
  const name = area === "values" ? pivot.values[index].name : area === "reportFilters" ? fieldName(pivot, field) : pivot[area][index].name || fieldName(pivot, field);
9151
- const active = _optionalChain([selected, 'optionalAccess', _698 => _698.area]) === area && selected.index === index;
9261
+ const active = _optionalChain([selected, 'optionalAccess', _703 => _703.area]) === area && selected.index === index;
9152
9262
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { draggable: !disabled, onDragStart: (event) => drag(event, { area, index }), onDrop: (event) => drop(event, area, index), style: { marginBottom: 3 }, children: /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "button", { type: "button", "aria-expanded": active, "aria-controls": settingsId, title: `${name} settings. Alt+Up or Alt+Down reorders the field.`, onClick: () => setSelected(active ? null : { area, index }), onKeyDown: (event) => {
9153
9263
  if (!event.altKey || !["ArrowUp", "ArrowDown"].includes(event.key)) return;
9154
9264
  event.preventDefault();
@@ -9273,7 +9383,7 @@ function preloadChartRenderers(chartsBySheet, experimentalOfficeCharts) {
9273
9383
  for (const chart of charts) {
9274
9384
  const source = chart.renderSource;
9275
9385
  hasSharedCharts ||= Boolean(source && !source.experimental);
9276
- hasExtendedCharts ||= Boolean(_optionalChain([source, 'optionalAccess', _699 => _699.experimental]));
9386
+ hasExtendedCharts ||= Boolean(_optionalChain([source, 'optionalAccess', _704 => _704.experimental]));
9277
9387
  }
9278
9388
  }
9279
9389
  if (experimentalOfficeCharts && (hasExtendedCharts || hasSharedCharts)) void suppliedOfficeChartRenderer.load().catch(() => {
@@ -9975,7 +10085,7 @@ function parseCanvasGradientStops(value) {
9975
10085
  if (!match) {
9976
10086
  return null;
9977
10087
  }
9978
- const color = _optionalChain([match, 'access', _700 => _700[1], 'optionalAccess', _701 => _701.trim, 'call', _702 => _702()]);
10088
+ const color = _optionalChain([match, 'access', _705 => _705[1], 'optionalAccess', _706 => _706.trim, 'call', _707 => _707()]);
9979
10089
  const percent = match[2] ? Number.parseFloat(match[2]) : Number.NaN;
9980
10090
  if (!color) {
9981
10091
  return null;
@@ -9991,7 +10101,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
9991
10101
  if (linearMatch) {
9992
10102
  const parts = splitCssGradientArgs(_nullishCoalesce(linearMatch[1], () => ( "")));
9993
10103
  if (parts.length >= 2) {
9994
- const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _703 => _703[0], 'optionalAccess', _704 => _704.trim, 'call', _705 => _705()]), () => ( "180deg"));
10104
+ const rawAngle = _nullishCoalesce(_optionalChain([parts, 'access', _708 => _708[0], 'optionalAccess', _709 => _709.trim, 'call', _710 => _710()]), () => ( "180deg"));
9995
10105
  const angleMatch = rawAngle.match(/(-?\d*\.?\d+)deg/i);
9996
10106
  const cssAngle = angleMatch ? Number.parseFloat(_nullishCoalesce(angleMatch[1], () => ( "180"))) : 180;
9997
10107
  const radians = (90 - cssAngle) * Math.PI / 180;
@@ -10021,7 +10131,7 @@ function resolveCanvasGradientFill(context, rect, backgroundImage) {
10021
10131
  const radialMatch = backgroundImage.match(/^radial-gradient\((.*)\)$/i);
10022
10132
  if (radialMatch) {
10023
10133
  const parts = splitCssGradientArgs(_nullishCoalesce(radialMatch[1], () => ( "")));
10024
- const stopParts = _optionalChain([parts, 'access', _706 => _706[0], 'optionalAccess', _707 => _707.startsWith, 'call', _708 => _708("circle")]) ? parts.slice(1) : parts;
10134
+ const stopParts = _optionalChain([parts, 'access', _711 => _711[0], 'optionalAccess', _712 => _712.startsWith, 'call', _713 => _713("circle")]) ? parts.slice(1) : parts;
10025
10135
  const gradient = context.createRadialGradient(
10026
10136
  rect.left + rect.width / 2,
10027
10137
  rect.top + rect.height / 2,
@@ -10201,7 +10311,7 @@ function resolveDarkModeSurface(themePalette, palette) {
10201
10311
  return "hsl(225 4% 6%)";
10202
10312
  }
10203
10313
  function resolveSheetSurface(sheet, palette) {
10204
- return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _709 => _709.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _710 => _710.themePalette, 'access', _711 => _711.colorsByIndex, 'access', _712 => _712[0]]), () => ( SHEET_SURFACE));
10314
+ return paletteIsDark(palette) ? resolveDarkModeSurface(_optionalChain([sheet, 'optionalAccess', _714 => _714.themePalette]), palette) : _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _715 => _715.themePalette, 'access', _716 => _716.colorsByIndex, 'access', _717 => _717[0]]), () => ( SHEET_SURFACE));
10205
10315
  }
10206
10316
  function normalizeRange2(range) {
10207
10317
  return {
@@ -10399,7 +10509,7 @@ function buildVisibleAxisIndices(precomputed, displayLimit, maxUsedIndex, hidden
10399
10509
  const visible = precomputed.filter((index) => index < displayLimit);
10400
10510
  const appendStart = precomputed.length ? Math.max(0, maxUsedIndex + 1) : 0;
10401
10511
  for (let index = appendStart; index < displayLimit; index++) {
10402
- if (!_optionalChain([hiddenIndices, 'optionalAccess', _713 => _713.has, 'call', _714 => _714(index)])) visible.push(index);
10512
+ if (!_optionalChain([hiddenIndices, 'optionalAccess', _718 => _718.has, 'call', _719 => _719(index)])) visible.push(index);
10403
10513
  }
10404
10514
  return visible;
10405
10515
  }
@@ -10421,31 +10531,31 @@ function resolveAxisStartOffset(actualIndex, actualIndices, sizes, indexByActual
10421
10531
  if (actualPrefixSums && actualIndex >= 0 && actualIndex < actualPrefixSums.length) {
10422
10532
  return _nullishCoalesce(actualPrefixSums[actualIndex], () => ( 0));
10423
10533
  }
10424
- const visibleIndex = _optionalChain([indexByActual, 'optionalAccess', _715 => _715.get, 'call', _716 => _716(actualIndex)]);
10534
+ const visibleIndex = _optionalChain([indexByActual, 'optionalAccess', _720 => _720.get, 'call', _721 => _721(actualIndex)]);
10425
10535
  if (visibleIndex !== void 0 && prefixSums) {
10426
10536
  return _nullishCoalesce(prefixSums[visibleIndex], () => ( 0));
10427
10537
  }
10428
10538
  return sumBeforeActualIndex(actualIndices, sizes, actualIndex);
10429
10539
  }
10430
10540
  function resolveAnchoredRect(anchor, visibleRows, visibleCols, rowHeights, colWidths, options2) {
10431
- const headerHeight = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _717 => _717.headerHeight]), () => ( HEADER_HEIGHT));
10432
- const rowHeaderWidth = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _718 => _718.rowHeaderWidth]), () => ( ROW_HEADER_WIDTH));
10433
- const anchorZoomFactor = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _719 => _719.zoomFactor]), () => ( 1));
10541
+ const headerHeight = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _722 => _722.headerHeight]), () => ( HEADER_HEIGHT));
10542
+ const rowHeaderWidth = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _723 => _723.rowHeaderWidth]), () => ( ROW_HEADER_WIDTH));
10543
+ const anchorZoomFactor = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _724 => _724.zoomFactor]), () => ( 1));
10434
10544
  const resolveMarkerLeft = (col, colOffsetEmu) => rowHeaderWidth + resolveAxisStartOffset(
10435
10545
  col,
10436
10546
  visibleCols,
10437
10547
  colWidths,
10438
- _optionalChain([options2, 'optionalAccess', _720 => _720.colIndexByActual]),
10439
- _optionalChain([options2, 'optionalAccess', _721 => _721.colPrefixSums]),
10440
- _optionalChain([options2, 'optionalAccess', _722 => _722.actualColPrefixSums])
10548
+ _optionalChain([options2, 'optionalAccess', _725 => _725.colIndexByActual]),
10549
+ _optionalChain([options2, 'optionalAccess', _726 => _726.colPrefixSums]),
10550
+ _optionalChain([options2, 'optionalAccess', _727 => _727.actualColPrefixSums])
10441
10551
  ) + _chunkGP5SOQQHcjs.emuToPixels.call(void 0, colOffsetEmu) * anchorZoomFactor;
10442
10552
  const resolveMarkerTop = (row3, rowOffsetEmu) => headerHeight + resolveAxisStartOffset(
10443
10553
  row3,
10444
10554
  visibleRows,
10445
10555
  rowHeights,
10446
- _optionalChain([options2, 'optionalAccess', _723 => _723.rowIndexByActual]),
10447
- _optionalChain([options2, 'optionalAccess', _724 => _724.rowPrefixSums]),
10448
- _optionalChain([options2, 'optionalAccess', _725 => _725.actualRowPrefixSums])
10556
+ _optionalChain([options2, 'optionalAccess', _728 => _728.rowIndexByActual]),
10557
+ _optionalChain([options2, 'optionalAccess', _729 => _729.rowPrefixSums]),
10558
+ _optionalChain([options2, 'optionalAccess', _730 => _730.actualRowPrefixSums])
10449
10559
  ) + _chunkGP5SOQQHcjs.emuToPixels.call(void 0, rowOffsetEmu) * anchorZoomFactor;
10450
10560
  if (anchor.kind === "absolute") {
10451
10561
  return {
@@ -10532,15 +10642,15 @@ function rectIntersectsViewport(rect, viewport, overscan = 240) {
10532
10642
  return rectRight >= viewportLeft && rect.left <= viewportRight && rectBottom >= viewportTop && rect.top <= viewportBottom;
10533
10643
  }
10534
10644
  function resolveFrozenDrawingPane(rect, frozenRows, frozenCols, actualRowHeights, actualColWidths, freezePanes, stickyTopByRow, stickyLeftByCol, options2) {
10535
- const headerHeight = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _726 => _726.headerHeight]), () => ( HEADER_HEIGHT));
10536
- const rowHeaderWidth = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _727 => _727.rowHeaderWidth]), () => ( ROW_HEADER_WIDTH));
10537
- const defaultRowHeight = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _728 => _728.defaultRowHeight]), () => ( DEFAULT_ROW_HEIGHT2));
10538
- const defaultColWidth = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _729 => _729.defaultColWidth]), () => ( DEFAULT_COL_WIDTH2));
10539
- const frozenPaneBottom = _optionalChain([freezePanes, 'optionalAccess', _730 => _730.row]) && freezePanes.row > 0 && frozenRows.length > 0 ? frozenRows.reduce(
10645
+ const headerHeight = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _731 => _731.headerHeight]), () => ( HEADER_HEIGHT));
10646
+ const rowHeaderWidth = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _732 => _732.rowHeaderWidth]), () => ( ROW_HEADER_WIDTH));
10647
+ const defaultRowHeight = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _733 => _733.defaultRowHeight]), () => ( DEFAULT_ROW_HEIGHT2));
10648
+ const defaultColWidth = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _734 => _734.defaultColWidth]), () => ( DEFAULT_COL_WIDTH2));
10649
+ const frozenPaneBottom = _optionalChain([freezePanes, 'optionalAccess', _735 => _735.row]) && freezePanes.row > 0 && frozenRows.length > 0 ? frozenRows.reduce(
10540
10650
  (max, row3) => Math.max(max, (_nullishCoalesce(stickyTopByRow.get(row3), () => ( headerHeight))) + (_nullishCoalesce(actualRowHeights[row3], () => ( defaultRowHeight)))),
10541
10651
  headerHeight
10542
10652
  ) : null;
10543
- const frozenPaneRight = _optionalChain([freezePanes, 'optionalAccess', _731 => _731.col]) && freezePanes.col > 0 && frozenCols.length > 0 ? frozenCols.reduce(
10653
+ const frozenPaneRight = _optionalChain([freezePanes, 'optionalAccess', _736 => _736.col]) && freezePanes.col > 0 && frozenCols.length > 0 ? frozenCols.reduce(
10544
10654
  (max, col) => Math.max(max, (_nullishCoalesce(stickyLeftByCol.get(col), () => ( rowHeaderWidth))) + (_nullishCoalesce(actualColWidths[col], () => ( defaultColWidth)))),
10545
10655
  rowHeaderWidth
10546
10656
  ) : null;
@@ -10561,9 +10671,9 @@ function drawingLayer(zIndex) {
10561
10671
  return Math.round(zIndex * 1024);
10562
10672
  }
10563
10673
  function buildShapeContainerStyle(shape, rect, viewerScale = 1) {
10564
- const borderWidth = _optionalChain([shape, 'access', _732 => _732.stroke, 'optionalAccess', _733 => _733.none]) ? 0 : Math.max(0, _nullishCoalesce(_optionalChain([shape, 'access', _734 => _734.stroke, 'optionalAccess', _735 => _735.widthPx]), () => ( 0))) * viewerScale;
10565
- const strokeColor = _nullishCoalesce(_optionalChain([shape, 'access', _736 => _736.stroke, 'optionalAccess', _737 => _737.color]), () => ( "transparent"));
10566
- const fillColor = _optionalChain([shape, 'access', _738 => _738.fill, 'optionalAccess', _739 => _739.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _740 => _740.fill, 'optionalAccess', _741 => _741.color]), () => ( "transparent"));
10674
+ const borderWidth = _optionalChain([shape, 'access', _737 => _737.stroke, 'optionalAccess', _738 => _738.none]) ? 0 : Math.max(0, _nullishCoalesce(_optionalChain([shape, 'access', _739 => _739.stroke, 'optionalAccess', _740 => _740.widthPx]), () => ( 0))) * viewerScale;
10675
+ const strokeColor = _nullishCoalesce(_optionalChain([shape, 'access', _741 => _741.stroke, 'optionalAccess', _742 => _742.color]), () => ( "transparent"));
10676
+ const fillColor = _optionalChain([shape, 'access', _743 => _743.fill, 'optionalAccess', _744 => _744.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _745 => _745.fill, 'optionalAccess', _746 => _746.color]), () => ( "transparent"));
10567
10677
  const hasVisibleText = shape.paragraphs.some((paragraph) => paragraph.runs.some((run) => run.text.trim().length > 0));
10568
10678
  const transformParts = [
10569
10679
  shape.rotationDeg ? `rotate(${shape.rotationDeg}deg)` : "",
@@ -10577,7 +10687,7 @@ function buildShapeContainerStyle(shape, rect, viewerScale = 1) {
10577
10687
  borderRadius = 12 * viewerScale;
10578
10688
  }
10579
10689
  return {
10580
- alignItems: _optionalChain([shape, 'access', _742 => _742.textBox, 'optionalAccess', _743 => _743.verticalAlign]) === "middle" ? "center" : _optionalChain([shape, 'access', _744 => _744.textBox, 'optionalAccess', _745 => _745.verticalAlign]) === "bottom" ? "flex-end" : "flex-start",
10690
+ alignItems: _optionalChain([shape, 'access', _747 => _747.textBox, 'optionalAccess', _748 => _748.verticalAlign]) === "middle" ? "center" : _optionalChain([shape, 'access', _749 => _749.textBox, 'optionalAccess', _750 => _750.verticalAlign]) === "bottom" ? "flex-end" : "flex-start",
10581
10691
  backgroundColor: fillColor,
10582
10692
  border: borderWidth > 0 ? `${borderWidth}px solid ${strokeColor}` : "none",
10583
10693
  borderRadius,
@@ -10587,7 +10697,7 @@ function buildShapeContainerStyle(shape, rect, viewerScale = 1) {
10587
10697
  height: rect.height,
10588
10698
  justifyContent: "flex-start",
10589
10699
  left: rect.left,
10590
- opacity: Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _746 => _746.fill, 'optionalAccess', _747 => _747.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _748 => _748.stroke, 'optionalAccess', _749 => _749.opacity]), () => ( 1))),
10700
+ opacity: Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _751 => _751.fill, 'optionalAccess', _752 => _752.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _753 => _753.stroke, 'optionalAccess', _754 => _754.opacity]), () => ( 1))),
10591
10701
  overflow: hasVisibleText ? "hidden" : "visible",
10592
10702
  position: "absolute",
10593
10703
  top: rect.top,
@@ -10604,7 +10714,7 @@ function clampPercent(value, fallback) {
10604
10714
  return Math.max(0, Math.min(100, value));
10605
10715
  }
10606
10716
  function resolveShapeAdjustment(shape, name, fallback) {
10607
- const rawValue = _optionalChain([shape, 'access', _750 => _750.geometryAdjustments, 'optionalAccess', _751 => _751[name]]);
10717
+ const rawValue = _optionalChain([shape, 'access', _755 => _755.geometryAdjustments, 'optionalAccess', _756 => _756[name]]);
10608
10718
  if (typeof rawValue !== "number") {
10609
10719
  return fallback;
10610
10720
  }
@@ -11541,9 +11651,9 @@ function renderShapeParagraph(paragraph, index, fallbackAlign = "left", textScal
11541
11651
  );
11542
11652
  }
11543
11653
  function clampImageRect(rect, options2) {
11544
- const contentOffsetLeft = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _752 => _752.contentOffsetLeft]), () => ( ROW_HEADER_WIDTH));
11545
- const contentOffsetTop = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _753 => _753.contentOffsetTop]), () => ( HEADER_HEIGHT));
11546
- const minSizePx = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _754 => _754.minSizePx]), () => ( IMAGE_MIN_SIZE_PX));
11654
+ const contentOffsetLeft = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _757 => _757.contentOffsetLeft]), () => ( ROW_HEADER_WIDTH));
11655
+ const contentOffsetTop = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _758 => _758.contentOffsetTop]), () => ( HEADER_HEIGHT));
11656
+ const minSizePx = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _759 => _759.minSizePx]), () => ( IMAGE_MIN_SIZE_PX));
11547
11657
  return {
11548
11658
  height: Math.max(minSizePx, rect.height),
11549
11659
  left: Math.max(contentOffsetLeft, rect.left),
@@ -11794,24 +11904,24 @@ function escapeCssFontFamily(name) {
11794
11904
  return /[\s"'(),]/.test(name) ? `"${name.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : name;
11795
11905
  }
11796
11906
  function resolveSpreadsheetThemeFont(font, themePalette) {
11797
- const scheme = typeof _optionalChain([font, 'optionalAccess', _755 => _755.scheme]) === "string" ? font.scheme : null;
11907
+ const scheme = typeof _optionalChain([font, 'optionalAccess', _760 => _760.scheme]) === "string" ? font.scheme : null;
11798
11908
  if (scheme === "major") {
11799
- return _optionalChain([themePalette, 'optionalAccess', _756 => _756.majorLatinFont]);
11909
+ return _optionalChain([themePalette, 'optionalAccess', _761 => _761.majorLatinFont]);
11800
11910
  }
11801
11911
  if (scheme === "minor") {
11802
- return _optionalChain([themePalette, 'optionalAccess', _757 => _757.minorLatinFont]);
11912
+ return _optionalChain([themePalette, 'optionalAccess', _762 => _762.minorLatinFont]);
11803
11913
  }
11804
11914
  return void 0;
11805
11915
  }
11806
11916
  function buildSpreadsheetFontFamily(font, themePalette) {
11807
11917
  const candidates = [
11808
- typeof _optionalChain([font, 'optionalAccess', _758 => _758.name]) === "string" ? font.name.trim() : "",
11809
- _nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _759 => _759(font, themePalette), 'optionalAccess', _760 => _760.trim, 'call', _761 => _761()]), () => ( ""))
11918
+ typeof _optionalChain([font, 'optionalAccess', _763 => _763.name]) === "string" ? font.name.trim() : "",
11919
+ _nullishCoalesce(_optionalChain([resolveSpreadsheetThemeFont, 'call', _764 => _764(font, themePalette), 'optionalAccess', _765 => _765.trim, 'call', _766 => _766()]), () => ( ""))
11810
11920
  ].filter((value, index, array) => value.length > 0 && array.indexOf(value) === index);
11811
11921
  if (candidates.length === 0) {
11812
11922
  return void 0;
11813
11923
  }
11814
- const primaryFont = _optionalChain([candidates, 'access', _762 => _762[0], 'optionalAccess', _763 => _763.toLowerCase, 'call', _764 => _764()]);
11924
+ const primaryFont = _optionalChain([candidates, 'access', _767 => _767[0], 'optionalAccess', _768 => _768.toLowerCase, 'call', _769 => _769()]);
11815
11925
  if (primaryFont === "calibri") {
11816
11926
  return [
11817
11927
  "Calibri",
@@ -11844,17 +11954,17 @@ function resolveSpreadsheetLineHeight(fontSizePt) {
11844
11954
  }
11845
11955
  function buildGridlineShadow(color, options2) {
11846
11956
  const parts = [];
11847
- if (_optionalChain([options2, 'optionalAccess', _765 => _765.right]) !== false) {
11957
+ if (_optionalChain([options2, 'optionalAccess', _770 => _770.right]) !== false) {
11848
11958
  parts.push(`inset -1px 0 0 ${color}`);
11849
11959
  }
11850
- if (_optionalChain([options2, 'optionalAccess', _766 => _766.bottom]) !== false) {
11960
+ if (_optionalChain([options2, 'optionalAccess', _771 => _771.bottom]) !== false) {
11851
11961
  parts.push(`inset 0 -1px 0 ${color}`);
11852
11962
  }
11853
11963
  return parts.join(", ");
11854
11964
  }
11855
11965
  function buildCellStyle(style, palette, themePalette, options2) {
11856
- const showGridLines = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _767 => _767.showGridLines]), () => ( true));
11857
- const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _768 => _768.colorsByIndex, 'access', _769 => _769[0]]), () => ( SHEET_SURFACE));
11966
+ const showGridLines = _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _772 => _772.showGridLines]), () => ( true));
11967
+ const baseSurface = paletteIsDark(palette) ? resolveDarkModeSurface(themePalette, palette) : _nullishCoalesce(_optionalChain([themePalette, 'optionalAccess', _773 => _773.colorsByIndex, 'access', _774 => _774[0]]), () => ( SHEET_SURFACE));
11858
11968
  const gridlineShadow = showGridLines ? buildGridlineShadow(palette.border) : void 0;
11859
11969
  const css = {
11860
11970
  backgroundColor: baseSurface,
@@ -11867,7 +11977,7 @@ function buildCellStyle(style, palette, themePalette, options2) {
11867
11977
  lineHeight: String(resolveSpreadsheetLineHeight(11)),
11868
11978
  overflow: "hidden",
11869
11979
  padding: DEFAULT_CELL_PADDING,
11870
- textAlign: _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _770 => _770.generalAlignment]), () => ( "left")),
11980
+ textAlign: _nullishCoalesce(_optionalChain([options2, 'optionalAccess', _775 => _775.generalAlignment]), () => ( "left")),
11871
11981
  textOverflow: "clip",
11872
11982
  verticalAlign: "bottom",
11873
11983
  whiteSpace: "nowrap"
@@ -11951,24 +12061,24 @@ function buildCellStyle(style, palette, themePalette, options2) {
11951
12061
  }
11952
12062
  const border = style.border;
11953
12063
  if (border) {
11954
- const hasRightBorder = Boolean(_optionalChain([border, 'access', _771 => _771.right, 'optionalAccess', _772 => _772.style]) && border.right.style !== "none");
11955
- const hasBottomBorder = Boolean(_optionalChain([border, 'access', _773 => _773.bottom, 'optionalAccess', _774 => _774.style]) && border.bottom.style !== "none");
12064
+ const hasRightBorder = Boolean(_optionalChain([border, 'access', _776 => _776.right, 'optionalAccess', _777 => _777.style]) && border.right.style !== "none");
12065
+ const hasBottomBorder = Boolean(_optionalChain([border, 'access', _778 => _778.bottom, 'optionalAccess', _779 => _779.style]) && border.bottom.style !== "none");
11956
12066
  if (showGridLines && (hasRightBorder || hasBottomBorder)) {
11957
12067
  css.boxShadow = buildGridlineShadow(palette.border, {
11958
12068
  bottom: !hasBottomBorder,
11959
12069
  right: !hasRightBorder
11960
12070
  }) || void 0;
11961
12071
  }
11962
- if (_optionalChain([border, 'access', _775 => _775.top, 'optionalAccess', _776 => _776.style]) && border.top.style !== "none") {
12072
+ if (_optionalChain([border, 'access', _780 => _780.top, 'optionalAccess', _781 => _781.style]) && border.top.style !== "none") {
11963
12073
  css.borderTop = mapBorder2(border.top, themePalette);
11964
12074
  }
11965
- if (_optionalChain([border, 'access', _777 => _777.right, 'optionalAccess', _778 => _778.style]) && border.right.style !== "none") {
12075
+ if (_optionalChain([border, 'access', _782 => _782.right, 'optionalAccess', _783 => _783.style]) && border.right.style !== "none") {
11966
12076
  css.borderRight = mapBorder2(border.right, themePalette);
11967
12077
  }
11968
- if (_optionalChain([border, 'access', _779 => _779.bottom, 'optionalAccess', _780 => _780.style]) && border.bottom.style !== "none") {
12078
+ if (_optionalChain([border, 'access', _784 => _784.bottom, 'optionalAccess', _785 => _785.style]) && border.bottom.style !== "none") {
11969
12079
  css.borderBottom = mapBorder2(border.bottom, themePalette);
11970
12080
  }
11971
- if (_optionalChain([border, 'access', _781 => _781.left, 'optionalAccess', _782 => _782.style]) && border.left.style !== "none") {
12081
+ if (_optionalChain([border, 'access', _786 => _786.left, 'optionalAccess', _787 => _787.style]) && border.left.style !== "none") {
11972
12082
  css.borderLeft = mapBorder2(border.left, themePalette);
11973
12083
  }
11974
12084
  }
@@ -12047,7 +12157,7 @@ function canReceiveOverflowText(data) {
12047
12157
  }
12048
12158
  function getCellDisplayValue(worksheet, row3, col, activeSheet, locale = "en-US") {
12049
12159
  const formula = worksheet.getFormulaAt(row3, col);
12050
- const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _783 => _783.cachedFormulaValues, 'optionalAccess', _784 => _784[cellAddressToA12({ row: row3, col })]]) : void 0;
12160
+ const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _788 => _788.cachedFormulaValues, 'optionalAccess', _789 => _789[cellAddressToA12({ row: row3, col })]]) : void 0;
12051
12161
  const formatted = worksheet.getFormattedValueAt(row3, col);
12052
12162
  if (formatted && !(formula && cachedFormulaValue !== void 0 && formatted.startsWith("#"))) {
12053
12163
  return _chunkGP5SOQQHcjs.localizeCellNumber.call(void 0, worksheet, row3, col, decodeHtmlEntities2(formatted), locale);
@@ -12160,13 +12270,13 @@ function resolveChartFormulaRange(formula, fallbackSheetIndex, sheets, workbook)
12160
12270
  }
12161
12271
  }
12162
12272
  const split = splitSheetFormulaReference(reference);
12163
- const range = parseA1RangeReference2((_nullishCoalesce(_optionalChain([split, 'optionalAccess', _785 => _785.range]), () => ( reference))).replace(/\$/g, ""));
12273
+ const range = parseA1RangeReference2((_nullishCoalesce(_optionalChain([split, 'optionalAccess', _790 => _790.range]), () => ( reference))).replace(/\$/g, ""));
12164
12274
  if (!range) {
12165
12275
  return null;
12166
12276
  }
12167
12277
  let workbookSheetIndex = fallbackSheetIndex;
12168
- if (_optionalChain([split, 'optionalAccess', _786 => _786.sheetName])) {
12169
- const workbookResolvedIndex = _optionalChain([workbook, 'optionalAccess', _787 => _787.sheetIndex, 'call', _788 => _788(split.sheetName)]);
12278
+ if (_optionalChain([split, 'optionalAccess', _791 => _791.sheetName])) {
12279
+ const workbookResolvedIndex = _optionalChain([workbook, 'optionalAccess', _792 => _792.sheetIndex, 'call', _793 => _793(split.sheetName)]);
12170
12280
  if (typeof workbookResolvedIndex === "number" && Number.isInteger(workbookResolvedIndex) && workbookResolvedIndex >= 0) {
12171
12281
  workbookSheetIndex = workbookResolvedIndex;
12172
12282
  } else {
@@ -12187,26 +12297,26 @@ function collectChartRangeHighlights(chart, selectedElement, sheets, workbook, i
12187
12297
  }
12188
12298
  const highlights = [];
12189
12299
  const seenRanges = /* @__PURE__ */ new Set();
12190
- const selectedSeriesIndex = _optionalChain([selectedElement, 'optionalAccess', _789 => _789.chartId]) === chart.id && selectedElement.kind !== "chart" && selectedElement.kind !== "legend" ? selectedElement.seriesIndex : null;
12300
+ const selectedSeriesIndex = _optionalChain([selectedElement, 'optionalAccess', _794 => _794.chartId]) === chart.id && selectedElement.kind !== "chart" && selectedElement.kind !== "legend" ? selectedElement.seriesIndex : null;
12191
12301
  const seriesEntries = chart.series.map((series, seriesIndex) => ({ series, seriesIndex })).filter(({ series, seriesIndex }) => series.hidden !== true && (selectedSeriesIndex == null || seriesIndex === selectedSeriesIndex));
12192
12302
  const references = seriesEntries.flatMap(({ series, seriesIndex }) => [
12193
12303
  {
12194
- formula: typeof _optionalChain([series, 'access', _790 => _790.raw, 'optionalAccess', _791 => _791.name]) === "string" ? series.raw.name : void 0,
12304
+ formula: typeof _optionalChain([series, 'access', _795 => _795.raw, 'optionalAccess', _796 => _796.name]) === "string" ? series.raw.name : void 0,
12195
12305
  role: "name",
12196
12306
  seriesIndex
12197
12307
  },
12198
12308
  {
12199
- formula: _optionalChain([series, 'access', _792 => _792.categoriesRef, 'optionalAccess', _793 => _793.formula]),
12309
+ formula: _optionalChain([series, 'access', _797 => _797.categoriesRef, 'optionalAccess', _798 => _798.formula]),
12200
12310
  role: "category",
12201
12311
  seriesIndex
12202
12312
  },
12203
12313
  {
12204
- formula: _optionalChain([series, 'access', _794 => _794.valuesRef, 'optionalAccess', _795 => _795.formula]),
12314
+ formula: _optionalChain([series, 'access', _799 => _799.valuesRef, 'optionalAccess', _800 => _800.formula]),
12205
12315
  role: "value",
12206
12316
  seriesIndex
12207
12317
  },
12208
12318
  {
12209
- formula: _optionalChain([series, 'access', _796 => _796.bubbleSizeRef, 'optionalAccess', _797 => _797.formula]),
12319
+ formula: _optionalChain([series, 'access', _801 => _801.bubbleSizeRef, 'optionalAccess', _802 => _802.formula]),
12210
12320
  role: "bubble",
12211
12321
  seriesIndex
12212
12322
  }
@@ -12378,7 +12488,7 @@ function normalizeBatchedMergeSpan(value) {
12378
12488
  }
12379
12489
  function normalizeBatchedCellValue(rawValue, formula, row3, col, activeSheet) {
12380
12490
  const value = typeof rawValue === "string" ? decodeHtmlEntities2(rawValue) : rawValue === null || rawValue === void 0 ? "" : String(rawValue);
12381
- const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _798 => _798.cachedFormulaValues, 'optionalAccess', _799 => _799[cellAddressToA12({ row: row3, col })]]) : void 0;
12491
+ const cachedFormulaValue = formula ? _optionalChain([activeSheet, 'optionalAccess', _803 => _803.cachedFormulaValues, 'optionalAccess', _804 => _804[cellAddressToA12({ row: row3, col })]]) : void 0;
12382
12492
  if (formula && cachedFormulaValue !== void 0 && value.startsWith("#")) {
12383
12493
  return cachedFormulaValue;
12384
12494
  }
@@ -12431,31 +12541,31 @@ function mergeResolvedCellStyle(base, overlay, options2) {
12431
12541
  ..._nullishCoalesce(base, () => ( {})),
12432
12542
  ..._nullishCoalesce(overlay, () => ( {}))
12433
12543
  };
12434
- const baseAlignment = _optionalChain([base, 'optionalAccess', _800 => _800.alignment]);
12435
- const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _801 => _801.alignment]);
12544
+ const baseAlignment = _optionalChain([base, 'optionalAccess', _805 => _805.alignment]);
12545
+ const overlayAlignment = _optionalChain([overlay, 'optionalAccess', _806 => _806.alignment]);
12436
12546
  if (baseAlignment || overlayAlignment) {
12437
12547
  nextStyle.alignment = {
12438
12548
  ..._nullishCoalesce(baseAlignment, () => ( {})),
12439
12549
  ..._nullishCoalesce(overlayAlignment, () => ( {}))
12440
12550
  };
12441
12551
  }
12442
- const baseBorder = _optionalChain([base, 'optionalAccess', _802 => _802.border]);
12443
- const overlayBorder = _optionalChain([overlay, 'optionalAccess', _803 => _803.border]);
12552
+ const baseBorder = _optionalChain([base, 'optionalAccess', _807 => _807.border]);
12553
+ const overlayBorder = _optionalChain([overlay, 'optionalAccess', _808 => _808.border]);
12444
12554
  if (baseBorder || overlayBorder) {
12445
- nextStyle.border = _optionalChain([options2, 'optionalAccess', _804 => _804.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
12555
+ nextStyle.border = _optionalChain([options2, 'optionalAccess', _809 => _809.replaceXfSubtrees]) && overlayBorder ? overlayBorder : {
12446
12556
  ..._nullishCoalesce(baseBorder, () => ( {})),
12447
12557
  ..._nullishCoalesce(overlayBorder, () => ( {}))
12448
12558
  };
12449
12559
  }
12450
- const baseFill = _optionalChain([base, 'optionalAccess', _805 => _805.fill]);
12451
- const overlayFill = _optionalChain([overlay, 'optionalAccess', _806 => _806.fill]);
12560
+ const baseFill = _optionalChain([base, 'optionalAccess', _810 => _810.fill]);
12561
+ const overlayFill = _optionalChain([overlay, 'optionalAccess', _811 => _811.fill]);
12452
12562
  if (baseFill || overlayFill) {
12453
- nextStyle.fill = _optionalChain([options2, 'optionalAccess', _807 => _807.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
12563
+ nextStyle.fill = _optionalChain([options2, 'optionalAccess', _812 => _812.replaceXfSubtrees]) && overlayFill ? overlayFill : _nullishCoalesce(overlayFill, () => ( baseFill));
12454
12564
  }
12455
- const baseFont = _optionalChain([base, 'optionalAccess', _808 => _808.font]);
12456
- const overlayFont = _optionalChain([overlay, 'optionalAccess', _809 => _809.font]);
12565
+ const baseFont = _optionalChain([base, 'optionalAccess', _813 => _813.font]);
12566
+ const overlayFont = _optionalChain([overlay, 'optionalAccess', _814 => _814.font]);
12457
12567
  if (baseFont || overlayFont) {
12458
- nextStyle.font = _optionalChain([options2, 'optionalAccess', _810 => _810.replaceXfSubtrees]) && overlayFont ? overlayFont : {
12568
+ nextStyle.font = _optionalChain([options2, 'optionalAccess', _815 => _815.replaceXfSubtrees]) && overlayFont ? overlayFont : {
12459
12569
  ..._nullishCoalesce(baseFont, () => ( {})),
12460
12570
  ..._nullishCoalesce(overlayFont, () => ( {}))
12461
12571
  };
@@ -12463,10 +12573,10 @@ function mergeResolvedCellStyle(base, overlay, options2) {
12463
12573
  return nextStyle;
12464
12574
  }
12465
12575
  function resolveCellTableOverrides(rawStyle, sheet, row3, col) {
12466
- const styleId = _nullishCoalesce(_nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _811 => _811.cellStyleIds, 'optionalAccess', _812 => _812[cellAddressToA12({ row: row3, col })]]), () => ( _optionalChain([sheet, 'optionalAccess', _813 => _813.rowStyleIds, 'access', _814 => _814[row3]]))), () => ( _optionalChain([sheet, 'optionalAccess', _815 => _815.colStyleIds, 'access', _816 => _816[col]])));
12467
- const declared = styleId === void 0 ? void 0 : _optionalChain([sheet, 'optionalAccess', _817 => _817.styleById, 'access', _818 => _818[styleId], 'optionalAccess', _819 => _819.tableStyleOverrides]);
12576
+ const styleId = _nullishCoalesce(_nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _816 => _816.cellStyleIds, 'optionalAccess', _817 => _817[cellAddressToA12({ row: row3, col })]]), () => ( _optionalChain([sheet, 'optionalAccess', _818 => _818.rowStyleIds, 'access', _819 => _819[row3]]))), () => ( _optionalChain([sheet, 'optionalAccess', _820 => _820.colStyleIds, 'access', _821 => _821[col]])));
12577
+ const declared = styleId === void 0 ? void 0 : _optionalChain([sheet, 'optionalAccess', _822 => _822.styleById, 'access', _823 => _823[styleId], 'optionalAccess', _824 => _824.tableStyleOverrides]);
12468
12578
  const overrides = {};
12469
- const font = asRecord(_optionalChain([rawStyle, 'optionalAccess', _820 => _820.font]));
12579
+ const font = asRecord(_optionalChain([rawStyle, 'optionalAccess', _825 => _825.font]));
12470
12580
  if (font) {
12471
12581
  const explicitFont = {};
12472
12582
  const fontDefaults = {
@@ -12479,28 +12589,28 @@ function resolveCellTableOverrides(rawStyle, sheet, row3, col) {
12479
12589
  verticalAlign: "baseline"
12480
12590
  };
12481
12591
  for (const [key, value] of Object.entries(font)) {
12482
- const isExplicit = declared ? Object.hasOwn(_nullishCoalesce(declared.font, () => ( {})), key) : key === "color" ? _optionalChain([asRecord, 'call', _821 => _821(value), 'optionalAccess', _822 => _822.colorType]) !== "auto" : value !== fontDefaults[key];
12592
+ const isExplicit = declared ? Object.hasOwn(_nullishCoalesce(declared.font, () => ( {})), key) : key === "color" ? _optionalChain([asRecord, 'call', _826 => _826(value), 'optionalAccess', _827 => _827.colorType]) !== "auto" : value !== fontDefaults[key];
12483
12593
  if (isExplicit) {
12484
12594
  explicitFont[key] = value;
12485
12595
  }
12486
12596
  }
12487
12597
  overrides.font = explicitFont;
12488
12598
  }
12489
- const fill = asRecord(_optionalChain([rawStyle, 'optionalAccess', _823 => _823.fill]));
12599
+ const fill = asRecord(_optionalChain([rawStyle, 'optionalAccess', _828 => _828.fill]));
12490
12600
  if (fill && fill.fillType !== "none") {
12491
12601
  overrides.fill = fill;
12492
12602
  }
12493
- const border = asRecord(_optionalChain([rawStyle, 'optionalAccess', _824 => _824.border]));
12603
+ const border = asRecord(_optionalChain([rawStyle, 'optionalAccess', _829 => _829.border]));
12494
12604
  if (border) {
12495
12605
  overrides.border = Object.fromEntries(Object.entries(border).filter(([, edge]) => {
12496
- const style = _optionalChain([asRecord, 'call', _825 => _825(edge), 'optionalAccess', _826 => _826.style]);
12606
+ const style = _optionalChain([asRecord, 'call', _830 => _830(edge), 'optionalAccess', _831 => _831.style]);
12497
12607
  return typeof style === "string" && style !== "none";
12498
12608
  }));
12499
12609
  }
12500
12610
  return overrides;
12501
12611
  }
12502
12612
  function resolveBorderEdgePriority(edge) {
12503
- const style = typeof _optionalChain([edge, 'optionalAccess', _827 => _827.style]) === "string" ? edge.style : "none";
12613
+ const style = typeof _optionalChain([edge, 'optionalAccess', _832 => _832.style]) === "string" ? edge.style : "none";
12504
12614
  const stylePriority = {
12505
12615
  dashed: 2,
12506
12616
  dashDot: 3,
@@ -12534,8 +12644,8 @@ function resolvePreferredBorderEdge(current, candidate) {
12534
12644
  return current;
12535
12645
  }
12536
12646
  function resolveMergedRegionBorderOverlay(row3, col, merge, resolveBaseCellStyle) {
12537
- const rowSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _828 => _828.rowSpan]), () => ( 1)));
12538
- const colSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _829 => _829.colSpan]), () => ( 1)));
12647
+ const rowSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _833 => _833.rowSpan]), () => ( 1)));
12648
+ const colSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _834 => _834.colSpan]), () => ( 1)));
12539
12649
  if (rowSpan === 1 && colSpan === 1) {
12540
12650
  return null;
12541
12651
  }
@@ -12547,19 +12657,19 @@ function resolveMergedRegionBorderOverlay(row3, col, merge, resolveBaseCellStyle
12547
12657
  let left = null;
12548
12658
  for (let targetCol = col; targetCol <= endCol; targetCol += 1) {
12549
12659
  const topStyle = resolveBaseCellStyle(row3, targetCol);
12550
- const topBorder = _optionalChain([topStyle, 'optionalAccess', _830 => _830.border]);
12551
- top = resolvePreferredBorderEdge(top, _nullishCoalesce(_optionalChain([topBorder, 'optionalAccess', _831 => _831.top]), () => ( null)));
12660
+ const topBorder = _optionalChain([topStyle, 'optionalAccess', _835 => _835.border]);
12661
+ top = resolvePreferredBorderEdge(top, _nullishCoalesce(_optionalChain([topBorder, 'optionalAccess', _836 => _836.top]), () => ( null)));
12552
12662
  const bottomStyle = resolveBaseCellStyle(endRow, targetCol);
12553
- const bottomBorder = _optionalChain([bottomStyle, 'optionalAccess', _832 => _832.border]);
12554
- bottom = resolvePreferredBorderEdge(bottom, _nullishCoalesce(_optionalChain([bottomBorder, 'optionalAccess', _833 => _833.bottom]), () => ( null)));
12663
+ const bottomBorder = _optionalChain([bottomStyle, 'optionalAccess', _837 => _837.border]);
12664
+ bottom = resolvePreferredBorderEdge(bottom, _nullishCoalesce(_optionalChain([bottomBorder, 'optionalAccess', _838 => _838.bottom]), () => ( null)));
12555
12665
  }
12556
12666
  for (let targetRow = row3; targetRow <= endRow; targetRow += 1) {
12557
12667
  const leftStyle = resolveBaseCellStyle(targetRow, col);
12558
- const leftBorder = _optionalChain([leftStyle, 'optionalAccess', _834 => _834.border]);
12559
- left = resolvePreferredBorderEdge(left, _nullishCoalesce(_optionalChain([leftBorder, 'optionalAccess', _835 => _835.left]), () => ( null)));
12668
+ const leftBorder = _optionalChain([leftStyle, 'optionalAccess', _839 => _839.border]);
12669
+ left = resolvePreferredBorderEdge(left, _nullishCoalesce(_optionalChain([leftBorder, 'optionalAccess', _840 => _840.left]), () => ( null)));
12560
12670
  const rightStyle = resolveBaseCellStyle(targetRow, endCol);
12561
- const rightBorder = _optionalChain([rightStyle, 'optionalAccess', _836 => _836.border]);
12562
- right = resolvePreferredBorderEdge(right, _nullishCoalesce(_optionalChain([rightBorder, 'optionalAccess', _837 => _837.right]), () => ( null)));
12671
+ const rightBorder = _optionalChain([rightStyle, 'optionalAccess', _841 => _841.border]);
12672
+ right = resolvePreferredBorderEdge(right, _nullishCoalesce(_optionalChain([rightBorder, 'optionalAccess', _842 => _842.right]), () => ( null)));
12563
12673
  }
12564
12674
  const border = {};
12565
12675
  if (top) {
@@ -12618,7 +12728,7 @@ function resolveTableCellStyle(table, row3, col, activeSheet) {
12618
12728
  if (!table || !activeSheet) {
12619
12729
  return null;
12620
12730
  }
12621
- const styleName = _optionalChain([table, 'access', _838 => _838.styleInfo, 'optionalAccess', _839 => _839.name]);
12731
+ const styleName = _optionalChain([table, 'access', _843 => _843.styleInfo, 'optionalAccess', _844 => _844.name]);
12622
12732
  if (!styleName) {
12623
12733
  return null;
12624
12734
  }
@@ -12657,7 +12767,7 @@ function resolveTableCellStyle(table, row3, col, activeSheet) {
12657
12767
  resolved = mergeResolvedCellStyle(resolved, nextStyle);
12658
12768
  };
12659
12769
  applyElement("wholeTable", tableRegion);
12660
- if (isBodyRow && _optionalChain([table, 'access', _840 => _840.styleInfo, 'optionalAccess', _841 => _841.showColumnStripes])) {
12770
+ if (isBodyRow && _optionalChain([table, 'access', _845 => _845.styleInfo, 'optionalAccess', _846 => _846.showColumnStripes])) {
12661
12771
  const isFirstStripe = (col - table.start.col) % 2 === 0;
12662
12772
  applyElement(isFirstStripe ? "firstColumnStripe" : "secondColumnStripe", {
12663
12773
  endCol: col,
@@ -12666,7 +12776,7 @@ function resolveTableCellStyle(table, row3, col, activeSheet) {
12666
12776
  startRow: bodyStartRow
12667
12777
  });
12668
12778
  }
12669
- if (isBodyRow && _optionalChain([table, 'access', _842 => _842.styleInfo, 'optionalAccess', _843 => _843.showRowStripes])) {
12779
+ if (isBodyRow && _optionalChain([table, 'access', _847 => _847.styleInfo, 'optionalAccess', _848 => _848.showRowStripes])) {
12670
12780
  const isFirstStripe = (row3 - bodyStartRow) % 2 === 0;
12671
12781
  applyElement(isFirstStripe ? "firstRowStripe" : "secondRowStripe", {
12672
12782
  ...tableRegion,
@@ -12674,8 +12784,8 @@ function resolveTableCellStyle(table, row3, col, activeSheet) {
12674
12784
  startRow: row3
12675
12785
  });
12676
12786
  }
12677
- applyElement("lastColumn", { ...tableRegion, startCol: table.end.col }, Boolean(_optionalChain([table, 'access', _844 => _844.styleInfo, 'optionalAccess', _845 => _845.showLastColumn])) && isLastColumn);
12678
- applyElement("firstColumn", { ...tableRegion, endCol: table.start.col }, Boolean(_optionalChain([table, 'access', _846 => _846.styleInfo, 'optionalAccess', _847 => _847.showFirstColumn])) && isFirstColumn);
12787
+ applyElement("lastColumn", { ...tableRegion, startCol: table.end.col }, Boolean(_optionalChain([table, 'access', _849 => _849.styleInfo, 'optionalAccess', _850 => _850.showLastColumn])) && isLastColumn);
12788
+ applyElement("firstColumn", { ...tableRegion, endCol: table.start.col }, Boolean(_optionalChain([table, 'access', _851 => _851.styleInfo, 'optionalAccess', _852 => _852.showFirstColumn])) && isFirstColumn);
12679
12789
  applyElement("headerRow", headerRegion, isHeaderRow);
12680
12790
  if (isHeaderRow && table.headerRowCellStyle) {
12681
12791
  const namedHeaderStyle = activeSheet.namedCellStyleByName[table.headerRowCellStyle];
@@ -13696,11 +13806,11 @@ function resolveConditionalFormulaComparable(formula, worksheet, sheet, batchedC
13696
13806
  return literal;
13697
13807
  }
13698
13808
  const splitReference = splitSheetFormulaReference(normalized);
13699
- const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _848 => _848.sheetName]), () => ( null));
13700
- if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _849 => _849.name]) && targetSheetName !== sheet.name) {
13809
+ const targetSheetName = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _853 => _853.sheetName]), () => ( null));
13810
+ if (targetSheetName && _optionalChain([sheet, 'optionalAccess', _854 => _854.name]) && targetSheetName !== sheet.name) {
13701
13811
  return literal;
13702
13812
  }
13703
- const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _850 => _850.range]), () => ( normalized));
13813
+ const cellRef = _nullishCoalesce(_optionalChain([splitReference, 'optionalAccess', _855 => _855.range]), () => ( normalized));
13704
13814
  const cell = parseA1CellReference2(cellRef.replace(/\$/g, ""));
13705
13815
  if (!cell) {
13706
13816
  return literal;
@@ -13732,8 +13842,8 @@ function normalizeConditionalTextOperand(value) {
13732
13842
  }
13733
13843
  function resolveConditionalStyledRuleMatch(rule, numericValue, textValue, worksheet, sheet, batchedCells) {
13734
13844
  const normalizedRuleType = rule.ruleType.trim().toLowerCase();
13735
- const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _851 => _851.formulas, 'optionalAccess', _852 => _852[0]]), () => ( "")), worksheet, sheet, batchedCells);
13736
- const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _853 => _853.formulas, 'optionalAccess', _854 => _854[1]]), () => ( "")), worksheet, sheet, batchedCells);
13845
+ const left = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _856 => _856.formulas, 'optionalAccess', _857 => _857[0]]), () => ( "")), worksheet, sheet, batchedCells);
13846
+ const right = resolveConditionalFormulaComparable(_nullishCoalesce(_optionalChain([rule, 'access', _858 => _858.formulas, 'optionalAccess', _859 => _859[1]]), () => ( "")), worksheet, sheet, batchedCells);
13737
13847
  if (normalizedRuleType === "cellis") {
13738
13848
  return resolveConditionalCellIsMatch(_nullishCoalesce(rule.operator, () => ( "equal")), left, right, numericValue, textValue);
13739
13849
  }
@@ -13764,7 +13874,7 @@ function getStyledConditionalRules(rules) {
13764
13874
  return styledRules;
13765
13875
  }
13766
13876
  function resolveConditionalCellStyleForCell(row3, col, sheet, readNumericValue, readTextValue, worksheet, batchedCells) {
13767
- const rules = _optionalChain([sheet, 'optionalAccess', _855 => _855.conditionalFormatRules]);
13877
+ const rules = _optionalChain([sheet, 'optionalAccess', _860 => _860.conditionalFormatRules]);
13768
13878
  if (!sheet || !rules || rules.length === 0) {
13769
13879
  return null;
13770
13880
  }
@@ -14043,7 +14153,7 @@ function resolveFormControlLabel(control3) {
14043
14153
  return label.replace(/\u00a0/g, " ").replace(/^\s+/, "");
14044
14154
  }
14045
14155
  function resolveConditionalDataBarForCell(row3, col, worksheet, sheet, metricsCache) {
14046
- const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _856 => _856.conditionalFormatRules]), () => ( []));
14156
+ const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _861 => _861.conditionalFormatRules]), () => ( []));
14047
14157
  const matchingRule = rules.find(
14048
14158
  (rule) => rule.kind === "dataBar" && rule.ranges.some((range) => isCellInRange({ row: row3, col }, range))
14049
14159
  );
@@ -14081,23 +14191,23 @@ function resolveConditionalDataBarForCell(row3, col, worksheet, sheet, metricsCa
14081
14191
  const span = maxValue - minValue;
14082
14192
  const ratio = span === 0 ? numericValue >= maxValue ? 1 : 0 : (numericValue - minValue) / span;
14083
14193
  const widthPercent = minLength + Math.max(0, Math.min(1, ratio)) * (maxLength - minLength);
14084
- const color = _chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.color, _optionalChain([sheet, 'optionalAccess', _857 => _857.themePalette]));
14194
+ const color = _chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.color, _optionalChain([sheet, 'optionalAccess', _862 => _862.themePalette]));
14085
14195
  if (!color || widthPercent <= 0) {
14086
14196
  return null;
14087
14197
  }
14088
14198
  return {
14089
- axisColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _858 => _858.themePalette])), () => ( void 0)),
14199
+ axisColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.axisColor, _optionalChain([sheet, 'optionalAccess', _863 => _863.themePalette])), () => ( void 0)),
14090
14200
  border: _nullishCoalesce(matchingRule.border, () => ( void 0)),
14091
- borderColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _859 => _859.themePalette])), () => ( void 0)),
14201
+ borderColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.borderColor, _optionalChain([sheet, 'optionalAccess', _864 => _864.themePalette])), () => ( void 0)),
14092
14202
  color,
14093
14203
  gradient: _nullishCoalesce(matchingRule.gradient, () => ( void 0)),
14094
- negativeBorderColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _860 => _860.themePalette])), () => ( void 0)),
14095
- negativeFillColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _861 => _861.themePalette])), () => ( void 0)),
14204
+ negativeBorderColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.negativeBorderColor, _optionalChain([sheet, 'optionalAccess', _865 => _865.themePalette])), () => ( void 0)),
14205
+ negativeFillColor: _nullishCoalesce(_chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, matchingRule.negativeFillColor, _optionalChain([sheet, 'optionalAccess', _866 => _866.themePalette])), () => ( void 0)),
14096
14206
  widthPercent
14097
14207
  };
14098
14208
  }
14099
14209
  function resolveConditionalColorScaleForCell(row3, col, worksheet, sheet, metricsCache) {
14100
- const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _862 => _862.conditionalFormatRules]), () => ( []));
14210
+ const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _867 => _867.conditionalFormatRules]), () => ( []));
14101
14211
  const matchingRule = rules.find(
14102
14212
  (rule) => rule.kind === "colorScale" && rule.ranges.some((range) => isCellInRange({ row: row3, col }, range))
14103
14213
  );
@@ -14125,7 +14235,7 @@ function resolveConditionalColorScaleForCell(row3, col, worksheet, sheet, metric
14125
14235
  });
14126
14236
  metricsCache.set(cacheKey, ruleValues);
14127
14237
  }
14128
- const colors = matchingRule.colors.map((color) => _chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, color, _optionalChain([sheet, 'optionalAccess', _863 => _863.themePalette]))).filter((color) => typeof color === "string");
14238
+ const colors = matchingRule.colors.map((color) => _chunkGP5SOQQHcjs.resolveWorkbookColor.call(void 0, color, _optionalChain([sheet, 'optionalAccess', _868 => _868.themePalette]))).filter((color) => typeof color === "string");
14129
14239
  const thresholds = matchingRule.cfvos.map((threshold) => resolveConditionalRuleThreshold(threshold, ruleValues)).filter((value) => typeof value === "number" && Number.isFinite(value));
14130
14240
  if (colors.length < 2 || thresholds.length < 2) {
14131
14241
  return null;
@@ -14144,7 +14254,7 @@ function resolveConditionalColorScaleForCell(row3, col, worksheet, sheet, metric
14144
14254
  return { color: resolvedColor };
14145
14255
  }
14146
14256
  function resolveConditionalIconForCell(row3, col, worksheet, sheet, metricsCache) {
14147
- const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _864 => _864.conditionalFormatRules]), () => ( []));
14257
+ const rules = _nullishCoalesce(_optionalChain([sheet, 'optionalAccess', _869 => _869.conditionalFormatRules]), () => ( []));
14148
14258
  const matchingRule = rules.find(
14149
14259
  (rule) => rule.kind === "iconSet" && rule.ranges.some((range) => isCellInRange({ row: row3, col }, range))
14150
14260
  );
@@ -14184,7 +14294,7 @@ function resolveConditionalIconForCell(row3, col, worksheet, sheet, metricsCache
14184
14294
  return icon ? buildConditionalIcon(icon.iconSet, icon.iconId) : null;
14185
14295
  }
14186
14296
  function resolveCellDataValidation(row3, col, sheet) {
14187
- const validation = _optionalChain([sheet, 'optionalAccess', _865 => _865.dataValidations, 'access', _866 => _866.find, 'call', _867 => _867((entry) => entry.ranges.some((range) => isCellInRange({ row: row3, col }, range)))]);
14297
+ const validation = _optionalChain([sheet, 'optionalAccess', _870 => _870.dataValidations, 'access', _871 => _871.find, 'call', _872 => _872((entry) => entry.ranges.some((range) => isCellInRange({ row: row3, col }, range)))]);
14188
14298
  if (!validation) {
14189
14299
  return null;
14190
14300
  }
@@ -14485,7 +14595,7 @@ function GridRow({
14485
14595
  whiteSpace: "nowrap",
14486
14596
  width: "max-content"
14487
14597
  } : null;
14488
- const title = [_optionalChain([cellData, 'access', _868 => _868.hyperlink, 'optionalAccess', _869 => _869.tooltip]), _optionalChain([cellData, 'access', _870 => _870.validation, 'optionalAccess', _871 => _871.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
14598
+ const title = [_optionalChain([cellData, 'access', _873 => _873.hyperlink, 'optionalAccess', _874 => _874.tooltip]), _optionalChain([cellData, 'access', _875 => _875.validation, 'optionalAccess', _876 => _876.message]), cellData.value].filter((value, index, values) => typeof value === "string" && value.length > 0 && values.indexOf(value) === index).join("\n");
14489
14599
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0,
14490
14600
  "td",
14491
14601
  {
@@ -14674,8 +14784,8 @@ var MemoGridRow = _chunkZ4WMURVUcjs.N.call(void 0, GridRow, (prev, next) => {
14674
14784
  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.onRowResizeDoubleClick !== next.onRowResizeDoubleClick || prev.onRowResizePointerDown !== next.onRowResizePointerDown || prev.renderCellAdornment !== next.renderCellAdornment || prev.cellEditorStyle !== next.cellEditorStyle || prev.onFocusEditorOverlay !== next.onFocusEditorOverlay) {
14675
14785
  return false;
14676
14786
  }
14677
- const prevEditingCol = _optionalChain([prev, 'access', _872 => _872.editingCell, 'optionalAccess', _873 => _873.row]) === prev.actualRow ? prev.editingCell.col : -1;
14678
- const nextEditingCol = _optionalChain([next, 'access', _874 => _874.editingCell, 'optionalAccess', _875 => _875.row]) === next.actualRow ? next.editingCell.col : -1;
14787
+ const prevEditingCol = _optionalChain([prev, 'access', _877 => _877.editingCell, 'optionalAccess', _878 => _878.row]) === prev.actualRow ? prev.editingCell.col : -1;
14788
+ const nextEditingCol = _optionalChain([next, 'access', _879 => _879.editingCell, 'optionalAccess', _880 => _880.row]) === next.actualRow ? next.editingCell.col : -1;
14679
14789
  if (prevEditingCol !== nextEditingCol) {
14680
14790
  return false;
14681
14791
  }
@@ -14926,9 +15036,9 @@ function XlsxGrid({
14926
15036
  const formulaReferences = _chunkZ4WMURVUcjs.T.call(void 0,
14927
15037
  () => {
14928
15038
  const worksheet2 = getActiveWorksheet();
14929
- return editingCell && worksheet2 && !isTextCell(worksheet2, editingCell) ? getFormulaReferences(editingValue, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _876 => _876.name]), () => ( ""))) : [];
15039
+ return editingCell && worksheet2 && !isTextCell(worksheet2, editingCell) ? getFormulaReferences(editingValue, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _881 => _881.name]), () => ( ""))) : [];
14930
15040
  },
14931
- [_optionalChain([activeSheet, 'optionalAccess', _877 => _877.name]), editingCell, editingValue, getActiveWorksheet]
15041
+ [_optionalChain([activeSheet, 'optionalAccess', _882 => _882.name]), editingCell, editingValue, getActiveWorksheet]
14932
15042
  );
14933
15043
  const [openTableMenu, setOpenTableMenu] = _chunkZ4WMURVUcjs.d.call(void 0, null);
14934
15044
  const [fillPreviewRange, setFillPreviewRange] = _chunkZ4WMURVUcjs.d.call(void 0, null);
@@ -14995,13 +15105,13 @@ function XlsxGrid({
14995
15105
  );
14996
15106
  const mergedRegions = _chunkZ4WMURVUcjs.T.call(void 0, () => {
14997
15107
  const regions = [];
14998
- const rawMergedRegions = Array.isArray(_optionalChain([worksheet, 'optionalAccess', _878 => _878.mergedRegions])) ? worksheet.mergedRegions : [];
15108
+ const rawMergedRegions = Array.isArray(_optionalChain([worksheet, 'optionalAccess', _883 => _883.mergedRegions])) ? worksheet.mergedRegions : [];
14999
15109
  for (const entry of rawMergedRegions) {
15000
15110
  const region = asRecord(entry);
15001
- const startRow = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _879 => _879.startRow]));
15002
- const startCol = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _880 => _880.startCol]));
15003
- const endRow = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _881 => _881.endRow]));
15004
- const endCol = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _882 => _882.endCol]));
15111
+ const startRow = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _884 => _884.startRow]));
15112
+ const startCol = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _885 => _885.startCol]));
15113
+ const endRow = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _886 => _886.endRow]));
15114
+ const endCol = asNonNegativeInteger(_optionalChain([region, 'optionalAccess', _887 => _887.endCol]));
15005
15115
  if (startRow === null || startCol === null || endRow === null || endCol === null) {
15006
15116
  continue;
15007
15117
  }
@@ -15013,19 +15123,19 @@ function XlsxGrid({
15013
15123
  return regions;
15014
15124
  }, [worksheet]);
15015
15125
  const findMergedRange = _chunkZ4WMURVUcjs.T.call(void 0,
15016
- () => createMergedRangeLookup(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _883 => _883.mergedRanges]), () => ( mergedRegions))),
15017
- [_optionalChain([activeSheet, 'optionalAccess', _884 => _884.mergedRanges]), mergedRegions]
15126
+ () => createMergedRangeLookup(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _888 => _888.mergedRanges]), () => ( mergedRegions))),
15127
+ [_optionalChain([activeSheet, 'optionalAccess', _889 => _889.mergedRanges]), mergedRegions]
15018
15128
  );
15019
15129
  const resolveMergeAnchorCell = _chunkZ4WMURVUcjs.q.call(void 0, (cell) => {
15020
- return _nullishCoalesce(_optionalChain([findMergedRange, 'call', _885 => _885(cell), 'optionalAccess', _886 => _886.start]), () => ( cell));
15130
+ return _nullishCoalesce(_optionalChain([findMergedRange, 'call', _890 => _890(cell), 'optionalAccess', _891 => _891.start]), () => ( cell));
15021
15131
  }, [findMergedRange]);
15022
15132
  const resolveCellSelectionRange = _chunkZ4WMURVUcjs.q.call(void 0, (range) => {
15023
15133
  const normalized = normalizeRange2(range);
15024
- return expandHighlightedRange(normalized, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _887 => _887.mergedRanges]), () => ( mergedRegions)));
15025
- }, [_optionalChain([activeSheet, 'optionalAccess', _888 => _888.mergedRanges]), mergedRegions, resolveMergeAnchorCell]);
15134
+ return expandHighlightedRange(normalized, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _892 => _892.mergedRanges]), () => ( mergedRegions)));
15135
+ }, [_optionalChain([activeSheet, 'optionalAccess', _893 => _893.mergedRanges]), mergedRegions, resolveMergeAnchorCell]);
15026
15136
  const highlightedCellRanges = _chunkZ4WMURVUcjs.T.call(void 0,
15027
- () => highlightedRanges.flatMap((highlight, index) => _optionalChain([activeSheet, 'optionalAccess', _889 => _889.workbookSheetIndex]) === highlight.workbookSheetIndex ? [{ highlight, index, range: expandHighlightedRange(highlight.range, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _890 => _890.mergedRanges]), () => ( mergedRegions))) }] : []),
15028
- [_optionalChain([activeSheet, 'optionalAccess', _891 => _891.mergedRanges]), _optionalChain([activeSheet, 'optionalAccess', _892 => _892.workbookSheetIndex]), highlightedRanges, mergedRegions]
15137
+ () => highlightedRanges.flatMap((highlight, index) => _optionalChain([activeSheet, 'optionalAccess', _894 => _894.workbookSheetIndex]) === highlight.workbookSheetIndex ? [{ highlight, index, range: expandHighlightedRange(highlight.range, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _895 => _895.mergedRanges]), () => ( mergedRegions))) }] : []),
15138
+ [_optionalChain([activeSheet, 'optionalAccess', _896 => _896.mergedRanges]), _optionalChain([activeSheet, 'optionalAccess', _897 => _897.workbookSheetIndex]), highlightedRanges, mergedRegions]
15029
15139
  );
15030
15140
  const normalizedSelection = _chunkZ4WMURVUcjs.T.call(void 0, () => selection ? normalizeRange2(selection) : null, [selection]);
15031
15141
  const secondaryRanges = _chunkZ4WMURVUcjs.T.call(void 0, () => selectionRanges.length > 1 ? selectionRanges.slice(0, -1) : EMPTY_SELECTION_RANGES, [selectionRanges]);
@@ -15043,15 +15153,15 @@ function XlsxGrid({
15043
15153
  insets.set(key, (_nullishCoalesce(insets.get(key), () => ( 0))) + 18);
15044
15154
  };
15045
15155
  for (const pivot of controller.pivotTables) {
15046
- if (pivot.target.sheet.toLowerCase() !== _optionalChain([activeSheet, 'optionalAccess', _893 => _893.name, 'access', _894 => _894.toLowerCase, 'call', _895 => _895()])) continue;
15156
+ if (pivot.target.sheet.toLowerCase() !== _optionalChain([activeSheet, 'optionalAccess', _898 => _898.name, 'access', _899 => _899.toLowerCase, 'call', _900 => _900()])) continue;
15047
15157
  for (const header of _nullishCoalesce(pivot.headers, () => ( []))) add2(header);
15048
15158
  if (!readOnly && !pivot.unsupportedFeatures.length) for (const toggle of _nullishCoalesce(pivot.toggles, () => ( []))) add2(toggle);
15049
15159
  }
15050
15160
  return insets;
15051
- }, [_optionalChain([activeSheet, 'optionalAccess', _896 => _896.name]), controller.pivotTables, readOnly]);
15161
+ }, [_optionalChain([activeSheet, 'optionalAccess', _901 => _901.name]), controller.pivotTables, readOnly]);
15052
15162
  const [displayRowLimit, setDisplayRowLimit] = _chunkZ4WMURVUcjs.d.call(void 0,
15053
15163
  () => resolveInitialDisplayExtent(
15054
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _897 => _897.maxUsedRow]), () => ( -1)),
15164
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _902 => _902.maxUsedRow]), () => ( -1)),
15055
15165
  MIN_OPEN_GRID_ROWS,
15056
15166
  OPEN_GRID_ROW_PADDING,
15057
15167
  Boolean(isWorkerBacked),
@@ -15060,15 +15170,15 @@ function XlsxGrid({
15060
15170
  );
15061
15171
  const [displayColLimit, setDisplayColLimit] = _chunkZ4WMURVUcjs.d.call(void 0,
15062
15172
  () => resolveInitialDisplayExtent(
15063
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _898 => _898.maxUsedCol]), () => ( -1)),
15173
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _903 => _903.maxUsedCol]), () => ( -1)),
15064
15174
  MIN_OPEN_GRID_COLS,
15065
15175
  OPEN_GRID_COL_PADDING,
15066
15176
  Boolean(isWorkerBacked),
15067
15177
  INITIAL_WORKER_GRID_COLS
15068
15178
  )
15069
15179
  );
15070
- const hiddenRowSet = _chunkZ4WMURVUcjs.T.call(void 0, () => new Set(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _899 => _899.hiddenRows]), () => ( []))), [_optionalChain([activeSheet, 'optionalAccess', _900 => _900.hiddenRows])]);
15071
- const hiddenColSet = _chunkZ4WMURVUcjs.T.call(void 0, () => new Set(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _901 => _901.hiddenCols]), () => ( []))), [_optionalChain([activeSheet, 'optionalAccess', _902 => _902.hiddenCols])]);
15180
+ const hiddenRowSet = _chunkZ4WMURVUcjs.T.call(void 0, () => new Set(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _904 => _904.hiddenRows]), () => ( []))), [_optionalChain([activeSheet, 'optionalAccess', _905 => _905.hiddenRows])]);
15181
+ const hiddenColSet = _chunkZ4WMURVUcjs.T.call(void 0, () => new Set(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _906 => _906.hiddenCols]), () => ( []))), [_optionalChain([activeSheet, 'optionalAccess', _907 => _907.hiddenCols])]);
15072
15182
  const displayDefaultRowHeight = DEFAULT_ROW_HEIGHT2 * zoomFactor;
15073
15183
  const displayDefaultColWidth = DEFAULT_COL_WIDTH2 * zoomFactor;
15074
15184
  const displayHeaderHeight = HEADER_HEIGHT * zoomFactor;
@@ -15104,27 +15214,27 @@ function XlsxGrid({
15104
15214
  const liveZoomAnchorX = resolveClampedLiveZoomAnchor(
15105
15215
  nextLiveViewport.left,
15106
15216
  nextLiveViewport.width,
15107
- _nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _903 => _903.scrollWidth]), () => ( nextLiveViewport.width)),
15108
- _nullishCoalesce(_optionalChain([currentLiveGestureZoom, 'optionalAccess', _904 => _904.anchor, 'access', _905 => _905.x]), () => ( 0))
15217
+ _nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _908 => _908.scrollWidth]), () => ( nextLiveViewport.width)),
15218
+ _nullishCoalesce(_optionalChain([currentLiveGestureZoom, 'optionalAccess', _909 => _909.anchor, 'access', _910 => _910.x]), () => ( 0))
15109
15219
  );
15110
15220
  const liveZoomAnchorY = resolveClampedLiveZoomAnchor(
15111
15221
  nextLiveViewport.top,
15112
15222
  nextLiveViewport.height,
15113
- _nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _906 => _906.scrollHeight]), () => ( nextLiveViewport.height)),
15114
- _nullishCoalesce(_optionalChain([currentLiveGestureZoom, 'optionalAccess', _907 => _907.anchor, 'access', _908 => _908.y]), () => ( 0))
15223
+ _nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _911 => _911.scrollHeight]), () => ( nextLiveViewport.height)),
15224
+ _nullishCoalesce(_optionalChain([currentLiveGestureZoom, 'optionalAccess', _912 => _912.anchor, 'access', _913 => _913.y]), () => ( 0))
15115
15225
  );
15116
15226
  const applyElementTransform = (element, transform, willChange, transformOrigin = null) => {
15117
15227
  if (!element) {
15118
15228
  return;
15119
15229
  }
15120
15230
  const cached = canvasTransformStyleCacheRef.current.get(element);
15121
- if (_optionalChain([cached, 'optionalAccess', _909 => _909.transform]) !== transform || element.style.transform !== transform) {
15231
+ if (_optionalChain([cached, 'optionalAccess', _914 => _914.transform]) !== transform || element.style.transform !== transform) {
15122
15232
  element.style.transform = transform;
15123
15233
  }
15124
- if (_optionalChain([cached, 'optionalAccess', _910 => _910.willChange]) !== willChange || element.style.willChange !== willChange) {
15234
+ if (_optionalChain([cached, 'optionalAccess', _915 => _915.willChange]) !== willChange || element.style.willChange !== willChange) {
15125
15235
  element.style.willChange = willChange;
15126
15236
  }
15127
- if (transformOrigin !== null && (_optionalChain([cached, 'optionalAccess', _911 => _911.transformOrigin]) !== transformOrigin || element.style.transformOrigin !== transformOrigin)) {
15237
+ if (transformOrigin !== null && (_optionalChain([cached, 'optionalAccess', _916 => _916.transformOrigin]) !== transformOrigin || element.style.transformOrigin !== transformOrigin)) {
15128
15238
  element.style.transformOrigin = transformOrigin;
15129
15239
  }
15130
15240
  canvasTransformStyleCacheRef.current.set(element, {
@@ -15346,7 +15456,7 @@ function XlsxGrid({
15346
15456
  pendingLiveZoomCommitRef.current = null;
15347
15457
  updateLiveGestureZoomState((current) => ({
15348
15458
  anchor,
15349
- baseZoomScale: _nullishCoalesce(_optionalChain([current, 'optionalAccess', _912 => _912.baseZoomScale]), () => ( committedZoomScaleRef.current)),
15459
+ baseZoomScale: _nullishCoalesce(_optionalChain([current, 'optionalAccess', _917 => _917.baseZoomScale]), () => ( committedZoomScaleRef.current)),
15350
15460
  targetZoomScale: clampedZoomScale
15351
15461
  }));
15352
15462
  }, [maxZoomScale, minZoomScale, updateLiveGestureZoomState]);
@@ -15396,7 +15506,7 @@ function XlsxGrid({
15396
15506
  const matchesLiveViewport = liveViewport.left === nextViewport.left && liveViewport.top === nextViewport.top && liveViewport.width === nextViewport.width && liveViewport.height === nextViewport.height;
15397
15507
  liveDrawingViewportRef.current = nextViewport;
15398
15508
  applyCanvasViewportCompensation(nextViewport);
15399
- if (_optionalChain([options2, 'optionalAccess', _913 => _913.immediate])) {
15509
+ if (_optionalChain([options2, 'optionalAccess', _918 => _918.immediate])) {
15400
15510
  pendingDrawingViewportRef.current = null;
15401
15511
  if (drawingViewportFrameRef.current !== null) {
15402
15512
  window.cancelAnimationFrame(drawingViewportFrameRef.current);
@@ -15445,7 +15555,7 @@ function XlsxGrid({
15445
15555
  }
15446
15556
  }, []);
15447
15557
  const clearResizeDrag = _chunkZ4WMURVUcjs.q.call(void 0, () => {
15448
- _optionalChain([resizeStateRef, 'access', _914 => _914.current, 'optionalAccess', _915 => _915.restoreUserSelect, 'call', _916 => _916()]);
15558
+ _optionalChain([resizeStateRef, 'access', _919 => _919.current, 'optionalAccess', _920 => _920.restoreUserSelect, 'call', _921 => _921()]);
15449
15559
  resizeStateRef.current = null;
15450
15560
  pendingResizePreviewRef.current = null;
15451
15561
  columnPreviewRef.current = null;
@@ -15496,63 +15606,63 @@ function XlsxGrid({
15496
15606
  }, []);
15497
15607
  const visibleRows = _chunkZ4WMURVUcjs.T.call(void 0, () => {
15498
15608
  return buildVisibleAxisIndices(
15499
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _917 => _917.visibleRows]), () => ( [])),
15609
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _922 => _922.visibleRows]), () => ( [])),
15500
15610
  displayRowLimit,
15501
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _918 => _918.maxUsedRow]), () => ( -1)),
15611
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _923 => _923.maxUsedRow]), () => ( -1)),
15502
15612
  hiddenRowSet
15503
15613
  );
15504
- }, [_optionalChain([activeSheet, 'optionalAccess', _919 => _919.maxUsedRow]), _optionalChain([activeSheet, 'optionalAccess', _920 => _920.visibleRows]), displayRowLimit, hiddenRowSet]);
15614
+ }, [_optionalChain([activeSheet, 'optionalAccess', _924 => _924.maxUsedRow]), _optionalChain([activeSheet, 'optionalAccess', _925 => _925.visibleRows]), displayRowLimit, hiddenRowSet]);
15505
15615
  const visibleCols = _chunkZ4WMURVUcjs.T.call(void 0, () => {
15506
15616
  return buildVisibleAxisIndices(
15507
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _921 => _921.visibleCols]), () => ( [])),
15617
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _926 => _926.visibleCols]), () => ( [])),
15508
15618
  displayColLimit,
15509
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _922 => _922.maxUsedCol]), () => ( -1)),
15619
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _927 => _927.maxUsedCol]), () => ( -1)),
15510
15620
  hiddenColSet
15511
15621
  );
15512
- }, [_optionalChain([activeSheet, 'optionalAccess', _923 => _923.maxUsedCol]), _optionalChain([activeSheet, 'optionalAccess', _924 => _924.visibleCols]), displayColLimit, hiddenColSet]);
15622
+ }, [_optionalChain([activeSheet, 'optionalAccess', _928 => _928.maxUsedCol]), _optionalChain([activeSheet, 'optionalAccess', _929 => _929.visibleCols]), displayColLimit, hiddenColSet]);
15513
15623
  const frozenRows = _chunkZ4WMURVUcjs.T.call(void 0, () => {
15514
- const freezeRow = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _925 => _925.freezePanes, 'optionalAccess', _926 => _926.row]), () => ( 0));
15624
+ const freezeRow = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _930 => _930.freezePanes, 'optionalAccess', _931 => _931.row]), () => ( 0));
15515
15625
  if (freezeRow <= 0) {
15516
15626
  return [];
15517
15627
  }
15518
15628
  return visibleRows.filter((row3) => row3 < freezeRow);
15519
- }, [_optionalChain([activeSheet, 'optionalAccess', _927 => _927.freezePanes, 'optionalAccess', _928 => _928.row]), visibleRows]);
15629
+ }, [_optionalChain([activeSheet, 'optionalAccess', _932 => _932.freezePanes, 'optionalAccess', _933 => _933.row]), visibleRows]);
15520
15630
  const frozenCols = _chunkZ4WMURVUcjs.T.call(void 0, () => {
15521
- const freezeCol = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _929 => _929.freezePanes, 'optionalAccess', _930 => _930.col]), () => ( 0));
15631
+ const freezeCol = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _934 => _934.freezePanes, 'optionalAccess', _935 => _935.col]), () => ( 0));
15522
15632
  if (freezeCol <= 0) {
15523
15633
  return [];
15524
15634
  }
15525
15635
  return visibleCols.filter((col) => col < freezeCol);
15526
- }, [_optionalChain([activeSheet, 'optionalAccess', _931 => _931.freezePanes, 'optionalAccess', _932 => _932.col]), visibleCols]);
15636
+ }, [_optionalChain([activeSheet, 'optionalAccess', _936 => _936.freezePanes, 'optionalAccess', _937 => _937.col]), visibleCols]);
15527
15637
  const actualColWidths = _chunkZ4WMURVUcjs.T.call(void 0,
15528
15638
  () => {
15529
- const office = _optionalChain([activeSheet, 'optionalAccess', _933 => _933.officeLayout]);
15639
+ const office = _optionalChain([activeSheet, 'optionalAccess', _938 => _938.officeLayout]);
15530
15640
  if (office) {
15531
15641
  return Array.from({ length: displayColLimit }, (_2, index) => {
15532
15642
  if (hiddenColSet.has(index)) return 0;
15533
15643
  const original = office.columns[index];
15534
- const override = _optionalChain([activeSheet, 'optionalAccess', _934 => _934.colWidthOverridesPx, 'access', _935 => _935[index]]);
15535
- if (override !== void 0 && override !== _optionalChain([original, 'optionalAccess', _936 => _936.sourcePx])) return override;
15536
- const width = _optionalChain([worksheet, 'optionalAccess', _937 => _937.getColumnWidth, 'call', _938 => _938(index)]);
15537
- return width !== void 0 && width !== null ? _chunkGP5SOQQHcjs.resolveOfficeColumnWidthPixels.call(void 0, width, office.columnDigitWidthPt) : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _939 => _939.sizePx]), () => ( office.defaultColumnPx));
15644
+ const override = _optionalChain([activeSheet, 'optionalAccess', _939 => _939.colWidthOverridesPx, 'access', _940 => _940[index]]);
15645
+ if (override !== void 0 && override !== _optionalChain([original, 'optionalAccess', _941 => _941.sourcePx])) return override;
15646
+ const width = _optionalChain([worksheet, 'optionalAccess', _942 => _942.getColumnWidth, 'call', _943 => _943(index)]);
15647
+ return width !== void 0 && width !== null ? _chunkGP5SOQQHcjs.resolveOfficeColumnWidthPixels.call(void 0, width, office.columnDigitWidthPt) : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _944 => _944.sizePx]), () => ( office.defaultColumnPx));
15538
15648
  });
15539
15649
  }
15540
15650
  const widths = new Array(displayColLimit).fill(0);
15541
- const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _940 => _940.showGridLines]), () => ( true));
15651
+ const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _945 => _945.showGridLines]), () => ( true));
15542
15652
  const fallbackWidth = Math.max(
15543
- _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _941 => _941.defaultColWidthPx]), () => ( DEFAULT_COL_WIDTH2)), showGridLines),
15653
+ _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _946 => _946.defaultColWidthPx]), () => ( DEFAULT_COL_WIDTH2)), showGridLines),
15544
15654
  DEFAULT_COL_WIDTH2 / 2
15545
15655
  );
15546
15656
  if (worksheet) {
15547
15657
  for (let col = 0; col < displayColLimit; col += 1) {
15548
- if (worksheet.isColumnHidden(col)) {
15658
+ if (hiddenColSet.has(col)) {
15549
15659
  continue;
15550
15660
  }
15551
15661
  const width = worksheet.getColumnWidth(col);
15552
15662
  if (width !== void 0 && width !== null) {
15553
15663
  widths[col] = Math.max(
15554
15664
  _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0,
15555
- _chunkGP5SOQQHcjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([activeSheet, 'optionalAccess', _942 => _942.columnWidthCharacterWidthPx])),
15665
+ _chunkGP5SOQQHcjs.resolveSheetColumnWidthPixels.call(void 0, width, _optionalChain([activeSheet, 'optionalAccess', _947 => _947.columnWidthCharacterWidthPx])),
15556
15666
  showGridLines
15557
15667
  ),
15558
15668
  DEFAULT_COL_WIDTH2 / 2
@@ -15561,7 +15671,7 @@ function XlsxGrid({
15561
15671
  }
15562
15672
  widths[col] = Math.max(
15563
15673
  _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0,
15564
- _nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _943 => _943.colWidthOverridesPx, 'access', _944 => _944[col]]), () => ( _optionalChain([activeSheet, 'optionalAccess', _945 => _945.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH2)),
15674
+ _nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _948 => _948.colWidthOverridesPx, 'access', _949 => _949[col]]), () => ( _optionalChain([activeSheet, 'optionalAccess', _950 => _950.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH2)),
15565
15675
  showGridLines
15566
15676
  ),
15567
15677
  DEFAULT_COL_WIDTH2 / 2
@@ -15569,8 +15679,8 @@ function XlsxGrid({
15569
15679
  }
15570
15680
  return widths;
15571
15681
  }
15572
- const precomputedCols = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _946 => _946.visibleCols]), () => ( []));
15573
- const precomputedWidths = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _947 => _947.colWidths]), () => ( []));
15682
+ const precomputedCols = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _951 => _951.visibleCols]), () => ( []));
15683
+ const precomputedWidths = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _952 => _952.colWidths]), () => ( []));
15574
15684
  for (let index = 0; index < precomputedCols.length; index += 1) {
15575
15685
  const col = precomputedCols[index];
15576
15686
  if (col === void 0 || col >= displayColLimit) {
@@ -15578,28 +15688,28 @@ function XlsxGrid({
15578
15688
  }
15579
15689
  widths[col] = Math.max(
15580
15690
  _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0,
15581
- _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _948 => _948.colWidthOverridesPx, 'access', _949 => _949[col]]), () => ( precomputedWidths[index])), () => ( _optionalChain([activeSheet, 'optionalAccess', _950 => _950.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH2)),
15691
+ _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _953 => _953.colWidthOverridesPx, 'access', _954 => _954[col]]), () => ( precomputedWidths[index])), () => ( _optionalChain([activeSheet, 'optionalAccess', _955 => _955.defaultColWidthPx]))), () => ( DEFAULT_COL_WIDTH2)),
15582
15692
  showGridLines
15583
15693
  ),
15584
15694
  DEFAULT_COL_WIDTH2 / 2
15585
15695
  );
15586
15696
  }
15587
- for (let col = Math.max(0, (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _951 => _951.maxUsedCol]), () => ( -1))) + 1); col < displayColLimit; col += 1) {
15697
+ for (let col = Math.max(0, (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _956 => _956.maxUsedCol]), () => ( -1))) + 1); col < displayColLimit; col += 1) {
15588
15698
  if (hiddenColSet.has(col)) continue;
15589
- const overrideWidth = _optionalChain([activeSheet, 'optionalAccess', _952 => _952.colWidthOverridesPx, 'access', _953 => _953[col]]);
15699
+ const overrideWidth = _optionalChain([activeSheet, 'optionalAccess', _957 => _957.colWidthOverridesPx, 'access', _958 => _958[col]]);
15590
15700
  widths[col] = overrideWidth === void 0 ? fallbackWidth : Math.max(_chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, overrideWidth, showGridLines), DEFAULT_COL_WIDTH2 / 2);
15591
15701
  }
15592
15702
  return widths;
15593
15703
  },
15594
15704
  [
15595
15705
  hiddenColSet,
15596
- _optionalChain([activeSheet, 'optionalAccess', _954 => _954.officeLayout]),
15597
- _optionalChain([activeSheet, 'optionalAccess', _955 => _955.colWidthOverridesPx]),
15598
- _optionalChain([activeSheet, 'optionalAccess', _956 => _956.colWidths]),
15599
- _optionalChain([activeSheet, 'optionalAccess', _957 => _957.defaultColWidthPx]),
15600
- _optionalChain([activeSheet, 'optionalAccess', _958 => _958.maxUsedCol]),
15601
- _optionalChain([activeSheet, 'optionalAccess', _959 => _959.showGridLines]),
15602
- _optionalChain([activeSheet, 'optionalAccess', _960 => _960.visibleCols]),
15706
+ _optionalChain([activeSheet, 'optionalAccess', _959 => _959.officeLayout]),
15707
+ _optionalChain([activeSheet, 'optionalAccess', _960 => _960.colWidthOverridesPx]),
15708
+ _optionalChain([activeSheet, 'optionalAccess', _961 => _961.colWidths]),
15709
+ _optionalChain([activeSheet, 'optionalAccess', _962 => _962.defaultColWidthPx]),
15710
+ _optionalChain([activeSheet, 'optionalAccess', _963 => _963.maxUsedCol]),
15711
+ _optionalChain([activeSheet, 'optionalAccess', _964 => _964.showGridLines]),
15712
+ _optionalChain([activeSheet, 'optionalAccess', _965 => _965.visibleCols]),
15603
15713
  displayColLimit,
15604
15714
  worksheet,
15605
15715
  revision,
@@ -15607,26 +15717,26 @@ function XlsxGrid({
15607
15717
  ]
15608
15718
  );
15609
15719
  const autoHeightCells = _chunkZ4WMURVUcjs.T.call(void 0,
15610
- () => worksheet && !_optionalChain([activeSheet, 'optionalAccess', _961 => _961.officeLayout]) ? _chunkGP5SOQQHcjs.readWorksheetAutoHeightCells.call(void 0, worksheet, displayRowLimit, displayColLimit, locale) : [],
15611
- [_optionalChain([activeSheet, 'optionalAccess', _962 => _962.officeLayout]), displayColLimit, displayRowLimit, locale, revision, worksheet]
15720
+ () => worksheet && !_optionalChain([activeSheet, 'optionalAccess', _966 => _966.officeLayout]) ? _chunkGP5SOQQHcjs.readWorksheetAutoHeightCells.call(void 0, worksheet, displayRowLimit, displayColLimit, locale) : [],
15721
+ [_optionalChain([activeSheet, 'optionalAccess', _967 => _967.officeLayout]), displayColLimit, displayRowLimit, locale, revision, worksheet]
15612
15722
  );
15613
15723
  const actualRowHeights = _chunkZ4WMURVUcjs.T.call(void 0,
15614
15724
  () => {
15615
- const office = _optionalChain([activeSheet, 'optionalAccess', _963 => _963.officeLayout]);
15725
+ const office = _optionalChain([activeSheet, 'optionalAccess', _968 => _968.officeLayout]);
15616
15726
  if (office) {
15617
15727
  return Array.from({ length: displayRowLimit }, (_2, index) => {
15618
15728
  if (hiddenRowSet.has(index)) return 0;
15619
15729
  const original = office.rows[index];
15620
- const override = _optionalChain([activeSheet, 'optionalAccess', _964 => _964.rowHeightOverridesPx, 'access', _965 => _965[index]]);
15621
- if (override !== void 0 && override !== _optionalChain([original, 'optionalAccess', _966 => _966.sourcePx])) return override;
15622
- const height = _optionalChain([worksheet, 'optionalAccess', _967 => _967.getRowHeight, 'call', _968 => _968(index)]);
15623
- return height !== void 0 && height !== null ? Math.max(0, height * (4 / 3)) : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _969 => _969.sizePx]), () => ( office.defaultRowPx));
15730
+ const override = _optionalChain([activeSheet, 'optionalAccess', _969 => _969.rowHeightOverridesPx, 'access', _970 => _970[index]]);
15731
+ if (override !== void 0 && override !== _optionalChain([original, 'optionalAccess', _971 => _971.sourcePx])) return override;
15732
+ const height = _optionalChain([worksheet, 'optionalAccess', _972 => _972.getRowHeight, 'call', _973 => _973(index)]);
15733
+ return height !== void 0 && height !== null ? Math.max(0, height * (4 / 3)) : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _974 => _974.sizePx]), () => ( office.defaultRowPx));
15624
15734
  });
15625
15735
  }
15626
15736
  const heights = new Array(displayRowLimit).fill(0);
15627
- const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _970 => _970.showGridLines]), () => ( true));
15737
+ const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _975 => _975.showGridLines]), () => ( true));
15628
15738
  const fallbackHeight = Math.max(
15629
- _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _971 => _971.defaultRowHeightPx]), () => ( DEFAULT_ROW_HEIGHT2)), showGridLines),
15739
+ _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _976 => _976.defaultRowHeightPx]), () => ( DEFAULT_ROW_HEIGHT2)), showGridLines),
15630
15740
  DEFAULT_ROW_HEIGHT2 / 1.5
15631
15741
  );
15632
15742
  if (worksheet) {
@@ -15634,18 +15744,18 @@ function XlsxGrid({
15634
15744
  for (const { index: row3, cells } of autoHeightCells) {
15635
15745
  let estimatedHeight = 0;
15636
15746
  for (const cell of cells) {
15637
- const cellStyle = buildCellStyle(asRecord(cell.style), palette, _optionalChain([activeSheet, 'optionalAccess', _972 => _972.themePalette]), { showGridLines });
15638
- const spanEnd = Math.min(displayColLimit, cell.col + (_nullishCoalesce(_optionalChain([cell, 'access', _973 => _973.mergeSpan, 'optionalAccess', _974 => _974.colSpan]), () => ( 1))));
15747
+ const cellStyle = buildCellStyle(asRecord(cell.style), palette, _optionalChain([activeSheet, 'optionalAccess', _977 => _977.themePalette]), { showGridLines });
15748
+ const spanEnd = Math.min(displayColLimit, cell.col + (_nullishCoalesce(_optionalChain([cell, 'access', _978 => _978.mergeSpan, 'optionalAccess', _979 => _979.colSpan]), () => ( 1))));
15639
15749
  let cellWidth = 0;
15640
15750
  for (let col = cell.col; col < spanEnd; col += 1) {
15641
- cellWidth += _nullishCoalesce(actualColWidths[col], () => ( (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _975 => _975.defaultColWidthPx]), () => ( DEFAULT_COL_WIDTH2)))));
15751
+ cellWidth += _nullishCoalesce(actualColWidths[col], () => ( (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _980 => _980.defaultColWidthPx]), () => ( DEFAULT_COL_WIDTH2)))));
15642
15752
  }
15643
15753
  estimatedHeight = Math.max(estimatedHeight, measureWrappedTextHeight(cell.value, cellStyle, cellWidth));
15644
15754
  }
15645
15755
  estimatedHeights.set(row3, estimatedHeight);
15646
15756
  }
15647
15757
  for (let row3 = 0; row3 < displayRowLimit; row3 += 1) {
15648
- if (worksheet.isRowHidden(row3)) continue;
15758
+ if (hiddenRowSet.has(row3)) continue;
15649
15759
  const height = worksheet.getRowHeight(row3);
15650
15760
  if (height !== void 0 && height !== null) {
15651
15761
  heights[row3] = Math.max(
@@ -15657,7 +15767,7 @@ function XlsxGrid({
15657
15767
  const estimatedAutoHeight = _nullishCoalesce(estimatedHeights.get(row3), () => ( 0));
15658
15768
  heights[row3] = estimatedAutoHeight > 0 ? Math.max(_chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, Math.ceil(estimatedAutoHeight), showGridLines), fallbackHeight) : Math.max(
15659
15769
  _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0,
15660
- _nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _976 => _976.rowHeightOverridesPx, 'access', _977 => _977[row3]]), () => ( _optionalChain([activeSheet, 'optionalAccess', _978 => _978.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT2)),
15770
+ _nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _981 => _981.rowHeightOverridesPx, 'access', _982 => _982[row3]]), () => ( _optionalChain([activeSheet, 'optionalAccess', _983 => _983.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT2)),
15661
15771
  showGridLines
15662
15772
  ),
15663
15773
  DEFAULT_ROW_HEIGHT2 / 1.5
@@ -15665,8 +15775,8 @@ function XlsxGrid({
15665
15775
  }
15666
15776
  return heights;
15667
15777
  }
15668
- const precomputedRows = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _979 => _979.visibleRows]), () => ( []));
15669
- const precomputedHeights = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _980 => _980.rowHeights]), () => ( []));
15778
+ const precomputedRows = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _984 => _984.visibleRows]), () => ( []));
15779
+ const precomputedHeights = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _985 => _985.rowHeights]), () => ( []));
15670
15780
  for (let index = 0; index < precomputedRows.length; index += 1) {
15671
15781
  const row3 = precomputedRows[index];
15672
15782
  if (row3 === void 0 || row3 >= displayRowLimit) {
@@ -15674,29 +15784,29 @@ function XlsxGrid({
15674
15784
  }
15675
15785
  heights[row3] = Math.max(
15676
15786
  _chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0,
15677
- _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _981 => _981.rowHeightOverridesPx, 'access', _982 => _982[row3]]), () => ( precomputedHeights[index])), () => ( _optionalChain([activeSheet, 'optionalAccess', _983 => _983.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT2)),
15787
+ _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _986 => _986.rowHeightOverridesPx, 'access', _987 => _987[row3]]), () => ( precomputedHeights[index])), () => ( _optionalChain([activeSheet, 'optionalAccess', _988 => _988.defaultRowHeightPx]))), () => ( DEFAULT_ROW_HEIGHT2)),
15678
15788
  showGridLines
15679
15789
  ),
15680
15790
  DEFAULT_ROW_HEIGHT2 / 1.5
15681
15791
  );
15682
15792
  }
15683
- for (let row3 = Math.max(0, (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _984 => _984.maxUsedRow]), () => ( -1))) + 1); row3 < displayRowLimit; row3 += 1) {
15793
+ for (let row3 = Math.max(0, (_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _989 => _989.maxUsedRow]), () => ( -1))) + 1); row3 < displayRowLimit; row3 += 1) {
15684
15794
  if (hiddenRowSet.has(row3)) continue;
15685
- const overrideHeight = _optionalChain([activeSheet, 'optionalAccess', _985 => _985.rowHeightOverridesPx, 'access', _986 => _986[row3]]);
15795
+ const overrideHeight = _optionalChain([activeSheet, 'optionalAccess', _990 => _990.rowHeightOverridesPx, 'access', _991 => _991[row3]]);
15686
15796
  heights[row3] = overrideHeight === void 0 ? fallbackHeight : Math.max(_chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, overrideHeight, showGridLines), DEFAULT_ROW_HEIGHT2 / 1.5);
15687
15797
  }
15688
15798
  return heights;
15689
15799
  },
15690
15800
  [
15691
15801
  hiddenRowSet,
15692
- _optionalChain([activeSheet, 'optionalAccess', _987 => _987.officeLayout]),
15693
- _optionalChain([activeSheet, 'optionalAccess', _988 => _988.defaultRowHeightPx]),
15694
- _optionalChain([activeSheet, 'optionalAccess', _989 => _989.maxUsedRow]),
15695
- _optionalChain([activeSheet, 'optionalAccess', _990 => _990.rowHeightOverridesPx]),
15696
- _optionalChain([activeSheet, 'optionalAccess', _991 => _991.rowHeights]),
15697
- _optionalChain([activeSheet, 'optionalAccess', _992 => _992.showGridLines]),
15698
- _optionalChain([activeSheet, 'optionalAccess', _993 => _993.themePalette]),
15699
- _optionalChain([activeSheet, 'optionalAccess', _994 => _994.visibleRows]),
15802
+ _optionalChain([activeSheet, 'optionalAccess', _992 => _992.officeLayout]),
15803
+ _optionalChain([activeSheet, 'optionalAccess', _993 => _993.defaultRowHeightPx]),
15804
+ _optionalChain([activeSheet, 'optionalAccess', _994 => _994.maxUsedRow]),
15805
+ _optionalChain([activeSheet, 'optionalAccess', _995 => _995.rowHeightOverridesPx]),
15806
+ _optionalChain([activeSheet, 'optionalAccess', _996 => _996.rowHeights]),
15807
+ _optionalChain([activeSheet, 'optionalAccess', _997 => _997.showGridLines]),
15808
+ _optionalChain([activeSheet, 'optionalAccess', _998 => _998.themePalette]),
15809
+ _optionalChain([activeSheet, 'optionalAccess', _999 => _999.visibleRows]),
15700
15810
  actualColWidths,
15701
15811
  autoHeightCells,
15702
15812
  displayRowLimit,
@@ -15902,19 +16012,19 @@ function XlsxGrid({
15902
16012
  [domBaseColIndices, domBaseRowIndices, indexedMergedRegions]
15903
16013
  );
15904
16014
  const maxRowDisplayLimit = _chunkZ4WMURVUcjs.T.call(void 0,
15905
- () => resolveOpenGridExtent(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _995 => _995.maxUsedRow]), () => ( -1)), MIN_OPEN_GRID_ROWS, OPEN_GRID_ROW_PADDING),
15906
- [_optionalChain([activeSheet, 'optionalAccess', _996 => _996.maxUsedRow])]
16015
+ () => resolveOpenGridExtent(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1000 => _1000.maxUsedRow]), () => ( -1)), MIN_OPEN_GRID_ROWS, OPEN_GRID_ROW_PADDING),
16016
+ [_optionalChain([activeSheet, 'optionalAccess', _1001 => _1001.maxUsedRow])]
15907
16017
  );
15908
16018
  const maxColDisplayLimit = _chunkZ4WMURVUcjs.T.call(void 0,
15909
- () => resolveOpenGridExtent(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _997 => _997.maxUsedCol]), () => ( -1)), MIN_OPEN_GRID_COLS, OPEN_GRID_COL_PADDING),
15910
- [_optionalChain([activeSheet, 'optionalAccess', _998 => _998.maxUsedCol])]
16019
+ () => resolveOpenGridExtent(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1002 => _1002.maxUsedCol]), () => ( -1)), MIN_OPEN_GRID_COLS, OPEN_GRID_COL_PADDING),
16020
+ [_optionalChain([activeSheet, 'optionalAccess', _1003 => _1003.maxUsedCol])]
15911
16021
  );
15912
16022
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
15913
16023
  if (!isWorkerBacked) {
15914
16024
  return;
15915
16025
  }
15916
- const lastVirtualRowIndex = _nullishCoalesce(_optionalChain([currentRowVirtualItems, 'access', _999 => _999[currentRowVirtualItems.length - 1], 'optionalAccess', _1000 => _1000.index]), () => ( -1));
15917
- const lastVirtualColIndex = _nullishCoalesce(_optionalChain([currentColVirtualItems, 'access', _1001 => _1001[currentColVirtualItems.length - 1], 'optionalAccess', _1002 => _1002.index]), () => ( -1));
16026
+ const lastVirtualRowIndex = _nullishCoalesce(_optionalChain([currentRowVirtualItems, 'access', _1004 => _1004[currentRowVirtualItems.length - 1], 'optionalAccess', _1005 => _1005.index]), () => ( -1));
16027
+ const lastVirtualColIndex = _nullishCoalesce(_optionalChain([currentColVirtualItems, 'access', _1006 => _1006[currentColVirtualItems.length - 1], 'optionalAccess', _1007 => _1007.index]), () => ( -1));
15918
16028
  if (lastVirtualRowIndex >= visibleRows.length - WORKER_GRID_GROW_THRESHOLD_ROWS && displayRowLimit < maxRowDisplayLimit) {
15919
16029
  setDisplayRowLimit((current) => Math.min(maxRowDisplayLimit, current + WORKER_GRID_GROW_ROWS));
15920
16030
  }
@@ -16129,7 +16239,7 @@ function XlsxGrid({
16129
16239
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
16130
16240
  setDisplayRowLimit(
16131
16241
  resolveInitialDisplayExtent(
16132
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1003 => _1003.maxUsedRow]), () => ( -1)),
16242
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1008 => _1008.maxUsedRow]), () => ( -1)),
16133
16243
  MIN_OPEN_GRID_ROWS,
16134
16244
  OPEN_GRID_ROW_PADDING,
16135
16245
  Boolean(isWorkerBacked),
@@ -16138,40 +16248,40 @@ function XlsxGrid({
16138
16248
  );
16139
16249
  setDisplayColLimit(
16140
16250
  resolveInitialDisplayExtent(
16141
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1004 => _1004.maxUsedCol]), () => ( -1)),
16251
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1009 => _1009.maxUsedCol]), () => ( -1)),
16142
16252
  MIN_OPEN_GRID_COLS,
16143
16253
  OPEN_GRID_COL_PADDING,
16144
16254
  Boolean(isWorkerBacked),
16145
16255
  INITIAL_WORKER_GRID_COLS
16146
16256
  )
16147
16257
  );
16148
- }, [_optionalChain([activeSheet, 'optionalAccess', _1005 => _1005.maxUsedCol]), _optionalChain([activeSheet, 'optionalAccess', _1006 => _1006.maxUsedRow]), activeSheetIndex, isWorkerBacked]);
16258
+ }, [_optionalChain([activeSheet, 'optionalAccess', _1010 => _1010.maxUsedCol]), _optionalChain([activeSheet, 'optionalAccess', _1011 => _1011.maxUsedRow]), activeSheetIndex, isWorkerBacked]);
16149
16259
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
16150
- const selectionEndRow = _nullishCoalesce(_optionalChain([normalizedSelection, 'optionalAccess', _1007 => _1007.end, 'access', _1008 => _1008.row]), () => ( -1));
16151
- const selectionEndCol = _nullishCoalesce(_optionalChain([normalizedSelection, 'optionalAccess', _1009 => _1009.end, 'access', _1010 => _1010.col]), () => ( -1));
16152
- const rowPadding = _optionalChain([axisSelectionRef, 'access', _1011 => _1011.current, 'optionalAccess', _1012 => _1012.axis]) === "column" ? 0 : OPEN_GRID_ROW_PADDING;
16153
- const colPadding = _optionalChain([axisSelectionRef, 'access', _1013 => _1013.current, 'optionalAccess', _1014 => _1014.axis]) === "row" ? 0 : OPEN_GRID_COL_PADDING;
16260
+ const selectionEndRow = _nullishCoalesce(_optionalChain([normalizedSelection, 'optionalAccess', _1012 => _1012.end, 'access', _1013 => _1013.row]), () => ( -1));
16261
+ const selectionEndCol = _nullishCoalesce(_optionalChain([normalizedSelection, 'optionalAccess', _1014 => _1014.end, 'access', _1015 => _1015.col]), () => ( -1));
16262
+ const rowPadding = _optionalChain([axisSelectionRef, 'access', _1016 => _1016.current, 'optionalAccess', _1017 => _1017.axis]) === "column" ? 0 : OPEN_GRID_ROW_PADDING;
16263
+ const colPadding = _optionalChain([axisSelectionRef, 'access', _1018 => _1018.current, 'optionalAccess', _1019 => _1019.axis]) === "row" ? 0 : OPEN_GRID_COL_PADDING;
16154
16264
  const nextRowLimit = Math.max(
16155
16265
  resolveInitialDisplayExtent(
16156
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1015 => _1015.maxUsedRow]), () => ( -1)),
16157
- minimumVisibleExtent(MIN_OPEN_GRID_ROWS, _optionalChain([activeSheet, 'optionalAccess', _1016 => _1016.hiddenRows]), _chunkGP5SOQQHcjs.XLSX_MAX_ROWS),
16266
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1020 => _1020.maxUsedRow]), () => ( -1)),
16267
+ minimumVisibleExtent(MIN_OPEN_GRID_ROWS, _optionalChain([activeSheet, 'optionalAccess', _1021 => _1021.hiddenRows]), _chunkGP5SOQQHcjs.XLSX_MAX_ROWS),
16158
16268
  OPEN_GRID_ROW_PADDING,
16159
16269
  false,
16160
16270
  INITIAL_WORKER_GRID_ROWS
16161
16271
  ),
16162
- (_nullishCoalesce(_optionalChain([activeCell, 'optionalAccess', _1017 => _1017.row]), () => ( -1))) + rowPadding + 1,
16272
+ (_nullishCoalesce(_optionalChain([activeCell, 'optionalAccess', _1022 => _1022.row]), () => ( -1))) + rowPadding + 1,
16163
16273
  selectionEndRow + rowPadding + 1,
16164
16274
  drawingExtents.maxRow + OPEN_GRID_ROW_PADDING + 1
16165
16275
  );
16166
16276
  const nextColLimit = Math.max(
16167
16277
  resolveInitialDisplayExtent(
16168
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1018 => _1018.maxUsedCol]), () => ( -1)),
16169
- minimumVisibleExtent(MIN_OPEN_GRID_COLS, _optionalChain([activeSheet, 'optionalAccess', _1019 => _1019.hiddenCols]), _chunkGP5SOQQHcjs.XLSX_MAX_COLUMNS),
16278
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1023 => _1023.maxUsedCol]), () => ( -1)),
16279
+ minimumVisibleExtent(MIN_OPEN_GRID_COLS, _optionalChain([activeSheet, 'optionalAccess', _1024 => _1024.hiddenCols]), _chunkGP5SOQQHcjs.XLSX_MAX_COLUMNS),
16170
16280
  OPEN_GRID_COL_PADDING,
16171
16281
  false,
16172
16282
  INITIAL_WORKER_GRID_COLS
16173
16283
  ),
16174
- (_nullishCoalesce(_optionalChain([activeCell, 'optionalAccess', _1020 => _1020.col]), () => ( -1))) + colPadding + 1,
16284
+ (_nullishCoalesce(_optionalChain([activeCell, 'optionalAccess', _1025 => _1025.col]), () => ( -1))) + colPadding + 1,
16175
16285
  selectionEndCol + colPadding + 1,
16176
16286
  drawingExtents.maxCol + OPEN_GRID_COL_PADDING + 1
16177
16287
  );
@@ -16179,30 +16289,30 @@ function XlsxGrid({
16179
16289
  setDisplayColLimit((current) => current < nextColLimit ? nextColLimit : current);
16180
16290
  }, [
16181
16291
  activeCell,
16182
- _optionalChain([activeSheet, 'optionalAccess', _1021 => _1021.hiddenRows]),
16183
- _optionalChain([activeSheet, 'optionalAccess', _1022 => _1022.hiddenCols]),
16184
- _optionalChain([activeSheet, 'optionalAccess', _1023 => _1023.maxUsedCol]),
16185
- _optionalChain([activeSheet, 'optionalAccess', _1024 => _1024.maxUsedRow]),
16292
+ _optionalChain([activeSheet, 'optionalAccess', _1026 => _1026.hiddenRows]),
16293
+ _optionalChain([activeSheet, 'optionalAccess', _1027 => _1027.hiddenCols]),
16294
+ _optionalChain([activeSheet, 'optionalAccess', _1028 => _1028.maxUsedCol]),
16295
+ _optionalChain([activeSheet, 'optionalAccess', _1029 => _1029.maxUsedRow]),
16186
16296
  drawingExtents.maxCol,
16187
16297
  drawingExtents.maxRow,
16188
- _optionalChain([normalizedSelection, 'optionalAccess', _1025 => _1025.end, 'access', _1026 => _1026.col]),
16189
- _optionalChain([normalizedSelection, 'optionalAccess', _1027 => _1027.end, 'access', _1028 => _1028.row])
16298
+ _optionalChain([normalizedSelection, 'optionalAccess', _1030 => _1030.end, 'access', _1031 => _1031.col]),
16299
+ _optionalChain([normalizedSelection, 'optionalAccess', _1032 => _1032.end, 'access', _1033 => _1033.row])
16190
16300
  ]);
16191
16301
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
16192
16302
  const initialScrollKey = [
16193
16303
  displayFileName,
16194
16304
  activeSheetIndex,
16195
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1029 => _1029.workbookSheetIndex]), () => ( -1)),
16196
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1030 => _1030.name]), () => ( "")),
16197
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1031 => _1031.minUsedRow]), () => ( -1)),
16198
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1032 => _1032.minUsedCol]), () => ( -1)),
16305
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1034 => _1034.workbookSheetIndex]), () => ( -1)),
16306
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1035 => _1035.name]), () => ( "")),
16307
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1036 => _1036.minUsedRow]), () => ( -1)),
16308
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1037 => _1037.minUsedCol]), () => ( -1)),
16199
16309
  isWorkerBacked ? "worker" : "main"
16200
16310
  ].join("|");
16201
16311
  if (initialScrollKeyRef.current === initialScrollKey) {
16202
16312
  return;
16203
16313
  }
16204
- const initialUsedRow = resolveFirstUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1033 => _1033.minUsedRow]), () => ( -1)));
16205
- const initialUsedCol = resolveFirstUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1034 => _1034.minUsedCol]), () => ( -1)));
16314
+ const initialUsedRow = resolveFirstUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1038 => _1038.minUsedRow]), () => ( -1)));
16315
+ const initialUsedCol = resolveFirstUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1039 => _1039.minUsedCol]), () => ( -1)));
16206
16316
  const initialScrollTop = initialUsedRow > 0 ? sumPrefixRange(actualRowPrefixSums, 0, initialUsedRow - 1) : 0;
16207
16317
  const initialScrollLeft = initialUsedCol > 0 ? sumPrefixRange(actualColPrefixSums, 0, initialUsedCol - 1) : 0;
16208
16318
  if (shouldUseDomVirtualizer && shouldVirtualizeRows) {
@@ -16221,10 +16331,10 @@ function XlsxGrid({
16221
16331
  }
16222
16332
  initialScrollKeyRef.current = initialScrollKey;
16223
16333
  }, [
16224
- _optionalChain([activeSheet, 'optionalAccess', _1035 => _1035.minUsedCol]),
16225
- _optionalChain([activeSheet, 'optionalAccess', _1036 => _1036.minUsedRow]),
16226
- _optionalChain([activeSheet, 'optionalAccess', _1037 => _1037.name]),
16227
- _optionalChain([activeSheet, 'optionalAccess', _1038 => _1038.workbookSheetIndex]),
16334
+ _optionalChain([activeSheet, 'optionalAccess', _1040 => _1040.minUsedCol]),
16335
+ _optionalChain([activeSheet, 'optionalAccess', _1041 => _1041.minUsedRow]),
16336
+ _optionalChain([activeSheet, 'optionalAccess', _1042 => _1042.name]),
16337
+ _optionalChain([activeSheet, 'optionalAccess', _1043 => _1043.workbookSheetIndex]),
16228
16338
  activeSheetIndex,
16229
16339
  actualColPrefixSums,
16230
16340
  actualRowPrefixSums,
@@ -16463,7 +16573,7 @@ function XlsxGrid({
16463
16573
  return;
16464
16574
  }
16465
16575
  function handlePointerDown(event) {
16466
- if (_optionalChain([tableMenuRef, 'access', _1039 => _1039.current, 'optionalAccess', _1040 => _1040.contains, 'call', _1041 => _1041(event.target)])) {
16576
+ if (_optionalChain([tableMenuRef, 'access', _1044 => _1044.current, 'optionalAccess', _1045 => _1045.contains, 'call', _1046 => _1046(event.target)])) {
16467
16577
  return;
16468
16578
  }
16469
16579
  setOpenTableMenu(null);
@@ -16474,7 +16584,7 @@ function XlsxGrid({
16474
16584
  }
16475
16585
  }
16476
16586
  function handleViewportChange(event) {
16477
- if (event.target instanceof Node && _optionalChain([tableMenuRef, 'access', _1042 => _1042.current, 'optionalAccess', _1043 => _1043.contains, 'call', _1044 => _1044(event.target)])) return;
16587
+ if (event.target instanceof Node && _optionalChain([tableMenuRef, 'access', _1047 => _1047.current, 'optionalAccess', _1048 => _1048.contains, 'call', _1049 => _1049(event.target)])) return;
16478
16588
  setOpenTableMenu(null);
16479
16589
  }
16480
16590
  window.addEventListener("pointerdown", handlePointerDown);
@@ -16482,15 +16592,15 @@ function XlsxGrid({
16482
16592
  window.addEventListener("scroll", handleViewportChange, true);
16483
16593
  window.addEventListener("resize", handleViewportChange);
16484
16594
  const scroller = scrollRef.current;
16485
- _optionalChain([scroller, 'optionalAccess', _1045 => _1045.addEventListener, 'call', _1046 => _1046("wheel", handleViewportChange, { passive: true })]);
16486
- _optionalChain([scroller, 'optionalAccess', _1047 => _1047.addEventListener, 'call', _1048 => _1048("gesturestart", handleViewportChange)]);
16595
+ _optionalChain([scroller, 'optionalAccess', _1050 => _1050.addEventListener, 'call', _1051 => _1051("wheel", handleViewportChange, { passive: true })]);
16596
+ _optionalChain([scroller, 'optionalAccess', _1052 => _1052.addEventListener, 'call', _1053 => _1053("gesturestart", handleViewportChange)]);
16487
16597
  return () => {
16488
16598
  window.removeEventListener("pointerdown", handlePointerDown);
16489
16599
  window.removeEventListener("keydown", handleKeyDown);
16490
16600
  window.removeEventListener("scroll", handleViewportChange, true);
16491
16601
  window.removeEventListener("resize", handleViewportChange);
16492
- _optionalChain([scroller, 'optionalAccess', _1049 => _1049.removeEventListener, 'call', _1050 => _1050("wheel", handleViewportChange)]);
16493
- _optionalChain([scroller, 'optionalAccess', _1051 => _1051.removeEventListener, 'call', _1052 => _1052("gesturestart", handleViewportChange)]);
16602
+ _optionalChain([scroller, 'optionalAccess', _1054 => _1054.removeEventListener, 'call', _1055 => _1055("wheel", handleViewportChange)]);
16603
+ _optionalChain([scroller, 'optionalAccess', _1056 => _1056.removeEventListener, 'call', _1057 => _1057("gesturestart", handleViewportChange)]);
16494
16604
  };
16495
16605
  }, [openTableMenu]);
16496
16606
  const resolvePointerCellFromGeometry = _chunkZ4WMURVUcjs.q.call(void 0, (clientX, clientY) => {
@@ -16543,7 +16653,7 @@ function XlsxGrid({
16543
16653
  if (!(element instanceof HTMLElement)) {
16544
16654
  continue;
16545
16655
  }
16546
- const cell = parseCellAddressAttribute(_nullishCoalesce(_optionalChain([element, 'access', _1053 => _1053.closest, 'call', _1054 => _1054("[data-xlsx-cell]"), 'optionalAccess', _1055 => _1055.getAttribute, 'call', _1056 => _1056("data-xlsx-cell")]), () => ( null)));
16656
+ const cell = parseCellAddressAttribute(_nullishCoalesce(_optionalChain([element, 'access', _1058 => _1058.closest, 'call', _1059 => _1059("[data-xlsx-cell]"), 'optionalAccess', _1060 => _1060.getAttribute, 'call', _1061 => _1061("data-xlsx-cell")]), () => ( null)));
16547
16657
  if (cell) {
16548
16658
  return cell;
16549
16659
  }
@@ -16575,8 +16685,8 @@ function XlsxGrid({
16575
16685
  const resolveDraggedSelectionCell = _chunkZ4WMURVUcjs.q.call(void 0, (dragState, clientX, clientY) => {
16576
16686
  const geometryCell = resolvePointerCellFromGeometry(clientX, clientY);
16577
16687
  const hitCell = resolvePointerCellFromHitTest(clientX, clientY);
16578
- const actualRow = _nullishCoalesce(_optionalChain([geometryCell, 'optionalAccess', _1057 => _1057.row]), () => ( (hitCell && rowIndexByActual.has(hitCell.row) ? hitCell.row : void 0)));
16579
- const actualCol = _nullishCoalesce(_optionalChain([geometryCell, 'optionalAccess', _1058 => _1058.col]), () => ( _optionalChain([hitCell, 'optionalAccess', _1059 => _1059.col])));
16688
+ const actualRow = _nullishCoalesce(_optionalChain([geometryCell, 'optionalAccess', _1062 => _1062.row]), () => ( (hitCell && rowIndexByActual.has(hitCell.row) ? hitCell.row : void 0)));
16689
+ const actualCol = _nullishCoalesce(_optionalChain([geometryCell, 'optionalAccess', _1063 => _1063.col]), () => ( _optionalChain([hitCell, 'optionalAccess', _1064 => _1064.col])));
16580
16690
  if (actualRow === void 0 || actualCol === void 0) {
16581
16691
  return null;
16582
16692
  }
@@ -16682,18 +16792,18 @@ function XlsxGrid({
16682
16792
  }
16683
16793
  }, [displayDefaultColWidth, displayEffectiveColWidths, displayRowHeaderWidth, visibleCols]);
16684
16794
  const applyRowPreview = _chunkZ4WMURVUcjs.q.call(void 0, (actualRow, heightPx) => {
16685
- const rowElement = _nullishCoalesce(_nullishCoalesce(rowElementRefs.current.get(actualRow), () => ( _optionalChain([wrapperRef, 'access', _1060 => _1060.current, 'optionalAccess', _1061 => _1061.querySelector, 'call', _1062 => _1062(`tr[data-xlsx-row="${actualRow}"]`)]))), () => ( null));
16795
+ const rowElement = _nullishCoalesce(_nullishCoalesce(rowElementRefs.current.get(actualRow), () => ( _optionalChain([wrapperRef, 'access', _1065 => _1065.current, 'optionalAccess', _1066 => _1066.querySelector, 'call', _1067 => _1067(`tr[data-xlsx-row="${actualRow}"]`)]))), () => ( null));
16686
16796
  if (rowElement) {
16687
16797
  rowElementRefs.current.set(actualRow, rowElement);
16688
16798
  rowElement.style.height = heightPx === null ? "" : `${heightPx}px`;
16689
16799
  }
16690
16800
  }, []);
16691
16801
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
16692
- _optionalChain([pendingSelectionDragCleanupRef, 'access', _1063 => _1063.current, 'optionalCall', _1064 => _1064()]);
16693
- _optionalChain([selectionDragCleanupRef, 'access', _1065 => _1065.current, 'optionalCall', _1066 => _1066()]);
16694
- _optionalChain([fillDragCleanupRef, 'access', _1067 => _1067.current, 'optionalCall', _1068 => _1068()]);
16695
- _optionalChain([chartInteractionCleanupRef, 'access', _1069 => _1069.current, 'optionalCall', _1070 => _1070()]);
16696
- _optionalChain([imageInteractionCleanupRef, 'access', _1071 => _1071.current, 'optionalCall', _1072 => _1072()]);
16802
+ _optionalChain([pendingSelectionDragCleanupRef, 'access', _1068 => _1068.current, 'optionalCall', _1069 => _1069()]);
16803
+ _optionalChain([selectionDragCleanupRef, 'access', _1070 => _1070.current, 'optionalCall', _1071 => _1071()]);
16804
+ _optionalChain([fillDragCleanupRef, 'access', _1072 => _1072.current, 'optionalCall', _1073 => _1073()]);
16805
+ _optionalChain([chartInteractionCleanupRef, 'access', _1074 => _1074.current, 'optionalCall', _1075 => _1075()]);
16806
+ _optionalChain([imageInteractionCleanupRef, 'access', _1076 => _1076.current, 'optionalCall', _1077 => _1077()]);
16697
16807
  pendingSelectionDragCleanupRef.current = null;
16698
16808
  selectionDragCleanupRef.current = null;
16699
16809
  fillDragCleanupRef.current = null;
@@ -16752,7 +16862,7 @@ function XlsxGrid({
16752
16862
  if (!scroller || interactiveTarget && interactiveTarget !== scroller) {
16753
16863
  return;
16754
16864
  }
16755
- _optionalChain([gridKeyboardHandlerRef, 'access', _1073 => _1073.current, 'optionalCall', _1074 => _1074(event)]);
16865
+ _optionalChain([gridKeyboardHandlerRef, 'access', _1078 => _1078.current, 'optionalCall', _1079 => _1079(event)]);
16756
16866
  };
16757
16867
  document.addEventListener("pointerdown", handleDocumentPointerDown, true);
16758
16868
  document.addEventListener("keydown", handleDocumentKeyDown);
@@ -16778,7 +16888,7 @@ function XlsxGrid({
16778
16888
  return;
16779
16889
  }
16780
16890
  }
16781
- const externalTarget = _optionalChain([target, 'optionalAccess', _1075 => _1075.trim, 'call', _1076 => _1076()]);
16891
+ const externalTarget = _optionalChain([target, 'optionalAccess', _1080 => _1080.trim, 'call', _1081 => _1081()]);
16782
16892
  if (!externalTarget || externalTarget.startsWith("#") || typeof window === "undefined") {
16783
16893
  return;
16784
16894
  }
@@ -16849,7 +16959,7 @@ function XlsxGrid({
16849
16959
  enabled: !!renderCellEditorOverlay && !readOnly && !isLoading,
16850
16960
  cell: editingCell,
16851
16961
  sheetIndex: activeSheetIndex,
16852
- sheetName: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1077 => _1077.name]), () => ( "")),
16962
+ sheetName: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1082 => _1082.name]), () => ( "")),
16853
16963
  originalValue: editingSavedValueRef.current,
16854
16964
  trigger: editingTriggerRef.current,
16855
16965
  value: editingValue,
@@ -16864,7 +16974,7 @@ function XlsxGrid({
16864
16974
  else commitEditing();
16865
16975
  }, [cancelEditing, commitEditing, hasEditorPreview]);
16866
16976
  const focusEditorOverlay = _chunkZ4WMURVUcjs.q.call(void 0, () => {
16867
- const target = _optionalChain([editorOverlayRef, 'access', _1078 => _1078.current, 'optionalAccess', _1079 => _1079.querySelector, 'call', _1080 => _1080('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), a[href], [tabindex="0"]')]);
16977
+ const target = _optionalChain([editorOverlayRef, 'access', _1083 => _1083.current, 'optionalAccess', _1084 => _1084.querySelector, 'call', _1085 => _1085('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), a[href], [tabindex="0"]')]);
16868
16978
  if (!target) return false;
16869
16979
  target.focus({ preventScroll: true });
16870
16980
  return true;
@@ -16873,7 +16983,7 @@ function XlsxGrid({
16873
16983
  if (!editingCellRef.current) {
16874
16984
  return;
16875
16985
  }
16876
- if (event.relatedTarget && _optionalChain([editorOverlayRef, 'access', _1081 => _1081.current, 'optionalAccess', _1082 => _1082.contains, 'call', _1083 => _1083(event.relatedTarget)])) return;
16986
+ if (event.relatedTarget && _optionalChain([editorOverlayRef, 'access', _1086 => _1086.current, 'optionalAccess', _1087 => _1087.contains, 'call', _1088 => _1088(event.relatedTarget)])) return;
16877
16987
  exitEditorScope();
16878
16988
  }, [exitEditorScope]);
16879
16989
  const handleEditingNavigate = _chunkZ4WMURVUcjs.q.call(void 0, (key, value) => {
@@ -17017,11 +17127,11 @@ function XlsxGrid({
17017
17127
  }, [activeSheetIndex, revision, locale]);
17018
17128
  const sparklinesByCell = _chunkZ4WMURVUcjs.T.call(void 0, () => {
17019
17129
  const map = /* @__PURE__ */ new Map();
17020
- for (const sparkline of _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1084 => _1084.sparklines]), () => ( []))) {
17130
+ for (const sparkline of _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1089 => _1089.sparklines]), () => ( []))) {
17021
17131
  map.set(`${sparkline.target.row}:${sparkline.target.col}`, sparkline);
17022
17132
  }
17023
17133
  return map;
17024
- }, [_optionalChain([activeSheet, 'optionalAccess', _1085 => _1085.sparklines])]);
17134
+ }, [_optionalChain([activeSheet, 'optionalAccess', _1090 => _1090.sparklines])]);
17025
17135
  const chartRangeHighlights = _chunkZ4WMURVUcjs.T.call(void 0,
17026
17136
  () => collectChartRangeHighlights(selectedChart, selectedChartElement, sheets, workbook, paletteIsDark(palette)),
17027
17137
  [palette, selectedChart, selectedChartElement, sheets, workbook]
@@ -17078,8 +17188,8 @@ function XlsxGrid({
17078
17188
  return cached;
17079
17189
  }
17080
17190
  const batchCoversRow = viewportRowBatch ? row3 >= viewportRowBatch.startRow && row3 <= viewportRowBatch.endRow : false;
17081
- const batchedCell = batchCoversRow ? _optionalChain([viewportRowBatch, 'optionalAccess', _1086 => _1086.cells, 'access', _1087 => _1087.get, 'call', _1088 => _1088(cacheKey)]) : void 0;
17082
- const worksheetMergedSecondary = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _1089 => _1089.isMergedSecondary, 'call', _1090 => _1090(row3, col)]), () => ( false));
17191
+ const batchedCell = batchCoversRow ? _optionalChain([viewportRowBatch, 'optionalAccess', _1091 => _1091.cells, 'access', _1092 => _1092.get, 'call', _1093 => _1093(cacheKey)]) : void 0;
17192
+ const worksheetMergedSecondary = _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _1094 => _1094.isMergedSecondary, 'call', _1095 => _1095(row3, col)]), () => ( false));
17083
17193
  if (!worksheet && !batchedCell) {
17084
17194
  const emptyData = {
17085
17195
  isMergedSecondary: false,
@@ -17087,7 +17197,7 @@ function XlsxGrid({
17087
17197
  backgroundColor: resolveSheetSurface(activeSheet, palette),
17088
17198
  borderBottom: "none",
17089
17199
  borderRight: "none",
17090
- boxShadow: _optionalChain([activeSheet, 'optionalAccess', _1091 => _1091.showGridLines]) ? buildGridlineShadow(palette.border) : void 0,
17200
+ boxShadow: _optionalChain([activeSheet, 'optionalAccess', _1096 => _1096.showGridLines]) ? buildGridlineShadow(palette.border) : void 0,
17091
17201
  padding: DEFAULT_CELL_PADDING,
17092
17202
  verticalAlign: "bottom",
17093
17203
  whiteSpace: "nowrap"
@@ -17097,7 +17207,7 @@ function XlsxGrid({
17097
17207
  cellRenderCacheRef.current.set(cacheKey, emptyData);
17098
17208
  return emptyData;
17099
17209
  }
17100
- if (_optionalChain([batchedCell, 'optionalAccess', _1092 => _1092.isMergedSecondary]) || worksheetMergedSecondary) {
17210
+ if (_optionalChain([batchedCell, 'optionalAccess', _1097 => _1097.isMergedSecondary]) || worksheetMergedSecondary) {
17101
17211
  const mergedSecondaryData = {
17102
17212
  isMergedSecondary: true,
17103
17213
  style: {},
@@ -17106,7 +17216,7 @@ function XlsxGrid({
17106
17216
  cellRenderCacheRef.current.set(cacheKey, mergedSecondaryData);
17107
17217
  return mergedSecondaryData;
17108
17218
  }
17109
- const merge = worksheet ? worksheet.getMergeSpan(row3, col) : batchCoversRow ? _optionalChain([batchedCell, 'optionalAccess', _1093 => _1093.mergeSpan]) : null;
17219
+ const merge = worksheet ? worksheet.getMergeSpan(row3, col) : batchCoversRow ? _optionalChain([batchedCell, 'optionalAccess', _1098 => _1098.mergeSpan]) : null;
17110
17220
  const resolveBaseResolvedStyle = (targetRow, targetCol) => {
17111
17221
  const targetCacheKey = `${targetRow}:${targetCol}`;
17112
17222
  const cachedBaseStyle = cellBaseRawStyleCacheRef.current.get(targetCacheKey);
@@ -17114,9 +17224,9 @@ function XlsxGrid({
17114
17224
  return cachedBaseStyle;
17115
17225
  }
17116
17226
  const targetBatchCoversRow = viewportRowBatch ? targetRow >= viewportRowBatch.startRow && targetRow <= viewportRowBatch.endRow : false;
17117
- const targetBatchedCell = targetBatchCoversRow ? _optionalChain([viewportRowBatch, 'optionalAccess', _1094 => _1094.cells, 'access', _1095 => _1095.get, 'call', _1096 => _1096(targetCacheKey)]) : void 0;
17227
+ const targetBatchedCell = targetBatchCoversRow ? _optionalChain([viewportRowBatch, 'optionalAccess', _1099 => _1099.cells, 'access', _1100 => _1100.get, 'call', _1101 => _1101(targetCacheKey)]) : void 0;
17118
17228
  const targetInheritedStyle = resolveInheritedCellStyle2(activeSheet, targetRow, targetCol);
17119
- const targetWorksheetStyle = targetBatchCoversRow ? _nullishCoalesce(_optionalChain([targetBatchedCell, 'optionalAccess', _1097 => _1097.style]), () => ( null)) : _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _1098 => _1098.getCellStyleAt, 'call', _1099 => _1099(targetRow, targetCol)]), () => ( null));
17229
+ const targetWorksheetStyle = targetBatchCoversRow ? _nullishCoalesce(_optionalChain([targetBatchedCell, 'optionalAccess', _1102 => _1102.style]), () => ( null)) : _nullishCoalesce(_optionalChain([worksheet, 'optionalAccess', _1103 => _1103.getCellStyleAt, 'call', _1104 => _1104(targetRow, targetCol)]), () => ( null));
17120
17230
  const targetRawStyle = mergeResolvedCellStyle(targetInheritedStyle, targetWorksheetStyle, {
17121
17231
  replaceXfSubtrees: true
17122
17232
  });
@@ -17130,8 +17240,8 @@ function XlsxGrid({
17130
17240
  return resolvedStyle;
17131
17241
  };
17132
17242
  const table = getTableAtCell(effectiveTables, row3, col);
17133
- const mergeRowSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _1100 => _1100.rowSpan]), () => ( 1)));
17134
- const mergeColSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _1101 => _1101.colSpan]), () => ( 1)));
17243
+ const mergeRowSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _1105 => _1105.rowSpan]), () => ( 1)));
17244
+ const mergeColSpan = Math.max(1, _nullishCoalesce(_optionalChain([merge, 'optionalAccess', _1106 => _1106.colSpan]), () => ( 1)));
17135
17245
  let mergedBorderOverlay = null;
17136
17246
  if (mergeRowSpan > 1 || mergeColSpan > 1) {
17137
17247
  const mergedBorderOverlayCacheKey = `${row3}:${col}:${mergeRowSpan}:${mergeColSpan}`;
@@ -17153,7 +17263,7 @@ function XlsxGrid({
17153
17263
  let displayValue = null;
17154
17264
  const readDisplayValue = () => {
17155
17265
  if (displayValue === null) {
17156
- displayValue = batchCoversRow || !worksheet ? _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1102 => _1102.value]), () => ( "")) : getCellDisplayValue(worksheet, row3, col, activeSheet, locale);
17266
+ displayValue = batchCoversRow || !worksheet ? _nullishCoalesce(_optionalChain([batchedCell, 'optionalAccess', _1107 => _1107.value]), () => ( "")) : getCellDisplayValue(worksheet, row3, col, activeSheet, locale);
17157
17267
  }
17158
17268
  return displayValue;
17159
17269
  };
@@ -17164,13 +17274,13 @@ function XlsxGrid({
17164
17274
  () => worksheet ? getCellNumericValue(worksheet, row3, col) : getBatchedCellNumericValue(batchedCell),
17165
17275
  readDisplayValue,
17166
17276
  worksheet,
17167
- _optionalChain([viewportRowBatch, 'optionalAccess', _1103 => _1103.cells])
17277
+ _optionalChain([viewportRowBatch, 'optionalAccess', _1108 => _1108.cells])
17168
17278
  );
17169
17279
  const finalResolvedStyle = mergeResolvedCellStyle(resolvedMergedStyle, conditionalCellStyle);
17170
- const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _1104 => _1104.alignment]);
17171
- const textRotationDeg = resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1105 => _1105.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1106 => _1106.textRotation]))));
17280
+ const alignment = _optionalChain([finalResolvedStyle, 'optionalAccess', _1109 => _1109.alignment]);
17281
+ const textRotationDeg = resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1110 => _1110.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1111 => _1111.textRotation]))));
17172
17282
  const headerRowCount = table ? Math.max(table.headerRowCount, 1) : 0;
17173
- const rawHyperlink = batchCoversRow ? _optionalChain([batchedCell, 'optionalAccess', _1107 => _1107.hyperlink]) : _optionalChain([worksheet, 'optionalAccess', _1108 => _1108.getHyperlinkAt, 'call', _1109 => _1109(row3, col)]);
17283
+ const rawHyperlink = batchCoversRow ? _optionalChain([batchedCell, 'optionalAccess', _1112 => _1112.hyperlink]) : _optionalChain([worksheet, 'optionalAccess', _1113 => _1113.getHyperlinkAt, 'call', _1114 => _1114(row3, col)]);
17174
17284
  const sparkline = _nullishCoalesce(sparklinesByCell.get(cacheKey), () => ( null));
17175
17285
  const sparklineValues = sparkline && worksheet ? sparkline.range.start.row === sparkline.range.end.row ? Array.from(
17176
17286
  { length: Math.abs(sparkline.range.end.col - sparkline.range.start.col) + 1 },
@@ -17187,13 +17297,13 @@ function XlsxGrid({
17187
17297
  sparkline.range.start.col
17188
17298
  )
17189
17299
  ) : null;
17190
- const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _1110 => _1110.cellControl]) && worksheet ? getCellBooleanValue(worksheet, row3, col) : null;
17300
+ const checkboxState = _optionalChain([finalResolvedStyle, 'optionalAccess', _1115 => _1115.cellControl]) && worksheet ? getCellBooleanValue(worksheet, row3, col) : null;
17191
17301
  const chartHighlight = resolveCellChartHighlight({ row: row3, col }, activeSheetChartHighlights);
17192
17302
  const nextData = {
17193
17303
  canvas: void 0,
17194
17304
  chartHighlight,
17195
17305
  checkboxState,
17196
- colSpan: _optionalChain([merge, 'optionalAccess', _1111 => _1111.colSpan]),
17306
+ colSpan: _optionalChain([merge, 'optionalAccess', _1116 => _1116.colSpan]),
17197
17307
  conditionalDataBar: worksheet ? resolveConditionalDataBarForCell(
17198
17308
  row3,
17199
17309
  col,
@@ -17217,25 +17327,25 @@ function XlsxGrid({
17217
17327
  ) : null,
17218
17328
  hyperlink: _nullishCoalesce(rawHyperlink, () => ( null)),
17219
17329
  isMergedSecondary: false,
17220
- shrinkToFit: _optionalChain([alignment, 'optionalAccess', _1112 => _1112.shrinkToFit]) === true,
17330
+ shrinkToFit: _optionalChain([alignment, 'optionalAccess', _1117 => _1117.shrinkToFit]) === true,
17221
17331
  isTableHeader: Boolean(table && row3 >= table.start.row && row3 < table.start.row + headerRowCount),
17222
17332
  pivotControlInset: pivotControlInsets.get(cacheKey),
17223
- rowSpan: _optionalChain([merge, 'optionalAccess', _1113 => _1113.rowSpan]),
17333
+ rowSpan: _optionalChain([merge, 'optionalAccess', _1118 => _1118.rowSpan]),
17224
17334
  sparkline: sparkline && sparklineValues ? { config: sparkline, values: sparklineValues } : null,
17225
- style: scaleCssProperties(buildCellStyle(finalResolvedStyle, palette, _optionalChain([activeSheet, 'optionalAccess', _1114 => _1114.themePalette]), {
17226
- generalAlignment: batchCoversRow || !worksheet ? _optionalChain([batchedCell, 'optionalAccess', _1115 => _1115.generalAlignment]) : getCellGeneralAlignment(worksheet, row3, col),
17227
- showGridLines: _optionalChain([activeSheet, 'optionalAccess', _1116 => _1116.showGridLines])
17335
+ style: scaleCssProperties(buildCellStyle(finalResolvedStyle, palette, _optionalChain([activeSheet, 'optionalAccess', _1119 => _1119.themePalette]), {
17336
+ generalAlignment: batchCoversRow || !worksheet ? _optionalChain([batchedCell, 'optionalAccess', _1120 => _1120.generalAlignment]) : getCellGeneralAlignment(worksheet, row3, col),
17337
+ showGridLines: _optionalChain([activeSheet, 'optionalAccess', _1121 => _1121.showGridLines])
17228
17338
  }), zoomFactor),
17229
- usesGeneralAlignment: !_optionalChain([alignment, 'optionalAccess', _1117 => _1117.horizontal]) || alignment.horizontal === "general",
17339
+ usesGeneralAlignment: !_optionalChain([alignment, 'optionalAccess', _1122 => _1122.horizontal]) || alignment.horizontal === "general",
17230
17340
  textRotationDeg,
17231
17341
  validation: resolveCellDataValidation(row3, col, activeSheet),
17232
17342
  value: sparkline ? "" : checkboxState !== null ? "" : readDisplayValue()
17233
17343
  };
17234
17344
  nextData.richText = resolveRichCellRuns(
17235
- batchCoversRow ? _optionalChain([batchedCell, 'optionalAccess', _1118 => _1118.richText]) : _optionalChain([worksheet, 'optionalAccess', _1119 => _1119.getRichTextAt, 'call', _1120 => _1120(row3, col)]),
17345
+ batchCoversRow ? _optionalChain([batchedCell, 'optionalAccess', _1123 => _1123.richText]) : _optionalChain([worksheet, 'optionalAccess', _1124 => _1124.getRichTextAt, 'call', _1125 => _1125(row3, col)]),
17236
17346
  nextData.value,
17237
17347
  nextData.style,
17238
- _optionalChain([activeSheet, 'optionalAccess', _1121 => _1121.themePalette]),
17348
+ _optionalChain([activeSheet, 'optionalAccess', _1126 => _1126.themePalette]),
17239
17349
  zoomFactor
17240
17350
  );
17241
17351
  if (getCellStyle) {
@@ -17250,13 +17360,13 @@ function XlsxGrid({
17250
17360
  isMerged: Boolean(nextData.colSpan || nextData.rowSpan),
17251
17361
  isTableHeader: Boolean(nextData.isTableHeader),
17252
17362
  resolvedStyle: { ...nextData.style },
17253
- sheetName: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1122 => _1122.name]), () => ( "")),
17363
+ sheetName: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1127 => _1127.name]), () => ( "")),
17254
17364
  value: nextData.value,
17255
- workbookSheetIndex: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1123 => _1123.workbookSheetIndex]), () => ( -1))
17365
+ workbookSheetIndex: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1128 => _1128.workbookSheetIndex]), () => ( -1))
17256
17366
  });
17257
17367
  if (styleOverrides) {
17258
17368
  nextData.style = { ...nextData.style, ...styleOverrides };
17259
- nextData.richText = _optionalChain([nextData, 'access', _1124 => _1124.richText, 'optionalAccess', _1125 => _1125.map, 'call', _1126 => _1126((run) => ({ ...run, style: { ...run.style, ...styleOverrides } }))]);
17369
+ nextData.richText = _optionalChain([nextData, 'access', _1129 => _1129.richText, 'optionalAccess', _1130 => _1130.map, 'call', _1131 => _1131((run) => ({ ...run, style: { ...run.style, ...styleOverrides } }))]);
17260
17370
  if (styleOverrides.textAlign !== void 0) nextData.usesGeneralAlignment = false;
17261
17371
  if (nextData.conditionalColorScale && (styleOverrides.backgroundColor !== void 0 || styleOverrides.background !== void 0)) {
17262
17372
  nextData.conditionalColorScale = null;
@@ -17374,7 +17484,7 @@ function XlsxGrid({
17374
17484
  ]);
17375
17485
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
17376
17486
  conditionalFormatMetricsCacheRef.current.clear();
17377
- }, [_optionalChain([activeSheet, 'optionalAccess', _1127 => _1127.conditionalFormatRules]), _optionalChain([activeSheet, 'optionalAccess', _1128 => _1128.workbookSheetIndex]), revision]);
17487
+ }, [_optionalChain([activeSheet, 'optionalAccess', _1132 => _1132.conditionalFormatRules]), _optionalChain([activeSheet, 'optionalAccess', _1133 => _1133.workbookSheetIndex]), revision]);
17378
17488
  const getSelectionOverlay = _chunkZ4WMURVUcjs.q.call(void 0, (range) => {
17379
17489
  if (!range) {
17380
17490
  return null;
@@ -17419,11 +17529,11 @@ function XlsxGrid({
17419
17529
  }
17420
17530
  setDisplayRowLimit((current) => Math.max(current, requiredRows));
17421
17531
  setDisplayColLimit((current) => Math.max(current, requiredCols));
17422
- }, [_optionalChain([activeSheet, 'optionalAccess', _1129 => _1129.maxUsedCol]), _optionalChain([activeSheet, 'optionalAccess', _1130 => _1130.maxUsedRow]), highlightedCellRanges, activeSheetIndex, isWorkerBacked]);
17532
+ }, [_optionalChain([activeSheet, 'optionalAccess', _1134 => _1134.maxUsedCol]), _optionalChain([activeSheet, 'optionalAccess', _1135 => _1135.maxUsedRow]), highlightedCellRanges, activeSheetIndex, isWorkerBacked]);
17423
17533
  _chunkZ4WMURVUcjs.h.call(void 0, () => {
17424
17534
  const scroller = scrollRef.current;
17425
17535
  const target = rangeHighlightRects.find(({ highlight: highlight2 }) => highlight2.autoScroll);
17426
- if (!scroller || !_optionalChain([target, 'optionalAccess', _1131 => _1131.rect]) || scrolledHighlightRef.current === target.highlight || isLoading || scroller.clientWidth === 0 || scroller.clientHeight === 0 || target.highlight.kind !== "columns" && displayRowLimit <= target.range.end.row || target.highlight.kind !== "rows" && displayColLimit <= target.range.end.col) {
17536
+ if (!scroller || !_optionalChain([target, 'optionalAccess', _1136 => _1136.rect]) || scrolledHighlightRef.current === target.highlight || isLoading || scroller.clientWidth === 0 || scroller.clientHeight === 0 || target.highlight.kind !== "columns" && displayRowLimit <= target.range.end.row || target.highlight.kind !== "rows" && displayColLimit <= target.range.end.col) {
17427
17537
  return;
17428
17538
  }
17429
17539
  const { highlight, rect } = target;
@@ -17570,8 +17680,8 @@ function XlsxGrid({
17570
17680
  };
17571
17681
  }, [canvasVisibleColItems, canvasVisibleRowItems, colIndexByActual, frozenCols, frozenRows, rowIndexByActual]);
17572
17682
  const totalContentWidth = _nullishCoalesce(colPrefixSums[colPrefixSums.length - 1], () => ( 0));
17573
- const leadingColumnSpacerWidth = shouldVirtualizeCols ? _nullishCoalesce(_optionalChain([virtualCols, 'access', _1132 => _1132[0], 'optionalAccess', _1133 => _1133.start]), () => ( 0)) : 0;
17574
- const trailingColumnSpacerWidth = shouldVirtualizeCols ? totalContentWidth - (_nullishCoalesce(_optionalChain([virtualCols, 'access', _1134 => _1134[virtualCols.length - 1], 'optionalAccess', _1135 => _1135.end]), () => ( 0))) : 0;
17683
+ const leadingColumnSpacerWidth = shouldVirtualizeCols ? _nullishCoalesce(_optionalChain([virtualCols, 'access', _1137 => _1137[0], 'optionalAccess', _1138 => _1138.start]), () => ( 0)) : 0;
17684
+ const trailingColumnSpacerWidth = shouldVirtualizeCols ? totalContentWidth - (_nullishCoalesce(_optionalChain([virtualCols, 'access', _1139 => _1139[virtualCols.length - 1], 'optionalAccess', _1140 => _1140.end]), () => ( 0))) : 0;
17575
17685
  const imageRects = _chunkZ4WMURVUcjs.T.call(void 0,
17576
17686
  () => showImages ? images.map((image) => ({
17577
17687
  image,
@@ -17775,8 +17885,8 @@ function XlsxGrid({
17775
17885
  const normalized = normalizeRange2(range);
17776
17886
  const isSingleCellSelection = normalized.start.row === normalized.end.row && normalized.start.col === normalized.end.col;
17777
17887
  const mergedRange = isSingleCellSelection ? findMergedRange(normalized.start) : null;
17778
- const startCell = _nullishCoalesce(_optionalChain([mergedRange, 'optionalAccess', _1136 => _1136.start]), () => ( normalized.start));
17779
- const endCell = _nullishCoalesce(_optionalChain([mergedRange, 'optionalAccess', _1137 => _1137.end]), () => ( normalized.end));
17888
+ const startCell = _nullishCoalesce(_optionalChain([mergedRange, 'optionalAccess', _1141 => _1141.start]), () => ( normalized.start));
17889
+ const endCell = _nullishCoalesce(_optionalChain([mergedRange, 'optionalAccess', _1142 => _1142.end]), () => ( normalized.end));
17780
17890
  const startRowIndex = rowIndexByActual.get(startCell.row);
17781
17891
  const endRowIndex = rowIndexByActual.get(endCell.row);
17782
17892
  const startColIndex = colIndexByActual.get(startCell.col);
@@ -18030,14 +18140,14 @@ function XlsxGrid({
18030
18140
  const applyPreviewOverlay = _chunkZ4WMURVUcjs.q.call(void 0, (range, options2) => {
18031
18141
  const overlays = experimentalCanvas ? [...selectionPaneOverlayRefs.current.values()] : [selectionOverlayRef.current];
18032
18142
  if (!range) {
18033
- if (_optionalChain([options2, 'optionalAccess', _1138 => _1138.updateHeaderSelection]) !== false) {
18143
+ if (_optionalChain([options2, 'optionalAccess', _1143 => _1143.updateHeaderSelection]) !== false) {
18034
18144
  applyHeaderSelection(range);
18035
18145
  }
18036
18146
  return;
18037
18147
  }
18038
- const nextRect = experimentalCanvas || _optionalChain([options2, 'optionalAccess', _1139 => _1139.preferGeometry]) ? _nullishCoalesce(resolveGeometryOverlayRect(range), () => ( resolveOverlayRect(range))) : _optionalChain([selectionDragRef, 'access', _1140 => _1140.current, 'optionalAccess', _1141 => _1141.didDrag]) || fillDragRef.current ? _nullishCoalesce(_nullishCoalesce(resolveDragPreviewRect(range), () => ( resolveGeometryOverlayRect(range))), () => ( resolveOverlayRect(range))) : resolveOverlayRect(range);
18148
+ const nextRect = experimentalCanvas || _optionalChain([options2, 'optionalAccess', _1144 => _1144.preferGeometry]) ? _nullishCoalesce(resolveGeometryOverlayRect(range), () => ( resolveOverlayRect(range))) : _optionalChain([selectionDragRef, 'access', _1145 => _1145.current, 'optionalAccess', _1146 => _1146.didDrag]) || fillDragRef.current ? _nullishCoalesce(_nullishCoalesce(resolveDragPreviewRect(range), () => ( resolveGeometryOverlayRect(range))), () => ( resolveOverlayRect(range))) : resolveOverlayRect(range);
18039
18149
  if (!nextRect) {
18040
- if (_optionalChain([options2, 'optionalAccess', _1142 => _1142.updateHeaderSelection]) !== false) {
18150
+ if (_optionalChain([options2, 'optionalAccess', _1147 => _1147.updateHeaderSelection]) !== false) {
18041
18151
  applyHeaderSelection(range);
18042
18152
  }
18043
18153
  return;
@@ -18059,7 +18169,7 @@ function XlsxGrid({
18059
18169
  fillHandle.style.top = `${nextRect.top + nextRect.height - 4}px`;
18060
18170
  }
18061
18171
  }
18062
- if (_optionalChain([options2, 'optionalAccess', _1143 => _1143.updateHeaderSelection]) !== false) {
18172
+ if (_optionalChain([options2, 'optionalAccess', _1148 => _1148.updateHeaderSelection]) !== false) {
18063
18173
  applyHeaderSelection(range);
18064
18174
  }
18065
18175
  }, [applyHeaderSelection, experimentalCanvas, resolveDragPreviewRect, resolveGeometryOverlayRect, resolveOverlayRect]);
@@ -18100,7 +18210,7 @@ function XlsxGrid({
18100
18210
  return;
18101
18211
  }
18102
18212
  const cellData = getCellData(cell.row, cell.col);
18103
- const shouldShow = _optionalChain([cellData, 'access', _1144 => _1144.validation, 'optionalAccess', _1145 => _1145.validationType]) === "list" && cellData.validation.showDropdown;
18213
+ const shouldShow = _optionalChain([cellData, 'access', _1149 => _1149.validation, 'optionalAccess', _1150 => _1150.validationType]) === "list" && cellData.validation.showDropdown;
18104
18214
  const rect = shouldShow ? resolveCellDisplayRect(cell) : null;
18105
18215
  if (!rect) {
18106
18216
  overlay.style.opacity = "0";
@@ -18128,7 +18238,7 @@ function XlsxGrid({
18128
18238
  }, [applyPreviewOverlay]);
18129
18239
  const resolveResizeGuidePositionFromClient = _chunkZ4WMURVUcjs.q.call(void 0, (type, clientPosition) => {
18130
18240
  const scroller = scrollRef.current;
18131
- const scrollerRect = _optionalChain([scroller, 'optionalAccess', _1146 => _1146.getBoundingClientRect, 'call', _1147 => _1147()]);
18241
+ const scrollerRect = _optionalChain([scroller, 'optionalAccess', _1151 => _1151.getBoundingClientRect, 'call', _1152 => _1152()]);
18132
18242
  if (!scroller || !scrollerRect) {
18133
18243
  return null;
18134
18244
  }
@@ -18184,7 +18294,7 @@ function XlsxGrid({
18184
18294
  });
18185
18295
  }
18186
18296
  function handlePointerUp(event) {
18187
- if (_optionalChain([resizeStateRef, 'access', _1148 => _1148.current, 'optionalAccess', _1149 => _1149.pointerId]) === event.pointerId) {
18297
+ if (_optionalChain([resizeStateRef, 'access', _1153 => _1153.current, 'optionalAccess', _1154 => _1154.pointerId]) === event.pointerId) {
18188
18298
  const resizeState = resizeStateRef.current;
18189
18299
  const preview = pendingResizePreviewRef.current;
18190
18300
  clearResizeDrag();
@@ -18291,7 +18401,7 @@ function XlsxGrid({
18291
18401
  const cleanup = pendingSelectionDragCleanupRef.current;
18292
18402
  pendingSelectionDragCleanupRef.current = null;
18293
18403
  pendingSelectionDragRef.current = null;
18294
- _optionalChain([cleanup, 'optionalCall', _1150 => _1150()]);
18404
+ _optionalChain([cleanup, 'optionalCall', _1155 => _1155()]);
18295
18405
  }
18296
18406
  function finishPendingSelectionDrag() {
18297
18407
  const pendingState = pendingSelectionDragRef.current;
@@ -18306,7 +18416,7 @@ function XlsxGrid({
18306
18416
  return;
18307
18417
  }
18308
18418
  clearPendingSelectionDrag();
18309
- cachedScrollerRectRef.current = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1151 => _1151.current, 'optionalAccess', _1152 => _1152.getBoundingClientRect, 'call', _1153 => _1153()]), () => ( null));
18419
+ cachedScrollerRectRef.current = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1156 => _1156.current, 'optionalAccess', _1157 => _1157.getBoundingClientRect, 'call', _1158 => _1158()]), () => ( null));
18310
18420
  pendingState.didDrag = true;
18311
18421
  selectionDragRef.current = pendingState;
18312
18422
  if (!pendingState.headerGesture) {
@@ -18321,10 +18431,10 @@ function XlsxGrid({
18321
18431
  function installPendingSelectionDragListeners(pointerId, target) {
18322
18432
  const existingCleanup = pendingSelectionDragCleanupRef.current;
18323
18433
  pendingSelectionDragCleanupRef.current = null;
18324
- _optionalChain([existingCleanup, 'optionalCall', _1154 => _1154()]);
18434
+ _optionalChain([existingCleanup, 'optionalCall', _1159 => _1159()]);
18325
18435
  const pointerTarget = target;
18326
18436
  try {
18327
- _optionalChain([pointerTarget, 'access', _1155 => _1155.setPointerCapture, 'optionalCall', _1156 => _1156(pointerId)]);
18437
+ _optionalChain([pointerTarget, 'access', _1160 => _1160.setPointerCapture, 'optionalCall', _1161 => _1161(pointerId)]);
18328
18438
  } catch (e17) {
18329
18439
  }
18330
18440
  const handlePointerMove = (event) => {
@@ -18359,15 +18469,15 @@ function XlsxGrid({
18359
18469
  target.removeEventListener("pointerup", handlePointerEnd);
18360
18470
  target.removeEventListener("pointercancel", handlePointerEnd);
18361
18471
  try {
18362
- if (_optionalChain([pointerTarget, 'access', _1157 => _1157.hasPointerCapture, 'optionalCall', _1158 => _1158(pointerId)])) {
18363
- _optionalChain([pointerTarget, 'access', _1159 => _1159.releasePointerCapture, 'optionalCall', _1160 => _1160(pointerId)]);
18472
+ if (_optionalChain([pointerTarget, 'access', _1162 => _1162.hasPointerCapture, 'optionalCall', _1163 => _1163(pointerId)])) {
18473
+ _optionalChain([pointerTarget, 'access', _1164 => _1164.releasePointerCapture, 'optionalCall', _1165 => _1165(pointerId)]);
18364
18474
  }
18365
18475
  } catch (e18) {
18366
18476
  }
18367
18477
  };
18368
18478
  }
18369
18479
  function installSelectionDragListeners(pointerId) {
18370
- _optionalChain([selectionDragCleanupRef, 'access', _1161 => _1161.current, 'optionalCall', _1162 => _1162()]);
18480
+ _optionalChain([selectionDragCleanupRef, 'access', _1166 => _1166.current, 'optionalCall', _1167 => _1167()]);
18371
18481
  let pendingClientPoint = null;
18372
18482
  let pointerMoveFrame = null;
18373
18483
  const flushPointerMove = () => {
@@ -18412,17 +18522,17 @@ function XlsxGrid({
18412
18522
  pendingClientPoint = null;
18413
18523
  const dragState = selectionDragRef.current;
18414
18524
  const nextCell = dragState ? resolveDraggedSelectionCell(dragState, event.clientX, event.clientY) : null;
18415
- let nextRange = _nullishCoalesce(_optionalChain([dragState, 'optionalAccess', _1163 => _1163.previewRange]), () => ( null));
18416
- if (_optionalChain([dragState, 'optionalAccess', _1164 => _1164.didDrag]) && nextCell && dragState) {
18525
+ let nextRange = _nullishCoalesce(_optionalChain([dragState, 'optionalAccess', _1168 => _1168.previewRange]), () => ( null));
18526
+ if (_optionalChain([dragState, 'optionalAccess', _1169 => _1169.didDrag]) && nextCell && dragState) {
18417
18527
  nextRange = buildDraggedSelectionRange(dragState, nextCell);
18418
18528
  }
18419
18529
  selectionDragRef.current = null;
18420
18530
  cachedScrollerRectRef.current = null;
18421
- if (nextRange && _optionalChain([dragState, 'optionalAccess', _1165 => _1165.headerGesture]) && dragState.axis !== "cell") {
18531
+ if (nextRange && _optionalChain([dragState, 'optionalAccess', _1170 => _1170.headerGesture]) && dragState.axis !== "cell") {
18422
18532
  if (!rangesEqual(nextRange, dragState.previewRange)) {
18423
18533
  commitHeaderSelection(dragState.headerGesture, nextRange, dragState.axis);
18424
18534
  }
18425
- } else if (nextRange && (_optionalChain([dragState, 'optionalAccess', _1166 => _1166.didDrag]) || !_optionalChain([dragState, 'optionalAccess', _1167 => _1167.committedOnPointerDown]))) {
18535
+ } else if (nextRange && (_optionalChain([dragState, 'optionalAccess', _1171 => _1171.didDrag]) || !_optionalChain([dragState, 'optionalAccess', _1172 => _1172.committedOnPointerDown]))) {
18426
18536
  selectionPreviewRangeRef.current = nextRange;
18427
18537
  displayedSelectionRef.current = nextRange;
18428
18538
  axisSelectionRef.current = null;
@@ -18433,7 +18543,7 @@ function XlsxGrid({
18433
18543
  setInteractionMode("idle");
18434
18544
  document.body.style.cursor = "";
18435
18545
  document.body.style.userSelect = "";
18436
- _optionalChain([selectionDragCleanupRef, 'access', _1168 => _1168.current, 'optionalCall', _1169 => _1169()]);
18546
+ _optionalChain([selectionDragCleanupRef, 'access', _1173 => _1173.current, 'optionalCall', _1174 => _1174()]);
18437
18547
  selectionDragCleanupRef.current = null;
18438
18548
  };
18439
18549
  window.addEventListener("pointermove", handlePointerMove);
@@ -18451,7 +18561,7 @@ function XlsxGrid({
18451
18561
  };
18452
18562
  }
18453
18563
  function installFillDragListeners(pointerId, sourceRange) {
18454
- _optionalChain([fillDragCleanupRef, 'access', _1170 => _1170.current, 'optionalCall', _1171 => _1171()]);
18564
+ _optionalChain([fillDragCleanupRef, 'access', _1175 => _1175.current, 'optionalCall', _1176 => _1176()]);
18455
18565
  let pendingClientPoint = null;
18456
18566
  let pointerMoveFrame = null;
18457
18567
  const flushPointerMove = () => {
@@ -18489,7 +18599,7 @@ function XlsxGrid({
18489
18599
  if (nextCell) {
18490
18600
  updateFillPreview(nextCell);
18491
18601
  }
18492
- const nextRange = _nullishCoalesce(_optionalChain([fillDragRef, 'access', _1172 => _1172.current, 'optionalAccess', _1173 => _1173.previewRange]), () => ( sourceRange));
18602
+ const nextRange = _nullishCoalesce(_optionalChain([fillDragRef, 'access', _1177 => _1177.current, 'optionalAccess', _1178 => _1178.previewRange]), () => ( sourceRange));
18493
18603
  fillDragRef.current = null;
18494
18604
  cachedScrollerRectRef.current = null;
18495
18605
  setInteractionMode("idle");
@@ -18497,7 +18607,7 @@ function XlsxGrid({
18497
18607
  document.body.style.cursor = "";
18498
18608
  document.body.style.userSelect = "";
18499
18609
  fillSelection(nextRange);
18500
- _optionalChain([fillDragCleanupRef, 'access', _1174 => _1174.current, 'optionalCall', _1175 => _1175()]);
18610
+ _optionalChain([fillDragCleanupRef, 'access', _1179 => _1179.current, 'optionalCall', _1180 => _1180()]);
18501
18611
  fillDragCleanupRef.current = null;
18502
18612
  };
18503
18613
  window.addEventListener("pointermove", handlePointerMove);
@@ -18673,8 +18783,8 @@ function XlsxGrid({
18673
18783
  let anchorIndex = index;
18674
18784
  if (event.shiftKey && active) {
18675
18785
  anchorIndex = active.start[coordinate];
18676
- if (_optionalChain([activeAxis, 'optionalAccess', _1176 => _1176.axis]) === "row" && axis === "row") anchorIndex = activeAxis.startRow;
18677
- if (_optionalChain([activeAxis, 'optionalAccess', _1177 => _1177.axis]) === "column" && axis === "column") anchorIndex = activeAxis.startCol;
18786
+ if (_optionalChain([activeAxis, 'optionalAccess', _1181 => _1181.axis]) === "row" && axis === "row") anchorIndex = activeAxis.startRow;
18787
+ if (_optionalChain([activeAxis, 'optionalAccess', _1182 => _1182.axis]) === "column" && axis === "column") anchorIndex = activeAxis.startCol;
18678
18788
  }
18679
18789
  const cell = (along, across) => axis === "row" ? { row: along, col: across } : { row: across, col: along };
18680
18790
  const range = normalizeRange2({ start: cell(anchorIndex, first), end: cell(index, last) });
@@ -18765,7 +18875,7 @@ function XlsxGrid({
18765
18875
  {
18766
18876
  "aria-haspopup": "menu",
18767
18877
  "aria-label": _chunkZ4WMURVUcjs.formatMessage.call(void 0, messages.openMenuForColumn, { column: tableColumn.name }),
18768
- "aria-expanded": _optionalChain([openTableMenu, 'optionalAccess', _1178 => _1178.tableName]) === table.name && openTableMenu.col === cell.col && openTableMenu.row === cell.row,
18878
+ "aria-expanded": _optionalChain([openTableMenu, 'optionalAccess', _1183 => _1183.tableName]) === table.name && openTableMenu.col === cell.col && openTableMenu.row === cell.row,
18769
18879
  onPointerDown: (event) => {
18770
18880
  event.preventDefault();
18771
18881
  event.stopPropagation();
@@ -18913,7 +19023,7 @@ function XlsxGrid({
18913
19023
  const office = activeSheet.officeLayout;
18914
19024
  if (office) {
18915
19025
  const original = office.columns[col];
18916
- return override !== void 0 && override !== _optionalChain([original, 'optionalAccess', _1179 => _1179.sourcePx]) ? override : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _1180 => _1180.sizePx]), () => ( office.defaultColumnPx));
19026
+ return override !== void 0 && override !== _optionalChain([original, 'optionalAccess', _1184 => _1184.sourcePx]) ? override : _nullishCoalesce(_optionalChain([original, 'optionalAccess', _1185 => _1185.sizePx]), () => ( office.defaultColumnPx));
18917
19027
  }
18918
19028
  const width = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(override, () => ( precomputedColumnWidths.get(col))), () => ( activeSheet.defaultColWidthPx)), () => ( DEFAULT_COL_WIDTH2));
18919
19029
  return Math.max(_chunkGP5SOQQHcjs.resolveRenderedSheetAxisPixels.call(void 0, width, activeSheet.showGridLines), DEFAULT_COL_WIDTH2 / 2);
@@ -18926,13 +19036,13 @@ function XlsxGrid({
18926
19036
  for (const [key, cell] of batch.cells) {
18927
19037
  if (!cell.value || cell.isMergedSecondary || sparklinesByCell.has(key)) continue;
18928
19038
  const [row3, col] = key.split(":").map(Number);
18929
- const colSpan = _nullishCoalesce(_optionalChain([cell, 'access', _1181 => _1181.mergeSpan, 'optionalAccess', _1182 => _1182.colSpan]), () => ( 1));
18930
- const rowSpan = _nullishCoalesce(_optionalChain([cell, 'access', _1183 => _1183.mergeSpan, 'optionalAccess', _1184 => _1184.rowSpan]), () => ( 1));
19039
+ const colSpan = _nullishCoalesce(_optionalChain([cell, 'access', _1186 => _1186.mergeSpan, 'optionalAccess', _1187 => _1187.colSpan]), () => ( 1));
19040
+ const rowSpan = _nullishCoalesce(_optionalChain([cell, 'access', _1188 => _1188.mergeSpan, 'optionalAccess', _1189 => _1189.rowSpan]), () => ( 1));
18931
19041
  if (isRow ? rowSpan > 1 || hiddenColSet.has(col) : colSpan > 1 || hiddenRowSet.has(row3)) continue;
18932
19042
  const address2 = { row: row3, col };
18933
19043
  const inheritedStyle = resolveInheritedCellStyle2(activeSheet, row3, col);
18934
19044
  const cellStyle = mergeResolvedCellStyle(inheritedStyle, cell.style, { replaceXfSubtrees: true });
18935
- if (_optionalChain([cellStyle, 'optionalAccess', _1185 => _1185.cellControl])) continue;
19045
+ if (_optionalChain([cellStyle, 'optionalAccess', _1190 => _1190.cellControl])) continue;
18936
19046
  const table = getTableAtCell(effectiveTables, row3, col);
18937
19047
  const tableStyle = resolveTableCellStyle(table, row3, col, activeSheet);
18938
19048
  const baseStyle = tableStyle ? mergeResolvedCellStyle(
@@ -18950,15 +19060,15 @@ function XlsxGrid({
18950
19060
  batch.cells
18951
19061
  );
18952
19062
  const resolvedStyle = mergeResolvedCellStyle(baseStyle, conditionalStyle);
18953
- const alignment = _optionalChain([resolvedStyle, 'optionalAccess', _1186 => _1186.alignment]);
18954
- const rotation = resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1187 => _1187.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1188 => _1188.textRotation]))));
19063
+ const alignment = _optionalChain([resolvedStyle, 'optionalAccess', _1191 => _1191.alignment]);
19064
+ const rotation = resolveSpreadsheetTextRotation(_nullishCoalesce(_optionalChain([alignment, 'optionalAccess', _1192 => _1192.rotation]), () => ( _optionalChain([alignment, 'optionalAccess', _1193 => _1193.textRotation]))));
18955
19065
  const isTableHeader = Boolean(table && row3 < table.start.row + Math.max(table.headerRowCount, 1));
18956
19066
  const matchingVisualRules = visualRules.length === 0 || readNumericValue() === null ? [] : visualRules.filter((rule) => rule.ranges.some((range) => isCellInRange(address2, range)));
18957
19067
  const baseCssStyle = scaleCssProperties(buildCellStyle(resolvedStyle, palette, activeSheet.themePalette, {
18958
19068
  generalAlignment: cell.generalAlignment,
18959
19069
  showGridLines: activeSheet.showGridLines
18960
19070
  }), zoomFactor);
18961
- const overrides = _optionalChain([getCellStyleRef, 'access', _1189 => _1189.current, 'optionalCall', _1190 => _1190({
19071
+ const overrides = _optionalChain([getCellStyleRef, 'access', _1194 => _1194.current, 'optionalCall', _1195 => _1195({
18962
19072
  cell: address2,
18963
19073
  hasChartHighlight: Boolean(resolveCellChartHighlight(address2, activeSheetChartHighlights)),
18964
19074
  hasConditionalFormat: matchingVisualRules.length > 0,
@@ -18972,7 +19082,7 @@ function XlsxGrid({
18972
19082
  workbookSheetIndex: activeSheet.workbookSheetIndex
18973
19083
  })]);
18974
19084
  const style = { ...baseCssStyle, ...overrides };
18975
- const richText = _optionalChain([resolveRichCellRuns, 'call', _1191 => _1191(cell.richText, cell.value, baseCssStyle, activeSheet.themePalette, zoomFactor), 'optionalAccess', _1192 => _1192.map, 'call', _1193 => _1193((run) => ({ ...run, style: { ...run.style, ...overrides } }))]);
19085
+ const richText = _optionalChain([resolveRichCellRuns, 'call', _1196 => _1196(cell.richText, cell.value, baseCssStyle, activeSheet.themePalette, zoomFactor), 'optionalAccess', _1197 => _1197.map, 'call', _1198 => _1198((run) => ({ ...run, style: { ...run.style, ...overrides } }))]);
18976
19086
  const padding = resolveCanvasPadding(style.padding);
18977
19087
  const leadingInset = matchingVisualRules.some((rule) => rule.kind === "iconSet") ? 18 : 0;
18978
19088
  const trailingInset = (isTableHeader ? experimentalCanvas ? 16 : 24 : 0) + (_nullishCoalesce(pivotControlInsets.get(key), () => ( 0)));
@@ -19041,7 +19151,7 @@ function XlsxGrid({
19041
19151
  if (!canResizeHeaders) {
19042
19152
  return null;
19043
19153
  }
19044
- const scrollerRect = _optionalChain([scrollRef, 'access', _1194 => _1194.current, 'optionalAccess', _1195 => _1195.getBoundingClientRect, 'call', _1196 => _1196()]);
19154
+ const scrollerRect = _optionalChain([scrollRef, 'access', _1199 => _1199.current, 'optionalAccess', _1200 => _1200.getBoundingClientRect, 'call', _1201 => _1201()]);
19045
19155
  if (!scrollerRect) {
19046
19156
  return null;
19047
19157
  }
@@ -19062,7 +19172,7 @@ function XlsxGrid({
19062
19172
  }
19063
19173
  }, [autofit, resolveCanvasColumnResizeTarget]);
19064
19174
  const resolveCanvasColumnHeaderTarget = _chunkZ4WMURVUcjs.q.call(void 0, (clientX) => {
19065
- const scrollerRect = _optionalChain([scrollRef, 'access', _1197 => _1197.current, 'optionalAccess', _1198 => _1198.getBoundingClientRect, 'call', _1199 => _1199()]);
19175
+ const scrollerRect = _optionalChain([scrollRef, 'access', _1202 => _1202.current, 'optionalAccess', _1203 => _1203.getBoundingClientRect, 'call', _1204 => _1204()]);
19066
19176
  if (!scrollerRect) {
19067
19177
  return null;
19068
19178
  }
@@ -19078,7 +19188,7 @@ function XlsxGrid({
19078
19188
  if (!canResizeHeaders) {
19079
19189
  return null;
19080
19190
  }
19081
- const scrollerRect = _optionalChain([scrollRef, 'access', _1200 => _1200.current, 'optionalAccess', _1201 => _1201.getBoundingClientRect, 'call', _1202 => _1202()]);
19191
+ const scrollerRect = _optionalChain([scrollRef, 'access', _1205 => _1205.current, 'optionalAccess', _1206 => _1206.getBoundingClientRect, 'call', _1207 => _1207()]);
19082
19192
  if (!scrollerRect) {
19083
19193
  return null;
19084
19194
  }
@@ -19103,7 +19213,7 @@ function XlsxGrid({
19103
19213
  });
19104
19214
  }, []);
19105
19215
  const resolveCanvasRowHeaderTarget = _chunkZ4WMURVUcjs.q.call(void 0, (clientY) => {
19106
- const scrollerRect = _optionalChain([scrollRef, 'access', _1203 => _1203.current, 'optionalAccess', _1204 => _1204.getBoundingClientRect, 'call', _1205 => _1205()]);
19216
+ const scrollerRect = _optionalChain([scrollRef, 'access', _1208 => _1208.current, 'optionalAccess', _1209 => _1209.getBoundingClientRect, 'call', _1210 => _1210()]);
19107
19217
  if (!scrollerRect) {
19108
19218
  return null;
19109
19219
  }
@@ -19116,14 +19226,14 @@ function XlsxGrid({
19116
19226
  return null;
19117
19227
  }, [canvasRowHeaderCells]);
19118
19228
  const handleCanvasColumnHeaderPointerMove = _chunkZ4WMURVUcjs.q.call(void 0, (event) => {
19119
- if (_optionalChain([resizeStateRef, 'access', _1206 => _1206.current, 'optionalAccess', _1207 => _1207.type]) === "column") {
19229
+ if (_optionalChain([resizeStateRef, 'access', _1211 => _1211.current, 'optionalAccess', _1212 => _1212.type]) === "column") {
19120
19230
  event.currentTarget.style.cursor = "col-resize";
19121
19231
  return;
19122
19232
  }
19123
19233
  event.currentTarget.style.cursor = resolveCanvasColumnResizeTarget(event.clientX) ? "col-resize" : "default";
19124
19234
  }, [resolveCanvasColumnResizeTarget]);
19125
19235
  const handleCanvasRowHeaderPointerMove = _chunkZ4WMURVUcjs.q.call(void 0, (event) => {
19126
- if (_optionalChain([resizeStateRef, 'access', _1208 => _1208.current, 'optionalAccess', _1209 => _1209.type]) === "row") {
19236
+ if (_optionalChain([resizeStateRef, 'access', _1213 => _1213.current, 'optionalAccess', _1214 => _1214.type]) === "row") {
19127
19237
  event.currentTarget.style.cursor = "row-resize";
19128
19238
  return;
19129
19239
  }
@@ -19151,7 +19261,7 @@ function XlsxGrid({
19151
19261
  const column = getTableHeaderColumn(table, cell.row, cell.col);
19152
19262
  const columnRect = resolveCanvasColumnHeaderRect(cell.col);
19153
19263
  const rowRect = resolveCanvasRowHeaderRect(cell.row);
19154
- const viewportRect = _optionalChain([scrollRef, 'access', _1210 => _1210.current, 'optionalAccess', _1211 => _1211.getBoundingClientRect, 'call', _1212 => _1212()]);
19264
+ const viewportRect = _optionalChain([scrollRef, 'access', _1215 => _1215.current, 'optionalAccess', _1216 => _1216.getBoundingClientRect, 'call', _1217 => _1217()]);
19155
19265
  if (table && column && columnRect && rowRect && viewportRect) {
19156
19266
  const right = viewportRect.left + columnRect.left + columnRect.width - zoomFactor;
19157
19267
  const bottom = viewportRect.top + rowRect.top + rowRect.height - zoomFactor;
@@ -19351,7 +19461,7 @@ function XlsxGrid({
19351
19461
  return null;
19352
19462
  }
19353
19463
  context.setTransform(dpr, 0, 0, dpr, 0, 0);
19354
- if (_optionalChain([options2, 'optionalAccess', _1213 => _1213.clear]) !== false) {
19464
+ if (_optionalChain([options2, 'optionalAccess', _1218 => _1218.clear]) !== false) {
19355
19465
  context.clearRect(0, 0, width, height);
19356
19466
  }
19357
19467
  return context;
@@ -19465,7 +19575,7 @@ function XlsxGrid({
19465
19575
  if (shouldRepaintBody && (!bodyContexts.scroll || !bodyContexts.top || !bodyContexts.left || !bodyContexts.corner) || shouldRepaintHeaders && (!cornerContext || topFrozenHeaderCanvasWidth > 0 && !topHeaderContexts.frozen || topScrollHeaderCanvasWidth > 0 && !topHeaderContexts.scroll || leftFrozenHeaderCanvasHeight > 0 && !leftHeaderContexts.frozen || leftScrollHeaderCanvasHeight > 0 && !leftHeaderContexts.scroll)) {
19466
19576
  return;
19467
19577
  }
19468
- const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1214 => _1214.showGridLines]), () => ( true));
19578
+ const showGridLines = _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1219 => _1219.showGridLines]), () => ( true));
19469
19579
  const sheetSurface = resolveSheetSurface(activeSheet, palette);
19470
19580
  const deferredSpillTextsByPane = {
19471
19581
  corner: [],
@@ -19510,11 +19620,11 @@ function XlsxGrid({
19510
19620
  if (shape.paragraphs.length === 0) {
19511
19621
  return;
19512
19622
  }
19513
- const inset = _optionalChain([shape, 'access', _1215 => _1215.textBox, 'optionalAccess', _1216 => _1216.insetPx]);
19514
- const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1217 => _1217.left]), () => ( 6))) * zoomFactor;
19515
- const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1218 => _1218.right]), () => ( 6))) * zoomFactor;
19516
- const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1219 => _1219.top]), () => ( 4))) * zoomFactor;
19517
- const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1220 => _1220.bottom]), () => ( 4))) * zoomFactor;
19623
+ const inset = _optionalChain([shape, 'access', _1220 => _1220.textBox, 'optionalAccess', _1221 => _1221.insetPx]);
19624
+ const paddingLeft = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1222 => _1222.left]), () => ( 6))) * zoomFactor;
19625
+ const paddingRight = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1223 => _1223.right]), () => ( 6))) * zoomFactor;
19626
+ const paddingTop = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1224 => _1224.top]), () => ( 4))) * zoomFactor;
19627
+ const paddingBottom = (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1225 => _1225.bottom]), () => ( 4))) * zoomFactor;
19518
19628
  const textLeft = left + paddingLeft;
19519
19629
  const textTop = top + paddingTop;
19520
19630
  const textWidth = Math.max(0, width - paddingLeft - paddingRight);
@@ -19536,9 +19646,9 @@ function XlsxGrid({
19536
19646
  });
19537
19647
  const totalTextHeight = lineMetrics.reduce((total, metric) => total + metric.lineHeight, 0);
19538
19648
  let y2 = textTop;
19539
- if (_optionalChain([shape, 'access', _1221 => _1221.textBox, 'optionalAccess', _1222 => _1222.verticalAlign]) === "middle") {
19649
+ if (_optionalChain([shape, 'access', _1226 => _1226.textBox, 'optionalAccess', _1227 => _1227.verticalAlign]) === "middle") {
19540
19650
  y2 = textTop + Math.max(0, (textHeight - totalTextHeight) / 2);
19541
- } else if (_optionalChain([shape, 'access', _1223 => _1223.textBox, 'optionalAccess', _1224 => _1224.verticalAlign]) === "bottom") {
19651
+ } else if (_optionalChain([shape, 'access', _1228 => _1228.textBox, 'optionalAccess', _1229 => _1229.verticalAlign]) === "bottom") {
19542
19652
  y2 = textTop + Math.max(0, textHeight - totalTextHeight);
19543
19653
  }
19544
19654
  context.save();
@@ -19549,7 +19659,7 @@ function XlsxGrid({
19549
19659
  shape.paragraphs.forEach((paragraph, paragraphIndex) => {
19550
19660
  const metric = _nullishCoalesce(lineMetrics[paragraphIndex], () => ( { lineHeight: 14 * zoomFactor, widthPx: 0 }));
19551
19661
  let x2 = textLeft;
19552
- const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _1225 => _1225.textBox, 'optionalAccess', _1226 => _1226.horizontalAlign]))), () => ( "left"));
19662
+ const align = _nullishCoalesce(_nullishCoalesce(paragraph.align, () => ( _optionalChain([shape, 'access', _1230 => _1230.textBox, 'optionalAccess', _1231 => _1231.horizontalAlign]))), () => ( "left"));
19553
19663
  if (align === "center") {
19554
19664
  x2 = textLeft + Math.max(0, (textWidth - metric.widthPx) / 2);
19555
19665
  } else if (align === "right") {
@@ -19578,11 +19688,11 @@ function XlsxGrid({
19578
19688
  context.restore();
19579
19689
  };
19580
19690
  const drawBakedShape = (context, shape, rect) => {
19581
- const fillColor = _optionalChain([shape, 'access', _1227 => _1227.fill, 'optionalAccess', _1228 => _1228.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1229 => _1229.fill, 'optionalAccess', _1230 => _1230.color]), () => ( "transparent"));
19582
- const strokeColor = _optionalChain([shape, 'access', _1231 => _1231.stroke, 'optionalAccess', _1232 => _1232.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1233 => _1233.stroke, 'optionalAccess', _1234 => _1234.color]), () => ( "transparent"));
19583
- const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _1235 => _1235.stroke, 'optionalAccess', _1236 => _1236.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
19691
+ const fillColor = _optionalChain([shape, 'access', _1232 => _1232.fill, 'optionalAccess', _1233 => _1233.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1234 => _1234.fill, 'optionalAccess', _1235 => _1235.color]), () => ( "transparent"));
19692
+ const strokeColor = _optionalChain([shape, 'access', _1236 => _1236.stroke, 'optionalAccess', _1237 => _1237.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1238 => _1238.stroke, 'optionalAccess', _1239 => _1239.color]), () => ( "transparent"));
19693
+ const lineWidth = Math.max(0, (_nullishCoalesce(_optionalChain([shape, 'access', _1240 => _1240.stroke, 'optionalAccess', _1241 => _1241.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * zoomFactor);
19584
19694
  const vectorShape = resolveShapeVector(shape);
19585
- const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _1237 => _1237.fill, 'optionalAccess', _1238 => _1238.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _1239 => _1239.stroke, 'optionalAccess', _1240 => _1240.opacity]), () => ( 1)));
19695
+ const opacity = Math.min(_nullishCoalesce(_optionalChain([shape, 'access', _1242 => _1242.fill, 'optionalAccess', _1243 => _1243.opacity]), () => ( 1)), _nullishCoalesce(_optionalChain([shape, 'access', _1244 => _1244.stroke, 'optionalAccess', _1245 => _1245.opacity]), () => ( 1)));
19586
19696
  context.save();
19587
19697
  context.translate(rect.left + rect.width / 2, rect.top + rect.height / 2);
19588
19698
  if (shape.rotationDeg) {
@@ -19593,7 +19703,7 @@ function XlsxGrid({
19593
19703
  context.lineWidth = lineWidth;
19594
19704
  context.strokeStyle = strokeColor;
19595
19705
  context.fillStyle = fillColor;
19596
- applyCanvasShapeDash(context, _optionalChain([shape, 'access', _1241 => _1241.stroke, 'optionalAccess', _1242 => _1242.dash]), lineWidth);
19706
+ applyCanvasShapeDash(context, _optionalChain([shape, 'access', _1246 => _1246.stroke, 'optionalAccess', _1247 => _1247.dash]), lineWidth);
19597
19707
  const localLeft = -rect.width / 2;
19598
19708
  const localTop = -rect.height / 2;
19599
19709
  if (vectorShape && typeof Path2D !== "undefined") {
@@ -19779,13 +19889,13 @@ function XlsxGrid({
19779
19889
  drawnMergedAnchorKeys.add(anchorKey);
19780
19890
  }
19781
19891
  const displayRect = cellData.colSpan || cellData.rowSpan ? resolveCellDisplayRect(drawCell) : null;
19782
- const baseLeft = _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1243 => _1243.left]), () => ( baseCellLeft));
19783
- const baseTop = _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1244 => _1244.top]), () => ( baseCellTop));
19892
+ const baseLeft = _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1248 => _1248.left]), () => ( baseCellLeft));
19893
+ const baseTop = _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1249 => _1249.top]), () => ( baseCellTop));
19784
19894
  const localRect = {
19785
- height: _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1245 => _1245.height]), () => ( (_nullishCoalesce(displayEffectiveRowHeights[drawRowIndex], () => ( rowItem.size))))),
19895
+ height: _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1250 => _1250.height]), () => ( (_nullishCoalesce(displayEffectiveRowHeights[drawRowIndex], () => ( rowItem.size))))),
19786
19896
  left: (useFrozenHorizontalPosition ? _nullishCoalesce(stickyLeftByCol.get(drawCell.col), () => ( baseLeft - drawingViewport.left)) : baseLeft - drawingViewport.left) - paneBoundsForCell.left,
19787
19897
  top: (useFrozenVerticalPosition ? _nullishCoalesce(stickyTopByRow.get(drawCell.row), () => ( baseTop - drawingViewport.top)) : baseTop - drawingViewport.top) - paneBoundsForCell.top,
19788
- width: _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1246 => _1246.width]), () => ( (_nullishCoalesce(displayEffectiveColWidths[drawColIndex], () => ( colItem.size)))))
19898
+ width: _nullishCoalesce(_optionalChain([displayRect, 'optionalAccess', _1251 => _1251.width]), () => ( (_nullishCoalesce(displayEffectiveColWidths[drawColIndex], () => ( colItem.size)))))
19789
19899
  };
19790
19900
  const spillOffsetX = Math.min(0, _nullishCoalesce(cellData.spillOffsetX, () => ( 0)));
19791
19901
  const drawableLeft = localRect.left + spillOffsetX;
@@ -19800,7 +19910,7 @@ function XlsxGrid({
19800
19910
  canvasProfilePaintedCells += 1;
19801
19911
  const cellStyle = cellData.style;
19802
19912
  const canvasCellStyle = _nullishCoalesce(cellData.canvas, () => ( buildCanvasCellStyleCache(cellStyle)));
19803
- const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _1247 => _1247.conditionalColorScale, 'optionalAccess', _1248 => _1248.color]), () => ( (typeof cellStyle.backgroundColor === "string" ? cellStyle.backgroundColor : sheetSurface)));
19913
+ const fillColor = _nullishCoalesce(_optionalChain([cellData, 'access', _1252 => _1252.conditionalColorScale, 'optionalAccess', _1253 => _1253.color]), () => ( (typeof cellStyle.backgroundColor === "string" ? cellStyle.backgroundColor : sheetSurface)));
19804
19914
  const gradientFill = !cellData.conditionalColorScale && typeof cellStyle.backgroundImage === "string" ? resolveCanvasGradientFill(paneContext, localRect, cellStyle.backgroundImage) : null;
19805
19915
  if (cellData.chartHighlight) {
19806
19916
  flushPendingGridlines();
@@ -19837,23 +19947,23 @@ function XlsxGrid({
19837
19947
  const rightNeighborCol = visibleCols[drawColIndex + Math.max(1, _nullishCoalesce(cellData.colSpan, () => ( 1)))];
19838
19948
  const rightNeighborCell = rightNeighborCol === void 0 ? null : { row: drawCell.row, col: rightNeighborCol };
19839
19949
  const rightNeighborData = rightNeighborCell ? getCellData(rightNeighborCell.row, rightNeighborCell.col) : null;
19840
- let rightNeighborLeftBorder = _optionalChain([rightNeighborData, 'optionalAccess', _1249 => _1249.isMergedSecondary]) ? null : _nullishCoalesce(_optionalChain([rightNeighborData, 'optionalAccess', _1250 => _1250.canvas, 'optionalAccess', _1251 => _1251.leftBorder]), () => ( parseCanvasBorderDeclaration(_optionalChain([rightNeighborData, 'optionalAccess', _1252 => _1252.style, 'access', _1253 => _1253.borderLeft]))));
19841
- if (rightNeighborLeftBorder == null && rightNeighborCell && _optionalChain([rightNeighborData, 'optionalAccess', _1254 => _1254.isMergedSecondary])) {
19950
+ let rightNeighborLeftBorder = _optionalChain([rightNeighborData, 'optionalAccess', _1254 => _1254.isMergedSecondary]) ? null : _nullishCoalesce(_optionalChain([rightNeighborData, 'optionalAccess', _1255 => _1255.canvas, 'optionalAccess', _1256 => _1256.leftBorder]), () => ( parseCanvasBorderDeclaration(_optionalChain([rightNeighborData, 'optionalAccess', _1257 => _1257.style, 'access', _1258 => _1258.borderLeft]))));
19951
+ if (rightNeighborLeftBorder == null && rightNeighborCell && _optionalChain([rightNeighborData, 'optionalAccess', _1259 => _1259.isMergedSecondary])) {
19842
19952
  const rightNeighborAnchorCell = resolveMergeAnchorCell(rightNeighborCell);
19843
19953
  if (rightNeighborAnchorCell.col === rightNeighborCell.col) {
19844
19954
  const rightNeighborAnchorData = getCellData(rightNeighborAnchorCell.row, rightNeighborAnchorCell.col);
19845
- rightNeighborLeftBorder = rightNeighborAnchorData.isMergedSecondary ? null : _nullishCoalesce(_optionalChain([rightNeighborAnchorData, 'access', _1255 => _1255.canvas, 'optionalAccess', _1256 => _1256.leftBorder]), () => ( parseCanvasBorderDeclaration(rightNeighborAnchorData.style.borderLeft)));
19955
+ rightNeighborLeftBorder = rightNeighborAnchorData.isMergedSecondary ? null : _nullishCoalesce(_optionalChain([rightNeighborAnchorData, 'access', _1260 => _1260.canvas, 'optionalAccess', _1261 => _1261.leftBorder]), () => ( parseCanvasBorderDeclaration(rightNeighborAnchorData.style.borderLeft)));
19846
19956
  }
19847
19957
  }
19848
19958
  const bottomNeighborRow = visibleRows[drawRowIndex + Math.max(1, _nullishCoalesce(cellData.rowSpan, () => ( 1)))];
19849
19959
  const bottomNeighborCell = bottomNeighborRow === void 0 ? null : { row: bottomNeighborRow, col: drawCell.col };
19850
19960
  const bottomNeighborData = bottomNeighborCell ? getCellData(bottomNeighborCell.row, bottomNeighborCell.col) : null;
19851
- let bottomNeighborTopBorder = _optionalChain([bottomNeighborData, 'optionalAccess', _1257 => _1257.isMergedSecondary]) ? null : _nullishCoalesce(_optionalChain([bottomNeighborData, 'optionalAccess', _1258 => _1258.canvas, 'optionalAccess', _1259 => _1259.topBorder]), () => ( parseCanvasBorderDeclaration(_optionalChain([bottomNeighborData, 'optionalAccess', _1260 => _1260.style, 'access', _1261 => _1261.borderTop]))));
19852
- if (bottomNeighborTopBorder == null && bottomNeighborCell && _optionalChain([bottomNeighborData, 'optionalAccess', _1262 => _1262.isMergedSecondary])) {
19961
+ let bottomNeighborTopBorder = _optionalChain([bottomNeighborData, 'optionalAccess', _1262 => _1262.isMergedSecondary]) ? null : _nullishCoalesce(_optionalChain([bottomNeighborData, 'optionalAccess', _1263 => _1263.canvas, 'optionalAccess', _1264 => _1264.topBorder]), () => ( parseCanvasBorderDeclaration(_optionalChain([bottomNeighborData, 'optionalAccess', _1265 => _1265.style, 'access', _1266 => _1266.borderTop]))));
19962
+ if (bottomNeighborTopBorder == null && bottomNeighborCell && _optionalChain([bottomNeighborData, 'optionalAccess', _1267 => _1267.isMergedSecondary])) {
19853
19963
  const bottomNeighborAnchorCell = resolveMergeAnchorCell(bottomNeighborCell);
19854
19964
  if (bottomNeighborAnchorCell.row === bottomNeighborCell.row) {
19855
19965
  const bottomNeighborAnchorData = getCellData(bottomNeighborAnchorCell.row, bottomNeighborAnchorCell.col);
19856
- bottomNeighborTopBorder = bottomNeighborAnchorData.isMergedSecondary ? null : _nullishCoalesce(_optionalChain([bottomNeighborAnchorData, 'access', _1263 => _1263.canvas, 'optionalAccess', _1264 => _1264.topBorder]), () => ( parseCanvasBorderDeclaration(bottomNeighborAnchorData.style.borderTop)));
19966
+ bottomNeighborTopBorder = bottomNeighborAnchorData.isMergedSecondary ? null : _nullishCoalesce(_optionalChain([bottomNeighborAnchorData, 'access', _1268 => _1268.canvas, 'optionalAccess', _1269 => _1269.topBorder]), () => ( parseCanvasBorderDeclaration(bottomNeighborAnchorData.style.borderTop)));
19857
19967
  }
19858
19968
  }
19859
19969
  const resolvedRightBorder = resolveCanvasBoundaryBorder(rightBorder, rightNeighborLeftBorder);
@@ -20147,7 +20257,7 @@ function XlsxGrid({
20147
20257
  if (cellData.isTableHeader && !renderTableHeaderMenu) {
20148
20258
  const table = getTableAtCell(effectiveTables, drawCell.row, drawCell.col);
20149
20259
  const column = getTableHeaderColumn(table, drawCell.row, drawCell.col);
20150
- const direction = table && column && _optionalChain([sortState, 'optionalAccess', _1265 => _1265.tableName]) === table.name && sortState.columnIndex === column.index ? sortState.direction : null;
20260
+ const direction = table && column && _optionalChain([sortState, 'optionalAccess', _1270 => _1270.tableName]) === table.name && sortState.columnIndex === column.index ? sortState.direction : null;
20151
20261
  drawCanvasTableHeaderTrigger(paneContext, localRect, direction, palette, zoomFactor);
20152
20262
  }
20153
20263
  }
@@ -20433,7 +20543,7 @@ function XlsxGrid({
20433
20543
  if (readOnlyRef.current || chart.editable === false) {
20434
20544
  return;
20435
20545
  }
20436
- _optionalChain([event, 'access', _1266 => _1266.currentTarget, 'access', _1267 => _1267.setPointerCapture, 'optionalCall', _1268 => _1268(event.pointerId)]);
20546
+ _optionalChain([event, 'access', _1271 => _1271.currentTarget, 'access', _1272 => _1272.setPointerCapture, 'optionalCall', _1273 => _1273(event.pointerId)]);
20437
20547
  chartInteractionRef.current = {
20438
20548
  baseRect: rect,
20439
20549
  chartId: chart.id,
@@ -20458,7 +20568,7 @@ function XlsxGrid({
20458
20568
  event.stopPropagation();
20459
20569
  focusGrid();
20460
20570
  selectChart(chart.id);
20461
- _optionalChain([event, 'access', _1269 => _1269.currentTarget, 'access', _1270 => _1270.setPointerCapture, 'optionalCall', _1271 => _1271(event.pointerId)]);
20571
+ _optionalChain([event, 'access', _1274 => _1274.currentTarget, 'access', _1275 => _1275.setPointerCapture, 'optionalCall', _1276 => _1276(event.pointerId)]);
20462
20572
  chartInteractionRef.current = {
20463
20573
  baseRect: rect,
20464
20574
  chartId: chart.id,
@@ -20487,7 +20597,7 @@ function XlsxGrid({
20487
20597
  if (readOnlyRef.current || image.editable === false) {
20488
20598
  return;
20489
20599
  }
20490
- _optionalChain([event, 'access', _1272 => _1272.currentTarget, 'access', _1273 => _1273.setPointerCapture, 'optionalCall', _1274 => _1274(event.pointerId)]);
20600
+ _optionalChain([event, 'access', _1277 => _1277.currentTarget, 'access', _1278 => _1278.setPointerCapture, 'optionalCall', _1279 => _1279(event.pointerId)]);
20491
20601
  imageInteractionRef.current = {
20492
20602
  baseRect: rect,
20493
20603
  didMove: false,
@@ -20512,7 +20622,7 @@ function XlsxGrid({
20512
20622
  event.stopPropagation();
20513
20623
  focusGrid();
20514
20624
  selectImage(image.id);
20515
- _optionalChain([event, 'access', _1275 => _1275.currentTarget, 'access', _1276 => _1276.setPointerCapture, 'optionalCall', _1277 => _1277(event.pointerId)]);
20625
+ _optionalChain([event, 'access', _1280 => _1280.currentTarget, 'access', _1281 => _1281.setPointerCapture, 'optionalCall', _1282 => _1282(event.pointerId)]);
20516
20626
  imageInteractionRef.current = {
20517
20627
  baseRect: rect,
20518
20628
  didMove: false,
@@ -20580,7 +20690,7 @@ function XlsxGrid({
20580
20690
  }
20581
20691
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, _chunkZ4WMURVUcjs.S, { children: renderError(errorState, error, palette, messages) });
20582
20692
  }
20583
- if (!activeSheet && _optionalChain([activeTab, 'optionalAccess', _1278 => _1278.kind]) === "chartsheet") {
20693
+ if (!activeSheet && _optionalChain([activeTab, 'optionalAccess', _1283 => _1283.kind]) === "chartsheet") {
20584
20694
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0,
20585
20695
  "div",
20586
20696
  {
@@ -20610,10 +20720,10 @@ function XlsxGrid({
20610
20720
  children: charts.length > 0 ? charts.map((chart) => {
20611
20721
  const sourceSize = chart.anchor.kind !== "two-cell" ? chart.anchor.sizeEmu : void 0;
20612
20722
  const chartsheetRect = {
20613
- height: _optionalChain([sourceSize, 'optionalAccess', _1279 => _1279.cy]) ? _chunkGP5SOQQHcjs.emuToPixels.call(void 0, sourceSize.cy) : 320,
20723
+ height: _optionalChain([sourceSize, 'optionalAccess', _1284 => _1284.cy]) ? _chunkGP5SOQQHcjs.emuToPixels.call(void 0, sourceSize.cy) : 320,
20614
20724
  left: 0,
20615
20725
  top: 0,
20616
- width: _optionalChain([sourceSize, 'optionalAccess', _1280 => _1280.cx]) ? _chunkGP5SOQQHcjs.emuToPixels.call(void 0, sourceSize.cx) : 640
20726
+ width: _optionalChain([sourceSize, 'optionalAccess', _1285 => _1285.cx]) ? _chunkGP5SOQQHcjs.emuToPixels.call(void 0, sourceSize.cx) : 640
20617
20727
  };
20618
20728
  return /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "div", { style: {
20619
20729
  minHeight: sourceSize ? void 0 : 320,
@@ -20671,8 +20781,8 @@ function XlsxGrid({
20671
20781
  const sheetContentHeight = displayHeaderHeight + totalHeight;
20672
20782
  const isLiveZooming = liveGestureZoom !== null && zoomScale === liveGestureZoom.baseZoomScale;
20673
20783
  const liveZoomScale = isLiveZooming ? Math.max(0.1, liveGestureZoom.targetZoomScale / liveGestureZoom.baseZoomScale) : 1;
20674
- const liveZoomScrollLeft = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1281 => _1281.current, 'optionalAccess', _1282 => _1282.scrollLeft]), () => ( drawingViewport.left));
20675
- const liveZoomScrollTop = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1283 => _1283.current, 'optionalAccess', _1284 => _1284.scrollTop]), () => ( drawingViewport.top));
20784
+ const liveZoomScrollLeft = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1286 => _1286.current, 'optionalAccess', _1287 => _1287.scrollLeft]), () => ( drawingViewport.left));
20785
+ const liveZoomScrollTop = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1288 => _1288.current, 'optionalAccess', _1289 => _1289.scrollTop]), () => ( drawingViewport.top));
20676
20786
  const liveZoomTranslateX = isLiveZooming ? (liveZoomScrollLeft + liveGestureZoom.anchor.x) * (1 - liveZoomScale) : 0;
20677
20787
  const liveZoomTranslateY = isLiveZooming ? (liveZoomScrollTop + liveGestureZoom.anchor.y) * (1 - liveZoomScale) : 0;
20678
20788
  const headerLabelLiveScale = isLiveZooming ? liveZoomScale : 1;
@@ -20839,7 +20949,7 @@ function XlsxGrid({
20839
20949
  }) : [];
20840
20950
  const activeCellOverlayCell = renderActiveCellOverlay && activeCell ? resolveMergeAnchorCell(activeCell) : null;
20841
20951
  const activeCellOverlayRect = activeCellOverlayCell ? resolveCellDisplayRect(activeCellOverlayCell) : null;
20842
- const activeCellOverlay = activeCellOverlayCell && activeCellOverlayRect ? _optionalChain([renderActiveCellOverlay, 'optionalCall', _1285 => _1285({ cell: activeCellOverlayCell, rect: activeCellOverlayRect })]) : null;
20952
+ const activeCellOverlay = activeCellOverlayCell && activeCellOverlayRect ? _optionalChain([renderActiveCellOverlay, 'optionalCall', _1290 => _1290({ cell: activeCellOverlayCell, rect: activeCellOverlayRect })]) : null;
20843
20953
  const cellOverlayPaneFor = (cell) => stickyTopByRow.has(cell.row) ? stickyLeftByCol.has(cell.col) ? "corner" : "top" : stickyLeftByCol.has(cell.col) ? "left" : "scroll";
20844
20954
  const renderCellOverlay = (cell, content) => {
20845
20955
  const host = cellOverlayHosts[cellOverlayPaneFor(cell)];
@@ -20861,7 +20971,7 @@ function XlsxGrid({
20861
20971
  frozenCols,
20862
20972
  displayActualRowHeights,
20863
20973
  displayActualColWidths,
20864
- _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1286 => _1286.freezePanes]), () => ( null)),
20974
+ _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1291 => _1291.freezePanes]), () => ( null)),
20865
20975
  stickyTopByRow,
20866
20976
  stickyLeftByCol,
20867
20977
  {
@@ -20881,7 +20991,7 @@ function XlsxGrid({
20881
20991
  return null;
20882
20992
  }
20883
20993
  const isFrozenDrawing = pane !== "scroll";
20884
- const inset = _optionalChain([shape, 'access', _1287 => _1287.textBox, 'optionalAccess', _1288 => _1288.insetPx]);
20994
+ const inset = _optionalChain([shape, 'access', _1292 => _1292.textBox, 'optionalAccess', _1293 => _1293.insetPx]);
20885
20995
  const groupScaleX = _nullishCoalesce(shape.scaleX, () => ( 1));
20886
20996
  const groupScaleY = _nullishCoalesce(shape.scaleY, () => ( 1));
20887
20997
  const strokeScale = Math.max(groupScaleX, groupScaleY);
@@ -20889,12 +20999,12 @@ function XlsxGrid({
20889
20999
  const textWidth = groupScaleX !== 0 ? rect.width / groupScaleX : rect.width;
20890
21000
  const textHeight = groupScaleY !== 0 ? rect.height / groupScaleY : rect.height;
20891
21001
  const vectorShape = resolveShapeVector(shape);
20892
- const strokeColor = _optionalChain([shape, 'access', _1289 => _1289.stroke, 'optionalAccess', _1290 => _1290.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1291 => _1291.stroke, 'optionalAccess', _1292 => _1292.color]), () => ( "transparent"));
20893
- const scaledStrokeWidth = (_nullishCoalesce(_optionalChain([shape, 'access', _1293 => _1293.stroke, 'optionalAccess', _1294 => _1294.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * strokeScale * zoomFactor;
21002
+ const strokeColor = _optionalChain([shape, 'access', _1294 => _1294.stroke, 'optionalAccess', _1295 => _1295.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1296 => _1296.stroke, 'optionalAccess', _1297 => _1297.color]), () => ( "transparent"));
21003
+ const scaledStrokeWidth = (_nullishCoalesce(_optionalChain([shape, 'access', _1298 => _1298.stroke, 'optionalAccess', _1299 => _1299.widthPx]), () => ( (shape.geometry === "line" ? 2 : 1)))) * strokeScale * zoomFactor;
20894
21004
  const headMarkerId = `${shape.id}-${pane}-head-marker`;
20895
21005
  const tailMarkerId = `${shape.id}-${pane}-tail-marker`;
20896
21006
  const headMarker = vectorShape ? resolveShapeLineEndMarker(
20897
- _optionalChain([shape, 'access', _1295 => _1295.stroke, 'optionalAccess', _1296 => _1296.headEndType]),
21007
+ _optionalChain([shape, 'access', _1300 => _1300.stroke, 'optionalAccess', _1301 => _1301.headEndType]),
20898
21008
  headMarkerId,
20899
21009
  strokeColor,
20900
21010
  scaledStrokeWidth,
@@ -20902,7 +21012,7 @@ function XlsxGrid({
20902
21012
  vectorShape.viewBox
20903
21013
  ) : null;
20904
21014
  const tailMarker = vectorShape ? resolveShapeLineEndMarker(
20905
- _optionalChain([shape, 'access', _1297 => _1297.stroke, 'optionalAccess', _1298 => _1298.tailEndType]),
21015
+ _optionalChain([shape, 'access', _1302 => _1302.stroke, 'optionalAccess', _1303 => _1303.tailEndType]),
20906
21016
  tailMarkerId,
20907
21017
  strokeColor,
20908
21018
  scaledStrokeWidth,
@@ -20952,12 +21062,12 @@ function XlsxGrid({
20952
21062
  "path",
20953
21063
  {
20954
21064
  d: vectorShape.path,
20955
- fill: _optionalChain([shape, 'access', _1299 => _1299.fill, 'optionalAccess', _1300 => _1300.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1301 => _1301.fill, 'optionalAccess', _1302 => _1302.color]), () => ( "transparent")),
20956
- fillOpacity: _nullishCoalesce(_optionalChain([shape, 'access', _1303 => _1303.fill, 'optionalAccess', _1304 => _1304.opacity]), () => ( 1)),
21065
+ fill: _optionalChain([shape, 'access', _1304 => _1304.fill, 'optionalAccess', _1305 => _1305.none]) ? "transparent" : _nullishCoalesce(_optionalChain([shape, 'access', _1306 => _1306.fill, 'optionalAccess', _1307 => _1307.color]), () => ( "transparent")),
21066
+ fillOpacity: _nullishCoalesce(_optionalChain([shape, 'access', _1308 => _1308.fill, 'optionalAccess', _1309 => _1309.opacity]), () => ( 1)),
20957
21067
  markerEnd: tailMarker ? `url(#${tailMarkerId})` : void 0,
20958
21068
  markerStart: headMarker ? `url(#${headMarkerId})` : void 0,
20959
21069
  stroke: strokeColor,
20960
- strokeOpacity: _nullishCoalesce(_optionalChain([shape, 'access', _1305 => _1305.stroke, 'optionalAccess', _1306 => _1306.opacity]), () => ( 1)),
21070
+ strokeOpacity: _nullishCoalesce(_optionalChain([shape, 'access', _1310 => _1310.stroke, 'optionalAccess', _1311 => _1311.opacity]), () => ( 1)),
20961
21071
  strokeWidth: scaledStrokeWidth,
20962
21072
  vectorEffect: "non-scaling-stroke"
20963
21073
  }
@@ -20975,11 +21085,11 @@ function XlsxGrid({
20975
21085
  flexDirection: "column",
20976
21086
  gap: 2 * zoomFactor,
20977
21087
  height: textHeight,
20978
- justifyContent: _optionalChain([shape, 'access', _1307 => _1307.textBox, 'optionalAccess', _1308 => _1308.verticalAlign]) === "middle" ? "center" : _optionalChain([shape, 'access', _1309 => _1309.textBox, 'optionalAccess', _1310 => _1310.verticalAlign]) === "bottom" ? "flex-end" : "flex-start",
20979
- paddingBottom: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1311 => _1311.bottom]), () => ( 4))) * zoomFactor,
20980
- paddingLeft: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1312 => _1312.left]), () => ( 6))) * zoomFactor,
20981
- paddingRight: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1313 => _1313.right]), () => ( 6))) * zoomFactor,
20982
- paddingTop: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1314 => _1314.top]), () => ( 4))) * zoomFactor,
21088
+ justifyContent: _optionalChain([shape, 'access', _1312 => _1312.textBox, 'optionalAccess', _1313 => _1313.verticalAlign]) === "middle" ? "center" : _optionalChain([shape, 'access', _1314 => _1314.textBox, 'optionalAccess', _1315 => _1315.verticalAlign]) === "bottom" ? "flex-end" : "flex-start",
21089
+ paddingBottom: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1316 => _1316.bottom]), () => ( 4))) * zoomFactor,
21090
+ paddingLeft: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1317 => _1317.left]), () => ( 6))) * zoomFactor,
21091
+ paddingRight: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1318 => _1318.right]), () => ( 6))) * zoomFactor,
21092
+ paddingTop: (_nullishCoalesce(_optionalChain([inset, 'optionalAccess', _1319 => _1319.top]), () => ( 4))) * zoomFactor,
20983
21093
  pointerEvents: "none",
20984
21094
  position: "relative",
20985
21095
  transform: groupScaleX !== 1 || groupScaleY !== 1 ? `scale(${groupScaleX}, ${groupScaleY})` : void 0,
@@ -20990,7 +21100,7 @@ function XlsxGrid({
20990
21100
  children: shape.paragraphs.map((paragraph, index) => renderShapeParagraph(
20991
21101
  paragraph,
20992
21102
  index,
20993
- _nullishCoalesce(_optionalChain([shape, 'access', _1315 => _1315.textBox, 'optionalAccess', _1316 => _1316.horizontalAlign]), () => ( "left")),
21103
+ _nullishCoalesce(_optionalChain([shape, 'access', _1320 => _1320.textBox, 'optionalAccess', _1321 => _1321.horizontalAlign]), () => ( "left")),
20994
21104
  textScale
20995
21105
  ))
20996
21106
  }
@@ -21054,7 +21164,7 @@ function XlsxGrid({
21054
21164
  }
21055
21165
  const didUpdate = updateFormControl(control3.controlIndex, { kind }, control3.sheetIndex);
21056
21166
  if (didUpdate) {
21057
- _optionalChain([onFormControlChange, 'optionalCall', _1317 => _1317({
21167
+ _optionalChain([onFormControlChange, 'optionalCall', _1322 => _1322({
21058
21168
  control: { ...control3, ...nextControl },
21059
21169
  previousControl: control3,
21060
21170
  type: "change"
@@ -21064,13 +21174,13 @@ function XlsxGrid({
21064
21174
  };
21065
21175
  const setControlState = (state = "unchecked") => {
21066
21176
  const kind = buildFormControlKindInput(control3);
21067
- if (_optionalChain([kind, 'optionalAccess', _1318 => _1318.kind]) === "checkbox") {
21177
+ if (_optionalChain([kind, 'optionalAccess', _1323 => _1323.kind]) === "checkbox") {
21068
21178
  return commitControlKind(
21069
21179
  { ...kind, state },
21070
21180
  { checked: state === "checked", state }
21071
21181
  );
21072
21182
  }
21073
- if (_optionalChain([kind, 'optionalAccess', _1319 => _1319.kind]) === "optionButton" && state !== "mixed") {
21183
+ if (_optionalChain([kind, 'optionalAccess', _1324 => _1324.kind]) === "optionButton" && state !== "mixed") {
21074
21184
  return commitControlKind(
21075
21185
  { ...kind, state },
21076
21186
  { checked: state === "checked", state }
@@ -21080,14 +21190,14 @@ function XlsxGrid({
21080
21190
  };
21081
21191
  const setControlSelected = (selected) => {
21082
21192
  const kind = buildFormControlKindInput(control3);
21083
- if (_optionalChain([kind, 'optionalAccess', _1320 => _1320.kind]) === "dropdown") {
21193
+ if (_optionalChain([kind, 'optionalAccess', _1325 => _1325.kind]) === "dropdown") {
21084
21194
  const nextSelected = typeof selected === "number" ? selected : void 0;
21085
21195
  return commitControlKind(
21086
21196
  { ...kind, selected: nextSelected },
21087
21197
  { selected: nextSelected }
21088
21198
  );
21089
21199
  }
21090
- if (_optionalChain([kind, 'optionalAccess', _1321 => _1321.kind]) === "listBox") {
21200
+ if (_optionalChain([kind, 'optionalAccess', _1326 => _1326.kind]) === "listBox") {
21091
21201
  const nextSelected = Array.isArray(selected) ? selected : typeof selected === "number" ? [selected] : [];
21092
21202
  return commitControlKind(
21093
21203
  { ...kind, selected: nextSelected },
@@ -21101,7 +21211,7 @@ function XlsxGrid({
21101
21211
  return false;
21102
21212
  }
21103
21213
  const kind = buildFormControlKindInput(control3);
21104
- if (_optionalChain([kind, 'optionalAccess', _1322 => _1322.kind]) !== "scrollbar" && _optionalChain([kind, 'optionalAccess', _1323 => _1323.kind]) !== "spinner") {
21214
+ if (_optionalChain([kind, 'optionalAccess', _1327 => _1327.kind]) !== "scrollbar" && _optionalChain([kind, 'optionalAccess', _1328 => _1328.kind]) !== "spinner") {
21105
21215
  return false;
21106
21216
  }
21107
21217
  const nextValue = Math.max(kind.min, Math.min(kind.max, value));
@@ -21109,7 +21219,7 @@ function XlsxGrid({
21109
21219
  };
21110
21220
  const activateControl = () => {
21111
21221
  if (!readOnly && control3.kind === "button") {
21112
- _optionalChain([onFormControlAction, 'optionalCall', _1324 => _1324({ control: control3, type: "activate" })]);
21222
+ _optionalChain([onFormControlAction, 'optionalCall', _1329 => _1329({ control: control3, type: "activate" })]);
21113
21223
  }
21114
21224
  };
21115
21225
  if (renderFormControl) {
@@ -21798,7 +21908,7 @@ function XlsxGrid({
21798
21908
  actualIndex: actualCol,
21799
21909
  initialPx: widthPx,
21800
21910
  pointerId,
21801
- restoreUserSelect: _nullishCoalesce(_optionalChain([resizeStateRef, 'access', _1325 => _1325.current, 'optionalAccess', _1326 => _1326.restoreUserSelect]), () => ( suppressResizeTextSelection())),
21911
+ restoreUserSelect: _nullishCoalesce(_optionalChain([resizeStateRef, 'access', _1330 => _1330.current, 'optionalAccess', _1331 => _1331.restoreUserSelect]), () => ( suppressResizeTextSelection())),
21802
21912
  startPosition: startX,
21803
21913
  type: "column"
21804
21914
  };
@@ -21818,7 +21928,7 @@ function XlsxGrid({
21818
21928
  actualIndex: actualRow,
21819
21929
  initialPx: heightPx,
21820
21930
  pointerId,
21821
- restoreUserSelect: _nullishCoalesce(_optionalChain([resizeStateRef, 'access', _1327 => _1327.current, 'optionalAccess', _1328 => _1328.restoreUserSelect]), () => ( suppressResizeTextSelection())),
21931
+ restoreUserSelect: _nullishCoalesce(_optionalChain([resizeStateRef, 'access', _1332 => _1332.current, 'optionalAccess', _1333 => _1333.restoreUserSelect]), () => ( suppressResizeTextSelection())),
21822
21932
  startPosition: startY,
21823
21933
  type: "row"
21824
21934
  };
@@ -21896,7 +22006,7 @@ function XlsxGrid({
21896
22006
  if (readOnly) {
21897
22007
  return;
21898
22008
  }
21899
- cachedScrollerRectRef.current = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1329 => _1329.current, 'optionalAccess', _1330 => _1330.getBoundingClientRect, 'call', _1331 => _1331()]), () => ( null));
22009
+ cachedScrollerRectRef.current = _nullishCoalesce(_optionalChain([scrollRef, 'access', _1334 => _1334.current, 'optionalAccess', _1335 => _1335.getBoundingClientRect, 'call', _1336 => _1336()]), () => ( null));
21900
22010
  const normalizedSource = normalizeRange2(sourceRange);
21901
22011
  fillDragRef.current = {
21902
22012
  pointerId,
@@ -21919,7 +22029,7 @@ function XlsxGrid({
21919
22029
  applyPreviewOverlay(nextRange);
21920
22030
  }
21921
22031
  function installImageInteractionListeners(pointerId) {
21922
- _optionalChain([imageInteractionCleanupRef, 'access', _1332 => _1332.current, 'optionalCall', _1333 => _1333()]);
22032
+ _optionalChain([imageInteractionCleanupRef, 'access', _1337 => _1337.current, 'optionalCall', _1338 => _1338()]);
21923
22033
  const resolveInteractionRect = (interaction, clientX, clientY) => {
21924
22034
  const deltaX = clientX - interaction.startClientX;
21925
22035
  const deltaY = clientY - interaction.startClientY;
@@ -21999,7 +22109,7 @@ function XlsxGrid({
21999
22109
  imageInteractionCleanupRef.current = cleanup;
22000
22110
  }
22001
22111
  function installChartInteractionListeners(pointerId) {
22002
- _optionalChain([chartInteractionCleanupRef, 'access', _1334 => _1334.current, 'optionalCall', _1335 => _1335()]);
22112
+ _optionalChain([chartInteractionCleanupRef, 'access', _1339 => _1339.current, 'optionalCall', _1340 => _1340()]);
22003
22113
  const resolveInteractionRect = (interaction, clientX, clientY) => {
22004
22114
  const deltaX = clientX - interaction.startClientX;
22005
22115
  const deltaY = clientY - interaction.startClientY;
@@ -22163,7 +22273,7 @@ function XlsxGrid({
22163
22273
  const scroller = scrollRef.current;
22164
22274
  const viewportHeight = Math.max(
22165
22275
  displayDefaultRowHeight,
22166
- (_nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _1336 => _1336.clientHeight]), () => ( displayDefaultRowHeight * 20))) - frozenPaneBottom
22276
+ (_nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _1341 => _1341.clientHeight]), () => ( displayDefaultRowHeight * 20))) - frozenPaneBottom
22167
22277
  );
22168
22278
  const currentOffset = _nullishCoalesce(rowPrefixSums[currentRowIndex], () => ( 0));
22169
22279
  const targetOffset = direction > 0 ? currentOffset + viewportHeight : currentOffset - viewportHeight;
@@ -22173,7 +22283,7 @@ function XlsxGrid({
22173
22283
  const scroller = scrollRef.current;
22174
22284
  const viewportWidth = Math.max(
22175
22285
  displayDefaultColWidth,
22176
- (_nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _1337 => _1337.clientWidth]), () => ( displayDefaultColWidth * 8))) - frozenPaneRight
22286
+ (_nullishCoalesce(_optionalChain([scroller, 'optionalAccess', _1342 => _1342.clientWidth]), () => ( displayDefaultColWidth * 8))) - frozenPaneRight
22177
22287
  );
22178
22288
  const currentOffset = _nullishCoalesce(colPrefixSums[currentColIndex], () => ( 0));
22179
22289
  const targetOffset = direction > 0 ? currentOffset + viewportWidth : currentOffset - viewportWidth;
@@ -22181,7 +22291,7 @@ function XlsxGrid({
22181
22291
  }
22182
22292
  function resolveColumnSelectionNavigation(eventKey) {
22183
22293
  const axisSelection = axisSelectionRef.current;
22184
- if (_optionalChain([axisSelection, 'optionalAccess', _1338 => _1338.axis]) !== "column" || firstVisibleRow === void 0) {
22294
+ if (_optionalChain([axisSelection, 'optionalAccess', _1343 => _1343.axis]) !== "column" || firstVisibleRow === void 0) {
22185
22295
  return null;
22186
22296
  }
22187
22297
  const startCol = Math.min(axisSelection.startCol, axisSelection.endCol);
@@ -22199,7 +22309,7 @@ function XlsxGrid({
22199
22309
  }
22200
22310
  function resolveRowSelectionNavigation(eventKey) {
22201
22311
  const axisSelection = axisSelectionRef.current;
22202
- if (_optionalChain([axisSelection, 'optionalAccess', _1339 => _1339.axis]) !== "row" || firstVisibleCol === void 0) {
22312
+ if (_optionalChain([axisSelection, 'optionalAccess', _1344 => _1344.axis]) !== "row" || firstVisibleCol === void 0) {
22203
22313
  return null;
22204
22314
  }
22205
22315
  const startRow = Math.min(axisSelection.startRow, axisSelection.endRow);
@@ -22221,18 +22331,18 @@ function XlsxGrid({
22221
22331
  }
22222
22332
  if (enableContextMenu && (event.key === "ContextMenu" || event.shiftKey && event.key === "F10")) {
22223
22333
  const cell = resolveCurrentCell();
22224
- const rect = _optionalChain([scrollRef, 'access', _1340 => _1340.current, 'optionalAccess', _1341 => _1341.getBoundingClientRect, 'call', _1342 => _1342()]);
22334
+ const rect = _optionalChain([scrollRef, 'access', _1345 => _1345.current, 'optionalAccess', _1346 => _1346.getBoundingClientRect, 'call', _1347 => _1347()]);
22225
22335
  if (cell && rect) {
22226
22336
  event.preventDefault();
22227
22337
  const overlay = resolveOverlayRect({ start: cell, end: cell });
22228
22338
  const position = {
22229
- x: rect.left + (_nullishCoalesce(_optionalChain([overlay, 'optionalAccess', _1343 => _1343.left]), () => ( displayRowHeaderWidth))) - (_nullishCoalesce(_optionalChain([scrollRef, 'access', _1344 => _1344.current, 'optionalAccess', _1345 => _1345.scrollLeft]), () => ( 0))),
22230
- y: rect.top + (overlay ? overlay.top + overlay.height : displayHeaderHeight) - (_nullishCoalesce(_optionalChain([scrollRef, 'access', _1346 => _1346.current, 'optionalAccess', _1347 => _1347.scrollTop]), () => ( 0)))
22339
+ x: rect.left + (_nullishCoalesce(_optionalChain([overlay, 'optionalAccess', _1348 => _1348.left]), () => ( displayRowHeaderWidth))) - (_nullishCoalesce(_optionalChain([scrollRef, 'access', _1349 => _1349.current, 'optionalAccess', _1350 => _1350.scrollLeft]), () => ( 0))),
22340
+ y: rect.top + (overlay ? overlay.top + overlay.height : displayHeaderHeight) - (_nullishCoalesce(_optionalChain([scrollRef, 'access', _1351 => _1351.current, 'optionalAccess', _1352 => _1352.scrollTop]), () => ( 0)))
22231
22341
  };
22232
22342
  if (selectedChart) openDrawingContextMenu("chart", selectedChart, position);
22233
22343
  else if (selectedImage) openDrawingContextMenu("image", selectedImage, position);
22234
22344
  else {
22235
- const axis = _optionalChain([axisSelectionRef, 'access', _1348 => _1348.current, 'optionalAccess', _1349 => _1349.axis]);
22345
+ const axis = _optionalChain([axisSelectionRef, 'access', _1353 => _1353.current, 'optionalAccess', _1354 => _1354.axis]);
22236
22346
  const kind = axis && selectionCoversRange(selectionRanges, getContextExtent(axis, { start: cell, end: cell })) ? axis : "cell";
22237
22347
  if (kind === "row") position.x = rect.left + displayRowHeaderWidth;
22238
22348
  if (kind === "column") position.y = rect.top + displayHeaderHeight;
@@ -22241,7 +22351,7 @@ function XlsxGrid({
22241
22351
  }
22242
22352
  return;
22243
22353
  }
22244
- if (!readOnly && !selectedChart && !selectedImage && event.ctrlKey && !event.metaKey && !event.altKey) {
22354
+ if ((_nullishCoalesce(controller.canChangeVisibility, () => ( !readOnly))) && !selectedChart && !selectedImage && event.ctrlKey && !event.metaKey && !event.altKey) {
22245
22355
  if (event.code === "Digit9" || event.code === "Digit0") {
22246
22356
  event.preventDefault();
22247
22357
  if (event.code === "Digit9") {
@@ -22294,7 +22404,7 @@ function XlsxGrid({
22294
22404
  }
22295
22405
  }
22296
22406
  moveSelection(
22297
- isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveLastUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1350 => _1350.maxUsedRow]), () => ( -1)))), () => ( visibleRows.length - 1)) : nextMerged.row,
22407
+ isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveLastUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1355 => _1355.maxUsedRow]), () => ( -1)))), () => ( visibleRows.length - 1)) : nextMerged.row,
22298
22408
  currentColIndex,
22299
22409
  event.shiftKey
22300
22410
  );
@@ -22309,7 +22419,7 @@ function XlsxGrid({
22309
22419
  }
22310
22420
  }
22311
22421
  moveSelection(
22312
- isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveFirstUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1351 => _1351.minUsedRow]), () => ( -1)))), () => ( 0)) : nextMerged.row,
22422
+ isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveFirstUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1356 => _1356.minUsedRow]), () => ( -1)))), () => ( 0)) : nextMerged.row,
22313
22423
  currentColIndex,
22314
22424
  event.shiftKey
22315
22425
  );
@@ -22325,7 +22435,7 @@ function XlsxGrid({
22325
22435
  }
22326
22436
  moveSelection(
22327
22437
  currentRowIndex,
22328
- isCommandNavigation ? _nullishCoalesce(colIndexByActual.get(resolveFirstUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1352 => _1352.minUsedCol]), () => ( -1)))), () => ( 0)) : nextMerged.col,
22438
+ isCommandNavigation ? _nullishCoalesce(colIndexByActual.get(resolveFirstUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1357 => _1357.minUsedCol]), () => ( -1)))), () => ( 0)) : nextMerged.col,
22329
22439
  event.shiftKey
22330
22440
  );
22331
22441
  break;
@@ -22340,23 +22450,23 @@ function XlsxGrid({
22340
22450
  }
22341
22451
  moveSelection(
22342
22452
  currentRowIndex,
22343
- isCommandNavigation ? _nullishCoalesce(colIndexByActual.get(resolveLastUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1353 => _1353.maxUsedCol]), () => ( -1)))), () => ( visibleCols.length - 1)) : nextMerged.col,
22453
+ isCommandNavigation ? _nullishCoalesce(colIndexByActual.get(resolveLastUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1358 => _1358.maxUsedCol]), () => ( -1)))), () => ( visibleCols.length - 1)) : nextMerged.col,
22344
22454
  event.shiftKey
22345
22455
  );
22346
22456
  break;
22347
22457
  case "Home":
22348
22458
  event.preventDefault();
22349
22459
  moveSelection(
22350
- isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveFirstUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1354 => _1354.minUsedRow]), () => ( -1)))), () => ( 0)) : currentRowIndex,
22351
- _nullishCoalesce(colIndexByActual.get(resolveFirstUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1355 => _1355.minUsedCol]), () => ( -1)))), () => ( 0)),
22460
+ isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveFirstUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1359 => _1359.minUsedRow]), () => ( -1)))), () => ( 0)) : currentRowIndex,
22461
+ _nullishCoalesce(colIndexByActual.get(resolveFirstUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1360 => _1360.minUsedCol]), () => ( -1)))), () => ( 0)),
22352
22462
  event.shiftKey
22353
22463
  );
22354
22464
  break;
22355
22465
  case "End":
22356
22466
  event.preventDefault();
22357
22467
  moveSelection(
22358
- isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveLastUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1356 => _1356.maxUsedRow]), () => ( -1)))), () => ( visibleRows.length - 1)) : currentRowIndex,
22359
- _nullishCoalesce(colIndexByActual.get(resolveLastUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1357 => _1357.maxUsedCol]), () => ( -1)))), () => ( visibleCols.length - 1)),
22468
+ isCommandNavigation ? _nullishCoalesce(rowIndexByActual.get(resolveLastUsedVisibleIndex(visibleRows, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1361 => _1361.maxUsedRow]), () => ( -1)))), () => ( visibleRows.length - 1)) : currentRowIndex,
22469
+ _nullishCoalesce(colIndexByActual.get(resolveLastUsedVisibleIndex(visibleCols, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1362 => _1362.maxUsedCol]), () => ( -1)))), () => ( visibleCols.length - 1)),
22360
22470
  event.shiftKey
22361
22471
  );
22362
22472
  break;
@@ -22413,11 +22523,11 @@ function XlsxGrid({
22413
22523
  gridKeyboardHandlerRef.current = handleGridKeyDown;
22414
22524
  const scrollerViewportProps = {
22415
22525
  ref: scrollRef,
22416
- "aria-colcount": Math.max(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1358 => _1358.colCount]), () => ( 0)), displayColLimit),
22526
+ "aria-colcount": Math.max(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1363 => _1363.colCount]), () => ( 0)), displayColLimit),
22417
22527
  "aria-keyshortcuts": "ArrowUp ArrowDown ArrowLeft ArrowRight Home End PageUp PageDown Control+Home Control+End",
22418
22528
  "aria-label": activeSheet ? _chunkZ4WMURVUcjs.formatMessage.call(void 0, messages.worksheetGrid, { sheet: activeSheet.name }) : messages.workbookGrid,
22419
22529
  "aria-readonly": readOnly,
22420
- "aria-rowcount": Math.max(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1359 => _1359.rowCount]), () => ( 0)), displayRowLimit),
22530
+ "aria-rowcount": Math.max(_nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1364 => _1364.rowCount]), () => ( 0)), displayRowLimit),
22421
22531
  role: "grid",
22422
22532
  onScroll: handleScrollerScroll,
22423
22533
  onContextMenu: (event) => {
@@ -22511,7 +22621,7 @@ function XlsxGrid({
22511
22621
  ["--xlsx-selection-header"]: selectionHeaderSurface,
22512
22622
  backgroundColor: palette.canvas,
22513
22623
  color: palette.text,
22514
- cursor: _optionalChain([resizeGuide, 'optionalAccess', _1360 => _1360.type]) === "column" ? "col-resize" : _optionalChain([resizeGuide, 'optionalAccess', _1361 => _1361.type]) === "row" ? "row-resize" : void 0,
22624
+ cursor: _optionalChain([resizeGuide, 'optionalAccess', _1365 => _1365.type]) === "column" ? "col-resize" : _optionalChain([resizeGuide, 'optionalAccess', _1366 => _1366.type]) === "row" ? "row-resize" : void 0,
22515
22625
  flex: 1,
22516
22626
  height: "100%",
22517
22627
  minHeight: 0,
@@ -22573,7 +22683,7 @@ function XlsxGrid({
22573
22683
  )];
22574
22684
  });
22575
22685
  const chartSourceHighlightNodes = (experimentalCanvas ? activeSheetChartHighlights : []).flatMap((highlight, index) => {
22576
- const range = expandHighlightedRange(highlight.range, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1362 => _1362.mergedRanges]), () => ( mergedRegions)));
22686
+ const range = expandHighlightedRange(highlight.range, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1367 => _1367.mergedRanges]), () => ( mergedRegions)));
22577
22687
  const rows = getHighlightAxisExtent(visibleRows, rowPrefixSums, range.start.row, range.end.row);
22578
22688
  const cols = getHighlightAxisExtent(visibleCols, colPrefixSums, range.start.col, range.end.col);
22579
22689
  if (!rows || !cols) return [];
@@ -22597,8 +22707,8 @@ function XlsxGrid({
22597
22707
  ];
22598
22708
  });
22599
22709
  const formulaHighlightNodes = formulaReferences.flatMap((reference, index) => {
22600
- if (reference.sheetName && reference.sheetName.toLowerCase() !== _optionalChain([activeSheet, 'optionalAccess', _1363 => _1363.name, 'access', _1364 => _1364.toLowerCase, 'call', _1365 => _1365()])) return [];
22601
- const range = expandHighlightedRange(reference.range, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1366 => _1366.mergedRanges]), () => ( mergedRegions)));
22710
+ if (reference.sheetName && reference.sheetName.toLowerCase() !== _optionalChain([activeSheet, 'optionalAccess', _1368 => _1368.name, 'access', _1369 => _1369.toLowerCase, 'call', _1370 => _1370()])) return [];
22711
+ const range = expandHighlightedRange(reference.range, _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1371 => _1371.mergedRanges]), () => ( mergedRegions)));
22602
22712
  const rows = getHighlightAxisExtent(visibleRows, rowPrefixSums, range.start.row, range.end.row);
22603
22713
  const cols = getHighlightAxisExtent(visibleCols, colPrefixSums, range.start.col, range.end.col);
22604
22714
  if (!rows || !cols) return [];
@@ -22647,16 +22757,16 @@ function XlsxGrid({
22647
22757
  boxSizing: "border-box",
22648
22758
  boxShadow: `inset 0 0 0 ${selectionBorderWidth}px ${selectionStroke}`,
22649
22759
  contain: "layout paint",
22650
- height: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1367 => _1367.height]), () => ( 0)),
22651
- left: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1368 => _1368.left]), () => ( 0)),
22760
+ height: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1372 => _1372.height]), () => ( 0)),
22761
+ left: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1373 => _1373.left]), () => ( 0)),
22652
22762
  opacity: resolvedSelectionOverlay ? 1 : 0,
22653
22763
  pointerEvents: "none",
22654
22764
  position: "absolute",
22655
- top: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1369 => _1369.top]), () => ( 0)),
22765
+ top: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1374 => _1374.top]), () => ( 0)),
22656
22766
  transition: canvasSelectionTransition,
22657
22767
  visibility: resolvedSelectionOverlay ? "visible" : "hidden",
22658
22768
  willChange: shouldAnimateCanvasSelectionGeometry ? "left, top, width, height" : void 0,
22659
- width: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1370 => _1370.width]), () => ( 0)),
22769
+ width: _nullishCoalesce(_optionalChain([resolvedSelectionOverlay, 'optionalAccess', _1375 => _1375.width]), () => ( 0)),
22660
22770
  zIndex: 24
22661
22771
  }
22662
22772
  }
@@ -22928,7 +23038,7 @@ function XlsxGrid({
22928
23038
  editingCell && editingOverlayRect ? (() => {
22929
23039
  const editingCellData = getCellData(editingCell.row, editingCell.col);
22930
23040
  const editingCellStyle = { ...editingCellData.style, ...cellEditorStyle };
22931
- if (editingCellData.usesGeneralAlignment && _optionalChain([cellEditorStyle, 'optionalAccess', _1371 => _1371.textAlign]) === void 0) {
23041
+ if (editingCellData.usesGeneralAlignment && _optionalChain([cellEditorStyle, 'optionalAccess', _1376 => _1376.textAlign]) === void 0) {
22932
23042
  const enteredValue = worksheet && isTextCell(worksheet, editingCell) ? editingValue : coerceUserEnteredValue(editingValue, locale);
22933
23043
  editingCellStyle.textAlign = typeof enteredValue === "number" ? "right" : typeof enteredValue === "boolean" ? "center" : "left";
22934
23044
  }
@@ -22990,9 +23100,9 @@ function XlsxGrid({
22990
23100
  wrapText: editingCellData.style.whiteSpace === "pre-wrap",
22991
23101
  references: formulaReferences,
22992
23102
  onBlur: handleEditingBlur,
22993
- onChange: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1372 => _1372.setValue]), () => ( setEditingValue)),
22994
- onCommit: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1373 => _1373.commit]), () => ( commitEditing)),
22995
- onCancel: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1374 => _1374.cancel]), () => ( cancelEditing)),
23103
+ onChange: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1377 => _1377.setValue]), () => ( setEditingValue)),
23104
+ onCommit: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1378 => _1378.commit]), () => ( commitEditing)),
23105
+ onCancel: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1379 => _1379.cancel]), () => ( cancelEditing)),
22996
23106
  onNavigate: handleEditingNavigate,
22997
23107
  style: {
22998
23108
  backgroundColor: editingBackground,
@@ -23129,7 +23239,7 @@ function XlsxGrid({
23129
23239
  if (actualRow === void 0) {
23130
23240
  return [];
23131
23241
  }
23132
- const previousEnd = index === 0 ? 0 : _nullishCoalesce(_optionalChain([virtualRows, 'access', _1375 => _1375[index - 1], 'optionalAccess', _1376 => _1376.end]), () => ( 0));
23242
+ const previousEnd = index === 0 ? 0 : _nullishCoalesce(_optionalChain([virtualRows, 'access', _1380 => _1380[index - 1], 'optionalAccess', _1381 => _1381.end]), () => ( 0));
23133
23243
  const gapHeight = Math.max(0, virtualRow.start - previousEnd);
23134
23244
  return [
23135
23245
  gapHeight > 0 ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "tr", { "aria-hidden": "true", style: { height: gapHeight }, children: /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "td", { colSpan: rowColSpan }) }, `spacer-${virtualRow.key}`) : null,
@@ -23152,10 +23262,10 @@ function XlsxGrid({
23152
23262
  onCellDoubleClick: handleCellDoubleClick,
23153
23263
  onCellPointerDown: handleCellPointerDown,
23154
23264
  onEditingBlur: handleEditingBlur,
23155
- onEditingCancel: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1377 => _1377.cancel]), () => ( cancelEditing)),
23156
- onEditingCommit: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1378 => _1378.commit]), () => ( commitEditing)),
23265
+ onEditingCancel: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1382 => _1382.cancel]), () => ( cancelEditing)),
23266
+ onEditingCommit: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1383 => _1383.commit]), () => ( commitEditing)),
23157
23267
  onEditingNavigate: handleEditingNavigate,
23158
- onEditingValueChange: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1379 => _1379.setValue]), () => ( setEditingValue)),
23268
+ onEditingValueChange: _nullishCoalesce(_optionalChain([cellEditorSession, 'optionalAccess', _1384 => _1384.setValue]), () => ( setEditingValue)),
23159
23269
  headerLabelLiveScale,
23160
23270
  onRowHeaderRef: setRowHeaderRef,
23161
23271
  onRowPointerDown: handleRowPointerDown,
@@ -23177,11 +23287,11 @@ function XlsxGrid({
23177
23287
  )
23178
23288
  ];
23179
23289
  }),
23180
- virtualRows.length > 0 && totalHeight - (_nullishCoalesce(_optionalChain([virtualRows, 'access', _1380 => _1380[virtualRows.length - 1], 'optionalAccess', _1381 => _1381.end]), () => ( totalHeight))) > 0 ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0,
23290
+ virtualRows.length > 0 && totalHeight - (_nullishCoalesce(_optionalChain([virtualRows, 'access', _1385 => _1385[virtualRows.length - 1], 'optionalAccess', _1386 => _1386.end]), () => ( totalHeight))) > 0 ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0,
23181
23291
  "tr",
23182
23292
  {
23183
23293
  style: {
23184
- height: totalHeight - (_nullishCoalesce(_optionalChain([virtualRows, 'access', _1382 => _1382[virtualRows.length - 1], 'optionalAccess', _1383 => _1383.end]), () => ( totalHeight)))
23294
+ height: totalHeight - (_nullishCoalesce(_optionalChain([virtualRows, 'access', _1387 => _1387[virtualRows.length - 1], 'optionalAccess', _1388 => _1388.end]), () => ( totalHeight)))
23185
23295
  },
23186
23296
  children: /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0, "td", { colSpan: rowColSpan })
23187
23297
  },
@@ -23213,7 +23323,7 @@ function XlsxGrid({
23213
23323
  PivotHeaderControls,
23214
23324
  {
23215
23325
  pivots: controller.pivotTables,
23216
- sheetName: _optionalChain([activeSheet, 'optionalAccess', _1384 => _1384.name]),
23326
+ sheetName: _optionalChain([activeSheet, 'optionalAccess', _1389 => _1389.name]),
23217
23327
  rectForCell: resolveCellDisplayRect,
23218
23328
  viewport: drawingViewport,
23219
23329
  stickyTop: stickyTopByRow,
@@ -23258,7 +23368,7 @@ function XlsxGrid({
23258
23368
  PivotGroupControls,
23259
23369
  {
23260
23370
  pivots: controller.pivotTables,
23261
- sheetName: _optionalChain([activeSheet, 'optionalAccess', _1385 => _1385.name]),
23371
+ sheetName: _optionalChain([activeSheet, 'optionalAccess', _1390 => _1390.name]),
23262
23372
  rectForCell: resolveCellDisplayRect,
23263
23373
  viewport: drawingViewport,
23264
23374
  stickyTop: stickyTopByRow,
@@ -23383,7 +23493,7 @@ function XlsxGrid({
23383
23493
  renderSelectionPopover && !secondaryRanges.length && normalizedSelection && activeCell && !isLoading && interactionMode === "idle" && !contextMenu && /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0,
23384
23494
  SelectionPopover,
23385
23495
  {
23386
- context: { cell: resolveMergeAnchorCell(activeCell), selection: normalizedSelection, sheetIndex: activeSheetIndex, sheetName: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1386 => _1386.name]), () => ( "")), readOnly },
23496
+ context: { cell: resolveMergeAnchorCell(activeCell), selection: normalizedSelection, sheetIndex: activeSheetIndex, sheetName: _nullishCoalesce(_optionalChain([activeSheet, 'optionalAccess', _1391 => _1391.name]), () => ( "")), readOnly },
23387
23497
  suspended: !!editingCell,
23388
23498
  viewportRef: scrollRef,
23389
23499
  getRects: () => {
@@ -23399,7 +23509,7 @@ function XlsxGrid({
23399
23509
  const frozenY = pane === "top" || pane === "corner";
23400
23510
  if (frozenX ? !stickyLeftByCol.has(normalizedSelection.start.col) : stickyLeftByCol.has(normalizedSelection.end.col)) return [];
23401
23511
  if (frozenY ? !stickyTopByRow.has(normalizedSelection.start.row) : stickyTopByRow.has(normalizedSelection.end.row)) return [];
23402
- const clip = _optionalChain([cellOverlayHosts, 'access', _1387 => _1387[pane], 'optionalAccess', _1388 => _1388.parentElement]);
23512
+ const clip = _optionalChain([cellOverlayHosts, 'access', _1392 => _1392[pane], 'optionalAccess', _1393 => _1393.parentElement]);
23403
23513
  const rect = clip ? visibleOverlayRect(element, clip) : null;
23404
23514
  return rect ? [rect] : [];
23405
23515
  });
@@ -23416,12 +23526,12 @@ function XlsxGrid({
23416
23526
  {
23417
23527
  editorRef: editorElementRef,
23418
23528
  overlayRef: editorOverlayRef,
23419
- clipElement: editingCell ? _optionalChain([cellOverlayHosts, 'access', _1389 => _1389[cellOverlayPaneFor(editingCell)], 'optionalAccess', _1390 => _1390.parentElement]) : null,
23529
+ clipElement: editingCell ? _optionalChain([cellOverlayHosts, 'access', _1394 => _1394[cellOverlayPaneFor(editingCell)], 'optionalAccess', _1395 => _1395.parentElement]) : null,
23420
23530
  session: cellEditorSession,
23421
23531
  render: renderCellEditorOverlay,
23422
23532
  onExit: exitEditorScope
23423
23533
  },
23424
- `${activeSheetIndex}:${_optionalChain([editingCell, 'optionalAccess', _1391 => _1391.row])}:${_optionalChain([editingCell, 'optionalAccess', _1392 => _1392.col])}`
23534
+ `${activeSheetIndex}:${_optionalChain([editingCell, 'optionalAccess', _1396 => _1396.row])}:${_optionalChain([editingCell, 'optionalAccess', _1397 => _1397.col])}`
23425
23535
  ),
23426
23536
  enableContextMenu && contextMenu && (contextMenu.sizeAxis ? /* @__PURE__ */ _chunkZ4WMURVUcjs.u.call(void 0,
23427
23537
  HeaderSizeDialog,
@@ -23429,7 +23539,7 @@ function XlsxGrid({
23429
23539
  axis: contextMenu.sizeAxis,
23430
23540
  context: contextMenu.context,
23431
23541
  sizes: contextMenu.sizeAxis === "row" ? actualRowHeights : actualColWidths,
23432
- maxSize: contextMenu.sizeAxis === "row" ? MAX_AUTOFIT_ROW_HEIGHT_PX : _optionalChain([activeSheet, 'optionalAccess', _1393 => _1393.officeLayout]) ? _chunkGP5SOQQHcjs.resolveOfficeColumnWidthPixels.call(void 0, MAX_COLUMN_WIDTH_CHARACTERS, activeSheet.officeLayout.columnDigitWidthPt) : _chunkGP5SOQQHcjs.resolveSheetColumnWidthPixels.call(void 0, MAX_COLUMN_WIDTH_CHARACTERS, _optionalChain([activeSheet, 'optionalAccess', _1394 => _1394.columnWidthCharacterWidthPx])),
23542
+ maxSize: contextMenu.sizeAxis === "row" ? MAX_AUTOFIT_ROW_HEIGHT_PX : _optionalChain([activeSheet, 'optionalAccess', _1398 => _1398.officeLayout]) ? _chunkGP5SOQQHcjs.resolveOfficeColumnWidthPixels.call(void 0, MAX_COLUMN_WIDTH_CHARACTERS, activeSheet.officeLayout.columnDigitWidthPt) : _chunkGP5SOQQHcjs.resolveSheetColumnWidthPixels.call(void 0, MAX_COLUMN_WIDTH_CHARACTERS, _optionalChain([activeSheet, 'optionalAccess', _1399 => _1399.columnWidthCharacterWidthPx])),
23433
23543
  messages,
23434
23544
  locale,
23435
23545
  palette,
@@ -23842,4 +23952,4 @@ function __createContentRoot(container) {
23842
23952
 
23843
23953
 
23844
23954
  exports.formatBinaryBytes = formatBinaryBytes; exports.XlsxFileSizeLimitExceededError = XlsxFileSizeLimitExceededError; exports.XlsxViewer = XlsxViewer2; exports.createXlsxViewer = createXlsxViewer; exports.__createControlledViewer = __createControlledViewer; exports.__createContentNode = __createContentNode; exports.__createContentRoot = __createContentRoot;
23845
- //# sourceMappingURL=chunk-DGNSB5M5.cjs.map
23955
+ //# sourceMappingURL=chunk-WW6G674Q.cjs.map