@sheetxl/io-xlsx 0.8.0-beta.1 → 0.8.0-beta.10

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 (126) hide show
  1. package/browser/esm/{Ctqql4O-3xj2K8vv.mjs → 2EOdn2WRK5y1L58S.mjs} +193 -143
  2. package/browser/esm/{BkNXyG6NC-w5Xo92.mjs → B-jb5SuiVh5NnBG_.mjs} +28 -13
  3. package/browser/esm/BKT8OBj-bhQwdg49.mjs +67 -0
  4. package/browser/esm/BLXcoiDAaOMjFuhw.mjs +8056 -0
  5. package/browser/esm/BPmehfSqdvgsLBsB.mjs +5153 -0
  6. package/browser/esm/CI_CZI5m5-KkiAK5.mjs +3559 -0
  7. package/browser/esm/{Dz1Dp8DDJvhd09RR.mjs → DXopGe8PrLWmwGaV.mjs} +1 -1
  8. package/browser/esm/NQIuOQIleHC4NUW6.mjs +2446 -0
  9. package/browser/esm/index.mjs +2 -3
  10. package/browser/esm/{CLWzJJyoSrykkVLX.mjs → xc_LzCPgHn-acgFZ.mjs} +2 -2
  11. package/licenses/dependencies.txt +2 -2
  12. package/node/esm/{fOnuUjpPCAzmuIXN.mjs → BmdmvgO5Zdgx-RWo.mjs} +2 -2
  13. package/node/esm/BpxxiZ2oKPkUSfdB.mjs +2486 -0
  14. package/node/esm/{CEV7nKotMpeRRnQC.mjs → CHqRP_NjPpPd7m9L.mjs} +1 -1
  15. package/node/esm/CtAF486aZqYzMeLM.mjs +3651 -0
  16. package/node/esm/{CEAmv36xpTNgFwl_.mjs → O5mti2R9drFOlXc7.mjs} +49 -35
  17. package/node/esm/QS_theNoeqNGLStj.mjs +5298 -0
  18. package/node/esm/index.mjs +40 -25
  19. package/node/esm/nNQ7MG89sGKwkjMA.mjs +4649 -0
  20. package/package.json +7 -8
  21. package/types/src/AutoFilterRules.d.ts +86 -10
  22. package/types/src/ConditionalFormatRules.d.ts +5 -5
  23. package/types/src/DataValidationRules.d.ts +18 -2
  24. package/types/src/ExcelCalcStamp.d.ts +39 -0
  25. package/types/src/ExcelCompat.d.ts +197 -42
  26. package/types/src/ExcelReservedNames.d.ts +3 -4
  27. package/types/src/LegacyFormula.d.ts +28 -7
  28. package/types/src/OOXMLExtensions.d.ts +14 -2
  29. package/types/src/Plugin.d.ts +16 -5
  30. package/types/src/ProtectionAttributes.d.ts +38 -0
  31. package/types/src/SourcePackage.d.ts +31 -12
  32. package/types/src/Types.d.ts +17 -0
  33. package/types/src/reader/HiddenFormulas.d.ts +16 -0
  34. package/types/src/reader/SlicerJoin.d.ts +24 -0
  35. package/types/src/reader/Warning.d.ts +29 -0
  36. package/types/src/reader/ZipReader.d.ts +1 -1
  37. package/types/src/reader/_SlicerRecord.d.ts +37 -0
  38. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  39. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  40. package/types/src/reader/dom/ExecutionContext.d.ts +16 -3
  41. package/types/src/reader/dom/Types.d.ts +19 -3
  42. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +13 -0
  43. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  44. package/types/src/reader/domVisitors/CommentVisitor.d.ts +24 -2
  45. package/types/src/reader/domVisitors/CommentsVisitor.d.ts +2 -2
  46. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  47. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +32 -1
  48. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  49. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  50. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +13 -0
  51. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  52. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  53. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +21 -3
  54. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +4 -4
  55. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  56. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  57. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  58. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +19 -6
  59. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +7 -2
  60. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -3
  61. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  62. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +18 -1
  63. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  64. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +11 -1
  65. package/types/src/reader/domVisitors/index.d.ts +4 -2
  66. package/types/src/reader/sax/LeanSaxParser.d.ts +58 -0
  67. package/types/src/reader/sax/SaxParser.d.ts +11 -1
  68. package/types/src/reader/sax/SaxVisitor.d.ts +3 -2
  69. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +9 -0
  70. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +11 -4
  71. package/types/src/utils/DrawingMLText.d.ts +39 -0
  72. package/types/src/utils/FormControls.d.ts +170 -0
  73. package/types/src/utils/VmlNoteShapes.d.ts +135 -0
  74. package/types/src/vba/VBAProject.d.ts +52 -4
  75. package/types/src/writer/builder/ContentTypes.d.ts +13 -0
  76. package/types/src/writer/builder/Emitter.d.ts +11 -6
  77. package/types/src/writer/builder/OpcXmlUtils.d.ts +2 -0
  78. package/types/src/writer/builder/PackageBuilder.d.ts +72 -22
  79. package/types/src/writer/builder/PartWriter.d.ts +5 -0
  80. package/types/src/writer/builder/RelationshipSet.d.ts +3 -0
  81. package/types/src/writer/builder/Types.d.ts +117 -38
  82. package/types/src/writer/builder/_Types.d.ts +17 -0
  83. package/types/src/writer/emitters/CommentsEmitter.d.ts +58 -0
  84. package/types/src/writer/emitters/EmbeddedPartEmitter.d.ts +60 -0
  85. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +19 -0
  86. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +18 -0
  87. package/types/src/writer/emitters/PersonsEmitter.d.ts +17 -0
  88. package/types/src/writer/emitters/PivotTableEmitter.d.ts +45 -0
  89. package/types/src/writer/emitters/SlicerEmitter.d.ts +66 -0
  90. package/types/src/writer/emitters/StylesEmitter.d.ts +2 -2
  91. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  92. package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +27 -0
  93. package/types/src/writer/emitters/WorkbookEmitter.d.ts +16 -3
  94. package/types/src/writer/utils/AutoFilter.d.ts +2 -2
  95. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  96. package/types/src/writer/utils/DrawMLUtils.d.ts +57 -3
  97. package/types/src/writer/utils/DummyFunction.d.ts +0 -2
  98. package/types/src/writer/utils/DxfCollector.d.ts +3 -3
  99. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +28 -0
  100. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  101. package/types/src/writer/utils/TextUtils.d.ts +21 -2
  102. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  103. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  104. package/browser/cjs/BAtEL-5TLyoaPFDP.cjs +0 -2
  105. package/browser/cjs/Bg0e53JZa8vhmm5a.cjs +0 -1
  106. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  107. package/browser/cjs/CK5FFUvet6FnIYO_.cjs +0 -5
  108. package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +0 -2
  109. package/browser/cjs/DV6LeTEiiFUrZoxj.cjs +0 -1
  110. package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +0 -1
  111. package/browser/cjs/Db8YjGM6TG34c8aT.cjs +0 -1
  112. package/browser/cjs/index.cjs +0 -1
  113. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  114. package/browser/esm/4BWLu134ABlCQEtM.mjs +0 -3655
  115. package/browser/esm/BzQ_lPzc8C4OTIGZ.mjs +0 -99
  116. package/browser/esm/CJknI8BYGSZr-4zS.mjs +0 -52
  117. package/browser/esm/Cok_fBIUCHDSrKw0.mjs +0 -2211
  118. package/browser/esm/D-m_kQLaewdwuXaF.mjs +0 -2685
  119. package/browser/esm/Dj7D2nVdAZ3TiUks.mjs +0 -4743
  120. package/browser/esm/ijQzHH-bvDfUHIi1.mjs +0 -24
  121. package/node/esm/CF1R5ovFsRNu--Rw.mjs +0 -3744
  122. package/node/esm/Ctcl4jN52INWpKWC.mjs +0 -2255
  123. package/node/esm/CvnRSooxEQdlJgMn.mjs +0 -2766
  124. package/node/esm/DQd0vxzTaPt2qSL-.mjs +0 -108
  125. package/node/esm/ssSlRCbCqxvZ9IX8.mjs +0 -2481
  126. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
@@ -1,3744 +0,0 @@
1
- /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.1
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 e, D as r, E as o, F as n, I as s, M as a, O as l, _ as i, a as c, b as d, f as p, g as m, h as f, i as u, k as h, l as g, n as y, s as x, u as v, w as S, z as w } from "./ssSlRCbCqxvZ9IX8.mjs";
9
- import { AddressUtils as b, BufferUtils as C, Color as T, CommonUtils as k, CoordUtils as M, FormulaError as R, IColor as I, ICondition as F, IConditionalFormat as A, IEffect as P, IFill as L, ISheet as _, IStroke as D, IStyle as E, ITextFrame as N, LicenseManager as O, NumberFormat as B, ScalarType as V } from "@sheetxl/sdk";
10
- import { BlobWriter as $, TextReader as W, Uint8ArrayReader as z, Uint8ArrayWriter as j, ZipWriter as X } from "@zip.js/zip.js";
11
- var U = class {
12
- constructor(t) {
13
- this._kind = t.kind, this._contentType = t.contentType, this._relTypeUri = t.relTypeUri, this._path = t.path;
14
- }
15
- get kind() {
16
- return this._kind;
17
- }
18
- get contentType() {
19
- return this._contentType;
20
- }
21
- get relTypeUri() {
22
- return this._relTypeUri;
23
- }
24
- getPath(t) {
25
- return "function" == typeof this._path ? this._path(t) : this._path;
26
- }
27
- }, H = 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 X(new j(), e);
33
- return new t(r, "uint8array");
34
- }
35
- static createBlob(e) {
36
- const r = new X(new $("application/zip"), e);
37
- return new t(r, "blob");
38
- }
39
- static createWritableStream(e, r) {
40
- const o = new X(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 W(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 z(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 q(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 = [], p = !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
- p && 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 (p) {
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}`), p) {
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
- p = !t;
153
- }
154
- };
155
- }
156
- function G(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 = q({ 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 J(t) {
176
- const e = K(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 K(t) {
182
- let e = (t ?? "").replace(/\\/g, "/").trim();
183
- for (; e.startsWith("/");) e = e.slice(1);
184
- return e;
185
- }
186
- function Y(t) {
187
- const e = /^rId(\d+)$/.exec(t);
188
- return e ? parseInt(e[1], 10) : Number.MAX_SAFE_INTEGER;
189
- }
190
- function Z(t) {
191
- return String(t).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/>/g, "&gt;");
192
- }
193
- function Q(t, e, r, o = !1) {
194
- let n = e;
195
- if (e.startsWith("/")) n = e.slice(1);
196
- else {
197
- 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").`);
198
- n = (t.includes("/") ? t.slice(0, t.lastIndexOf("/") + 1) : "") + e;
199
- }
200
- if (n = tt(n), !n.includes("{n}")) {
201
- if (!o && r.has(n)) throw new Error(`Path already existing path: ${n}`);
202
- return n;
203
- }
204
- let s, a = 1;
205
- do
206
- 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.`);
207
- while (r.has(s));
208
- return s;
209
- }
210
- function tt(t) {
211
- const e = t.split("/"), r = [];
212
- for (const o of e) {
213
- if ("" === o || "." === o) continue;
214
- if (".." === o) {
215
- if (0 === r.length) throw new Error(`Invalid path: too many ".." segments in "${t}"`);
216
- r.pop();
217
- } else r.push(o);
218
- }
219
- return r.join("/");
220
- }
221
- function et(t, e) {
222
- if (!t) return e;
223
- const r = t.includes("/") ? t.slice(0, t.lastIndexOf("/")) : "", o = r ? r.split("/") : [], n = e.split("/");
224
- let s = 0;
225
- const a = Math.min(o.length, n.length - 1);
226
- for (let t = 0; t < a && o[t] === n[t]; t++) s++;
227
- const l = o.length - s;
228
- return "../".repeat(l) + n.slice(s).join("/");
229
- }
230
- function rt(t) {
231
- return new TextEncoder().encode(t);
232
- }
233
- function ot(t, e) {
234
- return function(t, e = " ") {
235
- let r = "", o = 0;
236
- const n = t.split(/(<[^>]+>)/g).filter(Boolean);
237
- for (let t = 0; t < n.length; t++) {
238
- const s = n[t];
239
- if (s.trim()) if (s.startsWith("<?")) r += s + "\n";
240
- 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";
241
- else if (s.startsWith("<")) {
242
- const t = s.endsWith("/>");
243
- r += e.repeat(o) + s + "\n", t || o++;
244
- } else r += e.repeat(o) + s.trim() + "\n";
245
- }
246
- return r;
247
- }(function(t) {
248
- return new TextDecoder("utf-8").decode(t);
249
- }(t), e);
250
- }
251
- var nt = /&(amp|lt|gt|quot|apos|#x[0-9a-fA-F]+|#[0-9]+);/g;
252
- function st(t, e) {
253
- switch (e) {
254
- case "amp": return "&";
255
- case "lt": return "<";
256
- case "gt": return ">";
257
- case "quot": return "\"";
258
- case "apos": return "'";
259
- default: return e.startsWith("#x") ? String.fromCodePoint(parseInt(e.slice(2), 16)) : e.startsWith("#") ? String.fromCodePoint(parseInt(e.slice(1), 10)) : t;
260
- }
261
- }
262
- function at(t) {
263
- return t.replace(nt, st);
264
- }
265
- function lt(t) {
266
- const e = {}, r = /([A-Za-z_:][-A-Za-z0-9_:.]*)\s*=\s*"([^"]*)"/g;
267
- let o;
268
- for (; o = r.exec(t);) e[o[1]] = at(o[2]);
269
- return e;
270
- }
271
- function it(t, e) {
272
- const r = [], o = new RegExp(`<${e}\\b([^>]*)/?>`, "g");
273
- let n;
274
- for (; n = o.exec(t);) r.push(lt(n[1]));
275
- return r;
276
- }
277
- function ct(t) {
278
- return it(new TextDecoder("utf-8").decode(t), "Relationship").filter((t) => t.Type && t.Target).map((t) => ({
279
- type: t.Type,
280
- target: t.Target,
281
- external: "External" === t.TargetMode
282
- }));
283
- }
284
- var dt = class {
285
- constructor(t) {
286
- this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = K(t);
287
- }
288
- add(t, e, r) {
289
- let o = r?.idHint && !this.usedIds.has(r.idHint) ? r.idHint : void 0;
290
- if (!o) do
291
- o = "rId" + this.nextId++;
292
- while (this.usedIds.has(o));
293
- const n = /^rId(\d+)$/.exec(o);
294
- return n && (this.nextId = Math.max(this.nextId, parseInt(n[1], 10) + 1)), this.usedIds.add(o), this.rels.push({
295
- id: o,
296
- type: t,
297
- target: e,
298
- targetMode: r?.external ? "External" : void 0
299
- }), o;
300
- }
301
- list() {
302
- return this.rels;
303
- }
304
- toXmlBytes() {
305
- const t = [...this.rels].sort((t, e) => Y(e.id) - Y(t.id) || t.id.localeCompare(e.id)), e = [];
306
- e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Relationships xmlns="${pt}">`);
307
- for (const r of t) {
308
- const t = [
309
- `Id="${Z(r.id)}"`,
310
- `Type="${Z(r.type)}"`,
311
- `Target="${Z(r.target)}"`
312
- ];
313
- "External" === r.targetMode && t.push("TargetMode=\"External\""), e.push(`<Relationship ${t.join(" ")}/>`);
314
- }
315
- return e.push("</Relationships>"), rt(e.join(""));
316
- }
317
- }, pt = "http://schemas.openxmlformats.org/package/2006/relationships", mt = class {
318
- constructor() {
319
- this._defaultsSet = /* @__PURE__ */ new Set(), this._overridesSet = /* @__PURE__ */ new Set(), this._defaults = [], this._overrides = [];
320
- }
321
- addDefault(t, e) {
322
- const r = function(t) {
323
- let e = (t ?? "").trim().toLowerCase();
324
- return e.startsWith(".") && (e = e.slice(1)), e;
325
- }(t);
326
- this._defaultsSet.has(r) || (this._defaultsSet.add(r), this._defaults.push({
327
- key: r,
328
- content: e
329
- }));
330
- }
331
- addOverride(t, e) {
332
- const r = function(t) {
333
- let e = (t ?? "").replace(/\\/g, "/").trim();
334
- return e.startsWith("/") || (e = "/" + e), e;
335
- }(t);
336
- this._overridesSet.has(r) || (this._overridesSet.add(r), this._overrides.push({
337
- key: r,
338
- content: e
339
- }));
340
- }
341
- toXmlBytes() {
342
- const t = [];
343
- t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Types xmlns="${ft}">`);
344
- const e = this._defaults.reverse();
345
- this.addDefault("rels", "application/vnd.openxmlformats-package.relationships+xml"), this.addDefault("xml", "application/xml");
346
- for (const { key: r, content: o } of e) t.push(`<Default Extension="${Z(r)}" ContentType="${Z(o)}"/>`);
347
- const r = this._overrides;
348
- for (const { key: e, content: o } of r) t.push(`<Override PartName="${Z(e)}" ContentType="${Z(o)}"/>`);
349
- return t.push("</Types>"), rt(t.join(""));
350
- }
351
- }, ft = "http://schemas.openxmlformats.org/package/2006/content-types", ut = class {
352
- constructor(t) {
353
- this.parts = [], this.relsRoot = new dt(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new mt(), this.zip = t;
354
- }
355
- addContentType(t, e) {
356
- const r = K(t);
357
- this.contentTypes.addOverride("/" + r, e);
358
- }
359
- addDefaultType(t, e) {
360
- this.contentTypes.addDefault(t, e);
361
- }
362
- addPart(t, e, r, o) {
363
- const n = K(t);
364
- this.parts.push({
365
- path: n,
366
- body: e,
367
- optionsZip: o
368
- }), r && this.contentTypes.addOverride("/" + n, r);
369
- }
370
- rels(t) {
371
- const e = K(t || "");
372
- if (!e) return this.relsRoot;
373
- let r = this.relsByPart.get(e);
374
- return r || (r = new dt(e), this.relsByPart.set(e, r)), r;
375
- }
376
- async emit() {
377
- const t = [...this.parts].sort((t, e) => t.path.localeCompare(e.path));
378
- for (const e of t) {
379
- const t = G(e.body);
380
- await this.zip.add(e.path, t, e.optionsZip);
381
- }
382
- const e = this.relsRoot.toXmlBytes();
383
- await this.zip.add("_rels/.rels", e, {});
384
- const r = [...this.relsByPart.values()].sort((t, e) => t.sourcePart.localeCompare(e.sourcePart));
385
- for (const t of r) {
386
- const e = J(t.sourcePart), r = t.toXmlBytes();
387
- await this.zip.add(e, r, {});
388
- }
389
- const o = this.contentTypes.toXmlBytes();
390
- await this.zip.add("[Content_Types].xml", o, {});
391
- }
392
- async build(t) {
393
- return await this.emit(), await this.zip.close(t);
394
- }
395
- }, ht = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), gt = [
396
- /^xl\/drawings\/vmlDrawing\d+\.vml$/i,
397
- /^xl\/ctrlProps\//i,
398
- /^xl\/slicers\//i,
399
- /^xl\/slicerCaches\//i,
400
- /^xl\/pivotCache\//i,
401
- /^xl\/pivotTables\//i
402
- ];
403
- function yt(t) {
404
- return gt.some((e) => e.test(t));
405
- }
406
- function xt(t) {
407
- return "[Content_Types].xml" === t || vt.test(t);
408
- }
409
- var vt = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
410
- function St(t) {
411
- if ("_rels/.rels" === t) return "";
412
- const e = vt.exec(t);
413
- if (!e) return null;
414
- const r = e[1] ?? "", o = e[2];
415
- return r ? `${r}/${o}` : o;
416
- }
417
- var wt = class {
418
- constructor(t, e, r) {
419
- 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 ut(t), this._registry = e, this._options = r ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null;
420
- }
421
- async waitEmit() {
422
- const t = this._queue;
423
- for (; t.length;) {
424
- const e = t.shift();
425
- await this._processPart(e);
426
- }
427
- }
428
- async build(t) {
429
- return await this.waitEmit(), this._passthroughSourceParts(), await this._partWriter.build(t ?? {});
430
- }
431
- _passthroughSourceParts() {
432
- const t = this._sourcePackage;
433
- if (!t) return;
434
- const e = new Set(this._writtenPaths), r = t.hasStructuralChange(), o = [];
435
- for (const n of t.getNames()) e.has(n) || ht.has(n) || xt(n) || r && yt(n) || o.push(n);
436
- const n = new Set(e);
437
- for (const t of o) n.add(t);
438
- const s = t.getPart("[Content_Types].xml"), a = s ? function(t) {
439
- const e = new TextDecoder("utf-8").decode(t), r = it(e, "Default").map((t) => ({
440
- ext: (t.Extension ?? "").toLowerCase(),
441
- contentType: t.ContentType ?? ""
442
- })).filter((t) => t.ext && t.contentType), o = /* @__PURE__ */ new Map();
443
- for (const t of it(e, "Override")) t.PartName && t.ContentType && o.set(t.PartName, t.ContentType);
444
- return {
445
- defaults: r,
446
- overrides: o
447
- };
448
- }(s.data) : null;
449
- if (a) for (const { ext: t, contentType: e } of a.defaults) this._partWriter.addDefaultType(t, e);
450
- for (const e of o) {
451
- const r = t.getPart(e), o = a?.overrides.get("/" + e);
452
- r.raw ? this._partWriter.addPart(e, {
453
- kind: "bytes",
454
- bytes: r.raw.compressedData
455
- }, o, {
456
- passThrough: !0,
457
- compressionMethod: r.raw.compressionMethod,
458
- signature: r.raw.signature,
459
- uncompressedSize: r.uncompressedSize
460
- }) : this._partWriter.addPart(e, {
461
- kind: "bytes",
462
- bytes: r.data
463
- }, o), this._writtenPaths.add(e);
464
- }
465
- for (const r of t.getNames()) {
466
- if ("[Content_Types].xml" === r || !xt(r)) continue;
467
- const o = St(r);
468
- null !== o && ("" === o || n.has(o)) && this._mergeSourceRelsInto(o, t.getPart(r).data, e, n);
469
- }
470
- }
471
- _mergeSourceRelsInto(t, e, r, o) {
472
- const n = this._partWriter.rels(t), s = t.includes("/") ? t.slice(0, t.lastIndexOf("/")) : "";
473
- for (const a of ct(e)) {
474
- if (a.external) {
475
- n.add(a.type, a.target, { external: !0 });
476
- continue;
477
- }
478
- const e = tt((s ? s + "/" : "") + a.target);
479
- r.has(e) || this._explicitRelTargets.has(`${t}::${e}`) || (o.has(e) ? n.add(a.type, a.target) : this._registry.ownsRelType(a.type) || console.warn(`Dropping preserved relationship to missing part '${e}'`, t || "(root)"));
480
- }
481
- }
482
- addPart(t, e, r) {
483
- return this._addPartInternal("", t, e, r);
484
- }
485
- _addPartInternal(t, e, r, o) {
486
- const n = this._registry.get(e);
487
- if (!n) throw new Error(`No emitter registered for kind '${e}'.`);
488
- const s = o ?? n.getPath?.(r);
489
- if (!s) throw new Error("No path provided in either argument or emitter.");
490
- const a = this._writtenPaths, l = Q(t, s, a), i = `${e}:${l}`;
491
- let c = this._scheduledByNodeKey.get(i);
492
- if (!c) {
493
- let t;
494
- const o = new Promise((e) => {
495
- t = e;
496
- });
497
- c = {
498
- kind: e,
499
- key: i,
500
- payload: r,
501
- path: l,
502
- contentType: n.contentType,
503
- promise: o,
504
- resolve: t
505
- }, this._scheduledByNodeKey.set(i, c), this._queue.push(c);
506
- }
507
- let d = this._nodesByPath.get(t);
508
- d || (d = /* @__PURE__ */ new Set(), this._nodesByPath.set(t, d)), d.add(i), !n.contentType || n.relTypeUri || t || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", l);
509
- let p = null;
510
- if (n.relTypeUri) {
511
- const e = et(t, c.path);
512
- p = this._partWriter.rels(t).add(n.relTypeUri, e);
513
- }
514
- return a.add(l), {
515
- path: l,
516
- contentTypeUri: n.contentType,
517
- relId: p
518
- };
519
- }
520
- addBinary(t, e, r, o, n = !1) {
521
- return this._addBinaryInternal("", t, e, r, o, n);
522
- }
523
- _addBinaryInternal(t, e, r, o, n, s = !1) {
524
- if (!n) throw new Error("No path provided for binary.");
525
- if (!r) throw new Error("No content type provided for binary.");
526
- const a = this._writtenPaths, l = Q(t, n, a, s);
527
- let i = null;
528
- if (o) {
529
- const e = et(t, l);
530
- i = this._partWriter.rels(t).add(o, e);
531
- }
532
- if (t || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", l), !a.has(l)) {
533
- const t = l.split(".").pop() || "";
534
- t && this._partWriter.addDefaultType(t, r), this._partWriter.addPart(l, {
535
- kind: "bytes",
536
- bytes: e
537
- }, void 0, {
538
- level: 0,
539
- uncompressedSize: e.byteLength,
540
- dataDescriptor: !1
541
- }), a.add(l);
542
- }
543
- return {
544
- path: l,
545
- contentTypeUri: r,
546
- relId: i
547
- };
548
- }
549
- _forkPreservedPart(t, e, r, o, n) {
550
- const s = this._sourcePackage;
551
- if (!s) return null;
552
- const a = s.getPart(e);
553
- if (!a) return null;
554
- const l = new Set(this._writtenPaths);
555
- for (const t of s.getNames()) l.add(t);
556
- const i = Q(t, n, l), c = this._addBinaryInternal(t, a.data, r, o, "/" + i), d = s.getPart(J(e));
557
- if (d) {
558
- const t = this._partWriter.rels(c.path);
559
- for (const e of ct(d.data)) t.add(e.type, e.target, e.external ? { external: !0 } : void 0);
560
- }
561
- return c;
562
- }
563
- async _waitForDescendants(t) {
564
- const e = this._nodesByPath.get(t);
565
- if (!e || 0 === e.size) return;
566
- const r = [];
567
- for (const t of e) {
568
- const e = this._scheduledByNodeKey.get(t);
569
- if (e) {
570
- const t = this._processPart(e);
571
- r.push(t);
572
- }
573
- }
574
- await Promise.all(r);
575
- }
576
- async _processPart(t) {
577
- if (t.processed) return t.promise;
578
- t.processed = !0;
579
- const e = this._registry.get(t.kind), r = t.path;
580
- this._partWriter.addContentType(t.path, t.contentType);
581
- try {
582
- const o = [], n = { write: (t) => {
583
- o.push(t);
584
- } };
585
- let s;
586
- await e.emit(t.payload, {
587
- getXMLWriter: () => s || (s = q(n), s),
588
- addPart: (t, e, o) => this._addPartInternal(r, t, e, o),
589
- addBinary: (t, e, o, n, s = !1) => this._addBinaryInternal(r, t, e, o, n, s),
590
- addExternal: (t, e) => ({
591
- path: e,
592
- contentTypeUri: null,
593
- relId: this._partWriter.rels(r).add(t, e, { external: !0 })
594
- }),
595
- addPreservedRelationship: (t, e, o) => {
596
- const n = et(r, e), s = this._partWriter.rels(r).add(t, n, { idHint: o });
597
- return this._explicitRelTargets.add(`${r}::${e}`), s;
598
- },
599
- forkPreservedPart: (t, e, o, n) => this._forkPreservedPart(r, t, e, o, n),
600
- waitEmit: () => this._waitForDescendants(t.path),
601
- getPath: () => t.path,
602
- getSharedStates: () => this._mapState,
603
- warn: (t, e) => {
604
- console.warn(t, e);
605
- }
606
- });
607
- const a = function(t) {
608
- let e = 0;
609
- for (const r of t) e += r.byteLength;
610
- const r = new Uint8Array(e);
611
- let o = 0;
612
- for (const e of t) r.set(e, o), o += e.byteLength;
613
- return r;
614
- }(o), l = this._options.onPartEmitted;
615
- l && await l(t.kind, t.path, a), bt && (console.log(`\n=== ${t.path} ===`), console.log(ot(a))), this._partWriter.addPart(t.path, {
616
- kind: "bytes",
617
- bytes: a
618
- }, t.contentType);
619
- } catch (e) {
620
- throw this._options.onPartError?.(t.kind, t.path, e), e;
621
- } finally {
622
- this._nodesByPath.delete(t.path), this._scheduledByNodeKey.delete(t.key), t.resolve();
623
- }
624
- }
625
- }, bt = !1, Ct = class {
626
- constructor() {
627
- this.map = /* @__PURE__ */ new Map();
628
- }
629
- register(t) {
630
- if (this.map.has(t.kind)) throw new Error(`Duplicate part kind: ${t.kind}`);
631
- this.map.set(t.kind, t);
632
- }
633
- get(t) {
634
- const e = this.map.get(t);
635
- if (!e) throw new Error(`Unknown part kind: ${t}`);
636
- return e;
637
- }
638
- has(t) {
639
- return this.map.has(t);
640
- }
641
- ownsRelType(t) {
642
- for (const e of this.map.values()) if (e.relTypeUri === t) return !0;
643
- return !1;
644
- }
645
- };
646
- function Tt(t, e, r) {
647
- 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));
648
- }
649
- var kt = class {
650
- constructor() {
651
- this._daprFMBks = [], this._daprFMBkMap = /* @__PURE__ */ new Map(), this._rvFMBks = [], this._rvFMBkMap = /* @__PURE__ */ new Map(), this._valueMeta = [];
652
- }
653
- registerArrayCell(t) {
654
- const e = t ? 1 : 0, r = `1,${e}`;
655
- let o = this._daprFMBkMap.get(r);
656
- return void 0 === o && (o = this._daprFMBks.length, this._daprFMBks.push({
657
- fDynamic: 1,
658
- fCollapsed: e
659
- }), this._daprFMBkMap.set(r, o)), o + 1;
660
- }
661
- registerRichValueCell(t) {
662
- let e = this._rvFMBkMap.get(t);
663
- void 0 === e && (e = this._rvFMBks.length, this._rvFMBks.push(t), this._rvFMBkMap.set(t, e));
664
- const r = this._valueMeta.length;
665
- return this._valueMeta.push(e), r + 1;
666
- }
667
- hasCellMeta() {
668
- return this._daprFMBks.length > 0;
669
- }
670
- hasValueMeta() {
671
- return this._valueMeta.length > 0;
672
- }
673
- hasAny() {
674
- return this.hasCellMeta() || this.hasValueMeta();
675
- }
676
- getDAPRFutureMetadataBlocks() {
677
- return this._daprFMBks;
678
- }
679
- getRVFutureMetadataBlocks() {
680
- return this._rvFMBks;
681
- }
682
- getValueMeta() {
683
- return this._valueMeta;
684
- }
685
- }, Mt = class {
686
- constructor(t, e = console.warn) {
687
- this._entries = [], this._keyMap = /* @__PURE__ */ new Map(), this._metaCollector = t, this._onWarn = e;
688
- }
689
- add(t) {
690
- if (null == t) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
691
- if (R.isError(t)) {
692
- const e = t.getCode(), r = this._register(`_error:${e}`, { errorType: "" + (e - 1) }, Rt);
693
- return this._metaCollector.registerRichValueCell(r);
694
- }
695
- return t.isIRichData && t.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", t), this._registerFallback();
696
- }
697
- _registerFallback() {
698
- const t = this._register("_error:fallback", { errorType: R.Code.Unknown - 1 }, Rt);
699
- return this._metaCollector.registerRichValueCell(t);
700
- }
701
- _register(t, e, r) {
702
- let o = this._keyMap.get(t);
703
- return void 0 === o && (o = this._entries.length, this._entries.push({
704
- handler: r,
705
- rawValue: e
706
- }), this._keyMap.set(t, o)), o;
707
- }
708
- getCount() {
709
- return this._entries.length;
710
- }
711
- hasAny() {
712
- return this._entries.length > 0;
713
- }
714
- getEntries() {
715
- return this._entries;
716
- }
717
- uniqueHandlers() {
718
- const t = /* @__PURE__ */ new Set(), e = [];
719
- for (const r of this._entries) t.has(r.handler) || (t.add(r.handler), e.push(r.handler));
720
- return e;
721
- }
722
- handlerStructureIndex(t) {
723
- let e = 0;
724
- const r = /* @__PURE__ */ new Set();
725
- for (const o of this._entries) if (!r.has(o.handler)) {
726
- if (o.handler === t) return e;
727
- r.add(o.handler), e++;
728
- }
729
- return -1;
730
- }
731
- }, Rt = new class {
732
- constructor(t, e) {
733
- this.type = t, this.props = e;
734
- }
735
- getValues(t) {
736
- return this.props.map(([e, , r = ""]) => {
737
- const o = t?.[e];
738
- return null != o ? "" + o : r;
739
- });
740
- }
741
- }("_error", [[
742
- "errorType",
743
- "i",
744
- ""
745
- ], [
746
- "subType",
747
- "i",
748
- "0"
749
- ]]);
750
- var It = {
751
- auto: "auto",
752
- automaticExceptTables: "autoNoTable",
753
- manual: "manual"
754
- };
755
- function Ft(t, e, r, o) {
756
- if (!r) return;
757
- const n = "string" == typeof r ? e.parseColor(r) : r;
758
- o && t.start(o);
759
- const s = n.getType(), a = n.getVal(), l = n.getAdjustments(), i = l && l.length > 0;
760
- switch (s) {
761
- case "scheme":
762
- i ? (t.start("schemeClr", { val: a }), At(t, l), t.end("schemeClr")) : t.empty("schemeClr", { val: a });
763
- break;
764
- case "named":
765
- if (T.isSystem(a)) {
766
- const e = n.getLastColor() ?? n.getBaseColor().toHex().toString(!1).replace("#", "");
767
- i ? (t.start("sysClr", {
768
- val: a,
769
- lastClr: e
770
- }), At(t, l), t.end("sysClr")) : t.empty("sysClr", {
771
- val: a,
772
- lastClr: e
773
- });
774
- } else i ? (t.start("prstClr", { val: a }), At(t, l), t.end("prstClr")) : t.empty("prstClr", { val: a });
775
- break;
776
- case "auto": {
777
- const e = n.getLastColor() ?? n.getBaseColor().toHex().toString(!1).replace("#", "");
778
- i ? (t.start("sysClr", {
779
- val: "windowText",
780
- lastClr: e
781
- }), At(t, l), t.end("sysClr")) : t.empty("sysClr", {
782
- val: "windowText",
783
- lastClr: e
784
- });
785
- break;
786
- }
787
- case "index":
788
- i ? (t.start("srgbClr", { val: a }), At(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: a });
789
- break;
790
- case "hsl":
791
- const e = n.toHex().toString();
792
- i ? (t.start("srgbClr", { val: e }), At(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: e });
793
- break;
794
- case "rgb":
795
- case "lrgb":
796
- const r = n.toHex().toString();
797
- i ? (t.start("srgbClr", { val: r }), At(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: r });
798
- break;
799
- case "hex":
800
- const o = a.replace("#", "").toUpperCase();
801
- i ? (t.start("srgbClr", { val: o }), At(t, l), t.end("srgbClr")) : t.empty("srgbClr", { val: o });
802
- break;
803
- default:
804
- const s = a.replace("#", "").toUpperCase();
805
- t.empty("srgbClr", { val: s });
806
- }
807
- o && t.end(o);
808
- }
809
- function At(t, e) {
810
- if (e && 0 !== e.length) for (const r of e) for (const [e, o] of Object.entries(r)) {
811
- if (null == o) continue;
812
- const r = e;
813
- if (r) if ("boolean" == typeof o) t.empty(r);
814
- else {
815
- let n;
816
- if ("alpha" === e || "alphaOff" === e || "alphaMod" === e) n = Math.round(1e5 * o);
817
- else {
818
- if ("eTint" === e) {
819
- if (o < 0) {
820
- t.empty("shade", { val: Math.round(1e5 * (1 + o)).toString() });
821
- continue;
822
- }
823
- t.empty("tint", { val: Math.round(1e5 * o).toString() });
824
- continue;
825
- }
826
- n = Math.round(1e3 * o);
827
- }
828
- t.empty(r, { val: n.toString() });
829
- }
830
- }
831
- }
832
- function Pt(t, e, r, o, n = !1, s = !1) {
833
- if (!r) return;
834
- const a = "string" == typeof r ? e.parseColor(r) : r, l = () => {
835
- t.empty(o, { rgb: Vt(a.toHex().toString(!0)) });
836
- }, i = a.getAdjustments(), c = i && i.length > 0, d = a.getType();
837
- if (d !== I.Type.Auto) {
838
- if (d === I.Type.Scheme) {
839
- const e = a.getVal(), r = Lt[e] ?? e, n = Et.get(r);
840
- if (void 0 === n && "phClr" !== r) return console.warn(`Color scheme not in theme. schemeVal=${e} themeKey=${r}`), l();
841
- const s = {};
842
- if (s.theme = n, c) {
843
- if (!function(t) {
844
- for (const e of t) switch (Object.keys(e)[0]) {
845
- case I.AdjustmentType.Tint:
846
- case I.AdjustmentType.ETint:
847
- case I.AdjustmentType.Shade:
848
- case I.AdjustmentType.Lum:
849
- case I.AdjustmentType.LumOff:
850
- case I.AdjustmentType.LumMod:
851
- case I.AdjustmentType.Alpha:
852
- case I.AdjustmentType.AlphaOff:
853
- case I.AdjustmentType.AlphaMod: continue;
854
- default: return !1;
855
- }
856
- return !0;
857
- }(i)) return l();
858
- const t = 1 === i.length ? i[0][I.AdjustmentType.ETint] : void 0;
859
- let e;
860
- if (void 0 !== t) e = Ot(t);
861
- else {
862
- const t = a.getBaseColor().toHex().toString(!0), r = a.toHex().toString(!0);
863
- e = Ot(function(t, e) {
864
- const r = Nt(t, 0, 255), o = Nt(e, 0, 255);
865
- if (Math.abs(o - r) < 1e-9) return 0;
866
- return o < r ? r <= 1e-9 ? -1 : Nt(o / r - 1, -1, 0) : 255 - r <= 1e-9 ? 0 : Nt((o - r) / (255 - r), 0, 1);
867
- }(Bt(t), Bt(r)));
868
- }
869
- 0 !== e && (s.tint = e);
870
- }
871
- t.empty(o, s);
872
- return;
873
- }
874
- if (d === I.Type.Index) {
875
- const e = a.getVal(), r = e.substring(5, e.length);
876
- t.empty(o, { indexed: Number(r) });
877
- return;
878
- }
879
- return l();
880
- }
881
- t.empty(o, { auto: 1 });
882
- }
883
- var Lt = {
884
- bg1: "lt1",
885
- tx1: "dk1",
886
- bg2: "lt2",
887
- tx2: "dk2",
888
- accent1: "accent1",
889
- accent2: "accent2",
890
- accent3: "accent3",
891
- accent4: "accent4",
892
- accent5: "accent5",
893
- accent6: "accent6",
894
- hlink: "hlink",
895
- folHlink: "folHlink"
896
- }, _t = Object.freeze([
897
- "lt1",
898
- "dk1",
899
- "lt2",
900
- "dk2",
901
- "accent1",
902
- "accent2",
903
- "accent3",
904
- "accent4",
905
- "accent5",
906
- "accent6",
907
- "hlink",
908
- "folHlink"
909
- ]), Dt = Object.freeze([
910
- "dk1",
911
- "lt1",
912
- "dk2",
913
- "lt2",
914
- "accent1",
915
- "accent2",
916
- "accent3",
917
- "accent4",
918
- "accent5",
919
- "accent6",
920
- "hlink",
921
- "folHlink"
922
- ]), Et = new Map(_t.map((t, e) => [t, e]));
923
- function Nt(t, e, r) {
924
- return Math.max(e, Math.min(r, t));
925
- }
926
- function Ot(t) {
927
- const e = Nt(t, -1, 1);
928
- return Math.abs(e) < 1e-12 ? 0 : e;
929
- }
930
- function Bt(t) {
931
- const e = function(t) {
932
- const e = t.replace(/^#/, "").toUpperCase();
933
- if (8 === e.length) return e.slice(2);
934
- if (6 === e.length) return e;
935
- throw new Error(`Invalid hex: ${t}`);
936
- }(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;
937
- return (Math.max(r, o, n) + Math.min(r, o, n)) / 2 * 255;
938
- }
939
- function Vt(t) {
940
- const e = t.replace(/^#/, "").toUpperCase();
941
- if (8 === e.length) return e;
942
- if (6 === e.length) return "FF" + e;
943
- throw new Error(`Invalid hex: ${t}`);
944
- }
945
- function $t(t, e = !1) {
946
- let r = t;
947
- return 8 === r.length && (r = r.substring(2, 8)), 6 === r.length && (r = (e ? "00" : "FF") + r), r.toUpperCase();
948
- }
949
- function Wt(t, e, r, o, n = !1, s = !1) {
950
- const a = o.getTheme();
951
- if (n && e.start("fill"), "string" == typeof r && (r = {
952
- type: L.Type.Solid,
953
- color: r
954
- }), r.type === L.Type.None) n ? e.empty("patternFill", { patternType: "none" }) : e.empty("noFill");
955
- else if (r.type === L.Type.Solid) {
956
- const t = r;
957
- n ? e.start("patternFill", { patternType: "solid" }) : e.start("solidFill"), t.color && (n ? Pt(e, a, t.color, "fgColor") : Ft(e, a, t.color)), n ? e.end("patternFill") : e.end("solidFill");
958
- } else if (r.type === L.Type.Pattern) {
959
- const t = r, o = t.patternType || "solid";
960
- e.start("patternFill", { patternType: o }), t.foreground && (n ? Pt(e, a, s ? t.background : t.foreground, "fgColor") : Ft(e, a, s ? t.background : t.foreground)), t.background && (n ? Pt(e, a, s ? t.foreground : t.background, "bgColor") : Ft(e, a, s ? t.foreground : t.background)), e.end("patternFill");
961
- } else if (r.type === L.Type.Gradient && n) {
962
- const t = r, o = {}, n = t.gradientType;
963
- if (n !== L.GradientType.Path && n !== L.GradientType.Linear || (o.type = n), void 0 !== t.angle) {
964
- const e = (t.angle - 90) % 360;
965
- 0 !== e && (o.degree = String(e));
966
- }
967
- const s = t.focus;
968
- 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);
969
- const l = t.stops;
970
- if (l && l.length > 0) for (const t of l) {
971
- let r, o = 0;
972
- if ("string" == typeof t || "object" == typeof t && !("offset" in t)) r = t, o = 0;
973
- else {
974
- const e = t;
975
- o = e.offset || 0, r = e.color;
976
- }
977
- e.start("stop", { position: String(o) }), r && Pt(e, a, r, "color"), e.end("stop");
978
- }
979
- e.end("gradientFill");
980
- } else if (r.type === L.Type.Gradient) {
981
- const t = r, o = {};
982
- void 0 !== t.isRotatedWithShape && (o.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.start("gradFill", o), e.start("gsLst");
983
- const n = t.stops;
984
- if (n && n.length > 0) for (const t of n) {
985
- let r, o = 0;
986
- if ("string" == typeof t || "object" == typeof t && !("offset" in t)) r = t;
987
- else {
988
- const e = t;
989
- o = e.offset || 0, r = e.color;
990
- }
991
- e.start("gs", { pos: String(k.roundAccurately(1e3 * o, 0)) }), r && Ft(e, a, r), e.end("gs");
992
- }
993
- e.end("gsLst");
994
- const s = t.gradientType;
995
- if (s && s !== L.GradientType.Linear) {
996
- const r = "radial" === s ? "circle" : s;
997
- e.start("path", { path: r });
998
- const o = t.focus;
999
- if (o) {
1000
- const t = {};
1001
- void 0 !== o.t && (t.t = String(k.roundAccurately(1e3 * o.t, 0))), void 0 !== o.l && (t.l = String(k.roundAccurately(1e3 * o.l, 0))), void 0 !== o.b && (t.b = String(k.roundAccurately(1e3 * o.b, 0))), void 0 !== o.r && (t.r = String(k.roundAccurately(1e3 * o.r, 0))), e.empty("fillToRect", t);
1002
- }
1003
- e.end("path");
1004
- } else {
1005
- const r = {};
1006
- void 0 !== t.angle && (r.ang = String(k.roundAccurately(6e4 * t.angle, 0)));
1007
- const o = t.scaled;
1008
- void 0 !== o && (r.scaled = o ? "1" : "0"), e.empty("lin", r);
1009
- }
1010
- e.end("gradFill");
1011
- } else n ? e.empty("patternFill", { patternType: "none" }) : e.empty("noFill");
1012
- n && e.end("fill");
1013
- }
1014
- var zt = (t, e, r, o) => {
1015
- if (!r) return e.start("ln"), e.empty("noFill"), void e.end("ln");
1016
- "string" == typeof r && (r = { fill: r });
1017
- const n = r, s = {};
1018
- if (void 0 !== n.width && (s.w = String(Kt(n.width))), void 0 !== n.lineCap && (s.cap = jt(n.lineCap)), void 0 !== n.compound && (s.cmpd = n.compound), void 0 !== n.align && (s.algn = n.align), e.start("ln", s), Wt(0, e, n.fill ?? qt, o), Array.isArray(n.dash)) {
1019
- e.start("custDash");
1020
- for (let t = 0; t < n.dash.length; t += 2) e.empty("ds", {
1021
- d: String(k.roundAccurately(1e3 * n.dash[t], 0)),
1022
- sp: String(k.roundAccurately(1e3 * (n.dash[t + 1] ?? 0), 0))
1023
- });
1024
- e.end("custDash");
1025
- } else "string" == typeof n.dash && e.empty("prstDash", { val: n.dash });
1026
- if (n.lineJoin === D.LineJoin.Round) e.empty("round");
1027
- else if (n.lineJoin === D.LineJoin.Bevel) e.empty("bevel");
1028
- else if (n.lineJoin === D.LineJoin.Miter) {
1029
- const t = {};
1030
- void 0 !== n.miterLimit && (t.lim = String(k.roundAccurately(1e5 * n.miterLimit, 0))), e.empty("miter", t);
1031
- }
1032
- e.end("ln");
1033
- }, jt = (t) => "round" === t ? "rnd" : "butt" === t ? "flat" : "square" === t ? "sq" : t, Xt = (t, e, r, o = void 0, n = !1) => {
1034
- if (!r) return;
1035
- if (!(r.fill || r.stroke || r.effects?.length || n)) return;
1036
- const s = t.getXMLWriter();
1037
- o && s.start(o), s.pushDefaultNamespace("a"), r.fill && Wt(0, s, r.fill, e), r.stroke && zt(0, s, r.stroke, e), r.effects?.length ? Ut(t, s, e.getTheme(), r.effects) : n && s.empty("effectLst"), s.popDefaultNamespace(), o && s.end(o);
1038
- }, Ut = (t, e, r, o) => {
1039
- e.start("effectLst");
1040
- for (const t of o) Ht(e, r, t);
1041
- e.end("effectLst");
1042
- }, Ht = (t, e, r) => {
1043
- switch (r.type) {
1044
- case P.Type.OuterShadow: {
1045
- const o = r, n = {};
1046
- void 0 !== o.blur && (n.blurRad = String(Kt(o.blur))), void 0 !== o.distance && (n.dist = String(Kt(o.distance))), void 0 !== o.angle && (n.dir = String(Zt(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(k.roundAccurately(1e3 * o.scaleX, 0))), void 0 !== o.scaleY && (n.sy = String(k.roundAccurately(1e3 * o.scaleY, 0))), void 0 !== o.skewX && (n.kx = String(Zt(o.skewX))), void 0 !== o.skewY && (n.ky = String(Zt(o.skewY))), t.start("outerShdw", n), Ft(t, e, o.color), t.end("outerShdw");
1047
- break;
1048
- }
1049
- case P.Type.InnerShadow: {
1050
- const o = r, n = {};
1051
- void 0 !== o.blur && (n.blurRad = String(Kt(o.blur))), void 0 !== o.distance && (n.dist = String(Kt(o.distance))), void 0 !== o.angle && (n.dir = String(Zt(o.angle))), t.start("innerShdw", n), Ft(t, e, o.color), t.end("innerShdw");
1052
- break;
1053
- }
1054
- case P.Type.PresetShadow: {
1055
- const o = r, n = { prst: o.preset };
1056
- void 0 !== o.distance && (n.dist = String(Kt(o.distance))), void 0 !== o.angle && (n.dir = String(Zt(o.angle))), t.start("prstShdw", n), Ft(t, e, o.color), t.end("prstShdw");
1057
- break;
1058
- }
1059
- case P.Type.Glow: {
1060
- const o = r, n = {};
1061
- void 0 !== o.radius && (n.rad = String(Kt(o.radius))), t.start("glow", n), Ft(t, e, o.color), t.end("glow");
1062
- break;
1063
- }
1064
- case P.Type.SoftEdge: {
1065
- const e = r, o = {};
1066
- void 0 !== e.radius && (o.rad = String(Kt(e.radius))), t.empty("softEdge", o);
1067
- break;
1068
- }
1069
- case P.Type.Reflection: {
1070
- const e = r, o = {};
1071
- void 0 !== e.blur && (o.blurRad = String(Kt(e.blur))), void 0 !== e.distance && (o.dist = String(Kt(e.distance))), void 0 !== e.angle && (o.dir = String(Zt(e.angle))), void 0 !== e.fadeAngle && (o.fadeDir = String(Zt(e.fadeAngle))), void 0 !== e.startAlpha && (o.stA = String(k.roundAccurately(1e3 * e.startAlpha, 0))), void 0 !== e.startPosition && (o.stPos = String(k.roundAccurately(1e3 * e.startPosition, 0))), void 0 !== e.endAlpha && (o.endA = String(k.roundAccurately(1e3 * e.endAlpha, 0))), void 0 !== e.endPosition && (o.endPos = String(k.roundAccurately(1e3 * e.endPosition, 0))), void 0 !== e.scaleX && (o.sx = String(k.roundAccurately(1e3 * e.scaleX, 0))), void 0 !== e.scaleY && (o.sy = String(k.roundAccurately(1e3 * e.scaleY, 0))), void 0 !== e.skewX && (o.kx = String(Zt(e.skewX))), void 0 !== e.skewY && (o.ky = String(Zt(e.skewY))), void 0 !== e.alignment && (o.algn = e.alignment), void 0 !== e.isRotatedWithShape && (o.rotWithShape = e.isRotatedWithShape ? "1" : "0"), t.empty("reflection", o);
1072
- break;
1073
- }
1074
- }
1075
- }, qt = { type: "none" }, Gt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", Jt = {
1076
- mime: "image/png",
1077
- ext: "png"
1078
- }, Kt = (t = 0) => k.roundAccurately(12700 * t, 0), Yt = (t = 0) => k.roundAccurately(9525 * t, 0), Zt = (t) => 6e4 * t, Qt = (t = 0) => k.roundAccurately(100 * t, 2), te = class {
1079
- constructor() {
1080
- this._dxfs = [], this._byKey = /* @__PURE__ */ new Map();
1081
- }
1082
- add(t) {
1083
- const e = JSON.stringify(t);
1084
- let r = this._byKey.get(e);
1085
- return void 0 === r && (r = this._dxfs.length, this._dxfs.push(t), this._byKey.set(e, r)), r;
1086
- }
1087
- getDxfs() {
1088
- return this._dxfs;
1089
- }
1090
- getCount() {
1091
- return this._dxfs.length;
1092
- }
1093
- }, ee = "cfDxfs", re = [
1094
- "font",
1095
- "fill",
1096
- "border",
1097
- "numberFormat",
1098
- "alignment"
1099
- ];
1100
- function oe(t, e, r) {
1101
- if (e) {
1102
- if (e.named) {
1103
- const o = e.named, n = o.toLowerCase(), s = r.namedStyleMap;
1104
- if (!s.has(n)) {
1105
- s.set(n, "" + s.size);
1106
- const e = t.getNamed(o).toJSON();
1107
- oe(t, e.style ?? k.EmptyObject, r), r.namedStyles.push(e);
1108
- }
1109
- }
1110
- e.font && function(t, e, r) {
1111
- if (!e) return;
1112
- const o = C.JSONStableStringify(e), n = r.fontMap;
1113
- if (!n.has(o)) {
1114
- const t = n.size;
1115
- n.set(o, "" + t), r.fonts.push(e);
1116
- }
1117
- }(0, e.font, r), e.fill && function(t, e, r) {
1118
- if (!e) return;
1119
- const o = C.JSONStableStringify(e), n = r.fillMap;
1120
- if (!n.has(o) && "object" == typeof e && e.type) {
1121
- const t = n.size;
1122
- n.set(o, "" + t), r.fills.push(e);
1123
- }
1124
- }(0, e.fill, r), e.border && function(t, e, r) {
1125
- if (!e) return;
1126
- const o = C.JSONStableStringify(e), n = r.borderMap;
1127
- if (!n.has(o)) {
1128
- const t = n.size;
1129
- n.set(o, "" + t), r.borders.push(e);
1130
- }
1131
- }(0, e.border, r), void 0 !== e.numberFormat && function(t, e, r) {
1132
- if (!e) return;
1133
- const o = B.toBuiltInID(e), n = r.numFmtMap;
1134
- if (!n.has(o)) {
1135
- let t = 0;
1136
- "number" == typeof o ? t = o : (t = r.numFmtsCustom.length + pe, r.numFmtsCustom.push(o)), n.set(e, "" + t);
1137
- }
1138
- }(0, e.numberFormat, r);
1139
- }
1140
- }
1141
- function ne(t, e, r) {
1142
- if (!e) return;
1143
- const o = e.name.toLowerCase();
1144
- r.namedStyleMap.has(o) || (r.namedStyleMap.set(o, "" + r.namedStyleMap.size), r.namedStyles.push(e), oe(t, e.style, r));
1145
- }
1146
- function se(t, e, r, o, n = !1) {
1147
- const s = o.getDefaultFontSize(), a = o.getTheme().getFontScheme().getMinorFont() ?? "Calibri", l = o.getNormal().getFont().getColor();
1148
- 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");
1149
- let i = r.verticalAlign;
1150
- 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) }), Pt(e, o.getTheme(), r.color ?? l, "color", !n);
1151
- const c = !n || r.family && r.family !== a;
1152
- if (c && (e.empty("name", { val: r.family ?? a }), r.fallbacks && r.fallbacks.length > 0)) {
1153
- const t = r.fallbacks;
1154
- 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 });
1155
- }
1156
- void 0 !== r.charset && null !== r.charset && e.empty("charset", { val: String(r.charset) });
1157
- const d = r.scheme ?? (void 0 === r.family ? "minor" : void 0);
1158
- c && void 0 !== d && "none" !== d && e.empty("scheme", { val: d }), e.end("font");
1159
- }
1160
- function ae(t, e, r, o, n, s = !1) {
1161
- if (!n || "none" === n.style || !n.style) return void (s && !n || e.empty(o));
1162
- e.start(o, { style: n.style });
1163
- let a = n.color;
1164
- a && Pt(e, r, a, "color", !s, s), e.end(o);
1165
- }
1166
- function le(t, e, r, o, n = !1) {
1167
- const s = {};
1168
- n ? (s.diagonalUp = "0", s.diagonalDown = "0") : (r.diagonalUp && (s.diagonalUp = "1"), r.diagonalDown && (s.diagonalDown = "1")), e.start("border", s), ae(0, e, o, "left", r.left, n), ae(0, e, o, "right", r.right, n), ae(0, e, o, "top", r.top, n), ae(0, e, o, "bottom", r.bottom, n), n ? (ae(0, e, o, "vertical", r.vertical, n), ae(0, e, o, "horizontal", r.horizontal, n)) : ae(0, e, o, "diagonal", r.diagonalUp ?? r.diagonalDown, n), e.end("border");
1169
- }
1170
- function ie(t, e, r, o = !1) {
1171
- const n = {};
1172
- r.horizontal && r.horizontal !== N.HorizontalAlignment.General && (n.horizontal = r.horizontal), r.vertical && r.vertical !== N.VerticalAlignment.Bottom && (n.vertical = r.vertical);
1173
- let s = r.rotation;
1174
- 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));
1175
- const a = r.overflow;
1176
- switch (a === N.Overflow.Wrap && (n.wrapText = "1"), r.indent && (n.indent = "" + r.indent), r.relativeIndent && (n.relativeIndent = "" + r.relativeIndent), r.justifyLastLine && (n.justifyLastLine = "1"), a === N.Overflow.Shrink && (n.shrinkToFit = "1"), r.readingDirection) {
1177
- case N.ReadingDirection.Auto: break;
1178
- case N.ReadingDirection.LeftToRight:
1179
- n.readingOrder = "1";
1180
- break;
1181
- case N.ReadingDirection.RightToLeft: n.readingOrder = "2";
1182
- }
1183
- return Object.keys(n).length > 0 ? n : null;
1184
- }
1185
- function ce(t, e, r, o, n, s) {
1186
- const a = {};
1187
- let l = null, i = o.named;
1188
- i && (l = r.getNamed(i).toJSON().style);
1189
- const c = o.font ?? l?.font, d = c ? n.fontMap.get(C.JSONStableStringify(c)) ?? 0 : 0, p = o.fill ?? l?.fill, m = p ? n.fillMap.get(C.JSONStableStringify(p)) ?? 0 : 0, f = o.border ?? l?.border, u = f ? n.borderMap.get(C.JSONStableStringify(f)) ?? 0 : 0, h = o.numberFormat ?? l?.numberFormat;
1190
- if (a.numFmtId = (void 0 !== h ? n.numFmtMap.get(h) : void 0) ?? "0", a.fontId = String(d), a.fillId = String(m), a.borderId = String(u), s) {
1191
- const t = o.named ?? E.BuiltInName.Normal;
1192
- a.xfId = n.namedStyleMap.get(t.toLowerCase());
1193
- }
1194
- let g = null;
1195
- const y = o.alignment ?? l?.alignment;
1196
- y && (g = ie(0, 0, y)), o.font && (a.applyFont = "1"), o.fill && (a.applyFill = "1"), o.numberFormat && (a.applyNumberFormat = "1"), o.border && (a.applyBorder = "1"), g && (a.applyAlignment = "1"), o.quotePrefix && (a.quotePrefix = "1"), g ? (e.start("xf", a), g && e.empty("alignment", g), e.end("xf")) : e.empty("xf", a);
1197
- }
1198
- function de(t, e, r, o, n, s = "dxf", a = pe) {
1199
- if (e.start(s), r.font && se(0, e, r.font, o, !0), void 0 !== r.numberFormat && null !== r.numberFormat) {
1200
- const t = B.toBuiltInID(r.numberFormat), o = "number" == typeof t, n = o ? B.builtInFormat(t) : String(t);
1201
- n && e.empty("numFmt", {
1202
- numFmtId: String(o ? t : a++),
1203
- formatCode: n
1204
- });
1205
- }
1206
- if (r.fill && Wt(0, e, r.fill, o, !0, !0), r.alignment) {
1207
- const t = ie(0, 0, r.alignment, !0);
1208
- t && e.empty("alignment", t);
1209
- }
1210
- return r.border && le(0, e, r.border, n, !0), e.end(s), a;
1211
- }
1212
- var pe = 164, me = Object.freeze([
1213
- "wholeTable",
1214
- "headerRow",
1215
- "totalRow",
1216
- "firstColumn",
1217
- "lastColumn",
1218
- "firstRowStripe",
1219
- "secondRowStripe",
1220
- "firstColumnStripe",
1221
- "secondColumnStripe",
1222
- "firstHeaderCell",
1223
- "lastHeaderCell",
1224
- "firstTotalCell",
1225
- "lastTotalCell"
1226
- ]), fe = F.BuiltInOperatorNames, ue = (t, e, r, o, n, s) => {
1227
- const a = o.sorts, l = a ? a.length : 0;
1228
- if (0 === l) return;
1229
- const i = {};
1230
- if (l > 0) {
1231
- const t = a[0].criteria?.collatorOptions;
1232
- t && (i.caseSensitive = "object" != typeof t || Array.isArray(t) || "case" !== t.sensitivity && "variant" !== t.sensitivity ? "0" : "1");
1233
- }
1234
- i.ref = r.getRange().toString(), i["xmlns:xlrd2"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2", e.start("sortState", i);
1235
- for (let t = 0; t < l; t++) {
1236
- const r = a[t], o = r.criteria ?? {}, l = r.index + s.colStart, i = {};
1237
- o.reverse && (i.descending = "1"), i.ref = n.getIntersect({
1238
- colStart: l,
1239
- rowStart: s.rowStart,
1240
- colEnd: l,
1241
- rowEnd: s.rowEnd
1242
- }).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);
1243
- }
1244
- e.end("sortState");
1245
- }, he = (t, e, r, o, n = !1) => {
1246
- let s = r.getRange();
1247
- r.isShowTotals() && (s = s.getResizeBy(-1, 0));
1248
- const a = s.getCoords(), l = o.sort, i = o.filter, c = i ? i.conditions : void 0, d = c ? c.length : 0, p = o.hiddenButtons, m = {};
1249
- m.ref = s.toString();
1250
- let f, u = [];
1251
- for (let t = 0; t < d; t++) {
1252
- const e = c[t];
1253
- u[e.index] = { ...e };
1254
- }
1255
- if (Array.isArray(p) && p.length > 0) {
1256
- const t = p.length;
1257
- f = new Array(p[t - 1]);
1258
- for (let e = 0; e < t; e++) f[p[e]] = !0;
1259
- }
1260
- if (u || p || f || n) {
1261
- let i = 0;
1262
- o.columns ? i = o.columns.length : n && (i = s.getColumnCount()), e.start("autoFilter", m);
1263
- for (let r = 0; r < i; r++) {
1264
- const o = !0 === p || !0 === f?.[r], n = u[r];
1265
- (n || o) && ye(t, e, r, n, o);
1266
- }
1267
- l && n && ue(0, e, r, l, s, a), e.end("autoFilter");
1268
- } else e.empty("autoFilter", m);
1269
- l && !n && ue(0, e, r, l, s, a);
1270
- }, ge = (t, e, r) => {
1271
- const o = u(r, (e) => t.warn(e, r));
1272
- if (!o) return;
1273
- const n = { operator: o.operator };
1274
- void 0 !== o.val && (n.val = o.val), e.empty("customFilter", n);
1275
- }, ye = (t, e, r, o, n) => {
1276
- const s = {};
1277
- s.colId = "" + r, n && (s.hiddenButton = "1"), o ? (e.start("filterColumn", s), ((t, e, r) => {
1278
- const o = r.operator;
1279
- if (o !== F.BuiltInOperatorNames.Expression) if (o !== F.BuiltInOperatorNames.Unique) {
1280
- if (o === F.BuiltInOperatorNames.Color) {
1281
- const t = r.param, o = {};
1282
- void 0 !== t.cellColor && (o.cellColor = t.cellColor ? "1" : "0"), void 0 !== t.styleId && (o.dxfId = t.styleId), e.empty("colorFilter", o);
1283
- }
1284
- if (xe(o)) if ("between" === o) {
1285
- const o = r.param;
1286
- e.start("customFilters", { and: "1" }), ge(t, e, {
1287
- operator: fe.GreaterThanEqualTo,
1288
- param: o.from
1289
- }), ge(t, e, {
1290
- operator: fe.LessThanEqualTo,
1291
- param: o.to
1292
- }), e.end("customFilters");
1293
- } else if (o === F.BuiltInOperatorNames.Not) {
1294
- const o = r.param;
1295
- 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);
1296
- } else if (o === F.BuiltInOperatorNames.And || o === F.BuiltInOperatorNames.Or) {
1297
- const n = r.param, s = n.length;
1298
- if (s > 0) {
1299
- const r = {};
1300
- o === F.BuiltInOperatorNames.And && s > 1 && (r.and = "1"), e.start("customFilters", r);
1301
- for (let r = 0; r < s; r++) {
1302
- const o = n[r], s = o.operator === fe.Not && c(o.param?.operator);
1303
- c(o.operator) || s ? ge(t, e, o) : t.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", o);
1304
- }
1305
- e.end("customFilters");
1306
- }
1307
- } else c(o) && (e.start("customFilters"), ge(t, e, r), e.end("customFilters"));
1308
- if (o === F.BuiltInOperatorNames.TimePeriod) {
1309
- const t = r.param, o = {};
1310
- 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);
1311
- }
1312
- if (o === F.BuiltInOperatorNames.Average) {
1313
- const t = r.param, o = {};
1314
- let n = t.type;
1315
- n && (n === F.AverageType.Above ? o.type = "aboveAverage" : n === F.AverageType.Below && (o.type = "belowAverage")), void 0 !== t.stdDevs && (o.val = "" + t.stdDevs), e.empty("dynamicFilter", o);
1316
- }
1317
- if (o === F.BuiltInOperatorNames.InSet) {
1318
- const t = r.param;
1319
- if (t.dateGroups) {
1320
- const r = t.dateGroups, o = r.length;
1321
- e.start("dateGroupItem");
1322
- for (let t = 0; t < o; t++) {
1323
- const o = r[t], n = {};
1324
- 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);
1325
- }
1326
- e.end("dateGroupItem");
1327
- }
1328
- if (t.items) {
1329
- const r = t.items, o = r.length;
1330
- e.start("filters");
1331
- for (let t = 0; t < o; t++) {
1332
- const o = r[t];
1333
- e.empty("filter", { val: "" + o });
1334
- }
1335
- e.end("filters");
1336
- }
1337
- }
1338
- if (o === F.BuiltInOperatorNames.Icon) {
1339
- const t = r.param, o = {};
1340
- void 0 !== t.iconSet && (o.iconSet = t.iconSet), void 0 !== t.iconId && (o.iconId = "" + t.iconId), e.empty("iconFilter", o);
1341
- }
1342
- if (o === F.BuiltInOperatorNames.TopN) {
1343
- const t = r.param, o = {};
1344
- 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);
1345
- }
1346
- } else t.warn("Unique conditions not supported in Table AutoFilters", r);
1347
- else t.warn("Expression conditions not supported in Table AutoFilters", r);
1348
- })(t, e, o), e.end("filterColumn")) : e.empty("filterColumn", s);
1349
- }, xe = (t) => t === F.BuiltInOperatorNames.GreaterThan || t === F.BuiltInOperatorNames.GreaterThanEqualTo || t === F.BuiltInOperatorNames.LessThan || t === F.BuiltInOperatorNames.LessThanEqualTo || t === F.BuiltInOperatorNames.EqualTo || t === F.BuiltInOperatorNames.And || t === F.BuiltInOperatorNames.Or || t === F.BuiltInOperatorNames.Not || "between" === t, ve = "16.0000", Se = 1048575, we = 16383;
1350
- var be = {
1351
- names: /* @__PURE__ */ new Set(),
1352
- perFormula: [],
1353
- affects: () => !1
1354
- };
1355
- var Ce = 1048576, Te = (t, e, r) => {
1356
- if (!r) return [];
1357
- let o = 0;
1358
- for (let n = 0; n < r.length; n++) {
1359
- const s = r[n][0], a = e.getRange(s).getCoords();
1360
- if (o += (a.rowEnd - a.rowStart + 1) * (a.colEnd - a.colStart + 1), o > Ce) return t.warn(`Direct styles cover more than ${Ce} cells; not writing the styles from '${s}' on. A range that size belongs in a column or row style.`), r.slice(0, n);
1361
- }
1362
- return r;
1363
- };
1364
- function ke(t, e) {
1365
- let r = e.type;
1366
- r === A.ColorStopType.AutoMin ? r = A.ColorStopType.Min : r === A.ColorStopType.AutoMax && (r = A.ColorStopType.Max), t.empty("cfvo", {
1367
- type: r,
1368
- val: e.value,
1369
- gte: e.exclusive ? "0" : void 0
1370
- });
1371
- }
1372
- function Me(t, e) {
1373
- const r = {
1374
- type: e.type,
1375
- gte: e.exclusive ? "0" : void 0
1376
- };
1377
- 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);
1378
- }
1379
- var Re = /* @__PURE__ */ new Set([
1380
- E.IconSet.Arrows3,
1381
- E.IconSet.ArrowsGray3,
1382
- E.IconSet.Flags3,
1383
- E.IconSet.Signs3,
1384
- E.IconSet.Symbols3,
1385
- E.IconSet.Symbols3_2,
1386
- E.IconSet.TrafficLights3,
1387
- E.IconSet.TrafficLights3_2,
1388
- E.IconSet.Arrows4,
1389
- E.IconSet.ArrowsGray4,
1390
- E.IconSet.Rating4,
1391
- E.IconSet.RedToBlack4,
1392
- E.IconSet.TrafficLights4,
1393
- E.IconSet.Arrows5,
1394
- E.IconSet.ArrowsGray5,
1395
- E.IconSet.Quarters5,
1396
- E.IconSet.Rating5
1397
- ]);
1398
- function Ie(t) {
1399
- return (t.icon?.length ?? 0) > 0 || void 0 !== t.iconSet && !Re.has(t.iconSet);
1400
- }
1401
- function Fe(t, e, r, o, s, a, l, i, c) {
1402
- const d = o.scale;
1403
- o.ext && t.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1404
- const p = {
1405
- type: s.type,
1406
- dxfId: o.style && Object.keys(o.style).length > 0 ? i.add(o.style) : void 0,
1407
- priority: l,
1408
- stopIfTrue: Le(o.stopIfTrue),
1409
- aboveAverage: Le(s.aboveAverage),
1410
- equalAverage: Le(s.equalAverage),
1411
- stdDev: s.stdDev,
1412
- bottom: Le(s.bottom),
1413
- percent: Le(s.percent),
1414
- rank: s.rank,
1415
- operator: s.operator,
1416
- text: s.text,
1417
- timePeriod: s.timePeriod
1418
- };
1419
- let m;
1420
- d?.type === A.ScaleType.DataBar && function(t) {
1421
- if (t.gradient || t.borderColor || t.negativeFillColor || t.negativeBorderColor || t.axisColor || t.axisPosition || t.direction) return !0;
1422
- const e = t.stops, r = e ? e.length : 0;
1423
- for (let t = 0; t < r; t++) {
1424
- const r = e[t].type;
1425
- if (r === A.ColorStopType.AutoMin || r === A.ColorStopType.AutoMax) return !0;
1426
- }
1427
- return !1;
1428
- }(d) && (m = w(k.uuidV4), c.push({
1429
- guid: m,
1430
- sqref: a,
1431
- priority: l,
1432
- scale: d
1433
- }));
1434
- const f = s.formulas, u = f ? f.length : 0;
1435
- if (0 !== u || d) {
1436
- e.start("cfRule", p);
1437
- for (let t = 0; t < u; t++) e.start("formula"), e.text(f[t]), e.end("formula");
1438
- if (d?.type === A.ScaleType.ColorScale) {
1439
- const t = d.stops ?? [];
1440
- e.start("colorScale");
1441
- for (let r = 0; r < t.length; r++) ke(e, t[r]);
1442
- for (let o = 0; o < t.length; o++) Pt(e, r, t[o].color, "color");
1443
- e.end("colorScale");
1444
- } else if (d?.type === A.ScaleType.DataBar) {
1445
- const t = d.stops ?? [];
1446
- e.start("dataBar", {
1447
- minLength: d.minLength,
1448
- maxLength: d.maxLength,
1449
- showValue: Le(d.showValue)
1450
- });
1451
- for (let r = 0; r < t.length; r++) ke(e, t[r]);
1452
- d.color && Pt(e, r, d.color, "color"), e.end("dataBar");
1453
- } else if (d?.type === A.ScaleType.IconSet) {
1454
- const t = d.stops ?? [];
1455
- e.start("iconSet", {
1456
- iconSet: d.iconSet,
1457
- reverse: Le(d.reverse),
1458
- showValue: Le(d.showValue)
1459
- });
1460
- for (let r = 0; r < t.length; r++) ke(e, t[r]);
1461
- e.end("iconSet");
1462
- }
1463
- m && (e.start("extLst"), e.start("ext", {
1464
- uri: h,
1465
- "xmlns:x14": n
1466
- }), e.start("x14:id"), e.text(m), e.end("x14:id"), e.end("ext"), e.end("extLst")), e.end("cfRule");
1467
- } else e.empty("cfRule", p);
1468
- }
1469
- function Ae(t) {
1470
- return t.split(" ")[0].split(":")[0];
1471
- }
1472
- function Pe(t) {
1473
- if ("string" == typeof t) return t.split(",").join(" ");
1474
- if (Array.isArray(t)) {
1475
- const e = [];
1476
- for (let r = 0; r < t.length; r++) {
1477
- const o = b.rangeToString(t[r]);
1478
- o && e.push(o);
1479
- }
1480
- return e.length > 0 ? e.join(" ") : null;
1481
- }
1482
- return b.rangeToString(t);
1483
- }
1484
- function Le(t) {
1485
- if (void 0 !== t) return t ? "1" : "0";
1486
- }
1487
- function _e(t) {
1488
- if ("string" != typeof t) return !1;
1489
- let e = !1;
1490
- for (let r = 0; r < t.length; r++) {
1491
- const o = t[r];
1492
- if ("\"" === o) e = !e;
1493
- else if ("!" === o && !e) return !0;
1494
- }
1495
- return !1;
1496
- }
1497
- function De(t) {
1498
- const e = t.formulas, r = e ? e.length : 0;
1499
- for (let t = 0; t < r; t++) if (_e(e[t])) return !0;
1500
- return !1;
1501
- }
1502
- var Ee = {
1503
- r: void 0,
1504
- s: void 0,
1505
- t: void 0,
1506
- cm: void 0,
1507
- vm: void 0
1508
- }, Ne = {
1509
- r: void 0,
1510
- s: void 0,
1511
- customFormat: void 0,
1512
- hidden: void 0,
1513
- ht: void 0,
1514
- customHeight: void 0,
1515
- "x14ac:dyDescent": "0.25",
1516
- outlineLevel: void 0,
1517
- collapsed: void 0
1518
- }, Oe = {
1519
- t: void 0,
1520
- aca: void 0,
1521
- ref: void 0,
1522
- ca: void 0,
1523
- si: void 0
1524
- }, Be = {
1525
- t: "shared",
1526
- aca: void 0,
1527
- ref: void 0,
1528
- ca: void 0,
1529
- si: void 0
1530
- }, Ve = {
1531
- t: "array",
1532
- aca: void 0,
1533
- ref: void 0,
1534
- ca: void 0,
1535
- si: void 0
1536
- };
1537
- function $e(t, e, r, o) {
1538
- r && (e.start(o), e.empty("latin", { typeface: r }), e.empty("ea", { typeface: "" }), e.empty("cs", { typeface: "" }), e.end(o));
1539
- }
1540
- var We = (t) => t.toISOString().split(".")[0] + "Z", ze = (t, e, r) => {
1541
- switch (e) {
1542
- case "creator":
1543
- t.start("dc:creator"), t.text(r), t.end("dc:creator");
1544
- break;
1545
- case "lastModifiedBy":
1546
- t.start("cp:lastModifiedBy"), t.text(r), t.end("cp:lastModifiedBy");
1547
- break;
1548
- case "created":
1549
- t.start("dcterms:created", { "xsi:type": "dcterms:W3CDTF" }), t.text(r), t.end("dcterms:created");
1550
- break;
1551
- case "modified": t.start("dcterms:modified", { "xsi:type": "dcterms:W3CDTF" }), t.text(r), t.end("dcterms:modified");
1552
- }
1553
- }, je = (t, e, r, o) => {
1554
- e.start(r), e.text(o), e.end(r);
1555
- }, Xe = (t, e, r) => {
1556
- const o = r.getSheets().getItems({ visibility: _.Visibility.Hidden }).map((t) => t.getName()), n = r.getNames().getItems({ type: "formula" }).filter((t) => !!t.getRanges?.()).map((t) => t.getName());
1557
- e.start("HeadingPairs"), e.start("vt:vector", {
1558
- size: n.length > 0 ? "4" : "2",
1559
- baseType: "variant"
1560
- }), 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", {
1561
- size: "" + (o.length + n.length),
1562
- baseType: "lpstr"
1563
- });
1564
- for (const t of o) e.start("vt:lpstr"), e.text(t), e.end("vt:lpstr");
1565
- for (const t of n) e.start("vt:lpstr"), e.text(t), e.end("vt:lpstr");
1566
- e.end("vt:vector"), e.end("TitlesOfParts");
1567
- }, Ue = {
1568
- minSupportedVersion: "120000",
1569
- copy: "1",
1570
- pasteAll: "1",
1571
- pasteValues: "1",
1572
- merge: "1",
1573
- splitFirst: "1",
1574
- rowColShift: "1",
1575
- clearFormats: "1",
1576
- clearComments: "1",
1577
- assign: "1",
1578
- coerce: "1"
1579
- }, He = (t, e, r = k.EmptyArray) => {
1580
- if (!e) return { ...r };
1581
- const { text: o, runs: n, color: s, size: a, kern: l, weight: i, style: c, b: d, i: p, spc: m, baseline: f, ...u } = e, h = {
1582
- ...r,
1583
- ...u
1584
- };
1585
- return void 0 !== a && (h.sz = "" + Qt(a)), void 0 !== d && (h.b = d ? "1" : "0"), void 0 !== i && (h.b = i > 500 ? "1" : "0"), void 0 !== p && (h.i = p ? "1" : "0"), void 0 !== c && (h.i = "italic" === c ? "1" : "0"), void 0 !== l && (h.kern = "" + Qt(l)), void 0 !== m && (h.spc = "" + Qt(m)), void 0 !== f && (h.baseline = "" + Qt(f)), h;
1586
- }, qe = (t, e, r) => {
1587
- if (!r) return;
1588
- const o = t.getXMLWriter();
1589
- o.start("txBody"), o.pushDefaultNamespace("a");
1590
- Je(t, e, {
1591
- vertOverflow: "clip",
1592
- horzOverflow: "clip",
1593
- rtlCol: "0",
1594
- anchor: "ctr"
1595
- }), o.empty("lstStyle"), ((t, e, r) => {
1596
- if (!r) return;
1597
- const o = t.getXMLWriter();
1598
- o.pushDefaultNamespace("a"), "string" == typeof r && (r = { runs: [{ text: r }] }), o.start("p");
1599
- o.empty("pPr", { algn: "ctr" });
1600
- const s = He(0, r, {
1601
- ...Ke,
1602
- size: e.getDefaultFontSize()
1603
- }), a = r?.runs, l = a ? a.length : 0;
1604
- if (l > 0) for (let t = 0; t < l; t++) {
1605
- const r = a[t];
1606
- o.start("r", {});
1607
- const n = He(0, r, Ke), s = r.color;
1608
- s ? (o.start("rPr", n), Wt(0, o, s, e), o.end("rPr")) : o.empty("rPr", n), o.start("t"), o.text(r?.text ?? ""), o.end("t"), o.end("r");
1609
- }
1610
- else o.empty("endParaRPr", s);
1611
- o.end("p"), o.popDefaultNamespace();
1612
- })(t, e, r), o.popDefaultNamespace(), o.end("txBody");
1613
- }, Ge = (t, e, r) => {
1614
- if (!r) return;
1615
- const o = t.getXMLWriter(), n = He(0, r);
1616
- o.empty("defRPr", n);
1617
- }, Je = (t, e, r) => {
1618
- if (!r) return;
1619
- const o = t.getXMLWriter(), { spAutoFit: n, ...s } = r;
1620
- n ? (o.start("bodyPr", s), o.empty("spAutoFit"), o.end("bodyPr")) : o.empty("bodyPr", s);
1621
- }, Ke = Object.freeze({ lang: "en-US" }), Ye = (t, e) => {
1622
- if (0 !== e.length) {
1623
- t.start("a:extLst");
1624
- for (const r of e) {
1625
- const e = {}, o = r[0];
1626
- o && (e.uri = o), t.start("a:ext", e), t.empty(r[1], r[2]), t.end("a:ext");
1627
- }
1628
- t.end("a:extLst");
1629
- }
1630
- }, Ze = async (t, e, r, o, n) => {
1631
- const s = t.getSharedStates(), a = o.getContent().getResource(), l = await a.getExternalURI();
1632
- let i;
1633
- if (l) i = t.addExternal(Gt, l);
1634
- else if (i = r.get(a), !i) {
1635
- let e = s.get("imagesWritten");
1636
- e || (e = /* @__PURE__ */ new Map(), s.set("imagesWritten", e));
1637
- let o = e.get(a);
1638
- if (!o) {
1639
- const t = await a.toBuffer();
1640
- o = {
1641
- bytes: new Uint8Array(t),
1642
- type: await a.getType() ?? Jt,
1643
- index: e.size + 1
1644
- }, e.set(a, o);
1645
- }
1646
- i = t.addBinary(o.bytes, o.type.mime, Gt, `../media/image${o.index}.${o.type.ext}`, !0), r.set(a, i);
1647
- }
1648
- const c = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
1649
- l ? c["r:link"] = i.relId : c["r:embed"] = i.relId;
1650
- const d = [];
1651
- l || d.push([
1652
- "{28A0092B-C50C-407E-A947-70E740481C1C}",
1653
- "a14:useLocalDpi",
1654
- {
1655
- "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main",
1656
- val: "0"
1657
- }
1658
- ]);
1659
- const p = t.getXMLWriter();
1660
- p.start("pic"), p.start("nvPicPr"), ir(t, p, o, n, e), dr(t, p, o, n), p.end("nvPicPr"), p.start("blipFill"), p.start("a:blip", c), Ye(p, d), p.end("a:blip"), p.start("a:stretch"), p.empty("a:fillRect"), p.end("a:stretch"), p.end("blipFill"), ar(t, e, r, o, n), p.end("pic");
1661
- }, Qe = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart", tr = async (t, e, r, o, n, s) => {
1662
- const a = n.content?.json, l = a?.xml, i = a?.chartRelId, c = a?.chartTargetPath;
1663
- if (!l || !i || !c) return sr(t, e, r, o, n);
1664
- const d = t.getSharedStates();
1665
- let p, m = d.get("claimedChartTargets");
1666
- if (m || (m = /* @__PURE__ */ new Set(), d.set("claimedChartTargets", m)), m.has(c)) {
1667
- const s = t.forkPreservedPart(c, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", Qe, "../charts/chart{n}.xml");
1668
- if (!s?.relId) return sr(t, e, r, o, n);
1669
- p = s.relId;
1670
- } else m.add(c), p = t.addPreservedRelationship(Qe, c, i);
1671
- let f = p === i ? l : l.replace(`r:id="${i}"`, `r:id="${p}"`);
1672
- void 0 !== s && "number" == typeof a?.sourceId && (f = f.replace(`cNvPr id="${a.sourceId}"`, `cNvPr id="${s}"`)), t.getXMLWriter().raw(f);
1673
- }, er = async (t, e, r, o, n) => sr(t, e, r, o, n), rr = async (t, e, r, o, n) => sr(t, e, r, o, n), or = async (t, e, r, o, n) => sr(t, e, r, o, n), nr = async (t, e, r, o, n, s) => {
1674
- const a = n.content?.json, l = a?.xml;
1675
- if (!l) return sr(t, e, r, o, n);
1676
- const i = void 0 !== s && "number" == typeof a?.sourceId ? l.replace(`cNvPr id="${a.sourceId}"`, `cNvPr id="${s}"`) : l;
1677
- t.getXMLWriter().raw(i);
1678
- }, sr = async (t, e, r, o, n) => {
1679
- (async (t, e, r, o, n) => {
1680
- const s = t.getXMLWriter(), a = {}, l = n.content?.json, i = l?.type ?? "sp", c = e.getStyles();
1681
- "cxnSp" === i ? (a.macro = "", s.start("cxnSp", a), s.start("nvCxnSpPr"), ir(t, s, o, n, e), cr(t, s, o, n, e), s.start("cNvCxnSpPr"), s.empty("a:stCnx", {
1682
- id: "0",
1683
- idx: "0"
1684
- }), s.end("cNvCxnSpPr"), s.end("nvCxnSpPr"), ar(t, e, r, o, n), lr(t, e, r, o, n), qe(t, c, l?.text), s.end("cxnSp")) : "grpSp" === i || (a.macro = "", a.textlink = "", s.start("sp", a), s.start("nvSpPr"), ir(t, s, o, n, e), cr(t, s, o, n, e), s.end("nvSpPr"), ar(t, e, r, o, n), lr(t, e, r, o, n), qe(t, c, l?.text), s.end("sp"));
1685
- })(t, e, r, o, {
1686
- ...n,
1687
- content: {
1688
- type: "shape",
1689
- json: {
1690
- fill: "bg1",
1691
- stroke: {
1692
- width: 2,
1693
- fill: "red"
1694
- },
1695
- text: { runs: [{
1696
- text: "Unsupported Type: " + (n.content?.type ?? "unknown"),
1697
- color: "tx1"
1698
- }] }
1699
- }
1700
- }
1701
- });
1702
- }, ar = (t, e, r, o, n) => {
1703
- const s = t.getXMLWriter(), a = n.content?.json, l = a?.geometry ?? "rect", i = e.getStyles();
1704
- s.start("spPr"), s.pushDefaultNamespace("a"), pr(s, o, n), s.start("prstGeom", { prst: l }), s.empty("avLst"), s.end("prstGeom"), Xt(t, i, a), s.popDefaultNamespace(), s.end("spPr");
1705
- }, lr = (t, e, r, o, n) => {
1706
- const s = t.getXMLWriter();
1707
- 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");
1708
- }, ir = (t, e, r, o, n) => {
1709
- const s = t.getSharedStates();
1710
- let a = s.get("uniqueIdCounter");
1711
- a || (a = /* @__PURE__ */ new Map(), s.set("uniqueIdCounter", a));
1712
- let l = a.get(n) ?? 1;
1713
- l++, a.set(n, l);
1714
- const i = {
1715
- id: "" + l,
1716
- name: o.name
1717
- };
1718
- o.description && (i.descr = o.description), o.hidden && (i.hidden = "1");
1719
- const c = [];
1720
- c.push([
1721
- "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}",
1722
- "a16:creationId",
1723
- {
1724
- "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
1725
- id: `{${k.uuidV4().toUpperCase()}}`
1726
- }
1727
- ]), e.start("cNvPr", i), Ye(e, c), e.end("cNvPr");
1728
- }, cr = (t, e, r, o, n) => {
1729
- e.empty("cNvSpPr");
1730
- }, dr = (t, e, r, o) => {
1731
- const n = {};
1732
- if (o.lockAspect && (n.noChangeAspect = "1"), o.locks) for (const t of Object.keys(o.locks)) !0 === o.locks[t] && (n[t] = "1");
1733
- e.start("cNvPicPr", {}), e.empty("a:picLocks", n), e.end("cNvPicPr");
1734
- }, pr = (t, e, r) => {
1735
- const o = e.getBounds(), n = {}, s = r.rotation;
1736
- void 0 !== s && 0 !== s && (n.rot = "" + Zt(s)), t.start("xfrm", n), t.start("off", {
1737
- x: Yt(o.x),
1738
- y: Yt(o.y)
1739
- }), t.end("off"), t.start("ext", {
1740
- cx: Yt(o.width),
1741
- cy: Yt(o.height)
1742
- }), t.end("ext"), t.end("xfrm");
1743
- }, mr = (t, e, r) => {
1744
- t.start(e), t.start("col"), t.text(r.c ?? 0), t.end("col"), t.start("colOff"), t.text(Yt(r.x)), t.end("colOff"), t.start("row"), t.text(r.r ?? 0), t.end("row"), t.start("rowOff"), t.text(Yt(r.y)), t.end("rowOff"), t.end(e);
1745
- }, fr = 0, ur = (t, e, r, o) => {
1746
- const n = o.columns, s = n ? n.length : 0;
1747
- if (0 !== s) {
1748
- e.start("tableColumns", { count: s });
1749
- for (let t = 0; t < s; t++) {
1750
- let r = n[t];
1751
- "string" == typeof r && (r = { name: r });
1752
- const o = {};
1753
- o.id = t + 1, o.name = r.name ?? `Column${t + 1}`;
1754
- let s = null, a = r.totalsRowFormula;
1755
- a && ("number" == typeof a && (a = yr.get(a)), a && !gr.has(a.toLowerCase()) && (s = a, a = "custom"), a && (o.totalsRowFunction = a)), r.totalsRowLabel && (o.totalsRowLabel = r.totalsRowLabel), s ? (e.start("tableColumn", o), e.start("totalsRowFormula"), e.text(s), e.end("totalsRowFormula"), e.end("tableColumn")) : e.empty("tableColumn", o);
1756
- }
1757
- e.end("tableColumns");
1758
- }
1759
- }, hr = (t, e, r, o) => {
1760
- const n = {
1761
- name: r.getStyle().getName(),
1762
- showFirstColumn: r.isShowHighlightFirstColumn() ? "1" : "0",
1763
- showLastColumn: r.isShowHighlightLastColumn() ? "1" : "0",
1764
- showRowStripes: r.isShowBandedRows() ? "1" : "0",
1765
- showColumnStripes: r.isShowBandedColumns() ? "1" : "0"
1766
- };
1767
- e.empty("tableStyleInfo", n);
1768
- }, gr = /* @__PURE__ */ new Map([
1769
- ["average", 101],
1770
- ["countnums", 102],
1771
- ["count", 103],
1772
- ["max", 104],
1773
- ["min", 105],
1774
- ["product", 106],
1775
- ["stddev", 107],
1776
- ["stddevp", 108],
1777
- ["sum", 109],
1778
- ["var", 110]
1779
- ]), yr = /* @__PURE__ */ new Map();
1780
- gr.forEach((t, e) => {
1781
- yr.set(t, e);
1782
- });
1783
- var xr = (t, e, r, o) => {
1784
- e.start("mc:AlternateContent", { "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006" }), e.start("mc:Choice", {
1785
- Requires: "c14",
1786
- "xmlns:c14": "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
1787
- }), 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");
1788
- }, vr = (t, e, r, o, n) => {
1789
- e.start("chart"), ((t, e, r, o, n) => {
1790
- e.start("title"), e.empty("overlay", { val: "0" }), Xt(t, r, n, "spPr", !0), e.end("title"), e.empty("autoTitleDeleted", { val: "0" });
1791
- })(t, e, r, 0, n), ((t, e, r, o, n) => {
1792
- e.start("plotArea"), e.empty("layout"), Xt(t, r, n, "spPr", !0), e.end("plotArea");
1793
- })(t, e, r, 0, n), e.empty("plotVisOnly", { val: "1" }), e.empty("dispBlanksAs", { val: "gap" }), e.empty("showDLblsOverMax", { val: "0" }), e.end("chart");
1794
- }, Sr = (t, e, r, o) => {
1795
- e.start("printSettings"), e.empty("headerFooter"), e.empty("pageMargins", {
1796
- b: "0.75",
1797
- l: "0.7",
1798
- r: "0.7",
1799
- t: "0.75",
1800
- header: "0.3",
1801
- footer: "0.3"
1802
- }), e.empty("pageSetup"), e.end("printSettings");
1803
- }, wr = (t, e, r, o, n, s = "0") => {
1804
- const a = n?.color, l = { idx: n?.idx ?? s };
1805
- void 0 !== a ? (e.start(o, l), "auto" === a ? e.empty("styleClr", { val: "auto" }) : (e.pushDefaultNamespace("a"), Ft(e, r.getTheme(), a), e.popDefaultNamespace()), e.end(o)) : e.empty(o, l);
1806
- }, br = (t, e, r, o) => {
1807
- const n = r.length;
1808
- for (let s = 0; s < n; s++) {
1809
- const n = r[s];
1810
- n.empty ? e.empty(n.type, n.mods) : (e.start(n.type, n.mods), wr(0, e, o, "lnRef", n.lineRef, "0"), wr(0, e, o, "fillRef", n.fillRef, "0"), wr(0, e, o, "effectRef", n.effectRef, "0"), wr(0, e, o, "fontRef", n.fontRef, "minor"), Xt(t, o, n, "spPr"), Ge(t, 0, n.defRPr), Je(t, o, n.bodyPr), e.end(n.type));
1811
- }
1812
- }, to = Object.freeze([
1813
- {
1814
- type: "axisTitle",
1815
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
1816
- defRPr: {
1817
- size: 10,
1818
- kern: 12
1819
- }
1820
- },
1821
- {
1822
- type: "categoryAxis",
1823
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
1824
- stroke: {
1825
- width: .75,
1826
- cap: "flat",
1827
- cmpd: "sng",
1828
- algn: "ctr",
1829
- round: !0,
1830
- fill: "tx1 lumMod 15 lumOff 85"
1831
- },
1832
- defRPr: {
1833
- size: 9,
1834
- kern: 12
1835
- }
1836
- },
1837
- {
1838
- type: "chartArea",
1839
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
1840
- fontRef: { color: "tx1" },
1841
- fill: {
1842
- type: "solid",
1843
- color: "bg1"
1844
- },
1845
- stroke: {
1846
- width: .75,
1847
- cap: "flat",
1848
- cmpd: "sng",
1849
- algn: "ctr",
1850
- round: !0,
1851
- fill: "tx1 lumMod 15 lumOff 85"
1852
- },
1853
- defRPr: {
1854
- size: 10,
1855
- kern: 12
1856
- }
1857
- },
1858
- {
1859
- type: "dataLabel",
1860
- fontRef: { color: "tx1 lumMod 75 lumOff 25" },
1861
- defRPr: {
1862
- size: 9,
1863
- kern: 12
1864
- }
1865
- },
1866
- {
1867
- type: "dataLabelCallout",
1868
- fontRef: { color: "dk1 lumMod 65 lumOff 35" },
1869
- fill: {
1870
- type: "solid",
1871
- color: "lt1"
1872
- },
1873
- stroke: { fill: "dk1 lumMod 25 lumOff 75" },
1874
- defRPr: {
1875
- size: 9,
1876
- kern: 12
1877
- },
1878
- bodyPr: {
1879
- rot: "0",
1880
- spcFirstLastPara: "1",
1881
- vertOverflow: "clip",
1882
- horzOverflow: "clip",
1883
- vert: "horz",
1884
- wrap: "square",
1885
- lIns: "36576",
1886
- tIns: "18288",
1887
- rIns: "36576",
1888
- bIns: "18288",
1889
- anchor: "ctr",
1890
- anchorCtr: "1",
1891
- spAutoFit: "true"
1892
- }
1893
- },
1894
- {
1895
- type: "dataPoint",
1896
- fillRef: {
1897
- idx: "1",
1898
- color: "auto"
1899
- },
1900
- fontRef: { color: "tx1" }
1901
- },
1902
- {
1903
- type: "dataPoint3D",
1904
- fillRef: {
1905
- idx: "1",
1906
- color: "auto"
1907
- },
1908
- fontRef: { color: "tx1" }
1909
- },
1910
- {
1911
- type: "dataPointLine",
1912
- lineRef: { color: "auto" },
1913
- fillRef: { idx: "1" },
1914
- fontRef: { color: "tx1" },
1915
- stroke: {
1916
- width: 2.25,
1917
- cap: "rnd",
1918
- fill: "phClr",
1919
- round: !0
1920
- }
1921
- },
1922
- {
1923
- type: "dataPointMarker",
1924
- lineRef: { color: "auto" },
1925
- fillRef: {
1926
- idx: "1",
1927
- color: "auto"
1928
- },
1929
- fontRef: { color: "tx1" },
1930
- stroke: {
1931
- width: .75,
1932
- fill: "phClr"
1933
- }
1934
- },
1935
- {
1936
- type: "dataPointMarkerLayout",
1937
- mods: {
1938
- symbol: "circle",
1939
- size: "5"
1940
- },
1941
- empty: !0
1942
- },
1943
- {
1944
- type: "dataPointWireframe",
1945
- lineRef: { color: "auto" },
1946
- fillRef: { idx: "1" },
1947
- fontRef: { color: "tx1" },
1948
- stroke: {
1949
- width: .75,
1950
- cap: "rnd",
1951
- fill: "phClr",
1952
- round: !0
1953
- }
1954
- },
1955
- {
1956
- type: "dataTable",
1957
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
1958
- fill: { type: "none" },
1959
- stroke: {
1960
- width: .75,
1961
- cap: "flat",
1962
- cmpd: "sng",
1963
- algn: "ctr",
1964
- round: !0,
1965
- fill: "tx1 lumMod 15 lumOff 85"
1966
- },
1967
- defRPr: {
1968
- size: 9,
1969
- kern: 12
1970
- }
1971
- },
1972
- {
1973
- type: "downBar",
1974
- fontRef: { color: "tx1" },
1975
- fill: {
1976
- type: "solid",
1977
- color: "dk1 lumMod 75 lumOff 25"
1978
- },
1979
- stroke: {
1980
- width: .75,
1981
- cap: "flat",
1982
- cmpd: "sng",
1983
- algn: "ctr",
1984
- round: !0,
1985
- fill: "tx1 lumMod 65 lumOff 35"
1986
- }
1987
- },
1988
- {
1989
- type: "dropLine",
1990
- fontRef: { color: "tx1" },
1991
- stroke: {
1992
- width: .75,
1993
- cap: "flat",
1994
- cmpd: "sng",
1995
- algn: "ctr",
1996
- round: !0,
1997
- fill: "tx1 lumMod 35 lumOff 65"
1998
- }
1999
- },
2000
- {
2001
- type: "errorBar",
2002
- fontRef: { color: "tx1" },
2003
- stroke: {
2004
- width: .75,
2005
- cap: "flat",
2006
- cmpd: "sng",
2007
- algn: "ctr",
2008
- round: !0,
2009
- fill: "tx1 lumMod 65 lumOff 35"
2010
- }
2011
- },
2012
- {
2013
- type: "floor",
2014
- fontRef: { color: "tx1" },
2015
- fill: { type: "none" },
2016
- stroke: {}
2017
- },
2018
- {
2019
- type: "gridlineMajor",
2020
- fontRef: { color: "tx1" },
2021
- stroke: {
2022
- width: .75,
2023
- cap: "flat",
2024
- cmpd: "sng",
2025
- algn: "ctr",
2026
- round: !0,
2027
- fill: "tx1 lumMod 15 lumOff 85"
2028
- }
2029
- },
2030
- {
2031
- type: "gridlineMinor",
2032
- fontRef: { color: "tx1" },
2033
- stroke: {
2034
- width: .75,
2035
- cap: "flat",
2036
- cmpd: "sng",
2037
- algn: "ctr",
2038
- round: !0,
2039
- fill: "tx1 lumMod 5 lumOff 95"
2040
- }
2041
- },
2042
- {
2043
- type: "hiLoLine",
2044
- fontRef: { color: "tx1" },
2045
- stroke: {
2046
- width: .75,
2047
- cap: "flat",
2048
- cmpd: "sng",
2049
- algn: "ctr",
2050
- round: !0,
2051
- fill: "tx1 lumMod 50 lumOff 50"
2052
- }
2053
- },
2054
- {
2055
- type: "leaderLine",
2056
- fontRef: { color: "tx1" },
2057
- stroke: {
2058
- width: .75,
2059
- cap: "flat",
2060
- cmpd: "sng",
2061
- algn: "ctr",
2062
- round: !0,
2063
- fill: "tx1 lumMod 35 lumOff 65"
2064
- }
2065
- },
2066
- {
2067
- type: "legend",
2068
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2069
- defRPr: {
2070
- size: 9,
2071
- kern: 12
2072
- }
2073
- },
2074
- {
2075
- type: "plotArea",
2076
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2077
- fontRef: { color: "tx1" }
2078
- },
2079
- {
2080
- type: "plotArea3D",
2081
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2082
- fontRef: { color: "tx1" }
2083
- },
2084
- {
2085
- type: "seriesAxis",
2086
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2087
- defRPr: {
2088
- size: 9,
2089
- kern: 12
2090
- }
2091
- },
2092
- {
2093
- type: "seriesLine",
2094
- fontRef: { color: "tx1" },
2095
- stroke: {
2096
- width: .75,
2097
- cap: "flat",
2098
- cmpd: "sng",
2099
- algn: "ctr",
2100
- round: !0,
2101
- fill: "tx1 lumMod 35 lumOff 65"
2102
- }
2103
- },
2104
- {
2105
- type: "title",
2106
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2107
- defRPr: {
2108
- size: 14,
2109
- b: !1,
2110
- kern: 12,
2111
- spc: 0,
2112
- baseline: 0
2113
- }
2114
- },
2115
- {
2116
- type: "trendline",
2117
- lineRef: { color: "auto" },
2118
- fontRef: { color: "tx1" },
2119
- stroke: {
2120
- width: 1.5,
2121
- cap: "rnd",
2122
- fill: "phClr",
2123
- prstDash: "sysDot"
2124
- }
2125
- },
2126
- {
2127
- type: "trendlineLabel",
2128
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2129
- defRPr: {
2130
- size: 9,
2131
- kern: 12
2132
- }
2133
- },
2134
- {
2135
- type: "upBar",
2136
- fontRef: { color: "tx1" },
2137
- fill: {
2138
- type: "solid",
2139
- color: "lt1"
2140
- },
2141
- stroke: {
2142
- width: .75,
2143
- cap: "flat",
2144
- cmpd: "sng",
2145
- algn: "ctr",
2146
- round: !0,
2147
- fill: "tx1 lumMod 65 lumOff 35"
2148
- }
2149
- },
2150
- {
2151
- type: "valueAxis",
2152
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2153
- defRPr: {
2154
- size: 9,
2155
- kern: 12
2156
- }
2157
- },
2158
- {
2159
- type: "wall",
2160
- fontRef: { color: "tx1" },
2161
- fill: { type: "none" },
2162
- stroke: {}
2163
- }
2164
- ]), eo = (t, e, r) => {
2165
- const o = r.length;
2166
- for (let t = 0; t < o; t++) {
2167
- const o = r[t], n = {}, s = o[0], a = o[1];
2168
- 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);
2169
- }
2170
- }, ro = Object.freeze([
2171
- [0, 0],
2172
- [6e4, 0],
2173
- [8e4, 2e4],
2174
- [8e4, 0],
2175
- [6e4, 4e4],
2176
- [5e4, 0],
2177
- [7e4, 3e4],
2178
- [7e4, 0],
2179
- [5e4, 5e4]
2180
- ]), oo = [
2181
- new class extends U {
2182
- constructor() {
2183
- super({
2184
- kind: "workbook",
2185
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
2186
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
2187
- path: "/xl/workbook.xml"
2188
- });
2189
- }
2190
- async emit(t, e) {
2191
- const r = e.getXMLWriter();
2192
- r.decl(), r.start("workbook", {
2193
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2194
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2195
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2196
- "mc:Ignorable": "x15 xr xr6 xr10 xr2",
2197
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main",
2198
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
2199
- "xmlns:xr6": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision6",
2200
- "xmlns:xr10": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision10",
2201
- "xmlns:xr2": "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"
2202
- });
2203
- const o = /* @__PURE__ */ new Set(), n = t.getCalculation().getNamedFormulas().getItems();
2204
- for (let t = 0; t < n.length; t++) o.add(n[t].getName().toUpperCase());
2205
- const s = l(o), a = await t.toJSON({
2206
- ignoreData: !0,
2207
- ignoreResources: !0,
2208
- includeHeaderStyles: !0,
2209
- formulaTransform: s,
2210
- splitDirectBorders: !0
2211
- });
2212
- (function(t, e, r) {
2213
- const o = {};
2214
- r.getRuntime().isDate1904() && (o.date1904 = "1");
2215
- e.empty("workbookPr", o);
2216
- })(0, r, t), function(t, e, r, o) {
2217
- const n = o.protection;
2218
- if (!n) return;
2219
- const s = {};
2220
- Tt(n.password ?? {}, s, "workbook"), Tt(n.revisionsPassword ?? {}, s, "revisions"), n.structure && (s.lockStructure = "1");
2221
- n.windows && (s.lockWindows = "1");
2222
- n.revision && (s.lockRevision = "1");
2223
- e.empty("workbookProtection", s);
2224
- }(0, r, 0, a), function(t, e, r) {
2225
- e.start("bookViews");
2226
- const o = r.getView(), n = {};
2227
- o.isShowHorizontalScrollbar() || (n.showHorizontalScroll = "0");
2228
- o.isShowVerticalScrollbar() || (n.showVerticalScroll = "0");
2229
- o.isShowTabs() || (n.showSheetTabs = "0");
2230
- const s = o.getTabRatio();
2231
- 600 !== s && (n.tabRatio = s);
2232
- const a = r.getSelectedSheet().getIndex();
2233
- 0 !== a && (n.activeTab = "" + a);
2234
- e.empty("workbookView", n), e.end("bookViews");
2235
- }(0, r, t, a.view), r.start("sheets");
2236
- const i = e.getSharedStates();
2237
- i.set("formulaTransform", s);
2238
- const c = t.getStrings().beginPersist();
2239
- i.set("persistStrings", c);
2240
- const d = new kt();
2241
- i.set("metaCollector", d);
2242
- const p = new Mt(d, e.warn.bind(e));
2243
- i.set("persistRichTypes", p);
2244
- try {
2245
- const o = t.getSheets().getItems({ visibility: _.Visibility.VeryHidden }), n = a.sheets, s = t.getSelectedSheet(), l = o.length;
2246
- for (let t = 0; t < l; t++) {
2247
- const a = o[t], l = "" + (a.getIndex() + 1), i = {
2248
- name: a.getName(),
2249
- sheetId: l
2250
- }, d = a.getVisibility();
2251
- "hidden" === d ? i.state = "hidden" : "veryHidden" === d && (i.state = "veryHidden");
2252
- const p = n[t].sheet;
2253
- i["r:id"] = e.addPart("worksheet", {
2254
- model: a,
2255
- isSelected: s === a,
2256
- json: p,
2257
- persistStrings: c
2258
- }).relId, r.empty("sheet", i);
2259
- }
2260
- await e.waitEmit();
2261
- const d = t.getTheme();
2262
- e.addPart("theme", {
2263
- model: d,
2264
- json: a.theme
2265
- }), await e.waitEmit(), e.addPart("styles", {
2266
- styles: t.getStyles(),
2267
- theme: t.getTheme(),
2268
- json: a.styles
2269
- }), await e.waitEmit();
2270
- const p = await c.toJSONAsync();
2271
- p && p.length > 0 && (e.addPart("sharedStrings", {
2272
- model: p,
2273
- json: p
2274
- }), await e.waitEmit());
2275
- const m = i.get("persistRichTypes");
2276
- m?.hasAny() && (e.addPart("richValue", m), e.addPart("richValueStructure", m), e.addPart("richValueTypes", null), await e.waitEmit());
2277
- const f = i.get("metaCollector");
2278
- f?.hasAny() && (e.addPart("metadata", f), await e.waitEmit()), i.delete("persistRichTypes"), i.delete("metaCollector"), i.delete("persistStrings");
2279
- } catch (t) {
2280
- throw t;
2281
- } finally {
2282
- c.endPersist();
2283
- }
2284
- r.end("sheets"), function(t, e, r, o, n) {
2285
- const s = o.names, a = s ? s.length : 0;
2286
- if (0 === a) return;
2287
- const l = r.getCalculation().getNamedFormulas(), i = /* @__PURE__ */ new Map(), c = r.getSheets().getItems({ visibility: _.Visibility.VeryHidden });
2288
- for (let t = 0; t < c.length; t++) i.set(c[t].getName().toLowerCase(), t);
2289
- e.start("definedNames");
2290
- for (let r = 0; r < a; r++) {
2291
- const o = s[r], a = { name: o.name };
2292
- if (o.comment && (a.comment = o.comment), o.scope) {
2293
- const e = i.get(o.scope.toLowerCase());
2294
- void 0 !== e ? a.localSheetId = "" + e : t.warn(`Defined name '${o.name}' is scoped to unknown sheet '${o.scope}'; writing it as global.`);
2295
- }
2296
- o.hidden && (a.hidden = "1");
2297
- let c = o.ref;
2298
- const d = l.getItems({
2299
- name: o.name,
2300
- scope: o.scope ?? null
2301
- })[0];
2302
- d && (c = d.getExpression({ formulaTransform: n })), e.start("definedName", a), e.text(c), e.end("definedName");
2303
- }
2304
- e.end("definedNames");
2305
- }(e, r, t, a, s), function(t, e, r) {
2306
- const o = r.getCalculation().toJSON(), n = {}, s = (t, e) => {
2307
- const r = o[t];
2308
- "boolean" == typeof r && (n[e] = r ? "1" : "0");
2309
- };
2310
- if (o.calcMode) {
2311
- const t = It[o.calcMode];
2312
- t && "auto" !== t && (n.calcMode = t);
2313
- }
2314
- s("fullCalcOnLoad", "fullCalcOnLoad"), s("calcOnSave", "calcOnSave"), s("calcCompleted", "calcCompleted"), s("fullPrecision", "fullPrecision"), s("forceFullCalc", "forceFullCalc"), s("concurrentCalc", "concurrentCalc"), o.refMode && (n.refMode = o.refMode);
2315
- o.iterate && (n.iterate = "1");
2316
- void 0 !== o.maxIterations && (n.iterateCount = String(o.maxIterations));
2317
- void 0 !== o.maxIterateChange && (n.iterateDelta = String(o.maxIterateChange));
2318
- if (0 === Object.keys(n).length) return;
2319
- e.empty("calcPr", n);
2320
- }(0, r, t), r.end("workbook"), r.close();
2321
- }
2322
- }(),
2323
- new class extends U {
2324
- constructor() {
2325
- super({
2326
- kind: "worksheet",
2327
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
2328
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
2329
- path: () => "/xl/worksheets/sheet{n}.xml"
2330
- });
2331
- }
2332
- async emit(t, l) {
2333
- const c = l.getXMLWriter(), d = t.model, u = t.json;
2334
- c.decl(), c.start("worksheet", {
2335
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2336
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2337
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2338
- "mc:Ignorable": "x14ac",
2339
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
2340
- }), function(t, e, r) {
2341
- const o = r.getTabColor();
2342
- o && (e.start("sheetPr"), o && Pt(e, r.getStyles().getTheme(), o, "tabColor", !1), e.end("sheetPr"));
2343
- }(0, c, d), function(t, e, r, o) {
2344
- let n = r.getUsedRange({ features: [] }), s = n ? n.getCoords() : null;
2345
- const a = Se, l = we, i = o.directStyles, c = i ? i.length : 0;
2346
- for (let t = 0; t < c; t++) {
2347
- let e = r.getRange(i[t][0]).getCoords();
2348
- if (e.colEnd === l) {
2349
- const t = s?.colStart ?? 0;
2350
- e = {
2351
- ...e,
2352
- colStart: t,
2353
- colEnd: t
2354
- };
2355
- }
2356
- if (e.rowEnd === a) {
2357
- const t = s?.rowStart ?? 0;
2358
- e = {
2359
- ...e,
2360
- rowStart: t,
2361
- rowEnd: t
2362
- };
2363
- }
2364
- s = M.unionRanges(s, e);
2365
- }
2366
- const d = o.merges, p = d ? d.length : 0;
2367
- for (let t = 0; t < p; t++) {
2368
- let e = r.getRange(d[t]).getCoords();
2369
- 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 = M.unionRanges(s, e);
2370
- }
2371
- let m = "A1";
2372
- s && (n = r.getRange(s), m = s.colStart === s.colEnd && s.rowStart === s.rowEnd ? n.getAddress() : `${n.getIntersect({
2373
- colStart: s.colStart,
2374
- rowStart: s.rowStart,
2375
- colEnd: s.colStart,
2376
- rowEnd: s.rowStart
2377
- }).getAddress()}:${n.getIntersect({
2378
- colStart: s.colEnd,
2379
- rowStart: s.rowEnd,
2380
- colEnd: s.colEnd,
2381
- rowEnd: s.rowEnd
2382
- }).getAddress()}`);
2383
- e.empty("dimension", { ref: m });
2384
- }(0, c, d, u), function(t, e, r, o, n) {
2385
- const s = r.getView(), a = s.getTopLeft(), l = r.getRowHeaders().getIndex(a.top), i = r.getColumnHeaders().getIndex(a.left), c = b.cellToString({
2386
- colIndex: i,
2387
- rowIndex: l
2388
- });
2389
- e.start("sheetViews");
2390
- const d = {};
2391
- s.isShowFormulas() && (d.showFormulas = "1");
2392
- s.isShowColumnGridlines() || s.isShowRowGridlines() || (d.showGridLines = "0");
2393
- s.isShowColumnHeaders() || s.isShowRowHeaders() || (d.showRowColHeaders = "0");
2394
- s.isShowZeros() || (d.showZeros = "0");
2395
- s.isRightToLeft() && (d.rightToLeft = "1");
2396
- n && (d.tabSelected = "1");
2397
- "A1" !== c && (d.topLeftCell = c);
2398
- const p = s.getZoomScale();
2399
- 100 !== p && (d.zoomScale = p, d.zoomScaleNormal = p);
2400
- const m = s.getGridLineColor();
2401
- if (m) {
2402
- d.defaultGridColor = "0";
2403
- const t = m.toRGBA(), e = t.red, o = t.green, n = t.blue, s = r.getStyles().getIndexedColors(), a = s.length;
2404
- let l = 0, i = Number.MAX_VALUE;
2405
- for (let t = 0; t < a; t++) {
2406
- const r = s[t].toRGBA(), a = (e - r.red) ** 2 + (o - r.green) ** 2 + (n - r.blue) ** 2;
2407
- a < i && (i = a, l = t);
2408
- }
2409
- d.colorId = "" + l;
2410
- }
2411
- d.workbookViewId = "0";
2412
- const f = r.getSelection().getCoords(), u = b.cellToString(f.cell);
2413
- let h = {};
2414
- const g = s.getFreezePanes(), y = g.coords ?? {}, x = y.colIndex ?? 0, v = y.rowIndex ?? 0;
2415
- if (x > 0 || v > 0) {
2416
- 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, p = Math.max(x, r.getColumnHeaders().getIndex(a.left + r.getColumnHeaders().getOffset(x) - n)), m = Math.max(v, r.getRowHeaders().getIndex(a.top + r.getRowHeaders().getOffset(v) - o)), f = b.cellToString({
2417
- colIndex: l,
2418
- rowIndex: s
2419
- });
2420
- "A1" !== f ? d.topLeftCell = f : delete d.topLeftCell, e.start("sheetView", d);
2421
- const u = {};
2422
- if (i > 0 && (u.xSplit = i), c > 0 && (u.ySplit = c), u.topLeftCell = b.cellToString({
2423
- colIndex: p,
2424
- rowIndex: m
2425
- }), u.state = "frozen", 0 === x) {
2426
- u.activePane = "bottomLeft", e.empty("pane", u);
2427
- const t = b.cellToString({
2428
- colIndex: p,
2429
- rowIndex: s
2430
- });
2431
- "A1" !== t && e.empty("selection", {
2432
- activeCell: t,
2433
- sqref: t
2434
- }), h.pane = "bottomLeft";
2435
- } else if (0 === v) {
2436
- u.activePane = "topRight", e.empty("pane", u);
2437
- const t = b.cellToString({
2438
- colIndex: l,
2439
- rowIndex: m
2440
- });
2441
- "A1" !== t && e.empty("selection", {
2442
- activeCell: t,
2443
- sqref: t
2444
- }), h.pane = "topRight";
2445
- } else {
2446
- u.activePane = "bottomRight", e.empty("pane", u), "A1" !== f && e.empty("selection", {
2447
- activeCell: f,
2448
- sqref: f
2449
- });
2450
- const t = b.cellToString({
2451
- colIndex: p,
2452
- rowIndex: s
2453
- });
2454
- e.empty("selection", {
2455
- pane: "topRight",
2456
- activeCell: t,
2457
- sqref: t
2458
- });
2459
- const r = b.cellToString({
2460
- colIndex: l,
2461
- rowIndex: m
2462
- });
2463
- e.empty("selection", {
2464
- pane: "bottomLeft",
2465
- activeCell: r,
2466
- sqref: r
2467
- }), h.pane = "bottomRight";
2468
- }
2469
- } else e.start("sheetView", d);
2470
- h.activeCell = u;
2471
- const S = f.ranges, w = S ? S.length : 0;
2472
- if (w > 0) {
2473
- let t = "";
2474
- for (let e = 0; e < w; e++) {
2475
- const r = S[e];
2476
- e > 0 && (t += " "), t += b.rangeToString(r);
2477
- }
2478
- h.sqref = t, (f.rangeIndex ?? 0) > 0 && (h.activeCellId = "" + f.rangeIndex);
2479
- } else "A1" === u ? h = null : h.sqref = u;
2480
- h && e.empty("selection", h);
2481
- e.end("sheetView"), e.end("sheetViews");
2482
- }(0, c, d, 0, t.isSelected), function(t, e, r, o) {
2483
- const n = o.defaultColSize, s = o.defaultRowSize, a = {};
2484
- void 0 !== n && (a.defaultColWidth = n);
2485
- a.defaultRowHeight = s ?? .75 * r.getRowHeaders().getDefaultSize(), void 0 !== s && (a.customHeight = "1");
2486
- a["x14ac:dyDescent"] = "0.25", e.empty("sheetFormatPr", a);
2487
- }(0, c, d, u), function(t, e, r, o) {
2488
- const n = o.cols ? b.refsToRuns(o.cols, !0) : null, s = n ? n.length : 0;
2489
- r.getEntireRange().getColumnEnd();
2490
- const a = r.getColumnHeaders().getDefaultSizeNative();
2491
- if (s > 0) {
2492
- e.start("cols");
2493
- for (let t = 0; t < s; t++) {
2494
- const r = n[t], o = r.min + 1, s = 16384;
2495
- if (o > s) continue;
2496
- const l = {
2497
- min: o,
2498
- max: Math.min(r.max + 1, s)
2499
- }, i = r.value, c = i.sz;
2500
- void 0 !== c ? 0 !== c && (l.width = Math.round(256 * c) / 256) : l.width = a, i.s && (l.style = i.s), void 0 !== i.h && (l.hidden = 1), i.csz && (l.customWidth = 1), void 0 !== i.l && (l.outlineLevel = i.l), void 0 !== i.cl && (l.collapsed = 1), e.empty("col", l);
2501
- }
2502
- e.end("cols");
2503
- }
2504
- }(0, c, d, u), function(t, e, n, s, a) {
2505
- const l = t.getSharedStates(), c = l.get("persistStrings"), d = l.get("metaCollector"), f = l.get("persistRichTypes"), u = l.get("formulaTransform");
2506
- let h = 0, y = 0;
2507
- const x = n.getUsedRange();
2508
- let w = 0;
2509
- const C = s.rows ? b.refsToRuns(s.rows, !1) : null, T = C ? C.length : 0, k = C?.[T - 1]?.max ?? -1, M = s.cols ? b.refsToRuns(s.cols, !0) : null, I = M ? M.length : 0, F = M?.[I - 1]?.max ?? -1;
2510
- if (x || T > 0) {
2511
- const l = .75, x = s.defaultRowSize ?? n.getRowHeaders().getDefaultSize() * l, T = n.getStyles().getNormal().getBestFit().height * l, I = (t, e) => {
2512
- const r = Ne;
2513
- 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;
2514
- const o = e.value;
2515
- void 0 !== o.s && (r.s = "" + o.s, r.customFormat = "1"), o.h && (r.hidden = "1");
2516
- const n = o.csz ?? !1, s = o.sz ?? x;
2517
- return (s !== T || 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;
2518
- };
2519
- let A = 0, P = C?.[A] ?? null, L = P?.min ?? Number.MAX_SAFE_INTEGER, _ = P?.max ?? Number.MAX_SAFE_INTEGER, D = P?.value?.s, E = -1, N = 0, O = M?.[N] ?? null, B = O?.min ?? Number.MAX_SAFE_INTEGER, $ = O?.max ?? Number.MAX_SAFE_INTEGER, W = O?.value?.s;
2520
- const z = (t, r = !1) => {
2521
- if (E !== t) {
2522
- for (-1 !== E && (e.end("row"), 0 !== N && (N = 0, O = M?.[N] ?? null, B = O?.min ?? Number.MAX_SAFE_INTEGER, $ = O?.max ?? Number.MAX_SAFE_INTEGER, W = O?.value?.s)); E + 1 <= t;) {
2523
- E++, P && E > _ && (P = C[++A] ?? null, P ? (L = P.min, _ = P.max, D = P.value?.s) : (L = Number.MAX_SAFE_INTEGER, _ = Number.MAX_SAFE_INTEGER, D = void 0)), E < L && E < t && (E = P ? Math.min(L, t) : t);
2524
- const o = E < t || r && E === t, n = I(E, P && E >= L && E <= _ ? P : null);
2525
- o ? e.empty("row", n) : e.start("row", n);
2526
- }
2527
- if (t < E) {
2528
- const r = I(t, null);
2529
- e.start("row", r);
2530
- }
2531
- }
2532
- };
2533
- e.setValidationDisabled(!0), e.start("sheetData");
2534
- const j = [];
2535
- j.push(Te(t, n, s.directStyles));
2536
- const X = s.formulas, U = X ? X.length : 0;
2537
- if (U > 0) {
2538
- const t = /* @__PURE__ */ new Map();
2539
- if (a.names.size > 0 && s.formulaArray) for (const e of s.formulaArray) try {
2540
- const r = n.getRange(e[0]).getCoords();
2541
- t.set(`${r.rowStart},${r.colStart}`, r);
2542
- } catch {}
2543
- const e = [];
2544
- if (s.formulaArray) for (const t of s.formulaArray) try {
2545
- e.push(n.getRange(t[0]).getCoords());
2546
- } catch {}
2547
- const l = (t) => {
2548
- for (let r = 0; r < e.length; r++) {
2549
- const o = e[r];
2550
- if (o.rowStart <= t.rowEnd && o.rowEnd >= t.rowStart && o.colStart <= t.colEnd && o.colEnd >= t.colStart) return !0;
2551
- }
2552
- return !1;
2553
- }, c = S(() => n.getCalculation()), d = (t) => {
2554
- if (!t) return;
2555
- let e;
2556
- return t.getExpression({ formulaTransform: (t, r) => {
2557
- void 0 === r && (e = t);
2558
- } }), e;
2559
- }, p = [];
2560
- for (let e = 0; e < U; e++) {
2561
- const s = X[e];
2562
- try {
2563
- const f = s[0], h = n.getRange(f), g = h.getCoords();
2564
- let y = s[1], x = null;
2565
- const v = d(h.getCell().getFormula());
2566
- let S = !!v && o(v, c);
2567
- const C = r(v);
2568
- if (a.affects(e)) {
2569
- x = null, S = !1;
2570
- const e = (t, e, r) => {
2571
- const o = {
2572
- rowStart: t,
2573
- colStart: e,
2574
- rowEnd: t,
2575
- colEnd: e
2576
- };
2577
- p.push([o, {
2578
- coords: o,
2579
- formula: r,
2580
- sharedId: null,
2581
- ref: b.rangeToString(o),
2582
- isDynamicRange: !1,
2583
- isWrapped: !0
2584
- }]);
2585
- }, r = t.get(`${g.rowStart},${g.colStart}`), o = void 0 !== r && (r.rowEnd > r.rowStart || r.colEnd > r.colStart);
2586
- let s = !1;
2587
- if (o) {
2588
- const t = m(y, h.getCell().getValue());
2589
- if (null !== t) for (let o = r.rowStart; o <= r.rowEnd; o++) for (let a = r.colStart; a <= r.colEnd; a++) {
2590
- if (o === r.rowStart && a === r.colStart) {
2591
- e(o, a, t), s = !0;
2592
- continue;
2593
- }
2594
- const l = i(n.getRange(b.rangeToString({
2595
- rowStart: o,
2596
- colStart: a,
2597
- rowEnd: o,
2598
- colEnd: a
2599
- })).getCell().getValue());
2600
- null !== l && e(o, a, l);
2601
- }
2602
- } else {
2603
- const t = h.getCells();
2604
- for (let r = 0; r < t.length; r++) {
2605
- const o = t[r];
2606
- for (let t = 0; t < o.length; t++) {
2607
- const n = o[t], a = m(n.getFormula()?.getExpression() ?? y, n.getValue());
2608
- null !== a && (e(g.rowStart + r, g.colStart + t, a), s = !0);
2609
- }
2610
- }
2611
- }
2612
- if (s) continue;
2613
- }
2614
- const T = -1 !== y.indexOf("!") || -1 !== y.indexOf("[");
2615
- let k;
2616
- if (S || h.isSingleCell() || T || l(g) || (x = "" + w++), null === x && !h.isSingleCell()) {
2617
- k = [];
2618
- const t = h.getCells();
2619
- for (let e = 0; e < t.length; e++) {
2620
- const r = t[e], o = new Array(r.length);
2621
- for (let t = 0; t < r.length; t++) 0 === e && 0 === t || (o[t] = r[t].getFormula()?.getExpression({ formulaTransform: u }) ?? void 0);
2622
- k.push(o);
2623
- }
2624
- }
2625
- const M = [g, {
2626
- coords: g,
2627
- formula: y,
2628
- sharedId: x,
2629
- ref: f,
2630
- isDynamicRange: S,
2631
- isExcelVolatile: C,
2632
- memberTexts: k
2633
- }];
2634
- p.push(M);
2635
- } catch (t) {
2636
- console.warn(`Failed to parse formula: ${s[1]}`, t);
2637
- continue;
2638
- }
2639
- }
2640
- j.push(p);
2641
- } else j.push([]);
2642
- const H = s.volatile, q = H ? H.length : 0;
2643
- if (q > 0) {
2644
- const t = new Array(q);
2645
- for (let e = 0; e < q; e++) {
2646
- const r = H[e];
2647
- try {
2648
- t[e] = [n.getRange(r).getCoords(), !0];
2649
- } catch (t) {
2650
- console.warn(`Failed to parse volatile: ${r}`, t);
2651
- continue;
2652
- }
2653
- }
2654
- j.push(t);
2655
- } else j.push([]);
2656
- const G = s.formulaArray, J = G ? G.length : 0;
2657
- if (J > 0) {
2658
- const t = new Array(J);
2659
- for (let e = 0; e < J; e++) {
2660
- const r = G[e];
2661
- try {
2662
- const o = r[0];
2663
- t[e] = [n.getRange(o).getCoords(), {
2664
- ref: o,
2665
- kind: r[1] ?? "dynamic"
2666
- }];
2667
- } catch (t) {
2668
- console.warn(`Failed to parse formula array: ${r}`, t);
2669
- continue;
2670
- }
2671
- }
2672
- j.push(t);
2673
- } else j.push([]);
2674
- n.getEntireRange().forEach((r, o) => {
2675
- const n = o.getCoords(), s = n.rowIndex, a = n.colIndex;
2676
- E !== s && z(s);
2677
- let l = o.getInjectedReference(0);
2678
- if (void 0 === l && void 0 !== D && s >= L && s <= _ && (l = D), void 0 === l) {
2679
- for (; a <= F && a > $;) N++, O = M?.[N] ?? null, B = O?.min ?? Number.MAX_SAFE_INTEGER, $ = O?.max ?? Number.MAX_SAFE_INTEGER, W = O?.value?.s;
2680
- void 0 !== W && a >= B && a <= $ && (l = W);
2681
- }
2682
- const i = o.getType();
2683
- let m = null;
2684
- U > 0 && (m = o.getInjectedReference(1) ?? null);
2685
- let u = !1;
2686
- q > 0 && (u = o.getInjectedReference(2) ?? !1);
2687
- let x = null;
2688
- J > 0 && (x = o.getInjectedReference(3) ?? null);
2689
- const S = "dynamicSpillError" === x?.kind, w = "static" === x?.kind, b = Ee;
2690
- b.r = o.getAddress(), b.s = void 0, b.t = void 0, b.cm = void 0, b.vm = void 0, void 0 !== l && 0 !== l && (b.s = "" + l);
2691
- let C = null, T = null;
2692
- switch (i) {
2693
- case V.Boolean:
2694
- C = r ? "1" : "0", T = "b";
2695
- break;
2696
- case V.Error:
2697
- const t = r.getCode();
2698
- if (T = "e", t > 7) C = R.BuiltIn.Value.getLabel(), b.vm = "" + f.add(r);
2699
- else if (t < 1) {
2700
- let t;
2701
- T = "s", m ? (t = "=" + m.formula, m = null) : t = "" + r.getLabel(), C = "" + c.add(t), h++;
2702
- } else C = "" + r.getLabel();
2703
- break;
2704
- case V.Number:
2705
- C = "" + r, T = null;
2706
- break;
2707
- case V.String:
2708
- C = r, m ? (T = "str", C = r) : (T = "s", C = "" + c.add(C), h++);
2709
- break;
2710
- case V.RichData: T = "e", C = R.BuiltIn.Value.getLabel(), b.vm = "" + f.add(r);
2711
- }
2712
- T && (b.t = T);
2713
- const k = !m?.isWrapped && (null !== x || (m?.isDynamicRange ?? !1));
2714
- if (null !== m || null !== C) {
2715
- if (k && null !== m && !w && (b.cm = "" + d.registerArrayCell(S)), e.start("c", b), m) {
2716
- const t = m.memberTexts?.[s - m.coords.rowStart]?.[a - m.coords.colStart] ?? m.formula;
2717
- let r, o = null;
2718
- const n = m.sharedId;
2719
- if (n) {
2720
- r = Be;
2721
- const t = m.coords;
2722
- t.colStart === a && t.rowStart === s ? (r.ref = m.ref, r.si = n, o = m.formula) : (r.ref = void 0, r.si = n);
2723
- } else k ? (r = Ve, r.aca = S ? "1" : void 0, r.ref = S ? b.r : x?.ref ?? b.r, o = t) : (r = Oe, o = t);
2724
- r.ca = u || S || m.isExcelVolatile ? "1" : void 0, o ? (e.start("f", r), e.text(o), e.end("f")) : e.empty("f", r);
2725
- }
2726
- null !== C && ("str" === T && C ? (e.start("v", v.test(C) ? g : void 0), e.text(p(C))) : (e.start("v"), C && e.text(C)), e.end("v")), e.end("c");
2727
- } else y++ < Ce ? e.empty("c", b) : 1048577 === y && t.warn(`Reached ${Ce} style-only cells at '${b.r}'; not writing the rest.`);
2728
- }, {
2729
- injectReferences: j,
2730
- features: []
2731
- }), -1 !== E && E >= k ? e.end("row") : z(k, !0), e.end("sheetData"), e.setValidationDisabled(!1);
2732
- } else e.empty("sheetData");
2733
- if (h > 0) {
2734
- const t = l.get("stringsCount") ?? 0;
2735
- l.set("stringsCount", t + h);
2736
- }
2737
- }(l, c, d, u, await (async (t, e) => {
2738
- const r = e ? e.length : 0;
2739
- if (0 === r) return be;
2740
- const o = /* @__PURE__ */ new Set(), n = new Array(r);
2741
- for (let s = 0; s < r; s++) {
2742
- n[s] = null;
2743
- try {
2744
- const r = t.getRange(e[s][0]).getCell().getFormula()?.getTokens();
2745
- if (!r) continue;
2746
- let a = null;
2747
- for (let t = 0; t < r.length; t++) {
2748
- const e = r[t];
2749
- let n = null;
2750
- "function" === e.type ? n = String(e.value) : "named" === e.type && "paren" === r[t + 1]?.type && "(" === r[t + 1].value && (n = String(e.value?.name ?? "")), n && (n = n.toUpperCase(), o.add(n), (a ??= /* @__PURE__ */ new Set()).add(n));
2751
- }
2752
- n[s] = a;
2753
- } catch {}
2754
- }
2755
- const s = t.getWorkbook();
2756
- if (!s) return be;
2757
- const a = await f(s, o);
2758
- return 0 === a.size ? be : {
2759
- names: a,
2760
- perFormula: n,
2761
- affects: (t) => {
2762
- const e = n[t];
2763
- if (!e) return !1;
2764
- for (const t of e) if (a.has(t)) return !0;
2765
- return !1;
2766
- }
2767
- };
2768
- })(d, u.formulas)), function(t, e, r, o) {
2769
- const n = o.protection;
2770
- if (!n) return;
2771
- const s = {};
2772
- Tt(n.password ?? {}, s), s.sheet = "1";
2773
- const a = (t, e, r) => {
2774
- const o = n[t];
2775
- void 0 !== o && o !== e && (s[r ?? t] = o ? "1" : "0");
2776
- };
2777
- a("objects", "0"), a("scenarios", "0"), a("formatCells", "0"), a("formatColumns", "0"), a("formatRows", "0"), a("insertColumns", "0"), a("insertRows", "0"), a("insertHyperlinks", "0"), a("deleteColumns", "0"), a("deleteRows", "0"), a("selectLockedCells", "1"), a("sort", "0"), a("autoTable", "0", "autoFilter"), a("pivotTables", "0"), a("selectUnlockedCells", "1"), e.empty("sheetProtection", s);
2778
- }(0, c, 0, u), function(t, e, r, o) {
2779
- const n = o.protectedRanges, s = n ? n.length : 0;
2780
- if (0 === s) return;
2781
- const a = [];
2782
- for (let e = 0; e < s; e++) {
2783
- const r = n[e];
2784
- let o, s;
2785
- Array.isArray(r) ? (o = r[0], s = r[1]) : (o = r.r, s = r.v);
2786
- const l = Pe(o);
2787
- if (!l || !s) {
2788
- t.warn("Skipping protectedRange with no range.");
2789
- continue;
2790
- }
2791
- if (!s.name) {
2792
- t.warn("Skipping protectedRange with no name.");
2793
- continue;
2794
- }
2795
- const i = {};
2796
- Tt(s.password ?? {}, i), i.sqref = l, i.name = s.name, s.securityDescriptor && (i.securityDescriptor = s.securityDescriptor), a.push(i);
2797
- }
2798
- if (0 === a.length) return;
2799
- e.start("protectedRanges");
2800
- for (let t = 0; t < a.length; t++) e.empty("protectedRange", a[t]);
2801
- e.end("protectedRanges");
2802
- }(l, c, 0, u);
2803
- const h = u.autoTable;
2804
- if (h) {
2805
- let t;
2806
- const e = h;
2807
- t = Array.isArray(e) ? e[1] : e.v, he(l, c, d.getAutoTable(), t, !0);
2808
- }
2809
- (function(t, e, r, o) {
2810
- const n = o.merges ? o.merges.length : 0;
2811
- if (n > 0) {
2812
- e.start("mergeCells", { count: n });
2813
- for (let t = 0; t < n; t++) {
2814
- const r = o.merges[t], n = "string" == typeof r ? r : b.rangeToString(r);
2815
- e.empty("mergeCell", { ref: n });
2816
- }
2817
- e.end("mergeCells");
2818
- }
2819
- })(0, c, 0, u);
2820
- const C = function(t, e, r, o) {
2821
- const n = [], s = o.conditionals, a = s ? s.length : 0;
2822
- if (0 === a) return n;
2823
- const l = t.getSharedStates();
2824
- let i = l.get(ee);
2825
- i || (i = new te(), l.set(ee, i));
2826
- const c = r.getStyles().getTheme();
2827
- let d = null, p = 0;
2828
- for (let r = 0; r < a; r++) {
2829
- const o = s[r];
2830
- let a, l;
2831
- Array.isArray(o) ? (a = o[0], l = o[1]) : (a = o.r, l = o.v);
2832
- const m = Pe(a);
2833
- if (!m || !l) {
2834
- t.warn("Skipping conditionalFormatting with no range.");
2835
- continue;
2836
- }
2837
- const f = l.scale, u = f ? { type: f.type } : x(l.condition, Ae(m), (e) => t.warn(e));
2838
- u ? f?.type === A.ScaleType.IconSet && Ie(f) ? (p++, n.push({
2839
- guid: w(k.uuidV4),
2840
- sqref: m,
2841
- priority: p,
2842
- scale: f
2843
- })) : f || !De(u) ? (m !== d && (null !== d && e.end("conditionalFormatting"), e.start("conditionalFormatting", {
2844
- sqref: m,
2845
- pivot: l.pivot ? "1" : void 0
2846
- }), d = m), p++, Fe(t, e, c, l, u, m, p, i, n)) : (p++, n.push({
2847
- guid: w(k.uuidV4),
2848
- sqref: m,
2849
- priority: p,
2850
- rule: u,
2851
- style: l.style,
2852
- stopIfTrue: l.stopIfTrue
2853
- })) : l.condition || t.warn("Skipping conditional format with neither a condition nor a scale.");
2854
- }
2855
- null !== d && e.end("conditionalFormatting");
2856
- return n;
2857
- }(l, c, d, u), T = function(t, e, r, o) {
2858
- const n = [], s = o.validations, a = s ? s.length : 0;
2859
- if (0 === a) return n;
2860
- const l = [];
2861
- for (let e = 0; e < a; e++) {
2862
- const r = s[e];
2863
- let o, a;
2864
- Array.isArray(r) ? (o = r[0], a = r[1]) : (o = r.r, a = r.v);
2865
- const i = Pe(o);
2866
- if (!i || !a) {
2867
- t.warn?.("Skipping dataValidation with no range.");
2868
- continue;
2869
- }
2870
- a.ext && t.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
2871
- const { type: c, operator: d, formula1: p, formula2: m } = y(a.condition, (e) => t.warn(e)) ?? {}, f = {
2872
- type: c,
2873
- operator: d,
2874
- allowBlank: Le(a.condition?.includeBlanks ?? !1),
2875
- showDropDown: a.hideDropdown ? "1" : void 0,
2876
- showInputMessage: Le(a.showPromptMessage),
2877
- showErrorMessage: Le(a.showAlertMessage),
2878
- errorStyle: a.alertStyle ?? "information",
2879
- errorTitle: a.alertTitle,
2880
- error: a.alert,
2881
- promptTitle: a.promptTitle,
2882
- prompt: a.prompt,
2883
- imeMode: a.imeMode
2884
- };
2885
- _e(p) || _e(m) ? n.push({
2886
- attrs: f,
2887
- formula1: p,
2888
- formula2: m,
2889
- sqref: i
2890
- }) : (f.sqref = i, l.push({
2891
- attrs: f,
2892
- formula1: p,
2893
- formula2: m
2894
- }));
2895
- }
2896
- if (0 === l.length) return n;
2897
- e.start("dataValidations", { count: l.length });
2898
- for (let t = 0; t < l.length; t++) {
2899
- const { attrs: r, formula1: o, formula2: n } = l[t];
2900
- 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);
2901
- }
2902
- return e.end("dataValidations"), n;
2903
- }(l, c, 0, u);
2904
- (function(t, e, r, o) {
2905
- const n = o.hyperlinks, s = n ? n.length : 0;
2906
- if (0 === s) return;
2907
- e.start("hyperlinks");
2908
- for (let r = 0; r < s; r++) {
2909
- let o, s;
2910
- const a = n[r];
2911
- Array.isArray(a) ? (s = a[0], o = a[1]) : (s = a.r, o = a.v), "string" == typeof o && (o = { address: o });
2912
- const l = o.address ?? "", i = l.indexOf("#"), c = -1 === i ? l : l.substring(0, i), d = -1 === i ? "" : l.substring(i + 1), p = {};
2913
- p.ref = s, c && (p["r:id"] = t.addExternal("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", c).relId), d && (p.location = d), o.screenTip && (p.tooltip = o.screenTip), e.empty("hyperlink", p);
2914
- }
2915
- e.end("hyperlinks");
2916
- })(l, c, 0, u), function(t, e, r, o) {
2917
- const n = o.pageMargins;
2918
- e.empty("pageMargins", {
2919
- left: n?.left ?? .7,
2920
- right: n?.right ?? .7,
2921
- top: n?.top ?? .75,
2922
- bottom: n?.bottom ?? .75,
2923
- header: n?.header ?? .3,
2924
- footer: n?.footer ?? .3
2925
- });
2926
- }(0, c, 0, u), function(t, e, r, o) {
2927
- const n = o.movables;
2928
- if (0 === (n ? n.length : 0)) return;
2929
- const s = (t) => {
2930
- const e = t.content?.type;
2931
- if ("picture" === e || "chart" === e) return !0;
2932
- if ("shape" === e) {
2933
- const e = t.content?.json?.type;
2934
- return "sp" === e || "cxnSp" === e;
2935
- }
2936
- return !1;
2937
- };
2938
- if (!n.some(s)) return;
2939
- const a = r.getMovables().getItems(), l = t.addPart("drawing", {
2940
- sheet: r,
2941
- movables: a,
2942
- jsonMovables: n,
2943
- resources: r.getResources()
2944
- });
2945
- e.empty("drawing", { "r:id": l.relId });
2946
- }(l, c, d, u), function(t, e, r, o) {
2947
- const n = o.tables, s = n ? n.length : 0;
2948
- if (0 === s) return;
2949
- const a = r.getTables().getItems();
2950
- e.start("tableParts", { count: s });
2951
- for (let r = 0; r < s; r++) {
2952
- let o, s;
2953
- const l = n[r];
2954
- Array.isArray(l) ? (s = l[0], o = l[1]) : (s = l.r, o = l.v);
2955
- const i = t.addPart("table", {
2956
- json: o,
2957
- model: a[r],
2958
- ref: s
2959
- }), c = {};
2960
- c["r:id"] = i.relId, e.empty("tablePart", c);
2961
- }
2962
- e.end("tableParts");
2963
- }(l, c, d, u), function(t, r, o, l, i) {
2964
- if (0 === l.length && 0 === i.length) return;
2965
- const c = o.getStyles(), d = c.getTheme();
2966
- if (r.start("extLst"), l.length > 0) {
2967
- r.start("ext", {
2968
- uri: e,
2969
- "xmlns:x14": n
2970
- }), r.start("x14:conditionalFormattings");
2971
- for (let t = 0; t < l.length; t++) {
2972
- const { guid: e, sqref: o, priority: n, scale: a, rule: i, style: p, stopIfTrue: m } = l[t];
2973
- if (r.start("x14:conditionalFormatting", { "xmlns:xm": s }), a) if (a.type === A.ScaleType.DataBar) {
2974
- r.start("x14:cfRule", {
2975
- type: "dataBar",
2976
- id: e
2977
- }), r.start("x14:dataBar", {
2978
- minLength: a.minLength,
2979
- maxLength: a.maxLength,
2980
- gradient: a.gradient ? void 0 : "0",
2981
- border: a.borderColor ? "1" : void 0,
2982
- direction: a.direction,
2983
- negativeBarColorSameAsPositive: a.negativeFillColor ? "0" : "1",
2984
- negativeBarBorderColorSameAsPositive: a.negativeBorderColor ? "0" : void 0,
2985
- axisPosition: a.axisPosition
2986
- });
2987
- const t = a.stops ?? [];
2988
- if (0 === t.length) Me(r, { type: A.ColorStopType.AutoMin }), Me(r, { type: A.ColorStopType.AutoMax });
2989
- else for (let e = 0; e < t.length; e++) Me(r, t[e]);
2990
- a.borderColor && Pt(r, d, a.borderColor, "x14:borderColor"), a.negativeFillColor && Pt(r, d, a.negativeFillColor, "x14:negativeFillColor"), a.negativeBorderColor && Pt(r, d, a.negativeBorderColor, "x14:negativeBorderColor"), a.axisColor && Pt(r, d, a.axisColor, "x14:axisColor"), r.end("x14:dataBar"), r.end("x14:cfRule");
2991
- } else {
2992
- r.start("x14:cfRule", {
2993
- type: "iconSet",
2994
- priority: n,
2995
- id: e
2996
- }), r.start("x14:iconSet", {
2997
- iconSet: a.iconSet,
2998
- reverse: Le(a.reverse),
2999
- showValue: Le(a.showValue),
3000
- custom: (a.icon?.length ?? 0) > 0 ? "1" : void 0
3001
- });
3002
- const t = a.stops ?? [];
3003
- for (let e = 0; e < t.length; e++) Me(r, t[e]);
3004
- const o = a.icon ?? [];
3005
- for (let t = 0; t < o.length; t++) r.empty("x14:cfIcon", {
3006
- iconSet: o[t].set,
3007
- iconId: o[t].id
3008
- });
3009
- r.end("x14:iconSet"), r.end("x14:cfRule");
3010
- }
3011
- else {
3012
- r.start("x14:cfRule", {
3013
- type: i.type,
3014
- priority: n,
3015
- stopIfTrue: Le(m),
3016
- aboveAverage: Le(i.aboveAverage),
3017
- equalAverage: Le(i.equalAverage),
3018
- stdDev: i.stdDev,
3019
- bottom: Le(i.bottom),
3020
- percent: Le(i.percent),
3021
- rank: i.rank,
3022
- operator: i.operator,
3023
- text: i.text,
3024
- timePeriod: i.timePeriod,
3025
- id: e
3026
- });
3027
- const t = i.formulas ?? [];
3028
- for (let e = 0; e < t.length; e++) r.start("xm:f"), r.text(t[e]), r.end("xm:f");
3029
- p && Object.keys(p).length > 0 && de(0, r, p, c, d, "x14:dxf"), r.end("x14:cfRule");
3030
- }
3031
- r.start("xm:sqref"), r.text(o), r.end("xm:sqref"), r.end("x14:conditionalFormatting");
3032
- }
3033
- r.end("x14:conditionalFormattings"), r.end("ext");
3034
- }
3035
- if (i.length > 0) {
3036
- r.start("ext", {
3037
- uri: a,
3038
- "xmlns:x14": n
3039
- }), r.start("x14:dataValidations", {
3040
- "xmlns:xm": s,
3041
- count: i.length
3042
- });
3043
- for (let t = 0; t < i.length; t++) {
3044
- const { attrs: e, formula1: o, formula2: n, sqref: s } = i[t];
3045
- r.start("x14:dataValidation", e), void 0 !== o && (r.start("x14:formula1"), r.start("xm:f"), r.text(o), r.end("xm:f"), r.end("x14:formula1")), void 0 !== n && (r.start("x14:formula2"), r.start("xm:f"), r.text(n), r.end("xm:f"), r.end("x14:formula2")), r.start("xm:sqref"), r.text(s), r.end("xm:sqref"), r.end("x14:dataValidation");
3046
- }
3047
- r.end("x14:dataValidations"), r.end("ext");
3048
- }
3049
- r.end("extLst");
3050
- }(0, c, d, C, T), c.end("worksheet"), c.close();
3051
- }
3052
- }(),
3053
- new class extends U {
3054
- constructor() {
3055
- super({
3056
- kind: "sharedStrings",
3057
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
3058
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
3059
- path: "/xl/sharedStrings.xml"
3060
- });
3061
- }
3062
- async emit(t, e) {
3063
- const r = e.getXMLWriter(), o = t.json, n = o ? o.length : 0, s = e.getSharedStates().get("stringsCount") ?? 0;
3064
- r.decl(), r.start("sst", {
3065
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3066
- count: s,
3067
- uniqueCount: n
3068
- });
3069
- for (let t = 0; t < n; t++) {
3070
- const e = o[t];
3071
- r.start("si");
3072
- const n = v.test(e) ? g : void 0;
3073
- r.start("t", n), r.text(p(e)), r.end("t"), r.end("si");
3074
- }
3075
- r.end("sst"), r.close();
3076
- }
3077
- }(),
3078
- new class extends U {
3079
- constructor() {
3080
- super({
3081
- kind: "theme",
3082
- contentType: "application/vnd.openxmlformats-officedocument.theme+xml",
3083
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
3084
- path: "/xl/theme/theme{n}.xml"
3085
- });
3086
- }
3087
- async emit(t, e) {
3088
- const r = e.getXMLWriter(), o = t.model, n = t.json;
3089
- r.decl(), r.pushDefaultNamespace("a"), r.start("theme", {
3090
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3091
- name: o.getName() || "Office Theme"
3092
- }), r.start("themeElements"), function(t, e, r, o) {
3093
- const n = r?.getColorScheme();
3094
- if (!n) return;
3095
- e.start(o, { name: n.getName() || "Office" });
3096
- for (const t of Dt) e.start(t), Ft(e, r, n["get" + t.charAt(0).toUpperCase() + t.slice(1)]()), e.end(t);
3097
- e.end(o);
3098
- }(0, r, o, "clrScheme"), function(t, e, r, o) {
3099
- if (!r) return;
3100
- e.start(o, { name: r.getName() || "Office" }), $e(t, e, r.getMajorFont() || "Calibri Light", "majorFont"), $e(t, e, r.getMinorFont() || "Calibri", "minorFont"), e.end(o);
3101
- }(e, r, o.getFontScheme(), "fontScheme"), function(t, e, r, o, n) {
3102
- if (n?.fillStyleLst && n?.lnStyleLst && n?.effectStyleLst && n?.bgFillStyleLst) return void function(t, e, r, o, n) {
3103
- const s = { getTheme: () => o };
3104
- e.start(r, { name: "Office" }), e.start("fillStyleLst");
3105
- for (const t of n.fillStyleLst) Wt(0, e, t, s);
3106
- e.end("fillStyleLst"), e.start("lnStyleLst");
3107
- for (const t of n.lnStyleLst) zt(0, e, t, s);
3108
- e.end("lnStyleLst"), e.start("effectStyleLst");
3109
- for (const r of n.effectStyleLst) e.start("effectStyle"), r.length > 0 ? Ut(t, e, o, r) : e.empty("effectLst"), e.end("effectStyle");
3110
- e.end("effectStyleLst"), e.start("bgFillStyleLst");
3111
- for (const t of n.bgFillStyleLst) Wt(0, e, t, s);
3112
- e.end("bgFillStyleLst"), e.end(r);
3113
- }(t, e, r, o, n);
3114
- if (n?.formatSchemeXml) return void e.raw(n.formatSchemeXml);
3115
- e.start(r, { name: "Office" }), function(t, e) {
3116
- 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", {
3117
- ang: "16200000",
3118
- scaled: "1"
3119
- }), 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", {
3120
- ang: "16200000",
3121
- scaled: "0"
3122
- }), e.end("gradFill"), e.end("fillStyleLst");
3123
- }(0, e), function(t, e) {
3124
- e.start("lnStyleLst");
3125
- const r = [
3126
- 9525,
3127
- 25400,
3128
- 38100
3129
- ];
3130
- for (let t = 0; t < 3; t++) e.start("ln", {
3131
- w: r[t].toString(),
3132
- cap: "flat",
3133
- cmpd: "sng",
3134
- algn: "ctr"
3135
- }), 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");
3136
- e.end("lnStyleLst");
3137
- }(0, e), function(t, e) {
3138
- e.start("effectStyleLst");
3139
- for (let t = 0; t < 3; t++) e.start("effectStyle"), e.start("effectLst"), 2 === t && (e.start("outerShdw", {
3140
- blurRad: "40000",
3141
- dist: "20000",
3142
- dir: "5400000",
3143
- rotWithShape: "0"
3144
- }), e.start("srgbClr", { val: "000000" }), e.empty("alpha", { val: "38000" }), e.end("srgbClr"), e.end("outerShdw")), e.end("effectLst"), e.end("effectStyle");
3145
- e.end("effectStyleLst");
3146
- }(0, e), function(t, e) {
3147
- 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", {
3148
- l: "50000",
3149
- t: "-80000",
3150
- r: "50000",
3151
- b: "180000"
3152
- }), 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", {
3153
- l: "50000",
3154
- t: "50000",
3155
- r: "50000",
3156
- b: "50000"
3157
- }), e.end("gradFill"), e.end("bgFillStyleLst");
3158
- }(0, e), e.end(r);
3159
- }(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();
3160
- }
3161
- }(),
3162
- new class extends U {
3163
- constructor() {
3164
- super({
3165
- kind: "styles",
3166
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3167
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
3168
- path: "/xl/styles.xml"
3169
- });
3170
- }
3171
- async emit(t, e) {
3172
- const r = e.getXMLWriter(), o = t.json, n = (t.theme, t.styles);
3173
- r.decl(), r.start("styleSheet", {
3174
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3175
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3176
- "mc:Ignorable": "x14ac x16r2 xr",
3177
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac",
3178
- "xmlns:x16r2": "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main",
3179
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
3180
- });
3181
- const s = function(t, e) {
3182
- let r = e?.direct;
3183
- r && 0 !== r.length || (r = [{}]);
3184
- const o = r.length, n = new Array(o);
3185
- for (let e = 0; e < o; e++) {
3186
- const o = 0 === e ? {
3187
- ...r[e],
3188
- named: E.BuiltInName.Normal
3189
- } : r[e], s = t.resolve(o), a = {};
3190
- void 0 !== o.named && (a.named = o.named), void 0 !== o.quotePrefix && (a.quotePrefix = o.quotePrefix);
3191
- for (let t = 0; t < re.length; t++) {
3192
- const e = re[t];
3193
- if (void 0 === o[e] && "alignment" !== e) continue;
3194
- const r = s?.[e] ?? o[e];
3195
- void 0 !== r && (a[e] = r);
3196
- }
3197
- n[e] = a;
3198
- }
3199
- return n;
3200
- }(n, o), a = function(t, e, r) {
3201
- const o = {
3202
- fontMap: /* @__PURE__ */ new Map(),
3203
- fonts: [],
3204
- fillMap: /* @__PURE__ */ new Map(),
3205
- fills: [],
3206
- borderMap: /* @__PURE__ */ new Map(),
3207
- borders: [],
3208
- numFmtMap: /* @__PURE__ */ new Map(),
3209
- numFmtsCustom: [],
3210
- namedStyleMap: /* @__PURE__ */ new Map(),
3211
- namedStyles: []
3212
- };
3213
- (function(t, e) {
3214
- const r = (t.getNamed(E.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3215
- e.fontMap.set(C.JSONStableStringify(r), "0"), e.fonts.push(r);
3216
- })(t, o), function(t) {
3217
- const e = { type: "none" };
3218
- t.fillMap.set(C.JSONStableStringify(e), "0"), t.fills.push(e);
3219
- const r = {
3220
- type: "pattern",
3221
- patternType: "gray125"
3222
- };
3223
- t.fillMap.set(C.JSONStableStringify(r), "1"), t.fills.push(r);
3224
- }(o), function(t) {
3225
- const e = {
3226
- bottom: { style: "none" },
3227
- left: { style: "none" },
3228
- right: { style: "none" },
3229
- top: { style: "none" }
3230
- };
3231
- t.borderMap.set(C.JSONStableStringify(e), "0"), t.borders.push(e);
3232
- }(o), function(t, e) {
3233
- ne(t, t.getNamed(E.BuiltInName.Normal).toJSON(), e);
3234
- }(t, o);
3235
- const n = e?.named ?? k.EmptyArray;
3236
- for (const e of n) ne(t, e, o);
3237
- for (const e of r) oe(t, e, o);
3238
- return o;
3239
- }(n, o, s), l = e.getSharedStates().get(ee), i = function(t, e = 0) {
3240
- const r = t?.tables;
3241
- if (!r) return null;
3242
- const o = r.styles;
3243
- if (!o) return null;
3244
- const n = [], s = /* @__PURE__ */ new Map(), a = Object.keys(o), l = [...me].reverse();
3245
- for (const t of a) {
3246
- const r = o[t];
3247
- for (const o of l) {
3248
- const a = r[o];
3249
- if (!a) continue;
3250
- const l = {};
3251
- if (a.font && (l.font = a.font), a.fill && (l.fill = a.fill), a.border && (l.border = a.border), void 0 !== a.numberFormat && (l.numberFormat = a.numberFormat), 0 === Object.keys(l).length) continue;
3252
- const i = e + n.length;
3253
- n.push(l);
3254
- const c = `${t}:${o}`;
3255
- s.set(c, i);
3256
- }
3257
- }
3258
- return {
3259
- dxfs: n,
3260
- dxfIndexMap: s
3261
- };
3262
- }(o, l?.getCount() ?? 0);
3263
- (function(t, e, r) {
3264
- const o = r.numFmtsCustom, n = o.length;
3265
- if (0 === n) return;
3266
- e.start("numFmts", { count: String(n) });
3267
- for (let t = 0; t < n; t++) {
3268
- const r = o[t];
3269
- e.empty("numFmt", {
3270
- numFmtId: String(t + pe),
3271
- formatCode: r
3272
- });
3273
- }
3274
- e.end("numFmts");
3275
- })(0, r, a), function(t, e, r, o) {
3276
- const n = o.fonts, s = n.length;
3277
- e.start("fonts", {
3278
- count: String(s),
3279
- "x14ac:knownFonts": "1"
3280
- });
3281
- for (const o of n) se(t, e, o, r);
3282
- e.end("fonts");
3283
- }(e, r, n, a), function(t, e, r, o) {
3284
- const n = o.fills, s = n.length;
3285
- e.start("fills", { count: String(s) });
3286
- for (const t of n) Wt(0, e, t, r, !0);
3287
- e.end("fills");
3288
- }(0, r, n, a), function(t, e, r, o) {
3289
- const n = o.borders, s = n.length;
3290
- e.start("borders", { count: String(s) });
3291
- const a = r.getTheme();
3292
- for (const r of n) le(t, e, r, a, !1);
3293
- e.end("borders");
3294
- }(e, r, n, a), function(t, e, r, o, n) {
3295
- const s = n.namedStyles, a = s.length;
3296
- e.start("cellStyleXfs", { count: String(a) });
3297
- for (const o of s) ce(t, e, r, o.style ?? k.EmptyObject, n, !1);
3298
- e.end("cellStyleXfs");
3299
- }(e, r, n, 0, a), function(t, e, r, o, n) {
3300
- const s = o.length;
3301
- e.start("cellXfs", { count: String(s) });
3302
- for (let a = 0; a < s; a++) ce(t, e, r, o[a], n, !0);
3303
- e.end("cellXfs");
3304
- }(e, r, n, s, a), function(t, e, r, o, n) {
3305
- const s = n.namedStyles, a = s.length;
3306
- e.start("cellStyles", { count: String(a) });
3307
- const l = n.namedStyleMap;
3308
- for (let t = 0; t < a; t++) {
3309
- const o = s[t], n = o.name, a = n.toLowerCase(), i = {
3310
- name: n,
3311
- xfId: l.get(a)
3312
- };
3313
- o.hidden && (i.hidden = "1"), o.iLevel && (i.iLevel = String(o.iLevel));
3314
- let c = null;
3315
- c = a === E.BuiltInName.Normal.toLowerCase() ? 0 : r.getNamed(n).getBuiltInID(), null !== c && (i.builtinId = String(c), i.customBuiltin = "1"), e.empty("cellStyle", i);
3316
- }
3317
- e.end("cellStyles");
3318
- }(0, r, n, 0, a), function(t, e, r, o, n) {
3319
- const s = [...n?.getDxfs() ?? [], ...o?.dxfs ?? []];
3320
- if (0 === s.length) return void e.empty("dxfs", { count: "0" });
3321
- const a = r.getTheme();
3322
- e.start("dxfs", { count: String(s.length) });
3323
- let l = pe;
3324
- for (const o of s) l = de(t, e, o, r, a, "dxf", l);
3325
- e.end("dxfs");
3326
- }(e, r, n, i, l), function(t, e, r, o, n) {
3327
- const s = o?.tables, a = s?.styles ?? null, l = a ? Object.keys(a) : null, i = l ? l.length : 0, c = {
3328
- count: String(i),
3329
- defaultTableStyle: s?.defaultTableStyle ?? "TableStyleMedium2",
3330
- defaultPivotStyle: s?.defaultPivotStyle ?? "PivotStyleLight16"
3331
- };
3332
- if (0 === i) return void e.empty("tableStyles", c);
3333
- e.start("tableStyles", c);
3334
- for (const t of l) {
3335
- const r = a[t], o = [];
3336
- for (const t of me) {
3337
- const e = r[t];
3338
- e && o.push([t, e]);
3339
- }
3340
- const s = {
3341
- name: t,
3342
- pivot: r.pivot ? "1" : "0",
3343
- count: String(o.length)
3344
- };
3345
- e.start("tableStyle", s);
3346
- for (const [r, s] of o) {
3347
- const o = `${t}:${r}`, a = n?.dxfIndexMap.get(o) ?? "0", l = {};
3348
- l.type = r, void 0 !== s.size && (l.size = String(s.size)), l.dxfId = String(a), e.empty("tableStyleElement", l);
3349
- }
3350
- e.end("tableStyle");
3351
- }
3352
- e.end("tableStyles");
3353
- }(0, r, 0, o, i), function(t, e, r, o) {
3354
- const n = o?.indexedColors && o.indexedColors.length > 0, s = o?.mruColors && o.mruColors.length > 0;
3355
- if (!n && !s) return;
3356
- if (e.start("colors"), n) {
3357
- e.start("indexedColors");
3358
- for (const t of o.indexedColors) {
3359
- const r = $t(t, !0);
3360
- e.empty("rgbColor", { rgb: r });
3361
- }
3362
- e.end("indexedColors");
3363
- }
3364
- if (s) {
3365
- e.start("mruColors");
3366
- for (const t of o.mruColors) {
3367
- const r = $t(t);
3368
- e.empty("color", { rgb: r });
3369
- }
3370
- e.end("mruColors");
3371
- }
3372
- e.end("colors");
3373
- }(0, r, 0, o), function(t, e) {
3374
- e.start("extLst"), e.start("ext", {
3375
- uri: "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}",
3376
- "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
3377
- }), e.empty("x14:slicerStyles", { defaultSlicerStyle: "SlicerStyleLight1" }), e.end("ext"), e.start("ext", {
3378
- uri: "{9260A510-F301-46a8-8635-F512D64BE5F5}",
3379
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
3380
- }), e.empty("x15:timelineStyles", { defaultTimelineStyle: "TimeSlicerStyleLight1" }), e.end("ext"), e.end("extLst");
3381
- }(0, r), r.end("styleSheet"), r.close();
3382
- }
3383
- }(),
3384
- new class extends U {
3385
- constructor() {
3386
- super({
3387
- kind: "propsCore",
3388
- contentType: "application/vnd.openxmlformats-package.core-properties+xml",
3389
- relTypeUri: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
3390
- path: "/docProps/core.xml"
3391
- });
3392
- }
3393
- async emit(t, e) {
3394
- const r = e.getXMLWriter();
3395
- r.decl(), r.start("cp:coreProperties", {
3396
- "xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
3397
- "xmlns:dc": "http://purl.org/dc/elements/1.1/",
3398
- "xmlns:dcterms": "http://purl.org/dc/terms/",
3399
- "xmlns:dcmitype": "http://purl.org/dc/dcmitype/",
3400
- "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
3401
- });
3402
- const o = /* @__PURE__ */ new Date(), n = [
3403
- ["creator", "SheetXL"],
3404
- ["lastModifiedBy", "SheetXL"],
3405
- ["created", We(o)],
3406
- ["modified", We(o)]
3407
- ];
3408
- for (const t of n) ze(r, t[0], t[1]);
3409
- r.end("cp:coreProperties"), r.close();
3410
- }
3411
- }(),
3412
- new class extends U {
3413
- constructor() {
3414
- super({
3415
- kind: "propsApp",
3416
- contentType: "application/vnd.openxmlformats-officedocument.extended-properties+xml",
3417
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
3418
- path: "/docProps/app.xml"
3419
- });
3420
- }
3421
- async emit(t, e) {
3422
- const r = e.getXMLWriter(), o = t.model, n = await O.getDetails(), s = function(t) {
3423
- if (!t || "string" != typeof t) return ve;
3424
- if ("local" === t || "dev" === t || "development" === t) return "00.0000";
3425
- const e = t.match(/^(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
3426
- if (!e) return ve;
3427
- const r = parseInt(e[1], 10), o = parseInt(e[2] || "0", 10);
3428
- return r > 99 || o > 9999 ? ve : `${r.toString()}.${o.toString().padStart(4, "0")}`;
3429
- }(n.getBuildVersion()), a = n.getLicensee() || "";
3430
- r.setValidationDisabled(!0), r.decl(), r.start("Properties", {
3431
- xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
3432
- "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
3433
- }), je(e, r, "Application", "SheetXL"), je(e, r, "DocSecurity", "0"), je(e, r, "ScaleCrop", "false"), Xe(e, r, o), je(e, r, "Company", a), je(e, r, "LinksUpToDate", "false"), je(e, r, "SharedDoc", "false"), je(e, r, "HyperlinksChanged", "false"), je(e, r, "AppVersion", s), r.end("Properties"), r.close();
3434
- }
3435
- }(),
3436
- new class extends U {
3437
- constructor() {
3438
- super({
3439
- kind: "metadata",
3440
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",
3441
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",
3442
- path: "/xl/metadata.xml"
3443
- });
3444
- }
3445
- emit(t, e) {
3446
- const r = e.getXMLWriter(), o = t.hasCellMeta(), n = t.hasValueMeta(), s = t.getDAPRFutureMetadataBlocks(), a = t.getRVFutureMetadataBlocks(), l = t.getValueMeta();
3447
- let i = 0, c = 0, d = 0;
3448
- o && (i = ++d), n && (c = ++d);
3449
- const p = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
3450
- if (o && (p["xmlns:xda"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"), n && (p["xmlns:xlrd"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"), r.decl(), r.start("metadata", p), r.start("metadataTypes", { count: d }), o && r.empty("metadataType", {
3451
- name: "XLDAPR",
3452
- ...Ue,
3453
- cellMeta: "1"
3454
- }), n && r.empty("metadataType", {
3455
- name: "XLRICHVALUE",
3456
- ...Ue
3457
- }), r.end("metadataTypes"), o) {
3458
- r.start("futureMetadata", {
3459
- name: "XLDAPR",
3460
- count: s.length
3461
- });
3462
- for (const t of s) r.start("bk"), r.start("extLst"), r.start("ext", { uri: "{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}" }), r.empty("xda:dynamicArrayProperties", {
3463
- fDynamic: t.fDynamic,
3464
- fCollapsed: t.fCollapsed
3465
- }), r.end("ext"), r.end("extLst"), r.end("bk");
3466
- r.end("futureMetadata");
3467
- }
3468
- if (n) {
3469
- r.start("futureMetadata", {
3470
- name: "XLRICHVALUE",
3471
- count: a.length
3472
- });
3473
- 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");
3474
- r.end("futureMetadata");
3475
- }
3476
- if (o) {
3477
- r.start("cellMetadata", { count: s.length });
3478
- for (let t = 0; t < s.length; t++) r.start("bk"), r.empty("rc", {
3479
- t: i,
3480
- v: t
3481
- }), r.end("bk");
3482
- r.end("cellMetadata");
3483
- }
3484
- if (n) {
3485
- r.start("valueMetadata", { count: l.length });
3486
- for (const t of l) r.start("bk"), r.empty("rc", {
3487
- t: c,
3488
- v: t
3489
- }), r.end("bk");
3490
- r.end("valueMetadata");
3491
- }
3492
- r.end("metadata"), r.close();
3493
- }
3494
- }(),
3495
- new class extends U {
3496
- constructor() {
3497
- super({
3498
- kind: "richValue",
3499
- contentType: "application/vnd.ms-excel.rdrichvalue+xml",
3500
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValue",
3501
- path: "./richData/rdrichvalue.xml"
3502
- });
3503
- }
3504
- async emit(t, e) {
3505
- const r = e.getXMLWriter(), o = t.getEntries(), n = o.length;
3506
- r.decl(), r.start("rvData", {
3507
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3508
- count: n
3509
- });
3510
- for (const e of o) {
3511
- const o = t.handlerStructureIndex(e.handler);
3512
- r.start("rv", { s: o });
3513
- const n = e.handler.getValues(e.rawValue);
3514
- for (const t of n) r.start("v"), r.text(t), r.end("v");
3515
- r.end("rv");
3516
- }
3517
- r.end("rvData"), r.close();
3518
- }
3519
- }(),
3520
- new class extends U {
3521
- constructor() {
3522
- super({
3523
- kind: "richValueStructure",
3524
- contentType: "application/vnd.ms-excel.rdrichvaluestructure+xml",
3525
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueStructure",
3526
- path: "./richData/rdrichvaluestructure.xml"
3527
- });
3528
- }
3529
- async emit(t, e) {
3530
- const r = e.getXMLWriter(), o = t.uniqueHandlers(), n = o.length;
3531
- r.decl(), r.start("rvStructures", {
3532
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3533
- count: n
3534
- });
3535
- for (const t of o) {
3536
- r.start("s", { t: t.type });
3537
- for (const [e, o] of t.props) r.empty("k", {
3538
- n: e,
3539
- t: o
3540
- });
3541
- r.end("s");
3542
- }
3543
- r.end("rvStructures"), r.close();
3544
- }
3545
- }(),
3546
- new class extends U {
3547
- constructor() {
3548
- super({
3549
- kind: "richValueTypes",
3550
- contentType: "application/vnd.ms-excel.rdrichvaluetypes+xml",
3551
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueTypes",
3552
- path: "./richData/rdRichValueTypes.xml"
3553
- });
3554
- }
3555
- async emit(t, e) {
3556
- const r = e.getXMLWriter();
3557
- r.decl(), r.start("rvTypesInfo", {
3558
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2",
3559
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3560
- "mc:Ignorable": "x",
3561
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
3562
- });
3563
- const o = [
3564
- ["_self", ["ExcludeFromFile", "ExcludeFromCalcComparison"]],
3565
- ["_DisplayString", ["ExcludeFromCalcComparison"]],
3566
- ["_Flags", ["ExcludeFromCalcComparison"]],
3567
- ["_Format", ["ExcludeFromCalcComparison"]],
3568
- ["_SubLabel", ["ExcludeFromCalcComparison"]],
3569
- ["_Attribution", ["ExcludeFromCalcComparison"]],
3570
- ["_Icons", ["ExcludeFromCalcComparison"]],
3571
- ["_Display", ["ExcludeFromCalcComparison"]],
3572
- ["_CanonicalPropertyNames", ["ExcludeFromCalcComparison"]],
3573
- ["_ClassificationId", ["ExcludeFromCalcComparison"]]
3574
- ];
3575
- r.start("global"), r.start("keyFlags");
3576
- for (const [t, e] of o) {
3577
- r.start("key", { name: t });
3578
- for (const t of e) r.empty("flag", {
3579
- name: t,
3580
- value: "1"
3581
- });
3582
- r.end("key");
3583
- }
3584
- r.end("keyFlags"), r.end("global"), r.end("rvTypesInfo"), r.close();
3585
- }
3586
- }(),
3587
- new class extends U {
3588
- constructor() {
3589
- super({
3590
- kind: "drawing",
3591
- contentType: "application/vnd.openxmlformats-officedocument.drawing+xml",
3592
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
3593
- path: "../drawings/drawing{n}.xml"
3594
- });
3595
- }
3596
- async emit(t, e) {
3597
- const r = e.getXMLWriter();
3598
- r.decl(), r.pushDefaultNamespace("xdr"), r.start("wsDr", {
3599
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
3600
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
3601
- });
3602
- const o = /* @__PURE__ */ new Map(), n = t.sheet, s = t.movables, a = t.jsonMovables, l = a ? a.length : 0;
3603
- let i = 0;
3604
- for (let t = 0; t < l; t++) {
3605
- const e = a[t].content?.json?.sourceId;
3606
- "number" == typeof e && e > i && (i = e);
3607
- }
3608
- const c = /* @__PURE__ */ new Map();
3609
- let d;
3610
- if (i > 0) {
3611
- const t = e.getSharedStates();
3612
- d = t.get("uniqueIdCounter"), d || (d = /* @__PURE__ */ new Map(), t.set("uniqueIdCounter", d)), d.set(n, Math.max(d.get(n) ?? 1, i));
3613
- const r = /* @__PURE__ */ new Set();
3614
- for (let t = 0; t < l; t++) {
3615
- const e = a[t].content?.json?.sourceId;
3616
- if ("number" == typeof e) if (r.has(e)) {
3617
- const e = d.get(n) + 1;
3618
- d.set(n, e), c.set(a[t], e);
3619
- } else r.add(e);
3620
- }
3621
- }
3622
- for (let t = 0; t < l; t++) {
3623
- const l = a[t], i = s[t], d = l.content?.type;
3624
- switch (r.start("twoCellAnchor", { editAs: l.anchorType || "twoCell" }), mr(r, "from", l.anchor.tl), mr(r, "to", l.anchor.br), d) {
3625
- case "picture":
3626
- await Ze(e, n, o, i, l);
3627
- break;
3628
- case "chart":
3629
- await tr(e, n, o, i, l, c.get(l));
3630
- break;
3631
- case "shape":
3632
- await nr(e, n, o, i, l, c.get(l));
3633
- break;
3634
- case "smartArt":
3635
- await er(e, n, o, i, l);
3636
- break;
3637
- case "slicer":
3638
- await rr(e, n, o, i, l);
3639
- break;
3640
- case "graphicFrame":
3641
- await or(e, n, o, i, l);
3642
- break;
3643
- default: await sr(e, n, o, i, l);
3644
- }
3645
- r.empty("clientData"), r.end("twoCellAnchor");
3646
- }
3647
- r.end("wsDr"), r.close();
3648
- }
3649
- }(),
3650
- new class extends U {
3651
- constructor() {
3652
- super({
3653
- kind: "table",
3654
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
3655
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
3656
- path: "../tables/table{n}.xml"
3657
- });
3658
- }
3659
- async emit(t, e) {
3660
- const r = e.getXMLWriter();
3661
- r.decl();
3662
- const o = {
3663
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3664
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3665
- "mc:Ignorable": "xr xr3",
3666
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
3667
- "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"
3668
- }, n = t.json, s = t.model;
3669
- s.isShowHeaders(), o.id = ++fr, 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), s.isShowTotals() || (o.totalsRowShown = "0"), r.start("table", o), s.isShowHeaders() && he(e, r, s, n), ur(e, r, s, n), hr(e, r, s, n), r.end("table"), r.close();
3670
- }
3671
- }(),
3672
- new class extends U {
3673
- constructor() {
3674
- super({
3675
- kind: "chart",
3676
- contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
3677
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
3678
- path: "../charts/chart{n}.xml"
3679
- });
3680
- }
3681
- async emit(t, e) {
3682
- const r = e.getXMLWriter();
3683
- r.decl(), r.pushDefaultNamespace("c"), r.start("chartSpace", {
3684
- "xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
3685
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3686
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
3687
- "xmlns:c16r2": "http://schemas.microsoft.com/office/drawing/2015/06/chart"
3688
- }), r.empty("date1904", { val: "0" }), r.empty("lang", { val: "en-US" }), r.empty("roundedCorners", { val: "0" }), xr(e, r, t.model, t.json), vr(e, r, t.styles, t.model, t.json), Sr(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 });
3689
- }
3690
- }(),
3691
- new class extends U {
3692
- constructor() {
3693
- super({
3694
- kind: "chartStyle",
3695
- contentType: "application/vnd.ms-office.chartstyle+xml",
3696
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartStyle",
3697
- path: "./style{n}.xml"
3698
- });
3699
- }
3700
- async emit(t, e) {
3701
- const r = e.getXMLWriter();
3702
- r.pushDefaultNamespace("cs"), r.start("chartStyle", {
3703
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
3704
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3705
- id: "297"
3706
- }), br(e, r, to, t.styles), r.end("chartStyle"), r.close();
3707
- }
3708
- }(),
3709
- new class extends U {
3710
- constructor() {
3711
- super({
3712
- kind: "chartColors",
3713
- contentType: "application/vnd.ms-office.chartcolorstyle+xml",
3714
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",
3715
- path: "./colors{n}.xml"
3716
- });
3717
- }
3718
- async emit(t, e) {
3719
- const r = e.getXMLWriter();
3720
- r.pushDefaultNamespace("cs"), r.start("cs:colorStyle", {
3721
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
3722
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3723
- meth: "cycle",
3724
- id: "10"
3725
- }), 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" }), eo(e, r, ro), r.end("cs:colorStyle"), r.close();
3726
- }
3727
- }()
3728
- ], no = async (t, e) => {
3729
- const r = new Ct();
3730
- for (const t of oo) r.register(t);
3731
- const o = so, n = H.createUint8Array({
3732
- lastModDate: new Date(1899, 11, 29, 19, 0, 0),
3733
- level: o
3734
- }), s = t.getOrigin(), a = "Excel" === e?.format ? d(s) : null, l = /* @__PURE__ */ new Map(), i = new wt(n, r, {
3735
- strictDuplicateChildren: !0,
3736
- onPartEmitted: e?.onPartEmitted,
3737
- mapState: l,
3738
- sourcePackage: a
3739
- });
3740
- i.addPart("workbook", t, "/xl/workbook.xml"), await i.waitEmit(), i.addPart("propsCore", {}), i.addPart("propsApp", { model: t });
3741
- const c = await i.build();
3742
- return 0 === c.byteOffset && c.byteLength === c.buffer.byteLength ? c.buffer : c.slice().buffer;
3743
- }, so = 1;
3744
- export { no as writeXLSX };