@sheetxl/io-xlsx 0.7.28-beta.2 → 0.7.28-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/Bhq8KfEhCnRykWeS.cjs +1 -0
- package/browser/cjs/BmG0GOcbuYvt3-R2.cjs +1 -0
- package/browser/cjs/{jeOqW5knCg5F4v4u.cjs → D3YH3tTndeltJsh5.cjs} +1 -1
- package/browser/cjs/DK9GutW2zPbyNlfU.cjs +2 -0
- package/browser/cjs/Dmi-Tsz618B6vKpZ.cjs +5 -0
- package/browser/cjs/index.cjs +1 -1
- package/browser/esm/{BfG31qdPDPTaVft2.mjs → BXCOn1XvLvYSfpzi.mjs} +2 -2
- package/browser/esm/{kPda7Ul-twVT1FjI.mjs → BcnofzmeeuCVzr_M.mjs} +5 -5
- package/browser/esm/{CWplWy3gsPGbUAtN.mjs → BhohPLTubb_9rfrh.mjs} +2 -2
- package/browser/esm/{CkWprfA-u9b6Wv-6.mjs → BknJ4AeVeFJploh9.mjs} +2 -2
- package/browser/esm/{BfsN3ozwrBghVjdf.mjs → C3sYFBc7Tym8l12A.mjs} +1 -1
- package/browser/esm/{aZgK0aSXvnNeKhcT.mjs → C7R1lFA0iv-1bZ9i.mjs} +2 -2
- package/browser/esm/{5j5FhwFDI6_VA9fj.mjs → CV_L3E5OoPstI9lx.mjs} +260 -242
- package/browser/esm/{DVKFoaA2I9k0LZGi.mjs → D8qZcXzj_fdusd0Y.mjs} +1460 -1387
- package/browser/esm/{we8Sxc3Pjym3t1X3.mjs → DLEtaZiz_1cZH0dA.mjs} +743 -681
- package/browser/esm/{CXm95MW6vwQfZdt2.mjs → DlBlJGlFQJrKovwJ.mjs} +923 -889
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{Bd8VZadoCkiBl21c.mjs → saBnxecsRUpY6fGv.mjs} +1 -1
- package/node/esm/{DJqA5NiUXFqJIhei.mjs → B6lQXVQjFT_OE3IA.mjs} +2 -2
- package/node/esm/{CbGT81jm1I14j0h4.mjs → B9CUp-rqol5K1r1c.mjs} +1 -1
- package/node/esm/{vWgkWZWFCvOLFKn7.mjs → BSrW-J3BEH4Tza_S.mjs} +645 -572
- package/node/esm/{CkuXHY-kBtG7vsTe.mjs → BYCpXFieBgL_cwTO.mjs} +197 -179
- package/node/esm/{C-09SoRaez1R5ECm.mjs → Bqi4c7-14v0oNgFN.mjs} +1 -1
- package/node/esm/{CTasRO0iNMl4L5AI.mjs → CfIzBnObj09fDuUX.mjs} +2 -2
- package/node/esm/{QcGRYN0g5KXsSD2K.mjs → D0frS50CfyeuXcuz.mjs} +741 -677
- package/node/esm/{Bd7xe-v8LNfI_eBw.mjs → DsZ19z4oXoL-d0Lk.mjs} +989 -949
- package/node/esm/index.mjs +5 -5
- package/package.json +3 -3
- package/types/src/AutoFilterRules.d.ts +62 -0
- package/types/src/reader/dom/DOMTransformer.d.ts +10 -0
- package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +1 -1
- package/types/src/reader/sax/SaxVisitor.d.ts +14 -0
- package/types/src/writer/emitters/StylesEmitter.d.ts +13 -2
- package/types/src/writer/utils/AutoFilter.d.ts +3 -2
- package/browser/cjs/5QaWZ2tRVhz1rf3W.cjs +0 -1
- package/browser/cjs/D-8WoJkvdPf-79sB.cjs +0 -2
- package/browser/cjs/Dw2OjBJv3T-RVAoo.cjs +0 -5
- package/browser/cjs/sEmMmxaNBSY_o-Zb.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.7.28-beta.
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.7.28-beta.4
|
|
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 { c as t, d as e, f as s, l as o, p as i, r, s as n, u as a } from "./
|
|
8
|
-
import { A as c,
|
|
9
|
-
import { BufferUtils as
|
|
10
|
-
import { AddressUtils as
|
|
11
|
-
import { BlobReader as
|
|
12
|
-
var
|
|
7
|
+
import { c as t, d as e, f as s, l as o, p as i, r, s as n, u as a } from "./Bqi4c7-14v0oNgFN.mjs";
|
|
8
|
+
import { A as c, B as l, C as h, F as p, I as u, L as d, M as g, N as m, P as f, R as T, S as y, T as x, c as b, d as v, j as w, k as S, m as C, o as k, p as P, r as A, t as E, v as I, x as O, y as D } from "./BSrW-J3BEH4Tza_S.mjs";
|
|
9
|
+
import { BufferUtils as V, CommonUtils as L, ExpectedError as $ } from "@sheetxl/utils";
|
|
10
|
+
import { AddressUtils as j, CommonUtils as N, CoordUtils as R, FormulaError as B, ICondition as M, IConditionalFormat as H, IRange as _, OutOfBoundsError as z, ResourceCollection as X, Theme as F, Tuple as q, Workbook as W } from "@sheetxl/sdk";
|
|
11
|
+
import { BlobReader as U, Uint8ArrayReader as G, Uint8ArrayWriter as Z, ZipReader as J } from "@zip.js/zip.js";
|
|
12
|
+
var Q = /* @__PURE__ */ new Uint8Array(0), K = class t {
|
|
13
13
|
constructor(t, e, s) {
|
|
14
14
|
this.buffers = /* @__PURE__ */ new Map(), this.zip = t, this.entries = e, this.rawBuffer = s;
|
|
15
15
|
}
|
|
@@ -17,7 +17,7 @@ var G = /* @__PURE__ */ new Uint8Array(0), Z = class t {
|
|
|
17
17
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
18
18
|
}
|
|
19
19
|
static async create(e) {
|
|
20
|
-
const s = e instanceof Blob ?
|
|
20
|
+
const s = e instanceof Blob ? Q : e instanceof Uint8Array ? e : new Uint8Array(e), o = new J(e instanceof Blob ? new U(e) : new G(s)), i = /* @__PURE__ */ new Map();
|
|
21
21
|
for (const t of await o.getEntries()) t.directory || i.set(t.filename, t);
|
|
22
22
|
return new t(o, i, s);
|
|
23
23
|
}
|
|
@@ -35,12 +35,12 @@ var G = /* @__PURE__ */ new Uint8Array(0), Z = class t {
|
|
|
35
35
|
if (o) return o;
|
|
36
36
|
const i = this.entries.get(s);
|
|
37
37
|
if (!i) return null;
|
|
38
|
-
const r = await i.getData(new
|
|
38
|
+
const r = await i.getData(new Z());
|
|
39
39
|
return this.buffers.set(s, r), r;
|
|
40
40
|
}
|
|
41
41
|
async prefetch(t) {
|
|
42
42
|
const e = [];
|
|
43
|
-
for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new
|
|
43
|
+
for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new Z()).then((t) => {
|
|
44
44
|
this.buffers.set(s, t);
|
|
45
45
|
}));
|
|
46
46
|
await Promise.all(e);
|
|
@@ -83,18 +83,18 @@ var G = /* @__PURE__ */ new Uint8Array(0), Z = class t {
|
|
|
83
83
|
async close() {
|
|
84
84
|
await this.zip.close();
|
|
85
85
|
}
|
|
86
|
-
},
|
|
86
|
+
}, Y = class {
|
|
87
87
|
constructor(t) {
|
|
88
|
-
this._sink = t, this._samples = [], this._t0 =
|
|
88
|
+
this._sink = t, this._samples = [], this._t0 = tt(), this._tPrev = this._t0, this._heapPrev = et();
|
|
89
89
|
}
|
|
90
90
|
mark(t) {
|
|
91
|
-
const e =
|
|
91
|
+
const e = tt(), s = et(), o = {
|
|
92
92
|
label: t,
|
|
93
93
|
tMs: e - this._t0,
|
|
94
94
|
dtMs: e - this._tPrev,
|
|
95
95
|
heapBytes: s,
|
|
96
96
|
dHeapBytes: void 0 !== s && void 0 !== this._heapPrev ? s - this._heapPrev : void 0,
|
|
97
|
-
rssBytes:
|
|
97
|
+
rssBytes: st()
|
|
98
98
|
};
|
|
99
99
|
this._tPrev = e, this._heapPrev = s, this._samples.push(o), this._sink?.(o);
|
|
100
100
|
}
|
|
@@ -106,91 +106,91 @@ var G = /* @__PURE__ */ new Uint8Array(0), Z = class t {
|
|
|
106
106
|
phase: t.label,
|
|
107
107
|
tMs: Math.round(t.tMs),
|
|
108
108
|
dtMs: Math.round(t.dtMs),
|
|
109
|
-
heapMB: void 0 !== t.heapBytes ?
|
|
110
|
-
dHeapMB: void 0 !== t.dHeapBytes ?
|
|
111
|
-
rssMB: void 0 !== t.rssBytes ?
|
|
109
|
+
heapMB: void 0 !== t.heapBytes ? ot(t.heapBytes / 1048576) : "—",
|
|
110
|
+
dHeapMB: void 0 !== t.dHeapBytes ? ot(t.dHeapBytes / 1048576) : "—",
|
|
111
|
+
rssMB: void 0 !== t.rssBytes ? ot(t.rssBytes / 1048576) : "—"
|
|
112
112
|
}));
|
|
113
113
|
}
|
|
114
|
-
},
|
|
115
|
-
function
|
|
114
|
+
}, tt = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
|
|
115
|
+
function et() {
|
|
116
116
|
const t = "object" == typeof performance ? performance.memory : void 0;
|
|
117
117
|
if (t && "number" == typeof t.usedJSHeapSize) return t.usedJSHeapSize;
|
|
118
118
|
const e = globalThis.process;
|
|
119
119
|
return "object" == typeof e && "function" == typeof e.memoryUsage ? e.memoryUsage().heapUsed : void 0;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function st() {
|
|
122
122
|
const t = globalThis.process;
|
|
123
123
|
if ("object" == typeof t && "function" == typeof t.memoryUsage) return t.memoryUsage().rss;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function ot(t) {
|
|
126
126
|
return Math.round(10 * t) / 10;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
128
|
+
var it = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", rt = `-${it}.0-9·̀-ͯ‿-⁀`, nt = (new RegExp(`^[${it}]$`, "u"), new RegExp(`^[${rt}]$`, "u"), new RegExp(`^[${it}][${rt}]*$`, "u")), at = (new RegExp(`^[${rt}]+$`, "u"), [
|
|
129
129
|
32,
|
|
130
130
|
10,
|
|
131
131
|
13,
|
|
132
132
|
9
|
|
133
133
|
]);
|
|
134
|
-
function
|
|
134
|
+
function ct(t) {
|
|
135
135
|
return t >= 65 && t <= 90 || t >= 97 && t <= 122 || 58 === t || 95 === t || 8204 === t || 8205 === t || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
|
|
136
136
|
}
|
|
137
|
-
var
|
|
138
|
-
new RegExp(`^[${
|
|
139
|
-
var
|
|
140
|
-
function
|
|
137
|
+
var lt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", ht = `-${lt}.0-9·̀-ͯ‿-⁀`;
|
|
138
|
+
new RegExp(`^[${lt}]$`, "u"), new RegExp(`^[${ht}]$`, "u"), new RegExp(`^[${lt}][${ht}]*$`, "u"), new RegExp(`^[${ht}]+$`, "u");
|
|
139
|
+
var pt = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", ut = `-${pt}.0-9·̀-ͯ‿-⁀`, dt = (new RegExp(`^[${pt}]$`, "u"), new RegExp(`^[${ut}]$`, "u"), new RegExp(`^[${pt}][${ut}]*$`, "u"));
|
|
140
|
+
function gt(t) {
|
|
141
141
|
return t >= 65 && t <= 90 || 95 === t || t >= 97 && t <= 122 || t >= 192 && t <= 214 || t >= 216 && t <= 246 || t >= 248 && t <= 767 || t >= 880 && t <= 893 || t >= 895 && t <= 8191 || t >= 8204 && t <= 8205 || t >= 8304 && t <= 8591 || t >= 11264 && t <= 12271 || t >= 12289 && t <= 55295 || t >= 63744 && t <= 64975 || t >= 65008 && t <= 65533 || t >= 65536 && t <= 983039;
|
|
142
142
|
}
|
|
143
|
-
var
|
|
143
|
+
var mt = function(t) {
|
|
144
144
|
return 32 === t || 10 === t || 13 === t || 9 === t;
|
|
145
|
-
},
|
|
145
|
+
}, ft = function(t) {
|
|
146
146
|
return t >= 32 && t <= 55295 || 10 === t || 13 === t || 9 === t || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
147
|
-
},
|
|
148
|
-
return
|
|
149
|
-
},
|
|
147
|
+
}, Tt = ct, yt = function(t) {
|
|
148
|
+
return ct(t) || t >= 48 && t <= 57 || 45 === t || 46 === t || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
|
|
149
|
+
}, xt = at, bt = nt, vt = function(t) {
|
|
150
150
|
return t >= 1 && t <= 55295 || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
151
|
-
},
|
|
152
|
-
return
|
|
153
|
-
},
|
|
151
|
+
}, wt = gt, St = function(t) {
|
|
152
|
+
return gt(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
|
|
153
|
+
}, Ct = dt, kt = "http://www.w3.org/XML/1998/namespace", Pt = "http://www.w3.org/2000/xmlns/", At = {
|
|
154
154
|
__proto__: null,
|
|
155
|
-
xml:
|
|
156
|
-
xmlns:
|
|
157
|
-
},
|
|
155
|
+
xml: kt,
|
|
156
|
+
xmlns: Pt
|
|
157
|
+
}, Et = {
|
|
158
158
|
__proto__: null,
|
|
159
159
|
amp: "&",
|
|
160
160
|
gt: ">",
|
|
161
161
|
lt: "<",
|
|
162
162
|
quot: "\"",
|
|
163
163
|
apos: "'"
|
|
164
|
-
},
|
|
165
|
-
...
|
|
164
|
+
}, It = -1, Ot = -2, Dt = 13, Vt = 33, Lt = 10, $t = 60, jt = 61, Nt = 62, Rt = 63, Bt = 93, Mt = (t) => 34 === t || 39 === t, Ht = [34, 39], _t = [
|
|
165
|
+
...Ht,
|
|
166
166
|
91,
|
|
167
|
-
|
|
168
|
-
],
|
|
169
|
-
...
|
|
170
|
-
Dt,
|
|
171
|
-
jt
|
|
172
|
-
], Ht = [
|
|
173
|
-
Vt,
|
|
167
|
+
Nt
|
|
168
|
+
], zt = [
|
|
169
|
+
...Ht,
|
|
174
170
|
$t,
|
|
175
|
-
|
|
176
|
-
],
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
Bt
|
|
172
|
+
], Xt = [
|
|
173
|
+
jt,
|
|
174
|
+
Rt,
|
|
175
|
+
...xt
|
|
176
|
+
], Ft = [
|
|
177
|
+
...xt,
|
|
178
|
+
Nt,
|
|
179
179
|
38,
|
|
180
|
-
|
|
180
|
+
$t
|
|
181
181
|
];
|
|
182
|
-
function
|
|
182
|
+
function qt(t, e, s) {
|
|
183
183
|
switch (e) {
|
|
184
184
|
case "xml":
|
|
185
|
-
s !==
|
|
185
|
+
s !== kt && t.fail(`xml prefix must be bound to ${kt}.`);
|
|
186
186
|
break;
|
|
187
|
-
case "xmlns": s !==
|
|
187
|
+
case "xmlns": s !== Pt && t.fail(`xmlns prefix must be bound to ${Pt}.`);
|
|
188
188
|
}
|
|
189
189
|
switch (s) {
|
|
190
|
-
case
|
|
191
|
-
t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${
|
|
190
|
+
case Pt:
|
|
191
|
+
t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Pt}.`);
|
|
192
192
|
break;
|
|
193
|
-
case
|
|
193
|
+
case kt: switch (e) {
|
|
194
194
|
case "xml": break;
|
|
195
195
|
case "":
|
|
196
196
|
t.fail(`the default namespace may not be set to ${s}.`);
|
|
@@ -199,7 +199,7 @@ function zt(t, e, s) {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
var
|
|
202
|
+
var Wt, Ut, Gt = (t) => Ct.test(t), Zt = (t) => bt.test(t), Jt = {
|
|
203
203
|
xmldecl: "xmlDeclHandler",
|
|
204
204
|
text: "textHandler",
|
|
205
205
|
processinginstruction: "piHandler",
|
|
@@ -213,7 +213,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
213
213
|
error: "errorHandler",
|
|
214
214
|
end: "endHandler",
|
|
215
215
|
ready: "readyHandler"
|
|
216
|
-
},
|
|
216
|
+
}, Qt = class {
|
|
217
217
|
get closed() {
|
|
218
218
|
return this._closed;
|
|
219
219
|
}
|
|
@@ -221,15 +221,15 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
221
221
|
this.i = 0, this.prevI = 0, this.opt = t ?? {}, this.fragmentOpt = !!this.opt.fragment;
|
|
222
222
|
const e = this.xmlnsOpt = !!this.opt.xmlns;
|
|
223
223
|
if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, e) {
|
|
224
|
-
this.nameStartCheck =
|
|
224
|
+
this.nameStartCheck = wt, this.nameCheck = St, this.isName = Gt, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
|
|
225
225
|
__proto__: null,
|
|
226
|
-
...
|
|
226
|
+
...At
|
|
227
227
|
};
|
|
228
228
|
const t = this.opt.additionalNamespaces;
|
|
229
229
|
null != t && (function(t, e) {
|
|
230
|
-
for (const s of Object.keys(e))
|
|
230
|
+
for (const s of Object.keys(e)) qt(t, s, e[s]);
|
|
231
231
|
}(this, t), Object.assign(this.ns, t));
|
|
232
|
-
} else this.nameStartCheck =
|
|
232
|
+
} else this.nameStartCheck = Tt, this.nameCheck = yt, this.isName = Zt, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
|
|
233
233
|
this.stateTable = [
|
|
234
234
|
this.sBegin,
|
|
235
235
|
this.sBeginWhitespace,
|
|
@@ -281,7 +281,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
281
281
|
_init() {
|
|
282
282
|
this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
|
|
283
283
|
const { fragmentOpt: t } = this;
|
|
284
|
-
this.state = t ?
|
|
284
|
+
this.state = t ? Dt : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
|
|
285
285
|
let { defaultXMLVersion: e } = this.opt;
|
|
286
286
|
if (void 0 === e) {
|
|
287
287
|
if (!0 === this.opt.forceXMLVersion) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
|
|
@@ -291,7 +291,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
291
291
|
version: void 0,
|
|
292
292
|
encoding: void 0,
|
|
293
293
|
standalone: void 0
|
|
294
|
-
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(
|
|
294
|
+
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Et), this.readyHandler?.();
|
|
295
295
|
}
|
|
296
296
|
get position() {
|
|
297
297
|
return this.chunkPosition + this.i;
|
|
@@ -300,10 +300,10 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
300
300
|
return this.position - this.positionAtNewLine;
|
|
301
301
|
}
|
|
302
302
|
on(t, e) {
|
|
303
|
-
this[
|
|
303
|
+
this[Jt[t]] = e;
|
|
304
304
|
}
|
|
305
305
|
off(t) {
|
|
306
|
-
this[
|
|
306
|
+
this[Jt[t]] = void 0;
|
|
307
307
|
}
|
|
308
308
|
makeError(t) {
|
|
309
309
|
let e = this.fileName ?? "";
|
|
@@ -330,13 +330,13 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
330
330
|
}
|
|
331
331
|
getCode10() {
|
|
332
332
|
const t = this.chunk, e = this.i;
|
|
333
|
-
if (this.prevI = e, this.i++, e >= t.length) return
|
|
333
|
+
if (this.prevI = e, this.i++, e >= t.length) return It;
|
|
334
334
|
const s = t.charCodeAt(e);
|
|
335
335
|
if (this.column++, s < 55296) {
|
|
336
336
|
if (s >= 32 || 9 === s) return s;
|
|
337
337
|
switch (s) {
|
|
338
|
-
case
|
|
339
|
-
case 13: return t.charCodeAt(e + 1) ===
|
|
338
|
+
case Lt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Lt;
|
|
339
|
+
case 13: return t.charCodeAt(e + 1) === Lt && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, Ot;
|
|
340
340
|
default: return this.fail("disallowed character."), s;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -346,18 +346,18 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
346
346
|
}
|
|
347
347
|
getCode11() {
|
|
348
348
|
const { chunk: t, i: e } = this;
|
|
349
|
-
if (this.prevI = e, this.i = e + 1, e >= t.length) return
|
|
349
|
+
if (this.prevI = e, this.i = e + 1, e >= t.length) return It;
|
|
350
350
|
const s = t.charCodeAt(e);
|
|
351
351
|
if (this.column++, s < 55296) {
|
|
352
352
|
if (s > 31 && s < 127 || s > 159 && 8232 !== s || 9 === s) return s;
|
|
353
353
|
switch (s) {
|
|
354
|
-
case
|
|
354
|
+
case Lt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Lt;
|
|
355
355
|
case 13: {
|
|
356
356
|
const s = t.charCodeAt(e + 1);
|
|
357
|
-
s !==
|
|
357
|
+
s !== Lt && 133 !== s || (this.i = e + 2);
|
|
358
358
|
}
|
|
359
359
|
case 133:
|
|
360
|
-
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position,
|
|
360
|
+
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Ot;
|
|
361
361
|
default: return this.fail("disallowed character."), s;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
@@ -367,7 +367,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
367
367
|
}
|
|
368
368
|
getCodeNorm() {
|
|
369
369
|
const t = this.getCode();
|
|
370
|
-
return t ===
|
|
370
|
+
return t === Ot ? Lt : t;
|
|
371
371
|
}
|
|
372
372
|
unGet() {
|
|
373
373
|
this.i = this.prevI, this.column--;
|
|
@@ -376,8 +376,8 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
376
376
|
let { i: e } = this;
|
|
377
377
|
const { chunk: s } = this;
|
|
378
378
|
for (;;) {
|
|
379
|
-
const o = this.getCode(), i = o ===
|
|
380
|
-
if (r ===
|
|
379
|
+
const o = this.getCode(), i = o === Ot, r = i ? Lt : o;
|
|
380
|
+
if (r === It || t.includes(r)) return this.text += s.slice(e, this.prevI), r;
|
|
381
381
|
i && (this.text += `${s.slice(e, this.prevI)}\n`, e = this.i);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -387,10 +387,10 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
387
387
|
for (;;) {
|
|
388
388
|
let o = this.getCode();
|
|
389
389
|
switch (o) {
|
|
390
|
-
case
|
|
391
|
-
this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o =
|
|
390
|
+
case Ot:
|
|
391
|
+
this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = Lt;
|
|
392
392
|
break;
|
|
393
|
-
case
|
|
393
|
+
case It: return this.text += s.slice(e), !1;
|
|
394
394
|
}
|
|
395
395
|
if (o === t) return this.text += s.slice(e, this.prevI), !0;
|
|
396
396
|
}
|
|
@@ -399,18 +399,18 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
399
399
|
const { chunk: t, i: e } = this;
|
|
400
400
|
for (;;) {
|
|
401
401
|
const s = this.getCode();
|
|
402
|
-
if (s ===
|
|
403
|
-
if (!
|
|
402
|
+
if (s === It) return this.name += t.slice(e), It;
|
|
403
|
+
if (!yt(s)) return this.name += t.slice(e, this.prevI), s === Ot ? Lt : s;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
skipSpaces() {
|
|
407
407
|
for (;;) {
|
|
408
408
|
const t = this.getCodeNorm();
|
|
409
|
-
if (t ===
|
|
409
|
+
if (t === It || !mt(t)) return t;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
setXMLVersion(t) {
|
|
413
|
-
this.currentXMLVersion = t, "1.0" === t ? (this.isChar =
|
|
413
|
+
this.currentXMLVersion = t, "1.0" === t ? (this.isChar = ft, this.getCode = this.getCode10) : (this.isChar = vt, this.getCode = this.getCode11);
|
|
414
414
|
}
|
|
415
415
|
sBegin() {
|
|
416
416
|
65279 === this.chunk.charCodeAt(0) && (this.i++, this.column++), this.state = 1;
|
|
@@ -418,21 +418,21 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
418
418
|
sBeginWhitespace() {
|
|
419
419
|
const t = this.i, e = this.skipSpaces();
|
|
420
420
|
switch (this.prevI !== t && (this.xmlDeclPossible = !1), e) {
|
|
421
|
-
case
|
|
421
|
+
case $t:
|
|
422
422
|
if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
|
|
423
423
|
break;
|
|
424
|
-
case
|
|
425
|
-
default: this.unGet(), this.state =
|
|
424
|
+
case It: break;
|
|
425
|
+
default: this.unGet(), this.state = Dt, this.xmlDeclPossible = !1;
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
sDoctype() {
|
|
429
|
-
const t = this.captureTo(
|
|
429
|
+
const t = this.captureTo(_t);
|
|
430
430
|
switch (t) {
|
|
431
|
-
case
|
|
432
|
-
this.doctypeHandler?.(this.text), this.text = "", this.state =
|
|
431
|
+
case Nt:
|
|
432
|
+
this.doctypeHandler?.(this.text), this.text = "", this.state = Dt, this.doctype = !0;
|
|
433
433
|
break;
|
|
434
|
-
case
|
|
435
|
-
default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 :
|
|
434
|
+
case It: break;
|
|
435
|
+
default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : Mt(t) && (this.state = 3, this.q = t);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
sDoctypeQuote() {
|
|
@@ -440,8 +440,8 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
440
440
|
this.captureToChar(t) && (this.text += String.fromCodePoint(t), this.q = null, this.state = 2);
|
|
441
441
|
}
|
|
442
442
|
sDTD() {
|
|
443
|
-
const t = this.captureTo(
|
|
444
|
-
t !==
|
|
443
|
+
const t = this.captureTo(zt);
|
|
444
|
+
t !== It && (this.text += String.fromCodePoint(t), t === Bt ? this.state = 2 : t === $t ? this.state = 6 : Mt(t) && (this.state = 5, this.q = t));
|
|
445
445
|
}
|
|
446
446
|
sDTDQuoted() {
|
|
447
447
|
const t = this.q;
|
|
@@ -453,7 +453,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
453
453
|
case 33:
|
|
454
454
|
this.state = 7, this.openWakaBang = "";
|
|
455
455
|
break;
|
|
456
|
-
case
|
|
456
|
+
case Rt:
|
|
457
457
|
this.state = 11;
|
|
458
458
|
break;
|
|
459
459
|
default: this.state = 4;
|
|
@@ -472,14 +472,14 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
472
472
|
}
|
|
473
473
|
sDTDCommentEnded() {
|
|
474
474
|
const t = this.getCodeNorm();
|
|
475
|
-
this.text += String.fromCodePoint(t), t ===
|
|
475
|
+
this.text += String.fromCodePoint(t), t === Nt ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
|
|
476
476
|
}
|
|
477
477
|
sDTDPI() {
|
|
478
|
-
this.captureToChar(
|
|
478
|
+
this.captureToChar(Rt) && (this.text += "?", this.state = 12);
|
|
479
479
|
}
|
|
480
480
|
sDTDPIEnding() {
|
|
481
481
|
const t = this.getCodeNorm();
|
|
482
|
-
this.text += String.fromCodePoint(t), t ===
|
|
482
|
+
this.text += String.fromCodePoint(t), t === Nt && (this.state = 4);
|
|
483
483
|
}
|
|
484
484
|
sText() {
|
|
485
485
|
0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
|
|
@@ -488,23 +488,23 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
488
488
|
let { i: t } = this;
|
|
489
489
|
const { chunk: e } = this;
|
|
490
490
|
t: for (;;) switch (this.getCode()) {
|
|
491
|
-
case
|
|
491
|
+
case Ot:
|
|
492
492
|
this.entity += `${e.slice(t, this.prevI)}\n`, t = this.i;
|
|
493
493
|
break;
|
|
494
494
|
case 59: {
|
|
495
495
|
const { entityReturnState: s } = this, o = this.entity + e.slice(t, this.prevI);
|
|
496
496
|
let i;
|
|
497
|
-
this.state = s, "" === o ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(o), this.entity = ""), s ===
|
|
497
|
+
this.state = s, "" === o ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(o), this.entity = ""), s === Dt && void 0 === this.textHandler || (this.text += i);
|
|
498
498
|
break t;
|
|
499
499
|
}
|
|
500
|
-
case
|
|
500
|
+
case It:
|
|
501
501
|
this.entity += e.slice(t);
|
|
502
502
|
break t;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
sOpenWaka() {
|
|
506
506
|
const t = this.getCode();
|
|
507
|
-
if (
|
|
507
|
+
if (Tt(t)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
|
|
508
508
|
else switch (t) {
|
|
509
509
|
case 47:
|
|
510
510
|
this.state = 43, this.xmlDeclPossible = !1;
|
|
@@ -512,10 +512,10 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
512
512
|
case 33:
|
|
513
513
|
this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
|
|
514
514
|
break;
|
|
515
|
-
case
|
|
515
|
+
case Rt:
|
|
516
516
|
this.state = 23;
|
|
517
517
|
break;
|
|
518
|
-
default: this.fail("disallowed character in tag name"), this.state =
|
|
518
|
+
default: this.fail("disallowed character in tag name"), this.state = Dt, this.xmlDeclPossible = !1;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
sOpenWakaBang() {
|
|
@@ -541,22 +541,22 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
541
541
|
}
|
|
542
542
|
sCommentEnded() {
|
|
543
543
|
const t = this.getCodeNorm();
|
|
544
|
-
t !==
|
|
544
|
+
t !== Nt ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = Dt;
|
|
545
545
|
}
|
|
546
546
|
sCData() {
|
|
547
|
-
this.captureToChar(
|
|
547
|
+
this.captureToChar(Bt) && (this.state = 21);
|
|
548
548
|
}
|
|
549
549
|
sCDataEnding() {
|
|
550
550
|
const t = this.getCodeNorm();
|
|
551
|
-
t ===
|
|
551
|
+
t === Bt ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
|
|
552
552
|
}
|
|
553
553
|
sCDataEnding2() {
|
|
554
554
|
const t = this.getCodeNorm();
|
|
555
555
|
switch (t) {
|
|
556
|
-
case
|
|
557
|
-
this.cdataHandler?.(this.text), this.text = "", this.state =
|
|
556
|
+
case Nt:
|
|
557
|
+
this.cdataHandler?.(this.text), this.text = "", this.state = Dt;
|
|
558
558
|
break;
|
|
559
|
-
case
|
|
559
|
+
case Bt:
|
|
560
560
|
this.text += "]";
|
|
561
561
|
break;
|
|
562
562
|
default: this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
|
|
@@ -564,17 +564,17 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
564
564
|
}
|
|
565
565
|
sPIFirstChar() {
|
|
566
566
|
const t = this.getCodeNorm();
|
|
567
|
-
this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t ===
|
|
567
|
+
this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === Rt || mt(t) ? (this.fail("processing instruction without a target."), this.state = t === Rt ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t), this.state = 24);
|
|
568
568
|
}
|
|
569
569
|
sPIRest() {
|
|
570
570
|
const { chunk: t, i: e } = this;
|
|
571
571
|
for (;;) {
|
|
572
572
|
const s = this.getCodeNorm();
|
|
573
|
-
if (s ===
|
|
573
|
+
if (s === It) return void (this.piTarget += t.slice(e));
|
|
574
574
|
if (!this.nameCheck(s)) {
|
|
575
575
|
this.piTarget += t.slice(e, this.prevI);
|
|
576
|
-
const o = s ===
|
|
577
|
-
o ||
|
|
576
|
+
const o = s === Rt;
|
|
577
|
+
o || mt(s) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = o ? Vt : 27) : this.state = o ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s));
|
|
578
578
|
break;
|
|
579
579
|
}
|
|
580
580
|
}
|
|
@@ -582,28 +582,28 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
582
582
|
sPIBody() {
|
|
583
583
|
if (0 === this.text.length) {
|
|
584
584
|
const t = this.getCodeNorm();
|
|
585
|
-
t ===
|
|
586
|
-
} else this.captureToChar(
|
|
585
|
+
t === Rt ? this.state = 26 : mt(t) || (this.text = String.fromCodePoint(t));
|
|
586
|
+
} else this.captureToChar(Rt) && (this.state = 26);
|
|
587
587
|
}
|
|
588
588
|
sPIEnding() {
|
|
589
589
|
const t = this.getCodeNorm();
|
|
590
|
-
if (t ===
|
|
590
|
+
if (t === Nt) {
|
|
591
591
|
const { piTarget: t } = this;
|
|
592
592
|
"xml" === t.toLowerCase() && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
|
|
593
593
|
target: t,
|
|
594
594
|
body: this.text
|
|
595
|
-
}), this.piTarget = this.text = "", this.state =
|
|
596
|
-
} else t ===
|
|
595
|
+
}), this.piTarget = this.text = "", this.state = Dt;
|
|
596
|
+
} else t === Rt ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
|
|
597
597
|
this.xmlDeclPossible = !1;
|
|
598
598
|
}
|
|
599
599
|
sXMLDeclNameStart() {
|
|
600
600
|
const t = this.skipSpaces();
|
|
601
|
-
t !==
|
|
601
|
+
t !== Rt ? t !== It && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Vt;
|
|
602
602
|
}
|
|
603
603
|
sXMLDeclName() {
|
|
604
|
-
const t = this.captureTo(
|
|
605
|
-
if (t ===
|
|
606
|
-
if (
|
|
604
|
+
const t = this.captureTo(Xt);
|
|
605
|
+
if (t === Rt) return this.state = Vt, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
606
|
+
if (mt(t) || t === jt) {
|
|
607
607
|
if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
|
|
608
608
|
case 0:
|
|
609
609
|
this.fail("did not expect any more name/value pairs.");
|
|
@@ -613,23 +613,23 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
613
613
|
break;
|
|
614
614
|
default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
|
|
615
615
|
}
|
|
616
|
-
this.state = t ===
|
|
616
|
+
this.state = t === jt ? 30 : 29;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
sXMLDeclEq() {
|
|
620
620
|
const t = this.getCodeNorm();
|
|
621
|
-
if (t ===
|
|
622
|
-
|
|
621
|
+
if (t === Rt) return this.state = Vt, void this.fail("XML declaration is incomplete.");
|
|
622
|
+
mt(t) || (t !== jt && this.fail("value required."), this.state = 30);
|
|
623
623
|
}
|
|
624
624
|
sXMLDeclValueStart() {
|
|
625
625
|
const t = this.getCodeNorm();
|
|
626
|
-
if (t ===
|
|
627
|
-
|
|
626
|
+
if (t === Rt) return this.state = Vt, void this.fail("XML declaration is incomplete.");
|
|
627
|
+
mt(t) || (Mt(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
|
|
628
628
|
}
|
|
629
629
|
sXMLDeclValue() {
|
|
630
|
-
const t = this.captureTo([this.q,
|
|
631
|
-
if (t ===
|
|
632
|
-
if (t ===
|
|
630
|
+
const t = this.captureTo([this.q, Rt]);
|
|
631
|
+
if (t === Rt) return this.state = Vt, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
632
|
+
if (t === It) return;
|
|
633
633
|
const e = this.text;
|
|
634
634
|
switch (this.text = "", this.name) {
|
|
635
635
|
case "version": {
|
|
@@ -647,52 +647,52 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
647
647
|
}
|
|
648
648
|
sXMLDeclSeparator() {
|
|
649
649
|
const t = this.getCodeNorm();
|
|
650
|
-
t !==
|
|
650
|
+
t !== Rt ? (mt(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = Vt;
|
|
651
651
|
}
|
|
652
652
|
sXMLDeclEnding() {
|
|
653
|
-
this.getCodeNorm() ===
|
|
653
|
+
this.getCodeNorm() === Nt ? ("xml" !== this.piTarget ? this.fail("processing instructions are not allowed before root.") : "version" !== this.name && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = Dt) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
|
|
654
654
|
}
|
|
655
655
|
sOpenTag() {
|
|
656
656
|
const t = this.captureNameChars();
|
|
657
|
-
if (t ===
|
|
657
|
+
if (t === It) return;
|
|
658
658
|
const e = this.tag = {
|
|
659
659
|
name: this.name,
|
|
660
660
|
attributes: Object.create(null)
|
|
661
661
|
};
|
|
662
662
|
switch (this.name = "", this.xmlnsOpt && (this.topNS = e.ns = Object.create(null)), this.openTagStartHandler?.(e), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t) {
|
|
663
|
-
case
|
|
663
|
+
case Nt:
|
|
664
664
|
this.openTag();
|
|
665
665
|
break;
|
|
666
666
|
case 47:
|
|
667
667
|
this.state = 35;
|
|
668
668
|
break;
|
|
669
|
-
default:
|
|
669
|
+
default: mt(t) || this.fail("disallowed character in tag name."), this.state = 36;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
sOpenTagSlash() {
|
|
673
|
-
this.getCode() ===
|
|
673
|
+
this.getCode() === Nt ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
|
|
674
674
|
}
|
|
675
675
|
sAttrib() {
|
|
676
676
|
const t = this.skipSpaces();
|
|
677
|
-
t !==
|
|
677
|
+
t !== It && (Tt(t) ? (this.unGet(), this.state = 37) : t === Nt ? this.openTag() : 47 === t ? this.state = 35 : this.fail("disallowed character in attribute name."));
|
|
678
678
|
}
|
|
679
679
|
sAttribName() {
|
|
680
680
|
const t = this.captureNameChars();
|
|
681
|
-
t ===
|
|
681
|
+
t === jt ? this.state = 39 : mt(t) ? this.state = 38 : t === Nt ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== It && this.fail("disallowed character in attribute name.");
|
|
682
682
|
}
|
|
683
683
|
sAttribNameSawWhite() {
|
|
684
684
|
const t = this.skipSpaces();
|
|
685
685
|
switch (t) {
|
|
686
|
-
case
|
|
687
|
-
case
|
|
686
|
+
case It: return;
|
|
687
|
+
case jt:
|
|
688
688
|
this.state = 39;
|
|
689
689
|
break;
|
|
690
|
-
default: this.fail("attribute without value."), this.text = "", this.name = "", t ===
|
|
690
|
+
default: this.fail("attribute without value."), this.text = "", this.name = "", t === Nt ? this.openTag() : Tt(t) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
sAttribValue() {
|
|
694
694
|
const t = this.getCodeNorm();
|
|
695
|
-
|
|
695
|
+
Mt(t) ? (this.q = t, this.state = 40) : mt(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
|
|
696
696
|
}
|
|
697
697
|
sAttribValueQuoted() {
|
|
698
698
|
const { q: t, chunk: e } = this;
|
|
@@ -704,46 +704,46 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
704
704
|
case 38:
|
|
705
705
|
this.text += e.slice(s, this.prevI), this.state = 14, this.entityReturnState = 40;
|
|
706
706
|
return;
|
|
707
|
-
case
|
|
708
|
-
case
|
|
707
|
+
case Lt:
|
|
708
|
+
case Ot:
|
|
709
709
|
case 9:
|
|
710
710
|
this.text += `${e.slice(s, this.prevI)} `, s = this.i;
|
|
711
711
|
break;
|
|
712
|
-
case
|
|
712
|
+
case $t:
|
|
713
713
|
this.text += e.slice(s, this.prevI), this.fail("disallowed character.");
|
|
714
714
|
return;
|
|
715
|
-
case
|
|
715
|
+
case It:
|
|
716
716
|
this.text += e.slice(s);
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
sAttribValueClosed() {
|
|
721
721
|
const t = this.getCodeNorm();
|
|
722
|
-
|
|
722
|
+
mt(t) ? this.state = 36 : t === Nt ? this.openTag() : 47 === t ? this.state = 35 : Tt(t) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
|
|
723
723
|
}
|
|
724
724
|
sAttribValueUnquoted() {
|
|
725
|
-
const t = this.captureTo(
|
|
725
|
+
const t = this.captureTo(Ft);
|
|
726
726
|
switch (t) {
|
|
727
727
|
case 38:
|
|
728
728
|
this.state = 14, this.entityReturnState = 42;
|
|
729
729
|
break;
|
|
730
|
-
case
|
|
730
|
+
case $t:
|
|
731
731
|
this.fail("disallowed character.");
|
|
732
732
|
break;
|
|
733
|
-
case
|
|
734
|
-
default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", t ===
|
|
733
|
+
case It: break;
|
|
734
|
+
default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", t === Nt ? this.openTag() : this.state = 36;
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
737
|
sCloseTag() {
|
|
738
738
|
const t = this.captureNameChars();
|
|
739
|
-
t ===
|
|
739
|
+
t === Nt ? this.closeTag() : mt(t) ? this.state = 44 : t !== It && this.fail("disallowed character in closing tag.");
|
|
740
740
|
}
|
|
741
741
|
sCloseTagSawWhite() {
|
|
742
742
|
switch (this.skipSpaces()) {
|
|
743
|
-
case
|
|
743
|
+
case Nt:
|
|
744
744
|
this.closeTag();
|
|
745
745
|
break;
|
|
746
|
-
case
|
|
746
|
+
case It: break;
|
|
747
747
|
default: this.fail("disallowed character in closing tag.");
|
|
748
748
|
}
|
|
749
749
|
}
|
|
@@ -751,7 +751,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
751
751
|
let { i: t, forbiddenState: e } = this;
|
|
752
752
|
const { chunk: s, textHandler: o } = this;
|
|
753
753
|
t: for (;;) switch (this.getCode()) {
|
|
754
|
-
case
|
|
754
|
+
case $t:
|
|
755
755
|
if (this.state = 15, void 0 !== o) {
|
|
756
756
|
const { text: e } = this, i = s.slice(t, this.prevI);
|
|
757
757
|
0 !== e.length ? (o(e + i), this.text = "") : 0 !== i.length && o(i);
|
|
@@ -759,9 +759,9 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
759
759
|
e = 0;
|
|
760
760
|
break t;
|
|
761
761
|
case 38:
|
|
762
|
-
this.state = 14, this.entityReturnState =
|
|
762
|
+
this.state = 14, this.entityReturnState = Dt, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
|
|
763
763
|
break t;
|
|
764
|
-
case
|
|
764
|
+
case Bt:
|
|
765
765
|
switch (e) {
|
|
766
766
|
case 0:
|
|
767
767
|
e = 1;
|
|
@@ -773,13 +773,13 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
773
773
|
default: throw new Error("impossible state");
|
|
774
774
|
}
|
|
775
775
|
break;
|
|
776
|
-
case
|
|
776
|
+
case Nt:
|
|
777
777
|
2 === e && this.fail("the string \"]]>\" is disallowed in char data."), e = 0;
|
|
778
778
|
break;
|
|
779
|
-
case
|
|
779
|
+
case Ot:
|
|
780
780
|
void 0 !== o && (this.text += `${s.slice(t, this.prevI)}\n`), t = this.i, e = 0;
|
|
781
781
|
break;
|
|
782
|
-
case
|
|
782
|
+
case It:
|
|
783
783
|
void 0 !== o && (this.text += s.slice(t));
|
|
784
784
|
break t;
|
|
785
785
|
default: e = 0;
|
|
@@ -793,22 +793,22 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
793
793
|
t: for (;;) {
|
|
794
794
|
const i = this.getCode();
|
|
795
795
|
switch (i) {
|
|
796
|
-
case
|
|
796
|
+
case $t:
|
|
797
797
|
if (this.state = 15, void 0 !== s) {
|
|
798
798
|
const { text: o } = this, i = e.slice(t, this.prevI);
|
|
799
799
|
0 !== o.length ? (s(o + i), this.text = "") : 0 !== i.length && s(i);
|
|
800
800
|
}
|
|
801
801
|
break t;
|
|
802
802
|
case 38:
|
|
803
|
-
this.state = 14, this.entityReturnState =
|
|
803
|
+
this.state = 14, this.entityReturnState = Dt, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
|
|
804
804
|
break t;
|
|
805
|
-
case
|
|
805
|
+
case Ot:
|
|
806
806
|
void 0 !== s && (this.text += `${e.slice(t, this.prevI)}\n`), t = this.i;
|
|
807
807
|
break;
|
|
808
|
-
case
|
|
808
|
+
case It:
|
|
809
809
|
void 0 !== s && (this.text += e.slice(t));
|
|
810
810
|
break t;
|
|
811
|
-
default:
|
|
811
|
+
default: mt(i) || (o = !0);
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
o && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
|
|
@@ -822,10 +822,10 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
822
822
|
};
|
|
823
823
|
if (this.attribList.push(i), this.attributeHandler?.(i), "xmlns" === s) {
|
|
824
824
|
const t = e.trim();
|
|
825
|
-
"1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[o] = t,
|
|
825
|
+
"1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[o] = t, qt(this, o, t);
|
|
826
826
|
} else if ("xmlns" === t) {
|
|
827
827
|
const t = e.trim();
|
|
828
|
-
this.topNS[""] = t,
|
|
828
|
+
this.topNS[""] = t, qt(this, "", t);
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
831
|
pushAttribPlain(t, e) {
|
|
@@ -842,7 +842,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
842
842
|
const e = t.pop();
|
|
843
843
|
this.fail(`unclosed tag: ${e.name}`);
|
|
844
844
|
}
|
|
845
|
-
0 !== this.state && this.state !==
|
|
845
|
+
0 !== this.state && this.state !== Dt && this.fail("unexpected end.");
|
|
846
846
|
const { text: e } = this;
|
|
847
847
|
return 0 !== e.length && (this.textHandler?.(e), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
|
|
848
848
|
}
|
|
@@ -878,7 +878,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
878
878
|
for (const e of t) {
|
|
879
879
|
const { name: t, prefix: i, local: r } = e;
|
|
880
880
|
let n, a;
|
|
881
|
-
"" === i ? (n = "xmlns" === t ?
|
|
881
|
+
"" === i ? (n = "xmlns" === t ? Pt : "", a = t) : (n = this.resolve(i), void 0 === n && (this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`), n = i), a = `{${n}}${r}`), o.has(a) && this.fail(`duplicate attribute: ${a}.`), o.add(a), e.uri = n, s[t] = e;
|
|
882
882
|
}
|
|
883
883
|
this.attribList = [];
|
|
884
884
|
}
|
|
@@ -890,16 +890,16 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
890
890
|
openTag() {
|
|
891
891
|
this.processAttribs();
|
|
892
892
|
const { tags: t } = this, e = this.tag;
|
|
893
|
-
e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state =
|
|
893
|
+
e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = Dt, this.name = "";
|
|
894
894
|
}
|
|
895
895
|
openSelfClosingTag() {
|
|
896
896
|
this.processAttribs();
|
|
897
897
|
const { tags: t } = this, e = this.tag;
|
|
898
|
-
e.isSelfClosing = !0, this.openTagHandler?.(e), this.closeTagHandler?.(e), null === (this.tag = t[t.length - 1] ?? null) && (this.closedRoot = !0), this.state =
|
|
898
|
+
e.isSelfClosing = !0, this.openTagHandler?.(e), this.closeTagHandler?.(e), null === (this.tag = t[t.length - 1] ?? null) && (this.closedRoot = !0), this.state = Dt, this.name = "";
|
|
899
899
|
}
|
|
900
900
|
closeTag() {
|
|
901
901
|
const { tags: t, name: e } = this;
|
|
902
|
-
if (this.state =
|
|
902
|
+
if (this.state = Dt, this.name = "", "" === e) return this.fail("weird empty close tag."), void (this.text += "</>");
|
|
903
903
|
const s = this.closeTagHandler;
|
|
904
904
|
let o = t.length;
|
|
905
905
|
for (; o-- > 0;) {
|
|
@@ -918,7 +918,7 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
918
918
|
return "x" === t[1] && /^#x[0-9a-f]+$/i.test(t) ? e = parseInt(t.slice(2), 16) : /^#[0-9]+$/.test(t) && (e = parseInt(t.slice(1), 10)), this.isChar(e) ? String.fromCodePoint(e) : (this.fail("malformed character entity."), `&${t};`);
|
|
919
919
|
}
|
|
920
920
|
};
|
|
921
|
-
(
|
|
921
|
+
(Ut = Wt || (Wt = {})).Events = {
|
|
922
922
|
XmlDecl: "xmldecl",
|
|
923
923
|
Text: "text",
|
|
924
924
|
ProcessingInstruction: "processinginstruction",
|
|
@@ -932,19 +932,19 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
932
932
|
Error: "error",
|
|
933
933
|
End: "end",
|
|
934
934
|
Ready: "ready"
|
|
935
|
-
},
|
|
936
|
-
const o = new
|
|
935
|
+
}, Ut.parseStream = async (t, e, s) => {
|
|
936
|
+
const o = new Qt({
|
|
937
937
|
position: !1,
|
|
938
938
|
...s
|
|
939
939
|
});
|
|
940
940
|
let i;
|
|
941
|
-
e.onOpenTagStart && o.on(
|
|
941
|
+
e.onOpenTagStart && o.on(Wt.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && o.on(Wt.Events.OpenTag, e.onOpenTag), e.onCloseTag && o.on(Wt.Events.CloseTag, e.onCloseTag), e.onAttribute && o.on(Wt.Events.Attribute, e.onAttribute), e.onText && o.on(Wt.Events.Text, e.onText), e.onError && o.on(Wt.Events.Error, e.onError);
|
|
942
942
|
const r = e.onEnd;
|
|
943
943
|
if (r) {
|
|
944
944
|
const t = () => {
|
|
945
945
|
i = r();
|
|
946
946
|
};
|
|
947
|
-
o.on(
|
|
947
|
+
o.on(Wt.Events.End, t);
|
|
948
948
|
}
|
|
949
949
|
for (;;) {
|
|
950
950
|
const { value: e, done: s } = await t.read();
|
|
@@ -953,13 +953,13 @@ var Xt, Ft, qt = (t) => vt.test(t), Wt = (t) => Tt.test(t), Ut = {
|
|
|
953
953
|
}
|
|
954
954
|
return o.close(), i;
|
|
955
955
|
};
|
|
956
|
-
var
|
|
956
|
+
var Kt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, Yt = (t) => {
|
|
957
957
|
const e = parseInt(t);
|
|
958
958
|
return isNaN(e) ? null : e;
|
|
959
|
-
},
|
|
959
|
+
}, te = (t) => {
|
|
960
960
|
const e = parseFloat(t);
|
|
961
961
|
return isNaN(e) ? null : e;
|
|
962
|
-
},
|
|
962
|
+
}, ee = null, se = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), oe = (t) => se(t).replace(/"/g, """), ie = class {
|
|
963
963
|
constructor() {
|
|
964
964
|
this._registeredVisitors = /* @__PURE__ */ new Map();
|
|
965
965
|
}
|
|
@@ -974,8 +974,8 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
974
974
|
source: t,
|
|
975
975
|
parent: null
|
|
976
976
|
};
|
|
977
|
-
let u = null, d = !1;
|
|
978
|
-
const
|
|
977
|
+
let u = null, d = !1, g = null, m = null, f = null;
|
|
978
|
+
const T = (t, e) => {
|
|
979
979
|
let s = c.attributes[t];
|
|
980
980
|
if (e) if (Array.isArray(e)) {
|
|
981
981
|
const t = e.length;
|
|
@@ -988,7 +988,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
988
988
|
if (s = e(s), null == s) return;
|
|
989
989
|
}
|
|
990
990
|
return s;
|
|
991
|
-
},
|
|
991
|
+
}, y = {
|
|
992
992
|
getSource: () => u?.source ?? null,
|
|
993
993
|
setSource: (t) => {
|
|
994
994
|
u.source = t;
|
|
@@ -997,8 +997,8 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
997
997
|
u.key = t;
|
|
998
998
|
},
|
|
999
999
|
getFrom: () => c,
|
|
1000
|
-
getAttribute: (t, e) =>
|
|
1001
|
-
hasAttribute: (t) => null !==
|
|
1000
|
+
getAttribute: (t, e) => T(t, e) ?? null,
|
|
1001
|
+
hasAttribute: (t) => null !== y.getAttribute(t),
|
|
1002
1002
|
getParent: () => {
|
|
1003
1003
|
const t = h[h.length - 2];
|
|
1004
1004
|
return t.parent ?? t.source;
|
|
@@ -1008,13 +1008,14 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1008
1008
|
for (let s = 0; s < e; s++) t.push(r[s].local);
|
|
1009
1009
|
return t.join("\\");
|
|
1010
1010
|
},
|
|
1011
|
-
parseAttribute:
|
|
1011
|
+
parseAttribute: T,
|
|
1012
|
+
getRawXml: () => f,
|
|
1012
1013
|
copyToObject: (t, e, s, o) => {
|
|
1013
|
-
const i =
|
|
1014
|
+
const i = T(o ?? e, s);
|
|
1014
1015
|
void 0 !== i && (t[e] = i);
|
|
1015
1016
|
},
|
|
1016
1017
|
copyTo: (t, e, s) => {
|
|
1017
|
-
const o =
|
|
1018
|
+
const o = T(s ?? t, e);
|
|
1018
1019
|
void 0 !== o && (u.source[t] = o);
|
|
1019
1020
|
},
|
|
1020
1021
|
warn: (t) => {
|
|
@@ -1025,50 +1026,67 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1025
1026
|
onOpenTag: (t) => {
|
|
1026
1027
|
let e = t.name;
|
|
1027
1028
|
const s = e.indexOf(":");
|
|
1028
|
-
-1 !== s && (e = e.slice(s + 1))
|
|
1029
|
-
|
|
1029
|
+
if (-1 !== s && (e = e.slice(s + 1)), g) return g.push(((t) => {
|
|
1030
|
+
const e = t.attributes ?? {};
|
|
1031
|
+
let s = `<${t.name}`;
|
|
1032
|
+
for (const t in e) {
|
|
1033
|
+
const o = e[t];
|
|
1034
|
+
s += ` ${t}="${oe("string" == typeof o ? o : o?.value ?? "")}"`;
|
|
1035
|
+
}
|
|
1036
|
+
return s + ">";
|
|
1037
|
+
})(t)), n = {
|
|
1038
|
+
local: e,
|
|
1039
|
+
tag: t,
|
|
1040
|
+
destination: null
|
|
1041
|
+
}, r.push(n), a = e, void (c = t);
|
|
1042
|
+
const f = (i.length > 0 ? i[i.length - 1] : o).get(e);
|
|
1030
1043
|
if (n = {
|
|
1031
1044
|
local: e,
|
|
1032
|
-
visitor:
|
|
1045
|
+
visitor: f,
|
|
1033
1046
|
tag: t,
|
|
1034
1047
|
destination: null
|
|
1035
1048
|
}, d) return r.push(n), a = e, void (c = t);
|
|
1036
1049
|
l = n?.visitor ?? null, a = e, c = t;
|
|
1037
|
-
let
|
|
1038
|
-
if (
|
|
1039
|
-
const t =
|
|
1040
|
-
null === t ?
|
|
1050
|
+
let T = !!f && null === f.to;
|
|
1051
|
+
if (f && !T && f.scope) {
|
|
1052
|
+
const t = f.scope(y);
|
|
1053
|
+
null === t ? T = !0 : t && (i.push(t), n.pushedScope = !0);
|
|
1041
1054
|
}
|
|
1042
|
-
|
|
1055
|
+
f && (0 === r.length ? (u = p, n.destination = u, n.pushedDestination = !0, h.push(u)) : T ? (u = null, n.destination = null) : f.transparent ? n.destination = u : (u = {
|
|
1043
1056
|
key: null,
|
|
1044
1057
|
source: {},
|
|
1045
1058
|
parent: null
|
|
1046
|
-
}, n.destination = u, n.pushedDestination = !0, h.push(u))), r.push(n), d =
|
|
1047
|
-
const
|
|
1048
|
-
void 0 !==
|
|
1059
|
+
}, n.destination = u, n.pushedDestination = !0, h.push(u))), r.push(n), d = T;
|
|
1060
|
+
const x = l?.openTag?.(y);
|
|
1061
|
+
void 0 !== x && (u.parent = x), f?.raw && !T && (g = [], m = n);
|
|
1049
1062
|
},
|
|
1050
1063
|
onCloseTag: (t) => {
|
|
1051
1064
|
let e = t.name;
|
|
1052
1065
|
const o = e.indexOf(":");
|
|
1053
1066
|
if (-1 !== o && (e = e.slice(o + 1)), e !== a) throw new Error(`mismatch open/close tag: '${e}'/'${a}'`);
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1067
|
+
let T = !1;
|
|
1068
|
+
if (g) {
|
|
1069
|
+
if (r[r.length - 1] !== m) return g.push(`</${t.name}>`), r.pop(), n = r[r.length - 1] ?? null, a = n?.local ?? null, void (c = n?.tag ?? null);
|
|
1070
|
+
f = g.join(""), g = null, m = null, T = !0;
|
|
1071
|
+
}
|
|
1072
|
+
d || l?.closeTag?.(y), T && (f = null);
|
|
1073
|
+
const x = r.pop() ?? null;
|
|
1074
|
+
n = r[r.length - 1] ?? null, x?.pushedScope && i.pop();
|
|
1075
|
+
const b = x?.destination;
|
|
1076
|
+
if (b && x.pushedDestination) {
|
|
1059
1077
|
h.pop(), u = h[h.length - 1] ?? p;
|
|
1060
|
-
const t =
|
|
1061
|
-
t && t.to && void 0 !==
|
|
1078
|
+
const t = x.visitor;
|
|
1079
|
+
t && t.to && void 0 !== b.source && (Array.isArray(t.to) ? u.source.push ? u.source.push(b.source) : s?.(`Unable to parse array for ${t.from} at ${y.getPath()}`) : b.key ? u.source[b.key] = b.source : "string" == typeof t.to && (u.source[t.to] = b.source));
|
|
1062
1080
|
}
|
|
1063
1081
|
a = n?.local ?? null, c = n?.tag ?? null, l = n?.visitor ?? null, d = !n?.destination;
|
|
1064
1082
|
},
|
|
1065
1083
|
onText: (t) => {
|
|
1066
|
-
l?.text?.(t,
|
|
1084
|
+
g ? g.push(se(t)) : l?.text?.(t, y);
|
|
1067
1085
|
},
|
|
1068
1086
|
onEnd: e
|
|
1069
1087
|
};
|
|
1070
1088
|
}
|
|
1071
|
-
},
|
|
1089
|
+
}, re = `IFERROR(${C}(`, ne = re.toUpperCase(), ae = P.toUpperCase(), ce = { kind: "none" }, le = { kind: "spilled" }, he = (t, e) => {
|
|
1072
1090
|
if (34 !== t.charCodeAt(e)) return null;
|
|
1073
1091
|
let s = "", o = e + 1;
|
|
1074
1092
|
for (; o < t.length;) if (34 === t.charCodeAt(o)) {
|
|
@@ -1079,13 +1097,13 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1079
1097
|
s += "\"", o += 2;
|
|
1080
1098
|
} else s += t[o], o++;
|
|
1081
1099
|
return null;
|
|
1082
|
-
},
|
|
1100
|
+
}, pe = (t) => {
|
|
1083
1101
|
const e = [];
|
|
1084
1102
|
let s = 0;
|
|
1085
1103
|
for (; s < t.length;) {
|
|
1086
1104
|
const o = t.charCodeAt(s);
|
|
1087
1105
|
if (34 === o) {
|
|
1088
|
-
const e =
|
|
1106
|
+
const e = he(t, s);
|
|
1089
1107
|
if (null === e) break;
|
|
1090
1108
|
s = e.end;
|
|
1091
1109
|
continue;
|
|
@@ -1103,7 +1121,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1103
1121
|
40 === t.charCodeAt(i) && e.push(t.slice(s, i).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), s = i;
|
|
1104
1122
|
}
|
|
1105
1123
|
return e;
|
|
1106
|
-
},
|
|
1124
|
+
}, ue = (t) => {
|
|
1107
1125
|
let e = 0, s = 0;
|
|
1108
1126
|
for (let o = 0; o < t.length; o++) {
|
|
1109
1127
|
const i = t[o];
|
|
@@ -1129,7 +1147,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1129
1147
|
}
|
|
1130
1148
|
}
|
|
1131
1149
|
return 0 === e && 0 === s;
|
|
1132
|
-
},
|
|
1150
|
+
}, de = class {
|
|
1133
1151
|
static {
|
|
1134
1152
|
this.Collapsed = 1;
|
|
1135
1153
|
}
|
|
@@ -1166,36 +1184,36 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1166
1184
|
static {
|
|
1167
1185
|
this.ThickTop = 2048;
|
|
1168
1186
|
}
|
|
1169
|
-
},
|
|
1187
|
+
}, ge = (t, e, s) => {
|
|
1170
1188
|
if (t[0].value[0] === t[1].value[0]) return e;
|
|
1171
|
-
},
|
|
1189
|
+
}, me = {
|
|
1172
1190
|
colStart: 0,
|
|
1173
1191
|
colEnd: 0,
|
|
1174
1192
|
rowStart: 0,
|
|
1175
1193
|
rowEnd: 0
|
|
1176
|
-
},
|
|
1177
|
-
let a = !1, c = !1, l = [],
|
|
1178
|
-
const y = n?.get("richData") ??
|
|
1194
|
+
}, fe = (t, e, s, o, i, r, n) => {
|
|
1195
|
+
let a = !1, c = !1, l = [], p = !1, u = null, d = null, g = null, m = null, f = null, T = null;
|
|
1196
|
+
const y = n?.get("richData") ?? N.EmptyArray, x = n?.get("dummyWrapped") ?? null, b = j.normalizeA1ToR1C1, v = R.createConflatingRanges(), w = /* @__PURE__ */ new Map(), S = [];
|
|
1179
1197
|
let C = !1, k = !1, P = null;
|
|
1180
1198
|
let A = !1;
|
|
1181
|
-
const E =
|
|
1182
|
-
let
|
|
1183
|
-
const
|
|
1184
|
-
let
|
|
1199
|
+
const E = R.createConflatingRanges();
|
|
1200
|
+
let I = !1, O = -1, D = -1, V = null, L = null, $ = null;
|
|
1201
|
+
const M = [];
|
|
1202
|
+
let H = null, z = -2, X = 0, F = "", q = "", W = "", U = "", G = "", Z = "", J = "", Q = "", K = "", Y = "", tt = "", et = "", st = "", ot = "", it = !0, rt = null, nt = !1, at = !1, ct = null, lt = 0;
|
|
1185
1203
|
return {
|
|
1186
1204
|
...s,
|
|
1187
1205
|
onEnd: () => {
|
|
1188
|
-
|
|
1189
|
-
let o = v.done(
|
|
1206
|
+
M.length > 0 && (e.rows = j.runsToRefs(M, !1));
|
|
1207
|
+
let o = v.done(ge);
|
|
1190
1208
|
const i = o.length;
|
|
1191
1209
|
if (i > 0) {
|
|
1192
1210
|
const t = /* @__PURE__ */ new Set();
|
|
1193
1211
|
for (let e = 0; e < S.length; e++) t.add(S[e][0].split(":")[0]);
|
|
1194
1212
|
const s = new Array(i);
|
|
1195
1213
|
for (let e = 0; e < i; e++) {
|
|
1196
|
-
const i = o[e], r =
|
|
1197
|
-
let a =
|
|
1198
|
-
a && !t.has(r.split(":")[0]) &&
|
|
1214
|
+
const i = o[e], r = j.rangeToString(i), n = i.value[1];
|
|
1215
|
+
let a = j.resolveRelativeToA1(n, i.rowStart, i.colStart);
|
|
1216
|
+
a && !t.has(r.split(":")[0]) && ue(a) && (a = `${h}(${a})`), s[e] = [r, a];
|
|
1199
1217
|
}
|
|
1200
1218
|
e.formulas = s;
|
|
1201
1219
|
}
|
|
@@ -1204,14 +1222,14 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1204
1222
|
const t = new Array(n);
|
|
1205
1223
|
for (let e = 0; e < n; e++) {
|
|
1206
1224
|
const s = r[e];
|
|
1207
|
-
t[e] =
|
|
1225
|
+
t[e] = j.rangeToString(s);
|
|
1208
1226
|
}
|
|
1209
1227
|
e.volatile = t;
|
|
1210
1228
|
}
|
|
1211
1229
|
S.length > 0 && (e.formulaArray = [...S]);
|
|
1212
1230
|
const a = l.length;
|
|
1213
1231
|
if (a > 0) {
|
|
1214
|
-
l.sort(
|
|
1232
|
+
l.sort(R.createRangeComparator(_.Axis.Column));
|
|
1215
1233
|
let t = l[0], s = t.colStart, o = t.colEnd, i = t.rowEnd, r = t.value;
|
|
1216
1234
|
const n = [];
|
|
1217
1235
|
n.push(t);
|
|
@@ -1220,7 +1238,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1220
1238
|
const h = n.length, p = new Array(h);
|
|
1221
1239
|
for (let t = 0; t < h; t++) {
|
|
1222
1240
|
const e = n[t];
|
|
1223
|
-
p[t] = [
|
|
1241
|
+
p[t] = [j.rangeToString(e), e.value];
|
|
1224
1242
|
}
|
|
1225
1243
|
e.directStyles = p;
|
|
1226
1244
|
}
|
|
@@ -1229,15 +1247,15 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1229
1247
|
},
|
|
1230
1248
|
onOpenTag: (t) => {
|
|
1231
1249
|
let o = t.name;
|
|
1232
|
-
const
|
|
1233
|
-
if (-1 !==
|
|
1250
|
+
const h = o.indexOf(":");
|
|
1251
|
+
if (-1 !== h && (o = o.slice(h + 1)), lt++, lt % 196608 == 0 && i?.(lt), L) {
|
|
1234
1252
|
const e = t.attributes;
|
|
1235
1253
|
switch (o) {
|
|
1236
1254
|
case "v":
|
|
1237
1255
|
c = !0;
|
|
1238
1256
|
break;
|
|
1239
1257
|
case "f":
|
|
1240
|
-
switch (
|
|
1258
|
+
switch (p = !0, e.t ?? null) {
|
|
1241
1259
|
case null:
|
|
1242
1260
|
case "normal": break;
|
|
1243
1261
|
case "shared":
|
|
@@ -1247,31 +1265,31 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1247
1265
|
case "array":
|
|
1248
1266
|
d = e.ref, P = d;
|
|
1249
1267
|
break;
|
|
1250
|
-
case "datatable": d = e.ref,
|
|
1268
|
+
case "datatable": d = e.ref, p = !0;
|
|
1251
1269
|
}
|
|
1252
1270
|
const t = e.ca;
|
|
1253
1271
|
void 0 !== t && (A = "1" === t);
|
|
1254
1272
|
break;
|
|
1255
1273
|
case "is":
|
|
1256
|
-
|
|
1274
|
+
I = !0;
|
|
1257
1275
|
return;
|
|
1258
1276
|
}
|
|
1259
|
-
|
|
1277
|
+
I && !p && r?.onOpenTag?.(t);
|
|
1260
1278
|
return;
|
|
1261
1279
|
}
|
|
1262
1280
|
if (a) {
|
|
1263
1281
|
if ("c" === o) {
|
|
1264
|
-
|
|
1282
|
+
L = t;
|
|
1265
1283
|
const e = t.attributes, s = e.r;
|
|
1266
|
-
D =
|
|
1284
|
+
D = j.fastStringToCol(s);
|
|
1267
1285
|
const o = e.t;
|
|
1268
|
-
void 0 === o ?
|
|
1286
|
+
void 0 === o ? $ = null : ($ = o, "str" === $ && (I = !0));
|
|
1269
1287
|
let i = e.s;
|
|
1270
1288
|
void 0 === i && (null !== ct || at) && (i = "0"), void 0 !== i && (i = parseInt(i), rt && rt.value === i && rt.colEnd + 1 === D ? rt.colEnd = D : (rt = {
|
|
1271
1289
|
colStart: D,
|
|
1272
|
-
rowStart:
|
|
1290
|
+
rowStart: O,
|
|
1273
1291
|
colEnd: D,
|
|
1274
|
-
rowEnd:
|
|
1292
|
+
rowEnd: O,
|
|
1275
1293
|
value: i
|
|
1276
1294
|
}, l.push(rt))), P = null, k = !1;
|
|
1277
1295
|
const r = e.cm;
|
|
@@ -1284,12 +1302,12 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1284
1302
|
const a = e.vm;
|
|
1285
1303
|
if (void 0 !== a) {
|
|
1286
1304
|
const t = y[parseInt(a) - 1];
|
|
1287
|
-
if (
|
|
1305
|
+
if (B.isError(t)) {
|
|
1288
1306
|
const e = t.getCode();
|
|
1289
|
-
|
|
1307
|
+
V = {
|
|
1290
1308
|
t: "e",
|
|
1291
1309
|
v: e
|
|
1292
|
-
}, C && e ===
|
|
1310
|
+
}, C && e === B.Code.Spill && (k = !0);
|
|
1293
1311
|
}
|
|
1294
1312
|
}
|
|
1295
1313
|
}
|
|
@@ -1297,11 +1315,11 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1297
1315
|
if ("row" === o) {
|
|
1298
1316
|
a = !0;
|
|
1299
1317
|
const e = t.attributes.r;
|
|
1300
|
-
if (
|
|
1318
|
+
if (O = parseInt(e) - 1, X = 0, q = t.attributes.customHeight, void 0 !== q && (X |= de.CustomHeight), q !== K && (it = !0, K = q), F = t.attributes.ht, void 0 !== F && (X |= de.Ht), F !== Q && (it = !0, Q = F), W = t.attributes.hidden, void 0 !== W && (X |= de.Hidden), W !== Y && (it = !0, Y = W), G = t.attributes.s, void 0 !== G && (X |= de.S), G !== et && (it = !0, et = G), U = t.attributes.customFormat, void 0 !== U && (X |= de.CustomFormat), U !== tt && (it = !0, tt = U), Z = t.attributes.outlineLevel, void 0 !== Z && (X |= de.OutlineLevel), Z !== st && (it = !0, st = Z), J = t.attributes.collapsed, void 0 !== J && (X |= de.Collapsed), J !== ot && (it = !0, ot = J), 0 !== X) if (z + 1 !== O || it) {
|
|
1301
1319
|
const t = void 0 !== q && ("1" === q || "true" === q), e = void 0 !== U && ("1" === U || "true" === U);
|
|
1302
|
-
ct = e && void 0 !== G ? G : null, e && null === ct && (ct = "0"),
|
|
1303
|
-
min:
|
|
1304
|
-
max:
|
|
1320
|
+
ct = e && void 0 !== G ? G : null, e && null === ct && (ct = "0"), H = {
|
|
1321
|
+
min: O,
|
|
1322
|
+
max: O,
|
|
1305
1323
|
value: {
|
|
1306
1324
|
sz: void 0 === F ? -1 : parseFloat(F),
|
|
1307
1325
|
csz: t,
|
|
@@ -1310,9 +1328,9 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1310
1328
|
l: void 0 === Z || "0" === Z ? 0 : parseInt(Z),
|
|
1311
1329
|
cl: void 0 !== J && ("1" === J || "true" === J)
|
|
1312
1330
|
}
|
|
1313
|
-
},
|
|
1314
|
-
} else
|
|
1315
|
-
z =
|
|
1331
|
+
}, M.push(H);
|
|
1332
|
+
} else H.max = O;
|
|
1333
|
+
z = O, it = !1;
|
|
1316
1334
|
return;
|
|
1317
1335
|
}
|
|
1318
1336
|
if (!nt && "sheetData" === o) {
|
|
@@ -1325,13 +1343,13 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1325
1343
|
},
|
|
1326
1344
|
onCloseTag: (e) => {
|
|
1327
1345
|
let o = e.name;
|
|
1328
|
-
if (!
|
|
1346
|
+
if (!p || "c" !== o && "f" !== o || (u && (m = w.get(u) ?? null), m && (v.append(O, D, m), A && E.append(O, D)), null !== P && S.push([P, C ? k ? "dynamicSpillError" : "dynamic" : "static"]), p = !1, m = null, u = null, d = null, c = !1, A = !1, P = null, C = !1, k = !1), L) {
|
|
1329
1347
|
const s = o.indexOf(":");
|
|
1330
|
-
if (-1 !== s && (o = o.slice(s + 1)),
|
|
1348
|
+
if (-1 !== s && (o = o.slice(s + 1)), I) if ("is" === o || "v" === o) {
|
|
1331
1349
|
const e = r?.onEnd?.();
|
|
1332
|
-
null != e && t.pushAt(
|
|
1350
|
+
null != e && t.pushAt(O, D, "" + e);
|
|
1333
1351
|
} else "f" !== o && r?.onCloseTag?.(e);
|
|
1334
|
-
c && (c = !1), "c" === o && (
|
|
1352
|
+
c && (c = !1), "c" === o && (L = null, I = !1);
|
|
1335
1353
|
return;
|
|
1336
1354
|
}
|
|
1337
1355
|
if (a) return a = !1, void (rt = null);
|
|
@@ -1340,24 +1358,24 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1340
1358
|
onText: (i) => {
|
|
1341
1359
|
const n = i.trim();
|
|
1342
1360
|
if (c) {
|
|
1343
|
-
switch (
|
|
1361
|
+
switch (V = null, $) {
|
|
1344
1362
|
case null:
|
|
1345
1363
|
case "n":
|
|
1346
|
-
|
|
1364
|
+
V = parseFloat(n);
|
|
1347
1365
|
break;
|
|
1348
1366
|
case "b":
|
|
1349
|
-
|
|
1367
|
+
V = "1" === n || "true" === n;
|
|
1350
1368
|
break;
|
|
1351
1369
|
case "s":
|
|
1352
|
-
|
|
1370
|
+
V = n;
|
|
1353
1371
|
break;
|
|
1354
1372
|
case "e":
|
|
1355
1373
|
if ("#VALUE!" === n) {
|
|
1356
|
-
const t =
|
|
1374
|
+
const t = L.attributes.vm;
|
|
1357
1375
|
if (void 0 !== t) {
|
|
1358
1376
|
const e = y[parseInt(t) - 1];
|
|
1359
|
-
if (
|
|
1360
|
-
|
|
1377
|
+
if (B.isError(e)) {
|
|
1378
|
+
V = {
|
|
1361
1379
|
t: "e",
|
|
1362
1380
|
v: e.getCode()
|
|
1363
1381
|
};
|
|
@@ -1365,26 +1383,26 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1365
1383
|
}
|
|
1366
1384
|
}
|
|
1367
1385
|
}
|
|
1368
|
-
const t =
|
|
1369
|
-
t ?
|
|
1386
|
+
const t = B.getBuiltInByLabel(n);
|
|
1387
|
+
t ? V = {
|
|
1370
1388
|
t: "e",
|
|
1371
1389
|
v: t.getCode()
|
|
1372
|
-
} : (
|
|
1390
|
+
} : (V = n, o?.(`Unknown formula error '${n}' in cell ${j.cellToString({
|
|
1373
1391
|
colIndex: D,
|
|
1374
|
-
rowIndex:
|
|
1392
|
+
rowIndex: O
|
|
1375
1393
|
})}`));
|
|
1376
1394
|
break;
|
|
1377
1395
|
case "str":
|
|
1378
|
-
case "inlineStr":
|
|
1396
|
+
case "inlineStr": I = !0;
|
|
1379
1397
|
}
|
|
1380
|
-
null !==
|
|
1398
|
+
null !== V && t.pushAt(O, D, V);
|
|
1381
1399
|
}
|
|
1382
1400
|
if (u) {
|
|
1383
1401
|
if (f === u) m = T;
|
|
1384
1402
|
else {
|
|
1385
1403
|
if (m = w.get(u) ?? null, !m) {
|
|
1386
1404
|
const t = [];
|
|
1387
|
-
g =
|
|
1405
|
+
g = b(n, O, D, t), m = [
|
|
1388
1406
|
g,
|
|
1389
1407
|
t,
|
|
1390
1408
|
n
|
|
@@ -1394,43 +1412,43 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1394
1412
|
}
|
|
1395
1413
|
u = null;
|
|
1396
1414
|
}
|
|
1397
|
-
if (
|
|
1398
|
-
if (null !==
|
|
1415
|
+
if (p) {
|
|
1416
|
+
if (null !== x) {
|
|
1399
1417
|
const t = ((t) => {
|
|
1400
|
-
if (t.length <
|
|
1401
|
-
if (t.slice(0,
|
|
1402
|
-
const e =
|
|
1403
|
-
if (null === e) return
|
|
1404
|
-
if (41 !== t.charCodeAt(e.end)) return
|
|
1405
|
-
if (44 !== t.charCodeAt(e.end + 1)) return
|
|
1406
|
-
if (41 !== t.charCodeAt(t.length - 1)) return
|
|
1418
|
+
if (t.length < re.length) return ce;
|
|
1419
|
+
if (t.slice(0, re.length).toUpperCase() !== ne) return ce;
|
|
1420
|
+
const e = he(t, re.length);
|
|
1421
|
+
if (null === e) return ce;
|
|
1422
|
+
if (41 !== t.charCodeAt(e.end)) return ce;
|
|
1423
|
+
if (44 !== t.charCodeAt(e.end + 1)) return ce;
|
|
1424
|
+
if (41 !== t.charCodeAt(t.length - 1)) return ce;
|
|
1407
1425
|
const s = e.value;
|
|
1408
|
-
return s.toUpperCase() ===
|
|
1426
|
+
return s.toUpperCase() === ae ? le : 0 === s.length ? ce : {
|
|
1409
1427
|
kind: "formula",
|
|
1410
1428
|
formula: s
|
|
1411
1429
|
};
|
|
1412
1430
|
})(n);
|
|
1413
|
-
"none" !== t.kind &&
|
|
1431
|
+
"none" !== t.kind && x.push({
|
|
1414
1432
|
sheet: e,
|
|
1415
|
-
rowIndex:
|
|
1433
|
+
rowIndex: O,
|
|
1416
1434
|
colIndex: D,
|
|
1417
1435
|
formula: "formula" === t.kind ? t.formula : null
|
|
1418
1436
|
});
|
|
1419
1437
|
}
|
|
1420
1438
|
const t = [];
|
|
1421
|
-
g =
|
|
1439
|
+
g = b(n, O, D, t), m = [
|
|
1422
1440
|
g,
|
|
1423
1441
|
t,
|
|
1424
1442
|
n
|
|
1425
1443
|
];
|
|
1426
1444
|
}
|
|
1427
|
-
|
|
1445
|
+
I ? r?.onText?.(i) : a || s?.onText?.(n);
|
|
1428
1446
|
}
|
|
1429
1447
|
};
|
|
1430
|
-
},
|
|
1448
|
+
}, Te = (t) => {
|
|
1431
1449
|
const e = t.indexOf(":");
|
|
1432
1450
|
return -1 === e ? t : t.slice(e + 1);
|
|
1433
|
-
},
|
|
1451
|
+
}, ye = {
|
|
1434
1452
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
|
|
1435
1453
|
"application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
|
|
1436
1454
|
"application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
|
|
@@ -1460,45 +1478,45 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1460
1478
|
"application/vnd.ms-excel.externalLink": "links",
|
|
1461
1479
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
|
|
1462
1480
|
"application/vnd.openxmlformats-officedocument.theme+xml": "themes"
|
|
1463
|
-
},
|
|
1464
|
-
const { password:
|
|
1465
|
-
let
|
|
1466
|
-
const
|
|
1467
|
-
if (
|
|
1468
|
-
|
|
1469
|
-
const e = Math.min(
|
|
1470
|
-
|
|
1471
|
-
} : void 0,
|
|
1472
|
-
let
|
|
1481
|
+
}, xe = (t) => t.startsWith("/") ? t.slice(1) : t, be = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, ve = async (h, C) => {
|
|
1482
|
+
const { password: P, onVBA: N, profile: R, createWorkbookOptions: B = {}, ..._ } = C ?? {}, U = B.origin && "string" != typeof B.origin ? B.origin : null, G = R ? new Y("function" == typeof R ? R : void 0) : null, Z = [], J = C?.progress, Q = J?.onProgress ? J.onProgress.bind(J) : void 0, tt = h.byteLength;
|
|
1483
|
+
let et = 0, st = 0;
|
|
1484
|
+
const ot = Q ? (t) => {
|
|
1485
|
+
if (et <= 0) return;
|
|
1486
|
+
st += t;
|
|
1487
|
+
const e = Math.min(tt, Math.round(st / et * tt));
|
|
1488
|
+
Q(e, tt);
|
|
1489
|
+
} : void 0, it = import("./BYCpXFieBgL_cwTO.mjs");
|
|
1490
|
+
let rt = null;
|
|
1473
1491
|
try {
|
|
1474
|
-
|
|
1492
|
+
rt = new DOMParser();
|
|
1475
1493
|
} catch (t) {}
|
|
1476
|
-
let
|
|
1494
|
+
let nt = null;
|
|
1477
1495
|
try {
|
|
1478
|
-
|
|
1496
|
+
nt = new XMLSerializer();
|
|
1479
1497
|
} catch (t) {}
|
|
1480
|
-
let
|
|
1481
|
-
|
|
1498
|
+
let at, ct, lt, ht = null;
|
|
1499
|
+
rt || (ht = import("@xmldom/xmldom"));
|
|
1482
1500
|
try {
|
|
1483
|
-
const [t, e] = await Promise.all([
|
|
1484
|
-
|
|
1501
|
+
const [t, e] = await Promise.all([ht, it]);
|
|
1502
|
+
at = new e.DOMTransformer(), ct = rt ?? new t.DOMParser(), lt = nt ?? new t.XMLSerializer();
|
|
1485
1503
|
} catch (t) {
|
|
1486
1504
|
throw new Error("Unable to load XLSX parser.", { cause: t });
|
|
1487
1505
|
}
|
|
1488
|
-
const
|
|
1489
|
-
let
|
|
1506
|
+
const pt = (t) => lt.serializeToString(t);
|
|
1507
|
+
let ut;
|
|
1490
1508
|
try {
|
|
1491
|
-
|
|
1509
|
+
ut = await K.create(h);
|
|
1492
1510
|
} catch (t) {
|
|
1493
|
-
throw new
|
|
1511
|
+
throw new $("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
|
|
1494
1512
|
}
|
|
1495
|
-
|
|
1513
|
+
G?.mark("zip-open");
|
|
1496
1514
|
try {
|
|
1497
|
-
if (!
|
|
1498
|
-
const
|
|
1499
|
-
const e =
|
|
1515
|
+
if (!ut.has("[Content_Types].xml")) throw new $("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
1516
|
+
const h = (t) => {
|
|
1517
|
+
const e = ut.getEntry(t);
|
|
1500
1518
|
return e ? { content: e } : void 0;
|
|
1501
|
-
},
|
|
1519
|
+
}, C = {
|
|
1502
1520
|
workbooks: [],
|
|
1503
1521
|
sheets: [],
|
|
1504
1522
|
charts: [],
|
|
@@ -1529,7 +1547,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1529
1547
|
if ("Override" === s) {
|
|
1530
1548
|
const e = o.ContentType, s = o.PartName;
|
|
1531
1549
|
if (!e || !s) return;
|
|
1532
|
-
const i =
|
|
1550
|
+
const i = ye[e], r = i ? t[i] : void 0;
|
|
1533
1551
|
Array.isArray(r) && r.push(s);
|
|
1534
1552
|
} else if ("Default" === s) {
|
|
1535
1553
|
const e = o.Extension, s = o.ContentType;
|
|
@@ -1542,69 +1560,75 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1542
1560
|
onError: (t) => {
|
|
1543
1561
|
e?.(`Error parsing content types: ${t?.message ?? t}`);
|
|
1544
1562
|
}
|
|
1545
|
-
}))(
|
|
1546
|
-
|
|
1547
|
-
}), e = await
|
|
1563
|
+
}))(C, (t) => {
|
|
1564
|
+
Z.push([t, "[Content_Types].xml"]);
|
|
1565
|
+
}), e = await ut.getTextStream("[Content_Types].xml");
|
|
1548
1566
|
if (!e) throw new Error("Error parsing content types: '[Content_Types].xml'");
|
|
1549
1567
|
try {
|
|
1550
|
-
await
|
|
1568
|
+
await Wt.parseStream(e, t, { xmlns: !1 });
|
|
1551
1569
|
} catch (t) {
|
|
1552
1570
|
throw new Error("Error parsing content types: '[Content_Types].xml'", { cause: t });
|
|
1553
1571
|
}
|
|
1554
|
-
|
|
1572
|
+
U && await ut.getBuffer("[Content_Types].xml");
|
|
1555
1573
|
}
|
|
1556
|
-
|
|
1557
|
-
const
|
|
1558
|
-
for (const t of
|
|
1559
|
-
|
|
1560
|
-
for (const t of
|
|
1561
|
-
if (await
|
|
1562
|
-
const t = n("_rels/.rels",
|
|
1574
|
+
G?.mark("content-types");
|
|
1575
|
+
const P = C.sst, _ = /* @__PURE__ */ new Set();
|
|
1576
|
+
for (const t of C.sheets) _.add(xe(t));
|
|
1577
|
+
P && _.add(xe(P));
|
|
1578
|
+
for (const t of _) et += ut.uncompressedSize(t);
|
|
1579
|
+
if (await ut.prefetch((t) => !_.has(t) && !be.test(t)), G?.mark("prefetch-side-parts"), 0 === C.workbooks.length) {
|
|
1580
|
+
const t = n("_rels/.rels", h, ct, at), e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
|
1563
1581
|
if (t) {
|
|
1564
1582
|
for (const s of t.values()) if (s.type === e && s.target) {
|
|
1565
|
-
|
|
1583
|
+
C.workbooks.push(s.target);
|
|
1566
1584
|
break;
|
|
1567
1585
|
}
|
|
1568
1586
|
}
|
|
1569
1587
|
}
|
|
1570
|
-
if (0 ===
|
|
1571
|
-
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1588
|
+
if (0 === C.workbooks.length) throw new $("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
1589
|
+
C.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], C.richdata = ["/xl/richData/rdrichvalue.xml"];
|
|
1590
|
+
const z = B?.resources ?? new X(), K = z.beginPersist(), Y = {}, st = /* @__PURE__ */ new Set(), it = /* @__PURE__ */ new Map();
|
|
1591
|
+
it.set("richTypes", []), it.set("parseInlineDxf", (t) => {
|
|
1592
|
+
if (!t) return;
|
|
1593
|
+
const e = ct.parseFromString(`<dxf xmlns:x14="${p}" xmlns:xm="${u}">${t}</dxf>`, "text/xml")?.documentElement;
|
|
1594
|
+
if (!e) return;
|
|
1595
|
+
const s = at.parseDxf(e);
|
|
1596
|
+
return Object.keys(s).length > 0 ? s : void 0;
|
|
1597
|
+
});
|
|
1598
|
+
const rt = [];
|
|
1599
|
+
it.set("dummyWrapped", rt);
|
|
1600
|
+
const nt = a("metadata", C, h, ct, at).entries().next()?.value?.[1]?.metadata;
|
|
1601
|
+
nt && it.set("metadata", nt);
|
|
1602
|
+
const lt = /* @__PURE__ */ new Map(), ht = [], dt = (t, e = lt) => {
|
|
1579
1603
|
const s = t.lastIndexOf("/"), o = t.substring(0, s + 1) + "_rels/" + t.substring(s + 1, t.length) + ".rels";
|
|
1580
1604
|
let i = e.get(o);
|
|
1581
|
-
return i || (i = n(o,
|
|
1582
|
-
},
|
|
1583
|
-
let
|
|
1584
|
-
if (!
|
|
1585
|
-
if ("External" ===
|
|
1586
|
-
if (!
|
|
1587
|
-
const t =
|
|
1588
|
-
return t.addReference(
|
|
1605
|
+
return i || (i = n(o, h, ct, at, bt), e.set(o, i)), i;
|
|
1606
|
+
}, gt = (n, a, p, u = lt) => {
|
|
1607
|
+
let y = dt(a, u).get(n), x = y?.target;
|
|
1608
|
+
if (!x) return null;
|
|
1609
|
+
if ("External" === y.targetMode) {
|
|
1610
|
+
if (!p) return y.target;
|
|
1611
|
+
const t = z.add({ source: { external: y.target } });
|
|
1612
|
+
return t.addReference(Y), st.add(t), K.toResourceId(t);
|
|
1589
1613
|
}
|
|
1590
|
-
const
|
|
1591
|
-
|
|
1592
|
-
const
|
|
1593
|
-
let O =
|
|
1614
|
+
const C = a.lastIndexOf("/"), P = a.substring(0, C + 1);
|
|
1615
|
+
x.startsWith("/") || (x = P + x), x = i(x);
|
|
1616
|
+
const I = at?.getVisitorParamsState().get("dxfs");
|
|
1617
|
+
let O = u.get(x);
|
|
1594
1618
|
if (!O) {
|
|
1595
1619
|
const i = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", n = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
|
|
1596
|
-
if (
|
|
1620
|
+
if (y.type === i) {
|
|
1597
1621
|
const t = {};
|
|
1598
1622
|
O = t;
|
|
1599
1623
|
const o = async () => {
|
|
1600
|
-
const o = ((t, s, o, i, n, a,
|
|
1601
|
-
const
|
|
1602
|
-
let
|
|
1603
|
-
|
|
1624
|
+
const o = ((t, s, o, i, n, a, h, p) => {
|
|
1625
|
+
const u = new ie(), y = p?.get("parseInlineDxf"), x = new q.TransposedBuilder();
|
|
1626
|
+
let C = null;
|
|
1627
|
+
u.registerVisitor({
|
|
1604
1628
|
from: "autoFilter",
|
|
1605
1629
|
to: "autoTable",
|
|
1606
1630
|
openTag: (t) => {
|
|
1607
|
-
const e = t.getAttribute("ref"), s =
|
|
1631
|
+
const e = t.getAttribute("ref"), s = j.fastStringToRange(e);
|
|
1608
1632
|
t.getSource().r = s, t.getSource().v = {};
|
|
1609
1633
|
},
|
|
1610
1634
|
closeTag: (t) => {
|
|
@@ -1614,7 +1638,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1614
1638
|
0 === t ? s.hiddenButtons = !1 : t === r && (s.hiddenButtons = !0);
|
|
1615
1639
|
}
|
|
1616
1640
|
}
|
|
1617
|
-
}),
|
|
1641
|
+
}), u.registerVisitor({
|
|
1618
1642
|
from: "conditionalFormatting",
|
|
1619
1643
|
to: {},
|
|
1620
1644
|
openTag: (t) => {
|
|
@@ -1625,10 +1649,10 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1625
1649
|
const o = {
|
|
1626
1650
|
r: s,
|
|
1627
1651
|
conditionals: e.conditionals
|
|
1628
|
-
}, i = t.getAttribute("pivot",
|
|
1652
|
+
}, i = t.getAttribute("pivot", Kt);
|
|
1629
1653
|
null !== i && (o.pivot = i), t.setSource(o);
|
|
1630
1654
|
}
|
|
1631
|
-
}),
|
|
1655
|
+
}), u.registerVisitor({
|
|
1632
1656
|
from: "cfRule",
|
|
1633
1657
|
to: {},
|
|
1634
1658
|
openTag: (t) => {
|
|
@@ -1639,24 +1663,24 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1639
1663
|
r: e.r,
|
|
1640
1664
|
v: null,
|
|
1641
1665
|
rule: s
|
|
1642
|
-
}), t.copyToObject(s, "type",
|
|
1643
|
-
const o = t.getAttribute("dxfId",
|
|
1666
|
+
}), t.copyToObject(s, "type", ee), t.copyToObject(s, "priority", Yt), t.copyToObject(s, "stopIfTrue", Kt);
|
|
1667
|
+
const o = t.getAttribute("dxfId", Yt);
|
|
1644
1668
|
if (null !== o) {
|
|
1645
1669
|
let e = i?.get(o);
|
|
1646
1670
|
e || (a?.(`Unable to load conditional color. Invalid dxfI: '${o}' at '${t.getPath()}'.`), e = {}), s.style = e;
|
|
1647
1671
|
}
|
|
1648
|
-
t.copyToObject(s, "aboveAverage",
|
|
1672
|
+
t.copyToObject(s, "aboveAverage", Kt), t.copyToObject(s, "equalAverage", Kt), t.copyToObject(s, "stdDev", Yt), t.copyToObject(s, "bottom", Kt), t.copyToObject(s, "percent", Kt), t.copyToObject(s, "rank", Yt), t.copyToObject(s, "operator", ee), t.copyToObject(s, "text", ee), t.copyToObject(s, "timePeriod", ee);
|
|
1649
1673
|
},
|
|
1650
1674
|
closeTag: (t) => {
|
|
1651
1675
|
const e = t.getParent();
|
|
1652
1676
|
if (!e?.r) return;
|
|
1653
1677
|
const s = e.conditionals[e.conditionals.length - 1], o = s?.rule;
|
|
1654
1678
|
if (!o) return;
|
|
1655
|
-
const i = {}, r =
|
|
1679
|
+
const i = {}, r = b(o, a);
|
|
1656
1680
|
r && (i.condition = r), o.style && (i.style = o.style), o.scale && (i.scale = o.scale), o.stopIfTrue && (i.stopIfTrue = !0), o.pivot && (i.pivot = !0), s.v = i, s.priority = o.priority, o.x14Id && (s.x14Id = o.x14Id), delete s.rule;
|
|
1657
1681
|
}
|
|
1658
1682
|
});
|
|
1659
|
-
const
|
|
1683
|
+
const P = (t) => {
|
|
1660
1684
|
const e = t.conditions ?? [], s = [];
|
|
1661
1685
|
for (let t = 0; t < e.length; t++) {
|
|
1662
1686
|
const o = e[t], i = {};
|
|
@@ -1664,45 +1688,45 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1664
1688
|
}
|
|
1665
1689
|
return s;
|
|
1666
1690
|
};
|
|
1667
|
-
|
|
1691
|
+
u.registerVisitor({
|
|
1668
1692
|
from: "colorScale",
|
|
1669
1693
|
to: {},
|
|
1670
1694
|
openTag: (t) => {},
|
|
1671
1695
|
closeTag: (t) => {
|
|
1672
|
-
const e = t.getSource(), s = e.colors ?? [], o =
|
|
1696
|
+
const e = t.getSource(), s = e.colors ?? [], o = P(e);
|
|
1673
1697
|
for (let t = 0; t < o.length; t++) o[t].color = s[t];
|
|
1674
1698
|
t.getParent().scale = {
|
|
1675
|
-
type:
|
|
1699
|
+
type: H.ScaleType.ColorScale,
|
|
1676
1700
|
stops: o
|
|
1677
1701
|
};
|
|
1678
1702
|
}
|
|
1679
|
-
}),
|
|
1703
|
+
}), u.registerVisitor({
|
|
1680
1704
|
from: "dataBar",
|
|
1681
1705
|
to: {},
|
|
1682
1706
|
openTag: (t) => {
|
|
1683
|
-
t.copyTo("maxLength",
|
|
1707
|
+
t.copyTo("maxLength", Yt), t.copyTo("minLength", Yt), t.copyTo("showValue", Kt);
|
|
1684
1708
|
},
|
|
1685
1709
|
closeTag: (t) => {
|
|
1686
1710
|
const e = t.getSource(), s = {
|
|
1687
|
-
type:
|
|
1688
|
-
stops:
|
|
1711
|
+
type: H.ScaleType.DataBar,
|
|
1712
|
+
stops: P(e)
|
|
1689
1713
|
}, o = e.colors?.[0];
|
|
1690
1714
|
o && (s.color = o), void 0 !== e.minLength && (s.minLength = e.minLength), void 0 !== e.maxLength && (s.maxLength = e.maxLength), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
|
|
1691
1715
|
}
|
|
1692
|
-
}),
|
|
1716
|
+
}), u.registerVisitor({
|
|
1693
1717
|
from: "iconSet",
|
|
1694
1718
|
to: {},
|
|
1695
1719
|
openTag: (t) => {
|
|
1696
|
-
t.copyTo("iconSet",
|
|
1720
|
+
t.copyTo("iconSet", ee), t.copyTo("reverse", Kt), t.copyTo("showValue", Kt);
|
|
1697
1721
|
},
|
|
1698
1722
|
closeTag: (t) => {
|
|
1699
1723
|
const e = t.getSource(), s = {
|
|
1700
|
-
type:
|
|
1701
|
-
stops:
|
|
1724
|
+
type: H.ScaleType.IconSet,
|
|
1725
|
+
stops: P(e)
|
|
1702
1726
|
};
|
|
1703
1727
|
void 0 !== e.iconSet && (s.iconSet = e.iconSet), void 0 !== e.reverse && (s.reverse = e.reverse), void 0 !== e.showValue && (s.showValue = e.showValue), t.getParent().scale = s;
|
|
1704
1728
|
}
|
|
1705
|
-
}),
|
|
1729
|
+
}), u.registerVisitor({
|
|
1706
1730
|
from: "formula",
|
|
1707
1731
|
to: {},
|
|
1708
1732
|
text: (t, e) => {
|
|
@@ -1710,16 +1734,16 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1710
1734
|
let o = s.formulas;
|
|
1711
1735
|
o || (o = [], s.formulas = o), o.push(t);
|
|
1712
1736
|
}
|
|
1713
|
-
}),
|
|
1737
|
+
}), u.registerVisitor({
|
|
1714
1738
|
from: "cfvo",
|
|
1715
1739
|
to: {},
|
|
1716
1740
|
openTag: (t) => {
|
|
1717
1741
|
const e = t.getParent();
|
|
1718
1742
|
e.conditions || (e.conditions = []);
|
|
1719
1743
|
const s = t.getSource();
|
|
1720
|
-
e.conditions.push(s), t.copyTo("type",
|
|
1744
|
+
e.conditions.push(s), t.copyTo("type", ee), s.type === H.ColorStopType.Formula ? t.copyTo("value", ee, "val") : t.copyTo("value", te, "val"), !1 === t.getAttribute("gte", Kt) && (s.exclusive = !0);
|
|
1721
1745
|
}
|
|
1722
|
-
}),
|
|
1746
|
+
}), u.registerVisitor({
|
|
1723
1747
|
from: "color",
|
|
1724
1748
|
to: {},
|
|
1725
1749
|
openTag: (t) => {
|
|
@@ -1728,7 +1752,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1728
1752
|
const o = e((e) => t.getAttribute(e));
|
|
1729
1753
|
s.colors.push(o);
|
|
1730
1754
|
}
|
|
1731
|
-
}),
|
|
1755
|
+
}), u.registerVisitor({
|
|
1732
1756
|
from: "filterColumn",
|
|
1733
1757
|
to: {},
|
|
1734
1758
|
openTag: (t) => {
|
|
@@ -1737,83 +1761,89 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1737
1761
|
let i = e.filter;
|
|
1738
1762
|
i || (i = { conditions: [] }, e.filter = i);
|
|
1739
1763
|
let r = i.conditions;
|
|
1740
|
-
if (r || (r = [], i.conditions = r), r.push(o), t.getAttribute("hiddenButton",
|
|
1764
|
+
if (r || (r = [], i.conditions = r), r.push(o), t.getAttribute("hiddenButton", Kt) && e) {
|
|
1741
1765
|
let t = e.hiddenButtons;
|
|
1742
1766
|
t || (t = [], e.hiddenButtons = t), t.push(s);
|
|
1743
1767
|
}
|
|
1744
|
-
if (t.getAttribute("showButton",
|
|
1768
|
+
if (t.getAttribute("showButton", Kt) && e) {
|
|
1745
1769
|
let t = e.showButtons;
|
|
1746
1770
|
t || (t = [], e.showButtons = t), t.push(s);
|
|
1747
1771
|
}
|
|
1748
1772
|
return o;
|
|
1749
1773
|
}
|
|
1750
|
-
}),
|
|
1774
|
+
}), u.registerVisitor({
|
|
1751
1775
|
from: "colorFilter",
|
|
1752
1776
|
openTag: (t) => {
|
|
1753
1777
|
const e = t.getParent(), s = {};
|
|
1754
|
-
e.operator =
|
|
1778
|
+
e.operator = M.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor"), t.copyToObject(s, "styleId", Yt, "dxfId");
|
|
1755
1779
|
}
|
|
1756
|
-
}),
|
|
1780
|
+
}), u.registerVisitor({
|
|
1757
1781
|
from: "iconFilter",
|
|
1758
1782
|
openTag: (t) => {
|
|
1759
1783
|
const e = t.getParent(), s = {};
|
|
1760
|
-
e.operator =
|
|
1784
|
+
e.operator = M.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", Yt), t.copyToObject(s, "iconSet", ee);
|
|
1761
1785
|
}
|
|
1762
|
-
}),
|
|
1786
|
+
}), u.registerVisitor({
|
|
1763
1787
|
from: "top10",
|
|
1764
1788
|
openTag: (t) => {
|
|
1765
1789
|
const e = t.getParent(), s = {};
|
|
1766
|
-
e.operator =
|
|
1790
|
+
e.operator = M.BuiltInOperatorNames.TopN, e.param = s, t.copyToObject(s, "filterVal", te), t.copyToObject(s, "percent", Kt), t.copyToObject(s, "top", Kt), t.copyToObject(s, "limit", te, "val");
|
|
1767
1791
|
}
|
|
1768
|
-
}),
|
|
1792
|
+
}), u.registerVisitor({
|
|
1769
1793
|
from: "dynamicFilter",
|
|
1770
1794
|
openTag: (t) => {
|
|
1771
1795
|
const e = t.getParent(), s = {};
|
|
1772
|
-
e.operator =
|
|
1796
|
+
e.operator = M.BuiltInOperatorNames.TimePeriod, e.param = s;
|
|
1773
1797
|
let o = t.getAttribute("type");
|
|
1774
|
-
Object.values(
|
|
1798
|
+
Object.values(M.AverageType).includes(o) ? (e.operator = M.BuiltInOperatorNames.Average, t.copyToObject(s, "stdDevs", Yt, "val")) : t.copyToObject(s, "anchorDate", Yt, "val"), t.copyToObject(s, "operator", ee, "type"), t.copyToObject(s, "maxVal", te, "maxVal");
|
|
1775
1799
|
}
|
|
1776
|
-
}),
|
|
1800
|
+
}), u.registerVisitor({
|
|
1777
1801
|
from: "filters",
|
|
1778
1802
|
to: {},
|
|
1779
1803
|
openTag: (t) => {
|
|
1780
1804
|
const e = t.getParent(), s = {};
|
|
1781
|
-
return e.operator =
|
|
1805
|
+
return e.operator = M.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", Kt), t.copyToObject(s, "calendarType", ee), s;
|
|
1782
1806
|
}
|
|
1783
|
-
}),
|
|
1807
|
+
}), u.registerVisitor({
|
|
1784
1808
|
from: "filter",
|
|
1785
1809
|
openTag: (t) => {
|
|
1786
1810
|
const e = t.getParent();
|
|
1787
1811
|
let s = e.items;
|
|
1788
|
-
s || (s = [], e.items = s), s.push(t.getAttribute("val",
|
|
1812
|
+
s || (s = [], e.items = s), s.push(t.getAttribute("val", ee));
|
|
1789
1813
|
}
|
|
1790
|
-
}),
|
|
1814
|
+
}), u.registerVisitor({
|
|
1791
1815
|
from: "dateGroupItem",
|
|
1792
1816
|
to: {},
|
|
1793
1817
|
openTag: (t) => {
|
|
1794
1818
|
const e = t.getParent();
|
|
1795
1819
|
let s = e.dateGroups;
|
|
1796
|
-
s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group",
|
|
1820
|
+
s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group", ee, "dateTimeGrouping"), t.copyTo("day", Yt), t.copyTo("hour", Yt), t.copyTo("minute", Yt), t.copyTo("month", Yt), t.copyTo("second", Yt), t.copyTo("year", Yt);
|
|
1797
1821
|
}
|
|
1798
|
-
}),
|
|
1822
|
+
}), u.registerVisitor({
|
|
1799
1823
|
from: "customFilters",
|
|
1800
1824
|
openTag: (t) => {
|
|
1801
|
-
const e = t.getParent(), s = t.getAttribute("and"), o = "and" === s || "1" === s;
|
|
1802
|
-
t.
|
|
1803
|
-
const i = [];
|
|
1804
|
-
return e.operator = o ? N.BuiltInOperatorNames.And : N.BuiltInOperatorNames.Or, e.param = { conditions: i }, t.setSource(e), i;
|
|
1825
|
+
const e = t.getParent(), s = t.getAttribute("and"), o = "and" === s || "1" === s, i = [];
|
|
1826
|
+
return e.operator = o ? M.BuiltInOperatorNames.And : M.BuiltInOperatorNames.Or, e.param = i, t.setSource(e), i;
|
|
1805
1827
|
},
|
|
1806
1828
|
closeTag: (t) => {
|
|
1807
|
-
t.getSource()
|
|
1829
|
+
const e = t.getSource(), s = e?.param;
|
|
1830
|
+
if (1 !== s?.length) return;
|
|
1831
|
+
const o = s[0];
|
|
1832
|
+
e.operator = o.operator, e.param = o.param;
|
|
1808
1833
|
}
|
|
1809
|
-
}),
|
|
1834
|
+
}), u.registerVisitor({
|
|
1810
1835
|
from: "customFilter",
|
|
1811
1836
|
openTag: (t) => {
|
|
1812
1837
|
const e = t.getParent();
|
|
1813
1838
|
let s;
|
|
1814
|
-
Array.isArray(e) ? (s = {}, e.push(s)) : s = e
|
|
1839
|
+
Array.isArray(e) ? (s = {}, e.push(s)) : s = e;
|
|
1840
|
+
const o = k({
|
|
1841
|
+
operator: t.getAttribute("operator"),
|
|
1842
|
+
val: t.getAttribute("val")
|
|
1843
|
+
});
|
|
1844
|
+
o && (s.operator = o.operator, s.param = o.param);
|
|
1815
1845
|
}
|
|
1816
|
-
}),
|
|
1846
|
+
}), u.registerVisitor({
|
|
1817
1847
|
from: "sortState",
|
|
1818
1848
|
to: {},
|
|
1819
1849
|
openTag: (t) => {
|
|
@@ -1821,7 +1851,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1821
1851
|
let s = e.v;
|
|
1822
1852
|
s && (s.sort = {}, t.setSource(e));
|
|
1823
1853
|
}
|
|
1824
|
-
}),
|
|
1854
|
+
}), u.registerVisitor({
|
|
1825
1855
|
from: "sortCondition",
|
|
1826
1856
|
to: {},
|
|
1827
1857
|
openTag: (t) => {
|
|
@@ -1834,133 +1864,133 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1834
1864
|
const r = t.getAttribute("ref");
|
|
1835
1865
|
let n = 0;
|
|
1836
1866
|
if (r) {
|
|
1837
|
-
const t =
|
|
1867
|
+
const t = j.fastStringToRange(r, me).colStart, s = e.r, o = s.colStart;
|
|
1838
1868
|
n = s ? t - o : t;
|
|
1839
1869
|
}
|
|
1840
1870
|
const a = {};
|
|
1841
|
-
t.copyToObject(a, "sortOn",
|
|
1871
|
+
t.copyToObject(a, "sortOn", ee, "sortBy"), t.copyToObject(a, "dxfId", ee, "sortBy"), t.copyToObject(a, "iconSet", ee), t.copyToObject(a, "customList", ee), a.reverse = t.getAttribute("descending", Kt) ?? !1;
|
|
1842
1872
|
const c = {
|
|
1843
1873
|
index: n,
|
|
1844
1874
|
criteria: a
|
|
1845
1875
|
};
|
|
1846
1876
|
i.push(c);
|
|
1847
1877
|
}
|
|
1848
|
-
}),
|
|
1878
|
+
}), u.registerVisitor({
|
|
1849
1879
|
from: "AlternateContent",
|
|
1850
1880
|
to: null
|
|
1851
1881
|
});
|
|
1852
|
-
const
|
|
1853
|
-
|
|
1882
|
+
const I = (t) => {
|
|
1883
|
+
C = t.getSource(), t.copyTo("topLeft", ee, "topLeftCell");
|
|
1854
1884
|
const e = r(t.getAttribute("defaultGridColor")), s = t.getAttribute("colorId");
|
|
1855
|
-
null === s || e || (t.getSource().gridLineColor = "index" + parseFloat(s)), t.copyTo("showZeros",
|
|
1885
|
+
null === s || e || (t.getSource().gridLineColor = "index" + parseFloat(s)), t.copyTo("showZeros", Kt), t.copyTo("showFormulas", Kt), t.copyTo("zoomScale", Yt), t.copyTo("showRowHeaders", Kt, "showRowColHeaders"), t.copyTo("showColumnHeaders", Kt, "showRowColHeaders"), t.copyTo("showRowGridlines", Kt, "showGridLines"), t.copyTo("showColumnGridlines", Kt, "showGridLines"), t.copyTo("rightToLeft", Kt);
|
|
1856
1886
|
};
|
|
1857
|
-
|
|
1887
|
+
u.registerVisitor({
|
|
1858
1888
|
from: "sheetView",
|
|
1859
1889
|
to: "view",
|
|
1860
1890
|
openTag: (t) => {
|
|
1861
|
-
|
|
1891
|
+
I(t);
|
|
1862
1892
|
},
|
|
1863
1893
|
closeTag: () => {
|
|
1864
|
-
|
|
1894
|
+
C = null;
|
|
1865
1895
|
}
|
|
1866
|
-
}),
|
|
1896
|
+
}), u.registerVisitor({
|
|
1867
1897
|
from: "customSheetViews",
|
|
1868
1898
|
to: "customSheetViews",
|
|
1869
1899
|
openTag: (t) => {
|
|
1870
1900
|
t.setSource([]);
|
|
1871
1901
|
}
|
|
1872
|
-
}),
|
|
1902
|
+
}), u.registerVisitor({
|
|
1873
1903
|
from: "customSheetView",
|
|
1874
1904
|
to: [],
|
|
1875
1905
|
openTag: (t) => {
|
|
1876
|
-
|
|
1906
|
+
I(t);
|
|
1877
1907
|
},
|
|
1878
1908
|
closeTag: () => {
|
|
1879
|
-
|
|
1909
|
+
C = null;
|
|
1880
1910
|
}
|
|
1881
|
-
}),
|
|
1911
|
+
}), u.registerVisitor({
|
|
1882
1912
|
from: "selection",
|
|
1883
1913
|
to: "selection",
|
|
1884
1914
|
openTag: (t) => {
|
|
1885
|
-
if (!
|
|
1886
|
-
t.copyTo("cell",
|
|
1915
|
+
if (!C) return;
|
|
1916
|
+
t.copyTo("cell", ee, "activeCell"), t.copyTo("rangeIndex", Yt, "activeCellId");
|
|
1887
1917
|
const e = t.getAttribute("activeCell"), s = t.getAttribute("sqref");
|
|
1888
1918
|
s && s !== e && (t.getSource().ranges = s.trim().split(/\s+/));
|
|
1889
1919
|
}
|
|
1890
|
-
}),
|
|
1920
|
+
}), u.registerVisitor({
|
|
1891
1921
|
from: "pane",
|
|
1892
1922
|
to: null,
|
|
1893
1923
|
openTag: (t) => {
|
|
1894
|
-
if (!
|
|
1924
|
+
if (!C) return;
|
|
1895
1925
|
if ("frozen" === t.getAttribute("state")) {
|
|
1896
1926
|
const e = {};
|
|
1897
|
-
|
|
1898
|
-
const s = (
|
|
1927
|
+
C.freezePanes = e, t.copyToObject(e, "topLeft", ee, "topLeftCell");
|
|
1928
|
+
const s = (C.topLeft ? j.fastStringToCell(C.topLeft) : void 0) ?? {
|
|
1899
1929
|
colIndex: 0,
|
|
1900
1930
|
rowIndex: 0
|
|
1901
1931
|
}, o = {
|
|
1902
1932
|
colIndex: 0,
|
|
1903
1933
|
rowIndex: 0
|
|
1904
1934
|
};
|
|
1905
|
-
t.copyToObject(o, "colIndex",
|
|
1935
|
+
t.copyToObject(o, "colIndex", Yt, "xSplit"), t.copyToObject(o, "rowIndex", Yt, "ySplit");
|
|
1906
1936
|
const i = {
|
|
1907
1937
|
colIndex: s.colIndex + o.colIndex,
|
|
1908
1938
|
rowIndex: s.rowIndex + o.rowIndex
|
|
1909
1939
|
};
|
|
1910
|
-
e.coords =
|
|
1940
|
+
e.coords = j.cellToString(i);
|
|
1911
1941
|
}
|
|
1912
1942
|
}
|
|
1913
|
-
}),
|
|
1943
|
+
}), u.registerVisitor({
|
|
1914
1944
|
from: "tabColor",
|
|
1915
1945
|
to: null,
|
|
1916
1946
|
openTag: (s) => {
|
|
1917
1947
|
const o = e((t) => s.getAttribute(t));
|
|
1918
1948
|
o && (t.tabColor = o);
|
|
1919
1949
|
}
|
|
1920
|
-
}),
|
|
1950
|
+
}), u.registerVisitor({
|
|
1921
1951
|
from: "pageSetUpPr",
|
|
1922
1952
|
to: "pageSetUpPr",
|
|
1923
1953
|
openTag: (t) => {}
|
|
1924
|
-
}),
|
|
1954
|
+
}), u.registerVisitor({
|
|
1925
1955
|
from: "outlinePr",
|
|
1926
1956
|
to: "outlinePr",
|
|
1927
1957
|
openTag: (t) => {}
|
|
1928
|
-
}),
|
|
1958
|
+
}), u.registerVisitor({
|
|
1929
1959
|
from: "pageMargins",
|
|
1930
1960
|
to: "pageMargins",
|
|
1931
1961
|
openTag: (t) => {
|
|
1932
|
-
t.copyTo("bottom",
|
|
1962
|
+
t.copyTo("bottom", te), t.copyTo("footer", te), t.copyTo("header", te), t.copyTo("left", te), t.copyTo("right", te), t.copyTo("top", te), t.copyTo("bottom", te);
|
|
1933
1963
|
}
|
|
1934
|
-
}),
|
|
1964
|
+
}), u.registerVisitor({
|
|
1935
1965
|
from: "pageSetup",
|
|
1936
1966
|
to: "pageSetup",
|
|
1937
1967
|
openTag: (t) => {
|
|
1938
|
-
t.copyTo("blackAndWhite",
|
|
1968
|
+
t.copyTo("blackAndWhite", Kt), t.copyTo("cellComments"), t.copyTo("copies", Yt), t.copyTo("draft", Kt), t.copyTo("errors"), t.copyTo("firstPageNumber", Yt), t.copyTo("fitToHeight", Yt), t.copyTo("fitToWidth", Yt), t.copyTo("horizontalDpi", Yt), t.copyTo("orientation"), t.copyTo("pageOrder"), t.copyTo("paperSize", Yt), t.copyTo("scale", Yt), t.copyTo("useFirstPageNumber", Kt), t.copyTo("usePrinterDefaults", Kt), t.copyTo("verticalDpi", Yt);
|
|
1939
1969
|
}
|
|
1940
|
-
}),
|
|
1970
|
+
}), u.registerVisitor({
|
|
1941
1971
|
from: "printOptions",
|
|
1942
1972
|
to: "printOptions",
|
|
1943
1973
|
openTag: (t) => {
|
|
1944
|
-
t.copyTo("gridLines",
|
|
1974
|
+
t.copyTo("gridLines", Kt), t.copyTo("gridLinesSet", Kt), t.copyTo("headings", Kt), t.copyTo("horizontalCentered", Kt), t.copyTo("verticalCentered", Kt);
|
|
1945
1975
|
}
|
|
1946
|
-
}),
|
|
1976
|
+
}), u.registerVisitor({
|
|
1947
1977
|
from: "headerFoot",
|
|
1948
1978
|
to: "headerFoot",
|
|
1949
1979
|
openTag: (t) => {}
|
|
1950
|
-
}),
|
|
1980
|
+
}), u.registerVisitor({
|
|
1951
1981
|
from: "mergeCells",
|
|
1952
1982
|
to: "merges",
|
|
1953
1983
|
openTag: (t) => {
|
|
1954
1984
|
t.setSource([]);
|
|
1955
1985
|
}
|
|
1956
|
-
}),
|
|
1986
|
+
}), u.registerVisitor({
|
|
1957
1987
|
from: "dataValidations",
|
|
1958
1988
|
to: "validations",
|
|
1959
1989
|
openTag: (t) => {
|
|
1960
1990
|
t.setSource([]);
|
|
1961
1991
|
}
|
|
1962
1992
|
});
|
|
1963
|
-
const
|
|
1993
|
+
const O = {
|
|
1964
1994
|
from: "dataValidation",
|
|
1965
1995
|
to: [],
|
|
1966
1996
|
openTag: (t) => {
|
|
@@ -1974,30 +2004,30 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1974
2004
|
operator: t.getAttribute("operator") ?? void 0
|
|
1975
2005
|
}
|
|
1976
2006
|
};
|
|
1977
|
-
!0 === t.getAttribute("showDropDown",
|
|
2007
|
+
!0 === t.getAttribute("showDropDown", Kt) && (s.hideDropdown = !0), t.copyToObject(s, "alert", ee, "error"), t.copyToObject(s, "alertTitle", ee, "errorTitle"), t.copyToObject(s, "showAlertMessage", Kt, "showErrorMessage"), s.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(s, "imeMode"), t.copyToObject(s, "prompt"), t.copyToObject(s, "promptTitle"), t.copyToObject(s, "showPromptMessage", Kt, "showInputMessage"), t.setSource(o);
|
|
1978
2008
|
},
|
|
1979
2009
|
closeTag: (t) => {
|
|
1980
2010
|
const e = t.getSource();
|
|
1981
2011
|
if (!e?.rule) return;
|
|
1982
|
-
const s =
|
|
1983
|
-
s && (t.getAttribute("allowBlank",
|
|
2012
|
+
const s = A(e.rule, a);
|
|
2013
|
+
s && (t.getAttribute("allowBlank", Kt) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
|
|
1984
2014
|
}
|
|
1985
2015
|
};
|
|
1986
|
-
|
|
2016
|
+
u.registerVisitor(O), u.registerVisitor({
|
|
1987
2017
|
from: "formula1",
|
|
1988
2018
|
to: {},
|
|
1989
2019
|
text: (t, e) => {
|
|
1990
2020
|
const s = e.getParent().rule;
|
|
1991
|
-
s?.type && (s.formula1 =
|
|
2021
|
+
s?.type && (s.formula1 = E(t, s.type));
|
|
1992
2022
|
}
|
|
1993
|
-
}),
|
|
2023
|
+
}), u.registerVisitor({
|
|
1994
2024
|
from: "formula2",
|
|
1995
2025
|
to: {},
|
|
1996
2026
|
text: (t, e) => {
|
|
1997
2027
|
const s = e.getParent().rule;
|
|
1998
|
-
s?.type && (s.formula2 =
|
|
2028
|
+
s?.type && (s.formula2 = E(t, s.type));
|
|
1999
2029
|
}
|
|
2000
|
-
}),
|
|
2030
|
+
}), u.registerVisitor({
|
|
2001
2031
|
from: "picture",
|
|
2002
2032
|
to: "picture",
|
|
2003
2033
|
openTag: (t) => {
|
|
@@ -2007,7 +2037,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2007
2037
|
t.getSource().resId = o;
|
|
2008
2038
|
}
|
|
2009
2039
|
});
|
|
2010
|
-
const
|
|
2040
|
+
const D = {
|
|
2011
2041
|
from: "slicer",
|
|
2012
2042
|
to: {},
|
|
2013
2043
|
openTag: (t) => {
|
|
@@ -2019,8 +2049,8 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2019
2049
|
for (const t of r) i.slicers[t] = o[t];
|
|
2020
2050
|
}
|
|
2021
2051
|
};
|
|
2022
|
-
|
|
2023
|
-
const
|
|
2052
|
+
u.registerVisitor(D);
|
|
2053
|
+
const V = (t, e) => ({
|
|
2024
2054
|
from: t,
|
|
2025
2055
|
to: {},
|
|
2026
2056
|
openTag: (t) => {
|
|
@@ -2032,8 +2062,8 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2032
2062
|
closeTag: (t) => {
|
|
2033
2063
|
e(String(t.getSource() ?? ""), t);
|
|
2034
2064
|
}
|
|
2035
|
-
}),
|
|
2036
|
-
|
|
2065
|
+
}), L = /* @__PURE__ */ new Map();
|
|
2066
|
+
L.set("dataValidations", {
|
|
2037
2067
|
from: "dataValidations",
|
|
2038
2068
|
to: "validations",
|
|
2039
2069
|
openTag: (t) => {
|
|
@@ -2043,15 +2073,15 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2043
2073
|
closeTag: (t) => {
|
|
2044
2074
|
0 === (t.getSource()?.length ?? 0) && t.setSource(void 0);
|
|
2045
2075
|
}
|
|
2046
|
-
}),
|
|
2047
|
-
...
|
|
2076
|
+
}), L.set("dataValidation", {
|
|
2077
|
+
...O,
|
|
2048
2078
|
closeTag: (t) => {
|
|
2049
|
-
|
|
2079
|
+
O.closeTag(t);
|
|
2050
2080
|
const e = t.getSource();
|
|
2051
2081
|
e && !e.r && (t.warn("x14 dataValidation with no xm:sqref was dropped."), t.setSource(void 0));
|
|
2052
2082
|
}
|
|
2053
2083
|
});
|
|
2054
|
-
const
|
|
2084
|
+
const $ = (t) => ({
|
|
2055
2085
|
from: t,
|
|
2056
2086
|
to: {},
|
|
2057
2087
|
openTag: (e) => {
|
|
@@ -2061,14 +2091,14 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2061
2091
|
});
|
|
2062
2092
|
}
|
|
2063
2093
|
});
|
|
2064
|
-
|
|
2094
|
+
L.set("formula1", $("formula1")), L.set("formula2", $("formula2")), L.set("f", V("f", (t, e) => {
|
|
2065
2095
|
const s = e.getParent(), o = s?.rule;
|
|
2066
|
-
o && (o[s.key] =
|
|
2067
|
-
})),
|
|
2096
|
+
o && (o[s.key] = E(t, o.type));
|
|
2097
|
+
})), L.set("sqref", V("sqref", (t, e) => {
|
|
2068
2098
|
const s = e.getParent(), o = t.trim();
|
|
2069
2099
|
s && o && (s.r = o.split(/\s+/).join(","));
|
|
2070
2100
|
}));
|
|
2071
|
-
const
|
|
2101
|
+
const N = /* @__PURE__ */ new Map(), R = [], B = /* @__PURE__ */ new Map();
|
|
2072
2102
|
B.set("conditionalFormattings", {
|
|
2073
2103
|
from: "conditionalFormattings",
|
|
2074
2104
|
transparent: !0
|
|
@@ -2082,27 +2112,27 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2082
2112
|
const e = t.getSource(), s = e?.rules ?? [];
|
|
2083
2113
|
for (let t = 0; t < s.length; t++) {
|
|
2084
2114
|
const o = s[t];
|
|
2085
|
-
o.sqref = e.sqref, o.id ?
|
|
2115
|
+
o.sqref = e.sqref, o.id ? N.set(o.id, o) : R.push(o);
|
|
2086
2116
|
}
|
|
2087
2117
|
}
|
|
2088
2118
|
}), B.set("cfRule", {
|
|
2089
2119
|
from: "cfRule",
|
|
2090
2120
|
to: {},
|
|
2091
2121
|
openTag: (t) => {
|
|
2092
|
-
t.copyTo("id",
|
|
2122
|
+
t.copyTo("id", ee), t.copyTo("type", ee), t.copyTo("priority", Yt), t.copyTo("stopIfTrue", Kt), t.copyTo("operator", ee), t.copyTo("text", ee), t.copyTo("timePeriod", ee), t.copyTo("aboveAverage", Kt), t.copyTo("equalAverage", Kt), t.copyTo("stdDev", Yt), t.copyTo("bottom", Kt), t.copyTo("percent", Kt), t.copyTo("rank", Yt);
|
|
2093
2123
|
},
|
|
2094
2124
|
closeTag: (t) => {
|
|
2095
2125
|
const e = t.getSource();
|
|
2096
2126
|
e && t.getParent()?.rules?.push(e);
|
|
2097
2127
|
}
|
|
2098
|
-
}), B.set("sqref",
|
|
2128
|
+
}), B.set("sqref", V("sqref", (t, e) => {
|
|
2099
2129
|
const s = e.getParent(), o = t.trim();
|
|
2100
2130
|
s && o && (s.sqref = o);
|
|
2101
2131
|
})), B.set("dataBar", {
|
|
2102
2132
|
from: "dataBar",
|
|
2103
2133
|
to: {},
|
|
2104
2134
|
openTag: (t) => {
|
|
2105
|
-
t.copyTo("minLength",
|
|
2135
|
+
t.copyTo("minLength", Yt), t.copyTo("maxLength", Yt), t.copyTo("gradient", Kt), t.copyTo("border", Kt), t.copyTo("direction", ee), t.copyTo("axisPosition", ee), t.copyTo("negativeBarColorSameAsPositive", Kt), t.copyTo("negativeBarBorderColorSameAsPositive", Kt);
|
|
2106
2136
|
},
|
|
2107
2137
|
closeTag: (t) => {
|
|
2108
2138
|
t.getParent().dataBar = t.getSource();
|
|
@@ -2111,27 +2141,44 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2111
2141
|
from: "iconSet",
|
|
2112
2142
|
to: {},
|
|
2113
2143
|
openTag: (t) => {
|
|
2114
|
-
t.copyTo("iconSet",
|
|
2144
|
+
t.copyTo("iconSet", ee), t.copyTo("custom", Kt), t.copyTo("reverse", Kt), t.copyTo("showValue", Kt);
|
|
2115
2145
|
},
|
|
2116
2146
|
closeTag: (t) => {
|
|
2117
2147
|
t.getParent().iconSet = t.getSource();
|
|
2118
2148
|
}
|
|
2119
|
-
})
|
|
2149
|
+
});
|
|
2150
|
+
const _ = /* @__PURE__ */ new Map();
|
|
2151
|
+
_.set("f", V("f", (t, e) => {
|
|
2152
|
+
const s = e.getParent();
|
|
2153
|
+
if (!s) return;
|
|
2154
|
+
const o = t.trim(), i = Number(o);
|
|
2155
|
+
s.value = o.length > 0 && Number.isFinite(i) ? i : t;
|
|
2156
|
+
})), B.set("cfvo", {
|
|
2120
2157
|
from: "cfvo",
|
|
2121
2158
|
to: {},
|
|
2159
|
+
scope: () => _,
|
|
2122
2160
|
openTag: (t) => {
|
|
2123
2161
|
const e = t.getParent();
|
|
2124
2162
|
e.conditions || (e.conditions = []);
|
|
2125
2163
|
const s = t.getSource();
|
|
2126
|
-
e.conditions.push(s), t.copyTo("type",
|
|
2164
|
+
e.conditions.push(s), t.copyTo("type", ee), !1 === t.getAttribute("gte", Kt) && (s.exclusive = !0);
|
|
2127
2165
|
}
|
|
2128
|
-
}), B.set("f",
|
|
2166
|
+
}), B.set("f", V("f", (t, e) => {
|
|
2129
2167
|
const s = e.getParent();
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2168
|
+
s && (s.formulas ??= []).push(t);
|
|
2169
|
+
})), B.set("dxf", {
|
|
2170
|
+
from: "dxf",
|
|
2171
|
+
to: {},
|
|
2172
|
+
raw: !0,
|
|
2173
|
+
closeTag: (t) => {
|
|
2174
|
+
if (!y) return;
|
|
2175
|
+
const e = t.getParent();
|
|
2176
|
+
if (!e) return;
|
|
2177
|
+
const s = y(t.getRawXml() ?? "");
|
|
2178
|
+
s && (e.style = s);
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
2181
|
+
const z = (t) => ({
|
|
2135
2182
|
from: t,
|
|
2136
2183
|
to: {},
|
|
2137
2184
|
openTag: (s) => {
|
|
@@ -2139,11 +2186,11 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2139
2186
|
o && (s.getParent()[t] = o);
|
|
2140
2187
|
}
|
|
2141
2188
|
});
|
|
2142
|
-
B.set("borderColor",
|
|
2189
|
+
B.set("borderColor", z("borderColor")), B.set("negativeFillColor", z("negativeFillColor")), B.set("negativeBorderColor", z("negativeBorderColor")), B.set("axisColor", z("axisColor")), B.set("cfIcon", {
|
|
2143
2190
|
from: "cfIcon",
|
|
2144
2191
|
to: {},
|
|
2145
2192
|
openTag: (t) => {
|
|
2146
|
-
const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId",
|
|
2193
|
+
const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", Yt);
|
|
2147
2194
|
if (null === e || null === s) return;
|
|
2148
2195
|
const o = t.getParent();
|
|
2149
2196
|
o.icons || (o.icons = []), o.icons.push({
|
|
@@ -2152,54 +2199,54 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2152
2199
|
});
|
|
2153
2200
|
}
|
|
2154
2201
|
});
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2202
|
+
const X = /* @__PURE__ */ new Map();
|
|
2203
|
+
X.set("id", V("id", (t, e) => {
|
|
2157
2204
|
const s = e.getParent(), o = t.trim();
|
|
2158
2205
|
s && o && (s.x14Id = o);
|
|
2159
2206
|
}));
|
|
2160
|
-
const
|
|
2161
|
-
|
|
2207
|
+
const F = /* @__PURE__ */ new Map();
|
|
2208
|
+
F.set("slicerList", {
|
|
2162
2209
|
from: "slicerList",
|
|
2163
2210
|
transparent: !0
|
|
2164
|
-
}),
|
|
2165
|
-
const
|
|
2166
|
-
[
|
|
2167
|
-
[
|
|
2168
|
-
[
|
|
2169
|
-
[
|
|
2170
|
-
[
|
|
2171
|
-
[
|
|
2172
|
-
]),
|
|
2173
|
-
|
|
2211
|
+
}), F.set("slicer", D);
|
|
2212
|
+
const W = /* @__PURE__ */ new Map([
|
|
2213
|
+
[l(g), L],
|
|
2214
|
+
[l(c), B],
|
|
2215
|
+
[l(w), B],
|
|
2216
|
+
[l(S), X],
|
|
2217
|
+
[l(m), F],
|
|
2218
|
+
[l(f), F]
|
|
2219
|
+
]), U = /* @__PURE__ */ new Set();
|
|
2220
|
+
u.registerVisitor({
|
|
2174
2221
|
from: "extLst",
|
|
2175
2222
|
transparent: !0
|
|
2176
|
-
}),
|
|
2223
|
+
}), u.registerVisitor({
|
|
2177
2224
|
from: "ext",
|
|
2178
2225
|
transparent: !0,
|
|
2179
2226
|
scope: (t) => {
|
|
2180
|
-
const e = t.getAttribute("uri"), s =
|
|
2227
|
+
const e = t.getAttribute("uri"), s = l(e), o = W.get(s);
|
|
2181
2228
|
if (o) return o;
|
|
2182
|
-
if (!
|
|
2183
|
-
|
|
2184
|
-
const o =
|
|
2229
|
+
if (!d.has(s) && !U.has(s)) {
|
|
2230
|
+
U.add(s);
|
|
2231
|
+
const o = T[s];
|
|
2185
2232
|
t.warn(o ? `Extension content '${o}' (${e}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${e}) is not read; it will be lost on resave.`);
|
|
2186
2233
|
}
|
|
2187
2234
|
return null;
|
|
2188
2235
|
}
|
|
2189
|
-
}),
|
|
2236
|
+
}), u.registerVisitor({
|
|
2190
2237
|
from: "mergeCell",
|
|
2191
2238
|
to: [],
|
|
2192
2239
|
openTag: (t) => {
|
|
2193
2240
|
const e = t.getAttribute("ref");
|
|
2194
2241
|
t.setSource(e);
|
|
2195
2242
|
}
|
|
2196
|
-
}),
|
|
2243
|
+
}), u.registerVisitor({
|
|
2197
2244
|
from: "hyperlinks",
|
|
2198
2245
|
to: "hyperlinks",
|
|
2199
2246
|
openTag: (t) => {
|
|
2200
2247
|
t.setSource([]);
|
|
2201
2248
|
}
|
|
2202
|
-
}),
|
|
2249
|
+
}), u.registerVisitor({
|
|
2203
2250
|
from: "hyperlink",
|
|
2204
2251
|
to: [],
|
|
2205
2252
|
openTag: (t) => {
|
|
@@ -2221,7 +2268,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2221
2268
|
v: n
|
|
2222
2269
|
});
|
|
2223
2270
|
}
|
|
2224
|
-
}),
|
|
2271
|
+
}), u.registerVisitor({
|
|
2225
2272
|
from: "drawing",
|
|
2226
2273
|
to: "movables",
|
|
2227
2274
|
openTag: (t) => {
|
|
@@ -2230,13 +2277,13 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2230
2277
|
const o = s(e);
|
|
2231
2278
|
o ? t.setSource(o.movables) : console.warn("no drawing found for rId", e);
|
|
2232
2279
|
}
|
|
2233
|
-
}),
|
|
2280
|
+
}), u.registerVisitor({
|
|
2234
2281
|
from: "tableParts",
|
|
2235
2282
|
to: "tables",
|
|
2236
2283
|
openTag: (t) => {
|
|
2237
2284
|
t.setSource([]);
|
|
2238
2285
|
}
|
|
2239
|
-
}),
|
|
2286
|
+
}), u.registerVisitor({
|
|
2240
2287
|
from: "tablePart",
|
|
2241
2288
|
to: [],
|
|
2242
2289
|
openTag: (t) => {
|
|
@@ -2246,23 +2293,35 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2246
2293
|
o ? t.setSource(o) : console.warn("no table found for rId", e);
|
|
2247
2294
|
}
|
|
2248
2295
|
});
|
|
2249
|
-
const
|
|
2250
|
-
e.conditions?.length && (t.stops =
|
|
2251
|
-
},
|
|
2252
|
-
e.conditions?.length && (t.stops =
|
|
2253
|
-
},
|
|
2254
|
-
if (
|
|
2255
|
-
const e =
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2296
|
+
const G = (t, e) => {
|
|
2297
|
+
e.conditions?.length && (t.stops = P(e)), void 0 !== e.minLength && (t.minLength = e.minLength), void 0 !== e.maxLength && (t.maxLength = e.maxLength), (e.gradient ?? 1) && (t.gradient = !0), e.border && e.borderColor && (t.borderColor = e.borderColor), !e.negativeBarColorSameAsPositive && e.negativeFillColor && (t.negativeFillColor = e.negativeFillColor), !(e.negativeBarBorderColorSameAsPositive ?? 1) && e.negativeBorderColor && (t.negativeBorderColor = e.negativeBorderColor), e.axisColor && (t.axisColor = e.axisColor), "middle" !== e.axisPosition && "none" !== e.axisPosition || (t.axisPosition = e.axisPosition), "leftToRight" !== e.direction && "rightToLeft" !== e.direction || (t.direction = e.direction);
|
|
2298
|
+
}, Z = (t, e) => {
|
|
2299
|
+
e.conditions?.length && (t.stops = P(e)), e.iconSet && e.iconSet !== t.iconSet && (t.iconSet = e.iconSet), e.icons?.length && (t.icon = e.icons), void 0 !== e.reverse && (t.reverse = e.reverse), void 0 !== e.showValue && (t.showValue = e.showValue);
|
|
2300
|
+
}, J = (t) => {
|
|
2301
|
+
if (!t.sqref) return null;
|
|
2302
|
+
const e = t.sqref.split(/\s+/).join(",");
|
|
2303
|
+
if ("iconSet" === t.type) {
|
|
2304
|
+
if (!t.iconSet) return null;
|
|
2305
|
+
const s = {
|
|
2306
|
+
type: H.ScaleType.IconSet,
|
|
2307
|
+
stops: []
|
|
2308
|
+
};
|
|
2309
|
+
return Z(s, t.iconSet), {
|
|
2310
|
+
r: e,
|
|
2311
|
+
v: { scale: s },
|
|
2312
|
+
priority: t.priority
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
const s = b(t, a);
|
|
2316
|
+
if (!s) return null;
|
|
2317
|
+
const o = { condition: s };
|
|
2318
|
+
return t.style && (o.style = t.style), t.stopIfTrue && (o.stopIfTrue = !0), {
|
|
2319
|
+
r: e,
|
|
2320
|
+
v: o,
|
|
2262
2321
|
priority: t.priority
|
|
2263
2322
|
};
|
|
2264
2323
|
};
|
|
2265
|
-
|
|
2324
|
+
u.registerVisitor({
|
|
2266
2325
|
from: "worksheet",
|
|
2267
2326
|
to: {},
|
|
2268
2327
|
openTag: (t) => {},
|
|
@@ -2273,23 +2332,28 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2273
2332
|
const e = s[t], o = e.x14Id;
|
|
2274
2333
|
if (!o) continue;
|
|
2275
2334
|
delete e.x14Id;
|
|
2276
|
-
const i =
|
|
2335
|
+
const i = N.get(o);
|
|
2277
2336
|
if (!i) continue;
|
|
2278
|
-
|
|
2337
|
+
N.delete(o);
|
|
2279
2338
|
const r = e.v?.scale;
|
|
2280
|
-
i.dataBar && r?.type ===
|
|
2339
|
+
i.dataBar && r?.type === H.ScaleType.DataBar ? G(r, i.dataBar) : i.iconSet && r?.type === H.ScaleType.IconSet && Z(r, i.iconSet);
|
|
2281
2340
|
}
|
|
2282
|
-
const o = [
|
|
2341
|
+
const o = [...N.values(), ...R], i = /* @__PURE__ */ new Set();
|
|
2342
|
+
let r = 0;
|
|
2283
2343
|
for (let t = 0; t < o.length; t++) {
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2344
|
+
const n = J(o[t]);
|
|
2345
|
+
n ? (s || (s = [], e.conditionals = s), s.push(n)) : (i.add(o[t].type ?? "unknown"), r++);
|
|
2346
|
+
}
|
|
2347
|
+
if (r > 0) {
|
|
2348
|
+
const t = [...i].map((t) => `'${t}'`).join(", ");
|
|
2349
|
+
a?.(1 === r ? `An x14-only conditional formatting rule (type ${t}) is not read and will be lost on resave.` : `${r} x14-only conditional formatting rules (types ${t}) are not read and will be lost on resave.`);
|
|
2286
2350
|
}
|
|
2287
2351
|
if (s) {
|
|
2288
2352
|
s.length > 1 && s.sort((t, e) => (t.priority ?? Infinity) - (e.priority ?? Infinity));
|
|
2289
2353
|
for (let t = 0; t < s.length; t++) delete s[t].priority;
|
|
2290
2354
|
}
|
|
2291
2355
|
}
|
|
2292
|
-
}),
|
|
2356
|
+
}), u.registerVisitor({
|
|
2293
2357
|
from: "customProperties",
|
|
2294
2358
|
to: "customProperties",
|
|
2295
2359
|
openTag: (t) => {
|
|
@@ -2299,7 +2363,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2299
2363
|
const e = t.getSource();
|
|
2300
2364
|
e.length > 0 && (t.getParent().customProperties = e);
|
|
2301
2365
|
}
|
|
2302
|
-
}),
|
|
2366
|
+
}), u.registerVisitor({
|
|
2303
2367
|
from: "customPr",
|
|
2304
2368
|
to: {},
|
|
2305
2369
|
openTag: (t) => {
|
|
@@ -2310,24 +2374,24 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2310
2374
|
const i = s(o, !0), r = t.getSource();
|
|
2311
2375
|
r.resId = i, e.push(r);
|
|
2312
2376
|
}
|
|
2313
|
-
}),
|
|
2377
|
+
}), u.registerVisitor({
|
|
2314
2378
|
from: "sheetProtection",
|
|
2315
2379
|
to: "protection",
|
|
2316
2380
|
openTag: (t) => {
|
|
2317
2381
|
let e = !1;
|
|
2318
|
-
if (t.hasAttribute("sheet") &&
|
|
2382
|
+
if (t.hasAttribute("sheet") && Kt(t.getAttribute("sheet")) && (e = !0), !e) return void t.setSource(void 0);
|
|
2319
2383
|
const s = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null;
|
|
2320
2384
|
t.copyTo("autoTable", s), t.copyTo("deleteColumns", s), t.copyTo("formatCells", s), t.copyTo("formatColumns", s), t.copyTo("formatRows", s), t.copyTo("insertColumns", s), t.copyTo("insertHyperlinks", s), t.copyTo("insertRows", s), t.copyTo("objects", s), t.copyTo("pivotTables", s), t.copyTo("scenarios", s), t.copyTo("selectLockedCells", s), t.copyTo("selectUnlockedCells", s), t.copyTo("sort", s);
|
|
2321
2385
|
const o = {};
|
|
2322
|
-
t.copyToObject(o, "hash",
|
|
2386
|
+
t.copyToObject(o, "hash", ee, "hashValue"), t.copyToObject(o, "algorithm", ee, "algorithmName"), t.copyToObject(o, "salt", ee, "saltValue"), t.copyToObject(o, "spinCount", Yt), Object.keys(o).length > 0 && (t.getSource().password = o);
|
|
2323
2387
|
}
|
|
2324
|
-
}),
|
|
2388
|
+
}), u.registerVisitor({
|
|
2325
2389
|
from: "protectedRanges",
|
|
2326
2390
|
to: "protectedRanges",
|
|
2327
2391
|
openTag: (t) => {
|
|
2328
2392
|
t.setSource([]);
|
|
2329
2393
|
}
|
|
2330
|
-
}),
|
|
2394
|
+
}), u.registerVisitor({
|
|
2331
2395
|
from: "protectedRange",
|
|
2332
2396
|
to: [],
|
|
2333
2397
|
openTag: (t) => {
|
|
@@ -2339,90 +2403,90 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2339
2403
|
};
|
|
2340
2404
|
t.copyToObject(s, "name"), t.copyToObject(s, "securityDescriptor");
|
|
2341
2405
|
const i = {};
|
|
2342
|
-
t.copyToObject(i, "hash",
|
|
2406
|
+
t.copyToObject(i, "hash", ee, "hashValue"), t.copyToObject(i, "algorithm", ee, "algorithmName"), t.copyToObject(i, "salt", ee, "saltValue"), t.copyToObject(i, "spinCount", Yt), Object.keys(i).length > 0 && (s.password = i), t.setSource(o);
|
|
2343
2407
|
},
|
|
2344
2408
|
closeTag: (t) => {
|
|
2345
2409
|
const e = t.getSource();
|
|
2346
2410
|
e?.r && e.v.name || t.setSource(void 0);
|
|
2347
2411
|
}
|
|
2348
|
-
}),
|
|
2412
|
+
}), u.registerVisitor({
|
|
2349
2413
|
from: "sheetFormatPr",
|
|
2350
2414
|
to: "sheetFormatPr",
|
|
2351
2415
|
openTag: (e) => {
|
|
2352
|
-
e.copyToObject(t, "defaultColSize",
|
|
2416
|
+
e.copyToObject(t, "defaultColSize", te, "defaultColWidth"), e.copyToObject(t, "outlineLevelCol", Yt, "outlineLevelCol");
|
|
2353
2417
|
const s = e.getAttribute("customHeight");
|
|
2354
|
-
"1" !== s && "true" !== s || e.copyToObject(t, "defaultRowSize",
|
|
2418
|
+
"1" !== s && "true" !== s || e.copyToObject(t, "defaultRowSize", te, "defaultRowHeight"), e.copyToObject(t, "outlineLevelRow", Yt, "outlineLevelRow");
|
|
2355
2419
|
}
|
|
2356
|
-
}),
|
|
2420
|
+
}), u.registerVisitor({
|
|
2357
2421
|
from: "cols",
|
|
2358
2422
|
to: "cols",
|
|
2359
2423
|
openTag: (t) => {
|
|
2360
2424
|
t.setSource([]);
|
|
2361
2425
|
}
|
|
2362
|
-
}),
|
|
2426
|
+
}), u.registerVisitor({
|
|
2363
2427
|
from: "col",
|
|
2364
2428
|
to: [],
|
|
2365
2429
|
openTag: (t) => {
|
|
2366
2430
|
const e = t.getSource(), s = t.getAttribute("min"), o = t.getAttribute("max"), i = void 0 === s ? 0 : parseInt(s) - 1, r = void 0 === o ? i : parseInt(o) - 1;
|
|
2367
|
-
e.r =
|
|
2431
|
+
e.r = j.runToString(i, r, !0);
|
|
2368
2432
|
const n = {};
|
|
2369
|
-
e.v = n, t.copyToObject(n, "sz",
|
|
2433
|
+
e.v = n, t.copyToObject(n, "sz", te, "width"), t.copyToObject(n, "csz", Kt, "customWidth"), t.copyToObject(n, "h", Kt, "hidden"), t.copyToObject(n, "l", Yt, "outlineLevel"), t.copyToObject(n, "s", Yt, "style");
|
|
2370
2434
|
}
|
|
2371
|
-
}),
|
|
2435
|
+
}), u.registerVisitor({
|
|
2372
2436
|
from: "oleObjects",
|
|
2373
2437
|
to: null,
|
|
2374
2438
|
openTag: (t) => {
|
|
2375
2439
|
t.warn("'OLE Objects' are not supported.");
|
|
2376
2440
|
}
|
|
2377
2441
|
});
|
|
2378
|
-
let
|
|
2379
|
-
const
|
|
2442
|
+
let Q = !1, K = !1, Y = 0, tt = "";
|
|
2443
|
+
const et = (t) => {
|
|
2380
2444
|
const e = t.indexOf(":");
|
|
2381
2445
|
return -1 === e ? t : t.slice(e + 1);
|
|
2382
2446
|
};
|
|
2383
|
-
return
|
|
2447
|
+
return fe(x, t, u.createEventHandler(t, n, a), a, h, {
|
|
2384
2448
|
onOpenTag: (t) => {
|
|
2385
|
-
|
|
2386
|
-
const e =
|
|
2387
|
-
"t" === e || "v" === e ? 0 ===
|
|
2449
|
+
Q = !0;
|
|
2450
|
+
const e = et(t.name);
|
|
2451
|
+
"t" === e || "v" === e ? 0 === Y && (K = !0) : "rPh" !== e && "phoneticPr" !== e || Y++;
|
|
2388
2452
|
},
|
|
2389
2453
|
onText: (t) => {
|
|
2390
|
-
|
|
2454
|
+
K && (tt += t);
|
|
2391
2455
|
},
|
|
2392
2456
|
onCloseTag: (t) => {
|
|
2393
|
-
const e =
|
|
2394
|
-
"t" === e || "v" === e ?
|
|
2457
|
+
const e = et(t.name);
|
|
2458
|
+
"t" === e || "v" === e ? K = !1 : "rPh" !== e && "phoneticPr" !== e || Y > 0 && Y--;
|
|
2395
2459
|
},
|
|
2396
2460
|
onEnd: () => {
|
|
2397
|
-
if (!
|
|
2398
|
-
const t = o(
|
|
2399
|
-
return
|
|
2461
|
+
if (!Q) return;
|
|
2462
|
+
const t = o(v(tt));
|
|
2463
|
+
return Q = !1, K = !1, Y = 0, tt = "", t;
|
|
2400
2464
|
},
|
|
2401
2465
|
onError: (t) => {}
|
|
2402
|
-
},
|
|
2403
|
-
})(t, (t, e = !1) =>
|
|
2404
|
-
const s = e ? `${e} (${
|
|
2405
|
-
|
|
2406
|
-
}, void 0,
|
|
2466
|
+
}, p);
|
|
2467
|
+
})(t, (t, e = !1) => gt(t, x, e) ?? null, kt, I, () => {}, (t, e) => {
|
|
2468
|
+
const s = e ? `${e} (${x})` : x;
|
|
2469
|
+
Z.push([t, s]);
|
|
2470
|
+
}, void 0, it), i = await ut.getTextStream(x, ot);
|
|
2407
2471
|
if (i) try {
|
|
2408
|
-
await
|
|
2472
|
+
await Wt.parseStream(i, o, { xmlns: !1 });
|
|
2409
2473
|
} catch (t) {
|
|
2410
|
-
throw console.warn(`Error parsing sheet: '${
|
|
2474
|
+
throw console.warn(`Error parsing sheet: '${x}'`, t), new Error(`Error parsing sheet: '${x}'`, { cause: t });
|
|
2411
2475
|
}
|
|
2412
|
-
const n =
|
|
2413
|
-
let a,
|
|
2476
|
+
const n = dt(x, u);
|
|
2477
|
+
let a, h = /* @__PURE__ */ new Map();
|
|
2414
2478
|
if (n) {
|
|
2415
2479
|
const e = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
|
|
2416
2480
|
let o;
|
|
2417
2481
|
n.forEach((t, s) => {
|
|
2418
|
-
t.type === e && (a =
|
|
2482
|
+
t.type === e && (a = gt(s, x, !1, u)?.comments, a && a.forEach((t) => {
|
|
2419
2483
|
const e = t.v;
|
|
2420
|
-
|
|
2484
|
+
h.set(e.id, t);
|
|
2421
2485
|
}));
|
|
2422
2486
|
});
|
|
2423
2487
|
const i = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
|
2424
2488
|
if (n.forEach((t, e) => {
|
|
2425
|
-
t.type === i && (o =
|
|
2489
|
+
t.type === i && (o = gt(e, x, !1, u));
|
|
2426
2490
|
}), o || a) {
|
|
2427
2491
|
const e = a ?? [], i = o?.authors, r = o?.comments, n = r ? r.length : 0;
|
|
2428
2492
|
if (r) for (let t = 0; t < n; t++) {
|
|
@@ -2430,166 +2494,166 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2430
2494
|
if (!o) continue;
|
|
2431
2495
|
const n = o.v;
|
|
2432
2496
|
let a = i && void 0 !== n.personId ? i[n.personId] : n.personId;
|
|
2433
|
-
if (a && a.startsWith("tc=") && (a = s(a.substring(3)),
|
|
2434
|
-
const
|
|
2435
|
-
id:
|
|
2436
|
-
personId:
|
|
2497
|
+
if (a && a.startsWith("tc=") && (a = s(a.substring(3)), h.has(a))) continue;
|
|
2498
|
+
const c = xt({ displayName: a }), l = {
|
|
2499
|
+
id: L.uuidV4(),
|
|
2500
|
+
personId: c.id,
|
|
2437
2501
|
done: !1,
|
|
2438
2502
|
asNote: !0,
|
|
2439
2503
|
content: n.content
|
|
2440
2504
|
};
|
|
2441
2505
|
e.push({
|
|
2442
2506
|
r: o.r,
|
|
2443
|
-
v:
|
|
2507
|
+
v: l
|
|
2444
2508
|
});
|
|
2445
2509
|
}
|
|
2446
2510
|
t.comments = e;
|
|
2447
2511
|
}
|
|
2448
2512
|
}
|
|
2449
2513
|
};
|
|
2450
|
-
|
|
2451
|
-
} else if (
|
|
2452
|
-
const t = o(
|
|
2514
|
+
ht.push(o());
|
|
2515
|
+
} else if (y.type === n) {
|
|
2516
|
+
const t = o(x, h, ct, at, bt);
|
|
2453
2517
|
if (t && 0 !== Object.keys(t).length) {
|
|
2454
2518
|
const e = t, s = [];
|
|
2455
|
-
|
|
2519
|
+
dt(x, u)?.forEach((t) => {
|
|
2456
2520
|
"External" === t.targetMode && t.type && t.target && s.push({
|
|
2457
2521
|
type: t.type,
|
|
2458
2522
|
target: t.target
|
|
2459
2523
|
});
|
|
2460
2524
|
}), e.identity = s, O = e;
|
|
2461
2525
|
} else O = null;
|
|
2462
|
-
} else O =
|
|
2463
|
-
const s =
|
|
2464
|
-
return s.addReference(
|
|
2465
|
-
},
|
|
2526
|
+
} else O = p ? t(x, h, (t, e) => {
|
|
2527
|
+
const s = z.add({ source: { buffer: t } });
|
|
2528
|
+
return s.addReference(Y), st.add(s), K.toResourceId(s);
|
|
2529
|
+
}, bt) : o(x, h, ct, at, bt);
|
|
2466
2530
|
}
|
|
2467
2531
|
return O;
|
|
2468
2532
|
};
|
|
2469
|
-
a("coreprops",
|
|
2470
|
-
const
|
|
2471
|
-
let
|
|
2472
|
-
if (
|
|
2473
|
-
const t =
|
|
2533
|
+
a("coreprops", C, h, ct, at), a("extprops", C, h, ct, at);
|
|
2534
|
+
const mt = /* @__PURE__ */ new Map(), ft = /* @__PURE__ */ new Map(), Tt = a("people", C, h, ct, at);
|
|
2535
|
+
let yt = null;
|
|
2536
|
+
if (Tt.size > 0 && (yt = Tt.entries().next()?.value?.[1]?.persons, yt)) {
|
|
2537
|
+
const t = yt.length;
|
|
2474
2538
|
for (let e = 0; e < t; e++) {
|
|
2475
|
-
const t =
|
|
2476
|
-
|
|
2539
|
+
const t = yt[e];
|
|
2540
|
+
mt.set(t.id, t), void 0 !== t.displayName && ft.set(t.displayName, t);
|
|
2477
2541
|
}
|
|
2478
2542
|
}
|
|
2479
|
-
const
|
|
2543
|
+
const xt = (t) => {
|
|
2480
2544
|
if (!t) return;
|
|
2481
|
-
if (t.id &&
|
|
2545
|
+
if (t.id && mt.has(t.id)) return mt.get(t.id);
|
|
2482
2546
|
let e = t.displayName;
|
|
2483
2547
|
if (!t.id) {
|
|
2484
2548
|
if (e) {
|
|
2485
|
-
const t =
|
|
2549
|
+
const t = ft.get(e);
|
|
2486
2550
|
if (t) return t;
|
|
2487
2551
|
}
|
|
2488
|
-
t.id =
|
|
2552
|
+
t.id = L.uuidV4();
|
|
2489
2553
|
}
|
|
2490
|
-
const s =
|
|
2554
|
+
const s = mt.get(t.id);
|
|
2491
2555
|
if (s) return s;
|
|
2492
2556
|
const o = t;
|
|
2493
|
-
return
|
|
2494
|
-
},
|
|
2495
|
-
paramMap:
|
|
2496
|
-
getRefs:
|
|
2497
|
-
getRef:
|
|
2498
|
-
parsedRefs:
|
|
2499
|
-
addPerson:
|
|
2500
|
-
serializeElement:
|
|
2501
|
-
},
|
|
2502
|
-
if (
|
|
2503
|
-
const t = await
|
|
2557
|
+
return mt.set(t.id, o), e && ft.set(e, o), yt || (yt = []), yt.push(o), o;
|
|
2558
|
+
}, bt = {
|
|
2559
|
+
paramMap: it,
|
|
2560
|
+
getRefs: dt,
|
|
2561
|
+
getRef: gt,
|
|
2562
|
+
parsedRefs: lt,
|
|
2563
|
+
addPerson: xt,
|
|
2564
|
+
serializeElement: pt
|
|
2565
|
+
}, vt = [];
|
|
2566
|
+
if (P) {
|
|
2567
|
+
const t = await ut.getTextStream(P, ot);
|
|
2504
2568
|
if (t) {
|
|
2505
2569
|
const e = ((t, e) => {
|
|
2506
2570
|
let s = !1, o = !1, i = 0, r = "";
|
|
2507
2571
|
return {
|
|
2508
2572
|
onOpenTag: (t) => {
|
|
2509
|
-
const e =
|
|
2573
|
+
const e = Te(t.name);
|
|
2510
2574
|
"t" === e ? s && 0 === i && (o = !0) : "si" === e ? (s = !0, r = "", i = 0) : "rPh" !== e && "phoneticPr" !== e || i++;
|
|
2511
2575
|
},
|
|
2512
2576
|
onText: (t) => {
|
|
2513
2577
|
o && (r += t);
|
|
2514
2578
|
},
|
|
2515
2579
|
onCloseTag: (e) => {
|
|
2516
|
-
const n =
|
|
2517
|
-
"t" === n ? o = !1 : "si" === n ? (t(
|
|
2580
|
+
const n = Te(e.name);
|
|
2581
|
+
"t" === n ? o = !1 : "si" === n ? (t(v(r)), s = !1, r = "") : "rPh" !== n && "phoneticPr" !== n || i > 0 && i--;
|
|
2518
2582
|
},
|
|
2519
2583
|
onError: (t) => {
|
|
2520
2584
|
e?.(`Error parsing shared strings: ${t?.message ?? t}`);
|
|
2521
2585
|
}
|
|
2522
2586
|
};
|
|
2523
2587
|
})((t) => {
|
|
2524
|
-
|
|
2588
|
+
vt.push(t);
|
|
2525
2589
|
}, (t) => {
|
|
2526
|
-
|
|
2590
|
+
Z.push([t, P]);
|
|
2527
2591
|
});
|
|
2528
2592
|
try {
|
|
2529
|
-
await
|
|
2593
|
+
await Wt.parseStream(t, e, { xmlns: !1 });
|
|
2530
2594
|
} catch (t) {
|
|
2531
|
-
throw console.warn(`Error parsing shared strings: '${
|
|
2595
|
+
throw console.warn(`Error parsing shared strings: '${P}'`, t), new Error(`Error parsing shared strings: '${P}'`, { cause: t });
|
|
2532
2596
|
}
|
|
2533
2597
|
}
|
|
2534
2598
|
}
|
|
2535
|
-
|
|
2536
|
-
let
|
|
2537
|
-
const
|
|
2538
|
-
let
|
|
2539
|
-
const
|
|
2540
|
-
const e =
|
|
2599
|
+
G?.mark("shared-strings");
|
|
2600
|
+
let wt = vt.length;
|
|
2601
|
+
const St = /* @__PURE__ */ new Map();
|
|
2602
|
+
let Ct = wt;
|
|
2603
|
+
const kt = (t) => {
|
|
2604
|
+
const e = St.get(t);
|
|
2541
2605
|
if (void 0 !== e) return e;
|
|
2542
|
-
const s =
|
|
2543
|
-
return
|
|
2544
|
-
},
|
|
2545
|
-
|
|
2546
|
-
const
|
|
2547
|
-
for (let t = 0; t <
|
|
2548
|
-
const e =
|
|
2549
|
-
e && e.startsWith("xl/slicerCache") &&
|
|
2606
|
+
const s = Ct;
|
|
2607
|
+
return St.set(t, Ct++), vt.push(t), s;
|
|
2608
|
+
}, Pt = [];
|
|
2609
|
+
C.slicersCache = Pt;
|
|
2610
|
+
const At = ut.getNames(), Et = At.length;
|
|
2611
|
+
for (let t = 0; t < Et; t++) {
|
|
2612
|
+
const e = At[t];
|
|
2613
|
+
e && e.startsWith("xl/slicerCache") && Pt.push(`/${e}`);
|
|
2550
2614
|
}
|
|
2551
|
-
const
|
|
2552
|
-
|
|
2615
|
+
const It = a("slicersCache", C, h, ct, at, bt), Ot = /* @__PURE__ */ new Map();
|
|
2616
|
+
It.forEach((t) => {
|
|
2553
2617
|
const e = t.name;
|
|
2554
|
-
delete t.name,
|
|
2555
|
-
}),
|
|
2556
|
-
const
|
|
2557
|
-
let
|
|
2558
|
-
if (
|
|
2559
|
-
let t =
|
|
2560
|
-
t?.value?.[1] && (
|
|
2618
|
+
delete t.name, Ot.set(e, t);
|
|
2619
|
+
}), it.set("slicerCaches", Ot), a("richstructure", C, h, ct, at, bt), a("richdata", C, h, ct, at, bt);
|
|
2620
|
+
const Dt = a("themes", C, h, ct, at, bt);
|
|
2621
|
+
let Vt = null;
|
|
2622
|
+
if (Dt && Dt.entries) {
|
|
2623
|
+
let t = Dt.entries().next();
|
|
2624
|
+
t?.value?.[1] && (Vt = t.value[1]);
|
|
2561
2625
|
}
|
|
2562
|
-
const
|
|
2563
|
-
let
|
|
2564
|
-
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2567
|
-
const
|
|
2568
|
-
...
|
|
2569
|
-
styles:
|
|
2570
|
-
theme:
|
|
2626
|
+
const Lt = new F(Vt);
|
|
2627
|
+
let $t = a("styles", C, h, ct, at, bt).entries().next()?.value?.[1];
|
|
2628
|
+
$t && ($t = JSON.parse(V.JSONStableStringify($t)));
|
|
2629
|
+
const jt = a("workbooks", C, h, ct, at, bt);
|
|
2630
|
+
G?.mark("side-parts-json"), await Promise.all(ht), Q && et > 0 && (Q(tt, tt), await new Promise((t) => setTimeout(t, 0))), G?.mark("sheets");
|
|
2631
|
+
const Nt = {
|
|
2632
|
+
...jt.entries().next().value?.[1],
|
|
2633
|
+
styles: $t,
|
|
2634
|
+
theme: Lt.toJSON()
|
|
2571
2635
|
};
|
|
2572
|
-
if (
|
|
2573
|
-
const t =
|
|
2636
|
+
if (vt.length > 0 && (Nt.strings = vt), yt && yt.length > 0 && (Nt.people = yt), N) {
|
|
2637
|
+
const t = ut.getEntry("xl/vbaProject.bin");
|
|
2574
2638
|
if (t) try {
|
|
2575
|
-
const { VBAProject: e } = await import("./
|
|
2576
|
-
s ? (
|
|
2639
|
+
const { VBAProject: e } = await import("./CfIzBnObj09fDuUX.mjs"), s = e.extract(t);
|
|
2640
|
+
s ? (N?.(s), Nt.vba = s) : Z.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
|
|
2577
2641
|
} catch (t) {
|
|
2578
|
-
|
|
2642
|
+
Z.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
|
|
2579
2643
|
}
|
|
2580
2644
|
}
|
|
2581
|
-
let
|
|
2582
|
-
const
|
|
2583
|
-
...
|
|
2584
|
-
resources:
|
|
2585
|
-
json:
|
|
2586
|
-
formulaTransform:
|
|
2645
|
+
let Rt = null;
|
|
2646
|
+
const Bt = {
|
|
2647
|
+
...B,
|
|
2648
|
+
resources: z,
|
|
2649
|
+
json: Nt,
|
|
2650
|
+
formulaTransform: x(() => Rt?.getCalculation())
|
|
2587
2651
|
};
|
|
2588
|
-
void 0 ===
|
|
2589
|
-
const
|
|
2590
|
-
if (
|
|
2591
|
-
await
|
|
2592
|
-
const t = /* @__PURE__ */ new Map(), e =
|
|
2652
|
+
void 0 === Bt.disableLoadAutoFit && (Bt.disableLoadAutoFit = !1), G?.mark("json-assembled");
|
|
2653
|
+
const Mt = new W(Bt);
|
|
2654
|
+
if (Rt = Mt, G?.mark("workbook-constructed"), rt.length > 0) {
|
|
2655
|
+
await Mt.whenCalculationReady();
|
|
2656
|
+
const t = /* @__PURE__ */ new Map(), e = Nt.sheets ?? [], s = Mt.getSheets().getItems();
|
|
2593
2657
|
for (let o = 0; o < e.length; o++) {
|
|
2594
2658
|
const i = e[o]?.sheet, r = s[o];
|
|
2595
2659
|
i && r && t.set(i, r);
|
|
@@ -2611,7 +2675,7 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2611
2675
|
for (const t of e) null === t.formula && n.add(i(t.rowIndex, t.colIndex));
|
|
2612
2676
|
for (const t of e) {
|
|
2613
2677
|
if (null === t.formula) continue;
|
|
2614
|
-
const e =
|
|
2678
|
+
const e = pe(t.formula);
|
|
2615
2679
|
let s = !0;
|
|
2616
2680
|
for (const t of e) if (!r(t)) {
|
|
2617
2681
|
s = !1;
|
|
@@ -2645,20 +2709,20 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2645
2709
|
}).setValue("=" + t.formula);
|
|
2646
2710
|
}
|
|
2647
2711
|
}
|
|
2648
|
-
})(
|
|
2712
|
+
})(Mt, rt, t);
|
|
2649
2713
|
}
|
|
2650
|
-
if (
|
|
2651
|
-
t.deleteReference(
|
|
2652
|
-
}),
|
|
2653
|
-
|
|
2714
|
+
if (st.forEach((t) => {
|
|
2715
|
+
t.deleteReference(Y);
|
|
2716
|
+
}), K.endPersist(), U) {
|
|
2717
|
+
O(U);
|
|
2654
2718
|
const t = /* @__PURE__ */ new Map();
|
|
2655
2719
|
let e = 0;
|
|
2656
|
-
for (const s of
|
|
2657
|
-
const o =
|
|
2720
|
+
for (const s of ut.getNames()) {
|
|
2721
|
+
const o = ut.getEntry(s);
|
|
2658
2722
|
if (!o) continue;
|
|
2659
|
-
const i =
|
|
2723
|
+
const i = ut.getRawEntry(s), r = i ? {
|
|
2660
2724
|
data: o,
|
|
2661
|
-
uncompressedSize:
|
|
2725
|
+
uncompressedSize: ut.uncompressedSize(s),
|
|
2662
2726
|
raw: {
|
|
2663
2727
|
compressedData: i.data,
|
|
2664
2728
|
compressionMethod: i.compressionMethod,
|
|
@@ -2666,37 +2730,37 @@ var Zt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2666
2730
|
}
|
|
2667
2731
|
} : {
|
|
2668
2732
|
data: o,
|
|
2669
|
-
uncompressedSize:
|
|
2733
|
+
uncompressedSize: ut.uncompressedSize(s)
|
|
2670
2734
|
};
|
|
2671
2735
|
t.set(s, r), e += o.byteLength;
|
|
2672
2736
|
}
|
|
2673
|
-
if (e > 67108864)
|
|
2737
|
+
if (e > 67108864) Z.push([`Source package too large to retain (${e} bytes, limit ${I}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
|
|
2674
2738
|
else if (t.size > 0) {
|
|
2675
|
-
const e = new
|
|
2676
|
-
|
|
2677
|
-
let s =
|
|
2678
|
-
const o =
|
|
2739
|
+
const e = new D(t);
|
|
2740
|
+
y(U, e);
|
|
2741
|
+
let s = Mt.getSheets().getItems();
|
|
2742
|
+
const o = Mt.getTransactions().addListener({ onCommitEnd: (t) => {
|
|
2679
2743
|
const s = t.getOperation()?.name;
|
|
2680
2744
|
"insertCells" !== s && "deleteCells" !== s || e.markStructuralChange();
|
|
2681
|
-
} }), i =
|
|
2682
|
-
const t =
|
|
2745
|
+
} }), i = Mt.addListeners({ onSheetsChange: () => {
|
|
2746
|
+
const t = Mt.getSheets().getItems();
|
|
2683
2747
|
(t.length !== s.length || t.some((t, e) => t !== s[e])) && e.markStructuralChange(), s = t;
|
|
2684
2748
|
} });
|
|
2685
|
-
|
|
2686
|
-
o(), i(),
|
|
2749
|
+
Mt.addListeners({ onClose: () => {
|
|
2750
|
+
o(), i(), O(U);
|
|
2687
2751
|
} });
|
|
2688
2752
|
}
|
|
2689
2753
|
}
|
|
2690
|
-
if (
|
|
2754
|
+
if (Z.length && J?.onWarning) for (const t of Z) {
|
|
2691
2755
|
const [e, s] = t;
|
|
2692
|
-
|
|
2756
|
+
J.onWarning(e, s);
|
|
2693
2757
|
}
|
|
2694
|
-
return
|
|
2758
|
+
return G && !0 === R && console.table(G.toTable()), Mt;
|
|
2695
2759
|
} catch (t) {
|
|
2696
2760
|
let e = "Unable to parse XLSX.";
|
|
2697
|
-
throw t instanceof
|
|
2761
|
+
throw t instanceof z && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
|
|
2698
2762
|
} finally {
|
|
2699
|
-
await
|
|
2763
|
+
await ut.close().catch(() => {});
|
|
2700
2764
|
}
|
|
2701
2765
|
};
|
|
2702
|
-
export {
|
|
2766
|
+
export { ve as readXLSX };
|