@sheetxl/io-xlsx 0.8.0-beta.1 → 0.8.0-beta.3
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/browser/cjs/BGFXHa9DqD7qfj7K.cjs +5 -0
- package/browser/cjs/C8oC1tPbhgR0Dqtx.cjs +2 -0
- package/browser/cjs/CIQ0CyhkW02G7UhX.cjs +1 -0
- package/browser/cjs/{D5Y4KQhKdukOkjvA.cjs → D3EWCPfCu-qMOIGd.cjs} +1 -2
- package/browser/cjs/{BAtEL-5TLyoaPFDP.cjs → DULsYP_GcPGLVYSE.cjs} +10 -1
- package/browser/cjs/DtBN3UOzNJjYBwJ6.cjs +1 -0
- package/browser/cjs/index.cjs +1 -1
- package/browser/cjs/sNZR19Wk-XQ2xZ9E.cjs +1 -0
- package/browser/esm/{BkNXyG6NC-w5Xo92.mjs → 9kAH9485xCkOzN_I.mjs} +28 -13
- package/browser/esm/{Cok_fBIUCHDSrKw0.mjs → B8BqrWUHPa06PzmO.mjs} +446 -347
- package/browser/esm/{Dj7D2nVdAZ3TiUks.mjs → BdmxnPd0ptyqOCaM.mjs} +1595 -1124
- package/browser/esm/BzlhIt5zSG0Ts4xd.mjs +3324 -0
- package/browser/esm/CED9M7CASY6R5LBH.mjs +159 -0
- package/browser/esm/{4BWLu134ABlCQEtM.mjs → DNwAYvPHH1G27K-w.mjs} +1824 -1051
- package/browser/esm/{ijQzHH-bvDfUHIi1.mjs → DbSKfjIyE4a1YHoX.mjs} +1 -1
- package/browser/esm/{Dz1Dp8DDJvhd09RR.mjs → DtypWHI_cwfAvvyR.mjs} +1 -1
- package/browser/esm/PpS5wqbPAZ9D3W7c.mjs +67 -0
- package/browser/esm/{Ctqql4O-3xj2K8vv.mjs → aL7oQqItresvrEf2.mjs} +2 -2
- package/browser/esm/{CLWzJJyoSrykkVLX.mjs → h9ucGRwzGRA2N44D.mjs} +2 -2
- package/browser/esm/index.mjs +3 -3
- package/node/esm/{fOnuUjpPCAzmuIXN.mjs → A5sK8gK9ymQOyChG.mjs} +2 -2
- package/node/esm/CCD1vEduHhKax_d_.mjs +170 -0
- package/node/esm/{CF1R5ovFsRNu--Rw.mjs → CJGTDWKH_yrWAW8o.mjs} +1934 -1143
- package/node/esm/{CEAmv36xpTNgFwl_.mjs → CsTuNxyS02vBz0Tk.mjs} +49 -35
- package/node/esm/{Ctcl4jN52INWpKWC.mjs → DOXXVsfrZi_6L0V7.mjs} +607 -506
- package/node/esm/OkoETXoPSSH3gQxa.mjs +2959 -0
- package/node/esm/TERvDGVSsvCefEiX.mjs +3410 -0
- package/node/esm/index.mjs +40 -25
- package/node/esm/{CEV7nKotMpeRRnQC.mjs → mlCt7xhd97xcwrEr.mjs} +1 -1
- package/package.json +3 -3
- package/types/src/ConditionalFormatRules.d.ts +3 -3
- package/types/src/DataValidationRules.d.ts +18 -2
- package/types/src/ExcelCalcStamp.d.ts +39 -0
- package/types/src/ExcelCompat.d.ts +197 -42
- package/types/src/LegacyFormula.d.ts +28 -7
- package/types/src/Plugin.d.ts +16 -5
- package/types/src/ProtectionAttributes.d.ts +38 -0
- package/types/src/SourcePackage.d.ts +31 -12
- package/types/src/Types.d.ts +17 -0
- package/types/src/reader/HiddenFormulas.d.ts +16 -0
- package/types/src/reader/Warning.d.ts +29 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +1 -1
- package/types/src/reader/dom/ExecutionContext.d.ts +16 -3
- package/types/src/reader/dom/Types.d.ts +19 -3
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +18 -1
- package/types/src/reader/domVisitors/CommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +21 -3
- package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +6 -1
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -1
- package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
- package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +11 -1
- package/types/src/reader/sax/LeanSaxParser.d.ts +58 -0
- package/types/src/reader/sax/SaxParser.d.ts +11 -1
- package/types/src/reader/sax/SaxVisitor.d.ts +3 -2
- package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +9 -0
- package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +11 -4
- package/types/src/utils/VmlNoteShapes.d.ts +75 -0
- package/types/src/vba/VBAProject.d.ts +52 -4
- package/types/src/writer/builder/ContentTypes.d.ts +13 -0
- package/types/src/writer/builder/Emitter.d.ts +6 -6
- package/types/src/writer/builder/OpcXmlUtils.d.ts +2 -0
- package/types/src/writer/builder/PackageBuilder.d.ts +70 -22
- package/types/src/writer/builder/PartWriter.d.ts +5 -0
- package/types/src/writer/builder/RelationshipSet.d.ts +3 -0
- package/types/src/writer/builder/Types.d.ts +107 -38
- package/types/src/writer/builder/_Types.d.ts +17 -0
- package/types/src/writer/emitters/CommentsEmitter.d.ts +52 -0
- package/types/src/writer/emitters/EmbeddedPartEmitter.d.ts +60 -0
- package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +19 -0
- package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +18 -0
- package/types/src/writer/emitters/PersonsEmitter.d.ts +17 -0
- package/types/src/writer/emitters/PivotTableEmitter.d.ts +45 -0
- package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +21 -0
- package/types/src/writer/emitters/WorkbookEmitter.d.ts +16 -3
- package/types/src/writer/utils/DrawMLUtils.d.ts +16 -1
- package/types/src/writer/utils/HiddenFormulaXfs.d.ts +28 -0
- package/browser/cjs/Bg0e53JZa8vhmm5a.cjs +0 -1
- package/browser/cjs/CK5FFUvet6FnIYO_.cjs +0 -5
- package/browser/cjs/DV6LeTEiiFUrZoxj.cjs +0 -1
- package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +0 -1
- package/browser/cjs/Db8YjGM6TG34c8aT.cjs +0 -1
- package/browser/esm/BzQ_lPzc8C4OTIGZ.mjs +0 -99
- package/browser/esm/CJknI8BYGSZr-4zS.mjs +0 -52
- package/browser/esm/D-m_kQLaewdwuXaF.mjs +0 -2685
- package/node/esm/CvnRSooxEQdlJgMn.mjs +0 -2766
- package/node/esm/DQd0vxzTaPt2qSL-.mjs +0 -108
- package/node/esm/ssSlRCbCqxvZ9IX8.mjs +0 -2481
|
@@ -1,14 +1,14 @@
|
|
|
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.3
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { a as t,
|
|
8
|
-
import {
|
|
9
|
-
import { CommonUtils as
|
|
10
|
-
import { AddressUtils as
|
|
11
|
-
var
|
|
7
|
+
import { a as t, c as e, g as s, i as r, m as o, o as i, p as n, r as a, s as l, t as c } from "./CCD1vEduHhKax_d_.mjs";
|
|
8
|
+
import { b as u, g as h, x as p } from "./OkoETXoPSSH3gQxa.mjs";
|
|
9
|
+
import { CommonUtils as d } from "@sheetxl/utils";
|
|
10
|
+
import { AddressUtils as g, FormulaError as m, IBorders as b, ICondition as f, IEffect as A, IFill as y, IFont as v, IRange as N, IStyle as F, ITextFrame as C, Sort as w, Tuple as P } from "@sheetxl/sdk";
|
|
11
|
+
var S = class {
|
|
12
12
|
constructor(t) {
|
|
13
13
|
this.list = t;
|
|
14
14
|
}
|
|
@@ -34,23 +34,26 @@ var w = class {
|
|
|
34
34
|
[Symbol.iterator]() {
|
|
35
35
|
return this.list.values();
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, x = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, T = (t) => {
|
|
38
38
|
const e = parseInt(t);
|
|
39
39
|
return isNaN(e) ? null : e;
|
|
40
40
|
}, O = (t) => {
|
|
41
41
|
const e = parseFloat(t);
|
|
42
42
|
return isNaN(e) ? null : e;
|
|
43
|
-
},
|
|
44
|
-
constructor(t, e, s, r, o, i = null, n =
|
|
43
|
+
}, k = /* @__PURE__ */ new Map(), V = class {
|
|
44
|
+
constructor(t, e, s, r, o, i = null, n = d.EmptyObject) {
|
|
45
45
|
this._fileLocation = "";
|
|
46
|
-
const
|
|
47
|
-
this._parent = t, this.sharedShared = e, this.currentPath = s, this.elemRoot = r, this.jsonRoot = o, t ? (this._fileLocation = t._fileLocation, this._getRef = t._getRef, this._getRefs = t._getRefs, this._serializeElement = t._serializeElement) : (i && (this._fileLocation = i), n?.getRef && (this._getRef =
|
|
46
|
+
const a = (t, e, s) => n?.getRef?.(t, e, s, n?.parsedRefs), l = (t) => n?.getRefs?.(t, n?.parsedRefs);
|
|
47
|
+
this._parent = t, this.sharedShared = e, this.currentPath = s, this.elemRoot = r, this.jsonRoot = o, 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 = a), n?.getRefs && (this._getRefs = l), this._onWarning = n?.onWarning, this._addPerson = n?.addPerson, this._serializeElement = n?.serializeElement, this._readEmbeddedPart = n?.readEmbeddedPart);
|
|
48
48
|
}
|
|
49
49
|
getRef(t, e = !1) {
|
|
50
50
|
return this._getRef?.(t, this._fileLocation, e) ?? null;
|
|
51
51
|
}
|
|
52
|
+
readEmbeddedPart(t) {
|
|
53
|
+
return this._readEmbeddedPart?.(t, this._fileLocation) ?? null;
|
|
54
|
+
}
|
|
52
55
|
getRelationships() {
|
|
53
|
-
return this._getRefs?.(this._fileLocation) ??
|
|
56
|
+
return this._getRefs?.(this._fileLocation) ?? k;
|
|
54
57
|
}
|
|
55
58
|
getPath() {
|
|
56
59
|
return this.currentPath;
|
|
@@ -64,8 +67,11 @@ var w = class {
|
|
|
64
67
|
getJsonRoot() {
|
|
65
68
|
return this.jsonRoot;
|
|
66
69
|
}
|
|
67
|
-
warn(t) {
|
|
68
|
-
this.
|
|
70
|
+
warn(t, e) {
|
|
71
|
+
this._raiseWarning(t, this.getFileLocation(), e?.onceKey);
|
|
72
|
+
}
|
|
73
|
+
_raiseWarning(t, e, s) {
|
|
74
|
+
this._onWarning ? this._onWarning(t, e, s) : this._parent ? this._parent._raiseWarning(t, e, s) : console.warn(t);
|
|
69
75
|
}
|
|
70
76
|
serializeElement(t) {
|
|
71
77
|
return this._serializeElement?.(t) ?? null;
|
|
@@ -106,7 +112,7 @@ var w = class {
|
|
|
106
112
|
}
|
|
107
113
|
if (s = i, 0 === s.length) return null;
|
|
108
114
|
}
|
|
109
|
-
return 1 === s.length ? s[0] : 0 === s.length ? null : new
|
|
115
|
+
return 1 === s.length ? s[0] : 0 === s.length ? null : new S(s);
|
|
110
116
|
}
|
|
111
117
|
_matchesElementName(t, e) {
|
|
112
118
|
return e.includes(":") ? (t.tagName || t.nodeName) === e : t.localName === e;
|
|
@@ -122,10 +128,10 @@ var w = class {
|
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
130
|
getFromPath(t, e) {
|
|
125
|
-
return
|
|
131
|
+
return d.getFromPath(t, e);
|
|
126
132
|
}
|
|
127
133
|
setToPath(t, e, s) {
|
|
128
|
-
return
|
|
134
|
+
return d.setToPath(t, e, s);
|
|
129
135
|
}
|
|
130
136
|
getValAttrAsString(t, e) {
|
|
131
137
|
let s = this.evaluate(t, e);
|
|
@@ -146,10 +152,10 @@ var w = class {
|
|
|
146
152
|
return s && s.hasAttribute("val") ? parseFloat(s.getAttribute("val")) ?? null : null;
|
|
147
153
|
}
|
|
148
154
|
get BOOLEAN_COPY() {
|
|
149
|
-
return
|
|
155
|
+
return x;
|
|
150
156
|
}
|
|
151
157
|
get INT_COPY() {
|
|
152
|
-
return
|
|
158
|
+
return T;
|
|
153
159
|
}
|
|
154
160
|
get FLOAT_COPY() {
|
|
155
161
|
return O;
|
|
@@ -169,32 +175,32 @@ var w = class {
|
|
|
169
175
|
}
|
|
170
176
|
this.setToPath(s, r, i);
|
|
171
177
|
}
|
|
172
|
-
},
|
|
173
|
-
isBlank: () =>
|
|
174
|
-
isNotBlank: () =>
|
|
175
|
-
length: () =>
|
|
176
|
-
parseRotation: () =>
|
|
177
|
-
parseValAttrAsBoolean: () =>
|
|
178
|
-
parseValAttrAsFloat: () =>
|
|
179
|
-
parseValAttrAsInteger: () =>
|
|
180
|
-
parseValAttrAsString: () =>
|
|
181
|
-
}),
|
|
178
|
+
}, I = s({
|
|
179
|
+
isBlank: () => j,
|
|
180
|
+
isNotBlank: () => D,
|
|
181
|
+
length: () => Y,
|
|
182
|
+
parseRotation: () => L,
|
|
183
|
+
parseValAttrAsBoolean: () => B,
|
|
184
|
+
parseValAttrAsFloat: () => R,
|
|
185
|
+
parseValAttrAsInteger: () => E,
|
|
186
|
+
parseValAttrAsString: () => _
|
|
187
|
+
}), L = (t, e) => {
|
|
182
188
|
if (!t || !t.hasAttribute("rot")) return;
|
|
183
|
-
const s = t.getAttribute("rot"),
|
|
184
|
-
-1e3 !==
|
|
185
|
-
},
|
|
189
|
+
const s = t.getAttribute("rot"), o = d.roundAccurately(r(s), 2);
|
|
190
|
+
-1e3 !== o && (e.rotation = o);
|
|
191
|
+
}, _ = (t, e, s, r, o) => {
|
|
186
192
|
const i = t.getValAttrAsString(r, e);
|
|
187
193
|
null !== i && (s[o] = i);
|
|
188
|
-
},
|
|
194
|
+
}, B = (t, e, s, r, o = r, i = null) => {
|
|
189
195
|
const n = t.getValAttrAsBoolean(r, e, i);
|
|
190
196
|
null !== n && (s[o] = n);
|
|
191
|
-
},
|
|
197
|
+
}, E = (t, e, s, r, o) => {
|
|
192
198
|
const i = t.getValAttrAsInteger(r, e);
|
|
193
199
|
null !== i && (s[o] = i);
|
|
194
|
-
},
|
|
200
|
+
}, R = (t, e, s, r, o, i = 1) => {
|
|
195
201
|
const n = t.getValAttrAsFloat(r, e);
|
|
196
202
|
null !== n && (s[o] = n * i);
|
|
197
|
-
},
|
|
203
|
+
}, j = (t) => !t || 0 === t.trim().length, D = (t) => !j(t), Y = (t) => t?.length ?? 0, M = class {
|
|
198
204
|
constructor(t) {
|
|
199
205
|
this.jsonKey = t;
|
|
200
206
|
}
|
|
@@ -202,33 +208,33 @@ var w = class {
|
|
|
202
208
|
const r = {};
|
|
203
209
|
return s[this.jsonKey] = r, r;
|
|
204
210
|
}
|
|
205
|
-
},
|
|
211
|
+
}, z = class {
|
|
206
212
|
visit(t, e, s) {}
|
|
207
213
|
getStroke(t, e) {
|
|
208
214
|
const s = t.evaluate("ln", e);
|
|
209
215
|
return s ? this.parseLn(t, s) : {};
|
|
210
216
|
}
|
|
211
|
-
parseLn(t,
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
const o = t.evaluate("miter",
|
|
215
|
-
o && (
|
|
216
|
-
const
|
|
217
|
-
if (
|
|
218
|
-
const e = t.evaluate("ds",
|
|
217
|
+
parseLn(t, s) {
|
|
218
|
+
const r = {};
|
|
219
|
+
s.hasAttribute("algn") && (r.align = s.getAttribute("algn")), s.hasAttribute("cap") && (r.lineCap = X(s.getAttribute("cap"))), s.hasAttribute("cmpd") && (r.compound = s.getAttribute("cmpd")), s.hasAttribute("w") && (r.width = e(s.getAttribute("w")));
|
|
220
|
+
const o = t.evaluate("miter", s);
|
|
221
|
+
o && (r.lineJoin = "miter", o.hasAttribute("lim") && (r.miterLimit = parseFloat(o.getAttribute("lim")) / 1e5)), t.evaluate("bevel", s) && (r.lineJoin = "bevel"), t.evaluate("round", s) && (r.lineJoin = "round");
|
|
222
|
+
const n = t.evaluate("custDash", s);
|
|
223
|
+
if (n) {
|
|
224
|
+
const e = t.evaluate("ds", n);
|
|
219
225
|
if (e && e.length > 0) {
|
|
220
226
|
const t = [];
|
|
221
227
|
for (let s = 0; s < e.length; s++) {
|
|
222
|
-
const
|
|
223
|
-
t.push(r
|
|
228
|
+
const r = e.item(s);
|
|
229
|
+
t.push(i(r.getAttribute("d") ?? "")), t.push(i(r.getAttribute("sp") ?? ""));
|
|
224
230
|
}
|
|
225
|
-
|
|
231
|
+
r.dash = t;
|
|
226
232
|
}
|
|
227
233
|
}
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
return
|
|
234
|
+
const a = t.evaluate("prstDash", s);
|
|
235
|
+
a && a.hasAttribute("val") && (r.dash = a.getAttribute("val")), this.parseEndElement(t, s, r, "headEnd", "head"), this.parseEndElement(t, s, r, "tailEnd", "tail");
|
|
236
|
+
const l = this.getFill(t, s);
|
|
237
|
+
return l && (r.fill = l), r;
|
|
232
238
|
}
|
|
233
239
|
parseEndElement(t, e, s, r, o) {
|
|
234
240
|
const i = t.evaluate(r, e);
|
|
@@ -250,55 +256,55 @@ var w = class {
|
|
|
250
256
|
}
|
|
251
257
|
return r;
|
|
252
258
|
}
|
|
253
|
-
processEffectElement(
|
|
254
|
-
switch (
|
|
259
|
+
processEffectElement(s, o, n) {
|
|
260
|
+
switch (n) {
|
|
255
261
|
case "outerShdw": {
|
|
256
|
-
const
|
|
257
|
-
type:
|
|
258
|
-
color: this.processAdjColor(
|
|
262
|
+
const n = {
|
|
263
|
+
type: A.Type.OuterShadow,
|
|
264
|
+
color: this.processAdjColor(s, o)
|
|
259
265
|
};
|
|
260
|
-
return
|
|
266
|
+
return o.hasAttribute("dist") && (n.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (n.angle = r(o.getAttribute("dir"))), o.hasAttribute("blurRad") && (n.blur = e(o.getAttribute("blurRad"))), o.hasAttribute("algn") && (n.alignment = o.getAttribute("algn")), o.hasAttribute("rotWithShape") && (n.isRotatedWithShape = t(o.getAttribute("rotWithShape"))), o.hasAttribute("sx") && (n.scaleX = i(o.getAttribute("sx"))), o.hasAttribute("sy") && (n.scaleY = i(o.getAttribute("sy"))), o.hasAttribute("kx") && (n.skewX = r(o.getAttribute("kx"))), o.hasAttribute("ky") && (n.skewY = r(o.getAttribute("ky"))), n;
|
|
261
267
|
}
|
|
262
268
|
case "innerShdw": {
|
|
263
|
-
const
|
|
264
|
-
type:
|
|
265
|
-
color: this.processAdjColor(
|
|
269
|
+
const t = {
|
|
270
|
+
type: A.Type.InnerShadow,
|
|
271
|
+
color: this.processAdjColor(s, o)
|
|
266
272
|
};
|
|
267
|
-
return
|
|
273
|
+
return o.hasAttribute("dist") && (t.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (t.angle = r(o.getAttribute("dir"))), o.hasAttribute("blurRad") && (t.blur = e(o.getAttribute("blurRad"))), t;
|
|
268
274
|
}
|
|
269
275
|
case "prstShdw": {
|
|
270
|
-
const
|
|
271
|
-
type:
|
|
272
|
-
color: this.processAdjColor(
|
|
273
|
-
preset:
|
|
276
|
+
const t = {
|
|
277
|
+
type: A.Type.PresetShadow,
|
|
278
|
+
color: this.processAdjColor(s, o),
|
|
279
|
+
preset: o.getAttribute("prst") ?? void 0
|
|
274
280
|
};
|
|
275
|
-
return
|
|
281
|
+
return o.hasAttribute("dist") && (t.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (t.angle = r(o.getAttribute("dir"))), t;
|
|
276
282
|
}
|
|
277
283
|
case "glow": {
|
|
278
|
-
const
|
|
279
|
-
type:
|
|
280
|
-
color: this.processAdjColor(
|
|
284
|
+
const t = {
|
|
285
|
+
type: A.Type.Glow,
|
|
286
|
+
color: this.processAdjColor(s, o)
|
|
281
287
|
};
|
|
282
|
-
return
|
|
288
|
+
return o.hasAttribute("rad") && (t.radius = e(o.getAttribute("rad"))), t;
|
|
283
289
|
}
|
|
284
290
|
case "softEdge": {
|
|
285
|
-
const t = { type:
|
|
286
|
-
return
|
|
291
|
+
const t = { type: A.Type.SoftEdge };
|
|
292
|
+
return o.hasAttribute("rad") && (t.radius = e(o.getAttribute("rad"))), t;
|
|
287
293
|
}
|
|
288
294
|
case "reflection": {
|
|
289
|
-
const
|
|
290
|
-
return
|
|
295
|
+
const s = { type: A.Type.Reflection };
|
|
296
|
+
return o.hasAttribute("blurRad") && (s.blur = e(o.getAttribute("blurRad"))), o.hasAttribute("dist") && (s.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (s.angle = r(o.getAttribute("dir"))), o.hasAttribute("fadeDir") && (s.fadeAngle = r(o.getAttribute("fadeDir"))), o.hasAttribute("stA") && (s.startAlpha = i(o.getAttribute("stA"))), o.hasAttribute("stPos") && (s.startPosition = i(o.getAttribute("stPos"))), o.hasAttribute("endA") && (s.endAlpha = i(o.getAttribute("endA"))), o.hasAttribute("endPos") && (s.endPosition = i(o.getAttribute("endPos"))), o.hasAttribute("sx") && (s.scaleX = i(o.getAttribute("sx"))), o.hasAttribute("sy") && (s.scaleY = i(o.getAttribute("sy"))), o.hasAttribute("kx") && (s.skewX = r(o.getAttribute("kx"))), o.hasAttribute("ky") && (s.skewY = r(o.getAttribute("ky"))), o.hasAttribute("algn") && (s.alignment = o.getAttribute("algn")), o.hasAttribute("rotWithShape") && (s.isRotatedWithShape = t(o.getAttribute("rotWithShape"))), s;
|
|
291
297
|
}
|
|
292
298
|
default: return;
|
|
293
299
|
}
|
|
294
300
|
}
|
|
295
301
|
getFill(t, e) {
|
|
296
|
-
if (t.evaluate("noFill", e)) return { type:
|
|
302
|
+
if (t.evaluate("noFill", e)) return { type: y.Type.None };
|
|
297
303
|
const s = t.evaluate("solidFill", e);
|
|
298
304
|
if (s) {
|
|
299
305
|
const e = this.processAdjColor(t, s);
|
|
300
306
|
if (e) return {
|
|
301
|
-
type:
|
|
307
|
+
type: y.Type.Solid,
|
|
302
308
|
color: e
|
|
303
309
|
};
|
|
304
310
|
}
|
|
@@ -309,41 +315,41 @@ var w = class {
|
|
|
309
315
|
const i = t.evaluate("blipFill", e);
|
|
310
316
|
return i ? this.processImageFill(t, i) : null;
|
|
311
317
|
}
|
|
312
|
-
processGradFill(
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
const l =
|
|
318
|
+
processGradFill(e, s) {
|
|
319
|
+
const o = { type: y.Type.Gradient };
|
|
320
|
+
s.hasAttribute("rotWithShape") && (o.isRotatedWithShape = "1" === s.getAttribute("rotWithShape"));
|
|
321
|
+
const n = e.evaluate("lin", s);
|
|
322
|
+
n && (o.gradientType = y.GradientType.Linear, n.hasAttribute("ang") && (o.angle = r(n.getAttribute("ang"))), n.hasAttribute("scaled") && (o.scaled = t(n.getAttribute("scaled"))));
|
|
323
|
+
const a = {};
|
|
324
|
+
s.hasAttribute("flip") && (a.mirror = s.getAttribute("flip")), Object.keys(a).length > 0 && (o.tile = a);
|
|
325
|
+
const l = e.evaluate("path", s);
|
|
320
326
|
if (l) {
|
|
321
|
-
l.hasAttribute("path") && (
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
const c =
|
|
326
|
-
c && (
|
|
327
|
-
const u = [], h =
|
|
328
|
-
for (let
|
|
329
|
-
const s = h.item(
|
|
330
|
-
offset:
|
|
331
|
-
color: this.processAdjColor(
|
|
327
|
+
l.hasAttribute("path") && (o.gradientType = U(l.getAttribute("path")));
|
|
328
|
+
const t = e.evaluate("fillToRect", l);
|
|
329
|
+
t && (o.focus = this.getRect(t));
|
|
330
|
+
}
|
|
331
|
+
const c = e.evaluate("tileRect", s);
|
|
332
|
+
c && (o.tile || (o.tile = {}), o.tile.bounds = this.getRect(c));
|
|
333
|
+
const u = [], h = e.evaluate("gsLst/gs", s), p = h ? h.length : 0;
|
|
334
|
+
for (let t = 0; t < p; t++) {
|
|
335
|
+
const s = h.item(t), r = {
|
|
336
|
+
offset: i(s.getAttribute("pos") ?? ""),
|
|
337
|
+
color: this.processAdjColor(e, s)
|
|
332
338
|
};
|
|
333
|
-
u.push(
|
|
339
|
+
u.push(r);
|
|
334
340
|
}
|
|
335
|
-
return u.length > 0 && (
|
|
341
|
+
return u.length > 0 && (o.stops = u), o;
|
|
336
342
|
}
|
|
337
343
|
getRect(t) {
|
|
338
344
|
const e = {};
|
|
339
|
-
return t.hasAttribute("t") && (e.t =
|
|
345
|
+
return t.hasAttribute("t") && (e.t = i(t.getAttribute("t"))), t.hasAttribute("l") && (e.l = i(t.getAttribute("l"))), t.hasAttribute("b") && (e.b = i(t.getAttribute("b"))), t.hasAttribute("r") && (e.r = i(t.getAttribute("r"))), 0 === Object.keys(e).length ? null : e;
|
|
340
346
|
}
|
|
341
|
-
processImageFill(
|
|
342
|
-
const
|
|
343
|
-
return
|
|
347
|
+
processImageFill(e, s) {
|
|
348
|
+
const r = { type: y.Type.Image };
|
|
349
|
+
return s.hasAttribute("rotWithShape") && (r.isRotatedWithShape = t(s.getAttribute("rotWithShape"))), s.hasAttribute("dpi") && (r.dpi = s.getAttribute("dpi")), r.ref = "https://www.sheetxl.com/logo-color-padded-white.jpg", r.tile = !1, r;
|
|
344
350
|
}
|
|
345
351
|
processPatternFill(t, e) {
|
|
346
|
-
const s = { type:
|
|
352
|
+
const s = { type: y.Type.Pattern };
|
|
347
353
|
s.patternType = e.getAttribute("prst");
|
|
348
354
|
const r = t.evaluate("bgClr", e);
|
|
349
355
|
if (r) {
|
|
@@ -372,11 +378,11 @@ var w = class {
|
|
|
372
378
|
}
|
|
373
379
|
const n = t.evaluate("scrgbClr", e);
|
|
374
380
|
if (n) return this.processScrgbClrElement(t, n);
|
|
375
|
-
const
|
|
376
|
-
return
|
|
381
|
+
const a = t.evaluate("srgbClr", e);
|
|
382
|
+
return a ? this.processSrgbClrElement(t, a) : null;
|
|
377
383
|
}
|
|
378
384
|
processScrgbClrElement(t, e) {
|
|
379
|
-
let s = "lrgba(" +
|
|
385
|
+
let s = "lrgba(" + i(e.getAttribute("r") ?? "") + "," + i(e.getAttribute("g") ?? "") + "," + i(e.getAttribute("b") ?? "") + ")";
|
|
380
386
|
return s += this.processAdjustments(t, e), s;
|
|
381
387
|
}
|
|
382
388
|
processSrgbClrElement(t, e) {
|
|
@@ -384,7 +390,7 @@ var w = class {
|
|
|
384
390
|
return s += this.processAdjustments(t, e), s;
|
|
385
391
|
}
|
|
386
392
|
processHslClr(t, e) {
|
|
387
|
-
let s = "hsl(" +
|
|
393
|
+
let s = "hsl(" + r(e.getAttribute("hue") ?? "") + "," + i(e.getAttribute("sat") ?? "") + "," + i(e.getAttribute("lum") ?? "") + ")";
|
|
388
394
|
return s += this.processAdjustments(t, e), s;
|
|
389
395
|
}
|
|
390
396
|
processClrWithValAttribute(t, e) {
|
|
@@ -409,43 +415,43 @@ var w = class {
|
|
|
409
415
|
const o = e.getAttribute("val");
|
|
410
416
|
return o ? ` ${s} ${!o || parseFloat(o) / r}` : ` ${s}`;
|
|
411
417
|
}
|
|
412
|
-
},
|
|
418
|
+
}, U = (t) => "circle" === t ? "radial" : t, X = (t) => {
|
|
413
419
|
if ("rnd" === t) return "round";
|
|
414
420
|
if ("flat" === t) return "butt";
|
|
415
421
|
if ("sq" === t) return "square";
|
|
416
422
|
throw new Error("Invalid lineCap type: " + t);
|
|
417
|
-
},
|
|
418
|
-
visit(e, s
|
|
423
|
+
}, W = class extends z {
|
|
424
|
+
visit(t, e, s) {
|
|
419
425
|
try {
|
|
420
|
-
const
|
|
421
|
-
if (
|
|
422
|
-
|
|
423
|
-
const
|
|
426
|
+
const r = t.evaluate("xfrm", e);
|
|
427
|
+
if (r) {
|
|
428
|
+
L(r, s);
|
|
429
|
+
const e = {
|
|
424
430
|
x: 0,
|
|
425
431
|
y: 0,
|
|
426
432
|
width: 0,
|
|
427
433
|
height: 0
|
|
428
|
-
},
|
|
429
|
-
|
|
430
|
-
const
|
|
431
|
-
|
|
434
|
+
}, o = t.evaluate("off", r);
|
|
435
|
+
o && (e.x = l(o.getAttribute("x")) ?? 0, e.y = l(o.getAttribute("y")) ?? 0);
|
|
436
|
+
const i = t.evaluate("ext", r);
|
|
437
|
+
o && (e.width = l(i.getAttribute("cx")) ?? 0, e.height = l(i.getAttribute("cy")) ?? 0), s.bounds = e;
|
|
432
438
|
}
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
const
|
|
438
|
-
return
|
|
439
|
-
} catch (
|
|
440
|
-
|
|
439
|
+
const o = t.evaluate("prstGeom", e);
|
|
440
|
+
o?.hasAttribute("prst") ? s.geometry = o?.getAttribute("prst") : t.evaluate("customGeom", e) && t.warn("Custom shape geometry is not supported; the shape keeps its bounds only.", { onceKey: "xlsx.shape.customGeometry" });
|
|
441
|
+
const i = this.getFill(t, e);
|
|
442
|
+
i && Object.keys(i).length > 0 && (s.fill = i);
|
|
443
|
+
const n = this.getStroke(t, e);
|
|
444
|
+
return n && Object.keys(n).length > 0 && (s.stroke = n), s;
|
|
445
|
+
} catch (e) {
|
|
446
|
+
t.warn(`Unable to read shape properties: ${e?.message ?? e}`, { onceKey: "xlsx.shape.unreadable" });
|
|
441
447
|
}
|
|
442
448
|
}
|
|
443
|
-
},
|
|
449
|
+
}, G = class {
|
|
444
450
|
visit(t, e, s) {
|
|
445
451
|
let r = {};
|
|
446
|
-
if (
|
|
452
|
+
if (_(t, e, r, "grouping", "grouping"), B(t, e, r, "varyColors", "varyColors"), R(t, e, r, "gapWidth", "gapWidth", .01), R(t, e, r, "overlap", "overlap", .01), this.parseType(t, e, r), E(t, e, r, "bubbleScale", "bubbleScale"), B(t, e, r, "showNegBubbles", "showNegativeBubbleValues"), B(t, e, r, "sizeRepresents", "bubbleSizeRepresentsWidth"), E(t, e, r, "firstSliceAng", "startAngle"), E(t, e, r, "holeSize", "holeSize"), _(t, e, r, "scatterStyle", "scatterStyle"), this.parseAxisIds(t, e, r), Object.keys(r).length > 0) {
|
|
447
453
|
let e = t.getVisitorParamsState().get("types");
|
|
448
|
-
e || (
|
|
454
|
+
e || (t.warn("A chart type was read outside a chart; its types were started fresh.", { onceKey: "xlsx.chart.typesState" }), e = [], t.getVisitorParamsState().set("types", e)), e.push(r);
|
|
449
455
|
}
|
|
450
456
|
return r;
|
|
451
457
|
}
|
|
@@ -472,7 +478,7 @@ var w = class {
|
|
|
472
478
|
const r = t.evaluate("axId", e);
|
|
473
479
|
r && 0 !== r.length && (s.xAxisId = r.item(0).getAttribute("val"), s.yAxisId = r.item(1).getAttribute("val"));
|
|
474
480
|
}
|
|
475
|
-
},
|
|
481
|
+
}, K = (t, e, s) => {
|
|
476
482
|
if (!0 === t.getValAttrAsBoolean("invertIfNegative", e)) if (t.evaluate("extLst/ext/invertSolidFillFmt", e)) {
|
|
477
483
|
if (s.fill && s.fillNegative) {
|
|
478
484
|
const e = t.getFromPath(s, "fill.solid.adjs");
|
|
@@ -486,7 +492,7 @@ var w = class {
|
|
|
486
492
|
const i = {};
|
|
487
493
|
i.fill = o, s.strokeNegative = i;
|
|
488
494
|
}
|
|
489
|
-
},
|
|
495
|
+
}, $ = class extends z {
|
|
490
496
|
constructor(t = "text") {
|
|
491
497
|
super(), this._jsonKey = t;
|
|
492
498
|
}
|
|
@@ -498,19 +504,19 @@ var w = class {
|
|
|
498
504
|
return r || (r = {}), this.parseTextElement(t, e, r, !1), Object.keys(r).length > 0 && t.setToPath(s, this.getTextPath(), r), s;
|
|
499
505
|
}
|
|
500
506
|
parseTextElement(t, e, s, r) {
|
|
501
|
-
const o = t.evaluate("p/pPr/defRPr", e) ?? t.evaluate("defRPr", e);
|
|
502
|
-
|
|
503
|
-
const
|
|
507
|
+
const o = t.evaluate("p/pPr/defRPr", e) ?? t.evaluate("defRPr", e), i = void 0 !== o?.length ? o.item(0) : o;
|
|
508
|
+
i && (this.parseTextProperties(t, i, s), new W().visit(t, i, s));
|
|
509
|
+
const n = s.runs ?? [], a = t.evaluate("p/r", e) ?? t.evaluate("r", e), l = (e) => {
|
|
504
510
|
const s = {};
|
|
505
511
|
let r = t.evaluate("t", e);
|
|
506
512
|
const o = t.evaluate("rPr", e);
|
|
507
|
-
o && this.parseTextProperties(t, o, s), r && r.firstChild ? s.text = r.firstChild.textContent ?? "" : e.textContent && (s.text = e.textContent ?? ""), Object.keys(s).length > 0 &&
|
|
513
|
+
o && this.parseTextProperties(t, o, s), r && r.firstChild ? s.text = r.firstChild.textContent ?? "" : e.textContent && (s.text = e.textContent ?? ""), Object.keys(s).length > 0 && n.push(s);
|
|
508
514
|
};
|
|
509
|
-
if (void 0 !==
|
|
510
|
-
else l(
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
|
|
515
|
+
if (void 0 !== a?.length) for (let t = 0; a && t < a.length; t++) l(a.item(t));
|
|
516
|
+
else l(a || e);
|
|
517
|
+
n.length > 0 && (s.runs = n);
|
|
518
|
+
const c = t.evaluate("bodyPr", e);
|
|
519
|
+
c && L(c, s);
|
|
514
520
|
}
|
|
515
521
|
parseTextProperties(t, e, s) {
|
|
516
522
|
if (!e) return;
|
|
@@ -522,17 +528,17 @@ var w = class {
|
|
|
522
528
|
const t = s.font ?? {};
|
|
523
529
|
if (o.hasAttribute("typeface") && (t.family = o.getAttribute("typeface")), o.hasAttribute("panose")) {
|
|
524
530
|
const e = o.getAttribute("panose");
|
|
525
|
-
e && (t.fallbacks = [
|
|
531
|
+
e && (t.fallbacks = [v.getPanoseFallback(e)]);
|
|
526
532
|
}
|
|
527
533
|
o.hasAttribute("pitchFamily") && (t.pitch = o.getAttribute("pitchFamily")), o.hasAttribute("charset") && (t.charset = o.getAttribute("charset")), Object.keys(t).length > 0 && (s.font = t);
|
|
528
534
|
}
|
|
529
535
|
}
|
|
530
|
-
},
|
|
536
|
+
}, H = class {
|
|
531
537
|
visit(t, e, s) {}
|
|
532
|
-
processDataBarColor(t, s, r, o
|
|
533
|
-
if (!
|
|
534
|
-
const
|
|
535
|
-
return
|
|
538
|
+
processDataBarColor(t, e, s, r, o = "auto") {
|
|
539
|
+
if (!e) return;
|
|
540
|
+
const i = n((t) => e.getAttribute(t), o);
|
|
541
|
+
return i && (s[r] = i), s;
|
|
536
542
|
}
|
|
537
543
|
processFonts(t, e, s) {
|
|
538
544
|
if (!e) return;
|
|
@@ -549,11 +555,11 @@ var w = class {
|
|
|
549
555
|
return s;
|
|
550
556
|
}
|
|
551
557
|
processFont(t, e, s) {
|
|
552
|
-
t.getValAttrAsBoolean("b", e, !0) && (s.weight = 700), t.getValAttrAsBoolean("i", e, !0) && (s.style =
|
|
558
|
+
t.getValAttrAsBoolean("b", e, !0) && (s.weight = 700), t.getValAttrAsBoolean("i", e, !0) && (s.style = v.Style.Italic), t.getValAttrAsBoolean("strike", e, !0) && (s.strike = !0);
|
|
553
559
|
const r = t.evaluate("u", e);
|
|
554
|
-
r && (s.underline = r.getAttribute("val") ||
|
|
560
|
+
r && (s.underline = r.getAttribute("val") || v.UnderlineStyle.Single), _(t, e, s, "vertAlign", "verticalAlign"), "superscript" === s.verticalAlign ? s.verticalAlign = v.VerticalAlignment.Super : "subscript" === s.verticalAlign && (s.verticalAlign = v.VerticalAlignment.Sub), R(t, e, s, "sz", "size");
|
|
555
561
|
const o = t.evaluate("color", e);
|
|
556
|
-
this.processDataBarColor(t, o, s, "color"), s.color || (s.color = "auto"),
|
|
562
|
+
this.processDataBarColor(t, o, s, "color"), s.color || (s.color = "auto"), _(t, e, s, "name", "family"), _(t, e, s, "rFont", "family");
|
|
557
563
|
const i = t.evaluate("family", e);
|
|
558
564
|
if (i) {
|
|
559
565
|
const t = i.getAttribute("val");
|
|
@@ -573,7 +579,7 @@ var w = class {
|
|
|
573
579
|
case "5": s.fallbacks = ["fantasy"];
|
|
574
580
|
}
|
|
575
581
|
}
|
|
576
|
-
return
|
|
582
|
+
return _(t, e, s, "scheme", "scheme"), void 0 !== s.family && void 0 === s.scheme && (s.scheme = v.Scheme.None), B(t, e, s, "shadow", "shadow", !0), B(t, e, s, "outline", "outline", !0), t.getValAttrAsBoolean("condense", e, !0) && (s.letterSpacing = -1), t.getValAttrAsBoolean("extend", e, !0) && (s.letterSpacing = 1), E(t, e, s, "charset", "charset"), s;
|
|
577
583
|
}
|
|
578
584
|
processFills(t, e, s) {
|
|
579
585
|
if (!e) return;
|
|
@@ -587,10 +593,10 @@ var w = class {
|
|
|
587
593
|
return s;
|
|
588
594
|
}
|
|
589
595
|
processFill(t, e, s, r) {
|
|
590
|
-
const o = { type:
|
|
596
|
+
const o = { type: y.Type.None }, i = e.childNodes;
|
|
591
597
|
let n = !1;
|
|
592
|
-
const
|
|
593
|
-
for (let e = 0; !n && e <
|
|
598
|
+
const a = i.length;
|
|
599
|
+
for (let e = 0; !n && e < a; e++) {
|
|
594
600
|
const s = i.item(e);
|
|
595
601
|
1 === s.nodeType && ("gradientFill" === s.localName ? (this.processGradientFill(t, s, o), n = !0) : "patternFill" === s.localName && (this.processPatternFill(t, s, o), n = !0));
|
|
596
602
|
}
|
|
@@ -598,20 +604,20 @@ var w = class {
|
|
|
598
604
|
}
|
|
599
605
|
processGradientFill(t, e, s) {
|
|
600
606
|
if (!e) return;
|
|
601
|
-
s.type =
|
|
607
|
+
s.type = y.Type.Gradient;
|
|
602
608
|
const r = [];
|
|
603
609
|
s.stops = r;
|
|
604
610
|
const o = e.getAttribute("type");
|
|
605
611
|
o && (s.gradientType = o);
|
|
606
612
|
const i = e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0;
|
|
607
613
|
(i + 90) % 360 != 0 && (s.angle = (i + 90) % 360), (e.hasAttribute("left") || e.hasAttribute("top") || e.hasAttribute("right") || e.hasAttribute("bottom")) && (s.focus = {
|
|
608
|
-
left:
|
|
609
|
-
top:
|
|
610
|
-
right:
|
|
611
|
-
bottom:
|
|
614
|
+
left: q(e.getAttribute("left")),
|
|
615
|
+
top: q(e.getAttribute("top")),
|
|
616
|
+
right: q(e.getAttribute("right")),
|
|
617
|
+
bottom: q(e.getAttribute("bottom"))
|
|
612
618
|
});
|
|
613
|
-
const n = e.childNodes,
|
|
614
|
-
for (let e = 0; e <
|
|
619
|
+
const n = e.childNodes, a = n.length;
|
|
620
|
+
for (let e = 0; e < a; e++) {
|
|
615
621
|
const s = n.item(e);
|
|
616
622
|
if (1 === s.nodeType && "stop" === s.localName) {
|
|
617
623
|
const e = {};
|
|
@@ -624,20 +630,20 @@ var w = class {
|
|
|
624
630
|
}
|
|
625
631
|
processPatternFill(t, e, s) {
|
|
626
632
|
if (!e) return;
|
|
627
|
-
const r = t.getVisitorParamsState().get("processingDXFs"), o = e.getAttribute("patternType") || (r ?
|
|
628
|
-
if (o ===
|
|
629
|
-
s.type =
|
|
633
|
+
const r = t.getVisitorParamsState().get("processingDXFs"), o = e.getAttribute("patternType") || (r ? y.BuiltInSheetPattern.Solid : y.BuiltInSheetPattern.None);
|
|
634
|
+
if (o === y.BuiltInSheetPattern.None) return { none: !0 };
|
|
635
|
+
s.type = y.Type.Pattern, o && (s.patternType = o);
|
|
630
636
|
let i = "foreground", n = "background";
|
|
631
|
-
const
|
|
632
|
-
let
|
|
633
|
-
if (
|
|
637
|
+
const a = s.patternType === y.BuiltInSheetPattern.Solid && r;
|
|
638
|
+
let l = a ? "dk1" : "lt1", c = a ? "lt1" : "dk1";
|
|
639
|
+
if (a) {
|
|
634
640
|
const t = i;
|
|
635
641
|
i = n, n = t;
|
|
636
642
|
}
|
|
637
643
|
const u = t.evaluate("fgColor", e);
|
|
638
|
-
this.processDataBarColor(t, u, s, i,
|
|
644
|
+
this.processDataBarColor(t, u, s, i, l);
|
|
639
645
|
const h = t.evaluate("bgColor", e);
|
|
640
|
-
return this.processDataBarColor(t, h, s, n, c),
|
|
646
|
+
return this.processDataBarColor(t, h, s, n, c), a && (s.foreground || (s.foreground = "lt1"), s.background || (s.background = "dk1")), s;
|
|
641
647
|
}
|
|
642
648
|
processBorders(t, e, s, r) {
|
|
643
649
|
if (!e) return;
|
|
@@ -653,35 +659,38 @@ var w = class {
|
|
|
653
659
|
processBorder(t, e, s, r, o) {
|
|
654
660
|
if (!e) return;
|
|
655
661
|
const i = {};
|
|
656
|
-
return this.processBorderStroke(t, e, i,
|
|
662
|
+
return this.processBorderStroke(t, e, i, b.Edge.Left), this.processBorderStroke(t, e, i, b.Edge.Right), o ? (i.right || i.left) && (i.right ? i.vertical = { ...i.right } : i.vertical = { ...i.left }) : this.processBorderStroke(t, e, i, b.Edge.Vertical), this.processBorderStroke(t, e, i, b.Edge.Top), this.processBorderStroke(t, e, i, b.Edge.Bottom), o ? (i.bottom || i.top) && (i.bottom ? i.horizontal = { ...i.bottom } : i.horizontal = { ...i.top }) : this.processBorderStroke(t, e, i, b.Edge.Horizontal), s[r] = i, s;
|
|
657
663
|
}
|
|
658
664
|
processBorderStroke(t, e, s, r) {
|
|
659
665
|
if (!e) return;
|
|
660
666
|
const o = t.evaluate(r, e);
|
|
661
667
|
if (!o) return;
|
|
662
668
|
const i = {};
|
|
663
|
-
o.hasAttribute("style") ? i.style = o.getAttribute("style") : t.getVisitorParamsState().get("processingDXFs") && (i.style =
|
|
669
|
+
o.hasAttribute("style") ? i.style = o.getAttribute("style") : t.getVisitorParamsState().get("processingDXFs") && (i.style = b.StrokeStyle.None);
|
|
664
670
|
const n = t.evaluate("color", o);
|
|
665
671
|
return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? s[r] = i : null;
|
|
666
672
|
}
|
|
667
|
-
},
|
|
673
|
+
}, q = (t) => {
|
|
668
674
|
if (!t) return 0;
|
|
669
675
|
const e = parseFloat(t);
|
|
670
676
|
return isNaN(e) ? 0 : e;
|
|
671
|
-
},
|
|
677
|
+
}, J = {
|
|
672
678
|
auto: "auto",
|
|
673
679
|
autoNoTable: "automaticExceptTables",
|
|
674
680
|
manual: "manual"
|
|
675
|
-
},
|
|
681
|
+
}, Q = class {
|
|
676
682
|
visit(t, e, s) {
|
|
677
683
|
if (!e) return;
|
|
678
684
|
let r = t.evaluate("*/cNvPr", e);
|
|
679
685
|
return r.item && (r = r.item(0)), r && (t.copyFromAttribute(r, "name", s), t.copyFromAttribute(r, "descr", s, "description"), t.copyFromAttribute(r, "hidden", s, "hidden", t.BOOLEAN_COPY), t.copyFromAttribute(r, "id", s)), s;
|
|
680
686
|
}
|
|
681
|
-
},
|
|
687
|
+
}, Z = class extends Q {
|
|
682
688
|
visit(t, e, s) {
|
|
683
689
|
if (!e) return;
|
|
684
|
-
if (t.getPath().includes("Fallback") && s.content)
|
|
690
|
+
if (t.getPath().includes("Fallback") && s.content) {
|
|
691
|
+
const r = s.content.json;
|
|
692
|
+
return "sp" === s.content.type && r?.xml && void 0 === r.fallbackXml && (r.fallbackXml = t.serializeElement(e) ?? void 0), s;
|
|
693
|
+
}
|
|
685
694
|
s = super.visit(t, e, s);
|
|
686
695
|
const r = t.evaluate("nvSpPr/cNvSpPr", e);
|
|
687
696
|
if (r) {
|
|
@@ -692,20 +701,49 @@ var w = class {
|
|
|
692
701
|
Object.keys(t).length > 0 && (s.locks = t);
|
|
693
702
|
}
|
|
694
703
|
}
|
|
695
|
-
t.warn(`'${s.name}' is not editable; imported as a fixed drawing.`);
|
|
696
704
|
let o = t.evaluate("*/cNvPr", e);
|
|
697
705
|
o?.item && (o = o.item(0));
|
|
698
|
-
const i = o?.getAttribute?.("id"), n = i ? parseInt(i, 10) : void 0,
|
|
706
|
+
const i = o?.getAttribute?.("id"), n = i ? parseInt(i, 10) : void 0, a = {
|
|
699
707
|
type: "sp",
|
|
700
708
|
xml: t.serializeElement(e) ?? void 0,
|
|
701
709
|
sourceId: void 0 === n || isNaN(n) ? void 0 : n
|
|
702
710
|
};
|
|
703
711
|
return s.content = {
|
|
704
712
|
type: "sp",
|
|
705
|
-
json:
|
|
706
|
-
},
|
|
713
|
+
json: a
|
|
714
|
+
}, a;
|
|
715
|
+
}
|
|
716
|
+
}, tt = "richTypes", et = "richData";
|
|
717
|
+
function st(t, e) {
|
|
718
|
+
const s = t.childNodes;
|
|
719
|
+
for (let t = 0; t < s.length; t++) {
|
|
720
|
+
const r = s.item(t);
|
|
721
|
+
if (1 === r.nodeType) switch (r.localName) {
|
|
722
|
+
case "b":
|
|
723
|
+
e.bold = "0" !== r.getAttribute("val") && "false" !== r.getAttribute("val");
|
|
724
|
+
break;
|
|
725
|
+
case "i":
|
|
726
|
+
e.italic = "0" !== r.getAttribute("val") && "false" !== r.getAttribute("val");
|
|
727
|
+
break;
|
|
728
|
+
case "sz": {
|
|
729
|
+
const t = parseFloat(r.getAttribute("val") ?? "");
|
|
730
|
+
isNaN(t) || (e.size = t);
|
|
731
|
+
break;
|
|
732
|
+
}
|
|
733
|
+
case "rFont": {
|
|
734
|
+
const t = r.getAttribute("val");
|
|
735
|
+
t && (e.font = t);
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
case "color": {
|
|
739
|
+
const t = r.getAttribute("rgb");
|
|
740
|
+
t && (e.color = "#" + (8 === t.length ? t.substring(2) : t));
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
707
744
|
}
|
|
708
|
-
}
|
|
745
|
+
}
|
|
746
|
+
var rt = class {
|
|
709
747
|
visit(t, e, s) {
|
|
710
748
|
if (!e) return;
|
|
711
749
|
const r = e.childNodes, o = r.length;
|
|
@@ -720,7 +758,7 @@ var w = class {
|
|
|
720
758
|
t.copyFromAttribute(e, "Target", r, "target"), t.copyFromAttribute(e, "Type", r, "type"), t.copyFromAttribute(e, "TargetMode", r, "targetMode");
|
|
721
759
|
s[e.getAttribute("Id")] = r;
|
|
722
760
|
}
|
|
723
|
-
},
|
|
761
|
+
}, ot = class {
|
|
724
762
|
visit(t, e, s) {
|
|
725
763
|
const r = [], o = e.childNodes, i = o.length;
|
|
726
764
|
for (let e = 0; e < i; e++) {
|
|
@@ -737,7 +775,7 @@ var w = class {
|
|
|
737
775
|
value: e.textContent || ""
|
|
738
776
|
};
|
|
739
777
|
}
|
|
740
|
-
},
|
|
778
|
+
}, it = class {
|
|
741
779
|
visit(t, e, s) {
|
|
742
780
|
const r = [], o = e.childNodes, i = o.length;
|
|
743
781
|
for (let e = 0; e < i; e++) {
|
|
@@ -754,24 +792,24 @@ var w = class {
|
|
|
754
792
|
value: e.textContent || ""
|
|
755
793
|
};
|
|
756
794
|
}
|
|
757
|
-
},
|
|
795
|
+
}, nt = class {
|
|
758
796
|
visit(t, e, s) {
|
|
759
|
-
return
|
|
797
|
+
return B(t, e, s, "roundedCorners", "roundedCorners"), E(t, e, s, ".//AlternateContent/Fallback/style", "styleId"), t.getVisitorParamsState().set("types", []), t.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()), s.range = null, s;
|
|
760
798
|
}
|
|
761
799
|
afterVisit(t, e, s) {
|
|
762
800
|
let r = {};
|
|
763
801
|
s.types = r;
|
|
764
|
-
let o = {}, i = 0, n = {},
|
|
802
|
+
let o = {}, i = 0, n = {}, a = 0, l = t.getVisitorParamsState().get("axes");
|
|
765
803
|
const c = t.getVisitorParamsState().get("types"), u = c.length;
|
|
766
804
|
for (let t = 0; t < u; t++) {
|
|
767
805
|
const e = c[t];
|
|
768
806
|
if (e.xAxisId) {
|
|
769
|
-
const r = e.xAxisId, n =
|
|
807
|
+
const r = e.xAxisId, n = l.get(r);
|
|
770
808
|
o[t + ""] = n, e.offsetXAxis = t, delete e.xAxisId, s.xAxes = o, o.length = ++i;
|
|
771
809
|
}
|
|
772
810
|
if (e.yAxisId) {
|
|
773
|
-
const r = e.yAxisId, o =
|
|
774
|
-
n[t + ""] = o, e.offsetYAxis = t, delete e.yAxisId, s.yAxes = n, n.length = ++
|
|
811
|
+
const r = e.yAxisId, o = l.get(r);
|
|
812
|
+
n[t + ""] = o, e.offsetYAxis = t, delete e.yAxisId, s.yAxes = n, n.length = ++a;
|
|
775
813
|
}
|
|
776
814
|
r[t + ""] = e;
|
|
777
815
|
}
|
|
@@ -784,17 +822,17 @@ var w = class {
|
|
|
784
822
|
for (let t = 0; t < d; t++) p[t + ""] = h[t];
|
|
785
823
|
p.length = d, t.getVisitorParamsState().delete("types"), t.getVisitorParamsState().delete("axes"), t.getVisitorParamsState().delete("series");
|
|
786
824
|
}
|
|
787
|
-
},
|
|
825
|
+
}, at = class {
|
|
788
826
|
visit(t, e, s) {
|
|
789
827
|
let r = {};
|
|
790
828
|
return s.plotArea = r, r;
|
|
791
829
|
}
|
|
792
|
-
},
|
|
830
|
+
}, lt = W, ct = class extends G {
|
|
793
831
|
parseType(t, e, s) {
|
|
794
832
|
const r = t.getValAttrAsString("barDir", e);
|
|
795
833
|
r && (s.type = "col" === r ? "column" : "bar");
|
|
796
834
|
}
|
|
797
|
-
},
|
|
835
|
+
}, ut = G, ht = class {
|
|
798
836
|
constructor(t) {
|
|
799
837
|
this.jsonKey = t;
|
|
800
838
|
}
|
|
@@ -802,28 +840,28 @@ var w = class {
|
|
|
802
840
|
let r = {}, o = r, i = t.getValAttrAsString("idx", e);
|
|
803
841
|
null !== i && (o = {}, o[i] = r);
|
|
804
842
|
const n = t.getValAttrAsBoolean("delete", e);
|
|
805
|
-
this.parseNumFormat(t, e, r), !0 === n ? (r.showBubbleSize = !1, r.showCatName = !1, r.showLeaderLines = !1, r.showPercentage = !1, r.showSerName = !1, r.showVal = !1, r.showLegendKey = !1) : (
|
|
806
|
-
const
|
|
807
|
-
return null !==
|
|
843
|
+
this.parseNumFormat(t, e, r), !0 === n ? (r.showBubbleSize = !1, r.showCatName = !1, r.showLeaderLines = !1, r.showPercentage = !1, r.showSerName = !1, r.showVal = !1, r.showLegendKey = !1) : (B(t, e, r, "showBubbleSize", "showBubbleSize"), B(t, e, r, "showCatName", "showCatName"), B(t, e, r, "showLeaderLines", "showLeaderLines"), B(t, e, r, "showPercent", "showPercentage"), B(t, e, r, "showSerName", "showSerName"), B(t, e, r, "showVal", "showVal"), B(t, e, r, "showLegendKey", "showLegendKey"));
|
|
844
|
+
const a = t.evaluate("separator", e);
|
|
845
|
+
return null !== a && (r.separator = a.textContent), _(t, e, r, "dLblPos", "position"), s[this.jsonKey] = o, r;
|
|
808
846
|
}
|
|
809
847
|
parseNumFormat(t, e, s) {
|
|
810
848
|
const r = t.evaluate("numFmt", e);
|
|
811
849
|
r && (s.formatCode = r.getAttribute("formatCode"), r.hasAttribute("sourceLinked") && (s.sourceLinked = "1" === r.getAttribute("sourceLinked")));
|
|
812
850
|
}
|
|
813
|
-
},
|
|
851
|
+
}, pt = class {
|
|
814
852
|
visit(t, e, s) {
|
|
815
853
|
const r = {};
|
|
816
|
-
|
|
854
|
+
E(t, e, r, "explosion", "explosion");
|
|
817
855
|
let o = t.evaluate("cat/*/f", e);
|
|
818
856
|
o || (o = t.evaluate("xVal/*/f", e));
|
|
819
857
|
let i = null;
|
|
820
858
|
null !== o && null !== o.firstChild && (i = o.firstChild.nodeValue), o || (o = t.evaluate("cat/strLit", e), o || (o = t.evaluate("cat/numLit", e)), o && (i = this.parsePointsAsString(t, o))), null !== i && (r.xRange = i);
|
|
821
859
|
let n = t.evaluate("val/*/f", e);
|
|
822
860
|
n || (n = t.evaluate("yVal/*/f", e));
|
|
823
|
-
let
|
|
824
|
-
n && n.firstChild && (
|
|
825
|
-
let
|
|
826
|
-
return
|
|
861
|
+
let a = null;
|
|
862
|
+
n && n.firstChild && (a = n.firstChild.nodeValue), n || (n = t.evaluate("val/numLit", e), null !== n && (a = this.parsePointsAsString(t, n))), null !== a && (r.valRange = a), this.parseTitleRangeOrValue(t, e, r), E(t, e, r, "idx", "idx"), B(t, e, r, "smooth", "smooth"), r.offsetChart = t.getVisitorParamsState().get("types").length - 1;
|
|
863
|
+
let l = t.getVisitorParamsState().get("series");
|
|
864
|
+
return l || (l = [], t.getVisitorParamsState().set("series", l)), l.push(r), r;
|
|
827
865
|
}
|
|
828
866
|
parseTitleRangeOrValue(t, e, s) {
|
|
829
867
|
const r = t.evaluate("tx/strRef/f", e);
|
|
@@ -847,27 +885,27 @@ var w = class {
|
|
|
847
885
|
return s += "}", s;
|
|
848
886
|
}
|
|
849
887
|
afterVisit(t, e, s) {
|
|
850
|
-
|
|
888
|
+
K(t, e, s);
|
|
851
889
|
let r = t.getFromPath(s, "points");
|
|
852
890
|
if (r) {
|
|
853
891
|
const e = Object.keys(r);
|
|
854
892
|
for (let o = 0; o < e.length; o++) {
|
|
855
893
|
const i = e[o], n = t.getFromPath(r, i);
|
|
856
894
|
if (!n) continue;
|
|
857
|
-
let
|
|
858
|
-
|
|
895
|
+
let a = t.getFromPath(n, "markers");
|
|
896
|
+
a && (t.setToPath(s, "markers.points." + i, a), delete n.markers);
|
|
859
897
|
}
|
|
860
898
|
}
|
|
861
899
|
}
|
|
862
|
-
},
|
|
900
|
+
}, dt = class {
|
|
863
901
|
DataPointVisitor() {}
|
|
864
902
|
visit(t, e, s) {
|
|
865
903
|
let r = t.getFromPath(s, "points"), o = null;
|
|
866
904
|
r ? o = r : (o = {}, t.setToPath(s, "points", o));
|
|
867
905
|
let i = {}, n = t.getValAttrAsString("idx", e);
|
|
868
|
-
return null !== n && (o[n] = i),
|
|
906
|
+
return null !== n && (o[n] = i), B(t, e, i, "bubble3D", "bubble3D"), E(t, e, i, "explosion", "explosion"), K(t, e, i), i;
|
|
869
907
|
}
|
|
870
|
-
},
|
|
908
|
+
}, gt = class {
|
|
871
909
|
visit(t, e, s) {
|
|
872
910
|
const r = e.parentNode.localName;
|
|
873
911
|
if ("ser" === r || "dPt" === r) {
|
|
@@ -878,19 +916,19 @@ var w = class {
|
|
|
878
916
|
}
|
|
879
917
|
return null;
|
|
880
918
|
}
|
|
881
|
-
},
|
|
919
|
+
}, mt = class {
|
|
882
920
|
visit(t, e, s) {
|
|
883
921
|
let r = {};
|
|
884
|
-
this.parseScaling(t, e, r),
|
|
922
|
+
this.parseScaling(t, e, r), R(t, e, r, "majorUnit", "majorUnits"), R(t, e, r, "minorUnit", "minorUnits"), B(t, e, r, "delete", "shown"), this.parseOrientation(t, e, r), this.parseNumFormat(t, e, r), _(t, e, r, "majorTickMark", "majorTickMarks"), _(t, e, r, "minorTickMark", "minorTickMarks"), _(t, e, r, "crosses", "crosses"), R(t, e, r, "crossesAt", "crosses"), _(t, e, r, "crossBetween", "crossBetween"), this.parseLabelAlign(t, e, r), E(t, e, r, "lblOffset", "labelOffset"), _(t, e, r, "tickLblPos", "labelPosition");
|
|
885
923
|
const o = t.getValAttrAsInteger("noMultiLvlLbl", e);
|
|
886
|
-
r.labelMultiLevel = null !== o && 0 === o,
|
|
924
|
+
r.labelMultiLevel = null !== o && 0 === o, E(t, e, r, "tickMarkSkip", "tickMarkSkip"), E(t, e, r, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(e, t, r), this.parseTimeUnits(t, e, r, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(t, e, r, "minorUnitDates", "minorTimeUnit", "minorUnit"), _(t, e, r, "baseTimeUnit", "baseUnitDates"), t.getVisitorParamsState().get("axes") || (t.warn("An axis was read outside a chart; its axes were started fresh.", { onceKey: "xlsx.chart.axesState" }), t.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()));
|
|
887
925
|
const i = t.getValAttrAsString("axId", e);
|
|
888
926
|
return t.getVisitorParamsState().get("axes").set(i, r), r;
|
|
889
927
|
}
|
|
890
928
|
parseTimeUnits(t, e, s, r, o, i) {
|
|
891
929
|
const n = {};
|
|
892
|
-
let
|
|
893
|
-
null !==
|
|
930
|
+
let a = t.getValAttrAsString(o, e);
|
|
931
|
+
null !== a && (n.dem = a, n.amt = t.getValAttrAsString(i, e)), Object.keys(n).length > 0 && (s[r] = n);
|
|
894
932
|
}
|
|
895
933
|
parseDisplayCustOrBuiltInUnit(t, e, s) {
|
|
896
934
|
let r = e.getValAttrAsString("dispUnits/builtInUnit", t);
|
|
@@ -912,7 +950,7 @@ var w = class {
|
|
|
912
950
|
const r = t.getValAttrAsString("scaling/orientation", e);
|
|
913
951
|
null !== r && (s.inverted = "minMax" !== r);
|
|
914
952
|
const o = t.getValAttrAsFloat("scaling/logBase", e);
|
|
915
|
-
null !== o && (s.logBase = o, s.scaleType = "log"),
|
|
953
|
+
null !== o && (s.logBase = o, s.scaleType = "log"), R(t, e, s, "scaling/max", "max"), R(t, e, s, "scaling/min", "min");
|
|
916
954
|
}
|
|
917
955
|
afterVisit(t, e, s) {
|
|
918
956
|
s.fill && s.labels && (s.labels.fill = s.fill, delete s.fill);
|
|
@@ -924,10 +962,10 @@ var w = class {
|
|
|
924
962
|
t.setToPath(s, "title.shown", null !== i);
|
|
925
963
|
const n = t.evaluate("minorGridlines", e);
|
|
926
964
|
t.setToPath(s, "gridLinesMinor.shown", null !== n);
|
|
927
|
-
const
|
|
928
|
-
t.setToPath(s, "gridLinesMajor.shown", null !==
|
|
965
|
+
const a = t.evaluate("majorGridlines", e);
|
|
966
|
+
t.setToPath(s, "gridLinesMajor.shown", null !== a);
|
|
929
967
|
}
|
|
930
|
-
},
|
|
968
|
+
}, bt = $, ft = class {
|
|
931
969
|
visit(t, e, s) {
|
|
932
970
|
const r = t.getVisitorParamsState().get("series");
|
|
933
971
|
let o = t.getValAttrAsInteger("idx", e), i = null !== o ? r[o] : void 0;
|
|
@@ -939,19 +977,19 @@ var w = class {
|
|
|
939
977
|
}
|
|
940
978
|
return s;
|
|
941
979
|
}
|
|
942
|
-
},
|
|
980
|
+
}, At = class {
|
|
943
981
|
visit(t, e, s) {
|
|
944
982
|
const r = {};
|
|
945
|
-
return
|
|
983
|
+
return B(t, e, r, "overlay", "overlay"), _(t, e, r, "legendPos", "position"), s.legend = r, r;
|
|
946
984
|
}
|
|
947
|
-
},
|
|
985
|
+
}, yt = class extends W {
|
|
948
986
|
visit(t, e, s) {
|
|
949
987
|
const r = this.getFill(t, e);
|
|
950
988
|
Object.keys(r).length > 0 && (s.fillNegative = r);
|
|
951
989
|
const o = this.getStroke(t, e);
|
|
952
990
|
return Object.keys(o).length > 0 && (s.strokeNegative = o), s;
|
|
953
991
|
}
|
|
954
|
-
},
|
|
992
|
+
}, vt = class extends $ {
|
|
955
993
|
constructor(t = "title") {
|
|
956
994
|
super(t);
|
|
957
995
|
}
|
|
@@ -964,7 +1002,7 @@ var w = class {
|
|
|
964
1002
|
}
|
|
965
1003
|
visit(t, e, s) {
|
|
966
1004
|
const r = {};
|
|
967
|
-
|
|
1005
|
+
B(t, e, r, "overlay", "overlay"), s[this._jsonKey] = r;
|
|
968
1006
|
let o = t.getFromPath(r, this.getTextPath());
|
|
969
1007
|
o || (o = {}), this.parseTitleRangeOrValue(t, e, r);
|
|
970
1008
|
const i = t.evaluate("txPr", e);
|
|
@@ -978,20 +1016,20 @@ var w = class {
|
|
|
978
1016
|
null !== t && (s.rotation = parseInt(t), delete s.title.rotation);
|
|
979
1017
|
}
|
|
980
1018
|
}
|
|
981
|
-
},
|
|
1019
|
+
}, Nt = class {
|
|
982
1020
|
visit(t, e, s) {
|
|
983
1021
|
const r = t.evaluate("manualLayout", e);
|
|
984
1022
|
if (r) {
|
|
985
1023
|
let e = {};
|
|
986
|
-
|
|
1024
|
+
R(t, r, e, "x", "x"), R(t, r, e, "y", "y"), R(t, r, e, "w", "w"), R(t, r, e, "h", "h"), _(t, r, e, "xMode", "xMode"), _(t, r, e, "yMode", "yMode"), _(t, r, e, "wMode", "wMode"), _(t, r, e, "hMode", "hMode"), Object.keys(e).length > 0 && (s.manualLayout = e);
|
|
987
1025
|
}
|
|
988
1026
|
return s;
|
|
989
1027
|
}
|
|
990
|
-
},
|
|
1028
|
+
}, Ft = class {
|
|
991
1029
|
visit(t, e, s) {
|
|
992
1030
|
return s.name = e.getAttribute("name"), s;
|
|
993
1031
|
}
|
|
994
|
-
},
|
|
1032
|
+
}, Ct = class extends z {
|
|
995
1033
|
visit(t, e, s) {
|
|
996
1034
|
const r = {};
|
|
997
1035
|
r.name = e.getAttribute("name");
|
|
@@ -1006,14 +1044,14 @@ var w = class {
|
|
|
1006
1044
|
}
|
|
1007
1045
|
return Object.keys(r).length > 0 && (s.colors = r), r;
|
|
1008
1046
|
}
|
|
1009
|
-
},
|
|
1047
|
+
}, wt = class {
|
|
1010
1048
|
visit(t, e, s) {
|
|
1011
1049
|
const r = {};
|
|
1012
1050
|
r.name = e.getAttribute("name");
|
|
1013
1051
|
const o = t.evaluate("majorFont", e), i = this.processFontElement(t, o, {});
|
|
1014
1052
|
i && (r.majorFont = i.family, i.fallbacks && (r.majorFallbacks = i.fallbacks));
|
|
1015
|
-
const n = t.evaluate("minorFont", e),
|
|
1016
|
-
return
|
|
1053
|
+
const n = t.evaluate("minorFont", e), a = this.processFontElement(t, n, {});
|
|
1054
|
+
return a && (r.minorFont = a.family, a.fallbacks && (r.minorFallbacks = a.fallbacks)), s.fonts = r, r;
|
|
1017
1055
|
}
|
|
1018
1056
|
processFontElement(t, e, s) {
|
|
1019
1057
|
if (!e) return;
|
|
@@ -1022,14 +1060,14 @@ var w = class {
|
|
|
1022
1060
|
const o = r.getAttribute("typeface");
|
|
1023
1061
|
o && (s.family = o);
|
|
1024
1062
|
const i = r.getAttribute("panose");
|
|
1025
|
-
return i && (s.fallbacks = [
|
|
1063
|
+
return i && (s.fallbacks = [v.getPanoseFallback(i)]), s;
|
|
1026
1064
|
}
|
|
1027
|
-
},
|
|
1065
|
+
}, Pt = class extends z {
|
|
1028
1066
|
visit(t, e, s) {
|
|
1029
1067
|
const r = this.parseFillList(t, e, "fillStyleLst"), o = this.parseLnList(t, e, "lnStyleLst"), i = this.parseEffectStyleList(t, e, "effectStyleLst"), n = this.parseFillList(t, e, "bgFillStyleLst");
|
|
1030
1068
|
if (r && o && i && n) return s.fillStyleLst = r, s.lnStyleLst = o, s.effectStyleLst = i, void (s.bgFillStyleLst = n);
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1069
|
+
const a = t.serializeElement(e);
|
|
1070
|
+
a && (s.formatSchemeXml = a);
|
|
1033
1071
|
}
|
|
1034
1072
|
parseFillList(t, e, s) {
|
|
1035
1073
|
const r = t.evaluate(s, e);
|
|
@@ -1046,11 +1084,11 @@ var w = class {
|
|
|
1046
1084
|
}
|
|
1047
1085
|
parseFillListItem(t, e) {
|
|
1048
1086
|
switch (e.localName) {
|
|
1049
|
-
case "noFill": return { type:
|
|
1087
|
+
case "noFill": return { type: y.Type.None };
|
|
1050
1088
|
case "solidFill": {
|
|
1051
1089
|
const s = this.processAdjColor(t, e);
|
|
1052
1090
|
return s ? {
|
|
1053
|
-
type:
|
|
1091
|
+
type: y.Type.Solid,
|
|
1054
1092
|
color: s
|
|
1055
1093
|
} : void 0;
|
|
1056
1094
|
}
|
|
@@ -1086,7 +1124,7 @@ var w = class {
|
|
|
1086
1124
|
}
|
|
1087
1125
|
return o;
|
|
1088
1126
|
}
|
|
1089
|
-
},
|
|
1127
|
+
}, St = class {
|
|
1090
1128
|
visit(t, e, s) {
|
|
1091
1129
|
if (!e) return;
|
|
1092
1130
|
const r = {}, o = e.getAttribute("r:id");
|
|
@@ -1096,7 +1134,7 @@ var w = class {
|
|
|
1096
1134
|
}
|
|
1097
1135
|
return t.copyFromAttribute(e, "tooltip", r, "screenTip"), t.copyFromAttribute(e, "history", r, "history", t.BOOLEAN_COPY), t.copyFromAttribute(e, "tgtFrame", r, "target"), s.hyperlink = r, r;
|
|
1098
1136
|
}
|
|
1099
|
-
},
|
|
1137
|
+
}, xt = class {
|
|
1100
1138
|
visit(t, e, s) {
|
|
1101
1139
|
if (!e) return;
|
|
1102
1140
|
const r = {}, o = [];
|
|
@@ -1104,13 +1142,13 @@ var w = class {
|
|
|
1104
1142
|
}
|
|
1105
1143
|
processColorFilter(t, e) {
|
|
1106
1144
|
const s = {}, r = {
|
|
1107
|
-
operator:
|
|
1145
|
+
operator: f.BuiltInOperatorNames.Color,
|
|
1108
1146
|
param: s
|
|
1109
1147
|
};
|
|
1110
1148
|
return t.copyFromAttribute(e, "cellColor", s, "cellColor", t.BOOLEAN_COPY), t.copyFromAttribute(e, "dxfId", s, "styleId", t.INT_COPY), r;
|
|
1111
1149
|
}
|
|
1112
1150
|
processCustomFilter(t, e) {
|
|
1113
|
-
return
|
|
1151
|
+
return h({
|
|
1114
1152
|
operator: e.getAttribute("operator"),
|
|
1115
1153
|
val: e.getAttribute("val")
|
|
1116
1154
|
});
|
|
@@ -1119,10 +1157,10 @@ var w = class {
|
|
|
1119
1157
|
const s = e.getAttribute("and"), r = "and" === s || "1" === s;
|
|
1120
1158
|
e.getAttribute("val");
|
|
1121
1159
|
const o = [], i = {
|
|
1122
|
-
operator: r ?
|
|
1160
|
+
operator: r ? f.BuiltInOperatorNames.And : f.BuiltInOperatorNames.Or,
|
|
1123
1161
|
param: o
|
|
1124
|
-
}, n = e.childNodes,
|
|
1125
|
-
for (let e = 0; e <
|
|
1162
|
+
}, n = e.childNodes, a = n.length;
|
|
1163
|
+
for (let e = 0; e < a; e++) {
|
|
1126
1164
|
const s = n.item(e);
|
|
1127
1165
|
if (1 !== s.nodeType) continue;
|
|
1128
1166
|
let r = null;
|
|
@@ -1132,11 +1170,11 @@ var w = class {
|
|
|
1132
1170
|
}
|
|
1133
1171
|
processDynamicFilter(t, e) {
|
|
1134
1172
|
const s = {}, r = {
|
|
1135
|
-
operator:
|
|
1173
|
+
operator: f.BuiltInOperatorNames.TimePeriod,
|
|
1136
1174
|
param: s
|
|
1137
1175
|
};
|
|
1138
1176
|
let o = e.getAttribute("type");
|
|
1139
|
-
return "aboveAverage" === o ? o =
|
|
1177
|
+
return "aboveAverage" === o ? o = f.AverageType.Above : "belowAverage" === o && (o = f.AverageType.Below), Object.values(f.AverageType).includes(o) ? (r.operator = f.BuiltInOperatorNames.Average, t.copyFromAttribute(e, "val", s, "stdDevs", t.INT_COPY)) : t.copyFromAttribute(e, "val", s, "anchorDate", t.INT_COPY), t.copyFromAttribute(e, "type", s, "operator"), t.copyFromAttribute(e, "maxVal", s, "maxVal", t.INT_COPY), r;
|
|
1140
1178
|
}
|
|
1141
1179
|
processDateGroupItem(t, e) {
|
|
1142
1180
|
const s = {};
|
|
@@ -1147,13 +1185,13 @@ var w = class {
|
|
|
1147
1185
|
}
|
|
1148
1186
|
processFilters(t, e) {
|
|
1149
1187
|
const s = {}, r = {
|
|
1150
|
-
operator:
|
|
1188
|
+
operator: f.BuiltInOperatorNames.InSet,
|
|
1151
1189
|
param: s
|
|
1152
1190
|
};
|
|
1153
1191
|
t.copyFromAttribute(e, "blank", r, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", r, "calendarType");
|
|
1154
1192
|
let o = [], i = [];
|
|
1155
|
-
const n = e.childNodes,
|
|
1156
|
-
for (let e = 0; e <
|
|
1193
|
+
const n = e.childNodes, a = n.length;
|
|
1194
|
+
for (let e = 0; e < a; e++) {
|
|
1157
1195
|
const s = n.item(e);
|
|
1158
1196
|
if (1 === s.nodeType) {
|
|
1159
1197
|
if ("dateGroupItem" === s.localName) {
|
|
@@ -1169,14 +1207,14 @@ var w = class {
|
|
|
1169
1207
|
}
|
|
1170
1208
|
processIcon(t, e) {
|
|
1171
1209
|
const s = {}, r = {
|
|
1172
|
-
operator:
|
|
1210
|
+
operator: f.BuiltInOperatorNames.Icon,
|
|
1173
1211
|
param: s
|
|
1174
1212
|
};
|
|
1175
1213
|
return t.copyFromAttribute(e, "iconId", s, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", s), r;
|
|
1176
1214
|
}
|
|
1177
1215
|
processTop10(t, e) {
|
|
1178
1216
|
const s = {}, r = {
|
|
1179
|
-
operator:
|
|
1217
|
+
operator: f.BuiltInOperatorNames.TopN,
|
|
1180
1218
|
param: s
|
|
1181
1219
|
};
|
|
1182
1220
|
return t.copyFromAttribute(e, "filterVal", s, "filterVal", t.FLOAT_COPY), t.copyFromAttribute(e, "percent", s, "percent", t.BOOLEAN_COPY), t.copyFromAttribute(e, "top", s, "top", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", s, "val", t.FLOAT_COPY), r;
|
|
@@ -1192,22 +1230,22 @@ var w = class {
|
|
|
1192
1230
|
}
|
|
1193
1231
|
return r;
|
|
1194
1232
|
}
|
|
1195
|
-
processFilterColumn(
|
|
1196
|
-
if (!
|
|
1197
|
-
if (!
|
|
1198
|
-
const
|
|
1199
|
-
let o = !1;
|
|
1200
|
-
if (e.hasAttribute("hiddenButton") && (o = a(e.getAttribute("hiddenButton"))), o && s) {
|
|
1201
|
-
let t = s.hiddenButtons;
|
|
1202
|
-
t || (t = [], s.hiddenButtons = t), t.push(r);
|
|
1203
|
-
}
|
|
1233
|
+
processFilterColumn(e, s, r) {
|
|
1234
|
+
if (!s) return null;
|
|
1235
|
+
if (!s.hasAttribute("colId")) return;
|
|
1236
|
+
const o = parseInt(s.getAttribute("colId"));
|
|
1204
1237
|
let i = !1;
|
|
1205
|
-
if (
|
|
1206
|
-
let t =
|
|
1207
|
-
|
|
1238
|
+
if (s.hasAttribute("hiddenButton") && (i = t(s.getAttribute("hiddenButton"))), i && r) {
|
|
1239
|
+
let t = r.hiddenButtons;
|
|
1240
|
+
t || (t = [], r.hiddenButtons = t), t.push(o);
|
|
1241
|
+
}
|
|
1242
|
+
let n = !1;
|
|
1243
|
+
if (s.hasAttribute("showButton") && (n = t(s.getAttribute("showButton"))), n && r) {
|
|
1244
|
+
let t = r.showButtons;
|
|
1245
|
+
!0 !== t && (t || (t = [], r.showButtons = t), t[o] = !0);
|
|
1208
1246
|
}
|
|
1209
|
-
const
|
|
1210
|
-
return
|
|
1247
|
+
const a = this.processFilterCriteria(e, s);
|
|
1248
|
+
return a ? (a.index = o, a) : null;
|
|
1211
1249
|
}
|
|
1212
1250
|
processFilterColumns(t, e, s, r) {
|
|
1213
1251
|
if (!e) return;
|
|
@@ -1221,34 +1259,34 @@ var w = class {
|
|
|
1221
1259
|
}
|
|
1222
1260
|
return s;
|
|
1223
1261
|
}
|
|
1224
|
-
},
|
|
1225
|
-
visit(
|
|
1226
|
-
if (!
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
const
|
|
1230
|
-
null !=
|
|
1231
|
-
...
|
|
1262
|
+
}, Tt = class {
|
|
1263
|
+
visit(e, s, r) {
|
|
1264
|
+
if (!s) return;
|
|
1265
|
+
const o = s.getAttribute("ref"), i = {};
|
|
1266
|
+
s.hasAttribute("caseSensitive") && (i.collatorOptions = t(s.getAttribute("caseSensitive")) ? w.CaseSensitiveOptions : w.CaseInsensitiveOptions);
|
|
1267
|
+
const n = s.getAttribute("sortMethod");
|
|
1268
|
+
null != n && "none" !== n && ("stroke" === n ? i.collatorOptions = {
|
|
1269
|
+
...i.collatorOptions,
|
|
1232
1270
|
collation: "stroke"
|
|
1233
|
-
} : "pinYin" ===
|
|
1234
|
-
...
|
|
1271
|
+
} : "pinYin" === n && (i.collatorOptions = {
|
|
1272
|
+
...i.collatorOptions,
|
|
1235
1273
|
collation: "pinyin"
|
|
1236
1274
|
}));
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
const l =
|
|
1240
|
-
return this.processSortConditions(
|
|
1275
|
+
const a = {};
|
|
1276
|
+
s.hasAttribute("columnSort") && t(s.getAttribute("columnSort")) && (a.axis = N.Axis.Column);
|
|
1277
|
+
const l = g.fastStringToRange(o), c = [];
|
|
1278
|
+
return this.processSortConditions(e, s, c, l, i), c.length > 0 && (a.sorts = c), Object.keys(c).length > 0 && (r.sort = a), a;
|
|
1241
1279
|
}
|
|
1242
|
-
processSortCondition(
|
|
1243
|
-
if (!
|
|
1244
|
-
const
|
|
1245
|
-
if (!
|
|
1246
|
-
if (
|
|
1247
|
-
const t =
|
|
1248
|
-
|
|
1280
|
+
processSortCondition(e, s, r, o) {
|
|
1281
|
+
if (!s) return null;
|
|
1282
|
+
const i = {};
|
|
1283
|
+
if (!s.hasAttribute("ref")) return void e.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
|
|
1284
|
+
if (s.hasAttribute("ref")) {
|
|
1285
|
+
const t = s.getAttribute("ref"), e = g.fastStringToRange(t);
|
|
1286
|
+
i.index = r ? e.colStart - r.colStart : e.colStart;
|
|
1249
1287
|
}
|
|
1250
|
-
const
|
|
1251
|
-
return
|
|
1288
|
+
const n = { ...o };
|
|
1289
|
+
return i.criteria = n, n.reverse = !1, s.hasAttribute("descending") && (n.reverse = t(s.getAttribute("descending"))), e.copyFromAttribute(s, "sortBy", n, "sortOn"), e.copyFromAttribute(s, "dxfId", n), e.copyFromAttribute(s, "iconSet", n), e.copyFromAttribute(s, "customList", n), i;
|
|
1252
1290
|
}
|
|
1253
1291
|
processSortConditions(t, e, s, r, o) {
|
|
1254
1292
|
if (!e) return;
|
|
@@ -1261,7 +1299,7 @@ var w = class {
|
|
|
1261
1299
|
}
|
|
1262
1300
|
}
|
|
1263
1301
|
}
|
|
1264
|
-
},
|
|
1302
|
+
}, Ot = class extends H {
|
|
1265
1303
|
visit(t, e, s) {
|
|
1266
1304
|
this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
|
|
1267
1305
|
const r = {
|
|
@@ -1269,14 +1307,14 @@ var w = class {
|
|
|
1269
1307
|
fonts: {},
|
|
1270
1308
|
borders: {}
|
|
1271
1309
|
};
|
|
1272
|
-
this.processFonts(t, t.evaluate("fonts", e), r.fonts), this.processFills(t, t.evaluate("fills", e), r.fills), this.processBorders(t, t.evaluate("borders", e), r.borders, !0), r.fills[0] = { type:
|
|
1273
|
-
type:
|
|
1274
|
-
patternType:
|
|
1310
|
+
this.processFonts(t, t.evaluate("fonts", e), r.fonts), this.processFills(t, t.evaluate("fills", e), r.fills), this.processBorders(t, t.evaluate("borders", e), r.borders, !0), r.fills[0] = { type: y.Type.None }, r.fills[1] = {
|
|
1311
|
+
type: y.Type.Pattern,
|
|
1312
|
+
patternType: y.BuiltInSheetPattern.Gray125
|
|
1275
1313
|
}, r.borders[0] = {
|
|
1276
|
-
bottom: { style:
|
|
1277
|
-
left: { style:
|
|
1278
|
-
right: { style:
|
|
1279
|
-
top: { style:
|
|
1314
|
+
bottom: { style: b.StrokeStyle.None },
|
|
1315
|
+
left: { style: b.StrokeStyle.None },
|
|
1316
|
+
right: { style: b.StrokeStyle.None },
|
|
1317
|
+
top: { style: b.StrokeStyle.None }
|
|
1280
1318
|
};
|
|
1281
1319
|
const o = [];
|
|
1282
1320
|
this.processXFs(t, t.evaluate("cellStyleXfs", e), o, r, null, !1);
|
|
@@ -1287,6 +1325,8 @@ var w = class {
|
|
|
1287
1325
|
}
|
|
1288
1326
|
const n = [];
|
|
1289
1327
|
this.processXFs(t, t.evaluate("cellXfs", e), n, r, i), Object.keys(n).length > 0 && (s.direct = n);
|
|
1328
|
+
const a = this.collectHiddenXfs(t.evaluate("cellXfs", e));
|
|
1329
|
+
a.size > 0 && t.getVisitorParamsState().set(c, a);
|
|
1290
1330
|
const l = [];
|
|
1291
1331
|
return this.processDXFs(t, t.evaluate("dxfs", e), l), this.processTableStyles(t, t.evaluate("tableStyles", e), s, l), this.processIndexColors(t, t.evaluate("colors/indexedColors", e), s), this.processMruColors(t, t.evaluate("colors/mruColors", e), s), s;
|
|
1292
1332
|
}
|
|
@@ -1332,83 +1372,98 @@ var w = class {
|
|
|
1332
1372
|
}
|
|
1333
1373
|
processXFs(t, e, s, r, o = null, i = !0) {
|
|
1334
1374
|
if (!e) return;
|
|
1335
|
-
const n = e.childNodes,
|
|
1336
|
-
for (let e = 0; e <
|
|
1337
|
-
const
|
|
1338
|
-
if (1 ===
|
|
1375
|
+
const n = e.childNodes, a = n.length;
|
|
1376
|
+
for (let e = 0; e < a; e++) {
|
|
1377
|
+
const a = n.item(e);
|
|
1378
|
+
if (1 === a.nodeType && "xf" === a.localName) {
|
|
1339
1379
|
const e = {};
|
|
1340
|
-
this.processXF(t,
|
|
1380
|
+
this.processXF(t, a, e, r, o, i), s.push(e);
|
|
1341
1381
|
}
|
|
1342
1382
|
}
|
|
1343
1383
|
}
|
|
1344
|
-
processXF(
|
|
1345
|
-
if (!
|
|
1346
|
-
const
|
|
1347
|
-
if (
|
|
1348
|
-
const t =
|
|
1349
|
-
t && t !==
|
|
1384
|
+
processXF(e, s, r, o, i, n) {
|
|
1385
|
+
if (!s) return;
|
|
1386
|
+
const a = s.getAttribute("xfId");
|
|
1387
|
+
if (a && i) {
|
|
1388
|
+
const t = i.get(parseInt(a));
|
|
1389
|
+
t && t !== F.BuiltInName.Normal && (r.named = t);
|
|
1350
1390
|
}
|
|
1351
|
-
const l = (
|
|
1391
|
+
const l = (e) => !(!n && s.hasAttribute(e)) || t(s.getAttribute(e)), c = (e) => !n || s.hasAttribute(e) && t(s.getAttribute(e)), u = "0", h = n ? u : void 0;
|
|
1352
1392
|
if (l("applyFont")) {
|
|
1353
|
-
const t =
|
|
1393
|
+
const t = s.getAttribute("fontId") ?? h;
|
|
1354
1394
|
if (void 0 !== t && (t !== u || c("applyFont"))) {
|
|
1355
|
-
const e =
|
|
1356
|
-
void 0 !== e && (
|
|
1395
|
+
const e = o.fonts[t];
|
|
1396
|
+
void 0 !== e && (r.font = e);
|
|
1357
1397
|
}
|
|
1358
1398
|
}
|
|
1359
1399
|
if (l("applyFill")) {
|
|
1360
|
-
const t =
|
|
1400
|
+
const t = s.getAttribute("fillId") ?? h;
|
|
1361
1401
|
if (void 0 !== t && (t !== u || c("applyFill"))) {
|
|
1362
|
-
const e =
|
|
1363
|
-
void 0 !== e && Object.keys(e).length > 0 && (
|
|
1402
|
+
const e = o.fills[t];
|
|
1403
|
+
void 0 !== e && Object.keys(e).length > 0 && (r.fill = e);
|
|
1364
1404
|
}
|
|
1365
1405
|
}
|
|
1366
1406
|
if (l("applyBorder")) {
|
|
1367
|
-
const t =
|
|
1407
|
+
const t = s.getAttribute("borderId") ?? h;
|
|
1368
1408
|
if (void 0 !== t && (t !== u || c("applyBorder"))) {
|
|
1369
|
-
const e =
|
|
1370
|
-
void 0 !== e && (
|
|
1409
|
+
const e = o.borders[t];
|
|
1410
|
+
void 0 !== e && (r.borders = e);
|
|
1371
1411
|
}
|
|
1372
1412
|
}
|
|
1373
1413
|
if (l("applyNumberFormat")) {
|
|
1374
|
-
const
|
|
1375
|
-
if (void 0 !==
|
|
1376
|
-
const
|
|
1414
|
+
const t = s.getAttribute("numFmtId") ?? h;
|
|
1415
|
+
if (void 0 !== t && (t !== u || c("applyNumberFormat"))) {
|
|
1416
|
+
const s = parseInt(t);
|
|
1377
1417
|
let o;
|
|
1378
|
-
const i =
|
|
1418
|
+
const i = e.getVisitorParamsState();
|
|
1379
1419
|
if (i) {
|
|
1380
1420
|
const t = i.get("numFmts");
|
|
1381
|
-
t && (o = t.get(
|
|
1382
|
-
} else
|
|
1421
|
+
t && (o = t.get(s)), r.numberFormat = o ?? s;
|
|
1422
|
+
} else e.warn("Number formats were unavailable; a cell format was not read.", { onceKey: "xlsx.style.numberFormat.state" });
|
|
1383
1423
|
}
|
|
1384
1424
|
}
|
|
1385
1425
|
if (l("applyAlignment")) {
|
|
1386
|
-
const
|
|
1387
|
-
(
|
|
1426
|
+
const t = e.evaluate("alignment", s);
|
|
1427
|
+
(t || c("applyAlignment")) && this.processAlignment(e, t, r);
|
|
1388
1428
|
}
|
|
1389
1429
|
if (l("applyProtection")) {
|
|
1390
|
-
const
|
|
1391
|
-
(
|
|
1430
|
+
const t = e.evaluate("protection", s);
|
|
1431
|
+
(t || c("applyProtection")) && this.processProtection(e, t, r);
|
|
1392
1432
|
}
|
|
1393
|
-
const p =
|
|
1394
|
-
p && (
|
|
1433
|
+
const p = t(s.getAttribute("quotePrefix") ?? "");
|
|
1434
|
+
p && (r.quotePrefix = p);
|
|
1395
1435
|
}
|
|
1396
|
-
processAlignment(
|
|
1397
|
-
const
|
|
1398
|
-
if (
|
|
1399
|
-
let t = parseFloat(
|
|
1400
|
-
t > 0 && t <= 90 ? t = 360 - t : t > 90 && t <= 180 ? t -= 90 : 255 === t && (t = 0,
|
|
1401
|
-
} else
|
|
1402
|
-
|
|
1403
|
-
const
|
|
1404
|
-
return
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1436
|
+
processAlignment(e, s, r) {
|
|
1437
|
+
const o = {};
|
|
1438
|
+
if (s?.hasAttribute("horizontal") ? o.horizontal = s.getAttribute("horizontal") : o.horizontal = C.HorizontalAlignment.General, s?.hasAttribute("vertical") ? o.vertical = s.getAttribute("vertical") : o.vertical = C.VerticalAlignment.Bottom, s?.hasAttribute("indent") ? o.indent = parseInt(s.getAttribute("indent")) : o.indent = 0, s?.hasAttribute("relativeIndent") ? o.relativeIndent = parseInt(s.getAttribute("relativeIndent")) : o.relativeIndent = 0, t(s?.getAttribute("wrapText") ?? "") ? o.overflow = C.Overflow.Wrap : o.overflow = C.Overflow.Visible, t(s?.getAttribute("shrinkToFit") ?? "") && (o.overflow = C.Overflow.Shrink), s?.hasAttribute("textRotation")) {
|
|
1439
|
+
let t = parseFloat(s.getAttribute("textRotation"));
|
|
1440
|
+
t > 0 && t <= 90 ? t = 360 - t : t > 90 && t <= 180 ? t -= 90 : 255 === t && (t = 0, o.stacked = !0), o.rotation = t;
|
|
1441
|
+
} else o.rotation = 0;
|
|
1442
|
+
s?.hasAttribute("justifyLastLine") && (o.justifyLastLine = t(s.getAttribute("justifyLastLine")));
|
|
1443
|
+
const i = s?.getAttribute("readingOrder");
|
|
1444
|
+
return i && ("0" === i ? o.readingDirection = C.ReadingDirection.Auto : "1" === i ? o.readingDirection = C.ReadingDirection.LeftToRight : "2" === i ? o.readingDirection = C.ReadingDirection.RightToLeft : e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(o).length > 0 && (r.alignment = o), r;
|
|
1445
|
+
}
|
|
1446
|
+
collectHiddenXfs(e) {
|
|
1447
|
+
const s = /* @__PURE__ */ new Set();
|
|
1448
|
+
if (!e) return s;
|
|
1449
|
+
const r = e.childNodes;
|
|
1450
|
+
let o = 0;
|
|
1451
|
+
for (let e = 0; e < r.length; e++) {
|
|
1452
|
+
const i = r.item(e);
|
|
1453
|
+
if (1 !== i.nodeType || "xf" !== i.localName) continue;
|
|
1454
|
+
const n = i.childNodes;
|
|
1455
|
+
for (let e = 0; e < n.length; e++) {
|
|
1456
|
+
const r = n.item(e);
|
|
1457
|
+
1 === r.nodeType && "protection" === r.localName && t(r.getAttribute("hidden") ?? "") && s.add(o);
|
|
1458
|
+
}
|
|
1459
|
+
o++;
|
|
1460
|
+
}
|
|
1461
|
+
return s;
|
|
1462
|
+
}
|
|
1463
|
+
processProtection(e, s, r) {
|
|
1464
|
+
if (!s) return;
|
|
1465
|
+
const o = s.getAttribute("locked");
|
|
1466
|
+
return r.protection = { alwaysUnlocked: !!o && !t(o) }, r;
|
|
1412
1467
|
}
|
|
1413
1468
|
processDXF(t, e, s) {
|
|
1414
1469
|
if (!e) return;
|
|
@@ -1423,7 +1478,7 @@ var w = class {
|
|
|
1423
1478
|
this.processFill(t, o, e, 0), e.length > 0 && e[0] && (s.fill = e[0]);
|
|
1424
1479
|
} else if (1 === o.nodeType && "border" === o.localName) {
|
|
1425
1480
|
const e = [];
|
|
1426
|
-
this.processBorder(t, o, e, 0, !1), e.length > 0 && e[0] && (s.
|
|
1481
|
+
this.processBorder(t, o, e, 0, !1), e.length > 0 && e[0] && (s.borders = e[0]);
|
|
1427
1482
|
} else if (1 === o.nodeType && "numFmt" === o.localName) {
|
|
1428
1483
|
const t = o.getAttribute("formatCode");
|
|
1429
1484
|
if (t) s.numberFormat = t;
|
|
@@ -1451,60 +1506,60 @@ var w = class {
|
|
|
1451
1506
|
}
|
|
1452
1507
|
t.getVisitorParamsState().delete("processingDXFs");
|
|
1453
1508
|
}
|
|
1454
|
-
processTableStyle(
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1457
|
-
const l =
|
|
1509
|
+
processTableStyle(e, s, r, o, i = !1) {
|
|
1510
|
+
const n = s.getAttribute("name"), a = { name: n };
|
|
1511
|
+
s.hasAttribute("table") && (a.table = t(s.getAttribute("table"))), s.hasAttribute("pivot") && (a.pivot = t(s.getAttribute("pivot"))), i && !a.pivot && o.unshift(null);
|
|
1512
|
+
const l = s.childNodes, c = l.length;
|
|
1458
1513
|
for (let t = 0; t < c; t++) {
|
|
1459
|
-
const
|
|
1460
|
-
if (1 ===
|
|
1461
|
-
const t =
|
|
1462
|
-
let
|
|
1463
|
-
|
|
1464
|
-
let
|
|
1465
|
-
|
|
1514
|
+
const s = l.item(t);
|
|
1515
|
+
if (1 === s.nodeType && "tableStyleElement" === s.localName) {
|
|
1516
|
+
const t = s.getAttribute("type"), r = s.getAttribute("dxfId");
|
|
1517
|
+
let i = null != r ? o?.[r] : void 0;
|
|
1518
|
+
i || (e.warn(`A table style names a format that does not exist (dxfId '${r}').`, { onceKey: "xlsx.style.tableStyle.dxf" }), i = {}), a[t] = i;
|
|
1519
|
+
let n = null;
|
|
1520
|
+
s.hasAttribute("size") && (n = parseInt(s.getAttribute("size"))), n && !isNaN(n) && (i.size = n);
|
|
1466
1521
|
}
|
|
1467
1522
|
}
|
|
1468
|
-
delete
|
|
1523
|
+
delete a.name, r[n] = a;
|
|
1469
1524
|
}
|
|
1470
1525
|
processTableStyles(t, e, s, r, o) {
|
|
1471
1526
|
if (!e) return;
|
|
1472
1527
|
const i = {}, n = e.getAttribute("defaultTableStyle");
|
|
1473
1528
|
n && (i.defaultTableStyle = n);
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1476
|
-
const
|
|
1529
|
+
const a = e.getAttribute("defaultPivotStyle");
|
|
1530
|
+
a && (i.defaultPivotStyle = a);
|
|
1531
|
+
const l = e.childNodes, c = {}, u = l.length;
|
|
1477
1532
|
for (let e = 0; e < u; e++) {
|
|
1478
|
-
const s =
|
|
1533
|
+
const s = l.item(e);
|
|
1479
1534
|
1 === s.nodeType && "tableStyle" === s.localName && this.processTableStyle(t, s, c, r, o);
|
|
1480
1535
|
}
|
|
1481
1536
|
return Object.keys(c).length > 0 && (i.styles = c), Object.keys(i).length > 0 && (s.tables = i), s;
|
|
1482
1537
|
}
|
|
1483
|
-
processCellStyles(
|
|
1484
|
-
if (!
|
|
1485
|
-
const
|
|
1486
|
-
for (let
|
|
1487
|
-
const
|
|
1488
|
-
if (1 ===
|
|
1489
|
-
const
|
|
1490
|
-
let l =
|
|
1491
|
-
if (null !==
|
|
1492
|
-
const t =
|
|
1538
|
+
processCellStyles(e, s, r, o, i) {
|
|
1539
|
+
if (!s) return;
|
|
1540
|
+
const n = s.childNodes, a = n.length;
|
|
1541
|
+
for (let e = 0; e < a; e++) {
|
|
1542
|
+
const s = n.item(e);
|
|
1543
|
+
if (1 === s.nodeType && "cellStyle" === s.localName) {
|
|
1544
|
+
const e = parseInt(s.getAttribute("xfId") ?? ""), n = s.getAttribute("name"), a = s.getAttribute("builtinId");
|
|
1545
|
+
let l = n;
|
|
1546
|
+
if (null !== a) {
|
|
1547
|
+
const t = F.builtInNameFromId(parseInt(a));
|
|
1493
1548
|
void 0 !== t && (l = t);
|
|
1494
1549
|
}
|
|
1495
|
-
if (
|
|
1550
|
+
if (i.set(e, l), !o[e]) continue;
|
|
1496
1551
|
const c = {
|
|
1497
1552
|
name: l,
|
|
1498
|
-
style:
|
|
1553
|
+
style: o[e]
|
|
1499
1554
|
};
|
|
1500
|
-
|
|
1555
|
+
s.getAttribute("hidden") && (c.hidden = t(s.getAttribute("hidden"))), s.getAttribute("iLevel") && (c.iLevel = parseInt(s.getAttribute("iLevel"))), r.push(c);
|
|
1501
1556
|
}
|
|
1502
1557
|
}
|
|
1503
1558
|
}
|
|
1504
1559
|
afterVisit(t, e, s) {}
|
|
1505
|
-
},
|
|
1560
|
+
}, kt = class extends H {
|
|
1506
1561
|
visit(t, e, s) {
|
|
1507
|
-
return this.processSheetRefs(t, t.evaluate("sheets", e), s), this.processExternalReferences(t, t.evaluate("externalReferences", e), s), this.processBookViews(t, t.evaluate("bookViews", e), s), this.processDefinedNames(t, t.evaluate("definedNames", e), s), this.processCalcPr(t, t.evaluate("calcPr", e), s), this.processWorkbookProtection(t, t.evaluate("workbookProtection", e), s), this.processWorkbookPr(t, t.evaluate("workbookPr", e), s), s;
|
|
1562
|
+
return this.processSheetRefs(t, t.evaluate("sheets", e), s), this.processExternalReferences(t, t.evaluate("externalReferences", e), s), this.processBookViews(t, t.evaluate("bookViews", e), s), this.processDefinedNames(t, t.evaluate("definedNames", e), s), this.processCalcPr(t, t.evaluate("calcPr", e), s), this.processPivotCaches(t, t.evaluate("pivotCaches", e), s), this.processWorkbookProtection(t, t.evaluate("workbookProtection", e), s), this.processWorkbookPr(t, t.evaluate("workbookPr", e), s), s;
|
|
1508
1563
|
}
|
|
1509
1564
|
processPassword(t, e, s, r = "workbook", o = "password") {
|
|
1510
1565
|
if (!e) return;
|
|
@@ -1514,12 +1569,16 @@ var w = class {
|
|
|
1514
1569
|
processWorkbookProtection(t, e, s) {
|
|
1515
1570
|
if (!e) return;
|
|
1516
1571
|
const r = {};
|
|
1517
|
-
|
|
1572
|
+
this.processPassword(t, e, r, "workbook", "password"), this.processPassword(t, e, r, "revisions", "revisionsPassword");
|
|
1573
|
+
for (const t of u) r[t.key] = p(t, e.getAttribute(t.attribute));
|
|
1574
|
+
return s.protection = r, s;
|
|
1518
1575
|
}
|
|
1519
1576
|
processCalcPr(t, e, s) {
|
|
1520
1577
|
if (!e) return;
|
|
1521
1578
|
const r = {};
|
|
1522
|
-
t.copyFromAttribute(e, "calcMode", r, "calcMode", (t) =>
|
|
1579
|
+
t.copyFromAttribute(e, "calcMode", r, "calcMode", (t) => J[t] ?? null), t.copyFromAttribute(e, "fullCalcOnLoad", r, "fullCalcOnLoad", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcOnSave", r, "calcOnSave", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcCompleted", r, "calcCompleted", t.BOOLEAN_COPY), t.copyFromAttribute(e, "fullPrecision", r, "fullPrecision", t.BOOLEAN_COPY), t.copyFromAttribute(e, "forceFullCalc", r, "forceFullCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentCalc", r, "concurrentCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "refMode", r, "refMode"), t.copyFromAttribute(e, "iterate", r, "iterate", t.BOOLEAN_COPY), t.copyFromAttribute(e, "iterateCount", r, "maxIteration", t.INT_COPY), t.copyFromAttribute(e, "iterateDelta", r, "maxIterateChange", t.FLOAT_COPY);
|
|
1580
|
+
const o = e.getAttribute("calcId");
|
|
1581
|
+
null !== o && t.getVisitorParamsState().set("calcId", o), s.calc = r;
|
|
1523
1582
|
}
|
|
1524
1583
|
processSheetRefs(t, e, s) {
|
|
1525
1584
|
if (!e) return;
|
|
@@ -1532,7 +1591,7 @@ var w = class {
|
|
|
1532
1591
|
}
|
|
1533
1592
|
processSheetRef(t, e, s) {
|
|
1534
1593
|
const r = {};
|
|
1535
|
-
t.copyFromAttribute(e, "name", r, "name"), t.copyFromAttribute(e, "state", r, "visibility");
|
|
1594
|
+
t.copyFromAttribute(e, "name", r, "name"), t.copyFromAttribute(e, "state", r, "visibility"), t.copyFromAttribute(e, "sheetId", r, "sheetId", t.INT_COPY);
|
|
1536
1595
|
const o = e.getAttribute("r:id"), i = t.getRef(o);
|
|
1537
1596
|
i && (r.sheet = i), s.push(r);
|
|
1538
1597
|
}
|
|
@@ -1548,6 +1607,22 @@ var w = class {
|
|
|
1548
1607
|
}
|
|
1549
1608
|
r.length > 0 && (s.externalBooks = r);
|
|
1550
1609
|
}
|
|
1610
|
+
processPivotCaches(t, e, s) {
|
|
1611
|
+
if (!e) return;
|
|
1612
|
+
const r = [], o = e.childNodes, i = o.length;
|
|
1613
|
+
for (let e = 0; e < i; e++) {
|
|
1614
|
+
const s = o.item(e);
|
|
1615
|
+
if (1 !== s.nodeType || "pivotCache" !== s.localName) continue;
|
|
1616
|
+
const i = parseInt(s.getAttribute("cacheId") ?? "", 10), n = s.getAttribute("r:id");
|
|
1617
|
+
if (isNaN(i) || !n) continue;
|
|
1618
|
+
const a = t.readEmbeddedPart(n);
|
|
1619
|
+
a && r.push({
|
|
1620
|
+
cacheId: i,
|
|
1621
|
+
part: a
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
r.length > 0 && (s.pivotCaches = r);
|
|
1625
|
+
}
|
|
1551
1626
|
processBookViews(t, e, s) {
|
|
1552
1627
|
if (!e) return;
|
|
1553
1628
|
const r = e.childNodes;
|
|
@@ -1567,9 +1642,9 @@ var w = class {
|
|
|
1567
1642
|
if (!e) return;
|
|
1568
1643
|
const o = {}, i = e.firstChild;
|
|
1569
1644
|
if (i && 3 === i.nodeType && (o.ref = i.textContent), t.copyFromAttribute(e, "name", o), t.copyFromAttribute(e, "comment", o), t.copyFromAttribute(e, "hidden", o, "hidden", t.BOOLEAN_COPY), e.hasAttribute("localSheetId")) {
|
|
1570
|
-
const
|
|
1571
|
-
if (!r[
|
|
1572
|
-
o.scope = r[
|
|
1645
|
+
const s = e.getAttribute("localSheetId");
|
|
1646
|
+
if (!r[s]?.name) return void t.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${s}' which does not exist.`);
|
|
1647
|
+
o.scope = r[s].name;
|
|
1573
1648
|
}
|
|
1574
1649
|
t.copyFromAttribute(e, "customMenu", o), t.copyFromAttribute(e, "description", o), t.copyFromAttribute(e, "statusBar", o), t.copyFromAttribute(e, "help", o), t.copyFromAttribute(e, "shortcutKey", o), t.copyFromAttribute(e, "function", o, "function", t.BOOLEAN_COPY), t.copyFromAttribute(e, "functionGroupId", o, "functionGroupId", t.INT_COPY), t.copyFromAttribute(e, "publishToServer", o, "publishToServer", t.BOOLEAN_COPY), t.copyFromAttribute(e, "vbProcedure", o, "vbProcedure", t.BOOLEAN_COPY), t.copyFromAttribute(e, "xlm", o, "xlm", t.BOOLEAN_COPY), Object.keys(o).length > 0 && s.push(o);
|
|
1575
1650
|
}
|
|
@@ -1583,13 +1658,13 @@ var w = class {
|
|
|
1583
1658
|
r.length > 0 && (s.names = r);
|
|
1584
1659
|
}
|
|
1585
1660
|
processWorkbookPr(t, e, s) {
|
|
1586
|
-
e && t.copyFromAttribute(e, "date1904", s, "date1904", t.BOOLEAN_COPY);
|
|
1661
|
+
e && (t.copyFromAttribute(e, "date1904", s, "date1904", t.BOOLEAN_COPY), t.copyFromAttribute(e, "codeName", s, "codeName"), t.copyFromAttribute(e, "updateLinks", s, "updateLinks"));
|
|
1587
1662
|
}
|
|
1588
1663
|
afterVisit(t, e, s) {}
|
|
1589
|
-
},
|
|
1664
|
+
}, Vt = class {
|
|
1590
1665
|
visit(t, e, s) {
|
|
1591
1666
|
const r = {};
|
|
1592
|
-
return t.copyFromAttribute(e, "ref", s, "r"), t.getVisitorParamsState().set("ref", s.r), s.v = r, t.copyFromAttribute(e, "name", r), t.copyFromAttribute(e, "displayName", r), t.copyFromAttribute(e, "headerRowCount", r, "headerRowCount", t.INT_COPY), t.copyFromAttribute(e, "totalsRowCount", r, "totalsRowCount", t.INT_COPY), this.processTableColumns(t, e, r), this.processTableStyleInfo(t, e, r), t.copyFromAttribute(e, "id", r), t.copyFromAttribute(e, "comment", r, "description"), t.copyFromAttribute(e, "connectionId", r, "connectionId", t.INT_COPY), t.copyFromAttribute(e, "tableType", r), t.copyFromAttribute(e, "published", r, "published", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRow", r, "insertRow", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRowShift", r, "insertRowShift", t.BOOLEAN_COPY),
|
|
1667
|
+
return t.copyFromAttribute(e, "ref", s, "r"), t.getVisitorParamsState().set("ref", s.r), s.v = r, t.copyFromAttribute(e, "name", r), t.copyFromAttribute(e, "displayName", r), t.copyFromAttribute(e, "headerRowCount", r, "headerRowCount", t.INT_COPY), t.copyFromAttribute(e, "totalsRowCount", r, "totalsRowCount", t.INT_COPY), this.processTableColumns(t, e, r), this.processTableStyleInfo(t, e, r), t.copyFromAttribute(e, "id", r), t.copyFromAttribute(e, "comment", r, "description"), t.copyFromAttribute(e, "connectionId", r, "connectionId", t.INT_COPY), t.copyFromAttribute(e, "tableType", r), t.copyFromAttribute(e, "published", r, "published", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRow", r, "insertRow", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRowShift", r, "insertRowShift", t.BOOLEAN_COPY), r.totalsRowShown = "0" !== e.getAttribute("totalsRowShown"), r;
|
|
1593
1668
|
}
|
|
1594
1669
|
afterVisit(t, e, s) {
|
|
1595
1670
|
const r = s.v;
|
|
@@ -1623,7 +1698,9 @@ var w = class {
|
|
|
1623
1698
|
const s = t.evaluate("totalsRowFormula", o);
|
|
1624
1699
|
s && (e.totalsRowFormula = s.textContent);
|
|
1625
1700
|
} else e.totalsRowFormula = r;
|
|
1626
|
-
t.copyFromAttribute(o, "totalsRowLabel", e)
|
|
1701
|
+
t.copyFromAttribute(o, "totalsRowLabel", e);
|
|
1702
|
+
const i = t.evaluate("calculatedColumnFormula", o);
|
|
1703
|
+
i?.textContent && (e.calculatedColumnFormula = i.textContent), s.push(e);
|
|
1627
1704
|
}
|
|
1628
1705
|
}
|
|
1629
1706
|
return s;
|
|
@@ -1636,7 +1713,7 @@ var w = class {
|
|
|
1636
1713
|
}
|
|
1637
1714
|
o.length > 0 && (s.columns = o);
|
|
1638
1715
|
}
|
|
1639
|
-
},
|
|
1716
|
+
}, It = class {
|
|
1640
1717
|
visit(t, e, s) {
|
|
1641
1718
|
const r = t.getVisitorParamsState().get("ref");
|
|
1642
1719
|
if (r) {
|
|
@@ -1645,7 +1722,7 @@ var w = class {
|
|
|
1645
1722
|
}
|
|
1646
1723
|
return t.copyFromAttribute(e, "altText", s), t.copyFromAttribute(e, "altTextSummary", s), s;
|
|
1647
1724
|
}
|
|
1648
|
-
},
|
|
1725
|
+
}, Lt = class {
|
|
1649
1726
|
visit(t, e, s) {
|
|
1650
1727
|
const r = e.childNodes, o = r.length;
|
|
1651
1728
|
let i = null;
|
|
@@ -1656,7 +1733,12 @@ var w = class {
|
|
|
1656
1733
|
break;
|
|
1657
1734
|
}
|
|
1658
1735
|
}
|
|
1659
|
-
|
|
1736
|
+
if (!i) return s;
|
|
1737
|
+
e.getAttribute("mc:Ignorable") && (s.mceIgnorable = !0);
|
|
1738
|
+
const n = i.getAttribute("r:id");
|
|
1739
|
+
n && (s.__bookRelId = n);
|
|
1740
|
+
const a = this._findAbsoluteUrlRelId(i);
|
|
1741
|
+
return a && (s.__absoluteUrlRelId = a), s.sheetNames = [], this.processSheetNames(t, i, s), this.processDefinedNames(t, i, s), this.processSheetDataSet(t, i, s), s;
|
|
1660
1742
|
}
|
|
1661
1743
|
processSheetNames(t, e, s) {
|
|
1662
1744
|
const r = this._findChild(e, "sheetNames");
|
|
@@ -1699,7 +1781,7 @@ var w = class {
|
|
|
1699
1781
|
o.length > 0 && (s.sheetDataSet = o);
|
|
1700
1782
|
}
|
|
1701
1783
|
processSheetData(t, e) {
|
|
1702
|
-
const s = new
|
|
1784
|
+
const s = new P.Builder(), r = e.childNodes, o = r.length;
|
|
1703
1785
|
for (let t = 0; t < o; t++) {
|
|
1704
1786
|
const e = r.item(t);
|
|
1705
1787
|
if (1 !== e.nodeType || "row" !== e.localName) continue;
|
|
@@ -1709,7 +1791,7 @@ var w = class {
|
|
|
1709
1791
|
if (1 !== e.nodeType || "cell" !== e.localName) continue;
|
|
1710
1792
|
const r = e.getAttribute("r");
|
|
1711
1793
|
if (!r) continue;
|
|
1712
|
-
const i =
|
|
1794
|
+
const i = g.fastStringToCell(r);
|
|
1713
1795
|
if (void 0 === i?.rowIndex || void 0 === i?.colIndex) continue;
|
|
1714
1796
|
const n = this._readCellValue(e);
|
|
1715
1797
|
void 0 !== n && s.pushAt(i.rowIndex, i.colIndex, n);
|
|
@@ -1729,7 +1811,7 @@ var w = class {
|
|
|
1729
1811
|
case "str":
|
|
1730
1812
|
default: return e;
|
|
1731
1813
|
case "e": {
|
|
1732
|
-
const t =
|
|
1814
|
+
const t = m.getBuiltInByLabel(e);
|
|
1733
1815
|
return t ? {
|
|
1734
1816
|
t: "e",
|
|
1735
1817
|
v: t.getCode()
|
|
@@ -1745,13 +1827,17 @@ var w = class {
|
|
|
1745
1827
|
}
|
|
1746
1828
|
return null;
|
|
1747
1829
|
}
|
|
1748
|
-
|
|
1830
|
+
_findAbsoluteUrlRelId(t) {
|
|
1831
|
+
const e = this._findChild(t, "alternateUrls");
|
|
1832
|
+
return e ? this._findChild(e, "absoluteUrl")?.getAttribute("r:id") ?? null : null;
|
|
1833
|
+
}
|
|
1834
|
+
}, _t = class {
|
|
1749
1835
|
visit(t, e, s) {
|
|
1750
1836
|
t.copyFromAttribute(e, "name", s), t.copyFromAttribute(e, "sourceName", s);
|
|
1751
1837
|
const r = t.evaluate("*/tableSlicerCache", e);
|
|
1752
|
-
return r ? (t.copyFromAttribute(r, "tableId", s), t.copyFromAttribute(r, "column", s, "columnId"), t.copyFromAttribute(r, "crossFilter", s), s) : (
|
|
1838
|
+
return r ? (t.copyFromAttribute(r, "tableId", s), t.copyFromAttribute(r, "column", s, "columnId"), t.copyFromAttribute(r, "crossFilter", s), s) : (t.warn("A slicer names no table; it was not imported.", { onceKey: "xlsx.slicer.cacheDefinition" }), s);
|
|
1753
1839
|
}
|
|
1754
|
-
},
|
|
1840
|
+
}, Bt = class {
|
|
1755
1841
|
visit(t, e, s) {
|
|
1756
1842
|
let r = s.slicers;
|
|
1757
1843
|
r || (r = {}, s.slicers = r);
|
|
@@ -1773,35 +1859,35 @@ var w = class {
|
|
|
1773
1859
|
}
|
|
1774
1860
|
t.copyFromAttribute(e, "caption", r), t.copyFromAttribute(e, "startItem", r, "startItem", t.INT_COPY), t.copyFromAttribute(e, "columnCount", r, "columnCount", t.INT_COPY), t.copyFromAttribute(e, "showCaption", r, "showCaption", t.BOOLEAN_COPY), t.copyFromAttribute(e, "level", r, "level", t.INT_COPY), t.copyFromAttribute(e, "style", r), t.copyFromAttribute(e, "locked", r, "locked", t.BOOLEAN_COPY), t.copyFromAttribute(e, "rowHeight", r, "rowHeight", t.INT_COPY);
|
|
1775
1861
|
}
|
|
1776
|
-
},
|
|
1862
|
+
}, Et = class {
|
|
1777
1863
|
visit(t, e, s) {
|
|
1778
1864
|
return s;
|
|
1779
1865
|
}
|
|
1780
|
-
},
|
|
1866
|
+
}, Rt = class {
|
|
1781
1867
|
visit(t, e, s) {
|
|
1782
1868
|
if (!e) return;
|
|
1783
1869
|
const r = {};
|
|
1784
1870
|
return t.copyFromAttribute(e, "editAs", r, "anchorType"), r.anchor = {}, "absoluteAnchor" === e.localName ? (r.anchorType = "absolute", this.processAbsoluteCoord(t, t.evaluate("xdr:pos", e), r.anchor, "from", "x", "y"), this.processAbsoluteCoord(t, t.evaluate("xdr:ext", e), r.anchor, "to", "cx", "cy")) : "oneCellAnchor" === e.localName ? (this.processOffsetCoord(t, t.evaluate("from", e), r.anchor, "from"), this.processAbsoluteCoord(t, t.evaluate("xdr:ext", e), r.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(t, t.evaluate("from", e), r.anchor, "from"), this.processOffsetCoord(t, t.evaluate("to", e), r.anchor, "to")), s.movables || (s.movables = []), s.movables.push(r), r;
|
|
1785
1871
|
}
|
|
1786
|
-
processAbsoluteCoord(e, s, r, o, i
|
|
1787
|
-
if (!
|
|
1788
|
-
const
|
|
1872
|
+
processAbsoluteCoord(t, e, s, r, o, i) {
|
|
1873
|
+
if (!e) return;
|
|
1874
|
+
const n = {
|
|
1789
1875
|
x: 0,
|
|
1790
1876
|
y: 0
|
|
1791
1877
|
};
|
|
1792
|
-
return
|
|
1878
|
+
return n.x = l(e.getAttribute(o)), n.y = l(e.getAttribute(i)), "from" === r ? s.tl = n : s.br = n, s;
|
|
1793
1879
|
}
|
|
1794
|
-
processOffsetCoord(e, s, r
|
|
1795
|
-
if (!
|
|
1796
|
-
const
|
|
1880
|
+
processOffsetCoord(t, e, s, r) {
|
|
1881
|
+
if (!e) return;
|
|
1882
|
+
const o = {
|
|
1797
1883
|
c: 0,
|
|
1798
1884
|
r: 0,
|
|
1799
1885
|
x: 0,
|
|
1800
1886
|
y: 0
|
|
1801
1887
|
};
|
|
1802
|
-
return
|
|
1888
|
+
return t.evaluate("col", e) && (o.c = parseInt(t.evaluate("col", e).textContent)), t.evaluate("row", e) && (o.r = parseInt(t.evaluate("row", e).textContent)), t.evaluate("colOff", e) && (o.x = l(t.evaluate("colOff", e).textContent)), t.evaluate("rowOff", e) && (o.y = l(t.evaluate("rowOff", e).textContent)), "from" === r ? s.tl = o : s.br = o, s;
|
|
1803
1889
|
}
|
|
1804
|
-
},
|
|
1890
|
+
}, jt = class extends Q {
|
|
1805
1891
|
visit(t, e, s) {
|
|
1806
1892
|
if (!e) return;
|
|
1807
1893
|
s = super.visit(t, e, s);
|
|
@@ -1828,26 +1914,20 @@ var w = class {
|
|
|
1828
1914
|
if ("chart" === s && i) {
|
|
1829
1915
|
let s = t.evaluate("*/cNvPr", e);
|
|
1830
1916
|
s?.item && (s = s.item(0));
|
|
1831
|
-
const r = s?.getAttribute?.("id"), n = r ? parseInt(r, 10) : void 0
|
|
1832
|
-
let c;
|
|
1833
|
-
if (a?.target) {
|
|
1834
|
-
const e = t.getFileLocation(), s = e.slice(0, e.lastIndexOf("/") + 1);
|
|
1835
|
-
c = l(a.target.startsWith("/") ? a.target : s + a.target);
|
|
1836
|
-
}
|
|
1917
|
+
const r = s?.getAttribute?.("id"), n = r ? parseInt(r, 10) : void 0;
|
|
1837
1918
|
o.json = {
|
|
1838
1919
|
xml: t.serializeElement(e) ?? void 0,
|
|
1839
1920
|
sourceId: void 0 === n || isNaN(n) ? void 0 : n,
|
|
1840
|
-
|
|
1841
|
-
chartTargetPath: c
|
|
1921
|
+
part: t.readEmbeddedPart(i) ?? void 0
|
|
1842
1922
|
};
|
|
1843
1923
|
} else i && (o.json = t.getRef(i));
|
|
1844
|
-
} catch (
|
|
1845
|
-
|
|
1924
|
+
} catch (e) {
|
|
1925
|
+
t.warn(`Unable to read a graphic frame: ${e?.message ?? e}`, { onceKey: "xlsx.drawing.graphicFrame" });
|
|
1846
1926
|
}
|
|
1847
1927
|
}
|
|
1848
1928
|
return o && (s.content = o), o;
|
|
1849
1929
|
}
|
|
1850
|
-
},
|
|
1930
|
+
}, Dt = Z, Yt = class extends Q {
|
|
1851
1931
|
visit(t, e, s) {
|
|
1852
1932
|
if (!e) return;
|
|
1853
1933
|
const r = super.visit(t, e, s), o = t.evaluate("nvPicPr/cNvPicPr", e);
|
|
@@ -1864,7 +1944,7 @@ var w = class {
|
|
|
1864
1944
|
let n;
|
|
1865
1945
|
if (i) {
|
|
1866
1946
|
let e;
|
|
1867
|
-
if (e = i.getAttribute("r:embed") ?? i.getAttribute("embed"), e || (e = i.getAttribute("r:link") ?? i.getAttribute("link")), !e) return void
|
|
1947
|
+
if (e = i.getAttribute("r:embed") ?? i.getAttribute("embed"), e || (e = i.getAttribute("r:link") ?? i.getAttribute("link")), !e) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" });
|
|
1868
1948
|
n = t.getRef(e, !0);
|
|
1869
1949
|
}
|
|
1870
1950
|
return s.content = {
|
|
@@ -1872,7 +1952,7 @@ var w = class {
|
|
|
1872
1952
|
json: { resId: n }
|
|
1873
1953
|
}, r;
|
|
1874
1954
|
}
|
|
1875
|
-
},
|
|
1955
|
+
}, Mt = class extends Z {
|
|
1876
1956
|
visit(t, e, s) {
|
|
1877
1957
|
if (!e) return;
|
|
1878
1958
|
s = super.visit(t, e, s);
|
|
@@ -1892,7 +1972,7 @@ var w = class {
|
|
|
1892
1972
|
json: o
|
|
1893
1973
|
}, o;
|
|
1894
1974
|
}
|
|
1895
|
-
},
|
|
1975
|
+
}, zt = class extends Z {
|
|
1896
1976
|
visit(t, e, s) {
|
|
1897
1977
|
if (!e) return;
|
|
1898
1978
|
s = super.visit(t, e, s);
|
|
@@ -1905,20 +1985,19 @@ var w = class {
|
|
|
1905
1985
|
Object.keys(t).length > 0 && (s.locks = t);
|
|
1906
1986
|
}
|
|
1907
1987
|
}
|
|
1908
|
-
t.warn(`'${s.name}' is not editable; imported as a fixed drawing.`);
|
|
1909
1988
|
let o = t.evaluate("*/cNvPr", e);
|
|
1910
1989
|
o?.item && (o = o.item(0));
|
|
1911
|
-
const i = o?.getAttribute?.("id"), n = i ? parseInt(i, 10) : void 0,
|
|
1990
|
+
const i = o?.getAttribute?.("id"), n = i ? parseInt(i, 10) : void 0, a = {
|
|
1912
1991
|
type: "cxnSp",
|
|
1913
1992
|
xml: t.serializeElement(e) ?? void 0,
|
|
1914
1993
|
sourceId: void 0 === n || isNaN(n) ? void 0 : n
|
|
1915
1994
|
};
|
|
1916
1995
|
return s.content = {
|
|
1917
1996
|
type: "cxnSp",
|
|
1918
|
-
json:
|
|
1919
|
-
},
|
|
1997
|
+
json: a
|
|
1998
|
+
}, a;
|
|
1920
1999
|
}
|
|
1921
|
-
},
|
|
2000
|
+
}, Ut = class {
|
|
1922
2001
|
visit(t, e, s) {
|
|
1923
2002
|
const r = [], o = /* @__PURE__ */ new Map(), i = {
|
|
1924
2003
|
cells: [],
|
|
@@ -2016,19 +2095,19 @@ var w = class {
|
|
|
2016
2095
|
for (let t = 0; t < r.length; t++) {
|
|
2017
2096
|
const o = r.item(t);
|
|
2018
2097
|
if (1 !== o.nodeType || "rc" !== o.localName) continue;
|
|
2019
|
-
const i = Number(o.getAttribute("t")), n = Number(o.getAttribute("v")),
|
|
2020
|
-
if (!
|
|
2021
|
-
const { _blocks:
|
|
2098
|
+
const i = Number(o.getAttribute("t")), n = Number(o.getAttribute("v")), a = e[i - 1];
|
|
2099
|
+
if (!a) continue;
|
|
2100
|
+
const { _blocks: l, ...c } = a, u = { ...c };
|
|
2022
2101
|
for (const t of Object.keys(u)) void 0 === u[t] && delete u[t];
|
|
2023
|
-
const h =
|
|
2024
|
-
h && (void 0 !== h.fDynamic && (u.fDynamic = h.fDynamic, u.fCollapsed = h.fCollapsed ?? !1), void 0 !== h.richValueIndex && (u.richValueIndex = h.richValueIndex)), s.set(
|
|
2102
|
+
const h = l[n];
|
|
2103
|
+
h && (void 0 !== h.fDynamic && (u.fDynamic = h.fDynamic, u.fCollapsed = h.fCollapsed ?? !1), void 0 !== h.richValueIndex && (u.richValueIndex = h.richValueIndex)), s.set(a.name, u);
|
|
2025
2104
|
}
|
|
2026
2105
|
return s;
|
|
2027
2106
|
}
|
|
2028
|
-
},
|
|
2107
|
+
}, Xt = class {
|
|
2029
2108
|
visit(t, e, s) {
|
|
2030
|
-
let r = t.getVisitorParamsState().get(
|
|
2031
|
-
r || (r = [], t.getVisitorParamsState().set(
|
|
2109
|
+
let r = t.getVisitorParamsState().get(tt);
|
|
2110
|
+
r || (r = [], t.getVisitorParamsState().set(tt, r));
|
|
2032
2111
|
const o = e.childNodes, i = o.length;
|
|
2033
2112
|
for (let e = 0; e < i; e++) {
|
|
2034
2113
|
const s = o.item(e);
|
|
@@ -2052,12 +2131,12 @@ var w = class {
|
|
|
2052
2131
|
}
|
|
2053
2132
|
}
|
|
2054
2133
|
}
|
|
2055
|
-
},
|
|
2134
|
+
}, Wt = class {
|
|
2056
2135
|
visit(t, e, s) {
|
|
2057
2136
|
let r = t.getVisitorParamsState().get("richTypes");
|
|
2058
2137
|
if (!r) return void t.warn("RichValueFound but not type.");
|
|
2059
|
-
let o = t.getVisitorParamsState().get(
|
|
2060
|
-
o || (o = [], t.getVisitorParamsState().set(
|
|
2138
|
+
let o = t.getVisitorParamsState().get(et);
|
|
2139
|
+
o || (o = [], t.getVisitorParamsState().set(et, o));
|
|
2061
2140
|
const i = e.childNodes, n = i.length;
|
|
2062
2141
|
for (let e = 0; e < n; e++) {
|
|
2063
2142
|
const s = i.item(e);
|
|
@@ -2074,7 +2153,7 @@ var w = class {
|
|
|
2074
2153
|
if ("_error" === e.type) {
|
|
2075
2154
|
const t = e.errorType;
|
|
2076
2155
|
if (t) try {
|
|
2077
|
-
e =
|
|
2156
|
+
e = m.getBuiltInByCode(t + 1) ?? m.BuiltIn.Unknown;
|
|
2078
2157
|
} catch (t) {}
|
|
2079
2158
|
}
|
|
2080
2159
|
return e;
|
|
@@ -2088,13 +2167,13 @@ var w = class {
|
|
|
2088
2167
|
if (1 === r.nodeType && "v" === r.localName) {
|
|
2089
2168
|
const o = n[e];
|
|
2090
2169
|
if (!o) return void t.warn("Invalid richData");
|
|
2091
|
-
const i = o[0],
|
|
2092
|
-
let
|
|
2093
|
-
"i" ===
|
|
2170
|
+
const i = o[0], a = o[1];
|
|
2171
|
+
let l = r.textContent;
|
|
2172
|
+
"i" === a && (l = Number(l)), s[i] = l;
|
|
2094
2173
|
}
|
|
2095
2174
|
}
|
|
2096
2175
|
}
|
|
2097
|
-
},
|
|
2176
|
+
}, Gt = class {
|
|
2098
2177
|
visit(t, e, s) {
|
|
2099
2178
|
if (!e) return;
|
|
2100
2179
|
const r = [];
|
|
@@ -2113,114 +2192,136 @@ var w = class {
|
|
|
2113
2192
|
}
|
|
2114
2193
|
}
|
|
2115
2194
|
}
|
|
2116
|
-
},
|
|
2195
|
+
}, Kt = class {
|
|
2117
2196
|
visit(t, e, s) {
|
|
2118
2197
|
if (!e) return;
|
|
2119
|
-
const r =
|
|
2120
|
-
|
|
2121
|
-
const
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2198
|
+
const r = e.getAttribute("ref");
|
|
2199
|
+
if (!r) return;
|
|
2200
|
+
const o = { content: "" };
|
|
2201
|
+
if (e.hasAttribute("authorId")) {
|
|
2202
|
+
const t = parseInt(e.getAttribute("authorId"), 10);
|
|
2203
|
+
isNaN(t) || (o.authorId = t);
|
|
2204
|
+
}
|
|
2205
|
+
return o.content = function(t) {
|
|
2206
|
+
if (!t) return "";
|
|
2207
|
+
const e = [];
|
|
2208
|
+
let s = !0;
|
|
2209
|
+
const r = t.childNodes;
|
|
2210
|
+
for (let t = 0; t < r.length; t++) {
|
|
2211
|
+
const o = r.item(t);
|
|
2212
|
+
if (1 === o.nodeType) {
|
|
2213
|
+
if ("t" === o.localName) e.push({ text: o.textContent ?? "" });
|
|
2214
|
+
else if ("r" === o.localName) {
|
|
2215
|
+
const t = { text: "" }, r = o.childNodes;
|
|
2216
|
+
for (let e = 0; e < r.length; e++) {
|
|
2217
|
+
const s = r.item(e);
|
|
2218
|
+
1 === s.nodeType && ("t" === s.localName ? t.text += s.textContent ?? "" : "rPr" === s.localName && st(s, t));
|
|
2219
|
+
}
|
|
2220
|
+
Object.keys(t).length > 1 && (s = !1), e.push(t);
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
return 0 === e.length ? t.textContent ?? "" : s ? e.map((t) => t.text).join("") : { runs: e };
|
|
2225
|
+
}(t.evaluate("text", e)), s.push({
|
|
2226
|
+
r,
|
|
2227
|
+
v: o
|
|
2228
|
+
}), o;
|
|
2126
2229
|
}
|
|
2127
|
-
},
|
|
2230
|
+
}, $t = class {
|
|
2128
2231
|
visit(t, e, s) {
|
|
2129
2232
|
if (!e) return;
|
|
2130
2233
|
const r = [];
|
|
2131
2234
|
return s.comments = r, r;
|
|
2132
2235
|
}
|
|
2133
|
-
},
|
|
2134
|
-
visit(
|
|
2135
|
-
if (!
|
|
2136
|
-
const
|
|
2137
|
-
|
|
2138
|
-
const
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
visit(t, e, r) {
|
|
2148
|
-
const o = [], i = e.childNodes, n = i.length;
|
|
2236
|
+
}, Ht = class {
|
|
2237
|
+
visit(e, s, r) {
|
|
2238
|
+
if (!s) return;
|
|
2239
|
+
const i = {};
|
|
2240
|
+
e.copyFromAttribute(s, "id", i, "id", o);
|
|
2241
|
+
const n = s.getAttribute("ref");
|
|
2242
|
+
return e.copyFromAttribute(s, "personId", i, "personId", o), e.copyFromAttribute(s, "parentId", i, "parentId", o), e.copyFromAttribute(s, "dT", i, "dt"), s.hasAttribute("done") && (i.done = t(s.getAttribute("done"))), r.push({
|
|
2243
|
+
r: n,
|
|
2244
|
+
v: i
|
|
2245
|
+
}), i;
|
|
2246
|
+
}
|
|
2247
|
+
}, qt = class {
|
|
2248
|
+
visit(t, e, s) {
|
|
2249
|
+
const r = [], i = e.childNodes, n = i.length;
|
|
2149
2250
|
for (let e = 0; e < n; e++) {
|
|
2150
|
-
const
|
|
2151
|
-
if (1 ===
|
|
2251
|
+
const s = i.item(e);
|
|
2252
|
+
if (1 === s.nodeType && "person" === s.localName) {
|
|
2152
2253
|
const e = {};
|
|
2153
|
-
t.copyFromAttribute(
|
|
2254
|
+
t.copyFromAttribute(s, "id", e, "id", o), t.copyFromAttribute(s, "displayName", e), t.copyFromAttribute(s, "userId", e, "userId", o), t.copyFromAttribute(s, "providerId", e), r.push(e);
|
|
2154
2255
|
}
|
|
2155
2256
|
}
|
|
2156
|
-
return
|
|
2257
|
+
return r.length > 0 && (s.persons = r), r;
|
|
2157
2258
|
}
|
|
2158
|
-
},
|
|
2259
|
+
}, Jt = class {
|
|
2159
2260
|
constructor(t, e) {
|
|
2160
2261
|
this.path = t, this.visitor = e;
|
|
2161
2262
|
}
|
|
2162
|
-
},
|
|
2263
|
+
}, Qt = class {
|
|
2163
2264
|
constructor() {
|
|
2164
|
-
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new
|
|
2265
|
+
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new rt()), this.registerVisitor("cp:coreProperties", new ot()), this.registerVisitor("Properties", new it()), this.registerVisitor("spPr", new lt()), this.registerVisitor("txBody", new bt()), this.registerVisitor("txPr", new bt()), this.registerVisitor("c:chartSpace", new nt()), this.registerVisitor("c:plotArea", new at()), this.registerVisitor("c:barChart", new ct()), this.registerVisitor("c:doughnutChart", new ut()), this.registerVisitor("c:lineChart", new ut()), this.registerVisitor("c:ofPieType", new ut()), this.registerVisitor("c:pieChart", new ut()), this.registerVisitor("c:scatterChart", new ut()), this.registerVisitor("c:barChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new pt()), this.registerVisitor("c:dPt", new dt()), this.registerVisitor("c:marker", new gt()), this.registerVisitor("c:catAx", new mt()), this.registerVisitor("c:valAx", new mt()), this.registerVisitor("c:dateAx", new mt()), this.registerVisitor("c:majorGridlines", new M("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new M("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new bt("labels.text"), "txPr"), this.registerVisitor("c:valAx", new bt("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new bt("labels.text"), "txPr"), this.registerVisitor("c:legend", new At()), this.registerVisitor("c:legend", new bt("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new ft()), this.registerVisitor("c:ser", new yt(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new ht("labels"), "dLbls"), this.registerVisitor("c:dLbl", new ht("points")), this.registerVisitor("c:title", new vt()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new Nt()), this.registerVisitor("c:dispUnits", new M("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new vt("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new bt(), "tx/rich"), this.registerVisitor("a:theme", new Ft()), this.registerVisitor("a:theme", new Ct(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new wt(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new Pt(), "themeElements/fmtScheme"), this.registerVisitor("autoFilter", new xt()), this.registerVisitor("sortState", new Tt()), this.registerVisitor("s:workbook", new kt()), this.registerVisitor("styleSheet", new Ot()), this.registerVisitor("x14:table", new It()), this.registerVisitor("table", new Vt()), this.registerVisitor("externalLink", new Lt()), this.registerVisitor("hlinkClick", new St()), this.registerVisitor("wsDr", new Et()), this.registerVisitor("twoCellAnchor", new Rt()), this.registerVisitor("oneCellAnchor", new Rt()), this.registerVisitor("absoluteAnchor", new Rt()), this.registerVisitor("graphicFrame", new jt()), this.registerVisitor("sp", new Dt()), this.registerVisitor("grpSp", new Mt()), this.registerVisitor("cxnSp", new zt()), this.registerVisitor("pic", new Yt()), this.registerVisitor("metadata", new Ut()), this.registerVisitor("rvStructures", new Xt()), this.registerVisitor("rvData", new Wt()), this.registerVisitor("comments", new Gt()), this.registerVisitor("comment", new Kt()), this.registerVisitor("ThreadedComments", new $t()), this.registerVisitor("threadedComment", new Ht()), this.registerVisitor("threadedComment", new bt("content"), "text"), this.registerVisitor("personList", new qt()), this.registerVisitor("slicerCacheDefinition", new _t()), this.registerVisitor("slicers", new Bt());
|
|
2165
2266
|
}
|
|
2166
2267
|
registerVisitor(t, e, s = null) {
|
|
2167
2268
|
-1 === t.indexOf(":") && (t = "*:" + t);
|
|
2168
2269
|
const r = t.split(":"), o = r.length > 1 ? r[1] : r[0];
|
|
2169
2270
|
if (!s) return this.visitorsByXmlTagName.set(o, e), void this.visitorsByXmlTagName.set(t, e);
|
|
2170
2271
|
let i = this.scopedVisitorsByXmlTagName.get(o);
|
|
2171
|
-
i || (i = [], this.scopedVisitorsByXmlTagName.set(o, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new
|
|
2272
|
+
i || (i = [], this.scopedVisitorsByXmlTagName.set(o, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new Jt(s, e));
|
|
2172
2273
|
}
|
|
2173
|
-
parseDxf(t, e = "") {
|
|
2274
|
+
parseDxf(t, e = "", s = d.EmptyObject) {
|
|
2174
2275
|
this.visitorParamsState || (this.visitorParamsState = /* @__PURE__ */ new Map());
|
|
2175
|
-
const
|
|
2176
|
-
|
|
2276
|
+
const r = this.visitorParamsState, o = r.get("processingDXFs");
|
|
2277
|
+
r.set("processingDXFs", !0);
|
|
2177
2278
|
try {
|
|
2178
|
-
const
|
|
2179
|
-
return new
|
|
2279
|
+
const r = new V(null, this, "/dxf", t, {}, e, s), o = {};
|
|
2280
|
+
return new Ot().processDXF(r, t, o), o;
|
|
2180
2281
|
} finally {
|
|
2181
|
-
void 0 ===
|
|
2282
|
+
void 0 === o ? r.delete("processingDXFs") : r.set("processingDXFs", o);
|
|
2182
2283
|
}
|
|
2183
2284
|
}
|
|
2184
2285
|
getVisitorParamsState() {
|
|
2185
2286
|
return this.visitorParamsState;
|
|
2186
2287
|
}
|
|
2187
|
-
transform(t, e, s =
|
|
2288
|
+
transform(t, e, s = d.EmptyObject) {
|
|
2188
2289
|
const r = t.documentElement;
|
|
2189
2290
|
this.visitorParamsState && !s?.paramMap || (this.visitorParamsState = s?.paramMap ?? /* @__PURE__ */ new Map());
|
|
2190
2291
|
const o = {};
|
|
2191
2292
|
let i = this.visitorsByXmlTagName.get(r.nodeName);
|
|
2192
2293
|
if (i || (i = this.visitorsByXmlTagName.get(r.localName)), !i) throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
|
|
2193
|
-
const n = "/" + r.localName,
|
|
2194
|
-
this._doWalk(i,
|
|
2195
|
-
const c =
|
|
2294
|
+
const n = "/" + r.localName, a = new V(null, this, n, r, o, e, s), l = [];
|
|
2295
|
+
this._doWalk(i, a, l, r, o, e, s);
|
|
2296
|
+
const c = l.length;
|
|
2196
2297
|
for (let t = 0; t < c; t++) {
|
|
2197
|
-
const e =
|
|
2298
|
+
const e = l[t];
|
|
2198
2299
|
try {
|
|
2199
2300
|
e.visitor?.afterVisit?.(e.context, e.elemParent, e.jsonParent);
|
|
2200
2301
|
} catch (t) {
|
|
2201
|
-
|
|
2302
|
+
e.context.warn(`Unable to finish reading '${e.context.getPath()}': ${t?.message ?? t}`, { onceKey: "xlsx.transform.afterVisit" });
|
|
2202
2303
|
}
|
|
2203
2304
|
}
|
|
2204
2305
|
return o;
|
|
2205
2306
|
}
|
|
2206
2307
|
_walkScoped(t, e, s, r, o, i, n) {
|
|
2207
|
-
const
|
|
2208
|
-
for (let c = 0; c <
|
|
2209
|
-
const
|
|
2308
|
+
const a = this.scopedVisitorsByXmlTagName.get(t), l = a ? a.length : 0;
|
|
2309
|
+
for (let c = 0; c < l; c++) {
|
|
2310
|
+
const l = a[c];
|
|
2210
2311
|
let u = null;
|
|
2211
2312
|
try {
|
|
2212
|
-
u = e.evaluate(
|
|
2213
|
-
} catch (
|
|
2214
|
-
|
|
2313
|
+
u = e.evaluate(l.path, r);
|
|
2314
|
+
} catch (s) {
|
|
2315
|
+
e.warn(`Invalid path '${l.path}' for '${t}'.`, { onceKey: "xlsx.transform.invalidPath" });
|
|
2215
2316
|
}
|
|
2216
2317
|
if (!u) continue;
|
|
2217
2318
|
const h = (t) => {
|
|
2218
|
-
let
|
|
2219
|
-
for (; c && c !== r;)
|
|
2220
|
-
const u = e.getPath() + "/" +
|
|
2221
|
-
if (
|
|
2222
|
-
const r = new
|
|
2223
|
-
this._doWalk(
|
|
2319
|
+
let a = t.localName, c = t.parentNode;
|
|
2320
|
+
for (; c && c !== r;) a = c.localName + "/" + a, c = c.parentNode;
|
|
2321
|
+
const u = e.getPath() + "/" + a;
|
|
2322
|
+
if (l.visitor) {
|
|
2323
|
+
const r = new V(e, this, u, e.getElemRoot(), e.getJsonRoot(), i, n);
|
|
2324
|
+
this._doWalk(l.visitor, r, s, t, o, i, n);
|
|
2224
2325
|
}
|
|
2225
2326
|
};
|
|
2226
2327
|
if (u.length > 0) {
|
|
@@ -2230,26 +2331,26 @@ var w = class {
|
|
|
2230
2331
|
}
|
|
2231
2332
|
}
|
|
2232
2333
|
_doWalk(t, e, s, r, o, i, n) {
|
|
2233
|
-
let
|
|
2334
|
+
let a = null;
|
|
2234
2335
|
t && (s.push({
|
|
2235
2336
|
visitor: t,
|
|
2236
2337
|
context: e,
|
|
2237
2338
|
elemParent: r,
|
|
2238
2339
|
jsonParent: o
|
|
2239
|
-
}),
|
|
2240
|
-
const
|
|
2241
|
-
this._walkScoped(
|
|
2340
|
+
}), a = t.visit(e, r, o)), a || (a = o);
|
|
2341
|
+
const l = r.localName;
|
|
2342
|
+
this._walkScoped(l, e, s, r, a, i, n);
|
|
2242
2343
|
const c = this.visitorsByXmlTagName, u = e.getElemRoot(), h = e.getJsonRoot(), p = r.childNodes, d = p.length;
|
|
2243
2344
|
for (let t = 0; t < d; t++) {
|
|
2244
2345
|
const r = p.item(t);
|
|
2245
2346
|
if (1 !== r.nodeType) continue;
|
|
2246
|
-
const
|
|
2247
|
-
let d =
|
|
2248
|
-
g || (d =
|
|
2249
|
-
const m = e.getPath() + "/" + d, b = new
|
|
2250
|
-
this._doWalk(g, b, s,
|
|
2347
|
+
const l = r;
|
|
2348
|
+
let d = l.nodeName, g = c.get(d);
|
|
2349
|
+
g || (d = l.localName, g = c.get(d));
|
|
2350
|
+
const m = e.getPath() + "/" + d, b = new V(e, this, m, u, h, i, n);
|
|
2351
|
+
this._doWalk(g, b, s, l, a ?? o, i, n);
|
|
2251
2352
|
}
|
|
2252
|
-
return
|
|
2353
|
+
return a;
|
|
2253
2354
|
}
|
|
2254
2355
|
};
|
|
2255
|
-
export {
|
|
2356
|
+
export { Qt as DOMTransformer, V as ExecutionContext, a as NumberUtils, I as VisitorUtils };
|