@sheetxl/studio-mui 0.1.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/README.md +24 -0
- package/build/browser/cjs/4XrhSt2xtUIXkiCt.cjs +1516 -0
- package/build/browser/cjs/B3EvhaQf456RMc1Q.cjs +6 -0
- package/build/browser/cjs/B3kl467PN2cpvrfz.cjs +12 -0
- package/build/browser/cjs/B5LCoenQbQmzic16.cjs +314 -0
- package/build/browser/cjs/BBuyHZwFlDRvHzBH.cjs +7 -0
- package/build/browser/cjs/BGoG_ROASNB2owBR.cjs +28 -0
- package/build/browser/cjs/BJ6Da8vZLjAl44pz.cjs +6 -0
- package/build/browser/cjs/BL_UVvG75SFsFaT3.cjs +6 -0
- package/build/browser/cjs/BNDoTytIOGtVh5l9.cjs +6 -0
- package/build/browser/cjs/BQOyVCuOdwDja_VV.cjs +42 -0
- package/build/browser/cjs/BRiPktKUmeJipjaa.cjs +6 -0
- package/build/browser/cjs/BabbNVs5iKg49rfk.cjs +6 -0
- package/build/browser/cjs/BcOX5vODdThWbKrR.cjs +6 -0
- package/build/browser/cjs/BchlMljYmXDs0Ol2.cjs +6 -0
- package/build/browser/cjs/BmYZvm13acvbFhOu.cjs +6 -0
- package/build/browser/cjs/BmbsW1n0-CkF3ITF.cjs +6 -0
- package/build/browser/cjs/BnCUyGP_ERKmL3ZR.cjs +6 -0
- package/build/browser/cjs/BtP4E1_yhMjpfbr5.cjs +6 -0
- package/build/browser/cjs/C3E9wmSfmgYmXfJN.cjs +205 -0
- package/build/browser/cjs/C3Hl78e9qfEHxJYc.cjs +6 -0
- package/build/browser/cjs/CEvRH8aOx3etutK_.cjs +17 -0
- package/build/browser/cjs/CLZSdaBnKDfb142R.cjs +6 -0
- package/build/browser/cjs/CN1cS39WcNrcPVqS.cjs +129 -0
- package/build/browser/cjs/CSH1hUnHovjo8Lb8.cjs +6 -0
- package/build/browser/cjs/CTNt3asYQRA-MROc.cjs +47 -0
- package/build/browser/cjs/C_JZEtvgcli6T7Wg.cjs +11 -0
- package/build/browser/cjs/CbaYZmvS8u-p_Z8Z.cjs +6 -0
- package/build/browser/cjs/Cc-4c3DRm96wq5rj.cjs +12 -0
- package/build/browser/cjs/CnY6DbatGmPyylfU.cjs +20 -0
- package/build/browser/cjs/CqkQGfzNax6GmZFo.cjs +6 -0
- package/build/browser/cjs/D2AF0a4vbNKzFxzA.cjs +21 -0
- package/build/browser/cjs/D4y1iYdx8sdwQ50T.cjs +6 -0
- package/build/browser/cjs/D5cF1EnyvnPY2IxS.cjs +150 -0
- package/build/browser/cjs/DA1-OPTYQTepGKEg.cjs +11 -0
- package/build/browser/cjs/DJDMVDpUqlEKYLjt.cjs +6 -0
- package/build/browser/cjs/DLXLJ8SNNjwM5C-P.cjs +6 -0
- package/build/browser/cjs/DV8lOsZBgyx7MTBW.cjs +6 -0
- package/build/browser/cjs/DZAPn_d9mpvfRzsb.cjs +6 -0
- package/build/browser/cjs/DaicqO_9d1hYzyB_.cjs +11 -0
- package/build/browser/cjs/Dfh6eMCbAjW14fdh.cjs +6 -0
- package/build/browser/cjs/DhI2lgDZL8GqBejN.cjs +6 -0
- package/build/browser/cjs/Ds6s8fpzOZsd2m1r.cjs +6 -0
- package/build/browser/cjs/DvIWGmDT5uBVQ5zH.cjs +16 -0
- package/build/browser/cjs/DvLgu20RiaayrJcW.cjs +7 -0
- package/build/browser/cjs/Dvhwt25gyHzxQLrp.cjs +6 -0
- package/build/browser/cjs/DvwApJM_CVrlpLxn.cjs +6 -0
- package/build/browser/cjs/DwVYzo4a05DMfta_.cjs +28 -0
- package/build/browser/cjs/NYdqUauA5i2q33UZ.cjs +6 -0
- package/build/browser/cjs/S2Xfq-KDgoT7ipPC.cjs +25 -0
- package/build/browser/cjs/TOZQZr9ZZ_Q-jdQZ.cjs +6 -0
- package/build/browser/cjs/bJuLOalXTwrshZL3.cjs +16 -0
- package/build/browser/cjs/eh9refYW4Gm25cmW.cjs +6 -0
- package/build/browser/cjs/hKqcVeb_8_4M79xj.cjs +6 -0
- package/build/browser/cjs/index.cjs +7 -0
- package/build/browser/cjs/is17hbP-kpOIBRP3.cjs +6 -0
- package/build/browser/cjs/pNY789kHWwRQXqse.cjs +17 -0
- package/build/browser/cjs/qJcc3ALtLWml32LU.cjs +18 -0
- package/build/browser/cjs/vWgVoELLfZ2ff1xL.cjs +6 -0
- package/build/browser/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
- package/build/browser/esm/7Imk0owJj7oNHR7v.mjs +48 -0
- package/build/browser/esm/AuNwPf0DXe0twn35.mjs +1592 -0
- package/build/browser/esm/B1Kw9U_AxCk0Aq9f.mjs +59 -0
- package/build/browser/esm/B9l1_Tfw_tMhKCNB.mjs +437 -0
- package/build/browser/esm/B9winT3ff8rc4sbn.mjs +490 -0
- package/build/browser/esm/BEo9XX1sHmVjScSm.mjs +16 -0
- package/build/browser/esm/BGTcOBCyrTTlov_i.mjs +13399 -0
- package/build/browser/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
- package/build/browser/esm/BQSa7N7QMGysdZdU.mjs +3932 -0
- package/build/browser/esm/BVEuc_3fLG2GN34k.mjs +16 -0
- package/build/browser/esm/BVh9YUwiSov8wcyY.mjs +1708 -0
- package/build/browser/esm/BZt5yM_TvoPXqdeA.mjs +3867 -0
- package/build/browser/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
- package/build/browser/esm/BjUaiSvRZnas-HJW.mjs +16 -0
- package/build/browser/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
- package/build/browser/esm/BtMqJ5CRpKuAC4UQ.mjs +1486 -0
- package/build/browser/esm/BwvMR2cgGwFn8hAL.mjs +36 -0
- package/build/browser/esm/BxU3eVA-Adrnq7ZJ.mjs +1372 -0
- package/build/browser/esm/C00coampLNiXjWJJ.mjs +436 -0
- package/build/browser/esm/C6nh1rvYnAg2w2V2.mjs +838 -0
- package/build/browser/esm/C8gc149K34Zi2lP2.mjs +16 -0
- package/build/browser/esm/CGSkuCZY1EmTUNlQ.mjs +52 -0
- package/build/browser/esm/CKXzosgZX8Xe3l59.mjs +16 -0
- package/build/browser/esm/CNYANG0Z7mhGYo00.mjs +859 -0
- package/build/browser/esm/CV_FNw2i_aEc5nwA.mjs +16 -0
- package/build/browser/esm/CYSj0-zys2FKWgnb.mjs +18 -0
- package/build/browser/esm/CbTs5cvVaP1vPCYD.mjs +2248 -0
- package/build/browser/esm/CfAob8gGydmX1xQu.mjs +16 -0
- package/build/browser/esm/ChGigf2OPu7d44Km.mjs +16 -0
- package/build/browser/esm/CnzGN0S6zOfL_3SS.mjs +1358 -0
- package/build/browser/esm/CpyeUtXgDmrcMESB.mjs +52 -0
- package/build/browser/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
- package/build/browser/esm/CtrrmHx9YbrOithw.mjs +152 -0
- package/build/browser/esm/CzAM0pDdZ7sjGgn9.mjs +86 -0
- package/build/browser/esm/D0oVDcgRUMZ9MHzu.mjs +41 -0
- package/build/browser/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
- package/build/browser/esm/D78-3ghInxscHLVq.mjs +23 -0
- package/build/browser/esm/DEpR6b4DMs-va6RS.mjs +43734 -0
- package/build/browser/esm/DEsqE49cIQZ8AqCe.mjs +398 -0
- package/build/browser/esm/DGe70xvBhc62ZVZz.mjs +2410 -0
- package/build/browser/esm/DXapJ5_yR4E8vDaK.mjs +1685 -0
- package/build/browser/esm/DjAZeDxBIBZsRTm3.mjs +24 -0
- package/build/browser/esm/DttdPwwDTcRX4uwL.mjs +44 -0
- package/build/browser/esm/FXcO0MVElhw9cc3v.mjs +49 -0
- package/build/browser/esm/GpycqJcrwTRtjEqA.mjs +16 -0
- package/build/browser/esm/HCE-tMxyVd0m-PgN.mjs +16 -0
- package/build/browser/esm/OCdyQRicV8KxUwMt.mjs +16 -0
- package/build/browser/esm/UukTgmLv7or2mhlB.mjs +16 -0
- package/build/browser/esm/_cuE13TWr3oEoKGP.mjs +34 -0
- package/build/browser/esm/aIlK3Ybu-1T4WHPv.mjs +640 -0
- package/build/browser/esm/bFSkTthAEOn7gv5x.mjs +16 -0
- package/build/browser/esm/bOhN6up-rdLRp82s.mjs +5588 -0
- package/build/browser/esm/index.mjs +85 -0
- package/build/browser/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
- package/build/browser/esm/o6U2z4gZ7GE4QKZD.mjs +16 -0
- package/build/browser/esm/psav3cvsBQQczhPL.mjs +16 -0
- package/build/browser/esm/vn0iS301yg2hAbYd.mjs +51 -0
- package/build/licenses/dependencies.txt +1341 -0
- package/build/node/assets/style.css +1 -0
- package/build/node/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
- package/build/node/esm/B-Xlyl81h27-bnvO.mjs +16 -0
- package/build/node/esm/B1_NYsn5D8x9QedP.mjs +307 -0
- package/build/node/esm/BCA5bxOeDA8k1Bm1.mjs +16 -0
- package/build/node/esm/BEo9XX1sHmVjScSm.mjs +16 -0
- package/build/node/esm/BIfdVpnJR1TZwCPR.mjs +1378 -0
- package/build/node/esm/BIqDzNJtkm-dyH0v.mjs +154 -0
- package/build/node/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
- package/build/node/esm/BUOdfqhtCh8lhOhm.mjs +4000 -0
- package/build/node/esm/BYbE15S73xgn7S5E.mjs +88 -0
- package/build/node/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
- package/build/node/esm/BkyivirgeiDKFSjk.mjs +16 -0
- package/build/node/esm/Bm1RqNJ-XvHpJW9z.mjs +831 -0
- package/build/node/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
- package/build/node/esm/Bx-30HInllXS7M_J.mjs +41 -0
- package/build/node/esm/Bx3lQBEvcqhxffT-.mjs +1726 -0
- package/build/node/esm/BxsKlaBFnb5wNq6R.mjs +53 -0
- package/build/node/esm/C4PMhNAV0KpPsKFj.mjs +24 -0
- package/build/node/esm/C7x3L6HtPhZjSrrZ.mjs +471 -0
- package/build/node/esm/C8gc149K34Zi2lP2.mjs +16 -0
- package/build/node/esm/CK-kn1p9NGRVM_h7.mjs +16 -0
- package/build/node/esm/CKR6snAwSONs7kfL.mjs +19 -0
- package/build/node/esm/CKXzosgZX8Xe3l59.mjs +16 -0
- package/build/node/esm/CLE_RHHvsDeoZ9Zd.mjs +561 -0
- package/build/node/esm/CMKci_5THkcJ-w9a.mjs +80 -0
- package/build/node/esm/CVU9bu6AnxcgkEwq.mjs +13466 -0
- package/build/node/esm/CfAob8gGydmX1xQu.mjs +16 -0
- package/build/node/esm/ChGigf2OPu7d44Km.mjs +16 -0
- package/build/node/esm/CkvkuPSf4R_DqArg.mjs +5648 -0
- package/build/node/esm/CnBMj0oJAyr9ZbjP.mjs +23 -0
- package/build/node/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
- package/build/node/esm/Crx9i_8dm3OQsk_T.mjs +28 -0
- package/build/node/esm/CwUulbiMQH11aF4x.mjs +16 -0
- package/build/node/esm/D0Lh0V1tkdJPxZnI.mjs +392 -0
- package/build/node/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
- package/build/node/esm/D5bg3v_W8K9MVp0j.mjs +1711 -0
- package/build/node/esm/D8F08tiG98tM_voL.mjs +16 -0
- package/build/node/esm/DR7o1DOIK9zdiBgS.mjs +50 -0
- package/build/node/esm/DYEgm2kd3haV-Ml8.mjs +1246 -0
- package/build/node/esm/DfzhmhZ4I0Zurcqn.mjs +44 -0
- package/build/node/esm/Dg_ERnlsy5hwbzMA.mjs +1498 -0
- package/build/node/esm/Dt4cj_0sWgvt4FGj.mjs +92 -0
- package/build/node/esm/GpycqJcrwTRtjEqA.mjs +16 -0
- package/build/node/esm/LlkIFFfAjLiQ5Or6.mjs +3840 -0
- package/build/node/esm/OCdyQRicV8KxUwMt.mjs +16 -0
- package/build/node/esm/QATDL2FGAYcVnd33.mjs +49 -0
- package/build/node/esm/SvgA2TyqJYOzheuf.mjs +26 -0
- package/build/node/esm/VZ150KIUh5JVRqpk.mjs +52 -0
- package/build/node/esm/XRLHatWlgABiuBDS.mjs +52 -0
- package/build/node/esm/bFSkTthAEOn7gv5x.mjs +16 -0
- package/build/node/esm/index.mjs +44754 -0
- package/build/node/esm/lgtVRbg712G5Ba-x.mjs +60 -0
- package/build/node/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
- package/build/node/esm/psav3cvsBQQczhPL.mjs +16 -0
- package/build/node/esm/zWnN2OzbhzCc6T7u.mjs +86 -0
- package/build/package.json +84 -0
- package/build/types/index.d.ts +1848 -0
- package/package.json +100 -0
|
@@ -0,0 +1,1498 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { a8 as t, s as e, a9 as s, aa as i, ab as o, ac as r, b as n, ad as a, ae as l, a2 as c, af as h, Y as u, a as d, n as p, ag as g, l as f } from "./index.mjs";
|
|
8
|
+
/**
|
|
9
|
+
* @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
|
|
10
|
+
*
|
|
11
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
12
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
13
|
+
*/
|
|
14
|
+
const m = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", T = new RegExp(`^[${m}][-${m}.0-9·̀-ͯ‿-⁀]*$`, "u");
|
|
15
|
+
/**
|
|
16
|
+
* Character classes and associated utilities for the 5th edition of XML 1.0.
|
|
17
|
+
*
|
|
18
|
+
* @author Louis-Dominique Dubeau
|
|
19
|
+
* @license MIT
|
|
20
|
+
* @copyright Louis-Dominique Dubeau
|
|
21
|
+
*/
|
|
22
|
+
function y(t2) {
|
|
23
|
+
return t2 >= 65 && t2 <= 90 || t2 >= 97 && t2 <= 122 || 58 === t2 || 95 === t2 || 8204 === t2 || 8205 === t2 || t2 >= 192 && t2 <= 214 || t2 >= 216 && t2 <= 246 || t2 >= 248 && t2 <= 767 || t2 >= 880 && t2 <= 893 || t2 >= 895 && t2 <= 8191 || t2 >= 8304 && t2 <= 8591 || t2 >= 11264 && t2 <= 12271 || t2 >= 12289 && t2 <= 55295 || t2 >= 63744 && t2 <= 64975 || t2 >= 65008 && t2 <= 65533 || t2 >= 65536 && t2 <= 983039;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Character class utilities for XML NS 1.0 edition 3.
|
|
27
|
+
*
|
|
28
|
+
* @author Louis-Dominique Dubeau
|
|
29
|
+
* @license MIT
|
|
30
|
+
* @copyright Louis-Dominique Dubeau
|
|
31
|
+
*/
|
|
32
|
+
const b = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", x = new RegExp(`^[${b}][-${b}.0-9·̀-ͯ‿-⁀]*$`, "u");
|
|
33
|
+
function w(t2) {
|
|
34
|
+
return t2 >= 65 && t2 <= 90 || 95 === t2 || t2 >= 97 && t2 <= 122 || t2 >= 192 && t2 <= 214 || t2 >= 216 && t2 <= 246 || t2 >= 248 && t2 <= 767 || t2 >= 880 && t2 <= 893 || t2 >= 895 && t2 <= 8191 || t2 >= 8204 && t2 <= 8205 || t2 >= 8304 && t2 <= 8591 || t2 >= 11264 && t2 <= 12271 || t2 >= 12289 && t2 <= 55295 || t2 >= 63744 && t2 <= 64975 || t2 >= 65008 && t2 <= 65533 || t2 >= 65536 && t2 <= 983039;
|
|
35
|
+
}
|
|
36
|
+
const v = function(t2) {
|
|
37
|
+
return 32 === t2 || 10 === t2 || 13 === t2 || 9 === t2;
|
|
38
|
+
}, S = function(t2) {
|
|
39
|
+
return t2 >= 32 && t2 <= 55295 || 10 === t2 || 13 === t2 || 9 === t2 || t2 >= 57344 && t2 <= 65533 || t2 >= 65536 && t2 <= 1114111;
|
|
40
|
+
}, C = y, k = function(t2) {
|
|
41
|
+
return y(t2) || t2 >= 48 && t2 <= 57 || 45 === t2 || 46 === t2 || 183 === t2 || t2 >= 768 && t2 <= 879 || t2 >= 8255 && t2 <= 8256;
|
|
42
|
+
}, A = [32, 10, 13, 9], D = T, E = function(t2) {
|
|
43
|
+
return t2 >= 1 && t2 <= 55295 || t2 >= 57344 && t2 <= 65533 || t2 >= 65536 && t2 <= 1114111;
|
|
44
|
+
}, P = w, O = function(t2) {
|
|
45
|
+
return w(t2) || 45 === t2 || 46 === t2 || t2 >= 48 && t2 <= 57 || 183 === t2 || t2 >= 768 && t2 <= 879 || t2 >= 8255 && t2 <= 8256;
|
|
46
|
+
}, I = x, V = "http://www.w3.org/XML/1998/namespace", L = "http://www.w3.org/2000/xmlns/", N = { __proto__: null, xml: V, xmlns: L }, R = { __proto__: null, amp: "&", gt: ">", lt: "<", quot: '"', apos: "'" }, $ = -1, M = -2, j = 13, H = 33, F = 10, X = 60, B = 61, W = 62, _ = 63, q = 93, z = (t2) => 34 === t2 || 39 === t2, U = [34, 39], G = [...U, 91, W], Z = [...U, X, q], Q = [B, _, ...A], J = [...A, W, 38, X];
|
|
47
|
+
function K(t2, e2, s2) {
|
|
48
|
+
switch (e2) {
|
|
49
|
+
case "xml":
|
|
50
|
+
s2 !== V && t2.fail(`xml prefix must be bound to ${V}.`);
|
|
51
|
+
break;
|
|
52
|
+
case "xmlns":
|
|
53
|
+
s2 !== L && t2.fail(`xmlns prefix must be bound to ${L}.`);
|
|
54
|
+
}
|
|
55
|
+
switch (s2) {
|
|
56
|
+
case L:
|
|
57
|
+
t2.fail("" === e2 ? `the default namespace may not be set to ${s2}.` : `may not assign a prefix (even "xmlns") to the URI ${L}.`);
|
|
58
|
+
break;
|
|
59
|
+
case V:
|
|
60
|
+
switch (e2) {
|
|
61
|
+
case "xml":
|
|
62
|
+
break;
|
|
63
|
+
case "":
|
|
64
|
+
t2.fail(`the default namespace may not be set to ${s2}.`);
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
t2.fail("may not assign the xml namespace to another prefix.");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const Y = (t2) => I.test(t2), tt = (t2) => D.test(t2), et = { xmldecl: "xmldeclHandler", text: "textHandler", processinginstruction: "piHandler", doctype: "doctypeHandler", comment: "commentHandler", opentagstart: "openTagStartHandler", attribute: "attributeHandler", opentag: "openTagHandler", closetag: "closeTagHandler", cdata: "cdataHandler", error: "errorHandler", end: "endHandler", ready: "readyHandler" };
|
|
72
|
+
class st {
|
|
73
|
+
constructor(t2) {
|
|
74
|
+
this.i = 0, this.prevI = 0, this.opt = t2 ?? {}, this.fragmentOpt = !!this.opt.fragment;
|
|
75
|
+
const e2 = this.xmlnsOpt = !!this.opt.xmlns;
|
|
76
|
+
if (this.trackPosition = false !== this.opt.position, this.fileName = this.opt.fileName, e2) {
|
|
77
|
+
this.nameStartCheck = P, this.nameCheck = O, this.isName = Y, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = { __proto__: null, ...N };
|
|
78
|
+
const t3 = this.opt.additionalNamespaces;
|
|
79
|
+
null != t3 && (function(t4, e3) {
|
|
80
|
+
for (const s2 of Object.keys(e3)) K(t4, s2, e3[s2]);
|
|
81
|
+
}(this, t3), Object.assign(this.ns, t3));
|
|
82
|
+
} else this.nameStartCheck = C, this.nameCheck = k, this.isName = tt, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
|
|
83
|
+
this.stateTable = [this.sBegin, this.sBeginWhitespace, this.sDoctype, this.sDoctypeQuote, this.sDTD, this.sDTDQuoted, this.sDTDOpenWaka, this.sDTDOpenWakaBang, this.sDTDComment, this.sDTDCommentEnding, this.sDTDCommentEnded, this.sDTDPI, this.sDTDPIEnding, this.sText, this.sEntity, this.sOpenWaka, this.sOpenWakaBang, this.sComment, this.sCommentEnding, this.sCommentEnded, this.sCData, this.sCDataEnding, this.sCDataEnding2, this.sPIFirstChar, this.sPIRest, this.sPIBody, this.sPIEnding, this.sXMLDeclNameStart, this.sXMLDeclName, this.sXMLDeclEq, this.sXMLDeclValueStart, this.sXMLDeclValue, this.sXMLDeclSeparator, this.sXMLDeclEnding, this.sOpenTag, this.sOpenTagSlash, this.sAttrib, this.sAttribName, this.sAttribNameSawWhite, this.sAttribValue, this.sAttribValueQuoted, this.sAttribValueClosed, this.sAttribValueUnquoted, this.sCloseTag, this.sCloseTagSawWhite], this._init();
|
|
84
|
+
}
|
|
85
|
+
get closed() {
|
|
86
|
+
return this._closed;
|
|
87
|
+
}
|
|
88
|
+
_init() {
|
|
89
|
+
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 = [];
|
|
90
|
+
const { fragmentOpt: t2 } = this;
|
|
91
|
+
this.state = t2 ? j : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t2, this.xmlDeclPossible = !t2, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
|
|
92
|
+
let { defaultXMLVersion: e2 } = this.opt;
|
|
93
|
+
if (void 0 === e2) {
|
|
94
|
+
if (true === this.opt.forceXMLVersion) throw new Error("forceXMLVersion set but defaultXMLVersion is not set");
|
|
95
|
+
e2 = "1.0";
|
|
96
|
+
}
|
|
97
|
+
this.setXMLVersion(e2), this.positionAtNewLine = 0, this.doctype = false, this._closed = false, this.xmlDecl = { version: void 0, encoding: void 0, standalone: void 0 }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(R), this.readyHandler?.();
|
|
98
|
+
}
|
|
99
|
+
get position() {
|
|
100
|
+
return this.chunkPosition + this.i;
|
|
101
|
+
}
|
|
102
|
+
get columnIndex() {
|
|
103
|
+
return this.position - this.positionAtNewLine;
|
|
104
|
+
}
|
|
105
|
+
on(t2, e2) {
|
|
106
|
+
this[et[t2]] = e2;
|
|
107
|
+
}
|
|
108
|
+
off(t2) {
|
|
109
|
+
this[et[t2]] = void 0;
|
|
110
|
+
}
|
|
111
|
+
makeError(t2) {
|
|
112
|
+
let e2 = this.fileName ?? "";
|
|
113
|
+
return this.trackPosition && (e2.length > 0 && (e2 += ":"), e2 += `${this.line}:${this.column}`), e2.length > 0 && (e2 += ": "), new Error(e2 + t2);
|
|
114
|
+
}
|
|
115
|
+
fail(t2) {
|
|
116
|
+
const e2 = this.makeError(t2), s2 = this.errorHandler;
|
|
117
|
+
if (void 0 === s2) throw e2;
|
|
118
|
+
return s2(e2), this;
|
|
119
|
+
}
|
|
120
|
+
write(t2) {
|
|
121
|
+
if (this.closed) return this.fail("cannot write after close; assign an onready handler.");
|
|
122
|
+
let e2 = false;
|
|
123
|
+
null === t2 ? (e2 = true, t2 = "") : "object" == typeof t2 && (t2 = t2.toString()), void 0 !== this.carriedFromPrevious && (t2 = `${this.carriedFromPrevious}${t2}`, this.carriedFromPrevious = void 0);
|
|
124
|
+
let s2 = t2.length;
|
|
125
|
+
const i2 = t2.charCodeAt(s2 - 1);
|
|
126
|
+
!e2 && (13 === i2 || i2 >= 55296 && i2 <= 56319) && (this.carriedFromPrevious = t2[s2 - 1], s2--, t2 = t2.slice(0, s2));
|
|
127
|
+
const { stateTable: o2 } = this;
|
|
128
|
+
for (this.chunk = t2, this.i = 0; this.i < s2; ) o2[this.state].call(this);
|
|
129
|
+
return this.chunkPosition += s2, e2 ? this.end() : this;
|
|
130
|
+
}
|
|
131
|
+
close() {
|
|
132
|
+
return this.write(null);
|
|
133
|
+
}
|
|
134
|
+
getCode10() {
|
|
135
|
+
const t2 = this.chunk, e2 = this.i;
|
|
136
|
+
if (this.prevI = e2, this.i++, e2 >= t2.length) return $;
|
|
137
|
+
const s2 = t2.charCodeAt(e2);
|
|
138
|
+
if (this.column++, s2 < 55296) {
|
|
139
|
+
if (s2 >= 32 || 9 === s2) return s2;
|
|
140
|
+
switch (s2) {
|
|
141
|
+
case F:
|
|
142
|
+
return this.line++, this.column = 0, this.positionAtNewLine = this.position, F;
|
|
143
|
+
case 13:
|
|
144
|
+
return t2.charCodeAt(e2 + 1) === F && (this.i = e2 + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, M;
|
|
145
|
+
default:
|
|
146
|
+
return this.fail("disallowed character."), s2;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (s2 > 56319) return s2 >= 57344 && s2 <= 65533 || this.fail("disallowed character."), s2;
|
|
150
|
+
const i2 = 65536 + 1024 * (s2 - 55296) + (t2.charCodeAt(e2 + 1) - 56320);
|
|
151
|
+
return this.i = e2 + 2, i2 > 1114111 && this.fail("disallowed character."), i2;
|
|
152
|
+
}
|
|
153
|
+
getCode11() {
|
|
154
|
+
const { chunk: t2, i: e2 } = this;
|
|
155
|
+
if (this.prevI = e2, this.i = e2 + 1, e2 >= t2.length) return $;
|
|
156
|
+
const s2 = t2.charCodeAt(e2);
|
|
157
|
+
if (this.column++, s2 < 55296) {
|
|
158
|
+
if (s2 > 31 && s2 < 127 || s2 > 159 && 8232 !== s2 || 9 === s2) return s2;
|
|
159
|
+
switch (s2) {
|
|
160
|
+
case F:
|
|
161
|
+
return this.line++, this.column = 0, this.positionAtNewLine = this.position, F;
|
|
162
|
+
case 13: {
|
|
163
|
+
const s3 = t2.charCodeAt(e2 + 1);
|
|
164
|
+
s3 !== F && 133 !== s3 || (this.i = e2 + 2);
|
|
165
|
+
}
|
|
166
|
+
case 133:
|
|
167
|
+
case 8232:
|
|
168
|
+
return this.line++, this.column = 0, this.positionAtNewLine = this.position, M;
|
|
169
|
+
default:
|
|
170
|
+
return this.fail("disallowed character."), s2;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (s2 > 56319) return s2 >= 57344 && s2 <= 65533 || this.fail("disallowed character."), s2;
|
|
174
|
+
const i2 = 65536 + 1024 * (s2 - 55296) + (t2.charCodeAt(e2 + 1) - 56320);
|
|
175
|
+
return this.i = e2 + 2, i2 > 1114111 && this.fail("disallowed character."), i2;
|
|
176
|
+
}
|
|
177
|
+
getCodeNorm() {
|
|
178
|
+
const t2 = this.getCode();
|
|
179
|
+
return t2 === M ? F : t2;
|
|
180
|
+
}
|
|
181
|
+
unget() {
|
|
182
|
+
this.i = this.prevI, this.column--;
|
|
183
|
+
}
|
|
184
|
+
captureTo(t2) {
|
|
185
|
+
let { i: e2 } = this;
|
|
186
|
+
const { chunk: s2 } = this;
|
|
187
|
+
for (; ; ) {
|
|
188
|
+
const i2 = this.getCode(), o2 = i2 === M, r2 = o2 ? F : i2;
|
|
189
|
+
if (r2 === $ || t2.includes(r2)) return this.text += s2.slice(e2, this.prevI), r2;
|
|
190
|
+
o2 && (this.text += `${s2.slice(e2, this.prevI)}
|
|
191
|
+
`, e2 = this.i);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
captureToChar(t2) {
|
|
195
|
+
let { i: e2 } = this;
|
|
196
|
+
const { chunk: s2 } = this;
|
|
197
|
+
for (; ; ) {
|
|
198
|
+
let i2 = this.getCode();
|
|
199
|
+
switch (i2) {
|
|
200
|
+
case M:
|
|
201
|
+
this.text += `${s2.slice(e2, this.prevI)}
|
|
202
|
+
`, e2 = this.i, i2 = F;
|
|
203
|
+
break;
|
|
204
|
+
case $:
|
|
205
|
+
return this.text += s2.slice(e2), false;
|
|
206
|
+
}
|
|
207
|
+
if (i2 === t2) return this.text += s2.slice(e2, this.prevI), true;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
captureNameChars() {
|
|
211
|
+
const { chunk: t2, i: e2 } = this;
|
|
212
|
+
for (; ; ) {
|
|
213
|
+
const s2 = this.getCode();
|
|
214
|
+
if (s2 === $) return this.name += t2.slice(e2), $;
|
|
215
|
+
if (!k(s2)) return this.name += t2.slice(e2, this.prevI), s2 === M ? F : s2;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
skipSpaces() {
|
|
219
|
+
for (; ; ) {
|
|
220
|
+
const t2 = this.getCodeNorm();
|
|
221
|
+
if (t2 === $ || !v(t2)) return t2;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
setXMLVersion(t2) {
|
|
225
|
+
this.currentXMLVersion = t2, "1.0" === t2 ? (this.isChar = S, this.getCode = this.getCode10) : (this.isChar = E, this.getCode = this.getCode11);
|
|
226
|
+
}
|
|
227
|
+
sBegin() {
|
|
228
|
+
65279 === this.chunk.charCodeAt(0) && (this.i++, this.column++), this.state = 1;
|
|
229
|
+
}
|
|
230
|
+
sBeginWhitespace() {
|
|
231
|
+
const t2 = this.i, e2 = this.skipSpaces();
|
|
232
|
+
switch (this.prevI !== t2 && (this.xmlDeclPossible = false), e2) {
|
|
233
|
+
case X:
|
|
234
|
+
if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
|
|
235
|
+
break;
|
|
236
|
+
case $:
|
|
237
|
+
break;
|
|
238
|
+
default:
|
|
239
|
+
this.unget(), this.state = j, this.xmlDeclPossible = false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
sDoctype() {
|
|
243
|
+
const t2 = this.captureTo(G);
|
|
244
|
+
switch (t2) {
|
|
245
|
+
case W:
|
|
246
|
+
this.doctypeHandler?.(this.text), this.text = "", this.state = j, this.doctype = true;
|
|
247
|
+
break;
|
|
248
|
+
case $:
|
|
249
|
+
break;
|
|
250
|
+
default:
|
|
251
|
+
this.text += String.fromCodePoint(t2), 91 === t2 ? this.state = 4 : z(t2) && (this.state = 3, this.q = t2);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
sDoctypeQuote() {
|
|
255
|
+
const t2 = this.q;
|
|
256
|
+
this.captureToChar(t2) && (this.text += String.fromCodePoint(t2), this.q = null, this.state = 2);
|
|
257
|
+
}
|
|
258
|
+
sDTD() {
|
|
259
|
+
const t2 = this.captureTo(Z);
|
|
260
|
+
t2 !== $ && (this.text += String.fromCodePoint(t2), t2 === q ? this.state = 2 : t2 === X ? this.state = 6 : z(t2) && (this.state = 5, this.q = t2));
|
|
261
|
+
}
|
|
262
|
+
sDTDQuoted() {
|
|
263
|
+
const t2 = this.q;
|
|
264
|
+
this.captureToChar(t2) && (this.text += String.fromCodePoint(t2), this.state = 4, this.q = null);
|
|
265
|
+
}
|
|
266
|
+
sDTDOpenWaka() {
|
|
267
|
+
const t2 = this.getCodeNorm();
|
|
268
|
+
switch (this.text += String.fromCodePoint(t2), t2) {
|
|
269
|
+
case 33:
|
|
270
|
+
this.state = 7, this.openWakaBang = "";
|
|
271
|
+
break;
|
|
272
|
+
case _:
|
|
273
|
+
this.state = 11;
|
|
274
|
+
break;
|
|
275
|
+
default:
|
|
276
|
+
this.state = 4;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
sDTDOpenWakaBang() {
|
|
280
|
+
const t2 = String.fromCodePoint(this.getCodeNorm()), e2 = this.openWakaBang += t2;
|
|
281
|
+
this.text += t2, "-" !== e2 && (this.state = "--" === e2 ? 8 : 4, this.openWakaBang = "");
|
|
282
|
+
}
|
|
283
|
+
sDTDComment() {
|
|
284
|
+
this.captureToChar(45) && (this.text += "-", this.state = 9);
|
|
285
|
+
}
|
|
286
|
+
sDTDCommentEnding() {
|
|
287
|
+
const t2 = this.getCodeNorm();
|
|
288
|
+
this.text += String.fromCodePoint(t2), this.state = 45 === t2 ? 10 : 8;
|
|
289
|
+
}
|
|
290
|
+
sDTDCommentEnded() {
|
|
291
|
+
const t2 = this.getCodeNorm();
|
|
292
|
+
this.text += String.fromCodePoint(t2), t2 === W ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
|
|
293
|
+
}
|
|
294
|
+
sDTDPI() {
|
|
295
|
+
this.captureToChar(_) && (this.text += "?", this.state = 12);
|
|
296
|
+
}
|
|
297
|
+
sDTDPIEnding() {
|
|
298
|
+
const t2 = this.getCodeNorm();
|
|
299
|
+
this.text += String.fromCodePoint(t2), t2 === W && (this.state = 4);
|
|
300
|
+
}
|
|
301
|
+
sText() {
|
|
302
|
+
0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
|
|
303
|
+
}
|
|
304
|
+
sEntity() {
|
|
305
|
+
let { i: t2 } = this;
|
|
306
|
+
const { chunk: e2 } = this;
|
|
307
|
+
t: for (; ; ) switch (this.getCode()) {
|
|
308
|
+
case M:
|
|
309
|
+
this.entity += `${e2.slice(t2, this.prevI)}
|
|
310
|
+
`, t2 = this.i;
|
|
311
|
+
break;
|
|
312
|
+
case 59: {
|
|
313
|
+
const { entityReturnState: s2 } = this, i2 = this.entity + e2.slice(t2, this.prevI);
|
|
314
|
+
let o2;
|
|
315
|
+
this.state = s2, "" === i2 ? (this.fail("empty entity name."), o2 = "&;") : (o2 = this.parseEntity(i2), this.entity = ""), s2 === j && void 0 === this.textHandler || (this.text += o2);
|
|
316
|
+
break t;
|
|
317
|
+
}
|
|
318
|
+
case $:
|
|
319
|
+
this.entity += e2.slice(t2);
|
|
320
|
+
break t;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
sOpenWaka() {
|
|
324
|
+
const t2 = this.getCode();
|
|
325
|
+
if (C(t2)) this.state = 34, this.unget(), this.xmlDeclPossible = false;
|
|
326
|
+
else switch (t2) {
|
|
327
|
+
case 47:
|
|
328
|
+
this.state = 43, this.xmlDeclPossible = false;
|
|
329
|
+
break;
|
|
330
|
+
case 33:
|
|
331
|
+
this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = false;
|
|
332
|
+
break;
|
|
333
|
+
case _:
|
|
334
|
+
this.state = 23;
|
|
335
|
+
break;
|
|
336
|
+
default:
|
|
337
|
+
this.fail("disallowed character in tag name"), this.state = j, this.xmlDeclPossible = false;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
sOpenWakaBang() {
|
|
341
|
+
switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
|
|
342
|
+
case "[CDATA[":
|
|
343
|
+
this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = true), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = true), this.state = 20, this.openWakaBang = "";
|
|
344
|
+
break;
|
|
345
|
+
case "--":
|
|
346
|
+
this.state = 17, this.openWakaBang = "";
|
|
347
|
+
break;
|
|
348
|
+
case "DOCTYPE":
|
|
349
|
+
this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
|
|
350
|
+
break;
|
|
351
|
+
default:
|
|
352
|
+
this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
sComment() {
|
|
356
|
+
this.captureToChar(45) && (this.state = 18);
|
|
357
|
+
}
|
|
358
|
+
sCommentEnding() {
|
|
359
|
+
const t2 = this.getCodeNorm();
|
|
360
|
+
45 === t2 ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(t2)}`, this.state = 17);
|
|
361
|
+
}
|
|
362
|
+
sCommentEnded() {
|
|
363
|
+
const t2 = this.getCodeNorm();
|
|
364
|
+
t2 !== W ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t2)}`, this.state = 17) : this.state = j;
|
|
365
|
+
}
|
|
366
|
+
sCData() {
|
|
367
|
+
this.captureToChar(q) && (this.state = 21);
|
|
368
|
+
}
|
|
369
|
+
sCDataEnding() {
|
|
370
|
+
const t2 = this.getCodeNorm();
|
|
371
|
+
t2 === q ? this.state = 22 : (this.text += `]${String.fromCodePoint(t2)}`, this.state = 20);
|
|
372
|
+
}
|
|
373
|
+
sCDataEnding2() {
|
|
374
|
+
const t2 = this.getCodeNorm();
|
|
375
|
+
switch (t2) {
|
|
376
|
+
case W:
|
|
377
|
+
this.cdataHandler?.(this.text), this.text = "", this.state = j;
|
|
378
|
+
break;
|
|
379
|
+
case q:
|
|
380
|
+
this.text += "]";
|
|
381
|
+
break;
|
|
382
|
+
default:
|
|
383
|
+
this.text += `]]${String.fromCodePoint(t2)}`, this.state = 20;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
sPIFirstChar() {
|
|
387
|
+
const t2 = this.getCodeNorm();
|
|
388
|
+
this.nameStartCheck(t2) ? (this.piTarget += String.fromCodePoint(t2), this.state = 24) : t2 === _ || v(t2) ? (this.fail("processing instruction without a target."), this.state = t2 === _ ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(t2), this.state = 24);
|
|
389
|
+
}
|
|
390
|
+
sPIRest() {
|
|
391
|
+
const { chunk: t2, i: e2 } = this;
|
|
392
|
+
for (; ; ) {
|
|
393
|
+
const s2 = this.getCodeNorm();
|
|
394
|
+
if (s2 === $) return void (this.piTarget += t2.slice(e2));
|
|
395
|
+
if (!this.nameCheck(s2)) {
|
|
396
|
+
this.piTarget += t2.slice(e2, this.prevI);
|
|
397
|
+
const i2 = s2 === _;
|
|
398
|
+
i2 || v(s2) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = i2 ? H : 27) : this.state = i2 ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s2));
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
sPIBody() {
|
|
404
|
+
if (0 === this.text.length) {
|
|
405
|
+
const t2 = this.getCodeNorm();
|
|
406
|
+
t2 === _ ? this.state = 26 : v(t2) || (this.text = String.fromCodePoint(t2));
|
|
407
|
+
} else this.captureToChar(_) && (this.state = 26);
|
|
408
|
+
}
|
|
409
|
+
sPIEnding() {
|
|
410
|
+
const t2 = this.getCodeNorm();
|
|
411
|
+
if (t2 === W) {
|
|
412
|
+
const { piTarget: t3 } = this;
|
|
413
|
+
"xml" === t3.toLowerCase() && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({ target: t3, body: this.text }), this.piTarget = this.text = "", this.state = j;
|
|
414
|
+
} else t2 === _ ? this.text += "?" : (this.text += `?${String.fromCodePoint(t2)}`, this.state = 25);
|
|
415
|
+
this.xmlDeclPossible = false;
|
|
416
|
+
}
|
|
417
|
+
sXMLDeclNameStart() {
|
|
418
|
+
const t2 = this.skipSpaces();
|
|
419
|
+
t2 !== _ ? t2 !== $ && (this.state = 28, this.name = String.fromCodePoint(t2)) : this.state = H;
|
|
420
|
+
}
|
|
421
|
+
sXMLDeclName() {
|
|
422
|
+
const t2 = this.captureTo(Q);
|
|
423
|
+
if (t2 === _) return this.state = H, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
424
|
+
if (v(t2) || t2 === B) {
|
|
425
|
+
if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
|
|
426
|
+
case 0:
|
|
427
|
+
this.fail("did not expect any more name/value pairs.");
|
|
428
|
+
break;
|
|
429
|
+
case 1:
|
|
430
|
+
this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
|
|
431
|
+
break;
|
|
432
|
+
default:
|
|
433
|
+
this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
|
|
434
|
+
}
|
|
435
|
+
this.state = t2 === B ? 30 : 29;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
sXMLDeclEq() {
|
|
439
|
+
const t2 = this.getCodeNorm();
|
|
440
|
+
if (t2 === _) return this.state = H, void this.fail("XML declaration is incomplete.");
|
|
441
|
+
v(t2) || (t2 !== B && this.fail("value required."), this.state = 30);
|
|
442
|
+
}
|
|
443
|
+
sXMLDeclValueStart() {
|
|
444
|
+
const t2 = this.getCodeNorm();
|
|
445
|
+
if (t2 === _) return this.state = H, void this.fail("XML declaration is incomplete.");
|
|
446
|
+
v(t2) || (z(t2) ? this.q = t2 : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
|
|
447
|
+
}
|
|
448
|
+
sXMLDeclValue() {
|
|
449
|
+
const t2 = this.captureTo([this.q, _]);
|
|
450
|
+
if (t2 === _) return this.state = H, this.text = "", void this.fail("XML declaration is incomplete.");
|
|
451
|
+
if (t2 === $) return;
|
|
452
|
+
const e2 = this.text;
|
|
453
|
+
switch (this.text = "", this.name) {
|
|
454
|
+
case "version": {
|
|
455
|
+
this.xmlDeclExpects = ["encoding", "standalone"];
|
|
456
|
+
const t3 = e2;
|
|
457
|
+
this.xmlDecl.version = t3, /^1\.[0-9]+$/.test(t3) ? this.opt.forceXMLVersion || this.setXMLVersion(t3) : this.fail("version number must match /^1\\.[0-9]+$/.");
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
case "encoding":
|
|
461
|
+
/^[A-Za-z][A-Za-z0-9._-]*$/.test(e2) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = e2;
|
|
462
|
+
break;
|
|
463
|
+
case "standalone":
|
|
464
|
+
"yes" !== e2 && "no" !== e2 && this.fail('standalone value must match "yes" or "no".'), this.xmlDeclExpects = [], this.xmlDecl.standalone = e2;
|
|
465
|
+
}
|
|
466
|
+
this.name = "", this.state = 32;
|
|
467
|
+
}
|
|
468
|
+
sXMLDeclSeparator() {
|
|
469
|
+
const t2 = this.getCodeNorm();
|
|
470
|
+
t2 !== _ ? (v(t2) || (this.fail("whitespace required."), this.unget()), this.state = 27) : this.state = H;
|
|
471
|
+
}
|
|
472
|
+
sXMLDeclEnding() {
|
|
473
|
+
this.getCodeNorm() === W ? ("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 = j) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = false;
|
|
474
|
+
}
|
|
475
|
+
sOpenTag() {
|
|
476
|
+
const t2 = this.captureNameChars();
|
|
477
|
+
if (t2 === $) return;
|
|
478
|
+
const e2 = this.tag = { name: this.name, attributes: /* @__PURE__ */ Object.create(null) };
|
|
479
|
+
switch (this.name = "", this.xmlnsOpt && (this.topNS = e2.ns = /* @__PURE__ */ Object.create(null)), this.openTagStartHandler?.(e2), this.sawRoot = true, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), t2) {
|
|
480
|
+
case W:
|
|
481
|
+
this.openTag();
|
|
482
|
+
break;
|
|
483
|
+
case 47:
|
|
484
|
+
this.state = 35;
|
|
485
|
+
break;
|
|
486
|
+
default:
|
|
487
|
+
v(t2) || this.fail("disallowed character in tag name."), this.state = 36;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
sOpenTagSlash() {
|
|
491
|
+
this.getCode() === W ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
|
|
492
|
+
}
|
|
493
|
+
sAttrib() {
|
|
494
|
+
const t2 = this.skipSpaces();
|
|
495
|
+
t2 !== $ && (C(t2) ? (this.unget(), this.state = 37) : t2 === W ? this.openTag() : 47 === t2 ? this.state = 35 : this.fail("disallowed character in attribute name."));
|
|
496
|
+
}
|
|
497
|
+
sAttribName() {
|
|
498
|
+
const t2 = this.captureNameChars();
|
|
499
|
+
t2 === B ? this.state = 39 : v(t2) ? this.state = 38 : t2 === W ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t2 !== $ && this.fail("disallowed character in attribute name.");
|
|
500
|
+
}
|
|
501
|
+
sAttribNameSawWhite() {
|
|
502
|
+
const t2 = this.skipSpaces();
|
|
503
|
+
switch (t2) {
|
|
504
|
+
case $:
|
|
505
|
+
return;
|
|
506
|
+
case B:
|
|
507
|
+
this.state = 39;
|
|
508
|
+
break;
|
|
509
|
+
default:
|
|
510
|
+
this.fail("attribute without value."), this.text = "", this.name = "", t2 === W ? this.openTag() : C(t2) ? (this.unget(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
sAttribValue() {
|
|
514
|
+
const t2 = this.getCodeNorm();
|
|
515
|
+
z(t2) ? (this.q = t2, this.state = 40) : v(t2) || (this.fail("unquoted attribute value."), this.state = 42, this.unget());
|
|
516
|
+
}
|
|
517
|
+
sAttribValueQuoted() {
|
|
518
|
+
const { q: t2, chunk: e2 } = this;
|
|
519
|
+
let { i: s2 } = this;
|
|
520
|
+
for (; ; ) switch (this.getCode()) {
|
|
521
|
+
case t2:
|
|
522
|
+
return this.pushAttrib(this.name, this.text + e2.slice(s2, this.prevI)), this.name = this.text = "", this.q = null, void (this.state = 41);
|
|
523
|
+
case 38:
|
|
524
|
+
return this.text += e2.slice(s2, this.prevI), this.state = 14, void (this.entityReturnState = 40);
|
|
525
|
+
case F:
|
|
526
|
+
case M:
|
|
527
|
+
case 9:
|
|
528
|
+
this.text += `${e2.slice(s2, this.prevI)} `, s2 = this.i;
|
|
529
|
+
break;
|
|
530
|
+
case X:
|
|
531
|
+
return this.text += e2.slice(s2, this.prevI), void this.fail("disallowed character.");
|
|
532
|
+
case $:
|
|
533
|
+
return void (this.text += e2.slice(s2));
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
sAttribValueClosed() {
|
|
537
|
+
const t2 = this.getCodeNorm();
|
|
538
|
+
v(t2) ? this.state = 36 : t2 === W ? this.openTag() : 47 === t2 ? this.state = 35 : C(t2) ? (this.fail("no whitespace between attributes."), this.unget(), this.state = 37) : this.fail("disallowed character in attribute name.");
|
|
539
|
+
}
|
|
540
|
+
sAttribValueUnquoted() {
|
|
541
|
+
const t2 = this.captureTo(J);
|
|
542
|
+
switch (t2) {
|
|
543
|
+
case 38:
|
|
544
|
+
this.state = 14, this.entityReturnState = 42;
|
|
545
|
+
break;
|
|
546
|
+
case X:
|
|
547
|
+
this.fail("disallowed character.");
|
|
548
|
+
break;
|
|
549
|
+
case $:
|
|
550
|
+
break;
|
|
551
|
+
default:
|
|
552
|
+
this.text.includes("]]>") && this.fail('the string "]]>" is disallowed in char data.'), this.pushAttrib(this.name, this.text), this.name = this.text = "", t2 === W ? this.openTag() : this.state = 36;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
sCloseTag() {
|
|
556
|
+
const t2 = this.captureNameChars();
|
|
557
|
+
t2 === W ? this.closeTag() : v(t2) ? this.state = 44 : t2 !== $ && this.fail("disallowed character in closing tag.");
|
|
558
|
+
}
|
|
559
|
+
sCloseTagSawWhite() {
|
|
560
|
+
switch (this.skipSpaces()) {
|
|
561
|
+
case W:
|
|
562
|
+
this.closeTag();
|
|
563
|
+
break;
|
|
564
|
+
case $:
|
|
565
|
+
break;
|
|
566
|
+
default:
|
|
567
|
+
this.fail("disallowed character in closing tag.");
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
handleTextInRoot() {
|
|
571
|
+
let { i: t2, forbiddenState: e2 } = this;
|
|
572
|
+
const { chunk: s2, textHandler: i2 } = this;
|
|
573
|
+
t: for (; ; ) switch (this.getCode()) {
|
|
574
|
+
case X:
|
|
575
|
+
if (this.state = 15, void 0 !== i2) {
|
|
576
|
+
const { text: e3 } = this, o2 = s2.slice(t2, this.prevI);
|
|
577
|
+
0 !== e3.length ? (i2(e3 + o2), this.text = "") : 0 !== o2.length && i2(o2);
|
|
578
|
+
}
|
|
579
|
+
e2 = 0;
|
|
580
|
+
break t;
|
|
581
|
+
case 38:
|
|
582
|
+
this.state = 14, this.entityReturnState = j, void 0 !== i2 && (this.text += s2.slice(t2, this.prevI)), e2 = 0;
|
|
583
|
+
break t;
|
|
584
|
+
case q:
|
|
585
|
+
switch (e2) {
|
|
586
|
+
case 0:
|
|
587
|
+
e2 = 1;
|
|
588
|
+
break;
|
|
589
|
+
case 1:
|
|
590
|
+
e2 = 2;
|
|
591
|
+
break;
|
|
592
|
+
case 2:
|
|
593
|
+
break;
|
|
594
|
+
default:
|
|
595
|
+
throw new Error("impossible state");
|
|
596
|
+
}
|
|
597
|
+
break;
|
|
598
|
+
case W:
|
|
599
|
+
2 === e2 && this.fail('the string "]]>" is disallowed in char data.'), e2 = 0;
|
|
600
|
+
break;
|
|
601
|
+
case M:
|
|
602
|
+
void 0 !== i2 && (this.text += `${s2.slice(t2, this.prevI)}
|
|
603
|
+
`), t2 = this.i, e2 = 0;
|
|
604
|
+
break;
|
|
605
|
+
case $:
|
|
606
|
+
void 0 !== i2 && (this.text += s2.slice(t2));
|
|
607
|
+
break t;
|
|
608
|
+
default:
|
|
609
|
+
e2 = 0;
|
|
610
|
+
}
|
|
611
|
+
this.forbiddenState = e2;
|
|
612
|
+
}
|
|
613
|
+
handleTextOutsideRoot() {
|
|
614
|
+
let { i: t2 } = this;
|
|
615
|
+
const { chunk: e2, textHandler: s2 } = this;
|
|
616
|
+
let i2 = false;
|
|
617
|
+
t: for (; ; ) {
|
|
618
|
+
const o2 = this.getCode();
|
|
619
|
+
switch (o2) {
|
|
620
|
+
case X:
|
|
621
|
+
if (this.state = 15, void 0 !== s2) {
|
|
622
|
+
const { text: i3 } = this, o3 = e2.slice(t2, this.prevI);
|
|
623
|
+
0 !== i3.length ? (s2(i3 + o3), this.text = "") : 0 !== o3.length && s2(o3);
|
|
624
|
+
}
|
|
625
|
+
break t;
|
|
626
|
+
case 38:
|
|
627
|
+
this.state = 14, this.entityReturnState = j, void 0 !== s2 && (this.text += e2.slice(t2, this.prevI)), i2 = true;
|
|
628
|
+
break t;
|
|
629
|
+
case M:
|
|
630
|
+
void 0 !== s2 && (this.text += `${e2.slice(t2, this.prevI)}
|
|
631
|
+
`), t2 = this.i;
|
|
632
|
+
break;
|
|
633
|
+
case $:
|
|
634
|
+
void 0 !== s2 && (this.text += e2.slice(t2));
|
|
635
|
+
break t;
|
|
636
|
+
default:
|
|
637
|
+
v(o2) || (i2 = true);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
i2 && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = true), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = true));
|
|
641
|
+
}
|
|
642
|
+
pushAttribNS(t2, e2) {
|
|
643
|
+
const { prefix: s2, local: i2 } = this.qname(t2), o2 = { name: t2, prefix: s2, local: i2, value: e2 };
|
|
644
|
+
if (this.attribList.push(o2), this.attributeHandler?.(o2), "xmlns" === s2) {
|
|
645
|
+
const t3 = e2.trim();
|
|
646
|
+
"1.0" === this.currentXMLVersion && "" === t3 && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[i2] = t3, K(this, i2, t3);
|
|
647
|
+
} else if ("xmlns" === t2) {
|
|
648
|
+
const t3 = e2.trim();
|
|
649
|
+
this.topNS[""] = t3, K(this, "", t3);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
pushAttribPlain(t2, e2) {
|
|
653
|
+
const s2 = { name: t2, value: e2 };
|
|
654
|
+
this.attribList.push(s2), this.attributeHandler?.(s2);
|
|
655
|
+
}
|
|
656
|
+
end() {
|
|
657
|
+
this.sawRoot || this.fail("document must contain a root element.");
|
|
658
|
+
const { tags: t2 } = this;
|
|
659
|
+
for (; t2.length > 0; ) {
|
|
660
|
+
const e3 = t2.pop();
|
|
661
|
+
this.fail(`unclosed tag: ${e3.name}`);
|
|
662
|
+
}
|
|
663
|
+
0 !== this.state && this.state !== j && this.fail("unexpected end.");
|
|
664
|
+
const { text: e2 } = this;
|
|
665
|
+
return 0 !== e2.length && (this.textHandler?.(e2), this.text = ""), this._closed = true, this.endHandler?.(), this._init(), this;
|
|
666
|
+
}
|
|
667
|
+
resolve(t2) {
|
|
668
|
+
let e2 = this.topNS[t2];
|
|
669
|
+
if (void 0 !== e2) return e2;
|
|
670
|
+
const { tags: s2 } = this;
|
|
671
|
+
for (let i2 = s2.length - 1; i2 >= 0; i2--) if (e2 = s2[i2].ns[t2], void 0 !== e2) return e2;
|
|
672
|
+
return e2 = this.ns[t2], void 0 !== e2 ? e2 : this.opt.resolvePrefix?.(t2);
|
|
673
|
+
}
|
|
674
|
+
qname(t2) {
|
|
675
|
+
const e2 = t2.indexOf(":");
|
|
676
|
+
if (-1 === e2) return { prefix: "", local: t2 };
|
|
677
|
+
const s2 = t2.slice(e2 + 1), i2 = t2.slice(0, e2);
|
|
678
|
+
return ("" === i2 || "" === s2 || s2.includes(":")) && this.fail(`malformed name: ${t2}.`), { prefix: i2, local: s2 };
|
|
679
|
+
}
|
|
680
|
+
processAttribsNS() {
|
|
681
|
+
const { attribList: t2 } = this, e2 = this.tag;
|
|
682
|
+
{
|
|
683
|
+
const { prefix: t3, local: s3 } = this.qname(e2.name);
|
|
684
|
+
e2.prefix = t3, e2.local = s3;
|
|
685
|
+
const i3 = e2.uri = this.resolve(t3) ?? "";
|
|
686
|
+
"" !== t3 && ("xmlns" === t3 && this.fail('tags may not have "xmlns" as prefix.'), "" === i3 && (this.fail(`unbound namespace prefix: ${JSON.stringify(t3)}.`), e2.uri = t3));
|
|
687
|
+
}
|
|
688
|
+
if (0 === t2.length) return;
|
|
689
|
+
const { attributes: s2 } = e2, i2 = /* @__PURE__ */ new Set();
|
|
690
|
+
for (const e3 of t2) {
|
|
691
|
+
const { name: t3, prefix: o2, local: r2 } = e3;
|
|
692
|
+
let n2, a2;
|
|
693
|
+
"" === o2 ? (n2 = "xmlns" === t3 ? L : "", a2 = t3) : (n2 = this.resolve(o2), void 0 === n2 && (this.fail(`unbound namespace prefix: ${JSON.stringify(o2)}.`), n2 = o2), a2 = `{${n2}}${r2}`), i2.has(a2) && this.fail(`duplicate attribute: ${a2}.`), i2.add(a2), e3.uri = n2, s2[t3] = e3;
|
|
694
|
+
}
|
|
695
|
+
this.attribList = [];
|
|
696
|
+
}
|
|
697
|
+
processAttribsPlain() {
|
|
698
|
+
const { attribList: t2 } = this, e2 = this.tag.attributes;
|
|
699
|
+
for (const { name: s2, value: i2 } of t2) void 0 !== e2[s2] && this.fail(`duplicate attribute: ${s2}.`), e2[s2] = i2;
|
|
700
|
+
this.attribList = [];
|
|
701
|
+
}
|
|
702
|
+
openTag() {
|
|
703
|
+
this.processAttribs();
|
|
704
|
+
const { tags: t2 } = this, e2 = this.tag;
|
|
705
|
+
e2.isSelfClosing = false, this.openTagHandler?.(e2), t2.push(e2), this.state = j, this.name = "";
|
|
706
|
+
}
|
|
707
|
+
openSelfClosingTag() {
|
|
708
|
+
this.processAttribs();
|
|
709
|
+
const { tags: t2 } = this, e2 = this.tag;
|
|
710
|
+
e2.isSelfClosing = true, this.openTagHandler?.(e2), this.closeTagHandler?.(e2), null === (this.tag = t2[t2.length - 1] ?? null) && (this.closedRoot = true), this.state = j, this.name = "";
|
|
711
|
+
}
|
|
712
|
+
closeTag() {
|
|
713
|
+
const { tags: t2, name: e2 } = this;
|
|
714
|
+
if (this.state = j, this.name = "", "" === e2) return this.fail("weird empty close tag."), void (this.text += "</>");
|
|
715
|
+
const s2 = this.closeTagHandler;
|
|
716
|
+
let i2 = t2.length;
|
|
717
|
+
for (; i2-- > 0; ) {
|
|
718
|
+
const i3 = this.tag = t2.pop();
|
|
719
|
+
if (this.topNS = i3.ns, s2?.(i3), i3.name === e2) break;
|
|
720
|
+
this.fail("unexpected close tag.");
|
|
721
|
+
}
|
|
722
|
+
0 === i2 ? this.closedRoot = true : i2 < 0 && (this.fail(`unmatched closing tag: ${e2}.`), this.text += `</${e2}>`);
|
|
723
|
+
}
|
|
724
|
+
parseEntity(t2) {
|
|
725
|
+
if ("#" !== t2[0]) {
|
|
726
|
+
const e3 = this.ENTITIES[t2];
|
|
727
|
+
return void 0 !== e3 ? e3 : (this.fail(this.isName(t2) ? "undefined entity." : "disallowed character in entity name."), `&${t2};`);
|
|
728
|
+
}
|
|
729
|
+
let e2 = NaN;
|
|
730
|
+
return "x" === t2[1] && /^#x[0-9a-f]+$/i.test(t2) ? e2 = parseInt(t2.slice(2), 16) : /^#[0-9]+$/.test(t2) && (e2 = parseInt(t2.slice(1), 10)), this.isChar(e2) ? String.fromCodePoint(e2) : (this.fail("malformed character entity."), `&${t2};`);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
var it, ot;
|
|
734
|
+
(ot = it || (it = {})).Events = { XmlDecl: "xmldecl", Text: "text", ProcessingInstruction: "processinginstruction", Doctype: "doctype", Comment: "comment", OpenTagStart: "opentagstart", Attribute: "attribute", OpenTag: "opentag", CloseTag: "closetag", CDdata: "cdata", Error: "error", End: "end", Ready: "ready" }, ot.parseStream = async (t2, e2, s2) => {
|
|
735
|
+
const i2 = new st({ position: false, ...s2 });
|
|
736
|
+
let o2;
|
|
737
|
+
if (e2.onOpenTagStart && i2.on(ot.Events.OpenTagStart, e2.onOpenTagStart), e2.onOpenTag && i2.on(ot.Events.OpenTag, e2.onOpenTag), e2.onCloseTag && i2.on(ot.Events.CloseTag, e2.onCloseTag), e2.onAttribute && i2.on(ot.Events.Attribute, e2.onAttribute), e2.onText && i2.on(ot.Events.Text, e2.onText), e2.onError && i2.on(ot.Events.Error, e2.onError), e2.onEnd) {
|
|
738
|
+
e2.onEnd;
|
|
739
|
+
const t3 = () => {
|
|
740
|
+
o2 = e2.onEnd();
|
|
741
|
+
};
|
|
742
|
+
i2.on(ot.Events.End, t3);
|
|
743
|
+
}
|
|
744
|
+
for (; ; ) {
|
|
745
|
+
const { value: e3, done: s3 } = await t2.read();
|
|
746
|
+
if (s3) break;
|
|
747
|
+
i2.write(e3);
|
|
748
|
+
}
|
|
749
|
+
return i2.close(), o2;
|
|
750
|
+
};
|
|
751
|
+
const rt = (t2) => true === t2 || "1" === t2 || "on" === t2 || "true" === t2 || false !== t2 && "0" !== t2 && "off" !== t2 && "false" !== t2 && null, nt = (t2) => {
|
|
752
|
+
const e2 = parseInt(t2);
|
|
753
|
+
return isNaN(e2) ? null : e2;
|
|
754
|
+
}, at = (t2) => {
|
|
755
|
+
const e2 = parseFloat(t2);
|
|
756
|
+
return isNaN(e2) ? null : e2;
|
|
757
|
+
}, lt = null;
|
|
758
|
+
class ct {
|
|
759
|
+
constructor() {
|
|
760
|
+
this._registeredVisitors = /* @__PURE__ */ new Map();
|
|
761
|
+
}
|
|
762
|
+
registerVisitor(t2) {
|
|
763
|
+
this._registeredVisitors.set(t2.from, t2);
|
|
764
|
+
}
|
|
765
|
+
createEventHandler(t2, e2, s2) {
|
|
766
|
+
const i2 = this._registeredVisitors, o2 = [];
|
|
767
|
+
let r2 = null, n2 = null, a2 = null, l2 = null;
|
|
768
|
+
const c2 = [], h2 = { key: null, source: t2 };
|
|
769
|
+
let u2 = null, d2 = false;
|
|
770
|
+
const p2 = (t3, e3) => {
|
|
771
|
+
let s3 = a2.attributes[t3];
|
|
772
|
+
if (e3) if (Array.isArray(e3)) for (let t4 = 0; t4 < e3.length; t4++) {
|
|
773
|
+
if (null == s3) return;
|
|
774
|
+
if (s3 = e3[t4](s3), null == s3) return;
|
|
775
|
+
}
|
|
776
|
+
else {
|
|
777
|
+
if (null == s3) return;
|
|
778
|
+
if (s3 = e3(s3), null == s3) return;
|
|
779
|
+
}
|
|
780
|
+
return s3;
|
|
781
|
+
}, g2 = { getSource: () => u2.source, setSource: (t3) => {
|
|
782
|
+
u2.source = t3;
|
|
783
|
+
}, setKey: (t3) => {
|
|
784
|
+
u2.key = t3;
|
|
785
|
+
}, getFrom: () => a2, getAttribute: (t3, e3) => p2(t3, e3) ?? null, hasAttribute: (t3) => null !== g2.getAttribute(t3), getParent: () => c2[c2.length - 2].source, getPath: () => {
|
|
786
|
+
const t3 = [];
|
|
787
|
+
for (let e3 = 0; e3 < o2.length; e3++) t3.push(o2[e3].local);
|
|
788
|
+
return t3.join("\\");
|
|
789
|
+
}, parseAttribute: p2, copyToObject: (t3, e3, s3, i3) => {
|
|
790
|
+
const o3 = p2(i3 ?? e3, s3);
|
|
791
|
+
void 0 !== o3 && (t3[e3] = o3);
|
|
792
|
+
}, copyTo: (t3, e3, s3) => {
|
|
793
|
+
const i3 = p2(s3 ?? t3, e3);
|
|
794
|
+
void 0 !== i3 && (u2.source[t3] = i3);
|
|
795
|
+
}, warn: (t3) => {
|
|
796
|
+
s2 ? s2?.(t3) : console.warn(t3);
|
|
797
|
+
} };
|
|
798
|
+
return { onOpenTag: (t3) => {
|
|
799
|
+
let e3 = t3.name;
|
|
800
|
+
const s3 = e3.indexOf(":");
|
|
801
|
+
-1 !== s3 && (e3 = e3.slice(s3 + 1));
|
|
802
|
+
const p3 = i2.get(e3);
|
|
803
|
+
if (r2 = { local: e3, visitor: p3, tag: t3, destination: null }, d2) return o2.push(r2), n2 = e3, void (a2 = t3);
|
|
804
|
+
l2 = r2?.visitor ?? null, p3 && (u2 = 0 === o2.length ? h2 : null !== l2?.to ? { key: null, source: {} } : null, r2.destination = u2, u2 && c2.push(u2)), o2.push(r2), n2 = e3, a2 = t3, d2 = null === l2?.to, l2?.openTag?.(g2);
|
|
805
|
+
}, onCloseTag: (t3) => {
|
|
806
|
+
let e3 = t3.name;
|
|
807
|
+
const i3 = e3.indexOf(":");
|
|
808
|
+
if (-1 !== i3 && (e3 = e3.slice(i3 + 1)), e3 !== n2) throw new Error(`mismatch open/close tag: '${e3}'/'${n2}'`);
|
|
809
|
+
d2 || l2?.closeTag?.(g2);
|
|
810
|
+
const p3 = o2.pop() ?? null;
|
|
811
|
+
r2 = o2[o2.length - 1] ?? null;
|
|
812
|
+
const f2 = p3?.destination;
|
|
813
|
+
if (f2) {
|
|
814
|
+
c2.pop(), u2 = c2[c2.length - 1] ?? h2;
|
|
815
|
+
const t4 = p3.visitor;
|
|
816
|
+
t4 && t4.to && void 0 !== f2.source && (Array.isArray(t4.to) ? u2.source.push ? u2.source.push(f2.source) : s2?.(`Unable to parse array for ${t4.from} at ${g2.getPath()}`) : f2.key ? u2.source[f2.key] = f2.source : "string" == typeof t4.to && (u2.source[t4.to] = f2.source));
|
|
817
|
+
}
|
|
818
|
+
n2 = r2?.local ?? null, a2 = r2?.tag ?? null, l2 = r2?.visitor ?? null, d2 = !r2?.destination;
|
|
819
|
+
}, onText: (t3) => {
|
|
820
|
+
l2?.text?.(t3, g2);
|
|
821
|
+
}, onEnd: e2 };
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
const ht = (t2, e2, s2, i2 = null) => {
|
|
825
|
+
if (!t2) return null;
|
|
826
|
+
let o2 = t2;
|
|
827
|
+
o2.startsWith("/") && (o2 = o2.substring(1));
|
|
828
|
+
let r2 = i2?.parsedRefs?.get(t2);
|
|
829
|
+
if (void 0 !== r2) return r2;
|
|
830
|
+
const n2 = e2(o2);
|
|
831
|
+
if (!n2) return null;
|
|
832
|
+
let a2 = n2.content;
|
|
833
|
+
try {
|
|
834
|
+
s2 && (a2 = s2(a2));
|
|
835
|
+
} catch (t3) {
|
|
836
|
+
console.warn(t3);
|
|
837
|
+
}
|
|
838
|
+
return i2?.parsedRefs?.set(t2, a2), a2;
|
|
839
|
+
}, ut = (t2, e2, s2, i2, o2 = null) => {
|
|
840
|
+
if (!t2) return null;
|
|
841
|
+
let r2 = t2;
|
|
842
|
+
r2.startsWith("/") && (r2 = r2.substring(1));
|
|
843
|
+
let n2 = o2?.parsedRefs?.get(t2);
|
|
844
|
+
if (void 0 !== n2) return n2;
|
|
845
|
+
const a2 = e2(r2);
|
|
846
|
+
if (!a2) return null;
|
|
847
|
+
const l2 = a2.content;
|
|
848
|
+
try {
|
|
849
|
+
const e3 = new TextDecoder().decode(l2), r3 = s2.parseFromString(e3, "text/xml"), n3 = i2.convert(r3, t2, o2);
|
|
850
|
+
return o2?.parsedRefs?.set(t2, n3), n3;
|
|
851
|
+
} catch (t3) {
|
|
852
|
+
console.warn(t3);
|
|
853
|
+
}
|
|
854
|
+
return null;
|
|
855
|
+
}, dt = (t2, e2, s2, i2, o2 = null) => {
|
|
856
|
+
const r2 = /* @__PURE__ */ new Map();
|
|
857
|
+
let n2 = e2.Directory[t2];
|
|
858
|
+
const a2 = n2 ? n2.length : 0;
|
|
859
|
+
for (let t3 = 0; t3 < a2; t3++) {
|
|
860
|
+
const a3 = n2[t3];
|
|
861
|
+
if (!a3) continue;
|
|
862
|
+
let l2 = a3;
|
|
863
|
+
l2.startsWith("/") && (l2 = l2.substring(1));
|
|
864
|
+
const c2 = ut(l2, (t4) => e2.files[t4], s2, i2, o2);
|
|
865
|
+
r2.set(l2, c2);
|
|
866
|
+
}
|
|
867
|
+
return r2;
|
|
868
|
+
}, pt = ["lt1", "dk1", "lt2", "dk2", "accent1", "accent2", "accent3", "accent4", "accent5", "accent6", "hlink", "folHlink"], gt = (t2, e2 = "dk1") => {
|
|
869
|
+
let s2;
|
|
870
|
+
const i2 = t2("auto");
|
|
871
|
+
void 0 === i2 || "1" !== i2 && "true" !== i2 || (s2 = e2);
|
|
872
|
+
const o2 = t2("indexed");
|
|
873
|
+
o2 && (s2 = `index${o2}`);
|
|
874
|
+
const r2 = t2("rgb");
|
|
875
|
+
r2 && (s2 = r2.toLowerCase(), 8 !== r2.length || r2.startsWith("FF") || (s2 = "FF" + r2.substring(2, r2.length)));
|
|
876
|
+
const n2 = t2("theme");
|
|
877
|
+
n2 && (s2 = pt[n2]);
|
|
878
|
+
let a2 = t2("tint");
|
|
879
|
+
if (a2 && (s2 += ` ${h.AdjustmentType.ETint} ${parseFloat(a2)}`), s2) return s2;
|
|
880
|
+
}, ft = (t2) => t2 ? t2.replace(/^\{([\s\S]+)\}$/, "$1") : t2, mt = (t2) => t2 ? p.roundAccurately(parseFloat(t2) / 12700, 4) : null, Tt = (t2) => t2 ? p.roundAccurately(parseFloat(t2) / 9525, 1) : null, yt = (t2) => parseFloat(t2) / 1e3, bt = (t2) => parseFloat(t2) / 6e4, xt = (t2) => "true" === t2 || "1" === t2;
|
|
881
|
+
class wt {
|
|
882
|
+
static {
|
|
883
|
+
this.Collapsed = 1;
|
|
884
|
+
}
|
|
885
|
+
static {
|
|
886
|
+
this.CustomFormat = 2;
|
|
887
|
+
}
|
|
888
|
+
static {
|
|
889
|
+
this.CustomHeight = 4;
|
|
890
|
+
}
|
|
891
|
+
static {
|
|
892
|
+
this.Hidden = 8;
|
|
893
|
+
}
|
|
894
|
+
static {
|
|
895
|
+
this.Ht = 16;
|
|
896
|
+
}
|
|
897
|
+
static {
|
|
898
|
+
this.OutlineLevel = 32;
|
|
899
|
+
}
|
|
900
|
+
static {
|
|
901
|
+
this.Ph = 64;
|
|
902
|
+
}
|
|
903
|
+
static {
|
|
904
|
+
this.R = 128;
|
|
905
|
+
}
|
|
906
|
+
static {
|
|
907
|
+
this.S = 256;
|
|
908
|
+
}
|
|
909
|
+
static {
|
|
910
|
+
this.Spans = 512;
|
|
911
|
+
}
|
|
912
|
+
static {
|
|
913
|
+
this.ThickBot = 1024;
|
|
914
|
+
}
|
|
915
|
+
static {
|
|
916
|
+
this.ThickTop = 2048;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
const vt = (t2, e2, s2) => {
|
|
920
|
+
if (t2[0].value[0] === t2[1].value[0]) return e2;
|
|
921
|
+
}, St = { colStart: 0, colEnd: 0, rowStart: 0, rowEnd: 0 }, Ct = Object.freeze(Object.defineProperty({ __proto__: null, fromBufferXLSX: async (t2, h2) => {
|
|
922
|
+
const { password: p2, onWarning: m2, constructorOptions: T2 = {}, ...y2 } = h2 ?? {}, b2 = import("./CVU9bu6AnxcgkEwq.mjs"), x2 = import("./D5bg3v_W8K9MVp0j.mjs");
|
|
923
|
+
let w2 = null;
|
|
924
|
+
try {
|
|
925
|
+
w2 = new DOMParser();
|
|
926
|
+
} catch (t3) {
|
|
927
|
+
}
|
|
928
|
+
let v2 = null;
|
|
929
|
+
w2 || (v2 = import("./BIfdVpnJR1TZwCPR.mjs").then((t3) => t3.i));
|
|
930
|
+
let S2 = null, C2 = null, k2 = null;
|
|
931
|
+
try {
|
|
932
|
+
const t3 = await Promise.all([b2, x2, v2]);
|
|
933
|
+
S2 = t3[0], C2 = t3[1], k2 = t3[2];
|
|
934
|
+
} catch (t3) {
|
|
935
|
+
throw new Error("Unable to load XLSX parser.", { cause: t3 });
|
|
936
|
+
}
|
|
937
|
+
try {
|
|
938
|
+
const h3 = S2.read(t2, { type: "array", sheets: [], cellStyles: false, bookFiles: true });
|
|
939
|
+
if (!h3.Directory) throw new Error("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
|
|
940
|
+
h3.Directory.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], h3.Directory.richdata = ["/xl/richData/rdrichvalue.xml"];
|
|
941
|
+
const p3 = new C2.FromOOXMLConverter(), g2 = w2 ?? new k2.DOMParser(), y3 = T2?.resources ?? new s(), b3 = y3.beginPersist(), x3 = {}, v3 = /* @__PURE__ */ new Set(), A2 = /* @__PURE__ */ new Map();
|
|
942
|
+
A2.set("richTypes", []);
|
|
943
|
+
const D2 = /* @__PURE__ */ new Map(), E2 = [], P2 = (t3) => h3.files[t3], O2 = (t3, e2) => {
|
|
944
|
+
const s2 = t3.lastIndexOf("/"), i2 = t3.substring(0, s2 + 1) + "_rels/" + t3.substring(s2 + 1, t3.length) + ".rels";
|
|
945
|
+
let o2 = e2.get(i2);
|
|
946
|
+
return o2 || (o2 = ((t4, e3, s3, i3, o3 = null) => {
|
|
947
|
+
if (!t4) return null;
|
|
948
|
+
const r2 = ut(t4, e3, s3, i3, o3);
|
|
949
|
+
if (!r2) return null;
|
|
950
|
+
const n2 = /* @__PURE__ */ new Map(), a2 = Object.keys(r2), l2 = a2.length;
|
|
951
|
+
for (let t5 = 0; t5 < l2; t5++) {
|
|
952
|
+
const e4 = a2[t5], s4 = r2[e4];
|
|
953
|
+
n2.set(e4, s4);
|
|
954
|
+
}
|
|
955
|
+
return n2;
|
|
956
|
+
})(i2, P2, g2, p3, V2), e2.set(i2, o2)), o2;
|
|
957
|
+
}, I2 = (t3, s2, a2, l2 = D2) => {
|
|
958
|
+
let c2 = O2(s2, l2).get(t3), h4 = c2?.target;
|
|
959
|
+
if (!h4) return null;
|
|
960
|
+
if ("External" === c2.targetMode) return c2.target;
|
|
961
|
+
const T3 = s2.lastIndexOf("/"), w3 = s2.substring(0, T3 + 1);
|
|
962
|
+
h4.startsWith("/") || (h4 = w3 + h4), h4 = ((t4) => {
|
|
963
|
+
const e2 = t4.split(/\/+/);
|
|
964
|
+
return e2.reduce((t5, e3, s3) => ("." === e3 ? t5.splice(s3, 1) : ".." === e3 && t5.splice(s3 - 1, 2), t5), e2).join("/");
|
|
965
|
+
})(h4);
|
|
966
|
+
const S3 = p3?.getVisitorParamsState().get("dxfs");
|
|
967
|
+
let C3 = l2.get(h4);
|
|
968
|
+
if (!C3) {
|
|
969
|
+
const t4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet";
|
|
970
|
+
if (c2.type === t4) {
|
|
971
|
+
const t5 = {};
|
|
972
|
+
C3 = t5;
|
|
973
|
+
const s3 = async () => {
|
|
974
|
+
const s4 = ((t6, s5, n2, a4, l3, c4, h5) => {
|
|
975
|
+
const p5 = new ct(), g4 = new i.TransposedBuilder();
|
|
976
|
+
let m3 = null;
|
|
977
|
+
p5.registerVisitor({ from: "autoFilter", to: "filter", openTag: (t7) => {
|
|
978
|
+
t7.copyTo("ref", lt);
|
|
979
|
+
} }), p5.registerVisitor({ from: "conditionalFormatting", to: {}, openTag: (t7) => {
|
|
980
|
+
const e2 = t7.getParent();
|
|
981
|
+
e2.conditionals || (e2.conditionals = []), e2.conditionals.push(t7.getSource());
|
|
982
|
+
const s6 = t7.getAttribute("sqref");
|
|
983
|
+
s6 && (t7.getSource().ref = s6.split(" ").join(",")), t7.copyTo("pivot", rt);
|
|
984
|
+
}, closeTag: (t7) => {
|
|
985
|
+
const e2 = t7.getSource();
|
|
986
|
+
if (e2.rule) {
|
|
987
|
+
const t8 = Object.keys(e2.rule);
|
|
988
|
+
for (let s6 = 0; s6 < t8.length; s6++) {
|
|
989
|
+
const i2 = t8[s6];
|
|
990
|
+
"rule" !== i2 && (e2[i2] = e2.rule[i2]);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
delete e2.rule;
|
|
994
|
+
} }), p5.registerVisitor({ from: "cfRule", to: "rule", openTag: (t7) => {
|
|
995
|
+
const e2 = t7.getParent();
|
|
996
|
+
t7.copyToObject(e2, "type", lt), t7.copyToObject(e2, "priority", nt), t7.copyToObject(e2, "stopIfTrue", rt);
|
|
997
|
+
const s6 = t7.getAttribute("dxfId", nt);
|
|
998
|
+
if (null !== s6) {
|
|
999
|
+
let i2 = a4?.get(s6);
|
|
1000
|
+
i2 || (c4?.(`Unable to load conditional color. Invalid dxfI: '${s6}' at '${t7.getPath()}'.`), i2 = {}), e2.style = i2;
|
|
1001
|
+
}
|
|
1002
|
+
t7.copyToObject(e2, "aboveAverage", rt), t7.copyToObject(e2, "equalAverage", rt), t7.copyToObject(e2, "stdDev", nt), t7.copyToObject(e2, "bottom", rt), t7.copyToObject(e2, "percent", rt), t7.copyToObject(e2, "rank", nt), t7.copyToObject(e2, "operator", lt), t7.copyToObject(e2, "text", lt), t7.copyToObject(e2, "timePeriod", lt);
|
|
1003
|
+
} }), p5.registerVisitor({ from: "colorScale", to: "colorScale" }), p5.registerVisitor({ from: "dataBar", to: "dataBar", openTag: (t7) => {
|
|
1004
|
+
t7.copyTo("maxLength", nt), t7.copyTo("minLength", nt), t7.copyTo("showValue", rt);
|
|
1005
|
+
} }), p5.registerVisitor({ from: "iconSet", to: "iconSet", openTag: (t7) => {
|
|
1006
|
+
t7.copyTo("iconSet", lt), t7.copyTo("reverse", rt), t7.copyTo("showValue", rt);
|
|
1007
|
+
} }), p5.registerVisitor({ from: "formula", to: null, text: (t7, e2) => {
|
|
1008
|
+
const s6 = e2.getParent();
|
|
1009
|
+
let i2 = s6.formulas;
|
|
1010
|
+
i2 || (i2 = [], s6.formulas = i2), i2.push(t7);
|
|
1011
|
+
} }), p5.registerVisitor({ from: "cfvo", to: {}, openTag: (t7) => {
|
|
1012
|
+
const e2 = t7.getParent();
|
|
1013
|
+
e2.conditions || (e2.conditions = []), e2.conditions.push(t7.getSource()), t7.copyTo("type", lt), t7.copyTo("value", at, "val"), t7.copyTo("gte", rt);
|
|
1014
|
+
} }), p5.registerVisitor({ from: "color", to: {}, openTag: (t7) => {
|
|
1015
|
+
const e2 = t7.getParent();
|
|
1016
|
+
e2.colors || (e2.colors = []);
|
|
1017
|
+
const s6 = gt((e3) => t7.getAttribute(e3));
|
|
1018
|
+
e2.colors.push(s6);
|
|
1019
|
+
} }), p5.registerVisitor({ from: "filterColumn", to: "filterColumn", openTag: (t7) => {
|
|
1020
|
+
const e2 = t7.getParent();
|
|
1021
|
+
e2.fields || (e2.fields = []), e2.fields.push(t7.getSource()), t7.copyTo("offset", nt, "colId"), t7.copyTo("hiddenButton", rt), t7.copyTo("showButton", rt);
|
|
1022
|
+
} }), p5.registerVisitor({ from: "colorFilter", to: "colorFilter", openTag: (t7) => {
|
|
1023
|
+
const e2 = t7.getParent();
|
|
1024
|
+
e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Color, t7.copyTo("cellColor", rt), t7.copyTo("styleId", nt, "dxfId");
|
|
1025
|
+
} }), p5.registerVisitor({ from: "dynamicFilter", to: "dynamicFilter", openTag: (t7) => {
|
|
1026
|
+
const e2 = t7.getParent();
|
|
1027
|
+
e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Dynamic, t7.copyTo("dynamicType", lt, "type"), t7.copyTo("val", at), t7.copyTo("maxVal", at, "maxVal");
|
|
1028
|
+
} }), p5.registerVisitor({ from: "iconFilter", to: "iconFilter", openTag: (t7) => {
|
|
1029
|
+
const e2 = t7.getParent();
|
|
1030
|
+
e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Icon, t7.copyTo("iconId", nt), t7.copyTo("iconSet", lt);
|
|
1031
|
+
} }), p5.registerVisitor({ from: "top10", to: "top10", openTag: (t7) => {
|
|
1032
|
+
const e2 = t7.getParent();
|
|
1033
|
+
e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Top10, t7.copyTo("filterVal", at), t7.copyTo("percent", rt), t7.copyTo("top", rt), t7.copyTo("val", at);
|
|
1034
|
+
} }), p5.registerVisitor({ from: "filters", to: "filters", openTag: (t7) => {
|
|
1035
|
+
const e2 = t7.getParent();
|
|
1036
|
+
e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Items, t7.copyTo("blank", rt), t7.copyTo("calendarType", lt);
|
|
1037
|
+
} }), p5.registerVisitor({ from: "dateGroupItem", to: "dateGroupItem", openTag: (t7) => {
|
|
1038
|
+
const e2 = t7.getParent();
|
|
1039
|
+
e2.dateGroups || (e2.dateGroups = []), e2.dateGroups.push(t7.getSource()), t7.copyTo("group", lt, "dateTimeGrouping"), t7.copyTo("day", nt), t7.copyTo("hour", nt), t7.copyTo("minute", nt), t7.copyTo("month", nt), t7.copyTo("second", nt), t7.copyTo("year", nt);
|
|
1040
|
+
} }), p5.registerVisitor({ from: "filter", to: "filter", openTag: (t7) => {
|
|
1041
|
+
const e2 = t7.getParent();
|
|
1042
|
+
e2.items || (e2.items = []), e2.items.push(t7.getAttribute("val", at));
|
|
1043
|
+
} }), p5.registerVisitor({ from: "customFilters", to: "customFilters", openTag: (t7) => {
|
|
1044
|
+
const e2 = t7.getParent();
|
|
1045
|
+
e2.criteria || (e2.criteria = []), e2.criteria.push(t7.getSource()), t7.getSource().type = o.Type.Custom, t7.copyTo("and", rt);
|
|
1046
|
+
} }), p5.registerVisitor({ from: "customFilter", to: "customFilter", openTag: (t7) => {
|
|
1047
|
+
const e2 = t7.getParent();
|
|
1048
|
+
e2.filters || (e2.filters = []), e2.filters.push(t7.getSource()), t7.copyTo("operator", lt), t7.copyTo("value", at, "val");
|
|
1049
|
+
} }), p5.registerVisitor({ from: "sortState", to: "sort", openTag: (t7) => {
|
|
1050
|
+
t7.copyTo("ref", lt);
|
|
1051
|
+
} }), p5.registerVisitor({ from: "sortCondition", to: "sortCondition", openTag: (t7) => {
|
|
1052
|
+
const e2 = t7.getParent();
|
|
1053
|
+
e2.fields || (e2.fields = []);
|
|
1054
|
+
const s6 = t7.getSource();
|
|
1055
|
+
e2.fields.push(s6), t7.copyTo("sortOn", lt, "sortBy"), t7.copyTo("dxfId", lt, "sortBy"), t7.copyTo("iconSet", lt), t7.copyTo("customList", lt);
|
|
1056
|
+
const i2 = t7.getAttribute("ref");
|
|
1057
|
+
if (i2) {
|
|
1058
|
+
const t8 = r.fastStringToRange(i2, St).colStart, o2 = r.fastStringToRange(e2.ref, St), n3 = o2.colStart;
|
|
1059
|
+
s6.offset = o2 ? t8 - n3 : t8;
|
|
1060
|
+
}
|
|
1061
|
+
s6.reverse = t7.getAttribute("descending", rt) ?? false;
|
|
1062
|
+
} }), p5.registerVisitor({ from: "AlternateContent", to: null });
|
|
1063
|
+
const T5 = (t7) => {
|
|
1064
|
+
m3 = t7.getSource(), t7.copyTo("topLeft", lt, "topLeftCell");
|
|
1065
|
+
const e2 = xt(t7.getAttribute("defaultGridColor")), s6 = t7.getAttribute("colorId");
|
|
1066
|
+
null === s6 || e2 || (t7.getSource().gridLineColor = "index" + parseFloat(s6)), t7.copyTo("showZeros", rt), t7.copyTo("showFormulas", rt), t7.copyTo("zoomScale", nt), t7.copyTo("showRowHeaders", rt, "showRowColHeaders"), t7.copyTo("showColumnHeaders", rt, "showRowColHeaders"), t7.copyTo("showRowGridlines", rt, "showGridLines"), t7.copyTo("showColumnGridlines", rt, "showGridLines");
|
|
1067
|
+
};
|
|
1068
|
+
p5.registerVisitor({ from: "sheetView", to: "view", openTag: (t7) => {
|
|
1069
|
+
T5(t7);
|
|
1070
|
+
}, closeTag: () => {
|
|
1071
|
+
m3 = null;
|
|
1072
|
+
} }), p5.registerVisitor({ from: "customSheetViews", to: "customSheetViews", openTag: (t7) => {
|
|
1073
|
+
t7.setSource([]);
|
|
1074
|
+
} }), p5.registerVisitor({ from: "customSheetView", to: [], openTag: (t7) => {
|
|
1075
|
+
T5(t7);
|
|
1076
|
+
}, closeTag: () => {
|
|
1077
|
+
m3 = null;
|
|
1078
|
+
} }), p5.registerVisitor({ from: "selection", to: "selection", openTag: (t7) => {
|
|
1079
|
+
if (!m3) return;
|
|
1080
|
+
t7.copyTo("cell", lt, "activeCell"), t7.copyTo("rangeIndex", nt, "activeCellId");
|
|
1081
|
+
const e2 = t7.getAttribute("activeCell"), s6 = t7.getAttribute("sqref");
|
|
1082
|
+
s6 && s6 !== e2 && (t7.getSource().ranges = s6.split(" "));
|
|
1083
|
+
} }), p5.registerVisitor({ from: "pane", to: "pane", openTag: (t7) => {
|
|
1084
|
+
if (m3 && "frozen" === t7.getAttribute("state")) {
|
|
1085
|
+
const e2 = {};
|
|
1086
|
+
m3.freezePanes = e2, t7.copyToObject(e2, "topLeft", lt, "topLeftCell");
|
|
1087
|
+
const s6 = m3.topLeft ? r.fastStringToCell(m3.topLeft) : { colIndex: 0, rowIndex: 0 }, i2 = { colIndex: 0, rowIndex: 0 };
|
|
1088
|
+
t7.copyToObject(i2, "colIndex", nt, "xSplit"), t7.copyToObject(i2, "rowIndex", nt, "ySplit");
|
|
1089
|
+
const o2 = { colIndex: s6.colIndex + i2.colIndex, rowIndex: s6.rowIndex + i2.rowIndex };
|
|
1090
|
+
e2.coords = r.cellToString(o2);
|
|
1091
|
+
}
|
|
1092
|
+
} }), p5.registerVisitor({ from: "tabColor", to: null, openTag: (e2) => {
|
|
1093
|
+
const s6 = gt((t7) => e2.getAttribute(t7));
|
|
1094
|
+
s6 && (t6.tabColor = s6);
|
|
1095
|
+
} }), p5.registerVisitor({ from: "pageSetUpPr", to: "pageSetUpPr", openTag: (t7) => {
|
|
1096
|
+
} }), p5.registerVisitor({ from: "outlinePr", to: "outlinePr", openTag: (t7) => {
|
|
1097
|
+
} }), p5.registerVisitor({ from: "pageMargins", to: "pageMargins", openTag: (t7) => {
|
|
1098
|
+
} }), p5.registerVisitor({ from: "pageSetup", to: "pageSetup", openTag: (t7) => {
|
|
1099
|
+
} }), p5.registerVisitor({ from: "printOptions", to: "printOptions", openTag: (t7) => {
|
|
1100
|
+
} }), p5.registerVisitor({ from: "mergeCells", to: "merges", openTag: (t7) => {
|
|
1101
|
+
t7.setSource([]);
|
|
1102
|
+
} }), p5.registerVisitor({ from: "mergeCell", to: [], openTag: (t7) => {
|
|
1103
|
+
const e2 = t7.getAttribute("ref");
|
|
1104
|
+
t7.setSource(e2);
|
|
1105
|
+
} }), p5.registerVisitor({ from: "hyperlinks", to: "hyperlinks", openTag: (t7) => {
|
|
1106
|
+
t7.setSource([]);
|
|
1107
|
+
} }), p5.registerVisitor({ from: "hyperlink", to: [], openTag: (t7) => {
|
|
1108
|
+
const e2 = t7.getAttribute("r:id"), i2 = t7.getAttribute("ref");
|
|
1109
|
+
if (!i2) return void console.warn("No ref found for hyperlink");
|
|
1110
|
+
t7.setKey(i2);
|
|
1111
|
+
let o2 = e2 ? s5(e2) : "";
|
|
1112
|
+
if ("string" != typeof o2) return void console.warn("Invalid address ", o2);
|
|
1113
|
+
const r2 = t7.getAttribute("location");
|
|
1114
|
+
o2.endsWith("\\") && (o2 = o2.substring(0, o2.length - 1));
|
|
1115
|
+
const n3 = t7.getAttribute("location");
|
|
1116
|
+
if (n3 && (r2 && r2 !== n3 && console.warn("display and location are different", r2, n3), o2 += "#" + n3), !o2) return void console.warn("No address found for hyperlink. r:id", e2);
|
|
1117
|
+
let a5;
|
|
1118
|
+
const l4 = t7.getAttribute("tooltip");
|
|
1119
|
+
a5 = l4 ? { address: o2, tooltip: l4 } : o2, t7.setSource({ r: i2, v: a5 });
|
|
1120
|
+
} }), p5.registerVisitor({ from: "drawing", to: "movables", openTag: (t7) => {
|
|
1121
|
+
const e2 = t7.getAttribute("r:id");
|
|
1122
|
+
if (!e2) return;
|
|
1123
|
+
const i2 = s5(e2);
|
|
1124
|
+
i2 ? t7.setSource(i2.movables) : console.warn("no drawing found for rId", e2);
|
|
1125
|
+
} }), p5.registerVisitor({ from: "tableParts", to: "tables", openTag: (t7) => {
|
|
1126
|
+
t7.setSource([]);
|
|
1127
|
+
} }), p5.registerVisitor({ from: "tablePart", to: [], openTag: (t7) => {
|
|
1128
|
+
const e2 = t7.getAttribute("r:id");
|
|
1129
|
+
if (!e2) return;
|
|
1130
|
+
const i2 = s5(e2);
|
|
1131
|
+
i2 ? t7.setSource(i2) : console.warn("no table found for rId", e2);
|
|
1132
|
+
} }), p5.registerVisitor({ from: "worksheet", to: "worksheet", openTag: (t7) => {
|
|
1133
|
+
} }), p5.registerVisitor({ from: "sheetProtection", to: "protection", openTag: (t7) => {
|
|
1134
|
+
let e2 = false;
|
|
1135
|
+
if (t7.hasAttribute("sheet") && rt(t7.getAttribute("sheet")) && (e2 = true), !e2) return void t7.setSource(void 0);
|
|
1136
|
+
const s6 = (t8) => true === t8 || "1" === t8 || "on" === t8 || "true" === t8 || false === t8 || "0" === t8 || "off" === t8 || "false" === t8 || null;
|
|
1137
|
+
t7.copyTo("autoFilter", s6), t7.copyTo("deleteColumns", s6), t7.copyTo("formatCells", s6), t7.copyTo("formatColumns", s6), t7.copyTo("formatRows", s6), t7.copyTo("insertColumns", s6), t7.copyTo("insertHyperlinks", s6), t7.copyTo("insertRows", s6), t7.copyTo("objects", s6), t7.copyTo("pivotTables", s6), t7.copyTo("scenarios", s6), t7.copyTo("selectUnlockedCells", s6), t7.copyTo("selectUnlockedCells", s6), t7.copyTo("sort", s6);
|
|
1138
|
+
const i2 = {};
|
|
1139
|
+
t7.copyToObject(i2, "hash", lt, "hashValue"), t7.copyToObject(i2, "algorithm", lt, "algorithmName"), t7.copyToObject(i2, "salt", lt, "saltValue"), t7.copyToObject(i2, "spinCount", nt), Object.keys(i2).length > 0 && (t7.getSource().password = i2);
|
|
1140
|
+
} }), p5.registerVisitor({ from: "protectedRanges", to: "protectedRanges", openTag: (t7) => {
|
|
1141
|
+
t7.setSource({});
|
|
1142
|
+
} }), p5.registerVisitor({ from: "protectedRange", to: {}, openTag: (t7) => {
|
|
1143
|
+
const e2 = t7.getAttribute("sqref");
|
|
1144
|
+
t7.setKey(e2), t7.copyTo("name"), t7.copyTo("securityDescriptor");
|
|
1145
|
+
const s6 = {};
|
|
1146
|
+
t7.copyToObject(s6, "hash", lt, "hashValue"), t7.copyToObject(s6, "algorithm", lt, "algorithmName"), t7.copyToObject(s6, "salt", lt, "saltValue"), t7.copyToObject(s6, "spinCount", nt), Object.keys(s6).length > 0 && (t7.getSource().password = s6);
|
|
1147
|
+
} }), p5.registerVisitor({ from: "sheetFormatPr", to: "sheetFormatPr", openTag: (e2) => {
|
|
1148
|
+
e2.copyToObject(t6, "defaultColSize", at, "defaultColWidth"), e2.copyToObject(t6, "outlineLevelCol", nt, "outlineLevelCol");
|
|
1149
|
+
const s6 = e2.getAttribute("customHeight");
|
|
1150
|
+
"1" !== s6 && "true" !== s6 || e2.copyToObject(t6, "defaultRowSize", at, "defaultRowHeight"), e2.copyToObject(t6, "outlineLevelRow", nt, "outlineLevelRow");
|
|
1151
|
+
} }), p5.registerVisitor({ from: "cols", to: "cols", openTag: (t7) => {
|
|
1152
|
+
t7.setSource([]);
|
|
1153
|
+
} }), p5.registerVisitor({ from: "col", to: [], openTag: (t7) => {
|
|
1154
|
+
t7.copyTo("min", (t8) => parseInt(t8) - 1), t7.copyTo("max", (t8) => parseInt(t8) - 1), t7.copyTo("sz", at, "width"), t7.copyTo("cs", rt, "customWidth"), t7.copyTo("h", rt, "hidden"), t7.copyTo("l", nt, "outlineLevel"), t7.copyTo("s", nt, "style");
|
|
1155
|
+
} }), p5.registerVisitor({ from: "oleObjects", to: null, openTag: (t7) => {
|
|
1156
|
+
t7.warn("'OLE Objects' are not supported.");
|
|
1157
|
+
} });
|
|
1158
|
+
let y4 = null;
|
|
1159
|
+
const b4 = { onOpenTag: (t7) => {
|
|
1160
|
+
null === y4 && (y4 = "");
|
|
1161
|
+
}, onText: (t7) => {
|
|
1162
|
+
y4 += t7;
|
|
1163
|
+
}, onEnd: () => {
|
|
1164
|
+
const t7 = n2(y4);
|
|
1165
|
+
return y4 = null, t7;
|
|
1166
|
+
}, onError: (t7) => {
|
|
1167
|
+
} };
|
|
1168
|
+
return ((t7, s6, i2, o2, n3, a5) => {
|
|
1169
|
+
let l4 = false, c5 = false, h6 = [], p6 = false, g5 = null, m4 = null, T6 = null, y5 = null, b5 = null, x4 = null;
|
|
1170
|
+
const w4 = a5?.get("richData") ?? [], v4 = r.normalizeA1ToR1C1, S4 = u.createConflatingRanges(), C4 = /* @__PURE__ */ new Map(), k3 = [];
|
|
1171
|
+
let A3 = null;
|
|
1172
|
+
const D3 = u.createConflatingRanges();
|
|
1173
|
+
let E3, P3 = false, O3 = -1, I3 = -1, V3 = null, L3 = null;
|
|
1174
|
+
const N3 = [];
|
|
1175
|
+
let R3 = null, $3 = -2, M3 = 0, j3 = "", H3 = "", F3 = "", X3 = "", B3 = "", W3 = "", _3 = "", q3 = "", z3 = "", U3 = "", G3 = "", Z3 = "", Q3 = "", J3 = "", K2 = true, Y2 = null;
|
|
1176
|
+
return { ...i2, onEnd: () => {
|
|
1177
|
+
N3.length > 0 && (s6.rows = N3);
|
|
1178
|
+
let e2 = S4.done(vt);
|
|
1179
|
+
const o3 = e2.length;
|
|
1180
|
+
if (o3 > 0) {
|
|
1181
|
+
const t8 = new Array(o3);
|
|
1182
|
+
for (let s7 = 0; s7 < o3; s7++) {
|
|
1183
|
+
const i3 = e2[s7], o4 = r.rangeToString(i3), n5 = i3.value[1], a7 = r.resolveRelativeToA1(n5, i3.rowStart, i3.colStart);
|
|
1184
|
+
t8[s7] = [o4, a7];
|
|
1185
|
+
}
|
|
1186
|
+
s6.formulas = t8;
|
|
1187
|
+
}
|
|
1188
|
+
const n4 = D3.done(true), a6 = n4.length;
|
|
1189
|
+
if (a6 > 0) {
|
|
1190
|
+
const t8 = new Array(a6);
|
|
1191
|
+
for (let e3 = 0; e3 < a6; e3++) {
|
|
1192
|
+
const s7 = n4[e3], i3 = r.rangeToString(s7);
|
|
1193
|
+
t8[e3] = i3;
|
|
1194
|
+
}
|
|
1195
|
+
s6.volatile = t8;
|
|
1196
|
+
}
|
|
1197
|
+
if (k3.length > 0 && (s6.dynamicArray = [...k3]), h6.length > 0) {
|
|
1198
|
+
h6.sort(u.createRangeComparator(d.Orientation.Column));
|
|
1199
|
+
const t8 = [];
|
|
1200
|
+
let e3 = null, i3 = -1, o4 = -1, r2 = -1, n5 = -1, a7 = null;
|
|
1201
|
+
const l6 = h6.length;
|
|
1202
|
+
l6 > 0 && (e3 = h6[0], i3 = e3.colStart, o4 = e3.colEnd, r2 = e3.rowEnd, n5 = e3.value, t8.push(e3));
|
|
1203
|
+
for (let s7 = 1; s7 < l6; s7++) a7 = h6[s7], n5 !== a7.value || i3 !== a7.colStart || o4 !== a7.colEnd || r2 + 1 !== a7.rowEnd ? (t8.push(a7), e3 = a7, i3 = e3.colStart, o4 = e3.colEnd, r2 = e3.rowEnd, n5 = e3.value) : (r2 = a7.rowEnd, e3.rowEnd = r2);
|
|
1204
|
+
let c6 = [];
|
|
1205
|
+
for (let e4 = 0; e4 < t8.length; e4++) {
|
|
1206
|
+
const s7 = t8[e4];
|
|
1207
|
+
c6.push({ r: { colStart: s7.colStart, colEnd: s7.colEnd, rowStart: s7.rowStart, rowEnd: s7.rowEnd }, v: s7.value });
|
|
1208
|
+
}
|
|
1209
|
+
s6.directStyles = c6;
|
|
1210
|
+
}
|
|
1211
|
+
const l5 = t7.build();
|
|
1212
|
+
if (l5) {
|
|
1213
|
+
const t8 = l5.tuples;
|
|
1214
|
+
s6.data = t8;
|
|
1215
|
+
}
|
|
1216
|
+
i2?.onEnd?.();
|
|
1217
|
+
}, onOpenTag: (t8) => {
|
|
1218
|
+
let e2 = t8.name;
|
|
1219
|
+
const s7 = e2.indexOf(":");
|
|
1220
|
+
if (-1 !== s7 && (e2 = e2.slice(s7 + 1)), E3) {
|
|
1221
|
+
const s8 = t8.attributes;
|
|
1222
|
+
switch (e2) {
|
|
1223
|
+
case "v":
|
|
1224
|
+
c5 = true;
|
|
1225
|
+
break;
|
|
1226
|
+
case "f":
|
|
1227
|
+
switch (s8.t ?? null) {
|
|
1228
|
+
case null:
|
|
1229
|
+
case "normal":
|
|
1230
|
+
p6 = true;
|
|
1231
|
+
break;
|
|
1232
|
+
case "shared":
|
|
1233
|
+
const t9 = s8.si;
|
|
1234
|
+
m4 = s8.ref, g5 = t9;
|
|
1235
|
+
break;
|
|
1236
|
+
case "array":
|
|
1237
|
+
p6 = true, m4 = s8.ref, A3 = [m4, false];
|
|
1238
|
+
break;
|
|
1239
|
+
case "datatable":
|
|
1240
|
+
p6 = true, m4 = s8.ref, p6 = true;
|
|
1241
|
+
}
|
|
1242
|
+
void 0 !== s8.ca && D3.append(O3, I3);
|
|
1243
|
+
break;
|
|
1244
|
+
case "is":
|
|
1245
|
+
return void (P3 = true);
|
|
1246
|
+
}
|
|
1247
|
+
return void (P3 && n3?.onOpenTag(t8));
|
|
1248
|
+
}
|
|
1249
|
+
if (l4) {
|
|
1250
|
+
if ("c" === e2) {
|
|
1251
|
+
E3 = t8;
|
|
1252
|
+
const e3 = t8.attributes.r;
|
|
1253
|
+
I3 = r.fastStringToCol(e3);
|
|
1254
|
+
const s8 = t8.attributes.t;
|
|
1255
|
+
void 0 === s8 ? L3 = null : (L3 = s8, "str" === L3 && (P3 = true));
|
|
1256
|
+
let i3 = t8.attributes.s;
|
|
1257
|
+
void 0 !== i3 && (i3 = parseInt(i3), Y2 && Y2.value === i3 && Y2.colEnd + 1 === I3 ? Y2.colEnd = I3 : (Y2 = { colStart: I3, rowStart: O3, colEnd: I3, rowEnd: O3, value: i3 }, h6.push(Y2)));
|
|
1258
|
+
}
|
|
1259
|
+
} else {
|
|
1260
|
+
if ("row" === e2) {
|
|
1261
|
+
l4 = true;
|
|
1262
|
+
const e3 = t8.attributes.r;
|
|
1263
|
+
if (O3 = parseInt(e3) - 1, M3 = 0, H3 = t8.attributes.customHeight, void 0 !== H3 && (M3 |= wt.CustomHeight), H3 !== z3 && (K2 = true, z3 = H3), j3 = t8.attributes.ht, void 0 !== j3 && (M3 |= wt.Ht), j3 !== q3 && (K2 = true, q3 = j3), F3 = t8.attributes.hidden, void 0 !== F3 && (M3 |= wt.Hidden), F3 !== U3 && (K2 = true, U3 = F3), B3 = t8.attributes.s, void 0 !== B3 && (M3 |= wt.S), B3 !== Z3 && (K2 = true, Z3 = B3), X3 = t8.attributes.customFormat, void 0 !== X3 && (M3 |= wt.CustomFormat), X3 !== G3 && (K2 = true, G3 = X3), W3 = t8.attributes.outlineLevel, void 0 !== W3 && (M3 |= wt.OutlineLevel), W3 !== Q3 && (K2 = true, Q3 = W3), _3 = t8.attributes.collapsed, void 0 !== _3 && (M3 |= wt.Collapsed), _3 !== J3 && (K2 = true, J3 = _3), 0 !== M3) if ($3 + 1 !== O3 || K2) {
|
|
1264
|
+
const t9 = void 0 !== H3 && ("1" === H3 || "true" === H3), e4 = void 0 !== X3 && ("1" === X3 || "true" === X3);
|
|
1265
|
+
R3 = { min: O3, max: O3, sz: t9 && void 0 !== j3 ? parseFloat(j3) : -1, csz: t9, h: void 0 !== F3 && ("1" === F3 || "true" === F3), s: t9 && void 0 !== B3 && "0" !== B3 ? parseInt(B3) : 0, cs: e4, l: void 0 === W3 || "0" === W3 ? 0 : parseInt(W3), cl: void 0 !== _3 && ("1" === _3 || "true" === _3) }, N3.push(R3);
|
|
1266
|
+
} else R3.max = O3;
|
|
1267
|
+
return $3 = O3, void (K2 = false);
|
|
1268
|
+
}
|
|
1269
|
+
i2?.onOpenTag(t8);
|
|
1270
|
+
}
|
|
1271
|
+
}, onCloseTag: (e2) => {
|
|
1272
|
+
if (E3) {
|
|
1273
|
+
let s7 = e2.name;
|
|
1274
|
+
const i3 = s7.indexOf(":");
|
|
1275
|
+
if (-1 !== i3 && (s7 = s7.slice(i3 + 1)), P3) if ("is" === s7 || "v" === s7) {
|
|
1276
|
+
const e3 = n3?.onEnd();
|
|
1277
|
+
null !== e3 && t7.addValue(O3, I3, "" + e3);
|
|
1278
|
+
} else n3?.onCloseTag?.(e2);
|
|
1279
|
+
return c5 && (c5 = false), void ("c" === s7 && (E3 = null, P3 = false));
|
|
1280
|
+
}
|
|
1281
|
+
if (l4) return l4 = false, void (Y2 = null);
|
|
1282
|
+
i2?.onCloseTag(e2);
|
|
1283
|
+
}, onText: (s7) => {
|
|
1284
|
+
if (s7 = s7.trim(), c5) {
|
|
1285
|
+
switch (V3 = null, L3) {
|
|
1286
|
+
case null:
|
|
1287
|
+
case "n":
|
|
1288
|
+
V3 = parseFloat(s7);
|
|
1289
|
+
break;
|
|
1290
|
+
case "b":
|
|
1291
|
+
V3 = "1" === s7 || "true" === s7;
|
|
1292
|
+
break;
|
|
1293
|
+
case "s":
|
|
1294
|
+
V3 = s7;
|
|
1295
|
+
break;
|
|
1296
|
+
case "e":
|
|
1297
|
+
if ("#VALUE!" === s7) {
|
|
1298
|
+
const t9 = E3.attributes.vm;
|
|
1299
|
+
if (void 0 !== t9) {
|
|
1300
|
+
const s8 = w4[parseInt(t9) - 1];
|
|
1301
|
+
if (s8 && s8.isFormulaError) {
|
|
1302
|
+
V3 = { t: e.Error, v: s8.getCode() };
|
|
1303
|
+
break;
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
const t8 = f.getBuiltInByLabel(s7);
|
|
1308
|
+
t8 ? V3 = { t: e.Error, v: t8.getCode() } : (V3 = s7, o2?.(`Unknown formula error '${s7}' in cell ${r.cellToString({ colIndex: I3, rowIndex: O3 })}`));
|
|
1309
|
+
break;
|
|
1310
|
+
case "str":
|
|
1311
|
+
case "inlineStr":
|
|
1312
|
+
P3 = true;
|
|
1313
|
+
}
|
|
1314
|
+
null !== V3 && t7.addValue(O3, I3, V3);
|
|
1315
|
+
}
|
|
1316
|
+
if (A3 && ("e" === L3 && (A3[1] = true), k3.push(A3), A3 = null), g5) if (b5 === g5) y5 = x4;
|
|
1317
|
+
else {
|
|
1318
|
+
if (y5 = C4.get(g5), !y5) {
|
|
1319
|
+
const t8 = [];
|
|
1320
|
+
T6 = v4(s7, O3, I3, t8), y5 = [T6, t8, s7], C4.set(g5, y5);
|
|
1321
|
+
}
|
|
1322
|
+
b5 = g5, x4 = y5;
|
|
1323
|
+
}
|
|
1324
|
+
if (p6) {
|
|
1325
|
+
const t8 = [];
|
|
1326
|
+
T6 = v4(s7, O3, I3, t8), y5 = [T6, t8, s7];
|
|
1327
|
+
}
|
|
1328
|
+
if (y5) return S4.append(O3, I3, y5), y5 = null, p6 = false, g5 = null, void (m4 = null);
|
|
1329
|
+
P3 ? n3?.onText(s7) : l4 || i2?.onText(s7);
|
|
1330
|
+
} };
|
|
1331
|
+
})(g4, t6, p5.createEventHandler(t6, () => {
|
|
1332
|
+
}, c4), c4, b4, h5);
|
|
1333
|
+
})(t5, (t6, e2 = false) => I2(t6, h4, e2) ?? null, j2, S3, 0, (t6) => {
|
|
1334
|
+
m2 && (t6 = h4 + ": " + t6, m2?.(t6));
|
|
1335
|
+
}, A2), a3 = ht(h4, P2), c3 = await (async (t6, e2 = 8388608) => {
|
|
1336
|
+
await (async () => {
|
|
1337
|
+
if ("undefined" == typeof ReadableStream) if ("undefined" == typeof window) {
|
|
1338
|
+
const { ReadableStream: t7 } = await import("./Bx3lQBEvcqhxffT-.mjs");
|
|
1339
|
+
global.ReadableStream = t7;
|
|
1340
|
+
} else console.warn("Browser does not support ReadableStream; consider loading a polyfill.");
|
|
1341
|
+
})();
|
|
1342
|
+
const s5 = new TextDecoder("utf-8");
|
|
1343
|
+
let i2 = 0;
|
|
1344
|
+
const o2 = t6 instanceof Uint8Array ? t6 : new Uint8Array(t6);
|
|
1345
|
+
return new ReadableStream({ pull(t7) {
|
|
1346
|
+
if (i2 >= o2.byteLength) return void t7.close();
|
|
1347
|
+
const r2 = o2.subarray(i2, Math.min(i2 + e2, o2.byteLength)), n2 = s5.decode(r2, { stream: i2 + e2 < o2.byteLength });
|
|
1348
|
+
t7.enqueue(n2), i2 += r2.length;
|
|
1349
|
+
} }).getReader();
|
|
1350
|
+
})(a3);
|
|
1351
|
+
try {
|
|
1352
|
+
await it.parseStream(c3, s4, { xmlns: false });
|
|
1353
|
+
} catch (t6) {
|
|
1354
|
+
throw console.warn(`Error parsing sheet: '${h4}'`, t6), new Error(`Error parsing sheet: '${h4}'`, { cause: t6 });
|
|
1355
|
+
}
|
|
1356
|
+
const p4 = O2(h4, l2);
|
|
1357
|
+
let g3, T4 = /* @__PURE__ */ new Map();
|
|
1358
|
+
if (p4) {
|
|
1359
|
+
const e2 = "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment";
|
|
1360
|
+
let s5;
|
|
1361
|
+
p4.forEach((t6, s6) => {
|
|
1362
|
+
if (t6.type === e2) {
|
|
1363
|
+
const t7 = I2(s6, h4, false, l2);
|
|
1364
|
+
g3 = t7?.comments, g3 && g3.forEach((t8) => {
|
|
1365
|
+
T4.set(t8.id, t8);
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
const i2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
|
1370
|
+
if (p4.forEach((t6, e3) => {
|
|
1371
|
+
if (t6.type === i2) {
|
|
1372
|
+
const t7 = I2(e3, h4, false, l2);
|
|
1373
|
+
s5 = t7;
|
|
1374
|
+
}
|
|
1375
|
+
}), s5 || g3) {
|
|
1376
|
+
const e3 = g3 ?? [], i3 = s5?.comments;
|
|
1377
|
+
if (i3) {
|
|
1378
|
+
const t6 = s5?.authors;
|
|
1379
|
+
for (let s6 = 0; s6 < i3.length; s6++) {
|
|
1380
|
+
const o2 = i3[s6];
|
|
1381
|
+
let r2 = void 0 !== o2.authorId ? t6[o2.authorId] : void 0;
|
|
1382
|
+
if ((!r2 || r2.startsWith("tc=")) && (r2 = ft(r2.substring(3)), T4.has(r2))) continue;
|
|
1383
|
+
let a4 = H2.get(r2);
|
|
1384
|
+
a4 || (a4 = F2.get(r2)), a4 || (a4 = { id: n.uuidV4(), displayName: r2 }, F2.set(a4.displayName, a4), H2.set(a4.id, a4)), r2 = a4?.id ?? null;
|
|
1385
|
+
const l3 = { id: n.uuidV4(), personId: r2, ref: o2.ref, done: false, asNote: true, content: o2.content };
|
|
1386
|
+
e3.push(l3);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
t5.comments = e3;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
};
|
|
1393
|
+
E2.push(s3());
|
|
1394
|
+
} else C3 = a2 ? ht(h4, P2, (t5) => {
|
|
1395
|
+
const e2 = y3.add({ buffer: t5 });
|
|
1396
|
+
return e2.addReference(x3), v3.add(e2), b3.toResourceId(e2);
|
|
1397
|
+
}, V2) : ut(h4, P2, g2, p3, V2);
|
|
1398
|
+
}
|
|
1399
|
+
return C3;
|
|
1400
|
+
}, V2 = { paramMap: A2, getRefs: O2, getRef: I2, parsedRefs: D2, onWarning: m2, addPerson: (t3) => null }, L2 = [];
|
|
1401
|
+
let N2 = 0;
|
|
1402
|
+
h3.Strings && (N2 = parseInt(h3.Strings.Unique ?? h3.Strings.length ?? 0));
|
|
1403
|
+
const R2 = h3.Strings ?? [];
|
|
1404
|
+
for (let t3 = 0; t3 < N2; t3++) L2.push(R2[t3]?.t ?? "");
|
|
1405
|
+
const $2 = /* @__PURE__ */ new Map();
|
|
1406
|
+
let M2 = N2;
|
|
1407
|
+
const j2 = (t3) => {
|
|
1408
|
+
const e2 = $2.get(t3);
|
|
1409
|
+
if (void 0 !== e2) return e2;
|
|
1410
|
+
const s2 = M2;
|
|
1411
|
+
return $2.set(t3, M2++), L2.push(t3), s2;
|
|
1412
|
+
}, H2 = (dt("richstructure", h3, g2, p3, V2), dt("richdata", h3, g2, p3, V2), /* @__PURE__ */ new Map()), F2 = /* @__PURE__ */ new Map(), X2 = dt("people", h3, g2, p3);
|
|
1413
|
+
let B2 = null;
|
|
1414
|
+
if (X2.size > 0 && (B2 = X2.entries().next()?.value?.[1]?.persons, B2)) {
|
|
1415
|
+
const t3 = B2.length;
|
|
1416
|
+
for (let e2 = 0; e2 < t3; e2++) {
|
|
1417
|
+
const t4 = B2[e2];
|
|
1418
|
+
H2.set(t4.id, t4), H2.set(t4.displayName, t4);
|
|
1419
|
+
}
|
|
1420
|
+
}
|
|
1421
|
+
const W2 = dt("themes", h3, g2, p3, V2);
|
|
1422
|
+
let _2 = null;
|
|
1423
|
+
if (W2 && W2.entries) {
|
|
1424
|
+
let t3 = W2.entries().next();
|
|
1425
|
+
t3?.value?.[1] && (_2 = t3.value[1]);
|
|
1426
|
+
}
|
|
1427
|
+
const q2 = new a(_2), z2 = dt("styles", h3, g2, p3, V2);
|
|
1428
|
+
let U2 = z2.entries().next()?.value[1];
|
|
1429
|
+
U2 && (U2 = JSON.parse(l(U2)));
|
|
1430
|
+
const G2 = dt("workbooks", h3, g2, p3, V2);
|
|
1431
|
+
await Promise.all(E2);
|
|
1432
|
+
const Z2 = { ...G2.entries().next().value[1], styles: U2, theme: q2.toJSON() };
|
|
1433
|
+
L2.length > 0 && (Z2.strings = L2), B2 && B2.length > 0 && (Z2.people = B2);
|
|
1434
|
+
const Q2 = { ...T2, resources: y3, json: Z2 }, J2 = new c(Q2);
|
|
1435
|
+
return v3.forEach((t3) => {
|
|
1436
|
+
t3.deleteReference(x3);
|
|
1437
|
+
}), b3.endPersist(), J2;
|
|
1438
|
+
} catch (t3) {
|
|
1439
|
+
let e2 = "Unable to parse XLSX.";
|
|
1440
|
+
throw t3 instanceof g && (e2 = "Unable to open XLSX. There are too many rows or columns."), new Error(e2, { cause: t3 });
|
|
1441
|
+
}
|
|
1442
|
+
}, toBufferXLSX: async (s2, i2) => {
|
|
1443
|
+
const o2 = await import("./CVU9bu6AnxcgkEwq.mjs"), r2 = await s2.toJSON(true), n2 = o2.utils.book_new();
|
|
1444
|
+
for (let i3 = 0; i3 < r2.sheets.length; i3++) {
|
|
1445
|
+
const a2 = r2.sheets[i3], l2 = o2.utils.json_to_sheet([{}]);
|
|
1446
|
+
o2.utils.book_append_sheet(n2, l2, a2.name);
|
|
1447
|
+
const c2 = a2.sheet, h2 = s2.getSheetAt(i3), u2 = h2.getUsedRange();
|
|
1448
|
+
if (u2 ? (l2["!ref"] = u2.getA1(), u2.forEach((s3, i4) => {
|
|
1449
|
+
const o3 = { t: "z" }, r3 = i4.getCell().getStyle();
|
|
1450
|
+
if (!r3.isNormal()) {
|
|
1451
|
+
let e2 = r3.getNumberFormat();
|
|
1452
|
+
e2 !== t.Type.General && (e2 === t.Type.ShortDate ? e2 = "m/d/yyyy" : e2 === t.Type.MediumDate ? e2 = "d-mmm-yy" : e2 === t.Type.LongDate ? e2 = "[$-x-sysdate]dddd, mmmm dd, yyyy" : e2 === t.Type.ShortTime ? e2 = "h:mm" : e2 === t.Type.MediumTime ? e2 = "h:mm AM/PM" : e2 === t.Type.LongTime && (e2 = "h:mm:ss AM/PM"), o3.z = e2);
|
|
1453
|
+
}
|
|
1454
|
+
if (null !== s3) switch (i4.getType()) {
|
|
1455
|
+
case e.Number:
|
|
1456
|
+
o3.t = "n", o3.v = s3;
|
|
1457
|
+
break;
|
|
1458
|
+
case e.String:
|
|
1459
|
+
o3.t = "s", o3.v = s3;
|
|
1460
|
+
break;
|
|
1461
|
+
case e.Boolean:
|
|
1462
|
+
o3.t = "b", o3.v = s3;
|
|
1463
|
+
break;
|
|
1464
|
+
case e.Error:
|
|
1465
|
+
o3.t = "e", o3.v = s3.toString();
|
|
1466
|
+
case e.RichData:
|
|
1467
|
+
}
|
|
1468
|
+
l2[i4.getA1()] = o3;
|
|
1469
|
+
})) : l2["!ref"] = "A1:A1", c2.merges?.length > 0) {
|
|
1470
|
+
const t2 = [];
|
|
1471
|
+
l2["!merges"] = t2;
|
|
1472
|
+
for (let e2 = 0; e2 < c2.merges.length; e2++) t2.push(o2.utils.decode_range(c2.merges[e2]));
|
|
1473
|
+
}
|
|
1474
|
+
if (c2.cols?.length > 0) {
|
|
1475
|
+
const t2 = [];
|
|
1476
|
+
l2["!cols"] = t2;
|
|
1477
|
+
const e2 = c2.cols, s3 = { width: c2.defaultColSize ?? h2.getColumnWidthAsFontUnit(h2.getColumnHeaders().getDefaultSize()) };
|
|
1478
|
+
for (let i4 = 0; i4 < e2.length; i4++) {
|
|
1479
|
+
const o3 = e2[i4];
|
|
1480
|
+
for (let e3 = t2.length; e3 <= o3.min - 1; e3++) t2.push(s3);
|
|
1481
|
+
const r3 = {};
|
|
1482
|
+
void 0 !== o3.sz && (r3.width = o3.sz), void 0 !== o3.h && (r3.hidden = o3.h), void 0 !== o3.l && (r3.level = o3.l);
|
|
1483
|
+
for (let e3 = o3.min; e3 <= o3.max; e3++) t2.push(r3);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
return o2.write(n2, { type: "array", bookType: "xlsx" }), o2.write(n2, { type: "array", bookType: "xlsx" });
|
|
1488
|
+
} }, Symbol.toStringTag, { value: "Module" }));
|
|
1489
|
+
export {
|
|
1490
|
+
yt as a,
|
|
1491
|
+
xt as b,
|
|
1492
|
+
Tt as c,
|
|
1493
|
+
gt as d,
|
|
1494
|
+
Ct as i,
|
|
1495
|
+
bt as p,
|
|
1496
|
+
ft as r,
|
|
1497
|
+
mt as t
|
|
1498
|
+
};
|