@sheetxl/io-xlsx 0.8.0-beta.2 → 0.8.0-beta.20

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 (217) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/Bw35-W8cnzxxvqQy.mjs +104 -0
  3. package/browser/esm/{CMHb6pUUmsCP9r_9.mjs → C16bEh6IrUpJONhS.mjs} +3 -3
  4. package/browser/esm/CPK1-z95jtLOfCXG.mjs +2474 -0
  5. package/browser/esm/CSOuRlSN9bhykqDr.mjs +4627 -0
  6. package/browser/esm/{DhqYgh9G2vLn7mIE.mjs → D2872f7aTugYxhht.mjs} +3 -3
  7. package/browser/esm/D7ogsrtXfjU5NW7r.mjs +10312 -0
  8. package/browser/esm/D8CQKL3Y3CMFOPqD.mjs +7007 -0
  9. package/browser/esm/{CMzkLUwbgA73RvCb.mjs → DpPFQ7-tBwVyjvWr.mjs} +3 -3
  10. package/browser/esm/{IZf0hIeLYj3T0Xvu.mjs → PgUWs0pPSCSFYJtU.mjs} +194 -144
  11. package/browser/esm/RFSuXvJ9sgsaA2LC.mjs +2433 -0
  12. package/browser/esm/{_UDbQq5-pHbU1f82.mjs → S4Uq85YdUb6O5Pz0.mjs} +2 -2
  13. package/browser/esm/index.mjs +3 -4
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/BOAucs-qLpjtUOcZ.mjs +6957 -0
  16. package/node/esm/{CY-pSutJLHskZfXZ.mjs → BSHqfcsR9hY-JB30.mjs} +2 -2
  17. package/node/esm/{CB1ijGbhl-e2l6Mm.mjs → C6eSWtTkyDQKbQdT.mjs} +3 -3
  18. package/node/esm/{Bi_kZVtZams7taqa.mjs → CPhiu1T7tl-leKh2.mjs} +3 -3
  19. package/node/esm/D2vDZOgLcv-YiWnB.mjs +4741 -0
  20. package/node/esm/DFw0ibBUmPyd-wey.mjs +2479 -0
  21. package/node/esm/DGuQIj077oygCTGu.mjs +2562 -0
  22. package/node/esm/Qn2Bv4QG3mOLiJHh.mjs +7269 -0
  23. package/node/esm/index.mjs +65 -28
  24. package/package.json +8 -9
  25. package/types/src/AutoFilterRules.d.ts +85 -22
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +30 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  80. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  81. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  82. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +8 -3
  83. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  84. package/types/src/reader/domVisitors/CommentVisitor.d.ts +7 -2
  85. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  86. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +34 -1
  87. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  88. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  89. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
  90. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  91. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  92. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  93. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  94. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  95. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  96. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  97. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  98. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  99. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  101. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  102. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  103. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  104. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  105. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
  106. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  107. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  108. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  109. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  110. package/types/src/reader/domVisitors/index.d.ts +10 -36
  111. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  112. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  113. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  114. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  115. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  116. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  117. package/types/src/richValue/RichDataParts.d.ts +69 -0
  118. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  119. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  120. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  121. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  122. package/types/src/richValue/index.d.ts +7 -0
  123. package/types/src/utils/DrawingMLText.d.ts +39 -0
  124. package/types/src/utils/FormControls.d.ts +170 -0
  125. package/types/src/utils/SharedNames.d.ts +13 -0
  126. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  127. package/types/src/utils/VmlNoteShapes.d.ts +88 -35
  128. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  129. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  130. package/types/src/vba/VBAProject.d.ts +0 -19
  131. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  132. package/types/src/writer/builder/Emitter.d.ts +5 -0
  133. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  134. package/types/src/writer/builder/PackageBuilder.d.ts +4 -41
  135. package/types/src/writer/builder/Types.d.ts +28 -28
  136. package/types/src/writer/emitters/CommentsEmitter.d.ts +10 -4
  137. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  138. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  139. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  140. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  141. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  142. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  143. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  144. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  145. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  146. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  147. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  148. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  149. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  150. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  151. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  152. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  153. package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +7 -1
  154. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  155. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  156. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  157. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  158. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  159. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  160. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  161. package/types/src/writer/utils/DrawMLUtils.d.ts +42 -3
  162. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  163. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  164. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  165. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  166. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  167. package/types/src/writer/utils/TextUtils.d.ts +26 -2
  168. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  169. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  170. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  171. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  172. package/browser/cjs/BzOEBR0jaxXg9wvt.cjs +0 -5
  173. package/browser/cjs/C8oC1tPbhgR0Dqtx.cjs +0 -2
  174. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  175. package/browser/cjs/Ca-xJDjg5bOpUPXX.cjs +0 -1
  176. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  177. package/browser/cjs/DULsYP_GcPGLVYSE.cjs +0 -11
  178. package/browser/cjs/DtBN3UOzNJjYBwJ6.cjs +0 -1
  179. package/browser/cjs/index.cjs +0 -1
  180. package/browser/cjs/sNZR19Wk-XQ2xZ9E.cjs +0 -1
  181. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  182. package/browser/esm/B9q618XELV7uWJsA.mjs +0 -67
  183. package/browser/esm/BwbMurFOptAFs7gC.mjs +0 -5214
  184. package/browser/esm/D75_rfogFUfXADKc.mjs +0 -3324
  185. package/browser/esm/DfuBawaydlvgZMR-.mjs +0 -4428
  186. package/browser/esm/DoMlKUCnMSlR2qX5.mjs +0 -159
  187. package/browser/esm/DtpWa7tZahylJ3HS.mjs +0 -2310
  188. package/node/esm/BD03jrMQ_UKA196-.mjs +0 -4535
  189. package/node/esm/BxHvzSROx_N_7nJH.mjs +0 -2356
  190. package/node/esm/CO1M1H1N6fB422K-.mjs +0 -2959
  191. package/node/esm/CWpezSa6TERGEv-B.mjs +0 -3410
  192. package/node/esm/Dezt2uIDqlxjiuk5.mjs +0 -170
  193. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  194. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  195. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  196. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  197. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  198. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  199. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  200. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  201. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  202. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  203. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
  204. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  205. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  206. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  207. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  208. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  209. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  210. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  211. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  212. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  213. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  214. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  215. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  216. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  217. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -0,0 +1,2479 @@
1
+ /**
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.20
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: SheetXL EULA — https://www.sheetxl.com/eula
6
+ */
7
+ import { $n as t, A as e, Ar as o, B as s, Ct as r, Dt as i, F as n, Ht as l, I as a, L as u, M as d, N as h, Nt as p, P as m, R as f, Sr as g, St as b, Tt as y, Ut as A, V as v, Wt as N, bt as F, dn as C, er as S, fn as x, gt as T, in as w, j as P, jr as I, jt as k, k as O, mn as V, r as _, rn as B, t as D, v as E, vt as R, wt as j, xt as Y, yn as X, z as M } from "./BOAucs-qLpjtUOcZ.mjs";
8
+ import { a as z, i as G, n as W, r as $ } from "./D2vDZOgLcv-YiWnB.mjs";
9
+ import { c as H, l as U, o as K, r as q, s as J } from "./DGuQIj077oygCTGu.mjs";
10
+ import { CommonUtils as Z } from "@sheetxl/utils";
11
+ import { AddressUtils as Q, FormulaError as tt, IBorders as et, ICellStyle as ot, ICondition as st, IFill as rt, IFont as it, IRange as nt, IShape as lt, ISlicerStyle as at, ITextFrame as ct, ShapeStyleUtils as ut, Sort as dt, Tuple as ht } from "@sheetxl/sdk";
12
+ var pt = class {
13
+ constructor(t) {
14
+ this.list = t;
15
+ }
16
+ get length() {
17
+ return this.list.length;
18
+ }
19
+ item(t) {
20
+ return this.list[t];
21
+ }
22
+ forEach(t, e) {
23
+ const o = this.list, s = o.length;
24
+ for (let e = 0; e < s; e++) t(o[e], e, this);
25
+ }
26
+ entries() {
27
+ return this.list.entries();
28
+ }
29
+ keys() {
30
+ return this.list.keys();
31
+ }
32
+ values() {
33
+ return this.list.values();
34
+ }
35
+ [Symbol.iterator]() {
36
+ return this.list.values();
37
+ }
38
+ }, mt = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, ft = (t) => {
39
+ const e = parseInt(t);
40
+ return isNaN(e) ? null : e;
41
+ }, gt = (t) => {
42
+ const e = parseFloat(t);
43
+ return isNaN(e) ? null : e;
44
+ }, bt = /* @__PURE__ */ new Map(), yt = class {
45
+ constructor(t, e, o, s, r, i = null, n = Z.EmptyObject) {
46
+ this._fileLocation = "";
47
+ const l = (t, e, o) => n?.getRef?.(t, e, o, n?.parsedRefs), a = (t) => n?.getRefs?.(t, n?.parsedRefs);
48
+ this._parent = t, this.sharedShared = e, this.currentPath = o, this.elemRoot = s, this.jsonRoot = r, t ? (this._fileLocation = t._fileLocation, this._getRef = t._getRef, this._getRefs = t._getRefs, this._serializeElement = t._serializeElement, this._readEmbeddedPart = t._readEmbeddedPart) : (i && (this._fileLocation = i), n?.getRef && (this._getRef = l), n?.getRefs && (this._getRefs = a), this._onWarning = n?.onWarning, this._addPerson = n?.addPerson, this._serializeElement = n?.serializeElement, this._readEmbeddedPart = n?.readEmbeddedPart);
49
+ }
50
+ getRef(t, e = !1) {
51
+ return this._getRef?.(t, this._fileLocation, e) ?? null;
52
+ }
53
+ readEmbeddedPart(t) {
54
+ return this._readEmbeddedPart?.(t, this._fileLocation) ?? null;
55
+ }
56
+ getRelationships() {
57
+ return this._getRefs?.(this._fileLocation) ?? bt;
58
+ }
59
+ getPath() {
60
+ return this.currentPath;
61
+ }
62
+ getFileLocation() {
63
+ return this._fileLocation;
64
+ }
65
+ getElemRoot() {
66
+ return this.elemRoot;
67
+ }
68
+ getJsonRoot() {
69
+ return this.jsonRoot;
70
+ }
71
+ warn(t, e) {
72
+ this._raiseWarning(t, this.getFileLocation(), e?.onceKey);
73
+ }
74
+ _raiseWarning(t, e, o) {
75
+ this._onWarning ? this._onWarning(t, e, o) : this._parent ? this._parent._raiseWarning(t, e, o) : console.warn(t);
76
+ }
77
+ serializeElement(t) {
78
+ return this._serializeElement?.(t) ?? null;
79
+ }
80
+ addPerson(t) {
81
+ return "string" == typeof t && (t = { displayName: t }), this._addPerson ? this._addPerson(t) : this._parent ? this._parent?._addPerson?.(t) ?? null : null;
82
+ }
83
+ getVisitorParamsState() {
84
+ return this.sharedShared.getVisitorParamsState();
85
+ }
86
+ evaluate(t, e) {
87
+ if (!t) return e;
88
+ let o = [e];
89
+ const s = t.split("/"), r = s.length;
90
+ for (let t = 0; t < r; t++) {
91
+ const e = s[t];
92
+ if ("" === e || "." === e) continue;
93
+ const i = [], n = ("*" === e || "**" === e) && !(t === r - 1);
94
+ for (const r of o) if (r) if (n) {
95
+ const e = s[t + 1];
96
+ e && "" !== e && "." !== e && (this._findDescendants(r, e, i), t++);
97
+ } else if ("*" === e || "**" === e) {
98
+ if (!r.childNodes) continue;
99
+ const t = r.childNodes, e = t.length;
100
+ for (let o = 0; o < e; o++) {
101
+ const e = t[o];
102
+ 1 === e.nodeType && i.push(e);
103
+ }
104
+ } else {
105
+ if (!r.childNodes) continue;
106
+ const t = r.childNodes, o = t.length;
107
+ for (let s = 0; s < o; s++) {
108
+ const o = t[s];
109
+ if (1 !== o.nodeType) continue;
110
+ const r = o;
111
+ this._matchesElementName(r, e) && i.push(r);
112
+ }
113
+ }
114
+ if (o = i, 0 === o.length) return null;
115
+ }
116
+ return 1 === o.length ? o[0] : 0 === o.length ? null : new pt(o);
117
+ }
118
+ _matchesElementName(t, e) {
119
+ return e.includes(":") ? (t.tagName || t.nodeName) === e : t.localName === e;
120
+ }
121
+ _findDescendants(t, e, o) {
122
+ if (!t || !t.childNodes) return;
123
+ const s = t.childNodes, r = s.length;
124
+ for (let t = 0; t < r; t++) {
125
+ const r = s[t];
126
+ if (1 !== r.nodeType) continue;
127
+ const i = r;
128
+ this._matchesElementName(i, e) && o.push(i), this._findDescendants(i, e, o);
129
+ }
130
+ }
131
+ getFromPath(t, e) {
132
+ return Z.getFromPath(t, e);
133
+ }
134
+ setToPath(t, e, o) {
135
+ return Z.setToPath(t, e, o);
136
+ }
137
+ getValAttrAsString(t, e) {
138
+ let o = this.evaluate(t, e);
139
+ return o && o.hasAttribute("val") ? o.getAttribute("val") ?? null : null;
140
+ }
141
+ getValAttrAsBoolean(t, e, o = !1) {
142
+ let s = this.evaluate(t, e);
143
+ if (!s) return null;
144
+ const r = s.hasAttribute("val") ? s.getAttribute("val") : void 0;
145
+ return null == r ? o : "1" === r || "on" === r || "true" === r || "0" !== r && "off" !== r && "false" !== r && o;
146
+ }
147
+ getValAttrAsInteger(t, e) {
148
+ let o = this.evaluate(t, e);
149
+ return o && o.hasAttribute("val") ? parseInt(o.getAttribute("val")) ?? null : null;
150
+ }
151
+ getValAttrAsFloat(t, e) {
152
+ let o = this.evaluate(t, e);
153
+ return o && o.hasAttribute("val") ? parseFloat(o.getAttribute("val")) ?? null : null;
154
+ }
155
+ get BOOLEAN_COPY() {
156
+ return mt;
157
+ }
158
+ get INT_COPY() {
159
+ return ft;
160
+ }
161
+ get FLOAT_COPY() {
162
+ return gt;
163
+ }
164
+ copyFromAttribute(t, e, o, s = e, r = null) {
165
+ if (!t || !o || !t.hasAttribute(e)) return;
166
+ let i = t.getAttribute(e);
167
+ if (r) if (Array.isArray(r)) {
168
+ const t = r.length;
169
+ for (let e = 0; e < t; e++) {
170
+ if (null == i) return;
171
+ if (i = r[e](i), null == i) return;
172
+ }
173
+ } else {
174
+ if (null == i) return;
175
+ if (i = r(i), null == i) return;
176
+ }
177
+ this.setToPath(o, s, i);
178
+ }
179
+ }, At = (t, e) => {
180
+ const o = [], s = t.childNodes, r = s.length;
181
+ for (let t = 0; t < r; t++) {
182
+ const r = s.item(t);
183
+ 1 === r.nodeType && r.localName === e && o.push(r);
184
+ }
185
+ return o;
186
+ }, vt = [
187
+ ["fillRef", "fill"],
188
+ ["lnRef", "stroke"],
189
+ ["effectRef", "effect"]
190
+ ], Nt = (t, e) => {
191
+ const o = new m(), s = {};
192
+ for (const [r, i] of vt) {
193
+ const n = t.evaluate(r, e);
194
+ if (!n) continue;
195
+ const l = { index: parseInt(n.getAttribute("idx") ?? "0", 10) || 0 }, a = o.processAdjColor(t, n);
196
+ a && (l.color = a), s[i] = l;
197
+ }
198
+ const r = t.evaluate("fontRef", e);
199
+ if (r) {
200
+ const e = { index: r.getAttribute("idx") ?? "none" }, i = o.processAdjColor(t, r);
201
+ i && (e.color = i), s.font = e;
202
+ }
203
+ return s;
204
+ }, Ft = class {
205
+ visit(t, e, o) {
206
+ if (!e) return;
207
+ let s = t.evaluate("*/cNvPr", e);
208
+ return s.item && (s = s.item(0)), s && (t.copyFromAttribute(s, "name", o), t.copyFromAttribute(s, "descr", o, "description"), t.copyFromAttribute(s, "hidden", o, "hidden", t.BOOLEAN_COPY), this.readNonVisualDetails(t, s, o), t.copyFromAttribute(s, "id", o)), o;
209
+ }
210
+ readNonVisualDetails(t, e, o) {
211
+ e.hasAttribute("title") && (o.title = e.getAttribute("title"));
212
+ const s = t.evaluate("hlinkClick", e);
213
+ s && (o.hyperlink = d(t, s));
214
+ const r = t.evaluate("hlinkHover", e);
215
+ r && (o.hoverHyperlink = d(t, r));
216
+ const i = t.evaluate("extLst", e), n = i ? t.serializeElement(i) : null;
217
+ n && (o.extLst = {
218
+ ...o.extLst,
219
+ nonVisual: n
220
+ });
221
+ }
222
+ setContent(t, e) {
223
+ const o = t;
224
+ void 0 !== o.name && (e.name = o.name, delete o.name), void 0 !== o.description && (e.description = o.description, delete o.description);
225
+ for (const t of [
226
+ "title",
227
+ "hyperlink",
228
+ "hoverHyperlink",
229
+ "extLst"
230
+ ]) void 0 !== o[t] && (e.json && (e.json[t] = o[t]), delete o[t]);
231
+ t.content = e;
232
+ }
233
+ isGroupContent(t) {
234
+ return Array.isArray(t?.members);
235
+ }
236
+ readMemberHeader(t, e, o) {
237
+ const s = {}, r = {
238
+ anchor: void 0,
239
+ content: {
240
+ type: o,
241
+ json: s
242
+ }
243
+ };
244
+ let i = t.evaluate("*/cNvPr", e);
245
+ if (i?.item && (i = i.item(0)), i) {
246
+ const o = i.getAttribute("name");
247
+ null !== o && (r.content.name = o);
248
+ const n = i.getAttribute("descr");
249
+ n && (r.content.description = n), t.copyFromAttribute(i, "hidden", r, "hidden", t.BOOLEAN_COPY), this.readNonVisualDetails(t, i, s);
250
+ const l = this.readSourceId(t, e);
251
+ void 0 !== l && (s.sourceId = l);
252
+ }
253
+ return {
254
+ movable: r,
255
+ content: s
256
+ };
257
+ }
258
+ readStyleRefs(t, e, o) {
259
+ const s = t.evaluate("style", e);
260
+ if (!s) return void (o.style = null);
261
+ const r = Nt(t, s), i = ut.withoutDefaultStyleRefs({
262
+ ...o,
263
+ style: r
264
+ });
265
+ i && (o.style = i);
266
+ }
267
+ readLocks(t) {
268
+ const e = t?.attributes;
269
+ if (!e || 0 === e.length) return;
270
+ const o = {};
271
+ for (let t = 0; t < e.length; t++) {
272
+ const s = e.item(t);
273
+ s.name.startsWith("xmlns") || (o[s.localName ?? s.name] = A(s.value));
274
+ }
275
+ return Object.keys(o).length > 0 ? o : void 0;
276
+ }
277
+ readSourceId(t, e) {
278
+ let o = t.evaluate("*/cNvPr", e);
279
+ o?.item && (o = o.item(0));
280
+ const s = o?.getAttribute?.("id"), r = s ? parseInt(s, 10) : void 0;
281
+ return void 0 === r || isNaN(r) ? void 0 : r;
282
+ }
283
+ }, Ct = [
284
+ ["spDef", "shape"],
285
+ ["lnDef", "line"],
286
+ ["txDef", "text"]
287
+ ], St = (t, e) => {
288
+ const o = e.getAttribute("dxfId");
289
+ if (null === o) return;
290
+ const s = parseInt(o);
291
+ return t.getVisitorParamsState().get("dxfs")?.get(s) || (t.warn(`A color filter or sort names a format that does not exist (dxfId '${o}').`), {});
292
+ }, xt = (t) => "1" === t || "true" === t, Tt = class {
293
+ visit(t, e, o) {}
294
+ processDataBarColor(e, o, s, r, i = "auto") {
295
+ if (!o) return;
296
+ const n = t((t) => o.getAttribute(t), i);
297
+ return n && (s[r] = n), s;
298
+ }
299
+ processFonts(t, e, o) {
300
+ if (!e) return;
301
+ const s = e.childNodes;
302
+ let r = 0;
303
+ const i = s.length;
304
+ for (let e = 0; e < i; e++) {
305
+ const i = s.item(e);
306
+ if (1 === i.nodeType && "font" === i.localName) {
307
+ const e = {};
308
+ this.processFont(t, i, e), o[r++] = e;
309
+ }
310
+ }
311
+ return o;
312
+ }
313
+ processFont(t, e, o) {
314
+ t.getValAttrAsBoolean("b", e, !0) && (o.weight = 700), t.getValAttrAsBoolean("i", e, !0) && (o.style = it.Style.Italic), t.getValAttrAsBoolean("strike", e, !0) && (o.strike = j(!0));
315
+ const i = t.evaluate("u", e);
316
+ if (i) {
317
+ const t = i.getAttribute("val");
318
+ o.underline = y(t);
319
+ }
320
+ const n = Y(t.evaluate("vertAlign", e)?.getAttribute("val"));
321
+ void 0 !== n && (o.baseline = n), f(t, e, o, "sz", "size");
322
+ const l = t.evaluate("color", e);
323
+ this.processDataBarColor(t, l, o, "color"), o.color || (o.color = "auto"), s(t, e, o, "name", "family"), s(t, e, o, "rFont", "family");
324
+ const a = t.evaluate("family", e);
325
+ if (a) {
326
+ const t = a.getAttribute("val");
327
+ if (t) switch (t) {
328
+ case "1":
329
+ o.fallbacks = ["serif"];
330
+ break;
331
+ case "2":
332
+ o.fallbacks = ["sans-serif"];
333
+ break;
334
+ case "3":
335
+ o.fallbacks = ["monospace"];
336
+ break;
337
+ case "4":
338
+ o.fallbacks = ["cursive"];
339
+ break;
340
+ case "5": o.fallbacks = ["fantasy"];
341
+ }
342
+ }
343
+ b(o, t.evaluate("scheme", e)?.getAttribute("val")), u(t, e, o, "shadow", "shadow", !0), u(t, e, o, "outline", "outline", !0);
344
+ for (const s of ["condense", "extend"]) {
345
+ const i = r(s, !!t.getValAttrAsBoolean(s, e, !0));
346
+ void 0 !== i && (o.letterSpacing = i);
347
+ }
348
+ return M(t, e, o, "charset", "charset"), o;
349
+ }
350
+ processFills(t, e, o) {
351
+ if (!e) return;
352
+ const s = e.childNodes;
353
+ let r = 0;
354
+ const i = s.length;
355
+ for (let e = 0; e < i; e++) {
356
+ const i = s.item(e);
357
+ 1 === i.nodeType && "fill" === i.localName && this.processFill(t, i, o, r++);
358
+ }
359
+ return o;
360
+ }
361
+ processFill(t, e, o, s) {
362
+ const r = { type: rt.Type.None }, i = e.childNodes;
363
+ let n = !1;
364
+ const l = i.length;
365
+ for (let e = 0; !n && e < l; e++) {
366
+ const o = i.item(e);
367
+ 1 === o.nodeType && ("gradientFill" === o.localName ? (this.processGradientFill(t, o, r), n = !0) : "patternFill" === o.localName && (this.processPatternFill(t, o, r), n = !0));
368
+ }
369
+ return o[s] = r, o;
370
+ }
371
+ processGradientFill(t, e, o) {
372
+ if (!e) return;
373
+ o.type = rt.Type.Gradient;
374
+ const s = [];
375
+ o.stops = s;
376
+ const r = e.getAttribute("type");
377
+ r && (o.gradientType = r);
378
+ const i = e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0;
379
+ (i + 90) % 360 != 0 && (o.angle = (i + 90) % 360), (e.hasAttribute("left") || e.hasAttribute("top") || e.hasAttribute("right") || e.hasAttribute("bottom")) && (o.focus = {
380
+ left: wt(e.getAttribute("left")),
381
+ top: wt(e.getAttribute("top")),
382
+ right: wt(e.getAttribute("right")),
383
+ bottom: wt(e.getAttribute("bottom"))
384
+ });
385
+ const n = e.childNodes, l = n.length;
386
+ for (let e = 0; e < l; e++) {
387
+ const o = n.item(e);
388
+ if (1 === o.nodeType && "stop" === o.localName) {
389
+ const e = {};
390
+ s.push(e), e.offset = parseFloat(o.getAttribute("position") ?? "");
391
+ const r = t.evaluate("color", o);
392
+ this.processDataBarColor(t, r, e, "color");
393
+ }
394
+ }
395
+ return o;
396
+ }
397
+ processPatternFill(t, e, o) {
398
+ if (!e) return;
399
+ const s = t.getVisitorParamsState().get("processingDXFs"), r = e.getAttribute("patternType") || (s ? rt.BuiltInSheetPattern.Solid : rt.BuiltInSheetPattern.None);
400
+ if (r === rt.BuiltInSheetPattern.None) return { none: !0 };
401
+ o.type = rt.Type.Pattern, r && (o.patternType = r);
402
+ let i = "foreground", n = "background";
403
+ const l = o.patternType === rt.BuiltInSheetPattern.Solid && s;
404
+ let a = l ? "dk1" : "lt1", c = l ? "lt1" : "dk1";
405
+ if (l) {
406
+ const t = i;
407
+ i = n, n = t;
408
+ }
409
+ const u = t.evaluate("fgColor", e);
410
+ this.processDataBarColor(t, u, o, i, a);
411
+ const d = t.evaluate("bgColor", e);
412
+ return this.processDataBarColor(t, d, o, n, c), l && (o.foreground || (o.foreground = "lt1"), o.background || (o.background = "dk1")), o;
413
+ }
414
+ processBorders(t, e, o, s) {
415
+ if (!e) return;
416
+ const r = e.childNodes;
417
+ let i = 0;
418
+ const n = r.length;
419
+ for (let e = 0; e < n; e++) {
420
+ const n = r.item(e);
421
+ 1 === n.nodeType && "border" === n.localName && this.processBorder(t, n, o, i++, s);
422
+ }
423
+ return o;
424
+ }
425
+ processBorder(t, e, o, s, r) {
426
+ if (!e) return;
427
+ const i = {};
428
+ this.processBorderStroke(t, e, i, et.Edge.Left), this.processBorderStroke(t, e, i, et.Edge.Right), r ? (i.right || i.left) && (i.right ? i.vertical = { ...i.right } : i.vertical = { ...i.left }) : this.processBorderStroke(t, e, i, et.Edge.Vertical), this.processBorderStroke(t, e, i, et.Edge.Top), this.processBorderStroke(t, e, i, et.Edge.Bottom), r ? (i.bottom || i.top) && (i.bottom ? i.horizontal = { ...i.bottom } : i.horizontal = { ...i.top }) : this.processBorderStroke(t, e, i, et.Edge.Horizontal);
429
+ const n = this.processBorderStroke(t, e, {}, "diagonal");
430
+ return n && (xt(e.getAttribute("diagonalUp")) && (i.diagonalUp = { ...n }), xt(e.getAttribute("diagonalDown")) && (i.diagonalDown = { ...n })), o[s] = i, o;
431
+ }
432
+ processBorderStroke(t, e, o, s) {
433
+ if (!e) return;
434
+ const r = t.evaluate(s, e);
435
+ if (!r) return;
436
+ const i = {};
437
+ r.hasAttribute("style") ? i.style = r.getAttribute("style") : t.getVisitorParamsState().get("processingDXFs") && (i.style = et.StrokeStyle.None);
438
+ const n = t.evaluate("color", r);
439
+ return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? o[s] = i : null;
440
+ }
441
+ }, wt = (t) => {
442
+ if (!t) return 0;
443
+ const e = parseFloat(t);
444
+ return isNaN(e) ? 0 : e;
445
+ }, Pt = (t, e) => {
446
+ if (!t || 1 !== t.nodeType) return null;
447
+ const o = t.childNodes;
448
+ for (let t = 0; t < o.length; t++) {
449
+ const s = o.item(t);
450
+ if (1 === s.nodeType && s.localName === e) return s;
451
+ }
452
+ return null;
453
+ }, It = new Set(Object.values(at.ElementType).filter((t) => t !== at.ElementType.WholeTable && t !== at.ElementType.HeaderRow)), kt = {
454
+ auto: "auto",
455
+ autoNoTable: "automaticExceptTables",
456
+ manual: "manual"
457
+ }, Ot = [
458
+ "tableId",
459
+ "columnId",
460
+ "cacheName",
461
+ "cachePath",
462
+ "sourceName",
463
+ "sortOrder",
464
+ "customListSort",
465
+ "crossFilter",
466
+ "pivotTables",
467
+ "pivotCacheId",
468
+ "pivotBody",
469
+ "tabular",
470
+ "pivotData",
471
+ "showMissing"
472
+ ], Vt = /* @__PURE__ */ new Set([
473
+ "name",
474
+ "xr10:uid",
475
+ "cache",
476
+ "caption"
477
+ ]), _t = (t, e) => {
478
+ const o = t.content, s = o?.json;
479
+ if (s) {
480
+ if ("shape" === o.type || "picture" === o.type) {
481
+ const { rotation: o, flipH: r, flipV: i, bounds: n } = s;
482
+ delete s.rotation, delete s.flipH, delete s.flipV, delete s.bounds, void 0 !== o && 0 !== o && (t.rotation = o), r && (t.flipH = !0), i && (t.flipV = !0), e && n && (t.anchor = {
483
+ tl: {
484
+ x: n.x,
485
+ y: n.y
486
+ },
487
+ br: {
488
+ x: n.width,
489
+ y: n.height
490
+ }
491
+ });
492
+ }
493
+ if ("group" === o.type) for (const t of s.members ?? []) _t(t, !0);
494
+ }
495
+ }, Bt = class extends Ft {
496
+ visit(t, e, o) {
497
+ if (e) return this.visitShape(t, e, o, "sp", "nvSpPr/cNvSpPr/spLocks");
498
+ }
499
+ visitShape(t, o, s, r, i) {
500
+ const n = v[r];
501
+ if (this.isGroupContent(s)) {
502
+ if (t.getPath().includes("Fallback")) return {};
503
+ const { movable: e, content: l } = this.readMemberHeader(t, o, "shape");
504
+ n !== lt.Type.Shape && (l.type = n), this.readShapeDetails(t, o, r, i, l), this.readStyleRefs(t, o, l);
505
+ const a = t.evaluate(i, o);
506
+ a?.hasAttribute?.("noChangeAspect") && (e.lockAspect = "1" === a.getAttribute("noChangeAspect"));
507
+ const c = this.readTwinOf(t, o);
508
+ return void 0 !== c && Object.assign(l, { twinOf: c }), s.members.push(e), l;
509
+ }
510
+ if (t.getPath().includes("Fallback") && s.content) {
511
+ const r = s.content.json;
512
+ if ("shape" === s.content.type && r && (r.type ?? lt.Type.Shape) === n) {
513
+ const s = t.evaluate("txBody", o), i = s ? new O().readTextBody(t, s) : null;
514
+ i && "" !== e(i) && (r.text = i);
515
+ }
516
+ return {};
517
+ }
518
+ s = super.visit(t, o, s);
519
+ const l = t.evaluate(i, o);
520
+ l?.hasAttribute?.("noChangeAspect") && (s.lockAspect = "1" === l.getAttribute("noChangeAspect"));
521
+ const a = n === lt.Type.Shape ? {} : { type: n }, c = this.readSourceId(t, o);
522
+ void 0 !== c && (a.sourceId = c), this.readShapeDetails(t, o, r, i, a), this.readStyleRefs(t, o, a);
523
+ const u = this.readTwinOf(t, o);
524
+ return void 0 !== u && Object.assign(a, { twinOf: u }), this.setContent(s, {
525
+ type: "shape",
526
+ json: a
527
+ }), a;
528
+ }
529
+ readTwinOf(t, e) {
530
+ let o = t.evaluate("*/cNvPr/extLst/ext/compatExt", e);
531
+ o?.item && (o = o.item(0));
532
+ const s = /^_x0000_s(\d+)$/.exec(o?.getAttribute?.("spid") ?? "");
533
+ return s ? parseInt(s[1], 10) : void 0;
534
+ }
535
+ readShapeDetails(t, e, o, s, r) {
536
+ const i = e.getAttribute("macro");
537
+ i && (r.macro = i);
538
+ const n = e.getAttribute("textlink");
539
+ n && (r.textLink = n), e.hasAttribute("fLocksText") && (r.locksText = A(e.getAttribute("fLocksText"))), e.hasAttribute("fPublished") && (r.published = A(e.getAttribute("fPublished")));
540
+ const l = s.slice(0, s.lastIndexOf("/")), a = t.evaluate(l, e);
541
+ "1" === a?.getAttribute?.("txBox") && (r.textBox = !0);
542
+ const c = this.readLocks(t.evaluate(s, e));
543
+ if (c && (r.locks = c), "cxnSp" === o && a) {
544
+ const e = (e) => {
545
+ const o = t.evaluate(e, a);
546
+ if (o?.getAttribute) return {
547
+ id: parseInt(o.getAttribute("id") ?? "0", 10) || 0,
548
+ index: parseInt(o.getAttribute("idx") ?? "0", 10) || 0
549
+ };
550
+ }, o = e("stCxn"), s = e("endCxn");
551
+ (o || s) && (r.connectorEnds = {}, o && (r.connectorEnds.start = o), s && (r.connectorEnds.end = s));
552
+ }
553
+ }
554
+ }, Lt = /^<a:extLst(?:\s+xmlns:a="[^"]*")?><a:ext uri="\{28A0092B-C50C-407E-A947-70E740481C1C\}"><a14:useLocalDpi(?:\s+xmlns:a14="[^"]*")?\s+val="0"\s*\/><\/a:ext><\/a:extLst>$/, Dt = (t, e, o, s) => {
555
+ const r = t.evaluate(o, e), i = t.evaluate(s, e);
556
+ return r || i ? {
557
+ x: N(r?.getAttribute("x") ?? null) ?? 0,
558
+ y: N(r?.getAttribute("y") ?? null) ?? 0,
559
+ width: N(i?.getAttribute("cx") ?? null) ?? 0,
560
+ height: N(i?.getAttribute("cy") ?? null) ?? 0
561
+ } : null;
562
+ }, Et = { Checkbox: "checkbox" };
563
+ var Rt = (t) => {
564
+ const e = t.getAttribute("val");
565
+ return "0" !== e && "false" !== e;
566
+ }, jt = {
567
+ 1: "serif",
568
+ 2: "sans-serif",
569
+ 3: "monospace",
570
+ 4: "cursive",
571
+ 5: "fantasy"
572
+ };
573
+ function Yt(e) {
574
+ const o = {}, s = e.childNodes;
575
+ for (let e = 0; e < s.length; e++) {
576
+ const i = s.item(e);
577
+ if (1 === i.nodeType) switch (i.localName) {
578
+ case "b":
579
+ o.weight = Rt(i) ? 700 : 400;
580
+ break;
581
+ case "i":
582
+ o.style = Rt(i) ? it.Style.Italic : it.Style.Normal;
583
+ break;
584
+ case "strike":
585
+ o.strike = j(Rt(i));
586
+ break;
587
+ case "outline":
588
+ o.outline = Rt(i);
589
+ break;
590
+ case "shadow":
591
+ o.shadow = Rt(i);
592
+ break;
593
+ case "condense":
594
+ case "extend": {
595
+ const t = r(i.localName, Rt(i));
596
+ void 0 !== t && (o.letterSpacing = t);
597
+ break;
598
+ }
599
+ case "u":
600
+ o.underline = y(i.getAttribute("val"));
601
+ break;
602
+ case "vertAlign": {
603
+ const t = Y(i.getAttribute("val"));
604
+ void 0 !== t && (o.baseline = t);
605
+ break;
606
+ }
607
+ case "sz": {
608
+ const t = parseFloat(i.getAttribute("val") ?? "");
609
+ isNaN(t) || (o.size = t);
610
+ break;
611
+ }
612
+ case "rFont": {
613
+ const t = i.getAttribute("val");
614
+ t && (o.family = t);
615
+ break;
616
+ }
617
+ case "family": {
618
+ const t = jt[i.getAttribute("val") ?? ""];
619
+ t && (o.fallbacks = [t]);
620
+ break;
621
+ }
622
+ case "charset": {
623
+ const t = parseInt(i.getAttribute("val") ?? "", 10);
624
+ isNaN(t) || (o.charset = t);
625
+ break;
626
+ }
627
+ case "scheme":
628
+ b(o, i.getAttribute("val"));
629
+ break;
630
+ case "color": {
631
+ const e = i.getAttribute("rgb");
632
+ if (e && !i.hasAttribute("theme")) {
633
+ o.color = "#" + (8 === e.length ? e.substring(2) : e).toUpperCase();
634
+ break;
635
+ }
636
+ const s = t((t) => i.getAttribute(t));
637
+ s && (o.color = s);
638
+ break;
639
+ }
640
+ }
641
+ }
642
+ return Object.keys(o).length > 0 ? o : null;
643
+ }
644
+ var Xt = {
645
+ RelsVisitor: class {
646
+ visit(t, e, o) {
647
+ if (!e) return;
648
+ const s = e.childNodes, r = s.length;
649
+ for (let e = 0; e < r; e++) {
650
+ const r = s.item(e);
651
+ 1 === r.nodeType && "Relationship" === r.localName && this.processRelationship(t, r, o);
652
+ }
653
+ return o;
654
+ }
655
+ processRelationship(t, e, o) {
656
+ const s = {};
657
+ t.copyFromAttribute(e, "Target", s, "target"), t.copyFromAttribute(e, "Type", s, "type"), t.copyFromAttribute(e, "TargetMode", s, "targetMode");
658
+ o[e.getAttribute("Id")] = s;
659
+ }
660
+ },
661
+ CorePropertiesVisitor: class {
662
+ visit(t, e, o) {
663
+ const s = [], r = e.childNodes, i = r.length;
664
+ for (let e = 0; e < i; e++) {
665
+ const o = r.item(e);
666
+ if (1 !== o.nodeType) continue;
667
+ const i = this.processProperty(t, o);
668
+ i && s.push(i);
669
+ }
670
+ return s.length > 0 && (o.properties = s), s;
671
+ }
672
+ processProperty(t, e) {
673
+ if (e) return e.getAttribute("xsi:type"), {
674
+ key: e.localName,
675
+ value: e.textContent || ""
676
+ };
677
+ }
678
+ },
679
+ AppPropertiesVisitor: class {
680
+ visit(t, e, o) {
681
+ const s = e.childNodes, r = s.length;
682
+ for (let t = 0; t < r; t++) if ("property" === s.item(t).localName) return this.visitCustom(e, o);
683
+ const i = [];
684
+ for (let e = 0; e < r; e++) {
685
+ const o = s.item(e);
686
+ if (1 !== o.nodeType) continue;
687
+ const r = this.processProperty(t, o);
688
+ r && i.push(r);
689
+ }
690
+ return i.length > 0 && (o.properties = i), i;
691
+ }
692
+ visitCustom(t, e) {
693
+ const o = [], s = t.childNodes, r = s.length;
694
+ for (let t = 0; t < r; t++) {
695
+ const e = s.item(t);
696
+ if (1 !== e.nodeType || "property" !== e.localName) continue;
697
+ const r = e.getAttribute("name");
698
+ if (!r) continue;
699
+ let i = null;
700
+ for (let t = 0; t < e.childNodes.length && !i; t++) {
701
+ const o = e.childNodes.item(t);
702
+ 1 === o.nodeType && (i = o);
703
+ }
704
+ const n = {
705
+ key: r,
706
+ kind: i?.localName ?? null,
707
+ value: i?.textContent ?? ""
708
+ }, l = e.getAttribute("linkTarget");
709
+ l && (n.linkTarget = l), o.push(n);
710
+ }
711
+ return o.length > 0 && (e.custom = o), o;
712
+ }
713
+ processProperty(t, e) {
714
+ if (e) return {
715
+ key: e.localName,
716
+ value: e.textContent || ""
717
+ };
718
+ }
719
+ },
720
+ ShapePropertiesVisitor: h,
721
+ TextPropertiesVisitor: P,
722
+ ShapeTextVisitor: O,
723
+ ThemeVisitor: class {
724
+ visit(t, e, o) {
725
+ o.name = e.getAttribute("name"), o.objectDefaults = {};
726
+ const s = At(e, "custClrLst")[0];
727
+ if (s) {
728
+ const e = new m(), r = [];
729
+ for (const o of At(s, "custClr")) {
730
+ const s = e.processAdjColor(t, o);
731
+ if (!s) continue;
732
+ const i = { color: s }, n = o.getAttribute("name");
733
+ n && (i.name = n), r.push(i);
734
+ }
735
+ r.length && (o.customColors = r);
736
+ }
737
+ for (const t of At(e, "extLst")) for (const e of At(t, "ext")) {
738
+ if ("{05A4C25C-085E-4340-85A3-A5531E510DB2}" !== e.getAttribute("uri")) continue;
739
+ const t = At(e, "themeFamily")[0], s = t?.getAttribute("id");
740
+ if (!s) continue;
741
+ const r = {
742
+ name: t.getAttribute("name") ?? "",
743
+ id: s
744
+ }, i = t.getAttribute("vid");
745
+ i && (r.vid = i), o.family = r;
746
+ }
747
+ return o;
748
+ }
749
+ },
750
+ ClrSchemeVisitor: class extends m {
751
+ visit(t, e, o) {
752
+ const s = {};
753
+ s.name = e.getAttribute("name");
754
+ const r = e.childNodes, i = r.length;
755
+ for (let o = 0; o < i; o++) {
756
+ const i = r.item(o);
757
+ if (1 === i.nodeType) {
758
+ let o = i.localName;
759
+ const r = t.evaluate(o, e);
760
+ s[o] = this.processAdjColor(t, r);
761
+ }
762
+ }
763
+ return Object.keys(s).length > 0 && (o.colors = s), s;
764
+ }
765
+ },
766
+ FontSchemeVisitor: class {
767
+ visit(t, e, o) {
768
+ const s = {};
769
+ s.name = e.getAttribute("name");
770
+ const r = this.processFontCollection(t, t.evaluate("majorFont", e));
771
+ r && (s.major = r);
772
+ const i = this.processFontCollection(t, t.evaluate("minorFont", e));
773
+ return i && (s.minor = i), o.fonts = s, s;
774
+ }
775
+ processFontCollection(t, e) {
776
+ if (!e) return;
777
+ const o = {}, s = t.evaluate("latin", e), r = s?.getAttribute("typeface");
778
+ r && (o.latin = r);
779
+ const i = s?.getAttribute("panose");
780
+ i && (o.panose = i);
781
+ const n = t.evaluate("ea", e)?.getAttribute("typeface");
782
+ n && (o.eastAsian = n);
783
+ const l = t.evaluate("cs", e)?.getAttribute("typeface");
784
+ let a;
785
+ l && (o.complexScript = l);
786
+ const c = e.childNodes, u = c.length;
787
+ for (let t = 0; t < u; t++) {
788
+ const e = c.item(t);
789
+ if (1 !== e.nodeType || "font" !== e.localName) continue;
790
+ const o = e.getAttribute("script");
791
+ o && ((a ??= {})[o] = e.getAttribute("typeface") ?? "");
792
+ }
793
+ return a && (o.scripts = a), o;
794
+ }
795
+ },
796
+ ObjectDefaultsVisitor: class {
797
+ visit(t, e, o) {
798
+ const s = {};
799
+ for (const [o, r] of Ct) {
800
+ const i = t.evaluate(o, e);
801
+ i && (s[r] = this.processDefault(t, i));
802
+ }
803
+ return o.objectDefaults = s, {};
804
+ }
805
+ processDefault(t, e) {
806
+ const o = {}, s = t.evaluate("spPr", e);
807
+ s && new h().visit(t, s, o);
808
+ const r = new O().readTextBody(t, e);
809
+ (r.body || r.listStyle) && (o.text = r);
810
+ const i = t.evaluate("style", e);
811
+ return i && (o.style = Nt(t, i)), o;
812
+ }
813
+ },
814
+ FmtSchemeVisitor: class extends m {
815
+ visit(t, e, o) {
816
+ const s = this.parseFillList(t, e, "fillStyleLst"), r = this.parseLnList(t, e, "lnStyleLst"), i = this.parseEffectStyleList(t, e, "effectStyleLst"), n = this.parseFillList(t, e, "bgFillStyleLst");
817
+ if (s && (o.fillStyleLst = s), r && (o.lnStyleLst = r), i && (o.effectStyleLst = i), n && (o.bgFillStyleLst = n), s && r && i && n) return;
818
+ const l = t.serializeElement(e);
819
+ l && (o.formatSchemeXml = l);
820
+ }
821
+ parseFillList(t, e, o) {
822
+ const s = t.evaluate(o, e);
823
+ if (!s) return;
824
+ const r = [], i = s.childNodes, n = i.length;
825
+ for (let e = 0; e < n; e++) {
826
+ const o = i.item(e);
827
+ if (1 !== o.nodeType) continue;
828
+ const s = this.parseFillListItem(t, o);
829
+ if (void 0 === s) return;
830
+ r.push(s);
831
+ }
832
+ return r;
833
+ }
834
+ parseFillListItem(t, e) {
835
+ switch (e.localName) {
836
+ case "noFill": return { type: rt.Type.None };
837
+ case "solidFill": {
838
+ const o = this.processAdjColor(t, e);
839
+ return o ? {
840
+ type: rt.Type.Solid,
841
+ color: o
842
+ } : void 0;
843
+ }
844
+ case "gradFill": return this.processGradFill(t, e);
845
+ case "pattFill": return this.processPatternFill(t, e);
846
+ default: return;
847
+ }
848
+ }
849
+ parseLnList(t, e, o) {
850
+ const s = t.evaluate(o, e);
851
+ if (!s) return;
852
+ const r = [], i = s.childNodes, n = i.length;
853
+ for (let e = 0; e < n; e++) {
854
+ const o = i.item(e);
855
+ 1 === o.nodeType && r.push(this.parseLn(t, o));
856
+ }
857
+ return r;
858
+ }
859
+ parseEffectStyleList(t, e, o) {
860
+ const s = t.evaluate(o, e);
861
+ if (!s) return;
862
+ const r = [], i = s.childNodes, n = i.length;
863
+ for (let e = 0; e < n; e++) {
864
+ const o = i.item(e);
865
+ if (1 !== o.nodeType) continue;
866
+ if (t.evaluate("scene3d", o) || t.evaluate("sp3d", o)) return;
867
+ const s = this.getEffects(t, o);
868
+ if (void 0 === s) return;
869
+ r.push(s ?? []);
870
+ }
871
+ return r;
872
+ }
873
+ },
874
+ AutoFilterVisitor: class {
875
+ visit(t, e, o) {
876
+ if (!e) return;
877
+ const s = {}, r = [];
878
+ return this.processFilterColumns(t, e, r, o), r.length > 0 && (s.conditions = r), Object.keys(s).length > 0 && (o.filter = s), o;
879
+ }
880
+ processColorFilter(t, e) {
881
+ const o = {}, s = {
882
+ operator: st.BuiltInOperatorNames.Color,
883
+ param: o
884
+ };
885
+ t.copyFromAttribute(e, "cellColor", o, "cellColor", t.BOOLEAN_COPY);
886
+ const r = St(t, e);
887
+ return r && (o.style = r), s;
888
+ }
889
+ processCustomFilter(t, e) {
890
+ return X({
891
+ operator: e.getAttribute("operator"),
892
+ val: e.getAttribute("val")
893
+ }, (e) => t.warn(e));
894
+ }
895
+ processCustomFilters(t, e) {
896
+ const o = e.getAttribute("and"), s = "and" === o || "1" === o;
897
+ e.getAttribute("val");
898
+ const r = [], i = {
899
+ operator: s ? st.BuiltInOperatorNames.And : st.BuiltInOperatorNames.Or,
900
+ param: r
901
+ }, n = e.childNodes, l = n.length;
902
+ for (let e = 0; e < l; e++) {
903
+ const o = n.item(e);
904
+ if (1 !== o.nodeType) continue;
905
+ let s = null;
906
+ "customFilter" === o.localName && (s = this.processCustomFilter(t, o)), s && r.push(s);
907
+ }
908
+ return 1 === r.length ? r[0] : x(i);
909
+ }
910
+ processDynamicFilter(t, e) {
911
+ return C(e.getAttribute("type"), e.getAttribute("val"), e.getAttribute("maxVal"));
912
+ }
913
+ processDateGroupItem(t, e) {
914
+ const o = {};
915
+ return t.copyFromAttribute(e, "dateTimeGrouping", o, "group"), t.copyFromAttribute(e, "day", o, "day", t.INT_COPY), t.copyFromAttribute(e, "hour", o, "hour", t.INT_COPY), t.copyFromAttribute(e, "minute", o, "minute", t.INT_COPY), t.copyFromAttribute(e, "month", o, "month", t.INT_COPY), t.copyFromAttribute(e, "second", o, "second", t.INT_COPY), t.copyFromAttribute(e, "year", o, "year", t.INT_COPY), o;
916
+ }
917
+ processFilterItem(t, e) {
918
+ if (e.hasAttribute("val")) return e.getAttribute("val");
919
+ }
920
+ processFilters(t, e) {
921
+ const o = {}, s = {
922
+ operator: st.BuiltInOperatorNames.InSet,
923
+ param: o
924
+ };
925
+ s.selector = st.BuiltInSelectorNames.Display, t.copyFromAttribute(e, "blank", o, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", o, "calendarType");
926
+ let r = [], i = [];
927
+ const n = e.childNodes, l = n.length;
928
+ for (let e = 0; e < l; e++) {
929
+ const o = n.item(e);
930
+ if (1 === o.nodeType) {
931
+ if ("dateGroupItem" === o.localName) {
932
+ const e = this.processDateGroupItem(t, o);
933
+ e && r.push(e);
934
+ } else if ("filter" === o.localName) {
935
+ const e = this.processFilterItem(t, o);
936
+ void 0 !== e && i.push(e);
937
+ }
938
+ }
939
+ }
940
+ return r.length > 0 && (o.dateGroups = r), i.length > 0 && (o.items = i), s;
941
+ }
942
+ processIcon(t, e) {
943
+ const o = {}, s = {
944
+ operator: st.BuiltInOperatorNames.Icon,
945
+ param: o
946
+ };
947
+ return t.copyFromAttribute(e, "iconId", o, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", o), s;
948
+ }
949
+ processTop10(t, e) {
950
+ const o = {}, s = {
951
+ operator: st.BuiltInOperatorNames.TopN,
952
+ param: o
953
+ };
954
+ return t.copyFromAttribute(e, "filterVal", o, "filterVal", t.FLOAT_COPY), t.copyFromAttribute(e, "percent", o, "percent", t.BOOLEAN_COPY), t.copyFromAttribute(e, "top", o, "top", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", o, "limit", t.FLOAT_COPY), s;
955
+ }
956
+ processFilterColumnExt(t, e) {
957
+ const o = e.childNodes;
958
+ for (let e = 0; e < o.length; e++) {
959
+ const s = o.item(e);
960
+ if (1 !== s.nodeType || "ext" !== s.localName) continue;
961
+ if (g(s.getAttribute("uri")) !== g("{1AD28BCE-077C-4C59-8B6E-1921CE8616D4}")) continue;
962
+ const r = s.childNodes;
963
+ for (let e = 0; e < r.length; e++) {
964
+ const o = r.item(e);
965
+ if (1 !== o.nodeType || "filterColumn" !== o.localName) continue;
966
+ const s = o.childNodes;
967
+ for (let e = 0; e < s.length; e++) {
968
+ const o = s.item(e);
969
+ if (1 === o.nodeType && "filters" === o.localName) return this.processFilters(t, o);
970
+ }
971
+ }
972
+ }
973
+ }
974
+ processFilterCriteria(t, e) {
975
+ if (!e) return;
976
+ const o = e.childNodes;
977
+ let s;
978
+ const r = o.length;
979
+ for (let e = 0; e < r; e++) {
980
+ const r = o.item(e);
981
+ 1 === r.nodeType && ("colorFilter" === r.localName ? s = this.processColorFilter(t, r) : "customFilters" === r.localName ? s = this.processCustomFilters(t, r) : "dynamicFilter" === r.localName ? s = this.processDynamicFilter(t, r) : "filters" === r.localName ? s = this.processFilters(t, r) : "iconFilter" === r.localName ? s = this.processIcon(t, r) : "top10" === r.localName ? s = this.processTop10(t, r) : "extLst" === r.localName && (s = this.processFilterColumnExt(t, r) ?? s));
982
+ }
983
+ return s;
984
+ }
985
+ processFilterColumn(t, e, o) {
986
+ if (!e) return null;
987
+ if (!e.hasAttribute("colId")) return;
988
+ const s = parseInt(e.getAttribute("colId"));
989
+ let r = !1;
990
+ if (e.hasAttribute("hiddenButton") && (r = A(e.getAttribute("hiddenButton"))), r && o) {
991
+ let t = o.hiddenButtons;
992
+ t || (t = [], o.hiddenButtons = t), t.push(s);
993
+ }
994
+ let i = !1;
995
+ if (e.hasAttribute("showButton") && (i = A(e.getAttribute("showButton"))), i && o) {
996
+ let t = o.showButtons;
997
+ !0 !== t && (t || (t = [], o.showButtons = t), t[s] = !0);
998
+ }
999
+ const n = this.processFilterCriteria(t, e);
1000
+ return n ? (n.index = s, n) : null;
1001
+ }
1002
+ processFilterColumns(t, e, o, s) {
1003
+ if (!e) return;
1004
+ const r = e.childNodes, i = r.length;
1005
+ for (let e = 0; e < i; e++) {
1006
+ const i = r.item(e);
1007
+ if (1 === i.nodeType && "filterColumn" === i.localName) {
1008
+ const e = this.processFilterColumn(t, i, s);
1009
+ e && o.push(e);
1010
+ }
1011
+ }
1012
+ return o;
1013
+ }
1014
+ },
1015
+ SortStateVisitor: class {
1016
+ visit(t, e, o) {
1017
+ if (!e) return;
1018
+ const s = e.getAttribute("ref"), r = {};
1019
+ e.hasAttribute("caseSensitive") && (r.collatorOptions = A(e.getAttribute("caseSensitive")) ? dt.CaseSensitiveOptions : dt.CaseInsensitiveOptions);
1020
+ const i = e.getAttribute("sortMethod");
1021
+ null != i && "none" !== i && ("stroke" === i ? r.collatorOptions = {
1022
+ ...r.collatorOptions,
1023
+ collation: "stroke"
1024
+ } : "pinYin" === i && (r.collatorOptions = {
1025
+ ...r.collatorOptions,
1026
+ collation: "pinyin"
1027
+ }));
1028
+ const n = {};
1029
+ e.hasAttribute("columnSort") && A(e.getAttribute("columnSort")) && (n.axis = nt.Axis.Column);
1030
+ const l = Q.fastStringToRange(s), a = [], c = [];
1031
+ this.processSortConditions(t, e, a, l, r, c), a.length > 0 && (n.sorts = a);
1032
+ const u = t.getVisitorParamsState().get("ref");
1033
+ if (u && s) {
1034
+ const t = Q.fastStringToRange(u);
1035
+ n.extent = {
1036
+ range: p(t, l),
1037
+ sorts: c.map((e) => k(t, l, e))
1038
+ };
1039
+ }
1040
+ return Object.keys(a).length > 0 && (o.sort = n), n;
1041
+ }
1042
+ processSortCondition(t, e, o, s, r) {
1043
+ if (!e) return null;
1044
+ const i = {};
1045
+ if (!e.hasAttribute("ref")) return void t.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
1046
+ if (e.hasAttribute("ref")) {
1047
+ const t = e.getAttribute("ref"), s = Q.fastStringToRange(t);
1048
+ i.index = o ? s.colStart - o.colStart : s.colStart, r?.push(s);
1049
+ }
1050
+ const n = { ...s };
1051
+ i.criteria = n, n.reverse = !1, e.hasAttribute("descending") && (n.reverse = A(e.getAttribute("descending")));
1052
+ const l = V(e.getAttribute("sortBy"));
1053
+ l && (n.sortOn = l);
1054
+ const a = St(t, e);
1055
+ return a && (n.style = a), t.copyFromAttribute(e, "iconSet", n), t.copyFromAttribute(e, "customList", n), i;
1056
+ }
1057
+ processSortConditions(t, e, o, s, r, i) {
1058
+ if (!e) return;
1059
+ const n = e.childNodes, l = n.length;
1060
+ for (let e = 0; e < l; e++) {
1061
+ const l = n.item(e);
1062
+ if (1 === l.nodeType && "sortCondition" === l.localName) {
1063
+ const e = this.processSortCondition(t, l, s, r, i);
1064
+ e && o.push(e);
1065
+ }
1066
+ }
1067
+ }
1068
+ },
1069
+ SheetStyleVisitor: class extends Tt {
1070
+ visit(t, e, o) {
1071
+ this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1072
+ const s = {
1073
+ fills: {},
1074
+ fonts: {},
1075
+ borders: {}
1076
+ }, r = t.evaluate("fonts", e);
1077
+ this.processFonts(t, r, s.fonts);
1078
+ const n = s.fonts[this.normalFontId(t, e)], l = {
1079
+ declared: ["1", "true"].includes(r?.getAttribute("x14ac:knownFonts") ?? ""),
1080
+ normalIsThemeFont: F(n?.family),
1081
+ faces: _(Object.values(s.fonts).map((t) => ({
1082
+ ...t,
1083
+ family: i(t?.family, t?.fallbacks, null, !1).name
1084
+ })))
1085
+ };
1086
+ t.getVisitorParamsState().set(D, l), n && t.getVisitorParamsState().set(z, n), this.processFills(t, t.evaluate("fills", e), s.fills), this.processBorders(t, t.evaluate("borders", e), s.borders, !0), s.fills[0] = { type: rt.Type.None }, s.fills[1] = {
1087
+ type: rt.Type.Pattern,
1088
+ patternType: rt.BuiltInSheetPattern.Gray125
1089
+ }, s.borders[0] = {
1090
+ bottom: { style: et.StrokeStyle.None },
1091
+ left: { style: et.StrokeStyle.None },
1092
+ right: { style: et.StrokeStyle.None },
1093
+ top: { style: et.StrokeStyle.None }
1094
+ };
1095
+ const a = [];
1096
+ this.processXFs(t, t.evaluate("cellStyleXfs", e), a, s, null, !1);
1097
+ const c = /* @__PURE__ */ new Map();
1098
+ if (a.length > 0) {
1099
+ const s = [];
1100
+ this.processCellStyles(t, t.evaluate("cellStyles", e), s, a, c), o.named = s;
1101
+ }
1102
+ const u = [];
1103
+ this.processXFs(t, t.evaluate("cellXfs", e), u, s, c), Object.keys(u).length > 0 && (o.direct = u);
1104
+ const d = this.collectHiddenXfs(t.evaluate("cellXfs", e));
1105
+ d.size > 0 && t.getVisitorParamsState().set(G, d);
1106
+ const h = this.collectPivotButtonXfs(t.evaluate("cellXfs", e));
1107
+ h.size > 0 && t.getVisitorParamsState().set($, h);
1108
+ const p = this.collectXfComplements(t.evaluate("cellXfs", e));
1109
+ p.size > 0 && t.getVisitorParamsState().set(W, p);
1110
+ const m = [];
1111
+ return this.processDXFs(t, t.evaluate("dxfs", e), m), this.processTableStyles(t, t.evaluate("tableStyles", e), o, m), this.processSlicerStyles(t, t.evaluate("extLst", e), o), this.processIndexColors(t, t.evaluate("colors/indexedColors", e), o), this.processMruColors(t, t.evaluate("colors/mruColors", e), o), o;
1112
+ }
1113
+ normalFontId(t, e) {
1114
+ const o = t.evaluate("cellStyles", e)?.childNodes;
1115
+ let s = 0;
1116
+ for (let t = 0; t < (o?.length ?? 0); t++) {
1117
+ const e = o.item(t);
1118
+ if (1 === e.nodeType && "0" === e.getAttribute("builtinId")) {
1119
+ s = parseInt(e.getAttribute("xfId") ?? "0", 10) || 0;
1120
+ break;
1121
+ }
1122
+ }
1123
+ const r = t.evaluate("cellStyleXfs", e)?.childNodes;
1124
+ let i = 0;
1125
+ for (let t = 0; t < (r?.length ?? 0); t++) {
1126
+ const e = r.item(t);
1127
+ if (1 === e.nodeType && i++ === s) return parseInt(e.getAttribute("fontId") ?? "0", 10) || 0;
1128
+ }
1129
+ return 0;
1130
+ }
1131
+ processIndexColors(t, e, o) {
1132
+ if (!e) return;
1133
+ const s = [], r = e.childNodes, i = r.length;
1134
+ for (let e = 0; e < i; e++) {
1135
+ const o = r.item(e);
1136
+ if (1 === o.nodeType && "rgbColor" === o.localName) {
1137
+ const e = { color: null };
1138
+ this.processDataBarColor(t, o, e, "color"), e.color && s.push(e.color);
1139
+ }
1140
+ }
1141
+ o.indexedColors = s;
1142
+ }
1143
+ processMruColors(t, e, o) {
1144
+ if (!e) return;
1145
+ const s = [], r = e.childNodes, i = r.length;
1146
+ for (let e = 0; e < i; e++) {
1147
+ const o = r.item(e);
1148
+ if (1 === o.nodeType && "color" === o.localName) {
1149
+ const e = { color: null };
1150
+ this.processDataBarColor(t, o, e, "color"), e.color && s.push(e.color);
1151
+ }
1152
+ }
1153
+ s.length > 0 && (o.mruColors = s);
1154
+ }
1155
+ processNumFmts(t, e, o) {
1156
+ if (!e) return;
1157
+ const s = /* @__PURE__ */ new Map();
1158
+ if (t.getVisitorParamsState().set("numFmts", s), !e) return;
1159
+ const r = e.childNodes, i = r.length;
1160
+ for (let t = 0; t < i; t++) {
1161
+ const e = r.item(t);
1162
+ if (1 === e.nodeType && "numFmt" === e.localName) {
1163
+ const t = e.getAttribute("numFmtId"), o = e.getAttribute("formatCode");
1164
+ if (t && o) {
1165
+ const e = o;
1166
+ s.set(parseInt(t), e);
1167
+ }
1168
+ }
1169
+ }
1170
+ }
1171
+ processXFs(t, e, o, s, r = null, i = !0) {
1172
+ if (!e) return;
1173
+ const n = e.childNodes, l = n.length;
1174
+ for (let e = 0; e < l; e++) {
1175
+ const l = n.item(e);
1176
+ if (1 === l.nodeType && "xf" === l.localName) {
1177
+ const e = {};
1178
+ this.processXF(t, l, e, s, r, i), o.push(e);
1179
+ }
1180
+ }
1181
+ }
1182
+ processXF(t, e, o, s, r, i) {
1183
+ if (!e) return;
1184
+ const n = e.getAttribute("xfId");
1185
+ if (n && r) {
1186
+ const t = r.get(parseInt(n));
1187
+ t && t !== ot.BuiltInName.Normal && (o.named = t);
1188
+ }
1189
+ const l = (t) => !(!i && e.hasAttribute(t)) || A(e.getAttribute(t)), a = (t) => !i || e.hasAttribute(t) && A(e.getAttribute(t)), c = "0", u = i ? c : void 0;
1190
+ if (l("applyFont")) {
1191
+ const t = e.getAttribute("fontId") ?? u;
1192
+ if (void 0 !== t && (t !== c || a("applyFont"))) {
1193
+ const e = s.fonts[t];
1194
+ void 0 !== e && (o.font = e);
1195
+ }
1196
+ }
1197
+ if (l("applyFill")) {
1198
+ const t = e.getAttribute("fillId") ?? u;
1199
+ if (void 0 !== t && (t !== c || a("applyFill"))) {
1200
+ const e = s.fills[t];
1201
+ void 0 !== e && Object.keys(e).length > 0 && (o.fill = e);
1202
+ }
1203
+ }
1204
+ if (l("applyBorder")) {
1205
+ const t = e.getAttribute("borderId") ?? u;
1206
+ if (void 0 !== t && (t !== c || a("applyBorder"))) {
1207
+ const e = s.borders[t];
1208
+ void 0 !== e && (o.borders = e);
1209
+ }
1210
+ }
1211
+ if (l("applyNumberFormat")) {
1212
+ const s = e.getAttribute("numFmtId") ?? u;
1213
+ if (void 0 !== s && (s !== c || a("applyNumberFormat"))) {
1214
+ const e = parseInt(s);
1215
+ let r;
1216
+ const i = t.getVisitorParamsState();
1217
+ if (i) {
1218
+ const t = i.get("numFmts");
1219
+ t && (r = t.get(e)), o.numberFormat = r ?? e;
1220
+ } else t.warn("Number formats were unavailable; a cell format was not read.", { onceKey: "xlsx.style.numberFormat.state" });
1221
+ }
1222
+ }
1223
+ if (l("applyAlignment")) {
1224
+ const s = t.evaluate("alignment", e);
1225
+ (s || a("applyAlignment")) && this.processAlignment(t, s, o);
1226
+ }
1227
+ if (l("applyProtection")) {
1228
+ const s = t.evaluate("protection", e);
1229
+ (s || a("applyProtection")) && this.processProtection(t, s, o);
1230
+ }
1231
+ const d = A(e.getAttribute("quotePrefix") ?? "");
1232
+ d && (o.quotePrefix = d);
1233
+ }
1234
+ processAlignment(t, e, o) {
1235
+ const s = {};
1236
+ if (e?.hasAttribute("horizontal") ? s.horizontal = e.getAttribute("horizontal") : s.horizontal = ct.HorizontalAlignment.General, e?.hasAttribute("vertical") ? s.vertical = e.getAttribute("vertical") : s.vertical = ct.VerticalAlignment.Bottom, e?.hasAttribute("indent") ? s.indent = parseInt(e.getAttribute("indent")) : s.indent = 0, e?.hasAttribute("relativeIndent") ? s.relativeIndent = parseInt(e.getAttribute("relativeIndent")) : s.relativeIndent = 0, A(e?.getAttribute("wrapText") ?? "") ? s.overflow = ct.Overflow.Wrap : s.overflow = ct.Overflow.Visible, A(e?.getAttribute("shrinkToFit") ?? "") && (s.overflow = ct.Overflow.Shrink), e?.hasAttribute("textRotation")) {
1237
+ let t = parseFloat(e.getAttribute("textRotation"));
1238
+ t > 0 && t <= 90 ? t = 360 - t : t > 90 && t <= 180 ? t -= 90 : 255 === t && (t = 0, s.stacked = !0), s.rotation = t;
1239
+ } else s.rotation = 0;
1240
+ e?.hasAttribute("justifyLastLine") && (s.justifyLastLine = A(e.getAttribute("justifyLastLine")));
1241
+ const r = e?.getAttribute("readingOrder");
1242
+ return r && ("0" === r ? s.readingDirection = ct.ReadingDirection.Auto : "1" === r ? s.readingDirection = ct.ReadingDirection.LeftToRight : "2" === r ? s.readingDirection = ct.ReadingDirection.RightToLeft : t.warn(`Invalid readingOrder '${r}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(s).length > 0 && (o.alignment = s), o;
1243
+ }
1244
+ collectHiddenXfs(t) {
1245
+ const e = /* @__PURE__ */ new Set();
1246
+ if (!t) return e;
1247
+ const o = t.childNodes;
1248
+ let s = 0;
1249
+ for (let t = 0; t < o.length; t++) {
1250
+ const r = o.item(t);
1251
+ if (1 !== r.nodeType || "xf" !== r.localName) continue;
1252
+ const i = r.childNodes;
1253
+ for (let t = 0; t < i.length; t++) {
1254
+ const o = i.item(t);
1255
+ 1 === o.nodeType && "protection" === o.localName && A(o.getAttribute("hidden") ?? "") && e.add(s);
1256
+ }
1257
+ s++;
1258
+ }
1259
+ return e;
1260
+ }
1261
+ collectPivotButtonXfs(t) {
1262
+ const e = /* @__PURE__ */ new Set();
1263
+ if (!t) return e;
1264
+ const o = t.childNodes;
1265
+ let s = 0;
1266
+ for (let t = 0; t < o.length; t++) {
1267
+ const r = o.item(t);
1268
+ 1 === r.nodeType && "xf" === r.localName && (A(r.getAttribute("pivotButton") ?? "") && e.add(s), s++);
1269
+ }
1270
+ return e;
1271
+ }
1272
+ collectXfComplements(t) {
1273
+ const e = /* @__PURE__ */ new Map();
1274
+ if (!t) return e;
1275
+ const o = t.childNodes;
1276
+ let s = 0;
1277
+ for (let t = 0; t < o.length; t++) {
1278
+ const r = o.item(t);
1279
+ if (1 !== r.nodeType || "xf" !== r.localName) continue;
1280
+ const i = Pt(r, "extLst");
1281
+ if (i) {
1282
+ const t = i.childNodes;
1283
+ for (let o = 0; o < t.length; o++) {
1284
+ const r = Pt(t.item(o), "xfComplement"), i = parseInt(r?.getAttribute("i") ?? "", 10);
1285
+ isNaN(i) || e.set(s, i);
1286
+ }
1287
+ }
1288
+ s++;
1289
+ }
1290
+ return e;
1291
+ }
1292
+ processProtection(t, e, o) {
1293
+ if (!e) return;
1294
+ const s = e.getAttribute("locked");
1295
+ return o.protection = { alwaysUnlocked: !!s && !A(s) }, o;
1296
+ }
1297
+ processDXF(t, e, o) {
1298
+ if (!e) return;
1299
+ const s = e.childNodes, r = s.length;
1300
+ for (let e = 0; e < r; e++) {
1301
+ const r = s.item(e);
1302
+ if (1 === r.nodeType && "font" === r.localName) {
1303
+ const e = {};
1304
+ this.processFont(t, r, e), o.font = e;
1305
+ } else if (1 === r.nodeType && "fill" === r.localName) {
1306
+ const e = [];
1307
+ this.processFill(t, r, e, 0), e.length > 0 && e[0] && (o.fill = e[0]);
1308
+ } else if (1 === r.nodeType && "border" === r.localName) {
1309
+ const e = [];
1310
+ this.processBorder(t, r, e, 0, !1), e.length > 0 && e[0] && (o.borders = e[0]);
1311
+ } else if (1 === r.nodeType && "numFmt" === r.localName) {
1312
+ const t = r.getAttribute("formatCode");
1313
+ if (t) o.numberFormat = t;
1314
+ else {
1315
+ const t = r.getAttribute("numFmtId");
1316
+ t && (o.numberFormat = Number(t));
1317
+ }
1318
+ } else 1 === r.nodeType && "alignment" === r.localName && this.processAlignment(t, r, o);
1319
+ }
1320
+ }
1321
+ processDXFs(t, e, o) {
1322
+ if (!e) return;
1323
+ t.getVisitorParamsState().set("processingDXFs", !0);
1324
+ const s = /* @__PURE__ */ new Map();
1325
+ t.getVisitorParamsState().set("dxfs", s);
1326
+ const r = e.childNodes, i = r.length;
1327
+ for (let e = 0; e < i; e++) {
1328
+ const i = r.item(e);
1329
+ if (1 === i.nodeType && "dxf" === i.localName) {
1330
+ const e = {};
1331
+ this.processDXF(t, i, e);
1332
+ const r = o.length;
1333
+ s.set(r, e), o.push(e);
1334
+ }
1335
+ }
1336
+ t.getVisitorParamsState().delete("processingDXFs");
1337
+ }
1338
+ processSlicerStyles(t, e, o) {
1339
+ if (!e) return;
1340
+ let s = null, r = null;
1341
+ const i = e.childNodes;
1342
+ for (let t = 0; t < i.length; t++) {
1343
+ const e = i.item(t);
1344
+ if (1 !== e.nodeType || "ext" !== e.localName) continue;
1345
+ const o = e.childNodes;
1346
+ for (let t = 0; t < o.length; t++) {
1347
+ const e = o.item(t);
1348
+ 1 === e.nodeType && ("dxfs" === e.localName ? s = e : "slicerStyles" === e.localName && (r = e));
1349
+ }
1350
+ }
1351
+ if (!r) return;
1352
+ const n = [];
1353
+ if (s) {
1354
+ t.getVisitorParamsState().set("processingDXFs", !0);
1355
+ const e = s.childNodes;
1356
+ for (let o = 0; o < e.length; o++) {
1357
+ const s = e.item(o);
1358
+ if (1 !== s.nodeType || "dxf" !== s.localName) continue;
1359
+ const r = {};
1360
+ this.processDXF(t, s, r), n.push(r);
1361
+ }
1362
+ t.getVisitorParamsState().delete("processingDXFs");
1363
+ }
1364
+ const l = {}, a = r.getAttribute("defaultSlicerStyle");
1365
+ a && "SlicerStyleLight1" !== a && (l.defaultSlicerStyle = a);
1366
+ const c = o.tables?.styles, u = r.childNodes;
1367
+ for (let e = 0; e < u.length; e++) {
1368
+ const o = u.item(e);
1369
+ if (1 !== o.nodeType || "slicerStyle" !== o.localName) continue;
1370
+ const s = o.getAttribute("name");
1371
+ if (!s) continue;
1372
+ const r = {}, i = c?.[s];
1373
+ i && !1 === i.table && !i.pivot && (i.wholeTable && (r.wholeTable = i.wholeTable), i.headerRow && (r.headerRow = i.headerRow), delete c[s]);
1374
+ const a = t.evaluate("slicerStyleElements", o)?.childNodes, d = a?.length ?? 0;
1375
+ for (let e = 0; e < d; e++) {
1376
+ const o = a.item(e);
1377
+ if (1 !== o.nodeType || "slicerStyleElement" !== o.localName) continue;
1378
+ const s = o.getAttribute("type");
1379
+ if (!s || !It.has(s)) continue;
1380
+ const i = o.getAttribute("dxfId"), l = null != i ? n[parseInt(i)] : void 0;
1381
+ l ? r[s] = l : t.warn(`A slicer style names a format that does not exist (dxfId '${i}').`, { onceKey: "xlsx.style.slicerStyle.dxf" });
1382
+ }
1383
+ (l.styles ??= {})[s] = r;
1384
+ }
1385
+ c && 0 === Object.keys(c).length && (delete o.tables.styles, 0 === Object.keys(o.tables).length && delete o.tables), Object.keys(l).length > 0 && (o.slicers = l);
1386
+ }
1387
+ processTableStyle(t, e, o, s, r = !1) {
1388
+ const i = e.getAttribute("name"), n = { name: i };
1389
+ e.hasAttribute("table") && (n.table = A(e.getAttribute("table"))), n.pivot = !e.hasAttribute("pivot") || A(e.getAttribute("pivot")), r && !n.pivot && s.unshift(null);
1390
+ const l = e.childNodes, a = l.length;
1391
+ for (let e = 0; e < a; e++) {
1392
+ const o = l.item(e);
1393
+ if (1 === o.nodeType && "tableStyleElement" === o.localName) {
1394
+ const e = o.getAttribute("type"), r = o.getAttribute("dxfId");
1395
+ let i = null != r ? s?.[r] : void 0;
1396
+ i || (t.warn(`A table style names a format that does not exist (dxfId '${r}').`, { onceKey: "xlsx.style.tableStyle.dxf" }), i = {}), n[e] = i;
1397
+ let l = null;
1398
+ o.hasAttribute("size") && (l = parseInt(o.getAttribute("size"))), l && !isNaN(l) && (i.size = l);
1399
+ }
1400
+ }
1401
+ delete n.name, o[i] = n;
1402
+ }
1403
+ processTableStyles(t, e, o, s, r) {
1404
+ if (!e) return;
1405
+ const i = {}, n = e.getAttribute("defaultTableStyle");
1406
+ n && (i.defaultTableStyle = n);
1407
+ const l = e.getAttribute("defaultPivotStyle");
1408
+ l && (i.defaultPivotStyle = l);
1409
+ const a = e.childNodes, c = {}, u = a.length;
1410
+ for (let e = 0; e < u; e++) {
1411
+ const o = a.item(e);
1412
+ 1 === o.nodeType && "tableStyle" === o.localName && this.processTableStyle(t, o, c, s, r);
1413
+ }
1414
+ return Object.keys(c).length > 0 && (i.styles = c), Object.keys(i).length > 0 && (o.tables = i), o;
1415
+ }
1416
+ processCellStyles(t, e, o, s, r) {
1417
+ if (!e) return;
1418
+ const i = e.childNodes, n = i.length;
1419
+ for (let t = 0; t < n; t++) {
1420
+ const e = i.item(t);
1421
+ if (1 === e.nodeType && "cellStyle" === e.localName) {
1422
+ const t = parseInt(e.getAttribute("xfId") ?? ""), i = e.getAttribute("name"), n = e.getAttribute("builtinId");
1423
+ let l = i;
1424
+ if (null !== n) {
1425
+ const t = ot.builtInNameFromId(parseInt(n));
1426
+ void 0 !== t && (l = t);
1427
+ }
1428
+ if (r.set(t, l), !s[t]) continue;
1429
+ const a = {
1430
+ name: l,
1431
+ style: s[t]
1432
+ };
1433
+ e.getAttribute("hidden") && (a.hidden = A(e.getAttribute("hidden"))), e.getAttribute("iLevel") && (a.iLevel = parseInt(e.getAttribute("iLevel"))), null !== n && A(e.getAttribute("customBuiltin") ?? "0") && (a.customized = !0), o.push(a);
1434
+ }
1435
+ }
1436
+ }
1437
+ afterVisit(t, e, o) {}
1438
+ },
1439
+ WorkbookVisitor: class extends Tt {
1440
+ visit(t, e, o) {
1441
+ return this.processSheetRefs(t, t.evaluate("sheets", e), o), this.processExternalReferences(t, t.evaluate("externalReferences", e), o), this.processBookViews(t, t.evaluate("bookViews", e), o), this.processDefinedNames(t, t.evaluate("definedNames", e), o), this.processCalcPr(t, t.evaluate("calcPr", e), o), this.processPivotCaches(t, t.evaluate("pivotCaches", e), o), this.processWorkbookProtection(t, t.evaluate("workbookProtection", e), o), this.processWorkbookPr(t, t.evaluate("workbookPr", e), o), o;
1442
+ }
1443
+ processPassword(t, e, o, s = "workbook", r = "password") {
1444
+ if (!e) return;
1445
+ const i = {};
1446
+ t.copyFromAttribute(e, `${s}AlgorithmName`, i, "algorithm"), t.copyFromAttribute(e, `${s}HashValue`, i, "hash"), t.copyFromAttribute(e, `${s}SaltValue`, i, "salt"), t.copyFromAttribute(e, `${s}SpinCount`, i, "spinCount", t.INT_COPY), t.copyFromAttribute(e, `${s}Password`, i, "legacyHash"), Object.keys(i).length > 0 && (o[r] = i);
1447
+ }
1448
+ processWorkbookProtection(t, e, o) {
1449
+ if (!e) return;
1450
+ const s = {};
1451
+ this.processPassword(t, e, s, "workbook", "password"), this.processPassword(t, e, s, "revisions", "revisionsPassword");
1452
+ for (const t of T) s[t.key] = R(t, e.getAttribute(t.attribute));
1453
+ return o.protection = s, o;
1454
+ }
1455
+ processCalcPr(t, e, o) {
1456
+ if (!e) return;
1457
+ const s = {};
1458
+ t.copyFromAttribute(e, "calcMode", s, "calcMode", (t) => kt[t] ?? null), t.copyFromAttribute(e, "fullCalcOnLoad", s, "fullCalcOnLoad", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcOnSave", s, "calcOnSave", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcCompleted", s, "calcCompleted", t.BOOLEAN_COPY), t.copyFromAttribute(e, "fullPrecision", s, "fullPrecision", t.BOOLEAN_COPY), t.copyFromAttribute(e, "forceFullCalc", s, "forceFullCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentCalc", s, "concurrentCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentManualCount", s, "concurrentManualCount", t.INT_COPY), t.copyFromAttribute(e, "refMode", s, "refMode"), t.copyFromAttribute(e, "iterate", s, "iterate", t.BOOLEAN_COPY), t.copyFromAttribute(e, "iterateCount", s, "maxIteration", t.INT_COPY), t.copyFromAttribute(e, "iterateDelta", s, "maxIterateChange", t.FLOAT_COPY);
1459
+ const r = e.getAttribute("calcId");
1460
+ null !== r && t.getVisitorParamsState().set("calcId", r), o.calc = s;
1461
+ }
1462
+ processSheetRefs(t, e, o) {
1463
+ if (!e) return;
1464
+ const s = [], r = e.childNodes, i = r.length;
1465
+ for (let e = 0; e < i; e++) {
1466
+ const o = r.item(e);
1467
+ 1 === o.nodeType && "sheet" === o.localName && this.processSheetRef(t, o, s);
1468
+ }
1469
+ o.sheets = s;
1470
+ }
1471
+ processSheetRef(e, s, r) {
1472
+ const i = {};
1473
+ e.copyFromAttribute(s, "name", i, "name"), e.copyFromAttribute(s, "state", i, "visibility"), e.copyFromAttribute(s, "sheetId", i, "sheetId", e.INT_COPY);
1474
+ const n = s.getAttribute("r:id"), l = n ? I(e.getRelationships().get(n)?.type) : null;
1475
+ if (l) {
1476
+ const s = e.readEmbeddedPart(n);
1477
+ if (s?.xml) {
1478
+ const e = { part: s }, n = o(s.xml), a = n ? t((t) => n.get(t)) : void 0;
1479
+ a && (e.tabColor = a), i.kind = l, i.sheet = e, r.push(i);
1480
+ return;
1481
+ }
1482
+ e.warn(`The ${l} sheet '${i.name}' could not be read and was loaded as an empty worksheet.`), r.push(i);
1483
+ return;
1484
+ }
1485
+ const a = n ? e.getRef(n) : null;
1486
+ a && (i.sheet = a), r.push(i);
1487
+ }
1488
+ processExternalReferences(t, e, o) {
1489
+ if (!e) return;
1490
+ const s = [], r = e.childNodes, i = r.length;
1491
+ for (let e = 0; e < i; e++) {
1492
+ const o = r.item(e);
1493
+ if (1 === o.nodeType && "externalReference" === o.localName) {
1494
+ const e = o.getAttribute("r:id"), r = e ? t.getRef(e) : null;
1495
+ s.push(r ?? null);
1496
+ }
1497
+ }
1498
+ s.length > 0 && (o.externalBooks = s);
1499
+ }
1500
+ processPivotCaches(t, e, o) {
1501
+ if (!e) return;
1502
+ const s = [], r = t.evaluate("workbookPr", e.parentNode)?.getAttribute?.("date1904"), i = "1" === r || "true" === r, n = B(t.getVisitorParamsState().get("numFmts"), void 0), l = e.childNodes, a = l.length;
1503
+ for (let e = 0; e < a; e++) {
1504
+ const o = l.item(e);
1505
+ if (1 !== o.nodeType || "pivotCache" !== o.localName) continue;
1506
+ const r = parseInt(o.getAttribute("cacheId") ?? "", 10), a = o.getAttribute("r:id");
1507
+ if (isNaN(r) || !a) continue;
1508
+ const c = t.readEmbeddedPart(a);
1509
+ if (!c) continue;
1510
+ const u = K(c, i, (t) => n.numberFormat(t)), d = !u && c.xml ? w(c.xml, n) : void 0, h = !u && c.xml ? J(c.xml) : void 0;
1511
+ s.push({
1512
+ cacheId: r,
1513
+ part: c,
1514
+ ...d ? { partFormats: d } : {},
1515
+ ...h ? { source: h } : {},
1516
+ ...u
1517
+ });
1518
+ }
1519
+ s.length > 0 && (o.pivotCaches = s);
1520
+ }
1521
+ processBookViews(t, e, o) {
1522
+ if (!e) return;
1523
+ const s = e.childNodes;
1524
+ let r = 0;
1525
+ const i = s.length;
1526
+ for (let e = 0; r < 1 && e < i; e++) {
1527
+ const i = s.item(e);
1528
+ 1 === i.nodeType && "workbookView" === i.localName && (this.processWorkbookView(t, i, o), r++);
1529
+ }
1530
+ }
1531
+ processWorkbookView(t, e, o) {
1532
+ if (!e) return;
1533
+ const s = {}, r = [
1534
+ "xWindow",
1535
+ "yWindow",
1536
+ "windowWidth",
1537
+ "windowHeight"
1538
+ ].map((t) => parseInt(e.getAttribute(t) ?? "", 10));
1539
+ if (r.some((t) => Number.isFinite(t))) {
1540
+ const [t, e, o, i] = r.map((t) => Number.isFinite(t) ? t : 0);
1541
+ s.windowBounds = {
1542
+ left: t,
1543
+ top: e,
1544
+ width: o,
1545
+ height: i
1546
+ };
1547
+ }
1548
+ t.copyFromAttribute(e, "activeTab", s, "activeSheetId", [t.INT_COPY, (t) => t]), e.hasAttribute("activeTab") || (s.activeSheetId = 0), t.copyFromAttribute(e, "showHorizontalScroll", s, "showHorizontalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showVerticalScroll", s, "showVerticalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showSheetTabs", s, "showTabs", t.BOOLEAN_COPY), t.copyFromAttribute(e, "tabRatio", s, "tabRatio", [t.FLOAT_COPY, (t) => t]), t.copyFromAttribute(e, "firstSheet", s, "firstTab", [t.INT_COPY, (t) => t]), t.copyFromAttribute(e, "minimized", s, "minimized", t.BOOLEAN_COPY), t.copyFromAttribute(e, "autoFilterDateGrouping", s, "autoFilterDateGrouping", t.BOOLEAN_COPY);
1549
+ const i = e.getAttribute("visibility");
1550
+ "hidden" !== i && "veryHidden" !== i || (s.visibility = i), Object.keys(s).length > 0 && (o.view = s);
1551
+ }
1552
+ processDefineName(t, e, o, s) {
1553
+ if (!e) return;
1554
+ const r = {}, i = e.firstChild;
1555
+ if (i && 3 === i.nodeType && (r.ref = i.textContent), t.copyFromAttribute(e, "name", r), t.copyFromAttribute(e, "comment", r), t.copyFromAttribute(e, "hidden", r, "hidden", t.BOOLEAN_COPY), e.hasAttribute("localSheetId")) {
1556
+ const o = e.getAttribute("localSheetId");
1557
+ if (!s[o]?.name) return void t.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${o}' which does not exist.`);
1558
+ r.scope = s[o].name;
1559
+ }
1560
+ const n = {};
1561
+ for (const o of U) t.copyFromAttribute(e, o, n);
1562
+ for (const t of H) {
1563
+ const o = e.getAttribute(t);
1564
+ "1" !== o && "true" !== o || (n[t] = !0);
1565
+ }
1566
+ t.copyFromAttribute(e, "functionGroupId", n, "functionGroupId", t.INT_COPY), Object.keys(n).length > 0 && (r.fileAttributes = n), Object.keys(r).length > 0 && o.push(r);
1567
+ }
1568
+ processDefinedNames(t, e, o) {
1569
+ if (!e) return;
1570
+ const s = [], r = e.childNodes, i = r.length;
1571
+ for (let e = 0; e < i; e++) {
1572
+ const i = r.item(e);
1573
+ 1 === i.nodeType && "definedName" === i.localName && this.processDefineName(t, i, s, o.sheets);
1574
+ }
1575
+ s.length > 0 && (o.names = s);
1576
+ }
1577
+ processWorkbookPr(t, e, o) {
1578
+ if (!e) return;
1579
+ t.copyFromAttribute(e, "date1904", o, "date1904", t.BOOLEAN_COPY), t.copyFromAttribute(e, "codeName", o, "codeName"), t.copyFromAttribute(e, "updateLinks", o, "updateLinks");
1580
+ const s = e.getAttribute("hidePivotFieldList");
1581
+ "1" !== s && "true" !== s || (o.hiddenPivotFieldList = !0);
1582
+ }
1583
+ afterVisit(t, e, o) {}
1584
+ },
1585
+ TableVisitor: class {
1586
+ visit(t, e, o) {
1587
+ const s = {};
1588
+ return t.copyFromAttribute(e, "ref", o, "r"), t.getVisitorParamsState().set("ref", o.r), o.v = s, t.copyFromAttribute(e, "name", s), t.copyFromAttribute(e, "displayName", s, "name"), 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), t.copyFromAttribute(e, "id", s), t.copyFromAttribute(e, "comment", s, "description"), t.copyFromAttribute(e, "connectionId", s, "connectionId", t.INT_COPY), t.copyFromAttribute(e, "tableType", s), t.copyFromAttribute(e, "published", s, "published", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRow", s, "insertRow", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRowShift", s, "insertRowShift", t.BOOLEAN_COPY), s.totalsRowShown = "0" !== e.getAttribute("totalsRowShown"), s;
1589
+ }
1590
+ afterVisit(t, e, o) {
1591
+ const s = o.v;
1592
+ if (t.evaluate("autoFilter", e)) {
1593
+ if (Array.isArray(s.hiddenButtons)) {
1594
+ const t = s.hiddenButtons.length;
1595
+ 0 === t ? s.hiddenButtons = !1 : t === s.columns?.length && (s.hiddenButtons = !0);
1596
+ }
1597
+ } else s.hiddenButtons = !0, s.showButtons = !1;
1598
+ return s;
1599
+ }
1600
+ processTableStyleInfo(t, e, o) {
1601
+ if (!e) return;
1602
+ const s = e.childNodes, r = {}, i = s.length;
1603
+ for (let e = 0; e < i; e++) {
1604
+ const o = s.item(e);
1605
+ 1 === o.nodeType && "tableStyleInfo" === o.localName && (t.copyFromAttribute(o, "name", r), t.copyFromAttribute(o, "showColumnStripes", r, "showColumnStripes", t.BOOLEAN_COPY), t.copyFromAttribute(o, "showFirstColumn", r, "showFirstColumn", t.BOOLEAN_COPY), t.copyFromAttribute(o, "showLastColumn", r, "showLastColumn", t.BOOLEAN_COPY), t.copyFromAttribute(o, "showRowStripes", r, "showRowStripes", t.BOOLEAN_COPY));
1606
+ }
1607
+ Object.keys(r).length > 0 && (o.style = r);
1608
+ }
1609
+ processTableColumn(t, e, o) {
1610
+ if (!e) return null;
1611
+ const s = e.childNodes, r = s.length;
1612
+ for (let e = 0; e < r; e++) {
1613
+ const r = s.item(e);
1614
+ if (1 === r.nodeType && "tableColumn" === r.localName) {
1615
+ const e = {};
1616
+ t.copyFromAttribute(r, "name", e), t.copyFromAttribute(r, "id", e), t.copyFromAttribute(r, "uniqueName", e), t.copyFromAttribute(r, "queryTableFieldId", e), t.copyFromAttribute(r, "totalsRowLabel", e);
1617
+ let s = r.getAttribute("totalsRowFunction");
1618
+ if (null !== s) if ("custom" === s) {
1619
+ const o = t.evaluate("totalsRowFormula", r);
1620
+ o && (e.totalsRowFormula = o.textContent);
1621
+ } else e.totalsRowFormula = s;
1622
+ t.copyFromAttribute(r, "totalsRowLabel", e);
1623
+ const i = t.evaluate("calculatedColumnFormula", r);
1624
+ i?.textContent && (e.calculatedColumnFormula = i.textContent), o.push(e);
1625
+ }
1626
+ }
1627
+ return o;
1628
+ }
1629
+ processTableColumns(t, e, o) {
1630
+ const s = e.childNodes, r = [], i = s.length;
1631
+ for (let e = 0; e < i; e++) {
1632
+ const o = s.item(e);
1633
+ 1 === o.nodeType && "tableColumns" === o.localName && this.processTableColumn(t, o, r);
1634
+ }
1635
+ r.length > 0 && (o.columns = r);
1636
+ }
1637
+ },
1638
+ TableX14Visitor: class {
1639
+ visit(t, e, o) {
1640
+ const s = t.getVisitorParamsState().get("ref");
1641
+ if (s) {
1642
+ const o = t.getVisitorParamsState().get("descriptions");
1643
+ o && (o.add(s, e.getAttribute("altText")), o.add(s, e.getAttribute("altTextSummary")));
1644
+ }
1645
+ return t.copyFromAttribute(e, "altText", o), t.copyFromAttribute(e, "altTextSummary", o), o;
1646
+ }
1647
+ },
1648
+ ExternalLinkVisitor: class {
1649
+ visit(t, e, o) {
1650
+ const s = e.childNodes, r = s.length;
1651
+ let i = null;
1652
+ for (let t = 0; t < r; t++) {
1653
+ const e = s.item(t);
1654
+ if (1 === e.nodeType) {
1655
+ "externalBook" === e.localName && (i = e);
1656
+ break;
1657
+ }
1658
+ }
1659
+ if (!i) return o;
1660
+ e.getAttribute("mc:Ignorable") && (o.mceIgnorable = !0);
1661
+ const n = i.getAttribute("r:id");
1662
+ n && (o.__bookRelId = n);
1663
+ const l = this._findAbsoluteUrlRelId(i);
1664
+ return l && (o.__absoluteUrlRelId = l), o.sheetNames = [], this.processSheetNames(t, i, o), this.processDefinedNames(t, i, o), this.processSheetDataSet(t, i, o), o;
1665
+ }
1666
+ processSheetNames(t, e, o) {
1667
+ const s = this._findChild(e, "sheetNames");
1668
+ if (!s) return;
1669
+ const r = s.childNodes, i = r.length;
1670
+ for (let t = 0; t < i; t++) {
1671
+ const e = r.item(t);
1672
+ 1 === e.nodeType && "sheetName" === e.localName && o.sheetNames.push(e.getAttribute("val") ?? "");
1673
+ }
1674
+ }
1675
+ processDefinedNames(t, e, o) {
1676
+ const s = this._findChild(e, "definedNames");
1677
+ if (!s) return;
1678
+ const r = [], i = s.childNodes, n = i.length;
1679
+ for (let t = 0; t < n; t++) {
1680
+ const e = i.item(t);
1681
+ if (1 !== e.nodeType || "definedName" !== e.localName) continue;
1682
+ const o = e.getAttribute("name");
1683
+ if (!o) continue;
1684
+ const s = {
1685
+ name: o,
1686
+ refersTo: e.getAttribute("refersTo") ?? ""
1687
+ }, n = e.getAttribute("sheetId");
1688
+ null !== n && (s.sheetIndex = parseInt(n, 10)), r.push(s);
1689
+ }
1690
+ r.length > 0 && (o.definedNames = r);
1691
+ }
1692
+ processSheetDataSet(t, e, o) {
1693
+ const s = this._findChild(e, "sheetDataSet");
1694
+ if (!s) return;
1695
+ const r = [], i = s.childNodes, n = i.length;
1696
+ for (let e = 0; e < n; e++) {
1697
+ const o = i.item(e);
1698
+ if (1 !== o.nodeType || "sheetData" !== o.localName) continue;
1699
+ const s = o.getAttribute("sheetId");
1700
+ if (null === s) continue;
1701
+ const n = this.processSheetData(t, o);
1702
+ n.sheetIndex = parseInt(s, 10), "1" === o.getAttribute("refreshError") && (n.refreshError = !0), r.push(n);
1703
+ }
1704
+ r.length > 0 && (o.sheetDataSet = r);
1705
+ }
1706
+ processSheetData(t, e) {
1707
+ const o = new ht.Builder(), s = e.childNodes, r = s.length;
1708
+ for (let t = 0; t < r; t++) {
1709
+ const e = s.item(t);
1710
+ if (1 !== e.nodeType || "row" !== e.localName) continue;
1711
+ const r = e.childNodes, i = r.length;
1712
+ for (let t = 0; t < i; t++) {
1713
+ const e = r.item(t);
1714
+ if (1 !== e.nodeType || "cell" !== e.localName) continue;
1715
+ const s = e.getAttribute("r");
1716
+ if (!s) continue;
1717
+ const i = Q.fastStringToCell(s);
1718
+ if (void 0 === i?.rowIndex || void 0 === i?.colIndex) continue;
1719
+ const n = this._readCellValue(e);
1720
+ void 0 !== n && o.pushAt(i.rowIndex, i.colIndex, n);
1721
+ }
1722
+ }
1723
+ return {
1724
+ sheetIndex: -1,
1725
+ data: o.build()?.tuples ?? []
1726
+ };
1727
+ }
1728
+ _readCellValue(t) {
1729
+ const e = this._findChild(t, "v")?.textContent?.trim();
1730
+ if (void 0 !== e && "" !== e) switch (t.getAttribute("t")) {
1731
+ case null:
1732
+ case "n": return parseFloat(e);
1733
+ case "b": return "1" === e || "true" === e;
1734
+ case "str":
1735
+ default: return e;
1736
+ case "e": {
1737
+ const t = tt.getBuiltInByLabel(e);
1738
+ return t ? {
1739
+ t: "e",
1740
+ v: t.getCode()
1741
+ } : e;
1742
+ }
1743
+ }
1744
+ }
1745
+ _findChild(t, e) {
1746
+ const o = t.childNodes, s = o.length;
1747
+ for (let t = 0; t < s; t++) {
1748
+ const s = o.item(t);
1749
+ if (1 === s.nodeType && s.localName === e) return s;
1750
+ }
1751
+ return null;
1752
+ }
1753
+ _findAbsoluteUrlRelId(t) {
1754
+ const e = this._findChild(t, "alternateUrls");
1755
+ return e ? this._findChild(e, "absoluteUrl")?.getAttribute("r:id") ?? null : null;
1756
+ }
1757
+ },
1758
+ SlicerCacheDefinitionVisitor: class {
1759
+ visit(t, e, o) {
1760
+ t.copyFromAttribute(e, "name", o, "cacheName"), t.copyFromAttribute(e, "sourceName", o);
1761
+ const s = t.evaluate("*/tableSlicerCache", e);
1762
+ return s ? (t.copyFromAttribute(s, "tableId", o), t.copyFromAttribute(s, "column", o, "columnId"), t.copyFromAttribute(s, "sortOrder", o), t.copyFromAttribute(s, "customListSort", o, "customListSort", t.BOOLEAN_COPY), t.copyFromAttribute(s, "crossFilter", o), o) : (this.processPivot(t, e, o), o);
1763
+ }
1764
+ processPivot(t, e, o) {
1765
+ const s = [];
1766
+ let r = "";
1767
+ const i = e.childNodes;
1768
+ for (let e = 0; e < i.length; e++) {
1769
+ const n = i.item(e);
1770
+ if (1 !== n.nodeType) continue;
1771
+ if ("pivotTables" === n.localName) {
1772
+ const t = n.childNodes;
1773
+ for (let e = 0; e < t.length; e++) {
1774
+ const o = t.item(e);
1775
+ 1 === o.nodeType && "pivotTable" === o.localName && s.push({
1776
+ tabId: o.getAttribute("tabId") ?? "",
1777
+ name: o.getAttribute("name") ?? ""
1778
+ });
1779
+ }
1780
+ continue;
1781
+ }
1782
+ const l = n.getAttribute("pivotCacheId");
1783
+ if (l && (o.pivotCacheId = l), "state" === n.localName || "timelinePivotFilter" === n.localName) {
1784
+ o.tabular = !0, o.pivotData = (o.pivotData ?? "") + (t.serializeElement(n) ?? "");
1785
+ continue;
1786
+ }
1787
+ if ("data" === n.localName) {
1788
+ let e = null;
1789
+ const s = n.childNodes;
1790
+ for (let t = 0; t < s.length; t++) {
1791
+ const r = s.item(t);
1792
+ if (1 !== r.nodeType) continue;
1793
+ const i = r.getAttribute("pivotCacheId");
1794
+ i && (o.pivotCacheId = i), "tabular" === r.localName && (e = r);
1795
+ }
1796
+ if (e) {
1797
+ o.tabular = !0, t.copyFromAttribute(e, "sortOrder", o), t.copyFromAttribute(e, "customListSort", o, "customListSort", t.BOOLEAN_COPY), t.copyFromAttribute(e, "crossFilter", o), t.copyFromAttribute(e, "showMissing", o, "showMissing", t.BOOLEAN_COPY), o.pivotData = t.serializeElement(n) ?? void 0;
1798
+ continue;
1799
+ }
1800
+ }
1801
+ const a = t.serializeElement(n);
1802
+ if (null === a) return;
1803
+ r += a;
1804
+ }
1805
+ o.pivotTables = s, o.pivotBody = r;
1806
+ }
1807
+ },
1808
+ SlicersVisitor: class {
1809
+ visit(t, e, o) {
1810
+ let s = o.slicers;
1811
+ s || (s = {}, o.slicers = s);
1812
+ const r = e.childNodes, i = r.length;
1813
+ for (let e = 0; e < i; e++) {
1814
+ const o = r.item(e);
1815
+ 1 === o.nodeType && "slicer" === o.localName && this.processSlicer(t, o, s);
1816
+ }
1817
+ return s;
1818
+ }
1819
+ processSlicer(t, e, o) {
1820
+ if (!e) return;
1821
+ const s = {};
1822
+ o[e.getAttribute("name")] = s, t.copyFromAttribute(e, "xr10:uid", s, "uid");
1823
+ const r = e.getAttribute("cache"), i = t.getVisitorParamsState().get("slicerCaches"), n = r ? i?.get(r) : void 0;
1824
+ if (n) for (let t = 0; t < Ot.length; t++) {
1825
+ const e = Ot[t];
1826
+ void 0 !== n[e] && (s[e] = n[e]);
1827
+ }
1828
+ t.copyFromAttribute(e, "caption", s), t.copyFromAttribute(e, "startItem", s, "startItem", t.INT_COPY), t.copyFromAttribute(e, "columnCount", s, "columnCount", t.INT_COPY), t.copyFromAttribute(e, "showCaption", s, "showCaption", t.BOOLEAN_COPY), t.copyFromAttribute(e, "level", s, "level", t.INT_COPY), t.copyFromAttribute(e, "style", s), t.copyFromAttribute(e, "lockedPosition", s, "lockedPosition", t.BOOLEAN_COPY), t.copyFromAttribute(e, "rowHeight", s, "rowHeight", t.INT_COPY);
1829
+ }
1830
+ },
1831
+ TimelinesVisitor: class {
1832
+ visit(t, e, o) {
1833
+ let s = o.slicers;
1834
+ s || (s = {}, o.slicers = s);
1835
+ const r = e.childNodes;
1836
+ for (let e = 0; e < r.length; e++) {
1837
+ const o = r.item(e);
1838
+ 1 === o.nodeType && "timeline" === o.localName && this.processTimeline(t, o, s);
1839
+ }
1840
+ return s;
1841
+ }
1842
+ processTimeline(t, e, o) {
1843
+ const s = {};
1844
+ o[e.getAttribute("name")] = s, t.copyFromAttribute(e, "xr10:uid", s, "uid");
1845
+ const r = e.getAttribute("cache"), i = t.getVisitorParamsState().get("slicerCaches"), n = r ? i?.get(r) : void 0;
1846
+ if (n) for (let t = 0; t < Ot.length; t++) {
1847
+ const e = Ot[t];
1848
+ void 0 !== n[e] && (s[e] = n[e]);
1849
+ }
1850
+ t.copyFromAttribute(e, "caption", s);
1851
+ const l = {};
1852
+ for (let t = 0; t < e.attributes.length; t++) {
1853
+ const o = e.attributes.item(t);
1854
+ Vt.has(o.name) || o.name.startsWith("xmlns") || (l[o.name] = o.value);
1855
+ }
1856
+ s.timelineAttributes = l;
1857
+ let a = "";
1858
+ const c = e.childNodes;
1859
+ for (let e = 0; e < c.length; e++) {
1860
+ const o = c.item(e);
1861
+ 1 === o.nodeType && (a += t.serializeElement(o) ?? "");
1862
+ }
1863
+ s.timelineBody = a;
1864
+ }
1865
+ },
1866
+ FormControlPrVisitor: class {
1867
+ visit(t, e, o) {
1868
+ const s = {}, r = e.attributes;
1869
+ for (let t = 0; t < r.length; t++) {
1870
+ const e = r.item(t), o = e.name;
1871
+ "xmlns" === o || o.startsWith("xmlns:") || (s[o] = e.value);
1872
+ }
1873
+ const i = [];
1874
+ let n;
1875
+ const l = e.childNodes;
1876
+ for (let e = 0; e < l.length; e++) {
1877
+ const o = l.item(e);
1878
+ if (1 === o.nodeType) if ("itemLst" === o.localName) {
1879
+ const t = o.childNodes;
1880
+ for (let e = 0; e < t.length; e++) {
1881
+ const o = t.item(e);
1882
+ 1 === o.nodeType && "item" === o.localName && i.push(o.getAttribute("val") ?? "");
1883
+ }
1884
+ } else "extLst" === o.localName && (n = t.serializeElement(o) ?? void 0);
1885
+ }
1886
+ const a = E(s, i, n);
1887
+ return o.formControl = a, a;
1888
+ }
1889
+ },
1890
+ DrawingVisitor: class {
1891
+ visit(t, e, o) {
1892
+ return o;
1893
+ }
1894
+ afterVisit(t, e, o) {
1895
+ for (const t of o?.movables ?? []) _t(t, !1);
1896
+ }
1897
+ },
1898
+ DrawingAnchorVisitor: class {
1899
+ visit(t, e, o) {
1900
+ if (!e) return;
1901
+ const s = {};
1902
+ t.copyFromAttribute(e, "editAs", s, "anchorType"), s.anchor = {}, "absoluteAnchor" === e.localName ? (s.anchorType = "absolute", this.processAbsoluteCoord(t, t.evaluate("pos", e), s.anchor, "from", "x", "y"), this.processAbsoluteCoord(t, t.evaluate("ext", e), s.anchor, "to", "cx", "cy")) : "oneCellAnchor" === e.localName ? (this.processOffsetCoord(t, t.evaluate("from", e), s.anchor, "from"), this.processAbsoluteCoord(t, t.evaluate("ext", e), s.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(t, t.evaluate("from", e), s.anchor, "from"), this.processOffsetCoord(t, t.evaluate("to", e), s.anchor, "to"));
1903
+ const r = t.evaluate("clientData", e), i = (t) => {
1904
+ const e = r?.getAttribute(t);
1905
+ return "0" === e || "false" === e;
1906
+ };
1907
+ return i("fPrintsWithSheet") && (s.noPrint = !0), i("fLocksWithSheet") && (s.unlocked = !0), o.movables || (o.movables = []), o.movables.push(s), s;
1908
+ }
1909
+ processAbsoluteCoord(t, e, o, s, r, i) {
1910
+ if (!e) return;
1911
+ const n = {
1912
+ x: 0,
1913
+ y: 0
1914
+ };
1915
+ return n.x = N(e.getAttribute(r)), n.y = N(e.getAttribute(i)), "from" === s ? o.tl = n : o.br = n, o;
1916
+ }
1917
+ processOffsetCoord(t, e, o, s) {
1918
+ if (!e) return;
1919
+ const r = {
1920
+ c: 0,
1921
+ r: 0,
1922
+ x: 0,
1923
+ y: 0
1924
+ };
1925
+ return t.evaluate("col", e) && (r.c = parseInt(t.evaluate("col", e).textContent)), t.evaluate("row", e) && (r.r = parseInt(t.evaluate("row", e).textContent)), t.evaluate("colOff", e) && (r.x = N(t.evaluate("colOff", e).textContent)), t.evaluate("rowOff", e) && (r.y = N(t.evaluate("rowOff", e).textContent)), "from" === s ? o.tl = r : o.br = r, o;
1926
+ }
1927
+ },
1928
+ DrawingGraphicFrameVisitor: class extends Ft {
1929
+ visit(t, e, o) {
1930
+ if (!e) return;
1931
+ if (this.isGroupContent(o)) {
1932
+ if (t.getPath().includes("Fallback")) return {};
1933
+ const { movable: s } = this.readMemberHeader(t, e, "graphicFrame"), r = t.evaluate("xfrm", e);
1934
+ if (r) {
1935
+ a(r, s);
1936
+ const e = t.evaluate("off", r), o = t.evaluate("ext", r);
1937
+ s.anchor = {
1938
+ tl: {
1939
+ x: N(e?.getAttribute("x") ?? null) ?? 0,
1940
+ y: N(e?.getAttribute("y") ?? null) ?? 0
1941
+ },
1942
+ br: {
1943
+ x: N(o?.getAttribute("cx") ?? null) ?? 0,
1944
+ y: N(o?.getAttribute("cy") ?? null) ?? 0
1945
+ }
1946
+ };
1947
+ }
1948
+ const i = this.readGraphic(t, e), n = "chart" === i.type ? {
1949
+ ...s.content.json,
1950
+ ...i.json
1951
+ } : i.json;
1952
+ return s.content = {
1953
+ ...s.content,
1954
+ type: i.type,
1955
+ json: n
1956
+ }, o.members.push(s), i.json;
1957
+ }
1958
+ o = super.visit(t, e, o);
1959
+ const s = t.evaluate("nvGraphicFramePr/cNvGraphicFramePr", e);
1960
+ if (s) {
1961
+ const e = t.evaluate("graphicFrameLocks", s);
1962
+ e && e.hasAttribute("noChangeAspect") && (o.lockAspect = "1" === e.getAttribute("noChangeAspect"));
1963
+ }
1964
+ const r = this.readGraphic(t, e);
1965
+ return this.setContent(o, r), r;
1966
+ }
1967
+ readGraphic(t, e) {
1968
+ const o = t.evaluate("graphic/graphicData", e), s = {
1969
+ type: "graphicFrame",
1970
+ json: {}
1971
+ };
1972
+ if (!o) return s;
1973
+ const r = o.childNodes, i = r.length;
1974
+ for (let o = 0; o < i; o++) {
1975
+ const i = r.item(o);
1976
+ if (1 === i.nodeType) try {
1977
+ let o = i.localName;
1978
+ "chart" === o ? o = "chart" : "slicer" !== o && "timeslicer" !== o || (o = "slicer"), s.type = o;
1979
+ const r = i.getAttribute("r:id");
1980
+ if ("chart" === o && r) {
1981
+ const o = this.readSourceId(t, e), i = t.readEmbeddedPart(r) ?? void 0;
1982
+ let n;
1983
+ try {
1984
+ const e = i?.xml ? q(i.xml) : null;
1985
+ n = e?.model, e?.lossy && t.warn("A chart states something its model does not; it is saved as it was until it is changed.", { onceKey: "xlsx.chart.lossy" });
1986
+ } catch (e) {
1987
+ t.warn(`A chart could not be read into the chart model; it is kept as its markup: ${e?.message ?? e}`, { onceKey: "xlsx.chart.model" });
1988
+ }
1989
+ s.json = {
1990
+ sourceId: o,
1991
+ part: i,
1992
+ model: n
1993
+ };
1994
+ } else if ("slicer" === o) {
1995
+ const o = this.readSourceId(t, e);
1996
+ void 0 !== o && (s.json = { sourceId: o });
1997
+ } else r && (s.json = t.getRef(r));
1998
+ } catch (e) {
1999
+ t.warn(`Unable to read a graphic frame: ${e?.message ?? e}`, { onceKey: "xlsx.drawing.graphicFrame" });
2000
+ }
2001
+ }
2002
+ return s;
2003
+ }
2004
+ },
2005
+ DrawingSpVisitor: Bt,
2006
+ DrawingPicVisitor: class extends Ft {
2007
+ visit(t, e, o) {
2008
+ if (!e) return;
2009
+ if (this.isGroupContent(o)) {
2010
+ if (t.getPath().includes("Fallback")) return {};
2011
+ const { movable: s, content: r } = this.readMemberHeader(t, e, "picture"), i = this.readImage(t, e);
2012
+ return i ? (this.readPictureDetails(t, e, i, s, r), o.members.push(s), r) : {};
2013
+ }
2014
+ const s = super.visit(t, e, o), r = this.readImage(t, e);
2015
+ if (null === r) return;
2016
+ const i = {}, n = this.readSourceId(t, e);
2017
+ return void 0 !== n && (i.sourceId = n), this.readPictureDetails(t, e, r, s, i), this.setContent(s, {
2018
+ type: "picture",
2019
+ json: i
2020
+ }), i;
2021
+ }
2022
+ readPictureDetails(t, e, o, s, r) {
2023
+ void 0 !== o?.resId && (r.resId = o.resId), o?.image && (r.image = o.image);
2024
+ const i = e.getAttribute("macro");
2025
+ i && (r.macro = i), e.hasAttribute("fPublished") && (r.published = A(e.getAttribute("fPublished")));
2026
+ const n = t.evaluate("nvPicPr/cNvPicPr", e);
2027
+ if (n?.getAttribute) {
2028
+ "0" === n.getAttribute("preferRelativeResize") && (r.noRelativeResize = !0);
2029
+ const e = this.readLocks(t.evaluate("picLocks", n));
2030
+ e && (r.locks = e), s.lockAspect = e?.noChangeAspect ?? !1;
2031
+ }
2032
+ }
2033
+ readImage(t, e) {
2034
+ const o = t.evaluate("blipFill", e), s = o ? t.evaluate("blip", o) : null;
2035
+ if (!s) return;
2036
+ if (!(s.getAttribute("r:embed") ?? s.getAttribute("embed") ?? s.getAttribute("r:link") ?? s.getAttribute("link"))) return t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" }), null;
2037
+ const { type: r, resId: i, ...n } = new m().processImageFill(t, o);
2038
+ return !n.tile && n.stretch && 0 === Object.keys(n.stretch).length && delete n.stretch, n.extLst && Lt.test(n.extLst) && delete n.extLst, {
2039
+ resId: i,
2040
+ image: Object.keys(n).length > 0 ? n : void 0
2041
+ };
2042
+ }
2043
+ },
2044
+ DrawingGrpSpVisitor: class extends Ft {
2045
+ constructor(...t) {
2046
+ super(...t), this._fills = new m();
2047
+ }
2048
+ visit(t, e, o) {
2049
+ if (!e) return;
2050
+ const s = this.isGroupContent(o);
2051
+ let r, i;
2052
+ if (s) {
2053
+ if (t.getPath().includes("Fallback")) return {};
2054
+ const s = this.readMemberHeader(t, e, "group");
2055
+ r = s.movable, i = s.content, o.members.push(r);
2056
+ } else {
2057
+ if (t.getPath().includes("Fallback") && o.content) return {};
2058
+ r = super.visit(t, e, o), i = {};
2059
+ const s = this.readSourceId(t, e);
2060
+ void 0 !== s && (i.sourceId = s), this.setContent(r, {
2061
+ type: "group",
2062
+ json: i
2063
+ });
2064
+ }
2065
+ i.members = [];
2066
+ const n = t.evaluate("nvGrpSpPr/cNvGrpSpPr/grpSpLocks", e);
2067
+ n?.hasAttribute?.("noChangeAspect") && (r.lockAspect = "1" === n.getAttribute("noChangeAspect"));
2068
+ const l = this.readLocks(n);
2069
+ l && (i.locks = l);
2070
+ const c = t.evaluate("grpSpPr", e);
2071
+ if (c) {
2072
+ const e = t.evaluate("xfrm", c);
2073
+ if (e) {
2074
+ a(e, r), "1" === e.getAttribute("flipH") && (r.flipH = !0), "1" === e.getAttribute("flipV") && (r.flipV = !0);
2075
+ const o = Dt(t, e, "off", "ext"), n = Dt(t, e, "chOff", "chExt") ?? o;
2076
+ n && (i.childBounds = n), s && o && (r.anchor = {
2077
+ tl: {
2078
+ x: o.x,
2079
+ y: o.y
2080
+ },
2081
+ br: {
2082
+ x: o.width,
2083
+ y: o.height
2084
+ }
2085
+ });
2086
+ }
2087
+ const o = this._fills.getFill(t, c);
2088
+ o && Object.keys(o).length > 0 && (i.fill = o);
2089
+ const n = this._fills.getEffects(t, c);
2090
+ n && (i.effects = n);
2091
+ const l = t.evaluate("scene3d", c), u = l ? t.serializeElement(l) : null;
2092
+ u && (i.scene3d = u);
2093
+ const d = t.evaluate("extLst", c), h = d ? t.serializeElement(d) : null;
2094
+ h && (i.extLst = {
2095
+ ...i.extLst,
2096
+ properties: h
2097
+ });
2098
+ }
2099
+ return i;
2100
+ }
2101
+ },
2102
+ DrawingCxnSpVisitor: class extends Bt {
2103
+ visit(t, e, o) {
2104
+ if (e) return this.visitShape(t, e, o, "cxnSp", "nvCxnSpPr/cNvCxnSpPr/cxnSpLocks");
2105
+ }
2106
+ },
2107
+ MetadataVisitor: class {
2108
+ visit(t, e, o) {
2109
+ const s = [], r = /* @__PURE__ */ new Map(), i = {
2110
+ cells: [],
2111
+ values: []
2112
+ }, n = e.childNodes;
2113
+ for (let t = 0; t < n.length; t++) {
2114
+ const e = n.item(t);
2115
+ if (1 === e.nodeType) switch (e.localName) {
2116
+ case "metadataTypes":
2117
+ this._parseMetadataTypes(e, s, r);
2118
+ break;
2119
+ case "futureMetadata":
2120
+ this._attachFutureMetadata(e, r);
2121
+ break;
2122
+ case "cellMetadata":
2123
+ this._resolveBlocks(e, s, i.cells);
2124
+ break;
2125
+ case "valueMetadata": this._resolveBlocks(e, s, i.values);
2126
+ }
2127
+ }
2128
+ return o.metadata = i, i;
2129
+ }
2130
+ _parseMetadataTypes(t, e, o) {
2131
+ const s = t.childNodes;
2132
+ for (let t = 0; t < s.length; t++) {
2133
+ const r = s.item(t);
2134
+ if (1 === r.nodeType && "metadataType" === r.localName) {
2135
+ const t = this._parseMetadataType(r);
2136
+ e.push(t), o.set(t.name, t);
2137
+ }
2138
+ }
2139
+ }
2140
+ _parseMetadataType(t) {
2141
+ const e = {
2142
+ name: t.getAttribute("name") ?? "",
2143
+ _blocks: []
2144
+ }, o = t.getAttribute("minSupportedVersion");
2145
+ null != o && (e.minSupportedVersion = Number(o));
2146
+ for (const o of [
2147
+ "copy",
2148
+ "pasteAll",
2149
+ "pasteValues",
2150
+ "merge",
2151
+ "splitFirst",
2152
+ "splitAll",
2153
+ "rowColShift",
2154
+ "clearFormats",
2155
+ "clearComments",
2156
+ "assign",
2157
+ "coerce",
2158
+ "cellMeta",
2159
+ "adjust",
2160
+ "trans",
2161
+ "delete",
2162
+ "edit"
2163
+ ]) "1" === t.getAttribute(o) && (e[o] = !0);
2164
+ return e;
2165
+ }
2166
+ _attachFutureMetadata(t, e) {
2167
+ const o = t.getAttribute("name") ?? "", s = e.get(o);
2168
+ if (!s) return;
2169
+ const r = t.childNodes;
2170
+ for (let t = 0; t < r.length; t++) {
2171
+ const e = r.item(t);
2172
+ 1 === e.nodeType && "bk" === e.localName && s._blocks.push(this._parseFutureBlock(e));
2173
+ }
2174
+ }
2175
+ _parseFutureBlock(t) {
2176
+ const e = {}, o = t.childNodes;
2177
+ for (let t = 0; t < o.length; t++) {
2178
+ const s = o.item(t);
2179
+ if (1 !== s.nodeType || "extLst" !== s.localName) continue;
2180
+ const r = s.childNodes;
2181
+ for (let t = 0; t < r.length; t++) {
2182
+ const o = r.item(t);
2183
+ if (1 !== o.nodeType || "ext" !== o.localName) continue;
2184
+ const s = o.childNodes;
2185
+ for (let t = 0; t < s.length; t++) {
2186
+ const o = s.item(t);
2187
+ 1 === o.nodeType && ("dynamicArrayProperties" === o.localName ? (e.fDynamic = "1" === o.getAttribute("fDynamic"), e.fCollapsed = "1" === o.getAttribute("fCollapsed")) : "rvb" === o.localName && (e.richValueIndex = Number(o.getAttribute("i") ?? "0")));
2188
+ }
2189
+ }
2190
+ }
2191
+ return e;
2192
+ }
2193
+ _resolveBlocks(t, e, o) {
2194
+ const s = t.childNodes;
2195
+ for (let t = 0; t < s.length; t++) {
2196
+ const r = s.item(t);
2197
+ 1 === r.nodeType && "bk" === r.localName && o.push(this._resolveBlock(r, e));
2198
+ }
2199
+ }
2200
+ _resolveBlock(t, e) {
2201
+ const o = /* @__PURE__ */ new Map(), s = t.childNodes;
2202
+ for (let t = 0; t < s.length; t++) {
2203
+ const r = s.item(t);
2204
+ if (1 !== r.nodeType || "rc" !== r.localName) continue;
2205
+ const i = Number(r.getAttribute("t")), n = Number(r.getAttribute("v")), l = e[i - 1];
2206
+ if (!l) continue;
2207
+ const { _blocks: a, ...c } = l, u = { ...c };
2208
+ for (const t of Object.keys(u)) void 0 === u[t] && delete u[t];
2209
+ const d = a[n];
2210
+ d && (void 0 !== d.fDynamic && (u.fDynamic = d.fDynamic, u.fCollapsed = d.fCollapsed ?? !1), void 0 !== d.richValueIndex && (u.richValueIndex = d.richValueIndex)), o.set(l.name, u);
2211
+ }
2212
+ return o;
2213
+ }
2214
+ },
2215
+ FeaturePropertyBagVisitor: class {
2216
+ visit(t, e, o) {
2217
+ const s = [], r = e.childNodes;
2218
+ for (let t = 0; t < r.length; t++) {
2219
+ const e = r.item(t);
2220
+ 1 === e.nodeType && "bag" === e.localName && s.push(this._readBag(e));
2221
+ }
2222
+ const i = [], n = s.find((t) => "XFComplements" === t.type)?.arrays.get("MappedFeaturePropertyBags") ?? [];
2223
+ for (let e = 0; e < n.length; e++) {
2224
+ const o = s[n[e]]?.ids.get("XFControls"), r = void 0 !== o ? s[o]?.ids.get("CellControl") : void 0, l = void 0 !== r ? s[r]?.type : void 0, a = l ? Et[l] : void 0;
2225
+ a || t.warn(`A cell format's feature '${l ?? "unknown"}' is not read; its cells keep their values.`), i.push(a ? { type: a } : null);
2226
+ }
2227
+ const l = { controls: i };
2228
+ return o.featurePropertyBag = l, l;
2229
+ }
2230
+ _readBag(t) {
2231
+ const e = {
2232
+ type: t.getAttribute("type") ?? "",
2233
+ ids: /* @__PURE__ */ new Map(),
2234
+ arrays: /* @__PURE__ */ new Map()
2235
+ }, o = t.childNodes;
2236
+ for (let t = 0; t < o.length; t++) {
2237
+ const s = o.item(t);
2238
+ if (1 !== s.nodeType) continue;
2239
+ const r = s.getAttribute("k") ?? "";
2240
+ if ("bagId" === s.localName) {
2241
+ const t = parseInt(s.textContent ?? "", 10);
2242
+ isNaN(t) || e.ids.set(r, t);
2243
+ } else if ("a" === s.localName) {
2244
+ const t = [], o = s.childNodes;
2245
+ for (let e = 0; e < o.length; e++) {
2246
+ const s = o.item(e);
2247
+ if (1 !== s.nodeType || "bagId" !== s.localName) continue;
2248
+ const r = parseInt(s.textContent ?? "", 10);
2249
+ isNaN(r) || t.push(r);
2250
+ }
2251
+ e.arrays.set(r, t);
2252
+ }
2253
+ }
2254
+ return e;
2255
+ }
2256
+ },
2257
+ CommentsVisitor: class {
2258
+ visit(t, e, o) {
2259
+ if (!e) return;
2260
+ const s = [];
2261
+ this.processAuthors(t, t.evaluate("authors", e), s), s.length > 0 && (o.authors = s);
2262
+ const r = [];
2263
+ return o.comments = r, r;
2264
+ }
2265
+ processAuthors(t, e, o) {
2266
+ if (!e) return;
2267
+ const s = e.childNodes, r = s.length;
2268
+ for (let t = 0; t < r; t++) {
2269
+ const e = s.item(t);
2270
+ if (1 === e.nodeType && "author" === e.localName) {
2271
+ const t = e.firstChild;
2272
+ t && 3 === t.nodeType && o.push(t.textContent);
2273
+ }
2274
+ }
2275
+ }
2276
+ },
2277
+ CommentVisitor: class {
2278
+ visit(t, e, o) {
2279
+ if (!e) return;
2280
+ const s = e.getAttribute("ref");
2281
+ if (!s) return;
2282
+ const r = { content: "" };
2283
+ if (e.hasAttribute("authorId")) {
2284
+ const t = parseInt(e.getAttribute("authorId"), 10);
2285
+ isNaN(t) || (r.authorId = t);
2286
+ }
2287
+ return r.content = function(t) {
2288
+ if (!t) return "";
2289
+ const e = [];
2290
+ let o = !0;
2291
+ const s = t.childNodes;
2292
+ for (let t = 0; t < s.length; t++) {
2293
+ const r = s.item(t);
2294
+ if (1 === r.nodeType) {
2295
+ if ("t" === r.localName) e.push({ text: r.textContent ?? "" });
2296
+ else if ("r" === r.localName) {
2297
+ const t = { text: "" }, s = r.childNodes;
2298
+ for (let e = 0; e < s.length; e++) {
2299
+ const o = s.item(e);
2300
+ if (1 === o.nodeType) {
2301
+ if ("t" === o.localName) t.text += o.textContent ?? "";
2302
+ else if ("rPr" === o.localName) {
2303
+ const e = Yt(o);
2304
+ e && (t.font = e);
2305
+ }
2306
+ }
2307
+ }
2308
+ t.font && (o = !1), e.push(t);
2309
+ }
2310
+ }
2311
+ }
2312
+ return 0 === e.length ? t.textContent ?? "" : o ? e.map((t) => t.text).join("") : { runs: e };
2313
+ }(t.evaluate("text", e)), o.push({
2314
+ r: s,
2315
+ v: r
2316
+ }), r;
2317
+ }
2318
+ },
2319
+ ThreadedCommentsVisitor: class {
2320
+ visit(t, e, o) {
2321
+ if (!e) return;
2322
+ const s = [];
2323
+ return o.comments = s, s;
2324
+ }
2325
+ },
2326
+ ThreadedCommentVisitor: class {
2327
+ visit(t, e, o) {
2328
+ if (!e) return;
2329
+ const s = {};
2330
+ t.copyFromAttribute(e, "id", s, "id", S);
2331
+ const r = e.getAttribute("ref");
2332
+ t.copyFromAttribute(e, "personId", s, "personId", S), t.copyFromAttribute(e, "parentId", s, "parentId", S);
2333
+ const i = e.getAttribute("dT");
2334
+ i && (s.dt = function(t) {
2335
+ const e = /^(.*T\d{2}:\d{2}:\d{2})(?:\.(\d+))?(Z|[+-]\d{2}:?\d{2})?$/i.exec(t.trim());
2336
+ if (!e) return t;
2337
+ const [, o, s, r] = e;
2338
+ return `${o}${s ? `.${(s + "00").substring(0, 3)}` : ""}${r ?? "Z"}`;
2339
+ }(i)), e.hasAttribute("done") && (s.done = A(e.getAttribute("done")));
2340
+ const n = function(t) {
2341
+ let e;
2342
+ const o = t.childNodes;
2343
+ for (let t = 0; t < o.length; t++) {
2344
+ const s = o.item(t);
2345
+ if (1 !== s.nodeType || "mentions" !== s.localName) continue;
2346
+ const r = s.childNodes;
2347
+ for (let t = 0; t < r.length; t++) {
2348
+ const o = r.item(t);
2349
+ if (1 !== o.nodeType || "mention" !== o.localName) continue;
2350
+ const s = o.getAttribute("mentionId"), i = o.getAttribute("mentionpersonId");
2351
+ if (!s || !i) continue;
2352
+ const n = {
2353
+ id: S(s),
2354
+ personId: S(i)
2355
+ }, l = parseInt(o.getAttribute("startIndex") ?? "", 10);
2356
+ isNaN(l) || (n.startIndex = l);
2357
+ const a = parseInt(o.getAttribute("length") ?? "", 10);
2358
+ isNaN(a) || (n.length = a), (e ??= []).push(n);
2359
+ }
2360
+ }
2361
+ return e;
2362
+ }(e);
2363
+ return n && (s.mentions = n), o.push({
2364
+ r,
2365
+ v: s
2366
+ }), s;
2367
+ }
2368
+ },
2369
+ PersonListVisitor: class {
2370
+ visit(t, e, o) {
2371
+ const s = [], r = e.childNodes, i = r.length;
2372
+ for (let e = 0; e < i; e++) {
2373
+ const o = r.item(e);
2374
+ if (1 === o.nodeType && "person" === o.localName) {
2375
+ const e = {};
2376
+ t.copyFromAttribute(o, "id", e, "id", S), t.copyFromAttribute(o, "displayName", e), t.copyFromAttribute(o, "userId", e, "userId", S), t.copyFromAttribute(o, "providerId", e), s.push(e);
2377
+ }
2378
+ }
2379
+ return s.length > 0 && (o.persons = s), s;
2380
+ }
2381
+ }
2382
+ }, Mt = class {
2383
+ constructor(t, e) {
2384
+ this.path = t, this.visitor = e;
2385
+ }
2386
+ }, zt = class {
2387
+ constructor() {
2388
+ this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new Xt.RelsVisitor()), this.registerVisitor("cp:coreProperties", new Xt.CorePropertiesVisitor()), this.registerVisitor("Properties", new Xt.AppPropertiesVisitor()), this.registerVisitor("spPr", new Xt.ShapePropertiesVisitor()), this.registerVisitor("txBody", new Xt.ShapeTextVisitor()), this.registerVisitor("txPr", new Xt.TextPropertiesVisitor()), this.registerVisitor("a:theme", new Xt.ThemeVisitor()), this.registerVisitor("a:theme", new Xt.ClrSchemeVisitor(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new Xt.FontSchemeVisitor(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new Xt.FmtSchemeVisitor(), "themeElements/fmtScheme"), this.registerVisitor("a:theme", new Xt.ObjectDefaultsVisitor(), "objectDefaults"), this.registerVisitor("autoFilter", new Xt.AutoFilterVisitor()), this.registerVisitor("sortState", new Xt.SortStateVisitor()), this.registerVisitor("s:workbook", new Xt.WorkbookVisitor()), this.registerVisitor("styleSheet", new Xt.SheetStyleVisitor()), this.registerVisitor("x14:table", new Xt.TableX14Visitor()), this.registerVisitor("table", new Xt.TableVisitor()), this.registerVisitor("externalLink", new Xt.ExternalLinkVisitor()), this.registerVisitor("wsDr", new Xt.DrawingVisitor()), this.registerVisitor("twoCellAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("oneCellAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("absoluteAnchor", new Xt.DrawingAnchorVisitor()), this.registerVisitor("graphicFrame", new Xt.DrawingGraphicFrameVisitor()), this.registerVisitor("sp", new Xt.DrawingSpVisitor()), this.registerVisitor("grpSp", new Xt.DrawingGrpSpVisitor()), this.registerVisitor("cxnSp", new Xt.DrawingCxnSpVisitor()), this.registerVisitor("pic", new Xt.DrawingPicVisitor()), this.registerVisitor("metadata", new Xt.MetadataVisitor()), this.registerVisitor("FeaturePropertyBags", new Xt.FeaturePropertyBagVisitor()), this.registerVisitor("comments", new Xt.CommentsVisitor()), this.registerVisitor("comment", new Xt.CommentVisitor()), this.registerVisitor("ThreadedComments", new Xt.ThreadedCommentsVisitor()), this.registerVisitor("threadedComment", new Xt.ThreadedCommentVisitor()), this.registerVisitor("threadedComment", new Xt.TextPropertiesVisitor("content"), "text"), this.registerVisitor("personList", new Xt.PersonListVisitor()), this.registerVisitor("slicerCacheDefinition", new Xt.SlicerCacheDefinitionVisitor()), this.registerVisitor("slicers", new Xt.SlicersVisitor()), this.registerVisitor("timelineCacheDefinition", new Xt.SlicerCacheDefinitionVisitor()), this.registerVisitor("timelines", new Xt.TimelinesVisitor()), this.registerVisitor("formControlPr", new Xt.FormControlPrVisitor());
2389
+ }
2390
+ registerVisitor(t, e, o = null) {
2391
+ -1 === t.indexOf(":") && (t = "*:" + t);
2392
+ const s = t.split(":"), r = s.length > 1 ? s[1] : s[0];
2393
+ if (!o) return this.visitorsByXmlTagName.set(r, e), void this.visitorsByXmlTagName.set(t, e);
2394
+ let i = this.scopedVisitorsByXmlTagName.get(r);
2395
+ i || (i = [], this.scopedVisitorsByXmlTagName.set(r, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new Mt(o, e));
2396
+ }
2397
+ parseDxf(t, e = "", o = Z.EmptyObject) {
2398
+ this.visitorParamsState || (this.visitorParamsState = /* @__PURE__ */ new Map());
2399
+ const s = this.visitorParamsState, r = s.get("processingDXFs");
2400
+ s.set("processingDXFs", !0);
2401
+ try {
2402
+ const s = new yt(null, this, "/dxf", t, {}, e, o), r = {};
2403
+ return new Xt.SheetStyleVisitor().processDXF(s, t, r), r;
2404
+ } finally {
2405
+ void 0 === r ? s.delete("processingDXFs") : s.set("processingDXFs", r);
2406
+ }
2407
+ }
2408
+ getVisitorParamsState() {
2409
+ return this.visitorParamsState;
2410
+ }
2411
+ transform(t, e, o = Z.EmptyObject) {
2412
+ const s = t.documentElement;
2413
+ this.visitorParamsState && !o?.paramMap || (this.visitorParamsState = o?.paramMap ?? /* @__PURE__ */ new Map());
2414
+ const r = {};
2415
+ let i = this.visitorsByXmlTagName.get(s.nodeName);
2416
+ if (i || (i = this.visitorsByXmlTagName.get(s.localName)), !i) throw new Error(`A visitor for the root element: '${s.nodeName}' or '${s.localName}' must be registered.`);
2417
+ const n = "/" + s.localName, l = new yt(null, this, n, s, r, e, o), a = [];
2418
+ this._doWalk(i, l, a, s, r, e, o);
2419
+ const c = a.length;
2420
+ for (let t = 0; t < c; t++) {
2421
+ const e = a[t];
2422
+ try {
2423
+ e.visitor?.afterVisit?.(e.context, e.elemParent, e.jsonParent);
2424
+ } catch (t) {
2425
+ e.context.warn(`Unable to finish reading '${e.context.getPath()}': ${t?.message ?? t}`, { onceKey: "xlsx.transform.afterVisit" });
2426
+ }
2427
+ }
2428
+ return r;
2429
+ }
2430
+ _walkScoped(t, e, o, s, r, i, n) {
2431
+ const l = this.scopedVisitorsByXmlTagName.get(t), a = l ? l.length : 0;
2432
+ for (let c = 0; c < a; c++) {
2433
+ const a = l[c];
2434
+ let u = null;
2435
+ try {
2436
+ u = e.evaluate(a.path, s);
2437
+ } catch (o) {
2438
+ e.warn(`Invalid path '${a.path}' for '${t}'.`, { onceKey: "xlsx.transform.invalidPath" });
2439
+ }
2440
+ if (!u) continue;
2441
+ const d = (t) => {
2442
+ let l = t.localName, c = t.parentNode;
2443
+ for (; c && c !== s;) l = c.localName + "/" + l, c = c.parentNode;
2444
+ const u = e.getPath() + "/" + l;
2445
+ if (a.visitor) {
2446
+ const s = new yt(e, this, u, e.getElemRoot(), e.getJsonRoot(), i, n);
2447
+ this._doWalk(a.visitor, s, o, t, r, i, n);
2448
+ }
2449
+ };
2450
+ if (u.length > 0) {
2451
+ const t = u, e = t.length;
2452
+ for (let o = 0; o < e; o++) d(t.item(o));
2453
+ } else d(u);
2454
+ }
2455
+ }
2456
+ _doWalk(t, e, o, s, r, i, n) {
2457
+ let l = null;
2458
+ t && (o.push({
2459
+ visitor: t,
2460
+ context: e,
2461
+ elemParent: s,
2462
+ jsonParent: r
2463
+ }), l = t.visit(e, s, r)), l || (l = r);
2464
+ const a = s.localName;
2465
+ this._walkScoped(a, e, o, s, l, i, n);
2466
+ const c = this.visitorsByXmlTagName, u = e.getElemRoot(), d = e.getJsonRoot(), h = s.childNodes, p = h.length;
2467
+ for (let t = 0; t < p; t++) {
2468
+ const s = h.item(t);
2469
+ if (1 !== s.nodeType) continue;
2470
+ const a = s;
2471
+ let p = a.nodeName, m = c.get(p);
2472
+ m || (p = a.localName, m = c.get(p));
2473
+ const f = e.getPath() + "/" + p, g = new yt(e, this, f, u, d, i, n);
2474
+ this._doWalk(m, g, o, a, l ?? r, i, n);
2475
+ }
2476
+ return l;
2477
+ }
2478
+ };
2479
+ export { zt as DOMTransformer, yt as ExecutionContext, l as NumberUtils, n as VisitorUtils };