@evotecit/officeimo 0.1.3 → 0.1.4

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.
@@ -1409,13 +1409,13 @@ _modules.set("4a089607f7cbe50e13d4382d1cc4e5f6ce32c5773bbec2df84178710f54d9a38",
1409
1409
  return _exports;
1410
1410
  })();
1411
1411
 
1412
- const _m22 = _modules.get("e00bc0213b723678d050e3e1f11b39ed3d6b0b0fd6a39b403beb1a6bef69e282") ?? (() => {
1412
+ const _m22 = _modules.get("477ff98f49343b8ec4213008254b57a60dd42d07cb9843b3791d5e5f8e295865") ?? (() => {
1413
1413
  const { captureFields } = _m10;
1414
1414
 
1415
1415
  /** @internal The workbook owner captures these settings before validation or adapter merging. */
1416
1416
  const workbookOptionFields = ["signal", "onProgress", "limits", "sink", "dateMode", "compression", "invalidCharacterPolicy", "appProperties", "cellValueWriters", "oversizedText", "creator", "title", "subject", "description", "created", "modified"];
1417
1417
  /** @internal Worksheet settings also used by the portable sheet owner. */
1418
- const sheetOptionFields = ["columns", "includeHeader", "headerRows", "freezeHeader", "autoFilter", "boldHeader", "headerFill", "headerStyle", "alternatingRowStyle", "rowStyle", "cellStyle", "rowOutline", "maxOutlineLevel", "rowHeight", "headerHeight", "defaultColumnWidth", "freezeColumns", "table", "autoSize", "footer", "print", "title", "mergedCells", "hyperlinks", "conditionalFormats", "dataValidation"];
1418
+ const sheetOptionFields = ["columns", "includeHeader", "headerRows", "freezeHeader", "autoFilter", "boldHeader", "headerFill", "headerStyle", "alternatingRowStyle", "rowStyle", "cellStyle", "rowOutline", "maxOutlineLevel", "outlineSummaryBelow", "outlineSummaryRight", "columnOutlines", "rowHeight", "headerHeight", "defaultColumnWidth", "freezeColumns", "table", "autoSize", "footer", "print", "title", "mergedCells", "hyperlinks", "conditionalFormats", "dataValidation"];
1419
1419
  /** @internal Includes inherited format-specific ceilings before a wrapper combines stream settings. */
1420
1420
  const workbookLimitFields = ["maxRows", "maxCells", "maxTextCharacters", "maxOutputBytes", "maxStyles", "maxSheets", "maxOverflowCharacters", "maxHyperlinks", "maxImageBytes", "maxBufferedCells", "maxBufferedCharacters", "maxMergedRanges", "maxConditionalFormats", "maxDifferentialStyles", "maxCharts", "maxChartPoints", "maxChartTextCharacters", "maxFormulaCharacters", "maxDataValidations", "maxValidationTextCharacters"];
1421
1421
  /** @internal Capture the workbook's known ceilings without dropping supported prototype fields. */
@@ -1428,11 +1428,11 @@ function captureWorkbookOptions(options) {
1428
1428
  return { ...captured, ...(captured.limits === undefined ? {} : { limits: captureWorkbookLimits(captured.limits) }) };
1429
1429
  }
1430
1430
  const _exports = Object.freeze({ workbookOptionFields: workbookOptionFields, sheetOptionFields: sheetOptionFields, workbookLimitFields: workbookLimitFields, captureWorkbookLimits: captureWorkbookLimits, captureWorkbookOptions: captureWorkbookOptions });
1431
- _modules.set("e00bc0213b723678d050e3e1f11b39ed3d6b0b0fd6a39b403beb1a6bef69e282", _exports);
1431
+ _modules.set("477ff98f49343b8ec4213008254b57a60dd42d07cb9843b3791d5e5f8e295865", _exports);
1432
1432
  return _exports;
1433
1433
  })();
1434
1434
 
1435
- const _m15 = _modules.get("58066519dce31ad3bb7f5f5c377585d3374a84578358ad519e2c021efa1a26f8") ?? (() => {
1435
+ const _m15 = _modules.get("7b12a415e92cc9ef7212fb3a88007cb6dc37f9f30077165d4897cfa8052f9a3c") ?? (() => {
1436
1436
  const { captureFields } = _m10;
1437
1437
 
1438
1438
  const { ExportBudget } = _m9;
@@ -1473,7 +1473,7 @@ function capturePdfOptions(input = {}) {
1473
1473
  return { ...options, ...(options.limits === undefined ? {} : { limits: capturePdfLimits(options.limits) }) };
1474
1474
  }
1475
1475
  const _exports = Object.freeze({ captureCommonLimits: captureCommonLimits, mergeAdapterLimits: mergeAdapterLimits, captureXlsxOptions: captureXlsxOptions, captureCsvOptions: captureCsvOptions, capturePdfOptions: capturePdfOptions });
1476
- _modules.set("58066519dce31ad3bb7f5f5c377585d3374a84578358ad519e2c021efa1a26f8", _exports);
1476
+ _modules.set("7b12a415e92cc9ef7212fb3a88007cb6dc37f9f30077165d4897cfa8052f9a3c", _exports);
1477
1477
  return _exports;
1478
1478
  })();
1479
1479
 
@@ -2048,7 +2048,7 @@ _modules.set("699a019e0c3f317a62bf3a6e59b76b6cf1645908b0f1b1f157c18f4d4f368dfb",
2048
2048
  return _exports;
2049
2049
  })();
2050
2050
 
2051
- const _m25 = _modules.get("4d4856357f94ecbeea67d111ff5e97f916ccc6be6aaefde219d461c6ad10a8c5") ?? (() => {
2051
+ const _m25 = _modules.get("945379594834125fea38bc00f02ef077409dd15f6ed67279e63e89afe0bb944b") ?? (() => {
2052
2052
 
2053
2053
 
2054
2054
 
@@ -2126,7 +2126,16 @@ class OpcPackage {
2126
2126
  throw new OfficeIMOError("INVALID_STATE", "OPC package is finalized."); }
2127
2127
  reserve(uri, type) {
2128
2128
  this.open();
2129
+ // OPC part names become ZIP entry names. Reject oversized and deeply nested
2130
+ // names before collecting every ancestor prefix.
2131
+ if (typeof uri === "string" && uri.length > 65536)
2132
+ throw new OfficeIMOError("RESOURCE_LIMIT", "OPC part name exceeds the ZIP entry-name limit.");
2129
2133
  uri = partUri(uri);
2134
+ let depth = 0;
2135
+ for (let index = 0; index < uri.length; index++) {
2136
+ if (uri[index] === "/" && ++depth > 64)
2137
+ throw new OfficeIMOError("RESOURCE_LIMIT", "OPC part name exceeds the directory-depth limit.");
2138
+ }
2130
2139
  if (/\/_rels(?:\/|$)/i.test(uri) || uri.toLowerCase() === "/[content_types].xml")
2131
2140
  throw new TypeError("Package metadata part names are reserved.");
2132
2141
  const key = uri.toLowerCase();
@@ -2298,7 +2307,7 @@ class OpcPackage {
2298
2307
  }
2299
2308
  }
2300
2309
  const _exports = Object.freeze({ partUri: _m26.partUri, relationshipPartUri: _m26.relationshipPartUri, relativePartTarget: _m26.relativePartTarget, corePropertiesXml: _m27.corePropertiesXml, appPropertiesXml: _m27.appPropertiesXml, relationshipsNamespace: relationshipsNamespace, officeRelationshipsNamespace: officeRelationshipsNamespace, contentTypesNamespace: contentTypesNamespace, relationshipTypes: relationshipTypes, ContentTypes: ContentTypes, OpcPackage: OpcPackage });
2301
- _modules.set("4d4856357f94ecbeea67d111ff5e97f916ccc6be6aaefde219d461c6ad10a8c5", _exports);
2310
+ _modules.set("945379594834125fea38bc00f02ef077409dd15f6ed67279e63e89afe0bb944b", _exports);
2302
2311
  return _exports;
2303
2312
  })();
2304
2313
 
@@ -2751,7 +2760,7 @@ _modules.set("f1de2157d2aefa347a314940eb7f89c16545e11f69923920e605409433742f93",
2751
2760
  return _exports;
2752
2761
  })();
2753
2762
 
2754
- const _m35 = _modules.get("4bce839e90e3ef590aa1b224ffd9c4bdf24d7639b93bdf879f9a0d79de4cd0e4") ?? (() => {
2763
+ const _m35 = _modules.get("e88a83ca79cd099fc2de29689554c913c7d04b17018098f81c43044064fcdfb8") ?? (() => {
2755
2764
  const { cleanXml, escapeXml } = _m28;
2756
2765
 
2757
2766
  const { assertExportValue, assertScalar } = _m5;
@@ -2810,14 +2819,23 @@ function columnName(index) {
2810
2819
  return name;
2811
2820
  }
2812
2821
  function clipName(text, length) { return text.slice(0, length).replace(/[\ud800-\udbff]$/, ""); }
2822
+ function trimSheetNameEdges(text) {
2823
+ let start = 0, end = text.length;
2824
+ const removable = (character) => character === "'" || /\s/u.test(character);
2825
+ while (start < end && removable(text[start]))
2826
+ start++;
2827
+ while (end > start && removable(text[end - 1]))
2828
+ end--;
2829
+ return text.slice(start, end);
2830
+ }
2813
2831
  function sheetName(requested, names, policy, register = true) {
2814
2832
  if (typeof requested !== "string")
2815
2833
  throw new TypeError("Sheet name must be a string.");
2816
2834
  // Validate and deduplicate the decoded literal value, before ST_Xstring attribute encoding.
2817
2835
  // A requested _xHHHH_ token is literal text; the serializer protects its leading underscore.
2818
- let base = cleanXml(requested, policy).replace(/[\[\]:*?/\\]/g, "_").replace(/^[\s']+|[\s']+$/g, "");
2836
+ let base = trimSheetNameEdges(cleanXml(requested, policy).replace(/[\[\]:*?/\\]/g, "_"));
2819
2837
  // Clipping can expose an internal apostrophe or the reserved History name.
2820
- base = clipName(base, 31).replace(/[\s']+$/g, "");
2838
+ base = trimSheetNameEdges(clipName(base, 31));
2821
2839
  if (!base)
2822
2840
  base = "Sheet";
2823
2841
  if (base.toLowerCase() === "history")
@@ -2844,11 +2862,57 @@ function excelDate(date, mode) {
2844
2862
  return (time - Date.UTC(1899, 11, 31)) / 86400000 + (time >= Date.UTC(1900, 2, 1) ? 1 : 0);
2845
2863
  }
2846
2864
  const _exports = Object.freeze({ Cell: Cell, assertXlsxValue: assertXlsxValue, copyValue: copyValue, cellText: cellText, inlineText: inlineText, columnName: columnName, sheetName: sheetName, excelDate: excelDate });
2847
- _modules.set("4bce839e90e3ef590aa1b224ffd9c4bdf24d7639b93bdf879f9a0d79de4cd0e4", _exports);
2865
+ _modules.set("e88a83ca79cd099fc2de29689554c913c7d04b17018098f81c43044064fcdfb8", _exports);
2848
2866
  return _exports;
2849
2867
  })();
2850
2868
 
2851
- const _m39 = _modules.get("84c16159c55cf4c0af5d3c67510302694946ae99c6c685fc09314069ee3da5c5") ?? (() => {
2869
+ const _m37 = _modules.get("e92456dbf0c50db97c8b6cf9a09365489ca3a882b4d506ad4dd841805b1146d1") ?? (() => {
2870
+ const { captureFields } = _m10;
2871
+
2872
+ /** Capture bounded disjoint ranges before asynchronous serialization; absent columns stay visible. */
2873
+ function captureColumnOutlines(input, columns) {
2874
+ if (input === undefined)
2875
+ return undefined;
2876
+ if (!Array.isArray(input) || input.length > columns)
2877
+ throw new TypeError("Column outlines must be bounded, non-overlapping ranges.");
2878
+ let end = 0;
2879
+ return Object.freeze(input.map(range => {
2880
+ if (!range || typeof range !== "object")
2881
+ throw new TypeError("Column outlines require range metadata.");
2882
+ return captureFields(range, ["firstColumn", "columnCount", "level", "hidden", "collapsed"]);
2883
+ }).sort((a, b) => a.firstColumn - b.firstColumn).map(range => {
2884
+ const { firstColumn, columnCount, level = 0, hidden, collapsed } = range;
2885
+ if (!Number.isSafeInteger(firstColumn) || firstColumn < end || !Number.isSafeInteger(columnCount) || columnCount < 1 || firstColumn + columnCount > columns)
2886
+ throw new RangeError("Column outline ranges must be disjoint and within the declared columns.");
2887
+ if (!Number.isInteger(level) || level < 0 || level > 7)
2888
+ throw new RangeError("Column outline level must be from zero through seven.");
2889
+ for (const flag of [hidden, collapsed])
2890
+ if (flag !== undefined && typeof flag !== "boolean")
2891
+ throw new TypeError("Column outline flags must be booleans.");
2892
+ end = firstColumn + columnCount;
2893
+ return Object.freeze({ firstColumn, columnCount, level, ...(hidden === undefined ? {} : { hidden }), ...(collapsed === undefined ? {} : { collapsed }) });
2894
+ }));
2895
+ }
2896
+ /** @internal Positions are captured even when a sheet has only column outlines. */
2897
+ function validateOutlinePositions(options) {
2898
+ for (const flag of [options.outlineSummaryBelow, options.outlineSummaryRight])
2899
+ if (flag !== undefined && typeof flag !== "boolean")
2900
+ throw new TypeError("Outline summary positions must be booleans.");
2901
+ }
2902
+ /** @internal Resolve at most 16,384 columns once, without retaining any worksheet body. */
2903
+ function columnOutlineMap(ranges) {
2904
+ const result = new Map();
2905
+ for (const range of ranges ?? [])
2906
+ for (let index = range.firstColumn; index < range.firstColumn + range.columnCount; index++)
2907
+ result.set(index, range);
2908
+ return result;
2909
+ }
2910
+ const _exports = Object.freeze({ captureColumnOutlines: captureColumnOutlines, validateOutlinePositions: validateOutlinePositions, columnOutlineMap: columnOutlineMap });
2911
+ _modules.set("e92456dbf0c50db97c8b6cf9a09365489ca3a882b4d506ad4dd841805b1146d1", _exports);
2912
+ return _exports;
2913
+ })();
2914
+
2915
+ const _m40 = _modules.get("aaf6808e1812a251687fd513480fe845b5677ffa493bccf519409807fe4d250c") ?? (() => {
2852
2916
  const { ChunkedTextSink } = _m3;
2853
2917
 
2854
2918
  const { escapeXml, xmlDeclaration } = _m28;
@@ -2957,18 +3021,18 @@ async function writeChartXml(chart, destination, policy, signal) {
2957
3021
  await text.close();
2958
3022
  }
2959
3023
  const _exports = Object.freeze({ chartNamespace: chartNamespace, chartContentType: chartContentType, chartAnchorXml: chartAnchorXml, writeChartXml: writeChartXml });
2960
- _modules.set("84c16159c55cf4c0af5d3c67510302694946ae99c6c685fc09314069ee3da5c5", _exports);
3024
+ _modules.set("aaf6808e1812a251687fd513480fe845b5677ffa493bccf519409807fe4d250c", _exports);
2961
3025
  return _exports;
2962
3026
  })();
2963
3027
 
2964
- const _m38 = _modules.get("9d4496a1ff3d58ac0b9dcd7304e6861184df30700c344329157899639df7b5e4") ?? (() => {
3028
+ const _m39 = _modules.get("d599dca57105b9cc787ba2498051ed0193cbdb1e5f23116e35bc77cd67a233f1") ?? (() => {
2965
3029
  const { cleanXml, escapeXml, escapeOoxmlAttribute, xmlDeclaration } = _m28;
2966
3030
 
2967
3031
  const { copyExportLink } = _m7;
2968
3032
 
2969
3033
  const { officeRelationshipsNamespace } = _m25;
2970
3034
 
2971
- const { chartAnchorXml } = _m39;
3035
+ const { chartAnchorXml } = _m40;
2972
3036
 
2973
3037
  const { captureFields } = _m10;
2974
3038
 
@@ -3035,14 +3099,14 @@ function drawingXml(images, policy, charts = []) {
3035
3099
  }
3036
3100
  const drawingContentType = "application/vnd.openxmlformats-officedocument.drawing+xml";
3037
3101
  const _exports = Object.freeze({ copyDrawingAnchor: copyDrawingAnchor, cellPosition: cellPosition, copyHyperlink: copyHyperlink, copyImage: copyImage, hyperlinksXml: hyperlinksXml, drawingXml: drawingXml, drawingContentType: drawingContentType });
3038
- _modules.set("9d4496a1ff3d58ac0b9dcd7304e6861184df30700c344329157899639df7b5e4", _exports);
3102
+ _modules.set("d599dca57105b9cc787ba2498051ed0193cbdb1e5f23116e35bc77cd67a233f1", _exports);
3039
3103
  return _exports;
3040
3104
  })();
3041
3105
 
3042
- const _m41 = _modules.get("4c91e257806f805b473340527db7ce3404c98ac27db0a775ff047dc3dded10cc") ?? (() => {
3106
+ const _m42 = _modules.get("39155eb25a58694b2caf100529b6c13dbe91f583741807b46232a2a567e19ecb") ?? (() => {
3043
3107
  const { OfficeIMOError } = _m2;
3044
3108
 
3045
- const { cellPosition } = _m38;
3109
+ const { cellPosition } = _m39;
3046
3110
 
3047
3111
  function indexRows(regions) {
3048
3112
  if (!regions.length)
@@ -3140,11 +3204,11 @@ class MergeRegions {
3140
3204
  throw new RangeError("Merged ranges must stay within exported rows."); }
3141
3205
  }
3142
3206
  const _exports = Object.freeze({ MergeRegions: MergeRegions });
3143
- _modules.set("4c91e257806f805b473340527db7ce3404c98ac27db0a775ff047dc3dded10cc", _exports);
3207
+ _modules.set("39155eb25a58694b2caf100529b6c13dbe91f583741807b46232a2a567e19ecb", _exports);
3144
3208
  return _exports;
3145
3209
  })();
3146
3210
 
3147
- const _m42 = _modules.get("47efdc8f108b0e995accdd63fd1addea0e4de507010cbf0975417e7151636360") ?? (() => {
3211
+ const _m43 = _modules.get("2a51a034ac74f5a0656731f46740bb80adee48101e7a4b51253d9399df11d238") ?? (() => {
3148
3212
  const { ExportCell } = _m5;
3149
3213
 
3150
3214
  const { tableSpans } = _m18;
@@ -3177,11 +3241,11 @@ class StructuredRows {
3177
3241
  }
3178
3242
  }
3179
3243
  const _exports = Object.freeze({ StructuredRows: StructuredRows });
3180
- _modules.set("47efdc8f108b0e995accdd63fd1addea0e4de507010cbf0975417e7151636360", _exports);
3244
+ _modules.set("2a51a034ac74f5a0656731f46740bb80adee48101e7a4b51253d9399df11d238", _exports);
3181
3245
  return _exports;
3182
3246
  })();
3183
3247
 
3184
- const _m40 = _modules.get("23615ba776e7025e5e40cde325ad13799a7eeae6c88cb2ed74395222f91e6a81") ?? (() => {
3248
+ const _m41 = _modules.get("b732883d8635c0adf27cef2a3900f08374d02c9ce1b005d02af6853c8be627cc") ?? (() => {
3185
3249
  const { ExportCell } = _m5;
3186
3250
 
3187
3251
  const { isDate } = _m6;
@@ -3192,13 +3256,13 @@ const { FormulaCell } = _m36;
3192
3256
 
3193
3257
  const { escapeOoxmlAttribute } = _m28;
3194
3258
 
3195
- const { MergeRegions } = _m41;
3259
+ const { MergeRegions } = _m42;
3196
3260
 
3197
3261
  const { OfficeIMOError } = _m2;
3198
3262
 
3199
3263
  const { createTotals } = _m12;
3200
3264
 
3201
- const { StructuredRows } = _m42;
3265
+ const { StructuredRows } = _m43;
3202
3266
 
3203
3267
  /** @internal A computed formula with a numeric cache; no public arbitrary-formula input. */
3204
3268
  class ComputedTotal {
@@ -3378,11 +3442,11 @@ function printXml(options, policy) {
3378
3442
  (options.footer === undefined ? "" : '<oddFooter>' + escapeOoxmlAttribute("&C" + options.footer.replace(/&/g, "&&"), policy) + '</oddFooter>') + '</headerFooter>' : "");
3379
3443
  }
3380
3444
  const _exports = Object.freeze({ ComputedTotal: ComputedTotal, ReportLayout: ReportLayout, totalFormula: totalFormula, printXml: printXml });
3381
- _modules.set("23615ba776e7025e5e40cde325ad13799a7eeae6c88cb2ed74395222f91e6a81", _exports);
3445
+ _modules.set("b732883d8635c0adf27cef2a3900f08374d02c9ce1b005d02af6853c8be627cc", _exports);
3382
3446
  return _exports;
3383
3447
  })();
3384
3448
 
3385
- const _m44 = _modules.get("7845d79cd22590bbefc767802abfe3f805e8f68807521cef8d07ecc42db0b491") ?? (() => {
3449
+ const _m45 = _modules.get("09d589ff8f82302ce4c17411c7b811a87fb034e61e4b3013b7f8b18853a90449") ?? (() => {
3386
3450
  const { columnName } = _m35;
3387
3451
 
3388
3452
  /** @internal Data-column selectors use stable keys or one-based worksheet columns. */
@@ -3409,11 +3473,11 @@ function qualifiedCell(sheetName, column, row) {
3409
3473
  return qualifiedColumnRange(sheetName, column, row, 1).split(":")[0];
3410
3474
  }
3411
3475
  const _exports = Object.freeze({ resolveDataColumn: resolveDataColumn, qualifiedColumnRange: qualifiedColumnRange, qualifiedCell: qualifiedCell });
3412
- _modules.set("7845d79cd22590bbefc767802abfe3f805e8f68807521cef8d07ecc42db0b491", _exports);
3476
+ _modules.set("09d589ff8f82302ce4c17411c7b811a87fb034e61e4b3013b7f8b18853a90449", _exports);
3413
3477
  return _exports;
3414
3478
  })();
3415
3479
 
3416
- const _m45 = _modules.get("4892a7dafefc4d82567cd2bd4cc8da5470cee4dbf546e6473f782f44bd4bbe35") ?? (() => {
3480
+ const _m46 = _modules.get("55a9bd1fb59ea19bf98a03859769a119fdc71a44075e560937e7184720e53514") ?? (() => {
3417
3481
  const { OfficeIMOError } = _m2;
3418
3482
 
3419
3483
  const { columnName } = _m35;
@@ -3456,22 +3520,22 @@ function dataRowReference(firstColumn, lastColumn, headerRows, dataRows, ranges)
3456
3520
  return reference || undefined;
3457
3521
  }
3458
3522
  const _exports = Object.freeze({ retainDataRowRanges: retainDataRowRanges, dataRowRanges: dataRowRanges, dataRowCount: dataRowCount, dataRowReference: dataRowReference });
3459
- _modules.set("4892a7dafefc4d82567cd2bd4cc8da5470cee4dbf546e6473f782f44bd4bbe35", _exports);
3523
+ _modules.set("55a9bd1fb59ea19bf98a03859769a119fdc71a44075e560937e7184720e53514", _exports);
3460
3524
  return _exports;
3461
3525
  })();
3462
3526
 
3463
- const _m43 = _modules.get("736b2b2fc3489642263dbaf677544e8a270eea6b8efb0cc26c67346e66cab118") ?? (() => {
3527
+ const _m44 = _modules.get("a1b616256344317787b0b102f35d062009d6a2e9c873b9f106c99c095c92ace3") ?? (() => {
3464
3528
  const { cleanXml, escapeXml, escapeOoxmlAttribute } = _m28;
3465
3529
 
3466
- const { cellPosition } = _m38;
3530
+ const { cellPosition } = _m39;
3467
3531
 
3468
3532
  const { colorArgb } = _m33;
3469
3533
 
3470
3534
  const { fields, optionalBoolean, differentialXml } = _m34;
3471
3535
 
3472
- const { resolveDataColumn } = _m44;
3536
+ const { resolveDataColumn } = _m45;
3473
3537
 
3474
- const { dataRowReference } = _m45;
3538
+ const { dataRowReference } = _m46;
3475
3539
 
3476
3540
  function target(range, columns) {
3477
3541
  if (typeof range === "string") {
@@ -3626,11 +3690,11 @@ class ConditionalFormats {
3626
3690
  }
3627
3691
  }
3628
3692
  const _exports = Object.freeze({ prepareConditionalFormats: prepareConditionalFormats, ConditionalFormats: ConditionalFormats });
3629
- _modules.set("736b2b2fc3489642263dbaf677544e8a270eea6b8efb0cc26c67346e66cab118", _exports);
3693
+ _modules.set("a1b616256344317787b0b102f35d062009d6a2e9c873b9f106c99c095c92ace3", _exports);
3630
3694
  return _exports;
3631
3695
  })();
3632
3696
 
3633
- const _m46 = _modules.get("860c88d97ba76e8713c14d56967152e369d2f08f50ffada68827a9c220881c61") ?? (() => {
3697
+ const _m47 = _modules.get("13fa96d976e4dec7343dd3a392829567f1fcb574324a98f5a5d3a61c9a0dc27d") ?? (() => {
3634
3698
  const { OfficeIMOError } = _m2;
3635
3699
 
3636
3700
  const { checkAbort } = _m4;
@@ -3639,9 +3703,9 @@ const { cleanXml, escapeOoxmlAttribute, escapeXml } = _m28;
3639
3703
 
3640
3704
  const { fields, optionalBoolean } = _m34;
3641
3705
 
3642
- const { resolveDataColumn } = _m44;
3706
+ const { resolveDataColumn } = _m45;
3643
3707
 
3644
- const { dataRowReference } = _m45;
3708
+ const { dataRowReference } = _m46;
3645
3709
 
3646
3710
  function message(value, maximum, name) {
3647
3711
  if (value === undefined)
@@ -3730,11 +3794,11 @@ function* dataValidationsXml(prepared, headerRows, dataRows, ranges) {
3730
3794
  yield '</dataValidations>';
3731
3795
  }
3732
3796
  const _exports = Object.freeze({ prepareDataValidations: prepareDataValidations, dataValidationsXml: dataValidationsXml });
3733
- _modules.set("860c88d97ba76e8713c14d56967152e369d2f08f50ffada68827a9c220881c61", _exports);
3797
+ _modules.set("13fa96d976e4dec7343dd3a392829567f1fcb574324a98f5a5d3a61c9a0dc27d", _exports);
3734
3798
  return _exports;
3735
3799
  })();
3736
3800
 
3737
- const _m37 = _modules.get("b99287e3e329b75007119103112a699c368d8237b37fa79e083b0014a21952e4") ?? (() => {
3801
+ const _m38 = _modules.get("a61e744201bb537b635b367b1764bd85892101d55e00b8c78faec8be89577376") ?? (() => {
3738
3802
  const { checkAbort, consumeRows, inputRows, pause, taskYieldDue } = _m4;
3739
3803
 
3740
3804
  const { ChunkedTextSink, BlobByteSink } = _m3;
@@ -3755,25 +3819,27 @@ const { Cell, cellText, columnName, inlineText, excelDate, copyValue } = _m35;
3755
3819
 
3756
3820
  const { spreadsheetNamespace, colorArgb, validateStylePatch, copyStylePatch } = _m32;
3757
3821
 
3758
- const { copyHyperlink, copyImage, hyperlinksXml, cellPosition } = _m38;
3822
+ const { copyHyperlink, copyImage, hyperlinksXml, cellPosition } = _m39;
3759
3823
 
3760
3824
  const { ExportCell, assertScalar } = _m5;
3761
3825
 
3762
- const { ReportLayout, ComputedTotal, printXml } = _m40;
3826
+ const { ReportLayout, ComputedTotal, printXml } = _m41;
3763
3827
 
3764
3828
  const { cleanXml } = _m28;
3765
3829
 
3766
- const { ConditionalFormats, prepareConditionalFormats } = _m43;
3830
+ const { ConditionalFormats, prepareConditionalFormats } = _m44;
3767
3831
 
3768
3832
  const { isDate } = _m6;
3769
3833
 
3770
3834
  const { FormulaCell, formulaXml, isSubtotalFormula } = _m36;
3771
3835
 
3772
- const { prepareDataValidations, dataValidationsXml } = _m46;
3836
+ const { prepareDataValidations, dataValidationsXml } = _m47;
3773
3837
 
3774
- const { qualifiedCell, qualifiedColumnRange, resolveDataColumn } = _m44;
3838
+ const { qualifiedCell, qualifiedColumnRange, resolveDataColumn } = _m45;
3775
3839
 
3776
- const { dataRowRanges, dataRowCount } = _m45;
3840
+ const { dataRowRanges, dataRowCount } = _m46;
3841
+
3842
+ const { captureColumnOutlines, columnOutlineMap, validateOutlinePositions } = _m37;
3777
3843
 
3778
3844
  const maximumHyperlinks = 65530;
3779
3845
  function checkHyperlinkCount(count) {
@@ -3905,6 +3971,8 @@ class Worksheet {
3905
3971
  throw new TypeError("Row and style callbacks must be functions.");
3906
3972
  if (options.maxOutlineLevel !== undefined && (!Number.isInteger(options.maxOutlineLevel) || options.maxOutlineLevel < 0 || options.maxOutlineLevel > 7))
3907
3973
  throw new RangeError("Maximum outline level must be an integer from zero through seven.");
3974
+ validateOutlinePositions(options);
3975
+ captureColumnOutlines(options.columnOutlines, columns.length);
3908
3976
  if (options.rowOutline && options.maxOutlineLevel === undefined)
3909
3977
  throw new TypeError("A row outline callback requires maxOutlineLevel before streamed rows are written.");
3910
3978
  if (!options.rowOutline && options.maxOutlineLevel !== undefined)
@@ -4189,17 +4257,22 @@ class Worksheet {
4189
4257
  const buffer = this.buffer = new ChunkedTextSink(this.entry, this.book.settings.signal), opts = this.options;
4190
4258
  const x = opts.freezeColumns ?? 0, y = opts.freezeHeader ? this.headerRows : 0;
4191
4259
  const pane = x && y ? "bottomRight" : x ? "topRight" : "bottomLeft", cell = columnName(x + 1) + (y + 1);
4260
+ const outlines = columnOutlineMap(opts.columnOutlines), hasOutline = !!opts.rowOutline || outlines.size > 0;
4261
+ const maxColumnLevel = Math.max(0, ...Array.from(outlines.values(), value => value.level ?? 0));
4192
4262
  await buffer.write(xmlDeclaration + '<worksheet xmlns="' + spreadsheetNamespace + '" xmlns:r="' + officeRelationshipsNamespace + '">' +
4193
- (opts.print || opts.rowOutline ? '<sheetPr>' + (opts.rowOutline ? '<outlinePr summaryBelow="1" showOutlineSymbols="1"/>' : "") + (opts.print ? '<pageSetUpPr fitToPage="1"/>' : "") + '</sheetPr>' : "") + '<sheetViews><sheetView workbookViewId="0">' +
4263
+ (opts.print || hasOutline ? '<sheetPr>' + (hasOutline ? '<outlinePr summaryBelow="' + (opts.outlineSummaryBelow === false ? "0" : "1") + '"' + (opts.outlineSummaryRight === undefined ? "" : ' summaryRight="' + (opts.outlineSummaryRight ? "1" : "0") + '"') + ' showOutlineSymbols="1"/>' : "") + (opts.print ? '<pageSetUpPr fitToPage="1"/>' : "") + '</sheetPr>' : "") + '<sheetViews><sheetView workbookViewId="0">' +
4194
4264
  (x || y ? '<pane' + (x ? ' xSplit="' + x + '"' : "") + (y ? ' ySplit="' + y + '"' : "") + ' topLeftCell="' + cell + '" activePane="' + pane + '" state="frozen"/><selection pane="' + pane + '" activeCell="' + cell + '" sqref="' + cell + '"/>' : "") + '</sheetView></sheetViews>' +
4195
- (opts.rowOutline ? '<sheetFormatPr defaultRowHeight="15" outlineLevelRow="' + opts.maxOutlineLevel + '"/>' : ""));
4265
+ (hasOutline ? '<sheetFormatPr defaultRowHeight="15"' + (opts.rowOutline ? ' outlineLevelRow="' + opts.maxOutlineLevel + '"' : "") + (outlines.size ? ' outlineLevelCol="' + maxColumnLevel + '"' : "") + '/>' : ""));
4196
4266
  const defaultWidth = opts.defaultColumnWidth ?? (this.table ? 20 : undefined);
4197
- if (this.columns.some((_, i) => this.layout.widths[i] !== undefined || defaultWidth !== undefined)) {
4267
+ if (this.columns.some((_, i) => this.layout.widths[i] !== undefined || defaultWidth !== undefined || outlines.has(i))) {
4198
4268
  await buffer.write('<cols>');
4199
4269
  for (let i = 0; i < this.columns.length; i++) {
4200
- const width = this.layout.widths[i] ?? defaultWidth;
4201
- if (width !== undefined)
4202
- await buffer.write('<col min="' + (i + 1) + '" max="' + (i + 1) + '" width="' + width + '" customWidth="1"/>');
4270
+ const width = this.layout.widths[i] ?? defaultWidth, outline = outlines.get(i);
4271
+ if (width !== undefined || outline)
4272
+ await buffer.write('<col min="' + (i + 1) + '" max="' + (i + 1) + '"' +
4273
+ (width === undefined ? "" : ' width="' + width + '" customWidth="1"') +
4274
+ (outline?.level ? ' outlineLevel="' + outline.level + '"' : "") + (outline?.hidden ? ' hidden="1"' : "") +
4275
+ (outline?.collapsed ? ' collapsed="1"' : "") + '/>');
4203
4276
  }
4204
4277
  await buffer.write('</cols>');
4205
4278
  }
@@ -4457,11 +4530,11 @@ class Worksheet {
4457
4530
  async discard(error) { this.failed = true; this.error = error; this.pending = []; this.pendingCharacters = 0; this.prepared = undefined; this.buffer = undefined; this.nativeCharts.length = 0; this.chartSources.length = 0; this.output.discard(); await this.entry?.discard(error); }
4458
4531
  }
4459
4532
  const _exports = Object.freeze({ Worksheet: Worksheet });
4460
- _modules.set("b99287e3e329b75007119103112a699c368d8237b37fa79e083b0014a21952e4", _exports);
4533
+ _modules.set("a61e744201bb537b635b367b1764bd85892101d55e00b8c78faec8be89577376", _exports);
4461
4534
  return _exports;
4462
4535
  })();
4463
4536
 
4464
- const _m47 = _modules.get("7f1b6bb321e8055ba5269c0fe0933cf02f9a4ce269d3b8e4a64cc63d8398954a") ?? (() => {
4537
+ const _m48 = _modules.get("1b4698baf9a9c9b3505988abac9f83967c32cf37483d70a949ae89c4485532a4") ?? (() => {
4465
4538
  const { escapeOoxmlAttribute, escapeXml, xmlDeclaration } = _m28;
4466
4539
 
4467
4540
  const { cellText, columnName } = _m35;
@@ -4472,7 +4545,7 @@ const { ExportCell } = _m5;
4472
4545
 
4473
4546
  const { Cell } = _m35;
4474
4547
 
4475
- const { totalFormula } = _m40;
4548
+ const { totalFormula } = _m41;
4476
4549
 
4477
4550
  function defineTable(id, options, columns, policy) {
4478
4551
  const name = options.name ?? "Table" + id;
@@ -4504,11 +4577,11 @@ function tableXml(table, rowCount, policy, headerRow = 1, footer) {
4504
4577
  '" showColumnStripes="' + (options.bandedColumns ? 1 : 0) + '"/></table>';
4505
4578
  }
4506
4579
  const _exports = Object.freeze({ defineTable: defineTable, tableXml: tableXml });
4507
- _modules.set("7f1b6bb321e8055ba5269c0fe0933cf02f9a4ce269d3b8e4a64cc63d8398954a", _exports);
4580
+ _modules.set("1b4698baf9a9c9b3505988abac9f83967c32cf37483d70a949ae89c4485532a4", _exports);
4508
4581
  return _exports;
4509
4582
  })();
4510
4583
 
4511
- const _m48 = _modules.get("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92") ?? (() => {
4584
+ const _m49 = _modules.get("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92") ?? (() => {
4512
4585
  const { OfficeIMOError } = _m2;
4513
4586
 
4514
4587
  const { cleanXml } = _m28;
@@ -4576,7 +4649,7 @@ _modules.set("0c395783b9d7cc62dd39a21adeb698ad4a61e2c89f7b1fc8712e2eb2ccfe9d92",
4576
4649
  return _exports;
4577
4650
  })();
4578
4651
 
4579
- const _m50 = _modules.get("35db01801a6b2e3e0c5acd7493e56f04b5b41b1d57afa8be28b8358378ad6494") ?? (() => {
4652
+ const _m51 = _modules.get("35db01801a6b2e3e0c5acd7493e56f04b5b41b1d57afa8be28b8358378ad6494") ?? (() => {
4580
4653
  const { checkAbort } = _m4;
4581
4654
 
4582
4655
  const { NotSupportedError, OfficeIMOError } = _m2;
@@ -4708,18 +4781,18 @@ _modules.set("35db01801a6b2e3e0c5acd7493e56f04b5b41b1d57afa8be28b8358378ad6494",
4708
4781
  return _exports;
4709
4782
  })();
4710
4783
 
4711
- const _m49 = _modules.get("6ff482aba6cf0b524cf20f6a4f8af16b842a49f36448b14e73beaf838885d219") ?? (() => {
4784
+ const _m50 = _modules.get("24f1417c3c320a8a41137c28f70b72091256c63010be0c88b684dce85f54950c") ?? (() => {
4712
4785
  const { checkAbort } = _m4;
4713
4786
 
4714
4787
  const { NotSupportedError, OfficeIMOError } = _m2;
4715
4788
 
4716
4789
  const { cleanXml } = _m28;
4717
4790
 
4718
- const { copyDrawingAnchor } = _m38;
4791
+ const { copyDrawingAnchor } = _m39;
4719
4792
 
4720
4793
  const { captureFields } = _m10;
4721
4794
 
4722
- const { captureChartRange, prepareChartBinding } = _m50;
4795
+ const { captureChartRange, prepareChartBinding } = _m51;
4723
4796
 
4724
4797
  function fields(value, allowed, context) {
4725
4798
  if (!value || typeof value !== "object" || Array.isArray(value))
@@ -4875,11 +4948,11 @@ function prepareChart(input, policy, availablePoints, availableText, signal, res
4875
4948
  points, textCharacters });
4876
4949
  }
4877
4950
  const _exports = Object.freeze({ prepareChart: prepareChart });
4878
- _modules.set("6ff482aba6cf0b524cf20f6a4f8af16b842a49f36448b14e73beaf838885d219", _exports);
4951
+ _modules.set("24f1417c3c320a8a41137c28f70b72091256c63010be0c88b684dce85f54950c", _exports);
4879
4952
  return _exports;
4880
4953
  })();
4881
4954
 
4882
- const _m24 = _modules.get("0f11efc0d52501e827898643b33f7fa42365115a892aa801634ecea3f3603681") ?? (() => {
4955
+ const _m24 = _modules.get("e89ecd2f5e1738c6e88f72ac2bcac70dfaa81b4aa86edf333e9b395cf2212e2a") ?? (() => {
4883
4956
  const { beginTask, checkAbort, pause, taskYieldDue } = _m4;
4884
4957
 
4885
4958
  const { OfficeIMOError } = _m2;
@@ -4902,25 +4975,27 @@ const { copyColumns } = _m11;
4902
4975
 
4903
4976
  const { captureFields } = _m10;
4904
4977
 
4978
+ const { captureColumnOutlines } = _m37;
4979
+
4905
4980
  const { captureTableSpans } = _m18;
4906
4981
 
4907
4982
  const { assertExportValue } = _m5;
4908
4983
 
4909
- const { Worksheet } = _m37;
4984
+ const { Worksheet } = _m38;
4910
4985
 
4911
- const { defineTable, tableXml } = _m47;
4986
+ const { defineTable, tableXml } = _m48;
4912
4987
 
4913
- const { copyHyperlink, drawingXml, drawingContentType } = _m38;
4988
+ const { copyHyperlink, drawingXml, drawingContentType } = _m39;
4914
4989
 
4915
- const { TextOverflow } = _m48;
4990
+ const { TextOverflow } = _m49;
4916
4991
 
4917
4992
  const { captureWorkbookOptions, sheetOptionFields } = _m22;
4918
4993
 
4919
- const { prepareChart } = _m49;
4994
+ const { prepareChart } = _m50;
4920
4995
 
4921
- const { qualifiedColumnRange, resolveDataColumn } = _m44;
4996
+ const { qualifiedColumnRange, resolveDataColumn } = _m45;
4922
4997
 
4923
- const { chartContentType, writeChartXml } = _m39;
4998
+ const { chartContentType, writeChartXml } = _m40;
4924
4999
 
4925
5000
  const xlsxMime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
4926
5001
  const formatType = (name) => "application/vnd.openxmlformats-officedocument.spreadsheetml." + name + "+xml";
@@ -4931,6 +5006,7 @@ function captureSheet(options, policy) {
4931
5006
  const footer = captured.footer && captureFields(captured.footer, ["rows", "values", "totals", "style"]);
4932
5007
  const print = captured.print && captureFields(captured.print, ["paper", "orientation", "fitToWidth", "fitToHeight", "repeatHeaders", "margins", "header", "footer"]);
4933
5008
  return { ...captured, columns,
5009
+ ...(captured.columnOutlines === undefined ? {} : { columnOutlines: captureColumnOutlines(captured.columnOutlines, columns.length) }),
4934
5010
  ...(captured.headerRows === undefined ? {} : { headerRows: captureTableSpans(captured.headerRows, columns.length) }),
4935
5011
  ...(footer ? { footer: { ...footer,
4936
5012
  ...(footer.rows === undefined ? {} : { rows: captureTableSpans(footer.rows, columns.length) }),
@@ -5357,11 +5433,11 @@ class Workbook {
5357
5433
  }
5358
5434
  }
5359
5435
  const _exports = Object.freeze({ Workbook: Workbook });
5360
- _modules.set("0f11efc0d52501e827898643b33f7fa42365115a892aa801634ecea3f3603681", _exports);
5436
+ _modules.set("e89ecd2f5e1738c6e88f72ac2bcac70dfaa81b4aa86edf333e9b395cf2212e2a", _exports);
5361
5437
  return _exports;
5362
5438
  })();
5363
5439
 
5364
- const _m52 = _modules.get("89111eab1f3857529c2d0cd849f16598097e62bd73841211b9c66ccc7b1b7ca2") ?? (() => {
5440
+ const _m53 = _modules.get("a10003e971cd5ec2cee127bc9b029a0aa06fe3d50112838929d7a04a55e177c0") ?? (() => {
5365
5441
  const { ExportCell, assertScalar } = _m5;
5366
5442
 
5367
5443
  const { captureWorkbookOptions, sheetOptionFields } = _m22;
@@ -5410,18 +5486,18 @@ function portableWorkbook(options = {}) {
5410
5486
  return { ...options, cellValueWriters: wrapped };
5411
5487
  }
5412
5488
  const _exports = Object.freeze({ portableSheet: portableSheet, portableWorkbook: portableWorkbook });
5413
- _modules.set("89111eab1f3857529c2d0cd849f16598097e62bd73841211b9c66ccc7b1b7ca2", _exports);
5489
+ _modules.set("a10003e971cd5ec2cee127bc9b029a0aa06fe3d50112838929d7a04a55e177c0", _exports);
5414
5490
  return _exports;
5415
5491
  })();
5416
5492
 
5417
- const _m51 = _modules.get("8d425cd3abec2c5e0140f71239bbeacbae0e57524ed70a8e545f80286c4a1308") ?? (() => {
5493
+ const _m52 = _modules.get("5bfd5c9c5e179305b9bebd6cb0d6a0d75e974b223e119e0fd4fbb773325f1e63") ?? (() => {
5418
5494
  const { withDestination } = _m3;
5419
5495
 
5420
5496
  const { copyColumns } = _m11;
5421
5497
 
5422
5498
  const { Workbook } = _m24;
5423
5499
 
5424
- const { portableSheet, portableWorkbook } = _m52;
5500
+ const { portableSheet, portableWorkbook } = _m53;
5425
5501
 
5426
5502
  const { captureFields } = _m10;
5427
5503
 
@@ -5469,11 +5545,11 @@ async function writeXlsxTo(rows, destination, configuration) {
5469
5545
  });
5470
5546
  }
5471
5547
  const _exports = Object.freeze({ writeXlsx: writeXlsx, writeXlsxTo: writeXlsxTo });
5472
- _modules.set("8d425cd3abec2c5e0140f71239bbeacbae0e57524ed70a8e545f80286c4a1308", _exports);
5548
+ _modules.set("5bfd5c9c5e179305b9bebd6cb0d6a0d75e974b223e119e0fd4fbb773325f1e63", _exports);
5473
5549
  return _exports;
5474
5550
  })();
5475
5551
 
5476
- const _m54 = _modules.get("02f1b8fe9368420b22d79efc01f2b37794fc40aaf8150161b3b7623fcdc0d71f") ?? (() => {
5552
+ const _m55 = _modules.get("dd34d5fd89869a0f953f3f2b3fd27ac83be29e68f76c9087fae3d33095aeda7c") ?? (() => {
5477
5553
  const { assertGroupedReportSource } = _m8;
5478
5554
 
5479
5555
  const { captureFields } = _m10;
@@ -5484,9 +5560,9 @@ const { fields } = _m34;
5484
5560
 
5485
5561
  const { sheetOptionFields } = _m22;
5486
5562
 
5487
- const { portableSheet } = _m52;
5563
+ const { portableSheet } = _m53;
5488
5564
 
5489
- const { resolveDataColumn } = _m44;
5565
+ const { resolveDataColumn } = _m45;
5490
5566
 
5491
5567
  const { copyStylePatch } = _m32;
5492
5568
 
@@ -5562,11 +5638,11 @@ function prepareGroupedSheet(report, configuration, maxConditionalFormats = 1000
5562
5638
  ...(options.grandTotalStyle ? { grandTotalStyle: copyStylePatch(options.grandTotalStyle) } : {}) };
5563
5639
  }
5564
5640
  const _exports = Object.freeze({ groupedOptionFields: groupedOptionFields, prepareGroupedSheet: prepareGroupedSheet });
5565
- _modules.set("02f1b8fe9368420b22d79efc01f2b37794fc40aaf8150161b3b7623fcdc0d71f", _exports);
5641
+ _modules.set("dd34d5fd89869a0f953f3f2b3fd27ac83be29e68f76c9087fae3d33095aeda7c", _exports);
5566
5642
  return _exports;
5567
5643
  })();
5568
5644
 
5569
- const _m53 = _modules.get("6b646c4d57b8f8f452eaa7e61d2935bab09681aceb6064b8600bf73ca10b8f4e") ?? (() => {
5645
+ const _m54 = _modules.get("2ba62cdf88d559804bb84b20e9816b2de0f232401b7431ac414699a607d554a4") ?? (() => {
5570
5646
  const { groupedReportOperation } = _m8;
5571
5647
 
5572
5648
  const { checkAbort, withAbort } = _m4;
@@ -5583,9 +5659,9 @@ const { columnName } = _m35;
5583
5659
 
5584
5660
  const { captureWorkbookLimits, workbookOptionFields } = _m22;
5585
5661
 
5586
- const { retainDataRowRanges } = _m45;
5662
+ const { retainDataRowRanges } = _m46;
5587
5663
 
5588
- const { groupedOptionFields, prepareGroupedSheet } = _m54;
5664
+ const { groupedOptionFields, prepareGroupedSheet } = _m55;
5589
5665
 
5590
5666
  const subtotalOperations = { average: 1, count: 2, max: 4, min: 5, sum: 9 };
5591
5667
  function label(value) {
@@ -5739,18 +5815,18 @@ async function writeGroupedXlsxTo(report, destination, options) {
5739
5815
  return withDestination(destination, async (sink) => (await write(report, prepared, sink)).result);
5740
5816
  }
5741
5817
  const _exports = Object.freeze({ addGroupedXlsx: addGroupedXlsx, writeGroupedXlsx: writeGroupedXlsx, writeGroupedXlsxTo: writeGroupedXlsxTo });
5742
- _modules.set("6b646c4d57b8f8f452eaa7e61d2935bab09681aceb6064b8600bf73ca10b8f4e", _exports);
5818
+ _modules.set("2ba62cdf88d559804bb84b20e9816b2de0f232401b7431ac414699a607d554a4", _exports);
5743
5819
  return _exports;
5744
5820
  })();
5745
5821
 
5746
- const _m23 = _modules.get("9fbdb5c6f6af75d87ac6cb47771fe48fa6527be2cb7d16dbad56e4213e2f7195") ?? (() => {
5822
+ const _m23 = _modules.get("d6587a933b36ccfdba9a2a252389924ac8461f672b3a500082cceb5e53c8b0b6") ?? (() => {
5747
5823
 
5748
- const _exports = Object.freeze({ Workbook: _m24.Workbook, writeXlsx: _m51.writeXlsx, writeXlsxTo: _m51.writeXlsxTo, writeGroupedXlsx: _m53.writeGroupedXlsx, writeGroupedXlsxTo: _m53.writeGroupedXlsxTo, addGroupedXlsx: _m53.addGroupedXlsx, createGroupedReport: _m8.createGroupedReport, Worksheet: _m37.Worksheet, Cell: _m35.Cell, FormulaCell: _m36.FormulaCell, StyleRegistry: _m32.StyleRegistry, NumberFormats: _m32.NumberFormats, saveBlob: _m1.saveBlob, ExportCell: _m5.ExportCell });
5749
- _modules.set("9fbdb5c6f6af75d87ac6cb47771fe48fa6527be2cb7d16dbad56e4213e2f7195", _exports);
5824
+ const _exports = Object.freeze({ Workbook: _m24.Workbook, writeXlsx: _m52.writeXlsx, writeXlsxTo: _m52.writeXlsxTo, writeGroupedXlsx: _m54.writeGroupedXlsx, writeGroupedXlsxTo: _m54.writeGroupedXlsxTo, addGroupedXlsx: _m54.addGroupedXlsx, createGroupedReport: _m8.createGroupedReport, Worksheet: _m38.Worksheet, Cell: _m35.Cell, FormulaCell: _m36.FormulaCell, StyleRegistry: _m32.StyleRegistry, NumberFormats: _m32.NumberFormats, saveBlob: _m1.saveBlob, ExportCell: _m5.ExportCell });
5825
+ _modules.set("d6587a933b36ccfdba9a2a252389924ac8461f672b3a500082cceb5e53c8b0b6", _exports);
5750
5826
  return _exports;
5751
5827
  })();
5752
5828
 
5753
- const _m56 = _modules.get("2f5c0823847e9209017d01b2a753f36056df2a9988fae1f3a1bd5fd186545220") ?? (() => {
5829
+ const _m57 = _modules.get("2f5c0823847e9209017d01b2a753f36056df2a9988fae1f3a1bd5fd186545220") ?? (() => {
5754
5830
  const { captureTableSpans, tableSpans } = _m18;
5755
5831
 
5756
5832
  /** Snapshot small report matrices; flattening is an explicit format decision, never inferred from labels. */
@@ -5772,7 +5848,7 @@ _modules.set("2f5c0823847e9209017d01b2a753f36056df2a9988fae1f3a1bd5fd186545220",
5772
5848
  return _exports;
5773
5849
  })();
5774
5850
 
5775
- const _m55 = _modules.get("b48bcab805d4c75294dd8d8e8dc57f96d9db3f5af31a8f0ddc6562f010f566e4") ?? (() => {
5851
+ const _m56 = _modules.get("b48bcab805d4c75294dd8d8e8dc57f96d9db3f5af31a8f0ddc6562f010f566e4") ?? (() => {
5776
5852
  const { beginTask, checkAbort, consumeRows, taskYieldDue, withAbort } = _m4;
5777
5853
 
5778
5854
  const { BlobByteSink, ChunkedTextSink, withDestination } = _m3;
@@ -5787,7 +5863,7 @@ const { notifyProgress } = _m14;
5787
5863
 
5788
5864
  const { copyColumns, createRowProjector } = _m11;
5789
5865
 
5790
- const { csvStructuredRows } = _m56;
5866
+ const { csvStructuredRows } = _m57;
5791
5867
 
5792
5868
  const { captureBooleanText } = _m21;
5793
5869
 
@@ -5926,7 +6002,7 @@ _modules.set("b48bcab805d4c75294dd8d8e8dc57f96d9db3f5af31a8f0ddc6562f010f566e4",
5926
6002
  return _exports;
5927
6003
  })();
5928
6004
 
5929
- const _m61 = _modules.get("e3d39f39aebcbaf063fd8221df0d9cb5902ad2545a9d9e474bb59d47f15e2c01") ?? (() => {
6005
+ const _m62 = _modules.get("e3d39f39aebcbaf063fd8221df0d9cb5902ad2545a9d9e474bb59d47f15e2c01") ?? (() => {
5930
6006
  /** @internal One type byte, an eight-byte offset/container number and a two-byte generation/index. */
5931
6007
  const pdfXrefEntryBytes = 11;
5932
6008
  function unsigned(bytes, offset, value, width) {
@@ -5962,12 +6038,12 @@ _modules.set("e3d39f39aebcbaf063fd8221df0d9cb5902ad2545a9d9e474bb59d47f15e2c01",
5962
6038
  return _exports;
5963
6039
  })();
5964
6040
 
5965
- const _m60 = _modules.get("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f") ?? (() => {
6041
+ const _m61 = _modules.get("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f") ?? (() => {
5966
6042
  const { checkAbort, withAbort, pause, taskYieldDue } = _m4;
5967
6043
 
5968
6044
  const { OfficeIMOError } = _m2;
5969
6045
 
5970
- const { pdfXrefChunks, pdfXrefEntryBytes } = _m61;
6046
+ const { pdfXrefChunks, pdfXrefEntryBytes } = _m62;
5971
6047
 
5972
6048
  const compactObjectCount = 256, compactObjectBytes = 32768;
5973
6049
  const compactIndexChunkEntries = 4096;
@@ -6291,7 +6367,7 @@ _modules.set("e716b8b1da464094622f5f671518493c78e63ff22a029d61544d2d193b63ce8f",
6291
6367
  return _exports;
6292
6368
  })();
6293
6369
 
6294
- const _m65 = _modules.get("1e169e6ecdeceff319b5da4bf01f4c653c1a3d9e8ad696b141bf8ac52d9f446c") ?? (() => {
6370
+ const _m66 = _modules.get("1e169e6ecdeceff319b5da4bf01f4c653c1a3d9e8ad696b141bf8ac52d9f446c") ?? (() => {
6295
6371
  /** @internal Bounded big-endian reader used for caller-provided TrueType programs. */
6296
6372
  class FontReader {
6297
6373
  bytes;
@@ -6321,8 +6397,8 @@ _modules.set("1e169e6ecdeceff319b5da4bf01f4c653c1a3d9e8ad696b141bf8ac52d9f446c",
6321
6397
  return _exports;
6322
6398
  })();
6323
6399
 
6324
- const _m66 = _modules.get("ecf6c6ab2f9c5f747338d0d59d9f2cae0b006d9d2a210bcb1545db1f046eb80c") ?? (() => {
6325
- const { align4 } = _m65;
6400
+ const _m67 = _modules.get("ecf6c6ab2f9c5f747338d0d59d9f2cae0b006d9d2a210bcb1545db1f046eb80c") ?? (() => {
6401
+ const { align4 } = _m66;
6326
6402
 
6327
6403
  const { checkAbort, pause, taskYieldDue } = _m4;
6328
6404
 
@@ -6546,12 +6622,12 @@ _modules.set("ecf6c6ab2f9c5f747338d0d59d9f2cae0b006d9d2a210bcb1545db1f046eb80c",
6546
6622
  return _exports;
6547
6623
  })();
6548
6624
 
6549
- const _m64 = _modules.get("2e1fa1582af797386e2e2914c0a27237309b1692a3cc2be688f46590eb74480d") ?? (() => {
6625
+ const _m65 = _modules.get("2e1fa1582af797386e2e2914c0a27237309b1692a3cc2be688f46590eb74480d") ?? (() => {
6550
6626
  const { NotSupportedError } = _m2;
6551
6627
 
6552
- const { FontReader } = _m65;
6628
+ const { FontReader } = _m66;
6553
6629
 
6554
- const { subsetTrueType, subsetTrueTypeCooperatively } = _m66;
6630
+ const { subsetTrueType, subsetTrueTypeCooperatively } = _m67;
6555
6631
 
6556
6632
  const { checkAbort, pause, taskYieldDue } = _m4;
6557
6633
 
@@ -6791,8 +6867,8 @@ _modules.set("2e1fa1582af797386e2e2914c0a27237309b1692a3cc2be688f46590eb74480d",
6791
6867
  return _exports;
6792
6868
  })();
6793
6869
 
6794
- const _m63 = _modules.get("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596") ?? (() => {
6795
- const { TrueTypeFont } = _m64;
6870
+ const _m64 = _modules.get("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596") ?? (() => {
6871
+ const { TrueTypeFont } = _m65;
6796
6872
 
6797
6873
  const { beginTask, checkAbort } = _m4;
6798
6874
 
@@ -6855,7 +6931,7 @@ _modules.set("d9c1509dff0538488752433e47cd0927ece5f93c559ad0e32dc56602dfd44596",
6855
6931
  return _exports;
6856
6932
  })();
6857
6933
 
6858
- const _m68 = _modules.get("1ed4965a6e2963a91190baa8a58ada8ce0edde8fe653bcb6609002e872af0d61") ?? (() => {
6934
+ const _m69 = _modules.get("1ed4965a6e2963a91190baa8a58ada8ce0edde8fe653bcb6609002e872af0d61") ?? (() => {
6859
6935
  // Generated by scripts/pdf-widths.mjs from OfficeIMO.Pdf's Adobe AFM-derived metrics.
6860
6936
  const helveticaWidths = new Map([
6861
6937
  [32, [278, 278]],
@@ -7178,12 +7254,12 @@ _modules.set("1ed4965a6e2963a91190baa8a58ada8ce0edde8fe653bcb6609002e872af0d61",
7178
7254
  return _exports;
7179
7255
  })();
7180
7256
 
7181
- const _m67 = _modules.get("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070") ?? (() => {
7257
+ const _m68 = _modules.get("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070") ?? (() => {
7182
7258
  const { OfficeIMOError } = _m2;
7183
7259
 
7184
- const { PdfFont, fontProgram } = _m63;
7260
+ const { PdfFont, fontProgram } = _m64;
7185
7261
 
7186
- const { helveticaWidths } = _m68;
7262
+ const { helveticaWidths } = _m69;
7187
7263
 
7188
7264
  const winAnsiExtras = new Map([0x20ac, 0, 0x201a, 0x192, 0x201e, 0x2026, 0x2020, 0x2021, 0x2c6, 0x2030, 0x160, 0x2039, 0x152, 0, 0x17d, 0, 0, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014, 0x2dc, 0x2122, 0x161, 0x203a, 0x153, 0, 0x17e, 0x178].map((cp, i) => [cp, i + 128]));
7189
7265
  /** @internal Called after scalar support succeeds when encoding a standard-font run. */
@@ -7247,14 +7323,14 @@ _modules.set("59911f0fe023545e9e97521b268551078bdc4c5f303e446a13b7d52f905e8070",
7247
7323
  return _exports;
7248
7324
  })();
7249
7325
 
7250
- const _m62 = _modules.get("4d4736e6b8e2aaecc6f6c1b124b7e6bc0a5e141dcc725edf0ad4847d87fca1b3") ?? (() => {
7326
+ const _m63 = _modules.get("4d4736e6b8e2aaecc6f6c1b124b7e6bc0a5e141dcc725edf0ad4847d87fca1b3") ?? (() => {
7251
7327
  const { NotSupportedError, OfficeIMOError } = _m2;
7252
7328
 
7253
- const { fontProgram } = _m63;
7329
+ const { fontProgram } = _m64;
7254
7330
 
7255
- const { resolveScalar, selectFont, standardCode, validateFonts } = _m67;
7331
+ const { resolveScalar, selectFont, standardCode, validateFonts } = _m68;
7256
7332
 
7257
- const { pdfNumber, unicodeHex } = _m60;
7333
+ const { pdfNumber, unicodeHex } = _m61;
7258
7334
 
7259
7335
  const { checkAbort, pause, taskYieldDue } = _m4;
7260
7336
 
@@ -7479,7 +7555,7 @@ _modules.set("4d4736e6b8e2aaecc6f6c1b124b7e6bc0a5e141dcc725edf0ad4847d87fca1b3",
7479
7555
  return _exports;
7480
7556
  })();
7481
7557
 
7482
- const _m70 = _modules.get("253db2c0eab1f298fda61fb40a5ddaacbf6ad12a7408ee3d8c12d27f88e7ca27") ?? (() => {
7558
+ const _m71 = _modules.get("253db2c0eab1f298fda61fb40a5ddaacbf6ad12a7408ee3d8c12d27f88e7ca27") ?? (() => {
7483
7559
  const { OfficeIMOError } = _m2;
7484
7560
 
7485
7561
  const { ExportCell, assertExportValue } = _m5;
@@ -7591,7 +7667,7 @@ _modules.set("253db2c0eab1f298fda61fb40a5ddaacbf6ad12a7408ee3d8c12d27f88e7ca27",
7591
7667
  return _exports;
7592
7668
  })();
7593
7669
 
7594
- const _m72 = _modules.get("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6") ?? (() => {
7670
+ const _m73 = _modules.get("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6") ?? (() => {
7595
7671
  const { NotSupportedError, OfficeIMOError } = _m2;
7596
7672
 
7597
7673
  const { checkAbort, pause, taskYieldDue, withAbort } = _m4;
@@ -7804,7 +7880,7 @@ _modules.set("8be3fb029e08d100ce8ffcf50916d5ba7f7bc00d62156cc33815fd58554a9ed6",
7804
7880
  return _exports;
7805
7881
  })();
7806
7882
 
7807
- const _m71 = _modules.get("0a1c79b51ac9a164b86197239117df6497f45ca2892b423b1ec77a663ccc1c47") ?? (() => {
7883
+ const _m72 = _modules.get("0a1c79b51ac9a164b86197239117df6497f45ca2892b423b1ec77a663ccc1c47") ?? (() => {
7808
7884
  const { NotSupportedError, OfficeIMOError } = _m2;
7809
7885
 
7810
7886
  const { copyExportLink } = _m7;
@@ -7813,11 +7889,11 @@ const { checkAbort, pause, taskYieldDue } = _m4;
7813
7889
 
7814
7890
  const { presentation, color } = _m17;
7815
7891
 
7816
- const { wrapShapedPdfText } = _m72;
7892
+ const { wrapShapedPdfText } = _m73;
7817
7893
 
7818
- const { PdfFont } = _m63;
7894
+ const { PdfFont } = _m64;
7819
7895
 
7820
- const { pdfBudgetText } = _m70;
7896
+ const { pdfBudgetText } = _m71;
7821
7897
 
7822
7898
  /** @internal Callers supply an owned, validated, frozen base presentation. A run list is a PDF presentation value, never an alternate shared table value model. */
7823
7899
  function capturePdfText(value, base, settings, fonts, countEmpty = true, reserveBudget = true) {
@@ -8000,10 +8076,10 @@ _modules.set("0a1c79b51ac9a164b86197239117df6497f45ca2892b423b1ec77a663ccc1c47",
8000
8076
  return _exports;
8001
8077
  })();
8002
8078
 
8003
- const _m73 = _modules.get("2f40af05ba09102fe440c1d46385b64cecdd233371771796c9ae4e8d523f2cea") ?? (() => {
8079
+ const _m74 = _modules.get("2f40af05ba09102fe440c1d46385b64cecdd233371771796c9ae4e8d523f2cea") ?? (() => {
8004
8080
  const { OfficeIMOError } = _m2;
8005
8081
 
8006
- const { wrapPdfText } = _m71;
8082
+ const { wrapPdfText } = _m72;
8007
8083
 
8008
8084
  /** Plan without opening a source. Exact column widths never shrink in band mode. */
8009
8085
  function planTableBands(widths, settings) {
@@ -8099,7 +8175,7 @@ _modules.set("2f40af05ba09102fe440c1d46385b64cecdd233371771796c9ae4e8d523f2cea",
8099
8175
  return _exports;
8100
8176
  })();
8101
8177
 
8102
- const _m69 = _modules.get("ad81357e627d3100e1068a8ce521aa1c1cd65de5c6c6ab36f807a3e5da50d874") ?? (() => {
8178
+ const _m70 = _modules.get("ad81357e627d3100e1068a8ce521aa1c1cd65de5c6c6ab36f807a3e5da50d874") ?? (() => {
8103
8179
  const { ExportCell } = _m5;
8104
8180
 
8105
8181
  const { copyExportLink } = _m7;
@@ -8110,11 +8186,11 @@ const { createTotals } = _m12;
8110
8186
 
8111
8187
  const { presentation, positive } = _m17;
8112
8188
 
8113
- const { displayText, pdfBudgetText } = _m70;
8189
+ const { displayText, pdfBudgetText } = _m71;
8114
8190
 
8115
- const { capturePdfText, wrapPdfText } = _m71;
8191
+ const { capturePdfText, wrapPdfText } = _m72;
8116
8192
 
8117
- const { planTableBands, projectBandRows, alignBandBlocks } = _m73;
8193
+ const { planTableBands, projectBandRows, alignBandBlocks } = _m74;
8118
8194
 
8119
8195
  class PdfTableLayout {
8120
8196
  settings;
@@ -8334,7 +8410,7 @@ _modules.set("ad81357e627d3100e1068a8ce521aa1c1cd65de5c6c6ab36f807a3e5da50d874",
8334
8410
  return _exports;
8335
8411
  })();
8336
8412
 
8337
- const _m75 = _modules.get("9ea74d93c18250e809a7be745444b886bcd5ec924a78e6ab004d649789db1f72") ?? (() => {
8413
+ const _m76 = _modules.get("9ea74d93c18250e809a7be745444b886bcd5ec924a78e6ab004d649789db1f72") ?? (() => {
8338
8414
  const { OfficeIMOError } = _m2;
8339
8415
 
8340
8416
  const { checkAbort } = _m4;
@@ -8476,7 +8552,7 @@ _modules.set("9ea74d93c18250e809a7be745444b886bcd5ec924a78e6ab004d649789db1f72",
8476
8552
  return _exports;
8477
8553
  })();
8478
8554
 
8479
- const _m76 = _modules.get("9deed79565a5da5009f7a01579df8d6a3f019b78eb7b17d831c7964840e9a6bf") ?? (() => {
8555
+ const _m77 = _modules.get("9deed79565a5da5009f7a01579df8d6a3f019b78eb7b17d831c7964840e9a6bf") ?? (() => {
8480
8556
  /** @internal Source-cell identities survive page fragments and horizontal band projections.
8481
8557
  * Only column headers and still-owned row objects remain reachable from this table owner. */
8482
8558
  class PdfTableStructure {
@@ -8591,10 +8667,10 @@ _modules.set("9deed79565a5da5009f7a01579df8d6a3f019b78eb7b17d831c7964840e9a6bf",
8591
8667
  return _exports;
8592
8668
  })();
8593
8669
 
8594
- const _m77 = _modules.get("09c712096a1028af340e275d5a273e870546413797e71ed709657ad0482ea170") ?? (() => {
8670
+ const _m78 = _modules.get("09c712096a1028af340e275d5a273e870546413797e71ed709657ad0482ea170") ?? (() => {
8595
8671
  const { OfficeIMOError } = _m2;
8596
8672
 
8597
- const { pdfNumber, unicodeHex } = _m60;
8673
+ const { pdfNumber, unicodeHex } = _m61;
8598
8674
 
8599
8675
  const encoder = new TextEncoder();
8600
8676
  /** @internal URI actions are byte strings; tooltips are Unicode PDF text strings. */
@@ -8637,10 +8713,10 @@ _modules.set("09c712096a1028af340e275d5a273e870546413797e71ed709657ad0482ea170",
8637
8713
  return _exports;
8638
8714
  })();
8639
8715
 
8640
- const _m78 = _modules.get("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f") ?? (() => {
8716
+ const _m79 = _modules.get("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f") ?? (() => {
8641
8717
  const { OfficeIMOError } = _m2;
8642
8718
 
8643
- const { unicodeHex } = _m60;
8719
+ const { unicodeHex } = _m61;
8644
8720
 
8645
8721
  const { captureFields } = _m10;
8646
8722
 
@@ -8686,7 +8762,7 @@ _modules.set("c68d18d668366fb9b96d1b53c79dc6305f84cb83c05e4942fcf1cdf96ed1a73f",
8686
8762
  return _exports;
8687
8763
  })();
8688
8764
 
8689
- const _m79 = _modules.get("a66257a32f03d958aa57be4de9da7f80b708cebca26b5cc6404de0ee11bfe052") ?? (() => {
8765
+ const _m80 = _modules.get("a66257a32f03d958aa57be4de9da7f80b708cebca26b5cc6404de0ee11bfe052") ?? (() => {
8690
8766
  const { settings } = _m17;
8691
8767
 
8692
8768
  /** @internal Every section derives from captured document defaults, never the preceding section. */
@@ -8705,28 +8781,28 @@ _modules.set("a66257a32f03d958aa57be4de9da7f80b708cebca26b5cc6404de0ee11bfe052",
8705
8781
  return _exports;
8706
8782
  })();
8707
8783
 
8708
- const _m74 = _modules.get("3ed7114181be5a3066742336da574fef7f2fc04ee6dfc5e64211f3bedad4cab9") ?? (() => {
8784
+ const _m75 = _modules.get("3ed7114181be5a3066742336da574fef7f2fc04ee6dfc5e64211f3bedad4cab9") ?? (() => {
8709
8785
  const { OfficeIMOError } = _m2;
8710
8786
 
8711
8787
  const { checkAbort } = _m4;
8712
8788
 
8713
- const { pdfNumber } = _m60;
8789
+ const { pdfNumber } = _m61;
8714
8790
 
8715
8791
  const { color } = _m17;
8716
8792
 
8717
- const { PdfTableBandFlow } = _m75;
8793
+ const { PdfTableBandFlow } = _m76;
8718
8794
 
8719
- const { PdfTableStructure } = _m76;
8795
+ const { PdfTableStructure } = _m77;
8720
8796
 
8721
- const { wrapText, wrapTextCooperatively, synchronousText, pdfBudgetText } = _m70;
8797
+ const { wrapText, wrapTextCooperatively, synchronousText, pdfBudgetText } = _m71;
8722
8798
 
8723
- const { linkAnnotation } = _m77;
8799
+ const { linkAnnotation } = _m78;
8724
8800
 
8725
- const { unicodeHex } = _m60;
8801
+ const { unicodeHex } = _m61;
8726
8802
 
8727
- const { captureSection, captureBookmark } = _m78;
8803
+ const { captureSection, captureBookmark } = _m79;
8728
8804
 
8729
- const { sectionSettings } = _m79;
8805
+ const { sectionSettings } = _m80;
8730
8806
 
8731
8807
  /** @internal One page of drawing commands and O(page count) references, never the complete report body. */
8732
8808
  class PdfPages {
@@ -9447,7 +9523,7 @@ _modules.set("3ed7114181be5a3066742336da574fef7f2fc04ee6dfc5e64211f3bedad4cab9",
9447
9523
  return _exports;
9448
9524
  })();
9449
9525
 
9450
- const _m81 = _modules.get("7a58e8ccb5164de51db14e39ca9695af6487c354df909509f0ae6bfac8ae3887") ?? (() => {
9526
+ const _m82 = _modules.get("7a58e8ccb5164de51db14e39ca9695af6487c354df909509f0ae6bfac8ae3887") ?? (() => {
9451
9527
  /** @internal Incremental PDF number tree: at most 64 entries/children per retained level. */
9452
9528
  class PdfParentTree {
9453
9529
  objects;
@@ -9510,14 +9586,14 @@ _modules.set("7a58e8ccb5164de51db14e39ca9695af6487c354df909509f0ae6bfac8ae3887",
9510
9586
  return _exports;
9511
9587
  })();
9512
9588
 
9513
- const _m80 = _modules.get("1c1828a3d6dfc2edda674566203e7aa8e97c984114b7928df13cb373859977d0") ?? (() => {
9589
+ const _m81 = _modules.get("1c1828a3d6dfc2edda674566203e7aa8e97c984114b7928df13cb373859977d0") ?? (() => {
9514
9590
  const { OfficeIMOError } = _m2;
9515
9591
 
9516
9592
  const { checkAbort } = _m4;
9517
9593
 
9518
- const { unicodeHex } = _m60;
9594
+ const { unicodeHex } = _m61;
9519
9595
 
9520
- const { PdfParentTree } = _m81;
9596
+ const { PdfParentTree } = _m82;
9521
9597
 
9522
9598
  /** Same-page marked content uses integer K; cross-page MCR and annotation OBJR stay explicit. */
9523
9599
  function structureChild(child) {
@@ -9822,12 +9898,12 @@ _modules.set("1c1828a3d6dfc2edda674566203e7aa8e97c984114b7928df13cb373859977d0",
9822
9898
  return _exports;
9823
9899
  })();
9824
9900
 
9825
- const _m82 = _modules.get("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea") ?? (() => {
9901
+ const _m83 = _modules.get("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea") ?? (() => {
9826
9902
  const { OfficeIMOError } = _m2;
9827
9903
 
9828
9904
  const { checkAbort } = _m4;
9829
9905
 
9830
- const { pdfNumber, unicodeHex } = _m60;
9906
+ const { pdfNumber, unicodeHex } = _m61;
9831
9907
 
9832
9908
  /** @internal Bounded native bookmarks; destinations are captured only when their content is painted. */
9833
9909
  class PdfOutlines {
@@ -9886,18 +9962,18 @@ _modules.set("52c78ca6833cee7e5a96b657e2c00172d550176daf2c95e742692f8416977bea",
9886
9962
  return _exports;
9887
9963
  })();
9888
9964
 
9889
- const _m59 = _modules.get("afdad27eb363e8de0c3bd69ebf358860eb76f5c6fb29f43a87635807cb7fc273") ?? (() => {
9890
- const { PdfObjects, unicodeHex } = _m60;
9965
+ const _m60 = _modules.get("afdad27eb363e8de0c3bd69ebf358860eb76f5c6fb29f43a87635807cb7fc273") ?? (() => {
9966
+ const { PdfObjects, unicodeHex } = _m61;
9891
9967
 
9892
- const { PdfFontResources } = _m62;
9968
+ const { PdfFontResources } = _m63;
9893
9969
 
9894
- const { PdfTableLayout } = _m69;
9970
+ const { PdfTableLayout } = _m70;
9895
9971
 
9896
- const { PdfPages } = _m74;
9972
+ const { PdfPages } = _m75;
9897
9973
 
9898
- const { PdfStructure } = _m80;
9974
+ const { PdfStructure } = _m81;
9899
9975
 
9900
- const { PdfOutlines } = _m82;
9976
+ const { PdfOutlines } = _m83;
9901
9977
 
9902
9978
  /** One resource/catalog owner shared by table convenience exports and composed documents. */
9903
9979
  class PdfWriteSession {
@@ -9953,7 +10029,7 @@ _modules.set("afdad27eb363e8de0c3bd69ebf358860eb76f5c6fb29f43a87635807cb7fc273",
9953
10029
  return _exports;
9954
10030
  })();
9955
10031
 
9956
- const _m58 = _modules.get("45cf9fd6b6293c1a83bc8554e1bcb5cf119f44701fbad7849f39a712cab5074b") ?? (() => {
10032
+ const _m59 = _modules.get("45cf9fd6b6293c1a83bc8554e1bcb5cf119f44701fbad7849f39a712cab5074b") ?? (() => {
9957
10033
  const { BlobByteSink, withDestination } = _m3;
9958
10034
 
9959
10035
  const { beginTask, checkAbort, consumeRows, pause, taskYieldDue } = _m4;
@@ -9964,7 +10040,7 @@ const { createRowProjector } = _m11;
9964
10040
 
9965
10041
  const { settings } = _m17;
9966
10042
 
9967
- const { PdfWriteSession } = _m59;
10043
+ const { PdfWriteSession } = _m60;
9968
10044
 
9969
10045
  async function writePdf(rows, configuration) {
9970
10046
  const sink = new BlobByteSink();
@@ -10022,7 +10098,7 @@ _modules.set("45cf9fd6b6293c1a83bc8554e1bcb5cf119f44701fbad7849f39a712cab5074b",
10022
10098
  return _exports;
10023
10099
  })();
10024
10100
 
10025
- const _m86 = _modules.get("749d1ec5422c0087787f525ef42e3b8d3a94d2b70eb5e42d2e3723a870777ad6") ?? (() => {
10101
+ const _m87 = _modules.get("749d1ec5422c0087787f525ef42e3b8d3a94d2b70eb5e42d2e3723a870777ad6") ?? (() => {
10026
10102
  const { NotSupportedError, OfficeIMOError } = _m2;
10027
10103
 
10028
10104
  const { checkAbort, pause, taskYieldDue, withAbort } = _m4;
@@ -10290,12 +10366,12 @@ _modules.set("749d1ec5422c0087787f525ef42e3b8d3a94d2b70eb5e42d2e3723a870777ad6",
10290
10366
  return _exports;
10291
10367
  })();
10292
10368
 
10293
- const _m85 = _modules.get("7dca2d9ca5c43893abdaf86df5b1bcb1f3de3d5d33532d082fdfe04711999d21") ?? (() => {
10369
+ const _m86 = _modules.get("7dca2d9ca5c43893abdaf86df5b1bcb1f3de3d5d33532d082fdfe04711999d21") ?? (() => {
10294
10370
  const { NotSupportedError, OfficeIMOError } = _m2;
10295
10371
 
10296
10372
  const { checkAbort, pause, taskYieldDue } = _m4;
10297
10373
 
10298
- const { pngPixels } = _m86;
10374
+ const { pngPixels } = _m87;
10299
10375
 
10300
10376
  /** Shared document image resources; source objects are captured on first consumption. */
10301
10377
  class PdfDocumentImages {
@@ -10424,14 +10500,14 @@ _modules.set("7dca2d9ca5c43893abdaf86df5b1bcb1f3de3d5d33532d082fdfe04711999d21",
10424
10500
  return _exports;
10425
10501
  })();
10426
10502
 
10427
- const _m87 = _modules.get("3290c84fdf80725af802f497d947bc088aa8d93d9db0a33f6f829f9153aa6fd6") ?? (() => {
10503
+ const _m88 = _modules.get("3290c84fdf80725af802f497d947bc088aa8d93d9db0a33f6f829f9153aa6fd6") ?? (() => {
10428
10504
  const { OfficeIMOError } = _m2;
10429
10505
 
10430
10506
  const { checkAbort, pause, taskYieldDue } = _m4;
10431
10507
 
10432
10508
  const { color, positive } = _m17;
10433
10509
 
10434
- const { pdfNumber: n } = _m60;
10510
+ const { pdfNumber: n } = _m61;
10435
10511
 
10436
10512
  /** Capture and serialize one bounded display path, with no markup parser or resource loading. */
10437
10513
  async function vectorCommands(block, settings, used) {
@@ -10511,14 +10587,14 @@ _modules.set("3290c84fdf80725af802f497d947bc088aa8d93d9db0a33f6f829f9153aa6fd6",
10511
10587
  return _exports;
10512
10588
  })();
10513
10589
 
10514
- const _m88 = _modules.get("da9ad00f94b9ae28e2e3de796928ff0c4eab1d73382b1441e7d779fad4278ef7") ?? (() => {
10590
+ const _m89 = _modules.get("da9ad00f94b9ae28e2e3de796928ff0c4eab1d73382b1441e7d779fad4278ef7") ?? (() => {
10515
10591
  const { NotSupportedError, OfficeIMOError } = _m2;
10516
10592
 
10517
10593
  const { checkAbort, pause, taskYieldDue } = _m4;
10518
10594
 
10519
10595
  const { color, positive } = _m17;
10520
10596
 
10521
- const { pdfNumber: n } = _m60;
10597
+ const { pdfNumber: n } = _m61;
10522
10598
 
10523
10599
  /** Portable drawings are an exact schema: unsupported data must never be silently discarded. */
10524
10600
  function record(value, keys, name) {
@@ -10758,20 +10834,20 @@ _modules.set("da9ad00f94b9ae28e2e3de796928ff0c4eab1d73382b1441e7d779fad4278ef7",
10758
10834
  return _exports;
10759
10835
  })();
10760
10836
 
10761
- const _m89 = _modules.get("5e4503b77b357ee6d9fad1f52690085b0f0b140cd3b550b63c5100ed95a92f88") ?? (() => {
10837
+ const _m90 = _modules.get("5e4503b77b357ee6d9fad1f52690085b0f0b140cd3b550b63c5100ed95a92f88") ?? (() => {
10762
10838
  const { OfficeIMOError } = _m2;
10763
10839
 
10764
- const { capturePdfText, wrapPdfText } = _m71;
10840
+ const { capturePdfText, wrapPdfText } = _m72;
10765
10841
 
10766
10842
  const { positive } = _m17;
10767
10843
 
10768
10844
  const { resolveParagraphStyle } = _m19;
10769
10845
 
10770
- const { captureBookmark } = _m78;
10846
+ const { captureBookmark } = _m79;
10771
10847
 
10772
10848
  const { captureFields } = _m10;
10773
10849
 
10774
- const { pdfBudgetText } = _m70;
10850
+ const { pdfBudgetText } = _m71;
10775
10851
 
10776
10852
  /** @internal Copy public paragraph input before any cooperative layout or source enumeration. */
10777
10853
  function captureParagraph(block, settings, fonts, budgetOnPaint = false) {
@@ -10842,10 +10918,10 @@ _modules.set("5e4503b77b357ee6d9fad1f52690085b0f0b140cd3b550b63c5100ed95a92f88",
10842
10918
  return _exports;
10843
10919
  })();
10844
10920
 
10845
- const _m90 = _modules.get("1d57c429705ae0cbc14d98dcfef4c8a6c2df06f391c8f58e99cacb02f2d1cbc7") ?? (() => {
10846
- const { capturePdfText, wrapPdfText } = _m71;
10921
+ const _m91 = _modules.get("1d57c429705ae0cbc14d98dcfef4c8a6c2df06f391c8f58e99cacb02f2d1cbc7") ?? (() => {
10922
+ const { capturePdfText, wrapPdfText } = _m72;
10847
10923
 
10848
- const { captureParagraph, prepareParagraph } = _m89;
10924
+ const { captureParagraph, prepareParagraph } = _m90;
10849
10925
 
10850
10926
  const { resolveParagraphStyle } = _m19;
10851
10927
 
@@ -10900,7 +10976,7 @@ _modules.set("1d57c429705ae0cbc14d98dcfef4c8a6c2df06f391c8f58e99cacb02f2d1cbc7",
10900
10976
  return _exports;
10901
10977
  })();
10902
10978
 
10903
- const _m92 = _modules.get("d04686d2c067355dfd215333b83eb5f79f96e9e4be49f942e050f21ac0795343") ?? (() => {
10979
+ const _m93 = _modules.get("d04686d2c067355dfd215333b83eb5f79f96e9e4be49f942e050f21ac0795343") ?? (() => {
10904
10980
  const { assertGroupedReportSource } = _m8;
10905
10981
 
10906
10982
  const { captureFields } = _m10;
@@ -10950,22 +11026,22 @@ _modules.set("d04686d2c067355dfd215333b83eb5f79f96e9e4be49f942e050f21ac0795343",
10950
11026
  return _exports;
10951
11027
  })();
10952
11028
 
10953
- const _m91 = _modules.get("289fa3a052c7fbab2a3ca0fb91fb9974db709d24b7d850f1175810258f0409a0") ?? (() => {
11029
+ const _m92 = _modules.get("289fa3a052c7fbab2a3ca0fb91fb9974db709d24b7d850f1175810258f0409a0") ?? (() => {
10954
11030
  const { assertGroupedReportSource, groupedReportOperation } = _m8;
10955
11031
 
10956
11032
  const { consumeRows } = _m4;
10957
11033
 
10958
11034
  const { ExportCell } = _m5;
10959
11035
 
10960
- const { captureGroupedPdfTableOptions } = _m92;
11036
+ const { captureGroupedPdfTableOptions } = _m93;
10961
11037
 
10962
11038
  const { settings } = _m17;
10963
11039
 
10964
- const { PdfTableLayout } = _m69;
11040
+ const { PdfTableLayout } = _m70;
10965
11041
 
10966
- const { captureCaption, captureParagraph, prepareParagraph } = _m89;
11042
+ const { captureCaption, captureParagraph, prepareParagraph } = _m90;
10967
11043
 
10968
- const { synchronousText } = _m70;
11044
+ const { synchronousText } = _m71;
10969
11045
 
10970
11046
  /** @internal Render one analytical source in the existing document session. Retain one detail row and
10971
11047
  * at most four closing subtotals. All captions, rows, pages, bytes and fonts use the document owners. */
@@ -11208,7 +11284,7 @@ _modules.set("289fa3a052c7fbab2a3ca0fb91fb9974db709d24b7d850f1175810258f0409a0",
11208
11284
  return _exports;
11209
11285
  })();
11210
11286
 
11211
- const _m84 = _modules.get("9051bf9fc3168e24b53b16c123a42816198456846003fb49191c03a18cdab904") ?? (() => {
11287
+ const _m85 = _modules.get("9051bf9fc3168e24b53b16c123a42816198456846003fb49191c03a18cdab904") ?? (() => {
11212
11288
  const { BlobByteSink, withDestination } = _m3;
11213
11289
 
11214
11290
  const { OfficeIMOError } = _m2;
@@ -11223,27 +11299,27 @@ const { captureFields } = _m10;
11223
11299
 
11224
11300
  const { settings, captureWideTable } = _m17;
11225
11301
 
11226
- const { pdfNumber: n } = _m60;
11302
+ const { pdfNumber: n } = _m61;
11227
11303
 
11228
- const { PdfTableLayout } = _m69;
11304
+ const { PdfTableLayout } = _m70;
11229
11305
 
11230
- const { PdfWriteSession } = _m59;
11306
+ const { PdfWriteSession } = _m60;
11231
11307
 
11232
- const { PdfDocumentImages } = _m85;
11308
+ const { PdfDocumentImages } = _m86;
11233
11309
 
11234
- const { vectorCommands } = _m87;
11310
+ const { vectorCommands } = _m88;
11235
11311
 
11236
- const { graphicAlternative } = _m80;
11312
+ const { graphicAlternative } = _m81;
11237
11313
 
11238
- const { checkDrawingBlock, prepareDrawing } = _m88;
11314
+ const { checkDrawingBlock, prepareDrawing } = _m89;
11239
11315
 
11240
- const { captureParagraph, captureCaption, prepareParagraph, checkParagraphBuffer, paragraphStartHeight } = _m89;
11316
+ const { captureParagraph, captureCaption, prepareParagraph, checkParagraphBuffer, paragraphStartHeight } = _m90;
11241
11317
 
11242
- const { captureListOptions, prepareListItem } = _m90;
11318
+ const { captureListOptions, prepareListItem } = _m91;
11243
11319
 
11244
- const { captureSection } = _m78;
11320
+ const { captureSection } = _m79;
11245
11321
 
11246
- const { renderGroupedPdfTable } = _m91;
11322
+ const { renderGroupedPdfTable } = _m92;
11247
11323
 
11248
11324
  const tableOptionFields = ["columns", "includeHeader", "headerRows", "footer", "headerPresentation", "footerPresentation", "alternateRowColor", "columnWidths", "wideTable", "formatValue", "formatRuns"];
11249
11325
  /** Capture typed columns for a single-use table source in a composed document. */
@@ -11502,18 +11578,18 @@ _modules.set("9051bf9fc3168e24b53b16c123a42816198456846003fb49191c03a18cdab904",
11502
11578
  return _exports;
11503
11579
  })();
11504
11580
 
11505
- const _m83 = _modules.get("abe76e52ffeed11ab42477c83ddde1d1d7de28b803096436b5b23cb153af58ba") ?? (() => {
11581
+ const _m84 = _modules.get("abe76e52ffeed11ab42477c83ddde1d1d7de28b803096436b5b23cb153af58ba") ?? (() => {
11506
11582
  const { assertGroupedReportSource } = _m8;
11507
11583
 
11508
11584
  const { BlobByteSink } = _m3;
11509
11585
 
11510
- const { writePdfDocumentTo } = _m84;
11586
+ const { writePdfDocumentTo } = _m85;
11511
11587
 
11512
11588
  const { pdfOptionFields } = _m17;
11513
11589
 
11514
11590
  const { captureFields } = _m10;
11515
11591
 
11516
- const { pdfGroupedTable, groupedPdfLabelFields, groupedPdfTableFields } = _m92;
11592
+ const { pdfGroupedTable, groupedPdfLabelFields, groupedPdfTableFields } = _m93;
11517
11593
 
11518
11594
 
11519
11595
 
@@ -11547,15 +11623,15 @@ async function writeGroupedPdfTo(report, destination, configuration) {
11547
11623
  delete documentOptions.footer;
11548
11624
  return writePdfDocumentTo([pdfGroupedTable(report, tableOptions)], destination, documentOptions);
11549
11625
  }
11550
- const _exports = Object.freeze({ pdfGroupedTable: _m92.pdfGroupedTable, writeGroupedPdf: writeGroupedPdf, writeGroupedPdfTo: writeGroupedPdfTo });
11626
+ const _exports = Object.freeze({ pdfGroupedTable: _m93.pdfGroupedTable, writeGroupedPdf: writeGroupedPdf, writeGroupedPdfTo: writeGroupedPdfTo });
11551
11627
  _modules.set("abe76e52ffeed11ab42477c83ddde1d1d7de28b803096436b5b23cb153af58ba", _exports);
11552
11628
  return _exports;
11553
11629
  })();
11554
11630
 
11555
- const _m93 = _modules.get("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86") ?? (() => {
11556
- const { fontProgram } = _m63;
11631
+ const _m94 = _modules.get("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86") ?? (() => {
11632
+ const { fontProgram } = _m64;
11557
11633
 
11558
- const { resolveScalar, selectFont, validateFonts } = _m67;
11634
+ const { resolveScalar, selectFont, validateFonts } = _m68;
11559
11635
 
11560
11636
  /**
11561
11637
  * Check one text run against the writer's selected font and scalar-layout rules.
@@ -11592,14 +11668,110 @@ _modules.set("3d777096288d1be55a05a80bc015d4674212e587703f25a7e7cf99a8065feb86",
11592
11668
  return _exports;
11593
11669
  })();
11594
11670
 
11595
- const _m57 = _modules.get("027aafa08408056b10d7d717d63d1f7c0ee20ecfc68213aa66feacc75ec525fe") ?? (() => {
11671
+ const _m58 = _modules.get("027aafa08408056b10d7d717d63d1f7c0ee20ecfc68213aa66feacc75ec525fe") ?? (() => {
11596
11672
 
11597
- const _exports = Object.freeze({ writePdf: _m58.writePdf, writePdfTo: _m58.writePdfTo, writeGroupedPdf: _m83.writeGroupedPdf, writeGroupedPdfTo: _m83.writeGroupedPdfTo, pdfGroupedTable: _m83.pdfGroupedTable, createGroupedReport: _m8.createGroupedReport, writePdfDocument: _m84.writePdfDocument, writePdfDocumentTo: _m84.writePdfDocumentTo, pdfTable: _m84.pdfTable, PdfFont: _m63.PdfFont, preflightPdfText: _m93.preflightPdfText, ExportCell: _m5.ExportCell, saveBlob: _m1.saveBlob });
11673
+ const _exports = Object.freeze({ writePdf: _m59.writePdf, writePdfTo: _m59.writePdfTo, writeGroupedPdf: _m84.writeGroupedPdf, writeGroupedPdfTo: _m84.writeGroupedPdfTo, pdfGroupedTable: _m84.pdfGroupedTable, createGroupedReport: _m8.createGroupedReport, writePdfDocument: _m85.writePdfDocument, writePdfDocumentTo: _m85.writePdfDocumentTo, pdfTable: _m85.pdfTable, PdfFont: _m64.PdfFont, preflightPdfText: _m94.preflightPdfText, ExportCell: _m5.ExportCell, saveBlob: _m1.saveBlob });
11598
11674
  _modules.set("027aafa08408056b10d7d717d63d1f7c0ee20ecfc68213aa66feacc75ec525fe", _exports);
11599
11675
  return _exports;
11600
11676
  })();
11601
11677
 
11602
- const _m95 = _modules.get("c0aee2c5df0df3e62ca31fc685243cdd4b449f083834e8d28cf92c20dfa7b27f") ?? (() => {
11678
+ const _m95 = _modules.get("3d1862d8ab32171bca4b3ba5fe0bdcc073f67ce940aaff0ee735635893f86ee8") ?? (() => {
11679
+ /** One policy for capture diagnostics and unsupported adapter mappings; callbacks stay synchronous. */
11680
+ function canopyDiagnostics(format, options) {
11681
+ const policy = options.unsupportedPresentation ?? (format === "csv" ? "text" : "reject"), notify = options.onDiagnostic;
11682
+ if (policy !== "reject" && policy !== "text")
11683
+ throw new TypeError("unsupportedPresentation must be reject or text.");
11684
+ if (notify !== undefined && typeof notify !== "function")
11685
+ throw new TypeError("onDiagnostic must be a synchronous function.");
11686
+ return diagnostic => {
11687
+ if (policy === "reject")
11688
+ throw new TypeError("Unsupported Canopy presentation: " + diagnostic.code + (diagnostic.columnId ? " (" + diagnostic.columnId + ")" : ""));
11689
+ const result = notify?.(Object.freeze(diagnostic));
11690
+ if (result && typeof result.then === "function") {
11691
+ void Promise.resolve(result).catch(() => { });
11692
+ throw new TypeError("onDiagnostic must be synchronous.");
11693
+ }
11694
+ };
11695
+ }
11696
+ const _exports = Object.freeze({ canopyDiagnostics: canopyDiagnostics });
11697
+ _modules.set("3d1862d8ab32171bca4b3ba5fe0bdcc073f67ce940aaff0ee735635893f86ee8", _exports);
11698
+ return _exports;
11699
+ })();
11700
+
11701
+ const _m97 = _modules.get("9914b45196123264d883d65b074b339b224324876baa3f157c0ddec6ad1f67f9") ?? (() => {
11702
+ function presentation(input, axes) {
11703
+ const { axisKey, outlineLevel, summary, grandTotal, hidden, collapsed } = input;
11704
+ if (typeof axisKey !== "string" || !axes.has(axisKey) || !Number.isInteger(outlineLevel) || outlineLevel < 0 || outlineLevel > 7 ||
11705
+ [summary, grandTotal, hidden, collapsed].some(flag => typeof flag !== "boolean"))
11706
+ throw new TypeError("Invalid frozen Canopy pivot axis presentation.");
11707
+ return Object.freeze({ level: outlineLevel, hidden: hidden, collapsed: collapsed });
11708
+ }
11709
+ /** Qualify the explicit pivot path before flat/grouped handling; never evaluate query or aggregate data. */
11710
+ function canopyPivot(request) {
11711
+ if (request.pivot === undefined)
11712
+ return undefined;
11713
+ const pivot = request.pivot;
11714
+ if (!pivot || typeof pivot !== "object" || request.grouping !== undefined || !Array.isArray(request.columns) ||
11715
+ request.scope !== "filtered" || !Number.isSafeInteger(request.recordCount) || request.recordCount < 0 ||
11716
+ !pivot.definition || !Array.isArray(pivot.definition.rows) || pivot.definition.rows.length > 4 ||
11717
+ !Array.isArray(pivot.definition.columns) || pivot.definition.columns.length > 2 ||
11718
+ !Array.isArray(pivot.definition.values) || !pivot.definition.values.length || pivot.definition.values.length > 32 ||
11719
+ pivot.definition.values.some(value => typeof value !== "string") ||
11720
+ !Number.isSafeInteger(pivot.distinctColumns) || pivot.distinctColumns < 0 || typeof pivot.columnsLimited !== "boolean" ||
11721
+ !Array.isArray(pivot.retainedColumns) || !Array.isArray(pivot.columnGroups))
11722
+ throw new TypeError("Invalid explicit Canopy pivot descriptor.");
11723
+ const axes = (nodes) => {
11724
+ if (!Array.isArray(nodes) || nodes.length > 100001)
11725
+ throw new TypeError("Pivot axes require bounded accepted identities.");
11726
+ const keys = new Set();
11727
+ for (const node of nodes) {
11728
+ if (!node || typeof node.key !== "string" || !node.key || keys.has(node.key) || !Array.isArray(node.path) || typeof node.other !== "boolean")
11729
+ throw new TypeError("Invalid or duplicate Canopy pivot axis identity.");
11730
+ keys.add(node.key);
11731
+ }
11732
+ for (const node of nodes)
11733
+ if (node.parent !== undefined && !keys.has(node.parent))
11734
+ throw new TypeError("Unknown Canopy pivot parent identity.");
11735
+ return keys;
11736
+ };
11737
+ const rowKeys = axes(pivot.rowAxis), columnKeys = axes(pivot.columnAxis);
11738
+ const columns = request.columns.map((column, index) => {
11739
+ if (index === 0 && column.axisKey === undefined && column.kind === "text")
11740
+ return Object.freeze({ ...column });
11741
+ const outline = presentation(column, columnKeys);
11742
+ return Object.freeze({ ...column, outlineLevel: outline.level, hidden: outline.hidden, collapsed: outline.collapsed });
11743
+ });
11744
+ // Ranges are descriptor metadata, not another body. Validate them against the same ordered columns.
11745
+ if (pivot.columnGroups.length > columns.length)
11746
+ throw new RangeError("Pivot column group count exceeds projected columns.");
11747
+ for (const group of pivot.columnGroups) {
11748
+ if (!group || !columnKeys.has(group.key) || !Number.isSafeInteger(group.firstColumn) || group.firstColumn < 0 ||
11749
+ !Number.isSafeInteger(group.columnCount) || group.columnCount < 1 || group.firstColumn + group.columnCount > columns.length ||
11750
+ !Number.isInteger(group.depth) || group.depth < 1 || group.depth > 7 ||
11751
+ typeof group.hidden !== "boolean" || typeof group.collapsed !== "boolean")
11752
+ throw new TypeError("Invalid Canopy pivot column range.");
11753
+ }
11754
+ let current;
11755
+ const sheet = Object.freeze({ outlineSummaryBelow: false, outlineSummaryRight: false,
11756
+ maxOutlineLevel: 7, rowOutline: () => current,
11757
+ columnOutlines: Object.freeze(columns.flatMap((column, firstColumn) => column.axisKey === undefined ? [] :
11758
+ [Object.freeze({ firstColumn, columnCount: 1, level: column.outlineLevel, hidden: column.hidden, collapsed: column.collapsed })])) });
11759
+ return Object.freeze({ columns: Object.freeze(columns), sheet,
11760
+ observe(row) { current = presentation(row, rowKeys); } });
11761
+ }
11762
+ /** Per-cell formats preserve already-computed fractional percentages, ranks and differences. */
11763
+ function pivotNumberFormat(cell) {
11764
+ if (!["value", "percentGrandTotal", "percentParent", "percentColumn", "percentRow", "runningTotal", "rank", "difference", "percentChange"].includes(cell.mode ?? "") ||
11765
+ typeof cell.numberFormat !== "string" || !cell.numberFormat.length)
11766
+ throw new TypeError("Numeric pivot cells require a frozen mode and native numberFormat.");
11767
+ return cell.numberFormat;
11768
+ }
11769
+ const _exports = Object.freeze({ canopyPivot: canopyPivot, pivotNumberFormat: pivotNumberFormat });
11770
+ _modules.set("9914b45196123264d883d65b074b339b224324876baa3f157c0ddec6ad1f67f9", _exports);
11771
+ return _exports;
11772
+ })();
11773
+
11774
+ const _m98 = _modules.get("c0aee2c5df0df3e62ca31fc685243cdd4b449f083834e8d28cf92c20dfa7b27f") ?? (() => {
11603
11775
  /** @internal Typed conversion follows declared datetime intent, never localized display text. */
11604
11776
  function datetime(value, mode, clock) {
11605
11777
  if (mode === "text")
@@ -11639,30 +11811,7 @@ _modules.set("c0aee2c5df0df3e62ca31fc685243cdd4b449f083834e8d28cf92c20dfa7b27f",
11639
11811
  return _exports;
11640
11812
  })();
11641
11813
 
11642
- const _m96 = _modules.get("3d1862d8ab32171bca4b3ba5fe0bdcc073f67ce940aaff0ee735635893f86ee8") ?? (() => {
11643
- /** One policy for capture diagnostics and unsupported adapter mappings; callbacks stay synchronous. */
11644
- function canopyDiagnostics(format, options) {
11645
- const policy = options.unsupportedPresentation ?? (format === "csv" ? "text" : "reject"), notify = options.onDiagnostic;
11646
- if (policy !== "reject" && policy !== "text")
11647
- throw new TypeError("unsupportedPresentation must be reject or text.");
11648
- if (notify !== undefined && typeof notify !== "function")
11649
- throw new TypeError("onDiagnostic must be a synchronous function.");
11650
- return diagnostic => {
11651
- if (policy === "reject")
11652
- throw new TypeError("Unsupported Canopy presentation: " + diagnostic.code + (diagnostic.columnId ? " (" + diagnostic.columnId + ")" : ""));
11653
- const result = notify?.(Object.freeze(diagnostic));
11654
- if (result && typeof result.then === "function") {
11655
- void Promise.resolve(result).catch(() => { });
11656
- throw new TypeError("onDiagnostic must be synchronous.");
11657
- }
11658
- };
11659
- }
11660
- const _exports = Object.freeze({ canopyDiagnostics: canopyDiagnostics });
11661
- _modules.set("3d1862d8ab32171bca4b3ba5fe0bdcc073f67ce940aaff0ee735635893f86ee8", _exports);
11662
- return _exports;
11663
- })();
11664
-
11665
- const _m97 = _modules.get("040752afe195985e6f2e91f8c62fc13464c455fc44034b8cef4828851e05b83d") ?? (() => {
11814
+ const _m99 = _modules.get("040752afe195985e6f2e91f8c62fc13464c455fc44034b8cef4828851e05b83d") ?? (() => {
11666
11815
  /** Calibri 11, 96-DPI CSS pixels, seven-pixel maximum digit and five-pixel cell padding.
11667
11816
  * Quantize to native 1/256-character units; this is a reproducible profile, not pixel-identical rendering. */
11668
11817
  function canopyXlsxWidth(pixels) {
@@ -11708,10 +11857,12 @@ _modules.set("040752afe195985e6f2e91f8c62fc13464c455fc44034b8cef4828851e05b83d",
11708
11857
  return _exports;
11709
11858
  })();
11710
11859
 
11711
- const _m94 = _modules.get("a92d57114c08988b60d7dc46d24aeea3096cb6c695c12a7ea26761010692ef43") ?? (() => {
11860
+ const _m96 = _modules.get("965483034a9b849ca9359aaecae287d9a4a8ea4d64379af0f665743df7baa403") ?? (() => {
11712
11861
  const { ExportCell, checkAbort, inputRows } = _m1;
11713
11862
 
11714
- const { datetime } = _m95;
11863
+ const { canopyPivot, pivotNumberFormat } = _m97;
11864
+
11865
+ const { datetime } = _m98;
11715
11866
 
11716
11867
  const { captureFields } = _m10;
11717
11868
 
@@ -11719,11 +11870,19 @@ const { copyColumns } = _m11;
11719
11870
 
11720
11871
  const { copyCellPresentation } = _m5;
11721
11872
 
11722
- const { canopyDiagnostics } = _m96;
11873
+ const { canopyDiagnostics } = _m95;
11723
11874
 
11724
- const { canopyNumberFormat, canopyXlsxWidth } = _m97;
11875
+ const { canopyNumberFormat, canopyXlsxWidth } = _m99;
11725
11876
 
11726
11877
  const columnFields = ["width", "format", "wrapText", "alignment", "rowHeader", "groups"];
11878
+ const rawIdentities = new WeakMap();
11879
+ /** @internal Grouping uses captured identity even when a detail cell displays a relative-link label. */
11880
+ function canopyIdentityValue(value) {
11881
+ if (!(value instanceof ExportCell))
11882
+ return value;
11883
+ const original = rawIdentities.get(value);
11884
+ return original === undefined ? value.value : original;
11885
+ }
11727
11886
  /** Map an immutable CanopyX record capture to a writer without querying the grid or retaining its body. */
11728
11887
  function createCanopyExport(capture, format, options = {}) {
11729
11888
  return prepareCanopyExport(capture, format, options).source;
@@ -11735,12 +11894,16 @@ function prepareCanopyExport(capture, format, options = {}) {
11735
11894
  throw new TypeError("Canopy export format must be xlsx, csv or pdf.");
11736
11895
  if (!capture || typeof capture.rows !== "function" || !capture.request)
11737
11896
  throw new TypeError("A portable CanopyX capture with request and rows() is required.");
11738
- const request = captureFields(capture.request, ["columns", "recordCount", "values", "presentation", "timeZone", "revision", "scope", "total", "matched", "selection", "query", "generatedAt", "grouping", "formatRules"]);
11897
+ const request = captureFields(capture.request, ["columns", "recordCount", "values", "presentation", "timeZone", "revision", "scope", "total", "matched", "selection", "query", "generatedAt", "grouping", "pivot", "formatRules"]);
11898
+ const pivot = canopyPivot(request);
11739
11899
  const signal = options.signal, values = request.values;
11740
11900
  if (!Array.isArray(request.columns) || !request.columns.length || (request.recordCount !== null && (!Number.isSafeInteger(request.recordCount) || request.recordCount < 0)) ||
11741
11901
  (values !== "raw" && values !== "display") || (request.timeZone !== "utc" && request.timeZone !== "local") || typeof request.revision !== "string")
11742
11902
  throw new TypeError("Invalid portable CanopyX capture metadata.");
11743
11903
  const dateMode = options.datetime ?? "preserve", report = canopyDiagnostics(format, options);
11904
+ // These captured presentations have a complete scalar/text projection. Report
11905
+ // their visual loss without treating an ordinary report export as unsupported.
11906
+ const fallback = canopyDiagnostics(format, { ...options, unsupportedPresentation: "text" });
11744
11907
  const clock = options.xlsx?.dateMode ?? request.timeZone;
11745
11908
  if (clock !== "utc" && clock !== "local")
11746
11909
  throw new TypeError("XLSX dateMode must be utc or local.");
@@ -11751,8 +11914,10 @@ function prepareCanopyExport(capture, format, options = {}) {
11751
11914
  return;
11752
11915
  if (!Array.isArray(items) || items.some(item => typeof item !== "string"))
11753
11916
  throw new TypeError("Canopy presentation diagnostics must be strings.");
11754
- for (const code of items)
11755
- report({ code, ...(rowId === undefined ? {} : { rowId }), ...(columnId === undefined ? {} : { columnId }) });
11917
+ for (const code of items) {
11918
+ const diagnostic = { code, ...(rowId === undefined ? {} : { rowId }), ...(columnId === undefined ? {} : { columnId }) };
11919
+ (code === "relative-link" || code === "history-series" ? fallback : report)(diagnostic);
11920
+ }
11756
11921
  };
11757
11922
  if (request.presentation !== "text" && request.presentation !== "semantic")
11758
11923
  throw new TypeError("Canopy captures must declare text or semantic presentation.");
@@ -11768,11 +11933,11 @@ function prepareCanopyExport(capture, format, options = {}) {
11768
11933
  throw new TypeError("Canopy tones must be strings.");
11769
11934
  const style = tones.get(name);
11770
11935
  if (!style && name !== "neutral")
11771
- report({ code: "UNMAPPED_TONE:" + name, rowId, ...(columnId === undefined ? {} : { columnId }) });
11936
+ fallback({ code: "UNMAPPED_TONE:" + name, rowId, ...(columnId === undefined ? {} : { columnId }) });
11772
11937
  return style;
11773
11938
  };
11774
11939
  const ids = new Set();
11775
- const specs = request.columns.map(input => {
11940
+ const specs = (pivot?.columns ?? request.columns).map(input => {
11776
11941
  const fields = captureFields(input, ["id", "title", "kind", "width", "pinned", "format", "wrap", "alignment", "diagnostics"]);
11777
11942
  const column = Object.freeze({ ...fields,
11778
11943
  ...(fields.width === undefined ? {} : { width: Object.freeze(captureFields(fields.width, ["unit", "preferred", "minimum", "maximum"])) }),
@@ -11783,7 +11948,7 @@ function prepareCanopyExport(capture, format, options = {}) {
11783
11948
  (column.width !== undefined && (column.width.unit !== "css-px" || !Number.isFinite(column.width.preferred) ||
11784
11949
  !Number.isFinite(column.width.minimum) || column.width.minimum <= 0 || column.width.preferred < column.width.minimum ||
11785
11950
  column.width.maximum !== undefined && (!Number.isFinite(column.width.maximum) || column.width.maximum < column.width.preferred))) ||
11786
- (request.presentation === "semantic" && (column.wrap === undefined || column.alignment === undefined || column.width === undefined)))
11951
+ (!pivot && request.presentation === "semantic" && (column.wrap === undefined || column.alignment === undefined || column.width === undefined)))
11787
11952
  throw new TypeError("Invalid or duplicate Canopy export column.");
11788
11953
  ids.add(column.id);
11789
11954
  diagnostics(column.diagnostics, undefined, column.id);
@@ -11792,16 +11957,20 @@ function prepareCanopyExport(capture, format, options = {}) {
11792
11957
  if (!columnFields.includes(key))
11793
11958
  throw new TypeError("Unsupported Canopy column option: " + key);
11794
11959
  const override = captureFields(selected, columnFields);
11795
- const numericFormat = format === "xlsx" && values === "raw" && column.kind === "number" && column.format !== undefined && override.format === undefined
11960
+ const numericFormat = (format === "xlsx" || format === "pdf") && values === "raw" && column.kind === "number" && column.format !== undefined && override.format === undefined
11796
11961
  ? canopyNumberFormat(column.format, report, column.id) : undefined;
11797
11962
  const [captured] = copyColumns([{ ...override, key: column.id, header: column.title,
11798
11963
  ...(format === "xlsx" && override.width === undefined && column.width !== undefined ? { width: canopyXlsxWidth(column.width.preferred) } : {}),
11799
11964
  ...(override.format === undefined && numericFormat !== undefined ? { format: numericFormat } : {}),
11800
11965
  ...(format === "xlsx" && values === "raw" && column.kind === "datetime" && override.format === undefined ? { format: "yyyy-mm-dd hh:mm:ss.000" } : {}),
11801
11966
  ...(values === "raw" && column.kind === "number" ? { type: "number" } : {}),
11802
- ...(override.wrapText === undefined && column.wrap === undefined ? {} : { wrapText: override.wrapText ?? column.wrap }),
11803
- ...(override.alignment === undefined && column.alignment === undefined ? {} : { alignment: override.alignment ?? column.alignment }) }]);
11804
- return Object.freeze({ id: column.id, kind: column.kind, input: column, column: Object.freeze(captured) });
11967
+ // Screen nowrap is not a promise that its CSS width will survive PDF fitting.
11968
+ // PDF defaults to lossless wrapping; an explicit writer override stays strict.
11969
+ ...(format === "pdf" ? { wrapText: override.wrapText ?? true } :
11970
+ override.wrapText === undefined && column.wrap === undefined ? {} : { wrapText: override.wrapText ?? column.wrap }),
11971
+ ...(override.alignment === undefined && column.alignment === undefined ?
11972
+ format === "pdf" && column.kind === "number" ? { alignment: "right" } : {} : { alignment: override.alignment ?? column.alignment }) }]);
11973
+ return Object.freeze({ id: column.id, kind: column.kind, input: column, nativeFormatOverride: override.format, column: Object.freeze(captured) });
11805
11974
  });
11806
11975
  const rowCount = request.recordCount;
11807
11976
  const source = Object.freeze({ columns: Object.freeze(specs.map(spec => spec.column)), rowCount, async *rows() {
@@ -11811,6 +11980,7 @@ function prepareCanopyExport(capture, format, options = {}) {
11811
11980
  checkAbort(signal);
11812
11981
  if (!row || typeof row.id !== "string" || !row.cells || typeof row.cells !== "object")
11813
11982
  throw new TypeError("Invalid Canopy export record.");
11983
+ pivot?.observe(row);
11814
11984
  diagnostics(row.diagnostics, row.id);
11815
11985
  const rowStyle = tone(row.tone, row.id), result = [];
11816
11986
  for (const spec of specs) {
@@ -11822,13 +11992,29 @@ function prepareCanopyExport(capture, format, options = {}) {
11822
11992
  (typeof cell.value === "number" && (!Number.isFinite(cell.value) || Math.abs(cell.value) > Number.MAX_SAFE_INTEGER)))
11823
11993
  throw new TypeError("A portable Canopy GridExportCell with scalar value and resolved text is required.");
11824
11994
  diagnostics(cell.diagnostics, row.id, spec.id);
11825
- let value = values === "display" ? cell.text : cell.value;
11995
+ // A relative destination is navigation metadata, not the visible label.
11996
+ // History captures already carry their frozen latest scalar (or null).
11997
+ const relativeLabel = spec.kind === "text" && cell.diagnostics?.includes("relative-link");
11998
+ let value = values === "display" || relativeLabel ? cell.text : cell.value;
11826
11999
  if (format === "xlsx" && values === "raw" && spec.kind === "datetime" && typeof value === "string")
11827
12000
  value = datetime(value, dateMode, clock);
11828
- const cellStyle = tone(cell.tone, row.id, spec.id), presentation = rowStyle || cellStyle ? { ...rowStyle, ...cellStyle } : undefined;
12001
+ const capturedFormat = pivot && spec.kind === "number" && cell.value !== null ? pivotNumberFormat(cell) : undefined;
12002
+ const nativeFormat = capturedFormat === undefined ? undefined : spec.nativeFormatOverride === "" ? "General" : spec.nativeFormatOverride ?? capturedFormat;
12003
+ const summary = format === "pdf" && pivot && (row.summary || row.grandTotal);
12004
+ const cellStyle = tone(cell.tone, row.id, spec.id), presentation = rowStyle || cellStyle || nativeFormat || summary ? {
12005
+ ...rowStyle, ...(summary ? { bold: true } : {}), ...cellStyle,
12006
+ ...((format === "xlsx" || format === "pdf") && values === "raw" && nativeFormat !== undefined ? { numberFormat: nativeFormat } : {})
12007
+ } : undefined;
11829
12008
  // CSV has no presentation or link metadata: emit its selected scalar directly.
11830
12009
  // This also avoids a frozen wrapper for every cell in large CSV captures.
11831
- result.push(format === "csv" ? value : new ExportCell(value, { text: cell.text, ...(presentation ? { presentation } : {}), ...(cell.link === undefined ? {} : { link: cell.link }) }));
12010
+ if (format === "csv")
12011
+ result.push(value);
12012
+ else {
12013
+ const exported = new ExportCell(value, { text: cell.text, ...(presentation ? { presentation } : {}), ...(cell.link === undefined ? {} : { link: cell.link }) });
12014
+ if (relativeLabel)
12015
+ rawIdentities.set(exported, cell.value);
12016
+ result.push(exported);
12017
+ }
11832
12018
  }
11833
12019
  if (rowCount !== null && count >= rowCount)
11834
12020
  throw new TypeError("Canopy capture exceeded its declared recordCount.");
@@ -11838,19 +12024,19 @@ function prepareCanopyExport(capture, format, options = {}) {
11838
12024
  if (rowCount !== null && count !== rowCount)
11839
12025
  throw new TypeError("Canopy capture did not produce its declared recordCount.");
11840
12026
  } });
11841
- return Object.freeze({ source, request: Object.freeze({ ...request, columns: Object.freeze(specs.map(spec => spec.input)) }), report, tones });
12027
+ return Object.freeze({ source, request: Object.freeze({ ...request, columns: Object.freeze(specs.map(spec => spec.input)) }), report, tones, pivot });
11842
12028
  }
11843
- const _exports = Object.freeze({ createCanopyExport: createCanopyExport, prepareCanopyExport: prepareCanopyExport });
11844
- _modules.set("a92d57114c08988b60d7dc46d24aeea3096cb6c695c12a7ea26761010692ef43", _exports);
12029
+ const _exports = Object.freeze({ canopyIdentityValue: canopyIdentityValue, createCanopyExport: createCanopyExport, prepareCanopyExport: prepareCanopyExport });
12030
+ _modules.set("965483034a9b849ca9359aaecae287d9a4a8ea4d64379af0f665743df7baa403", _exports);
11845
12031
  return _exports;
11846
12032
  })();
11847
12033
 
11848
- const _m99 = _modules.get("237239bcf5fa7675f75c53d2f367d843e089051bfd9f586770330a2c504ce1f7") ?? (() => {
12034
+ const _m101 = _modules.get("2b0b73e8c376d24e6a5b498c0f710966b00de0eff44f474d7b2aece7af64fa96") ?? (() => {
11849
12035
  const { columnName, excelDate } = _m35;
11850
12036
 
11851
12037
  const { captureFields } = _m10;
11852
12038
 
11853
- const { datetime } = _m95;
12039
+ const { datetime } = _m98;
11854
12040
 
11855
12041
  /** Compile only comparisons whose raw types and native encodings have a faithful bounded mapping. */
11856
12042
  function canopyPredicate(request, grouped, options, root, unsupported, cellTypes) {
@@ -11960,14 +12146,14 @@ function canopyPredicate(request, grouped, options, root, unsupported, cellTypes
11960
12146
  return formula;
11961
12147
  }
11962
12148
  const _exports = Object.freeze({ canopyPredicate: canopyPredicate });
11963
- _modules.set("237239bcf5fa7675f75c53d2f367d843e089051bfd9f586770330a2c504ce1f7", _exports);
12149
+ _modules.set("2b0b73e8c376d24e6a5b498c0f710966b00de0eff44f474d7b2aece7af64fa96", _exports);
11964
12150
  return _exports;
11965
12151
  })();
11966
12152
 
11967
- const _m98 = _modules.get("13582dc7ba6ecf2a33722c6fee326b500408542ffdaa5cdac26ae72c310ea1ba") ?? (() => {
12153
+ const _m100 = _modules.get("eb8cf81d2a340cdb41301d59c667cef44f3ad1d6a19f717eb8137257b545115e") ?? (() => {
11968
12154
  const { captureFields } = _m10;
11969
12155
 
11970
- const { canopyPredicate } = _m99;
12156
+ const { canopyPredicate } = _m101;
11971
12157
 
11972
12158
  // Stable document palette. Browser CSS variables and resolved cell.format are never interpreted.
11973
12159
  const palette = {
@@ -12144,25 +12330,25 @@ function canopyRules(request, format, grouped, tones, report, options = {}, cell
12144
12330
  return Object.freeze([...visuals, ...cells, ...rows]);
12145
12331
  }
12146
12332
  const _exports = Object.freeze({ canopyRules: canopyRules });
12147
- _modules.set("13582dc7ba6ecf2a33722c6fee326b500408542ffdaa5cdac26ae72c310ea1ba", _exports);
12333
+ _modules.set("eb8cf81d2a340cdb41301d59c667cef44f3ad1d6a19f717eb8137257b545115e", _exports);
12148
12334
  return _exports;
12149
12335
  })();
12150
12336
 
12151
- const _m100 = _modules.get("0f2b50bd606bf0a3273e7a3bec7ed6255f23cfee522a7cfeb2cb676c062ad40e") ?? (() => {
12337
+ const _m102 = _modules.get("4aefd89b060b86e8e6e50a47a502f9ee7e64a2a1df334e0e9482f7ed30f0bee2") ?? (() => {
12152
12338
  const { createGroupedReport } = _m8;
12153
12339
 
12154
- const { ExportCell } = _m5;
12155
-
12156
12340
  const { checkAbort } = _m4;
12157
12341
 
12158
12342
  const { createTotals } = _m12;
12159
12343
 
12160
12344
  const { captureFields } = _m10;
12161
12345
 
12162
- const { datetime } = _m95;
12346
+ const { datetime } = _m98;
12347
+
12348
+ const { canopyIdentityValue } = _m96;
12163
12349
 
12164
12350
  const identity = (value) => value instanceof Date ? "date:" + value.getTime() : typeof value + ":" + String(value);
12165
- const scalar = (value) => value instanceof ExportCell ? value.value : value;
12351
+ const scalar = canopyIdentityValue;
12166
12352
  /** Validate captured ranges, then use the owned grouping factory and its existing writers.
12167
12353
  * Only ranges, labels and at most four active aggregate vectors are retained; no detail body is buffered. */
12168
12354
  function canopyGrouped(source, request, options, limits, report, format) {
@@ -12329,10 +12515,20 @@ function canopyGrouped(source, request, options, limits, report, format) {
12329
12515
  }
12330
12516
  verify(grand, grandExpected);
12331
12517
  }
12518
+ // The factory's hidden fields keep raw group identity separate from projected
12519
+ // detail labels. Never override a declared output column's value getter.
12520
+ const groupKeys = new Set([...source.columns.map(column => column.key), ...levels.map(level => level.column)]);
12332
12521
  const groupBy = levels.map((level, depth) => {
12333
- const visible = source.columns.some(column => column.key === level.column);
12334
- return { key: level.column,
12335
- ...(visible ? {} : { value: (_row, context) => at(depth, context.rowIndex).value }),
12522
+ const column = source.columns.findIndex(column => column.key === level.column);
12523
+ let key = level.column;
12524
+ if (column >= 0) {
12525
+ do {
12526
+ key += "#raw";
12527
+ } while (groupKeys.has(key));
12528
+ groupKeys.add(key);
12529
+ }
12530
+ return { key,
12531
+ value: (row, context) => column < 0 ? at(depth, context.rowIndex).value : scalar(row[column]),
12336
12532
  label: (value) => labels[depth].get(identity(value)) ?? String(value ?? "") };
12337
12533
  });
12338
12534
  const sourceLimits = limits === undefined ? undefined : {
@@ -12344,11 +12540,11 @@ function canopyGrouped(source, request, options, limits, report, format) {
12344
12540
  ...(options.signal === undefined ? {} : { signal: options.signal }), ...(sourceLimits === undefined ? {} : { limits: sourceLimits }) });
12345
12541
  }
12346
12542
  const _exports = Object.freeze({ canopyGrouped: canopyGrouped });
12347
- _modules.set("0f2b50bd606bf0a3273e7a3bec7ed6255f23cfee522a7cfeb2cb676c062ad40e", _exports);
12543
+ _modules.set("4aefd89b060b86e8e6e50a47a502f9ee7e64a2a1df334e0e9482f7ed30f0bee2", _exports);
12348
12544
  return _exports;
12349
12545
  })();
12350
12546
 
12351
- const _m101 = _modules.get("c3e14cc7c7a8367d216ab1ca0b2a41751cc8775866d730cb941d062509dd4886") ?? (() => {
12547
+ const _m103 = _modules.get("9ee68b08aff01ebcd88790854ac27b71235c5df5cab4a9575ffcf267e8fea5ea") ?? (() => {
12352
12548
  const { cellText } = _m35;
12353
12549
 
12354
12550
  const { cleanXml } = _m28;
@@ -12403,14 +12599,14 @@ function canopyAbout(request, options) {
12403
12599
  return Object.freeze(result.map(row => Object.freeze(row)));
12404
12600
  }
12405
12601
  const _exports = Object.freeze({ canopyAbout: canopyAbout });
12406
- _modules.set("c3e14cc7c7a8367d216ab1ca0b2a41751cc8775866d730cb941d062509dd4886", _exports);
12602
+ _modules.set("9ee68b08aff01ebcd88790854ac27b71235c5df5cab4a9575ffcf267e8fea5ea", _exports);
12407
12603
  return _exports;
12408
12604
  })();
12409
12605
 
12410
- const _m102 = _modules.get("e9bef8c7399cd0b119a8802014687efc2004572db8fa3045f2dbfe3c37ab6fb9") ?? (() => {
12606
+ const _m104 = _modules.get("ccfefc97a47cc288f2c9a2eed33fff323570e35193cedbd876ebb3e8fb78a42e") ?? (() => {
12411
12607
  const { Workbook, addGroupedXlsx } = _m23;
12412
12608
 
12413
- const { portableWorkbook } = _m52;
12609
+ const { portableWorkbook } = _m53;
12414
12610
 
12415
12611
  const { withDestination } = _m3;
12416
12612
 
@@ -12464,11 +12660,191 @@ async function writeCanopyWorkbook(source, grouped, destination, options, labels
12464
12660
  });
12465
12661
  }
12466
12662
  const _exports = Object.freeze({ writeCanopyWorkbook: writeCanopyWorkbook });
12467
- _modules.set("e9bef8c7399cd0b119a8802014687efc2004572db8fa3045f2dbfe3c37ab6fb9", _exports);
12663
+ _modules.set("ccfefc97a47cc288f2c9a2eed33fff323570e35193cedbd876ebb3e8fb78a42e", _exports);
12664
+ return _exports;
12665
+ })();
12666
+
12667
+ const _m106 = _modules.get("0fb3a852d2d81b9921e07024df980295e7d9ad436f8f1640d90456dd4e36e2e0") ?? (() => {
12668
+ const { ExportCell } = _m1;
12669
+
12670
+ /** Fixed numeric formats affect PDF text, not the frozen numeric value used by other writers. */
12671
+ function numericProfile(format) {
12672
+ if (format === undefined)
12673
+ return undefined;
12674
+ const match = /^((?:"[^"\\]*")*)(#,##)?0(?:\.([0#]+))?(%)?((?:"[^"\\]*")*)$/.exec(format);
12675
+ if (!match || (match[3]?.length ?? 0) > 10)
12676
+ return undefined;
12677
+ return { minimumFractionDigits: (match[3]?.match(/0/g) ?? []).length, maximumFractionDigits: match[3]?.length ?? 0,
12678
+ percent: !!match[4], grouping: !!match[2], prefix: match[1].replace(/"/g, ""), suffix: match[5].replace(/"/g, "") };
12679
+ }
12680
+ /** Preserve the captured decimal convention across a column, including whole percentages without a separator. */
12681
+ function canopyPdfNumbers(sample, columns) {
12682
+ const formatters = new Map();
12683
+ const decimal = columns.map((column, index) => {
12684
+ let fallback = ".";
12685
+ for (const row of sample) {
12686
+ const cell = row[index];
12687
+ if (!(cell instanceof ExportCell) || typeof cell.value !== "number")
12688
+ continue;
12689
+ const profile = numericProfile(cell.presentation?.numberFormat ?? column.format);
12690
+ if (!profile?.maximumFractionDigits)
12691
+ continue;
12692
+ const match = /([.,])(\d+)[^\d.,]*$/.exec(cell.text ?? "");
12693
+ if (match && match[2].length <= profile.maximumFractionDigits) {
12694
+ const numeric = /([+-]?\d[\d.,]*)[^\d]*$/.exec(cell.text ?? "")?.[1] ?? "";
12695
+ const scaled = cell.value * (profile.percent ? 100 : 1);
12696
+ if (/^[+-]?\d{1,3}(?:,\d{3})+$/.test(numeric) || /^[+-]?\d{1,3}(?:\.\d{3})+$/.test(numeric)) {
12697
+ if (Math.abs(Number(numeric.replace(/[.,]/g, "")) - scaled) < .5) {
12698
+ fallback = match[1] === "," ? "." : ",";
12699
+ continue;
12700
+ }
12701
+ }
12702
+ return match[1];
12703
+ }
12704
+ }
12705
+ return fallback;
12706
+ });
12707
+ return row => row.map((value, index) => {
12708
+ if (!(value instanceof ExportCell) || typeof value.value !== "number")
12709
+ return value;
12710
+ const profile = numericProfile(value.presentation?.numberFormat ?? columns[index].format);
12711
+ if (!profile)
12712
+ return value;
12713
+ const captured = /^([^0-9+-]*)([+-]?\d[\d., \u00a0\u202f]*?)([^0-9]*)$/.exec(value.text ?? "");
12714
+ if (value.text && !captured)
12715
+ return value;
12716
+ const key = [decimal[index], profile.minimumFractionDigits, profile.maximumFractionDigits, profile.grouping].join(":");
12717
+ let formatter = formatters.get(key);
12718
+ if (!formatter) {
12719
+ formatter = new Intl.NumberFormat(decimal[index] === "," ? "de-DE" : "en-US", {
12720
+ minimumFractionDigits: profile.minimumFractionDigits, maximumFractionDigits: profile.maximumFractionDigits, useGrouping: profile.grouping
12721
+ });
12722
+ formatters.set(key, formatter);
12723
+ }
12724
+ const formatted = formatter.format(value.value * (profile.percent ? 100 : 1));
12725
+ const prefix = profile.prefix || captured?.[1] || "";
12726
+ let suffix = profile.suffix || captured?.[3] || "";
12727
+ if (profile.percent && !profile.suffix)
12728
+ suffix = suffix.replace(/%/g, "");
12729
+ return new ExportCell(value.value, { text: prefix + formatted + (profile.percent ? "%" : "") + suffix,
12730
+ ...(value.presentation ? { presentation: value.presentation } : {}), ...(value.link ? { link: value.link } : {}) });
12731
+ });
12732
+ }
12733
+ const _exports = Object.freeze({ canopyPdfNumbers: canopyPdfNumbers });
12734
+ _modules.set("0fb3a852d2d81b9921e07024df980295e7d9ad436f8f1640d90456dd4e36e2e0", _exports);
12468
12735
  return _exports;
12469
12736
  })();
12470
12737
 
12471
- const _m0 = _modules.get("06222f91ea59fdd2aff673ab351a19c8b3372e05c612adf6136ffa05ee8bf037") ?? (() => {
12738
+ const _m105 = _modules.get("8cf0b0de5a9930ea2c50a459ce70b695b69483978ca9343cb2c22982845ff142") ?? (() => {
12739
+ const { ExportCell, NotSupportedError, OfficeIMOError } = _m1;
12740
+
12741
+ const { inputRows, checkAbort, pause, taskYieldDue } = _m4;
12742
+
12743
+ const { fontProgram } = _m64;
12744
+
12745
+ const { resolveScalar, selectFont, validateFonts } = _m68;
12746
+
12747
+ const { settings } = _m17;
12748
+
12749
+ const { canopyPdfNumbers } = _m106;
12750
+
12751
+ /** A bounded lookahead is replayed once; no second capture, full-dataset copy or smaller font is needed. */
12752
+ async function withCanopyPdfLayout(source, captured, options, write) {
12753
+ const prepared = settings({ ...options, columns: source.columns }), { fontSize, padding, page, margins, limits } = prepared;
12754
+ options = prepared.options;
12755
+ validateFonts(options.fonts, limits.maxFontBytes);
12756
+ const available = page.width - margins.left - margins.right;
12757
+ const iterator = inputRows(source.rows(), options.signal)[Symbol.asyncIterator](), sample = [];
12758
+ let done = false, characters = 0;
12759
+ try {
12760
+ while (sample.length < Math.min(128, options.limits?.maxRows ?? 128) && characters < 262144) {
12761
+ const item = await iterator.next();
12762
+ if (item.done) {
12763
+ done = true;
12764
+ break;
12765
+ }
12766
+ sample.push(item.value);
12767
+ characters += item.value.reduce((n, cell) => n + (cell instanceof ExportCell ? cell.text?.length ?? 0 : String(cell ?? "").length), 0);
12768
+ }
12769
+ const format = canopyPdfNumbers(sample, source.columns), rows = sample.map(format);
12770
+ const measure = (text, bold = false, italic = false) => {
12771
+ if (text.length > limits.maxCellCharacters)
12772
+ throw new OfficeIMOError("RESOURCE_LIMIT", "maxCellCharacters exceeded.");
12773
+ const face = selectFont(options.fonts, bold, italic), program = face.font ? fontProgram(face.font) : undefined;
12774
+ let width = 0;
12775
+ for (const character of text.replace(/\t/g, " ")) {
12776
+ const scalar = resolveScalar(character.codePointAt(0), program, bold);
12777
+ if (!scalar.supported)
12778
+ throw new NotSupportedError(scalar.message);
12779
+ width += scalar.width * fontSize / 1000;
12780
+ }
12781
+ return width;
12782
+ };
12783
+ const largest = (parts, bold = false, italic = false) => parts.reduce((width, part) => Math.max(width, measure(part, bold, italic)), 0);
12784
+ let layout = {};
12785
+ // Explicit points/bands and shaping providers retain their own layout policy.
12786
+ if (!options.columnWidths && typeof options.wideTable !== "object" && !options.textShaper) {
12787
+ const minimum = source.columns.map(column => Math.min(available, largest(column.header.split(/\s+/), prepared.options.headerPresentation?.bold) + padding * 2 + .01));
12788
+ const natural = source.columns.map((column, index) => Math.min(available, Math.max(minimum[index], largest(column.header.split(/\r\n?|\n/), prepared.options.headerPresentation?.bold) + padding * 2 + .01)));
12789
+ for (const row of rows) {
12790
+ for (let i = 0; i < row.length; i++) {
12791
+ const cell = row[i], text = cell instanceof ExportCell ? cell.text ?? String(cell.value ?? "") : String(cell ?? "");
12792
+ const style = cell instanceof ExportCell ? cell.presentation : undefined;
12793
+ const line = largest(text.split(/\r\n?|\n/), style?.bold, style?.italic) + padding * 2 + .01;
12794
+ const word = largest(text.split(/\s+/), style?.bold, style?.italic) + padding * 2 + .01;
12795
+ natural[i] = Math.min(available, Math.max(natural[i], line));
12796
+ minimum[i] = Math.min(available, Math.max(minimum[i], captured[i].kind === "text" ? word : line));
12797
+ }
12798
+ if (taskYieldDue())
12799
+ await pause();
12800
+ checkAbort(options.signal);
12801
+ }
12802
+ const sum = minimum.reduce((total, width) => total + width, 0), widths = [...minimum];
12803
+ if (sum > available + .001)
12804
+ layout = { columnWidths: widths, wideTable: options.wideTable === "reject" ? "reject" : {
12805
+ mode: "bands", repeatColumns: widths[0] + Math.max(...widths.slice(1)) <= available ? [0] : []
12806
+ } };
12807
+ else {
12808
+ let spare = available - sum;
12809
+ const needs = natural.map((width, index) => Math.max(0, width - widths[index])), total = needs.reduce((n, width) => n + width, 0);
12810
+ for (let i = 0; i < widths.length; i++)
12811
+ widths[i] += total ? needs[i] * Math.min(1, spare / total) : 0;
12812
+ spare = available - widths.reduce((n, width) => n + width, 0);
12813
+ const text = captured.flatMap((column, index) => column.kind === "text" ? [index] : []);
12814
+ for (const i of text.length ? text : widths.map((_, index) => index))
12815
+ widths[i] += spare / (text.length || widths.length);
12816
+ layout = { columnWidths: widths };
12817
+ }
12818
+ }
12819
+ const replay = async function* () {
12820
+ for (const row of rows)
12821
+ yield row;
12822
+ while (!done) {
12823
+ const item = await iterator.next();
12824
+ if (item.done) {
12825
+ done = true;
12826
+ break;
12827
+ }
12828
+ yield format(item.value);
12829
+ }
12830
+ };
12831
+ return await write(replay(), layout, prepared.options);
12832
+ }
12833
+ finally {
12834
+ if (!done) {
12835
+ try {
12836
+ void iterator.return(undefined).catch(() => { });
12837
+ }
12838
+ catch { /* Keep the writer's original failure. */ }
12839
+ }
12840
+ }
12841
+ }
12842
+ const _exports = Object.freeze({ withCanopyPdfLayout: withCanopyPdfLayout });
12843
+ _modules.set("8cf0b0de5a9930ea2c50a459ce70b695b69483978ca9343cb2c22982845ff142", _exports);
12844
+ return _exports;
12845
+ })();
12846
+
12847
+ const _m0 = _modules.get("8a4acb328f0d0bd6089df8bcce4099064ea408bdef1e20d13fdbe59b083c76c9") ?? (() => {
12472
12848
  const { BlobByteSink, ExportCell } = _m1;
12473
12849
 
12474
12850
  const { notifyProgress } = _m14;
@@ -12479,21 +12855,25 @@ const { captureCommonLimits, captureXlsxOptions, captureCsvOptions, capturePdfOp
12479
12855
 
12480
12856
  const { writeXlsxTo } = _m23;
12481
12857
 
12482
- const { writeCsvTo } = _m55;
12858
+ const { writeCsvTo } = _m56;
12859
+
12860
+ const { writePdfTo, writeGroupedPdfTo } = _m58;
12861
+
12862
+ const { canopyDiagnostics } = _m95;
12483
12863
 
12484
- const { writePdfTo, writeGroupedPdfTo } = _m57;
12864
+ const { prepareCanopyExport } = _m96;
12485
12865
 
12486
- const { prepareCanopyExport } = _m94;
12866
+ const { canopyPins } = _m99;
12487
12867
 
12488
- const { canopyPins } = _m97;
12868
+ const { canopyRules } = _m100;
12489
12869
 
12490
- const { canopyRules } = _m98;
12870
+ const { canopyGrouped } = _m102;
12491
12871
 
12492
- const { canopyGrouped } = _m100;
12872
+ const { canopyAbout } = _m103;
12493
12873
 
12494
- const { canopyAbout } = _m101;
12874
+ const { writeCanopyWorkbook } = _m104;
12495
12875
 
12496
- const { writeCanopyWorkbook } = _m102;
12876
+ const { withCanopyPdfLayout } = _m105;
12497
12877
 
12498
12878
 
12499
12879
 
@@ -12508,7 +12888,7 @@ async function writeCanopyTo(capture, format, destination, options = {}) {
12508
12888
  const xlsx = captureXlsxOptions(format === "xlsx" ? selected.xlsx : undefined);
12509
12889
  const csv = captureCsvOptions(format === "csv" ? selected.csv : undefined);
12510
12890
  const pdf = capturePdfOptions(format === "pdf" ? selected.pdf : undefined);
12511
- const prepared = prepareCanopyExport(capture, format, { ...selected, xlsx }), { request, report, tones } = prepared;
12891
+ const prepared = prepareCanopyExport(capture, format, { ...selected, xlsx }), { request, report, tones, pivot } = prepared;
12512
12892
  if (selected.about !== undefined && typeof selected.about !== "boolean")
12513
12893
  throw new TypeError("Canopy about must be boolean.");
12514
12894
  const labels = selected.grouped === undefined ? undefined : captureFields(selected.grouped, ["labelColumn", "subtotalLabel", "grandTotalLabel", "includeGrandTotal", "continuationLabel", "groupHeadingLevel"]);
@@ -12539,9 +12919,14 @@ async function writeCanopyTo(capture, format, destination, options = {}) {
12539
12919
  } } : {};
12540
12920
  const stream = { ...(signal ? { signal } : {}), ...progress };
12541
12921
  if (format === "xlsx") {
12542
- const formatLimits = mergeAdapterLimits(xlsx.limits, limits), grouped = canopyGrouped(source, request, { ...selected, xlsx }, formatLimits, report, format);
12922
+ const formatLimits = mergeAdapterLimits(xlsx.limits, limits), grouped = pivot ? undefined : canopyGrouped(source, request, { ...selected, xlsx }, formatLimits, report, format);
12543
12923
  const pinned = canopyPins(request.columns, report), rules = canopyRules(request, format, grouped !== undefined, tones, report, { ...selected, xlsx }, ruleCellTypes);
12544
- const sheet = { ...xlsx.sheet,
12924
+ if (pivot && (xlsx.sheet?.rowOutline !== undefined || xlsx.sheet?.columnOutlines !== undefined || xlsx.sheet?.maxOutlineLevel !== undefined ||
12925
+ xlsx.sheet?.outlineSummaryBelow !== undefined || xlsx.sheet?.outlineSummaryRight !== undefined || xlsx.sheet?.table !== undefined || xlsx.sheet?.footer !== undefined))
12926
+ throw new TypeError("Captured pivot metadata owns outlines and totals; worksheet overrides cannot regroup or recalculate it.");
12927
+ if (pivot && xlsx.cellValueWriters !== undefined)
12928
+ throw new TypeError("Captured pivot exports use frozen values rather than custom cellValueWriters.");
12929
+ const sheet = { ...xlsx.sheet, ...(pivot?.sheet ?? {}), ...(pivot ? { autoFilter: false } : {}),
12545
12930
  freezeHeader: xlsx.sheet?.freezeHeader ?? (xlsx.sheet?.includeHeader !== false),
12546
12931
  freezeColumns: xlsx.sheet?.freezeColumns ?? (pinned ? pinned + (grouped ? 1 : 0) : 0),
12547
12932
  conditionalFormats: [...rules, ...(xlsx.sheet?.conditionalFormats ?? [])] };
@@ -12550,13 +12935,17 @@ async function writeCanopyTo(capture, format, destination, options = {}) {
12550
12935
  return writeCanopyWorkbook(source, grouped, destination, settings, capturedLabels, about);
12551
12936
  return writeXlsxTo(source.rows(), destination, settings);
12552
12937
  }
12938
+ if (pivot)
12939
+ canopyDiagnostics(format, { ...selected, unsupportedPresentation: "text" })({ code: "PIVOT_OUTLINES_XLSX_ONLY" });
12553
12940
  if (format === "pdf") {
12554
- const formatLimits = mergeAdapterLimits(pdf.limits, limits), grouped = canopyGrouped(source, request, selected, formatLimits, report, format);
12941
+ if (pivot && pdf.footer?.totals !== undefined)
12942
+ throw new TypeError("Captured pivot metadata owns totals; PDF footer totals cannot recalculate it.");
12943
+ const formatLimits = mergeAdapterLimits(pdf.limits, limits), grouped = pivot ? undefined : canopyGrouped(source, request, selected, formatLimits, report, format);
12555
12944
  canopyRules(request, format, grouped !== undefined, tones, report, selected);
12556
12945
  // CSS pixels become points before the existing fit/band policy. Explicit PDF point widths win.
12557
12946
  const fitted = request.columns.every(column => column.width !== undefined) ? request.columns.map(column => column.width.preferred * 72 / 96) : undefined;
12558
12947
  const widths = pdf.columnWidths ?? fitted;
12559
- const settings = { ...(fitted === undefined ? {} : { orientation: "landscape", wideTable: "fit" }), ...pdf, ...stream, limits: formatLimits };
12948
+ const settings = { orientation: "landscape", wideTable: "fit", ...pdf, ...stream, limits: formatLimits };
12560
12949
  if (grouped) {
12561
12950
  if (pdf.headerRows !== undefined || pdf.footer !== undefined)
12562
12951
  throw new TypeError("Grouped Canopy PDF owns heading and summary rows.");
@@ -12570,7 +12959,13 @@ async function writeCanopyTo(capture, format, destination, options = {}) {
12570
12959
  ...(capturedLabels?.continuationLabel === undefined ? {} : { continuationLabel: capturedLabels.continuationLabel }),
12571
12960
  ...(capturedLabels?.groupHeadingLevel === undefined ? {} : { groupHeadingLevel: capturedLabels.groupHeadingLevel }) });
12572
12961
  }
12573
- return writePdfTo(source.rows(), destination, { ...settings, columns: source.columns, ...(widths === undefined ? {} : { columnWidths: widths }) });
12962
+ return withCanopyPdfLayout(prepared.source, request.columns, settings, async (rows, layout, captured) => {
12963
+ const counted = async function* () { for await (const row of rows) {
12964
+ consumed++;
12965
+ yield row;
12966
+ } };
12967
+ return writePdfTo(counted(), destination, { ...captured, ...layout, columns: source.columns });
12968
+ });
12574
12969
  }
12575
12970
  return writeCsvTo(source.rows(), destination, { ...csv, ...stream, columns: source.columns, valueMode: request.values,
12576
12971
  limits: mergeAdapterLimits(csv.limits, limits) });
@@ -12587,8 +12982,8 @@ async function exportCanopy(capture, format, options = {}) {
12587
12982
  throw error;
12588
12983
  }
12589
12984
  }
12590
- const _exports = Object.freeze({ createCanopyExport: _m94.createCanopyExport, ExportCell: _m5.ExportCell, PdfFont: _m63.PdfFont, writeCanopyTo: writeCanopyTo, exportCanopy: exportCanopy });
12591
- _modules.set("06222f91ea59fdd2aff673ab351a19c8b3372e05c612adf6136ffa05ee8bf037", _exports);
12985
+ const _exports = Object.freeze({ createCanopyExport: _m96.createCanopyExport, ExportCell: _m5.ExportCell, PdfFont: _m64.PdfFont, writeCanopyTo: writeCanopyTo, exportCanopy: exportCanopy });
12986
+ _modules.set("8a4acb328f0d0bd6089df8bcce4099064ea408bdef1e20d13fdbe59b083c76c9", _exports);
12592
12987
  return _exports;
12593
12988
  })();
12594
12989
  Object.assign(officeimo, _m0);