@sheetxl/io-xlsx 0.8.0-beta.15 → 0.8.0-beta.16
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.
- package/LICENSE.md +8 -7
- package/browser/esm/BQaNticMfvf7-y0L.mjs +2474 -0
- package/browser/esm/{BFHIFwfouCmmizKM.mjs → BalqIL4s8nR3NbK8.mjs} +2528 -1702
- package/browser/esm/{DPgI3veM7LuSesNu.mjs → BiueQ3eVPDOEdEeL.mjs} +1321 -1087
- package/browser/esm/{DsepJB2krbe8n-h0.mjs → BtLo1V0gnJ3ktOw9.mjs} +2 -2
- package/browser/esm/{VJT_B2rC29Twv3oJ.mjs → C3H8HKjSun-wLDrE.mjs} +5 -5
- package/browser/esm/{CbQ6xSA_Ryc9x49z.mjs → CCGqD5BzdZMq2pTI.mjs} +2 -2
- package/browser/esm/{B0as56gGm8o91eha.mjs → DT-3sV5qGuHTFmnB.mjs} +3295 -2163
- package/browser/esm/{CirSa4nJDHuHyGFb.mjs → W3dYk6brWDUtMZca.mjs} +3 -3
- package/browser/esm/{B5T6ZjCOm6tpqIxy.mjs → X5YJn8ZwrgDKMwwO.mjs} +3 -3
- package/browser/esm/{CVAAfrHVJ6jjaD4l.mjs → ekV6d7YNDF6FkKLw.mjs} +423 -318
- package/browser/esm/{cD_3iBL0XZP3GHGG.mjs → idgOmd_zpVTKLyek.mjs} +3 -3
- package/browser/esm/index.mjs +3 -3
- package/node/esm/{B_bFXQdvg63_jXXv.mjs → BO8o53Yo-gLFNELS.mjs} +3 -3
- package/node/esm/{CcMI8GfS94qlNCB0.mjs → BT0HKieizRDqDegH.mjs} +440 -330
- package/node/esm/BmIrpH_719z1aqvw.mjs +2562 -0
- package/node/esm/CJYMs5EGkLOZKyF0.mjs +4676 -0
- package/node/esm/{CQ3fUb7A8HUgTAIh.mjs → CZsPzV1CsMPKiICx.mjs} +2 -2
- package/node/esm/CdFqKswnjeM_u8-g.mjs +7242 -0
- package/node/esm/CnYiZh1EVKY4BNVs.mjs +6851 -0
- package/node/esm/{Cz6FfReTe9Ps5moN.mjs → OO5K_WYvAj-UV14K.mjs} +3 -3
- package/node/esm/index.mjs +5 -5
- package/package.json +4 -4
- package/types/src/AutoFilterRules.d.ts +26 -4
- package/types/src/OOXMLExtensions.d.ts +12 -1
- package/types/src/pivot/PivotArea.d.ts +20 -0
- package/types/src/pivot/PivotCacheRead.d.ts +30 -0
- package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
- package/types/src/pivot/PivotFilters.d.ts +29 -0
- package/types/src/pivot/PivotFormats.d.ts +60 -0
- package/types/src/pivot/PivotTableRead.d.ts +44 -0
- package/types/src/pivot/PivotTableWrite.d.ts +13 -0
- package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
- package/types/src/pivot/_PivotTableXml.d.ts +23 -0
- package/types/src/reader/PivotButtons.d.ts +14 -0
- package/types/src/reader/PivotCellFormats.d.ts +22 -0
- package/types/src/reader/SlicerJoin.d.ts +6 -4
- package/types/src/reader/_SlicerRecord.d.ts +22 -0
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +5 -0
- package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -2
- package/types/src/reader/domVisitors/SlicersVisitor.d.ts +2 -0
- package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
- package/types/src/reader/domVisitors/index.d.ts +2 -0
- package/types/src/writer/EvaluationSheet.d.ts +5 -0
- package/types/src/writer/builder/Types.d.ts +13 -0
- package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
- package/types/src/writer/emitters/SlicerEmitter.d.ts +81 -18
- package/types/src/writer/emitters/StylesEmitter.d.ts +32 -1
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +19 -2
- package/types/src/writer/utils/DateSystem.d.ts +6 -0
- package/types/src/writer/utils/XfVariants.d.ts +61 -0
- package/browser/esm/CE5CJXtA1SK_ve3k.mjs +0 -2265
- package/node/esm/B0IbtakI6lvldj5N.mjs +0 -5693
- package/node/esm/C87CEL-9kIrXknM_.mjs +0 -2346
- package/node/esm/CPb9rk-UywrH-U7Y.mjs +0 -4437
- package/node/esm/Dw3qQRUIJShJWc_D.mjs +0 -6367
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.16
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { A as t,
|
|
8
|
-
import { i as
|
|
9
|
-
import {
|
|
10
|
-
import { CommonUtils as
|
|
11
|
-
import { AddressUtils as
|
|
12
|
-
var
|
|
7
|
+
import { A as t, B as e, Cr as s, Dt as r, F as i, I as n, It as l, Jn as a, L as c, Lt as u, M as d, N as h, P as p, Qt as m, R as f, Rt as g, Tt as b, V as y, Zt as A, _t as v, an as N, cn as F, ft as C, gt as S, hr as x, ht as T, j as w, k as P, mt as I, on as k, pn as O, qn as V, r as _, t as B, ut as D, v as E, vt as R, wr as j, xt as Y, yt as X, z as M } from "./CnYiZh1EVKY4BNVs.mjs";
|
|
8
|
+
import { a as z, i as G, n as W, r as $ } from "./CJYMs5EGkLOZKyF0.mjs";
|
|
9
|
+
import { c as H, l as U, o as K, r as q, s as J } from "./BmIrpH_719z1aqvw.mjs";
|
|
10
|
+
import { CommonUtils as Z } from "@sheetxl/utils";
|
|
11
|
+
import { AddressUtils as Q, FormulaError as tt, IBorders as et, ICellStyle as ot, ICondition as st, IFill as rt, IFont as it, IRange as nt, IShape as lt, ISlicerStyle as at, ITextFrame as ct, ShapeStyleUtils as ut, Sort as dt, Tuple as ht } from "@sheetxl/sdk";
|
|
12
|
+
var pt = class {
|
|
13
13
|
constructor(t) {
|
|
14
14
|
this.list = t;
|
|
15
15
|
}
|
|
@@ -35,14 +35,14 @@ var at = class {
|
|
|
35
35
|
[Symbol.iterator]() {
|
|
36
36
|
return this.list.values();
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, mt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, ft = (t) => {
|
|
39
39
|
const e = parseInt(t);
|
|
40
40
|
return isNaN(e) ? null : e;
|
|
41
|
-
},
|
|
41
|
+
}, gt = (t) => {
|
|
42
42
|
const e = parseFloat(t);
|
|
43
43
|
return isNaN(e) ? null : e;
|
|
44
|
-
},
|
|
45
|
-
constructor(t, e, o, s, r, i = null, n =
|
|
44
|
+
}, bt = /* @__PURE__ */ new Map(), yt = class {
|
|
45
|
+
constructor(t, e, o, s, r, i = null, n = Z.EmptyObject) {
|
|
46
46
|
this._fileLocation = "";
|
|
47
47
|
const l = (t, e, o) => n?.getRef?.(t, e, o, n?.parsedRefs), a = (t) => n?.getRefs?.(t, n?.parsedRefs);
|
|
48
48
|
this._parent = t, this.sharedShared = e, this.currentPath = o, this.elemRoot = s, this.jsonRoot = r, t ? (this._fileLocation = t._fileLocation, this._getRef = t._getRef, this._getRefs = t._getRefs, this._serializeElement = t._serializeElement, this._readEmbeddedPart = t._readEmbeddedPart) : (i && (this._fileLocation = i), n?.getRef && (this._getRef = l), n?.getRefs && (this._getRefs = a), this._onWarning = n?.onWarning, this._addPerson = n?.addPerson, this._serializeElement = n?.serializeElement, this._readEmbeddedPart = n?.readEmbeddedPart);
|
|
@@ -54,7 +54,7 @@ var at = class {
|
|
|
54
54
|
return this._readEmbeddedPart?.(t, this._fileLocation) ?? null;
|
|
55
55
|
}
|
|
56
56
|
getRelationships() {
|
|
57
|
-
return this._getRefs?.(this._fileLocation) ??
|
|
57
|
+
return this._getRefs?.(this._fileLocation) ?? bt;
|
|
58
58
|
}
|
|
59
59
|
getPath() {
|
|
60
60
|
return this.currentPath;
|
|
@@ -113,7 +113,7 @@ var at = class {
|
|
|
113
113
|
}
|
|
114
114
|
if (o = i, 0 === o.length) return null;
|
|
115
115
|
}
|
|
116
|
-
return 1 === o.length ? o[0] : 0 === o.length ? null : new
|
|
116
|
+
return 1 === o.length ? o[0] : 0 === o.length ? null : new pt(o);
|
|
117
117
|
}
|
|
118
118
|
_matchesElementName(t, e) {
|
|
119
119
|
return e.includes(":") ? (t.tagName || t.nodeName) === e : t.localName === e;
|
|
@@ -129,10 +129,10 @@ var at = class {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
getFromPath(t, e) {
|
|
132
|
-
return
|
|
132
|
+
return Z.getFromPath(t, e);
|
|
133
133
|
}
|
|
134
134
|
setToPath(t, e, o) {
|
|
135
|
-
return
|
|
135
|
+
return Z.setToPath(t, e, o);
|
|
136
136
|
}
|
|
137
137
|
getValAttrAsString(t, e) {
|
|
138
138
|
let o = this.evaluate(t, e);
|
|
@@ -153,13 +153,13 @@ var at = class {
|
|
|
153
153
|
return o && o.hasAttribute("val") ? parseFloat(o.getAttribute("val")) ?? null : null;
|
|
154
154
|
}
|
|
155
155
|
get BOOLEAN_COPY() {
|
|
156
|
-
return
|
|
156
|
+
return mt;
|
|
157
157
|
}
|
|
158
158
|
get INT_COPY() {
|
|
159
|
-
return
|
|
159
|
+
return ft;
|
|
160
160
|
}
|
|
161
161
|
get FLOAT_COPY() {
|
|
162
|
-
return
|
|
162
|
+
return gt;
|
|
163
163
|
}
|
|
164
164
|
copyFromAttribute(t, e, o, s = e, r = null) {
|
|
165
165
|
if (!t || !o || !t.hasAttribute(e)) return;
|
|
@@ -176,20 +176,20 @@ var at = class {
|
|
|
176
176
|
}
|
|
177
177
|
this.setToPath(o, s, i);
|
|
178
178
|
}
|
|
179
|
-
},
|
|
179
|
+
}, At = (t, e) => {
|
|
180
180
|
const o = [], s = t.childNodes, r = s.length;
|
|
181
181
|
for (let t = 0; t < r; t++) {
|
|
182
182
|
const r = s.item(t);
|
|
183
183
|
1 === r.nodeType && r.localName === e && o.push(r);
|
|
184
184
|
}
|
|
185
185
|
return o;
|
|
186
|
-
},
|
|
186
|
+
}, vt = [
|
|
187
187
|
["fillRef", "fill"],
|
|
188
188
|
["lnRef", "stroke"],
|
|
189
189
|
["effectRef", "effect"]
|
|
190
|
-
],
|
|
191
|
-
const o = new
|
|
192
|
-
for (const [r, i] of
|
|
190
|
+
], Nt = (t, e) => {
|
|
191
|
+
const o = new p(), s = {};
|
|
192
|
+
for (const [r, i] of vt) {
|
|
193
193
|
const n = t.evaluate(r, e);
|
|
194
194
|
if (!n) continue;
|
|
195
195
|
const l = { index: parseInt(n.getAttribute("idx") ?? "0", 10) || 0 }, a = o.processAdjColor(t, n);
|
|
@@ -201,22 +201,22 @@ var at = class {
|
|
|
201
201
|
i && (e.color = i), s.font = e;
|
|
202
202
|
}
|
|
203
203
|
return s;
|
|
204
|
-
},
|
|
204
|
+
}, Ft = class {
|
|
205
205
|
visit(t, e, o) {
|
|
206
206
|
if (!e) return;
|
|
207
207
|
let s = t.evaluate("*/cNvPr", e);
|
|
208
208
|
return s.item && (s = s.item(0)), s && (t.copyFromAttribute(s, "name", o), t.copyFromAttribute(s, "descr", o, "description"), t.copyFromAttribute(s, "hidden", o, "hidden", t.BOOLEAN_COPY), this.readNonVisualDetails(t, s, o), t.copyFromAttribute(s, "id", o)), o;
|
|
209
209
|
}
|
|
210
|
-
readNonVisualDetails(e, o
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
...
|
|
219
|
-
nonVisual:
|
|
210
|
+
readNonVisualDetails(t, e, o) {
|
|
211
|
+
e.hasAttribute("title") && (o.title = e.getAttribute("title"));
|
|
212
|
+
const s = t.evaluate("hlinkClick", e);
|
|
213
|
+
s && (o.hyperlink = d(t, s));
|
|
214
|
+
const r = t.evaluate("hlinkHover", e);
|
|
215
|
+
r && (o.hoverHyperlink = d(t, r));
|
|
216
|
+
const i = t.evaluate("extLst", e), n = i ? t.serializeElement(i) : null;
|
|
217
|
+
n && (o.extLst = {
|
|
218
|
+
...o.extLst,
|
|
219
|
+
nonVisual: n
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
setContent(t, e) {
|
|
@@ -258,7 +258,7 @@ var at = class {
|
|
|
258
258
|
readStyleRefs(t, e, o) {
|
|
259
259
|
const s = t.evaluate("style", e);
|
|
260
260
|
if (!s) return void (o.style = null);
|
|
261
|
-
const r =
|
|
261
|
+
const r = Nt(t, s), i = ut.withoutDefaultStyleRefs({
|
|
262
262
|
...o,
|
|
263
263
|
style: r
|
|
264
264
|
});
|
|
@@ -270,7 +270,7 @@ var at = class {
|
|
|
270
270
|
const o = {};
|
|
271
271
|
for (let t = 0; t < e.length; t++) {
|
|
272
272
|
const s = e.item(t);
|
|
273
|
-
s.name.startsWith("xmlns") || (o[s.localName ?? s.name] =
|
|
273
|
+
s.name.startsWith("xmlns") || (o[s.localName ?? s.name] = u(s.value));
|
|
274
274
|
}
|
|
275
275
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
276
276
|
}
|
|
@@ -280,20 +280,20 @@ var at = class {
|
|
|
280
280
|
const s = o?.getAttribute?.("id"), r = s ? parseInt(s, 10) : void 0;
|
|
281
281
|
return void 0 === r || isNaN(r) ? void 0 : r;
|
|
282
282
|
}
|
|
283
|
-
},
|
|
283
|
+
}, Ct = [
|
|
284
284
|
["spDef", "shape"],
|
|
285
285
|
["lnDef", "line"],
|
|
286
286
|
["txDef", "text"]
|
|
287
|
-
],
|
|
287
|
+
], St = (t, e) => {
|
|
288
288
|
const o = e.getAttribute("dxfId");
|
|
289
289
|
if (null === o) return;
|
|
290
290
|
const s = parseInt(o);
|
|
291
291
|
return t.getVisitorParamsState().get("dxfs")?.get(s) || (t.warn(`A color filter or sort names a format that does not exist (dxfId '${o}').`), {});
|
|
292
|
-
},
|
|
292
|
+
}, xt = (t) => "1" === t || "true" === t, Tt = class {
|
|
293
293
|
visit(t, e, o) {}
|
|
294
294
|
processDataBarColor(t, e, o, s, r = "auto") {
|
|
295
295
|
if (!e) return;
|
|
296
|
-
const i =
|
|
296
|
+
const i = V((t) => e.getAttribute(t), r);
|
|
297
297
|
return i && (o[s] = i), o;
|
|
298
298
|
}
|
|
299
299
|
processFonts(t, e, o) {
|
|
@@ -310,42 +310,42 @@ var at = class {
|
|
|
310
310
|
}
|
|
311
311
|
return o;
|
|
312
312
|
}
|
|
313
|
-
processFont(t,
|
|
314
|
-
t.getValAttrAsBoolean("b",
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
317
|
-
const t =
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
const i =
|
|
321
|
-
void 0 !== i && (
|
|
322
|
-
const
|
|
323
|
-
this.processDataBarColor(t,
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
326
|
-
const t =
|
|
313
|
+
processFont(t, o, s) {
|
|
314
|
+
t.getValAttrAsBoolean("b", o, !0) && (s.weight = 700), t.getValAttrAsBoolean("i", o, !0) && (s.style = it.Style.Italic), t.getValAttrAsBoolean("strike", o, !0) && (s.strike = R(!0));
|
|
315
|
+
const r = t.evaluate("u", o);
|
|
316
|
+
if (r) {
|
|
317
|
+
const t = r.getAttribute("val");
|
|
318
|
+
s.underline = X(t);
|
|
319
|
+
}
|
|
320
|
+
const i = T(t.evaluate("vertAlign", o)?.getAttribute("val"));
|
|
321
|
+
void 0 !== i && (s.baseline = i), f(t, o, s, "sz", "size");
|
|
322
|
+
const n = t.evaluate("color", o);
|
|
323
|
+
this.processDataBarColor(t, n, s, "color"), s.color || (s.color = "auto"), e(t, o, s, "name", "family"), e(t, o, s, "rFont", "family");
|
|
324
|
+
const l = t.evaluate("family", o);
|
|
325
|
+
if (l) {
|
|
326
|
+
const t = l.getAttribute("val");
|
|
327
327
|
if (t) switch (t) {
|
|
328
328
|
case "1":
|
|
329
|
-
|
|
329
|
+
s.fallbacks = ["serif"];
|
|
330
330
|
break;
|
|
331
331
|
case "2":
|
|
332
|
-
|
|
332
|
+
s.fallbacks = ["sans-serif"];
|
|
333
333
|
break;
|
|
334
334
|
case "3":
|
|
335
|
-
|
|
335
|
+
s.fallbacks = ["monospace"];
|
|
336
336
|
break;
|
|
337
337
|
case "4":
|
|
338
|
-
|
|
338
|
+
s.fallbacks = ["cursive"];
|
|
339
339
|
break;
|
|
340
|
-
case "5":
|
|
340
|
+
case "5": s.fallbacks = ["fantasy"];
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
|
|
344
|
-
for (const
|
|
345
|
-
const r =
|
|
346
|
-
void 0 !== r && (
|
|
343
|
+
S(s, t.evaluate("scheme", o)?.getAttribute("val")), c(t, o, s, "shadow", "shadow", !0), c(t, o, s, "outline", "outline", !0);
|
|
344
|
+
for (const e of ["condense", "extend"]) {
|
|
345
|
+
const r = v(e, !!t.getValAttrAsBoolean(e, o, !0));
|
|
346
|
+
void 0 !== r && (s.letterSpacing = r);
|
|
347
347
|
}
|
|
348
|
-
return
|
|
348
|
+
return M(t, o, s, "charset", "charset"), s;
|
|
349
349
|
}
|
|
350
350
|
processFills(t, e, o) {
|
|
351
351
|
if (!e) return;
|
|
@@ -359,7 +359,7 @@ var at = class {
|
|
|
359
359
|
return o;
|
|
360
360
|
}
|
|
361
361
|
processFill(t, e, o, s) {
|
|
362
|
-
const r = { type:
|
|
362
|
+
const r = { type: rt.Type.None }, i = e.childNodes;
|
|
363
363
|
let n = !1;
|
|
364
364
|
const l = i.length;
|
|
365
365
|
for (let e = 0; !n && e < l; e++) {
|
|
@@ -370,17 +370,17 @@ var at = class {
|
|
|
370
370
|
}
|
|
371
371
|
processGradientFill(t, e, o) {
|
|
372
372
|
if (!e) return;
|
|
373
|
-
o.type =
|
|
373
|
+
o.type = rt.Type.Gradient;
|
|
374
374
|
const s = [];
|
|
375
375
|
o.stops = s;
|
|
376
376
|
const r = e.getAttribute("type");
|
|
377
377
|
r && (o.gradientType = r);
|
|
378
378
|
const i = e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0;
|
|
379
379
|
(i + 90) % 360 != 0 && (o.angle = (i + 90) % 360), (e.hasAttribute("left") || e.hasAttribute("top") || e.hasAttribute("right") || e.hasAttribute("bottom")) && (o.focus = {
|
|
380
|
-
left:
|
|
381
|
-
top:
|
|
382
|
-
right:
|
|
383
|
-
bottom:
|
|
380
|
+
left: wt(e.getAttribute("left")),
|
|
381
|
+
top: wt(e.getAttribute("top")),
|
|
382
|
+
right: wt(e.getAttribute("right")),
|
|
383
|
+
bottom: wt(e.getAttribute("bottom"))
|
|
384
384
|
});
|
|
385
385
|
const n = e.childNodes, l = n.length;
|
|
386
386
|
for (let e = 0; e < l; e++) {
|
|
@@ -396,11 +396,11 @@ var at = class {
|
|
|
396
396
|
}
|
|
397
397
|
processPatternFill(t, e, o) {
|
|
398
398
|
if (!e) return;
|
|
399
|
-
const s = t.getVisitorParamsState().get("processingDXFs"), r = e.getAttribute("patternType") || (s ?
|
|
400
|
-
if (r ===
|
|
401
|
-
o.type =
|
|
399
|
+
const s = t.getVisitorParamsState().get("processingDXFs"), r = e.getAttribute("patternType") || (s ? rt.BuiltInSheetPattern.Solid : rt.BuiltInSheetPattern.None);
|
|
400
|
+
if (r === rt.BuiltInSheetPattern.None) return { none: !0 };
|
|
401
|
+
o.type = rt.Type.Pattern, r && (o.patternType = r);
|
|
402
402
|
let i = "foreground", n = "background";
|
|
403
|
-
const l = o.patternType ===
|
|
403
|
+
const l = o.patternType === rt.BuiltInSheetPattern.Solid && s;
|
|
404
404
|
let a = l ? "dk1" : "lt1", c = l ? "lt1" : "dk1";
|
|
405
405
|
if (l) {
|
|
406
406
|
const t = i;
|
|
@@ -425,24 +425,24 @@ var at = class {
|
|
|
425
425
|
processBorder(t, e, o, s, r) {
|
|
426
426
|
if (!e) return;
|
|
427
427
|
const i = {};
|
|
428
|
-
this.processBorderStroke(t, e, i,
|
|
428
|
+
this.processBorderStroke(t, e, i, et.Edge.Left), this.processBorderStroke(t, e, i, et.Edge.Right), r ? (i.right || i.left) && (i.right ? i.vertical = { ...i.right } : i.vertical = { ...i.left }) : this.processBorderStroke(t, e, i, et.Edge.Vertical), this.processBorderStroke(t, e, i, et.Edge.Top), this.processBorderStroke(t, e, i, et.Edge.Bottom), r ? (i.bottom || i.top) && (i.bottom ? i.horizontal = { ...i.bottom } : i.horizontal = { ...i.top }) : this.processBorderStroke(t, e, i, et.Edge.Horizontal);
|
|
429
429
|
const n = this.processBorderStroke(t, e, {}, "diagonal");
|
|
430
|
-
return n && (
|
|
430
|
+
return n && (xt(e.getAttribute("diagonalUp")) && (i.diagonalUp = { ...n }), xt(e.getAttribute("diagonalDown")) && (i.diagonalDown = { ...n })), o[s] = i, o;
|
|
431
431
|
}
|
|
432
432
|
processBorderStroke(t, e, o, s) {
|
|
433
433
|
if (!e) return;
|
|
434
434
|
const r = t.evaluate(s, e);
|
|
435
435
|
if (!r) return;
|
|
436
436
|
const i = {};
|
|
437
|
-
r.hasAttribute("style") ? i.style = r.getAttribute("style") : t.getVisitorParamsState().get("processingDXFs") && (i.style =
|
|
437
|
+
r.hasAttribute("style") ? i.style = r.getAttribute("style") : t.getVisitorParamsState().get("processingDXFs") && (i.style = et.StrokeStyle.None);
|
|
438
438
|
const n = t.evaluate("color", r);
|
|
439
439
|
return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? o[s] = i : null;
|
|
440
440
|
}
|
|
441
|
-
},
|
|
441
|
+
}, wt = (t) => {
|
|
442
442
|
if (!t) return 0;
|
|
443
443
|
const e = parseFloat(t);
|
|
444
444
|
return isNaN(e) ? 0 : e;
|
|
445
|
-
},
|
|
445
|
+
}, Pt = (t, e) => {
|
|
446
446
|
if (!t || 1 !== t.nodeType) return null;
|
|
447
447
|
const o = t.childNodes;
|
|
448
448
|
for (let t = 0; t < o.length; t++) {
|
|
@@ -450,11 +450,11 @@ var at = class {
|
|
|
450
450
|
if (1 === s.nodeType && s.localName === e) return s;
|
|
451
451
|
}
|
|
452
452
|
return null;
|
|
453
|
-
},
|
|
453
|
+
}, It = new Set(Object.values(at.ElementType).filter((t) => t !== at.ElementType.WholeTable && t !== at.ElementType.HeaderRow)), kt = {
|
|
454
454
|
auto: "auto",
|
|
455
455
|
autoNoTable: "automaticExceptTables",
|
|
456
456
|
manual: "manual"
|
|
457
|
-
},
|
|
457
|
+
}, Ot = [
|
|
458
458
|
"tableId",
|
|
459
459
|
"columnId",
|
|
460
460
|
"cacheName",
|
|
@@ -462,8 +462,19 @@ var at = class {
|
|
|
462
462
|
"sourceName",
|
|
463
463
|
"sortOrder",
|
|
464
464
|
"customListSort",
|
|
465
|
-
"crossFilter"
|
|
466
|
-
|
|
465
|
+
"crossFilter",
|
|
466
|
+
"pivotTables",
|
|
467
|
+
"pivotCacheId",
|
|
468
|
+
"pivotBody",
|
|
469
|
+
"tabular",
|
|
470
|
+
"pivotData",
|
|
471
|
+
"showMissing"
|
|
472
|
+
], Vt = /* @__PURE__ */ new Set([
|
|
473
|
+
"name",
|
|
474
|
+
"xr10:uid",
|
|
475
|
+
"cache",
|
|
476
|
+
"caption"
|
|
477
|
+
]), _t = (t, e) => {
|
|
467
478
|
const o = t.content, s = o?.json;
|
|
468
479
|
if (s) {
|
|
469
480
|
if ("shape" === o.type || "picture" === o.type) {
|
|
@@ -479,38 +490,38 @@ var at = class {
|
|
|
479
490
|
}
|
|
480
491
|
});
|
|
481
492
|
}
|
|
482
|
-
if ("group" === o.type) for (const t of s.members ?? [])
|
|
493
|
+
if ("group" === o.type) for (const t of s.members ?? []) _t(t, !0);
|
|
483
494
|
}
|
|
484
|
-
},
|
|
495
|
+
}, Bt = class extends Ft {
|
|
485
496
|
visit(t, e, o) {
|
|
486
497
|
if (e) return this.visitShape(t, e, o, "sp", "nvSpPr/cNvSpPr/spLocks");
|
|
487
498
|
}
|
|
488
|
-
visitShape(
|
|
489
|
-
const n =
|
|
490
|
-
if (this.isGroupContent(
|
|
491
|
-
if (
|
|
492
|
-
const { movable:
|
|
493
|
-
n !==
|
|
494
|
-
const a =
|
|
495
|
-
a?.hasAttribute?.("noChangeAspect") && (
|
|
496
|
-
const c = this.readTwinOf(
|
|
497
|
-
return void 0 !== c && Object.assign(l, { twinOf: c }),
|
|
498
|
-
}
|
|
499
|
-
if (
|
|
500
|
-
const r =
|
|
501
|
-
if ("shape" ===
|
|
502
|
-
const
|
|
503
|
-
i && "" !==
|
|
499
|
+
visitShape(e, o, s, r, i) {
|
|
500
|
+
const n = y[r];
|
|
501
|
+
if (this.isGroupContent(s)) {
|
|
502
|
+
if (e.getPath().includes("Fallback")) return {};
|
|
503
|
+
const { movable: t, content: l } = this.readMemberHeader(e, o, "shape");
|
|
504
|
+
n !== lt.Type.Shape && (l.type = n), this.readShapeDetails(e, o, r, i, l), this.readStyleRefs(e, o, l);
|
|
505
|
+
const a = e.evaluate(i, o);
|
|
506
|
+
a?.hasAttribute?.("noChangeAspect") && (t.lockAspect = "1" === a.getAttribute("noChangeAspect"));
|
|
507
|
+
const c = this.readTwinOf(e, o);
|
|
508
|
+
return void 0 !== c && Object.assign(l, { twinOf: c }), s.members.push(t), l;
|
|
509
|
+
}
|
|
510
|
+
if (e.getPath().includes("Fallback") && s.content) {
|
|
511
|
+
const r = s.content.json;
|
|
512
|
+
if ("shape" === s.content.type && r && (r.type ?? lt.Type.Shape) === n) {
|
|
513
|
+
const s = e.evaluate("txBody", o), i = s ? new P().readTextBody(e, s) : null;
|
|
514
|
+
i && "" !== t(i) && (r.text = i);
|
|
504
515
|
}
|
|
505
516
|
return {};
|
|
506
517
|
}
|
|
507
|
-
|
|
508
|
-
const l =
|
|
509
|
-
l?.hasAttribute?.("noChangeAspect") && (
|
|
510
|
-
const a = n ===
|
|
511
|
-
void 0 !== c && (a.sourceId = c), this.readShapeDetails(
|
|
512
|
-
const u = this.readTwinOf(
|
|
513
|
-
return void 0 !== u && Object.assign(a, { twinOf: u }), this.setContent(
|
|
518
|
+
s = super.visit(e, o, s);
|
|
519
|
+
const l = e.evaluate(i, o);
|
|
520
|
+
l?.hasAttribute?.("noChangeAspect") && (s.lockAspect = "1" === l.getAttribute("noChangeAspect"));
|
|
521
|
+
const a = n === lt.Type.Shape ? {} : { type: n }, c = this.readSourceId(e, o);
|
|
522
|
+
void 0 !== c && (a.sourceId = c), this.readShapeDetails(e, o, r, i, a), this.readStyleRefs(e, o, a);
|
|
523
|
+
const u = this.readTwinOf(e, o);
|
|
524
|
+
return void 0 !== u && Object.assign(a, { twinOf: u }), this.setContent(s, {
|
|
514
525
|
type: "shape",
|
|
515
526
|
json: a
|
|
516
527
|
}), a;
|
|
@@ -525,7 +536,7 @@ var at = class {
|
|
|
525
536
|
const i = e.getAttribute("macro");
|
|
526
537
|
i && (r.macro = i);
|
|
527
538
|
const n = e.getAttribute("textlink");
|
|
528
|
-
n && (r.textLink = n), e.hasAttribute("fLocksText") && (r.locksText =
|
|
539
|
+
n && (r.textLink = n), e.hasAttribute("fLocksText") && (r.locksText = u(e.getAttribute("fLocksText"))), e.hasAttribute("fPublished") && (r.published = u(e.getAttribute("fPublished")));
|
|
529
540
|
const l = s.slice(0, s.lastIndexOf("/")), a = t.evaluate(l, e);
|
|
530
541
|
"1" === a?.getAttribute?.("txBox") && (r.textBox = !0);
|
|
531
542
|
const c = this.readLocks(t.evaluate(s, e));
|
|
@@ -540,56 +551,56 @@ var at = class {
|
|
|
540
551
|
(o || s) && (r.connectorEnds = {}, o && (r.connectorEnds.start = o), s && (r.connectorEnds.end = s));
|
|
541
552
|
}
|
|
542
553
|
}
|
|
543
|
-
},
|
|
554
|
+
}, Lt = /^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/, Dt = (t, e, o, s) => {
|
|
544
555
|
const r = t.evaluate(o, e), i = t.evaluate(s, e);
|
|
545
556
|
return r || i ? {
|
|
546
|
-
x:
|
|
547
|
-
y:
|
|
548
|
-
width:
|
|
549
|
-
height:
|
|
557
|
+
x: g(r?.getAttribute("x") ?? null) ?? 0,
|
|
558
|
+
y: g(r?.getAttribute("y") ?? null) ?? 0,
|
|
559
|
+
width: g(i?.getAttribute("cx") ?? null) ?? 0,
|
|
560
|
+
height: g(i?.getAttribute("cy") ?? null) ?? 0
|
|
550
561
|
} : null;
|
|
551
|
-
},
|
|
552
|
-
var
|
|
562
|
+
}, Et = { Checkbox: "checkbox" };
|
|
563
|
+
var Rt = (t) => {
|
|
553
564
|
const e = t.getAttribute("val");
|
|
554
565
|
return "0" !== e && "false" !== e;
|
|
555
|
-
},
|
|
566
|
+
}, jt = {
|
|
556
567
|
1: "serif",
|
|
557
568
|
2: "sans-serif",
|
|
558
569
|
3: "monospace",
|
|
559
570
|
4: "cursive",
|
|
560
571
|
5: "fantasy"
|
|
561
572
|
};
|
|
562
|
-
function
|
|
573
|
+
function Yt(t) {
|
|
563
574
|
const e = {}, o = t.childNodes;
|
|
564
575
|
for (let t = 0; t < o.length; t++) {
|
|
565
576
|
const s = o.item(t);
|
|
566
577
|
if (1 === s.nodeType) switch (s.localName) {
|
|
567
578
|
case "b":
|
|
568
|
-
e.weight =
|
|
579
|
+
e.weight = Rt(s) ? 700 : 400;
|
|
569
580
|
break;
|
|
570
581
|
case "i":
|
|
571
|
-
e.style =
|
|
582
|
+
e.style = Rt(s) ? it.Style.Italic : it.Style.Normal;
|
|
572
583
|
break;
|
|
573
584
|
case "strike":
|
|
574
|
-
e.strike =
|
|
585
|
+
e.strike = R(Rt(s));
|
|
575
586
|
break;
|
|
576
587
|
case "outline":
|
|
577
|
-
e.outline =
|
|
588
|
+
e.outline = Rt(s);
|
|
578
589
|
break;
|
|
579
590
|
case "shadow":
|
|
580
|
-
e.shadow =
|
|
591
|
+
e.shadow = Rt(s);
|
|
581
592
|
break;
|
|
582
593
|
case "condense":
|
|
583
594
|
case "extend": {
|
|
584
|
-
const t =
|
|
595
|
+
const t = v(s.localName, Rt(s));
|
|
585
596
|
void 0 !== t && (e.letterSpacing = t);
|
|
586
597
|
break;
|
|
587
598
|
}
|
|
588
599
|
case "u":
|
|
589
|
-
e.underline =
|
|
600
|
+
e.underline = X(s.getAttribute("val"));
|
|
590
601
|
break;
|
|
591
602
|
case "vertAlign": {
|
|
592
|
-
const t =
|
|
603
|
+
const t = T(s.getAttribute("val"));
|
|
593
604
|
void 0 !== t && (e.baseline = t);
|
|
594
605
|
break;
|
|
595
606
|
}
|
|
@@ -604,7 +615,7 @@ function Lt(t) {
|
|
|
604
615
|
break;
|
|
605
616
|
}
|
|
606
617
|
case "family": {
|
|
607
|
-
const t =
|
|
618
|
+
const t = jt[s.getAttribute("val") ?? ""];
|
|
608
619
|
t && (e.fallbacks = [t]);
|
|
609
620
|
break;
|
|
610
621
|
}
|
|
@@ -614,7 +625,7 @@ function Lt(t) {
|
|
|
614
625
|
break;
|
|
615
626
|
}
|
|
616
627
|
case "scheme":
|
|
617
|
-
|
|
628
|
+
S(e, s.getAttribute("val"));
|
|
618
629
|
break;
|
|
619
630
|
case "color": {
|
|
620
631
|
const t = s.getAttribute("rgb");
|
|
@@ -622,7 +633,7 @@ function Lt(t) {
|
|
|
622
633
|
e.color = "#" + (8 === t.length ? t.substring(2) : t).toUpperCase();
|
|
623
634
|
break;
|
|
624
635
|
}
|
|
625
|
-
const o =
|
|
636
|
+
const o = V((t) => s.getAttribute(t));
|
|
626
637
|
o && (e.color = o);
|
|
627
638
|
break;
|
|
628
639
|
}
|
|
@@ -630,7 +641,7 @@ function Lt(t) {
|
|
|
630
641
|
}
|
|
631
642
|
return Object.keys(e).length > 0 ? e : null;
|
|
632
643
|
}
|
|
633
|
-
var
|
|
644
|
+
var Xt = {
|
|
634
645
|
RelsVisitor: class {
|
|
635
646
|
visit(t, e, o) {
|
|
636
647
|
if (!e) return;
|
|
@@ -706,16 +717,16 @@ var Bt = {
|
|
|
706
717
|
};
|
|
707
718
|
}
|
|
708
719
|
},
|
|
709
|
-
ShapePropertiesVisitor:
|
|
710
|
-
TextPropertiesVisitor:
|
|
711
|
-
ShapeTextVisitor:
|
|
720
|
+
ShapePropertiesVisitor: h,
|
|
721
|
+
TextPropertiesVisitor: w,
|
|
722
|
+
ShapeTextVisitor: P,
|
|
712
723
|
ThemeVisitor: class {
|
|
713
724
|
visit(t, e, o) {
|
|
714
725
|
o.name = e.getAttribute("name"), o.objectDefaults = {};
|
|
715
|
-
const s =
|
|
726
|
+
const s = At(e, "custClrLst")[0];
|
|
716
727
|
if (s) {
|
|
717
|
-
const e = new
|
|
718
|
-
for (const o of
|
|
728
|
+
const e = new p(), r = [];
|
|
729
|
+
for (const o of At(s, "custClr")) {
|
|
719
730
|
const s = e.processAdjColor(t, o);
|
|
720
731
|
if (!s) continue;
|
|
721
732
|
const i = { color: s }, n = o.getAttribute("name");
|
|
@@ -723,9 +734,9 @@ var Bt = {
|
|
|
723
734
|
}
|
|
724
735
|
r.length && (o.customColors = r);
|
|
725
736
|
}
|
|
726
|
-
for (const t of
|
|
737
|
+
for (const t of At(e, "extLst")) for (const e of At(t, "ext")) {
|
|
727
738
|
if ("{05A4C25C-085E-4340-85A3-A5531E510DB2}" !== e.getAttribute("uri")) continue;
|
|
728
|
-
const t =
|
|
739
|
+
const t = At(e, "themeFamily")[0], s = t?.getAttribute("id");
|
|
729
740
|
if (!s) continue;
|
|
730
741
|
const r = {
|
|
731
742
|
name: t.getAttribute("name") ?? "",
|
|
@@ -736,7 +747,7 @@ var Bt = {
|
|
|
736
747
|
return o;
|
|
737
748
|
}
|
|
738
749
|
},
|
|
739
|
-
ClrSchemeVisitor: class extends
|
|
750
|
+
ClrSchemeVisitor: class extends p {
|
|
740
751
|
visit(t, e, o) {
|
|
741
752
|
const s = {};
|
|
742
753
|
s.name = e.getAttribute("name");
|
|
@@ -785,22 +796,22 @@ var Bt = {
|
|
|
785
796
|
ObjectDefaultsVisitor: class {
|
|
786
797
|
visit(t, e, o) {
|
|
787
798
|
const s = {};
|
|
788
|
-
for (const [o, r] of
|
|
799
|
+
for (const [o, r] of Ct) {
|
|
789
800
|
const i = t.evaluate(o, e);
|
|
790
801
|
i && (s[r] = this.processDefault(t, i));
|
|
791
802
|
}
|
|
792
803
|
return o.objectDefaults = s, {};
|
|
793
804
|
}
|
|
794
805
|
processDefault(t, e) {
|
|
795
|
-
const o = {},
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
(
|
|
799
|
-
const
|
|
800
|
-
return
|
|
806
|
+
const o = {}, s = t.evaluate("spPr", e);
|
|
807
|
+
s && new h().visit(t, s, o);
|
|
808
|
+
const r = new P().readTextBody(t, e);
|
|
809
|
+
(r.body || r.listStyle) && (o.text = r);
|
|
810
|
+
const i = t.evaluate("style", e);
|
|
811
|
+
return i && (o.style = Nt(t, i)), o;
|
|
801
812
|
}
|
|
802
813
|
},
|
|
803
|
-
FmtSchemeVisitor: class extends
|
|
814
|
+
FmtSchemeVisitor: class extends p {
|
|
804
815
|
visit(t, e, o) {
|
|
805
816
|
const s = this.parseFillList(t, e, "fillStyleLst"), r = this.parseLnList(t, e, "lnStyleLst"), i = this.parseEffectStyleList(t, e, "effectStyleLst"), n = this.parseFillList(t, e, "bgFillStyleLst");
|
|
806
817
|
if (s && (o.fillStyleLst = s), r && (o.lnStyleLst = r), i && (o.effectStyleLst = i), n && (o.bgFillStyleLst = n), s && r && i && n) return;
|
|
@@ -822,11 +833,11 @@ var Bt = {
|
|
|
822
833
|
}
|
|
823
834
|
parseFillListItem(t, e) {
|
|
824
835
|
switch (e.localName) {
|
|
825
|
-
case "noFill": return { type:
|
|
836
|
+
case "noFill": return { type: rt.Type.None };
|
|
826
837
|
case "solidFill": {
|
|
827
838
|
const o = this.processAdjColor(t, e);
|
|
828
839
|
return o ? {
|
|
829
|
-
type:
|
|
840
|
+
type: rt.Type.Solid,
|
|
830
841
|
color: o
|
|
831
842
|
} : void 0;
|
|
832
843
|
}
|
|
@@ -868,15 +879,15 @@ var Bt = {
|
|
|
868
879
|
}
|
|
869
880
|
processColorFilter(t, e) {
|
|
870
881
|
const o = {}, s = {
|
|
871
|
-
operator:
|
|
882
|
+
operator: st.BuiltInOperatorNames.Color,
|
|
872
883
|
param: o
|
|
873
884
|
};
|
|
874
885
|
t.copyFromAttribute(e, "cellColor", o, "cellColor", t.BOOLEAN_COPY);
|
|
875
|
-
const r =
|
|
886
|
+
const r = St(t, e);
|
|
876
887
|
return r && (o.style = r), s;
|
|
877
888
|
}
|
|
878
889
|
processCustomFilter(t, e) {
|
|
879
|
-
return
|
|
890
|
+
return O({
|
|
880
891
|
operator: e.getAttribute("operator"),
|
|
881
892
|
val: e.getAttribute("val")
|
|
882
893
|
}, (e) => t.warn(e));
|
|
@@ -885,7 +896,7 @@ var Bt = {
|
|
|
885
896
|
const o = e.getAttribute("and"), s = "and" === o || "1" === o;
|
|
886
897
|
e.getAttribute("val");
|
|
887
898
|
const r = [], i = {
|
|
888
|
-
operator: s ?
|
|
899
|
+
operator: s ? st.BuiltInOperatorNames.And : st.BuiltInOperatorNames.Or,
|
|
889
900
|
param: r
|
|
890
901
|
}, n = e.childNodes, l = n.length;
|
|
891
902
|
for (let e = 0; e < l; e++) {
|
|
@@ -894,10 +905,10 @@ var Bt = {
|
|
|
894
905
|
let s = null;
|
|
895
906
|
"customFilter" === o.localName && (s = this.processCustomFilter(t, o)), s && r.push(s);
|
|
896
907
|
}
|
|
897
|
-
return 1 === r.length ? r[0] :
|
|
908
|
+
return 1 === r.length ? r[0] : k(i);
|
|
898
909
|
}
|
|
899
910
|
processDynamicFilter(t, e) {
|
|
900
|
-
return
|
|
911
|
+
return N(e.getAttribute("type"), e.getAttribute("val"), e.getAttribute("maxVal"));
|
|
901
912
|
}
|
|
902
913
|
processDateGroupItem(t, e) {
|
|
903
914
|
const o = {};
|
|
@@ -908,10 +919,10 @@ var Bt = {
|
|
|
908
919
|
}
|
|
909
920
|
processFilters(t, e) {
|
|
910
921
|
const o = {}, s = {
|
|
911
|
-
operator:
|
|
922
|
+
operator: st.BuiltInOperatorNames.InSet,
|
|
912
923
|
param: o
|
|
913
924
|
};
|
|
914
|
-
s.selector =
|
|
925
|
+
s.selector = st.BuiltInSelectorNames.Display, t.copyFromAttribute(e, "blank", o, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", o, "calendarType");
|
|
915
926
|
let r = [], i = [];
|
|
916
927
|
const n = e.childNodes, l = n.length;
|
|
917
928
|
for (let e = 0; e < l; e++) {
|
|
@@ -930,14 +941,14 @@ var Bt = {
|
|
|
930
941
|
}
|
|
931
942
|
processIcon(t, e) {
|
|
932
943
|
const o = {}, s = {
|
|
933
|
-
operator:
|
|
944
|
+
operator: st.BuiltInOperatorNames.Icon,
|
|
934
945
|
param: o
|
|
935
946
|
};
|
|
936
947
|
return t.copyFromAttribute(e, "iconId", o, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", o), s;
|
|
937
948
|
}
|
|
938
949
|
processTop10(t, e) {
|
|
939
950
|
const o = {}, s = {
|
|
940
|
-
operator:
|
|
951
|
+
operator: st.BuiltInOperatorNames.TopN,
|
|
941
952
|
param: o
|
|
942
953
|
};
|
|
943
954
|
return t.copyFromAttribute(e, "filterVal", o, "filterVal", t.FLOAT_COPY), t.copyFromAttribute(e, "percent", o, "percent", t.BOOLEAN_COPY), t.copyFromAttribute(e, "top", o, "top", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", o, "limit", t.FLOAT_COPY), s;
|
|
@@ -947,7 +958,7 @@ var Bt = {
|
|
|
947
958
|
for (let e = 0; e < o.length; e++) {
|
|
948
959
|
const s = o.item(e);
|
|
949
960
|
if (1 !== s.nodeType || "ext" !== s.localName) continue;
|
|
950
|
-
if (
|
|
961
|
+
if (x(s.getAttribute("uri")) !== x("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
|
|
951
962
|
const r = s.childNodes;
|
|
952
963
|
for (let e = 0; e < r.length; e++) {
|
|
953
964
|
const o = r.item(e);
|
|
@@ -976,12 +987,12 @@ var Bt = {
|
|
|
976
987
|
if (!e.hasAttribute("colId")) return;
|
|
977
988
|
const s = parseInt(e.getAttribute("colId"));
|
|
978
989
|
let r = !1;
|
|
979
|
-
if (e.hasAttribute("hiddenButton") && (r =
|
|
990
|
+
if (e.hasAttribute("hiddenButton") && (r = u(e.getAttribute("hiddenButton"))), r && o) {
|
|
980
991
|
let t = o.hiddenButtons;
|
|
981
992
|
t || (t = [], o.hiddenButtons = t), t.push(s);
|
|
982
993
|
}
|
|
983
994
|
let i = !1;
|
|
984
|
-
if (e.hasAttribute("showButton") && (i =
|
|
995
|
+
if (e.hasAttribute("showButton") && (i = u(e.getAttribute("showButton"))), i && o) {
|
|
985
996
|
let t = o.showButtons;
|
|
986
997
|
!0 !== t && (t || (t = [], o.showButtons = t), t[s] = !0);
|
|
987
998
|
}
|
|
@@ -1004,43 +1015,43 @@ var Bt = {
|
|
|
1004
1015
|
SortStateVisitor: class {
|
|
1005
1016
|
visit(t, e, o) {
|
|
1006
1017
|
if (!e) return;
|
|
1007
|
-
const s = e.getAttribute("ref"),
|
|
1008
|
-
e.hasAttribute("caseSensitive") && (
|
|
1009
|
-
const
|
|
1010
|
-
null !=
|
|
1011
|
-
...
|
|
1018
|
+
const s = e.getAttribute("ref"), i = {};
|
|
1019
|
+
e.hasAttribute("caseSensitive") && (i.collatorOptions = u(e.getAttribute("caseSensitive")) ? dt.CaseSensitiveOptions : dt.CaseInsensitiveOptions);
|
|
1020
|
+
const n = e.getAttribute("sortMethod");
|
|
1021
|
+
null != n && "none" !== n && ("stroke" === n ? i.collatorOptions = {
|
|
1022
|
+
...i.collatorOptions,
|
|
1012
1023
|
collation: "stroke"
|
|
1013
|
-
} : "pinYin" ===
|
|
1014
|
-
...
|
|
1024
|
+
} : "pinYin" === n && (i.collatorOptions = {
|
|
1025
|
+
...i.collatorOptions,
|
|
1015
1026
|
collation: "pinyin"
|
|
1016
1027
|
}));
|
|
1017
|
-
const
|
|
1018
|
-
e.hasAttribute("columnSort") &&
|
|
1019
|
-
const
|
|
1020
|
-
this.processSortConditions(t, e,
|
|
1021
|
-
const
|
|
1022
|
-
if (
|
|
1023
|
-
const t =
|
|
1024
|
-
|
|
1025
|
-
range:
|
|
1026
|
-
sorts:
|
|
1028
|
+
const l = {};
|
|
1029
|
+
e.hasAttribute("columnSort") && u(e.getAttribute("columnSort")) && (l.axis = nt.Axis.Column);
|
|
1030
|
+
const a = Q.fastStringToRange(s), c = [], d = [];
|
|
1031
|
+
this.processSortConditions(t, e, c, a, i, d), c.length > 0 && (l.sorts = c);
|
|
1032
|
+
const h = t.getVisitorParamsState().get("ref");
|
|
1033
|
+
if (h && s) {
|
|
1034
|
+
const t = Q.fastStringToRange(h);
|
|
1035
|
+
l.extent = {
|
|
1036
|
+
range: r(t, a),
|
|
1037
|
+
sorts: d.map((e) => b(t, a, e))
|
|
1027
1038
|
};
|
|
1028
1039
|
}
|
|
1029
|
-
return Object.keys(
|
|
1040
|
+
return Object.keys(c).length > 0 && (o.sort = l), l;
|
|
1030
1041
|
}
|
|
1031
1042
|
processSortCondition(t, e, o, s, r) {
|
|
1032
1043
|
if (!e) return null;
|
|
1033
1044
|
const i = {};
|
|
1034
1045
|
if (!e.hasAttribute("ref")) return void t.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
|
|
1035
1046
|
if (e.hasAttribute("ref")) {
|
|
1036
|
-
const t = e.getAttribute("ref"), s =
|
|
1047
|
+
const t = e.getAttribute("ref"), s = Q.fastStringToRange(t);
|
|
1037
1048
|
i.index = o ? s.colStart - o.colStart : s.colStart, r?.push(s);
|
|
1038
1049
|
}
|
|
1039
1050
|
const n = { ...s };
|
|
1040
|
-
i.criteria = n, n.reverse = !1, e.hasAttribute("descending") && (n.reverse =
|
|
1041
|
-
const l =
|
|
1051
|
+
i.criteria = n, n.reverse = !1, e.hasAttribute("descending") && (n.reverse = u(e.getAttribute("descending")));
|
|
1052
|
+
const l = F(e.getAttribute("sortBy"));
|
|
1042
1053
|
l && (n.sortOn = l);
|
|
1043
|
-
const a =
|
|
1054
|
+
const a = St(t, e);
|
|
1044
1055
|
return a && (n.style = a), t.copyFromAttribute(e, "iconSet", n), t.copyFromAttribute(e, "customList", n), i;
|
|
1045
1056
|
}
|
|
1046
1057
|
processSortConditions(t, e, o, s, r, i) {
|
|
@@ -1055,47 +1066,49 @@ var Bt = {
|
|
|
1055
1066
|
}
|
|
1056
1067
|
}
|
|
1057
1068
|
},
|
|
1058
|
-
SheetStyleVisitor: class extends
|
|
1059
|
-
visit(t,
|
|
1060
|
-
this.processNumFmts(t, t.evaluate("numFmts",
|
|
1061
|
-
const
|
|
1069
|
+
SheetStyleVisitor: class extends Tt {
|
|
1070
|
+
visit(t, e, o) {
|
|
1071
|
+
this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
|
|
1072
|
+
const s = {
|
|
1062
1073
|
fills: {},
|
|
1063
1074
|
fonts: {},
|
|
1064
1075
|
borders: {}
|
|
1065
|
-
},
|
|
1066
|
-
this.processFonts(t,
|
|
1067
|
-
const
|
|
1068
|
-
declared: ["1", "true"].includes(
|
|
1069
|
-
normalIsThemeFont:
|
|
1070
|
-
faces:
|
|
1076
|
+
}, r = t.evaluate("fonts", e);
|
|
1077
|
+
this.processFonts(t, r, s.fonts);
|
|
1078
|
+
const i = s.fonts[this.normalFontId(t, e)], n = {
|
|
1079
|
+
declared: ["1", "true"].includes(r?.getAttribute("x14ac:knownFonts") ?? ""),
|
|
1080
|
+
normalIsThemeFont: I(i?.family),
|
|
1081
|
+
faces: _(Object.values(s.fonts).map((t) => ({
|
|
1071
1082
|
...t,
|
|
1072
|
-
family:
|
|
1083
|
+
family: Y(t?.family, t?.fallbacks, null, !1).name
|
|
1073
1084
|
})))
|
|
1074
1085
|
};
|
|
1075
|
-
t.getVisitorParamsState().set(
|
|
1076
|
-
type:
|
|
1077
|
-
patternType:
|
|
1078
|
-
},
|
|
1079
|
-
bottom: { style:
|
|
1080
|
-
left: { style:
|
|
1081
|
-
right: { style:
|
|
1082
|
-
top: { style:
|
|
1086
|
+
t.getVisitorParamsState().set(B, n), i && t.getVisitorParamsState().set(z, i), this.processFills(t, t.evaluate("fills", e), s.fills), this.processBorders(t, t.evaluate("borders", e), s.borders, !0), s.fills[0] = { type: rt.Type.None }, s.fills[1] = {
|
|
1087
|
+
type: rt.Type.Pattern,
|
|
1088
|
+
patternType: rt.BuiltInSheetPattern.Gray125
|
|
1089
|
+
}, s.borders[0] = {
|
|
1090
|
+
bottom: { style: et.StrokeStyle.None },
|
|
1091
|
+
left: { style: et.StrokeStyle.None },
|
|
1092
|
+
right: { style: et.StrokeStyle.None },
|
|
1093
|
+
top: { style: et.StrokeStyle.None }
|
|
1083
1094
|
};
|
|
1084
|
-
const
|
|
1085
|
-
this.processXFs(t, t.evaluate("cellStyleXfs",
|
|
1086
|
-
const
|
|
1087
|
-
if (
|
|
1088
|
-
const
|
|
1089
|
-
this.processCellStyles(t, t.evaluate("cellStyles",
|
|
1095
|
+
const l = [];
|
|
1096
|
+
this.processXFs(t, t.evaluate("cellStyleXfs", e), l, s, null, !1);
|
|
1097
|
+
const a = /* @__PURE__ */ new Map();
|
|
1098
|
+
if (l.length > 0) {
|
|
1099
|
+
const s = [];
|
|
1100
|
+
this.processCellStyles(t, t.evaluate("cellStyles", e), s, l, a), o.named = s;
|
|
1090
1101
|
}
|
|
1091
|
-
const
|
|
1092
|
-
this.processXFs(t, t.evaluate("cellXfs",
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1102
|
+
const c = [];
|
|
1103
|
+
this.processXFs(t, t.evaluate("cellXfs", e), c, s, a), Object.keys(c).length > 0 && (o.direct = c);
|
|
1104
|
+
const u = this.collectHiddenXfs(t.evaluate("cellXfs", e));
|
|
1105
|
+
u.size > 0 && t.getVisitorParamsState().set(G, u);
|
|
1106
|
+
const d = this.collectPivotButtonXfs(t.evaluate("cellXfs", e));
|
|
1107
|
+
d.size > 0 && t.getVisitorParamsState().set($, d);
|
|
1108
|
+
const h = this.collectXfComplements(t.evaluate("cellXfs", e));
|
|
1109
|
+
h.size > 0 && t.getVisitorParamsState().set(W, h);
|
|
1110
|
+
const p = [];
|
|
1111
|
+
return this.processDXFs(t, t.evaluate("dxfs", e), p), this.processTableStyles(t, t.evaluate("tableStyles", e), o, p), this.processSlicerStyles(t, t.evaluate("extLst", e), o), this.processIndexColors(t, t.evaluate("colors/indexedColors", e), o), this.processMruColors(t, t.evaluate("colors/mruColors", e), o), o;
|
|
1099
1112
|
}
|
|
1100
1113
|
normalFontId(t, e) {
|
|
1101
1114
|
const o = t.evaluate("cellStyles", e)?.childNodes;
|
|
@@ -1171,32 +1184,32 @@ var Bt = {
|
|
|
1171
1184
|
const n = e.getAttribute("xfId");
|
|
1172
1185
|
if (n && r) {
|
|
1173
1186
|
const t = r.get(parseInt(n));
|
|
1174
|
-
t && t !==
|
|
1187
|
+
t && t !== ot.BuiltInName.Normal && (o.named = t);
|
|
1175
1188
|
}
|
|
1176
|
-
const l = (t) => !(!i && e.hasAttribute(t)) ||
|
|
1189
|
+
const l = (t) => !(!i && e.hasAttribute(t)) || u(e.getAttribute(t)), a = (t) => !i || e.hasAttribute(t) && u(e.getAttribute(t)), c = "0", d = i ? c : void 0;
|
|
1177
1190
|
if (l("applyFont")) {
|
|
1178
|
-
const t = e.getAttribute("fontId") ??
|
|
1191
|
+
const t = e.getAttribute("fontId") ?? d;
|
|
1179
1192
|
if (void 0 !== t && (t !== c || a("applyFont"))) {
|
|
1180
1193
|
const e = s.fonts[t];
|
|
1181
1194
|
void 0 !== e && (o.font = e);
|
|
1182
1195
|
}
|
|
1183
1196
|
}
|
|
1184
1197
|
if (l("applyFill")) {
|
|
1185
|
-
const t = e.getAttribute("fillId") ??
|
|
1198
|
+
const t = e.getAttribute("fillId") ?? d;
|
|
1186
1199
|
if (void 0 !== t && (t !== c || a("applyFill"))) {
|
|
1187
1200
|
const e = s.fills[t];
|
|
1188
1201
|
void 0 !== e && Object.keys(e).length > 0 && (o.fill = e);
|
|
1189
1202
|
}
|
|
1190
1203
|
}
|
|
1191
1204
|
if (l("applyBorder")) {
|
|
1192
|
-
const t = e.getAttribute("borderId") ??
|
|
1205
|
+
const t = e.getAttribute("borderId") ?? d;
|
|
1193
1206
|
if (void 0 !== t && (t !== c || a("applyBorder"))) {
|
|
1194
1207
|
const e = s.borders[t];
|
|
1195
1208
|
void 0 !== e && (o.borders = e);
|
|
1196
1209
|
}
|
|
1197
1210
|
}
|
|
1198
1211
|
if (l("applyNumberFormat")) {
|
|
1199
|
-
const s = e.getAttribute("numFmtId") ??
|
|
1212
|
+
const s = e.getAttribute("numFmtId") ?? d;
|
|
1200
1213
|
if (void 0 !== s && (s !== c || a("applyNumberFormat"))) {
|
|
1201
1214
|
const e = parseInt(s);
|
|
1202
1215
|
let r;
|
|
@@ -1215,18 +1228,18 @@ var Bt = {
|
|
|
1215
1228
|
const s = t.evaluate("protection", e);
|
|
1216
1229
|
(s || a("applyProtection")) && this.processProtection(t, s, o);
|
|
1217
1230
|
}
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1231
|
+
const h = u(e.getAttribute("quotePrefix") ?? "");
|
|
1232
|
+
h && (o.quotePrefix = h);
|
|
1220
1233
|
}
|
|
1221
1234
|
processAlignment(t, e, o) {
|
|
1222
1235
|
const s = {};
|
|
1223
|
-
if (e?.hasAttribute("horizontal") ? s.horizontal = e.getAttribute("horizontal") : s.horizontal =
|
|
1236
|
+
if (e?.hasAttribute("horizontal") ? s.horizontal = e.getAttribute("horizontal") : s.horizontal = ct.HorizontalAlignment.General, e?.hasAttribute("vertical") ? s.vertical = e.getAttribute("vertical") : s.vertical = ct.VerticalAlignment.Bottom, e?.hasAttribute("indent") ? s.indent = parseInt(e.getAttribute("indent")) : s.indent = 0, e?.hasAttribute("relativeIndent") ? s.relativeIndent = parseInt(e.getAttribute("relativeIndent")) : s.relativeIndent = 0, u(e?.getAttribute("wrapText") ?? "") ? s.overflow = ct.Overflow.Wrap : s.overflow = ct.Overflow.Visible, u(e?.getAttribute("shrinkToFit") ?? "") && (s.overflow = ct.Overflow.Shrink), e?.hasAttribute("textRotation")) {
|
|
1224
1237
|
let t = parseFloat(e.getAttribute("textRotation"));
|
|
1225
1238
|
t > 0 && t <= 90 ? t = 360 - t : t > 90 && t <= 180 ? t -= 90 : 255 === t && (t = 0, s.stacked = !0), s.rotation = t;
|
|
1226
1239
|
} else s.rotation = 0;
|
|
1227
|
-
e?.hasAttribute("justifyLastLine") && (s.justifyLastLine =
|
|
1240
|
+
e?.hasAttribute("justifyLastLine") && (s.justifyLastLine = u(e.getAttribute("justifyLastLine")));
|
|
1228
1241
|
const r = e?.getAttribute("readingOrder");
|
|
1229
|
-
return r && ("0" === r ? s.readingDirection =
|
|
1242
|
+
return r && ("0" === r ? s.readingDirection = ct.ReadingDirection.Auto : "1" === r ? s.readingDirection = ct.ReadingDirection.LeftToRight : "2" === r ? s.readingDirection = ct.ReadingDirection.RightToLeft : t.warn(`Invalid readingOrder '${r}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(s).length > 0 && (o.alignment = s), o;
|
|
1230
1243
|
}
|
|
1231
1244
|
collectHiddenXfs(t) {
|
|
1232
1245
|
const e = /* @__PURE__ */ new Set();
|
|
@@ -1239,12 +1252,23 @@ var Bt = {
|
|
|
1239
1252
|
const i = r.childNodes;
|
|
1240
1253
|
for (let t = 0; t < i.length; t++) {
|
|
1241
1254
|
const o = i.item(t);
|
|
1242
|
-
1 === o.nodeType && "protection" === o.localName &&
|
|
1255
|
+
1 === o.nodeType && "protection" === o.localName && u(o.getAttribute("hidden") ?? "") && e.add(s);
|
|
1243
1256
|
}
|
|
1244
1257
|
s++;
|
|
1245
1258
|
}
|
|
1246
1259
|
return e;
|
|
1247
1260
|
}
|
|
1261
|
+
collectPivotButtonXfs(t) {
|
|
1262
|
+
const e = /* @__PURE__ */ new Set();
|
|
1263
|
+
if (!t) return e;
|
|
1264
|
+
const o = t.childNodes;
|
|
1265
|
+
let s = 0;
|
|
1266
|
+
for (let t = 0; t < o.length; t++) {
|
|
1267
|
+
const r = o.item(t);
|
|
1268
|
+
1 === r.nodeType && "xf" === r.localName && (u(r.getAttribute("pivotButton") ?? "") && e.add(s), s++);
|
|
1269
|
+
}
|
|
1270
|
+
return e;
|
|
1271
|
+
}
|
|
1248
1272
|
collectXfComplements(t) {
|
|
1249
1273
|
const e = /* @__PURE__ */ new Map();
|
|
1250
1274
|
if (!t) return e;
|
|
@@ -1253,11 +1277,11 @@ var Bt = {
|
|
|
1253
1277
|
for (let t = 0; t < o.length; t++) {
|
|
1254
1278
|
const r = o.item(t);
|
|
1255
1279
|
if (1 !== r.nodeType || "xf" !== r.localName) continue;
|
|
1256
|
-
const i =
|
|
1280
|
+
const i = Pt(r, "extLst");
|
|
1257
1281
|
if (i) {
|
|
1258
1282
|
const t = i.childNodes;
|
|
1259
1283
|
for (let o = 0; o < t.length; o++) {
|
|
1260
|
-
const r =
|
|
1284
|
+
const r = Pt(t.item(o), "xfComplement"), i = parseInt(r?.getAttribute("i") ?? "", 10);
|
|
1261
1285
|
isNaN(i) || e.set(s, i);
|
|
1262
1286
|
}
|
|
1263
1287
|
}
|
|
@@ -1268,7 +1292,7 @@ var Bt = {
|
|
|
1268
1292
|
processProtection(t, e, o) {
|
|
1269
1293
|
if (!e) return;
|
|
1270
1294
|
const s = e.getAttribute("locked");
|
|
1271
|
-
return o.protection = { alwaysUnlocked: !!s && !
|
|
1295
|
+
return o.protection = { alwaysUnlocked: !!s && !u(s) }, o;
|
|
1272
1296
|
}
|
|
1273
1297
|
processDXF(t, e, o) {
|
|
1274
1298
|
if (!e) return;
|
|
@@ -1352,7 +1376,7 @@ var Bt = {
|
|
|
1352
1376
|
const o = a.item(e);
|
|
1353
1377
|
if (1 !== o.nodeType || "slicerStyleElement" !== o.localName) continue;
|
|
1354
1378
|
const s = o.getAttribute("type");
|
|
1355
|
-
if (!s || !
|
|
1379
|
+
if (!s || !It.has(s)) continue;
|
|
1356
1380
|
const i = o.getAttribute("dxfId"), l = null != i ? n[parseInt(i)] : void 0;
|
|
1357
1381
|
l ? r[s] = l : t.warn(`A slicer style names a format that does not exist (dxfId '${i}').`, { onceKey: "xlsx.style.slicerStyle.dxf" });
|
|
1358
1382
|
}
|
|
@@ -1362,7 +1386,7 @@ var Bt = {
|
|
|
1362
1386
|
}
|
|
1363
1387
|
processTableStyle(t, e, o, s, r = !1) {
|
|
1364
1388
|
const i = e.getAttribute("name"), n = { name: i };
|
|
1365
|
-
e.hasAttribute("table") && (n.table =
|
|
1389
|
+
e.hasAttribute("table") && (n.table = u(e.getAttribute("table"))), n.pivot = !e.hasAttribute("pivot") || u(e.getAttribute("pivot")), r && !n.pivot && s.unshift(null);
|
|
1366
1390
|
const l = e.childNodes, a = l.length;
|
|
1367
1391
|
for (let e = 0; e < a; e++) {
|
|
1368
1392
|
const o = l.item(e);
|
|
@@ -1398,7 +1422,7 @@ var Bt = {
|
|
|
1398
1422
|
const t = parseInt(e.getAttribute("xfId") ?? ""), i = e.getAttribute("name"), n = e.getAttribute("builtinId");
|
|
1399
1423
|
let l = i;
|
|
1400
1424
|
if (null !== n) {
|
|
1401
|
-
const t =
|
|
1425
|
+
const t = ot.builtInNameFromId(parseInt(n));
|
|
1402
1426
|
void 0 !== t && (l = t);
|
|
1403
1427
|
}
|
|
1404
1428
|
if (r.set(t, l), !s[t]) continue;
|
|
@@ -1406,13 +1430,13 @@ var Bt = {
|
|
|
1406
1430
|
name: l,
|
|
1407
1431
|
style: s[t]
|
|
1408
1432
|
};
|
|
1409
|
-
e.getAttribute("hidden") && (a.hidden =
|
|
1433
|
+
e.getAttribute("hidden") && (a.hidden = u(e.getAttribute("hidden"))), e.getAttribute("iLevel") && (a.iLevel = parseInt(e.getAttribute("iLevel"))), null !== n && u(e.getAttribute("customBuiltin") ?? "0") && (a.customized = !0), o.push(a);
|
|
1410
1434
|
}
|
|
1411
1435
|
}
|
|
1412
1436
|
}
|
|
1413
1437
|
afterVisit(t, e, o) {}
|
|
1414
1438
|
},
|
|
1415
|
-
WorkbookVisitor: class extends
|
|
1439
|
+
WorkbookVisitor: class extends Tt {
|
|
1416
1440
|
visit(t, e, o) {
|
|
1417
1441
|
return this.processSheetRefs(t, t.evaluate("sheets", e), o), this.processExternalReferences(t, t.evaluate("externalReferences", e), o), this.processBookViews(t, t.evaluate("bookViews", e), o), this.processDefinedNames(t, t.evaluate("definedNames", e), o), this.processCalcPr(t, t.evaluate("calcPr", e), o), this.processPivotCaches(t, t.evaluate("pivotCaches", e), o), this.processWorkbookProtection(t, t.evaluate("workbookProtection", e), o), this.processWorkbookPr(t, t.evaluate("workbookPr", e), o), o;
|
|
1418
1442
|
}
|
|
@@ -1425,13 +1449,13 @@ var Bt = {
|
|
|
1425
1449
|
if (!e) return;
|
|
1426
1450
|
const s = {};
|
|
1427
1451
|
this.processPassword(t, e, s, "workbook", "password"), this.processPassword(t, e, s, "revisions", "revisionsPassword");
|
|
1428
|
-
for (const t of
|
|
1452
|
+
for (const t of D) s[t.key] = C(t, e.getAttribute(t.attribute));
|
|
1429
1453
|
return o.protection = s, o;
|
|
1430
1454
|
}
|
|
1431
1455
|
processCalcPr(t, e, o) {
|
|
1432
1456
|
if (!e) return;
|
|
1433
1457
|
const s = {};
|
|
1434
|
-
t.copyFromAttribute(e, "calcMode", s, "calcMode", (t) =>
|
|
1458
|
+
t.copyFromAttribute(e, "calcMode", s, "calcMode", (t) => kt[t] ?? null), t.copyFromAttribute(e, "fullCalcOnLoad", s, "fullCalcOnLoad", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcOnSave", s, "calcOnSave", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcCompleted", s, "calcCompleted", t.BOOLEAN_COPY), t.copyFromAttribute(e, "fullPrecision", s, "fullPrecision", t.BOOLEAN_COPY), t.copyFromAttribute(e, "forceFullCalc", s, "forceFullCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentCalc", s, "concurrentCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentManualCount", s, "concurrentManualCount", t.INT_COPY), t.copyFromAttribute(e, "refMode", s, "refMode"), t.copyFromAttribute(e, "iterate", s, "iterate", t.BOOLEAN_COPY), t.copyFromAttribute(e, "iterateCount", s, "maxIteration", t.INT_COPY), t.copyFromAttribute(e, "iterateDelta", s, "maxIterateChange", t.FLOAT_COPY);
|
|
1435
1459
|
const r = e.getAttribute("calcId");
|
|
1436
1460
|
null !== r && t.getVisitorParamsState().set("calcId", r), o.calc = s;
|
|
1437
1461
|
}
|
|
@@ -1445,21 +1469,21 @@ var Bt = {
|
|
|
1445
1469
|
o.sheets = s;
|
|
1446
1470
|
}
|
|
1447
1471
|
processSheetRef(t, e, o) {
|
|
1448
|
-
const
|
|
1449
|
-
t.copyFromAttribute(e, "name",
|
|
1450
|
-
const
|
|
1451
|
-
if (
|
|
1452
|
-
const e = t.readEmbeddedPart(
|
|
1472
|
+
const r = {};
|
|
1473
|
+
t.copyFromAttribute(e, "name", r, "name"), t.copyFromAttribute(e, "state", r, "visibility"), t.copyFromAttribute(e, "sheetId", r, "sheetId", t.INT_COPY);
|
|
1474
|
+
const i = e.getAttribute("r:id"), n = i ? j(t.getRelationships().get(i)?.type) : null;
|
|
1475
|
+
if (n) {
|
|
1476
|
+
const e = t.readEmbeddedPart(i);
|
|
1453
1477
|
if (e?.xml) {
|
|
1454
|
-
const t = { part: e },
|
|
1455
|
-
|
|
1478
|
+
const t = { part: e }, i = s(e.xml), l = i ? V((t) => i.get(t)) : void 0;
|
|
1479
|
+
l && (t.tabColor = l), r.kind = n, r.sheet = t, o.push(r);
|
|
1456
1480
|
return;
|
|
1457
1481
|
}
|
|
1458
|
-
t.warn(`The ${
|
|
1482
|
+
t.warn(`The ${n} sheet '${r.name}' could not be read and was loaded as an empty worksheet.`), o.push(r);
|
|
1459
1483
|
return;
|
|
1460
1484
|
}
|
|
1461
|
-
const
|
|
1462
|
-
|
|
1485
|
+
const l = i ? t.getRef(i) : null;
|
|
1486
|
+
l && (r.sheet = l), o.push(r);
|
|
1463
1487
|
}
|
|
1464
1488
|
processExternalReferences(t, e, o) {
|
|
1465
1489
|
if (!e) return;
|
|
@@ -1475,16 +1499,21 @@ var Bt = {
|
|
|
1475
1499
|
}
|
|
1476
1500
|
processPivotCaches(t, e, o) {
|
|
1477
1501
|
if (!e) return;
|
|
1478
|
-
const s = [], r = e.
|
|
1479
|
-
for (let e = 0; e <
|
|
1480
|
-
const o =
|
|
1502
|
+
const s = [], r = t.evaluate("workbookPr", e.parentNode)?.getAttribute?.("date1904"), i = "1" === r || "true" === r, n = A(t.getVisitorParamsState().get("numFmts"), void 0), l = e.childNodes, a = l.length;
|
|
1503
|
+
for (let e = 0; e < a; e++) {
|
|
1504
|
+
const o = l.item(e);
|
|
1481
1505
|
if (1 !== o.nodeType || "pivotCache" !== o.localName) continue;
|
|
1482
|
-
const
|
|
1483
|
-
if (isNaN(
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1506
|
+
const r = parseInt(o.getAttribute("cacheId") ?? "", 10), a = o.getAttribute("r:id");
|
|
1507
|
+
if (isNaN(r) || !a) continue;
|
|
1508
|
+
const c = t.readEmbeddedPart(a);
|
|
1509
|
+
if (!c) continue;
|
|
1510
|
+
const u = K(c, i, (t) => n.numberFormat(t)), d = !u && c.xml ? m(c.xml, n) : void 0, h = !u && c.xml ? J(c.xml) : void 0;
|
|
1511
|
+
s.push({
|
|
1512
|
+
cacheId: r,
|
|
1513
|
+
part: c,
|
|
1514
|
+
...d ? { partFormats: d } : {},
|
|
1515
|
+
...h ? { source: h } : {},
|
|
1516
|
+
...u
|
|
1488
1517
|
});
|
|
1489
1518
|
}
|
|
1490
1519
|
s.length > 0 && (o.pivotCaches = s);
|
|
@@ -1529,8 +1558,8 @@ var Bt = {
|
|
|
1529
1558
|
r.scope = s[o].name;
|
|
1530
1559
|
}
|
|
1531
1560
|
const n = {};
|
|
1532
|
-
for (const o of
|
|
1533
|
-
for (const t of
|
|
1561
|
+
for (const o of U) t.copyFromAttribute(e, o, n);
|
|
1562
|
+
for (const t of H) {
|
|
1534
1563
|
const o = e.getAttribute(t);
|
|
1535
1564
|
"1" !== o && "true" !== o || (n[t] = !0);
|
|
1536
1565
|
}
|
|
@@ -1546,7 +1575,10 @@ var Bt = {
|
|
|
1546
1575
|
s.length > 0 && (o.names = s);
|
|
1547
1576
|
}
|
|
1548
1577
|
processWorkbookPr(t, e, o) {
|
|
1549
|
-
|
|
1578
|
+
if (!e) return;
|
|
1579
|
+
t.copyFromAttribute(e, "date1904", o, "date1904", t.BOOLEAN_COPY), t.copyFromAttribute(e, "codeName", o, "codeName"), t.copyFromAttribute(e, "updateLinks", o, "updateLinks");
|
|
1580
|
+
const s = e.getAttribute("hidePivotFieldList");
|
|
1581
|
+
"1" !== s && "true" !== s || (o.hiddenPivotFieldList = !0);
|
|
1550
1582
|
}
|
|
1551
1583
|
afterVisit(t, e, o) {}
|
|
1552
1584
|
},
|
|
@@ -1672,7 +1704,7 @@ var Bt = {
|
|
|
1672
1704
|
r.length > 0 && (o.sheetDataSet = r);
|
|
1673
1705
|
}
|
|
1674
1706
|
processSheetData(t, e) {
|
|
1675
|
-
const o = new
|
|
1707
|
+
const o = new ht.Builder(), s = e.childNodes, r = s.length;
|
|
1676
1708
|
for (let t = 0; t < r; t++) {
|
|
1677
1709
|
const e = s.item(t);
|
|
1678
1710
|
if (1 !== e.nodeType || "row" !== e.localName) continue;
|
|
@@ -1682,7 +1714,7 @@ var Bt = {
|
|
|
1682
1714
|
if (1 !== e.nodeType || "cell" !== e.localName) continue;
|
|
1683
1715
|
const s = e.getAttribute("r");
|
|
1684
1716
|
if (!s) continue;
|
|
1685
|
-
const i =
|
|
1717
|
+
const i = Q.fastStringToCell(s);
|
|
1686
1718
|
if (void 0 === i?.rowIndex || void 0 === i?.colIndex) continue;
|
|
1687
1719
|
const n = this._readCellValue(e);
|
|
1688
1720
|
void 0 !== n && o.pushAt(i.rowIndex, i.colIndex, n);
|
|
@@ -1702,7 +1734,7 @@ var Bt = {
|
|
|
1702
1734
|
case "str":
|
|
1703
1735
|
default: return e;
|
|
1704
1736
|
case "e": {
|
|
1705
|
-
const t =
|
|
1737
|
+
const t = tt.getBuiltInByLabel(e);
|
|
1706
1738
|
return t ? {
|
|
1707
1739
|
t: "e",
|
|
1708
1740
|
v: t.getCode()
|
|
@@ -1727,7 +1759,50 @@ var Bt = {
|
|
|
1727
1759
|
visit(t, e, o) {
|
|
1728
1760
|
t.copyFromAttribute(e, "name", o, "cacheName"), t.copyFromAttribute(e, "sourceName", o);
|
|
1729
1761
|
const s = t.evaluate("*/tableSlicerCache", e);
|
|
1730
|
-
return s ? (t.copyFromAttribute(s, "tableId", o), t.copyFromAttribute(s, "column", o, "columnId"), t.copyFromAttribute(s, "sortOrder", o), t.copyFromAttribute(s, "customListSort", o, "customListSort", t.BOOLEAN_COPY), t.copyFromAttribute(s, "crossFilter", o), o) : (
|
|
1762
|
+
return s ? (t.copyFromAttribute(s, "tableId", o), t.copyFromAttribute(s, "column", o, "columnId"), t.copyFromAttribute(s, "sortOrder", o), t.copyFromAttribute(s, "customListSort", o, "customListSort", t.BOOLEAN_COPY), t.copyFromAttribute(s, "crossFilter", o), o) : (this.processPivot(t, e, o), o);
|
|
1763
|
+
}
|
|
1764
|
+
processPivot(t, e, o) {
|
|
1765
|
+
const s = [];
|
|
1766
|
+
let r = "";
|
|
1767
|
+
const i = e.childNodes;
|
|
1768
|
+
for (let e = 0; e < i.length; e++) {
|
|
1769
|
+
const n = i.item(e);
|
|
1770
|
+
if (1 !== n.nodeType) continue;
|
|
1771
|
+
if ("pivotTables" === n.localName) {
|
|
1772
|
+
const t = n.childNodes;
|
|
1773
|
+
for (let e = 0; e < t.length; e++) {
|
|
1774
|
+
const o = t.item(e);
|
|
1775
|
+
1 === o.nodeType && "pivotTable" === o.localName && s.push({
|
|
1776
|
+
tabId: o.getAttribute("tabId") ?? "",
|
|
1777
|
+
name: o.getAttribute("name") ?? ""
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
continue;
|
|
1781
|
+
}
|
|
1782
|
+
const l = n.getAttribute("pivotCacheId");
|
|
1783
|
+
if (l && (o.pivotCacheId = l), "state" === n.localName || "timelinePivotFilter" === n.localName) {
|
|
1784
|
+
o.tabular = !0, o.pivotData = (o.pivotData ?? "") + (t.serializeElement(n) ?? "");
|
|
1785
|
+
continue;
|
|
1786
|
+
}
|
|
1787
|
+
if ("data" === n.localName) {
|
|
1788
|
+
let e = null;
|
|
1789
|
+
const s = n.childNodes;
|
|
1790
|
+
for (let t = 0; t < s.length; t++) {
|
|
1791
|
+
const r = s.item(t);
|
|
1792
|
+
if (1 !== r.nodeType) continue;
|
|
1793
|
+
const i = r.getAttribute("pivotCacheId");
|
|
1794
|
+
i && (o.pivotCacheId = i), "tabular" === r.localName && (e = r);
|
|
1795
|
+
}
|
|
1796
|
+
if (e) {
|
|
1797
|
+
o.tabular = !0, t.copyFromAttribute(e, "sortOrder", o), t.copyFromAttribute(e, "customListSort", o, "customListSort", t.BOOLEAN_COPY), t.copyFromAttribute(e, "crossFilter", o), t.copyFromAttribute(e, "showMissing", o, "showMissing", t.BOOLEAN_COPY), o.pivotData = t.serializeElement(n) ?? void 0;
|
|
1798
|
+
continue;
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
const a = t.serializeElement(n);
|
|
1802
|
+
if (null === a) return;
|
|
1803
|
+
r += a;
|
|
1804
|
+
}
|
|
1805
|
+
o.pivotTables = s, o.pivotBody = r;
|
|
1731
1806
|
}
|
|
1732
1807
|
},
|
|
1733
1808
|
SlicersVisitor: class {
|
|
@@ -1746,13 +1821,48 @@ var Bt = {
|
|
|
1746
1821
|
const s = {};
|
|
1747
1822
|
o[e.getAttribute("name")] = s, t.copyFromAttribute(e, "xr10:uid", s, "uid");
|
|
1748
1823
|
const r = e.getAttribute("cache"), i = t.getVisitorParamsState().get("slicerCaches"), n = r ? i?.get(r) : void 0;
|
|
1749
|
-
if (n) for (let t = 0; t <
|
|
1750
|
-
const e =
|
|
1824
|
+
if (n) for (let t = 0; t < Ot.length; t++) {
|
|
1825
|
+
const e = Ot[t];
|
|
1751
1826
|
void 0 !== n[e] && (s[e] = n[e]);
|
|
1752
1827
|
}
|
|
1753
1828
|
t.copyFromAttribute(e, "caption", s), t.copyFromAttribute(e, "startItem", s, "startItem", t.INT_COPY), t.copyFromAttribute(e, "columnCount", s, "columnCount", t.INT_COPY), t.copyFromAttribute(e, "showCaption", s, "showCaption", t.BOOLEAN_COPY), t.copyFromAttribute(e, "level", s, "level", t.INT_COPY), t.copyFromAttribute(e, "style", s), t.copyFromAttribute(e, "lockedPosition", s, "lockedPosition", t.BOOLEAN_COPY), t.copyFromAttribute(e, "rowHeight", s, "rowHeight", t.INT_COPY);
|
|
1754
1829
|
}
|
|
1755
1830
|
},
|
|
1831
|
+
TimelinesVisitor: class {
|
|
1832
|
+
visit(t, e, o) {
|
|
1833
|
+
let s = o.slicers;
|
|
1834
|
+
s || (s = {}, o.slicers = s);
|
|
1835
|
+
const r = e.childNodes;
|
|
1836
|
+
for (let e = 0; e < r.length; e++) {
|
|
1837
|
+
const o = r.item(e);
|
|
1838
|
+
1 === o.nodeType && "timeline" === o.localName && this.processTimeline(t, o, s);
|
|
1839
|
+
}
|
|
1840
|
+
return s;
|
|
1841
|
+
}
|
|
1842
|
+
processTimeline(t, e, o) {
|
|
1843
|
+
const s = {};
|
|
1844
|
+
o[e.getAttribute("name")] = s, t.copyFromAttribute(e, "xr10:uid", s, "uid");
|
|
1845
|
+
const r = e.getAttribute("cache"), i = t.getVisitorParamsState().get("slicerCaches"), n = r ? i?.get(r) : void 0;
|
|
1846
|
+
if (n) for (let t = 0; t < Ot.length; t++) {
|
|
1847
|
+
const e = Ot[t];
|
|
1848
|
+
void 0 !== n[e] && (s[e] = n[e]);
|
|
1849
|
+
}
|
|
1850
|
+
t.copyFromAttribute(e, "caption", s);
|
|
1851
|
+
const l = {};
|
|
1852
|
+
for (let t = 0; t < e.attributes.length; t++) {
|
|
1853
|
+
const o = e.attributes.item(t);
|
|
1854
|
+
Vt.has(o.name) || o.name.startsWith("xmlns") || (l[o.name] = o.value);
|
|
1855
|
+
}
|
|
1856
|
+
s.timelineAttributes = l;
|
|
1857
|
+
let a = "";
|
|
1858
|
+
const c = e.childNodes;
|
|
1859
|
+
for (let e = 0; e < c.length; e++) {
|
|
1860
|
+
const o = c.item(e);
|
|
1861
|
+
1 === o.nodeType && (a += t.serializeElement(o) ?? "");
|
|
1862
|
+
}
|
|
1863
|
+
s.timelineBody = a;
|
|
1864
|
+
}
|
|
1865
|
+
},
|
|
1756
1866
|
FormControlPrVisitor: class {
|
|
1757
1867
|
visit(t, e, o) {
|
|
1758
1868
|
const s = {}, r = e.attributes;
|
|
@@ -1773,7 +1883,7 @@ var Bt = {
|
|
|
1773
1883
|
}
|
|
1774
1884
|
} else "extLst" === o.localName && (n = t.serializeElement(o) ?? void 0);
|
|
1775
1885
|
}
|
|
1776
|
-
const a =
|
|
1886
|
+
const a = E(s, i, n);
|
|
1777
1887
|
return o.formControl = a, a;
|
|
1778
1888
|
}
|
|
1779
1889
|
},
|
|
@@ -1782,7 +1892,7 @@ var Bt = {
|
|
|
1782
1892
|
return o;
|
|
1783
1893
|
}
|
|
1784
1894
|
afterVisit(t, e, o) {
|
|
1785
|
-
for (const t of o?.movables ?? [])
|
|
1895
|
+
for (const t of o?.movables ?? []) _t(t, !1);
|
|
1786
1896
|
}
|
|
1787
1897
|
},
|
|
1788
1898
|
DrawingAnchorVisitor: class {
|
|
@@ -1802,7 +1912,7 @@ var Bt = {
|
|
|
1802
1912
|
x: 0,
|
|
1803
1913
|
y: 0
|
|
1804
1914
|
};
|
|
1805
|
-
return n.x =
|
|
1915
|
+
return n.x = g(e.getAttribute(r)), n.y = g(e.getAttribute(i)), "from" === s ? o.tl = n : o.br = n, o;
|
|
1806
1916
|
}
|
|
1807
1917
|
processOffsetCoord(t, e, o, s) {
|
|
1808
1918
|
if (!e) return;
|
|
@@ -1812,37 +1922,37 @@ var Bt = {
|
|
|
1812
1922
|
x: 0,
|
|
1813
1923
|
y: 0
|
|
1814
1924
|
};
|
|
1815
|
-
return t.evaluate("col", e) && (r.c = parseInt(t.evaluate("col", e).textContent)), t.evaluate("row", e) && (r.r = parseInt(t.evaluate("row", e).textContent)), t.evaluate("colOff", e) && (r.x =
|
|
1925
|
+
return t.evaluate("col", e) && (r.c = parseInt(t.evaluate("col", e).textContent)), t.evaluate("row", e) && (r.r = parseInt(t.evaluate("row", e).textContent)), t.evaluate("colOff", e) && (r.x = g(t.evaluate("colOff", e).textContent)), t.evaluate("rowOff", e) && (r.y = g(t.evaluate("rowOff", e).textContent)), "from" === s ? o.tl = r : o.br = r, o;
|
|
1816
1926
|
}
|
|
1817
1927
|
},
|
|
1818
|
-
DrawingGraphicFrameVisitor: class extends
|
|
1928
|
+
DrawingGraphicFrameVisitor: class extends Ft {
|
|
1819
1929
|
visit(t, e, o) {
|
|
1820
1930
|
if (!e) return;
|
|
1821
1931
|
if (this.isGroupContent(o)) {
|
|
1822
1932
|
if (t.getPath().includes("Fallback")) return {};
|
|
1823
1933
|
const { movable: s } = this.readMemberHeader(t, e, "graphicFrame"), r = t.evaluate("xfrm", e);
|
|
1824
1934
|
if (r) {
|
|
1825
|
-
|
|
1935
|
+
n(r, s);
|
|
1826
1936
|
const e = t.evaluate("off", r), o = t.evaluate("ext", r);
|
|
1827
1937
|
s.anchor = {
|
|
1828
1938
|
tl: {
|
|
1829
|
-
x:
|
|
1830
|
-
y:
|
|
1939
|
+
x: g(e?.getAttribute("x") ?? null) ?? 0,
|
|
1940
|
+
y: g(e?.getAttribute("y") ?? null) ?? 0
|
|
1831
1941
|
},
|
|
1832
1942
|
br: {
|
|
1833
|
-
x:
|
|
1834
|
-
y:
|
|
1943
|
+
x: g(o?.getAttribute("cx") ?? null) ?? 0,
|
|
1944
|
+
y: g(o?.getAttribute("cy") ?? null) ?? 0
|
|
1835
1945
|
}
|
|
1836
1946
|
};
|
|
1837
1947
|
}
|
|
1838
|
-
const i = this.readGraphic(t, e),
|
|
1948
|
+
const i = this.readGraphic(t, e), l = "chart" === i.type ? {
|
|
1839
1949
|
...s.content.json,
|
|
1840
1950
|
...i.json
|
|
1841
1951
|
} : i.json;
|
|
1842
1952
|
return s.content = {
|
|
1843
1953
|
...s.content,
|
|
1844
1954
|
type: i.type,
|
|
1845
|
-
json:
|
|
1955
|
+
json: l
|
|
1846
1956
|
}, o.members.push(s), i.json;
|
|
1847
1957
|
}
|
|
1848
1958
|
o = super.visit(t, e, o);
|
|
@@ -1865,13 +1975,13 @@ var Bt = {
|
|
|
1865
1975
|
const i = r.item(o);
|
|
1866
1976
|
if (1 === i.nodeType) try {
|
|
1867
1977
|
let o = i.localName;
|
|
1868
|
-
"chart" === o ? o = "chart" : "slicer"
|
|
1978
|
+
"chart" === o ? o = "chart" : "slicer" !== o && "timeslicer" !== o || (o = "slicer"), s.type = o;
|
|
1869
1979
|
const r = i.getAttribute("r:id");
|
|
1870
1980
|
if ("chart" === o && r) {
|
|
1871
1981
|
const o = this.readSourceId(t, e), i = t.readEmbeddedPart(r) ?? void 0;
|
|
1872
1982
|
let n;
|
|
1873
1983
|
try {
|
|
1874
|
-
const e = i?.xml ?
|
|
1984
|
+
const e = i?.xml ? q(i.xml) : null;
|
|
1875
1985
|
n = e?.model, e?.lossy && t.warn("A chart states something its model does not; it is saved as it was until it is changed.", { onceKey: "xlsx.chart.lossy" });
|
|
1876
1986
|
} catch (e) {
|
|
1877
1987
|
t.warn(`A chart could not be read into the chart model; it is kept as its markup: ${e?.message ?? e}`, { onceKey: "xlsx.chart.model" });
|
|
@@ -1892,8 +2002,8 @@ var Bt = {
|
|
|
1892
2002
|
return s;
|
|
1893
2003
|
}
|
|
1894
2004
|
},
|
|
1895
|
-
DrawingSpVisitor:
|
|
1896
|
-
DrawingPicVisitor: class extends
|
|
2005
|
+
DrawingSpVisitor: Bt,
|
|
2006
|
+
DrawingPicVisitor: class extends Ft {
|
|
1897
2007
|
visit(t, e, o) {
|
|
1898
2008
|
if (!e) return;
|
|
1899
2009
|
if (this.isGroupContent(o)) {
|
|
@@ -1912,7 +2022,7 @@ var Bt = {
|
|
|
1912
2022
|
readPictureDetails(t, e, o, s, r) {
|
|
1913
2023
|
void 0 !== o?.resId && (r.resId = o.resId), o?.image && (r.image = o.image);
|
|
1914
2024
|
const i = e.getAttribute("macro");
|
|
1915
|
-
i && (r.macro = i), e.hasAttribute("fPublished") && (r.published =
|
|
2025
|
+
i && (r.macro = i), e.hasAttribute("fPublished") && (r.published = u(e.getAttribute("fPublished")));
|
|
1916
2026
|
const n = t.evaluate("nvPicPr/cNvPicPr", e);
|
|
1917
2027
|
if (n?.getAttribute) {
|
|
1918
2028
|
"0" === n.getAttribute("preferRelativeResize") && (r.noRelativeResize = !0);
|
|
@@ -1924,16 +2034,16 @@ var Bt = {
|
|
|
1924
2034
|
const o = t.evaluate("blipFill", e), s = o ? t.evaluate("blip", o) : null;
|
|
1925
2035
|
if (!s) return;
|
|
1926
2036
|
if (!(s.getAttribute("r:embed") ?? s.getAttribute("embed") ?? s.getAttribute("r:link") ?? s.getAttribute("link"))) return t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" }), null;
|
|
1927
|
-
const { type: r, resId: i, ...n } = new
|
|
1928
|
-
return !n.tile && n.stretch && 0 === Object.keys(n.stretch).length && delete n.stretch, n.extLst &&
|
|
2037
|
+
const { type: r, resId: i, ...n } = new p().processImageFill(t, o);
|
|
2038
|
+
return !n.tile && n.stretch && 0 === Object.keys(n.stretch).length && delete n.stretch, n.extLst && Lt.test(n.extLst) && delete n.extLst, {
|
|
1929
2039
|
resId: i,
|
|
1930
2040
|
image: Object.keys(n).length > 0 ? n : void 0
|
|
1931
2041
|
};
|
|
1932
2042
|
}
|
|
1933
2043
|
},
|
|
1934
|
-
DrawingGrpSpVisitor: class extends
|
|
2044
|
+
DrawingGrpSpVisitor: class extends Ft {
|
|
1935
2045
|
constructor(...t) {
|
|
1936
|
-
super(...t), this._fills = new
|
|
2046
|
+
super(...t), this._fills = new p();
|
|
1937
2047
|
}
|
|
1938
2048
|
visit(t, e, o) {
|
|
1939
2049
|
if (!e) return;
|
|
@@ -1953,17 +2063,17 @@ var Bt = {
|
|
|
1953
2063
|
});
|
|
1954
2064
|
}
|
|
1955
2065
|
i.members = [];
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1960
|
-
const
|
|
1961
|
-
if (
|
|
1962
|
-
const e = t.evaluate("xfrm",
|
|
2066
|
+
const l = t.evaluate("nvGrpSpPr/cNvGrpSpPr/grpSpLocks", e);
|
|
2067
|
+
l?.hasAttribute?.("noChangeAspect") && (r.lockAspect = "1" === l.getAttribute("noChangeAspect"));
|
|
2068
|
+
const a = this.readLocks(l);
|
|
2069
|
+
a && (i.locks = a);
|
|
2070
|
+
const c = t.evaluate("grpSpPr", e);
|
|
2071
|
+
if (c) {
|
|
2072
|
+
const e = t.evaluate("xfrm", c);
|
|
1963
2073
|
if (e) {
|
|
1964
|
-
|
|
1965
|
-
const o =
|
|
1966
|
-
|
|
2074
|
+
n(e, r), "1" === e.getAttribute("flipH") && (r.flipH = !0), "1" === e.getAttribute("flipV") && (r.flipV = !0);
|
|
2075
|
+
const o = Dt(t, e, "off", "ext"), l = Dt(t, e, "chOff", "chExt") ?? o;
|
|
2076
|
+
l && (i.childBounds = l), s && o && (r.anchor = {
|
|
1967
2077
|
tl: {
|
|
1968
2078
|
x: o.x,
|
|
1969
2079
|
y: o.y
|
|
@@ -1974,22 +2084,22 @@ var Bt = {
|
|
|
1974
2084
|
}
|
|
1975
2085
|
});
|
|
1976
2086
|
}
|
|
1977
|
-
const o = this._fills.getFill(t,
|
|
2087
|
+
const o = this._fills.getFill(t, c);
|
|
1978
2088
|
o && Object.keys(o).length > 0 && (i.fill = o);
|
|
1979
|
-
const
|
|
1980
|
-
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1983
|
-
const
|
|
1984
|
-
|
|
2089
|
+
const l = this._fills.getEffects(t, c);
|
|
2090
|
+
l && (i.effects = l);
|
|
2091
|
+
const a = t.evaluate("scene3d", c), u = a ? t.serializeElement(a) : null;
|
|
2092
|
+
u && (i.scene3d = u);
|
|
2093
|
+
const d = t.evaluate("extLst", c), h = d ? t.serializeElement(d) : null;
|
|
2094
|
+
h && (i.extLst = {
|
|
1985
2095
|
...i.extLst,
|
|
1986
|
-
properties:
|
|
2096
|
+
properties: h
|
|
1987
2097
|
});
|
|
1988
2098
|
}
|
|
1989
2099
|
return i;
|
|
1990
2100
|
}
|
|
1991
2101
|
},
|
|
1992
|
-
DrawingCxnSpVisitor: class extends
|
|
2102
|
+
DrawingCxnSpVisitor: class extends Bt {
|
|
1993
2103
|
visit(t, e, o) {
|
|
1994
2104
|
if (e) return this.visitShape(t, e, o, "cxnSp", "nvCxnSpPr/cNvCxnSpPr/cxnSpLocks");
|
|
1995
2105
|
}
|
|
@@ -2111,7 +2221,7 @@ var Bt = {
|
|
|
2111
2221
|
}
|
|
2112
2222
|
const i = [], n = s.find((t) => "XFComplements" === t.type)?.arrays.get("MappedFeaturePropertyBags") ?? [];
|
|
2113
2223
|
for (let e = 0; e < n.length; e++) {
|
|
2114
|
-
const o = s[n[e]]?.ids.get("XFControls"), r = void 0 !== o ? s[o]?.ids.get("CellControl") : void 0, l = void 0 !== r ? s[r]?.type : void 0, a = l ?
|
|
2224
|
+
const o = s[n[e]]?.ids.get("XFControls"), r = void 0 !== o ? s[o]?.ids.get("CellControl") : void 0, l = void 0 !== r ? s[r]?.type : void 0, a = l ? Et[l] : void 0;
|
|
2115
2225
|
a || t.warn(`A cell format's feature '${l ?? "unknown"}' is not read; its cells keep their values.`), i.push(a ? { type: a } : null);
|
|
2116
2226
|
}
|
|
2117
2227
|
const l = { controls: i };
|
|
@@ -2190,7 +2300,7 @@ var Bt = {
|
|
|
2190
2300
|
if (1 === o.nodeType) {
|
|
2191
2301
|
if ("t" === o.localName) t.text += o.textContent ?? "";
|
|
2192
2302
|
else if ("rPr" === o.localName) {
|
|
2193
|
-
const e =
|
|
2303
|
+
const e = Yt(o);
|
|
2194
2304
|
e && (t.font = e);
|
|
2195
2305
|
}
|
|
2196
2306
|
}
|
|
@@ -2217,16 +2327,16 @@ var Bt = {
|
|
|
2217
2327
|
visit(t, e, o) {
|
|
2218
2328
|
if (!e) return;
|
|
2219
2329
|
const s = {};
|
|
2220
|
-
t.copyFromAttribute(e, "id", s, "id",
|
|
2330
|
+
t.copyFromAttribute(e, "id", s, "id", a);
|
|
2221
2331
|
const r = e.getAttribute("ref");
|
|
2222
|
-
t.copyFromAttribute(e, "personId", s, "personId",
|
|
2332
|
+
t.copyFromAttribute(e, "personId", s, "personId", a), t.copyFromAttribute(e, "parentId", s, "parentId", a);
|
|
2223
2333
|
const i = e.getAttribute("dT");
|
|
2224
2334
|
i && (s.dt = function(t) {
|
|
2225
2335
|
const e = /^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(t.trim());
|
|
2226
2336
|
if (!e) return t;
|
|
2227
2337
|
const [, o, s, r] = e;
|
|
2228
2338
|
return `${o}${s ? `.${(s + "00").substring(0, 3)}` : ""}${r ?? "Z"}`;
|
|
2229
|
-
}(i)), e.hasAttribute("done") && (s.done =
|
|
2339
|
+
}(i)), e.hasAttribute("done") && (s.done = u(e.getAttribute("done")));
|
|
2230
2340
|
const n = function(t) {
|
|
2231
2341
|
let e;
|
|
2232
2342
|
const o = t.childNodes;
|
|
@@ -2240,12 +2350,12 @@ var Bt = {
|
|
|
2240
2350
|
const s = o.getAttribute("mentionId"), i = o.getAttribute("mentionpersonId");
|
|
2241
2351
|
if (!s || !i) continue;
|
|
2242
2352
|
const n = {
|
|
2243
|
-
id:
|
|
2244
|
-
personId:
|
|
2353
|
+
id: a(s),
|
|
2354
|
+
personId: a(i)
|
|
2245
2355
|
}, l = parseInt(o.getAttribute("startIndex") ?? "", 10);
|
|
2246
2356
|
isNaN(l) || (n.startIndex = l);
|
|
2247
|
-
const
|
|
2248
|
-
isNaN(
|
|
2357
|
+
const c = parseInt(o.getAttribute("length") ?? "", 10);
|
|
2358
|
+
isNaN(c) || (n.length = c), (e ??= []).push(n);
|
|
2249
2359
|
}
|
|
2250
2360
|
}
|
|
2251
2361
|
return e;
|
|
@@ -2263,34 +2373,34 @@ var Bt = {
|
|
|
2263
2373
|
const o = r.item(e);
|
|
2264
2374
|
if (1 === o.nodeType && "person" === o.localName) {
|
|
2265
2375
|
const e = {};
|
|
2266
|
-
t.copyFromAttribute(o, "id", e, "id",
|
|
2376
|
+
t.copyFromAttribute(o, "id", e, "id", a), t.copyFromAttribute(o, "displayName", e), t.copyFromAttribute(o, "userId", e, "userId", a), t.copyFromAttribute(o, "providerId", e), s.push(e);
|
|
2267
2377
|
}
|
|
2268
2378
|
}
|
|
2269
2379
|
return s.length > 0 && (o.persons = s), s;
|
|
2270
2380
|
}
|
|
2271
2381
|
}
|
|
2272
|
-
},
|
|
2382
|
+
}, Mt = class {
|
|
2273
2383
|
constructor(t, e) {
|
|
2274
2384
|
this.path = t, this.visitor = e;
|
|
2275
2385
|
}
|
|
2276
|
-
},
|
|
2386
|
+
}, zt = class {
|
|
2277
2387
|
constructor() {
|
|
2278
|
-
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new
|
|
2388
|
+
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new Xt.RelsVisitor()), this.registerVisitor("cp:coreProperties", new Xt.CorePropertiesVisitor()), this.registerVisitor("Properties", new Xt.AppPropertiesVisitor()), this.registerVisitor("spPr", new Xt.ShapePropertiesVisitor()), this.registerVisitor("txBody", new Xt.ShapeTextVisitor()), this.registerVisitor("txPr", new Xt.TextPropertiesVisitor()), this.registerVisitor("a:theme", new Xt.ThemeVisitor()), this.registerVisitor("a:theme", new Xt.ClrSchemeVisitor(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new Xt.FontSchemeVisitor(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new Xt.FmtSchemeVisitor(), "themeElements/fmtScheme"), this.registerVisitor("a:theme", new Xt.ObjectDefaultsVisitor(), "objectDefaults"), this.registerVisitor("autoFilter", new Xt.AutoFilterVisitor()), this.registerVisitor("sortState", new Xt.SortStateVisitor()), this.registerVisitor("s:workbook", new Xt.WorkbookVisitor()), this.registerVisitor("styleSheet", new Xt.SheetStyleVisitor()), this.registerVisitor("x14:table", new Xt.TableX14Visitor()), this.registerVisitor("table", new Xt.TableVisitor()), this.registerVisitor("externalLink", new Xt.ExternalLinkVisitor()), this.registerVisitor("wsDr", new Xt.DrawingVisitor()), this.registerVisitor("twoCellAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("oneCellAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("absoluteAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("graphicFrame", new Xt.DrawingGraphicFrameVisitor()), this.registerVisitor("sp", new Xt.DrawingSpVisitor()), this.registerVisitor("grpSp", new Xt.DrawingGrpSpVisitor()), this.registerVisitor("cxnSp", new Xt.DrawingCxnSpVisitor()), this.registerVisitor("pic", new Xt.DrawingPicVisitor()), this.registerVisitor("metadata", new Xt.MetadataVisitor()), this.registerVisitor("FeaturePropertyBags", new Xt.FeaturePropertyBagVisitor()), this.registerVisitor("comments", new Xt.CommentsVisitor()), this.registerVisitor("comment", new Xt.CommentVisitor()), this.registerVisitor("ThreadedComments", new Xt.ThreadedCommentsVisitor()), this.registerVisitor("threadedComment", new Xt.ThreadedCommentVisitor()), this.registerVisitor("threadedComment", new Xt.TextPropertiesVisitor("content"), "text"), this.registerVisitor("personList", new Xt.PersonListVisitor()), this.registerVisitor("slicerCacheDefinition", new Xt.SlicerCacheDefinitionVisitor()), this.registerVisitor("slicers", new Xt.SlicersVisitor()), this.registerVisitor("timelineCacheDefinition", new Xt.SlicerCacheDefinitionVisitor()), this.registerVisitor("timelines", new Xt.TimelinesVisitor()), this.registerVisitor("formControlPr", new Xt.FormControlPrVisitor());
|
|
2279
2389
|
}
|
|
2280
2390
|
registerVisitor(t, e, o = null) {
|
|
2281
2391
|
-1 === t.indexOf(":") && (t = "*:" + t);
|
|
2282
2392
|
const s = t.split(":"), r = s.length > 1 ? s[1] : s[0];
|
|
2283
2393
|
if (!o) return this.visitorsByXmlTagName.set(r, e), void this.visitorsByXmlTagName.set(t, e);
|
|
2284
2394
|
let i = this.scopedVisitorsByXmlTagName.get(r);
|
|
2285
|
-
i || (i = [], this.scopedVisitorsByXmlTagName.set(r, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new
|
|
2395
|
+
i || (i = [], this.scopedVisitorsByXmlTagName.set(r, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new Mt(o, e));
|
|
2286
2396
|
}
|
|
2287
|
-
parseDxf(t, e = "", o =
|
|
2397
|
+
parseDxf(t, e = "", o = Z.EmptyObject) {
|
|
2288
2398
|
this.visitorParamsState || (this.visitorParamsState = /* @__PURE__ */ new Map());
|
|
2289
2399
|
const s = this.visitorParamsState, r = s.get("processingDXFs");
|
|
2290
2400
|
s.set("processingDXFs", !0);
|
|
2291
2401
|
try {
|
|
2292
|
-
const s = new
|
|
2293
|
-
return new
|
|
2402
|
+
const s = new yt(null, this, "/dxf", t, {}, e, o), r = {};
|
|
2403
|
+
return new Xt.SheetStyleVisitor().processDXF(s, t, r), r;
|
|
2294
2404
|
} finally {
|
|
2295
2405
|
void 0 === r ? s.delete("processingDXFs") : s.set("processingDXFs", r);
|
|
2296
2406
|
}
|
|
@@ -2298,13 +2408,13 @@ var Bt = {
|
|
|
2298
2408
|
getVisitorParamsState() {
|
|
2299
2409
|
return this.visitorParamsState;
|
|
2300
2410
|
}
|
|
2301
|
-
transform(t, e, o =
|
|
2411
|
+
transform(t, e, o = Z.EmptyObject) {
|
|
2302
2412
|
const s = t.documentElement;
|
|
2303
2413
|
this.visitorParamsState && !o?.paramMap || (this.visitorParamsState = o?.paramMap ?? /* @__PURE__ */ new Map());
|
|
2304
2414
|
const r = {};
|
|
2305
2415
|
let i = this.visitorsByXmlTagName.get(s.nodeName);
|
|
2306
2416
|
if (i || (i = this.visitorsByXmlTagName.get(s.localName)), !i) throw new Error(`A visitor for the root element: '${s.nodeName}' or '${s.localName}' must be registered.`);
|
|
2307
|
-
const n = "/" + s.localName, l = new
|
|
2417
|
+
const n = "/" + s.localName, l = new yt(null, this, n, s, r, e, o), a = [];
|
|
2308
2418
|
this._doWalk(i, l, a, s, r, e, o);
|
|
2309
2419
|
const c = a.length;
|
|
2310
2420
|
for (let t = 0; t < c; t++) {
|
|
@@ -2333,7 +2443,7 @@ var Bt = {
|
|
|
2333
2443
|
for (; c && c !== s;) l = c.localName + "/" + l, c = c.parentNode;
|
|
2334
2444
|
const u = e.getPath() + "/" + l;
|
|
2335
2445
|
if (a.visitor) {
|
|
2336
|
-
const s = new
|
|
2446
|
+
const s = new yt(e, this, u, e.getElemRoot(), e.getJsonRoot(), i, n);
|
|
2337
2447
|
this._doWalk(a.visitor, s, o, t, r, i, n);
|
|
2338
2448
|
}
|
|
2339
2449
|
};
|
|
@@ -2360,10 +2470,10 @@ var Bt = {
|
|
|
2360
2470
|
const a = s;
|
|
2361
2471
|
let p = a.nodeName, m = c.get(p);
|
|
2362
2472
|
m || (p = a.localName, m = c.get(p));
|
|
2363
|
-
const f = e.getPath() + "/" + p, g = new
|
|
2473
|
+
const f = e.getPath() + "/" + p, g = new yt(e, this, f, u, d, i, n);
|
|
2364
2474
|
this._doWalk(m, g, o, a, l ?? r, i, n);
|
|
2365
2475
|
}
|
|
2366
2476
|
return l;
|
|
2367
2477
|
}
|
|
2368
2478
|
};
|
|
2369
|
-
export {
|
|
2479
|
+
export { zt as DOMTransformer, yt as ExecutionContext, l as NumberUtils, i as VisitorUtils };
|