@sheetxl/io-xlsx 0.8.0-beta.2 → 0.8.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/{DhqYgh9G2vLn7mIE.mjs → BCQs67LTVZ1xG82R.mjs} +3 -3
  3. package/browser/esm/B_Jfq-O7tght6ixL.mjs +4631 -0
  4. package/browser/esm/{CMHb6pUUmsCP9r_9.mjs → BoTT_U96McOdkuId.mjs} +3 -3
  5. package/browser/esm/{_UDbQq5-pHbU1f82.mjs → CGQXv_OxqwXL3F8q.mjs} +2 -2
  6. package/browser/esm/CNAv3IL7hhyvzLaF.mjs +7011 -0
  7. package/browser/esm/{CMzkLUwbgA73RvCb.mjs → CROAqUhKnVtkbBSm.mjs} +3 -3
  8. package/browser/esm/D74i1p_CJmHw8HKb.mjs +2474 -0
  9. package/browser/esm/DPz0IeW70Nh4n8Wz.mjs +104 -0
  10. package/browser/esm/D_5T8KKyirVCR3RO.mjs +10312 -0
  11. package/browser/esm/cG4z0eDMlE49HJvD.mjs +2433 -0
  12. package/browser/esm/{IZf0hIeLYj3T0Xvu.mjs → f-Z5vnvNnzj-0ujR.mjs} +194 -144
  13. package/browser/esm/index.mjs +3 -4
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/{Bi_kZVtZams7taqa.mjs → Bl5eH7YPk64NxkkI.mjs} +3 -3
  16. package/node/esm/C0q_ulF7hl9zoVQ8.mjs +6957 -0
  17. package/node/esm/CT1rO7_YWIvsG9hs.mjs +4745 -0
  18. package/node/esm/{CB1ijGbhl-e2l6Mm.mjs → CUPNuRm5G47rulaW.mjs} +3 -3
  19. package/node/esm/{CY-pSutJLHskZfXZ.mjs → CoNllGglhnzJ6EJ4.mjs} +2 -2
  20. package/node/esm/CqhoZ8-FRZjS3p-D.mjs +7273 -0
  21. package/node/esm/TN8KqnRPY-7Ln4Ez.mjs +2562 -0
  22. package/node/esm/ZNTwnevSmMslvfiW.mjs +2479 -0
  23. package/node/esm/index.mjs +65 -28
  24. package/package.json +8 -9
  25. package/types/src/AutoFilterRules.d.ts +85 -22
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +30 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  80. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  81. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  82. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +8 -3
  83. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  84. package/types/src/reader/domVisitors/CommentVisitor.d.ts +7 -2
  85. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  86. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +34 -1
  87. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  88. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  89. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
  90. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  91. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  92. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  93. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  94. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  95. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  96. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  97. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  98. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  99. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  101. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  102. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  103. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  104. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  105. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
  106. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  107. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  108. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  109. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  110. package/types/src/reader/domVisitors/index.d.ts +10 -36
  111. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  112. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  113. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  114. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  115. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  116. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  117. package/types/src/richValue/RichDataParts.d.ts +69 -0
  118. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  119. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  120. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  121. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  122. package/types/src/richValue/index.d.ts +7 -0
  123. package/types/src/utils/DrawingMLText.d.ts +39 -0
  124. package/types/src/utils/FormControls.d.ts +170 -0
  125. package/types/src/utils/SharedNames.d.ts +13 -0
  126. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  127. package/types/src/utils/VmlNoteShapes.d.ts +88 -35
  128. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  129. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  130. package/types/src/vba/VBAProject.d.ts +0 -19
  131. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  132. package/types/src/writer/builder/Emitter.d.ts +5 -0
  133. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  134. package/types/src/writer/builder/PackageBuilder.d.ts +4 -41
  135. package/types/src/writer/builder/Types.d.ts +28 -28
  136. package/types/src/writer/emitters/CommentsEmitter.d.ts +10 -4
  137. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  138. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  139. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  140. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  141. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  142. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  143. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  144. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  145. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  146. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  147. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  148. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  149. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  150. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  151. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  152. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  153. package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +7 -1
  154. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  155. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  156. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  157. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  158. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  159. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  160. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  161. package/types/src/writer/utils/DrawMLUtils.d.ts +42 -3
  162. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  163. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  164. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  165. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  166. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  167. package/types/src/writer/utils/TextUtils.d.ts +26 -2
  168. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  169. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  170. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  171. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  172. package/browser/cjs/BzOEBR0jaxXg9wvt.cjs +0 -5
  173. package/browser/cjs/C8oC1tPbhgR0Dqtx.cjs +0 -2
  174. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  175. package/browser/cjs/Ca-xJDjg5bOpUPXX.cjs +0 -1
  176. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  177. package/browser/cjs/DULsYP_GcPGLVYSE.cjs +0 -11
  178. package/browser/cjs/DtBN3UOzNJjYBwJ6.cjs +0 -1
  179. package/browser/cjs/index.cjs +0 -1
  180. package/browser/cjs/sNZR19Wk-XQ2xZ9E.cjs +0 -1
  181. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  182. package/browser/esm/B9q618XELV7uWJsA.mjs +0 -67
  183. package/browser/esm/BwbMurFOptAFs7gC.mjs +0 -5214
  184. package/browser/esm/D75_rfogFUfXADKc.mjs +0 -3324
  185. package/browser/esm/DfuBawaydlvgZMR-.mjs +0 -4428
  186. package/browser/esm/DoMlKUCnMSlR2qX5.mjs +0 -159
  187. package/browser/esm/DtpWa7tZahylJ3HS.mjs +0 -2310
  188. package/node/esm/BD03jrMQ_UKA196-.mjs +0 -4535
  189. package/node/esm/BxHvzSROx_N_7nJH.mjs +0 -2356
  190. package/node/esm/CO1M1H1N6fB422K-.mjs +0 -2959
  191. package/node/esm/CWpezSa6TERGEv-B.mjs +0 -3410
  192. package/node/esm/Dezt2uIDqlxjiuk5.mjs +0 -170
  193. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  194. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  195. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  196. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  197. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  198. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  199. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  200. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  201. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  202. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  203. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
  204. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  205. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  206. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  207. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  208. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  209. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  210. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  211. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  212. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  213. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  214. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  215. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  216. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  217. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,4535 +0,0 @@
1
- /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.2
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import "./index.mjs";
8
- import { A as r, C as n, E as s, G as a, J as l, K as i, L as c, P as d, Q as m, R as p, S as f, U as h, W as g, Z as y, _ as x, a as v, b as w, c as S, f as b, h as C, i as k, j as T, k as I, l as M, m as R, n as F, o as A, r as L, s as _, t as P, tt as N, u as D, w as E, y as B } from "./CO1M1H1N6fB422K-.mjs";
9
- import { AddressUtils as O, BufferUtils as $, Color as W, CommonUtils as V, CoordUtils as z, FormulaError as j, FormulaText as U, IColor as X, ICondition as H, IConditionalFormat as q, IEffect as G, IFill as J, ISheet as K, IStroke as Y, IStyle as Z, ITextFrame as Q, LicenseManager as tt, NumberFormat as et, ScalarType as rt } from "@sheetxl/sdk";
10
- import { BlobWriter as ot, TextReader as nt, Uint8ArrayReader as st, Uint8ArrayWriter as at, ZipWriter as lt } from "@zip.js/zip.js";
11
- var it = "resourcesById", ct = class {
12
- constructor(t) {
13
- this._kind = t.kind, this._contentType = t.contentType, this._relTypeUri = t.relTypeUri, this._path = t.path;
14
- }
15
- getKind() {
16
- return this._kind;
17
- }
18
- getContentType(t) {
19
- return this._contentType;
20
- }
21
- getRelTypeUri(t) {
22
- return this._relTypeUri;
23
- }
24
- getPath(t) {
25
- return "function" == typeof this._path ? this._path(t) : this._path;
26
- }
27
- }, dt = class t {
28
- constructor(t, e, r) {
29
- this.zipWriter = t, this.outputKind = e, this.outWritable = r;
30
- }
31
- static createUint8Array(e) {
32
- const r = new lt(new at(), e);
33
- return new t(r, "uint8array");
34
- }
35
- static createBlob(e) {
36
- const r = new lt(new ot("application/zip"), e);
37
- return new t(r, "blob");
38
- }
39
- static createWritableStream(e, r) {
40
- const o = new lt(e, r);
41
- return new t(o, "writable", e);
42
- }
43
- async add(t, e, r) {
44
- const o = function(t) {
45
- let e = t.replace(/\\/g, "/").trim();
46
- for (; e.startsWith("/");) e = e.slice(1);
47
- return e;
48
- }(t), n = {
49
- level: r?.level,
50
- password: r?.password,
51
- encryptionStrength: r?.encryptionStrength,
52
- zipCrypto: r?.zipCrypto,
53
- lastModDate: r?.lastModDate,
54
- keepOrder: r?.keepOrder,
55
- uncompressedSize: r?.uncompressedSize,
56
- dataDescriptor: r?.dataDescriptor,
57
- passThrough: r?.passThrough,
58
- compressionMethod: r?.compressionMethod,
59
- signature: r?.signature
60
- };
61
- if ("string" == typeof e) return void await this.zipWriter.add(o, new nt(e), n);
62
- if (e instanceof Uint8Array || ArrayBuffer.isView(e) || e && "number" == typeof e.byteLength && "number" == typeof e.byteOffset) {
63
- try {
64
- await this.zipWriter.add(o, new st(e), n);
65
- } catch (t) {
66
- throw console.log("Error adding Uint8Array source to zip:", o, n), t;
67
- }
68
- return;
69
- }
70
- const s = (a = e) && "function" == typeof a.getReader ? e : function(t) {
71
- const e = t[Symbol.asyncIterator]();
72
- return new ReadableStream({
73
- async pull(t) {
74
- const { value: r, done: o } = await e.next();
75
- o ? t.close() : t.enqueue(r);
76
- },
77
- async cancel(t) {
78
- if ("function" == typeof e.return) try {
79
- await e.return(t);
80
- } catch {}
81
- }
82
- });
83
- }(e);
84
- var a;
85
- await this.zipWriter.add(o, s, n);
86
- }
87
- async close(t) {
88
- const e = t?.comment, r = await this.zipWriter.close(e, {});
89
- return "writable" === this.outputKind ? this.outWritable ?? r : r;
90
- }
91
- };
92
- function mt(t) {
93
- const e = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), r = (t) => e(t).replace(/"/g, "&quot;"), o = (t) => {
94
- if (!t) return "";
95
- let e = "";
96
- for (const [o, n] of Object.entries(t)) void 0 !== n && !1 !== n && (e += !0 === n ? ` ${o}="1"` : ` ${o}="${r(String(n))}"`);
97
- return e;
98
- }, n = new TextEncoder();
99
- let s = "";
100
- const a = () => {
101
- s && (t.write(n.encode(s)), s = "");
102
- }, l = (t) => {
103
- s += t, s.length > 65536 && a();
104
- };
105
- let i = [], c = null, d = [], m = !0;
106
- return {
107
- decl() {
108
- l("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
109
- },
110
- pushDefaultNamespace(t) {
111
- i.push(t), c = t;
112
- },
113
- getDefaultNamespace: () => i.length > 0 ? i[i.length - 1] : null,
114
- popDefaultNamespace() {
115
- i.length > 0 && (i.pop(), c = i.length > 0 ? i[i.length - 1] : null);
116
- },
117
- start(t, e) {
118
- m && d.push({
119
- tag: t,
120
- attrs: e,
121
- bufferPos: s.length
122
- });
123
- let r = t;
124
- c && -1 === t.indexOf(":") && (r = `${c}:${t}`), l(`<${r}${o(e)}>`);
125
- },
126
- empty(t, e) {
127
- let r = t;
128
- c && -1 === t.indexOf(":") && (r = `${c}:${t}`), l(`<${r}${o(e)}/>`);
129
- },
130
- text(t) {
131
- l(e(String(t)));
132
- },
133
- raw(t) {
134
- l(t);
135
- },
136
- end(t) {
137
- let e;
138
- if (m) {
139
- if (0 === d.length) throw new Error(`XML Writer: Unexpected end tag </${t}> - no matching start tag`);
140
- if (e = d[d.length - 1], e.tag !== t) throw new Error(`XML Writer: End tag </${t}> does not match start tag <${e.tag}>`);
141
- }
142
- let r = t;
143
- if (c && -1 === t.indexOf(":") && (r = `${c}:${t}`), m) {
144
- const t = s.length, n = `<${r}${o(e.attrs)}>`.length;
145
- t === e.bufferPos + n ? (s = s.slice(0, e.bufferPos), l(`<${r}${o(e.attrs)}/>`)) : l(`</${r}>`), d.pop();
146
- } else l(`</${r}>`);
147
- },
148
- close() {
149
- a();
150
- },
151
- setValidationDisabled(t) {
152
- m = !t;
153
- }
154
- };
155
- }
156
- function pt(t) {
157
- switch (t.kind) {
158
- case "bytes": return t.bytes;
159
- case "text": return t.text;
160
- case "stream": return t.stream;
161
- case "xmlStream": {
162
- const e = [], r = mt({ write: (t) => e.push(t) });
163
- return t.writeXml(r), r.close(), function(t) {
164
- let e = 0;
165
- for (const r of t) e += r.byteLength;
166
- const r = new Uint8Array(e);
167
- let o = 0;
168
- for (const e of t) r.set(e, o), o += e.byteLength;
169
- return r;
170
- }(e);
171
- }
172
- case "xmlStreamed": return t.write();
173
- }
174
- }
175
- function ft(t) {
176
- const e = ht(t);
177
- if (!e) return "_rels/.rels";
178
- const r = e.lastIndexOf("/"), o = r >= 0 ? e.slice(0, r) : "";
179
- return `${o ? `${o}/_rels` : "_rels"}/${r >= 0 ? e.slice(r + 1) : e}.rels`;
180
- }
181
- function ht(t) {
182
- let e = (t ?? "").replace(/\\/g, "/").trim();
183
- for (; e.startsWith("/");) e = e.slice(1);
184
- return e;
185
- }
186
- function ut(t) {
187
- let e = (t ?? "").replace(/\\/g, "/").trim();
188
- return e.startsWith("/") || (e = "/" + e), e;
189
- }
190
- function gt(t) {
191
- const e = /^rId(\d+)$/.exec(t);
192
- return e ? parseInt(e[1], 10) : Number.MAX_SAFE_INTEGER;
193
- }
194
- function yt(t) {
195
- return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/>/g, "&gt;");
196
- }
197
- function xt(t, e, r, o = !1) {
198
- let n = e;
199
- if (e.startsWith("/")) n = e.slice(1);
200
- else {
201
- if (!t) throw new Error(`Relative path "${e}" cannot be used at root level. Use an absolute path starting with "/" (e.g., "/xl/workbook.xml").`);
202
- n = (t.includes("/") ? t.slice(0, t.lastIndexOf("/") + 1) : "") + e;
203
- }
204
- if (n = vt(n), !n.includes("{n}")) {
205
- if (!o && r.has(n)) throw new Error(`Path already existing path: ${n}`);
206
- return n;
207
- }
208
- let s, a = 1;
209
- do
210
- if (s = n.replace(/{n}/g, String(a)), a++, a > 1e4) throw new Error(`Failed to resolve path template "${e}" after 10000 attempts. This likely indicates a bug or an impossible constraint.`);
211
- while (r.has(s));
212
- return s;
213
- }
214
- function vt(t) {
215
- const e = t.split("/"), r = [];
216
- for (const o of e) {
217
- if ("" === o || "." === o) continue;
218
- if (".." === o) {
219
- if (0 === r.length) throw new Error(`Invalid path: too many ".." segments in "${t}"`);
220
- r.pop();
221
- } else r.push(o);
222
- }
223
- return r.join("/");
224
- }
225
- function wt(t, e) {
226
- if (!t) return e;
227
- const r = t.includes("/") ? t.slice(0, t.lastIndexOf("/")) : "", o = r ? r.split("/") : [], n = e.split("/");
228
- let s = 0;
229
- const a = Math.min(o.length, n.length - 1);
230
- for (let t = 0; t < a && o[t] === n[t]; t++) s++;
231
- const l = o.length - s;
232
- return "../".repeat(l) + n.slice(s).join("/");
233
- }
234
- function St(t) {
235
- return new TextEncoder().encode(t);
236
- }
237
- function bt(t, e) {
238
- return function(t, e = " ") {
239
- let r = "", o = 0;
240
- const n = t.split(/(<[^>]+>)/g).filter(Boolean);
241
- for (let t = 0; t < n.length; t++) {
242
- const s = n[t];
243
- if (s.trim()) if (s.startsWith("<?")) r += s + "\n";
244
- else if (s.startsWith("</")) o--, o < 0 && console.warn(`XML formatting warning: negative indentation depth: ${s}`), r += e.repeat(Math.max(o, 0)) + s + "\n";
245
- else if (s.startsWith("<")) {
246
- const t = s.endsWith("/>");
247
- r += e.repeat(o) + s + "\n", t || o++;
248
- } else r += e.repeat(o) + s.trim() + "\n";
249
- }
250
- return r;
251
- }(function(t) {
252
- return new TextDecoder("utf-8").decode(t);
253
- }(t), e);
254
- }
255
- var Ct = class {
256
- constructor(t) {
257
- this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.reservedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = ht(t);
258
- }
259
- add(t, e, r) {
260
- let o = r?.idHint && !this.usedIds.has(r.idHint) ? r.idHint : void 0;
261
- if (!o) do
262
- o = "rId" + this.nextId++;
263
- while (this.usedIds.has(o) || this.reservedIds.has(o));
264
- const n = /^rId(\d+)$/.exec(o);
265
- return n && (this.nextId = Math.max(this.nextId, parseInt(n[1], 10) + 1)), this.usedIds.add(o), this.rels.push({
266
- id: o,
267
- type: t,
268
- target: e,
269
- targetMode: r?.external ? "External" : void 0
270
- }), o;
271
- }
272
- reserve(t) {
273
- for (const e of t) {
274
- if (!e) continue;
275
- this.reservedIds.add(e);
276
- const t = /^rId(\d+)$/.exec(e);
277
- t && (this.nextId = Math.max(this.nextId, parseInt(t[1], 10) + 1));
278
- }
279
- }
280
- list() {
281
- return this.rels;
282
- }
283
- toXmlBytes() {
284
- const t = [...this.rels].sort((t, e) => gt(e.id) - gt(t.id) || t.id.localeCompare(e.id)), e = [];
285
- e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Relationships xmlns="${kt}">`);
286
- for (const r of t) {
287
- const t = [
288
- `Id="${yt(r.id)}"`,
289
- `Type="${yt(r.type)}"`,
290
- `Target="${yt(r.target)}"`
291
- ];
292
- "External" === r.targetMode && t.push("TargetMode=\"External\""), e.push(`<Relationship ${t.join(" ")}/>`);
293
- }
294
- return e.push("</Relationships>"), St(e.join(""));
295
- }
296
- }, kt = "http://schemas.openxmlformats.org/package/2006/relationships", Tt = class {
297
- constructor() {
298
- this._defaultsSet = /* @__PURE__ */ new Set(), this._overridesSet = /* @__PURE__ */ new Set(), this._defaults = [], this._overrides = [];
299
- }
300
- addDefault(t, e) {
301
- const r = function(t) {
302
- let e = (t ?? "").trim().toLowerCase();
303
- return e.startsWith(".") && (e = e.slice(1)), e;
304
- }(t);
305
- this._defaultsSet.has(r) || (this._defaultsSet.add(r), this._defaults.push({
306
- key: r,
307
- content: e
308
- }));
309
- }
310
- addOverride(t, e) {
311
- const r = ut(t);
312
- this._overridesSet.has(r) || (this._overridesSet.add(r), this._overrides.push({
313
- key: r,
314
- content: e
315
- }));
316
- }
317
- replaceOverride(t, e) {
318
- const r = ut(t);
319
- if (!this._overridesSet.has(r)) return;
320
- const o = this._overrides.find((t) => t.key === r);
321
- o && (o.content = e);
322
- }
323
- toXmlBytes() {
324
- const t = [];
325
- t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Types xmlns="${It}">`);
326
- const e = this._defaults.reverse();
327
- this.addDefault("rels", "application/vnd.openxmlformats-package.relationships+xml"), this.addDefault("xml", "application/xml");
328
- for (const { key: r, content: o } of e) t.push(`<Default Extension="${yt(r)}" ContentType="${yt(o)}"/>`);
329
- const r = this._overrides;
330
- for (const { key: e, content: o } of r) t.push(`<Override PartName="${yt(e)}" ContentType="${yt(o)}"/>`);
331
- return t.push("</Types>"), St(t.join(""));
332
- }
333
- }, It = "http://schemas.openxmlformats.org/package/2006/content-types", Mt = class {
334
- constructor(t) {
335
- this.parts = [], this.relsRoot = new Ct(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new Tt(), this.zip = t;
336
- }
337
- addContentType(t, e) {
338
- const r = ht(t);
339
- this.contentTypes.addOverride("/" + r, e);
340
- }
341
- addDefaultType(t, e) {
342
- this.contentTypes.addDefault(t, e);
343
- }
344
- replaceContentType(t, e) {
345
- this.contentTypes.replaceOverride("/" + ht(t), e);
346
- }
347
- addPart(t, e, r, o) {
348
- const n = ht(t);
349
- this.parts.push({
350
- path: n,
351
- body: e,
352
- optionsZip: o
353
- }), r && this.contentTypes.addOverride("/" + n, r);
354
- }
355
- rels(t) {
356
- const e = ht(t || "");
357
- if (!e) return this.relsRoot;
358
- let r = this.relsByPart.get(e);
359
- return r || (r = new Ct(e), this.relsByPart.set(e, r)), r;
360
- }
361
- async emit() {
362
- const t = [...this.parts].sort((t, e) => t.path.localeCompare(e.path));
363
- for (const e of t) {
364
- const t = pt(e.body);
365
- await this.zip.add(e.path, t, e.optionsZip);
366
- }
367
- const e = this.relsRoot.toXmlBytes();
368
- await this.zip.add("_rels/.rels", e, {});
369
- const r = [...this.relsByPart.values()].sort((t, e) => t.sourcePart.localeCompare(e.sourcePart));
370
- for (const t of r) {
371
- const e = ft(t.sourcePart), r = t.toXmlBytes();
372
- await this.zip.add(e, r, {});
373
- }
374
- const o = this.contentTypes.toXmlBytes();
375
- await this.zip.add("[Content_Types].xml", o, {});
376
- }
377
- async build(t) {
378
- return await this.emit(), await this.zip.close(t);
379
- }
380
- }, Rt = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), Ft = [/^xl\/slicers\//i, /^xl\/slicerCaches\//i];
381
- function At(t) {
382
- return "[Content_Types].xml" === t || Lt.test(t);
383
- }
384
- var Lt = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
385
- function _t(t) {
386
- if ("_rels/.rels" === t) return "";
387
- const e = Lt.exec(t);
388
- if (!e) return null;
389
- const r = e[1] ?? "", o = e[2];
390
- return r ? `${r}/${o}` : o;
391
- }
392
- function Pt(t) {
393
- return t.startsWith("#");
394
- }
395
- function Nt(t, e) {
396
- if (e.startsWith("/")) return vt(e);
397
- const r = t.includes("/") ? t.slice(0, t.lastIndexOf("/")) : "";
398
- return vt((r ? r + "/" : "") + e);
399
- }
400
- var Dt = class {
401
- constructor(t, e, r) {
402
- this._queue = [], this._scheduledByNodeKey = /* @__PURE__ */ new Map(), this._nodesByPath = /* @__PURE__ */ new Map(), this._writtenPaths = /* @__PURE__ */ new Set(), this._explicitRelTargets = /* @__PURE__ */ new Set(), this._partWriter = new Mt(t), this._registry = e, this._options = r ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null, this._macroEnabled = this._options.macroEnabled ?? !1, this._reserveSourceRelIds("");
403
- }
404
- _isSourcePartCarried(t) {
405
- const e = this._sourcePackage;
406
- return !(!e || !e.has(t)) && !Rt.has(t) && !e.isAbsorbed(t) && !(!this._macroEnabled && "xl/vbaProject.bin" === t) && !At(t) && (!e.hasStructuralChange() || !function(t) {
407
- return Ft.some((e) => e.test(t));
408
- }(t));
409
- }
410
- _reserveSourceRelIds(t) {
411
- const e = this._sourcePackage?.getPart(ft(t));
412
- e && this._partWriter.rels(t).reserve(g(e.data).map((t) => t.id));
413
- }
414
- async waitEmit() {
415
- const t = this._queue;
416
- for (; t.length;) {
417
- const e = t.shift();
418
- await this._processPart(e);
419
- }
420
- }
421
- async build(t) {
422
- return await this.waitEmit(), this._passthroughSourceParts(), this._applyWorkbookContentTypeVariant(), await this._partWriter.build(t ?? {});
423
- }
424
- _passthroughSourceParts() {
425
- const t = this._sourcePackage;
426
- if (!t) return;
427
- const e = new Set(this._writtenPaths), r = [];
428
- for (const o of t.getNames()) e.has(o) || this._isSourcePartCarried(o) && r.push(o);
429
- const o = new Set(e);
430
- for (const t of r) o.add(t);
431
- const n = t.getPart("[Content_Types].xml"), s = n ? h(n.data) : null;
432
- if (s) for (const { ext: t, contentType: e } of s.defaults) this._partWriter.addDefaultType(t, e);
433
- for (const e of r) {
434
- const r = t.getPart(e), o = s?.overrides.get("/" + e);
435
- r.raw ? this._partWriter.addPart(e, {
436
- kind: "bytes",
437
- bytes: r.raw.compressedData
438
- }, o, {
439
- passThrough: !0,
440
- compressionMethod: r.raw.compressionMethod,
441
- signature: r.raw.signature,
442
- uncompressedSize: r.uncompressedSize
443
- }) : this._partWriter.addPart(e, {
444
- kind: "bytes",
445
- bytes: r.data
446
- }, o), this._writtenPaths.add(e);
447
- }
448
- for (const r of t.getNames()) {
449
- if ("[Content_Types].xml" === r || !At(r)) continue;
450
- const n = _t(r);
451
- null !== n && ("" === n || o.has(n)) && (t.isAbsorbed(n) || this._mergeSourceRelsInto(n, t.getPart(r).data, e, o));
452
- }
453
- }
454
- _applyWorkbookContentTypeVariant() {
455
- this._macroEnabled && this._partWriter.replaceContentType("xl/workbook.xml", "application/vnd.ms-excel.sheet.macroEnabled.main+xml");
456
- }
457
- _mergeSourceRelsInto(t, e, r, o) {
458
- const n = this._partWriter.rels(t), s = "" === t || r.has(t);
459
- for (const a of g(e)) {
460
- if (a.external || Pt(a.target)) {
461
- n.add(a.type, a.target, {
462
- external: a.external,
463
- idHint: a.id
464
- });
465
- continue;
466
- }
467
- const e = Nt(t, a.target);
468
- if (s) {
469
- if (r.has(e)) continue;
470
- if (this._explicitRelTargets.has(`${t}::${e}`)) continue;
471
- }
472
- o.has(e) ? n.add(a.type, a.target, { idHint: a.id }) : this._registry.ownsRelType(a.type) || Rt.has(e) || this._sourcePackage?.isAbsorbed(e) || console.warn(`Dropping preserved relationship to missing part '${e}'`, t || "(root)");
473
- }
474
- }
475
- addPart(t, e, r, o) {
476
- return this._addPartInternal("", t, e, r, o);
477
- }
478
- _addPartInternal(t, e, r, o, n) {
479
- const s = this._registry.get(e);
480
- if (!s) throw new Error(`No emitter registered for kind '${e}'.`);
481
- const a = s.getContentType(r), l = s.getRelTypeUri(r), i = o ?? s.getPath?.(r);
482
- if (!i) throw new Error("No path provided in either argument or emitter.");
483
- const c = this._writtenPaths, d = xt(t, i, c), m = `${e}:${d}`;
484
- let p = this._scheduledByNodeKey.get(m);
485
- if (!p) {
486
- let t;
487
- this._reserveSourceRelIds(d), p = {
488
- kind: e,
489
- key: m,
490
- payload: r,
491
- path: d,
492
- contentType: a,
493
- promise: new Promise((e) => {
494
- t = e;
495
- }),
496
- resolve: t
497
- }, this._scheduledByNodeKey.set(m, p), this._queue.push(p);
498
- }
499
- let f = this._nodesByPath.get(t);
500
- f || (f = /* @__PURE__ */ new Set(), this._nodesByPath.set(t, f)), f.add(m), !a || l || t || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", d);
501
- let h = null;
502
- if (l) {
503
- const e = wt(t, p.path);
504
- h = this._partWriter.rels(t).add(l, e, { idHint: n });
505
- }
506
- return c.add(d), {
507
- path: d,
508
- contentTypeUri: a,
509
- relId: h
510
- };
511
- }
512
- addBinary(t, e, r, o, n = !1, s) {
513
- return this._addBinaryInternal("", t, e, r, o, n, s);
514
- }
515
- _addBinaryInternal(t, e, r, o, n, s = !1, a) {
516
- if (!n) throw new Error("No path provided for binary.");
517
- if (!r) throw new Error("No content type provided for binary.");
518
- const l = this._writtenPaths, i = xt(t, n, l, s);
519
- let c = null;
520
- if (o) {
521
- const e = wt(t, i);
522
- c = this._partWriter.rels(t).add(o, e, { idHint: a });
523
- }
524
- if (t || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", i), !l.has(i)) {
525
- const t = i.split(".").pop() || "";
526
- t && this._partWriter.addDefaultType(t, r), this._partWriter.addPart(i, {
527
- kind: "bytes",
528
- bytes: e
529
- }, void 0, {
530
- level: 0,
531
- uncompressedSize: e.byteLength,
532
- dataDescriptor: !1
533
- }), l.add(i);
534
- }
535
- return {
536
- path: i,
537
- contentTypeUri: r,
538
- relId: c
539
- };
540
- }
541
- async _waitForDescendants(t) {
542
- const e = this._nodesByPath.get(t);
543
- if (!e || 0 === e.size) return;
544
- const r = [];
545
- for (const t of e) {
546
- const e = this._scheduledByNodeKey.get(t);
547
- if (e) {
548
- const t = this._processPart(e);
549
- r.push(t);
550
- }
551
- }
552
- await Promise.all(r);
553
- }
554
- async _processPart(t) {
555
- if (t.processed) return t.promise;
556
- t.processed = !0;
557
- const e = this._registry.get(t.kind), r = t.path;
558
- this._partWriter.addContentType(t.path, t.contentType);
559
- try {
560
- const o = [], n = { write: (t) => {
561
- o.push(t);
562
- } };
563
- let s;
564
- await e.emit(t.payload, {
565
- getXMLWriter: () => s || (s = mt(n), s),
566
- addPart: (t, e, o, n) => this._addPartInternal(r, t, e, o, n),
567
- addBinary: (t, e, o, n, s = !1, a) => this._addBinaryInternal(r, t, e, o, n, s, a),
568
- addExternal: (t, e, o) => ({
569
- path: e,
570
- contentTypeUri: null,
571
- relId: this._partWriter.rels(r).add(t, e, {
572
- external: !0,
573
- idHint: o
574
- })
575
- }),
576
- addRelationship: (t, e, o) => {
577
- if (!this._writtenPaths.has(e) && !this._isSourcePartCarried(e)) return null;
578
- const n = wt(r, e), s = this._partWriter.rels(r).add(t, n, { idHint: o });
579
- return this._explicitRelTargets.add(`${r}::${e}`), s;
580
- },
581
- waitEmit: () => this._waitForDescendants(t.path),
582
- getPath: () => t.path,
583
- getSharedStates: () => this._mapState,
584
- warn: (e, r, o) => {
585
- const n = r ?? t.path, s = this._options.onWarning;
586
- s ? s(e, n, o) : console.warn(e, n);
587
- },
588
- log: (e, r) => {
589
- console.warn(e, r ?? t.path);
590
- }
591
- });
592
- const a = function(t) {
593
- let e = 0;
594
- for (const r of t) e += r.byteLength;
595
- const r = new Uint8Array(e);
596
- let o = 0;
597
- for (const e of t) r.set(e, o), o += e.byteLength;
598
- return r;
599
- }(o), l = this._options.onPartEmitted;
600
- l && await l(t.kind, t.path, a), Et && (console.log(`\n=== ${t.path} ===`), console.log(bt(a))), this._partWriter.addPart(t.path, {
601
- kind: "bytes",
602
- bytes: a
603
- }, t.contentType);
604
- } catch (e) {
605
- throw this._options.onPartError?.(t.kind, t.path, e), e;
606
- } finally {
607
- this._nodesByPath.delete(t.path), this._scheduledByNodeKey.delete(t.key), t.resolve();
608
- }
609
- }
610
- }, Et = !1, Bt = class {
611
- constructor() {
612
- this.map = /* @__PURE__ */ new Map();
613
- }
614
- register(t) {
615
- const e = t.getKind();
616
- if (this.map.has(e)) throw new Error(`Duplicate part kind: ${e}`);
617
- this.map.set(e, t);
618
- }
619
- get(t) {
620
- const e = this.map.get(t);
621
- if (!e) throw new Error(`Unknown part kind: ${t}`);
622
- return e;
623
- }
624
- has(t) {
625
- return this.map.has(t);
626
- }
627
- ownsRelType(t) {
628
- for (const e of this.map.values()) if (e.getRelTypeUri() === t) return !0;
629
- return !1;
630
- }
631
- };
632
- function Ot(t, e, r) {
633
- t && (t.algorithm && (e[r ? `${r}AlgorithmName` : "algorithmName"] = t.algorithm), t.hash && (e[r ? `${r}HashValue` : "hashValue"] = t.hash), t.salt && (e[r ? `${r}SaltValue` : "saltValue"] = t.salt), void 0 !== t.spinCount && (e[r ? `${r}SpinCount` : "spinCount"] = t.spinCount));
634
- }
635
- var $t = "hiddenFormulaXfs", Wt = class {
636
- constructor(t, e) {
637
- this._variants = /* @__PURE__ */ new Map(), this._sources = [], this._json = t, this._styles = e, this._directCount = Math.max(1, t?.direct?.length ?? 0);
638
- }
639
- getHiddenXf(t) {
640
- let e = this._variants.get(t);
641
- return void 0 !== e || (this._isShown(t) ? e = t : (e = this._directCount + this._sources.length, this._sources.push(t)), this._variants.set(t, e)), e;
642
- }
643
- getSources() {
644
- return this._sources;
645
- }
646
- _isShown(t) {
647
- const e = this._json?.direct?.[t], r = e?.protection?.showFormulas;
648
- if (void 0 !== r) return r;
649
- const o = (0 !== t ? e?.named : void 0) ?? Z.BuiltInName.Normal;
650
- return this._styles.getNamedStyles().getByName(o)?.toJSON().style?.protection?.showFormulas ?? !1;
651
- }
652
- }, Vt = class {
653
- constructor() {
654
- this._daprFMBks = [], this._daprFMBkMap = /* @__PURE__ */ new Map(), this._rvFMBks = [], this._rvFMBkMap = /* @__PURE__ */ new Map(), this._valueMeta = [];
655
- }
656
- registerArrayCell(t) {
657
- const e = t ? 1 : 0, r = `1,${e}`;
658
- let o = this._daprFMBkMap.get(r);
659
- return void 0 === o && (o = this._daprFMBks.length, this._daprFMBks.push({
660
- fDynamic: 1,
661
- fCollapsed: e
662
- }), this._daprFMBkMap.set(r, o)), o + 1;
663
- }
664
- registerRichValueCell(t) {
665
- let e = this._rvFMBkMap.get(t);
666
- void 0 === e && (e = this._rvFMBks.length, this._rvFMBks.push(t), this._rvFMBkMap.set(t, e));
667
- const r = this._valueMeta.length;
668
- return this._valueMeta.push(e), r + 1;
669
- }
670
- hasCellMeta() {
671
- return this._daprFMBks.length > 0;
672
- }
673
- hasValueMeta() {
674
- return this._valueMeta.length > 0;
675
- }
676
- hasAny() {
677
- return this.hasCellMeta() || this.hasValueMeta();
678
- }
679
- getDAPRFutureMetadataBlocks() {
680
- return this._daprFMBks;
681
- }
682
- getRVFutureMetadataBlocks() {
683
- return this._rvFMBks;
684
- }
685
- getValueMeta() {
686
- return this._valueMeta;
687
- }
688
- }, zt = class {
689
- constructor(t, e = console.warn) {
690
- this._entries = [], this._keyMap = /* @__PURE__ */ new Map(), this._metaCollector = t, this._onWarn = e;
691
- }
692
- add(t) {
693
- if (null == t) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
694
- if (j.isError(t)) {
695
- const e = t.getCode(), r = this._register(`_error:${e}`, { errorType: "" + (e - 1) }, jt);
696
- return this._metaCollector.registerRichValueCell(r);
697
- }
698
- return t.isIRichData && t.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", t), this._registerFallback();
699
- }
700
- _registerFallback() {
701
- const t = this._register("_error:fallback", { errorType: j.Code.Unknown - 1 }, jt);
702
- return this._metaCollector.registerRichValueCell(t);
703
- }
704
- _register(t, e, r) {
705
- let o = this._keyMap.get(t);
706
- return void 0 === o && (o = this._entries.length, this._entries.push({
707
- handler: r,
708
- rawValue: e
709
- }), this._keyMap.set(t, o)), o;
710
- }
711
- getCount() {
712
- return this._entries.length;
713
- }
714
- hasAny() {
715
- return this._entries.length > 0;
716
- }
717
- getEntries() {
718
- return this._entries;
719
- }
720
- uniqueHandlers() {
721
- const t = /* @__PURE__ */ new Set(), e = [];
722
- for (const r of this._entries) t.has(r.handler) || (t.add(r.handler), e.push(r.handler));
723
- return e;
724
- }
725
- handlerStructureIndex(t) {
726
- let e = 0;
727
- const r = /* @__PURE__ */ new Set();
728
- for (const o of this._entries) if (!r.has(o.handler)) {
729
- if (o.handler === t) return e;
730
- r.add(o.handler), e++;
731
- }
732
- return -1;
733
- }
734
- }, jt = new class {
735
- constructor(t, e) {
736
- this.type = t, this.props = e;
737
- }
738
- getValues(t) {
739
- return this.props.map(([e, , r = ""]) => {
740
- const o = t?.[e];
741
- return null != o ? "" + o : r;
742
- });
743
- }
744
- }("_error", [[
745
- "errorType",
746
- "i",
747
- ""
748
- ], [
749
- "subType",
750
- "i",
751
- "0"
752
- ]]), Ut = "application/xml", Xt = async (t, e) => {
753
- const r = t.parts, o = r ? r.length : 0;
754
- for (let n = 0; n < o; n++) {
755
- const o = r[n];
756
- try {
757
- await Ht(o, e);
758
- } catch (r) {
759
- e.log(`Unable to write the part '${o.name ?? o.id}' referenced by '${t.name ?? t.id}'`, r);
760
- }
761
- }
762
- }, Ht = async (t, e, r) => {
763
- const o = void 0 === t.resId ? void 0 : e.getSharedStates().get(it)?.get(t.resId);
764
- if (!o) return void 0 !== t.resId ? (e.log(`The part '${t.name ?? t.id}' cites resource ${t.resId}, which is not in the workbook.`), null) : e.addPart("embeddedPart", t, r, t.id);
765
- const n = await o.getExternalURI();
766
- if (n) {
767
- const r = e.addExternal(t.type, n, t.id);
768
- return r.relId !== t.id && e.log(`The external reference '${t.id}' was written as '${r.relId}'; the markup will not find it.`), r;
769
- }
770
- const s = await o.toBuffer();
771
- return e.addBinary(new Uint8Array(s), t.contentType || Ut, t.type, r ?? `./${qt(t.name)}`, !1, t.id);
772
- }, qt = (t) => {
773
- const e = t && /^[\w.\-~%]+$/.test(t) ? t : "part.xml", r = e.lastIndexOf("."), o = r > 0 ? e.slice(0, r) : e, n = r > 0 ? e.slice(r) : "";
774
- return `${o.replace(/\d+$/, "")}{n}${n}`;
775
- }, Gt = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", Jt = (t, e) => t.getSharedStates().get("pivotCachePaths")?.get(e) ?? null, Kt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink", Yt = "fileVersion";
776
- var Zt = "sheetParts";
777
- var Qt = "externalLinkParts";
778
- function te(t) {
779
- if (!t || -1 === t.indexOf("[")) return [];
780
- const e = [], r = t.replace(/"(?:[^"]|"")*"/g, "");
781
- for (const t of r.matchAll(/\[(\d+)\]/g)) {
782
- const r = Number(t[1]);
783
- r > 0 && !e.includes(r) && e.push(r);
784
- }
785
- return e;
786
- }
787
- var ee = {
788
- auto: "auto",
789
- automaticExceptTables: "autoNoTable",
790
- manual: "manual"
791
- };
792
- function re(t, e, r, o) {
793
- if (!r) return;
794
- const n = "string" == typeof r ? e.parseColor(r) : r;
795
- o && t.start(o);
796
- const s = n.getType(), a = n.getVal(), l = n.getAdjustments(), i = l && l.length > 0;
797
- switch (s) {
798
- case "scheme":
799
- i ? (t.start("schemeClr", { val: a }), oe(t, l), t.end("schemeClr")) : t.empty("schemeClr", { val: a });
800
- break;
801
- case "named":
802
- if (W.isSystem(a)) {
803
- const e = n.getLastColor() ?? n.getBaseColor().toHex().toString(!1).replace("#", "");
804
- i ? (t.start("sysClr", {
805
- val: a,
806
- lastClr: e
807
- }), oe(t, l), t.end("sysClr")) : t.empty("sysClr", {
808
- val: a,
809
- lastClr: e
810
- });
811
- } else i ? (t.start("prstClr", { val: a }), oe(t, l), t.end("prstClr")) : t.empty("prstClr", { val: a });
812
- break;
813
- case "auto": {
814
- const e = n.getLastColor() ?? n.getBaseColor().toHex().toString(!1).replace("#", "");
815
- i ? (t.start("sysClr", {
816
- val: "windowText",
817
- lastClr: e
818
- }), oe(t, l), t.end("sysClr")) : t.empty("sysClr", {
819
- val: "windowText",
820
- lastClr: e
821
- });
822
- break;
823
- }
824
- case "index":
825
- i ? (t.start("srgbClr", { val: a }), oe(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: a });
826
- break;
827
- case "hsl":
828
- const e = n.toHex().toString();
829
- i ? (t.start("srgbClr", { val: e }), oe(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: e });
830
- break;
831
- case "rgb":
832
- case "lrgb":
833
- const r = n.toHex().toString();
834
- i ? (t.start("srgbClr", { val: r }), oe(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: r });
835
- break;
836
- case "hex":
837
- const o = a.replace("#", "").toUpperCase();
838
- i ? (t.start("srgbClr", { val: o }), oe(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: o });
839
- break;
840
- default:
841
- const s = a.replace("#", "").toUpperCase();
842
- t.empty("srgbClr", { val: s });
843
- }
844
- o && t.end(o);
845
- }
846
- function oe(t, e) {
847
- if (e && 0 !== e.length) for (const r of e) for (const [e, o] of Object.entries(r)) {
848
- if (null == o) continue;
849
- const r = e;
850
- if (r) if ("boolean" == typeof o) t.empty(r);
851
- else {
852
- let n;
853
- if ("alpha" === e || "alphaOff" === e || "alphaMod" === e) n = Math.round(1e5 * o);
854
- else {
855
- if ("eTint" === e) {
856
- if (o < 0) {
857
- t.empty("shade", { val: Math.round(1e5 * (1 + o)).toString() });
858
- continue;
859
- }
860
- t.empty("tint", { val: Math.round(1e5 * o).toString() });
861
- continue;
862
- }
863
- n = Math.round(1e3 * o);
864
- }
865
- t.empty(r, { val: n.toString() });
866
- }
867
- }
868
- }
869
- function ne(t, e, r, o, n = !1, s = !1) {
870
- if (!r) return;
871
- const a = "string" == typeof r ? e.parseColor(r) : r, l = () => {
872
- t.empty(o, { rgb: pe(a.toHex().toString(!0)) });
873
- }, i = a.getAdjustments(), c = i && i.length > 0, d = a.getType();
874
- if (d !== X.Type.Auto) {
875
- if (d === X.Type.Scheme) {
876
- const e = a.getVal(), r = se[e] ?? e, n = ie.get(r);
877
- if (void 0 === n && "phClr" !== r) return console.warn(`Color scheme not in theme. schemeVal=${e} themeKey=${r}`), l();
878
- const s = {};
879
- if (s.theme = n, c) {
880
- if (!function(t) {
881
- for (const e of t) switch (Object.keys(e)[0]) {
882
- case X.AdjustmentType.Tint:
883
- case X.AdjustmentType.ETint:
884
- case X.AdjustmentType.Shade:
885
- case X.AdjustmentType.Lum:
886
- case X.AdjustmentType.LumOff:
887
- case X.AdjustmentType.LumMod:
888
- case X.AdjustmentType.Alpha:
889
- case X.AdjustmentType.AlphaOff:
890
- case X.AdjustmentType.AlphaMod: continue;
891
- default: return !1;
892
- }
893
- return !0;
894
- }(i)) return l();
895
- const t = 1 === i.length ? i[0][X.AdjustmentType.ETint] : void 0;
896
- let e;
897
- if (void 0 !== t) e = de(t);
898
- else {
899
- const t = a.getBaseColor().toHex().toString(!0), r = a.toHex().toString(!0);
900
- e = de(function(t, e) {
901
- const r = ce(t, 0, 255), o = ce(e, 0, 255);
902
- if (Math.abs(o - r) < 1e-9) return 0;
903
- return o < r ? r <= 1e-9 ? -1 : ce(o / r - 1, -1, 0) : 255 - r <= 1e-9 ? 0 : ce((o - r) / (255 - r), 0, 1);
904
- }(me(t), me(r)));
905
- }
906
- 0 !== e && (s.tint = e);
907
- }
908
- t.empty(o, s);
909
- return;
910
- }
911
- if (d === X.Type.Index) {
912
- const e = a.getVal(), r = e.substring(5, e.length);
913
- t.empty(o, { indexed: Number(r) });
914
- return;
915
- }
916
- return l();
917
- }
918
- t.empty(o, { auto: 1 });
919
- }
920
- var se = {
921
- bg1: "lt1",
922
- tx1: "dk1",
923
- bg2: "lt2",
924
- tx2: "dk2",
925
- accent1: "accent1",
926
- accent2: "accent2",
927
- accent3: "accent3",
928
- accent4: "accent4",
929
- accent5: "accent5",
930
- accent6: "accent6",
931
- hlink: "hlink",
932
- folHlink: "folHlink"
933
- }, ae = Object.freeze([
934
- "lt1",
935
- "dk1",
936
- "lt2",
937
- "dk2",
938
- "accent1",
939
- "accent2",
940
- "accent3",
941
- "accent4",
942
- "accent5",
943
- "accent6",
944
- "hlink",
945
- "folHlink"
946
- ]), le = Object.freeze([
947
- "dk1",
948
- "lt1",
949
- "dk2",
950
- "lt2",
951
- "accent1",
952
- "accent2",
953
- "accent3",
954
- "accent4",
955
- "accent5",
956
- "accent6",
957
- "hlink",
958
- "folHlink"
959
- ]), ie = new Map(ae.map((t, e) => [t, e]));
960
- function ce(t, e, r) {
961
- return Math.max(e, Math.min(r, t));
962
- }
963
- function de(t) {
964
- const e = ce(t, -1, 1);
965
- return Math.abs(e) < 1e-12 ? 0 : e;
966
- }
967
- function me(t) {
968
- const e = function(t) {
969
- const e = t.replace(/^#/, "").toUpperCase();
970
- if (8 === e.length) return e.slice(2);
971
- if (6 === e.length) return e;
972
- throw new Error(`Invalid hex: ${t}`);
973
- }(t), r = parseInt(e.slice(0, 2), 16) / 255, o = parseInt(e.slice(2, 4), 16) / 255, n = parseInt(e.slice(4, 6), 16) / 255;
974
- return (Math.max(r, o, n) + Math.min(r, o, n)) / 2 * 255;
975
- }
976
- function pe(t) {
977
- const e = t.replace(/^#/, "").toUpperCase();
978
- if (8 === e.length) return e;
979
- if (6 === e.length) return "FF" + e;
980
- throw new Error(`Invalid hex: ${t}`);
981
- }
982
- function fe(t, e = !1) {
983
- let r = t;
984
- return 8 === r.length && (r = r.substring(2, 8)), 6 === r.length && (r = (e ? "00" : "FF") + r), r.toUpperCase();
985
- }
986
- function he(t) {
987
- return `[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ${t.getContent()}`;
988
- }
989
- function ue(t, e) {
990
- if ("string" == typeof e) return void ge(t, e);
991
- const r = e.runs;
992
- for (let e = 0; e < r.length; e++) {
993
- const o = r[e];
994
- t.start("r"), (o.bold || o.italic || void 0 !== o.size || o.font || o.color) && (t.start("rPr"), o.bold && t.empty("b"), o.italic && t.empty("i"), void 0 !== o.size && t.empty("sz", { val: o.size }), o.color && t.empty("color", { rgb: "FF" + o.color.replace(/^#/, "").toUpperCase() }), o.font && t.empty("rFont", { val: o.font }), t.end("rPr")), ge(t, o.text ?? ""), t.end("r");
995
- }
996
- }
997
- function ge(t, e) {
998
- t.start("t", E.test(e) || /[\n\r]/.test(e) ? n : void 0), t.text(e), t.end("t");
999
- }
1000
- function ye(t) {
1001
- const e = t.getRanges();
1002
- if (e.isInvalid()) return null;
1003
- const r = e.getCoords()[0];
1004
- return r ? {
1005
- ref: O.cellToString({
1006
- rowIndex: r.rowStart,
1007
- colIndex: r.colStart
1008
- }),
1009
- row: r.rowStart,
1010
- col: r.colStart
1011
- } : null;
1012
- }
1013
- function xe(t, e, r, o, n = !1, s = !1) {
1014
- const a = o.getTheme();
1015
- if (n && e.start("fill"), "string" == typeof r && (r = {
1016
- type: J.Type.Solid,
1017
- color: r
1018
- }), r.type === J.Type.None) n ? e.empty("patternFill", { patternType: "none" }) : e.empty("noFill");
1019
- else if (r.type === J.Type.Solid) {
1020
- const t = r;
1021
- n ? e.start("patternFill", { patternType: "solid" }) : e.start("solidFill"), t.color && (n ? ne(e, a, t.color, "fgColor") : re(e, a, t.color)), n ? e.end("patternFill") : e.end("solidFill");
1022
- } else if (r.type === J.Type.Pattern) {
1023
- const t = r, o = t.patternType || "solid";
1024
- e.start("patternFill", { patternType: o }), t.foreground && (n ? ne(e, a, s ? t.background : t.foreground, "fgColor") : re(e, a, s ? t.background : t.foreground)), t.background && (n ? ne(e, a, s ? t.foreground : t.background, "bgColor") : re(e, a, s ? t.foreground : t.background)), e.end("patternFill");
1025
- } else if (r.type === J.Type.Gradient && n) {
1026
- const t = r, o = {}, n = t.gradientType;
1027
- if (n !== J.GradientType.Path && n !== J.GradientType.Linear || (o.type = n), void 0 !== t.angle) {
1028
- const e = (t.angle - 90) % 360;
1029
- 0 !== e && (o.degree = String(e));
1030
- }
1031
- const s = t.focus;
1032
- s && (s.left && (o.left = String(s.left)), s.right && (o.right = String(s.right)), s.top && (o.top = String(s.top)), s.bottom && (o.bottom = String(s.bottom))), e.start("gradientFill", o);
1033
- const l = t.stops;
1034
- if (l && l.length > 0) for (const t of l) {
1035
- let r, o = 0;
1036
- if ("string" == typeof t || "object" == typeof t && !("offset" in t)) r = t, o = 0;
1037
- else {
1038
- const e = t;
1039
- o = e.offset || 0, r = e.color;
1040
- }
1041
- e.start("stop", { position: String(o) }), r && ne(e, a, r, "color"), e.end("stop");
1042
- }
1043
- e.end("gradientFill");
1044
- } else if (r.type === J.Type.Gradient) {
1045
- const t = r, o = {};
1046
- void 0 !== t.isRotatedWithShape && (o.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.start("gradFill", o), e.start("gsLst");
1047
- const n = t.stops;
1048
- if (n && n.length > 0) for (const t of n) {
1049
- let r, o = 0;
1050
- if ("string" == typeof t || "object" == typeof t && !("offset" in t)) r = t;
1051
- else {
1052
- const e = t;
1053
- o = e.offset || 0, r = e.color;
1054
- }
1055
- e.start("gs", { pos: String(V.roundAccurately(1e3 * o, 0)) }), r && re(e, a, r), e.end("gs");
1056
- }
1057
- e.end("gsLst");
1058
- const s = t.gradientType;
1059
- if (s && s !== J.GradientType.Linear) {
1060
- const r = "radial" === s ? "circle" : s;
1061
- e.start("path", { path: r });
1062
- const o = t.focus;
1063
- if (o) {
1064
- const t = {};
1065
- void 0 !== o.t && (t.t = String(V.roundAccurately(1e3 * o.t, 0))), void 0 !== o.l && (t.l = String(V.roundAccurately(1e3 * o.l, 0))), void 0 !== o.b && (t.b = String(V.roundAccurately(1e3 * o.b, 0))), void 0 !== o.r && (t.r = String(V.roundAccurately(1e3 * o.r, 0))), e.empty("fillToRect", t);
1066
- }
1067
- e.end("path");
1068
- } else {
1069
- const r = {};
1070
- void 0 !== t.angle && (r.ang = String(V.roundAccurately(6e4 * t.angle, 0)));
1071
- const o = t.scaled;
1072
- void 0 !== o && (r.scaled = o ? "1" : "0"), e.empty("lin", r);
1073
- }
1074
- e.end("gradFill");
1075
- } else n ? e.empty("patternFill", { patternType: "none" }) : e.empty("noFill");
1076
- n && e.end("fill");
1077
- }
1078
- var ve = (t, e, r, o) => {
1079
- if (!r) return e.start("ln"), e.empty("noFill"), void e.end("ln");
1080
- "string" == typeof r && (r = { fill: r });
1081
- const n = r, s = {};
1082
- if (void 0 !== n.width && (s.w = String(Re(n.width))), void 0 !== n.lineCap && (s.cap = we(n.lineCap)), void 0 !== n.compound && (s.cmpd = n.compound), void 0 !== n.align && (s.algn = n.align), e.start("ln", s), xe(0, e, n.fill ?? ke, o), Array.isArray(n.dash)) {
1083
- e.start("custDash");
1084
- for (let t = 0; t < n.dash.length; t += 2) e.empty("ds", {
1085
- d: String(V.roundAccurately(1e3 * n.dash[t], 0)),
1086
- sp: String(V.roundAccurately(1e3 * (n.dash[t + 1] ?? 0), 0))
1087
- });
1088
- e.end("custDash");
1089
- } else "string" == typeof n.dash && e.empty("prstDash", { val: n.dash });
1090
- if (n.lineJoin === Y.LineJoin.Round) e.empty("round");
1091
- else if (n.lineJoin === Y.LineJoin.Bevel) e.empty("bevel");
1092
- else if (n.lineJoin === Y.LineJoin.Miter) {
1093
- const t = {};
1094
- void 0 !== n.miterLimit && (t.lim = String(V.roundAccurately(1e5 * n.miterLimit, 0))), e.empty("miter", t);
1095
- }
1096
- e.end("ln");
1097
- }, we = (t) => "round" === t ? "rnd" : "butt" === t ? "flat" : "square" === t ? "sq" : t, Se = (t, e, r, o = void 0, n = !1) => {
1098
- if (!r) return;
1099
- if (!(r.fill || r.stroke || r.effects?.length || n)) return;
1100
- const s = t.getXMLWriter();
1101
- o && s.start(o), s.pushDefaultNamespace("a"), r.fill && xe(0, s, r.fill, e), r.stroke && ve(0, s, r.stroke, e), r.effects?.length ? be(t, s, e.getTheme(), r.effects) : n && s.empty("effectLst"), s.popDefaultNamespace(), o && s.end(o);
1102
- }, be = (t, e, r, o) => {
1103
- e.start("effectLst");
1104
- for (const t of o) Ce(e, r, t);
1105
- e.end("effectLst");
1106
- }, Ce = (t, e, r) => {
1107
- switch (r.type) {
1108
- case G.Type.OuterShadow: {
1109
- const o = r, n = {};
1110
- void 0 !== o.blur && (n.blurRad = String(Re(o.blur))), void 0 !== o.distance && (n.dist = String(Re(o.distance))), void 0 !== o.angle && (n.dir = String(Ae(o.angle))), void 0 !== o.alignment && (n.algn = o.alignment), void 0 !== o.isRotatedWithShape && (n.rotWithShape = o.isRotatedWithShape ? "1" : "0"), void 0 !== o.scaleX && (n.sx = String(V.roundAccurately(1e3 * o.scaleX, 0))), void 0 !== o.scaleY && (n.sy = String(V.roundAccurately(1e3 * o.scaleY, 0))), void 0 !== o.skewX && (n.kx = String(Ae(o.skewX))), void 0 !== o.skewY && (n.ky = String(Ae(o.skewY))), t.start("outerShdw", n), re(t, e, o.color), t.end("outerShdw");
1111
- break;
1112
- }
1113
- case G.Type.InnerShadow: {
1114
- const o = r, n = {};
1115
- void 0 !== o.blur && (n.blurRad = String(Re(o.blur))), void 0 !== o.distance && (n.dist = String(Re(o.distance))), void 0 !== o.angle && (n.dir = String(Ae(o.angle))), t.start("innerShdw", n), re(t, e, o.color), t.end("innerShdw");
1116
- break;
1117
- }
1118
- case G.Type.PresetShadow: {
1119
- const o = r, n = { prst: o.preset };
1120
- void 0 !== o.distance && (n.dist = String(Re(o.distance))), void 0 !== o.angle && (n.dir = String(Ae(o.angle))), t.start("prstShdw", n), re(t, e, o.color), t.end("prstShdw");
1121
- break;
1122
- }
1123
- case G.Type.Glow: {
1124
- const o = r, n = {};
1125
- void 0 !== o.radius && (n.rad = String(Re(o.radius))), t.start("glow", n), re(t, e, o.color), t.end("glow");
1126
- break;
1127
- }
1128
- case G.Type.SoftEdge: {
1129
- const e = r, o = {};
1130
- void 0 !== e.radius && (o.rad = String(Re(e.radius))), t.empty("softEdge", o);
1131
- break;
1132
- }
1133
- case G.Type.Reflection: {
1134
- const e = r, o = {};
1135
- void 0 !== e.blur && (o.blurRad = String(Re(e.blur))), void 0 !== e.distance && (o.dist = String(Re(e.distance))), void 0 !== e.angle && (o.dir = String(Ae(e.angle))), void 0 !== e.fadeAngle && (o.fadeDir = String(Ae(e.fadeAngle))), void 0 !== e.startAlpha && (o.stA = String(V.roundAccurately(1e3 * e.startAlpha, 0))), void 0 !== e.startPosition && (o.stPos = String(V.roundAccurately(1e3 * e.startPosition, 0))), void 0 !== e.endAlpha && (o.endA = String(V.roundAccurately(1e3 * e.endAlpha, 0))), void 0 !== e.endPosition && (o.endPos = String(V.roundAccurately(1e3 * e.endPosition, 0))), void 0 !== e.scaleX && (o.sx = String(V.roundAccurately(1e3 * e.scaleX, 0))), void 0 !== e.scaleY && (o.sy = String(V.roundAccurately(1e3 * e.scaleY, 0))), void 0 !== e.skewX && (o.kx = String(Ae(e.skewX))), void 0 !== e.skewY && (o.ky = String(Ae(e.skewY))), void 0 !== e.alignment && (o.algn = e.alignment), void 0 !== e.isRotatedWithShape && (o.rotWithShape = e.isRotatedWithShape ? "1" : "0"), t.empty("reflection", o);
1136
- break;
1137
- }
1138
- }
1139
- }, ke = { type: "none" }, Te = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", Ie = "imagesWritten", Me = {
1140
- mime: "image/png",
1141
- ext: "png"
1142
- }, Re = (t = 0) => V.roundAccurately(12700 * t, 0), Fe = (t = 0) => V.roundAccurately(9525 * t, 0), Ae = (t) => 6e4 * t, Le = (t = 0) => V.roundAccurately(100 * t, 2), _e = class {
1143
- constructor() {
1144
- this._dxfs = [], this._byKey = /* @__PURE__ */ new Map();
1145
- }
1146
- add(t) {
1147
- const e = JSON.stringify(t);
1148
- let r = this._byKey.get(e);
1149
- return void 0 === r && (r = this._dxfs.length, this._dxfs.push(t), this._byKey.set(e, r)), r;
1150
- }
1151
- getDxfs() {
1152
- return this._dxfs;
1153
- }
1154
- getCount() {
1155
- return this._dxfs.length;
1156
- }
1157
- }, Pe = "cfDxfs", Ne = [
1158
- "font",
1159
- "fill",
1160
- "borders",
1161
- "numberFormat",
1162
- "alignment"
1163
- ];
1164
- function De(t, e, r) {
1165
- if (e) {
1166
- if (e.named) {
1167
- const o = e.named, n = o.toLowerCase(), s = r.namedStyleMap;
1168
- if (!s.has(n)) {
1169
- s.set(n, "" + s.size);
1170
- const e = t.getNamedStyles().getByName(o).toJSON();
1171
- De(t, e.style ?? V.EmptyObject, r), r.namedStyles.push(e);
1172
- }
1173
- }
1174
- e.font && function(t, e, r) {
1175
- if (!e) return;
1176
- const o = $.JSONStableStringify(e), n = r.fontMap;
1177
- if (!n.has(o)) {
1178
- const t = n.size;
1179
- n.set(o, "" + t), r.fonts.push(e);
1180
- }
1181
- }(0, e.font, r), e.fill && function(t, e, r) {
1182
- if (!e) return;
1183
- const o = $.JSONStableStringify(e), n = r.fillMap;
1184
- if (!n.has(o) && "object" == typeof e && e.type) {
1185
- const t = n.size;
1186
- n.set(o, "" + t), r.fills.push(e);
1187
- }
1188
- }(0, e.fill, r), e.borders && function(t, e, r) {
1189
- if (!e) return;
1190
- const o = $.JSONStableStringify(e), n = r.borderMap;
1191
- if (!n.has(o)) {
1192
- const t = n.size;
1193
- n.set(o, "" + t), r.borders.push(e);
1194
- }
1195
- }(0, e.borders, r), void 0 !== e.numberFormat && function(t, e, r) {
1196
- if (!e) return;
1197
- const o = et.toBuiltInID(e), n = r.numFmtMap;
1198
- if (!n.has(o)) {
1199
- let t = 0;
1200
- "number" == typeof o ? t = o : (t = r.numFmtsCustom.length + je, r.numFmtsCustom.push(o)), n.set(e, "" + t);
1201
- }
1202
- }(0, e.numberFormat, r);
1203
- }
1204
- }
1205
- function Ee(t, e, r) {
1206
- if (!e) return;
1207
- const o = e.name.toLowerCase();
1208
- r.namedStyleMap.has(o) || (r.namedStyleMap.set(o, "" + r.namedStyleMap.size), r.namedStyles.push(e), De(t, e.style, r));
1209
- }
1210
- function Be(t, e, r, o, n = !1) {
1211
- const s = o.getDefaultFontSize(), a = o.getTheme().getFontScheme().getMinorFont() ?? "Calibri", l = o.getNormal().getFont().getColor();
1212
- e.start("font"), r.weight && r.weight >= 700 && e.empty("b"), r.style && "normal" !== r.style && e.empty("i"), r.strike && e.empty("strike"), r.underline && e.empty("u", { val: r.underline }), r.outline && e.empty("outline"), r.shadow && e.empty("shadow"), r.extend && e.empty("extend");
1213
- let i = r.verticalAlign;
1214
- i && ("super" === i && (i = "superscript"), "sub" === i && (i = "subscript"), e.empty("vertAlign", { val: i })), n ? void 0 !== r.size && e.empty("sz", { val: String(r.size) }) : e.empty("sz", { val: String(r.size ?? s) }), ne(e, o.getTheme(), r.color ?? l, "color", !n);
1215
- const c = !n || r.family && r.family !== a;
1216
- if (c && (e.empty("name", { val: r.family ?? a }), r.fallbacks && r.fallbacks.length > 0)) {
1217
- const t = r.fallbacks;
1218
- t.includes("serif") ? e.empty("family", { val: 1 }) : t.includes("sans-serif") ? e.empty("family", { val: 2 }) : t.includes("monospace") ? e.empty("family", { val: 3 }) : t.includes("cursive") ? e.empty("family", { val: 4 }) : t.includes("fantasy") && e.empty("family", { val: 5 });
1219
- }
1220
- void 0 !== r.charset && null !== r.charset && e.empty("charset", { val: String(r.charset) });
1221
- const d = r.scheme ?? (void 0 === r.family ? "minor" : void 0);
1222
- c && void 0 !== d && "none" !== d && e.empty("scheme", { val: d }), e.end("font");
1223
- }
1224
- function Oe(t, e, r, o, n, s = !1) {
1225
- if (!n || "none" === n.style || !n.style) return void (s && !n || e.empty(o));
1226
- e.start(o, { style: n.style });
1227
- let a = n.color;
1228
- a && ne(e, r, a, "color", !s, s), e.end(o);
1229
- }
1230
- function $e(t, e, r, o, n = !1) {
1231
- const s = {};
1232
- n ? (s.diagonalUp = "0", s.diagonalDown = "0") : (r.diagonalUp && (s.diagonalUp = "1"), r.diagonalDown && (s.diagonalDown = "1")), e.start("border", s), Oe(0, e, o, "left", r.left, n), Oe(0, e, o, "right", r.right, n), Oe(0, e, o, "top", r.top, n), Oe(0, e, o, "bottom", r.bottom, n), n ? (Oe(0, e, o, "vertical", r.vertical, n), Oe(0, e, o, "horizontal", r.horizontal, n)) : Oe(0, e, o, "diagonal", r.diagonalUp ?? r.diagonalDown, n), e.end("border");
1233
- }
1234
- function We(t, e, r, o = !1) {
1235
- const n = {};
1236
- r.horizontal && r.horizontal !== Q.HorizontalAlignment.General && (n.horizontal = r.horizontal), r.vertical && r.vertical !== Q.VerticalAlignment.Bottom && (n.vertical = r.vertical);
1237
- let s = r.rotation;
1238
- r.stacked && (n.textRotation = "255", s = 0), s && (s >= 270 && s < 360 ? s = 360 - s : s > 0 && s <= 90 && (s += 90), n.textRotation = String(s));
1239
- const a = r.overflow;
1240
- switch (a === Q.Overflow.Wrap && (n.wrapText = "1"), r.indent && (n.indent = "" + r.indent), r.relativeIndent && (n.relativeIndent = "" + r.relativeIndent), r.justifyLastLine && (n.justifyLastLine = "1"), a === Q.Overflow.Shrink && (n.shrinkToFit = "1"), r.readingDirection) {
1241
- case Q.ReadingDirection.Auto: break;
1242
- case Q.ReadingDirection.LeftToRight:
1243
- n.readingOrder = "1";
1244
- break;
1245
- case Q.ReadingDirection.RightToLeft: n.readingOrder = "2";
1246
- }
1247
- return Object.keys(n).length > 0 ? n : null;
1248
- }
1249
- function Ve(t, e, r, o, n, s, a = !1) {
1250
- const l = {};
1251
- let i = null, c = o.named;
1252
- c && (i = r.getNamedStyles().getByName(c).toJSON().style);
1253
- const d = o.font ?? i?.font, m = d ? n.fontMap.get($.JSONStableStringify(d)) ?? 0 : 0, p = o.fill ?? i?.fill, f = p ? n.fillMap.get($.JSONStableStringify(p)) ?? 0 : 0, h = o.borders ?? i?.borders, u = h ? n.borderMap.get($.JSONStableStringify(h)) ?? 0 : 0, g = o.numberFormat ?? i?.numberFormat;
1254
- if (l.numFmtId = (void 0 !== g ? n.numFmtMap.get(g) : void 0) ?? "0", l.fontId = String(m), l.fillId = String(f), l.borderId = String(u), s) {
1255
- const t = o.named ?? Z.BuiltInName.Normal;
1256
- l.xfId = n.namedStyleMap.get(t.toLowerCase());
1257
- }
1258
- let y = null;
1259
- const x = o.alignment ?? i?.alignment;
1260
- x && (y = We(0, 0, x)), o.font && (l.applyFont = "1"), o.fill && (l.applyFill = "1"), o.numberFormat && (l.applyNumberFormat = "1"), o.borders && (l.applyBorder = "1"), y && (l.applyAlignment = "1");
1261
- let v = null;
1262
- const w = o.protection?.alwaysUnlocked ?? i?.protection?.alwaysUnlocked ?? !1;
1263
- (w || a) && (v = {}, w && (v.locked = "0"), a && (v.hidden = "1"), l.applyProtection = "1"), o.quotePrefix && (l.quotePrefix = "1"), y || v ? (e.start("xf", l), y && e.empty("alignment", y), v && e.empty("protection", v), e.end("xf")) : e.empty("xf", l);
1264
- }
1265
- function ze(t, e, r, o, n, s = "dxf", a = je) {
1266
- if (e.start(s), r.font && Be(0, e, r.font, o, !0), void 0 !== r.numberFormat && null !== r.numberFormat) {
1267
- const t = et.toBuiltInID(r.numberFormat), o = "number" == typeof t, n = o ? et.builtInFormat(t) : String(t);
1268
- n && e.empty("numFmt", {
1269
- numFmtId: String(o ? t : a++),
1270
- formatCode: n
1271
- });
1272
- }
1273
- if (r.fill && xe(0, e, r.fill, o, !0, !0), r.alignment) {
1274
- const t = We(0, 0, r.alignment, !0);
1275
- t && e.empty("alignment", t);
1276
- }
1277
- return r.borders && $e(0, e, r.borders, n, !0), e.end(s), a;
1278
- }
1279
- var je = 164, Ue = Object.freeze([
1280
- "wholeTable",
1281
- "headerRow",
1282
- "totalRow",
1283
- "firstColumn",
1284
- "lastColumn",
1285
- "firstRowStripe",
1286
- "secondRowStripe",
1287
- "firstColumnStripe",
1288
- "secondColumnStripe",
1289
- "firstHeaderCell",
1290
- "lastHeaderCell",
1291
- "firstTotalCell",
1292
- "lastTotalCell"
1293
- ]), Xe = H.BuiltInOperatorNames, He = (t, e, r, o, n, s) => {
1294
- const a = o.sorts, l = a ? a.length : 0;
1295
- if (0 === l) return;
1296
- const i = {};
1297
- if (l > 0) {
1298
- const t = a[0].criteria?.collatorOptions;
1299
- t && (i.caseSensitive = "object" != typeof t || Array.isArray(t) || "case" !== t.sensitivity && "variant" !== t.sensitivity ? "0" : "1");
1300
- }
1301
- i.ref = r.getRange().toString(), i["xmlns:xlrd2"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2", e.start("sortState", i);
1302
- for (let t = 0; t < l; t++) {
1303
- const r = a[t], o = r.criteria ?? {}, l = r.index + s.colStart, i = {};
1304
- o.reverse && (i.descending = "1"), i.ref = n.getIntersect({
1305
- colStart: l,
1306
- rowStart: s.rowStart,
1307
- colEnd: l,
1308
- rowEnd: s.rowEnd
1309
- }).toString(), o.sortOn && (i.sortBy = o.sortOn), void 0 !== o.dxfId && (i.dxfId = o.dxfId), void 0 !== o.iconSet && (i.iconSet = o.iconSet), void 0 !== o.customList && (i.customList = o.customList), e.empty("sortCondition", i);
1310
- }
1311
- e.end("sortState");
1312
- }, qe = (t, e, r, o, n = !1) => {
1313
- let s = r.getRange();
1314
- r.isShowTotals() && (s = s.getResizeBy(-1, 0));
1315
- const a = s.getCoords(), l = o.sort, i = o.filter, c = i ? i.conditions : void 0, d = c ? c.length : 0, m = o.hiddenButtons, p = {};
1316
- p.ref = s.toString();
1317
- let f, h = [];
1318
- for (let t = 0; t < d; t++) {
1319
- const e = c[t];
1320
- h[e.index] = { ...e };
1321
- }
1322
- if (Array.isArray(m) && m.length > 0) {
1323
- const t = m.length;
1324
- f = new Array(m[t - 1]);
1325
- for (let e = 0; e < t; e++) f[m[e]] = !0;
1326
- }
1327
- if (h || m || f || n) {
1328
- let i = 0;
1329
- o.columns ? i = o.columns.length : n && (i = s.getColumnCount()), e.start("autoFilter", p);
1330
- for (let r = 0; r < i; r++) {
1331
- const o = !0 === m || !0 === f?.[r], n = h[r];
1332
- (n || o) && Je(t, e, r, n, o);
1333
- }
1334
- l && n && He(0, e, r, l, s, a), e.end("autoFilter");
1335
- } else e.empty("autoFilter", p);
1336
- l && !n && He(0, e, r, l, s, a);
1337
- }, Ge = (t, e, r) => {
1338
- const o = R(r, (e) => t.warn(e, r));
1339
- if (!o) return;
1340
- const n = { operator: o.operator };
1341
- void 0 !== o.val && (n.val = o.val), e.empty("customFilter", n);
1342
- }, Je = (t, e, r, o, n) => {
1343
- const s = {};
1344
- s.colId = "" + r, n && (s.hiddenButton = "1"), o ? (e.start("filterColumn", s), ((t, e, r) => {
1345
- const o = r.operator;
1346
- if (o !== H.BuiltInOperatorNames.Expression) if (o !== H.BuiltInOperatorNames.Unique) {
1347
- if (o === H.BuiltInOperatorNames.Color) {
1348
- const t = r.param, o = {};
1349
- void 0 !== t.cellColor && (o.cellColor = t.cellColor ? "1" : "0"), void 0 !== t.styleId && (o.dxfId = t.styleId), e.empty("colorFilter", o);
1350
- }
1351
- if (Ke(o)) if ("between" === o) {
1352
- const o = r.param;
1353
- e.start("customFilters", { and: "1" }), Ge(t, e, {
1354
- operator: Xe.GreaterThanEqualTo,
1355
- param: o.from
1356
- }), Ge(t, e, {
1357
- operator: Xe.LessThanEqualTo,
1358
- param: o.to
1359
- }), e.end("customFilters");
1360
- } else if (o === H.BuiltInOperatorNames.Not) {
1361
- const o = r.param;
1362
- C(o?.operator) ? (e.start("customFilters"), Ge(t, e, r), e.end("customFilters")) : t.warn("Not rule with non-comparison criteria not supported in OOXML", o);
1363
- } else if (o === H.BuiltInOperatorNames.And || o === H.BuiltInOperatorNames.Or) {
1364
- const n = r.param, s = n.length;
1365
- if (s > 0) {
1366
- const r = {};
1367
- o === H.BuiltInOperatorNames.And && s > 1 && (r.and = "1"), e.start("customFilters", r);
1368
- for (let r = 0; r < s; r++) {
1369
- const o = n[r], s = o.operator === Xe.Not && C(o.param?.operator);
1370
- C(o.operator) || s ? Ge(t, e, o) : t.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", o);
1371
- }
1372
- e.end("customFilters");
1373
- }
1374
- } else C(o) && (e.start("customFilters"), Ge(t, e, r), e.end("customFilters"));
1375
- if (o === H.BuiltInOperatorNames.TimePeriod) {
1376
- const t = r.param, o = {};
1377
- t.type && (o.type = t.type), void 0 !== t.anchorDate && (o.val = "" + t.anchorDate), void 0 !== t.maxVal && (o.maxVal = "" + t.maxVal), e.empty("dynamicFilter", o);
1378
- }
1379
- if (o === H.BuiltInOperatorNames.Average) {
1380
- const t = r.param, o = {};
1381
- let n = t.type;
1382
- n && (n === H.AverageType.Above ? o.type = "aboveAverage" : n === H.AverageType.Below && (o.type = "belowAverage")), void 0 !== t.stdDevs && (o.val = "" + t.stdDevs), e.empty("dynamicFilter", o);
1383
- }
1384
- if (o === H.BuiltInOperatorNames.InSet) {
1385
- const t = r.param;
1386
- if (t.dateGroups) {
1387
- const r = t.dateGroups, o = r.length;
1388
- e.start("dateGroupItem");
1389
- for (let t = 0; t < o; t++) {
1390
- const o = r[t], n = {};
1391
- void 0 !== o.day && (n.day = "" + o.day), void 0 !== o.hour && (n.hour = "" + o.hour), void 0 !== o.minute && (n.minute = "" + o.minute), void 0 !== o.second && (n.second = "" + o.second), void 0 !== o.year && (n.year = "" + o.year), void 0 !== o.month && (n.month = "" + o.month), n.dateTimeGrouping = o.group, e.empty("dateGroupItem", n);
1392
- }
1393
- e.end("dateGroupItem");
1394
- }
1395
- if (t.items) {
1396
- const r = t.items, o = r.length;
1397
- e.start("filters");
1398
- for (let t = 0; t < o; t++) {
1399
- const o = r[t];
1400
- e.empty("filter", { val: "" + o });
1401
- }
1402
- e.end("filters");
1403
- }
1404
- }
1405
- if (o === H.BuiltInOperatorNames.Icon) {
1406
- const t = r.param, o = {};
1407
- void 0 !== t.iconSet && (o.iconSet = t.iconSet), void 0 !== t.iconId && (o.iconId = "" + t.iconId), e.empty("iconFilter", o);
1408
- }
1409
- if (o === H.BuiltInOperatorNames.TopN) {
1410
- const t = r.param, o = {};
1411
- t.percent && (o.percent = "1"), void 0 !== t.top && (o.top = t.top ? "1" : "0"), void 0 !== t.limit && (o.val = "" + t.limit), void 0 !== t.filterVal && (o.filterVal = "" + t.filterVal), e.empty("top10", o);
1412
- }
1413
- } else t.warn("Unique conditions not supported in Table AutoFilters", r);
1414
- else t.warn("Expression conditions not supported in Table AutoFilters", r);
1415
- })(t, e, o), e.end("filterColumn")) : e.empty("filterColumn", s);
1416
- }, Ke = (t) => t === H.BuiltInOperatorNames.GreaterThan || t === H.BuiltInOperatorNames.GreaterThanEqualTo || t === H.BuiltInOperatorNames.LessThan || t === H.BuiltInOperatorNames.LessThanEqualTo || t === H.BuiltInOperatorNames.EqualTo || t === H.BuiltInOperatorNames.And || t === H.BuiltInOperatorNames.Or || t === H.BuiltInOperatorNames.Not || "between" === t, Ye = {
1417
- names: /* @__PURE__ */ new Set(),
1418
- perFormula: [],
1419
- affects: () => !1
1420
- };
1421
- var Ze = 1048576, Qe = (t, e, r) => {
1422
- if (!r) return [];
1423
- let o = 0;
1424
- for (let n = 0; n < r.length; n++) {
1425
- const s = r[n][0], a = e.getRange(s).getCoords();
1426
- if (o += (a.rowEnd - a.rowStart + 1) * (a.colEnd - a.colStart + 1), o > Ze) return t.warn(`Direct styles cover more than ${Ze} cells; not writing the styles from '${s}' on. A range that size belongs in a column or row style.`), r.slice(0, n);
1427
- }
1428
- return r;
1429
- };
1430
- function tr(t, e) {
1431
- let r = e.type;
1432
- r === q.ColorStopType.AutoMin ? r = q.ColorStopType.Min : r === q.ColorStopType.AutoMax && (r = q.ColorStopType.Max), t.empty("cfvo", {
1433
- type: r,
1434
- val: e.value,
1435
- gte: e.exclusive ? "0" : void 0
1436
- });
1437
- }
1438
- function er(t, e) {
1439
- const r = {
1440
- type: e.type,
1441
- gte: e.exclusive ? "0" : void 0
1442
- };
1443
- void 0 !== e.value ? (t.start("x14:cfvo", r), t.start("xm:f"), t.text(e.value), t.end("xm:f"), t.end("x14:cfvo")) : t.empty("x14:cfvo", r);
1444
- }
1445
- var rr = /* @__PURE__ */ new Set([
1446
- Z.IconSet.Arrows3,
1447
- Z.IconSet.ArrowsGray3,
1448
- Z.IconSet.Flags3,
1449
- Z.IconSet.Signs3,
1450
- Z.IconSet.Symbols3,
1451
- Z.IconSet.Symbols3_2,
1452
- Z.IconSet.TrafficLights3,
1453
- Z.IconSet.TrafficLights3_2,
1454
- Z.IconSet.Arrows4,
1455
- Z.IconSet.ArrowsGray4,
1456
- Z.IconSet.Rating4,
1457
- Z.IconSet.RedToBlack4,
1458
- Z.IconSet.TrafficLights4,
1459
- Z.IconSet.Arrows5,
1460
- Z.IconSet.ArrowsGray5,
1461
- Z.IconSet.Quarters5,
1462
- Z.IconSet.Rating5
1463
- ]);
1464
- function or(t) {
1465
- return (t.icon?.length ?? 0) > 0 || void 0 !== t.iconSet && !rr.has(t.iconSet);
1466
- }
1467
- function nr(t, e, r, o, n, s, l, i, c) {
1468
- const d = o.scale;
1469
- o.ext && t.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1470
- const m = {
1471
- type: n.type,
1472
- dxfId: o.style && Object.keys(o.style).length > 0 ? i.add(o.style) : void 0,
1473
- priority: l,
1474
- stopIfTrue: lr(o.stopIfTrue),
1475
- aboveAverage: lr(n.aboveAverage),
1476
- equalAverage: lr(n.equalAverage),
1477
- stdDev: n.stdDev,
1478
- bottom: lr(n.bottom),
1479
- percent: lr(n.percent),
1480
- rank: n.rank,
1481
- operator: n.operator,
1482
- text: n.text,
1483
- timePeriod: n.timePeriod
1484
- };
1485
- let p;
1486
- d?.type === q.ScaleType.DataBar && function(t) {
1487
- if (t.gradient || t.borderColor || t.negativeFillColor || t.negativeBorderColor || t.axisColor || t.axisPosition || t.direction) return !0;
1488
- const e = t.stops, r = e ? e.length : 0;
1489
- for (let t = 0; t < r; t++) {
1490
- const r = e[t].type;
1491
- if (r === q.ColorStopType.AutoMin || r === q.ColorStopType.AutoMax) return !0;
1492
- }
1493
- return !1;
1494
- }(d) && (p = N(V.uuidV4), c.push({
1495
- guid: p,
1496
- sqref: s,
1497
- priority: l,
1498
- scale: d
1499
- }));
1500
- const f = n.formulas, h = f ? f.length : 0;
1501
- if (0 !== h || d) {
1502
- e.start("cfRule", m);
1503
- for (let t = 0; t < h; t++) e.start("formula"), e.text(f[t]), e.end("formula");
1504
- if (d?.type === q.ScaleType.ColorScale) {
1505
- const t = d.stops ?? [];
1506
- e.start("colorScale");
1507
- for (let r = 0; r < t.length; r++) tr(e, t[r]);
1508
- for (let o = 0; o < t.length; o++) ne(e, r, t[o].color, "color");
1509
- e.end("colorScale");
1510
- } else if (d?.type === q.ScaleType.DataBar) {
1511
- const t = d.stops ?? [];
1512
- e.start("dataBar", {
1513
- minLength: d.minLength,
1514
- maxLength: d.maxLength,
1515
- showValue: lr(d.showValue)
1516
- });
1517
- for (let r = 0; r < t.length; r++) tr(e, t[r]);
1518
- d.color && ne(e, r, d.color, "color"), e.end("dataBar");
1519
- } else if (d?.type === q.ScaleType.IconSet) {
1520
- const t = d.stops ?? [];
1521
- e.start("iconSet", {
1522
- iconSet: d.iconSet,
1523
- reverse: lr(d.reverse),
1524
- showValue: lr(d.showValue)
1525
- });
1526
- for (let r = 0; r < t.length; r++) tr(e, t[r]);
1527
- e.end("iconSet");
1528
- }
1529
- p && (e.start("extLst"), e.start("ext", {
1530
- uri: a,
1531
- "xmlns:x14": y
1532
- }), e.start("x14:id"), e.text(p), e.end("x14:id"), e.end("ext"), e.end("extLst")), e.end("cfRule");
1533
- } else e.empty("cfRule", m);
1534
- }
1535
- function sr(t) {
1536
- let e = Number.MAX_SAFE_INTEGER, r = Number.MAX_SAFE_INTEGER;
1537
- const o = t.split(" ");
1538
- for (let t = 0; t < o.length; t++) {
1539
- if (!o[t]) continue;
1540
- const n = O.fastStringToRange(o[t]);
1541
- n.rowStart < e && (e = n.rowStart), n.colStart < r && (r = n.colStart);
1542
- }
1543
- return O.cellToString({
1544
- rowIndex: e,
1545
- colIndex: r
1546
- });
1547
- }
1548
- function ar(t) {
1549
- if ("string" == typeof t) return t.split(",").join(" ");
1550
- if (Array.isArray(t)) {
1551
- const e = [];
1552
- for (let r = 0; r < t.length; r++) {
1553
- const o = O.rangeToString(t[r]);
1554
- o && e.push(o);
1555
- }
1556
- return e.length > 0 ? e.join(" ") : null;
1557
- }
1558
- return O.rangeToString(t);
1559
- }
1560
- function lr(t) {
1561
- if (void 0 !== t) return t ? "1" : "0";
1562
- }
1563
- function ir(t) {
1564
- if ("string" != typeof t) return !1;
1565
- let e = !1;
1566
- for (let r = 0; r < t.length; r++) {
1567
- const o = t[r];
1568
- if ("\"" === o) e = !e;
1569
- else if ("!" === o && !e) return !0;
1570
- }
1571
- return !1;
1572
- }
1573
- function cr(t) {
1574
- const e = t.formulas, r = e ? e.length : 0;
1575
- for (let t = 0; t < r; t++) if (ir(e[t])) return !0;
1576
- return !1;
1577
- }
1578
- function dr(t) {
1579
- let e = Number.MAX_SAFE_INTEGER, r = Number.MAX_SAFE_INTEGER;
1580
- const o = t.split(" ");
1581
- for (let t = 0; t < o.length; t++) {
1582
- if (!o[t]) continue;
1583
- const n = O.fastStringToRange(o[t]);
1584
- n.rowStart < e && (e = n.rowStart), n.colStart < r && (r = n.colStart);
1585
- }
1586
- return e === Number.MAX_SAFE_INTEGER ? null : {
1587
- rowIndex: e,
1588
- colIndex: r
1589
- };
1590
- }
1591
- function mr(t, e, r) {
1592
- if ("string" != typeof t || !t || !e || !r) return t;
1593
- try {
1594
- const o = r.parse(t, e);
1595
- return o && U.image(r.spell(o, !0), { at: e }) || t;
1596
- } catch {
1597
- return t;
1598
- }
1599
- }
1600
- function pr(t, e, r) {
1601
- const o = t?.stops;
1602
- if (!o || !r) return t;
1603
- let n;
1604
- for (let t = 0; t < o.length; t++) {
1605
- const s = o[t]?.value;
1606
- if ("string" != typeof s) continue;
1607
- const a = mr(s, e, r);
1608
- a !== s && (n || (n = [...o]), n[t] = {
1609
- ...o[t],
1610
- value: a
1611
- });
1612
- }
1613
- return n ? {
1614
- ...t,
1615
- stops: n
1616
- } : t;
1617
- }
1618
- function fr(t, e, r, o) {
1619
- if (!o?.xml) return;
1620
- const n = t.addPart("legacyDrawing", o);
1621
- e.empty(r, { "r:id": n.relId });
1622
- }
1623
- var hr = (t, e) => {
1624
- if (!e) return t;
1625
- const r = t?.xml ?? null;
1626
- let o = v(r ?? "");
1627
- const n = [], s = e.comments;
1628
- for (let t = 0; t < s.length; t++) {
1629
- const { comment: e, row: r, col: a } = s[t], l = e.toJSON()?.box, i = l?.xml ? _(l.xml).notes[0] : void 0;
1630
- if (i) {
1631
- const t = A(i.xml);
1632
- null !== t && (o = Math.max(o, t)), n.push(M(i, r, a));
1633
- } else n.push(S(r, a, ++o));
1634
- }
1635
- const a = k(r, n);
1636
- return a ? a === r ? t : t ? {
1637
- ...t,
1638
- xml: a
1639
- } : { xml: a } : t;
1640
- };
1641
- var ur = (t) => "control" !== t.content?.type, gr = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp";
1642
- var yr = (t, e) => {
1643
- if (!t?.xml) return t;
1644
- const r = e.movables;
1645
- if (!r) return t;
1646
- const o = /* @__PURE__ */ new Map(), n = r.length;
1647
- for (let t = 0; t < n; t++) {
1648
- const e = r[t];
1649
- if (ur(e)) continue;
1650
- const n = (e.content?.json)?.shapeId;
1651
- "number" == typeof n && o.set(n, e);
1652
- }
1653
- if (0 === o.size) return t;
1654
- const s = t.xml.replace(/<v:shape\b[\s\S]*?<\/v:shape>/g, (t) => {
1655
- const e = /\bo:spid="_x0000_s(\d+)"/.exec(t) ?? /\bid="_x0000_s(\d+)"/.exec(t), r = e ? o.get(parseInt(e[1], 10)) : void 0;
1656
- if (!r) return t;
1657
- const n = r.anchor, s = [
1658
- n.tl.c,
1659
- n.tl.r,
1660
- n.br.c,
1661
- n.br.r
1662
- ];
1663
- return t.replace(/(<x:Anchor>)([\s\d,-]*)(<\/x:Anchor>)/, (t, e, r, o) => {
1664
- const n = r.split(",").map((t) => t.trim());
1665
- if (8 !== n.length) return t;
1666
- const a = n.slice();
1667
- for (let t = 0; t < 4; t++) a[2 * t] = String(s[t] ?? 0);
1668
- return a.join(",") === n.join(",") ? t : `${e}${a.join(", ")}${o}`;
1669
- });
1670
- });
1671
- return s === t.xml ? t : {
1672
- ...t,
1673
- xml: s
1674
- };
1675
- }, xr = (t, e, r) => {
1676
- t.start(e), t.start("xdr:col"), t.text(r.c ?? 0), t.end("xdr:col"), t.start("xdr:colOff"), t.text(Fe(r.x)), t.end("xdr:colOff"), t.start("xdr:row"), t.text(r.r ?? 0), t.end("xdr:row"), t.start("xdr:rowOff"), t.text(Fe(r.y)), t.end("xdr:rowOff"), t.end(e);
1677
- };
1678
- var vr = {
1679
- r: void 0,
1680
- s: void 0,
1681
- t: void 0,
1682
- cm: void 0,
1683
- vm: void 0
1684
- }, wr = {
1685
- r: void 0,
1686
- s: void 0,
1687
- customFormat: void 0,
1688
- hidden: void 0,
1689
- ht: void 0,
1690
- customHeight: void 0,
1691
- "x14ac:dyDescent": "0.25",
1692
- outlineLevel: void 0,
1693
- collapsed: void 0
1694
- }, Sr = {
1695
- t: void 0,
1696
- aca: void 0,
1697
- ref: void 0,
1698
- ca: void 0,
1699
- si: void 0
1700
- }, br = {
1701
- t: "shared",
1702
- aca: void 0,
1703
- ref: void 0,
1704
- ca: void 0,
1705
- si: void 0
1706
- }, Cr = {
1707
- t: "array",
1708
- aca: void 0,
1709
- ref: void 0,
1710
- ca: void 0,
1711
- si: void 0
1712
- };
1713
- function kr(t, e, r, o) {
1714
- r && (e.start(o), e.empty("latin", { typeface: r }), e.empty("ea", { typeface: "" }), e.empty("cs", { typeface: "" }), e.end(o));
1715
- }
1716
- var Tr = (t) => t.toISOString().split(".")[0] + "Z", Ir = (t, e, r) => {
1717
- switch (e) {
1718
- case "creator":
1719
- t.start("dc:creator"), t.text(r), t.end("dc:creator");
1720
- break;
1721
- case "lastModifiedBy":
1722
- t.start("cp:lastModifiedBy"), t.text(r), t.end("cp:lastModifiedBy");
1723
- break;
1724
- case "created":
1725
- t.start("dcterms:created", { "xsi:type": "dcterms:W3CDTF" }), t.text(r), t.end("dcterms:created");
1726
- break;
1727
- case "modified": t.start("dcterms:modified", { "xsi:type": "dcterms:W3CDTF" }), t.text(r), t.end("dcterms:modified");
1728
- }
1729
- }, Mr = (t, e, r, o) => {
1730
- e.start(r), e.text(o), e.end(r);
1731
- }, Rr = (t, e, r) => {
1732
- const o = r.getSheets().getItems({ visibility: K.Visibility.Hidden }).map((t) => t.getName()), n = r.getNames().getItems({ type: "formula" }).filter((t) => !!t.getRanges?.()).map((t) => t.getName());
1733
- e.start("HeadingPairs"), e.start("vt:vector", {
1734
- size: n.length > 0 ? "4" : "2",
1735
- baseType: "variant"
1736
- }), e.start("vt:variant"), e.start("vt:lpstr"), e.text("Worksheets"), e.end("vt:lpstr"), e.end("vt:variant"), e.start("vt:variant"), e.start("vt:i4"), e.text("" + o.length), e.end("vt:i4"), e.end("vt:variant"), n.length > 0 && (e.start("vt:variant"), e.start("vt:lpstr"), e.text("Named Ranges"), e.end("vt:lpstr"), e.end("vt:variant"), e.start("vt:variant"), e.start("vt:i4"), e.text("" + n.length), e.end("vt:i4"), e.end("vt:variant")), e.end("vt:vector"), e.end("HeadingPairs"), e.start("TitlesOfParts"), e.start("vt:vector", {
1737
- size: "" + (o.length + n.length),
1738
- baseType: "lpstr"
1739
- });
1740
- for (const t of o) e.start("vt:lpstr"), e.text(t), e.end("vt:lpstr");
1741
- for (const t of n) e.start("vt:lpstr"), e.text(t), e.end("vt:lpstr");
1742
- e.end("vt:vector"), e.end("TitlesOfParts");
1743
- }, Fr = {
1744
- minSupportedVersion: "120000",
1745
- copy: "1",
1746
- pasteAll: "1",
1747
- pasteValues: "1",
1748
- merge: "1",
1749
- splitFirst: "1",
1750
- rowColShift: "1",
1751
- clearFormats: "1",
1752
- clearComments: "1",
1753
- assign: "1",
1754
- coerce: "1"
1755
- }, Ar = (t, e, r = V.EmptyArray) => {
1756
- if (!e) return { ...r };
1757
- const { text: o, runs: n, color: s, size: a, kern: l, weight: i, style: c, b: d, i: m, spc: p, baseline: f, ...h } = e, u = {
1758
- ...r,
1759
- ...h
1760
- };
1761
- return void 0 !== a && (u.sz = "" + Le(a)), void 0 !== d && (u.b = d ? "1" : "0"), void 0 !== i && (u.b = i > 500 ? "1" : "0"), void 0 !== m && (u.i = m ? "1" : "0"), void 0 !== c && (u.i = "italic" === c ? "1" : "0"), void 0 !== l && (u.kern = "" + Le(l)), void 0 !== p && (u.spc = "" + Le(p)), void 0 !== f && (u.baseline = "" + Le(f)), u;
1762
- }, Lr = (t, e, r) => {
1763
- if (!r) return;
1764
- const o = t.getXMLWriter();
1765
- o.start("txBody"), o.pushDefaultNamespace("a");
1766
- Pr(t, e, {
1767
- vertOverflow: "clip",
1768
- horzOverflow: "clip",
1769
- rtlCol: "0",
1770
- anchor: "ctr"
1771
- }), o.empty("lstStyle"), ((t, e, r) => {
1772
- if (!r) return;
1773
- const o = t.getXMLWriter();
1774
- o.pushDefaultNamespace("a"), "string" == typeof r && (r = { runs: [{ text: r }] }), o.start("p");
1775
- o.empty("pPr", { algn: "ctr" });
1776
- const s = Ar(0, r, {
1777
- ...Nr,
1778
- size: e.getDefaultFontSize()
1779
- }), a = r?.runs, l = a ? a.length : 0;
1780
- if (l > 0) for (let t = 0; t < l; t++) {
1781
- const r = a[t];
1782
- o.start("r", {});
1783
- const n = Ar(0, r, Nr), s = r.color;
1784
- s ? (o.start("rPr", n), xe(0, o, s, e), o.end("rPr")) : o.empty("rPr", n), o.start("t"), o.text(r?.text ?? ""), o.end("t"), o.end("r");
1785
- }
1786
- else o.empty("endParaRPr", s);
1787
- o.end("p"), o.popDefaultNamespace();
1788
- })(t, e, r), o.popDefaultNamespace(), o.end("txBody");
1789
- }, _r = (t, e, r) => {
1790
- if (!r) return;
1791
- const o = t.getXMLWriter(), n = Ar(0, r);
1792
- o.empty("defRPr", n);
1793
- }, Pr = (t, e, r) => {
1794
- if (!r) return;
1795
- const o = t.getXMLWriter(), { spAutoFit: n, ...s } = r;
1796
- n ? (o.start("bodyPr", s), o.empty("spAutoFit"), o.end("bodyPr")) : o.empty("bodyPr", s);
1797
- }, Nr = Object.freeze({ lang: "en-US" }), Dr = (t, e) => {
1798
- if (0 !== e.length) {
1799
- t.start("a:extLst");
1800
- for (const r of e) {
1801
- const e = {}, o = r[0];
1802
- o && (e.uri = o), t.start("a:ext", e), t.empty(r[1], r[2]), t.end("a:ext");
1803
- }
1804
- t.end("a:extLst");
1805
- }
1806
- }, Er = async (t, e, r, o, n) => {
1807
- const s = t.getSharedStates(), a = o.getContent().getResource(), l = await a.getExternalURI();
1808
- let i;
1809
- if (l) i = t.addExternal(Te, l);
1810
- else if (i = r.get(a), !i) {
1811
- let e = s.get(Ie);
1812
- e || (e = /* @__PURE__ */ new Map(), s.set(Ie, e));
1813
- let o = e.get(a);
1814
- if (!o) {
1815
- const t = await a.toBuffer();
1816
- o = {
1817
- bytes: new Uint8Array(t),
1818
- type: await a.getType() ?? Me,
1819
- index: e.size + 1
1820
- }, e.set(a, o);
1821
- }
1822
- i = t.addBinary(o.bytes, o.type.mime, Te, `../media/image${o.index}.${o.type.ext}`, !0), r.set(a, i);
1823
- }
1824
- const c = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
1825
- l ? c["r:link"] = i.relId : c["r:embed"] = i.relId;
1826
- const d = [];
1827
- l || d.push([
1828
- "{28A0092B-C50C-407E-A947-70E740481C1C}",
1829
- "a14:useLocalDpi",
1830
- {
1831
- "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main",
1832
- val: "0"
1833
- }
1834
- ]);
1835
- const m = t.getXMLWriter();
1836
- m.start("pic"), m.start("nvPicPr"), Xr(t, m, o, n, e), qr(t, m, o, n), m.end("nvPicPr"), m.start("blipFill"), m.start("a:blip", c), Dr(m, d), m.end("a:blip"), m.start("a:stretch"), m.empty("a:fillRect"), m.end("a:stretch"), m.end("blipFill"), jr(t, e, r, o, n), m.end("pic");
1837
- }, Br = async (t, e, r, o, n, s) => {
1838
- const a = n.content?.json, l = a?.xml, i = a?.part;
1839
- if (!l || !i) return zr(t, e, r, o, n);
1840
- const c = await Ht(i, t, "../charts/chart{n}.xml");
1841
- if (!c?.relId) return zr(t, e, r, o, n);
1842
- let d = c.relId === i.id ? l : l.replace(`r:id="${i.id}"`, `r:id="${c.relId}"`);
1843
- void 0 !== s && "number" == typeof n.content?.json?.sourceId && (d = d.replace(`cNvPr id="${n.content.json.sourceId}"`, `cNvPr id="${s}"`)), t.getXMLWriter().raw(d);
1844
- }, Or = async (t, e, r, o, n) => zr(t, e, r, o, n), $r = async (t, e, r, o, n) => zr(t, e, r, o, n), Wr = async (t, e, r, o, n) => zr(t, e, r, o, n), Vr = async (t, e, r, o, n, s) => {
1845
- const a = n.content?.json, l = a?.xml;
1846
- if (!l) return zr(t, e, r, o, n);
1847
- const i = void 0 !== s && "number" == typeof a?.sourceId ? l.replace(`cNvPr id="${a.sourceId}"`, `cNvPr id="${s}"`) : l;
1848
- t.getXMLWriter().raw(i);
1849
- }, zr = async (t, e, r, o, n) => {
1850
- (async (t, e, r, o, n) => {
1851
- const s = t.getXMLWriter(), a = {}, l = n.content?.json, i = l?.type ?? "sp", c = e.getStyles();
1852
- "cxnSp" === i ? (a.macro = "", s.start("cxnSp", a), s.start("nvCxnSpPr"), Xr(t, s, o, n, e), Hr(t, s, o, n, e), s.start("cNvCxnSpPr"), s.empty("a:stCnx", {
1853
- id: "0",
1854
- idx: "0"
1855
- }), s.end("cNvCxnSpPr"), s.end("nvCxnSpPr"), jr(t, e, r, o, n), Ur(t, e, r, o, n), Lr(t, c, l?.text), s.end("cxnSp")) : "grpSp" === i || (a.macro = "", a.textlink = "", s.start("sp", a), s.start("nvSpPr"), Xr(t, s, o, n, e), Hr(t, s, o, n, e), s.end("nvSpPr"), jr(t, e, r, o, n), Ur(t, e, r, o, n), Lr(t, c, l?.text), s.end("sp"));
1856
- })(t, e, r, o, {
1857
- ...n,
1858
- content: {
1859
- type: "shape",
1860
- json: {
1861
- fill: "bg1",
1862
- stroke: {
1863
- width: 2,
1864
- fill: "red"
1865
- },
1866
- text: { runs: [{
1867
- text: "Unsupported Type: " + (n.content?.type ?? "unknown"),
1868
- color: "tx1"
1869
- }] }
1870
- }
1871
- }
1872
- });
1873
- }, jr = (t, e, r, o, n) => {
1874
- const s = t.getXMLWriter(), a = n.content?.json, l = a?.geometry ?? "rect", i = e.getStyles();
1875
- s.start("spPr"), s.pushDefaultNamespace("a"), Gr(s, o, n), s.start("prstGeom", { prst: l }), s.empty("avLst"), s.end("prstGeom"), Se(t, i, a), s.popDefaultNamespace(), s.end("spPr");
1876
- }, Ur = (t, e, r, o, n) => {
1877
- const s = t.getXMLWriter();
1878
- s.start("style"), s.pushDefaultNamespace("a"), s.start("lnRef", { idx: "1" }), s.start("schemeClr", { val: "accent1" }), s.empty("shade", { val: "15000" }), s.end("schemeClr"), s.end("lnRef"), s.start("fillRef", { idx: "1" }), s.empty("schemeClr", { val: "accent1" }), s.end("fillRef"), s.start("effectRef", { idx: "0" }), s.empty("schemeClr", { val: "accent1" }), s.end("effectRef"), s.start("fontRef", { idx: "minor" }), s.empty("schemeClr", { val: "lt1" }), s.end("fontRef"), s.popDefaultNamespace(), s.end("style");
1879
- }, Xr = (t, e, r, o, n) => {
1880
- const s = t.getSharedStates();
1881
- let a = s.get("uniqueIdCounter");
1882
- a || (a = /* @__PURE__ */ new Map(), s.set("uniqueIdCounter", a));
1883
- let l = a.get(n) ?? 1;
1884
- l++, a.set(n, l);
1885
- const i = {
1886
- id: "" + l,
1887
- name: o.name
1888
- };
1889
- o.description && (i.descr = o.description), o.hidden && (i.hidden = "1");
1890
- const c = [];
1891
- c.push([
1892
- "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}",
1893
- "a16:creationId",
1894
- {
1895
- "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
1896
- id: `{${V.uuidV4().toUpperCase()}}`
1897
- }
1898
- ]), e.start("cNvPr", i), Dr(e, c), e.end("cNvPr");
1899
- }, Hr = (t, e, r, o, n) => {
1900
- e.empty("cNvSpPr");
1901
- }, qr = (t, e, r, o) => {
1902
- const n = {};
1903
- if (o.lockAspect && (n.noChangeAspect = "1"), o.locks) for (const t of Object.keys(o.locks)) !0 === o.locks[t] && (n[t] = "1");
1904
- e.start("cNvPicPr", {}), e.empty("a:picLocks", n), e.end("cNvPicPr");
1905
- }, Gr = (t, e, r) => {
1906
- const o = e.getBounds(), n = {}, s = r.rotation;
1907
- void 0 !== s && 0 !== s && (n.rot = "" + Ae(s)), t.start("xfrm", n), t.start("off", {
1908
- x: Fe(o.x),
1909
- y: Fe(o.y)
1910
- }), t.end("off"), t.start("ext", {
1911
- cx: Fe(o.width),
1912
- cy: Fe(o.height)
1913
- }), t.end("ext"), t.end("xfrm");
1914
- }, Jr = (t, e, r) => {
1915
- t.start(e), t.start("col"), t.text(r.c ?? 0), t.end("col"), t.start("colOff"), t.text(Fe(r.x)), t.end("colOff"), t.start("row"), t.text(r.r ?? 0), t.end("row"), t.start("rowOff"), t.text(Fe(r.y)), t.end("rowOff"), t.end(e);
1916
- }, Kr = async (t, e, r) => {
1917
- const o = await r.getExternalURI();
1918
- if (o) return void t.addExternal(Te, o);
1919
- const n = t.getSharedStates();
1920
- let s = n.get(Ie);
1921
- s || (s = /* @__PURE__ */ new Map(), n.set(Ie, s));
1922
- let a = s.get(r);
1923
- if (!a) {
1924
- const t = await r.toBuffer();
1925
- a = {
1926
- bytes: new Uint8Array(t),
1927
- type: await r.getType() ?? Me,
1928
- index: s.size + 1
1929
- }, s.set(r, a);
1930
- }
1931
- const l = t.addBinary(a.bytes, a.type.mime, Te, `../media/image${a.index}.${a.type.ext}`, !0, e);
1932
- l.relId !== e && t.log(`Legacy drawing image '${e}' was written as '${l.relId}'; the markup will not find it.`);
1933
- };
1934
- function Yr(t, e, r, o, s, a, l, i) {
1935
- const c = {
1936
- ref: e,
1937
- dT: (s ?? /* @__PURE__ */ new Date()).toISOString().replace(/\.\d{3}Z$/, "Z"),
1938
- personId: o ? Zr(o) : void 0,
1939
- id: Zr(r),
1940
- parentId: l ? Zr(l) : void 0,
1941
- done: i ? "1" : void 0
1942
- };
1943
- t.start("threadedComment", c), t.start("text", E.test(a) || /[\n\r]/.test(a) ? n : void 0), t.text(a), t.end("text"), t.end("threadedComment");
1944
- }
1945
- function Zr(t) {
1946
- return `{${t.replace(/^\{|\}$/g, "").toUpperCase()}}`;
1947
- }
1948
- var Qr = 0, to = (t, e, r, o) => {
1949
- const n = o.columns, s = n ? n.length : 0;
1950
- if (0 !== s) {
1951
- e.start("tableColumns", { count: s });
1952
- for (let a = 0; a < s; a++) {
1953
- let s = n[a];
1954
- "string" == typeof s && (s = { name: s });
1955
- const l = {};
1956
- l.id = a + 1, l.name = s.name ?? `Column${a + 1}`;
1957
- let i = null;
1958
- const c = s.totalsRowFormula;
1959
- if ("number" == typeof c) {
1960
- const t = oo.get(c);
1961
- t ? l.totalsRowFunction = t : i = `SUBTOTAL(${c},${o.name?.trim()}[${l.name}])`;
1962
- } else c && (i = eo(t, r, a, c.startsWith("=") ? c.substring(1) : c));
1963
- i && (l.totalsRowFunction = "custom"), s.totalsRowLabel && (l.totalsRowLabel = s.totalsRowLabel);
1964
- const d = s.calculatedColumnFormula ? eo(t, r, a, s.calculatedColumnFormula) : null;
1965
- (i || d) && (e.start("tableColumn", l), d && (e.start("calculatedColumnFormula"), e.text(d), e.end("calculatedColumnFormula"))), i && (e.start("totalsRowFormula"), e.text(i), e.end("totalsRowFormula")), i || d ? e.end("tableColumn") : e.empty("tableColumn", l);
1966
- }
1967
- e.end("tableColumns");
1968
- }
1969
- }, eo = (t, e, r, o) => {
1970
- const n = t.getSharedStates().get(c);
1971
- if (!n) return o;
1972
- try {
1973
- const t = e.getDataRange().getCoords(), s = {
1974
- rowIndex: t.rowStart,
1975
- colIndex: t.colStart + r
1976
- }, a = n.parse(o, s);
1977
- return a && U.image(n.spell(a, !1, e.getName()), { at: s }) || o;
1978
- } catch {
1979
- return o;
1980
- }
1981
- }, ro = (t, e, r, o) => {
1982
- const n = {
1983
- name: r.getStyle().getName(),
1984
- showFirstColumn: r.isShowHighlightFirstColumn() ? "1" : "0",
1985
- showLastColumn: r.isShowHighlightLastColumn() ? "1" : "0",
1986
- showRowStripes: r.isShowBandedRows() ? "1" : "0",
1987
- showColumnStripes: r.isShowBandedColumns() ? "1" : "0"
1988
- };
1989
- e.empty("tableStyleInfo", n);
1990
- }, oo = /* @__PURE__ */ new Map([
1991
- [101, "average"],
1992
- [102, "countNums"],
1993
- [103, "count"],
1994
- [104, "max"],
1995
- [105, "min"],
1996
- [107, "stdDev"],
1997
- [109, "sum"],
1998
- [110, "var"]
1999
- ]);
2000
- var no = {
2001
- rowIndex: 0,
2002
- colIndex: 0
2003
- };
2004
- function so(t, e, r, o) {
2005
- if (null == o) return;
2006
- no.rowIndex = e, no.colIndex = r;
2007
- const n = O.cellToString(no);
2008
- let s, a;
2009
- switch (typeof o) {
2010
- case "number":
2011
- a = "" + o;
2012
- break;
2013
- case "boolean":
2014
- s = "b", a = o ? "1" : "0";
2015
- break;
2016
- case "string":
2017
- s = "str", a = o;
2018
- break;
2019
- default: {
2020
- const t = o;
2021
- if ("e" !== t.t) return;
2022
- s = "e", a = j.getBuiltInByCode(t.v)?.getLabel() ?? j.BuiltIn.Value.getLabel();
2023
- }
2024
- }
2025
- t.start("cell", s ? {
2026
- r: n,
2027
- t: s
2028
- } : { r: n }), t.start("v"), t.text(a), t.end("v"), t.end("cell");
2029
- }
2030
- var ao = (t, e, r, o) => {
2031
- e.start("mc:AlternateContent", { "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006" }), e.start("mc:Choice", {
2032
- Requires: "c14",
2033
- "xmlns:c14": "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
2034
- }), e.empty("c14:style", { val: "102" }), e.end("mc:Choice"), e.start("mc:Fallback"), e.empty("c:style", { val: "2" }), e.end("mc:Fallback"), e.end("mc:AlternateContent");
2035
- }, lo = (t, e, r, o, n) => {
2036
- e.start("chart"), ((t, e, r, o, n) => {
2037
- e.start("title"), e.empty("overlay", { val: "0" }), Se(t, r, n, "spPr", !0), e.end("title"), e.empty("autoTitleDeleted", { val: "0" });
2038
- })(t, e, r, 0, n), ((t, e, r, o, n) => {
2039
- e.start("plotArea"), e.empty("layout"), Se(t, r, n, "spPr", !0), e.end("plotArea");
2040
- })(t, e, r, 0, n), e.empty("plotVisOnly", { val: "1" }), e.empty("dispBlanksAs", { val: "gap" }), e.empty("showDLblsOverMax", { val: "0" }), e.end("chart");
2041
- }, io = (t, e, r, o) => {
2042
- e.start("printSettings"), e.empty("headerFooter"), e.empty("pageMargins", {
2043
- b: "0.75",
2044
- l: "0.7",
2045
- r: "0.7",
2046
- t: "0.75",
2047
- header: "0.3",
2048
- footer: "0.3"
2049
- }), e.empty("pageSetup"), e.end("printSettings");
2050
- }, co = (t, e, r, o, n, s = "0") => {
2051
- const a = n?.color, l = { idx: n?.idx ?? s };
2052
- void 0 !== a ? (e.start(o, l), "auto" === a ? e.empty("styleClr", { val: "auto" }) : (e.pushDefaultNamespace("a"), re(e, r.getTheme(), a), e.popDefaultNamespace()), e.end(o)) : e.empty(o, l);
2053
- }, mo = (t, e, r, o) => {
2054
- const n = r.length;
2055
- for (let s = 0; s < n; s++) {
2056
- const n = r[s];
2057
- n.empty ? e.empty(n.type, n.mods) : (e.start(n.type, n.mods), co(0, e, o, "lnRef", n.lineRef, "0"), co(0, e, o, "fillRef", n.fillRef, "0"), co(0, e, o, "effectRef", n.effectRef, "0"), co(0, e, o, "fontRef", n.fontRef, "minor"), Se(t, o, n, "spPr"), _r(t, 0, n.defRPr), Pr(t, o, n.bodyPr), e.end(n.type));
2058
- }
2059
- }, jo = Object.freeze([
2060
- {
2061
- type: "axisTitle",
2062
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2063
- defRPr: {
2064
- size: 10,
2065
- kern: 12
2066
- }
2067
- },
2068
- {
2069
- type: "categoryAxis",
2070
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2071
- stroke: {
2072
- width: .75,
2073
- cap: "flat",
2074
- cmpd: "sng",
2075
- algn: "ctr",
2076
- round: !0,
2077
- fill: "tx1 lumMod 15 lumOff 85"
2078
- },
2079
- defRPr: {
2080
- size: 9,
2081
- kern: 12
2082
- }
2083
- },
2084
- {
2085
- type: "chartArea",
2086
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2087
- fontRef: { color: "tx1" },
2088
- fill: {
2089
- type: "solid",
2090
- color: "bg1"
2091
- },
2092
- stroke: {
2093
- width: .75,
2094
- cap: "flat",
2095
- cmpd: "sng",
2096
- algn: "ctr",
2097
- round: !0,
2098
- fill: "tx1 lumMod 15 lumOff 85"
2099
- },
2100
- defRPr: {
2101
- size: 10,
2102
- kern: 12
2103
- }
2104
- },
2105
- {
2106
- type: "dataLabel",
2107
- fontRef: { color: "tx1 lumMod 75 lumOff 25" },
2108
- defRPr: {
2109
- size: 9,
2110
- kern: 12
2111
- }
2112
- },
2113
- {
2114
- type: "dataLabelCallout",
2115
- fontRef: { color: "dk1 lumMod 65 lumOff 35" },
2116
- fill: {
2117
- type: "solid",
2118
- color: "lt1"
2119
- },
2120
- stroke: { fill: "dk1 lumMod 25 lumOff 75" },
2121
- defRPr: {
2122
- size: 9,
2123
- kern: 12
2124
- },
2125
- bodyPr: {
2126
- rot: "0",
2127
- spcFirstLastPara: "1",
2128
- vertOverflow: "clip",
2129
- horzOverflow: "clip",
2130
- vert: "horz",
2131
- wrap: "square",
2132
- lIns: "36576",
2133
- tIns: "18288",
2134
- rIns: "36576",
2135
- bIns: "18288",
2136
- anchor: "ctr",
2137
- anchorCtr: "1",
2138
- spAutoFit: "true"
2139
- }
2140
- },
2141
- {
2142
- type: "dataPoint",
2143
- fillRef: {
2144
- idx: "1",
2145
- color: "auto"
2146
- },
2147
- fontRef: { color: "tx1" }
2148
- },
2149
- {
2150
- type: "dataPoint3D",
2151
- fillRef: {
2152
- idx: "1",
2153
- color: "auto"
2154
- },
2155
- fontRef: { color: "tx1" }
2156
- },
2157
- {
2158
- type: "dataPointLine",
2159
- lineRef: { color: "auto" },
2160
- fillRef: { idx: "1" },
2161
- fontRef: { color: "tx1" },
2162
- stroke: {
2163
- width: 2.25,
2164
- cap: "rnd",
2165
- fill: "phClr",
2166
- round: !0
2167
- }
2168
- },
2169
- {
2170
- type: "dataPointMarker",
2171
- lineRef: { color: "auto" },
2172
- fillRef: {
2173
- idx: "1",
2174
- color: "auto"
2175
- },
2176
- fontRef: { color: "tx1" },
2177
- stroke: {
2178
- width: .75,
2179
- fill: "phClr"
2180
- }
2181
- },
2182
- {
2183
- type: "dataPointMarkerLayout",
2184
- mods: {
2185
- symbol: "circle",
2186
- size: "5"
2187
- },
2188
- empty: !0
2189
- },
2190
- {
2191
- type: "dataPointWireframe",
2192
- lineRef: { color: "auto" },
2193
- fillRef: { idx: "1" },
2194
- fontRef: { color: "tx1" },
2195
- stroke: {
2196
- width: .75,
2197
- cap: "rnd",
2198
- fill: "phClr",
2199
- round: !0
2200
- }
2201
- },
2202
- {
2203
- type: "dataTable",
2204
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2205
- fill: { type: "none" },
2206
- stroke: {
2207
- width: .75,
2208
- cap: "flat",
2209
- cmpd: "sng",
2210
- algn: "ctr",
2211
- round: !0,
2212
- fill: "tx1 lumMod 15 lumOff 85"
2213
- },
2214
- defRPr: {
2215
- size: 9,
2216
- kern: 12
2217
- }
2218
- },
2219
- {
2220
- type: "downBar",
2221
- fontRef: { color: "tx1" },
2222
- fill: {
2223
- type: "solid",
2224
- color: "dk1 lumMod 75 lumOff 25"
2225
- },
2226
- stroke: {
2227
- width: .75,
2228
- cap: "flat",
2229
- cmpd: "sng",
2230
- algn: "ctr",
2231
- round: !0,
2232
- fill: "tx1 lumMod 65 lumOff 35"
2233
- }
2234
- },
2235
- {
2236
- type: "dropLine",
2237
- fontRef: { color: "tx1" },
2238
- stroke: {
2239
- width: .75,
2240
- cap: "flat",
2241
- cmpd: "sng",
2242
- algn: "ctr",
2243
- round: !0,
2244
- fill: "tx1 lumMod 35 lumOff 65"
2245
- }
2246
- },
2247
- {
2248
- type: "errorBar",
2249
- fontRef: { color: "tx1" },
2250
- stroke: {
2251
- width: .75,
2252
- cap: "flat",
2253
- cmpd: "sng",
2254
- algn: "ctr",
2255
- round: !0,
2256
- fill: "tx1 lumMod 65 lumOff 35"
2257
- }
2258
- },
2259
- {
2260
- type: "floor",
2261
- fontRef: { color: "tx1" },
2262
- fill: { type: "none" },
2263
- stroke: {}
2264
- },
2265
- {
2266
- type: "gridlineMajor",
2267
- fontRef: { color: "tx1" },
2268
- stroke: {
2269
- width: .75,
2270
- cap: "flat",
2271
- cmpd: "sng",
2272
- algn: "ctr",
2273
- round: !0,
2274
- fill: "tx1 lumMod 15 lumOff 85"
2275
- }
2276
- },
2277
- {
2278
- type: "gridlineMinor",
2279
- fontRef: { color: "tx1" },
2280
- stroke: {
2281
- width: .75,
2282
- cap: "flat",
2283
- cmpd: "sng",
2284
- algn: "ctr",
2285
- round: !0,
2286
- fill: "tx1 lumMod 5 lumOff 95"
2287
- }
2288
- },
2289
- {
2290
- type: "hiLoLine",
2291
- fontRef: { color: "tx1" },
2292
- stroke: {
2293
- width: .75,
2294
- cap: "flat",
2295
- cmpd: "sng",
2296
- algn: "ctr",
2297
- round: !0,
2298
- fill: "tx1 lumMod 50 lumOff 50"
2299
- }
2300
- },
2301
- {
2302
- type: "leaderLine",
2303
- fontRef: { color: "tx1" },
2304
- stroke: {
2305
- width: .75,
2306
- cap: "flat",
2307
- cmpd: "sng",
2308
- algn: "ctr",
2309
- round: !0,
2310
- fill: "tx1 lumMod 35 lumOff 65"
2311
- }
2312
- },
2313
- {
2314
- type: "legend",
2315
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2316
- defRPr: {
2317
- size: 9,
2318
- kern: 12
2319
- }
2320
- },
2321
- {
2322
- type: "plotArea",
2323
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2324
- fontRef: { color: "tx1" }
2325
- },
2326
- {
2327
- type: "plotArea3D",
2328
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2329
- fontRef: { color: "tx1" }
2330
- },
2331
- {
2332
- type: "seriesAxis",
2333
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2334
- defRPr: {
2335
- size: 9,
2336
- kern: 12
2337
- }
2338
- },
2339
- {
2340
- type: "seriesLine",
2341
- fontRef: { color: "tx1" },
2342
- stroke: {
2343
- width: .75,
2344
- cap: "flat",
2345
- cmpd: "sng",
2346
- algn: "ctr",
2347
- round: !0,
2348
- fill: "tx1 lumMod 35 lumOff 65"
2349
- }
2350
- },
2351
- {
2352
- type: "title",
2353
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2354
- defRPr: {
2355
- size: 14,
2356
- b: !1,
2357
- kern: 12,
2358
- spc: 0,
2359
- baseline: 0
2360
- }
2361
- },
2362
- {
2363
- type: "trendline",
2364
- lineRef: { color: "auto" },
2365
- fontRef: { color: "tx1" },
2366
- stroke: {
2367
- width: 1.5,
2368
- cap: "rnd",
2369
- fill: "phClr",
2370
- prstDash: "sysDot"
2371
- }
2372
- },
2373
- {
2374
- type: "trendlineLabel",
2375
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2376
- defRPr: {
2377
- size: 9,
2378
- kern: 12
2379
- }
2380
- },
2381
- {
2382
- type: "upBar",
2383
- fontRef: { color: "tx1" },
2384
- fill: {
2385
- type: "solid",
2386
- color: "lt1"
2387
- },
2388
- stroke: {
2389
- width: .75,
2390
- cap: "flat",
2391
- cmpd: "sng",
2392
- algn: "ctr",
2393
- round: !0,
2394
- fill: "tx1 lumMod 65 lumOff 35"
2395
- }
2396
- },
2397
- {
2398
- type: "valueAxis",
2399
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2400
- defRPr: {
2401
- size: 9,
2402
- kern: 12
2403
- }
2404
- },
2405
- {
2406
- type: "wall",
2407
- fontRef: { color: "tx1" },
2408
- fill: { type: "none" },
2409
- stroke: {}
2410
- }
2411
- ]), Uo = (t, e, r) => {
2412
- const o = r.length;
2413
- for (let t = 0; t < o; t++) {
2414
- const o = r[t], n = {}, s = o[0], a = o[1];
2415
- s || a ? (e.start("variation", n), s && e.empty("a:lumMod", { val: s }), a && e.empty("a:lumOff", { val: a }), e.end("variation")) : e.empty("variation", n);
2416
- }
2417
- }, Xo = Object.freeze([
2418
- [0, 0],
2419
- [6e4, 0],
2420
- [8e4, 2e4],
2421
- [8e4, 0],
2422
- [6e4, 4e4],
2423
- [5e4, 0],
2424
- [7e4, 3e4],
2425
- [7e4, 0],
2426
- [5e4, 5e4]
2427
- ]), Ho = [
2428
- new class extends ct {
2429
- constructor() {
2430
- super({
2431
- kind: "workbook",
2432
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
2433
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
2434
- path: "/xl/workbook.xml"
2435
- });
2436
- }
2437
- async emit(t, e) {
2438
- const r = e.getXMLWriter();
2439
- r.decl(), r.start("workbook", {
2440
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2441
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2442
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2443
- "mc:Ignorable": "x15 xr xr6 xr10 xr2",
2444
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main",
2445
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
2446
- "xmlns:xr6": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision6",
2447
- "xmlns:xr10": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision10",
2448
- "xmlns:xr2": "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"
2449
- });
2450
- const o = e.getSharedStates().get(it), n = await t.toJSON({
2451
- ignoreData: !0,
2452
- resources: (t, e) => (o?.set(e, t), null),
2453
- includeHeaderStyles: !0,
2454
- splitDirectBorders: !0
2455
- });
2456
- e.getSharedStates().set(c, p(n.names, function(t) {
2457
- const e = [], r = t.sheets ?? [];
2458
- for (let t = 0; t < r.length; t++) {
2459
- const o = r[t]?.sheet?.tables;
2460
- if (o) for (let t = 0; t < o.length; t++) {
2461
- const r = o[t], n = Array.isArray(r) ? r[1]?.name : r?.v?.name;
2462
- n && e.push(String(n));
2463
- }
2464
- }
2465
- return e;
2466
- }(n))), function(t, e) {
2467
- const r = t.getSharedStates().get(Yt);
2468
- if (!r) return;
2469
- e.empty("fileVersion", r);
2470
- }(e, r), function(t, e, r, o) {
2471
- const n = {}, s = r.getCodeName();
2472
- s && (n.codeName = s);
2473
- r.getRuntime().isDate1904() && (n.date1904 = "1");
2474
- o.updateLinks && (n.updateLinks = o.updateLinks);
2475
- e.empty("workbookPr", n);
2476
- }(0, r, t, n), function(t, e, r, o) {
2477
- const n = o.protection;
2478
- if (!n || n.workbook) return;
2479
- const s = {};
2480
- Ot(n.password ?? {}, s, "workbook"), Ot(n.revisionsPassword ?? {}, s, "revisions");
2481
- for (const t of w) {
2482
- const e = f(t, n[t.key]);
2483
- null !== e && (s[t.attribute] = e);
2484
- }
2485
- e.empty("workbookProtection", s);
2486
- }(0, r, 0, n), function(t, e, r) {
2487
- e.start("bookViews");
2488
- const o = r.getView(), n = {};
2489
- o.isShowHorizontalScrollbar() || (n.showHorizontalScroll = "0");
2490
- o.isShowVerticalScrollbar() || (n.showVerticalScroll = "0");
2491
- o.isShowTabs() || (n.showSheetTabs = "0");
2492
- const s = o.getTabRatio();
2493
- 600 !== s && (n.tabRatio = s);
2494
- const a = r.getSelectedSheet().getIndex();
2495
- 0 !== a && (n.activeTab = "" + a);
2496
- e.empty("workbookView", n), e.end("bookViews");
2497
- }(0, r, t, n.view);
2498
- const s = await (async (t, e) => {
2499
- const r = [], o = e ? e.length : 0;
2500
- if (0 === o) return r;
2501
- const n = /* @__PURE__ */ new Map();
2502
- t.getSharedStates().set("pivotCachePaths", n);
2503
- for (let s = 0; s < o; s++) {
2504
- const o = e[s], a = o.cacheId, l = o.part;
2505
- if (l?.xml && !n.has(a)) try {
2506
- const e = await Ht({
2507
- ...l,
2508
- type: l.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
2509
- contentType: l.contentType || "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
2510
- }, t, "/xl/pivotCache/pivotCacheDefinition{n}.xml");
2511
- if (!e?.relId) continue;
2512
- n.set(a, e.path), r.push({
2513
- cacheId: a,
2514
- relId: e.relId
2515
- });
2516
- } catch (e) {
2517
- t.log(`Unable to write the pivot cache ${a}; the pivot tables on it will be dropped.`, e);
2518
- }
2519
- }
2520
- return r;
2521
- })(e, n.pivotCaches);
2522
- (function(t, e) {
2523
- if (!e.getComments().some((t) => !t.isNote())) return;
2524
- t.addPart("persons", e.getPeople());
2525
- })(e, t), r.start("sheets");
2526
- const a = e.getSharedStates(), l = t.getStrings().beginPersist();
2527
- a.set("persistStrings", l);
2528
- const i = new Vt();
2529
- a.set("metaCollector", i);
2530
- const d = new zt(i, e.log.bind(e));
2531
- a.set("persistRichTypes", d), a.set($t, new Wt(n.styles, t.getStyles()));
2532
- try {
2533
- const o = t.getSheets().getItems({ visibility: K.Visibility.VeryHidden }), s = n.sheets, i = t.getSelectedSheet(), c = o.length, d = ((t, e) => {
2534
- const r = new Array(e), o = /* @__PURE__ */ new Set();
2535
- let n = 1;
2536
- for (let s = 0; s < e; s++) {
2537
- const e = t?.[s]?.sheetId;
2538
- void 0 === e || !Number.isInteger(e) || e < 1 || o.has(e) || (o.add(e), r[s] = e, e >= n && (n = e + 1));
2539
- }
2540
- for (let t = 0; t < e; t++) if (void 0 === r[t]) {
2541
- for (; o.has(n);) n++;
2542
- o.add(n), r[t] = n++;
2543
- }
2544
- return r;
2545
- })(s, c), m = ((t, e, r) => {
2546
- const o = e.length, n = new Array(o), s = new Set(r?.values() ?? []), a = /* @__PURE__ */ new Set();
2547
- for (let s = 0; s < o; s++) {
2548
- const o = t?.[s]?.sheetId;
2549
- if (void 0 === o || e[s] !== o) continue;
2550
- const l = r?.get(o);
2551
- l && !a.has(l) && (a.add(l), n[s] = l);
2552
- }
2553
- let l = 1;
2554
- for (let t = 0; t < o; t++) {
2555
- if (n[t]) continue;
2556
- let e;
2557
- do
2558
- e = `xl/worksheets/sheet${l++}.xml`;
2559
- while (s.has(e) || a.has(e));
2560
- a.add(e), n[t] = e;
2561
- }
2562
- return n;
2563
- })(s, d, a.get(Zt));
2564
- for (let t = 0; t < c; t++) {
2565
- const n = o[t], a = "" + d[t], c = {
2566
- name: n.getName(),
2567
- sheetId: a
2568
- }, p = n.getVisibility();
2569
- "hidden" === p ? c.state = "hidden" : "veryHidden" === p && (c.state = "veryHidden");
2570
- const f = s[t].sheet;
2571
- c["r:id"] = e.addPart("worksheet", {
2572
- model: n,
2573
- isSelected: i === n,
2574
- json: f,
2575
- persistStrings: l
2576
- }, "/" + m[t]).relId, r.empty("sheet", c);
2577
- }
2578
- await e.waitEmit();
2579
- const p = t.getTheme();
2580
- e.addPart("theme", {
2581
- model: p,
2582
- json: n.theme
2583
- }), await e.waitEmit(), e.addPart("styles", {
2584
- styles: t.getStyles(),
2585
- theme: t.getTheme(),
2586
- json: n.styles
2587
- }), await e.waitEmit();
2588
- const f = await l.toJSONAsync();
2589
- f && f.length > 0 && (e.addPart("sharedStrings", {
2590
- model: f,
2591
- json: f
2592
- }), await e.waitEmit());
2593
- const h = a.get("persistRichTypes");
2594
- h?.hasAny() && (e.addPart("richValue", h), e.addPart("richValueStructure", h), e.addPart("richValueTypes", null), await e.waitEmit());
2595
- const u = a.get("metaCollector");
2596
- u?.hasAny() && (e.addPart("metadata", u), await e.waitEmit()), a.delete("persistRichTypes"), a.delete("metaCollector"), a.delete("persistStrings");
2597
- } catch (t) {
2598
- throw t;
2599
- } finally {
2600
- l.endPersist();
2601
- }
2602
- r.end("sheets"), function(t, e, r) {
2603
- const o = r.externalBooks, n = o ? o.length : 0;
2604
- if (0 === n) return;
2605
- const s = t.getSharedStates().get(Qt), a = /* @__PURE__ */ new Set();
2606
- if (s) for (let t = 0; t < n; t++) !o[t] && s[t] && a.add(s[t]);
2607
- const l = [];
2608
- let i = 1;
2609
- for (let e = 0; e < n; e++) {
2610
- const r = o[e];
2611
- if (r) {
2612
- let e;
2613
- do
2614
- e = `xl/externalLinks/externalLink${i++}.xml`;
2615
- while (a.has(e));
2616
- l.push(t.addPart("externalLink", r, "/" + e).relId);
2617
- continue;
2618
- }
2619
- const n = s?.[e], c = n ? t.addRelationship(Kt, n) : null;
2620
- c ? l.push(c) : t.log(`External link [${e + 1}] cannot be written and is being dropped; later links will renumber.`);
2621
- }
2622
- if (0 === l.length) return;
2623
- e.start("externalReferences");
2624
- for (let t = 0; t < l.length; t++) e.empty("externalReference", { "r:id": l[t] });
2625
- e.end("externalReferences");
2626
- }(e, r, n), function(t, e, r, o) {
2627
- const n = t.getSharedStates().get(c), s = o.names, a = s ? s.length : 0;
2628
- if (0 === a) return;
2629
- const l = o.externalBooks?.length ?? 0, i = /* @__PURE__ */ new Map(), d = r.getSheets().getItems({ visibility: K.Visibility.VeryHidden });
2630
- for (let t = 0; t < d.length; t++) i.set(d[t].getName().toLowerCase(), t);
2631
- e.start("definedNames");
2632
- for (let r = 0; r < a; r++) {
2633
- const o = s[r], a = { name: o.name };
2634
- if (o.comment && (a.comment = o.comment), o.scope) {
2635
- const e = i.get(o.scope.toLowerCase());
2636
- void 0 !== e ? a.localSheetId = "" + e : t.log(`Defined name '${o.name}' is scoped to unknown sheet '${o.scope}'; writing it as global.`);
2637
- }
2638
- o.hidden && (a.hidden = "1");
2639
- const c = n.writeName(o.ref);
2640
- for (const e of te(c)) e > l && t.log(`Defined name '${o.name}' cites external book [${e}], but only ${l} ${1 === l ? "is" : "are"} written; Excel will report the file as needing repair.`);
2641
- e.start("definedName", a), e.text(c), e.end("definedName");
2642
- }
2643
- e.end("definedNames");
2644
- }(e, r, t, n), function(t, e, r) {
2645
- const o = r.getCalculation().toJSON(), n = { calcId: t.getSharedStates().get("calcId") ?? "191029" }, s = (t, e) => {
2646
- const r = o[t];
2647
- "boolean" == typeof r && (n[e] = r ? "1" : "0");
2648
- };
2649
- if (o.calcMode) {
2650
- const t = ee[o.calcMode];
2651
- t && "auto" !== t && (n.calcMode = t);
2652
- }
2653
- s("fullCalcOnLoad", "fullCalcOnLoad"), s("calcOnSave", "calcOnSave"), s("calcCompleted", "calcCompleted"), s("fullPrecision", "fullPrecision"), s("forceFullCalc", "forceFullCalc"), s("concurrentCalc", "concurrentCalc"), o.refMode && (n.refMode = o.refMode);
2654
- o.iterate && (n.iterate = "1");
2655
- void 0 !== o.maxIteration && (n.iterateCount = String(o.maxIteration));
2656
- void 0 !== o.maxIterateChange && (n.iterateDelta = String(o.maxIterateChange));
2657
- e.empty("calcPr", n);
2658
- }(e, r, t), function(t, e) {
2659
- if (0 === e.length) return;
2660
- t.start("pivotCaches");
2661
- for (let r = 0; r < e.length; r++) t.empty("pivotCache", {
2662
- cacheId: e[r].cacheId,
2663
- "r:id": e[r].relId
2664
- });
2665
- t.end("pivotCaches");
2666
- }(r, s), function(t, e) {
2667
- const r = t.getSharedStates().get("calcFeatures") ?? "<ext uri=\"{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}\" xmlns:xcalcf=\"http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures\"><xcalcf:calcFeatures><xcalcf:feature name=\"microsoft.com:RD\"/><xcalcf:feature name=\"microsoft.com:Single\"/><xcalcf:feature name=\"microsoft.com:FV\"/><xcalcf:feature name=\"microsoft.com:CNMTM\"/><xcalcf:feature name=\"microsoft.com:LET_WF\"/><xcalcf:feature name=\"microsoft.com:LAMBDA_WF\"/><xcalcf:feature name=\"microsoft.com:ARRAYTEXT_WF\"/></xcalcf:calcFeatures></ext>";
2668
- e.start("extLst"), e.raw(r), e.end("extLst");
2669
- }(e, r), r.end("workbook"), r.close();
2670
- }
2671
- }(),
2672
- new class extends ct {
2673
- constructor() {
2674
- super({
2675
- kind: "worksheet",
2676
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
2677
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
2678
- path: () => "/xl/worksheets/sheet{n}.xml"
2679
- });
2680
- }
2681
- async emit(t, e) {
2682
- const o = e.getXMLWriter(), a = t.model, d = t.json;
2683
- o.decl(), o.start("worksheet", {
2684
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2685
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2686
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2687
- "mc:Ignorable": "x14ac",
2688
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
2689
- }), function(t, e, r) {
2690
- const o = r.getTabColor(), n = r.getCodeName(), s = {};
2691
- n && (s.codeName = n);
2692
- r.isConditionalFormatCalculationEnabled() || (s.enableFormatConditionsCalculation = "0");
2693
- const a = r.getOutlineSettings(), l = {};
2694
- a.summaryBelow || (l.summaryBelow = "0");
2695
- a.summaryRight || (l.summaryRight = "0");
2696
- a.showOutlineSymbols || (l.showOutlineSymbols = "0");
2697
- a.applyStyles && (l.applyStyles = "1");
2698
- const i = Object.keys(l).length > 0, c = !!o || i;
2699
- if (!c && 0 === Object.keys(s).length) return;
2700
- if (!c) return void e.empty("sheetPr", s);
2701
- e.start("sheetPr", s), o && ne(e, r.getStyles().getTheme(), o, "tabColor", !1);
2702
- i && e.empty("outlinePr", l);
2703
- e.end("sheetPr");
2704
- }(0, o, a), function(t, e, r, o) {
2705
- let n = r.getUsedRange({ features: [] }), s = n ? n.getCoords() : null;
2706
- const a = F, l = P, i = o.directStyles, c = i ? i.length : 0;
2707
- for (let t = 0; t < c; t++) {
2708
- let e = r.getRange(i[t][0]).getCoords();
2709
- if (e.colEnd === l) {
2710
- const t = s?.colStart ?? 0;
2711
- e = {
2712
- ...e,
2713
- colStart: t,
2714
- colEnd: t
2715
- };
2716
- }
2717
- if (e.rowEnd === a) {
2718
- const t = s?.rowStart ?? 0;
2719
- e = {
2720
- ...e,
2721
- rowStart: t,
2722
- rowEnd: t
2723
- };
2724
- }
2725
- s = z.unionRanges(s, e);
2726
- }
2727
- const d = o.merges, m = d ? d.length : 0;
2728
- for (let t = 0; t < m; t++) {
2729
- let e = r.getRange(d[t]).getCoords();
2730
- e.colEnd === l && (e = { ...s }, e.colStart = s?.colStart ?? 0, e.colEnd = e.colStart), e.rowEnd === a && (e = { ...e }, e.rowStart = s?.rowStart ?? 0, e.rowEnd = e.rowStart), s = z.unionRanges(s, e);
2731
- }
2732
- let p = "A1";
2733
- s && (n = r.getRange(s), p = s.colStart === s.colEnd && s.rowStart === s.rowEnd ? n.getAddress() : `${n.getIntersect({
2734
- colStart: s.colStart,
2735
- rowStart: s.rowStart,
2736
- colEnd: s.colStart,
2737
- rowEnd: s.rowStart
2738
- }).getAddress()}:${n.getIntersect({
2739
- colStart: s.colEnd,
2740
- rowStart: s.rowEnd,
2741
- colEnd: s.colEnd,
2742
- rowEnd: s.rowEnd
2743
- }).getAddress()}`);
2744
- e.empty("dimension", { ref: p });
2745
- }(0, o, a, d), function(t, e, r, o, n) {
2746
- const s = r.getView(), a = s.getTopLeft(), l = r.getRowHeaders().getIndex(a.top), i = r.getColumnHeaders().getIndex(a.left), c = O.cellToString({
2747
- colIndex: i,
2748
- rowIndex: l
2749
- });
2750
- e.start("sheetViews");
2751
- const d = {};
2752
- s.isShowFormulas() && (d.showFormulas = "1");
2753
- s.isShowColumnGridlines() || s.isShowRowGridlines() || (d.showGridLines = "0");
2754
- s.isShowColumnHeaders() || s.isShowRowHeaders() || (d.showRowColHeaders = "0");
2755
- s.isShowZeros() || (d.showZeros = "0");
2756
- s.isRightToLeft() && (d.rightToLeft = "1");
2757
- n && (d.tabSelected = "1");
2758
- "A1" !== c && (d.topLeftCell = c);
2759
- const m = s.getZoomScale();
2760
- 100 !== m && (d.zoomScale = m, d.zoomScaleNormal = m);
2761
- const p = s.getGridLineColor();
2762
- if (p) {
2763
- d.defaultGridColor = "0";
2764
- const t = p.toRGBA(), e = t.red, o = t.green, n = t.blue, s = r.getStyles().getIndexedColors(), a = s.length;
2765
- let l = 0, i = Number.MAX_VALUE;
2766
- for (let t = 0; t < a; t++) {
2767
- const r = s[t].toRGBA(), a = (e - r.red) ** 2 + (o - r.green) ** 2 + (n - r.blue) ** 2;
2768
- a < i && (i = a, l = t);
2769
- }
2770
- d.colorId = "" + l;
2771
- }
2772
- d.workbookViewId = "0";
2773
- const f = r.getSelection().getCoords(), h = O.cellToString(f.cell);
2774
- let u = {};
2775
- const g = s.getFreezePanes(), y = g.coords ?? {}, x = y.colIndex ?? 0, v = y.rowIndex ?? 0;
2776
- if (x > 0 || v > 0) {
2777
- const t = g.topLeft ?? {}, o = t.top ?? 0, n = t.left ?? 0, s = r.getRowHeaders().getIndex(o), l = r.getColumnHeaders().getIndex(n), i = x - l, c = v - s, m = Math.max(x, r.getColumnHeaders().getIndex(a.left + r.getColumnHeaders().getOffset(x) - n)), p = Math.max(v, r.getRowHeaders().getIndex(a.top + r.getRowHeaders().getOffset(v) - o)), f = O.cellToString({
2778
- colIndex: l,
2779
- rowIndex: s
2780
- });
2781
- "A1" !== f ? d.topLeftCell = f : delete d.topLeftCell, e.start("sheetView", d);
2782
- const h = {};
2783
- if (i > 0 && (h.xSplit = i), c > 0 && (h.ySplit = c), h.topLeftCell = O.cellToString({
2784
- colIndex: m,
2785
- rowIndex: p
2786
- }), h.state = "frozen", 0 === x) {
2787
- h.activePane = "bottomLeft", e.empty("pane", h);
2788
- const t = O.cellToString({
2789
- colIndex: m,
2790
- rowIndex: s
2791
- });
2792
- "A1" !== t && e.empty("selection", {
2793
- activeCell: t,
2794
- sqref: t
2795
- }), u.pane = "bottomLeft";
2796
- } else if (0 === v) {
2797
- h.activePane = "topRight", e.empty("pane", h);
2798
- const t = O.cellToString({
2799
- colIndex: l,
2800
- rowIndex: p
2801
- });
2802
- "A1" !== t && e.empty("selection", {
2803
- activeCell: t,
2804
- sqref: t
2805
- }), u.pane = "topRight";
2806
- } else {
2807
- h.activePane = "bottomRight", e.empty("pane", h), "A1" !== f && e.empty("selection", {
2808
- activeCell: f,
2809
- sqref: f
2810
- });
2811
- const t = O.cellToString({
2812
- colIndex: m,
2813
- rowIndex: s
2814
- });
2815
- e.empty("selection", {
2816
- pane: "topRight",
2817
- activeCell: t,
2818
- sqref: t
2819
- });
2820
- const r = O.cellToString({
2821
- colIndex: l,
2822
- rowIndex: p
2823
- });
2824
- e.empty("selection", {
2825
- pane: "bottomLeft",
2826
- activeCell: r,
2827
- sqref: r
2828
- }), u.pane = "bottomRight";
2829
- }
2830
- } else e.start("sheetView", d);
2831
- u.activeCell = h;
2832
- const w = f.ranges, S = w ? w.length : 0;
2833
- if (S > 0) {
2834
- let t = "";
2835
- for (let e = 0; e < S; e++) {
2836
- const r = w[e];
2837
- e > 0 && (t += " "), t += O.rangeToString(r);
2838
- }
2839
- u.sqref = t, (f.rangeIndex ?? 0) > 0 && (u.activeCellId = "" + f.rangeIndex);
2840
- } else "A1" === h ? u = null : u.sqref = h;
2841
- u && e.empty("selection", u);
2842
- e.end("sheetView"), e.end("sheetViews");
2843
- }(0, o, a, 0, t.isSelected), function(t, e, r, o) {
2844
- const n = o.defaultColSize, s = o.defaultRowSize, a = {};
2845
- void 0 !== n && (a.defaultColWidth = n);
2846
- a.defaultRowHeight = s ?? .75 * r.getRowHeaders().getDefaultSize(), void 0 !== s && (a.customHeight = "1");
2847
- a["x14ac:dyDescent"] = "0.25", e.empty("sheetFormatPr", a);
2848
- }(0, o, a, d);
2849
- const h = !1 === d.protection?.showFormulas ? e.getSharedStates().get("hiddenFormulaXfs") ?? null : null;
2850
- (function(t, e, r, o, n) {
2851
- const s = o.cols ? O.refsToRuns(o.cols, !0) : null, a = s ? s.length : 0;
2852
- r.getEntireRange().getColumnEnd();
2853
- const l = r.getColumnHeaders().getDefaultSizeNative(), i = n ? n.getHiddenXf(0) : 0;
2854
- let c = 1;
2855
- const d = (t) => {
2856
- 0 !== i && t >= c && e.empty("col", {
2857
- min: c,
2858
- max: t,
2859
- width: l,
2860
- style: i
2861
- });
2862
- };
2863
- if (a > 0 || 0 !== i) {
2864
- e.start("cols");
2865
- for (let t = 0; t < a; t++) {
2866
- const r = s[t], o = r.min + 1, a = P + 1;
2867
- if (o > a) continue;
2868
- const i = Math.min(r.max + 1, a);
2869
- d(o - 1), c = i + 1;
2870
- const m = {
2871
- min: o,
2872
- max: i
2873
- }, p = r.value, f = p.sz;
2874
- void 0 !== f ? 0 !== f && (m.width = Math.round(256 * f) / 256) : m.width = l;
2875
- const h = n ? n.getHiddenXf(p.s ?? 0) : p.s;
2876
- h && (m.style = h), void 0 !== p.h && (m.hidden = 1), p.csz && (m.customWidth = 1), void 0 !== p.l && (m.outlineLevel = p.l), void 0 !== p.cl && (m.collapsed = 1), e.empty("col", m);
2877
- }
2878
- d(P + 1), e.end("cols");
2879
- }
2880
- })(0, o, a, d, h), function(t, e, o, a, l, i) {
2881
- const c = t.getSharedStates(), d = c.get("persistStrings"), m = c.get("metaCollector"), f = c.get("persistRichTypes");
2882
- let h = 0, u = 0;
2883
- const g = o.getUsedRange();
2884
- let y = 0;
2885
- const x = a.rows ? O.refsToRuns(a.rows, !1) : null, v = x ? x.length : 0, w = x?.[v - 1]?.max ?? -1, S = a.cols ? O.refsToRuns(a.cols, !0) : null, b = S ? S.length : 0, C = S?.[b - 1]?.max ?? -1;
2886
- if (g || v > 0) {
2887
- const c = .75, g = a.defaultRowSize ?? o.getRowHeaders().getDefaultSize() * c, v = o.getStyles().getNormal().getBestFit().height * c, b = (t, e) => {
2888
- const r = wr;
2889
- if (r.r = "" + (t + 1), r.s = void 0, r.customFormat = void 0, r.hidden = void 0, r.ht = void 0, r.customHeight = void 0, r.outlineLevel = void 0, r.collapsed = void 0, !e) return r;
2890
- const o = e.value;
2891
- void 0 !== o.s && (r.s = "" + (i ? i.getHiddenXf(o.s) : o.s), r.customFormat = "1"), o.h && (r.hidden = "1");
2892
- const n = o.csz ?? !1, s = o.sz ?? g;
2893
- return (s !== v || n) && (r.ht = "" + s), n && (r.customHeight = "1"), void 0 !== o.l && (r.outlineLevel = "" + o.l), void 0 !== o.cl && (r.collapsed = "" + o.cl), r;
2894
- };
2895
- let k = 0, I = x?.[k] ?? null, M = I?.min ?? Number.MAX_SAFE_INTEGER, R = I?.max ?? Number.MAX_SAFE_INTEGER, F = I?.value?.s, A = -1, L = 0, _ = S?.[L] ?? null, P = _?.min ?? Number.MAX_SAFE_INTEGER, N = _?.max ?? Number.MAX_SAFE_INTEGER, D = _?.value?.s;
2896
- const B = (t, r = !1) => {
2897
- if (A !== t) {
2898
- for (-1 !== A && (e.end("row"), 0 !== L && (L = 0, _ = S?.[L] ?? null, P = _?.min ?? Number.MAX_SAFE_INTEGER, N = _?.max ?? Number.MAX_SAFE_INTEGER, D = _?.value?.s)); A + 1 <= t;) {
2899
- A++, I && A > R && (I = x[++k] ?? null, I ? (M = I.min, R = I.max, F = I.value?.s) : (M = Number.MAX_SAFE_INTEGER, R = Number.MAX_SAFE_INTEGER, F = void 0)), A < M && A < t && (A = I ? Math.min(M, t) : t);
2900
- const o = A < t || r && A === t, n = b(A, I && A >= M && A <= R ? I : null);
2901
- o ? e.empty("row", n) : e.start("row", n);
2902
- }
2903
- if (t < A) {
2904
- const r = b(t, null);
2905
- e.start("row", r);
2906
- }
2907
- }
2908
- };
2909
- e.setValidationDisabled(!0), e.start("sheetData");
2910
- const $ = [];
2911
- $.push(Qe(t, o, a.directStyles));
2912
- const W = a.formulas, V = W ? W.length : 0;
2913
- if (V > 0) {
2914
- const e = /* @__PURE__ */ new Map();
2915
- if (l.names.size > 0 && a.formulaArray) for (const t of a.formulaArray) try {
2916
- const r = o.getRange(t[0]).getCoords();
2917
- e.set(`${r.rowStart},${r.colStart}`, r);
2918
- } catch {}
2919
- const n = [];
2920
- if (a.formulaArray) for (const t of a.formulaArray) try {
2921
- n.push(o.getRange(t[0]).getCoords());
2922
- } catch {}
2923
- const s = (t) => {
2924
- for (let e = 0; e < n.length; e++) {
2925
- const r = n[e];
2926
- if (r.rowStart <= t.rowEnd && r.rowEnd >= t.rowStart && r.colStart <= t.colEnd && r.colEnd >= t.colStart) return !0;
2927
- }
2928
- return !1;
2929
- }, i = t.getSharedStates().get("xlsxFormulaDialect") ?? p(o.getCalculation().getNamedFormulas().toJSON(), o.getTables().getItems().map((t) => t.getName())), c = o.getEntireRange().getCoords(), d = [];
2930
- for (const t of o.getTables().getItems()) d.push([t.getRange().getCoords(), t.getName()]);
2931
- const m = (t, e) => {
2932
- for (let r = 0; r < d.length; r++) {
2933
- const o = d[r][0];
2934
- if (t >= o.rowStart && t <= o.rowEnd && e >= o.colStart && e <= o.colEnd) return d[r][1];
2935
- }
2936
- return null;
2937
- }, f = /* @__PURE__ */ new Set();
2938
- for (let t = 0; t < n.length; t++) f.add(`${n[t].rowStart},${n[t].colStart}`);
2939
- const h = [];
2940
- for (let n = 0; n < V; n++) {
2941
- const a = W[n];
2942
- try {
2943
- const t = a[0], d = o.getRange(t), p = d.getCoords();
2944
- let u = a[1], g = null;
2945
- const x = {
2946
- rowIndex: p.rowStart,
2947
- colIndex: p.colStart
2948
- }, v = i.parse(u, x), w = v ? i.annotate(v) : void 0, S = v ? i.spell(v, f.has(`${p.rowStart},${p.colStart}`), m(p.rowStart, p.colStart)) : null, b = S ? U.imager(S, { entireCoords: c }) : null;
2949
- b && (u = b(x));
2950
- let C = !0 === w?.cm;
2951
- const k = !0 === w?.ca;
2952
- if (l.affects(n)) {
2953
- g = null, C = !1;
2954
- const t = (t, e, r) => {
2955
- const o = {
2956
- rowStart: t,
2957
- colStart: e,
2958
- rowEnd: t,
2959
- colEnd: e
2960
- };
2961
- h.push([o, {
2962
- coords: o,
2963
- formula: r,
2964
- sharedId: null,
2965
- ref: O.rangeToString(o),
2966
- isDynamicRange: !1,
2967
- isWrapped: !0
2968
- }]);
2969
- }, n = e.get(`${p.rowStart},${p.colStart}`), s = void 0 !== n && (n.rowEnd > n.rowStart || n.colEnd > n.colStart);
2970
- let a = !1;
2971
- if (s) {
2972
- const e = r(u, d.getCell().getValue());
2973
- if (null !== e) for (let r = n.rowStart; r <= n.rowEnd; r++) for (let s = n.colStart; s <= n.colEnd; s++) {
2974
- if (r === n.rowStart && s === n.colStart) {
2975
- t(r, s, e), a = !0;
2976
- continue;
2977
- }
2978
- const l = T(o.getRange(O.rangeToString({
2979
- rowStart: r,
2980
- colStart: s,
2981
- rowEnd: r,
2982
- colEnd: s
2983
- })).getCell().getValue());
2984
- null !== l && t(r, s, l);
2985
- }
2986
- } else d.forEach((e, o) => {
2987
- const n = o.getCoords(), s = r(b?.(n) ?? u, o.getCell().getValue());
2988
- null !== s && (t(n.rowIndex, n.colIndex, s), a = !0);
2989
- }, { includeEmpty: !0 });
2990
- if (a) continue;
2991
- }
2992
- const I = -1 !== u.indexOf("!") || -1 !== u.indexOf("[");
2993
- C || d.isSingleCell() || I || s(p) || (g = "" + y++);
2994
- const M = null !== g || d.isSingleCell() ? null : b, R = [p, {
2995
- coords: p,
2996
- formula: u,
2997
- sharedId: g,
2998
- ref: t,
2999
- isDynamicRange: C,
3000
- isExcelVolatile: k,
3001
- memberImage: M
3002
- }];
3003
- h.push(R);
3004
- } catch (e) {
3005
- t.log(`Could not write the formula '${a[1]}' over '${a[0]}'; those cells are written as values only. ${e}`);
3006
- continue;
3007
- }
3008
- }
3009
- $.push(h);
3010
- } else $.push([]);
3011
- const z = a.volatile, X = z ? z.length : 0;
3012
- if (X > 0) {
3013
- const t = new Array(X);
3014
- for (let e = 0; e < X; e++) {
3015
- const r = z[e];
3016
- try {
3017
- t[e] = [o.getRange(r).getCoords(), !0];
3018
- } catch (t) {
3019
- console.warn(`Failed to parse volatile: ${r}`, t);
3020
- continue;
3021
- }
3022
- }
3023
- $.push(t);
3024
- } else $.push([]);
3025
- const H = a.formulaArray, q = H ? H.length : 0;
3026
- if (q > 0) {
3027
- const t = new Array(q);
3028
- for (let e = 0; e < q; e++) {
3029
- const r = H[e];
3030
- try {
3031
- const n = r[0];
3032
- t[e] = [o.getRange(n).getCoords(), {
3033
- ref: n,
3034
- kind: r[1] ?? "dynamic"
3035
- }];
3036
- } catch (t) {
3037
- console.warn(`Failed to parse formula array: ${r}`, t);
3038
- continue;
3039
- }
3040
- }
3041
- $.push(t);
3042
- } else $.push([]);
3043
- o.getEntireRange().forEach((r, o) => {
3044
- const a = o.getCoords(), l = a.rowIndex, c = a.colIndex;
3045
- A !== l && B(l);
3046
- let p = o.getInjectedReference(0);
3047
- if (void 0 === p && void 0 !== F && l >= M && l <= R && (p = F), void 0 === p) {
3048
- for (; c <= C && c > N;) L++, _ = S?.[L] ?? null, P = _?.min ?? Number.MAX_SAFE_INTEGER, N = _?.max ?? Number.MAX_SAFE_INTEGER, D = _?.value?.s;
3049
- void 0 !== D && c >= P && c <= N && (p = D);
3050
- }
3051
- const g = o.getType();
3052
- let y = null;
3053
- V > 0 && (y = o.getInjectedReference(1) ?? null);
3054
- let x = !1;
3055
- X > 0 && (x = o.getInjectedReference(2) ?? !1);
3056
- let v = null;
3057
- q > 0 && (v = o.getInjectedReference(3) ?? null);
3058
- const w = "error" === v?.kind, b = "fixed" === v?.kind, k = vr;
3059
- k.r = o.getAddress(), k.s = void 0, k.t = void 0, k.cm = void 0, k.vm = void 0, i && (p = i.getHiddenXf(p ?? 0)), void 0 !== p && 0 !== p && (k.s = "" + p);
3060
- let T = null, I = null;
3061
- switch (g) {
3062
- case rt.Boolean:
3063
- T = r ? "1" : "0", I = "b";
3064
- break;
3065
- case rt.Error:
3066
- const t = r.getCode();
3067
- if (I = "e", t > 7) T = j.BuiltIn.Value.getLabel(), k.vm = "" + f.add(r);
3068
- else if (t < 1) {
3069
- let t;
3070
- I = "s", y ? (t = "=" + y.formula, y = null) : t = "" + r.getLabel(), T = "" + d.add(t), h++;
3071
- } else T = "" + r.getLabel();
3072
- break;
3073
- case rt.Number:
3074
- T = "" + r, I = null;
3075
- break;
3076
- case rt.String:
3077
- T = r, y ? (I = "str", T = r) : (I = "s", T = "" + d.add(T), h++);
3078
- break;
3079
- case rt.RichData: I = "e", T = j.BuiltIn.Value.getLabel(), k.vm = "" + f.add(r);
3080
- }
3081
- I && (k.t = I);
3082
- const O = !y?.isWrapped && (null !== v || (y?.isDynamicRange ?? !1));
3083
- if (null !== y || null !== T) {
3084
- if (O && null !== y && !b && (k.cm = "" + m.registerArrayCell(w)), e.start("c", k), y) {
3085
- const t = l === y.coords.rowStart && c === y.coords.colStart;
3086
- let r = y.formula;
3087
- y.memberImage && !t && (r = y.memberImage({
3088
- rowIndex: l,
3089
- colIndex: c
3090
- }));
3091
- let o, n = null;
3092
- const s = y.sharedId;
3093
- if (s) {
3094
- o = br;
3095
- const t = y.coords;
3096
- t.colStart === c && t.rowStart === l ? (o.ref = y.ref, o.si = s, n = y.formula) : (o.ref = void 0, o.si = s);
3097
- } else O ? (o = Cr, o.aca = w ? "1" : void 0, o.ref = w ? k.r : v?.ref ?? k.r, n = r) : (o = Sr, n = r);
3098
- o.ca = x || w || y.isExcelVolatile ? "1" : void 0, n ? (e.start("f", o), e.text(n), e.end("f")) : e.empty("f", o);
3099
- }
3100
- null !== T && ("str" === I && T ? (e.start("v", E.test(T) ? n : void 0), e.text(s(T))) : (e.start("v"), T && e.text(T)), e.end("v")), e.end("c");
3101
- } else u++ < Ze ? e.empty("c", k) : 1048577 === u && t.warn(`Reached ${Ze} style-only cells at '${k.r}'; not writing the rest.`);
3102
- }, {
3103
- injectReferences: $,
3104
- features: []
3105
- }), -1 !== A && A >= w ? e.end("row") : B(w, !0), e.end("sheetData"), e.setValidationDisabled(!1);
3106
- } else e.empty("sheetData");
3107
- if (h > 0) {
3108
- const t = c.get("stringsCount") ?? 0;
3109
- c.set("stringsCount", t + h);
3110
- }
3111
- }(e, o, a, d, await (async (t, e) => {
3112
- const r = e ? e.length : 0;
3113
- if (0 === r) return Ye;
3114
- const o = /* @__PURE__ */ new Set(), n = new Array(r);
3115
- for (let t = 0; t < r; t++) {
3116
- n[t] = null;
3117
- try {
3118
- const r = U.parse(e[t][1]);
3119
- if (!r) continue;
3120
- let s = null;
3121
- const a = (t) => {
3122
- let e = null;
3123
- "function" === t.type ? e = String(t.value) : "call" === t.type && "named" === t.inputs?.[0]?.type && (e = String(t.inputs[0].value?.name ?? "")), e && (e = e.toUpperCase(), o.add(e), (s ??= /* @__PURE__ */ new Set()).add(e));
3124
- const r = t.inputs;
3125
- if (r) for (let t = 0; t < r.length; t++) r[t] && a(r[t]);
3126
- };
3127
- a(r), n[t] = s;
3128
- } catch {}
3129
- }
3130
- const s = t.getWorkbook();
3131
- if (!s) return Ye;
3132
- const a = await I(s, o);
3133
- return 0 === a.size ? Ye : {
3134
- names: a,
3135
- perFormula: n,
3136
- affects: (t) => {
3137
- const e = n[t];
3138
- if (!e) return !1;
3139
- for (const t of e) if (a.has(t)) return !0;
3140
- return !1;
3141
- }
3142
- };
3143
- })(a, d.formulas), h), function(t, e, r, o) {
3144
- const n = o.protection;
3145
- if (!n) return;
3146
- const s = {};
3147
- n.sheet || Ot(n.password ?? {}, s);
3148
- for (const t of B) {
3149
- const e = f(t, n[t.key]);
3150
- null !== e && (s[t.attribute] = e);
3151
- }
3152
- e.empty("sheetProtection", s);
3153
- }(0, o, 0, d), function(t, e, r, o) {
3154
- const n = o.protectedRanges, s = n ? n.length : 0;
3155
- if (0 === s) return;
3156
- const a = [];
3157
- for (let e = 0; e < s; e++) {
3158
- const r = n[e];
3159
- let o, s;
3160
- Array.isArray(r) ? (o = r[0], s = r[1]) : (o = r.r, s = r.v);
3161
- const l = ar(o);
3162
- if (!l || !s) {
3163
- t.log("Skipping protectedRange with no range.");
3164
- continue;
3165
- }
3166
- if (!s.name) {
3167
- t.log("Skipping protectedRange with no name.");
3168
- continue;
3169
- }
3170
- const i = {};
3171
- Ot(s.password ?? {}, i), i.sqref = l, i.name = s.name, s.securityDescriptor && (i.securityDescriptor = s.securityDescriptor), a.push(i);
3172
- }
3173
- if (0 === a.length) return;
3174
- e.start("protectedRanges");
3175
- for (let t = 0; t < a.length; t++) e.empty("protectedRange", a[t]);
3176
- e.end("protectedRanges");
3177
- }(e, o, 0, d);
3178
- const u = d.autoTable;
3179
- if (u) {
3180
- let t;
3181
- const r = u;
3182
- t = Array.isArray(r) ? r[1] : r.v, qe(e, o, a.getAutoTable(), t, !0);
3183
- }
3184
- (function(t, e, r, o) {
3185
- const n = o.merges ? o.merges.length : 0;
3186
- if (n > 0) {
3187
- e.start("mergeCells", { count: n });
3188
- for (let t = 0; t < n; t++) {
3189
- const r = o.merges[t], n = "string" == typeof r ? r : O.rangeToString(r);
3190
- e.empty("mergeCell", { ref: n });
3191
- }
3192
- e.end("mergeCells");
3193
- }
3194
- })(0, o, 0, d);
3195
- const g = function(t, e, r, o) {
3196
- const n = [], s = o.conditionals, a = s ? s.length : 0;
3197
- if (0 === a) return n;
3198
- const l = t.getSharedStates();
3199
- let i = l.get(Pe);
3200
- i || (i = new _e(), l.set(Pe, i));
3201
- const d = r.getStyles().getTheme(), m = l.get(c);
3202
- let p = null, f = 0;
3203
- for (let r = 0; r < a; r++) {
3204
- const o = s[r];
3205
- let a, l;
3206
- Array.isArray(o) ? (a = o[0], l = o[1]) : (a = o.r, l = o.v);
3207
- const c = ar(a);
3208
- if (!c || !l) {
3209
- t.log("Skipping conditionalFormatting with no range.");
3210
- continue;
3211
- }
3212
- const h = dr(c), u = pr(l.scale, h, m);
3213
- u !== l.scale && (l = {
3214
- ...l,
3215
- scale: u
3216
- });
3217
- const g = u ? { type: u.type } : x(l.condition, sr(c), (e, r) => t.warn(e, void 0, r));
3218
- g ? (g.formulas && (g.formulas = g.formulas.map((t) => mr(t, h, m))), u?.type === q.ScaleType.IconSet && or(u) ? (f++, n.push({
3219
- guid: N(V.uuidV4),
3220
- sqref: c,
3221
- priority: f,
3222
- scale: u
3223
- })) : u || !cr(g) ? (c !== p && (null !== p && e.end("conditionalFormatting"), e.start("conditionalFormatting", {
3224
- sqref: c,
3225
- pivot: l.pivot ? "1" : void 0
3226
- }), p = c), f++, nr(t, e, d, l, g, c, f, i, n)) : (f++, n.push({
3227
- guid: N(V.uuidV4),
3228
- sqref: c,
3229
- priority: f,
3230
- rule: g,
3231
- style: l.style,
3232
- stopIfTrue: l.stopIfTrue
3233
- }))) : l.condition || t.log("Skipping conditional format with neither a condition nor a scale.");
3234
- }
3235
- null !== p && e.end("conditionalFormatting");
3236
- return n;
3237
- }(e, o, a, d), v = function(t, e, r, o) {
3238
- const n = [], s = t.getSharedStates().get(c), a = o.validations, l = a ? a.length : 0;
3239
- if (0 === l) return n;
3240
- const i = [];
3241
- for (let e = 0; e < l; e++) {
3242
- const r = a[e];
3243
- let o, l;
3244
- Array.isArray(r) ? (o = r[0], l = r[1]) : (o = r.r, l = r.v);
3245
- const c = ar(o);
3246
- if (!c || !l) {
3247
- t.log("Skipping dataValidation with no range.");
3248
- continue;
3249
- }
3250
- l.ext && t.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
3251
- const d = (e, r) => t.warn(e, void 0, r), m = b(l.condition, d), { type: p, operator: f } = m ?? {}, h = dr(c), u = mr(m?.formula1, h, s), g = mr(m?.formula2, h, s), y = {
3252
- type: p,
3253
- operator: f,
3254
- allowBlank: lr(l.condition?.includeBlanks ?? !1),
3255
- showDropDown: l.hideDropdown ? "1" : void 0,
3256
- showInputMessage: lr(l.showPromptMessage),
3257
- showErrorMessage: lr(l.showAlertMessage),
3258
- errorStyle: l.alertStyle ?? "stop",
3259
- errorTitle: D(l.alertTitle, "errorTitle", d),
3260
- error: D(l.alert, "error", d),
3261
- promptTitle: D(l.promptTitle, "promptTitle", d),
3262
- prompt: D(l.prompt, "prompt", d),
3263
- imeMode: l.imeMode
3264
- };
3265
- ir(u) || ir(g) ? n.push({
3266
- attrs: y,
3267
- formula1: u,
3268
- formula2: g,
3269
- sqref: c
3270
- }) : (y.sqref = c, i.push({
3271
- attrs: y,
3272
- formula1: u,
3273
- formula2: g
3274
- }));
3275
- }
3276
- if (0 === i.length) return n;
3277
- e.start("dataValidations", { count: i.length });
3278
- for (let t = 0; t < i.length; t++) {
3279
- const { attrs: r, formula1: o, formula2: n } = i[t];
3280
- void 0 !== o || void 0 !== n ? (e.start("dataValidation", r), void 0 !== o && (e.start("formula1"), e.text(o), e.end("formula1")), void 0 !== n && (e.start("formula2"), e.text(n), e.end("formula2")), e.end("dataValidation")) : e.empty("dataValidation", r);
3281
- }
3282
- return e.end("dataValidations"), n;
3283
- }(e, o, 0, d);
3284
- (function(t, e, r, o) {
3285
- const n = o.hyperlinks, s = n ? n.length : 0;
3286
- if (0 === s) return;
3287
- e.start("hyperlinks");
3288
- for (let r = 0; r < s; r++) {
3289
- let o, s;
3290
- const a = n[r];
3291
- Array.isArray(a) ? (s = a[0], o = a[1]) : (s = a.r, o = a.v), "string" == typeof o && (o = { address: o });
3292
- const l = o.address ?? "", i = l.indexOf("#"), c = -1 === i ? l : l.substring(0, i), d = -1 === i ? "" : l.substring(i + 1), m = {};
3293
- m.ref = s, c && (m["r:id"] = t.addExternal("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", c).relId), d && (m.location = d), o.screenTip && (m.tooltip = o.screenTip), e.empty("hyperlink", m);
3294
- }
3295
- e.end("hyperlinks");
3296
- })(e, o, 0, d), function(t, e, r, o) {
3297
- const n = o.pageMargins;
3298
- e.empty("pageMargins", {
3299
- left: n?.left ?? .7,
3300
- right: n?.right ?? .7,
3301
- top: n?.top ?? .75,
3302
- bottom: n?.bottom ?? .75,
3303
- header: n?.header ?? .3,
3304
- footer: n?.footer ?? .3
3305
- });
3306
- }(0, o, 0, d), function(t, e, r, o) {
3307
- const n = o.movables?.filter(ur);
3308
- if (0 === (n ? n.length : 0)) return;
3309
- const s = (t) => {
3310
- const e = t.content?.type;
3311
- if ("picture" === e || "chart" === e) return !0;
3312
- if ("shape" === e) {
3313
- const e = t.content?.json?.type;
3314
- return "sp" === e || "cxnSp" === e;
3315
- }
3316
- return !1;
3317
- };
3318
- if (!n.some(s)) return;
3319
- const a = r.getMovables().getItems().filter((t, e) => ur(o.movables[e])), l = t.addPart("drawing", {
3320
- sheet: r,
3321
- movables: a,
3322
- jsonMovables: n,
3323
- resources: r.getResources()
3324
- });
3325
- e.empty("drawing", { "r:id": l.relId });
3326
- }(e, o, a, d);
3327
- const w = function(t) {
3328
- const e = t.getComments().toArray();
3329
- if (0 === e.length) return null;
3330
- const r = [];
3331
- for (let t = 0; t < e.length; t++) {
3332
- const o = e[t], n = ye(o);
3333
- n && r.push({
3334
- comment: o,
3335
- ...n
3336
- });
3337
- }
3338
- return 0 === r.length ? null : (r.sort((t, e) => t.row - e.row || t.col - e.col), {
3339
- sheet: t,
3340
- comments: r
3341
- });
3342
- }(a);
3343
- fr(e, o, "legacyDrawing", hr(yr(d.legacyDrawing ?? null, d), w)), fr(e, o, "legacyDrawingHF", d.legacyDrawingHF ?? null), await async function(t, e, r) {
3344
- const o = r.getPicture();
3345
- if (!o) return;
3346
- const n = o.getResource(), s = await n.getExternalURI();
3347
- let a;
3348
- if (s) a = t.addExternal(Te, s);
3349
- else {
3350
- const e = t.getSharedStates();
3351
- let r = e.get(Ie);
3352
- r || (r = /* @__PURE__ */ new Map(), e.set(Ie, r));
3353
- let o = r.get(n);
3354
- if (!o) {
3355
- const t = await n.toBuffer();
3356
- o = {
3357
- bytes: new Uint8Array(t),
3358
- type: await n.getType() ?? Me,
3359
- index: r.size + 1
3360
- }, r.set(n, o);
3361
- }
3362
- a = t.addBinary(o.bytes, o.type.mime, Te, `../media/image${o.index}.${o.type.ext}`, !0);
3363
- }
3364
- e.empty("picture", { "r:id": a.relId });
3365
- }(e, o, a), await async function(t, e, r) {
3366
- const o = r.movables;
3367
- if (!o || o.every(ur)) return;
3368
- const n = [], s = o.length;
3369
- for (let e = 0; e < s; e++) {
3370
- const r = o[e];
3371
- if (ur(r)) continue;
3372
- const s = r.content?.json ?? {}, a = s.part;
3373
- let l;
3374
- if (a) try {
3375
- l = (await Ht(a.type ? a : {
3376
- ...a,
3377
- type: gr
3378
- }, t, "../ctrlProps/ctrlProp{n}.xml"))?.relId ?? void 0;
3379
- } catch (e) {
3380
- t.log(`Unable to write the properties of the control '${r.name}'`, e);
3381
- }
3382
- l ? n.push({
3383
- jsonMovable: r,
3384
- jsonControl: s,
3385
- relId: l
3386
- }) : t.log(`The control '${r.name}' has no properties to write and was dropped.`);
3387
- }
3388
- if (0 === n.length) return;
3389
- e.start("mc:AlternateContent", {
3390
- "xmlns:x14": y,
3391
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
3392
- }), e.start("mc:Choice", { Requires: "x14" }), e.start("controls");
3393
- const a = n.length;
3394
- for (let t = 0; t < a; t++) {
3395
- const { jsonMovable: r, jsonControl: o, relId: s } = n[t];
3396
- e.start("mc:AlternateContent"), e.start("mc:Choice", { Requires: "x14" }), e.start("control", {
3397
- shapeId: o.shapeId,
3398
- "r:id": s,
3399
- name: r.name ?? void 0
3400
- });
3401
- const a = r.anchorType ?? "twoCell";
3402
- e.start("controlPr", o.props), e.start("anchor", {
3403
- moveWithCells: "absolute" === a ? void 0 : "1",
3404
- sizeWithCells: "twoCell" === a ? "1" : void 0
3405
- }), xr(e, "from", r.anchor.tl), xr(e, "to", r.anchor.br), e.end("anchor"), o.xml && e.raw(o.xml), e.end("controlPr"), e.end("control"), e.end("mc:Choice"), e.end("mc:AlternateContent");
3406
- }
3407
- e.end("controls"), e.end("mc:Choice"), e.end("mc:AlternateContent");
3408
- }(e, o, d), function(t, e, r, o) {
3409
- const n = o.tables, s = n ? n.length : 0;
3410
- if (0 === s) return;
3411
- const a = r.getTables().getItems();
3412
- e.start("tableParts", { count: s });
3413
- for (let r = 0; r < s; r++) {
3414
- let o, s;
3415
- const l = n[r];
3416
- Array.isArray(l) ? (s = l[0], o = l[1]) : (s = l.r, o = l.v);
3417
- const i = t.addPart("table", {
3418
- json: o,
3419
- model: a[r],
3420
- ref: s
3421
- }), c = {};
3422
- c["r:id"] = i.relId, e.empty("tablePart", c);
3423
- }
3424
- e.end("tableParts");
3425
- }(e, o, a, d), function(t, e, r, o, n) {
3426
- if (0 === o.length && 0 === n.length) return;
3427
- const s = r.getStyles(), a = s.getTheme();
3428
- if (e.start("extLst"), o.length > 0) {
3429
- e.start("ext", {
3430
- uri: i,
3431
- "xmlns:x14": y
3432
- }), e.start("x14:conditionalFormattings");
3433
- for (let t = 0; t < o.length; t++) {
3434
- const { guid: r, sqref: n, priority: l, scale: i, rule: c, style: d, stopIfTrue: p } = o[t];
3435
- if (e.start("x14:conditionalFormatting", { "xmlns:xm": m }), i) if (i.type === q.ScaleType.DataBar) {
3436
- e.start("x14:cfRule", {
3437
- type: "dataBar",
3438
- id: r
3439
- }), e.start("x14:dataBar", {
3440
- minLength: i.minLength,
3441
- maxLength: i.maxLength,
3442
- gradient: i.gradient ? void 0 : "0",
3443
- border: i.borderColor ? "1" : void 0,
3444
- direction: i.direction,
3445
- negativeBarColorSameAsPositive: i.negativeFillColor ? "0" : "1",
3446
- negativeBarBorderColorSameAsPositive: i.negativeBorderColor ? "0" : void 0,
3447
- axisPosition: i.axisPosition
3448
- });
3449
- const t = i.stops ?? [];
3450
- if (0 === t.length) er(e, { type: q.ColorStopType.AutoMin }), er(e, { type: q.ColorStopType.AutoMax });
3451
- else for (let r = 0; r < t.length; r++) er(e, t[r]);
3452
- i.borderColor && ne(e, a, i.borderColor, "x14:borderColor"), i.negativeFillColor && ne(e, a, i.negativeFillColor, "x14:negativeFillColor"), i.negativeBorderColor && ne(e, a, i.negativeBorderColor, "x14:negativeBorderColor"), i.axisColor && ne(e, a, i.axisColor, "x14:axisColor"), e.end("x14:dataBar"), e.end("x14:cfRule");
3453
- } else {
3454
- e.start("x14:cfRule", {
3455
- type: "iconSet",
3456
- priority: l,
3457
- id: r
3458
- }), e.start("x14:iconSet", {
3459
- iconSet: i.iconSet,
3460
- reverse: lr(i.reverse),
3461
- showValue: lr(i.showValue),
3462
- custom: (i.icon?.length ?? 0) > 0 ? "1" : void 0
3463
- });
3464
- const t = i.stops ?? [];
3465
- for (let r = 0; r < t.length; r++) er(e, t[r]);
3466
- const o = i.icon ?? [];
3467
- for (let t = 0; t < o.length; t++) e.empty("x14:cfIcon", {
3468
- iconSet: o[t].set,
3469
- iconId: o[t].id
3470
- });
3471
- e.end("x14:iconSet"), e.end("x14:cfRule");
3472
- }
3473
- else {
3474
- e.start("x14:cfRule", {
3475
- type: c.type,
3476
- priority: l,
3477
- stopIfTrue: lr(p),
3478
- aboveAverage: lr(c.aboveAverage),
3479
- equalAverage: lr(c.equalAverage),
3480
- stdDev: c.stdDev,
3481
- bottom: lr(c.bottom),
3482
- percent: lr(c.percent),
3483
- rank: c.rank,
3484
- operator: c.operator,
3485
- text: c.text,
3486
- timePeriod: c.timePeriod,
3487
- id: r
3488
- });
3489
- const t = c.formulas ?? [];
3490
- for (let r = 0; r < t.length; r++) e.start("xm:f"), e.text(t[r]), e.end("xm:f");
3491
- d && Object.keys(d).length > 0 && ze(0, e, d, s, a, "x14:dxf"), e.end("x14:cfRule");
3492
- }
3493
- e.start("xm:sqref"), e.text(n), e.end("xm:sqref"), e.end("x14:conditionalFormatting");
3494
- }
3495
- e.end("x14:conditionalFormattings"), e.end("ext");
3496
- }
3497
- if (n.length > 0) {
3498
- e.start("ext", {
3499
- uri: l,
3500
- "xmlns:x14": y
3501
- }), e.start("x14:dataValidations", {
3502
- "xmlns:xm": m,
3503
- count: n.length
3504
- });
3505
- for (let t = 0; t < n.length; t++) {
3506
- const { attrs: r, formula1: o, formula2: s, sqref: a } = n[t];
3507
- e.start("x14:dataValidation", r), void 0 !== o && (e.start("x14:formula1"), e.start("xm:f"), e.text(o), e.end("xm:f"), e.end("x14:formula1")), void 0 !== s && (e.start("x14:formula2"), e.start("xm:f"), e.text(s), e.end("xm:f"), e.end("x14:formula2")), e.start("xm:sqref"), e.text(a), e.end("xm:sqref"), e.end("x14:dataValidation");
3508
- }
3509
- e.end("x14:dataValidations"), e.end("ext");
3510
- }
3511
- e.end("extLst");
3512
- }(0, o, a, g, v), function(t, e) {
3513
- const r = e.pivotTables, o = r ? r.length : 0;
3514
- for (let e = 0; e < o; e++) {
3515
- const o = r[e], n = o.part;
3516
- n?.xml && (Jt(t, o.cacheId) ? t.addPart("pivotTable", o) : t.log(`The pivot table '${n.name ?? ""}' has no cache with id ${o.cacheId} and was dropped.`));
3517
- }
3518
- }(e, d), function(t, e) {
3519
- if (!e) return;
3520
- t.addPart("comments", e), e.comments.some((t) => !t.comment.isNote()) && t.addPart("threadedComments", e);
3521
- }(e, w), o.end("worksheet"), o.close();
3522
- }
3523
- }(),
3524
- new class extends ct {
3525
- constructor() {
3526
- super({
3527
- kind: "sharedStrings",
3528
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
3529
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
3530
- path: "/xl/sharedStrings.xml"
3531
- });
3532
- }
3533
- async emit(t, e) {
3534
- const r = e.getXMLWriter(), o = t.json, a = o ? o.length : 0, l = e.getSharedStates().get("stringsCount") ?? 0;
3535
- r.decl(), r.start("sst", {
3536
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3537
- count: l,
3538
- uniqueCount: a
3539
- });
3540
- for (let t = 0; t < a; t++) {
3541
- const e = o[t];
3542
- r.start("si");
3543
- const a = E.test(e) ? n : void 0;
3544
- r.start("t", a), r.text(s(e)), r.end("t"), r.end("si");
3545
- }
3546
- r.end("sst"), r.close();
3547
- }
3548
- }(),
3549
- new class extends ct {
3550
- constructor() {
3551
- super({
3552
- kind: "theme",
3553
- contentType: "application/vnd.openxmlformats-officedocument.theme+xml",
3554
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
3555
- path: "/xl/theme/theme{n}.xml"
3556
- });
3557
- }
3558
- async emit(t, e) {
3559
- const r = e.getXMLWriter(), o = t.model, n = t.json;
3560
- r.decl(), r.pushDefaultNamespace("a"), r.start("theme", {
3561
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3562
- name: o.getName() || "Office Theme"
3563
- }), r.start("themeElements"), function(t, e, r, o) {
3564
- const n = r?.getColorScheme();
3565
- if (!n) return;
3566
- e.start(o, { name: n.getName() || "Office" });
3567
- for (const t of le) e.start(t), re(e, r, n["get" + t.charAt(0).toUpperCase() + t.slice(1)]()), e.end(t);
3568
- e.end(o);
3569
- }(0, r, o, "clrScheme"), function(t, e, r, o) {
3570
- if (!r) return;
3571
- e.start(o, { name: r.getName() || "Office" }), kr(t, e, r.getMajorFont() || "Calibri Light", "majorFont"), kr(t, e, r.getMinorFont() || "Calibri", "minorFont"), e.end(o);
3572
- }(e, r, o.getFontScheme(), "fontScheme"), function(t, e, r, o, n) {
3573
- if (n?.fillStyleLst && n?.lnStyleLst && n?.effectStyleLst && n?.bgFillStyleLst) return void function(t, e, r, o, n) {
3574
- const s = { getTheme: () => o };
3575
- e.start(r, { name: "Office" }), e.start("fillStyleLst");
3576
- for (const t of n.fillStyleLst) xe(0, e, t, s);
3577
- e.end("fillStyleLst"), e.start("lnStyleLst");
3578
- for (const t of n.lnStyleLst) ve(0, e, t, s);
3579
- e.end("lnStyleLst"), e.start("effectStyleLst");
3580
- for (const r of n.effectStyleLst) e.start("effectStyle"), r.length > 0 ? be(t, e, o, r) : e.empty("effectLst"), e.end("effectStyle");
3581
- e.end("effectStyleLst"), e.start("bgFillStyleLst");
3582
- for (const t of n.bgFillStyleLst) xe(0, e, t, s);
3583
- e.end("bgFillStyleLst"), e.end(r);
3584
- }(t, e, r, o, n);
3585
- if (n?.formatSchemeXml) return void e.raw(n.formatSchemeXml);
3586
- e.start(r, { name: "Office" }), function(t, e) {
3587
- e.start("fillStyleLst"), e.start("solidFill"), e.empty("schemeClr", { val: "phClr" }), e.end("solidFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "50000" }), e.empty("satMod", { val: "300000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "35000" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "37000" }), e.empty("satMod", { val: "300000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "15000" }), e.empty("satMod", { val: "350000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("lin", {
3588
- ang: "16200000",
3589
- scaled: "1"
3590
- }), e.end("gradFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "51000" }), e.empty("satMod", { val: "130000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "80000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "93000" }), e.empty("satMod", { val: "130000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "94000" }), e.empty("satMod", { val: "135000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("lin", {
3591
- ang: "16200000",
3592
- scaled: "0"
3593
- }), e.end("gradFill"), e.end("fillStyleLst");
3594
- }(0, e), function(t, e) {
3595
- e.start("lnStyleLst");
3596
- const r = [
3597
- 9525,
3598
- 25400,
3599
- 38100
3600
- ];
3601
- for (let t = 0; t < 3; t++) e.start("ln", {
3602
- w: r[t].toString(),
3603
- cap: "flat",
3604
- cmpd: "sng",
3605
- algn: "ctr"
3606
- }), e.start("solidFill"), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "95000" }), e.empty("satMod", { val: "105000" }), e.end("schemeClr"), e.end("solidFill"), e.empty("prstDash", { val: "solid" }), e.end("ln");
3607
- e.end("lnStyleLst");
3608
- }(0, e), function(t, e) {
3609
- e.start("effectStyleLst");
3610
- for (let t = 0; t < 3; t++) e.start("effectStyle"), e.start("effectLst"), 2 === t && (e.start("outerShdw", {
3611
- blurRad: "40000",
3612
- dist: "20000",
3613
- dir: "5400000",
3614
- rotWithShape: "0"
3615
- }), e.start("srgbClr", { val: "000000" }), e.empty("alpha", { val: "38000" }), e.end("srgbClr"), e.end("outerShdw")), e.end("effectLst"), e.end("effectStyle");
3616
- e.end("effectStyleLst");
3617
- }(0, e), function(t, e) {
3618
- e.start("bgFillStyleLst"), e.start("solidFill"), e.empty("schemeClr", { val: "phClr" }), e.end("solidFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "40000" }), e.empty("satMod", { val: "350000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "40000" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "45000" }), e.empty("shade", { val: "99000" }), e.empty("satMod", { val: "350000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "20000" }), e.empty("satMod", { val: "255000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("path", { path: "circle" }), e.empty("fillToRect", {
3619
- l: "50000",
3620
- t: "-80000",
3621
- r: "50000",
3622
- b: "180000"
3623
- }), e.end("gradFill"), e.start("gradFill", { rotWithShape: "1" }), e.start("gsLst"), e.start("gs", { pos: "0" }), e.start("schemeClr", { val: "phClr" }), e.empty("tint", { val: "80000" }), e.empty("satMod", { val: "300000" }), e.end("schemeClr"), e.end("gs"), e.start("gs", { pos: "100000" }), e.start("schemeClr", { val: "phClr" }), e.empty("shade", { val: "30000" }), e.empty("satMod", { val: "200000" }), e.end("schemeClr"), e.end("gs"), e.end("gsLst"), e.empty("path", { path: "circle" }), e.empty("fillToRect", {
3624
- l: "50000",
3625
- t: "50000",
3626
- r: "50000",
3627
- b: "50000"
3628
- }), e.end("gradFill"), e.end("bgFillStyleLst");
3629
- }(0, e), e.end(r);
3630
- }(e, r, "fmtScheme", o, n), r.end("themeElements"), r.start("objectDefaults"), r.end("objectDefaults"), r.start("extraClrSchemeLst"), r.end("extraClrSchemeLst"), r.end("theme"), r.close();
3631
- }
3632
- }(),
3633
- new class extends ct {
3634
- constructor() {
3635
- super({
3636
- kind: "styles",
3637
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3638
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
3639
- path: "/xl/styles.xml"
3640
- });
3641
- }
3642
- async emit(t, e) {
3643
- const r = e.getXMLWriter(), o = t.json, n = (t.theme, t.styles);
3644
- r.decl(), r.start("styleSheet", {
3645
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3646
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3647
- "mc:Ignorable": "x14ac x16r2 xr",
3648
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac",
3649
- "xmlns:x16r2": "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main",
3650
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
3651
- });
3652
- const s = function(t, e) {
3653
- let r = e?.direct;
3654
- r && 0 !== r.length || (r = [{}]);
3655
- const o = r.length, n = new Array(o);
3656
- for (let e = 0; e < o; e++) {
3657
- const o = 0 === e ? {
3658
- ...r[e],
3659
- named: Z.BuiltInName.Normal
3660
- } : r[e], s = t.resolve(o), a = {};
3661
- void 0 !== o.named && (a.named = o.named), void 0 !== o.quotePrefix && (a.quotePrefix = o.quotePrefix), void 0 !== o.protection && (a.protection = o.protection);
3662
- for (let t = 0; t < Ne.length; t++) {
3663
- const e = Ne[t];
3664
- if (void 0 === o[e] && "alignment" !== e) continue;
3665
- const r = s?.[e] ?? o[e];
3666
- void 0 !== r && (a[e] = r);
3667
- }
3668
- n[e] = a;
3669
- }
3670
- return n;
3671
- }(n, o), a = function(t, e, r) {
3672
- const o = {
3673
- fontMap: /* @__PURE__ */ new Map(),
3674
- fonts: [],
3675
- fillMap: /* @__PURE__ */ new Map(),
3676
- fills: [],
3677
- borderMap: /* @__PURE__ */ new Map(),
3678
- borders: [],
3679
- numFmtMap: /* @__PURE__ */ new Map(),
3680
- numFmtsCustom: [],
3681
- namedStyleMap: /* @__PURE__ */ new Map(),
3682
- namedStyles: []
3683
- };
3684
- (function(t, e) {
3685
- const r = (t.getNamedStyles().getByName(Z.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3686
- e.fontMap.set($.JSONStableStringify(r), "0"), e.fonts.push(r);
3687
- })(t, o), function(t) {
3688
- const e = { type: "none" };
3689
- t.fillMap.set($.JSONStableStringify(e), "0"), t.fills.push(e);
3690
- const r = {
3691
- type: "pattern",
3692
- patternType: "gray125"
3693
- };
3694
- t.fillMap.set($.JSONStableStringify(r), "1"), t.fills.push(r);
3695
- }(o), function(t) {
3696
- const e = {
3697
- bottom: { style: "none" },
3698
- left: { style: "none" },
3699
- right: { style: "none" },
3700
- top: { style: "none" }
3701
- };
3702
- t.borderMap.set($.JSONStableStringify(e), "0"), t.borders.push(e);
3703
- }(o), function(t, e) {
3704
- Ee(t, t.getNamedStyles().getByName(Z.BuiltInName.Normal).toJSON(), e);
3705
- }(t, o);
3706
- const n = e?.named ?? V.EmptyArray;
3707
- for (const e of n) Ee(t, e, o);
3708
- for (const e of r) De(t, e, o);
3709
- return o;
3710
- }(n, o, s), l = e.getSharedStates().get(Pe), i = function(t, e = 0) {
3711
- const r = t?.tables;
3712
- if (!r) return null;
3713
- const o = r.styles;
3714
- if (!o) return null;
3715
- const n = [], s = /* @__PURE__ */ new Map(), a = Object.keys(o), l = [...Ue].reverse();
3716
- for (const t of a) {
3717
- const r = o[t];
3718
- for (const o of l) {
3719
- const a = r[o];
3720
- if (!a) continue;
3721
- const l = {};
3722
- if (a.font && (l.font = a.font), a.fill && (l.fill = a.fill), a.borders && (l.borders = a.borders), void 0 !== a.numberFormat && (l.numberFormat = a.numberFormat), 0 === Object.keys(l).length) continue;
3723
- const i = e + n.length;
3724
- n.push(l);
3725
- const c = `${t}:${o}`;
3726
- s.set(c, i);
3727
- }
3728
- }
3729
- return {
3730
- dxfs: n,
3731
- dxfIndexMap: s
3732
- };
3733
- }(o, l?.getCount() ?? 0);
3734
- (function(t, e, r) {
3735
- const o = r.numFmtsCustom, n = o.length;
3736
- if (0 === n) return;
3737
- e.start("numFmts", { count: String(n) });
3738
- for (let t = 0; t < n; t++) {
3739
- const r = o[t];
3740
- e.empty("numFmt", {
3741
- numFmtId: String(t + je),
3742
- formatCode: r
3743
- });
3744
- }
3745
- e.end("numFmts");
3746
- })(0, r, a), function(t, e, r, o) {
3747
- const n = o.fonts, s = n.length;
3748
- e.start("fonts", {
3749
- count: String(s),
3750
- "x14ac:knownFonts": "1"
3751
- });
3752
- for (const o of n) Be(t, e, o, r);
3753
- e.end("fonts");
3754
- }(e, r, n, a), function(t, e, r, o) {
3755
- const n = o.fills, s = n.length;
3756
- e.start("fills", { count: String(s) });
3757
- for (const t of n) xe(0, e, t, r, !0);
3758
- e.end("fills");
3759
- }(0, r, n, a), function(t, e, r, o) {
3760
- const n = o.borders, s = n.length;
3761
- e.start("borders", { count: String(s) });
3762
- const a = r.getTheme();
3763
- for (const r of n) $e(t, e, r, a, !1);
3764
- e.end("borders");
3765
- }(e, r, n, a), function(t, e, r, o, n) {
3766
- const s = n.namedStyles, a = s.length;
3767
- e.start("cellStyleXfs", { count: String(a) });
3768
- for (const o of s) Ve(t, e, r, o.style ?? V.EmptyObject, n, !1);
3769
- e.end("cellStyleXfs");
3770
- }(e, r, n, 0, a), function(t, e, r, o, n, s) {
3771
- const a = o.length, l = s?.getSources() ?? [];
3772
- e.start("cellXfs", { count: String(a + l.length) });
3773
- for (let s = 0; s < a; s++) Ve(t, e, r, o[s], n, !0);
3774
- for (let s = 0; s < l.length; s++) Ve(t, e, r, o[l[s]], n, !0, !0);
3775
- e.end("cellXfs");
3776
- }(e, r, n, s, a, e.getSharedStates().get($t)), function(t, e, r, o, n) {
3777
- const s = n.namedStyles, a = s.length;
3778
- e.start("cellStyles", { count: String(a) });
3779
- const l = n.namedStyleMap;
3780
- for (let t = 0; t < a; t++) {
3781
- const o = s[t], n = o.name, a = n.toLowerCase(), i = {
3782
- name: n,
3783
- xfId: l.get(a)
3784
- };
3785
- o.hidden && (i.hidden = "1"), o.iLevel && (i.iLevel = String(o.iLevel));
3786
- let c = null;
3787
- c = a === Z.BuiltInName.Normal.toLowerCase() ? 0 : r.getNamedStyles().getByName(n).getBuiltInID(), null !== c && (i.builtinId = String(c), i.customBuiltin = "1"), e.empty("cellStyle", i);
3788
- }
3789
- e.end("cellStyles");
3790
- }(0, r, n, 0, a), function(t, e, r, o, n) {
3791
- const s = [...n?.getDxfs() ?? [], ...o?.dxfs ?? []];
3792
- if (0 === s.length) return void e.empty("dxfs", { count: "0" });
3793
- const a = r.getTheme();
3794
- e.start("dxfs", { count: String(s.length) });
3795
- let l = je;
3796
- for (const o of s) l = ze(t, e, o, r, a, "dxf", l);
3797
- e.end("dxfs");
3798
- }(e, r, n, i, l), function(t, e, r, o, n) {
3799
- const s = o?.tables, a = s?.styles ?? null, l = a ? Object.keys(a) : null, i = l ? l.length : 0, c = {
3800
- count: String(i),
3801
- defaultTableStyle: s?.defaultTableStyle ?? "TableStyleMedium2",
3802
- defaultPivotStyle: s?.defaultPivotStyle ?? "PivotStyleLight16"
3803
- };
3804
- if (0 === i) return void e.empty("tableStyles", c);
3805
- e.start("tableStyles", c);
3806
- for (const t of l) {
3807
- const r = a[t], o = [];
3808
- for (const t of Ue) {
3809
- const e = r[t];
3810
- e && o.push([t, e]);
3811
- }
3812
- const s = {
3813
- name: t,
3814
- pivot: r.pivot ? "1" : "0",
3815
- count: String(o.length)
3816
- };
3817
- e.start("tableStyle", s);
3818
- for (const [r, s] of o) {
3819
- const o = `${t}:${r}`, a = n?.dxfIndexMap.get(o) ?? "0", l = {};
3820
- l.type = r, void 0 !== s.size && (l.size = String(s.size)), l.dxfId = String(a), e.empty("tableStyleElement", l);
3821
- }
3822
- e.end("tableStyle");
3823
- }
3824
- e.end("tableStyles");
3825
- }(0, r, 0, o, i), function(t, e, r, o) {
3826
- const n = o?.indexedColors && o.indexedColors.length > 0, s = o?.mruColors && o.mruColors.length > 0;
3827
- if (!n && !s) return;
3828
- if (e.start("colors"), n) {
3829
- e.start("indexedColors");
3830
- for (const t of o.indexedColors) {
3831
- const r = fe(t, !0);
3832
- e.empty("rgbColor", { rgb: r });
3833
- }
3834
- e.end("indexedColors");
3835
- }
3836
- if (s) {
3837
- e.start("mruColors");
3838
- for (const t of o.mruColors) {
3839
- const r = fe(t);
3840
- e.empty("color", { rgb: r });
3841
- }
3842
- e.end("mruColors");
3843
- }
3844
- e.end("colors");
3845
- }(0, r, 0, o), function(t, e) {
3846
- e.start("extLst"), e.start("ext", {
3847
- uri: "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}",
3848
- "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
3849
- }), e.empty("x14:slicerStyles", { defaultSlicerStyle: "SlicerStyleLight1" }), e.end("ext"), e.start("ext", {
3850
- uri: "{9260A510-F301-46a8-8635-F512D64BE5F5}",
3851
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
3852
- }), e.empty("x15:timelineStyles", { defaultTimelineStyle: "TimeSlicerStyleLight1" }), e.end("ext"), e.end("extLst");
3853
- }(0, r), r.end("styleSheet"), r.close();
3854
- }
3855
- }(),
3856
- new class extends ct {
3857
- constructor() {
3858
- super({
3859
- kind: "propsCore",
3860
- contentType: "application/vnd.openxmlformats-package.core-properties+xml",
3861
- relTypeUri: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
3862
- path: "/docProps/core.xml"
3863
- });
3864
- }
3865
- async emit(t, e) {
3866
- const r = e.getXMLWriter();
3867
- r.decl(), r.start("cp:coreProperties", {
3868
- "xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
3869
- "xmlns:dc": "http://purl.org/dc/elements/1.1/",
3870
- "xmlns:dcterms": "http://purl.org/dc/terms/",
3871
- "xmlns:dcmitype": "http://purl.org/dc/dcmitype/",
3872
- "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
3873
- });
3874
- const o = /* @__PURE__ */ new Date(), n = [
3875
- ["creator", "SheetXL"],
3876
- ["lastModifiedBy", "SheetXL"],
3877
- ["created", Tr(o)],
3878
- ["modified", Tr(o)]
3879
- ];
3880
- for (const t of n) Ir(r, t[0], t[1]);
3881
- r.end("cp:coreProperties"), r.close();
3882
- }
3883
- }(),
3884
- new class extends ct {
3885
- constructor() {
3886
- super({
3887
- kind: "propsApp",
3888
- contentType: "application/vnd.openxmlformats-officedocument.extended-properties+xml",
3889
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
3890
- path: "/docProps/app.xml"
3891
- });
3892
- }
3893
- async emit(t, e) {
3894
- const r = e.getXMLWriter(), o = t.model, n = await tt.getDetails(), s = L(n.getBuildVersion()), a = n.getLicensee() || "";
3895
- r.setValidationDisabled(!0), r.decl(), r.start("Properties", {
3896
- xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
3897
- "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
3898
- }), Mr(e, r, "Application", "SheetXL"), Mr(e, r, "DocSecurity", "0"), Mr(e, r, "ScaleCrop", "false"), Rr(e, r, o), Mr(e, r, "Company", a), Mr(e, r, "LinksUpToDate", "false"), Mr(e, r, "SharedDoc", "false"), Mr(e, r, "HyperlinksChanged", "false"), Mr(e, r, "AppVersion", s), r.end("Properties"), r.close();
3899
- }
3900
- }(),
3901
- new class extends ct {
3902
- constructor() {
3903
- super({
3904
- kind: "metadata",
3905
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",
3906
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",
3907
- path: "/xl/metadata.xml"
3908
- });
3909
- }
3910
- emit(t, e) {
3911
- const r = e.getXMLWriter(), o = t.hasCellMeta(), n = t.hasValueMeta(), s = t.getDAPRFutureMetadataBlocks(), a = t.getRVFutureMetadataBlocks(), l = t.getValueMeta();
3912
- let i = 0, c = 0, d = 0;
3913
- o && (i = ++d), n && (c = ++d);
3914
- const m = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
3915
- if (o && (m["xmlns:xda"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"), n && (m["xmlns:xlrd"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"), r.decl(), r.start("metadata", m), r.start("metadataTypes", { count: d }), o && r.empty("metadataType", {
3916
- name: "XLDAPR",
3917
- ...Fr,
3918
- cellMeta: "1"
3919
- }), n && r.empty("metadataType", {
3920
- name: "XLRICHVALUE",
3921
- ...Fr
3922
- }), r.end("metadataTypes"), o) {
3923
- r.start("futureMetadata", {
3924
- name: "XLDAPR",
3925
- count: s.length
3926
- });
3927
- for (const t of s) r.start("bk"), r.start("extLst"), r.start("ext", { uri: "{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}" }), r.empty("xda:dynamicArrayProperties", {
3928
- fDynamic: t.fDynamic,
3929
- fCollapsed: t.fCollapsed
3930
- }), r.end("ext"), r.end("extLst"), r.end("bk");
3931
- r.end("futureMetadata");
3932
- }
3933
- if (n) {
3934
- r.start("futureMetadata", {
3935
- name: "XLRICHVALUE",
3936
- count: a.length
3937
- });
3938
- for (const t of a) r.start("bk"), r.start("extLst"), r.start("ext", { uri: "{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}" }), r.empty("xlrd:rvb", { i: t }), r.end("ext"), r.end("extLst"), r.end("bk");
3939
- r.end("futureMetadata");
3940
- }
3941
- if (o) {
3942
- r.start("cellMetadata", { count: s.length });
3943
- for (let t = 0; t < s.length; t++) r.start("bk"), r.empty("rc", {
3944
- t: i,
3945
- v: t
3946
- }), r.end("bk");
3947
- r.end("cellMetadata");
3948
- }
3949
- if (n) {
3950
- r.start("valueMetadata", { count: l.length });
3951
- for (const t of l) r.start("bk"), r.empty("rc", {
3952
- t: c,
3953
- v: t
3954
- }), r.end("bk");
3955
- r.end("valueMetadata");
3956
- }
3957
- r.end("metadata"), r.close();
3958
- }
3959
- }(),
3960
- new class extends ct {
3961
- constructor() {
3962
- super({
3963
- kind: "richValue",
3964
- contentType: "application/vnd.ms-excel.rdrichvalue+xml",
3965
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValue",
3966
- path: "./richData/rdrichvalue.xml"
3967
- });
3968
- }
3969
- async emit(t, e) {
3970
- const r = e.getXMLWriter(), o = t.getEntries(), n = o.length;
3971
- r.decl(), r.start("rvData", {
3972
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3973
- count: n
3974
- });
3975
- for (const e of o) {
3976
- const o = t.handlerStructureIndex(e.handler);
3977
- r.start("rv", { s: o });
3978
- const n = e.handler.getValues(e.rawValue);
3979
- for (const t of n) r.start("v"), r.text(t), r.end("v");
3980
- r.end("rv");
3981
- }
3982
- r.end("rvData"), r.close();
3983
- }
3984
- }(),
3985
- new class extends ct {
3986
- constructor() {
3987
- super({
3988
- kind: "richValueStructure",
3989
- contentType: "application/vnd.ms-excel.rdrichvaluestructure+xml",
3990
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueStructure",
3991
- path: "./richData/rdrichvaluestructure.xml"
3992
- });
3993
- }
3994
- async emit(t, e) {
3995
- const r = e.getXMLWriter(), o = t.uniqueHandlers(), n = o.length;
3996
- r.decl(), r.start("rvStructures", {
3997
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3998
- count: n
3999
- });
4000
- for (const t of o) {
4001
- r.start("s", { t: t.type });
4002
- for (const [e, o] of t.props) r.empty("k", {
4003
- n: e,
4004
- t: o
4005
- });
4006
- r.end("s");
4007
- }
4008
- r.end("rvStructures"), r.close();
4009
- }
4010
- }(),
4011
- new class extends ct {
4012
- constructor() {
4013
- super({
4014
- kind: "richValueTypes",
4015
- contentType: "application/vnd.ms-excel.rdrichvaluetypes+xml",
4016
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueTypes",
4017
- path: "./richData/rdRichValueTypes.xml"
4018
- });
4019
- }
4020
- async emit(t, e) {
4021
- const r = e.getXMLWriter();
4022
- r.decl(), r.start("rvTypesInfo", {
4023
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2",
4024
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4025
- "mc:Ignorable": "x",
4026
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4027
- });
4028
- const o = [
4029
- ["_self", ["ExcludeFromFile", "ExcludeFromCalcComparison"]],
4030
- ["_DisplayString", ["ExcludeFromCalcComparison"]],
4031
- ["_Flags", ["ExcludeFromCalcComparison"]],
4032
- ["_Format", ["ExcludeFromCalcComparison"]],
4033
- ["_SubLabel", ["ExcludeFromCalcComparison"]],
4034
- ["_Attribution", ["ExcludeFromCalcComparison"]],
4035
- ["_Icons", ["ExcludeFromCalcComparison"]],
4036
- ["_Display", ["ExcludeFromCalcComparison"]],
4037
- ["_CanonicalPropertyNames", ["ExcludeFromCalcComparison"]],
4038
- ["_ClassificationId", ["ExcludeFromCalcComparison"]]
4039
- ];
4040
- r.start("global"), r.start("keyFlags");
4041
- for (const [t, e] of o) {
4042
- r.start("key", { name: t });
4043
- for (const t of e) r.empty("flag", {
4044
- name: t,
4045
- value: "1"
4046
- });
4047
- r.end("key");
4048
- }
4049
- r.end("keyFlags"), r.end("global"), r.end("rvTypesInfo"), r.close();
4050
- }
4051
- }(),
4052
- new class extends ct {
4053
- constructor() {
4054
- super({
4055
- kind: "drawing",
4056
- contentType: "application/vnd.openxmlformats-officedocument.drawing+xml",
4057
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
4058
- path: "../drawings/drawing{n}.xml"
4059
- });
4060
- }
4061
- async emit(t, e) {
4062
- const r = e.getXMLWriter();
4063
- r.decl(), r.pushDefaultNamespace("xdr"), r.start("wsDr", {
4064
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
4065
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
4066
- });
4067
- const o = /* @__PURE__ */ new Map(), n = t.sheet, s = t.movables, a = t.jsonMovables, l = a ? a.length : 0;
4068
- let i = 0;
4069
- for (let t = 0; t < l; t++) {
4070
- const e = a[t].content?.json?.sourceId;
4071
- "number" == typeof e && e > i && (i = e);
4072
- }
4073
- const c = /* @__PURE__ */ new Map();
4074
- let d;
4075
- if (i > 0) {
4076
- const t = e.getSharedStates();
4077
- d = t.get("uniqueIdCounter"), d || (d = /* @__PURE__ */ new Map(), t.set("uniqueIdCounter", d)), d.set(n, Math.max(d.get(n) ?? 1, i));
4078
- const r = /* @__PURE__ */ new Set();
4079
- for (let t = 0; t < l; t++) {
4080
- const e = a[t].content?.json?.sourceId;
4081
- if ("number" == typeof e) if (r.has(e)) {
4082
- const e = d.get(n) + 1;
4083
- d.set(n, e), c.set(a[t], e);
4084
- } else r.add(e);
4085
- }
4086
- }
4087
- for (let t = 0; t < l; t++) {
4088
- const l = a[t], i = s[t], d = l.content?.type;
4089
- switch (r.start("twoCellAnchor", { editAs: l.anchorType || "twoCell" }), Jr(r, "from", l.anchor.tl), Jr(r, "to", l.anchor.br), d) {
4090
- case "picture":
4091
- await Er(e, n, o, i, l);
4092
- break;
4093
- case "chart":
4094
- await Br(e, n, o, i, l, c.get(l));
4095
- break;
4096
- case "shape":
4097
- await Vr(e, n, o, i, l, c.get(l));
4098
- break;
4099
- case "smartArt":
4100
- await Or(e, n, o, i, l);
4101
- break;
4102
- case "slicer":
4103
- await $r(e, n, o, i, l);
4104
- break;
4105
- case "graphicFrame":
4106
- await Wr(e, n, o, i, l);
4107
- break;
4108
- default: await zr(e, n, o, i, l);
4109
- }
4110
- r.empty("clientData"), r.end("twoCellAnchor");
4111
- }
4112
- r.end("wsDr"), r.close();
4113
- }
4114
- }(),
4115
- new class extends ct {
4116
- constructor() {
4117
- super({
4118
- kind: "legacyDrawing",
4119
- contentType: "application/vnd.openxmlformats-officedocument.vmlDrawing",
4120
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
4121
- path: "../drawings/vmlDrawing{n}.vml"
4122
- });
4123
- }
4124
- async emit(t, e) {
4125
- const r = t.images, o = r ? r.length : 0;
4126
- if (o > 0) {
4127
- const t = e.getSharedStates().get(it);
4128
- for (let n = 0; n < o; n++) {
4129
- const o = r[n], s = t?.get(o.resId);
4130
- if (s) try {
4131
- await Kr(e, o.id, s);
4132
- } catch (t) {
4133
- e.log(`Unable to write legacy drawing image '${o.id}'`, t);
4134
- }
4135
- else e.log(`Legacy drawing image '${o.id}' has no resource ${o.resId} and was not written.`);
4136
- }
4137
- }
4138
- const n = e.getXMLWriter();
4139
- n.setValidationDisabled(!0), n.raw(t.xml), n.close();
4140
- }
4141
- }(),
4142
- new class extends ct {
4143
- constructor() {
4144
- super({
4145
- kind: "embeddedPart",
4146
- contentType: Ut,
4147
- relTypeUri: ""
4148
- });
4149
- }
4150
- getContentType(t) {
4151
- return t?.contentType || Ut;
4152
- }
4153
- getRelTypeUri(t) {
4154
- return t?.type ?? "";
4155
- }
4156
- getPath(t) {
4157
- return `./${qt(t.name)}`;
4158
- }
4159
- async emit(t, e) {
4160
- await Xt(t, e);
4161
- const r = e.getXMLWriter();
4162
- r.setValidationDisabled(!0), r.raw(t.xml ?? ""), r.close();
4163
- }
4164
- }(),
4165
- new class extends ct {
4166
- constructor() {
4167
- super({
4168
- kind: "pivotTable",
4169
- contentType: Gt,
4170
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
4171
- path: "../pivotTables/pivotTable{n}.xml"
4172
- });
4173
- }
4174
- getContentType(t) {
4175
- return t?.part?.contentType || Gt;
4176
- }
4177
- async emit(t, e) {
4178
- const r = t.part;
4179
- await Xt(r, e);
4180
- const o = Jt(e, t.cacheId);
4181
- if (!o || !e.addRelationship("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition", o)) throw new Error(`Pivot table '${r.name ?? ""}' has no cache with id ${t.cacheId}.`);
4182
- const n = e.getXMLWriter();
4183
- n.setValidationDisabled(!0), n.raw(r.xml ?? ""), n.close();
4184
- }
4185
- }(),
4186
- new class extends ct {
4187
- constructor() {
4188
- super({
4189
- kind: "comments",
4190
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
4191
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",
4192
- path: "../comments{n}.xml"
4193
- });
4194
- }
4195
- async emit(t, e) {
4196
- const r = e.getXMLWriter();
4197
- r.decl(), r.start("comments", {
4198
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
4199
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4200
- "mc:Ignorable": "xr",
4201
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
4202
- });
4203
- const o = [], n = /* @__PURE__ */ new Map(), s = (t) => {
4204
- let e = n.get(t);
4205
- return void 0 === e && (e = o.length, o.push(t), n.set(t, e)), e;
4206
- }, a = t.comments, l = [];
4207
- for (let t = 0; t < a.length; t++) {
4208
- const { comment: e, ref: r } = a[t];
4209
- e.isNote() ? l.push({
4210
- ref: r,
4211
- authorId: s(e.getAuthor()?.getDisplayName() ?? ""),
4212
- content: e.getRichContent() ?? e.getContent()
4213
- }) : l.push({
4214
- ref: r,
4215
- authorId: s(`tc={${e.getId().toUpperCase()}}`),
4216
- content: he(e)
4217
- });
4218
- }
4219
- r.start("authors");
4220
- for (let t = 0; t < o.length; t++) r.start("author"), r.text(o[t]), r.end("author");
4221
- r.end("authors"), r.start("commentList");
4222
- for (let t = 0; t < l.length; t++) {
4223
- const e = l[t];
4224
- r.start("comment", {
4225
- ref: e.ref,
4226
- authorId: e.authorId,
4227
- shapeId: 0
4228
- }), r.start("text"), ue(r, e.content), r.end("text"), r.end("comment");
4229
- }
4230
- r.end("commentList"), r.end("comments"), r.close();
4231
- }
4232
- }(),
4233
- new class extends ct {
4234
- constructor() {
4235
- super({
4236
- kind: "threadedComments",
4237
- contentType: "application/vnd.ms-excel.threadedcomments+xml",
4238
- relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
4239
- path: "../threadedComments/threadedComment{n}.xml"
4240
- });
4241
- }
4242
- async emit(t, e) {
4243
- const r = e.getXMLWriter();
4244
- r.decl(), r.start("ThreadedComments", {
4245
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4246
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4247
- });
4248
- const o = t.comments;
4249
- for (let t = 0; t < o.length; t++) {
4250
- const { comment: e, ref: n } = o[t];
4251
- if (e.isNote()) continue;
4252
- Yr(r, n, e.getId(), e.getAuthor()?.getId(), e.getCreationDate(), e.getContent(), null, e.isResolved());
4253
- const s = e.getReplies();
4254
- for (let t = 0; t < s.length; t++) {
4255
- const o = s[t];
4256
- Yr(r, n, o.getId(), o.getAuthor()?.getId(), o.getCreationDate(), o.getContent(), e.getId(), !1);
4257
- }
4258
- }
4259
- r.end("ThreadedComments"), r.close();
4260
- }
4261
- }(),
4262
- new class extends ct {
4263
- constructor() {
4264
- super({
4265
- kind: "persons",
4266
- contentType: "application/vnd.ms-excel.person+xml",
4267
- relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/person",
4268
- path: "persons/person.xml"
4269
- });
4270
- }
4271
- async emit(t, e) {
4272
- const r = e.getXMLWriter();
4273
- r.decl(), r.start("personList", {
4274
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4275
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4276
- });
4277
- const o = t.toArray();
4278
- for (let t = 0; t < o.length; t++) {
4279
- const e = o[t];
4280
- r.empty("person", {
4281
- displayName: e.getDisplayName(),
4282
- id: Zr(e.getId()),
4283
- userId: e.getUserId() ?? e.getDisplayName(),
4284
- providerId: e.getProviderId() ?? "None"
4285
- });
4286
- }
4287
- r.end("personList"), r.close();
4288
- }
4289
- }(),
4290
- new class extends ct {
4291
- constructor() {
4292
- super({
4293
- kind: "table",
4294
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
4295
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
4296
- path: "../tables/table{n}.xml"
4297
- });
4298
- }
4299
- async emit(t, e) {
4300
- const r = e.getXMLWriter();
4301
- r.decl();
4302
- const o = {
4303
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
4304
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4305
- "mc:Ignorable": "xr xr3",
4306
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
4307
- "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"
4308
- }, n = t.json, s = t.model;
4309
- s.isShowHeaders(), o.id = ++Qr, o.name = n.name?.trim(), o.displayName = n.description ?? n.name, o.ref = t.ref, 1 !== n.headerRowCount && (o.headerRowCount = n.headerRowCount), 0 !== n.totalsRowCount && (o.totalsRowCount = n.totalsRowCount), n.totalsRowShown || s.isShowTotals() || (o.totalsRowShown = "0"), r.start("table", o), s.isShowHeaders() && qe(e, r, s, n), to(e, r, s, n), ro(e, r, s, n), r.end("table"), r.close();
4310
- }
4311
- }(),
4312
- new class extends ct {
4313
- constructor() {
4314
- super({
4315
- kind: "externalLink",
4316
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml",
4317
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
4318
- path: "../externalLinks/externalLink{n}.xml"
4319
- });
4320
- }
4321
- async emit(t, e) {
4322
- const r = e.getXMLWriter(), o = t.sources ?? [];
4323
- let n = o.findIndex((t) => "book" === t.role);
4324
- n < 0 && o.length > 0 && (n = 0);
4325
- let s = null, a = null;
4326
- for (let t = 0; t < o.length; t++) {
4327
- const r = o[t], l = e.addExternal(r.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath", r.target).relId;
4328
- t === n ? s = l : "absoluteUrl" === r.role && (a = l);
4329
- }
4330
- s || e.log("External book has no path relationship; Excel cannot locate its source.", t.sheetNames), r.decl();
4331
- const l = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
4332
- (t.mceIgnorable || a) && (l["xmlns:mc"] = "http://schemas.openxmlformats.org/markup-compatibility/2006", l["mc:Ignorable"] = "x14 xxl21", l["xmlns:x14"] = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main", l["xmlns:xxl21"] = "http://schemas.microsoft.com/office/spreadsheetml/2021/extlinks2021"), r.start("externalLink", l);
4333
- const i = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
4334
- s && (i["r:id"] = s), r.start("externalBook", i), a && (r.start("xxl21:alternateUrls"), r.empty("xxl21:absoluteUrl", { "r:id": a }), r.end("xxl21:alternateUrls")), function(t, e) {
4335
- const r = e.sheetNames, o = r ? r.length : 0;
4336
- if (0 === o) return;
4337
- t.start("sheetNames");
4338
- for (let e = 0; e < o; e++) t.empty("sheetName", { val: r[e] });
4339
- t.end("sheetNames");
4340
- }(r, t), function(t, e) {
4341
- const r = e.definedNames, o = r ? r.length : 0;
4342
- if (0 === o) return;
4343
- t.start("definedNames");
4344
- for (let e = 0; e < o; e++) {
4345
- const o = r[e], n = {
4346
- name: o.name,
4347
- refersTo: o.refersTo
4348
- };
4349
- void 0 !== o.sheetIndex && (n.sheetId = "" + o.sheetIndex), t.empty("definedName", n);
4350
- }
4351
- t.end("definedNames");
4352
- }(r, t), function(t, e) {
4353
- const r = e.sheetDataSet, o = r ? r.length : 0;
4354
- if (0 === o) return;
4355
- t.start("sheetDataSet");
4356
- for (let e = 0; e < o; e++) {
4357
- const o = r[e], n = { sheetId: "" + o.sheetIndex };
4358
- o.refreshError && (n.refreshError = "1");
4359
- const s = o.data, a = s ? s.length : 0;
4360
- if (0 !== a) {
4361
- t.start("sheetData", n);
4362
- for (let e = 0; e < a; e++) {
4363
- const [r, o] = s[e];
4364
- t.start("row", { r: "" + (r + 1) });
4365
- const n = o.length;
4366
- for (let e = 0; e < n; e++) {
4367
- const [n, s] = o[e], a = s.length;
4368
- for (let e = 0; e < a; e++) so(t, r, n + e, s.at(e));
4369
- }
4370
- t.end("row");
4371
- }
4372
- t.end("sheetData");
4373
- } else t.empty("sheetData", n);
4374
- }
4375
- t.end("sheetDataSet");
4376
- }(r, t), r.end("externalBook"), r.end("externalLink"), r.close();
4377
- }
4378
- }(),
4379
- new class extends ct {
4380
- constructor() {
4381
- super({
4382
- kind: "chart",
4383
- contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
4384
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
4385
- path: "../charts/chart{n}.xml"
4386
- });
4387
- }
4388
- async emit(t, e) {
4389
- const r = e.getXMLWriter();
4390
- r.decl(), r.pushDefaultNamespace("c"), r.start("chartSpace", {
4391
- "xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
4392
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4393
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
4394
- "xmlns:c16r2": "http://schemas.microsoft.com/office/drawing/2015/06/chart"
4395
- }), r.empty("date1904", { val: "0" }), r.empty("lang", { val: "en-US" }), r.empty("roundedCorners", { val: "0" }), ao(e, r, t.model, t.json), lo(e, r, t.styles, t.model, t.json), io(e, r, t.model, t.json), r.end("chartSpace"), r.popDefaultNamespace(), r.close(), e.addPart("chartStyle", { styles: t.styles }), e.addPart("chartColors", { styles: t.styles });
4396
- }
4397
- }(),
4398
- new class extends ct {
4399
- constructor() {
4400
- super({
4401
- kind: "chartStyle",
4402
- contentType: "application/vnd.ms-office.chartstyle+xml",
4403
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartStyle",
4404
- path: "./style{n}.xml"
4405
- });
4406
- }
4407
- async emit(t, e) {
4408
- const r = e.getXMLWriter();
4409
- r.pushDefaultNamespace("cs"), r.start("chartStyle", {
4410
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
4411
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4412
- id: "297"
4413
- }), mo(e, r, jo, t.styles), r.end("chartStyle"), r.close();
4414
- }
4415
- }(),
4416
- new class extends ct {
4417
- constructor() {
4418
- super({
4419
- kind: "chartColors",
4420
- contentType: "application/vnd.ms-office.chartcolorstyle+xml",
4421
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",
4422
- path: "./colors{n}.xml"
4423
- });
4424
- }
4425
- async emit(t, e) {
4426
- const r = e.getXMLWriter();
4427
- r.pushDefaultNamespace("cs"), r.start("cs:colorStyle", {
4428
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
4429
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4430
- meth: "cycle",
4431
- id: "10"
4432
- }), r.empty("a:schemeClr", { val: "accent1" }), r.empty("a:schemeClr", { val: "accent2" }), r.empty("a:schemeClr", { val: "accent3" }), r.empty("a:schemeClr", { val: "accent4" }), r.empty("a:schemeClr", { val: "accent5" }), r.empty("a:schemeClr", { val: "accent6" }), Uo(e, r, Xo), r.end("cs:colorStyle"), r.close();
4433
- }
4434
- }()
4435
- ], qo = (t) => {
4436
- const e = t.getPart("xl/_rels/workbook.xml.rels");
4437
- if (!e) return null;
4438
- const r = /* @__PURE__ */ new Map();
4439
- for (const t of g(e.data)) {
4440
- if (!t.id) continue;
4441
- const e = t.external ? t.target : vt(t.target.startsWith("/") ? t.target : "xl/" + t.target);
4442
- r.set(t.id, {
4443
- type: t.type,
4444
- target: e,
4445
- external: t.external
4446
- });
4447
- }
4448
- return r;
4449
- }, Go = (t) => {
4450
- const e = t.getPart("xl/workbook.xml");
4451
- return e ? new TextDecoder("utf-8").decode(e.data) : null;
4452
- }, Jo = (t) => {
4453
- const e = Ko.get(t);
4454
- if (void 0 !== e) return e;
4455
- const r = t.getPart("xl/workbook.xml"), o = r ? new TextDecoder("utf-8").decode(r.data) : null;
4456
- return Ko.set(t, o), o;
4457
- }, Ko = /* @__PURE__ */ new WeakMap(), Yo = async (t, e) => {
4458
- const r = new Bt();
4459
- for (const t of Ho) r.register(t);
4460
- const o = Zo, n = dt.createUint8Array({
4461
- lastModDate: new Date(1899, 11, 29, 19, 0, 0),
4462
- level: o
4463
- }), s = "Excel" === e?.format || "ExcelMacro" === e?.format ? d(t) : null, a = /* @__PURE__ */ new Map(), l = s ? ((t) => {
4464
- const e = t.getPart("xl/workbook.xml");
4465
- if (!e) return null;
4466
- const r = new TextDecoder("utf-8").decode(e.data.subarray(0, 4096)).match(/<fileVersion\b([^>]*)\/?>/);
4467
- if (!r) return null;
4468
- const o = {};
4469
- for (const t of r[1].matchAll(/([\w:]+)="([^"]*)"/g)) o[t[1]] = t[2];
4470
- return Object.keys(o).length > 0 ? o : null;
4471
- })(s) : null;
4472
- l && (e?.macroEnabled || delete l.codeName, a.set(Yt, l));
4473
- const i = s ? ((t) => {
4474
- const e = Jo(t)?.match(/<calcPr\b[^>]*?\bcalcId="([^"]*)"/);
4475
- return e ? e[1] : null;
4476
- })(s) : null;
4477
- null !== i && a.set("calcId", i);
4478
- const c = s ? ((t) => {
4479
- const e = Jo(t)?.match(/<ext\b[^>]*>\s*<xcalcf:calcFeatures\b[\s\S]*?<\/xcalcf:calcFeatures>\s*<\/ext>/);
4480
- return e ? e[0] : null;
4481
- })(s) : null;
4482
- null !== c && a.set("calcFeatures", c);
4483
- const m = s ? ((t) => {
4484
- const e = Go(t);
4485
- if (!e) return null;
4486
- const r = /<externalReferences\b[^>]*>([\s\S]*?)<\/externalReferences>/.exec(e);
4487
- if (!r) return null;
4488
- const o = [...r[1].matchAll(/<externalReference\b[^>]*\sr:id="([^"]*)"/g)].map((t) => t[1]);
4489
- if (0 === o.length) return null;
4490
- const n = qo(t);
4491
- return n ? o.map((t) => {
4492
- const e = n.get(t);
4493
- return e && !e.external ? e.target : null;
4494
- }) : null;
4495
- })(s) : null;
4496
- m && a.set(Qt, m);
4497
- const p = s ? ((t) => {
4498
- const e = Go(t), r = e ? qo(t) : null;
4499
- if (!e || !r) return null;
4500
- const o = /* @__PURE__ */ new Map();
4501
- for (const t of e.matchAll(/<sheet\b([^>]*)\/?>/g)) {
4502
- const e = /\bsheetId="(\d+)"/.exec(t[1])?.[1], n = /\br:id="([^"]*)"/.exec(t[1])?.[1];
4503
- if (!e || !n) continue;
4504
- const s = r.get(n);
4505
- s && !s.external && "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" === s.type && o.set(parseInt(e, 10), s.target);
4506
- }
4507
- return o.size > 0 ? o : null;
4508
- })(s) : null;
4509
- p && a.set(Zt, p), a.set(it, /* @__PURE__ */ new Map());
4510
- const f = [], h = new Dt(n, r, {
4511
- strictDuplicateChildren: !0,
4512
- onPartEmitted: e?.onPartEmitted,
4513
- onWarning: (t, e, r) => {
4514
- f.push([
4515
- t,
4516
- e,
4517
- r
4518
- ]);
4519
- },
4520
- mapState: a,
4521
- sourcePackage: s,
4522
- macroEnabled: e?.macroEnabled ?? !1
4523
- });
4524
- h.addPart("workbook", t, "/xl/workbook.xml"), await h.waitEmit(), h.addPart("propsCore", {}), h.addPart("propsApp", { model: t });
4525
- const u = await h.build(), g = e?.progress?.onWarning;
4526
- if (f.length && g) {
4527
- const t = /* @__PURE__ */ new Set();
4528
- for (const [r, o, n] of f) {
4529
- const s = n ?? r;
4530
- t.has(s) || (t.add(s), g.call(e.progress, r, o));
4531
- }
4532
- }
4533
- return 0 === u.byteOffset && u.byteLength === u.buffer.byteLength ? u.buffer : u.slice().buffer;
4534
- }, Zo = 1;
4535
- export { Yo as writeXLSX };