@sheetxl/studio-vanilla 0.4.12 → 0.4.13
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/{BwN8vKi5o3-PbIMo.cjs → -DkdmW3XP1ICRY25.cjs} +2 -2
- package/browser/cjs/B-KQs1Bf48nEucW7.cjs +7 -0
- package/browser/cjs/B1xnY7pDnbnNzknG.cjs +7 -0
- package/browser/cjs/B6A5w_aWHkigBc6j.cjs +7 -0
- package/browser/cjs/B9jxuOg1CXcmbi9J.cjs +110 -0
- package/browser/cjs/BAYjkr4LmsWRLoPr.cjs +7 -0
- package/browser/cjs/{Q_VvA-yUQx3xFKiJ.cjs → BG2uV2RpxrfZyCuV.cjs} +1 -1
- package/browser/cjs/{BPzEQNENF-gEBkg9.cjs → BGCPG4Ip5ZijUQwi.cjs} +2 -2
- package/browser/cjs/BHTlBOQH-tPGoKgo.cjs +7 -0
- package/browser/cjs/BLBNzBvRVl9VLynf.cjs +7 -0
- package/browser/cjs/BLh6E7ER8mrM6vc_.cjs +7 -0
- package/browser/cjs/{hwDUzorB6aCvH1eL.cjs → BMaq_2S3IFrE5XeJ.cjs} +1 -1
- package/browser/cjs/BO7Pbclmywy-QCSV.cjs +13 -0
- package/browser/cjs/BPlthbyKkqCDjgxO.cjs +7 -0
- package/browser/cjs/BUGo0mXtBfFOmQXV.cjs +7 -0
- package/browser/cjs/BdHdXCz_K1djQgI4.cjs +7 -0
- package/browser/cjs/BfNkb1jDZkJf3wRA.cjs +7 -0
- package/browser/cjs/BfdQd2UEOlOc5iF3.cjs +7 -0
- package/browser/cjs/Bi9KvObgq_kJ_pjC.cjs +7 -0
- package/browser/cjs/BjPpJjnABDd3_WOZ.cjs +7 -0
- package/browser/cjs/BsSNzyN8kOGCKzso.cjs +7 -0
- package/browser/cjs/BtCcoaKKb8ZDnliG.cjs +7 -0
- package/browser/cjs/{Ccs2ouvlLekaLGH0.cjs → BwHquG4sSd7OJjxz.cjs} +2 -2
- package/browser/cjs/{D_VQzwC1zzTJyKtG.cjs → BywNBbTVRYbgRbNI.cjs} +1 -1
- package/browser/cjs/C04Qr5P8uyQ6Vcml.cjs +7 -0
- package/browser/cjs/C42ZEPRmW9Wcd7tI.cjs +7 -0
- package/browser/cjs/{BeZHmOKfa37mFNAu.cjs → CBpt1PBR1VfBegko.cjs} +2 -2
- package/browser/cjs/CED8Az5C8GWF7pUT.cjs +7 -0
- package/browser/cjs/{JKEGlXjMwGnXk_Gv.cjs → CbD4Wa5QLTdRCYcz.cjs} +2 -2
- package/browser/cjs/{L1iE_VcelYZIy0wI.cjs → CbILz9Skl6lWf6yR.cjs} +1 -1
- package/browser/cjs/CoFQQqIzuvS9PM77.cjs +7 -0
- package/browser/cjs/{B35OZ0mE8aINQPP9.cjs → CpDNo2Lhwr5ZHECs.cjs} +2 -2
- package/browser/cjs/{C3OizZPVuxO2fjSG.cjs → CsamfGfFsItvSgo_.cjs} +1 -1
- package/browser/cjs/Cx3kn5gBsQ-1bORi.cjs +7 -0
- package/browser/cjs/CxLvGnG44-qNI36G.cjs +7 -0
- package/browser/cjs/D-xyWit7jxctQCpR.cjs +7 -0
- package/browser/cjs/D4XQsK7d7DRctaOO.cjs +7 -0
- package/browser/cjs/D9rVEA1BdB0JZwhE.cjs +7 -0
- package/browser/cjs/DES2NmIRVZg-HXgs.cjs +7 -0
- package/browser/cjs/{CBL6KkiWI2RPflEN.cjs → DFxeLNhACFIHb0nv.cjs} +2 -2
- package/browser/cjs/DIv1SrLYeyVwcaxE.cjs +7 -0
- package/browser/cjs/DJ6L43osbaMzEV5K.cjs +7 -0
- package/browser/cjs/DMjLN_HDktNzzUB8.cjs +7 -0
- package/browser/cjs/DVPfPZCFjmYu3xyn.cjs +7 -0
- package/browser/cjs/DhSlaiQXxEOVtZkA.cjs +7 -0
- package/browser/cjs/{DAHpsyykuPBkoh-Z.cjs → Dh_dFnagz7dMZlGh.cjs} +1 -1
- package/browser/cjs/DpF6vgGka2d-RKkb.cjs +10 -0
- package/browser/cjs/{BUokV6yuzE-_8MyK.cjs → DtY0Jzlwnr_YKnV4.cjs} +2 -2
- package/browser/cjs/DwyyFI1Ix0uc0Qoz.cjs +7 -0
- package/browser/cjs/Dy5_viRzFls9rOzN.cjs +7 -0
- package/browser/cjs/GkINjQ8Te3GKi2mx.cjs +7 -0
- package/browser/cjs/aN3KCqswA1SdJIMq.cjs +7 -0
- package/browser/cjs/{no5c2H18QD2qmOH6.cjs → hLJbgylpETByV4wc.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/qumqKlVHFx89iLeu.cjs +7 -0
- package/browser/cjs/{fTGpiXzFm3K_u2Fm.cjs → rKZjTYQ0WpTriIv6.cjs} +2 -2
- package/browser/cjs/xjKotAOVt3JH36U7.cjs +7 -0
- package/browser/cjs/ymbPxio09Fw7I2BW.cjs +7 -0
- package/browser/esm/2P5dQT7wZToOh-n9.mjs +7 -0
- package/browser/esm/4GgcUVhUmQmiv9Ha.mjs +110 -0
- package/browser/esm/7_x68v6PpvRDox_Z.mjs +7 -0
- package/browser/esm/9icgSuuzXq6mlgM8.mjs +7 -0
- package/browser/esm/B354iAatN9y9AIIP.mjs +7 -0
- package/browser/esm/B5EVyoxm3aSlAnxN.mjs +7 -0
- package/browser/esm/BD8rE7MUxuHXsdcf.mjs +7 -0
- package/browser/esm/BGFWI1a1PmU8_hCE.mjs +7 -0
- package/browser/esm/{Bts4nCgfCAUpTfxz.mjs → BI6JAQCQx1V0F2aC.mjs} +2 -2
- package/browser/esm/BIYg30d_9HaluFFz.mjs +7 -0
- package/browser/esm/{SAyRTPVprOHZ8Up8.mjs → BKL-uyBp_OE47lXd.mjs} +2 -2
- package/browser/esm/BMwJCtLAYUW8wExX.mjs +13 -0
- package/browser/esm/BNOfK-lGWF2S8vQE.mjs +7 -0
- package/browser/esm/Ba433v6lQUMtECiY.mjs +7 -0
- package/browser/esm/BbZWfDW2LUyjqUDy.mjs +7 -0
- package/browser/esm/C238uBmZN1XXqMUb.mjs +7 -0
- package/browser/esm/C34whwRkHO0lhq4-.mjs +7 -0
- package/browser/esm/C6FEpAqSZoW5Hgte.mjs +7 -0
- package/browser/esm/COlW5ULL29SUKN1Z.mjs +7 -0
- package/browser/esm/CRyxOj2xPj9qe9LK.mjs +7 -0
- package/browser/esm/CVeyOpbAhaBhDRye.mjs +7 -0
- package/browser/esm/CVyVvtlJuCTn4MDh.mjs +7 -0
- package/browser/esm/CapeIfjWq-_BHMlE.mjs +7 -0
- package/browser/esm/CcQqGNgK2CsgNtuD.mjs +7 -0
- package/browser/esm/CdZSxrk3k1Lx6G8W.mjs +7 -0
- package/browser/esm/CdchvB_wAbv_6Whw.mjs +7 -0
- package/browser/esm/{D3KNxvnrwR6_fTJE.mjs → Cf8eDl3Tu5NAWWwG.mjs} +1 -1
- package/browser/esm/{B8ISUdOxsJMYWzNN.mjs → Cfq9tttQlsKvfaCr.mjs} +2 -2
- package/browser/esm/{M4hZ25330e96seUM.mjs → ClR6uLJoM-xKVYEc.mjs} +1 -1
- package/browser/esm/Cnl_e-EYkZ3CLbi2.mjs +7 -0
- package/browser/esm/CtRS2ZCPF7IH_mXe.mjs +7 -0
- package/browser/esm/{DeXfOSxGE_Ez7DZq.mjs → CuV-bwi1vcXAqFUY.mjs} +1 -1
- package/browser/esm/CwVE0qelO_xgf-l1.mjs +7 -0
- package/browser/esm/{CYIhGb86r-kKOrP5.mjs → D1Dzlta8ZVy08ng6.mjs} +2 -2
- package/browser/esm/D1TjRQiHLWhpl-dl.mjs +7 -0
- package/browser/esm/D8BJ-y3ulgO_ezrj.mjs +10 -0
- package/browser/esm/{dpdy0BU4GGI5lZrX.mjs → DTDXNEbHVnnZONNL.mjs} +1 -1
- package/browser/esm/DTWfi8Dl-c2s5moT.mjs +7 -0
- package/browser/esm/DYVBXcu1r5KRLB-1.mjs +7 -0
- package/browser/esm/{BnJiF38TGudjoHzT.mjs → DZjWyWMvr2XHQrBg.mjs} +1 -1
- package/browser/esm/DhHK4QmASvgAq9Xy.mjs +7 -0
- package/browser/esm/{DcX8yGEBX6qi9RCe.mjs → DoFV2S6Su86IN5Ul.mjs} +2 -2
- package/browser/esm/Dq3ybkgattcCsF_4.mjs +7 -0
- package/browser/esm/DqWoZ4TjweoJWX3o.mjs +7 -0
- package/browser/esm/DtXxHirBm16ldE1l.mjs +7 -0
- package/browser/esm/DtuWZG6c_8vKRSdr.mjs +7 -0
- package/browser/esm/FBG8XXdIMd9PfUIo.mjs +7 -0
- package/browser/esm/Nh7JiwvF01PblHQ0.mjs +7 -0
- package/browser/esm/PVYiH9vBQM6rqXI4.mjs +7 -0
- package/browser/esm/U5-LDZQ0qkJ2Y-p8.mjs +7 -0
- package/browser/esm/XhQDWZu47oe6bwHh.mjs +7 -0
- package/browser/esm/_BjU6TtI-mQfFpfy.mjs +7 -0
- package/browser/esm/{DzgM_rkwyIHsCb6I.mjs → gOUfyCw957TzcbNB.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/lmkbfs9sNc7f0oe5.mjs +7 -0
- package/browser/esm/{oLCocGFRAwsVsOSE.mjs → naa0kcRwxHEYGaQB.mjs} +2 -2
- package/browser/esm/qxOkQutRxmAi1vRh.mjs +7 -0
- package/browser/esm/tMSro0g2GM5BBTIH.mjs +7 -0
- package/cdn/assets/{B3kbBB6oxKBErwzn.js → 0e9wDKSn4SFxSmP5.js} +3 -3
- package/cdn/assets/0j_nQmV1Bb0lJ6sB.js +472 -0
- package/cdn/assets/2mxiQm6dELsqQoX7.js +5624 -0
- package/cdn/assets/5XdpCWQ6AcxZ6oY1.js +10 -0
- package/cdn/assets/6JtXguBKwGj6dqfy.js +1577 -0
- package/cdn/assets/{Bv0Xb6DdcQbPYJKo.js → 8U2WVdbZHYCBnd9L.js} +13 -14
- package/cdn/assets/9-cIcj6CRJx5HTn9.js +10 -0
- package/cdn/assets/{BcWoqhD_sX85c7Mh.js → B-kFRtzNNkf4_SiP.js} +1 -1
- package/cdn/assets/B1Iys8a964LGNZKf.js +10 -0
- package/cdn/assets/B2RAJJJFkcaWUfUW.js +21 -0
- package/cdn/assets/{DBL4jY0AVc53RGNm.js → BAzGoI9gE2G3F3on.js} +1 -1
- package/cdn/assets/BBJxLS-wB_nXRnI2.js +10 -0
- package/cdn/assets/{qA23x9VVBL9R4qxN.js → BDE7FUo2oiivrvBL.js} +14 -14
- package/cdn/assets/BL6TUDSeou6wPejW.js +10 -0
- package/cdn/assets/{CC-S4NMYhLg3WgqO.js → BLqaorJ5Wl-1YOoy.js} +2 -2
- package/cdn/assets/BMiA9p1uOrwnooVT.js +10 -0
- package/cdn/assets/{BoOefjrM4kZ-YXxa.js → BNh9nSR83reiVMKt.js} +2 -2
- package/cdn/assets/{BtweFYnoj_aEfydW.js → BQON-ToGsIBPrPkM.js} +1 -1
- package/cdn/assets/BUwNyHytF9St68tJ.js +10 -0
- package/cdn/assets/{D_5RgqgwXsoqLJDR.js → BVYDmdUGWvMG5gNK.js} +1 -1
- package/cdn/assets/B_2bXmyji3Dr7LRM.js +50224 -0
- package/cdn/assets/BciokME96sykArSM.js +10 -0
- package/cdn/assets/BgnlshX157Ob6RLs.js +21 -0
- package/cdn/assets/{dk2teWHDODYNarJY.js → BlYoycYtR-sUp0iC.js} +3 -3
- package/cdn/assets/{DfmaL8DmDaFAv8M_.js → Bsa9-Itkf_SdDBM9.js} +4 -4
- package/cdn/assets/BwpBFv8Ks2ka07ch.js +10 -0
- package/cdn/assets/BxblmHGC7YxZcuak.js +10 -0
- package/cdn/assets/C-Z8wvIy20kJ7R-k.js +10 -0
- package/cdn/assets/C3EFzvmp0DcC_HAx.js +10 -0
- package/cdn/assets/C4vStn7wNlvrxdsp.js +10 -0
- package/cdn/assets/C5q0qaKi2eeDgoO8.js +10 -0
- package/cdn/assets/C9eQW5GKgPRmKKgJ.js +29 -0
- package/cdn/assets/{BCK7yhx9JfzU2rF0.js → CHTspRZD2v_dU_eV.js} +9 -9
- package/cdn/assets/CKA4s2hlzSnrdWSD.js +10 -0
- package/cdn/assets/{BSAH88RG1oubICau.js → CMBDD1Mjde6UL5ep.js} +19 -19
- package/cdn/assets/{DDW1WJ2IM_9ZUfKm.js → CR01MBraUPYPpwy4.js} +2 -2
- package/cdn/assets/CT0d1P-Aav62lUvV.js +10 -0
- package/cdn/assets/CV8UjJPDVplXjK1E.js +49 -0
- package/cdn/assets/CrLrvmlJhYpNpXqR.js +10 -0
- package/cdn/assets/CsorxCiOoe7qX9j1.js +10 -0
- package/cdn/assets/CuNqTH3P8mCglRiz.js +10 -0
- package/cdn/assets/{MRBi3juXAW0lA_mj.js → CwdMjMPFdIs8SAV0.js} +1 -1
- package/cdn/assets/D-5VYBO5_VEh6fEW.js +24 -0
- package/cdn/assets/{BT5EcMEFBsphczwC.js → DD3csu4pddGtMp3n.js} +106 -107
- package/cdn/assets/{DWJE3K3jMKMTCi3o.js → DFHruAftzuzBZ71r.js} +2 -2
- package/cdn/assets/DHydjLSnijEgtpyU.js +10 -0
- package/cdn/assets/DPQqTIMsRLhMxPIy.js +820 -0
- package/cdn/assets/{CUc6gRjjRGTFWSHD.js → DUtu7r6CzW4dtW3E.js} +12 -12
- package/cdn/assets/{CiY3HumGDc_5bMtR.js → DXHirQMr483hJBil.js} +15 -15
- package/cdn/assets/DXtbonLk2ESfF4Dh.js +10 -0
- package/cdn/assets/{CsjftXmSYQRHNKdq.js → Dr5X-ng9wbwUWVr4.js} +4 -4
- package/cdn/assets/{BB66NDz7S3ocEfRB.js → DvFNLgeMJ9LdQROu.js} +46 -47
- package/cdn/assets/Dvj7UEckqOBrgs9i.js +3947 -0
- package/cdn/assets/F6zW9Vj410C4yRVG.js +424 -0
- package/cdn/assets/{DJQOS9qxVAlpgDMt.js → Gz4u4ewyWfB-Pf-a.js} +20 -21
- package/cdn/assets/KDGtuIzSpkf1vsmH.js +10 -0
- package/cdn/assets/KtKlo5mM4kTTfFgi.js +46 -0
- package/cdn/assets/N3pWBoccPrTedAw-.js +12 -0
- package/cdn/assets/{7_O6nILzn1fSVvkO.js → NTINjW8JjyZudT8s.js} +1 -1
- package/cdn/assets/{DxMu6URURFWj9aXM.js → R9RwlorPWfftoboH.js} +4 -4
- package/cdn/assets/{DgLPO_EQ9DYoGgec.js → Xwyp21e7L5fTeb_y.js} +1 -1
- package/cdn/assets/{CfObTzh8pGdd8D23.js → XysyS9rk9tFdbzZh.js} +5 -5
- package/cdn/assets/{DkS6quwH1okWaho6.js → f3_QXO8z0p-q4nJo.js} +14 -14
- package/cdn/assets/{phYz0vGgqIEQ2hco.js → quOP5QFyTT9soNIl.js} +1 -1
- package/cdn/index.js +2 -2
- package/cdn/loader.js +1 -1
- package/package.json +3 -5
- package/browser/cjs/BflJ_0gT9lQtDvY_.cjs +0 -7
- package/browser/cjs/CN6-6xpZMpFqSS8M.cjs +0 -7
- package/browser/cjs/CTrEV_UpxC0W6cZZ.cjs +0 -7
- package/browser/cjs/CU30GVjjFXl44vEU.cjs +0 -7
- package/browser/cjs/CZWBxvUXzfpn_zmc.cjs +0 -7
- package/browser/cjs/Ce-8L4Viq3I_6j0i.cjs +0 -7
- package/browser/cjs/CtNjLzIHB8WX63Bl.cjs +0 -7
- package/browser/cjs/DJbKKxeeTEHHA1gR.cjs +0 -107
- package/browser/cjs/GrsZZ_mEdsM5dEMA.cjs +0 -7
- package/browser/esm/B4Mm5gczpI_k2zzN.mjs +0 -7
- package/browser/esm/C3cyAbIH8Qc8MIFN.mjs +0 -107
- package/browser/esm/C4jlaVv8bELgiHyE.mjs +0 -7
- package/browser/esm/CcpskguvlvemArQn.mjs +0 -7
- package/browser/esm/CeRfALx1iU5fqOUg.mjs +0 -7
- package/browser/esm/CfYWmP_Hots5f0f6.mjs +0 -7
- package/browser/esm/CkarbqNx_lhlBnw7.mjs +0 -7
- package/browser/esm/D2PlWNQjrTgf6GuR.mjs +0 -7
- package/browser/esm/DIJyH94oCzUnlcNZ.mjs +0 -7
- package/browser/esm/DVAG1NxFe3cMjLE1.mjs +0 -7
- package/browser/esm/DVqga7g7j0FUiM6p.mjs +0 -7
- package/browser/esm/Qp2Toeh_EbJH_f_6.mjs +0 -7
- package/browser/esm/_ft7JYO6QdDbIu3d.mjs +0 -7
- package/cdn/assets/CJhyHcQcrhbtC33r.js +0 -50
- package/cdn/assets/CpPLN0-hDsTIFHZV.js +0 -46
- package/cdn/assets/Cq94woVmlxhjWVRI.js +0 -21
- package/cdn/assets/Jhm2DAcrfAqiM-Y-.js +0 -26490
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
"use strict";const e=require("./
|
|
7
|
+
"use strict";const e=require("./B9jxuOg1CXcmbi9J.cjs");module.exports=e.SheetXL;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
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
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.default={DELTA:{s:"Tests whether two numbers are equal",p:{number1:{d:"is the first number"},number2:{d:"is the second number",v:0}}},GESTEP:{s:"Tests whether a number is greater than a threshold value",p:{number:{d:"is the value to test against step"},step:{d:"is the threshold value",v:0}}}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./
|
|
7
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./B9jxuOg1CXcmbi9J.cjs"),e=["Ok","Cancel"],o=t.reactExports.memo(o=>{const{initialComments:n=null,onUpdateComments:s,context:a,onOption:i,onValidateOption:r,onDone:l,options:p=e,defaultOption:c=p?.[0],cancelOption:u="Cancel",sx:x,...m}=o,d=t.reactExports.useMemo(()=>{const t=n??a?.()?.getComments();let e="";if(t&&t.content&&t.content.runs){const o=t.content.runs;for(let t=0;t<o.length;t++){const n=o[t];e+=n?.text}}return e},[]),[g,f]=t.reactExports.useState(d),[h,C]=t.reactExports.useState(!1),E=t.reactExports.useCallback(async(t,e)=>null,[]),j=t.go(async t=>{const e=""===g?[]:g.split("\n");if(t!==u){const t=[];for(let o=0;o<e.length;o++)t.push({text:e[o]});const o={content:{runs:t}};s?.(o)}i?.(t,t===u,t===c),l?.()},[g,s,l,i,c,u]),O=t.go(t=>{f(t.target.value),E(t.target.value,null)},[r]),b=t.go(async t=>{let e=await Promise.resolve(r?.(t));try{!1!==e&&(e=await E(g,t))}catch(t){}return e??!0},[r,g]);return t.jsxRuntimeExports.jsx(t.sb,{title:(d?"Edit":"Insert")+" Comments",options:p,onDone:l,onOption:t=>j(t),onValidateOption:b,defaultOption:c,cancelOption:u,autoFocusSel:".autoFocus",sx:{width:"480px",...x},...m,children:t.jsxRuntimeExports.jsx(t.Box,{sx:{paddingTop:t=>t.spacing(1),paddingBottom:t=>t.spacing(0),rowGap:t=>t.spacing(1),display:"flex",flexDirection:"column"},children:t.jsxRuntimeExports.jsx(t.FormControl,{sx:{paddingTop:t=>t.spacing(1.5),minWidth:135,width:"100%"},size:"small",children:t.jsxRuntimeExports.jsx(t.TextField,{label:"Comments",placeholder:"Enter a comment.",onFocus:t=>{h||t.target?.select(),C(!0)},sx:{"& .MuiFormHelperText-root":{marginTop:t=>t.spacing(.5)}},InputLabelProps:{shrink:!0},InputProps:{inputProps:{className:"autoFocus",spellCheck:!1,autoComplete:"off",sx:{paddingTop:t=>t.spacing(1.25),paddingBottom:t=>t.spacing(.75),backgroundImage:`linear-gradient(${t.alpha("#fff",t.hx(5))}, ${t.alpha("#fff",t.hx(5))})`}}},value:g,onChange:O,onContextMenu:t=>{t.stopPropagation()}})})})})});exports.CommentsDialog=o,exports.default=o;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
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
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./B9jxuOg1CXcmbi9J.cjs"),e=require("./DES2NmIRVZg-HXgs.cjs");class s{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let e=0;e<this.list.length;e++)t(this.list[e],e,this)}}const r=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,o=t=>{const e=parseInt(t);return isNaN(e)?null:e},i=t=>{const e=parseFloat(t);return isNaN(e)?null:e},n=new Map;class l{constructor(t,e,s,r,o,i=null,n){const l=(t,e,s)=>n?.getRef?.(t,e,s,n?.parsedRefs),a=t=>n?.getRefs?.(t,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??n}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let r=[e];const o=t.split("/");for(let t=0;t<o.length;t++){const e=o[t];if(""===e||"."===e)continue;let s=[];for(let t=0;t<r.length;t++){const o=r[t],i=o.childNodes;for(let t=0;i&&t<i.length;t++){const r=o.childNodes[t];r.localName!==e&&"*"!==e||s.push(r)}}r=s}return 1===r.length?r[0]:0===r.length?null:new s(r)}getFromPath(e,s){return t._n.getFromPath(e,s)}setToPath(e,s,r){return t._n.setToPath(e,s,r)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return null==o?s:"1"===o||"on"===o||"true"===o||"0"!==o&&"off"!==o&&"false"!==o&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return r}get INT_COPY(){return o}get FLOAT_COPY(){return i}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){if(null==i)return;if(i=o[t](i),null==i)return}else{if(null==i)return;if(i=o(i),null==i)return}this.setToPath(s,r,i)}}class a{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class c{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);1===o.nodeType&&"Relationship"===o.localName&&this.processRelationship(t,o,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const u=(s,r)=>{if(s||!s.hasAttribute("rot"))return;const o=s.getAttribute("rot"),i=t._n.roundAccurately(e.p(o),2);-1e3!==i&&(r.rotation=i)},h=(t,e,s,r,o)=>{const i=t.getValAttrAsString(r,e);null!==i&&(s[o]=i)},p=(t,e,s,r,o=r,i=null)=>{const n=t.getValAttrAsBoolean(r,e,i);null!==n&&(s[o]=n)},g=(t,e,s,r,o)=>{const i=t.getValAttrAsInteger(r,e);null!==i&&(s[o]=i)},d=(t,e,s,r,o,i=1)=>{const n=t.getValAttrAsFloat(r,e);null!==n&&(s[o]=n*i)};class m{visit(t,e,s){return p(t,e,s,"roundedCorners","roundedCorners"),g(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let t=0;t<c.length;t++){const e=c[t];if(e.xAxisId){const r=e.xAxisId,n=a.get(r);o[t+""]=n,e.offsetXAxis=t,delete e.xAxisId,s.xAxes=o,o.length=++i}if(e.yAxisId){const r=e.yAxisId,o=a.get(r);n[t+""]=o,e.offsetYAxis=t,delete e.yAxisId,s.yAxes=n,n.length=++l}r[t+""]=e}r.length=c.length;const u=t.getVisitorParamsState().get("series");if(!u||0===u.length)return;const h={};s.series=h;for(let t=0;t<u.length;t++)h[t+""]=u[t];h.length=u.length}}class b{visit(t,e,s){return p(t,e,s,"plotVisOnly","plotVisOnly"),h(t,e,s,"dispBlanksAs","dispBlanksAs"),p(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),p(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(!0===r||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",null!==i)}catch(t){throw new Error("Unexpected Error parsing Chart: "+t)}}}class f{visit(t,e,s){let r={};return s.plotArea=r,r}}class A{EnumMappings(){}static fromOoxmlGradientType(t){return"circle"===t?"radial":t}static fromOoxmlLineCap(t){if("rnd"===t)return"round";if("flat"===t)return"butt";if("sq"===t)return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return"sng"===t?"single":t}static fromOoxmlAlignment(t){return"ctr"===t?"center":t}}class y{visit(t,e,s){}processStroke(t,s,r){const o={},i=t.evaluate("ln",s);if(i){i.hasAttribute("algn")&&(o.align=A.fromOoxmlAlignment(i.getAttribute("algn"))),i.hasAttribute("cap")&&(o.lineCap=A.fromOoxmlLineCap(i.getAttribute("cap"))),i.hasAttribute("cmpd")&&(o.compound=A.fromOoxmlCompound(i.getAttribute("cmpd"))),i.hasAttribute("w")&&(o.width=e.t(i.getAttribute("w")));const s=t.evaluate("miter",i);s&&(o.lineJoin="miter",s.hasAttribute("lim")&&(o.miter=parseFloat(s.getAttribute("lim")))),t.evaluate("bevel",i)&&(o.lineJoin="bevel"),t.evaluate("round",i)&&(o.lineJoin="round");const n=t.evaluate("custDash",i);if(n){const s=t.evaluate("ds",n);if(s&&s.length>0){let t="";for(let r=0;r<s.length;r++){const o=s.item(r);t+=e.a(o.getAttribute("d"))+","+e.a(o.getAttribute("sp"))}o.dash=t}}const l=t.evaluate("prstDash",i);l&&l.hasAttribute("val")&&(o.dash=l.getAttribute("val")),this.parseEndElement(t,i,o,"headEnd","head"),this.parseEndElement(t,i,o,"tailEnd","tail");const a=this.processFill(t,i,r);o.fill=a}return o}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const t=i.getAttribute("len")?i.getAttribute("len"):"med",e=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=t+"-"+e}}processFill(t,s,r){const o={};if(t.evaluate("noFill",s))return o.none=!0,o;const i=t.evaluate("solidFill",s);if(i){const e=this.processAdjColor(t,i);return e&&(o.solid=e),o}const n=t.evaluate("gradFill",s);if(n){n.hasAttribute("rotWithShape")&&(o.isRotated="1"===n.getAttribute("rotWithShape"));const e=this.processGradFill(t,n);return o.gradient=e,o}const l=t.evaluate("pattFill",s);if(l){const e=this.processPatternFill(t,l);return o.pattern=e,o}const a=t.evaluate("blipFill",s);if(a){a.hasAttribute("rotWithShape")&&(o.isRotated=e.b(a.getAttribute("rotWithShape"))),a.hasAttribute("dpi")&&(o.dpi=a.getAttribute("dpi"));const s=this.processImageFill(t,a);return o.image=s,o}return o.none=!0,o}processGradFill(t,s){const r={},o=t.evaluate("lin",s);if(o){if(r.type="linear",o.hasAttribute("ang")){const t=e.p(o.getAttribute("ang"));r.angle=t}if(o.hasAttribute("scaled")){const t=e.b(o.getAttribute("scaled"));r.scaled=t}}const i={};s.hasAttribute("flip")&&(i.mirror=s.getAttribute("flip")),Object.keys(i).length>0&&(r.tile=i);const n=t.evaluate("path",s);if(n){n.hasAttribute("path")&&(r.type=A.fromOoxmlGradientType(n.getAttribute("path")));const e=t.evaluate("fillToRect",n);e&&(r.fillTo=this.getRect(e))}const l=t.evaluate("tileRect",s);l&&(r.tile.bounds=this.getRect(l));const a=[],c=t.evaluate("gsLst/gs",s);for(let s=0;c&&s<c.length;s++){const r=c.item(s),o={offset:e.a(r.getAttribute("pos")),color:this.processAdjColor(t,r)};a.push(o)}return a.length>0&&(r.stops=a),r}getRect(t){const s={};return t.hasAttribute("t")&&(s.t=e.a(t.getAttribute("t"))),t.hasAttribute("l")&&(s.l=e.a(t.getAttribute("l"))),t.hasAttribute("b")&&(s.b=e.a(t.getAttribute("b"))),t.hasAttribute("r")&&(s.r=e.a(t.getAttribute("r"))),0===Object.keys(s).length?null:s}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const e=this.processAdjColor(t,o);e&&(s.background=e)}const i=t.evaluate("fgClr",e);if(i){let e=this.processAdjColor(t,i);e&&(s.foreground=e)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,s){let r="lrgba("+e.a(s.getAttribute("r"))+","+e.a(s.getAttribute("g"))+","+e.a(s.getAttribute("b"))+")";return r+=this.processAdjustments(t,s),r}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,s){let r="hsl("+e.p(s.getAttribute("hue"))+","+e.a(s.getAttribute("sat"))+","+e.a(s.getAttribute("lum"))+")";return r+=this.processAdjustments(t,s),r}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(1===i.nodeType){let r=i.localName;s+="hue"===r||"hueOff"===r||"hueMod"===r?this.processAdjustmentElement(t,e,r,6e4):"gray"===r||"comp"===r||"inv"===r||"gamma"===r||"invGamma"===r?this.processAdjustmentElement(t,e,r,1):this.processAdjustmentElement(t,e,r)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class v extends y{visit(t,s,r){try{const o=t.evaluate("xfrm",s);if(o){u(o,r);const s={x:0,y:0,width:0,height:0},i=t.evaluate("off",o);i&&(s.x=e.c(i.getAttribute("x"))??0,s.y=e.c(i.getAttribute("y"))??0);const n=t.evaluate("ext",o);i&&(s.width=e.c(n.getAttribute("cx"))??0,s.height=e.c(n.getAttribute("cy"))??0),r.bounds=s}const i=t.evaluate("prstGeom",s);i?.hasAttribute("prst")?r.geometry=i?.getAttribute("prst"):t.evaluate("customGeom",s)&&console.warn("customGeom not supported yet");const n=this.processFill(t,s,r);n&&Object.keys(n).length>0&&(r.fill=n);const l=this.processStroke(t,s,r);return l&&Object.keys(l).length>0&&(r.stroke=l),r}catch(t){throw console.warn(t),new Error("Unexpected Error parsing Shape Properties element")}}}class F{visit(t,e,s){let r={};if(h(t,e,r,"grouping","grouping"),p(t,e,r,"varyColors","varyColors"),d(t,e,r,"gapWidth","gapWidth",.01),d(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),g(t,e,r,"bubbleScale","bubbleScale"),p(t,e,r,"showNegBubbles","showNegativeBubbleValues"),p(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),g(t,e,r,"firstSliceAng","startAngle"),g(t,e,r,"holeSize","holeSize"),h(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let e=t.getVisitorParamsState().get("types");e||(e=[],t.getVisitorParamsState().set("types",e)),e.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(0===r.length)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class C extends F{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type="col"===r?"column":"bar")}}class w{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);null!==i&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),!0===n?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(p(t,e,r,"showBubbleSize","showBubbleSize"),p(t,e,r,"showCatName","showCatName"),p(t,e,r,"showLeaderLines","showLeaderLines"),p(t,e,r,"showPercent","showPercentage"),p(t,e,r,"showSerName","showSerName"),p(t,e,r,"showVal","showVal"),p(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return null!==l&&(r.separator=l.textContent),h(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const t=r.getAttribute("formatCode");s.formatCode=t,r.hasAttribute("sourceLinked")&&(s.sourceLinked="1"===r.getAttribute("sourceLinked"))}}}const P=(t,e,s)=>{if(!0===t.getValAttrAsBoolean("invertIfNegative",e))if(t.evaluate("extLst/ext/invertSolidFillFmt",e)){if(s.fill&&s.fillNegative){const e=t.getFromPath(s,"fill.solid.adjs");e&&t.setToPath(s,"fillNegative.solid.adjs",e)}}else{const t={val:"FFFFFF"},e={};e.solid=t,s.fillNegative=e;const r={val:"000000"},o={};o.solid=r;const i={};i.fill=o,s.strokeNegative=i}};class N{visit(t,e,s){const r={};g(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;null!==o&&null!==o.firstChild&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),null!==i&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),null!==n&&(l=this.parsePointsAsString(t,n))),null!==l&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),g(t,e,r,"idx","idx"),p(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(null!==r){const e=r.firstChild.nodeValue;t.setToPath(s,"title.range",e)}else{const r=t.evaluate("tx/v",e);null!==r&&t.setToPath(s,"title.text.simpleRun",r.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let s=0;o&&r&&s<r;s++){let r=null,o=t.evaluate("pt[@idx='"+s+"']/v",e);o instanceof Node&&(r=o.textContent),i[s]=r}for(let t=0;t<i.length;t++)t>0&&(s+=","),void 0!==i[t]&&(s+=i[t]);return s+="}",s}afterVisit(t,e,s){P(t,e,s);let r=t.getFromPath(s,"points");if(r){const e=Object.keys(r);for(let o=0;o<e.length;o++){const i=e[o],n=t.getFromPath(r,i);if(!n)continue;let l=t.getFromPath(n,"markers");l&&(t.setToPath(s,"markers.points."+i,l),delete n.markers)}}}}class O{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return null!==n&&(o[n]=i),p(t,e,i,"bubble3D","bubble3D"),g(t,e,i,"explosion","explosion"),P(t,e,i),i}}class S{visit(t,e,s){const r=e.parentNode.localName;if("ser"===r||"dPt"===r){const r={},o=t.getValAttrAsString("size",e);null!==o&&(r.size=o);const i=t.getValAttrAsString("symbol",e);return i&&(r.type=i),s.markers=r,r}return null}}class T{visit(t,e,s){let r={};this.parseScaling(t,e,r),d(t,e,r,"majorUnit","majorUnits"),d(t,e,r,"minorUnit","minorUnits"),p(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),h(t,e,r,"majorTickMark","majorTickMarks"),h(t,e,r,"minorTickMark","minorTickMarks"),h(t,e,r,"crosses","crosses"),d(t,e,r,"crossesAt","crosses"),h(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),g(t,e,r,"lblOffset","labelOffset"),h(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=null!==o&&0===o,g(t,e,r,"tickMarkSkip","tickMarkSkip"),g(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),h(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(null!==l){n.dem=l;let s=t.getValAttrAsString(i,e);n.amt=s}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);null!==r&&("ctr"===r?s.labelAlign="center":"l"===r?s.labelAlign="left":"r"===r&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);null!==r&&("b"===r?s.orientation="bottom":"l"===r?s.orientation="left":"r"===r?s.orientation="right":"t"===r&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);null!==o&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked="1"===o.getAttribute("sourceLinked"))),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);null!==r&&(s.inverted="minMax"!==r);const o=t.getValAttrAsFloat("scaling/logBase",e);null!==o&&(s.logBase=o,s.scaleType="log"),d(t,e,s,"scaling/max","max"),d(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);null!==r&&(t.setToPath(s,"labels.shown",!0!==r),t.setToPath(s,"shown",!0!==r));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",null!==i);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",null!==n);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",null!==l)}}class V{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),(new v).visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=e=>{const s={};let r=t.evaluate("t",e);const o=t.evaluate("rPr",e);o&&this.parseTextProperties(t,o,s),r?s.text=r.firstChild.textContent??"":e.textContent&&(s.text=e.textContent??""),i.push(s)};if(void 0!==n?.length)for(let t=0;n&&t<n.length;t++)l(n.item(t));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&u(a,s)}parseTextProperties(e,s,r){if(!s)return;s.hasAttribute("sz")&&(r.size=parseFloat(s.getAttribute("sz"))/100),s.hasAttribute("b")&&(r.weight="1"===s.getAttribute("b")?700:400),s.hasAttribute("i")&&(r.italic="1"===s.getAttribute("i")),s.hasAttribute("u")&&(r.underline=s.getAttribute("u")),s.hasAttribute("strike")&&(r.strike=s.getAttribute("strike"));const o=e.evaluate("latin",s);if(o&&!o.getAttribute("typeface").startsWith("+")){const e=r.font??{};if(o.hasAttribute("typeface")&&(e.family=o.getAttribute("typeface")),o.hasAttribute("panose")){const s=o.getAttribute("panose");s&&(e.fallbacks=[t.fi.getPanoseFallback(s)])}o.hasAttribute("pitchFamily")&&(e.pitch=o.getAttribute("pitchFamily")),o.hasAttribute("charset")&&(e.charset=o.getAttribute("charset")),Object.keys(e).length>0&&(r.font=e)}}}class x{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let s=t.getFromPath(r,"title");s||(s={},t.setToPath(r,"title",s));let o=s,i=t.getValAttrAsBoolean("delete",e);return null!==i&&(o.shown=!i),o}return s}}class k{visit(t,e,s){const r={};return p(t,e,r,"overlay","overlay"),h(t,e,r,"legendPos","position"),s.legend=r,r}}class L extends v{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class I extends V{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const e=r.firstElementChild.nodeValue;t.setToPath(s,"range",e)}}visit(t,e,s){const r={};p(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const t=s.text?.rotation??null;null!==t&&(s.rotation=parseInt(t),delete s.title.rotation)}}}class B{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let e={};d(t,r,e,"x","x"),d(t,r,e,"y","y"),d(t,r,e,"w","w"),d(t,r,e,"h","h"),h(t,r,e,"xMode","xMode"),h(t,r,e,"yMode","yMode"),h(t,r,e,"wMode","wMode"),h(t,r,e,"hMode","hMode"),Object.keys(e).length>0&&(s.manualLayout=e)}return s}}class _{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class j extends y{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let s=0;s<o.length;s++){const i=o.item(s);if(1===i.nodeType){let s=i.localName;const o=t.evaluate(s,e),n=this.processAdjColor(t,o);r[s]=n}}return Object.keys(r).length>0&&(s.colors=r),r}}class R{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(e,s,r){if(!s)return;const o=e.evaluate("latin",s);if(!o)return;const i=o.getAttribute("typeface");i&&(r.family=i);const n=o.getAttribute("panose");return n&&(r.fallbacks=[t.fi.getPanoseFallback(n)]),r}}class E{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const e=t.getRef(o);"string"==typeof e&&(r.address=e)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class Y{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(e,s){const r={type:t.iS.Type.Color};return e.copyFromAttribute(s,"cellColor",r,"cellColor",e.BOOLEAN_COPY),e.copyFromAttribute(s,"dxfId",r,"styleId",e.INT_COPY),r}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(e,s){const r={type:t.iS.Type.Custom};e.copyFromAttribute(s,"and",r,"and",e.BOOLEAN_COPY);const o=s.childNodes;r.filters=[];for(let t=0;t<o.length;t++){const s=o.item(t);if(1!==s.nodeType)continue;let i=null;"customFilter"===s.localName&&(i=this.processCustomFilter(e,s)),i&&r.filters.push(i)}return r}processDynamicFilter(e,s){const r={type:t.iS.Type.Dynamic};return e.copyFromAttribute(s,"type",r,"dynamicType"),e.copyFromAttribute(s,"val",r,"val",e.INT_COPY),e.copyFromAttribute(s,"maxVal",r,"maxVal",e.INT_COPY),r}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(e,s){const r={type:t.iS.Type.Items};e.copyFromAttribute(s,"blank",r,"blank",e.BOOLEAN_COPY),e.copyFromAttribute(s,"calendarType",r,"calendarType");let o=[],i=[];const n=s.childNodes;for(let t=0;t<n.length;t++){const s=n.item(t);if(1===s.nodeType)if("dateGroupItem"===s.localName){const t=this.processDateGroupItem(e,s);t&&o.push(t)}else if("filter"===s.localName){const t=this.processFilterItem(e,s);void 0!==t&&i.push(t)}}return o.length>0&&(r.dateGroups=o),i.length>0&&(r.items=i),r}processIcon(e,s){const r={type:t.iS.Type.Icon};return e.copyFromAttribute(s,"iconId",r,"iconId",e.INT_COPY),e.copyFromAttribute(s,"iconSet",r),r}processTop10(e,s){const r={type:t.iS.Type.Top10};return e.copyFromAttribute(s,"filterVal",r,"filterVal",e.FLOAT_COPY),e.copyFromAttribute(s,"percent",r,"percent",e.BOOLEAN_COPY),e.copyFromAttribute(s,"top",r,"top",e.BOOLEAN_COPY),e.copyFromAttribute(s,"val",r,"val",e.FLOAT_COPY),r}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1!==s.nodeType)continue;let i=null;"colorFilter"===s.localName?i=this.processColorFilter(t,s):"customFilters"===s.localName?i=this.processCustomFilters(t,s):"dynamicFilter"===s.localName?i=this.processDynamicFilter(t,s):"filters"===s.localName?i=this.processFilters(t,s):"iconFilter"===s.localName?i=this.processIcon(t,s):"top10"===s.localName&&(i=this.processTop10(t,s)),i&&o.push(i)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,s){if(!s)return null;const r={};if(!s.hasAttribute("colId"))return;r.offset=parseInt(s.getAttribute("colId"));let o=!1;return s.hasAttribute("hiddenButton")&&(o=e.b(s.getAttribute("hiddenButton"))),o&&(r.hiddenButton=!0),s.hasAttribute("showButton")&&(r.showButton=e.b(s.getAttribute("showButton"))),this.processFilterCriteria(t,s,r),r}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1===s.nodeType&&"filterColumn"===s.localName){const e=this.processFilterColumn(t,s);e&&o.push(e)}}return o.length>0&&(s.fields=o),o}}class D{visit(s,r,o){if(!r)return;const i={};if(s.copyFromAttribute(r,"ref",i),r.hasAttribute("caseSensitive")){const s=e.b(r.getAttribute("caseSensitive"));i.collatorOptions=s?t.Pl.CaseSensitiveOptions:t.Pl.CaseInsensitiveOptions}const n=r.getAttribute("sortMethod");null!=n&&"none"!==n&&("stroke"===n?i.collatorOptions={...i.collatorOptions,collation:"stroke"}:"pinYin"===n&&(i.collatorOptions={...i.collatorOptions,collation:"pinyin"})),r.hasAttribute("columnSort")&&e.b(r.getAttribute("columnSort"))&&(i.orientation=t.e.Orientation.Column);const l=t.ip.fastStringToRange(i.ref);return this.processSortConditions(s,r,i,l),Object.keys(i).length>0&&(o.sort=i),i}processSortCondition(s,r,o){if(!r)return null;const i={};if(r.hasAttribute("ref")){if(r.hasAttribute("ref")){const e=r.getAttribute("ref"),s=t.ip.fastStringToRange(e);i.offset=o?s.colStart-o.colStart:s.colStart}return i.reverse=!1,r.hasAttribute("descending")&&(i.reverse=e.b(r.getAttribute("descending"))),s.copyFromAttribute(r,"sortBy",i,"sortOn"),s.copyFromAttribute(r,"dxfId",i),s.copyFromAttribute(r,"iconSet",i),s.copyFromAttribute(r,"customList",i),i}console.warn("no ref for sort conditional",s.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"sortCondition"===s.localName){const e=this.processSortCondition(t,s,r);e&&i.push(e)}}return i.length>0&&(s.fields=i),i}}class M{visit(t,e,s){}processDataBarColor(t,s,r,o,i="dk1"){if(!s)return;const n=e.d(t=>s.getAttribute(t),i);return n&&(r[o]=n),r}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);if(1===i.nodeType&&"font"===i.localName){const e={};this.processFont(t,i,e),s[o++]=e}}return s}processFont(e,s,r){e.getValAttrAsBoolean("b",s,!0)&&(r.weight=700),e.getValAttrAsBoolean("i",s,!0)&&(r.style=t.fi.Style.Italic),e.getValAttrAsBoolean("strike",s,!0)&&(r.strike=!0);const o=e.evaluate("u",s);if(o){const e=o.getAttribute("val");r.underline=e||t.fi.UnderlineStyle.Single}h(e,s,r,"vertAlign","verticalAlign"),"superscript"===r.verticalAlign?r.verticalAlign=t.fi.VerticalAlignment.Super:"subscript"===r.verticalAlign&&(r.verticalAlign=t.fi.VerticalAlignment.Sub),d(e,s,r,"sz","size");const i=e.evaluate("color",s);this.processDataBarColor(e,i,r,"fill"),r.fill||(r.fill="dk1"),h(e,s,r,"name","family"),h(e,s,r,"rFont","family");const n=e.evaluate("family",s);if(n){const t=n.getAttribute("val");if(t)switch(t){case"1":r.fallbacks=["serif"];break;case"2":r.fallbacks=["sans-serif"];break;case"3":r.fallbacks=["monospace"];break;case"4":r.fallbacks=["cursive"];break;case"5":r.fallbacks=["fantasy"]}}return h(e,s,r,"scheme","scheme"),p(e,s,r,"shadow","shadow",!0),p(e,s,r,"outline","outline",!0),e.getValAttrAsBoolean("condense",s,!0)&&(r.letterSpacing=-1),e.getValAttrAsBoolean("extend",s,!0)&&(r.letterSpacing=1),h(e,s,r,"charset","charset"),r}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);1===i.nodeType&&"fill"===i.localName&&this.processFill(t,i,s,o++)}return s}processFill(e,s,r,o){const i={type:t.ya.Type.None},n=s.childNodes;let l=!1;for(let t=0;!l&&t<n.length;t++){const s=n.item(t);1===s.nodeType&&("gradientFill"===s.localName?(this.processGradientFill(e,s,i),l=!0):"patternFill"===s.localName&&(this.processPatternFill(e,s,i),l=!0))}return r[o]=i,r}processGradientFill(e,s,r){if(!s)return;r.type=t.ya.Type.Gradient;const o=[];r.stops=o,r.angle=90+(s.hasAttribute("degree")?parseFloat(s.getAttribute("degree")):0);const i=s.getAttribute("type");i&&(r.gradientType=i);const n=t=>{if(!t)return 0;const e=parseFloat(t);return isNaN(e)?0:e};(s.hasAttribute("left")||s.hasAttribute("top")||s.hasAttribute("right")||s.hasAttribute("bottom"))&&(r.fillTo={left:n(s.getAttribute("left")),top:n(s.getAttribute("top")),right:n(s.getAttribute("right")),bottom:n(s.getAttribute("bottom"))});const l=s.childNodes;for(let t=0;t<l.length;t++){const s=l.item(t);if(1===s.nodeType&&"stop"===s.localName){const t={};o.push(t);const r=parseFloat(s.getAttribute("position"));t.offset=r;const i=e.evaluate("color",s);this.processDataBarColor(e,i,t,"color")}}return r}processPatternFill(e,s,r){if(!s)return;const o=e.getVisitorParamsState().get("processingDXFs"),i=s.getAttribute("patternType")||(o?t.ya.BuiltInSheetPattern.Solid:t.ya.BuiltInSheetPattern.None);if(i===t.ya.BuiltInSheetPattern.None)return{none:!0};r.type=t.ya.Type.Pattern,i&&(r.patternType=i);let n,l="foreground",a="background";const c=r.patternType===t.ya.BuiltInSheetPattern.Solid&&o;if(c){n="lt1";const t=l;l=a,a=t}const u=e.evaluate("fgColor",s);this.processDataBarColor(e,u,r,l,n);const h=e.evaluate("bgColor",s);return this.processDataBarColor(e,h,r,a,n),c&&!r.foreground&&(r.foreground=n),r}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let e=0;e<o.length;e++){const n=o.item(e);1===n.nodeType&&"border"===n.localName&&this.processBorder(t,n,s,i++,r)}return s}processBorder(e,s,r,o,i){if(!s)return;const n={};return this.processBorderStroke(e,s,n,t.Ba.Edge.Left),this.processBorderStroke(e,s,n,t.Ba.Edge.Right),i?(n.right||n.left)&&(n.right?n.vertical={...n.right}:n.vertical={...n.left}):this.processBorderStroke(e,s,n,t.Ba.Edge.Vertical),this.processBorderStroke(e,s,n,t.Ba.Edge.Top),this.processBorderStroke(e,s,n,t.Ba.Edge.Bottom),i?(n.bottom||n.top)&&(n.right?n.horizontal={...n.bottom}:n.horizontal={...n.top}):this.processBorderStroke(e,s,n,t.Ba.Edge.Horizontal),r[o]=n,r}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class z extends M{visit(e,s,r){this.processNumFmts(e,e.evaluate("numFmts",s),null),e.getVisitorParamsState().set("colorsToProcess",new Set);const o={fills:{},fonts:{},borders:{}};this.processFonts(e,e.evaluate("fonts",s),o.fonts),this.processFills(e,e.evaluate("fills",s),o.fills),this.processBorders(e,e.evaluate("borders",s),o.borders,!0),o.fills[0]={type:t.ya.Type.None},o.fills[1]={type:t.ya.Type.Pattern,patternType:t.ya.BuiltInSheetPattern.Gray125},o.borders[0]={};const i=[];this.processXFs(e,e.evaluate("cellStyleXfs",s),i,o,null,!1);const n=new Map;if(i.length>0){const t=[];this.processCellStyles(e,e.evaluate("cellStyles",s),t,i,n),r.named=t}const l=[];this.processXFs(e,e.evaluate("cellXfs",s),l,o,n),Object.keys(l).length>0&&(r.direct=l);const a=[];return this.processDXFs(e,e.evaluate("dxfs",s),a),this.processTableStyles(e,e.evaluate("tableStyles",s),r,a),this.processIndexColors(e,e.evaluate("colors/indexedColors",s),r),this.processMruColors(e,e.evaluate("colors/mruColors",s),r),r}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"rgbColor"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"color"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let t=0;t<o.length;t++){const e=o.item(t);if(1===e.nodeType&&"numFmt"===e.localName){const t=e.getAttribute("numFmtId"),s=e.getAttribute("formatCode");if(t&&s){const e=s.replace(/\\(.)/g,"$1");r.set(parseInt(t),e)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let e=0;e<n.length;e++){const l=n.item(e);if(1===l.nodeType&&"xf"===l.localName){const e={};this.processXF(t,l,e,r,o,i),s.push(e)}}}processXF(s,r,o,i,n,l){if(!r)return;const a=r.getAttribute("xfId");if(a&&n){const e=n.get(parseInt(a));e&&e!==t.rl.BuiltInName.Normal&&(o.named=e)}const c=t=>!(!l&&r.hasAttribute(t))||e.b(r.getAttribute("applyFont"));if(c("applyFont")){const t=i.fonts[r.getAttribute("fontId")];t&&(o.font=t)}if(c("applyFill")){const t=i.fills[r.getAttribute("fillId")];t&&Object.keys(t).length>0&&(o.fill=t)}if(c("applyBorder")){const t=i.borders[r.getAttribute("borderId")];t&&Object.keys(t).length>0&&(o.border=t)}if(c("applyNumberFormat")){const t=r.getAttribute("numFmtId");if(t){const e=parseInt(t);let r;const i=s.getVisitorParamsState();if(i){const t=i.get("numFmts");t&&(r=t.get(e)),o.numberFormat=r??e}else console.warn("no visitor params state")}}c("applyAlignment")&&this.processAlignment(s,s.evaluate("alignment",r),o),c("applyProtection")&&this.processProtection(s,s.evaluate("protection",r),o);const u=e.b(r.getAttribute("quotePrefix"));u&&(o.quotePrefix=u)}processAlignment(s,r,o){const i={};if(r?.hasAttribute("horizontal")?i.horizontal=r.getAttribute("horizontal"):i.horizontal=t.zs.HorizontalAlignment.General,r?.hasAttribute("vertical")?i.vertical=r.getAttribute("vertical"):i.vertical=t.zs.VerticalAlignment.Bottom,r?.hasAttribute("indent")?i.indent=parseInt(r.getAttribute("indent")):i.indent=0,r?.hasAttribute("relativeIndent")?i.relativeIndent=parseInt(r.getAttribute("relativeIndent")):i.relativeIndent=0,e.b(r?.getAttribute("wrapText"))?i.overflow=t.zs.Overflow.Wrap:i.overflow=t.zs.Overflow.Visible,e.b(r?.getAttribute("shrinkToFit"))&&(i.overflow=t.zs.Overflow.Shrink),r?.hasAttribute("textRotation")){let t=parseFloat(r.getAttribute("textRotation"));t>0&&t<=90?t=360-t:t>90&&t<=180?t-=90:255===t&&(t=0,i.stacked=!0),i.rotation=t}else i.rotation=0;r?.hasAttribute("justifyLastLine")&&(i.justifyLastLine=e.b(r.getAttribute("justifyLastLine")));const n=r?.getAttribute("readingOrder");return n&&("0"===n?i.readingDirection=t.zs.ReadingDirection.Auto:"1"===n?i.readingDirection=t.zs.ReadingDirection.LeftToRight:"2"===n?i.readingDirection=t.zs.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${n}`)),Object.keys(i).length>0&&(o.alignment=i),o}processProtection(t,s,r){if(!s)return;const o={},i=s.getAttribute("locked");i&&!e.b(i)&&(o.edit=!0);const n=s.getAttribute("hidden");return n&&e.b(n)&&(o.formulaHidden=!0),Object.keys(o).length>0&&(r.protection=o),r}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"font"===o.localName){const e={};this.processFont(t,o,e),s.font=e}else if(1===o.nodeType&&"fill"===o.localName){const e=[];this.processFill(t,o,e,0),e.length>0&&e[0]&&(s.fill=e[0])}else if(1===o.nodeType&&"border"===o.localName){const e=[];this.processBorder(t,o,e,0,!1),e.length>0&&e[0]&&(s.border=e[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);if(1===i.nodeType&&"dxf"===i.localName){const e={};this.processDXF(t,i,e);const o=s.length;r.set(o,e),s.push(e)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,s,r,o,i=!1){const n=s.getAttribute("name"),l={name:n};s.hasAttribute("table")&&(l.table=e.b(s.getAttribute("table"))),s.hasAttribute("pivot")&&(l.pivot=e.b(s.getAttribute("pivot"))),i&&!l.pivot&&o.unshift(null);const a=s.childNodes;for(let t=0;t<a.length;t++){const e=a.item(t);if(1===e.nodeType&&"tableStyleElement"===e.localName){const t=e.getAttribute("type"),s=e.getAttribute("dxfId");let r=o?.[s];r||(console.warn("invalid dfx id",s),r={}),l[t]=r;let i=null;e.hasAttribute("size")&&(i=parseInt(e.getAttribute("size"))),i&&!isNaN(i)&&(r.size=i)}}delete l.name,r[n]=l}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let e=0;e<a.length;e++){const s=a.item(e);1===s.nodeType&&"tableStyle"===s.localName&&this.processTableStyle(t,s,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,s,r,o,i){if(!s)return;const n=s.childNodes;for(let t=0;t<n.length;t++){const s=n.item(t);if(1===s.nodeType&&"cellStyle"===s.localName){const t=parseInt(s.getAttribute("xfId")),n=s.getAttribute("name");if(i.set(t,n),!o[t])continue;const l={name:n,style:o[t]};s.getAttribute("hidden")&&(l.hidden=e.b(s.getAttribute("hidden"))),s.getAttribute("iLevel")&&(l.iLevel=parseInt(s.getAttribute("iLevel"))),r.push(l)}}}afterVisit(t,e,s){}}class U extends M{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=t=>!0!==t&&"1"!==t&&"on"!==t&&"true"!==t&&(!1===t||"0"===t||"off"===t||"false"===t||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);1===s.nodeType&&"sheet"===s.localName&&this.processSheetRef(t,s,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const e=r.item(i);1===e.nodeType&&"workbookView"===e.localName&&(this.processWorkbookView(t,e,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,t=>t+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,t=>t]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&3===i.nodeType&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const t=e.getAttribute("localSheetId");if(!r[t]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${t}' which does not exist.`);o.scope=r[t].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);1===i.nodeType&&"definedName"===i.localName&&this.processDefineName(t,i,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class G{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableStyleInfo"===s.localName&&(t.copyFromAttribute(s,"name",o),t.copyFromAttribute(s,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"tableColumn"===o.localName){const e={};t.copyFromAttribute(o,"name",e),t.copyFromAttribute(o,"uniqueName",e),s.push(e)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableColumns"===s.localName&&this.processTableColumn(t,s,o)}o.length>0&&(s.columns=o)}}class W{visit(t,e,s){return s}}class X{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,s,r,o){if(!s)return;const i={c:0,r:0,x:0,y:0};return t.evaluate("col",s)&&(i.c=parseInt(t.evaluate("col",s).textContent)),t.evaluate("row",s)&&(i.r=parseInt(t.evaluate("row",s).textContent)),t.evaluate("colOff",s)&&(i.x=e.c(t.evaluate("colOff",s).textContent)),t.evaluate("rowOff",s)&&(i.y=e.c(t.evaluate("rowOff",s).textContent)),"from"===o?r.tl=i:r.br=i,r}}class ${visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class K extends ${visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const e=t.evaluate("graphicFrameLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)try{let e=s.localName;"chart"===e&&(e="chart"),o.type=e;const r=s.getAttribute("r:id");r&&(o.json=t.getRef(r))}catch(t){console.warn("Unable to parse graphicFrame",t)}}return o&&(s.content=o),o}}class H extends ${visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const e=t.evaluate("spLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class q extends ${visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const s=t.evaluate("picLocks",o);if(s){s.hasAttribute("noChangeAspect")&&(r.lockAspect="1"===s.getAttribute("noChangeAspect"));const e={};t.copyFromAttribute(s,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(e).length>0&&(r.locks=e)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const e=i.getAttribute("r:embed")??i.getAttribute("embed");if(!e)return void console.warn("no rId found for blip",i);n=t.getRef(e,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class J extends H{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const e=t.evaluate("grpSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class Q extends H{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const e=t.evaluate("cxnSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const Z="richTypes";class tt{visit(t,e,s){let r=t.getVisitorParamsState().get(Z);r||(r=[],t.getVisitorParamsState().set(Z,r));const o=e.childNodes,i=o.length;for(let e=0;e<i;e++){const s=o.item(e);if(1===s.nodeType&&"s"===s.localName){const e={type:s.getAttribute("t")??"n",keys:[]};this.processKeys(t,s,e),r.push(e)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let t=0;t<o;t++){const e=r.item(t);if(1===e.nodeType&&"k"===e.localName){const t=e.getAttribute("n"),s=e.getAttribute("t");i.push([t,s])}}}}const et="richData";class st{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(et);o||(o=[],t.getVisitorParamsState().set(et,o));const i=e.childNodes,n=i.length;for(let e=0;e<n;e++){const s=i.item(e);if(1===s.nodeType&&"rv"===s.localName){const e=r[s.getAttribute("s")],i={type:e.type};this.processValues(t,s,i,e);const n=this.mapType(t,i);o.push(n)}}return s.richData=o,o}mapType(e,s){if("_error"===s.type){const r=s.errorType;if(r)try{s=t.r.getBuiltInById(r+1)}catch(e){}}return s}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let e=0;e<i;e++){const r=o.item(e);if(1===r.nodeType&&"v"===r.localName){const o=n[e];if(!o)return void t.warn("Invalid richData");const i=o[0],l=o[1];let a=r.textContent;"i"===l&&(a=Number(a)),s[i]=a}}}}class rt{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let t=0;t<r.length;t++){const e=r.item(t);if(1===e.nodeType&&"author"===e.localName){const t=e.firstChild;t&&3===t.nodeType&&s.push(t.textContent)}}}}class ot{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class it{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class nt{visit(t,s,r){if(!s)return;const o={};return t.copyFromAttribute(s,"id",o,"id",e.r),t.copyFromAttribute(s,"personId",o,"personId",e.r),t.copyFromAttribute(s,"ref",o),t.copyFromAttribute(s,"parentId",o,"parentId",e.r),t.copyFromAttribute(s,"dT",o),s.hasAttribute("done")&&(o.done=e.b(s.getAttribute("done"))),r.push(o),o}}class lt{visit(t,s,r){const o=[],i=s.childNodes;for(let s=0;s<i.length;s++){const r=i.item(s);if(1===r.nodeType&&"person"===r.localName){const s={};t.copyFromAttribute(r,"id",s,"id",e.r),t.copyFromAttribute(r,"displayName",s),t.copyFromAttribute(r,"userId",s,"userId",e.r),t.copyFromAttribute(r,"providerId",s),o.push(s)}}return o.length>0&&(r.persons=o),o}}const at={};class ct{constructor(t,e){this.path=t,this.visitor=e}}class ut{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new c),this.registerVisitor("spPr",new v),this.registerVisitor("txBody",new V),this.registerVisitor("txPr",new V),this.registerVisitor("c:chartSpace",new m),this.registerVisitor("c:chartSpace",new b,"chart"),this.registerVisitor("c:plotArea",new f),this.registerVisitor("c:barChart",new C),this.registerVisitor("c:doughnutChart",new F),this.registerVisitor("c:lineChart",new F),this.registerVisitor("c:ofPieType",new F),this.registerVisitor("c:pieChart",new F),this.registerVisitor("c:scatterChart",new F),this.registerVisitor("c:barChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new w("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new w("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new N),this.registerVisitor("c:dPt",new O),this.registerVisitor("c:marker",new S),this.registerVisitor("c:catAx",new T),this.registerVisitor("c:valAx",new T),this.registerVisitor("c:dateAx",new T),this.registerVisitor("c:majorGridlines",new a("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new a("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new V("labels.text"),"txPr"),this.registerVisitor("c:valAx",new V("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new V("labels.text"),"txPr"),this.registerVisitor("c:legend",new k),this.registerVisitor("c:legend",new V("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new x),this.registerVisitor("c:ser",new L,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new w("labels"),"dLbls"),this.registerVisitor("c:dLbl",new w("points")),this.registerVisitor("c:title",new I),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new B),this.registerVisitor("c:dispUnits",new a("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new I("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new V,"tx/rich"),this.registerVisitor("a:theme",new _),this.registerVisitor("a:theme",new j,"themeElements/clrScheme"),this.registerVisitor("a:theme",new R,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new Y),this.registerVisitor("sortState",new D),this.registerVisitor("s:workbook",new U),this.registerVisitor("styleSheet",new z),this.registerVisitor("table",new G),this.registerVisitor("hlinkClick",new E),this.registerVisitor("wsDr",new W),this.registerVisitor("twoCellAnchor",new X),this.registerVisitor("oneCellAnchor",new X),this.registerVisitor("absoluteAnchor",new X),this.registerVisitor("graphicFrame",new K),this.registerVisitor("sp",new H),this.registerVisitor("grpSp",new J),this.registerVisitor("cxnSp",new Q),this.registerVisitor("pic",new q),this.registerVisitor("rvStructures",new tt),this.registerVisitor("rvData",new st),this.registerVisitor("comments",new rt),this.registerVisitor("commentList",new ot,"comment"),this.registerVisitor("comment",new V("content"),"text"),this.registerVisitor("ThreadedComments",new it),this.registerVisitor("threadedComment",new nt),this.registerVisitor("threadedComment",new V("content"),"text"),this.registerVisitor("personList",new lt)}registerVisitor(t,e,s=null){-1===t.indexOf(":")&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new ct(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=at){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,a=new l(null,this,n,r,o,e,s),c=[];this._doWalk(i,a,c,r,o,e,s);for(let e=0;e<c.length;e++){const s=c[e];try{s.visitor?.afterVisit?.(s.context,s.elemParent,s.jsonParent)}catch(t){console.warn(`Error in afterVisit: ${s.context.getPath()}`,t)}}return o}_walkScoped(t,e,s,r,o,i,n){const a=this.scopedVisitorsByXmlTagName.get(t);for(let c=0;a&&c<a.length;c++){const u=a[c];let h=null;try{h=e.evaluate(u.path,r)}catch(e){console.warn(`"Invalid path '${u.path}' for '${t}'.`)}if(!h)continue;const p=t=>{let a=t.localName,c=t.parentNode;for(;c&&c!==r;)a=c.localName+"/"+a,c=c.parentNode;const h=e.getPath()+"/"+a;if(u.visitor){const r=new l(e,this,h,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(u.visitor,r,s,t,o,i,n)}};if(h.length>0){const t=h;for(let e=0;e<t.length;e++)p(t.item(e))}else p(h)}}_doWalk(t,e,s,r,o,i,n){let a=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),a=t.visit(e,r,o)),a||(a=o);const c=r.localName;this._walkScoped(c,e,s,r,a,i,n);const u=r.childNodes;for(let t=0;t<u.length;t++){const r=u.item(t);if(1===r.nodeType){const t=r,c=t.localName,u=this.visitorsByXmlTagName.get(c),h=e.getPath()+"/"+c,p=new l(e,this,h,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(u,p,s,t,a??o,i,n)}}return a}}exports.FromOOXMLConverter=ut,exports.default=ut;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
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
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let e=null;exports.initialize=async function(){return e||(e=new Promise(async(e,t)=>{let r=null;try{r=await import("https://esm.sh/typescript@5.7.2")}catch(e){console.error("Error initializing Browser TypeScript module:",e)}r||console.log("use script fallback"),e(r)}),e)};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.13
|
|
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{aZ as t,o as e,ai as s,h as r,p as o,a_ as i,a$ as n,b0 as l,u as a,x as c,b1 as u}from"./4GgcUVhUmQmiv9Ha.mjs";import{c as h,b as p,r as g,t as d,a as m,p as b,d as f}from"./BD8rE7MUxuHXsdcf.mjs";class A{constructor(t){this.list=t}get length(){return this.list.length}item(t){return this.list[t]}forEach(t,e){for(let e=0;e<this.list.length;e++)t(this.list[e],e,this)}}const y=t=>!0===t||"1"===t||"on"===t||"true"===t||!1!==t&&"0"!==t&&"off"!==t&&"false"!==t&&null,v=t=>{const e=parseInt(t);return isNaN(e)?null:e},F=t=>{const e=parseFloat(t);return isNaN(e)?null:e},C=new Map;class w{constructor(t,e,s,r,o,i=null,n){const l=(t,e,s)=>n?.getRef?.(t,e,s,n?.parsedRefs),a=t=>n?.getRefs?.(t,n?.parsedRefs);this._parent=t,this.sharedShared=e,this.currentPath=s,this.elemRoot=r,this.jsonRoot=o,t?(this._fileLocation=t._fileLocation,this._getRef=t._getRef,this._getRefs=t._getRefs):(i&&(this._fileLocation=i),l&&a&&(this._getRef=l),a&&(this._getRefs=a),this._onWarning=n?.onWarning,this._addPerson=n?.addPerson)}getRef(t,e=!1){return this._getRef?.(t,this._fileLocation,e)??null}getRelationships(){return this._getRefs(this._fileLocation)??C}getPath(){return this.currentPath}getElemRoot(){return this.elemRoot}getJsonRoot(){return this.jsonRoot}warn(t){this._onWarning?this._onWarning(t):this._parent?this._parent?.warn?.(t):console.warn(t)}addPerson(t){return this._addPerson?this._addPerson(t):this._parent?this._parent?._addPerson?.(t):null}getVisitorParamsState(){return this.sharedShared.getVisitorParamsState()}evaluate(t,e){if(!t)return e;let s=[e];const r=t.split("/");for(let t=0;t<r.length;t++){const e=r[t];if(""===e||"."===e)continue;let o=[];for(let t=0;t<s.length;t++){const r=s[t],i=r.childNodes;for(let t=0;i&&t<i.length;t++){const s=r.childNodes[t];s.localName!==e&&"*"!==e||o.push(s)}}s=o}return 1===s.length?s[0]:0===s.length?null:new A(s)}getFromPath(t,e){return c.getFromPath(t,e)}setToPath(t,e,s){return c.setToPath(t,e,s)}getValAttrAsString(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?s.getAttribute("val")??null:null}getValAttrAsBoolean(t,e,s=!1){let r=this.evaluate(t,e);if(!r)return null;const o=r.hasAttribute("val")?r.getAttribute("val"):void 0;return null==o?s:"1"===o||"on"===o||"true"===o||"0"!==o&&"off"!==o&&"false"!==o&&s}getValAttrAsInteger(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseInt(s.getAttribute("val"))??null:null}getValAttrAsFloat(t,e){let s=this.evaluate(t,e);return s&&s.hasAttribute("val")?parseFloat(s.getAttribute("val"))??null:null}get BOOLEAN_COPY(){return y}get INT_COPY(){return v}get FLOAT_COPY(){return F}copyFromAttribute(t,e,s,r=e,o=null){if(!t||!s||!t.hasAttribute(e))return;let i=t.getAttribute(e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){if(null==i)return;if(i=o[t](i),null==i)return}else{if(null==i)return;if(i=o(i),null==i)return}this.setToPath(s,r,i)}}class P{constructor(t){this.jsonKey=t}visit(t,e,s){const r={};return s[this.jsonKey]=r,r}}class N{visit(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);1===o.nodeType&&"Relationship"===o.localName&&this.processRelationship(t,o,s)}return s}processRelationship(t,e,s){const r={};t.copyFromAttribute(e,"Target",r,"target"),t.copyFromAttribute(e,"Type",r,"type"),t.copyFromAttribute(e,"TargetMode",r,"targetMode"),s[e.getAttribute("Id")]=r}}const O=(t,e)=>{if(t||!t.hasAttribute("rot"))return;const s=t.getAttribute("rot"),r=c.roundAccurately(b(s),2);-1e3!==r&&(e.rotation=r)},T=(t,e,s,r,o)=>{const i=t.getValAttrAsString(r,e);null!==i&&(s[o]=i)},V=(t,e,s,r,o=r,i=null)=>{const n=t.getValAttrAsBoolean(r,e,i);null!==n&&(s[o]=n)},S=(t,e,s,r,o)=>{const i=t.getValAttrAsInteger(r,e);null!==i&&(s[o]=i)},x=(t,e,s,r,o,i=1)=>{const n=t.getValAttrAsFloat(r,e);null!==n&&(s[o]=n*i)};class k{visit(t,e,s){return V(t,e,s,"roundedCorners","roundedCorners"),S(t,e,s,".//AlternateContent/Fallback/style","styleId"),s.range=null,s}afterVisit(t,e,s){let r={};s.types=r;let o={},i=0,n={},l=0,a=t.getVisitorParamsState().get("axes");const c=t.getVisitorParamsState().get("types");for(let t=0;t<c.length;t++){const e=c[t];if(e.xAxisId){const r=e.xAxisId,n=a.get(r);o[t+""]=n,e.offsetXAxis=t,delete e.xAxisId,s.xAxes=o,o.length=++i}if(e.yAxisId){const r=e.yAxisId,o=a.get(r);n[t+""]=o,e.offsetYAxis=t,delete e.yAxisId,s.yAxes=n,n.length=++l}r[t+""]=e}r.length=c.length;const u=t.getVisitorParamsState().get("series");if(!u||0===u.length)return;const h={};s.series=h;for(let t=0;t<u.length;t++)h[t+""]=u[t];h.length=u.length}}class L{visit(t,e,s){return V(t,e,s,"plotVisOnly","plotVisOnly"),T(t,e,s,"dispBlanksAs","dispBlanksAs"),V(t,e,s,".//extLst/ext/dataDisplayOptions16/dispNaAsBlank","dispNaAsBlank"),V(t,e,s,"showDLblsOverMax","showDLblsOverMax"),s}afterVisit(t,e,s){try{const r=t.getValAttrAsBoolean("autoTitleDeleted",e),o=t.evaluate("title",e);t.setToPath(s,"title.shown",!(!0===r||!o));const i=t.evaluate("legend",e);t.setToPath(s,"legend.shown",null!==i)}catch(t){throw new Error("Unexpected Error parsing Chart: "+t)}}}class I{visit(t,e,s){let r={};return s.plotArea=r,r}}class B{EnumMappings(){}static fromOoxmlGradientType(t){return"circle"===t?"radial":t}static fromOoxmlLineCap(t){if("rnd"===t)return"round";if("flat"===t)return"butt";if("sq"===t)return"square";throw new Error("Invalid lineCap type: "+t)}static fromOoxmlCompound(t){return"sng"===t?"single":t}static fromOoxmlAlignment(t){return"ctr"===t?"center":t}}class _{visit(t,e,s){}processStroke(t,e,s){const r={},o=t.evaluate("ln",e);if(o){o.hasAttribute("algn")&&(r.align=B.fromOoxmlAlignment(o.getAttribute("algn"))),o.hasAttribute("cap")&&(r.lineCap=B.fromOoxmlLineCap(o.getAttribute("cap"))),o.hasAttribute("cmpd")&&(r.compound=B.fromOoxmlCompound(o.getAttribute("cmpd"))),o.hasAttribute("w")&&(r.width=d(o.getAttribute("w")));const e=t.evaluate("miter",o);e&&(r.lineJoin="miter",e.hasAttribute("lim")&&(r.miter=parseFloat(e.getAttribute("lim")))),t.evaluate("bevel",o)&&(r.lineJoin="bevel"),t.evaluate("round",o)&&(r.lineJoin="round");const i=t.evaluate("custDash",o);if(i){const e=t.evaluate("ds",i);if(e&&e.length>0){let t="";for(let s=0;s<e.length;s++){const r=e.item(s);t+=m(r.getAttribute("d"))+","+m(r.getAttribute("sp"))}r.dash=t}}const n=t.evaluate("prstDash",o);n&&n.hasAttribute("val")&&(r.dash=n.getAttribute("val")),this.parseEndElement(t,o,r,"headEnd","head"),this.parseEndElement(t,o,r,"tailEnd","tail");const l=this.processFill(t,o,s);r.fill=l}return r}parseEndElement(t,e,s,r,o){const i=t.evaluate(r,e);if(i&&(i.hasAttribute("type")&&(s[o+"Type"]=i.getAttribute("type")),i.hasAttribute("len")||i.hasAttribute("w"))){const t=i.getAttribute("len")?i.getAttribute("len"):"med",e=i.getAttribute("w")?i.getAttribute("w"):"med";s[o+"Size"]=t+"-"+e}}processFill(t,e,s){const r={};if(t.evaluate("noFill",e))return r.none=!0,r;const o=t.evaluate("solidFill",e);if(o){const e=this.processAdjColor(t,o);return e&&(r.solid=e),r}const i=t.evaluate("gradFill",e);if(i){i.hasAttribute("rotWithShape")&&(r.isRotated="1"===i.getAttribute("rotWithShape"));const e=this.processGradFill(t,i);return r.gradient=e,r}const n=t.evaluate("pattFill",e);if(n){const e=this.processPatternFill(t,n);return r.pattern=e,r}const l=t.evaluate("blipFill",e);if(l){l.hasAttribute("rotWithShape")&&(r.isRotated=p(l.getAttribute("rotWithShape"))),l.hasAttribute("dpi")&&(r.dpi=l.getAttribute("dpi"));const e=this.processImageFill(t,l);return r.image=e,r}return r.none=!0,r}processGradFill(t,e){const s={},r=t.evaluate("lin",e);if(r){if(s.type="linear",r.hasAttribute("ang")){const t=b(r.getAttribute("ang"));s.angle=t}if(r.hasAttribute("scaled")){const t=p(r.getAttribute("scaled"));s.scaled=t}}const o={};e.hasAttribute("flip")&&(o.mirror=e.getAttribute("flip")),Object.keys(o).length>0&&(s.tile=o);const i=t.evaluate("path",e);if(i){i.hasAttribute("path")&&(s.type=B.fromOoxmlGradientType(i.getAttribute("path")));const e=t.evaluate("fillToRect",i);e&&(s.fillTo=this.getRect(e))}const n=t.evaluate("tileRect",e);n&&(s.tile.bounds=this.getRect(n));const l=[],a=t.evaluate("gsLst/gs",e);for(let e=0;a&&e<a.length;e++){const s=a.item(e),r={offset:m(s.getAttribute("pos")),color:this.processAdjColor(t,s)};l.push(r)}return l.length>0&&(s.stops=l),s}getRect(t){const e={};return t.hasAttribute("t")&&(e.t=m(t.getAttribute("t"))),t.hasAttribute("l")&&(e.l=m(t.getAttribute("l"))),t.hasAttribute("b")&&(e.b=m(t.getAttribute("b"))),t.hasAttribute("r")&&(e.r=m(t.getAttribute("r"))),0===Object.keys(e).length?null:e}processImageFill(t,e){return{ref:"https://www.sheetxl.com/logo-color-padded-white.jpg",tile:!1}}processPatternFill(t,e){const s={},r=e.getAttribute("prst");s.type=r;const o=t.evaluate("bgClr",e);if(o){const e=this.processAdjColor(t,o);e&&(s.background=e)}const i=t.evaluate("fgClr",e);if(i){let e=this.processAdjColor(t,i);e&&(s.foreground=e)}return s}processAdjColor(t,e){const s=t.evaluate("hslClr",e);if(s)return this.processHslClr(t,s);const r=t.evaluate("prstClr",e);if(r)return this.processClrWithValAttribute(t,r);const o=t.evaluate("schemeClr",e);if(o)return this.processClrWithValAttribute(t,o);const i=t.evaluate("sysClr",e);if(i)return this.processClrWithValAttribute(t,i);const n=t.evaluate("scrgbClr",e);if(n)return this.processScrgbClrElement(t,n);const l=t.evaluate("srgbClr",e);return l?this.processSrgbClrElement(t,l):null}processScrgbClrElement(t,e){let s="lrgba("+m(e.getAttribute("r"))+","+m(e.getAttribute("g"))+","+m(e.getAttribute("b"))+")";return s+=this.processAdjustments(t,e),s}processSrgbClrElement(t,e){let s=e.getAttribute("val");return s+=this.processAdjustments(t,e),s}processHslClr(t,e){let s="hsl("+b(e.getAttribute("hue"))+","+m(e.getAttribute("sat"))+","+m(e.getAttribute("lum"))+")";return s+=this.processAdjustments(t,e),s}processClrWithValAttribute(t,e){const s=e.getAttribute("val");if(!s)return;let r=s;return r+=this.processAdjustments(t,e),r}processAdjustments(t,e){let s="";const r=e.childNodes;for(let o=0;o<r.length;o++){const i=r.item(o);if(1===i.nodeType){let r=i.localName;s+="hue"===r||"hueOff"===r||"hueMod"===r?this.processAdjustmentElement(t,e,r,6e4):"gray"===r||"comp"===r||"inv"===r||"gamma"===r||"invGamma"===r?this.processAdjustmentElement(t,e,r,1):this.processAdjustmentElement(t,e,r)}}return s}processAdjustmentElement(t,e,s,r=1e3){const o=t.evaluate(s,e);if(!o)return"";const i=o.getAttribute("val");return i?` ${s} ${!i||parseFloat(i)/r}`:` ${s}`}}class j extends _{visit(t,e,s){try{const r=t.evaluate("xfrm",e);if(r){O(r,s);const e={x:0,y:0,width:0,height:0},o=t.evaluate("off",r);o&&(e.x=h(o.getAttribute("x"))??0,e.y=h(o.getAttribute("y"))??0);const i=t.evaluate("ext",r);o&&(e.width=h(i.getAttribute("cx"))??0,e.height=h(i.getAttribute("cy"))??0),s.bounds=e}const o=t.evaluate("prstGeom",e);o?.hasAttribute("prst")?s.geometry=o?.getAttribute("prst"):t.evaluate("customGeom",e)&&console.warn("customGeom not supported yet");const i=this.processFill(t,e,s);i&&Object.keys(i).length>0&&(s.fill=i);const n=this.processStroke(t,e,s);return n&&Object.keys(n).length>0&&(s.stroke=n),s}catch(t){throw console.warn(t),new Error("Unexpected Error parsing Shape Properties element")}}}class R{visit(t,e,s){let r={};if(T(t,e,r,"grouping","grouping"),V(t,e,r,"varyColors","varyColors"),x(t,e,r,"gapWidth","gapWidth",.01),x(t,e,r,"overlap","overlap",.01),this.parseType(t,e,r),S(t,e,r,"bubbleScale","bubbleScale"),V(t,e,r,"showNegBubbles","showNegativeBubbleValues"),V(t,e,r,"sizeRepresents","bubbleSizeRepresentsWidth"),S(t,e,r,"firstSliceAng","startAngle"),S(t,e,r,"holeSize","holeSize"),T(t,e,r,"scatterStyle","scatterStyle"),this.parseAxisIds(t,e,r),Object.keys(r).length>0){let e=t.getVisitorParamsState().get("types");e||(e=[],t.getVisitorParamsState().set("types",e)),e.push(r)}return r}parseType(t,e,s){switch(e.localName){case"areaChart":s.type="area";break;case"bubbleChart":s.type="bubble";break;case"doughnutChart":case"ofPieType":case"pieChart":s.type="pie";break;case"lineChart":s.type="line";break;case"scatterChart":s.type="scatter"}}parseAxisIds(t,e,s){const r=t.evaluate("axId",e);if(0===r.length)return;const o=r.item(0).getAttribute("val");s.xAxisId=o;const i=r.item(1).getAttribute("val");s.yAxisId=i}}class E extends R{parseType(t,e,s){const r=t.getValAttrAsString("barDir",e);r&&(s.type="col"===r?"column":"bar")}}class Y{constructor(t){this.jsonKey=t}visit(t,e,s){let r={},o=r,i=t.getValAttrAsString("idx",e);null!==i&&(o={},o[i]=r);const n=t.getValAttrAsBoolean("delete",e);this.parseNumFormat(t,e,r),!0===n?(r.showBubbleSize=!1,r.showCatName=!1,r.showLeaderLines=!1,r.showPercentage=!1,r.showSerName=!1,r.showVal=!1,r.showLegendKey=!1):(V(t,e,r,"showBubbleSize","showBubbleSize"),V(t,e,r,"showCatName","showCatName"),V(t,e,r,"showLeaderLines","showLeaderLines"),V(t,e,r,"showPercent","showPercentage"),V(t,e,r,"showSerName","showSerName"),V(t,e,r,"showVal","showVal"),V(t,e,r,"showLegendKey","showLegendKey"));const l=t.evaluate("separator",e);return null!==l&&(r.separator=l.textContent),T(t,e,r,"dLblPos","position"),s[this.jsonKey]=o,r}parseNumFormat(t,e,s){const r=t.evaluate("numFmt",e);if(r){const t=r.getAttribute("formatCode");s.formatCode=t,r.hasAttribute("sourceLinked")&&(s.sourceLinked="1"===r.getAttribute("sourceLinked"))}}}const D=(t,e,s)=>{if(!0===t.getValAttrAsBoolean("invertIfNegative",e))if(t.evaluate("extLst/ext/invertSolidFillFmt",e)){if(s.fill&&s.fillNegative){const e=t.getFromPath(s,"fill.solid.adjs");e&&t.setToPath(s,"fillNegative.solid.adjs",e)}}else{const t={val:"FFFFFF"},e={};e.solid=t,s.fillNegative=e;const r={val:"000000"},o={};o.solid=r;const i={};i.fill=o,s.strokeNegative=i}};class M{visit(t,e,s){const r={};S(t,e,r,"explosion","explosion");let o=t.evaluate("cat/*/f",e);o||(o=t.evaluate("xVal/*/f",e));let i=null;null!==o&&null!==o.firstChild&&(i=o.firstChild.nodeValue),o||(o=t.evaluate("cat/strLit",e),o||(o=t.evaluate("cat/numLit",e)),o&&(i=this.parsePointsAsString(t,o))),null!==i&&(r.xRange=i);let n=t.evaluate("val/*/f",e);n||(n=t.evaluate("yVal/*/f",e));let l=null;n&&n.firstChild&&(l=n.firstChild.nodeValue),n||(n=t.evaluate("val/numLit",e),null!==n&&(l=this.parsePointsAsString(t,n))),null!==l&&(r.valRange=l),this.parseTitleRangeOrValue(t,e,r),S(t,e,r,"idx","idx"),V(t,e,r,"smooth","smooth");const a=t.getVisitorParamsState().get("types").length-1;r.offsetChart=a;let c=t.getVisitorParamsState().get("series");return c||(c=[],t.getVisitorParamsState().set("series",c)),c.push(r),r}parseTitleRangeOrValue(t,e,s){const r=t.evaluate("tx/strRef/f",e);if(null!==r){const e=r.firstChild.nodeValue;t.setToPath(s,"title.range",e)}else{const r=t.evaluate("tx/v",e);null!==r&&t.setToPath(s,"title.text.simpleRun",r.firstChild.nodeValue)}}parsePointsAsString(t,e){let s="{";const r=t.getValAttrAsInteger("ptCount",e),o=t.evaluate("pt",e),i=[];for(let s=0;o&&r&&s<r;s++){let r=null,o=t.evaluate("pt[@idx='"+s+"']/v",e);o instanceof Node&&(r=o.textContent),i[s]=r}for(let t=0;t<i.length;t++)t>0&&(s+=","),void 0!==i[t]&&(s+=i[t]);return s+="}",s}afterVisit(t,e,s){D(t,e,s);let r=t.getFromPath(s,"points");if(r){const e=Object.keys(r);for(let o=0;o<e.length;o++){const i=e[o],n=t.getFromPath(r,i);if(!n)continue;let l=t.getFromPath(n,"markers");l&&(t.setToPath(s,"markers.points."+i,l),delete n.markers)}}}}class U{DataPointVisitor(){}visit(t,e,s){let r=t.getFromPath(s,"points"),o=null;r?o=r:(o={},t.setToPath(s,"points",o));let i={},n=t.getValAttrAsString("idx",e);return null!==n&&(o[n]=i),V(t,e,i,"bubble3D","bubble3D"),S(t,e,i,"explosion","explosion"),D(t,e,i),i}}class z{visit(t,e,s){const r=e.parentNode.localName;if("ser"===r||"dPt"===r){const r={},o=t.getValAttrAsString("size",e);null!==o&&(r.size=o);const i=t.getValAttrAsString("symbol",e);return i&&(r.type=i),s.markers=r,r}return null}}class G{visit(t,e,s){let r={};this.parseScaling(t,e,r),x(t,e,r,"majorUnit","majorUnits"),x(t,e,r,"minorUnit","minorUnits"),V(t,e,r,"delete","shown"),this.parseOrientation(t,e,r),this.parseNumFormat(t,e,r),T(t,e,r,"majorTickMark","majorTickMarks"),T(t,e,r,"minorTickMark","minorTickMarks"),T(t,e,r,"crosses","crosses"),x(t,e,r,"crossesAt","crosses"),T(t,e,r,"crossBetween","crossBetween"),this.parseLabelAlign(t,e,r),S(t,e,r,"lblOffset","labelOffset"),T(t,e,r,"tickLblPos","labelPosition");const o=t.getValAttrAsInteger("noMultiLvlLbl",e);r.labelMultiLevel=null!==o&&0===o,S(t,e,r,"tickMarkSkip","tickMarkSkip"),S(t,e,r,"tickLblSkip","labelInterval"),this.parseDisplayCustOrBuiltInUnit(e,t,r),this.parseTimeUnits(t,e,r,"majorUnitDates","majorTimeUnit","majorUnit"),this.parseTimeUnits(t,e,r,"minorUnitDates","minorTimeUnit","minorUnit"),T(t,e,r,"baseTimeUnit","baseUnitDates"),t.getVisitorParamsState().get("axes")||t.getVisitorParamsState().set("axes",new Map);const i=t.getValAttrAsString("axId",e);return t.getVisitorParamsState().get("axes").set(i,r),r}parseTimeUnits(t,e,s,r,o,i){const n={};let l=t.getValAttrAsString(o,e);if(null!==l){n.dem=l;let s=t.getValAttrAsString(i,e);n.amt=s}Object.keys(n).length>0&&(s[r]=n)}parseDisplayCustOrBuiltInUnit(t,e,s){let r=e.getValAttrAsString("dispUnits/builtInUnit",t);r||(r=e.getValAttrAsString("dispUnits/custUnit",t)),r&&(s.displayUnits=r)}parseLabelAlign(t,e,s){let r=t.getValAttrAsString("lblAlgn",e);null!==r&&("ctr"===r?s.labelAlign="center":"l"===r?s.labelAlign="left":"r"===r&&(s.labelAlign="right"))}parseOrientation(t,e,s){const r=t.getValAttrAsString("AxPos",e);null!==r&&("b"===r?s.orientation="bottom":"l"===r?s.orientation="left":"r"===r?s.orientation="right":"t"===r&&(s.orientation="top"))}parseNumFormat(t,e,s){const r={},o=t.evaluate("numFmt",e);null!==o&&(o.hasAttribute("formatCode")&&(r.formatCode=o.getAttribute("formatCode")),o.hasAttribute("sourceLinked")&&(r.sourceLinked="1"===o.getAttribute("sourceLinked"))),Object.keys(r).length>0&&(s.labels=r)}parseScaling(t,e,s){const r=t.getValAttrAsString("scaling/orientation",e);null!==r&&(s.inverted="minMax"!==r);const o=t.getValAttrAsFloat("scaling/logBase",e);null!==o&&(s.logBase=o,s.scaleType="log"),x(t,e,s,"scaling/max","max"),x(t,e,s,"scaling/min","min")}afterVisit(t,e,s){s.fill&&s.labels&&(s.labels.fill=s.fill,delete s.fill);let r=t.getValAttrAsBoolean("delete",e);null!==r&&(t.setToPath(s,"labels.shown",!0!==r),t.setToPath(s,"shown",!0!==r));const o=t.getFromPath(s,"dispUnits.displayUnitsLabel");o&&(t.setToPath(s,"displayUnitsLabel",o),delete s.dispUnits);const i=t.evaluate("title",e);t.setToPath(s,"title.shown",null!==i);const n=t.evaluate("minorGridlines",e);t.setToPath(s,"gridLinesMinor.shown",null!==n);const l=t.evaluate("majorGridlines",e);t.setToPath(s,"gridLinesMajor.shown",null!==l)}}class W{constructor(t="text"){this._jsonKey=t}getTextPath(){return this._jsonKey}visit(t,e,s){let r=t.getFromPath(s,this.getTextPath());return r||(r={}),this.parseTextElement(t,e,r,!1),Object.keys(r).length>0&&t.setToPath(s,this.getTextPath(),r),s}parseTextElement(t,e,s,r){const o=t.evaluate("p/pPr/defRPr",e)??t.evaluate("defRPr",e);o&&(this.parseTextProperties(t,o,s),(new j).visit(t,o,s));let i=[],n=t.evaluate("p/r",e)??t.evaluate("r",e);const l=e=>{const s={};let r=t.evaluate("t",e);const o=t.evaluate("rPr",e);o&&this.parseTextProperties(t,o,s),r?s.text=r.firstChild.textContent??"":e.textContent&&(s.text=e.textContent??""),i.push(s)};if(void 0!==n?.length)for(let t=0;n&&t<n.length;t++)l(n.item(t));else l(n||e);i.length>0&&(s.runs=i);const a=t.evaluate("bodyPr",e);a&&O(a,s)}parseTextProperties(e,s,r){if(!s)return;s.hasAttribute("sz")&&(r.size=parseFloat(s.getAttribute("sz"))/100),s.hasAttribute("b")&&(r.weight="1"===s.getAttribute("b")?700:400),s.hasAttribute("i")&&(r.italic="1"===s.getAttribute("i")),s.hasAttribute("u")&&(r.underline=s.getAttribute("u")),s.hasAttribute("strike")&&(r.strike=s.getAttribute("strike"));const o=e.evaluate("latin",s);if(o&&!o.getAttribute("typeface").startsWith("+")){const e=r.font??{};if(o.hasAttribute("typeface")&&(e.family=o.getAttribute("typeface")),o.hasAttribute("panose")){const s=o.getAttribute("panose");s&&(e.fallbacks=[t.getPanoseFallback(s)])}o.hasAttribute("pitchFamily")&&(e.pitch=o.getAttribute("pitchFamily")),o.hasAttribute("charset")&&(e.charset=o.getAttribute("charset")),Object.keys(e).length>0&&(r.font=e)}}}class X{visit(t,e,s){let r=t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx",e)];if(r){let s=t.getFromPath(r,"title");s||(s={},t.setToPath(r,"title",s));let o=s,i=t.getValAttrAsBoolean("delete",e);return null!==i&&(o.shown=!i),o}return s}}class ${visit(t,e,s){const r={};return V(t,e,r,"overlay","overlay"),T(t,e,r,"legendPos","position"),s.legend=r,r}}class K extends j{visit(t,e,s){const r=this.processFill(t,e,s);Object.keys(r).length>0&&(s.fillNegative=r);const o=this.processStroke(t,e,s);return Object.keys(o).length>0&&(s.strokeNegative=o),s}}class H extends W{constructor(t="title"){super(t)}parseTitleRangeOrValue(t,e,s){let r=t.evaluate("tx/strRef/f",e)??null;if(r){const e=r.firstElementChild.nodeValue;t.setToPath(s,"range",e)}}visit(t,e,s){const r={};V(t,e,r,"overlay","overlay"),s[this._jsonKey]=r;let o=t.getFromPath(r,this.getTextPath());o||(o={}),this.parseTitleRangeOrValue(t,e,r);const i=t.evaluate("txPr",e);i&&this.parseTextElement(t,i,o,!1);const n=t.evaluate("tx/rich",e);return n&&this.parseTextElement(t,n,o,!0),Object.keys(o).length>0&&t.setToPath(r,this.getTextPath(),o),r}afterVisit(t,e,s){if(s?.text){const t=s.text?.rotation??null;null!==t&&(s.rotation=parseInt(t),delete s.title.rotation)}}}class J{visit(t,e,s){const r=t.evaluate("manualLayout",e);if(r){let e={};x(t,r,e,"x","x"),x(t,r,e,"y","y"),x(t,r,e,"w","w"),x(t,r,e,"h","h"),T(t,r,e,"xMode","xMode"),T(t,r,e,"yMode","yMode"),T(t,r,e,"wMode","wMode"),T(t,r,e,"hMode","hMode"),Object.keys(e).length>0&&(s.manualLayout=e)}return s}}class q{visit(t,e,s){return s.name=e.getAttribute("name"),s}}class Z extends _{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=e.childNodes;for(let s=0;s<o.length;s++){const i=o.item(s);if(1===i.nodeType){let s=i.localName;const o=t.evaluate(s,e),n=this.processAdjColor(t,o);r[s]=n}}return Object.keys(r).length>0&&(s.colors=r),r}}class Q{visit(t,e,s){const r={};r.name=e.getAttribute("name");const o=t.evaluate("majorFont",e),i=this.processFontElement(t,o,{});r.majorFont=i.family,i.fallbacks&&(r.majorFallbacks=i.fallbacks);const n=t.evaluate("minorFont",e),l=this.processFontElement(t,n,{});return r.minorFont=l.family,i.fallbacks&&(r.minorFallbacks=l.fallbacks),s.fonts=r,r}processFontElement(e,s,r){if(!s)return;const o=e.evaluate("latin",s);if(!o)return;const i=o.getAttribute("typeface");i&&(r.family=i);const n=o.getAttribute("panose");return n&&(r.fallbacks=[t.getPanoseFallback(n)]),r}}class tt{visit(t,e,s){if(!e)return;const r={},o=e.getAttribute("r:id");if(o){const e=t.getRef(o);"string"==typeof e&&(r.address=e)}return t.copyFromAttribute(e,"tooltip",r),t.copyFromAttribute(e,"history",r,"history",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tgtFrame",r,"target"),s.hyperlink=r,r}}class et{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),this.processFilterColumns(t,e,r),Object.keys(r).length>0&&(s.filter=r),r}processColorFilter(t,s){const r={type:e.Type.Color};return t.copyFromAttribute(s,"cellColor",r,"cellColor",t.BOOLEAN_COPY),t.copyFromAttribute(s,"dxfId",r,"styleId",t.INT_COPY),r}processCustomFilter(t,e){const s={};return t.copyFromAttribute(e,"operator",s,"operator",t.BOOLEAN_COPY),t.copyFromAttribute(e,"val",s,"val"),s}processCustomFilters(t,s){const r={type:e.Type.Custom};t.copyFromAttribute(s,"and",r,"and",t.BOOLEAN_COPY);const o=s.childNodes;r.filters=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1!==s.nodeType)continue;let i=null;"customFilter"===s.localName&&(i=this.processCustomFilter(t,s)),i&&r.filters.push(i)}return r}processDynamicFilter(t,s){const r={type:e.Type.Dynamic};return t.copyFromAttribute(s,"type",r,"dynamicType"),t.copyFromAttribute(s,"val",r,"val",t.INT_COPY),t.copyFromAttribute(s,"maxVal",r,"maxVal",t.INT_COPY),r}processDateGroupItem(t,e){const s={};return t.copyFromAttribute(e,"dateTimeGrouping",s,"group"),t.copyFromAttribute(e,"day",s,"day",t.INT_COPY),t.copyFromAttribute(e,"hour",s,"hour",t.INT_COPY),t.copyFromAttribute(e,"minute",s,"minute",t.INT_COPY),t.copyFromAttribute(e,"month",s,"month",t.INT_COPY),t.copyFromAttribute(e,"second",s,"second",t.INT_COPY),t.copyFromAttribute(e,"year",s,"year",t.INT_COPY),s}processFilterItem(t,e){if(e.hasAttribute("val"))return e.getAttribute("val")}processFilters(t,s){const r={type:e.Type.Items};t.copyFromAttribute(s,"blank",r,"blank",t.BOOLEAN_COPY),t.copyFromAttribute(s,"calendarType",r,"calendarType");let o=[],i=[];const n=s.childNodes;for(let e=0;e<n.length;e++){const s=n.item(e);if(1===s.nodeType)if("dateGroupItem"===s.localName){const e=this.processDateGroupItem(t,s);e&&o.push(e)}else if("filter"===s.localName){const e=this.processFilterItem(t,s);void 0!==e&&i.push(e)}}return o.length>0&&(r.dateGroups=o),i.length>0&&(r.items=i),r}processIcon(t,s){const r={type:e.Type.Icon};return t.copyFromAttribute(s,"iconId",r,"iconId",t.INT_COPY),t.copyFromAttribute(s,"iconSet",r),r}processTop10(t,s){const r={type:e.Type.Top10};return t.copyFromAttribute(s,"filterVal",r,"filterVal",t.FLOAT_COPY),t.copyFromAttribute(s,"percent",r,"percent",t.BOOLEAN_COPY),t.copyFromAttribute(s,"top",r,"top",t.BOOLEAN_COPY),t.copyFromAttribute(s,"val",r,"val",t.FLOAT_COPY),r}processFilterCriteria(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1!==s.nodeType)continue;let i=null;"colorFilter"===s.localName?i=this.processColorFilter(t,s):"customFilters"===s.localName?i=this.processCustomFilters(t,s):"dynamicFilter"===s.localName?i=this.processDynamicFilter(t,s):"filters"===s.localName?i=this.processFilters(t,s):"iconFilter"===s.localName?i=this.processIcon(t,s):"top10"===s.localName&&(i=this.processTop10(t,s)),i&&o.push(i)}return o.length>0&&(s.criteria=o),o}processFilterColumn(t,e){if(!e)return null;const s={};if(!e.hasAttribute("colId"))return;s.offset=parseInt(e.getAttribute("colId"));let r=!1;return e.hasAttribute("hiddenButton")&&(r=p(e.getAttribute("hiddenButton"))),r&&(s.hiddenButton=!0),e.hasAttribute("showButton")&&(s.showButton=p(e.getAttribute("showButton"))),this.processFilterCriteria(t,e,s),s}processFilterColumns(t,e,s){if(!e)return;const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);if(1===s.nodeType&&"filterColumn"===s.localName){const e=this.processFilterColumn(t,s);e&&o.push(e)}}return o.length>0&&(s.fields=o),o}}class st{visit(t,e,i){if(!e)return;const n={};if(t.copyFromAttribute(e,"ref",n),e.hasAttribute("caseSensitive")){const t=p(e.getAttribute("caseSensitive"));n.collatorOptions=t?s.CaseSensitiveOptions:s.CaseInsensitiveOptions}const l=e.getAttribute("sortMethod");null!=l&&"none"!==l&&("stroke"===l?n.collatorOptions={...n.collatorOptions,collation:"stroke"}:"pinYin"===l&&(n.collatorOptions={...n.collatorOptions,collation:"pinyin"})),e.hasAttribute("columnSort")&&p(e.getAttribute("columnSort"))&&(n.orientation=r.Orientation.Column);const a=o.fastStringToRange(n.ref);return this.processSortConditions(t,e,n,a),Object.keys(n).length>0&&(i.sort=n),n}processSortCondition(t,e,s){if(!e)return null;const r={};if(e.hasAttribute("ref")){if(e.hasAttribute("ref")){const t=e.getAttribute("ref"),i=o.fastStringToRange(t);r.offset=s?i.colStart-s.colStart:i.colStart}return r.reverse=!1,e.hasAttribute("descending")&&(r.reverse=p(e.getAttribute("descending"))),t.copyFromAttribute(e,"sortBy",r,"sortOn"),t.copyFromAttribute(e,"dxfId",r),t.copyFromAttribute(e,"iconSet",r),t.copyFromAttribute(e,"customList",r),r}console.warn("no ref for sort conditional",t.getPath())}processSortConditions(t,e,s,r){if(!e)return;const o=e.childNodes,i=[];for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"sortCondition"===s.localName){const e=this.processSortCondition(t,s,r);e&&i.push(e)}}return i.length>0&&(s.fields=i),i}}class rt{visit(t,e,s){}processDataBarColor(t,e,s,r,o="dk1"){if(!e)return;const i=f(t=>e.getAttribute(t),o);return i&&(s[r]=i),s}processFonts(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);if(1===i.nodeType&&"font"===i.localName){const e={};this.processFont(t,i,e),s[o++]=e}}return s}processFont(e,s,r){e.getValAttrAsBoolean("b",s,!0)&&(r.weight=700),e.getValAttrAsBoolean("i",s,!0)&&(r.style=t.Style.Italic),e.getValAttrAsBoolean("strike",s,!0)&&(r.strike=!0);const o=e.evaluate("u",s);if(o){const e=o.getAttribute("val");r.underline=e||t.UnderlineStyle.Single}T(e,s,r,"vertAlign","verticalAlign"),"superscript"===r.verticalAlign?r.verticalAlign=t.VerticalAlignment.Super:"subscript"===r.verticalAlign&&(r.verticalAlign=t.VerticalAlignment.Sub),x(e,s,r,"sz","size");const i=e.evaluate("color",s);this.processDataBarColor(e,i,r,"fill"),r.fill||(r.fill="dk1"),T(e,s,r,"name","family"),T(e,s,r,"rFont","family");const n=e.evaluate("family",s);if(n){const t=n.getAttribute("val");if(t)switch(t){case"1":r.fallbacks=["serif"];break;case"2":r.fallbacks=["sans-serif"];break;case"3":r.fallbacks=["monospace"];break;case"4":r.fallbacks=["cursive"];break;case"5":r.fallbacks=["fantasy"]}}return T(e,s,r,"scheme","scheme"),V(e,s,r,"shadow","shadow",!0),V(e,s,r,"outline","outline",!0),e.getValAttrAsBoolean("condense",s,!0)&&(r.letterSpacing=-1),e.getValAttrAsBoolean("extend",s,!0)&&(r.letterSpacing=1),T(e,s,r,"charset","charset"),r}processFills(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let e=0;e<r.length;e++){const i=r.item(e);1===i.nodeType&&"fill"===i.localName&&this.processFill(t,i,s,o++)}return s}processFill(t,e,s,r){const o={type:i.Type.None},n=e.childNodes;let l=!1;for(let e=0;!l&&e<n.length;e++){const s=n.item(e);1===s.nodeType&&("gradientFill"===s.localName?(this.processGradientFill(t,s,o),l=!0):"patternFill"===s.localName&&(this.processPatternFill(t,s,o),l=!0))}return s[r]=o,s}processGradientFill(t,e,s){if(!e)return;s.type=i.Type.Gradient;const r=[];s.stops=r,s.angle=90+(e.hasAttribute("degree")?parseFloat(e.getAttribute("degree")):0);const o=e.getAttribute("type");o&&(s.gradientType=o);const n=t=>{if(!t)return 0;const e=parseFloat(t);return isNaN(e)?0:e};(e.hasAttribute("left")||e.hasAttribute("top")||e.hasAttribute("right")||e.hasAttribute("bottom"))&&(s.fillTo={left:n(e.getAttribute("left")),top:n(e.getAttribute("top")),right:n(e.getAttribute("right")),bottom:n(e.getAttribute("bottom"))});const l=e.childNodes;for(let e=0;e<l.length;e++){const s=l.item(e);if(1===s.nodeType&&"stop"===s.localName){const e={};r.push(e);const o=parseFloat(s.getAttribute("position"));e.offset=o;const i=t.evaluate("color",s);this.processDataBarColor(t,i,e,"color")}}return s}processPatternFill(t,e,s){if(!e)return;const r=t.getVisitorParamsState().get("processingDXFs"),o=e.getAttribute("patternType")||(r?i.BuiltInSheetPattern.Solid:i.BuiltInSheetPattern.None);if(o===i.BuiltInSheetPattern.None)return{none:!0};s.type=i.Type.Pattern,o&&(s.patternType=o);let n,l="foreground",a="background";const c=s.patternType===i.BuiltInSheetPattern.Solid&&r;if(c){n="lt1";const t=l;l=a,a=t}const u=t.evaluate("fgColor",e);this.processDataBarColor(t,u,s,l,n);const h=t.evaluate("bgColor",e);return this.processDataBarColor(t,h,s,a,n),c&&!s.foreground&&(s.foreground=n),s}processBorders(t,e,s,r){if(!e)return;const o=e.childNodes;let i=0;for(let e=0;e<o.length;e++){const n=o.item(e);1===n.nodeType&&"border"===n.localName&&this.processBorder(t,n,s,i++,r)}return s}processBorder(t,e,s,r,o){if(!e)return;const i={};return this.processBorderStroke(t,e,i,u.Edge.Left),this.processBorderStroke(t,e,i,u.Edge.Right),o?(i.right||i.left)&&(i.right?i.vertical={...i.right}:i.vertical={...i.left}):this.processBorderStroke(t,e,i,u.Edge.Vertical),this.processBorderStroke(t,e,i,u.Edge.Top),this.processBorderStroke(t,e,i,u.Edge.Bottom),o?(i.bottom||i.top)&&(i.right?i.horizontal={...i.bottom}:i.horizontal={...i.top}):this.processBorderStroke(t,e,i,u.Edge.Horizontal),s[r]=i,s}processBorderStroke(t,e,s,r){if(!e)return;const o=t.evaluate(r,e);if(!o)return;const i={};o.hasAttribute("style")&&(i.style=o.getAttribute("style"));const n=t.evaluate("color",o);return n&&this.processDataBarColor(t,n,i,"color"),Object.keys(i).length>0?s[r]=i:null}}class ot extends rt{visit(t,e,s){this.processNumFmts(t,t.evaluate("numFmts",e),null),t.getVisitorParamsState().set("colorsToProcess",new Set);const r={fills:{},fonts:{},borders:{}};this.processFonts(t,t.evaluate("fonts",e),r.fonts),this.processFills(t,t.evaluate("fills",e),r.fills),this.processBorders(t,t.evaluate("borders",e),r.borders,!0),r.fills[0]={type:i.Type.None},r.fills[1]={type:i.Type.Pattern,patternType:i.BuiltInSheetPattern.Gray125},r.borders[0]={};const o=[];this.processXFs(t,t.evaluate("cellStyleXfs",e),o,r,null,!1);const n=new Map;if(o.length>0){const r=[];this.processCellStyles(t,t.evaluate("cellStyles",e),r,o,n),s.named=r}const l=[];this.processXFs(t,t.evaluate("cellXfs",e),l,r,n),Object.keys(l).length>0&&(s.direct=l);const a=[];return this.processDXFs(t,t.evaluate("dxfs",e),a),this.processTableStyles(t,t.evaluate("tableStyles",e),s,a),this.processIndexColors(t,t.evaluate("colors/indexedColors",e),s),this.processMruColors(t,t.evaluate("colors/mruColors",e),s),s}processIndexColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"rgbColor"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}s.indexedColors=r}processMruColors(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"color"===s.localName){const e={color:null};this.processDataBarColor(t,s,e,"color"),e.color&&r.push(e.color)}}r.length>0&&(s.mruColors=r)}processNumFmts(t,e,s){if(!e)return;const r=new Map;if(t.getVisitorParamsState().set("numFmts",r),!e)return;const o=e.childNodes;for(let t=0;t<o.length;t++){const e=o.item(t);if(1===e.nodeType&&"numFmt"===e.localName){const t=e.getAttribute("numFmtId"),s=e.getAttribute("formatCode");if(t&&s){const e=s.replace(/\\(.)/g,"$1");r.set(parseInt(t),e)}}}}processXFs(t,e,s,r,o=null,i=!0){if(!e)return;const n=e.childNodes;for(let e=0;e<n.length;e++){const l=n.item(e);if(1===l.nodeType&&"xf"===l.localName){const e={};this.processXF(t,l,e,r,o,i),s.push(e)}}}processXF(t,e,s,r,o,i){if(!e)return;const l=e.getAttribute("xfId");if(l&&o){const t=o.get(parseInt(l));t&&t!==n.BuiltInName.Normal&&(s.named=t)}const a=t=>!(!i&&e.hasAttribute(t))||p(e.getAttribute("applyFont"));if(a("applyFont")){const t=r.fonts[e.getAttribute("fontId")];t&&(s.font=t)}if(a("applyFill")){const t=r.fills[e.getAttribute("fillId")];t&&Object.keys(t).length>0&&(s.fill=t)}if(a("applyBorder")){const t=r.borders[e.getAttribute("borderId")];t&&Object.keys(t).length>0&&(s.border=t)}if(a("applyNumberFormat")){const r=e.getAttribute("numFmtId");if(r){const e=parseInt(r);let o;const i=t.getVisitorParamsState();if(i){const t=i.get("numFmts");t&&(o=t.get(e)),s.numberFormat=o??e}else console.warn("no visitor params state")}}a("applyAlignment")&&this.processAlignment(t,t.evaluate("alignment",e),s),a("applyProtection")&&this.processProtection(t,t.evaluate("protection",e),s);const c=p(e.getAttribute("quotePrefix"));c&&(s.quotePrefix=c)}processAlignment(t,e,s){const r={};if(e?.hasAttribute("horizontal")?r.horizontal=e.getAttribute("horizontal"):r.horizontal=l.HorizontalAlignment.General,e?.hasAttribute("vertical")?r.vertical=e.getAttribute("vertical"):r.vertical=l.VerticalAlignment.Bottom,e?.hasAttribute("indent")?r.indent=parseInt(e.getAttribute("indent")):r.indent=0,e?.hasAttribute("relativeIndent")?r.relativeIndent=parseInt(e.getAttribute("relativeIndent")):r.relativeIndent=0,p(e?.getAttribute("wrapText"))?r.overflow=l.Overflow.Wrap:r.overflow=l.Overflow.Visible,p(e?.getAttribute("shrinkToFit"))&&(r.overflow=l.Overflow.Shrink),e?.hasAttribute("textRotation")){let t=parseFloat(e.getAttribute("textRotation"));t>0&&t<=90?t=360-t:t>90&&t<=180?t-=90:255===t&&(t=0,r.stacked=!0),r.rotation=t}else r.rotation=0;e?.hasAttribute("justifyLastLine")&&(r.justifyLastLine=p(e.getAttribute("justifyLastLine")));const o=e?.getAttribute("readingOrder");return o&&("0"===o?r.readingDirection=l.ReadingDirection.Auto:"1"===o?r.readingDirection=l.ReadingDirection.LeftToRight:"2"===o?r.readingDirection=l.ReadingDirection.RightToLeft:console.warn(`invalid readingOrder: ${o}`)),Object.keys(r).length>0&&(s.alignment=r),s}processProtection(t,e,s){if(!e)return;const r={},o=e.getAttribute("locked");o&&!p(o)&&(r.edit=!0);const i=e.getAttribute("hidden");return i&&p(i)&&(r.formulaHidden=!0),Object.keys(r).length>0&&(s.protection=r),s}processDXF(t,e,s){if(!e)return;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"font"===o.localName){const e={};this.processFont(t,o,e),s.font=e}else if(1===o.nodeType&&"fill"===o.localName){const e=[];this.processFill(t,o,e,0),e.length>0&&e[0]&&(s.fill=e[0])}else if(1===o.nodeType&&"border"===o.localName){const e=[];this.processBorder(t,o,e,0,!1),e.length>0&&e[0]&&(s.border=e[0])}}}processDXFs(t,e,s){if(!e)return;t.getVisitorParamsState().set("processingDXFs",!0);const r=new Map;t.getVisitorParamsState().set("dxfs",r);const o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);if(1===i.nodeType&&"dxf"===i.localName){const e={};this.processDXF(t,i,e);const o=s.length;r.set(o,e),s.push(e)}}t.getVisitorParamsState().delete("processingDXFs")}processTableStyle(t,e,s,r,o=!1){const i=e.getAttribute("name"),n={name:i};e.hasAttribute("table")&&(n.table=p(e.getAttribute("table"))),e.hasAttribute("pivot")&&(n.pivot=p(e.getAttribute("pivot"))),o&&!n.pivot&&r.unshift(null);const l=e.childNodes;for(let t=0;t<l.length;t++){const e=l.item(t);if(1===e.nodeType&&"tableStyleElement"===e.localName){const t=e.getAttribute("type"),s=e.getAttribute("dxfId");let o=r?.[s];o||(console.warn("invalid dfx id",s),o={}),n[t]=o;let i=null;e.hasAttribute("size")&&(i=parseInt(e.getAttribute("size"))),i&&!isNaN(i)&&(o.size=i)}}delete n.name,s[i]=n}processTableStyles(t,e,s,r,o){if(!e)return;const i={},n=e.getAttribute("defaultTableStyle");n&&(i.defaultTableStyle=n);const l=e.getAttribute("defaultPivotStyle");l&&(i.defaultPivotStyle=l);const a=e.childNodes,c={};for(let e=0;e<a.length;e++){const s=a.item(e);1===s.nodeType&&"tableStyle"===s.localName&&this.processTableStyle(t,s,c,r,o)}return Object.keys(c).length>0&&(i.styles=c),Object.keys(i).length>0&&(s.tables=i),s}processCellStyles(t,e,s,r,o){if(!e)return;const i=e.childNodes;for(let t=0;t<i.length;t++){const e=i.item(t);if(1===e.nodeType&&"cellStyle"===e.localName){const t=parseInt(e.getAttribute("xfId")),i=e.getAttribute("name");if(o.set(t,i),!r[t])continue;const n={name:i,style:r[t]};e.getAttribute("hidden")&&(n.hidden=p(e.getAttribute("hidden"))),e.getAttribute("iLevel")&&(n.iLevel=parseInt(e.getAttribute("iLevel"))),s.push(n)}}}afterVisit(t,e,s){}}class it extends rt{visit(t,e,s){return this.processSheetRefs(t,t.evaluate("sheets",e),s),this.processBookViews(t,t.evaluate("bookViews",e),s),this.processDefinedNames(t,t.evaluate("definedNames",e),s),this.processCalcPr(t,t.evaluate("calcPr",e),s),this.processWorkbookProtection(t,t.evaluate("workbookProtection",e),s),this.processWorkbookPr(t,t.evaluate("workbookPr",e),s),s}processPassword(t,e,s,r="password"){if(!e)return;const o={};t.copyFromAttribute(e,"algorithmName",o,"algorithmName"),t.copyFromAttribute(e,"hashValue",o,"hashValue"),t.copyFromAttribute(e,"saltValue",o,"saltValue",t.BOOLEAN_COPY),t.copyFromAttribute(e,"spinCount",o,"spinCount",t.INT_COPY),Object.keys(o).length>0&&(s[r]=o)}processWorkbookProtection(t,e,s){if(!e)return;const r={};this.processPassword(t,t.evaluate("workbookPassword",e),r),this.processPassword(t,t.evaluate("revisionsPassword",e),r,"revisionsPassword");const o=t=>!0!==t&&"1"!==t&&"on"!==t&&"true"!==t&&(!1===t||"0"===t||"off"===t||"false"===t||null);return t.copyFromAttribute(e,"lockStructure",r,"structure",o),t.copyFromAttribute(e,"lockWindows",r,"windows",o),t.copyFromAttribute(e,"lockRevision",r,"revision",o),s.protection=r,s}processCalcPr(t,e,s){e&&(s.calc={})}processSheetRefs(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);1===s.nodeType&&"sheet"===s.localName&&this.processSheetRef(t,s,r)}s.sheets=r}processSheetRef(t,e,s){const r={};t.copyFromAttribute(e,"name",r,"name"),t.copyFromAttribute(e,"state",r,"visibility");const o=e.getAttribute("r:id"),i=t.getRef(o);i&&(r.sheet=i),s.push(r)}processBookViews(t,e,s){if(!e)return;const r=e.childNodes;let o=0;for(let i=0;o<1&&i<e.childNodes.length;i++){const e=r.item(i);1===e.nodeType&&"workbookView"===e.localName&&(this.processWorkbookView(t,e,s),o++)}}processWorkbookView(t,e,s){if(!e)return;const r={};t.copyFromAttribute(e,"activeTab",r,"activeSheetId",[t.INT_COPY,t=>t+1]),e.hasAttribute("activeTab")||(r.activeSheetId=1),t.copyFromAttribute(e,"showHorizontalScroll",r,"showHorizontalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showVerticalScroll",r,"showVerticalScrollbar",t.BOOLEAN_COPY),t.copyFromAttribute(e,"showSheetTabs",r,"showTabs",t.BOOLEAN_COPY),t.copyFromAttribute(e,"tabRatio",r,"tabRatio",[t.FLOAT_COPY,t=>t]),Object.keys(r).length>0&&(s.view=r)}processDefineName(t,e,s,r){if(!e)return;const o={},i=e.firstChild;if(i&&3===i.nodeType&&(o.ref=i.textContent),t.copyFromAttribute(e,"name",o),t.copyFromAttribute(e,"comment",o),t.copyFromAttribute(e,"hidden",o,"hidden",t.BOOLEAN_COPY),e.hasAttribute("localSheetId")){const t=e.getAttribute("localSheetId");if(!r[t]?.name)return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${t}' which does not exist.`);o.scope=r[t].name}t.copyFromAttribute(e,"customMenu",o),t.copyFromAttribute(e,"description",o),t.copyFromAttribute(e,"statusBar",o),t.copyFromAttribute(e,"help",o),t.copyFromAttribute(e,"shortcutKey",o),t.copyFromAttribute(e,"function",o,"function",t.BOOLEAN_COPY),t.copyFromAttribute(e,"functionGroupId",o,"functionGroupId",t.INT_COPY),t.copyFromAttribute(e,"publishToServer",o,"publishToServer",t.BOOLEAN_COPY),t.copyFromAttribute(e,"vbProcedure",o,"vbProcedure",t.BOOLEAN_COPY),t.copyFromAttribute(e,"xlm",o,"xlm",t.BOOLEAN_COPY),Object.keys(o).length>0&&s.push(o)}processDefinedNames(t,e,s){if(!e)return;const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const i=o.item(e);1===i.nodeType&&"definedName"===i.localName&&this.processDefineName(t,i,r,s.sheets)}r.length>0&&(s.names=r)}processWorkbookPr(t,e,s){e&&t.copyFromAttribute(e,"date1904",s,"date1904",t.BOOLEAN_COPY)}afterVisit(t,e,s){}}class nt{visit(t,e,s){return t.copyFromAttribute(e,"name",s),t.copyFromAttribute(e,"displayName",s),t.copyFromAttribute(e,"ref",s),t.copyFromAttribute(e,"headerRowCount",s,"headerRowCount",t.INT_COPY),t.copyFromAttribute(e,"totalsRowCount",s,"totalsRowCount",t.INT_COPY),this.processTableColumns(t,e,s),this.processTableStyleInfo(t,e,s),s}processTableStyleInfo(t,e,s){if(!e)return;const r=e.childNodes,o={};for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableStyleInfo"===s.localName&&(t.copyFromAttribute(s,"name",o),t.copyFromAttribute(s,"showColumnStripes",o,"showColumnStripes",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showFirstColumn",o,"showFirstColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showLastColumn",o,"showLastColumn",t.BOOLEAN_COPY),t.copyFromAttribute(s,"showRowStripes",o,"showRowStripes",t.BOOLEAN_COPY))}Object.keys(o).length>0&&(s.styleOptions=o)}processTableColumn(t,e,s){if(!e)return null;const r=e.childNodes;for(let e=0;e<r.length;e++){const o=r.item(e);if(1===o.nodeType&&"tableColumn"===o.localName){const e={};t.copyFromAttribute(o,"name",e),t.copyFromAttribute(o,"uniqueName",e),s.push(e)}}return s}processTableColumns(t,e,s){const r=e.childNodes,o=[];for(let e=0;e<r.length;e++){const s=r.item(e);1===s.nodeType&&"tableColumns"===s.localName&&this.processTableColumn(t,s,o)}o.length>0&&(s.columns=o)}}class lt{visit(t,e,s){return s}}class at{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"editAs",r,"anchorType"),r.anchor={},this.processOffsetCoord(t,t.evaluate("from",e),r.anchor,"from"),this.processOffsetCoord(t,t.evaluate("to",e),r.anchor,"to"),s.movables||(s.movables=[]),s.movables.push(r),r}processOffsetCoord(t,e,s,r){if(!e)return;const o={c:0,r:0,x:0,y:0};return t.evaluate("col",e)&&(o.c=parseInt(t.evaluate("col",e).textContent)),t.evaluate("row",e)&&(o.r=parseInt(t.evaluate("row",e).textContent)),t.evaluate("colOff",e)&&(o.x=h(t.evaluate("colOff",e).textContent)),t.evaluate("rowOff",e)&&(o.y=h(t.evaluate("rowOff",e).textContent)),"from"===r?s.tl=o:s.br=o,s}}class ct{visit(t,e,s){if(!e)return;const r=t.evaluate("*/cNvPr",e);return r&&(t.copyFromAttribute(r,"name",s),t.copyFromAttribute(r,"desc",s),t.copyFromAttribute(r,"hidden",s,"hidden",t.BOOLEAN_COPY),t.copyFromAttribute(r,"id",s)),s}}class ut extends ct{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGraphicFramePr/cNvGraphicFramePr",e);if(r){const e=t.evaluate("graphicFrameLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}let o={type:"graphicFrame",json:{}};const i=t.evaluate("graphic/graphicData",e).childNodes;for(let e=0;e<i.length;e++){const s=i.item(e);if(1===s.nodeType)try{let e=s.localName;"chart"===e&&(e="chart"),o.type=e;const r=s.getAttribute("r:id");r&&(o.json=t.getRef(r))}catch(t){console.warn("Unable to parse graphicFrame",t)}}return o&&(s.content=o),o}}class ht extends ct{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvSpPr/cNvSpPr",e);if(r){const e=t.evaluate("spLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', shapes are not supported.`);const o={};return s.content={type:"sp",json:o},o}}class pt extends ct{visit(t,e,s){if(!e)return;const r=super.visit(t,e,s),o=t.evaluate("nvPicPr/cNvPicPr",e);if(o){t.copyFromAttribute(e,"preferRelativeResize",r,"preferRelativeResize",t.BOOLEAN_COPY);const s=t.evaluate("picLocks",o);if(s){s.hasAttribute("noChangeAspect")&&(r.lockAspect="1"===s.getAttribute("noChangeAspect"));const e={};t.copyFromAttribute(s,"noChangeArrowheads",r,"noChangeArrowheads",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noChangeShapeType",r,"noChangeShapeType",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noEditPoints",r,"noEditPoints",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noAdjustHandles",r,"noAdjustHandles",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noCrop",r,"noCrop",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noGrp",r,"noGrp",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noMove",r,"noMove",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noResize",r,"noResize",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noRot",r,"noRot",t.BOOLEAN_COPY),t.copyFromAttribute(s,"noSelect",r,"noSelect",t.BOOLEAN_COPY),Object.keys(e).length>0&&(r.locks=e)}}const i=t.evaluate("blipFill/blip",e);let n;if(i){const e=i.getAttribute("r:embed")??i.getAttribute("embed");if(!e)return void console.warn("no rId found for blip",i);n=t.getRef(e,!0)}const l={resId:n};return s.content={type:"picture",json:l},r}}class gt extends ht{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvGrpSpPr/cNvGrpSpPr",e);if(r){const e=t.evaluate("grpSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', group shapes are not supported.`);const o={};return s.content={type:"grpSp",json:o},o}}class dt extends ht{visit(t,e,s){if(!e)return;s=super.visit(t,e,s);const r=t.evaluate("nvCxnSpPr/cNvCxnSpPr",e);if(r){const e=t.evaluate("cxnSpLocks",r);if(e){e.hasAttribute("noChangeAspect")&&(s.lockAspect="1"===e.getAttribute("noChangeAspect"));const t={};Object.keys(t).length>0&&(s.locks=t)}}t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);const o={};return s.content={type:"cxnSp",json:o},o}}const mt="richTypes";class bt{visit(t,e,s){let r=t.getVisitorParamsState().get(mt);r||(r=[],t.getVisitorParamsState().set(mt,r));const o=e.childNodes,i=o.length;for(let e=0;e<i;e++){const s=o.item(e);if(1===s.nodeType&&"s"===s.localName){const e={type:s.getAttribute("t")??"n",keys:[]};this.processKeys(t,s,e),r.push(e)}}return s.richTypes=r,r}processKeys(t,e,s){const r=e.childNodes,o=r.length,i=s.keys;for(let t=0;t<o;t++){const e=r.item(t);if(1===e.nodeType&&"k"===e.localName){const t=e.getAttribute("n"),s=e.getAttribute("t");i.push([t,s])}}}}const ft="richData";class At{visit(t,e,s){let r=t.getVisitorParamsState().get("richTypes");if(!r)return void t.warn("RichValueFound but not type.");let o=t.getVisitorParamsState().get(ft);o||(o=[],t.getVisitorParamsState().set(ft,o));const i=e.childNodes,n=i.length;for(let e=0;e<n;e++){const s=i.item(e);if(1===s.nodeType&&"rv"===s.localName){const e=r[s.getAttribute("s")],i={type:e.type};this.processValues(t,s,i,e);const n=this.mapType(t,i);o.push(n)}}return s.richData=o,o}mapType(t,e){if("_error"===e.type){const s=e.errorType;if(s)try{e=a.getBuiltInById(s+1)}catch(t){}}return e}processValues(t,e,s,r){const o=e.childNodes,i=o.length;r.type;const n=r.keys;for(let e=0;e<i;e++){const r=o.item(e);if(1===r.nodeType&&"v"===r.localName){const o=n[e];if(!o)return void t.warn("Invalid richData");const i=o[0],l=o[1];let a=r.textContent;"i"===l&&(a=Number(a)),s[i]=a}}}}class yt{visit(t,e,s){if(!e)return;const r=[];return this.processAuthors(t,t.evaluate("authors",e),r),r.length>0&&(s.authors=r),s.comments=[],s}processAuthors(t,e,s){if(!e)return;const r=e.childNodes;for(let t=0;t<r.length;t++){const e=r.item(t);if(1===e.nodeType&&"author"===e.localName){const t=e.firstChild;t&&3===t.nodeType&&s.push(t.textContent)}}}}class vt{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"authorId",r,"authorId",t.INT_COPY),r.asNote=!0,s.comments||(s.comments=[]),s.comments.push(r),r}}class Ft{visit(t,e,s){if(!e)return;const r=[];return s.comments=r,r}}class Ct{visit(t,e,s){if(!e)return;const r={};return t.copyFromAttribute(e,"id",r,"id",g),t.copyFromAttribute(e,"personId",r,"personId",g),t.copyFromAttribute(e,"ref",r),t.copyFromAttribute(e,"parentId",r,"parentId",g),t.copyFromAttribute(e,"dT",r),e.hasAttribute("done")&&(r.done=p(e.getAttribute("done"))),s.push(r),r}}class wt{visit(t,e,s){const r=[],o=e.childNodes;for(let e=0;e<o.length;e++){const s=o.item(e);if(1===s.nodeType&&"person"===s.localName){const e={};t.copyFromAttribute(s,"id",e,"id",g),t.copyFromAttribute(s,"displayName",e),t.copyFromAttribute(s,"userId",e,"userId",g),t.copyFromAttribute(s,"providerId",e),r.push(e)}}return r.length>0&&(s.persons=r),r}}const Pt={};class Nt{constructor(t,e){this.path=t,this.visitor=e}}class Ot{constructor(){this.visitorsByXmlTagName=new Map,this.scopedVisitorsByXmlTagName=new Map,this.visitorParamsState=null,this.registerVisitor("Relationships",new N),this.registerVisitor("spPr",new j),this.registerVisitor("txBody",new W),this.registerVisitor("txPr",new W),this.registerVisitor("c:chartSpace",new k),this.registerVisitor("c:chartSpace",new L,"chart"),this.registerVisitor("c:plotArea",new I),this.registerVisitor("c:barChart",new E),this.registerVisitor("c:doughnutChart",new R),this.registerVisitor("c:lineChart",new R),this.registerVisitor("c:ofPieType",new R),this.registerVisitor("c:pieChart",new R),this.registerVisitor("c:scatterChart",new R),this.registerVisitor("c:barChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:doughnutChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:lineChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ofPieType",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:pieChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:scatterChart",new Y("dataLabels"),"dLbls"),this.registerVisitor("c:ser",new M),this.registerVisitor("c:dPt",new U),this.registerVisitor("c:marker",new z),this.registerVisitor("c:catAx",new G),this.registerVisitor("c:valAx",new G),this.registerVisitor("c:dateAx",new G),this.registerVisitor("c:majorGridlines",new P("gridLinesMajor")),this.registerVisitor("c:minorGridlines",new P("gridLinesMinor")),this.registerVisitor("c:chartSpace",null,"txPr"),this.registerVisitor("c:catAx",new W("labels.text"),"txPr"),this.registerVisitor("c:valAx",new W("labels.text"),"txPr"),this.registerVisitor("c:dateAx",new W("labels.text"),"txPr"),this.registerVisitor("c:legend",new $),this.registerVisitor("c:legend",new W("labels.text"),"txPr"),this.registerVisitor("c:legendEntry",new X),this.registerVisitor("c:ser",new K,"extLst/ext/invertSolidFillFmt/spPr"),this.registerVisitor("c:ser",new Y("labels"),"dLbls"),this.registerVisitor("c:dLbl",new Y("points")),this.registerVisitor("c:title",new H),this.registerVisitor("c:title",null,"tx/rich"),this.registerVisitor("c:title",null,"txPr"),this.registerVisitor("c:layout",new J),this.registerVisitor("c:dispUnits",new P("dispUnits")),this.registerVisitor("c:dispUnitsLbl",new H("displayUnitsLabel")),this.registerVisitor("c:dispUnitsLbl",new W,"tx/rich"),this.registerVisitor("a:theme",new q),this.registerVisitor("a:theme",new Z,"themeElements/clrScheme"),this.registerVisitor("a:theme",new Q,"themeElements/fontScheme"),this.registerVisitor("autoFilter",new et),this.registerVisitor("sortState",new st),this.registerVisitor("s:workbook",new it),this.registerVisitor("styleSheet",new ot),this.registerVisitor("table",new nt),this.registerVisitor("hlinkClick",new tt),this.registerVisitor("wsDr",new lt),this.registerVisitor("twoCellAnchor",new at),this.registerVisitor("oneCellAnchor",new at),this.registerVisitor("absoluteAnchor",new at),this.registerVisitor("graphicFrame",new ut),this.registerVisitor("sp",new ht),this.registerVisitor("grpSp",new gt),this.registerVisitor("cxnSp",new dt),this.registerVisitor("pic",new pt),this.registerVisitor("rvStructures",new bt),this.registerVisitor("rvData",new At),this.registerVisitor("comments",new yt),this.registerVisitor("commentList",new vt,"comment"),this.registerVisitor("comment",new W("content"),"text"),this.registerVisitor("ThreadedComments",new Ft),this.registerVisitor("threadedComment",new Ct),this.registerVisitor("threadedComment",new W("content"),"text"),this.registerVisitor("personList",new wt)}registerVisitor(t,e,s=null){-1===t.indexOf(":")&&(t="*:"+t);const r=t.split(":"),o=r.length>1?r[1]:r[0];if(!s)return this.visitorsByXmlTagName.set(o,e),void this.visitorsByXmlTagName.set(t,e);let i=this.scopedVisitorsByXmlTagName.get(o);i||(i=[],this.scopedVisitorsByXmlTagName.set(o,i),this.scopedVisitorsByXmlTagName.set(t,i)),i.push(new Nt(s,e))}getVisitorParamsState(){return this.visitorParamsState}convert(t,e,s=Pt){const r=t.documentElement;this.visitorParamsState&&!s?.paramMap||(this.visitorParamsState=s?.paramMap??new Map);const o={};let i=this.visitorsByXmlTagName.get(r.nodeName);if(i||(i=this.visitorsByXmlTagName.get(r.localName)),!i)throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);const n="/"+r.localName,l=new w(null,this,n,r,o,e,s),a=[];this._doWalk(i,l,a,r,o,e,s);for(let e=0;e<a.length;e++){const s=a[e];try{s.visitor?.afterVisit?.(s.context,s.elemParent,s.jsonParent)}catch(t){console.warn(`Error in afterVisit: ${s.context.getPath()}`,t)}}return o}_walkScoped(t,e,s,r,o,i,n){const l=this.scopedVisitorsByXmlTagName.get(t);for(let a=0;l&&a<l.length;a++){const c=l[a];let u=null;try{u=e.evaluate(c.path,r)}catch(e){console.warn(`"Invalid path '${c.path}' for '${t}'.`)}if(!u)continue;const h=t=>{let l=t.localName,a=t.parentNode;for(;a&&a!==r;)l=a.localName+"/"+l,a=a.parentNode;const u=e.getPath()+"/"+l;if(c.visitor){const r=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c.visitor,r,s,t,o,i,n)}};if(u.length>0){const t=u;for(let e=0;e<t.length;e++)h(t.item(e))}else h(u)}}_doWalk(t,e,s,r,o,i,n){let l=null;t&&(s.push({visitor:t,context:e,elemParent:r,jsonParent:o}),l=t.visit(e,r,o)),l||(l=o);const a=r.localName;this._walkScoped(a,e,s,r,l,i,n);const c=r.childNodes;for(let t=0;t<c.length;t++){const r=c.item(t);if(1===r.nodeType){const t=r,a=t.localName,c=this.visitorsByXmlTagName.get(a),u=e.getPath()+"/"+a,h=new w(e,this,u,e.getElemRoot(),e.getJsonRoot(),i,n);this._doWalk(c,h,s,t,l??o,i,n)}}return l}}export{Ot as FromOOXMLConverter,Ot as default};
|