@sheetxl/studio-mui 0.1.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +24 -0
  3. package/build/browser/cjs/4XrhSt2xtUIXkiCt.cjs +1516 -0
  4. package/build/browser/cjs/B3EvhaQf456RMc1Q.cjs +6 -0
  5. package/build/browser/cjs/B3kl467PN2cpvrfz.cjs +12 -0
  6. package/build/browser/cjs/B5LCoenQbQmzic16.cjs +314 -0
  7. package/build/browser/cjs/BBuyHZwFlDRvHzBH.cjs +7 -0
  8. package/build/browser/cjs/BGoG_ROASNB2owBR.cjs +28 -0
  9. package/build/browser/cjs/BJ6Da8vZLjAl44pz.cjs +6 -0
  10. package/build/browser/cjs/BL_UVvG75SFsFaT3.cjs +6 -0
  11. package/build/browser/cjs/BNDoTytIOGtVh5l9.cjs +6 -0
  12. package/build/browser/cjs/BQOyVCuOdwDja_VV.cjs +42 -0
  13. package/build/browser/cjs/BRiPktKUmeJipjaa.cjs +6 -0
  14. package/build/browser/cjs/BabbNVs5iKg49rfk.cjs +6 -0
  15. package/build/browser/cjs/BcOX5vODdThWbKrR.cjs +6 -0
  16. package/build/browser/cjs/BchlMljYmXDs0Ol2.cjs +6 -0
  17. package/build/browser/cjs/BmYZvm13acvbFhOu.cjs +6 -0
  18. package/build/browser/cjs/BmbsW1n0-CkF3ITF.cjs +6 -0
  19. package/build/browser/cjs/BnCUyGP_ERKmL3ZR.cjs +6 -0
  20. package/build/browser/cjs/BtP4E1_yhMjpfbr5.cjs +6 -0
  21. package/build/browser/cjs/C3E9wmSfmgYmXfJN.cjs +205 -0
  22. package/build/browser/cjs/C3Hl78e9qfEHxJYc.cjs +6 -0
  23. package/build/browser/cjs/CEvRH8aOx3etutK_.cjs +17 -0
  24. package/build/browser/cjs/CLZSdaBnKDfb142R.cjs +6 -0
  25. package/build/browser/cjs/CN1cS39WcNrcPVqS.cjs +129 -0
  26. package/build/browser/cjs/CSH1hUnHovjo8Lb8.cjs +6 -0
  27. package/build/browser/cjs/CTNt3asYQRA-MROc.cjs +47 -0
  28. package/build/browser/cjs/C_JZEtvgcli6T7Wg.cjs +11 -0
  29. package/build/browser/cjs/CbaYZmvS8u-p_Z8Z.cjs +6 -0
  30. package/build/browser/cjs/Cc-4c3DRm96wq5rj.cjs +12 -0
  31. package/build/browser/cjs/CnY6DbatGmPyylfU.cjs +20 -0
  32. package/build/browser/cjs/CqkQGfzNax6GmZFo.cjs +6 -0
  33. package/build/browser/cjs/D2AF0a4vbNKzFxzA.cjs +21 -0
  34. package/build/browser/cjs/D4y1iYdx8sdwQ50T.cjs +6 -0
  35. package/build/browser/cjs/D5cF1EnyvnPY2IxS.cjs +150 -0
  36. package/build/browser/cjs/DA1-OPTYQTepGKEg.cjs +11 -0
  37. package/build/browser/cjs/DJDMVDpUqlEKYLjt.cjs +6 -0
  38. package/build/browser/cjs/DLXLJ8SNNjwM5C-P.cjs +6 -0
  39. package/build/browser/cjs/DV8lOsZBgyx7MTBW.cjs +6 -0
  40. package/build/browser/cjs/DZAPn_d9mpvfRzsb.cjs +6 -0
  41. package/build/browser/cjs/DaicqO_9d1hYzyB_.cjs +11 -0
  42. package/build/browser/cjs/Dfh6eMCbAjW14fdh.cjs +6 -0
  43. package/build/browser/cjs/DhI2lgDZL8GqBejN.cjs +6 -0
  44. package/build/browser/cjs/Ds6s8fpzOZsd2m1r.cjs +6 -0
  45. package/build/browser/cjs/DvIWGmDT5uBVQ5zH.cjs +16 -0
  46. package/build/browser/cjs/DvLgu20RiaayrJcW.cjs +7 -0
  47. package/build/browser/cjs/Dvhwt25gyHzxQLrp.cjs +6 -0
  48. package/build/browser/cjs/DvwApJM_CVrlpLxn.cjs +6 -0
  49. package/build/browser/cjs/DwVYzo4a05DMfta_.cjs +28 -0
  50. package/build/browser/cjs/NYdqUauA5i2q33UZ.cjs +6 -0
  51. package/build/browser/cjs/S2Xfq-KDgoT7ipPC.cjs +25 -0
  52. package/build/browser/cjs/TOZQZr9ZZ_Q-jdQZ.cjs +6 -0
  53. package/build/browser/cjs/bJuLOalXTwrshZL3.cjs +16 -0
  54. package/build/browser/cjs/eh9refYW4Gm25cmW.cjs +6 -0
  55. package/build/browser/cjs/hKqcVeb_8_4M79xj.cjs +6 -0
  56. package/build/browser/cjs/index.cjs +7 -0
  57. package/build/browser/cjs/is17hbP-kpOIBRP3.cjs +6 -0
  58. package/build/browser/cjs/pNY789kHWwRQXqse.cjs +17 -0
  59. package/build/browser/cjs/qJcc3ALtLWml32LU.cjs +18 -0
  60. package/build/browser/cjs/vWgVoELLfZ2ff1xL.cjs +6 -0
  61. package/build/browser/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
  62. package/build/browser/esm/7Imk0owJj7oNHR7v.mjs +48 -0
  63. package/build/browser/esm/AuNwPf0DXe0twn35.mjs +1592 -0
  64. package/build/browser/esm/B1Kw9U_AxCk0Aq9f.mjs +59 -0
  65. package/build/browser/esm/B9l1_Tfw_tMhKCNB.mjs +437 -0
  66. package/build/browser/esm/B9winT3ff8rc4sbn.mjs +490 -0
  67. package/build/browser/esm/BEo9XX1sHmVjScSm.mjs +16 -0
  68. package/build/browser/esm/BGTcOBCyrTTlov_i.mjs +13399 -0
  69. package/build/browser/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
  70. package/build/browser/esm/BQSa7N7QMGysdZdU.mjs +3932 -0
  71. package/build/browser/esm/BVEuc_3fLG2GN34k.mjs +16 -0
  72. package/build/browser/esm/BVh9YUwiSov8wcyY.mjs +1708 -0
  73. package/build/browser/esm/BZt5yM_TvoPXqdeA.mjs +3867 -0
  74. package/build/browser/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
  75. package/build/browser/esm/BjUaiSvRZnas-HJW.mjs +16 -0
  76. package/build/browser/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
  77. package/build/browser/esm/BtMqJ5CRpKuAC4UQ.mjs +1486 -0
  78. package/build/browser/esm/BwvMR2cgGwFn8hAL.mjs +36 -0
  79. package/build/browser/esm/BxU3eVA-Adrnq7ZJ.mjs +1372 -0
  80. package/build/browser/esm/C00coampLNiXjWJJ.mjs +436 -0
  81. package/build/browser/esm/C6nh1rvYnAg2w2V2.mjs +838 -0
  82. package/build/browser/esm/C8gc149K34Zi2lP2.mjs +16 -0
  83. package/build/browser/esm/CGSkuCZY1EmTUNlQ.mjs +52 -0
  84. package/build/browser/esm/CKXzosgZX8Xe3l59.mjs +16 -0
  85. package/build/browser/esm/CNYANG0Z7mhGYo00.mjs +859 -0
  86. package/build/browser/esm/CV_FNw2i_aEc5nwA.mjs +16 -0
  87. package/build/browser/esm/CYSj0-zys2FKWgnb.mjs +18 -0
  88. package/build/browser/esm/CbTs5cvVaP1vPCYD.mjs +2248 -0
  89. package/build/browser/esm/CfAob8gGydmX1xQu.mjs +16 -0
  90. package/build/browser/esm/ChGigf2OPu7d44Km.mjs +16 -0
  91. package/build/browser/esm/CnzGN0S6zOfL_3SS.mjs +1358 -0
  92. package/build/browser/esm/CpyeUtXgDmrcMESB.mjs +52 -0
  93. package/build/browser/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
  94. package/build/browser/esm/CtrrmHx9YbrOithw.mjs +152 -0
  95. package/build/browser/esm/CzAM0pDdZ7sjGgn9.mjs +86 -0
  96. package/build/browser/esm/D0oVDcgRUMZ9MHzu.mjs +41 -0
  97. package/build/browser/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
  98. package/build/browser/esm/D78-3ghInxscHLVq.mjs +23 -0
  99. package/build/browser/esm/DEpR6b4DMs-va6RS.mjs +43734 -0
  100. package/build/browser/esm/DEsqE49cIQZ8AqCe.mjs +398 -0
  101. package/build/browser/esm/DGe70xvBhc62ZVZz.mjs +2410 -0
  102. package/build/browser/esm/DXapJ5_yR4E8vDaK.mjs +1685 -0
  103. package/build/browser/esm/DjAZeDxBIBZsRTm3.mjs +24 -0
  104. package/build/browser/esm/DttdPwwDTcRX4uwL.mjs +44 -0
  105. package/build/browser/esm/FXcO0MVElhw9cc3v.mjs +49 -0
  106. package/build/browser/esm/GpycqJcrwTRtjEqA.mjs +16 -0
  107. package/build/browser/esm/HCE-tMxyVd0m-PgN.mjs +16 -0
  108. package/build/browser/esm/OCdyQRicV8KxUwMt.mjs +16 -0
  109. package/build/browser/esm/UukTgmLv7or2mhlB.mjs +16 -0
  110. package/build/browser/esm/_cuE13TWr3oEoKGP.mjs +34 -0
  111. package/build/browser/esm/aIlK3Ybu-1T4WHPv.mjs +640 -0
  112. package/build/browser/esm/bFSkTthAEOn7gv5x.mjs +16 -0
  113. package/build/browser/esm/bOhN6up-rdLRp82s.mjs +5588 -0
  114. package/build/browser/esm/index.mjs +85 -0
  115. package/build/browser/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
  116. package/build/browser/esm/o6U2z4gZ7GE4QKZD.mjs +16 -0
  117. package/build/browser/esm/psav3cvsBQQczhPL.mjs +16 -0
  118. package/build/browser/esm/vn0iS301yg2hAbYd.mjs +51 -0
  119. package/build/licenses/dependencies.txt +1341 -0
  120. package/build/node/assets/style.css +1 -0
  121. package/build/node/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
  122. package/build/node/esm/B-Xlyl81h27-bnvO.mjs +16 -0
  123. package/build/node/esm/B1_NYsn5D8x9QedP.mjs +307 -0
  124. package/build/node/esm/BCA5bxOeDA8k1Bm1.mjs +16 -0
  125. package/build/node/esm/BEo9XX1sHmVjScSm.mjs +16 -0
  126. package/build/node/esm/BIfdVpnJR1TZwCPR.mjs +1378 -0
  127. package/build/node/esm/BIqDzNJtkm-dyH0v.mjs +154 -0
  128. package/build/node/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
  129. package/build/node/esm/BUOdfqhtCh8lhOhm.mjs +4000 -0
  130. package/build/node/esm/BYbE15S73xgn7S5E.mjs +88 -0
  131. package/build/node/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
  132. package/build/node/esm/BkyivirgeiDKFSjk.mjs +16 -0
  133. package/build/node/esm/Bm1RqNJ-XvHpJW9z.mjs +831 -0
  134. package/build/node/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
  135. package/build/node/esm/Bx-30HInllXS7M_J.mjs +41 -0
  136. package/build/node/esm/Bx3lQBEvcqhxffT-.mjs +1726 -0
  137. package/build/node/esm/BxsKlaBFnb5wNq6R.mjs +53 -0
  138. package/build/node/esm/C4PMhNAV0KpPsKFj.mjs +24 -0
  139. package/build/node/esm/C7x3L6HtPhZjSrrZ.mjs +471 -0
  140. package/build/node/esm/C8gc149K34Zi2lP2.mjs +16 -0
  141. package/build/node/esm/CK-kn1p9NGRVM_h7.mjs +16 -0
  142. package/build/node/esm/CKR6snAwSONs7kfL.mjs +19 -0
  143. package/build/node/esm/CKXzosgZX8Xe3l59.mjs +16 -0
  144. package/build/node/esm/CLE_RHHvsDeoZ9Zd.mjs +561 -0
  145. package/build/node/esm/CMKci_5THkcJ-w9a.mjs +80 -0
  146. package/build/node/esm/CVU9bu6AnxcgkEwq.mjs +13466 -0
  147. package/build/node/esm/CfAob8gGydmX1xQu.mjs +16 -0
  148. package/build/node/esm/ChGigf2OPu7d44Km.mjs +16 -0
  149. package/build/node/esm/CkvkuPSf4R_DqArg.mjs +5648 -0
  150. package/build/node/esm/CnBMj0oJAyr9ZbjP.mjs +23 -0
  151. package/build/node/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
  152. package/build/node/esm/Crx9i_8dm3OQsk_T.mjs +28 -0
  153. package/build/node/esm/CwUulbiMQH11aF4x.mjs +16 -0
  154. package/build/node/esm/D0Lh0V1tkdJPxZnI.mjs +392 -0
  155. package/build/node/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
  156. package/build/node/esm/D5bg3v_W8K9MVp0j.mjs +1711 -0
  157. package/build/node/esm/D8F08tiG98tM_voL.mjs +16 -0
  158. package/build/node/esm/DR7o1DOIK9zdiBgS.mjs +50 -0
  159. package/build/node/esm/DYEgm2kd3haV-Ml8.mjs +1246 -0
  160. package/build/node/esm/DfzhmhZ4I0Zurcqn.mjs +44 -0
  161. package/build/node/esm/Dg_ERnlsy5hwbzMA.mjs +1498 -0
  162. package/build/node/esm/Dt4cj_0sWgvt4FGj.mjs +92 -0
  163. package/build/node/esm/GpycqJcrwTRtjEqA.mjs +16 -0
  164. package/build/node/esm/LlkIFFfAjLiQ5Or6.mjs +3840 -0
  165. package/build/node/esm/OCdyQRicV8KxUwMt.mjs +16 -0
  166. package/build/node/esm/QATDL2FGAYcVnd33.mjs +49 -0
  167. package/build/node/esm/SvgA2TyqJYOzheuf.mjs +26 -0
  168. package/build/node/esm/VZ150KIUh5JVRqpk.mjs +52 -0
  169. package/build/node/esm/XRLHatWlgABiuBDS.mjs +52 -0
  170. package/build/node/esm/bFSkTthAEOn7gv5x.mjs +16 -0
  171. package/build/node/esm/index.mjs +44754 -0
  172. package/build/node/esm/lgtVRbg712G5Ba-x.mjs +60 -0
  173. package/build/node/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
  174. package/build/node/esm/psav3cvsBQQczhPL.mjs +16 -0
  175. package/build/node/esm/zWnN2OzbhzCc6T7u.mjs +86 -0
  176. package/build/package.json +84 -0
  177. package/build/types/index.d.ts +1848 -0
  178. package/package.json +100 -0
@@ -0,0 +1,1708 @@
1
+ import { b0 as k, as as T, ay as G, k as Z, at as W, b1 as C, b2 as tt, b3 as P, Y as et, P as Y, b4 as V } from "./DEpR6b4DMs-va6RS.mjs";
2
+ import { c as x, b as f, r as L, t as rt, a as A, p as D, d as st } from "./BtMqJ5CRpKuAC4UQ.mjs";
3
+ /**
4
+ * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
5
+ *
6
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
7
+ * License: The license can be found at https://www.sheetxl.com/license.
8
+ */
9
+ /**
10
+ * @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
11
+ *
12
+ * (C) 2025-present SheetXL Inc. & Michael T. Ford
13
+ * License: The license can be found at https://www.sheetxl.com/license.
14
+ */
15
+ class ot {
16
+ constructor(t) {
17
+ this.list = t;
18
+ }
19
+ get length() {
20
+ return this.list.length;
21
+ }
22
+ item(t) {
23
+ return this.list[t];
24
+ }
25
+ forEach(t, e) {
26
+ for (let s = 0; s < this.list.length; s++) t(this.list[s], s, this);
27
+ }
28
+ }
29
+ const it = (u) => u === !0 || u === "1" || u === "on" || u === "true" || u !== !1 && u !== "0" && u !== "off" && u !== "false" && null, nt = (u) => {
30
+ const t = parseInt(u);
31
+ return isNaN(t) ? null : t;
32
+ }, lt = (u) => {
33
+ const t = parseFloat(u);
34
+ return isNaN(t) ? null : t;
35
+ }, at = /* @__PURE__ */ new Map();
36
+ class _ {
37
+ constructor(t, e, s, r, o, i = null, n) {
38
+ const l = (c, h, p) => n?.getRef?.(c, h, p, n?.parsedRefs), a = (c) => n?.getRefs?.(c, n?.parsedRefs);
39
+ 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);
40
+ }
41
+ getRef(t, e = !1) {
42
+ return this._getRef?.(t, this._fileLocation, e) ?? null;
43
+ }
44
+ getRelationships() {
45
+ return this._getRefs(this._fileLocation) ?? at;
46
+ }
47
+ getPath() {
48
+ return this.currentPath;
49
+ }
50
+ getElemRoot() {
51
+ return this.elemRoot;
52
+ }
53
+ getJsonRoot() {
54
+ return this.jsonRoot;
55
+ }
56
+ warn(t) {
57
+ this._onWarning ? this._onWarning(t) : this._parent ? this._parent?.warn?.(t) : console.warn(t);
58
+ }
59
+ addPerson(t) {
60
+ return this._addPerson ? this._addPerson(t) : this._parent ? this._parent?._addPerson?.(t) : null;
61
+ }
62
+ getVisitorParamsState() {
63
+ return this.sharedShared.getVisitorParamsState();
64
+ }
65
+ evaluate(t, e) {
66
+ if (!t) return e;
67
+ let s = [e];
68
+ const r = t.split("/");
69
+ for (let o = 0; o < r.length; o++) {
70
+ const i = r[o];
71
+ if (i === "" || i === ".") continue;
72
+ let n = [];
73
+ for (let l = 0; l < s.length; l++) {
74
+ const a = s[l], c = a.childNodes;
75
+ for (let h = 0; c && h < c.length; h++) {
76
+ const p = a.childNodes[h];
77
+ p.localName !== i && i !== "*" || n.push(p);
78
+ }
79
+ }
80
+ s = n;
81
+ }
82
+ return s.length === 1 ? s[0] : s.length === 0 ? null : new ot(s);
83
+ }
84
+ getFromPath(t, e) {
85
+ return Y.getFromPath(t, e);
86
+ }
87
+ setToPath(t, e, s) {
88
+ return Y.setToPath(t, e, s);
89
+ }
90
+ getValAttrAsString(t, e) {
91
+ let s = this.evaluate(t, e);
92
+ return s && s.hasAttribute("val") ? s.getAttribute("val") ?? null : null;
93
+ }
94
+ getValAttrAsBoolean(t, e, s = !1) {
95
+ let r = this.evaluate(t, e);
96
+ if (!r) return null;
97
+ const o = r.hasAttribute("val") ? r.getAttribute("val") : void 0;
98
+ return o == null ? s : o === "1" || o === "on" || o === "true" || o !== "0" && o !== "off" && o !== "false" && s;
99
+ }
100
+ getValAttrAsInteger(t, e) {
101
+ let s = this.evaluate(t, e);
102
+ return s && s.hasAttribute("val") ? parseInt(s.getAttribute("val")) ?? null : null;
103
+ }
104
+ getValAttrAsFloat(t, e) {
105
+ let s = this.evaluate(t, e);
106
+ return s && s.hasAttribute("val") ? parseFloat(s.getAttribute("val")) ?? null : null;
107
+ }
108
+ get BOOLEAN_COPY() {
109
+ return it;
110
+ }
111
+ get INT_COPY() {
112
+ return nt;
113
+ }
114
+ get FLOAT_COPY() {
115
+ return lt;
116
+ }
117
+ copyFromAttribute(t, e, s, r = e, o = null) {
118
+ if (!t || !s || !t.hasAttribute(e)) return;
119
+ let i = t.getAttribute(e);
120
+ if (o) {
121
+ if (Array.isArray(o)) {
122
+ for (let n = 0; n < o.length; n++) if (i == null || (i = o[n](i), i == null)) return;
123
+ } else if (i == null || (i = o(i), i == null)) return;
124
+ }
125
+ this.setToPath(s, r, i);
126
+ }
127
+ }
128
+ class j {
129
+ constructor(t) {
130
+ this.jsonKey = t;
131
+ }
132
+ visit(t, e, s) {
133
+ const r = {};
134
+ return s[this.jsonKey] = r, r;
135
+ }
136
+ }
137
+ class ct {
138
+ visit(t, e, s) {
139
+ if (!e) return;
140
+ const r = e.childNodes;
141
+ for (let o = 0; o < r.length; o++) {
142
+ const i = r.item(o);
143
+ i.nodeType === 1 && i.localName === "Relationship" && this.processRelationship(t, i, s);
144
+ }
145
+ return s;
146
+ }
147
+ processRelationship(t, e, s) {
148
+ const r = {};
149
+ t.copyFromAttribute(e, "Target", r, "target"), t.copyFromAttribute(e, "Type", r, "type"), t.copyFromAttribute(e, "TargetMode", r, "targetMode"), s[e.getAttribute("Id")] = r;
150
+ }
151
+ }
152
+ const H = (u, t) => {
153
+ if (u || !u.hasAttribute("rot")) return;
154
+ const e = u.getAttribute("rot"), s = Y.roundAccurately(D(e), 2);
155
+ s !== -1e3 && (t.rotation = s);
156
+ }, b = (u, t, e, s, r) => {
157
+ const o = u.getValAttrAsString(s, t);
158
+ o !== null && (e[r] = o);
159
+ }, m = (u, t, e, s, r = s, o = null) => {
160
+ const i = u.getValAttrAsBoolean(s, t, o);
161
+ i !== null && (e[r] = i);
162
+ }, w = (u, t, e, s, r) => {
163
+ const o = u.getValAttrAsInteger(s, t);
164
+ o !== null && (e[r] = o);
165
+ }, y = (u, t, e, s, r, o = 1) => {
166
+ const i = u.getValAttrAsFloat(s, t);
167
+ i !== null && (e[r] = i * o);
168
+ };
169
+ class ut {
170
+ visit(t, e, s) {
171
+ return m(t, e, s, "roundedCorners", "roundedCorners"), w(t, e, s, ".//AlternateContent/Fallback/style", "styleId"), s.range = null, s;
172
+ }
173
+ afterVisit(t, e, s) {
174
+ let r = {};
175
+ s.types = r;
176
+ let o = {}, i = 0, n = {}, l = 0, a = t.getVisitorParamsState().get("axes");
177
+ const c = t.getVisitorParamsState().get("types");
178
+ for (let g = 0; g < c.length; g++) {
179
+ const d = c[g];
180
+ if (d.xAxisId) {
181
+ const v = d.xAxisId, O = a.get(v);
182
+ o[g + ""] = O, d.offsetXAxis = g, delete d.xAxisId, s.xAxes = o, o.length = ++i;
183
+ }
184
+ if (d.yAxisId) {
185
+ const v = d.yAxisId, O = a.get(v);
186
+ n[g + ""] = O, d.offsetYAxis = g, delete d.yAxisId, s.yAxes = n, n.length = ++l;
187
+ }
188
+ r[g + ""] = d;
189
+ }
190
+ r.length = c.length;
191
+ const h = t.getVisitorParamsState().get("series");
192
+ if (!h || h.length === 0) return;
193
+ const p = {};
194
+ s.series = p;
195
+ for (let g = 0; g < h.length; g++) p[g + ""] = h[g];
196
+ p.length = h.length;
197
+ }
198
+ }
199
+ class ht {
200
+ visit(t, e, s) {
201
+ return m(t, e, s, "plotVisOnly", "plotVisOnly"), b(t, e, s, "dispBlanksAs", "dispBlanksAs"), m(t, e, s, ".//extLst/ext/dataDisplayOptions16/dispNaAsBlank", "dispNaAsBlank"), m(t, e, s, "showDLblsOverMax", "showDLblsOverMax"), s;
202
+ }
203
+ afterVisit(t, e, s) {
204
+ try {
205
+ const r = t.getValAttrAsBoolean("autoTitleDeleted", e), o = t.evaluate("title", e);
206
+ t.setToPath(s, "title.shown", !(r === !0 || !o));
207
+ const i = t.evaluate("legend", e);
208
+ t.setToPath(s, "legend.shown", i !== null);
209
+ } catch (r) {
210
+ throw new Error("Unexpected Error parsing Chart: " + r);
211
+ }
212
+ }
213
+ }
214
+ class pt {
215
+ visit(t, e, s) {
216
+ let r = {};
217
+ return s.plotArea = r, r;
218
+ }
219
+ }
220
+ class I {
221
+ EnumMappings() {
222
+ }
223
+ static fromOoxmlGradientType(t) {
224
+ return t === "circle" ? "radial" : t;
225
+ }
226
+ static fromOoxmlLineCap(t) {
227
+ if (t === "rnd") return "round";
228
+ if (t === "flat") return "butt";
229
+ if (t === "sq") return "square";
230
+ throw new Error("Invalid lineCap type: " + t);
231
+ }
232
+ static fromOoxmlCompound(t) {
233
+ return t === "sng" ? "single" : t;
234
+ }
235
+ static fromOoxmlAlignment(t) {
236
+ return t === "ctr" ? "center" : t;
237
+ }
238
+ }
239
+ class q {
240
+ visit(t, e, s) {
241
+ }
242
+ processStroke(t, e, s) {
243
+ const r = {}, o = t.evaluate("ln", e);
244
+ if (o) {
245
+ o.hasAttribute("algn") && (r.align = I.fromOoxmlAlignment(o.getAttribute("algn"))), o.hasAttribute("cap") && (r.lineCap = I.fromOoxmlLineCap(o.getAttribute("cap"))), o.hasAttribute("cmpd") && (r.compound = I.fromOoxmlCompound(o.getAttribute("cmpd"))), o.hasAttribute("w") && (r.width = rt(o.getAttribute("w")));
246
+ const i = t.evaluate("miter", o);
247
+ i && (r.lineJoin = "miter", i.hasAttribute("lim") && (r.miter = parseFloat(i.getAttribute("lim")))), t.evaluate("bevel", o) && (r.lineJoin = "bevel"), t.evaluate("round", o) && (r.lineJoin = "round");
248
+ const n = t.evaluate("custDash", o);
249
+ if (n) {
250
+ const c = t.evaluate("ds", n);
251
+ if (c && c.length > 0) {
252
+ let h = "";
253
+ for (let p = 0; p < c.length; p++) {
254
+ const g = c.item(p);
255
+ h += A(g.getAttribute("d")) + "," + A(g.getAttribute("sp"));
256
+ }
257
+ r.dash = h;
258
+ }
259
+ }
260
+ const l = t.evaluate("prstDash", o);
261
+ l && l.hasAttribute("val") && (r.dash = l.getAttribute("val")), this.parseEndElement(t, o, r, "headEnd", "head"), this.parseEndElement(t, o, r, "tailEnd", "tail");
262
+ const a = this.processFill(t, o, s);
263
+ r.fill = a;
264
+ }
265
+ return r;
266
+ }
267
+ parseEndElement(t, e, s, r, o) {
268
+ const i = t.evaluate(r, e);
269
+ if (i && (i.hasAttribute("type") && (s[o + "Type"] = i.getAttribute("type")), i.hasAttribute("len") || i.hasAttribute("w"))) {
270
+ const n = i.getAttribute("len") ? i.getAttribute("len") : "med", l = i.getAttribute("w") ? i.getAttribute("w") : "med";
271
+ s[o + "Size"] = n + "-" + l;
272
+ }
273
+ }
274
+ processFill(t, e, s) {
275
+ const r = {};
276
+ if (t.evaluate("noFill", e)) return r.none = !0, r;
277
+ const o = t.evaluate("solidFill", e);
278
+ if (o) {
279
+ const a = this.processAdjColor(t, o);
280
+ return a && (r.solid = a), r;
281
+ }
282
+ const i = t.evaluate("gradFill", e);
283
+ if (i) {
284
+ i.hasAttribute("rotWithShape") && (r.isRotated = i.getAttribute("rotWithShape") === "1");
285
+ const a = this.processGradFill(t, i);
286
+ return r.gradient = a, r;
287
+ }
288
+ const n = t.evaluate("pattFill", e);
289
+ if (n) {
290
+ const a = this.processPatternFill(t, n);
291
+ return r.pattern = a, r;
292
+ }
293
+ const l = t.evaluate("blipFill", e);
294
+ if (l) {
295
+ l.hasAttribute("rotWithShape") && (r.isRotated = f(l.getAttribute("rotWithShape"))), l.hasAttribute("dpi") && (r.dpi = l.getAttribute("dpi"));
296
+ const a = this.processImageFill(t, l);
297
+ return r.image = a, r;
298
+ }
299
+ return r.none = !0, r;
300
+ }
301
+ processGradFill(t, e) {
302
+ const s = {}, r = t.evaluate("lin", e);
303
+ if (r) {
304
+ if (s.type = "linear", r.hasAttribute("ang")) {
305
+ const c = D(r.getAttribute("ang"));
306
+ s.angle = c;
307
+ }
308
+ if (r.hasAttribute("scaled")) {
309
+ const c = f(r.getAttribute("scaled"));
310
+ s.scaled = c;
311
+ }
312
+ }
313
+ const o = {};
314
+ e.hasAttribute("flip") && (o.mirror = e.getAttribute("flip")), Object.keys(o).length > 0 && (s.tile = o);
315
+ const i = t.evaluate("path", e);
316
+ if (i) {
317
+ i.hasAttribute("path") && (s.type = I.fromOoxmlGradientType(i.getAttribute("path")));
318
+ const c = t.evaluate("fillToRect", i);
319
+ c && (s.fillTo = this.getRect(c));
320
+ }
321
+ const n = t.evaluate("tileRect", e);
322
+ n && (s.tile.bounds = this.getRect(n));
323
+ const l = [], a = t.evaluate("gsLst/gs", e);
324
+ for (let c = 0; a && c < a.length; c++) {
325
+ const h = a.item(c), p = { offset: A(h.getAttribute("pos")), color: this.processAdjColor(t, h) };
326
+ l.push(p);
327
+ }
328
+ return l.length > 0 && (s.stops = l), s;
329
+ }
330
+ getRect(t) {
331
+ const e = {};
332
+ return t.hasAttribute("t") && (e.t = A(t.getAttribute("t"))), t.hasAttribute("l") && (e.l = A(t.getAttribute("l"))), t.hasAttribute("b") && (e.b = A(t.getAttribute("b"))), t.hasAttribute("r") && (e.r = A(t.getAttribute("r"))), Object.keys(e).length === 0 ? null : e;
333
+ }
334
+ processImageFill(t, e) {
335
+ return { ref: "https://cdn.sheetxl.com/public/logo-color-square-onwhite.png", tile: !1 };
336
+ }
337
+ processPatternFill(t, e) {
338
+ const s = {}, r = e.getAttribute("prst");
339
+ s.type = r;
340
+ const o = t.evaluate("bgClr", e);
341
+ if (o) {
342
+ const n = this.processAdjColor(t, o);
343
+ n && (s.background = n);
344
+ }
345
+ const i = t.evaluate("fgClr", e);
346
+ if (i) {
347
+ let n = this.processAdjColor(t, i);
348
+ n && (s.foreground = n);
349
+ }
350
+ return s;
351
+ }
352
+ processAdjColor(t, e) {
353
+ const s = t.evaluate("hslClr", e);
354
+ if (s) return this.processHslClr(t, s);
355
+ const r = t.evaluate("prstClr", e);
356
+ if (r) return this.processClrWithValAttribute(t, r);
357
+ const o = t.evaluate("schemeClr", e);
358
+ if (o) return this.processClrWithValAttribute(t, o);
359
+ const i = t.evaluate("sysClr", e);
360
+ if (i) return this.processClrWithValAttribute(t, i);
361
+ const n = t.evaluate("scrgbClr", e);
362
+ if (n) return this.processScrgbClrElement(t, n);
363
+ const l = t.evaluate("srgbClr", e);
364
+ return l ? this.processSrgbClrElement(t, l) : null;
365
+ }
366
+ processScrgbClrElement(t, e) {
367
+ let s = "lrgba(" + A(e.getAttribute("r")) + "," + A(e.getAttribute("g")) + "," + A(e.getAttribute("b")) + ")";
368
+ return s += this.processAdjustments(t, e), s;
369
+ }
370
+ processSrgbClrElement(t, e) {
371
+ let s = e.getAttribute("val");
372
+ return s += this.processAdjustments(t, e), s;
373
+ }
374
+ processHslClr(t, e) {
375
+ let s = "hsl(" + D(e.getAttribute("hue")) + "," + A(e.getAttribute("sat")) + "," + A(e.getAttribute("lum")) + ")";
376
+ return s += this.processAdjustments(t, e), s;
377
+ }
378
+ processClrWithValAttribute(t, e) {
379
+ const s = e.getAttribute("val");
380
+ if (!s) return;
381
+ let r = s;
382
+ return r += this.processAdjustments(t, e), r;
383
+ }
384
+ processAdjustments(t, e) {
385
+ let s = "";
386
+ const r = e.childNodes;
387
+ for (let o = 0; o < r.length; o++) {
388
+ const i = r.item(o);
389
+ if (i.nodeType === 1) {
390
+ let n = i.localName;
391
+ s += n === "hue" || n === "hueOff" || n === "hueMod" ? this.processAdjustmentElement(t, e, n, 6e4) : n === "gray" || n === "comp" || n === "inv" || n === "gamma" || n === "invGamma" ? this.processAdjustmentElement(t, e, n, 1) : this.processAdjustmentElement(t, e, n);
392
+ }
393
+ }
394
+ return s;
395
+ }
396
+ processAdjustmentElement(t, e, s, r = 1e3) {
397
+ const o = t.evaluate(s, e);
398
+ if (!o) return "";
399
+ const i = o.getAttribute("val");
400
+ return i ? ` ${s} ${!i || parseFloat(i) / r}` : ` ${s}`;
401
+ }
402
+ }
403
+ class M extends q {
404
+ visit(t, e, s) {
405
+ try {
406
+ const r = t.evaluate("xfrm", e);
407
+ if (r) {
408
+ H(r, s);
409
+ const l = { x: 0, y: 0, width: 0, height: 0 }, a = t.evaluate("off", r);
410
+ a && (l.x = x(a.getAttribute("x")) ?? 0, l.y = x(a.getAttribute("y")) ?? 0);
411
+ const c = t.evaluate("ext", r);
412
+ a && (l.width = x(c.getAttribute("cx")) ?? 0, l.height = x(c.getAttribute("cy")) ?? 0), s.bounds = l;
413
+ }
414
+ const o = t.evaluate("prstGeom", e);
415
+ o?.hasAttribute("prst") ? s.geometry = o?.getAttribute("prst") : t.evaluate("customGeom", e) && console.warn("customGeom not supported yet");
416
+ const i = this.processFill(t, e, s);
417
+ i && Object.keys(i).length > 0 && (s.fill = i);
418
+ const n = this.processStroke(t, e, s);
419
+ return n && Object.keys(n).length > 0 && (s.stroke = n), s;
420
+ } catch (r) {
421
+ throw console.warn(r), new Error("Unexpected Error parsing Shape Properties element");
422
+ }
423
+ }
424
+ }
425
+ class S {
426
+ visit(t, e, s) {
427
+ let r = {};
428
+ if (b(t, e, r, "grouping", "grouping"), m(t, e, r, "varyColors", "varyColors"), y(t, e, r, "gapWidth", "gapWidth", 0.01), y(t, e, r, "overlap", "overlap", 0.01), this.parseType(t, e, r), w(t, e, r, "bubbleScale", "bubbleScale"), m(t, e, r, "showNegBubbles", "showNegativeBubbleValues"), m(t, e, r, "sizeRepresents", "bubbleSizeRepresentsWidth"), w(t, e, r, "firstSliceAng", "startAngle"), w(t, e, r, "holeSize", "holeSize"), b(t, e, r, "scatterStyle", "scatterStyle"), this.parseAxisIds(t, e, r), Object.keys(r).length > 0) {
429
+ let o = t.getVisitorParamsState().get("types");
430
+ o || (o = [], t.getVisitorParamsState().set("types", o)), o.push(r);
431
+ }
432
+ return r;
433
+ }
434
+ parseType(t, e, s) {
435
+ switch (e.localName) {
436
+ case "areaChart":
437
+ s.type = "area";
438
+ break;
439
+ case "bubbleChart":
440
+ s.type = "bubble";
441
+ break;
442
+ case "doughnutChart":
443
+ case "ofPieType":
444
+ case "pieChart":
445
+ s.type = "pie";
446
+ break;
447
+ case "lineChart":
448
+ s.type = "line";
449
+ break;
450
+ case "scatterChart":
451
+ s.type = "scatter";
452
+ }
453
+ }
454
+ parseAxisIds(t, e, s) {
455
+ const r = t.evaluate("axId", e);
456
+ if (r.length === 0) return;
457
+ const o = r.item(0).getAttribute("val");
458
+ s.xAxisId = o;
459
+ const i = r.item(1).getAttribute("val");
460
+ s.yAxisId = i;
461
+ }
462
+ }
463
+ class gt extends S {
464
+ parseType(t, e, s) {
465
+ const r = t.getValAttrAsString("barDir", e);
466
+ r && (s.type = r === "col" ? "column" : "bar");
467
+ }
468
+ }
469
+ class N {
470
+ constructor(t) {
471
+ this.jsonKey = t;
472
+ }
473
+ visit(t, e, s) {
474
+ let r = {}, o = r, i = t.getValAttrAsString("idx", e);
475
+ i !== null && (o = {}, o[i] = r);
476
+ const n = t.getValAttrAsBoolean("delete", e);
477
+ this.parseNumFormat(t, e, r), n === !0 ? (r.showBubbleSize = !1, r.showCatName = !1, r.showLeaderLines = !1, r.showPercentage = !1, r.showSerName = !1, r.showVal = !1, r.showLegendKey = !1) : (m(t, e, r, "showBubbleSize", "showBubbleSize"), m(t, e, r, "showCatName", "showCatName"), m(t, e, r, "showLeaderLines", "showLeaderLines"), m(t, e, r, "showPercent", "showPercentage"), m(t, e, r, "showSerName", "showSerName"), m(t, e, r, "showVal", "showVal"), m(t, e, r, "showLegendKey", "showLegendKey"));
478
+ const l = t.evaluate("separator", e);
479
+ return l !== null && (r.separator = l.textContent), b(t, e, r, "dLblPos", "position"), s[this.jsonKey] = o, r;
480
+ }
481
+ parseNumFormat(t, e, s) {
482
+ const r = t.evaluate("numFmt", e);
483
+ if (r) {
484
+ const o = r.getAttribute("formatCode");
485
+ s.formatCode = o, r.hasAttribute("sourceLinked") && (s.sourceLinked = r.getAttribute("sourceLinked") === "1");
486
+ }
487
+ }
488
+ }
489
+ const J = (u, t, e) => {
490
+ if (u.getValAttrAsBoolean("invertIfNegative", t) === !0) if (u.evaluate("extLst/ext/invertSolidFillFmt", t)) {
491
+ if (e.fill && e.fillNegative) {
492
+ const s = u.getFromPath(e, "fill.solid.adjs");
493
+ s && u.setToPath(e, "fillNegative.solid.adjs", s);
494
+ }
495
+ } else {
496
+ const s = { val: "FFFFFF" }, r = {};
497
+ r.solid = s, e.fillNegative = r;
498
+ const o = { val: "000000" }, i = {};
499
+ i.solid = o;
500
+ const n = {};
501
+ n.fill = i, e.strokeNegative = n;
502
+ }
503
+ };
504
+ class dt {
505
+ visit(t, e, s) {
506
+ const r = {};
507
+ w(t, e, r, "explosion", "explosion");
508
+ let o = t.evaluate("cat/*/f", e);
509
+ o || (o = t.evaluate("xVal/*/f", e));
510
+ let i = null;
511
+ o !== null && o.firstChild !== null && (i = o.firstChild.nodeValue), o || (o = t.evaluate("cat/strLit", e), o || (o = t.evaluate("cat/numLit", e)), o && (i = this.parsePointsAsString(t, o))), i !== null && (r.xRange = i);
512
+ let n = t.evaluate("val/*/f", e);
513
+ n || (n = t.evaluate("yVal/*/f", e));
514
+ let l = null;
515
+ n && n.firstChild && (l = n.firstChild.nodeValue), n || (n = t.evaluate("val/numLit", e), n !== null && (l = this.parsePointsAsString(t, n))), l !== null && (r.valRange = l), this.parseTitleRangeOrValue(t, e, r), w(t, e, r, "idx", "idx"), m(t, e, r, "smooth", "smooth");
516
+ const a = t.getVisitorParamsState().get("types").length - 1;
517
+ r.offsetChart = a;
518
+ let c = t.getVisitorParamsState().get("series");
519
+ return c || (c = [], t.getVisitorParamsState().set("series", c)), c.push(r), r;
520
+ }
521
+ parseTitleRangeOrValue(t, e, s) {
522
+ const r = t.evaluate("tx/strRef/f", e);
523
+ if (r !== null) {
524
+ const o = r.firstChild.nodeValue;
525
+ t.setToPath(s, "title.range", o);
526
+ } else {
527
+ const o = t.evaluate("tx/v", e);
528
+ o !== null && t.setToPath(s, "title.text.simpleRun", o.firstChild.nodeValue);
529
+ }
530
+ }
531
+ parsePointsAsString(t, e) {
532
+ let s = "{";
533
+ const r = t.getValAttrAsInteger("ptCount", e), o = t.evaluate("pt", e), i = [];
534
+ for (let n = 0; o && r && n < r; n++) {
535
+ let l = null, a = t.evaluate("pt[@idx='" + n + "']/v", e);
536
+ a instanceof Node && (l = a.textContent), i[n] = l;
537
+ }
538
+ for (let n = 0; n < i.length; n++) n > 0 && (s += ","), i[n] !== void 0 && (s += i[n]);
539
+ return s += "}", s;
540
+ }
541
+ afterVisit(t, e, s) {
542
+ J(t, e, s);
543
+ let r = t.getFromPath(s, "points");
544
+ if (r) {
545
+ const o = Object.keys(r);
546
+ for (let i = 0; i < o.length; i++) {
547
+ const n = o[i], l = t.getFromPath(r, n);
548
+ if (!l) continue;
549
+ let a = t.getFromPath(l, "markers");
550
+ a && (t.setToPath(s, "markers.points." + n, a), delete l.markers);
551
+ }
552
+ }
553
+ }
554
+ }
555
+ class mt {
556
+ DataPointVisitor() {
557
+ }
558
+ visit(t, e, s) {
559
+ let r = t.getFromPath(s, "points"), o = null;
560
+ r ? o = r : (o = {}, t.setToPath(s, "points", o));
561
+ let i = {}, n = t.getValAttrAsString("idx", e);
562
+ return n !== null && (o[n] = i), m(t, e, i, "bubble3D", "bubble3D"), w(t, e, i, "explosion", "explosion"), J(t, e, i), i;
563
+ }
564
+ }
565
+ class bt {
566
+ visit(t, e, s) {
567
+ const r = e.parentNode.localName;
568
+ if (r === "ser" || r === "dPt") {
569
+ const o = {}, i = t.getValAttrAsString("size", e);
570
+ i !== null && (o.size = i);
571
+ const n = t.getValAttrAsString("symbol", e);
572
+ return n && (o.type = n), s.markers = o, o;
573
+ }
574
+ return null;
575
+ }
576
+ }
577
+ class R {
578
+ visit(t, e, s) {
579
+ let r = {};
580
+ this.parseScaling(t, e, r), y(t, e, r, "majorUnit", "majorUnits"), y(t, e, r, "minorUnit", "minorUnits"), m(t, e, r, "delete", "shown"), this.parseOrientation(t, e, r), this.parseNumFormat(t, e, r), b(t, e, r, "majorTickMark", "majorTickMarks"), b(t, e, r, "minorTickMark", "minorTickMarks"), b(t, e, r, "crosses", "crosses"), y(t, e, r, "crossesAt", "crosses"), b(t, e, r, "crossBetween", "crossBetween"), this.parseLabelAlign(t, e, r), w(t, e, r, "lblOffset", "labelOffset"), b(t, e, r, "tickLblPos", "labelPosition");
581
+ const o = t.getValAttrAsInteger("noMultiLvlLbl", e);
582
+ r.labelMultiLevel = o !== null && o === 0, w(t, e, r, "tickMarkSkip", "tickMarkSkip"), w(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"), b(t, e, r, "baseTimeUnit", "baseUnitDates"), t.getVisitorParamsState().get("axes") || t.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map());
583
+ const i = t.getValAttrAsString("axId", e);
584
+ return t.getVisitorParamsState().get("axes").set(i, r), r;
585
+ }
586
+ parseTimeUnits(t, e, s, r, o, i) {
587
+ const n = {};
588
+ let l = t.getValAttrAsString(o, e);
589
+ if (l !== null) {
590
+ n.dem = l;
591
+ let a = t.getValAttrAsString(i, e);
592
+ n.amt = a;
593
+ }
594
+ Object.keys(n).length > 0 && (s[r] = n);
595
+ }
596
+ parseDisplayCustOrBuiltInUnit(t, e, s) {
597
+ let r = e.getValAttrAsString("dispUnits/builtInUnit", t);
598
+ r || (r = e.getValAttrAsString("dispUnits/custUnit", t)), r && (s.displayUnits = r);
599
+ }
600
+ parseLabelAlign(t, e, s) {
601
+ let r = t.getValAttrAsString("lblAlgn", e);
602
+ r !== null && (r === "ctr" ? s.labelAlign = "center" : r === "l" ? s.labelAlign = "left" : r === "r" && (s.labelAlign = "right"));
603
+ }
604
+ parseOrientation(t, e, s) {
605
+ const r = t.getValAttrAsString("AxPos", e);
606
+ r !== null && (r === "b" ? s.orientation = "bottom" : r === "l" ? s.orientation = "left" : r === "r" ? s.orientation = "right" : r === "t" && (s.orientation = "top"));
607
+ }
608
+ parseNumFormat(t, e, s) {
609
+ const r = {}, o = t.evaluate("numFmt", e);
610
+ o !== null && (o.hasAttribute("formatCode") && (r.formatCode = o.getAttribute("formatCode")), o.hasAttribute("sourceLinked") && (r.sourceLinked = o.getAttribute("sourceLinked") === "1")), Object.keys(r).length > 0 && (s.labels = r);
611
+ }
612
+ parseScaling(t, e, s) {
613
+ const r = t.getValAttrAsString("scaling/orientation", e);
614
+ r !== null && (s.inverted = r !== "minMax");
615
+ const o = t.getValAttrAsFloat("scaling/logBase", e);
616
+ o !== null && (s.logBase = o, s.scaleType = "log"), y(t, e, s, "scaling/max", "max"), y(t, e, s, "scaling/min", "min");
617
+ }
618
+ afterVisit(t, e, s) {
619
+ s.fill && s.labels && (s.labels.fill = s.fill, delete s.fill);
620
+ let r = t.getValAttrAsBoolean("delete", e);
621
+ r !== null && (t.setToPath(s, "labels.shown", r !== !0), t.setToPath(s, "shown", r !== !0));
622
+ const o = t.getFromPath(s, "dispUnits.displayUnitsLabel");
623
+ o && (t.setToPath(s, "displayUnitsLabel", o), delete s.dispUnits);
624
+ const i = t.evaluate("title", e);
625
+ t.setToPath(s, "title.shown", i !== null);
626
+ const n = t.evaluate("minorGridlines", e);
627
+ t.setToPath(s, "gridLinesMinor.shown", n !== null);
628
+ const l = t.evaluate("majorGridlines", e);
629
+ t.setToPath(s, "gridLinesMajor.shown", l !== null);
630
+ }
631
+ }
632
+ class F {
633
+ constructor(t = "text") {
634
+ this._jsonKey = t;
635
+ }
636
+ getTextPath() {
637
+ return this._jsonKey;
638
+ }
639
+ visit(t, e, s) {
640
+ let r = t.getFromPath(s, this.getTextPath());
641
+ return r || (r = {}), this.parseTextElement(t, e, r, !1), Object.keys(r).length > 0 && t.setToPath(s, this.getTextPath(), r), s;
642
+ }
643
+ parseTextElement(t, e, s, r) {
644
+ const o = t.evaluate("p/pPr/defRPr", e) ?? t.evaluate("defRPr", e);
645
+ o && (this.parseTextProperties(t, o, s), new M().visit(t, o, s));
646
+ let i = [], n = t.evaluate("p/r", e) ?? t.evaluate("r", e);
647
+ const l = (c) => {
648
+ const h = {};
649
+ let p = t.evaluate("t", c);
650
+ const g = t.evaluate("rPr", c);
651
+ g && this.parseTextProperties(t, g, h), p ? h.text = p.firstChild.textContent ?? "" : c.textContent && (h.text = c.textContent ?? ""), i.push(h);
652
+ };
653
+ if (n?.length !== void 0) for (let c = 0; n && c < n.length; c++) l(n.item(c));
654
+ else l(n || e);
655
+ i.length > 0 && (s.runs = i);
656
+ const a = t.evaluate("bodyPr", e);
657
+ a && H(a, s);
658
+ }
659
+ parseTextProperties(t, e, s) {
660
+ if (!e) return;
661
+ e.hasAttribute("sz") && (s.size = parseFloat(e.getAttribute("sz")) / 100), e.hasAttribute("b") && (s.weight = e.getAttribute("b") === "1" ? 700 : 400), e.hasAttribute("i") && (s.italic = e.getAttribute("i") === "1"), e.hasAttribute("u") && (s.underline = e.getAttribute("u")), e.hasAttribute("strike") && (s.strike = e.getAttribute("strike"));
662
+ const r = t.evaluate("latin", e);
663
+ if (r && !r.getAttribute("typeface").startsWith("+")) {
664
+ const o = s.font ?? {};
665
+ if (r.hasAttribute("typeface") && (o.family = r.getAttribute("typeface")), r.hasAttribute("panose")) {
666
+ const i = r.getAttribute("panose");
667
+ i && (o.fallbacks = [k.getPanoseFallback(i)]);
668
+ }
669
+ r.hasAttribute("pitchFamily") && (o.pitch = r.getAttribute("pitchFamily")), r.hasAttribute("charset") && (o.charset = r.getAttribute("charset")), Object.keys(o).length > 0 && (s.font = o);
670
+ }
671
+ }
672
+ }
673
+ class ft {
674
+ visit(t, e, s) {
675
+ let r = t.getVisitorParamsState().get("series")[t.getValAttrAsInteger("idx", e)];
676
+ if (r) {
677
+ let o = t.getFromPath(r, "title");
678
+ o || (o = {}, t.setToPath(r, "title", o));
679
+ let i = o, n = t.getValAttrAsBoolean("delete", e);
680
+ return n !== null && (i.shown = !n), i;
681
+ }
682
+ return s;
683
+ }
684
+ }
685
+ class At {
686
+ visit(t, e, s) {
687
+ const r = {};
688
+ return m(t, e, r, "overlay", "overlay"), b(t, e, r, "legendPos", "position"), s.legend = r, r;
689
+ }
690
+ }
691
+ class yt extends M {
692
+ visit(t, e, s) {
693
+ const r = this.processFill(t, e, s);
694
+ Object.keys(r).length > 0 && (s.fillNegative = r);
695
+ const o = this.processStroke(t, e, s);
696
+ return Object.keys(o).length > 0 && (s.strokeNegative = o), s;
697
+ }
698
+ }
699
+ class X extends F {
700
+ constructor(t = "title") {
701
+ super(t);
702
+ }
703
+ parseTitleRangeOrValue(t, e, s) {
704
+ let r = t.evaluate("tx/strRef/f", e) ?? null;
705
+ if (r) {
706
+ const o = r.firstElementChild.nodeValue;
707
+ t.setToPath(s, "range", o);
708
+ }
709
+ }
710
+ visit(t, e, s) {
711
+ const r = {};
712
+ m(t, e, r, "overlay", "overlay"), s[this._jsonKey] = r;
713
+ let o = t.getFromPath(r, this.getTextPath());
714
+ o || (o = {}), this.parseTitleRangeOrValue(t, e, r);
715
+ const i = t.evaluate("txPr", e);
716
+ i && this.parseTextElement(t, i, o, !1);
717
+ const n = t.evaluate("tx/rich", e);
718
+ return n && this.parseTextElement(t, n, o, !0), Object.keys(o).length > 0 && t.setToPath(r, this.getTextPath(), o), r;
719
+ }
720
+ afterVisit(t, e, s) {
721
+ if (s?.text) {
722
+ const r = s.text?.rotation ?? null;
723
+ r !== null && (s.rotation = parseInt(r), delete s.title.rotation);
724
+ }
725
+ }
726
+ }
727
+ class vt {
728
+ visit(t, e, s) {
729
+ const r = t.evaluate("manualLayout", e);
730
+ if (r) {
731
+ let o = {};
732
+ y(t, r, o, "x", "x"), y(t, r, o, "y", "y"), y(t, r, o, "w", "w"), y(t, r, o, "h", "h"), b(t, r, o, "xMode", "xMode"), b(t, r, o, "yMode", "yMode"), b(t, r, o, "wMode", "wMode"), b(t, r, o, "hMode", "hMode"), Object.keys(o).length > 0 && (s.manualLayout = o);
733
+ }
734
+ return s;
735
+ }
736
+ }
737
+ class Ft {
738
+ visit(t, e, s) {
739
+ return s.name = e.getAttribute("name"), s;
740
+ }
741
+ }
742
+ class Ct extends q {
743
+ visit(t, e, s) {
744
+ const r = {};
745
+ r.name = e.getAttribute("name");
746
+ const o = e.childNodes;
747
+ for (let i = 0; i < o.length; i++) {
748
+ const n = o.item(i);
749
+ if (n.nodeType === 1) {
750
+ let l = n.localName;
751
+ const a = t.evaluate(l, e), c = this.processAdjColor(t, a);
752
+ r[l] = c;
753
+ }
754
+ }
755
+ return Object.keys(r).length > 0 && (s.colors = r), r;
756
+ }
757
+ }
758
+ class wt {
759
+ visit(t, e, s) {
760
+ const r = {};
761
+ r.name = e.getAttribute("name");
762
+ const o = t.evaluate("majorFont", e), i = this.processFontElement(t, o, {});
763
+ r.majorFont = i.family, i.fallbacks && (r.majorFallbacks = i.fallbacks);
764
+ const n = t.evaluate("minorFont", e), l = this.processFontElement(t, n, {});
765
+ return r.minorFont = l.family, i.fallbacks && (r.minorFallbacks = l.fallbacks), s.fonts = r, r;
766
+ }
767
+ processFontElement(t, e, s) {
768
+ if (!e) return;
769
+ const r = t.evaluate("latin", e);
770
+ if (!r) return;
771
+ const o = r.getAttribute("typeface");
772
+ o && (s.family = o);
773
+ const i = r.getAttribute("panose");
774
+ return i && (s.fallbacks = [k.getPanoseFallback(i)]), s;
775
+ }
776
+ }
777
+ class Pt {
778
+ visit(t, e, s) {
779
+ if (!e) return;
780
+ const r = {}, o = e.getAttribute("r:id");
781
+ if (o) {
782
+ const i = t.getRef(o);
783
+ typeof i == "string" && (r.address = i);
784
+ }
785
+ 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;
786
+ }
787
+ }
788
+ class Nt {
789
+ visit(t, e, s) {
790
+ if (!e) return;
791
+ const r = {};
792
+ return t.copyFromAttribute(e, "ref", r), this.processFilterColumns(t, e, r), Object.keys(r).length > 0 && (s.filter = r), r;
793
+ }
794
+ processColorFilter(t, e) {
795
+ const s = { type: T.Type.Color };
796
+ return t.copyFromAttribute(e, "cellColor", s, "cellColor", t.BOOLEAN_COPY), t.copyFromAttribute(e, "dxfId", s, "styleId", t.INT_COPY), s;
797
+ }
798
+ processCustomFilter(t, e) {
799
+ const s = {};
800
+ return t.copyFromAttribute(e, "operator", s, "operator", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", s, "val"), s;
801
+ }
802
+ processCustomFilters(t, e) {
803
+ const s = { type: T.Type.Custom };
804
+ t.copyFromAttribute(e, "and", s, "and", t.BOOLEAN_COPY);
805
+ const r = e.childNodes;
806
+ s.filters = [];
807
+ for (let o = 0; o < r.length; o++) {
808
+ const i = r.item(o);
809
+ if (i.nodeType !== 1) continue;
810
+ let n = null;
811
+ i.localName === "customFilter" && (n = this.processCustomFilter(t, i)), n && s.filters.push(n);
812
+ }
813
+ return s;
814
+ }
815
+ processDynamicFilter(t, e) {
816
+ const s = { type: T.Type.Dynamic };
817
+ return t.copyFromAttribute(e, "type", s, "dynamicType"), t.copyFromAttribute(e, "val", s, "val", t.INT_COPY), t.copyFromAttribute(e, "maxVal", s, "maxVal", t.INT_COPY), s;
818
+ }
819
+ processDateGroupItem(t, e) {
820
+ const s = {};
821
+ 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;
822
+ }
823
+ processFilterItem(t, e) {
824
+ if (e.hasAttribute("val")) return e.getAttribute("val");
825
+ }
826
+ processFilters(t, e) {
827
+ const s = { type: T.Type.Items };
828
+ t.copyFromAttribute(e, "blank", s, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", s, "calendarType");
829
+ let r = [], o = [];
830
+ const i = e.childNodes;
831
+ for (let n = 0; n < i.length; n++) {
832
+ const l = i.item(n);
833
+ if (l.nodeType === 1) {
834
+ if (l.localName === "dateGroupItem") {
835
+ const a = this.processDateGroupItem(t, l);
836
+ a && r.push(a);
837
+ } else if (l.localName === "filter") {
838
+ const a = this.processFilterItem(t, l);
839
+ a !== void 0 && o.push(a);
840
+ }
841
+ }
842
+ }
843
+ return r.length > 0 && (s.dateGroups = r), o.length > 0 && (s.items = o), s;
844
+ }
845
+ processIcon(t, e) {
846
+ const s = { type: T.Type.Icon };
847
+ return t.copyFromAttribute(e, "iconId", s, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", s), s;
848
+ }
849
+ processTop10(t, e) {
850
+ const s = { type: T.Type.Top10 };
851
+ return t.copyFromAttribute(e, "filterVal", s, "filterVal", t.FLOAT_COPY), t.copyFromAttribute(e, "percent", s, "percent", t.BOOLEAN_COPY), t.copyFromAttribute(e, "top", s, "top", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", s, "val", t.FLOAT_COPY), s;
852
+ }
853
+ processFilterCriteria(t, e, s) {
854
+ if (!e) return;
855
+ const r = e.childNodes, o = [];
856
+ for (let i = 0; i < r.length; i++) {
857
+ const n = r.item(i);
858
+ if (n.nodeType !== 1) continue;
859
+ let l = null;
860
+ n.localName === "colorFilter" ? l = this.processColorFilter(t, n) : n.localName === "customFilters" ? l = this.processCustomFilters(t, n) : n.localName === "dynamicFilter" ? l = this.processDynamicFilter(t, n) : n.localName === "filters" ? l = this.processFilters(t, n) : n.localName === "iconFilter" ? l = this.processIcon(t, n) : n.localName === "top10" && (l = this.processTop10(t, n)), l && o.push(l);
861
+ }
862
+ return o.length > 0 && (s.criteria = o), o;
863
+ }
864
+ processFilterColumn(t, e) {
865
+ if (!e) return null;
866
+ const s = {};
867
+ if (!e.hasAttribute("colId")) return;
868
+ s.offset = parseInt(e.getAttribute("colId"));
869
+ let r = !1;
870
+ return e.hasAttribute("hiddenButton") && (r = f(e.getAttribute("hiddenButton"))), r && (s.hiddenButton = !0), e.hasAttribute("showButton") && (s.showButton = f(e.getAttribute("showButton"))), this.processFilterCriteria(t, e, s), s;
871
+ }
872
+ processFilterColumns(t, e, s) {
873
+ if (!e) return;
874
+ const r = e.childNodes, o = [];
875
+ for (let i = 0; i < r.length; i++) {
876
+ const n = r.item(i);
877
+ if (n.nodeType === 1 && n.localName === "filterColumn") {
878
+ const l = this.processFilterColumn(t, n);
879
+ l && o.push(l);
880
+ }
881
+ }
882
+ return o.length > 0 && (s.fields = o), o;
883
+ }
884
+ }
885
+ class Ot {
886
+ visit(t, e, s) {
887
+ if (!e) return;
888
+ const r = {};
889
+ if (t.copyFromAttribute(e, "ref", r), e.hasAttribute("caseSensitive")) {
890
+ const n = f(e.getAttribute("caseSensitive"));
891
+ r.collatorOptions = n ? G.CaseSensitiveOptions : G.CaseInsensitiveOptions;
892
+ }
893
+ const o = e.getAttribute("sortMethod");
894
+ o != null && o !== "none" && (o === "stroke" ? r.collatorOptions = { ...r.collatorOptions, collation: "stroke" } : o === "pinYin" && (r.collatorOptions = { ...r.collatorOptions, collation: "pinyin" })), e.hasAttribute("columnSort") && f(e.getAttribute("columnSort")) && (r.orientation = Z.Orientation.Column);
895
+ const i = W.fastStringToRange(r.ref);
896
+ return this.processSortConditions(t, e, r, i), Object.keys(r).length > 0 && (s.sort = r), r;
897
+ }
898
+ processSortCondition(t, e, s) {
899
+ if (!e) return null;
900
+ const r = {};
901
+ if (e.hasAttribute("ref")) {
902
+ if (e.hasAttribute("ref")) {
903
+ const o = e.getAttribute("ref"), i = W.fastStringToRange(o);
904
+ r.offset = s ? i.colStart - s.colStart : i.colStart;
905
+ }
906
+ return r.reverse = !1, e.hasAttribute("descending") && (r.reverse = f(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;
907
+ }
908
+ console.warn("no ref for sort conditional", t.getPath());
909
+ }
910
+ processSortConditions(t, e, s, r) {
911
+ if (!e) return;
912
+ const o = e.childNodes, i = [];
913
+ for (let n = 0; n < o.length; n++) {
914
+ const l = o.item(n);
915
+ if (l.nodeType === 1 && l.localName === "sortCondition") {
916
+ const a = this.processSortCondition(t, l, r);
917
+ a && i.push(a);
918
+ }
919
+ }
920
+ return i.length > 0 && (s.fields = i), i;
921
+ }
922
+ }
923
+ class Q {
924
+ visit(t, e, s) {
925
+ }
926
+ processDataBarColor(t, e, s, r, o = "dk1") {
927
+ if (!e) return;
928
+ const i = st((n) => e.getAttribute(n), o);
929
+ return i && (s[r] = i), s;
930
+ }
931
+ processFonts(t, e, s) {
932
+ if (!e) return;
933
+ const r = e.childNodes;
934
+ let o = 0;
935
+ for (let i = 0; i < r.length; i++) {
936
+ const n = r.item(i);
937
+ if (n.nodeType === 1 && n.localName === "font") {
938
+ const l = {};
939
+ this.processFont(t, n, l), s[o++] = l;
940
+ }
941
+ }
942
+ return s;
943
+ }
944
+ processFont(t, e, s) {
945
+ t.getValAttrAsBoolean("b", e, !0) && (s.weight = 700), t.getValAttrAsBoolean("i", e, !0) && (s.style = k.Style.Italic), t.getValAttrAsBoolean("strike", e, !0) && (s.strike = !0);
946
+ const r = t.evaluate("u", e);
947
+ if (r) {
948
+ const n = r.getAttribute("val");
949
+ s.underline = n || k.UnderlineStyle.Single;
950
+ }
951
+ b(t, e, s, "vertAlign", "verticalAlign"), s.verticalAlign === "superscript" ? s.verticalAlign = k.VerticalAlignment.Super : s.verticalAlign === "subscript" && (s.verticalAlign = k.VerticalAlignment.Sub), y(t, e, s, "sz", "size");
952
+ const o = t.evaluate("color", e);
953
+ this.processDataBarColor(t, o, s, "fill"), s.fill || (s.fill = "dk1"), b(t, e, s, "name", "family"), b(t, e, s, "rFont", "family");
954
+ const i = t.evaluate("family", e);
955
+ if (i) {
956
+ const n = i.getAttribute("val");
957
+ if (n) switch (n) {
958
+ case "1":
959
+ s.fallbacks = ["serif"];
960
+ break;
961
+ case "2":
962
+ s.fallbacks = ["sans-serif"];
963
+ break;
964
+ case "3":
965
+ s.fallbacks = ["monospace"];
966
+ break;
967
+ case "4":
968
+ s.fallbacks = ["cursive"];
969
+ break;
970
+ case "5":
971
+ s.fallbacks = ["fantasy"];
972
+ }
973
+ }
974
+ return b(t, e, s, "scheme", "scheme"), m(t, e, s, "shadow", "shadow", !0), m(t, e, s, "outline", "outline", !0), t.getValAttrAsBoolean("condense", e, !0) && (s.letterSpacing = -1), t.getValAttrAsBoolean("extend", e, !0) && (s.letterSpacing = 1), b(t, e, s, "charset", "charset"), s;
975
+ }
976
+ processFills(t, e, s) {
977
+ if (!e) return;
978
+ const r = e.childNodes;
979
+ let o = 0;
980
+ for (let i = 0; i < r.length; i++) {
981
+ const n = r.item(i);
982
+ n.nodeType === 1 && n.localName === "fill" && this.processFill(t, n, s, o++);
983
+ }
984
+ return s;
985
+ }
986
+ processFill(t, e, s, r) {
987
+ const o = { type: C.Type.None }, i = e.childNodes;
988
+ let n = !1;
989
+ for (let l = 0; !n && l < i.length; l++) {
990
+ const a = i.item(l);
991
+ a.nodeType === 1 && (a.localName === "gradientFill" ? (this.processGradientFill(t, a, o), n = !0) : a.localName === "patternFill" && (this.processPatternFill(t, a, o), n = !0));
992
+ }
993
+ return s[r] = o, s;
994
+ }
995
+ processGradientFill(t, e, s) {
996
+ if (!e) return;
997
+ s.type = C.Type.Gradient;
998
+ const r = [];
999
+ s.stops = r, s.angle = 90 + (e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0);
1000
+ const o = e.getAttribute("type");
1001
+ o && (s.gradientType = o);
1002
+ const i = (l) => {
1003
+ if (!l) return 0;
1004
+ const a = parseFloat(l);
1005
+ return isNaN(a) ? 0 : a;
1006
+ };
1007
+ (e.hasAttribute("left") || e.hasAttribute("top") || e.hasAttribute("right") || e.hasAttribute("bottom")) && (s.fillTo = { left: i(e.getAttribute("left")), top: i(e.getAttribute("top")), right: i(e.getAttribute("right")), bottom: i(e.getAttribute("bottom")) });
1008
+ const n = e.childNodes;
1009
+ for (let l = 0; l < n.length; l++) {
1010
+ const a = n.item(l);
1011
+ if (a.nodeType === 1 && a.localName === "stop") {
1012
+ const c = {};
1013
+ r.push(c);
1014
+ const h = parseFloat(a.getAttribute("position"));
1015
+ c.offset = h;
1016
+ const p = t.evaluate("color", a);
1017
+ this.processDataBarColor(t, p, c, "color");
1018
+ }
1019
+ }
1020
+ return s;
1021
+ }
1022
+ processPatternFill(t, e, s) {
1023
+ if (!e) return;
1024
+ const r = t.getVisitorParamsState().get("processingDXFs"), o = e.getAttribute("patternType") || (r ? C.BuiltInSheetPattern.Solid : C.BuiltInSheetPattern.None);
1025
+ if (o === C.BuiltInSheetPattern.None) return { none: !0 };
1026
+ s.type = C.Type.Pattern, o && (s.patternType = o);
1027
+ let i, n = "foreground", l = "background";
1028
+ const a = s.patternType === C.BuiltInSheetPattern.Solid && r;
1029
+ if (a) {
1030
+ i = "lt1";
1031
+ const p = n;
1032
+ n = l, l = p;
1033
+ }
1034
+ const c = t.evaluate("fgColor", e);
1035
+ this.processDataBarColor(t, c, s, n, i);
1036
+ const h = t.evaluate("bgColor", e);
1037
+ return this.processDataBarColor(t, h, s, l, i), a && !s.foreground && (s.foreground = i), s;
1038
+ }
1039
+ processBorders(t, e, s, r) {
1040
+ if (!e) return;
1041
+ const o = e.childNodes;
1042
+ let i = 0;
1043
+ for (let n = 0; n < o.length; n++) {
1044
+ const l = o.item(n);
1045
+ l.nodeType === 1 && l.localName === "border" && this.processBorder(t, l, s, i++, r);
1046
+ }
1047
+ return s;
1048
+ }
1049
+ processBorder(t, e, s, r, o) {
1050
+ if (!e) return;
1051
+ const i = {};
1052
+ return this.processBorderStroke(t, e, i, V.Edge.Left), this.processBorderStroke(t, e, i, V.Edge.Right), o ? (i.right || i.left) && (i.right ? i.vertical = { ...i.right } : i.vertical = { ...i.left }) : this.processBorderStroke(t, e, i, V.Edge.Vertical), this.processBorderStroke(t, e, i, V.Edge.Top), this.processBorderStroke(t, e, i, V.Edge.Bottom), o ? (i.bottom || i.top) && (i.right ? i.horizontal = { ...i.bottom } : i.horizontal = { ...i.top }) : this.processBorderStroke(t, e, i, V.Edge.Horizontal), s[r] = i, s;
1053
+ }
1054
+ processBorderStroke(t, e, s, r) {
1055
+ if (!e) return;
1056
+ const o = t.evaluate(r, e);
1057
+ if (!o) return;
1058
+ const i = {};
1059
+ o.hasAttribute("style") && (i.style = o.getAttribute("style"));
1060
+ const n = t.evaluate("color", o);
1061
+ return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? s[r] = i : null;
1062
+ }
1063
+ }
1064
+ class Tt extends Q {
1065
+ visit(t, e, s) {
1066
+ this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1067
+ const r = { fills: {}, fonts: {}, borders: {} };
1068
+ 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: C.Type.None }, r.fills[1] = { type: C.Type.Pattern, patternType: C.BuiltInSheetPattern.Gray125 }, r.borders[0] = {};
1069
+ const o = [];
1070
+ this.processXFs(t, t.evaluate("cellStyleXfs", e), o, r, null, !1);
1071
+ const i = /* @__PURE__ */ new Map();
1072
+ if (o.length > 0) {
1073
+ const a = [];
1074
+ this.processCellStyles(t, t.evaluate("cellStyles", e), a, o, i), s.named = a;
1075
+ }
1076
+ const n = [];
1077
+ this.processXFs(t, t.evaluate("cellXfs", e), n, r, i), Object.keys(n).length > 0 && (s.direct = n);
1078
+ const l = [];
1079
+ return this.processDXFs(t, t.evaluate("dxfs", e), l), this.processTableStyles(t, t.evaluate("tableStyles", e), s, l), this.processIndexColors(t, t.evaluate("colors/indexedColors", e), s), this.processMruColors(t, t.evaluate("colors/mruColors", e), s), s;
1080
+ }
1081
+ processIndexColors(t, e, s) {
1082
+ if (!e) return;
1083
+ const r = [], o = e.childNodes;
1084
+ for (let i = 0; i < o.length; i++) {
1085
+ const n = o.item(i);
1086
+ if (n.nodeType === 1 && n.localName === "rgbColor") {
1087
+ const l = { color: null };
1088
+ this.processDataBarColor(t, n, l, "color"), l.color && r.push(l.color);
1089
+ }
1090
+ }
1091
+ s.indexedColors = r;
1092
+ }
1093
+ processMruColors(t, e, s) {
1094
+ if (!e) return;
1095
+ const r = [], o = e.childNodes;
1096
+ for (let i = 0; i < o.length; i++) {
1097
+ const n = o.item(i);
1098
+ if (n.nodeType === 1 && n.localName === "color") {
1099
+ const l = { color: null };
1100
+ this.processDataBarColor(t, n, l, "color"), l.color && r.push(l.color);
1101
+ }
1102
+ }
1103
+ r.length > 0 && (s.mruColors = r);
1104
+ }
1105
+ processNumFmts(t, e, s) {
1106
+ if (!e) return;
1107
+ const r = /* @__PURE__ */ new Map();
1108
+ if (t.getVisitorParamsState().set("numFmts", r), !e) return;
1109
+ const o = e.childNodes;
1110
+ for (let i = 0; i < o.length; i++) {
1111
+ const n = o.item(i);
1112
+ if (n.nodeType === 1 && n.localName === "numFmt") {
1113
+ const l = n.getAttribute("numFmtId"), a = n.getAttribute("formatCode");
1114
+ if (l && a) {
1115
+ const c = a.replace(/\\(.)/g, "$1");
1116
+ r.set(parseInt(l), c);
1117
+ }
1118
+ }
1119
+ }
1120
+ }
1121
+ processXFs(t, e, s, r, o = null, i = !0) {
1122
+ if (!e) return;
1123
+ const n = e.childNodes;
1124
+ for (let l = 0; l < n.length; l++) {
1125
+ const a = n.item(l);
1126
+ if (a.nodeType === 1 && a.localName === "xf") {
1127
+ const c = {};
1128
+ this.processXF(t, a, c, r, o, i), s.push(c);
1129
+ }
1130
+ }
1131
+ }
1132
+ processXF(t, e, s, r, o, i) {
1133
+ if (!e) return;
1134
+ const n = e.getAttribute("xfId");
1135
+ if (n && o) {
1136
+ const c = o.get(parseInt(n));
1137
+ c && c !== tt.BuiltInName.Normal && (s.named = c);
1138
+ }
1139
+ const l = (c) => !(!i && e.hasAttribute(c)) || f(e.getAttribute("applyFont"));
1140
+ if (l("applyFont")) {
1141
+ const c = r.fonts[e.getAttribute("fontId")];
1142
+ c && (s.font = c);
1143
+ }
1144
+ if (l("applyFill")) {
1145
+ const c = r.fills[e.getAttribute("fillId")];
1146
+ c && Object.keys(c).length > 0 && (s.fill = c);
1147
+ }
1148
+ if (l("applyBorder")) {
1149
+ const c = r.borders[e.getAttribute("borderId")];
1150
+ c && Object.keys(c).length > 0 && (s.border = c);
1151
+ }
1152
+ if (l("applyNumberFormat")) {
1153
+ const c = e.getAttribute("numFmtId");
1154
+ if (c) {
1155
+ const h = parseInt(c);
1156
+ let p;
1157
+ const g = t.getVisitorParamsState();
1158
+ if (g) {
1159
+ const d = g.get("numFmts");
1160
+ d && (p = d.get(h)), s.numberFormat = p ?? h;
1161
+ } else console.warn("no visitor params state");
1162
+ }
1163
+ }
1164
+ l("applyAlignment") && this.processAlignment(t, t.evaluate("alignment", e), s), l("applyProtection") && this.processProtection(t, t.evaluate("protection", e), s);
1165
+ const a = f(e.getAttribute("quotePrefix"));
1166
+ a && (s.quotePrefix = a);
1167
+ }
1168
+ processAlignment(t, e, s) {
1169
+ const r = {};
1170
+ if (e?.hasAttribute("horizontal") ? r.horizontal = e.getAttribute("horizontal") : r.horizontal = P.HorizontalAlignment.General, e?.hasAttribute("vertical") ? r.vertical = e.getAttribute("vertical") : r.vertical = P.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, f(e?.getAttribute("wrapText")) ? r.overflow = P.Overflow.Wrap : r.overflow = P.Overflow.Visible, f(e?.getAttribute("shrinkToFit")) && (r.overflow = P.Overflow.Shrink), e?.hasAttribute("textRotation")) {
1171
+ let i = parseFloat(e.getAttribute("textRotation"));
1172
+ i > 0 && i <= 90 ? i = 360 - i : i > 90 && i <= 180 ? i -= 90 : i === 255 && (i = 0, r.stacked = !0), r.rotation = i;
1173
+ } else r.rotation = 0;
1174
+ e?.hasAttribute("justifyLastLine") && (r.justifyLastLine = f(e.getAttribute("justifyLastLine")));
1175
+ const o = e?.getAttribute("readingOrder");
1176
+ return o && (o === "0" ? r.readingDirection = P.ReadingDirection.Auto : o === "1" ? r.readingDirection = P.ReadingDirection.LeftToRight : o === "2" ? r.readingDirection = P.ReadingDirection.RightToLeft : console.warn(`invalid readingOrder: ${o}`)), Object.keys(r).length > 0 && (s.alignment = r), s;
1177
+ }
1178
+ processProtection(t, e, s) {
1179
+ if (!e) return;
1180
+ const r = {}, o = e.getAttribute("locked");
1181
+ o && !f(o) && (r.edit = !0);
1182
+ const i = e.getAttribute("hidden");
1183
+ return i && f(i) && (r.formulaHidden = !0), Object.keys(r).length > 0 && (s.protection = r), s;
1184
+ }
1185
+ processDXF(t, e, s) {
1186
+ if (!e) return;
1187
+ const r = e.childNodes;
1188
+ for (let o = 0; o < r.length; o++) {
1189
+ const i = r.item(o);
1190
+ if (i.nodeType === 1 && i.localName === "font") {
1191
+ const n = {};
1192
+ this.processFont(t, i, n), s.font = n;
1193
+ } else if (i.nodeType === 1 && i.localName === "fill") {
1194
+ const n = [];
1195
+ this.processFill(t, i, n, 0), n.length > 0 && n[0] && (s.fill = n[0]);
1196
+ } else if (i.nodeType === 1 && i.localName === "border") {
1197
+ const n = [];
1198
+ this.processBorder(t, i, n, 0, !1), n.length > 0 && n[0] && (s.border = n[0]);
1199
+ }
1200
+ }
1201
+ }
1202
+ processDXFs(t, e, s) {
1203
+ if (!e) return;
1204
+ t.getVisitorParamsState().set("processingDXFs", !0);
1205
+ const r = /* @__PURE__ */ new Map();
1206
+ t.getVisitorParamsState().set("dxfs", r);
1207
+ const o = e.childNodes;
1208
+ for (let i = 0; i < o.length; i++) {
1209
+ const n = o.item(i);
1210
+ if (n.nodeType === 1 && n.localName === "dxf") {
1211
+ const l = {};
1212
+ this.processDXF(t, n, l);
1213
+ const a = s.length;
1214
+ r.set(a, l), s.push(l);
1215
+ }
1216
+ }
1217
+ t.getVisitorParamsState().delete("processingDXFs");
1218
+ }
1219
+ processTableStyle(t, e, s, r, o = !1) {
1220
+ const i = e.getAttribute("name"), n = { name: i };
1221
+ e.hasAttribute("table") && (n.table = f(e.getAttribute("table"))), e.hasAttribute("pivot") && (n.pivot = f(e.getAttribute("pivot"))), o && !n.pivot && r.unshift(null);
1222
+ const l = e.childNodes;
1223
+ for (let a = 0; a < l.length; a++) {
1224
+ const c = l.item(a);
1225
+ if (c.nodeType === 1 && c.localName === "tableStyleElement") {
1226
+ const h = c.getAttribute("type"), p = c.getAttribute("dxfId");
1227
+ let g = r?.[p];
1228
+ g || (console.warn("invalid dfx id", p), g = {}), n[h] = g;
1229
+ let d = null;
1230
+ c.hasAttribute("size") && (d = parseInt(c.getAttribute("size"))), d && !isNaN(d) && (g.size = d);
1231
+ }
1232
+ }
1233
+ delete n.name, s[i] = n;
1234
+ }
1235
+ processTableStyles(t, e, s, r, o) {
1236
+ if (!e) return;
1237
+ const i = {}, n = e.getAttribute("defaultTableStyle");
1238
+ n && (i.defaultTableStyle = n);
1239
+ const l = e.getAttribute("defaultPivotStyle");
1240
+ l && (i.defaultPivotStyle = l);
1241
+ const a = e.childNodes, c = {};
1242
+ for (let h = 0; h < a.length; h++) {
1243
+ const p = a.item(h);
1244
+ p.nodeType === 1 && p.localName === "tableStyle" && this.processTableStyle(t, p, c, r, o);
1245
+ }
1246
+ return Object.keys(c).length > 0 && (i.styles = c), Object.keys(i).length > 0 && (s.tables = i), s;
1247
+ }
1248
+ processCellStyles(t, e, s, r, o) {
1249
+ if (!e) return;
1250
+ const i = e.childNodes;
1251
+ for (let n = 0; n < i.length; n++) {
1252
+ const l = i.item(n);
1253
+ if (l.nodeType === 1 && l.localName === "cellStyle") {
1254
+ const a = parseInt(l.getAttribute("xfId")), c = l.getAttribute("name");
1255
+ if (o.set(a, c), !r[a]) continue;
1256
+ const h = { name: c, style: r[a] };
1257
+ l.getAttribute("hidden") && (h.hidden = f(l.getAttribute("hidden"))), l.getAttribute("iLevel") && (h.iLevel = parseInt(l.getAttribute("iLevel"))), s.push(h);
1258
+ }
1259
+ }
1260
+ }
1261
+ afterVisit(t, e, s) {
1262
+ }
1263
+ }
1264
+ class Vt extends Q {
1265
+ visit(t, e, s) {
1266
+ 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;
1267
+ }
1268
+ processPassword(t, e, s, r = "password") {
1269
+ if (!e) return;
1270
+ const o = {};
1271
+ 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);
1272
+ }
1273
+ processWorkbookProtection(t, e, s) {
1274
+ if (!e) return;
1275
+ const r = {};
1276
+ this.processPassword(t, t.evaluate("workbookPassword", e), r), this.processPassword(t, t.evaluate("revisionsPassword", e), r, "revisionsPassword");
1277
+ const o = (i) => i !== !0 && i !== "1" && i !== "on" && i !== "true" && (i === !1 || i === "0" || i === "off" || i === "false" || null);
1278
+ 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;
1279
+ }
1280
+ processCalcPr(t, e, s) {
1281
+ e && (s.calc = {});
1282
+ }
1283
+ processSheetRefs(t, e, s) {
1284
+ if (!e) return;
1285
+ const r = [], o = e.childNodes;
1286
+ for (let i = 0; i < o.length; i++) {
1287
+ const n = o.item(i);
1288
+ n.nodeType === 1 && n.localName === "sheet" && this.processSheetRef(t, n, r);
1289
+ }
1290
+ s.sheets = r;
1291
+ }
1292
+ processSheetRef(t, e, s) {
1293
+ const r = {};
1294
+ t.copyFromAttribute(e, "name", r, "name"), t.copyFromAttribute(e, "state", r, "visibility");
1295
+ const o = e.getAttribute("r:id"), i = t.getRef(o);
1296
+ i && (r.sheet = i), s.push(r);
1297
+ }
1298
+ processBookViews(t, e, s) {
1299
+ if (!e) return;
1300
+ const r = e.childNodes;
1301
+ let o = 0;
1302
+ for (let i = 0; o < 1 && i < e.childNodes.length; i++) {
1303
+ const n = r.item(i);
1304
+ n.nodeType === 1 && n.localName === "workbookView" && (this.processWorkbookView(t, n, s), o++);
1305
+ }
1306
+ }
1307
+ processWorkbookView(t, e, s) {
1308
+ if (!e) return;
1309
+ const r = {};
1310
+ t.copyFromAttribute(e, "activeTab", r, "activeSheetId", [t.INT_COPY, (o) => o + 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, (o) => o]), Object.keys(r).length > 0 && (s.view = r);
1311
+ }
1312
+ processDefineName(t, e, s, r) {
1313
+ if (!e) return;
1314
+ const o = {}, i = e.firstChild;
1315
+ if (i && i.nodeType === 3 && (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")) {
1316
+ const n = e.getAttribute("localSheetId");
1317
+ if (!r[n]?.name) return void console.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);
1318
+ o.scope = r[n].name;
1319
+ }
1320
+ 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);
1321
+ }
1322
+ processDefinedNames(t, e, s) {
1323
+ if (!e) return;
1324
+ const r = [], o = e.childNodes;
1325
+ for (let i = 0; i < o.length; i++) {
1326
+ const n = o.item(i);
1327
+ n.nodeType === 1 && n.localName === "definedName" && this.processDefineName(t, n, r, s.sheets);
1328
+ }
1329
+ r.length > 0 && (s.names = r);
1330
+ }
1331
+ processWorkbookPr(t, e, s) {
1332
+ e && t.copyFromAttribute(e, "date1904", s, "date1904", t.BOOLEAN_COPY);
1333
+ }
1334
+ afterVisit(t, e, s) {
1335
+ }
1336
+ }
1337
+ class St {
1338
+ visit(t, e, s) {
1339
+ 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;
1340
+ }
1341
+ processTableStyleInfo(t, e, s) {
1342
+ if (!e) return;
1343
+ const r = e.childNodes, o = {};
1344
+ for (let i = 0; i < r.length; i++) {
1345
+ const n = r.item(i);
1346
+ n.nodeType === 1 && n.localName === "tableStyleInfo" && (t.copyFromAttribute(n, "name", o), t.copyFromAttribute(n, "showColumnStripes", o, "showColumnStripes", t.BOOLEAN_COPY), t.copyFromAttribute(n, "showFirstColumn", o, "showFirstColumn", t.BOOLEAN_COPY), t.copyFromAttribute(n, "showLastColumn", o, "showLastColumn", t.BOOLEAN_COPY), t.copyFromAttribute(n, "showRowStripes", o, "showRowStripes", t.BOOLEAN_COPY));
1347
+ }
1348
+ Object.keys(o).length > 0 && (s.styleOptions = o);
1349
+ }
1350
+ processTableColumn(t, e, s) {
1351
+ if (!e) return null;
1352
+ const r = e.childNodes;
1353
+ for (let o = 0; o < r.length; o++) {
1354
+ const i = r.item(o);
1355
+ if (i.nodeType === 1 && i.localName === "tableColumn") {
1356
+ const n = {};
1357
+ t.copyFromAttribute(i, "name", n), t.copyFromAttribute(i, "uniqueName", n), s.push(n);
1358
+ }
1359
+ }
1360
+ return s;
1361
+ }
1362
+ processTableColumns(t, e, s) {
1363
+ const r = e.childNodes, o = [];
1364
+ for (let i = 0; i < r.length; i++) {
1365
+ const n = r.item(i);
1366
+ n.nodeType === 1 && n.localName === "tableColumns" && this.processTableColumn(t, n, o);
1367
+ }
1368
+ o.length > 0 && (s.columns = o);
1369
+ }
1370
+ }
1371
+ class kt {
1372
+ visit(t, e, s) {
1373
+ return s;
1374
+ }
1375
+ }
1376
+ class E {
1377
+ visit(t, e, s) {
1378
+ if (!e) return;
1379
+ const r = {};
1380
+ 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;
1381
+ }
1382
+ processOffsetCoord(t, e, s, r) {
1383
+ if (!e) return;
1384
+ const o = { c: 0, r: 0, x: 0, y: 0 };
1385
+ 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 = x(t.evaluate("colOff", e).textContent)), t.evaluate("rowOff", e) && (o.y = x(t.evaluate("rowOff", e).textContent)), r === "from" ? s.tl = o : s.br = o, s;
1386
+ }
1387
+ }
1388
+ class U {
1389
+ visit(t, e, s) {
1390
+ if (!e) return;
1391
+ const r = t.evaluate("*/cNvPr", e);
1392
+ 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;
1393
+ }
1394
+ }
1395
+ class xt extends U {
1396
+ visit(t, e, s) {
1397
+ if (!e) return;
1398
+ s = super.visit(t, e, s);
1399
+ const r = t.evaluate("nvGraphicFramePr/cNvGraphicFramePr", e);
1400
+ if (r) {
1401
+ const n = t.evaluate("graphicFrameLocks", r);
1402
+ if (n) {
1403
+ n.hasAttribute("noChangeAspect") && (s.lockAspect = n.getAttribute("noChangeAspect") === "1");
1404
+ const l = {};
1405
+ Object.keys(l).length > 0 && (s.locks = l);
1406
+ }
1407
+ }
1408
+ let o = { type: "graphicFrame", json: {} };
1409
+ const i = t.evaluate("graphic/graphicData", e).childNodes;
1410
+ for (let n = 0; n < i.length; n++) {
1411
+ const l = i.item(n);
1412
+ if (l.nodeType === 1) try {
1413
+ let a = l.localName;
1414
+ a === "chart" && (a = "chart"), o.type = a;
1415
+ const c = l.getAttribute("r:id");
1416
+ c && (o.json = t.getRef(c));
1417
+ } catch (a) {
1418
+ console.warn("Unable to parse graphicFrame", a);
1419
+ }
1420
+ }
1421
+ return o && (s.content = o), o;
1422
+ }
1423
+ }
1424
+ class z extends U {
1425
+ visit(t, e, s) {
1426
+ if (!e) return;
1427
+ s = super.visit(t, e, s);
1428
+ const r = t.evaluate("nvSpPr/cNvSpPr", e);
1429
+ if (r) {
1430
+ const i = t.evaluate("spLocks", r);
1431
+ if (i) {
1432
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1433
+ const n = {};
1434
+ Object.keys(n).length > 0 && (s.locks = n);
1435
+ }
1436
+ }
1437
+ t.warn(`Unable to import '${s.name}', shapes are not supported.`);
1438
+ const o = {};
1439
+ return s.content = { type: "sp", json: o }, o;
1440
+ }
1441
+ }
1442
+ class Lt extends U {
1443
+ visit(t, e, s) {
1444
+ if (!e) return;
1445
+ const r = super.visit(t, e, s), o = t.evaluate("nvPicPr/cNvPicPr", e);
1446
+ if (o) {
1447
+ t.copyFromAttribute(e, "preferRelativeResize", r, "preferRelativeResize", t.BOOLEAN_COPY);
1448
+ const a = t.evaluate("picLocks", o);
1449
+ if (a) {
1450
+ a.hasAttribute("noChangeAspect") && (r.lockAspect = a.getAttribute("noChangeAspect") === "1");
1451
+ const c = {};
1452
+ t.copyFromAttribute(a, "noChangeArrowheads", r, "noChangeArrowheads", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noChangeShapeType", r, "noChangeShapeType", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noEditPoints", r, "noEditPoints", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noAdjustHandles", r, "noAdjustHandles", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noCrop", r, "noCrop", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noGrp", r, "noGrp", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noMove", r, "noMove", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noResize", r, "noResize", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noRot", r, "noRot", t.BOOLEAN_COPY), t.copyFromAttribute(a, "noSelect", r, "noSelect", t.BOOLEAN_COPY), Object.keys(c).length > 0 && (r.locks = c);
1453
+ }
1454
+ }
1455
+ const i = t.evaluate("blipFill/blip", e);
1456
+ let n;
1457
+ if (i) {
1458
+ const a = i.getAttribute("r:embed") ?? i.getAttribute("embed");
1459
+ if (!a) return void console.warn("no rId found for blip", i);
1460
+ n = t.getRef(a, !0);
1461
+ }
1462
+ const l = { resId: n };
1463
+ return s.content = { type: "picture", json: l }, r;
1464
+ }
1465
+ }
1466
+ class It extends z {
1467
+ visit(t, e, s) {
1468
+ if (!e) return;
1469
+ s = super.visit(t, e, s);
1470
+ const r = t.evaluate("nvGrpSpPr/cNvGrpSpPr", e);
1471
+ if (r) {
1472
+ const i = t.evaluate("grpSpLocks", r);
1473
+ if (i) {
1474
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1475
+ const n = {};
1476
+ Object.keys(n).length > 0 && (s.locks = n);
1477
+ }
1478
+ }
1479
+ t.warn(`Unable to import '${s.name}', group shapes are not supported.`);
1480
+ const o = {};
1481
+ return s.content = { type: "grpSp", json: o }, o;
1482
+ }
1483
+ }
1484
+ class Bt extends z {
1485
+ visit(t, e, s) {
1486
+ if (!e) return;
1487
+ s = super.visit(t, e, s);
1488
+ const r = t.evaluate("nvCxnSpPr/cNvCxnSpPr", e);
1489
+ if (r) {
1490
+ const i = t.evaluate("cxnSpLocks", r);
1491
+ if (i) {
1492
+ i.hasAttribute("noChangeAspect") && (s.lockAspect = i.getAttribute("noChangeAspect") === "1");
1493
+ const n = {};
1494
+ Object.keys(n).length > 0 && (s.locks = n);
1495
+ }
1496
+ }
1497
+ t.warn(`Unable to import '${s.name}', connection shapes are not supported.`);
1498
+ const o = {};
1499
+ return s.content = { type: "cxnSp", json: o }, o;
1500
+ }
1501
+ }
1502
+ const $ = "richTypes";
1503
+ class _t {
1504
+ visit(t, e, s) {
1505
+ let r = t.getVisitorParamsState().get($);
1506
+ r || (r = [], t.getVisitorParamsState().set($, r));
1507
+ const o = e.childNodes, i = o.length;
1508
+ for (let n = 0; n < i; n++) {
1509
+ const l = o.item(n);
1510
+ if (l.nodeType === 1 && l.localName === "s") {
1511
+ const a = { type: l.getAttribute("t") ?? "n", keys: [] };
1512
+ this.processKeys(t, l, a), r.push(a);
1513
+ }
1514
+ }
1515
+ return s.richTypes = r, r;
1516
+ }
1517
+ processKeys(t, e, s) {
1518
+ const r = e.childNodes, o = r.length, i = s.keys;
1519
+ for (let n = 0; n < o; n++) {
1520
+ const l = r.item(n);
1521
+ if (l.nodeType === 1 && l.localName === "k") {
1522
+ const a = l.getAttribute("n"), c = l.getAttribute("t");
1523
+ i.push([a, c]);
1524
+ }
1525
+ }
1526
+ }
1527
+ }
1528
+ const K = "richData";
1529
+ class jt {
1530
+ visit(t, e, s) {
1531
+ let r = t.getVisitorParamsState().get("richTypes");
1532
+ if (!r) return void t.warn("RichValueFound but not type.");
1533
+ let o = t.getVisitorParamsState().get(K);
1534
+ o || (o = [], t.getVisitorParamsState().set(K, o));
1535
+ const i = e.childNodes, n = i.length;
1536
+ for (let l = 0; l < n; l++) {
1537
+ const a = i.item(l);
1538
+ if (a.nodeType === 1 && a.localName === "rv") {
1539
+ const c = r[a.getAttribute("s")], h = { type: c.type };
1540
+ this.processValues(t, a, h, c);
1541
+ const p = this.mapType(t, h);
1542
+ o.push(p);
1543
+ }
1544
+ }
1545
+ return s.richData = o, o;
1546
+ }
1547
+ mapType(t, e) {
1548
+ if (e.type === "_error") {
1549
+ const s = e.errorType;
1550
+ if (s) try {
1551
+ e = et.getBuiltInById(s + 1);
1552
+ } catch {
1553
+ }
1554
+ }
1555
+ return e;
1556
+ }
1557
+ processValues(t, e, s, r) {
1558
+ const o = e.childNodes, i = o.length;
1559
+ r.type;
1560
+ const n = r.keys;
1561
+ for (let l = 0; l < i; l++) {
1562
+ const a = o.item(l);
1563
+ if (a.nodeType === 1 && a.localName === "v") {
1564
+ const c = n[l];
1565
+ if (!c) return void t.warn("Invalid richData");
1566
+ const h = c[0], p = c[1];
1567
+ let g = a.textContent;
1568
+ p === "i" && (g = Number(g)), s[h] = g;
1569
+ }
1570
+ }
1571
+ }
1572
+ }
1573
+ class Rt {
1574
+ visit(t, e, s) {
1575
+ if (!e) return;
1576
+ const r = [];
1577
+ return this.processAuthors(t, t.evaluate("authors", e), r), r.length > 0 && (s.authors = r), s.comments = [], s;
1578
+ }
1579
+ processAuthors(t, e, s) {
1580
+ if (!e) return;
1581
+ const r = e.childNodes;
1582
+ for (let o = 0; o < r.length; o++) {
1583
+ const i = r.item(o);
1584
+ if (i.nodeType === 1 && i.localName === "author") {
1585
+ const n = i.firstChild;
1586
+ n && n.nodeType === 3 && s.push(n.textContent);
1587
+ }
1588
+ }
1589
+ }
1590
+ }
1591
+ class Et {
1592
+ visit(t, e, s) {
1593
+ if (!e) return;
1594
+ const r = {};
1595
+ 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;
1596
+ }
1597
+ }
1598
+ class Yt {
1599
+ visit(t, e, s) {
1600
+ if (!e) return;
1601
+ const r = [];
1602
+ return s.comments = r, r;
1603
+ }
1604
+ }
1605
+ class Dt {
1606
+ visit(t, e, s) {
1607
+ if (!e) return;
1608
+ const r = {};
1609
+ return t.copyFromAttribute(e, "id", r, "id", L), t.copyFromAttribute(e, "personId", r, "personId", L), t.copyFromAttribute(e, "ref", r), t.copyFromAttribute(e, "parentId", r, "parentId", L), t.copyFromAttribute(e, "dT", r), e.hasAttribute("done") && (r.done = f(e.getAttribute("done"))), s.push(r), r;
1610
+ }
1611
+ }
1612
+ class Mt {
1613
+ visit(t, e, s) {
1614
+ const r = [], o = e.childNodes;
1615
+ for (let i = 0; i < o.length; i++) {
1616
+ const n = o.item(i);
1617
+ if (n.nodeType === 1 && n.localName === "person") {
1618
+ const l = {};
1619
+ t.copyFromAttribute(n, "id", l, "id", L), t.copyFromAttribute(n, "displayName", l), t.copyFromAttribute(n, "userId", l, "userId", L), t.copyFromAttribute(n, "providerId", l), r.push(l);
1620
+ }
1621
+ }
1622
+ return r.length > 0 && (s.persons = r), r;
1623
+ }
1624
+ }
1625
+ const Ut = {};
1626
+ class zt {
1627
+ constructor(t, e) {
1628
+ this.path = t, this.visitor = e;
1629
+ }
1630
+ }
1631
+ class Xt {
1632
+ constructor() {
1633
+ this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new ct()), this.registerVisitor("spPr", new M()), this.registerVisitor("txBody", new F()), this.registerVisitor("txPr", new F()), this.registerVisitor("c:chartSpace", new ut()), this.registerVisitor("c:chartSpace", new ht(), "chart"), this.registerVisitor("c:plotArea", new pt()), this.registerVisitor("c:barChart", new gt()), this.registerVisitor("c:doughnutChart", new S()), this.registerVisitor("c:lineChart", new S()), this.registerVisitor("c:ofPieType", new S()), this.registerVisitor("c:pieChart", new S()), this.registerVisitor("c:scatterChart", new S()), this.registerVisitor("c:barChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new N("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new N("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new dt()), this.registerVisitor("c:dPt", new mt()), this.registerVisitor("c:marker", new bt()), this.registerVisitor("c:catAx", new R()), this.registerVisitor("c:valAx", new R()), this.registerVisitor("c:dateAx", new R()), this.registerVisitor("c:majorGridlines", new j("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new j("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new F("labels.text"), "txPr"), this.registerVisitor("c:valAx", new F("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new F("labels.text"), "txPr"), this.registerVisitor("c:legend", new At()), this.registerVisitor("c:legend", new F("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new ft()), this.registerVisitor("c:ser", new yt(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new N("labels"), "dLbls"), this.registerVisitor("c:dLbl", new N("points")), this.registerVisitor("c:title", new X()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new vt()), this.registerVisitor("c:dispUnits", new j("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new X("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new F(), "tx/rich"), this.registerVisitor("a:theme", new Ft()), this.registerVisitor("a:theme", new Ct(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new wt(), "themeElements/fontScheme"), this.registerVisitor("autoFilter", new Nt()), this.registerVisitor("sortState", new Ot()), this.registerVisitor("s:workbook", new Vt()), this.registerVisitor("styleSheet", new Tt()), this.registerVisitor("table", new St()), this.registerVisitor("hlinkClick", new Pt()), this.registerVisitor("wsDr", new kt()), this.registerVisitor("twoCellAnchor", new E()), this.registerVisitor("oneCellAnchor", new E()), this.registerVisitor("absoluteAnchor", new E()), this.registerVisitor("graphicFrame", new xt()), this.registerVisitor("sp", new z()), this.registerVisitor("grpSp", new It()), this.registerVisitor("cxnSp", new Bt()), this.registerVisitor("pic", new Lt()), this.registerVisitor("rvStructures", new _t()), this.registerVisitor("rvData", new jt()), this.registerVisitor("comments", new Rt()), this.registerVisitor("commentList", new Et(), "comment"), this.registerVisitor("comment", new F("content"), "text"), this.registerVisitor("ThreadedComments", new Yt()), this.registerVisitor("threadedComment", new Dt()), this.registerVisitor("threadedComment", new F("content"), "text"), this.registerVisitor("personList", new Mt());
1634
+ }
1635
+ registerVisitor(t, e, s = null) {
1636
+ t.indexOf(":") === -1 && (t = "*:" + t);
1637
+ const r = t.split(":"), o = r.length > 1 ? r[1] : r[0];
1638
+ if (!s) return this.visitorsByXmlTagName.set(o, e), void this.visitorsByXmlTagName.set(t, e);
1639
+ let i = this.scopedVisitorsByXmlTagName.get(o);
1640
+ i || (i = [], this.scopedVisitorsByXmlTagName.set(o, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new zt(s, e));
1641
+ }
1642
+ getVisitorParamsState() {
1643
+ return this.visitorParamsState;
1644
+ }
1645
+ convert(t, e, s = Ut) {
1646
+ const r = t.documentElement;
1647
+ this.visitorParamsState && !s?.paramMap || (this.visitorParamsState = s?.paramMap ?? /* @__PURE__ */ new Map());
1648
+ const o = {};
1649
+ let i = this.visitorsByXmlTagName.get(r.nodeName);
1650
+ 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.`);
1651
+ const n = "/" + r.localName, l = new _(null, this, n, r, o, e, s), a = [];
1652
+ this._doWalk(i, l, a, r, o, e, s);
1653
+ for (let c = 0; c < a.length; c++) {
1654
+ const h = a[c];
1655
+ try {
1656
+ h.visitor?.afterVisit?.(h.context, h.elemParent, h.jsonParent);
1657
+ } catch (p) {
1658
+ console.warn(`Error in afterVisit: ${h.context.getPath()}`, p);
1659
+ }
1660
+ }
1661
+ return o;
1662
+ }
1663
+ _walkScoped(t, e, s, r, o, i, n) {
1664
+ const l = this.scopedVisitorsByXmlTagName.get(t);
1665
+ for (let a = 0; l && a < l.length; a++) {
1666
+ const c = l[a];
1667
+ let h = null;
1668
+ try {
1669
+ h = e.evaluate(c.path, r);
1670
+ } catch {
1671
+ console.warn(`"Invalid path '${c.path}' for '${t}'.`);
1672
+ }
1673
+ if (!h) continue;
1674
+ const p = (g) => {
1675
+ let d = g.localName, v = g.parentNode;
1676
+ for (; v && v !== r; ) d = v.localName + "/" + d, v = v.parentNode;
1677
+ const O = e.getPath() + "/" + d;
1678
+ if (c.visitor) {
1679
+ const B = new _(e, this, O, e.getElemRoot(), e.getJsonRoot(), i, n);
1680
+ this._doWalk(c.visitor, B, s, g, o, i, n);
1681
+ }
1682
+ };
1683
+ if (h.length > 0) {
1684
+ const g = h;
1685
+ for (let d = 0; d < g.length; d++) p(g.item(d));
1686
+ } else p(h);
1687
+ }
1688
+ }
1689
+ _doWalk(t, e, s, r, o, i, n) {
1690
+ let l = null;
1691
+ t && (s.push({ visitor: t, context: e, elemParent: r, jsonParent: o }), l = t.visit(e, r, o)), l || (l = o);
1692
+ const a = r.localName;
1693
+ this._walkScoped(a, e, s, r, l, i, n);
1694
+ const c = r.childNodes;
1695
+ for (let h = 0; h < c.length; h++) {
1696
+ const p = c.item(h);
1697
+ if (p.nodeType === 1) {
1698
+ const g = p, d = g.localName, v = this.visitorsByXmlTagName.get(d), O = e.getPath() + "/" + d, B = new _(e, this, O, e.getElemRoot(), e.getJsonRoot(), i, n);
1699
+ this._doWalk(v, B, s, g, l ?? o, i, n);
1700
+ }
1701
+ }
1702
+ return l;
1703
+ }
1704
+ }
1705
+ export {
1706
+ Xt as FromOOXMLConverter,
1707
+ Xt as default
1708
+ };