@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
@@ -1,2310 +0,0 @@
1
- /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.2
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { n as e } from "./CMzkLUwbgA73RvCb.mjs";
8
- import { b as t, g as n, x as r } from "./BwbMurFOptAFs7gC.mjs";
9
- import { a as i, c as a, i as o, m as s, o as c, p as l, r as u, s as d, t as f } from "./DoMlKUCnMSlR2qX5.mjs";
10
- import { CommonUtils as p } from "@sheetxl/utils";
11
- import { AddressUtils as m, FormulaError as h, IBorders as g, ICondition as _, IEffect as v, IFill as y, IFont as b, IRange as x, IStyle as S, ITextFrame as C, Sort as w, Tuple as ee } from "@sheetxl/sdk";
12
- var te = class {
13
- constructor(e) {
14
- this.list = e;
15
- }
16
- get length() {
17
- return this.list.length;
18
- }
19
- item(e) {
20
- return this.list[e];
21
- }
22
- forEach(e, t) {
23
- let n = this.list, r = n.length;
24
- for (let t = 0; t < r; t++) e(n[t], t, 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
- }, ne = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, re = (e) => {
39
- let t = parseInt(e);
40
- return isNaN(t) ? null : t;
41
- }, ie = (e) => {
42
- let t = parseFloat(e);
43
- return isNaN(t) ? null : t;
44
- }, ae = /* @__PURE__ */ new Map(), T = class {
45
- constructor(e, t, n, r, i, a = null, o = p.EmptyObject) {
46
- this._fileLocation = "";
47
- let s = (e, t, n) => o?.getRef?.(e, t, n, o?.parsedRefs), c = (e) => o?.getRefs?.(e, o?.parsedRefs);
48
- this._parent = e, this.sharedShared = t, this.currentPath = n, this.elemRoot = r, this.jsonRoot = i, e ? (this._fileLocation = e._fileLocation, this._getRef = e._getRef, this._getRefs = e._getRefs, this._serializeElement = e._serializeElement, this._readEmbeddedPart = e._readEmbeddedPart) : (a && (this._fileLocation = a), o?.getRef && (this._getRef = s), o?.getRefs && (this._getRefs = c), this._onWarning = o?.onWarning, this._addPerson = o?.addPerson, this._serializeElement = o?.serializeElement, this._readEmbeddedPart = o?.readEmbeddedPart);
49
- }
50
- getRef(e, t = !1) {
51
- return this._getRef?.(e, this._fileLocation, t) ?? null;
52
- }
53
- readEmbeddedPart(e) {
54
- return this._readEmbeddedPart?.(e, this._fileLocation) ?? null;
55
- }
56
- getRelationships() {
57
- return this._getRefs?.(this._fileLocation) ?? ae;
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(e, t) {
72
- this._raiseWarning(e, this.getFileLocation(), t?.onceKey);
73
- }
74
- _raiseWarning(e, t, n) {
75
- this._onWarning ? this._onWarning(e, t, n) : this._parent ? this._parent._raiseWarning(e, t, n) : console.warn(e);
76
- }
77
- serializeElement(e) {
78
- return this._serializeElement?.(e) ?? null;
79
- }
80
- addPerson(e) {
81
- return typeof e == "string" && (e = { displayName: e }), this._addPerson ? this._addPerson(e) : this._parent ? this._parent?._addPerson?.(e) ?? null : null;
82
- }
83
- getVisitorParamsState() {
84
- return this.sharedShared.getVisitorParamsState();
85
- }
86
- evaluate(e, t) {
87
- if (!e) return t;
88
- let n = [t], r = e.split("/"), i = r.length;
89
- for (let e = 0; e < i; e++) {
90
- let t = r[e];
91
- if (t === "" || t === ".") continue;
92
- let a = [], o = (t === "*" || t === "**") && e !== i - 1;
93
- for (let i of n) if (i) if (o) {
94
- let t = r[e + 1];
95
- t && t !== "" && t !== "." && (this._findDescendants(i, t, a), e++);
96
- } else if (t === "*" || t === "**") {
97
- if (!i.childNodes) continue;
98
- let e = i.childNodes, t = e.length;
99
- for (let n = 0; n < t; n++) {
100
- let t = e[n];
101
- t.nodeType === 1 && a.push(t);
102
- }
103
- } else {
104
- if (!i.childNodes) continue;
105
- let e = i.childNodes, n = e.length;
106
- for (let r = 0; r < n; r++) {
107
- let n = e[r];
108
- if (n.nodeType !== 1) continue;
109
- let i = n;
110
- this._matchesElementName(i, t) && a.push(i);
111
- }
112
- }
113
- if (n = a, n.length === 0) return null;
114
- }
115
- return n.length === 1 ? n[0] : n.length === 0 ? null : new te(n);
116
- }
117
- _matchesElementName(e, t) {
118
- return t.includes(":") ? (e.tagName || e.nodeName) === t : e.localName === t;
119
- }
120
- _findDescendants(e, t, n) {
121
- if (!e || !e.childNodes) return;
122
- let r = e.childNodes, i = r.length;
123
- for (let e = 0; e < i; e++) {
124
- let i = r[e];
125
- if (i.nodeType !== 1) continue;
126
- let a = i;
127
- this._matchesElementName(a, t) && n.push(a), this._findDescendants(a, t, n);
128
- }
129
- }
130
- getFromPath(e, t) {
131
- return p.getFromPath(e, t);
132
- }
133
- setToPath(e, t, n) {
134
- return p.setToPath(e, t, n);
135
- }
136
- getValAttrAsString(e, t) {
137
- let n = this.evaluate(e, t);
138
- return n && n.hasAttribute("val") ? n.getAttribute("val") ?? null : null;
139
- }
140
- getValAttrAsBoolean(e, t, n = !1) {
141
- let r = this.evaluate(e, t);
142
- if (!r) return null;
143
- let i = r.hasAttribute("val") ? r.getAttribute("val") : void 0;
144
- return i == null ? n : i === "1" || i === "on" || i === "true" || i !== "0" && i !== "off" && i !== "false" && n;
145
- }
146
- getValAttrAsInteger(e, t) {
147
- let n = this.evaluate(e, t);
148
- return n && n.hasAttribute("val") ? parseInt(n.getAttribute("val")) ?? null : null;
149
- }
150
- getValAttrAsFloat(e, t) {
151
- let n = this.evaluate(e, t);
152
- return n && n.hasAttribute("val") ? parseFloat(n.getAttribute("val")) ?? null : null;
153
- }
154
- get BOOLEAN_COPY() {
155
- return ne;
156
- }
157
- get INT_COPY() {
158
- return re;
159
- }
160
- get FLOAT_COPY() {
161
- return ie;
162
- }
163
- copyFromAttribute(e, t, n, r = t, i = null) {
164
- if (!e || !n || !e.hasAttribute(t)) return;
165
- let a = e.getAttribute(t);
166
- if (i) {
167
- if (Array.isArray(i)) {
168
- let e = i.length;
169
- for (let t = 0; t < e; t++) if (a == null || (a = i[t](a), a == null)) return;
170
- } else if (a == null || (a = i(a), a == null)) return;
171
- }
172
- this.setToPath(n, r, a);
173
- }
174
- }, oe = e({
175
- isBlank: () => j,
176
- isNotBlank: () => M,
177
- length: () => N,
178
- parseRotation: () => E,
179
- parseValAttrAsBoolean: () => O,
180
- parseValAttrAsFloat: () => A,
181
- parseValAttrAsInteger: () => k,
182
- parseValAttrAsString: () => D
183
- }), E = (e, t) => {
184
- if (!e || !e.hasAttribute("rot")) return;
185
- let n = e.getAttribute("rot"), r = p.roundAccurately(o(n), 2);
186
- r !== -1e3 && (t.rotation = r);
187
- }, D = (e, t, n, r, i) => {
188
- let a = e.getValAttrAsString(r, t);
189
- a !== null && (n[i] = a);
190
- }, O = (e, t, n, r, i = r, a = null) => {
191
- let o = e.getValAttrAsBoolean(r, t, a);
192
- o !== null && (n[i] = o);
193
- }, k = (e, t, n, r, i) => {
194
- let a = e.getValAttrAsInteger(r, t);
195
- a !== null && (n[i] = a);
196
- }, A = (e, t, n, r, i, a = 1) => {
197
- let o = e.getValAttrAsFloat(r, t);
198
- o !== null && (n[i] = o * a);
199
- }, j = (e) => !e || e.trim().length === 0, M = (e) => !j(e), N = (e) => e?.length ?? 0, P = class {
200
- constructor(e) {
201
- this.jsonKey = e;
202
- }
203
- visit(e, t, n) {
204
- let r = {};
205
- return n[this.jsonKey] = r, r;
206
- }
207
- }, F = class {
208
- visit(e, t, n) {}
209
- getStroke(e, t) {
210
- let n = e.evaluate("ln", t);
211
- return n ? this.parseLn(e, n) : {};
212
- }
213
- parseLn(e, t) {
214
- let n = {};
215
- t.hasAttribute("algn") && (n.align = t.getAttribute("algn")), t.hasAttribute("cap") && (n.lineCap = ce(t.getAttribute("cap"))), t.hasAttribute("cmpd") && (n.compound = t.getAttribute("cmpd")), t.hasAttribute("w") && (n.width = a(t.getAttribute("w")));
216
- let r = e.evaluate("miter", t);
217
- r && (n.lineJoin = "miter", r.hasAttribute("lim") && (n.miterLimit = parseFloat(r.getAttribute("lim")) / 1e5)), e.evaluate("bevel", t) && (n.lineJoin = "bevel"), e.evaluate("round", t) && (n.lineJoin = "round");
218
- let i = e.evaluate("custDash", t);
219
- if (i) {
220
- let t = e.evaluate("ds", i);
221
- if (t && t.length > 0) {
222
- let e = [];
223
- for (let n = 0; n < t.length; n++) {
224
- let r = t.item(n);
225
- e.push(c(r.getAttribute("d") ?? "")), e.push(c(r.getAttribute("sp") ?? ""));
226
- }
227
- n.dash = e;
228
- }
229
- }
230
- let o = e.evaluate("prstDash", t);
231
- o && o.hasAttribute("val") && (n.dash = o.getAttribute("val")), this.parseEndElement(e, t, n, "headEnd", "head"), this.parseEndElement(e, t, n, "tailEnd", "tail");
232
- let s = this.getFill(e, t);
233
- return s && (n.fill = s), n;
234
- }
235
- parseEndElement(e, t, n, r, i) {
236
- let a = e.evaluate(r, t);
237
- if (a && (a.hasAttribute("type") && (n[i + "Type"] = a.getAttribute("type")), a.hasAttribute("len") || a.hasAttribute("w"))) {
238
- let e = a.getAttribute("len") || "med", t = a.getAttribute("w") || "med";
239
- n[i + "Size"] = e + "-" + t;
240
- }
241
- }
242
- getEffects(e, t) {
243
- let n = e.evaluate("effectLst", t);
244
- if (!n) return null;
245
- let r = [], i = n.childNodes, a = i.length;
246
- for (let t = 0; t < a; t++) {
247
- let n = i.item(t);
248
- if (n.nodeType !== 1) continue;
249
- let a = this.processEffectElement(e, n, n.localName);
250
- if (a === void 0) return;
251
- r.push(a);
252
- }
253
- return r;
254
- }
255
- processEffectElement(e, t, n) {
256
- switch (n) {
257
- case "outerShdw": {
258
- let n = {
259
- type: v.Type.OuterShadow,
260
- color: this.processAdjColor(e, t)
261
- };
262
- return t.hasAttribute("dist") && (n.distance = a(t.getAttribute("dist"))), t.hasAttribute("dir") && (n.angle = o(t.getAttribute("dir"))), t.hasAttribute("blurRad") && (n.blur = a(t.getAttribute("blurRad"))), t.hasAttribute("algn") && (n.alignment = t.getAttribute("algn")), t.hasAttribute("rotWithShape") && (n.isRotatedWithShape = i(t.getAttribute("rotWithShape"))), t.hasAttribute("sx") && (n.scaleX = c(t.getAttribute("sx"))), t.hasAttribute("sy") && (n.scaleY = c(t.getAttribute("sy"))), t.hasAttribute("kx") && (n.skewX = o(t.getAttribute("kx"))), t.hasAttribute("ky") && (n.skewY = o(t.getAttribute("ky"))), n;
263
- }
264
- case "innerShdw": {
265
- let n = {
266
- type: v.Type.InnerShadow,
267
- color: this.processAdjColor(e, t)
268
- };
269
- return t.hasAttribute("dist") && (n.distance = a(t.getAttribute("dist"))), t.hasAttribute("dir") && (n.angle = o(t.getAttribute("dir"))), t.hasAttribute("blurRad") && (n.blur = a(t.getAttribute("blurRad"))), n;
270
- }
271
- case "prstShdw": {
272
- let n = {
273
- type: v.Type.PresetShadow,
274
- color: this.processAdjColor(e, t),
275
- preset: t.getAttribute("prst") ?? void 0
276
- };
277
- return t.hasAttribute("dist") && (n.distance = a(t.getAttribute("dist"))), t.hasAttribute("dir") && (n.angle = o(t.getAttribute("dir"))), n;
278
- }
279
- case "glow": {
280
- let n = {
281
- type: v.Type.Glow,
282
- color: this.processAdjColor(e, t)
283
- };
284
- return t.hasAttribute("rad") && (n.radius = a(t.getAttribute("rad"))), n;
285
- }
286
- case "softEdge": {
287
- let e = { type: v.Type.SoftEdge };
288
- return t.hasAttribute("rad") && (e.radius = a(t.getAttribute("rad"))), e;
289
- }
290
- case "reflection": {
291
- let e = { type: v.Type.Reflection };
292
- return t.hasAttribute("blurRad") && (e.blur = a(t.getAttribute("blurRad"))), t.hasAttribute("dist") && (e.distance = a(t.getAttribute("dist"))), t.hasAttribute("dir") && (e.angle = o(t.getAttribute("dir"))), t.hasAttribute("fadeDir") && (e.fadeAngle = o(t.getAttribute("fadeDir"))), t.hasAttribute("stA") && (e.startAlpha = c(t.getAttribute("stA"))), t.hasAttribute("stPos") && (e.startPosition = c(t.getAttribute("stPos"))), t.hasAttribute("endA") && (e.endAlpha = c(t.getAttribute("endA"))), t.hasAttribute("endPos") && (e.endPosition = c(t.getAttribute("endPos"))), t.hasAttribute("sx") && (e.scaleX = c(t.getAttribute("sx"))), t.hasAttribute("sy") && (e.scaleY = c(t.getAttribute("sy"))), t.hasAttribute("kx") && (e.skewX = o(t.getAttribute("kx"))), t.hasAttribute("ky") && (e.skewY = o(t.getAttribute("ky"))), t.hasAttribute("algn") && (e.alignment = t.getAttribute("algn")), t.hasAttribute("rotWithShape") && (e.isRotatedWithShape = i(t.getAttribute("rotWithShape"))), e;
293
- }
294
- default: return;
295
- }
296
- }
297
- getFill(e, t) {
298
- if (e.evaluate("noFill", t)) return { type: y.Type.None };
299
- let n = e.evaluate("solidFill", t);
300
- if (n) {
301
- let t = this.processAdjColor(e, n);
302
- if (t) return {
303
- type: y.Type.Solid,
304
- color: t
305
- };
306
- }
307
- let r = e.evaluate("gradFill", t);
308
- if (r) return this.processGradFill(e, r);
309
- let i = e.evaluate("pattFill", t);
310
- if (i) return this.processPatternFill(e, i);
311
- let a = e.evaluate("blipFill", t);
312
- return a ? this.processImageFill(e, a) : null;
313
- }
314
- processGradFill(e, t) {
315
- let n = { type: y.Type.Gradient };
316
- t.hasAttribute("rotWithShape") && (n.isRotatedWithShape = t.getAttribute("rotWithShape") === "1");
317
- let r = e.evaluate("lin", t);
318
- r && (n.gradientType = y.GradientType.Linear, r.hasAttribute("ang") && (n.angle = o(r.getAttribute("ang"))), r.hasAttribute("scaled") && (n.scaled = i(r.getAttribute("scaled"))));
319
- let a = {};
320
- t.hasAttribute("flip") && (a.mirror = t.getAttribute("flip")), Object.keys(a).length > 0 && (n.tile = a);
321
- let s = e.evaluate("path", t);
322
- if (s) {
323
- s.hasAttribute("path") && (n.gradientType = se(s.getAttribute("path")));
324
- let t = e.evaluate("fillToRect", s);
325
- t && (n.focus = this.getRect(t));
326
- }
327
- let l = e.evaluate("tileRect", t);
328
- l && (n.tile ||= {}, n.tile.bounds = this.getRect(l));
329
- let u = [], d = e.evaluate("gsLst/gs", t), f = d ? d.length : 0;
330
- for (let t = 0; t < f; t++) {
331
- let n = d.item(t), r = {
332
- offset: c(n.getAttribute("pos") ?? ""),
333
- color: this.processAdjColor(e, n)
334
- };
335
- u.push(r);
336
- }
337
- return u.length > 0 && (n.stops = u), n;
338
- }
339
- getRect(e) {
340
- let t = {};
341
- return e.hasAttribute("t") && (t.t = c(e.getAttribute("t"))), e.hasAttribute("l") && (t.l = c(e.getAttribute("l"))), e.hasAttribute("b") && (t.b = c(e.getAttribute("b"))), e.hasAttribute("r") && (t.r = c(e.getAttribute("r"))), Object.keys(t).length === 0 ? null : t;
342
- }
343
- processImageFill(e, t) {
344
- let n = { type: y.Type.Image };
345
- return t.hasAttribute("rotWithShape") && (n.isRotatedWithShape = i(t.getAttribute("rotWithShape"))), t.hasAttribute("dpi") && (n.dpi = t.getAttribute("dpi")), n.ref = "https://www.sheetxl.com/logo-color-padded-white.jpg", n.tile = !1, n;
346
- }
347
- processPatternFill(e, t) {
348
- let n = { type: y.Type.Pattern };
349
- n.patternType = t.getAttribute("prst");
350
- let r = e.evaluate("bgClr", t);
351
- if (r) {
352
- let t = this.processAdjColor(e, r);
353
- t && (n.background = t);
354
- }
355
- let i = e.evaluate("fgClr", t);
356
- if (i) {
357
- let t = this.processAdjColor(e, i);
358
- t && (n.foreground = t);
359
- }
360
- return n;
361
- }
362
- processAdjColor(e, t) {
363
- let n = e.evaluate("hslClr", t);
364
- if (n) return this.processHslClr(e, n);
365
- let r = e.evaluate("prstClr", t);
366
- if (r) return this.processClrWithValAttribute(e, r);
367
- let i = e.evaluate("schemeClr", t);
368
- if (i) return this.processClrWithValAttribute(e, i);
369
- let a = e.evaluate("sysClr", t);
370
- if (a) {
371
- let t = this.processClrWithValAttribute(e, a), n = a.getAttribute("lastClr");
372
- return t && n && (t += ` lastClr ${n}`), t;
373
- }
374
- let o = e.evaluate("scrgbClr", t);
375
- if (o) return this.processScrgbClrElement(e, o);
376
- let s = e.evaluate("srgbClr", t);
377
- return s ? this.processSrgbClrElement(e, s) : null;
378
- }
379
- processScrgbClrElement(e, t) {
380
- let n = "lrgba(" + c(t.getAttribute("r") ?? "") + "," + c(t.getAttribute("g") ?? "") + "," + c(t.getAttribute("b") ?? "") + ")";
381
- return n += this.processAdjustments(e, t), n;
382
- }
383
- processSrgbClrElement(e, t) {
384
- let n = t.getAttribute("val");
385
- return n += this.processAdjustments(e, t), n;
386
- }
387
- processHslClr(e, t) {
388
- let n = "hsl(" + o(t.getAttribute("hue") ?? "") + "," + c(t.getAttribute("sat") ?? "") + "," + c(t.getAttribute("lum") ?? "") + ")";
389
- return n += this.processAdjustments(e, t), n;
390
- }
391
- processClrWithValAttribute(e, t) {
392
- let n = t.getAttribute("val");
393
- if (!n) return null;
394
- let r = n;
395
- return r += this.processAdjustments(e, t), r;
396
- }
397
- processAdjustments(e, t) {
398
- let n = "", r = t.childNodes, i = r.length;
399
- for (let t = 0; t < i; t++) {
400
- let i = r.item(t);
401
- if (i.nodeType === 1) {
402
- let t = i.localName;
403
- n += t === "hue" || t === "hueOff" || t === "hueMod" ? this.processAdjustmentElement(e, i, t, 6e4) : t === "gray" || t === "comp" || t === "inv" || t === "gamma" || t === "invGamma" ? this.processAdjustmentElement(e, i, t, 1) : t === "alpha" || t === "alphaOff" || t === "alphaMod" ? this.processAdjustmentElement(e, i, t, 1e5) : this.processAdjustmentElement(e, i, t);
404
- }
405
- }
406
- return n;
407
- }
408
- processAdjustmentElement(e, t, n, r = 1e3) {
409
- let i = t.getAttribute("val");
410
- return i ? ` ${n} ${!i || parseFloat(i) / r}` : ` ${n}`;
411
- }
412
- }, se = (e) => e === "circle" ? "radial" : e, ce = (e) => {
413
- if (e === "rnd") return "round";
414
- if (e === "flat") return "butt";
415
- if (e === "sq") return "square";
416
- throw Error("Invalid lineCap type: " + e);
417
- }, I = class extends F {
418
- visit(e, t, n) {
419
- try {
420
- let r = e.evaluate("xfrm", t);
421
- if (r) {
422
- E(r, n);
423
- let t = {
424
- x: 0,
425
- y: 0,
426
- width: 0,
427
- height: 0
428
- }, i = e.evaluate("off", r);
429
- i && (t.x = d(i.getAttribute("x")) ?? 0, t.y = d(i.getAttribute("y")) ?? 0);
430
- let a = e.evaluate("ext", r);
431
- i && (t.width = d(a.getAttribute("cx")) ?? 0, t.height = d(a.getAttribute("cy")) ?? 0), n.bounds = t;
432
- }
433
- let i = e.evaluate("prstGeom", t);
434
- i?.hasAttribute("prst") ? n.geometry = i?.getAttribute("prst") : e.evaluate("customGeom", t) && e.warn("Custom shape geometry is not supported; the shape keeps its bounds only.", { onceKey: "xlsx.shape.customGeometry" });
435
- let a = this.getFill(e, t);
436
- a && Object.keys(a).length > 0 && (n.fill = a);
437
- let o = this.getStroke(e, t);
438
- return o && Object.keys(o).length > 0 && (n.stroke = o), n;
439
- } catch (t) {
440
- e.warn(`Unable to read shape properties: ${t?.message ?? t}`, { onceKey: "xlsx.shape.unreadable" });
441
- }
442
- }
443
- }, L = class {
444
- visit(e, t, n) {
445
- let r = {};
446
- if (D(e, t, r, "grouping", "grouping"), O(e, t, r, "varyColors", "varyColors"), A(e, t, r, "gapWidth", "gapWidth", .01), A(e, t, r, "overlap", "overlap", .01), this.parseType(e, t, r), k(e, t, r, "bubbleScale", "bubbleScale"), O(e, t, r, "showNegBubbles", "showNegativeBubbleValues"), O(e, t, r, "sizeRepresents", "bubbleSizeRepresentsWidth"), k(e, t, r, "firstSliceAng", "startAngle"), k(e, t, r, "holeSize", "holeSize"), D(e, t, r, "scatterStyle", "scatterStyle"), this.parseAxisIds(e, t, r), Object.keys(r).length > 0) {
447
- let t = e.getVisitorParamsState().get("types");
448
- t || (e.warn("A chart type was read outside a chart; its types were started fresh.", { onceKey: "xlsx.chart.typesState" }), t = [], e.getVisitorParamsState().set("types", t)), t.push(r);
449
- }
450
- return r;
451
- }
452
- parseType(e, t, n) {
453
- switch (t.localName) {
454
- case "areaChart":
455
- n.type = "area";
456
- break;
457
- case "bubbleChart":
458
- n.type = "bubble";
459
- break;
460
- case "doughnutChart":
461
- case "ofPieType":
462
- case "pieChart":
463
- n.type = "pie";
464
- break;
465
- case "lineChart":
466
- n.type = "line";
467
- break;
468
- case "scatterChart": n.type = "scatter";
469
- }
470
- }
471
- parseAxisIds(e, t, n) {
472
- let r = e.evaluate("axId", t);
473
- r && r.length !== 0 && (n.xAxisId = r.item(0).getAttribute("val"), n.yAxisId = r.item(1).getAttribute("val"));
474
- }
475
- }, R = (e, t, n) => {
476
- if (!0 === e.getValAttrAsBoolean("invertIfNegative", t)) if (e.evaluate("extLst/ext/invertSolidFillFmt", t)) {
477
- if (n.fill && n.fillNegative) {
478
- let t = e.getFromPath(n, "fill.solid.adjs");
479
- t && e.setToPath(n, "fillNegative.solid.adjs", t);
480
- }
481
- } else {
482
- let e = { val: "FFFFFF" }, t = {};
483
- t.solid = e, n.fillNegative = t;
484
- let r = { val: "000000" }, i = {};
485
- i.solid = r;
486
- let a = {};
487
- a.fill = i, n.strokeNegative = a;
488
- }
489
- }, z = class extends F {
490
- constructor(e = "text") {
491
- super(), this._jsonKey = e;
492
- }
493
- getTextPath() {
494
- return this._jsonKey;
495
- }
496
- visit(e, t, n) {
497
- let r = e.getFromPath(n, this.getTextPath());
498
- return r ||= {}, this.parseTextElement(e, t, r, !1), Object.keys(r).length > 0 && e.setToPath(n, this.getTextPath(), r), n;
499
- }
500
- parseTextElement(e, t, n, r) {
501
- let i = e.evaluate("p/pPr/defRPr", t) ?? e.evaluate("defRPr", t), a = i?.length === void 0 ? i : i.item(0);
502
- a && (this.parseTextProperties(e, a, n), new I().visit(e, a, n));
503
- let o = n.runs ?? [], s = e.evaluate("p/r", t) ?? e.evaluate("r", t), c = (t) => {
504
- let n = {}, r = e.evaluate("t", t), i = e.evaluate("rPr", t);
505
- i && this.parseTextProperties(e, i, n), r && r.firstChild ? n.text = r.firstChild.textContent ?? "" : t.textContent && (n.text = t.textContent ?? ""), Object.keys(n).length > 0 && o.push(n);
506
- };
507
- if (s?.length !== void 0) for (let e = 0; s && e < s.length; e++) c(s.item(e));
508
- else c(s || t);
509
- o.length > 0 && (n.runs = o);
510
- let l = e.evaluate("bodyPr", t);
511
- l && E(l, n);
512
- }
513
- parseTextProperties(e, t, n) {
514
- if (!t) return;
515
- t.hasAttribute("sz") && (n.size = parseFloat(t.getAttribute("sz")) / 100), t.hasAttribute("b") && (n.weight = t.getAttribute("b") === "1" ? 700 : 400), t.hasAttribute("i") && (n.italic = t.getAttribute("i") === "1"), t.hasAttribute("u") && (n.underline = t.getAttribute("u")), t.hasAttribute("strike") && (n.strike = t.getAttribute("strike"));
516
- let r = this.getFill(e, t);
517
- r && Object.keys(r).length > 0 && (n.color = r);
518
- let i = e.evaluate("latin", t);
519
- if (i && !i.getAttribute("typeface").startsWith("+")) {
520
- let e = n.font ?? {};
521
- if (i.hasAttribute("typeface") && (e.family = i.getAttribute("typeface")), i.hasAttribute("panose")) {
522
- let t = i.getAttribute("panose");
523
- t && (e.fallbacks = [b.getPanoseFallback(t)]);
524
- }
525
- i.hasAttribute("pitchFamily") && (e.pitch = i.getAttribute("pitchFamily")), i.hasAttribute("charset") && (e.charset = i.getAttribute("charset")), Object.keys(e).length > 0 && (n.font = e);
526
- }
527
- }
528
- }, B = class {
529
- visit(e, t, n) {}
530
- processDataBarColor(e, t, n, r, i = "auto") {
531
- if (!t) return;
532
- let a = l((e) => t.getAttribute(e), i);
533
- return a && (n[r] = a), n;
534
- }
535
- processFonts(e, t, n) {
536
- if (!t) return;
537
- let r = t.childNodes, i = 0, a = r.length;
538
- for (let t = 0; t < a; t++) {
539
- let a = r.item(t);
540
- if (a.nodeType === 1 && a.localName === "font") {
541
- let t = {};
542
- this.processFont(e, a, t), n[i++] = t;
543
- }
544
- }
545
- return n;
546
- }
547
- processFont(e, t, n) {
548
- e.getValAttrAsBoolean("b", t, !0) && (n.weight = 700), e.getValAttrAsBoolean("i", t, !0) && (n.style = b.Style.Italic), e.getValAttrAsBoolean("strike", t, !0) && (n.strike = !0);
549
- let r = e.evaluate("u", t);
550
- r && (n.underline = r.getAttribute("val") || b.UnderlineStyle.Single), D(e, t, n, "vertAlign", "verticalAlign"), n.verticalAlign === "superscript" ? n.verticalAlign = b.VerticalAlignment.Super : n.verticalAlign === "subscript" && (n.verticalAlign = b.VerticalAlignment.Sub), A(e, t, n, "sz", "size");
551
- let i = e.evaluate("color", t);
552
- this.processDataBarColor(e, i, n, "color"), n.color ||= "auto", D(e, t, n, "name", "family"), D(e, t, n, "rFont", "family");
553
- let a = e.evaluate("family", t);
554
- if (a) {
555
- let e = a.getAttribute("val");
556
- if (e) switch (e) {
557
- case "1":
558
- n.fallbacks = ["serif"];
559
- break;
560
- case "2":
561
- n.fallbacks = ["sans-serif"];
562
- break;
563
- case "3":
564
- n.fallbacks = ["monospace"];
565
- break;
566
- case "4":
567
- n.fallbacks = ["cursive"];
568
- break;
569
- case "5": n.fallbacks = ["fantasy"];
570
- }
571
- }
572
- return D(e, t, n, "scheme", "scheme"), n.family !== void 0 && n.scheme === void 0 && (n.scheme = b.Scheme.None), O(e, t, n, "shadow", "shadow", !0), O(e, t, n, "outline", "outline", !0), e.getValAttrAsBoolean("condense", t, !0) && (n.letterSpacing = -1), e.getValAttrAsBoolean("extend", t, !0) && (n.letterSpacing = 1), k(e, t, n, "charset", "charset"), n;
573
- }
574
- processFills(e, t, n) {
575
- if (!t) return;
576
- let r = t.childNodes, i = 0, a = r.length;
577
- for (let t = 0; t < a; t++) {
578
- let a = r.item(t);
579
- a.nodeType === 1 && a.localName === "fill" && this.processFill(e, a, n, i++);
580
- }
581
- return n;
582
- }
583
- processFill(e, t, n, r) {
584
- let i = { type: y.Type.None }, a = t.childNodes, o = !1, s = a.length;
585
- for (let t = 0; !o && t < s; t++) {
586
- let n = a.item(t);
587
- n.nodeType === 1 && (n.localName === "gradientFill" ? (this.processGradientFill(e, n, i), o = !0) : n.localName === "patternFill" && (this.processPatternFill(e, n, i), o = !0));
588
- }
589
- return n[r] = i, n;
590
- }
591
- processGradientFill(e, t, n) {
592
- if (!t) return;
593
- n.type = y.Type.Gradient;
594
- let r = [];
595
- n.stops = r;
596
- let i = t.getAttribute("type");
597
- i && (n.gradientType = i);
598
- let a = t.hasAttribute("degree") ? parseFloat(t.getAttribute("degree")) : 0;
599
- (a + 90) % 360 != 0 && (n.angle = (a + 90) % 360), (t.hasAttribute("left") || t.hasAttribute("top") || t.hasAttribute("right") || t.hasAttribute("bottom")) && (n.focus = {
600
- left: V(t.getAttribute("left")),
601
- top: V(t.getAttribute("top")),
602
- right: V(t.getAttribute("right")),
603
- bottom: V(t.getAttribute("bottom"))
604
- });
605
- let o = t.childNodes, s = o.length;
606
- for (let t = 0; t < s; t++) {
607
- let n = o.item(t);
608
- if (n.nodeType === 1 && n.localName === "stop") {
609
- let t = {};
610
- r.push(t), t.offset = parseFloat(n.getAttribute("position") ?? "");
611
- let i = e.evaluate("color", n);
612
- this.processDataBarColor(e, i, t, "color");
613
- }
614
- }
615
- return n;
616
- }
617
- processPatternFill(e, t, n) {
618
- if (!t) return;
619
- let r = e.getVisitorParamsState().get("processingDXFs"), i = t.getAttribute("patternType") || (r ? y.BuiltInSheetPattern.Solid : y.BuiltInSheetPattern.None);
620
- if (i === y.BuiltInSheetPattern.None) return { none: !0 };
621
- n.type = y.Type.Pattern, i && (n.patternType = i);
622
- let a = "foreground", o = "background", s = n.patternType === y.BuiltInSheetPattern.Solid && r, c = s ? "dk1" : "lt1", l = s ? "lt1" : "dk1";
623
- if (s) {
624
- let e = a;
625
- a = o, o = e;
626
- }
627
- let u = e.evaluate("fgColor", t);
628
- this.processDataBarColor(e, u, n, a, c);
629
- let d = e.evaluate("bgColor", t);
630
- return this.processDataBarColor(e, d, n, o, l), s && (n.foreground ||= "lt1", n.background ||= "dk1"), n;
631
- }
632
- processBorders(e, t, n, r) {
633
- if (!t) return;
634
- let i = t.childNodes, a = 0, o = i.length;
635
- for (let t = 0; t < o; t++) {
636
- let o = i.item(t);
637
- o.nodeType === 1 && o.localName === "border" && this.processBorder(e, o, n, a++, r);
638
- }
639
- return n;
640
- }
641
- processBorder(e, t, n, r, i) {
642
- if (!t) return;
643
- let a = {};
644
- return this.processBorderStroke(e, t, a, g.Edge.Left), this.processBorderStroke(e, t, a, g.Edge.Right), i ? (a.right || a.left) && (a.right ? a.vertical = { ...a.right } : a.vertical = { ...a.left }) : this.processBorderStroke(e, t, a, g.Edge.Vertical), this.processBorderStroke(e, t, a, g.Edge.Top), this.processBorderStroke(e, t, a, g.Edge.Bottom), i ? (a.bottom || a.top) && (a.bottom ? a.horizontal = { ...a.bottom } : a.horizontal = { ...a.top }) : this.processBorderStroke(e, t, a, g.Edge.Horizontal), n[r] = a, n;
645
- }
646
- processBorderStroke(e, t, n, r) {
647
- if (!t) return;
648
- let i = e.evaluate(r, t);
649
- if (!i) return;
650
- let a = {};
651
- i.hasAttribute("style") ? a.style = i.getAttribute("style") : e.getVisitorParamsState().get("processingDXFs") && (a.style = g.StrokeStyle.None);
652
- let o = e.evaluate("color", i);
653
- return o && this.processDataBarColor(e, o, a, "color"), Object.keys(a).length > 0 ? n[r] = a : null;
654
- }
655
- }, V = (e) => {
656
- if (!e) return 0;
657
- let t = parseFloat(e);
658
- return isNaN(t) ? 0 : t;
659
- }, le = {
660
- auto: "auto",
661
- autoNoTable: "automaticExceptTables",
662
- manual: "manual"
663
- }, H = class {
664
- visit(e, t, n) {
665
- if (!t) return;
666
- let r = e.evaluate("*/cNvPr", t);
667
- return r.item && (r = r.item(0)), r && (e.copyFromAttribute(r, "name", n), e.copyFromAttribute(r, "descr", n, "description"), e.copyFromAttribute(r, "hidden", n, "hidden", e.BOOLEAN_COPY), e.copyFromAttribute(r, "id", n)), n;
668
- }
669
- }, U = class extends H {
670
- visit(e, t, n) {
671
- if (!t) return;
672
- if (e.getPath().includes("Fallback") && n.content) {
673
- let r = n.content.json;
674
- return n.content.type === "sp" && r?.xml && r.fallbackXml === void 0 && (r.fallbackXml = e.serializeElement(t) ?? void 0), n;
675
- }
676
- n = super.visit(e, t, n);
677
- let r = e.evaluate("nvSpPr/cNvSpPr", t);
678
- if (r) {
679
- let t = e.evaluate("spLocks", r);
680
- if (t) {
681
- t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
682
- let e = {};
683
- Object.keys(e).length > 0 && (n.locks = e);
684
- }
685
- }
686
- let i = e.evaluate("*/cNvPr", t);
687
- i?.item && (i = i.item(0));
688
- let a = i?.getAttribute?.("id"), o = a ? parseInt(a, 10) : void 0, s = {
689
- type: "sp",
690
- xml: e.serializeElement(t) ?? void 0,
691
- sourceId: o === void 0 || isNaN(o) ? void 0 : o
692
- };
693
- return n.content = {
694
- type: "sp",
695
- json: s
696
- }, s;
697
- }
698
- }, W = "richTypes", G = "richData";
699
- function ue(e, t) {
700
- let n = e.childNodes;
701
- for (let e = 0; e < n.length; e++) {
702
- let r = n.item(e);
703
- if (r.nodeType === 1) switch (r.localName) {
704
- case "b":
705
- t.bold = r.getAttribute("val") !== "0" && r.getAttribute("val") !== "false";
706
- break;
707
- case "i":
708
- t.italic = r.getAttribute("val") !== "0" && r.getAttribute("val") !== "false";
709
- break;
710
- case "sz": {
711
- let e = parseFloat(r.getAttribute("val") ?? "");
712
- isNaN(e) || (t.size = e);
713
- break;
714
- }
715
- case "rFont": {
716
- let e = r.getAttribute("val");
717
- e && (t.font = e);
718
- break;
719
- }
720
- case "color": {
721
- let e = r.getAttribute("rgb");
722
- e && (t.color = "#" + (e.length === 8 ? e.substring(2) : e));
723
- break;
724
- }
725
- }
726
- }
727
- }
728
- var de = class {
729
- visit(e, t, n) {
730
- if (!t) return;
731
- let r = t.childNodes, i = r.length;
732
- for (let t = 0; t < i; t++) {
733
- let i = r.item(t);
734
- i.nodeType === 1 && i.localName === "Relationship" && this.processRelationship(e, i, n);
735
- }
736
- return n;
737
- }
738
- processRelationship(e, t, n) {
739
- let r = {};
740
- e.copyFromAttribute(t, "Target", r, "target"), e.copyFromAttribute(t, "Type", r, "type"), e.copyFromAttribute(t, "TargetMode", r, "targetMode"), n[t.getAttribute("Id")] = r;
741
- }
742
- }, fe = class {
743
- visit(e, t, n) {
744
- let r = [], i = t.childNodes, a = i.length;
745
- for (let t = 0; t < a; t++) {
746
- let n = i.item(t);
747
- if (n.nodeType !== 1) continue;
748
- let a = this.processProperty(e, n);
749
- a && r.push(a);
750
- }
751
- return r.length > 0 && (n.properties = r), r;
752
- }
753
- processProperty(e, t) {
754
- if (t) return t.getAttribute("xsi:type"), {
755
- key: t.localName,
756
- value: t.textContent || ""
757
- };
758
- }
759
- }, pe = class {
760
- visit(e, t, n) {
761
- let r = [], i = t.childNodes, a = i.length;
762
- for (let t = 0; t < a; t++) {
763
- let n = i.item(t);
764
- if (n.nodeType !== 1) continue;
765
- let a = this.processProperty(e, n);
766
- a && r.push(a);
767
- }
768
- return r.length > 0 && (n.properties = r), r;
769
- }
770
- processProperty(e, t) {
771
- if (t) return {
772
- key: t.localName,
773
- value: t.textContent || ""
774
- };
775
- }
776
- }, me = class {
777
- visit(e, t, n) {
778
- return O(e, t, n, "roundedCorners", "roundedCorners"), k(e, t, n, ".//AlternateContent/Fallback/style", "styleId"), e.getVisitorParamsState().set("types", []), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()), n.range = null, n;
779
- }
780
- afterVisit(e, t, n) {
781
- let r = {};
782
- n.types = r;
783
- let i = {}, a = 0, o = {}, s = 0, c = e.getVisitorParamsState().get("axes"), l = e.getVisitorParamsState().get("types"), u = l.length;
784
- for (let e = 0; e < u; e++) {
785
- let t = l[e];
786
- if (t.xAxisId) {
787
- let r = t.xAxisId, o = c.get(r);
788
- i[e + ""] = o, t.offsetXAxis = e, delete t.xAxisId, n.xAxes = i, i.length = ++a;
789
- }
790
- if (t.yAxisId) {
791
- let r = t.yAxisId, i = c.get(r);
792
- o[e + ""] = i, t.offsetYAxis = e, delete t.yAxisId, n.yAxes = o, o.length = ++s;
793
- }
794
- r[e + ""] = t;
795
- }
796
- r.length = l.length;
797
- let d = e.getVisitorParamsState().get("series");
798
- if (!d || d.length === 0) return;
799
- let f = {};
800
- n.series = f;
801
- let p = d.length;
802
- for (let e = 0; e < p; e++) f[e + ""] = d[e];
803
- f.length = p, e.getVisitorParamsState().delete("types"), e.getVisitorParamsState().delete("axes"), e.getVisitorParamsState().delete("series");
804
- }
805
- }, he = class {
806
- visit(e, t, n) {
807
- let r = {};
808
- return n.plotArea = r, r;
809
- }
810
- }, ge = I, _e = class extends L {
811
- parseType(e, t, n) {
812
- let r = e.getValAttrAsString("barDir", t);
813
- r && (n.type = r === "col" ? "column" : "bar");
814
- }
815
- }, K = L, q = class {
816
- constructor(e) {
817
- this.jsonKey = e;
818
- }
819
- visit(e, t, n) {
820
- let r = {}, i = r, a = e.getValAttrAsString("idx", t);
821
- a !== null && (i = {}, i[a] = r);
822
- let o = e.getValAttrAsBoolean("delete", t);
823
- this.parseNumFormat(e, t, r), !0 === o ? (r.showBubbleSize = !1, r.showCatName = !1, r.showLeaderLines = !1, r.showPercentage = !1, r.showSerName = !1, r.showVal = !1, r.showLegendKey = !1) : (O(e, t, r, "showBubbleSize", "showBubbleSize"), O(e, t, r, "showCatName", "showCatName"), O(e, t, r, "showLeaderLines", "showLeaderLines"), O(e, t, r, "showPercent", "showPercentage"), O(e, t, r, "showSerName", "showSerName"), O(e, t, r, "showVal", "showVal"), O(e, t, r, "showLegendKey", "showLegendKey"));
824
- let s = e.evaluate("separator", t);
825
- return s !== null && (r.separator = s.textContent), D(e, t, r, "dLblPos", "position"), n[this.jsonKey] = i, r;
826
- }
827
- parseNumFormat(e, t, n) {
828
- let r = e.evaluate("numFmt", t);
829
- r && (n.formatCode = r.getAttribute("formatCode"), r.hasAttribute("sourceLinked") && (n.sourceLinked = r.getAttribute("sourceLinked") === "1"));
830
- }
831
- }, ve = class {
832
- visit(e, t, n) {
833
- let r = {};
834
- k(e, t, r, "explosion", "explosion");
835
- let i = e.evaluate("cat/*/f", t);
836
- i ||= e.evaluate("xVal/*/f", t);
837
- let a = null;
838
- i !== null && i.firstChild !== null && (a = i.firstChild.nodeValue), i || (i = e.evaluate("cat/strLit", t), i ||= e.evaluate("cat/numLit", t), i && (a = this.parsePointsAsString(e, i))), a !== null && (r.xRange = a);
839
- let o = e.evaluate("val/*/f", t);
840
- o ||= e.evaluate("yVal/*/f", t);
841
- let s = null;
842
- o && o.firstChild && (s = o.firstChild.nodeValue), o || (o = e.evaluate("val/numLit", t), o !== null && (s = this.parsePointsAsString(e, o))), s !== null && (r.valRange = s), this.parseTitleRangeOrValue(e, t, r), k(e, t, r, "idx", "idx"), O(e, t, r, "smooth", "smooth"), r.offsetChart = e.getVisitorParamsState().get("types").length - 1;
843
- let c = e.getVisitorParamsState().get("series");
844
- return c || (c = [], e.getVisitorParamsState().set("series", c)), c.push(r), r;
845
- }
846
- parseTitleRangeOrValue(e, t, n) {
847
- let r = e.evaluate("tx/strRef/f", t);
848
- if (r !== null) {
849
- let t = r.firstChild.nodeValue;
850
- e.setToPath(n, "title.range", t);
851
- } else {
852
- let r = e.evaluate("tx/v", t);
853
- r !== null && e.setToPath(n, "title.text.simpleRun", r.firstChild.nodeValue);
854
- }
855
- }
856
- parsePointsAsString(e, t) {
857
- let n = "{", r = e.getValAttrAsInteger("ptCount", t), i = e.evaluate("pt", t), a = [];
858
- for (let n = 0; i && r && n < r; n++) {
859
- let r = null, i = e.evaluate("pt[@idx='" + n + "']/v", t);
860
- i && (r = i.textContent), a[n] = r;
861
- }
862
- for (let e = 0; e < a.length; e++) e > 0 && (n += ","), a[e] !== void 0 && (n += a[e]);
863
- return n += "}", n;
864
- }
865
- afterVisit(e, t, n) {
866
- R(e, t, n);
867
- let r = e.getFromPath(n, "points");
868
- if (r) {
869
- let t = Object.keys(r);
870
- for (let i = 0; i < t.length; i++) {
871
- let a = t[i], o = e.getFromPath(r, a);
872
- if (!o) continue;
873
- let s = e.getFromPath(o, "markers");
874
- s && (e.setToPath(n, "markers.points." + a, s), delete o.markers);
875
- }
876
- }
877
- }
878
- }, ye = class {
879
- DataPointVisitor() {}
880
- visit(e, t, n) {
881
- let r = e.getFromPath(n, "points"), i = null;
882
- r ? i = r : (i = {}, e.setToPath(n, "points", i));
883
- let a = {}, o = e.getValAttrAsString("idx", t);
884
- return o !== null && (i[o] = a), O(e, t, a, "bubble3D", "bubble3D"), k(e, t, a, "explosion", "explosion"), R(e, t, a), a;
885
- }
886
- }, be = class {
887
- visit(e, t, n) {
888
- let r = t.parentNode.localName;
889
- if (r === "ser" || r === "dPt") {
890
- let r = {}, i = e.getValAttrAsString("size", t);
891
- i !== null && (r.size = i);
892
- let a = e.getValAttrAsString("symbol", t);
893
- return a && (r.type = a), n.markers = r, r;
894
- }
895
- return null;
896
- }
897
- }, J = class {
898
- visit(e, t, n) {
899
- let r = {};
900
- this.parseScaling(e, t, r), A(e, t, r, "majorUnit", "majorUnits"), A(e, t, r, "minorUnit", "minorUnits"), O(e, t, r, "delete", "shown"), this.parseOrientation(e, t, r), this.parseNumFormat(e, t, r), D(e, t, r, "majorTickMark", "majorTickMarks"), D(e, t, r, "minorTickMark", "minorTickMarks"), D(e, t, r, "crosses", "crosses"), A(e, t, r, "crossesAt", "crosses"), D(e, t, r, "crossBetween", "crossBetween"), this.parseLabelAlign(e, t, r), k(e, t, r, "lblOffset", "labelOffset"), D(e, t, r, "tickLblPos", "labelPosition");
901
- let i = e.getValAttrAsInteger("noMultiLvlLbl", t);
902
- r.labelMultiLevel = i !== null && i === 0, k(e, t, r, "tickMarkSkip", "tickMarkSkip"), k(e, t, r, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(t, e, r), this.parseTimeUnits(e, t, r, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(e, t, r, "minorUnitDates", "minorTimeUnit", "minorUnit"), D(e, t, r, "baseTimeUnit", "baseUnitDates"), e.getVisitorParamsState().get("axes") || (e.warn("An axis was read outside a chart; its axes were started fresh.", { onceKey: "xlsx.chart.axesState" }), e.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()));
903
- let a = e.getValAttrAsString("axId", t);
904
- return e.getVisitorParamsState().get("axes").set(a, r), r;
905
- }
906
- parseTimeUnits(e, t, n, r, i, a) {
907
- let o = {}, s = e.getValAttrAsString(i, t);
908
- s !== null && (o.dem = s, o.amt = e.getValAttrAsString(a, t)), Object.keys(o).length > 0 && (n[r] = o);
909
- }
910
- parseDisplayCustOrBuiltInUnit(e, t, n) {
911
- let r = t.getValAttrAsString("dispUnits/builtInUnit", e);
912
- r ||= t.getValAttrAsString("dispUnits/custUnit", e), r && (n.displayUnits = r);
913
- }
914
- parseLabelAlign(e, t, n) {
915
- let r = e.getValAttrAsString("lblAlgn", t);
916
- r !== null && (r === "ctr" ? n.labelAlign = "center" : r === "l" ? n.labelAlign = "left" : r === "r" && (n.labelAlign = "right"));
917
- }
918
- parseOrientation(e, t, n) {
919
- let r = e.getValAttrAsString("AxPos", t);
920
- r !== null && (r === "b" ? n.orientation = "bottom" : r === "l" ? n.orientation = "left" : r === "r" ? n.orientation = "right" : r === "t" && (n.orientation = "top"));
921
- }
922
- parseNumFormat(e, t, n) {
923
- let r = {}, i = e.evaluate("numFmt", t);
924
- i !== null && (i.hasAttribute("formatCode") && (r.formatCode = i.getAttribute("formatCode")), i.hasAttribute("sourceLinked") && (r.sourceLinked = i.getAttribute("sourceLinked") === "1")), Object.keys(r).length > 0 && (n.labels = r);
925
- }
926
- parseScaling(e, t, n) {
927
- let r = e.getValAttrAsString("scaling/orientation", t);
928
- r !== null && (n.inverted = r !== "minMax");
929
- let i = e.getValAttrAsFloat("scaling/logBase", t);
930
- i !== null && (n.logBase = i, n.scaleType = "log"), A(e, t, n, "scaling/max", "max"), A(e, t, n, "scaling/min", "min");
931
- }
932
- afterVisit(e, t, n) {
933
- n.fill && n.labels && (n.labels.fill = n.fill, delete n.fill);
934
- let r = e.getValAttrAsBoolean("delete", t);
935
- r !== null && (e.setToPath(n, "labels.shown", !0 !== r), e.setToPath(n, "shown", !0 !== r));
936
- let i = e.getFromPath(n, "dispUnits.displayUnitsLabel");
937
- i && (e.setToPath(n, "displayUnitsLabel", i), delete n.dispUnits);
938
- let a = e.evaluate("title", t);
939
- e.setToPath(n, "title.shown", a !== null);
940
- let o = e.evaluate("minorGridlines", t);
941
- e.setToPath(n, "gridLinesMinor.shown", o !== null);
942
- let s = e.evaluate("majorGridlines", t);
943
- e.setToPath(n, "gridLinesMajor.shown", s !== null);
944
- }
945
- }, Y = z, xe = class {
946
- visit(e, t, n) {
947
- let r = e.getVisitorParamsState().get("series"), i = e.getValAttrAsInteger("idx", t), a = i === null ? void 0 : r[i];
948
- if (a) {
949
- let n = e.getFromPath(a, "title");
950
- n || (n = {}, e.setToPath(a, "title", n));
951
- let r = n, i = e.getValAttrAsBoolean("delete", t);
952
- return i !== null && (r.shown = !i), r;
953
- }
954
- return n;
955
- }
956
- }, Se = class {
957
- visit(e, t, n) {
958
- let r = {};
959
- return O(e, t, r, "overlay", "overlay"), D(e, t, r, "legendPos", "position"), n.legend = r, r;
960
- }
961
- }, Ce = class extends I {
962
- visit(e, t, n) {
963
- let r = this.getFill(e, t);
964
- Object.keys(r).length > 0 && (n.fillNegative = r);
965
- let i = this.getStroke(e, t);
966
- return Object.keys(i).length > 0 && (n.strokeNegative = i), n;
967
- }
968
- }, X = class extends z {
969
- constructor(e = "title") {
970
- super(e);
971
- }
972
- parseTitleRangeOrValue(e, t, n) {
973
- let r = e.evaluate("tx/strRef/f", t) ?? null;
974
- if (r) {
975
- let t = r.firstElementChild.nodeValue;
976
- e.setToPath(n, "range", t);
977
- }
978
- }
979
- visit(e, t, n) {
980
- let r = {};
981
- O(e, t, r, "overlay", "overlay"), n[this._jsonKey] = r;
982
- let i = e.getFromPath(r, this.getTextPath());
983
- i ||= {}, this.parseTitleRangeOrValue(e, t, r);
984
- let a = e.evaluate("txPr", t);
985
- a && this.parseTextElement(e, a, i, !1);
986
- let o = e.evaluate("tx/rich", t);
987
- return o && this.parseTextElement(e, o, i, !0), Object.keys(i).length > 0 && e.setToPath(r, "text", i), r;
988
- }
989
- afterVisit(e, t, n) {
990
- if (n?.text) {
991
- let e = n.text?.rotation ?? null;
992
- e !== null && (n.rotation = parseInt(e), delete n.title.rotation);
993
- }
994
- }
995
- }, we = class {
996
- visit(e, t, n) {
997
- let r = e.evaluate("manualLayout", t);
998
- if (r) {
999
- let t = {};
1000
- A(e, r, t, "x", "x"), A(e, r, t, "y", "y"), A(e, r, t, "w", "w"), A(e, r, t, "h", "h"), D(e, r, t, "xMode", "xMode"), D(e, r, t, "yMode", "yMode"), D(e, r, t, "wMode", "wMode"), D(e, r, t, "hMode", "hMode"), Object.keys(t).length > 0 && (n.manualLayout = t);
1001
- }
1002
- return n;
1003
- }
1004
- }, Te = class {
1005
- visit(e, t, n) {
1006
- return n.name = t.getAttribute("name"), n;
1007
- }
1008
- }, Ee = class extends F {
1009
- visit(e, t, n) {
1010
- let r = {};
1011
- r.name = t.getAttribute("name");
1012
- let i = t.childNodes, a = i.length;
1013
- for (let n = 0; n < a; n++) {
1014
- let a = i.item(n);
1015
- if (a.nodeType === 1) {
1016
- let n = a.localName, i = e.evaluate(n, t);
1017
- r[n] = this.processAdjColor(e, i);
1018
- }
1019
- }
1020
- return Object.keys(r).length > 0 && (n.colors = r), r;
1021
- }
1022
- }, De = class {
1023
- visit(e, t, n) {
1024
- let r = {};
1025
- r.name = t.getAttribute("name");
1026
- let i = e.evaluate("majorFont", t), a = this.processFontElement(e, i, {});
1027
- a && (r.majorFont = a.family, a.fallbacks && (r.majorFallbacks = a.fallbacks));
1028
- let o = e.evaluate("minorFont", t), s = this.processFontElement(e, o, {});
1029
- return s && (r.minorFont = s.family, s.fallbacks && (r.minorFallbacks = s.fallbacks)), n.fonts = r, r;
1030
- }
1031
- processFontElement(e, t, n) {
1032
- if (!t) return;
1033
- let r = e.evaluate("latin", t);
1034
- if (!r) return;
1035
- let i = r.getAttribute("typeface");
1036
- i && (n.family = i);
1037
- let a = r.getAttribute("panose");
1038
- return a && (n.fallbacks = [b.getPanoseFallback(a)]), n;
1039
- }
1040
- }, Oe = class extends F {
1041
- visit(e, t, n) {
1042
- let r = this.parseFillList(e, t, "fillStyleLst"), i = this.parseLnList(e, t, "lnStyleLst"), a = this.parseEffectStyleList(e, t, "effectStyleLst"), o = this.parseFillList(e, t, "bgFillStyleLst");
1043
- if (r && i && a && o) return n.fillStyleLst = r, n.lnStyleLst = i, n.effectStyleLst = a, void (n.bgFillStyleLst = o);
1044
- let s = e.serializeElement(t);
1045
- s && (n.formatSchemeXml = s);
1046
- }
1047
- parseFillList(e, t, n) {
1048
- let r = e.evaluate(n, t);
1049
- if (!r) return;
1050
- let i = [], a = r.childNodes, o = a.length;
1051
- for (let t = 0; t < o; t++) {
1052
- let n = a.item(t);
1053
- if (n.nodeType !== 1) continue;
1054
- let r = this.parseFillListItem(e, n);
1055
- if (r === void 0) return;
1056
- i.push(r);
1057
- }
1058
- return i;
1059
- }
1060
- parseFillListItem(e, t) {
1061
- switch (t.localName) {
1062
- case "noFill": return { type: y.Type.None };
1063
- case "solidFill": {
1064
- let n = this.processAdjColor(e, t);
1065
- return n ? {
1066
- type: y.Type.Solid,
1067
- color: n
1068
- } : void 0;
1069
- }
1070
- case "gradFill": return this.processGradFill(e, t);
1071
- case "pattFill": return this.processPatternFill(e, t);
1072
- default: return;
1073
- }
1074
- }
1075
- parseLnList(e, t, n) {
1076
- let r = e.evaluate(n, t);
1077
- if (!r) return;
1078
- let i = [], a = r.childNodes, o = a.length;
1079
- for (let t = 0; t < o; t++) {
1080
- let n = a.item(t);
1081
- if (n.nodeType === 1) {
1082
- if (e.evaluate("headEnd", n) || e.evaluate("tailEnd", n)) return;
1083
- i.push(this.parseLn(e, n));
1084
- }
1085
- }
1086
- return i;
1087
- }
1088
- parseEffectStyleList(e, t, n) {
1089
- let r = e.evaluate(n, t);
1090
- if (!r) return;
1091
- let i = [], a = r.childNodes, o = a.length;
1092
- for (let t = 0; t < o; t++) {
1093
- let n = a.item(t);
1094
- if (n.nodeType !== 1) continue;
1095
- if (e.evaluate("scene3d", n) || e.evaluate("sp3d", n)) return;
1096
- let r = this.getEffects(e, n);
1097
- if (r === void 0) return;
1098
- i.push(r ?? []);
1099
- }
1100
- return i;
1101
- }
1102
- }, ke = class {
1103
- visit(e, t, n) {
1104
- if (!t) return;
1105
- let r = {}, i = t.getAttribute("r:id");
1106
- if (i) {
1107
- let t = e.getRef(i);
1108
- typeof t == "string" && (r.address = t);
1109
- }
1110
- return e.copyFromAttribute(t, "tooltip", r, "screenTip"), e.copyFromAttribute(t, "history", r, "history", e.BOOLEAN_COPY), e.copyFromAttribute(t, "tgtFrame", r, "target"), n.hyperlink = r, r;
1111
- }
1112
- }, Ae = class {
1113
- visit(e, t, n) {
1114
- if (!t) return;
1115
- let r = {}, i = [];
1116
- return this.processFilterColumns(e, t, i, n), i.length > 0 && (r.conditions = i), Object.keys(r).length > 0 && (n.filter = r), r;
1117
- }
1118
- processColorFilter(e, t) {
1119
- let n = {}, r = {
1120
- operator: _.BuiltInOperatorNames.Color,
1121
- param: n
1122
- };
1123
- return e.copyFromAttribute(t, "cellColor", n, "cellColor", e.BOOLEAN_COPY), e.copyFromAttribute(t, "dxfId", n, "styleId", e.INT_COPY), r;
1124
- }
1125
- processCustomFilter(e, t) {
1126
- return n({
1127
- operator: t.getAttribute("operator"),
1128
- val: t.getAttribute("val")
1129
- });
1130
- }
1131
- processCustomFilters(e, t) {
1132
- let n = t.getAttribute("and"), r = n === "and" || n === "1";
1133
- t.getAttribute("val");
1134
- let i = [], a = {
1135
- operator: r ? _.BuiltInOperatorNames.And : _.BuiltInOperatorNames.Or,
1136
- param: i
1137
- }, o = t.childNodes, s = o.length;
1138
- for (let t = 0; t < s; t++) {
1139
- let n = o.item(t);
1140
- if (n.nodeType !== 1) continue;
1141
- let r = null;
1142
- n.localName === "customFilter" && (r = this.processCustomFilter(e, n)), r && i.push(r);
1143
- }
1144
- return i.length === 1 ? i[0] : a;
1145
- }
1146
- processDynamicFilter(e, t) {
1147
- let n = {}, r = {
1148
- operator: _.BuiltInOperatorNames.TimePeriod,
1149
- param: n
1150
- }, i = t.getAttribute("type");
1151
- return i === "aboveAverage" ? i = _.AverageType.Above : i === "belowAverage" && (i = _.AverageType.Below), Object.values(_.AverageType).includes(i) ? (r.operator = _.BuiltInOperatorNames.Average, e.copyFromAttribute(t, "val", n, "stdDevs", e.INT_COPY)) : e.copyFromAttribute(t, "val", n, "anchorDate", e.INT_COPY), e.copyFromAttribute(t, "type", n, "operator"), e.copyFromAttribute(t, "maxVal", n, "maxVal", e.INT_COPY), r;
1152
- }
1153
- processDateGroupItem(e, t) {
1154
- let n = {};
1155
- return e.copyFromAttribute(t, "dateTimeGrouping", n, "group"), e.copyFromAttribute(t, "day", n, "day", e.INT_COPY), e.copyFromAttribute(t, "hour", n, "hour", e.INT_COPY), e.copyFromAttribute(t, "minute", n, "minute", e.INT_COPY), e.copyFromAttribute(t, "month", n, "month", e.INT_COPY), e.copyFromAttribute(t, "second", n, "second", e.INT_COPY), e.copyFromAttribute(t, "year", n, "year", e.INT_COPY), n;
1156
- }
1157
- processFilterItem(e, t) {
1158
- if (t.hasAttribute("val")) return t.getAttribute("val");
1159
- }
1160
- processFilters(e, t) {
1161
- let n = {}, r = {
1162
- operator: _.BuiltInOperatorNames.InSet,
1163
- param: n
1164
- };
1165
- e.copyFromAttribute(t, "blank", r, "blank", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calendarType", r, "calendarType");
1166
- let i = [], a = [], o = t.childNodes, s = o.length;
1167
- for (let t = 0; t < s; t++) {
1168
- let n = o.item(t);
1169
- if (n.nodeType === 1) {
1170
- if (n.localName === "dateGroupItem") {
1171
- let t = this.processDateGroupItem(e, n);
1172
- t && i.push(t);
1173
- } else if (n.localName === "filter") {
1174
- let t = this.processFilterItem(e, n);
1175
- t !== void 0 && a.push(t);
1176
- }
1177
- }
1178
- }
1179
- return i.length > 0 && (n.dateGroups = i), a.length > 0 && (n.items = a), r;
1180
- }
1181
- processIcon(e, t) {
1182
- let n = {}, r = {
1183
- operator: _.BuiltInOperatorNames.Icon,
1184
- param: n
1185
- };
1186
- return e.copyFromAttribute(t, "iconId", n, "iconId", e.INT_COPY), e.copyFromAttribute(t, "iconSet", n), r;
1187
- }
1188
- processTop10(e, t) {
1189
- let n = {}, r = {
1190
- operator: _.BuiltInOperatorNames.TopN,
1191
- param: n
1192
- };
1193
- return e.copyFromAttribute(t, "filterVal", n, "filterVal", e.FLOAT_COPY), e.copyFromAttribute(t, "percent", n, "percent", e.BOOLEAN_COPY), e.copyFromAttribute(t, "top", n, "top", e.BOOLEAN_COPY), e.copyFromAttribute(t, "val", n, "val", e.FLOAT_COPY), r;
1194
- }
1195
- processFilterCriteria(e, t) {
1196
- if (!t) return;
1197
- let n = t.childNodes, r, i = n.length;
1198
- for (let t = 0; t < i; t++) {
1199
- let i = n.item(t);
1200
- i.nodeType === 1 && (i.localName === "colorFilter" ? r = this.processColorFilter(e, i) : i.localName === "customFilters" ? r = this.processCustomFilters(e, i) : i.localName === "dynamicFilter" ? r = this.processDynamicFilter(e, i) : i.localName === "filters" ? r = this.processFilters(e, i) : i.localName === "iconFilter" ? r = this.processIcon(e, i) : i.localName === "top10" && (r = this.processTop10(e, i)));
1201
- }
1202
- return r;
1203
- }
1204
- processFilterColumn(e, t, n) {
1205
- if (!t) return null;
1206
- if (!t.hasAttribute("colId")) return;
1207
- let r = parseInt(t.getAttribute("colId")), a = !1;
1208
- if (t.hasAttribute("hiddenButton") && (a = i(t.getAttribute("hiddenButton"))), a && n) {
1209
- let e = n.hiddenButtons;
1210
- e || (e = [], n.hiddenButtons = e), e.push(r);
1211
- }
1212
- let o = !1;
1213
- if (t.hasAttribute("showButton") && (o = i(t.getAttribute("showButton"))), o && n) {
1214
- let e = n.showButtons;
1215
- !0 !== e && (e || (e = [], n.showButtons = e), e[r] = !0);
1216
- }
1217
- let s = this.processFilterCriteria(e, t);
1218
- return s ? (s.index = r, s) : null;
1219
- }
1220
- processFilterColumns(e, t, n, r) {
1221
- if (!t) return;
1222
- let i = t.childNodes, a = i.length;
1223
- for (let t = 0; t < a; t++) {
1224
- let a = i.item(t);
1225
- if (a.nodeType === 1 && a.localName === "filterColumn") {
1226
- let t = this.processFilterColumn(e, a, r);
1227
- t && n.push(t);
1228
- }
1229
- }
1230
- return n;
1231
- }
1232
- }, je = class {
1233
- visit(e, t, n) {
1234
- if (!t) return;
1235
- let r = t.getAttribute("ref"), a = {};
1236
- t.hasAttribute("caseSensitive") && (a.collatorOptions = i(t.getAttribute("caseSensitive")) ? w.CaseSensitiveOptions : w.CaseInsensitiveOptions);
1237
- let o = t.getAttribute("sortMethod");
1238
- o != null && o !== "none" && (o === "stroke" ? a.collatorOptions = {
1239
- ...a.collatorOptions,
1240
- collation: "stroke"
1241
- } : o === "pinYin" && (a.collatorOptions = {
1242
- ...a.collatorOptions,
1243
- collation: "pinyin"
1244
- }));
1245
- let s = {};
1246
- t.hasAttribute("columnSort") && i(t.getAttribute("columnSort")) && (s.axis = x.Axis.Column);
1247
- let c = m.fastStringToRange(r), l = [];
1248
- return this.processSortConditions(e, t, l, c, a), l.length > 0 && (s.sorts = l), Object.keys(l).length > 0 && (n.sort = s), s;
1249
- }
1250
- processSortCondition(e, t, n, r) {
1251
- if (!t) return null;
1252
- let a = {};
1253
- if (!t.hasAttribute("ref")) return void e.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
1254
- if (t.hasAttribute("ref")) {
1255
- let e = t.getAttribute("ref"), r = m.fastStringToRange(e);
1256
- a.index = n ? r.colStart - n.colStart : r.colStart;
1257
- }
1258
- let o = { ...r };
1259
- return a.criteria = o, o.reverse = !1, t.hasAttribute("descending") && (o.reverse = i(t.getAttribute("descending"))), e.copyFromAttribute(t, "sortBy", o, "sortOn"), e.copyFromAttribute(t, "dxfId", o), e.copyFromAttribute(t, "iconSet", o), e.copyFromAttribute(t, "customList", o), a;
1260
- }
1261
- processSortConditions(e, t, n, r, i) {
1262
- if (!t) return;
1263
- let a = t.childNodes, o = a.length;
1264
- for (let t = 0; t < o; t++) {
1265
- let o = a.item(t);
1266
- if (o.nodeType === 1 && o.localName === "sortCondition") {
1267
- let t = this.processSortCondition(e, o, r, i);
1268
- t && n.push(t);
1269
- }
1270
- }
1271
- }
1272
- }, Z = class extends B {
1273
- visit(e, t, n) {
1274
- this.processNumFmts(e, e.evaluate("numFmts", t), null), e.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1275
- let r = {
1276
- fills: {},
1277
- fonts: {},
1278
- borders: {}
1279
- };
1280
- this.processFonts(e, e.evaluate("fonts", t), r.fonts), this.processFills(e, e.evaluate("fills", t), r.fills), this.processBorders(e, e.evaluate("borders", t), r.borders, !0), r.fills[0] = { type: y.Type.None }, r.fills[1] = {
1281
- type: y.Type.Pattern,
1282
- patternType: y.BuiltInSheetPattern.Gray125
1283
- }, r.borders[0] = {
1284
- bottom: { style: g.StrokeStyle.None },
1285
- left: { style: g.StrokeStyle.None },
1286
- right: { style: g.StrokeStyle.None },
1287
- top: { style: g.StrokeStyle.None }
1288
- };
1289
- let i = [];
1290
- this.processXFs(e, e.evaluate("cellStyleXfs", t), i, r, null, !1);
1291
- let a = /* @__PURE__ */ new Map();
1292
- if (i.length > 0) {
1293
- let r = [];
1294
- this.processCellStyles(e, e.evaluate("cellStyles", t), r, i, a), n.named = r;
1295
- }
1296
- let o = [];
1297
- this.processXFs(e, e.evaluate("cellXfs", t), o, r, a), Object.keys(o).length > 0 && (n.direct = o);
1298
- let s = this.collectHiddenXfs(e.evaluate("cellXfs", t));
1299
- s.size > 0 && e.getVisitorParamsState().set(f, s);
1300
- let c = [];
1301
- return this.processDXFs(e, e.evaluate("dxfs", t), c), this.processTableStyles(e, e.evaluate("tableStyles", t), n, c), this.processIndexColors(e, e.evaluate("colors/indexedColors", t), n), this.processMruColors(e, e.evaluate("colors/mruColors", t), n), n;
1302
- }
1303
- processIndexColors(e, t, n) {
1304
- if (!t) return;
1305
- let r = [], i = t.childNodes, a = i.length;
1306
- for (let t = 0; t < a; t++) {
1307
- let n = i.item(t);
1308
- if (n.nodeType === 1 && n.localName === "rgbColor") {
1309
- let t = { color: null };
1310
- this.processDataBarColor(e, n, t, "color"), t.color && r.push(t.color);
1311
- }
1312
- }
1313
- n.indexedColors = r;
1314
- }
1315
- processMruColors(e, t, n) {
1316
- if (!t) return;
1317
- let r = [], i = t.childNodes, a = i.length;
1318
- for (let t = 0; t < a; t++) {
1319
- let n = i.item(t);
1320
- if (n.nodeType === 1 && n.localName === "color") {
1321
- let t = { color: null };
1322
- this.processDataBarColor(e, n, t, "color"), t.color && r.push(t.color);
1323
- }
1324
- }
1325
- r.length > 0 && (n.mruColors = r);
1326
- }
1327
- processNumFmts(e, t, n) {
1328
- if (!t) return;
1329
- let r = /* @__PURE__ */ new Map();
1330
- if (e.getVisitorParamsState().set("numFmts", r), !t) return;
1331
- let i = t.childNodes, a = i.length;
1332
- for (let e = 0; e < a; e++) {
1333
- let t = i.item(e);
1334
- if (t.nodeType === 1 && t.localName === "numFmt") {
1335
- let e = t.getAttribute("numFmtId"), n = t.getAttribute("formatCode");
1336
- if (e && n) {
1337
- let t = n;
1338
- r.set(parseInt(e), t);
1339
- }
1340
- }
1341
- }
1342
- }
1343
- processXFs(e, t, n, r, i = null, a = !0) {
1344
- if (!t) return;
1345
- let o = t.childNodes, s = o.length;
1346
- for (let t = 0; t < s; t++) {
1347
- let s = o.item(t);
1348
- if (s.nodeType === 1 && s.localName === "xf") {
1349
- let t = {};
1350
- this.processXF(e, s, t, r, i, a), n.push(t);
1351
- }
1352
- }
1353
- }
1354
- processXF(e, t, n, r, a, o) {
1355
- if (!t) return;
1356
- let s = t.getAttribute("xfId");
1357
- if (s && a) {
1358
- let e = a.get(parseInt(s));
1359
- e && e !== S.BuiltInName.Normal && (n.named = e);
1360
- }
1361
- let c = (e) => !(!o && t.hasAttribute(e)) || i(t.getAttribute(e)), l = (e) => !o || t.hasAttribute(e) && i(t.getAttribute(e)), u = o ? "0" : void 0;
1362
- if (c("applyFont")) {
1363
- let e = t.getAttribute("fontId") ?? u;
1364
- if (e !== void 0 && (e !== "0" || l("applyFont"))) {
1365
- let t = r.fonts[e];
1366
- t !== void 0 && (n.font = t);
1367
- }
1368
- }
1369
- if (c("applyFill")) {
1370
- let e = t.getAttribute("fillId") ?? u;
1371
- if (e !== void 0 && (e !== "0" || l("applyFill"))) {
1372
- let t = r.fills[e];
1373
- t !== void 0 && Object.keys(t).length > 0 && (n.fill = t);
1374
- }
1375
- }
1376
- if (c("applyBorder")) {
1377
- let e = t.getAttribute("borderId") ?? u;
1378
- if (e !== void 0 && (e !== "0" || l("applyBorder"))) {
1379
- let t = r.borders[e];
1380
- t !== void 0 && (n.borders = t);
1381
- }
1382
- }
1383
- if (c("applyNumberFormat")) {
1384
- let r = t.getAttribute("numFmtId") ?? u;
1385
- if (r !== void 0 && (r !== "0" || l("applyNumberFormat"))) {
1386
- let t = parseInt(r), i, a = e.getVisitorParamsState();
1387
- if (a) {
1388
- let e = a.get("numFmts");
1389
- e && (i = e.get(t)), n.numberFormat = i ?? t;
1390
- } else e.warn("Number formats were unavailable; a cell format was not read.", { onceKey: "xlsx.style.numberFormat.state" });
1391
- }
1392
- }
1393
- if (c("applyAlignment")) {
1394
- let r = e.evaluate("alignment", t);
1395
- (r || l("applyAlignment")) && this.processAlignment(e, r, n);
1396
- }
1397
- if (c("applyProtection")) {
1398
- let r = e.evaluate("protection", t);
1399
- (r || l("applyProtection")) && this.processProtection(e, r, n);
1400
- }
1401
- let d = i(t.getAttribute("quotePrefix") ?? "");
1402
- d && (n.quotePrefix = d);
1403
- }
1404
- processAlignment(e, t, n) {
1405
- let r = {};
1406
- if (t?.hasAttribute("horizontal") ? r.horizontal = t.getAttribute("horizontal") : r.horizontal = C.HorizontalAlignment.General, t?.hasAttribute("vertical") ? r.vertical = t.getAttribute("vertical") : r.vertical = C.VerticalAlignment.Bottom, t?.hasAttribute("indent") ? r.indent = parseInt(t.getAttribute("indent")) : r.indent = 0, t?.hasAttribute("relativeIndent") ? r.relativeIndent = parseInt(t.getAttribute("relativeIndent")) : r.relativeIndent = 0, i(t?.getAttribute("wrapText") ?? "") ? r.overflow = C.Overflow.Wrap : r.overflow = C.Overflow.Visible, i(t?.getAttribute("shrinkToFit") ?? "") && (r.overflow = C.Overflow.Shrink), t?.hasAttribute("textRotation")) {
1407
- let e = parseFloat(t.getAttribute("textRotation"));
1408
- e > 0 && e <= 90 ? e = 360 - e : e > 90 && e <= 180 ? e -= 90 : e === 255 && (e = 0, r.stacked = !0), r.rotation = e;
1409
- } else r.rotation = 0;
1410
- t?.hasAttribute("justifyLastLine") && (r.justifyLastLine = i(t.getAttribute("justifyLastLine")));
1411
- let a = t?.getAttribute("readingOrder");
1412
- return a && (a === "0" ? r.readingDirection = C.ReadingDirection.Auto : a === "1" ? r.readingDirection = C.ReadingDirection.LeftToRight : a === "2" ? r.readingDirection = C.ReadingDirection.RightToLeft : e.warn(`Invalid readingOrder '${a}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(r).length > 0 && (n.alignment = r), n;
1413
- }
1414
- collectHiddenXfs(e) {
1415
- let t = /* @__PURE__ */ new Set();
1416
- if (!e) return t;
1417
- let n = e.childNodes, r = 0;
1418
- for (let e = 0; e < n.length; e++) {
1419
- let a = n.item(e);
1420
- if (a.nodeType !== 1 || a.localName !== "xf") continue;
1421
- let o = a.childNodes;
1422
- for (let e = 0; e < o.length; e++) {
1423
- let n = o.item(e);
1424
- n.nodeType === 1 && n.localName === "protection" && i(n.getAttribute("hidden") ?? "") && t.add(r);
1425
- }
1426
- r++;
1427
- }
1428
- return t;
1429
- }
1430
- processProtection(e, t, n) {
1431
- if (!t) return;
1432
- let r = t.getAttribute("locked");
1433
- return n.protection = { alwaysUnlocked: !!r && !i(r) }, n;
1434
- }
1435
- processDXF(e, t, n) {
1436
- if (!t) return;
1437
- let r = t.childNodes, i = r.length;
1438
- for (let t = 0; t < i; t++) {
1439
- let i = r.item(t);
1440
- if (i.nodeType === 1 && i.localName === "font") {
1441
- let t = {};
1442
- this.processFont(e, i, t), n.font = t;
1443
- } else if (i.nodeType === 1 && i.localName === "fill") {
1444
- let t = [];
1445
- this.processFill(e, i, t, 0), t.length > 0 && t[0] && (n.fill = t[0]);
1446
- } else if (i.nodeType === 1 && i.localName === "border") {
1447
- let t = [];
1448
- this.processBorder(e, i, t, 0, !1), t.length > 0 && t[0] && (n.borders = t[0]);
1449
- } else if (i.nodeType === 1 && i.localName === "numFmt") {
1450
- let e = i.getAttribute("formatCode");
1451
- if (e) n.numberFormat = e;
1452
- else {
1453
- let e = i.getAttribute("numFmtId");
1454
- e && (n.numberFormat = Number(e));
1455
- }
1456
- } else i.nodeType === 1 && i.localName === "alignment" && this.processAlignment(e, i, n);
1457
- }
1458
- }
1459
- processDXFs(e, t, n) {
1460
- if (!t) return;
1461
- e.getVisitorParamsState().set("processingDXFs", !0);
1462
- let r = /* @__PURE__ */ new Map();
1463
- e.getVisitorParamsState().set("dxfs", r);
1464
- let i = t.childNodes, a = i.length;
1465
- for (let t = 0; t < a; t++) {
1466
- let a = i.item(t);
1467
- if (a.nodeType === 1 && a.localName === "dxf") {
1468
- let t = {};
1469
- this.processDXF(e, a, t);
1470
- let i = n.length;
1471
- r.set(i, t), n.push(t);
1472
- }
1473
- }
1474
- e.getVisitorParamsState().delete("processingDXFs");
1475
- }
1476
- processTableStyle(e, t, n, r, a = !1) {
1477
- let o = t.getAttribute("name"), s = { name: o };
1478
- t.hasAttribute("table") && (s.table = i(t.getAttribute("table"))), t.hasAttribute("pivot") && (s.pivot = i(t.getAttribute("pivot"))), a && !s.pivot && r.unshift(null);
1479
- let c = t.childNodes, l = c.length;
1480
- for (let t = 0; t < l; t++) {
1481
- let n = c.item(t);
1482
- if (n.nodeType === 1 && n.localName === "tableStyleElement") {
1483
- let t = n.getAttribute("type"), i = n.getAttribute("dxfId"), a = i == null ? void 0 : r?.[i];
1484
- a ||= (e.warn(`A table style names a format that does not exist (dxfId '${i}').`, { onceKey: "xlsx.style.tableStyle.dxf" }), {}), s[t] = a;
1485
- let o = null;
1486
- n.hasAttribute("size") && (o = parseInt(n.getAttribute("size"))), o && !isNaN(o) && (a.size = o);
1487
- }
1488
- }
1489
- delete s.name, n[o] = s;
1490
- }
1491
- processTableStyles(e, t, n, r, i) {
1492
- if (!t) return;
1493
- let a = {}, o = t.getAttribute("defaultTableStyle");
1494
- o && (a.defaultTableStyle = o);
1495
- let s = t.getAttribute("defaultPivotStyle");
1496
- s && (a.defaultPivotStyle = s);
1497
- let c = t.childNodes, l = {}, u = c.length;
1498
- for (let t = 0; t < u; t++) {
1499
- let n = c.item(t);
1500
- n.nodeType === 1 && n.localName === "tableStyle" && this.processTableStyle(e, n, l, r, i);
1501
- }
1502
- return Object.keys(l).length > 0 && (a.styles = l), Object.keys(a).length > 0 && (n.tables = a), n;
1503
- }
1504
- processCellStyles(e, t, n, r, a) {
1505
- if (!t) return;
1506
- let o = t.childNodes, s = o.length;
1507
- for (let e = 0; e < s; e++) {
1508
- let t = o.item(e);
1509
- if (t.nodeType === 1 && t.localName === "cellStyle") {
1510
- let e = parseInt(t.getAttribute("xfId") ?? ""), o = t.getAttribute("name"), s = t.getAttribute("builtinId"), c = o;
1511
- if (s !== null) {
1512
- let e = S.builtInNameFromId(parseInt(s));
1513
- e !== void 0 && (c = e);
1514
- }
1515
- if (a.set(e, c), !r[e]) continue;
1516
- let l = {
1517
- name: c,
1518
- style: r[e]
1519
- };
1520
- t.getAttribute("hidden") && (l.hidden = i(t.getAttribute("hidden"))), t.getAttribute("iLevel") && (l.iLevel = parseInt(t.getAttribute("iLevel"))), n.push(l);
1521
- }
1522
- }
1523
- }
1524
- afterVisit(e, t, n) {}
1525
- }, Me = class extends B {
1526
- visit(e, t, n) {
1527
- return this.processSheetRefs(e, e.evaluate("sheets", t), n), this.processExternalReferences(e, e.evaluate("externalReferences", t), n), this.processBookViews(e, e.evaluate("bookViews", t), n), this.processDefinedNames(e, e.evaluate("definedNames", t), n), this.processCalcPr(e, e.evaluate("calcPr", t), n), this.processPivotCaches(e, e.evaluate("pivotCaches", t), n), this.processWorkbookProtection(e, e.evaluate("workbookProtection", t), n), this.processWorkbookPr(e, e.evaluate("workbookPr", t), n), n;
1528
- }
1529
- processPassword(e, t, n, r = "workbook", i = "password") {
1530
- if (!t) return;
1531
- let a = {};
1532
- e.copyFromAttribute(t, `${r}AlgorithmName`, a, "algorithm"), e.copyFromAttribute(t, `${r}HashValue`, a, "hash"), e.copyFromAttribute(t, `${r}SaltValue`, a, "salt"), e.copyFromAttribute(t, `${r}SpinCount`, a, "spinCount", e.INT_COPY), Object.keys(a).length > 0 && (n[i] = a);
1533
- }
1534
- processWorkbookProtection(e, n, i) {
1535
- if (!n) return;
1536
- let a = {};
1537
- this.processPassword(e, n, a, "workbook", "password"), this.processPassword(e, n, a, "revisions", "revisionsPassword");
1538
- for (let e of t) a[e.key] = r(e, n.getAttribute(e.attribute));
1539
- return i.protection = a, i;
1540
- }
1541
- processCalcPr(e, t, n) {
1542
- if (!t) return;
1543
- let r = {};
1544
- e.copyFromAttribute(t, "calcMode", r, "calcMode", (e) => le[e] ?? null), e.copyFromAttribute(t, "fullCalcOnLoad", r, "fullCalcOnLoad", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcOnSave", r, "calcOnSave", e.BOOLEAN_COPY), e.copyFromAttribute(t, "calcCompleted", r, "calcCompleted", e.BOOLEAN_COPY), e.copyFromAttribute(t, "fullPrecision", r, "fullPrecision", e.BOOLEAN_COPY), e.copyFromAttribute(t, "forceFullCalc", r, "forceFullCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "concurrentCalc", r, "concurrentCalc", e.BOOLEAN_COPY), e.copyFromAttribute(t, "refMode", r, "refMode"), e.copyFromAttribute(t, "iterate", r, "iterate", e.BOOLEAN_COPY), e.copyFromAttribute(t, "iterateCount", r, "maxIteration", e.INT_COPY), e.copyFromAttribute(t, "iterateDelta", r, "maxIterateChange", e.FLOAT_COPY);
1545
- let i = t.getAttribute("calcId");
1546
- i !== null && e.getVisitorParamsState().set("calcId", i), n.calc = r;
1547
- }
1548
- processSheetRefs(e, t, n) {
1549
- if (!t) return;
1550
- let r = [], i = t.childNodes, a = i.length;
1551
- for (let t = 0; t < a; t++) {
1552
- let n = i.item(t);
1553
- n.nodeType === 1 && n.localName === "sheet" && this.processSheetRef(e, n, r);
1554
- }
1555
- n.sheets = r;
1556
- }
1557
- processSheetRef(e, t, n) {
1558
- let r = {};
1559
- e.copyFromAttribute(t, "name", r, "name"), e.copyFromAttribute(t, "state", r, "visibility"), e.copyFromAttribute(t, "sheetId", r, "sheetId", e.INT_COPY);
1560
- let i = t.getAttribute("r:id"), a = e.getRef(i);
1561
- a && (r.sheet = a), n.push(r);
1562
- }
1563
- processExternalReferences(e, t, n) {
1564
- if (!t) return;
1565
- let r = [], i = t.childNodes, a = i.length;
1566
- for (let t = 0; t < a; t++) {
1567
- let n = i.item(t);
1568
- if (n.nodeType === 1 && n.localName === "externalReference") {
1569
- let t = n.getAttribute("r:id"), i = t ? e.getRef(t) : null;
1570
- r.push(i ?? null);
1571
- }
1572
- }
1573
- r.length > 0 && (n.externalBooks = r);
1574
- }
1575
- processPivotCaches(e, t, n) {
1576
- if (!t) return;
1577
- let r = [], i = t.childNodes, a = i.length;
1578
- for (let t = 0; t < a; t++) {
1579
- let n = i.item(t);
1580
- if (n.nodeType !== 1 || n.localName !== "pivotCache") continue;
1581
- let a = parseInt(n.getAttribute("cacheId") ?? "", 10), o = n.getAttribute("r:id");
1582
- if (isNaN(a) || !o) continue;
1583
- let s = e.readEmbeddedPart(o);
1584
- s && r.push({
1585
- cacheId: a,
1586
- part: s
1587
- });
1588
- }
1589
- r.length > 0 && (n.pivotCaches = r);
1590
- }
1591
- processBookViews(e, t, n) {
1592
- if (!t) return;
1593
- let r = t.childNodes, i = 0, a = r.length;
1594
- for (let t = 0; i < 1 && t < a; t++) {
1595
- let a = r.item(t);
1596
- a.nodeType === 1 && a.localName === "workbookView" && (this.processWorkbookView(e, a, n), i++);
1597
- }
1598
- }
1599
- processWorkbookView(e, t, n) {
1600
- if (!t) return;
1601
- let r = {};
1602
- e.copyFromAttribute(t, "activeTab", r, "activeSheetId", [e.INT_COPY, (e) => e]), t.hasAttribute("activeTab") || (r.activeSheetId = 0), e.copyFromAttribute(t, "showHorizontalScroll", r, "showHorizontalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showVerticalScroll", r, "showVerticalScrollbar", e.BOOLEAN_COPY), e.copyFromAttribute(t, "showSheetTabs", r, "showTabs", e.BOOLEAN_COPY), e.copyFromAttribute(t, "tabRatio", r, "tabRatio", [e.FLOAT_COPY, (e) => e]), Object.keys(r).length > 0 && (n.view = r);
1603
- }
1604
- processDefineName(e, t, n, r) {
1605
- if (!t) return;
1606
- let i = {}, a = t.firstChild;
1607
- if (a && a.nodeType === 3 && (i.ref = a.textContent), e.copyFromAttribute(t, "name", i), e.copyFromAttribute(t, "comment", i), e.copyFromAttribute(t, "hidden", i, "hidden", e.BOOLEAN_COPY), t.hasAttribute("localSheetId")) {
1608
- let n = t.getAttribute("localSheetId");
1609
- if (!r[n]?.name) return void e.warn(`Defined name '${t.getAttribute("name")}' references a sheet with localSheetId '${n}' which does not exist.`);
1610
- i.scope = r[n].name;
1611
- }
1612
- e.copyFromAttribute(t, "customMenu", i), e.copyFromAttribute(t, "description", i), e.copyFromAttribute(t, "statusBar", i), e.copyFromAttribute(t, "help", i), e.copyFromAttribute(t, "shortcutKey", i), e.copyFromAttribute(t, "function", i, "function", e.BOOLEAN_COPY), e.copyFromAttribute(t, "functionGroupId", i, "functionGroupId", e.INT_COPY), e.copyFromAttribute(t, "publishToServer", i, "publishToServer", e.BOOLEAN_COPY), e.copyFromAttribute(t, "vbProcedure", i, "vbProcedure", e.BOOLEAN_COPY), e.copyFromAttribute(t, "xlm", i, "xlm", e.BOOLEAN_COPY), Object.keys(i).length > 0 && n.push(i);
1613
- }
1614
- processDefinedNames(e, t, n) {
1615
- if (!t) return;
1616
- let r = [], i = t.childNodes, a = i.length;
1617
- for (let t = 0; t < a; t++) {
1618
- let a = i.item(t);
1619
- a.nodeType === 1 && a.localName === "definedName" && this.processDefineName(e, a, r, n.sheets);
1620
- }
1621
- r.length > 0 && (n.names = r);
1622
- }
1623
- processWorkbookPr(e, t, n) {
1624
- t && (e.copyFromAttribute(t, "date1904", n, "date1904", e.BOOLEAN_COPY), e.copyFromAttribute(t, "codeName", n, "codeName"), e.copyFromAttribute(t, "updateLinks", n, "updateLinks"));
1625
- }
1626
- afterVisit(e, t, n) {}
1627
- }, Ne = class {
1628
- visit(e, t, n) {
1629
- let r = {};
1630
- return e.copyFromAttribute(t, "ref", n, "r"), e.getVisitorParamsState().set("ref", n.r), n.v = r, e.copyFromAttribute(t, "name", r), e.copyFromAttribute(t, "displayName", r), e.copyFromAttribute(t, "headerRowCount", r, "headerRowCount", e.INT_COPY), e.copyFromAttribute(t, "totalsRowCount", r, "totalsRowCount", e.INT_COPY), this.processTableColumns(e, t, r), this.processTableStyleInfo(e, t, r), e.copyFromAttribute(t, "id", r), e.copyFromAttribute(t, "comment", r, "description"), e.copyFromAttribute(t, "connectionId", r, "connectionId", e.INT_COPY), e.copyFromAttribute(t, "tableType", r), e.copyFromAttribute(t, "published", r, "published", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRow", r, "insertRow", e.BOOLEAN_COPY), e.copyFromAttribute(t, "insertRowShift", r, "insertRowShift", e.BOOLEAN_COPY), r.totalsRowShown = t.getAttribute("totalsRowShown") !== "0", r;
1631
- }
1632
- afterVisit(e, t, n) {
1633
- let r = n.v;
1634
- if (e.evaluate("autoFilter", t)) {
1635
- if (Array.isArray(r.hiddenButtons)) {
1636
- let e = r.hiddenButtons.length;
1637
- e === 0 ? r.hiddenButtons = !1 : e === r.columns?.length && (r.hiddenButtons = !0);
1638
- }
1639
- } else r.hiddenButtons = !0, r.showButtons = !1;
1640
- return r;
1641
- }
1642
- processTableStyleInfo(e, t, n) {
1643
- if (!t) return;
1644
- let r = t.childNodes, i = {}, a = r.length;
1645
- for (let t = 0; t < a; t++) {
1646
- let n = r.item(t);
1647
- n.nodeType === 1 && n.localName === "tableStyleInfo" && (e.copyFromAttribute(n, "name", i), e.copyFromAttribute(n, "showColumnStripes", i, "showColumnStripes", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showFirstColumn", i, "showFirstColumn", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showLastColumn", i, "showLastColumn", e.BOOLEAN_COPY), e.copyFromAttribute(n, "showRowStripes", i, "showRowStripes", e.BOOLEAN_COPY));
1648
- }
1649
- Object.keys(i).length > 0 && (n.style = i);
1650
- }
1651
- processTableColumn(e, t, n) {
1652
- if (!t) return null;
1653
- let r = t.childNodes, i = r.length;
1654
- for (let t = 0; t < i; t++) {
1655
- let i = r.item(t);
1656
- if (i.nodeType === 1 && i.localName === "tableColumn") {
1657
- let t = {};
1658
- e.copyFromAttribute(i, "name", t), e.copyFromAttribute(i, "id", t), e.copyFromAttribute(i, "uniqueName", t), e.copyFromAttribute(i, "queryTableFieldId", t), e.copyFromAttribute(i, "totalsRowLabel", t);
1659
- let r = i.getAttribute("totalsRowFunction");
1660
- if (r !== null) if (r === "custom") {
1661
- let n = e.evaluate("totalsRowFormula", i);
1662
- n && (t.totalsRowFormula = n.textContent);
1663
- } else t.totalsRowFormula = r;
1664
- e.copyFromAttribute(i, "totalsRowLabel", t);
1665
- let a = e.evaluate("calculatedColumnFormula", i);
1666
- a?.textContent && (t.calculatedColumnFormula = a.textContent), n.push(t);
1667
- }
1668
- }
1669
- return n;
1670
- }
1671
- processTableColumns(e, t, n) {
1672
- let r = t.childNodes, i = [], a = r.length;
1673
- for (let t = 0; t < a; t++) {
1674
- let n = r.item(t);
1675
- n.nodeType === 1 && n.localName === "tableColumns" && this.processTableColumn(e, n, i);
1676
- }
1677
- i.length > 0 && (n.columns = i);
1678
- }
1679
- }, Pe = class {
1680
- visit(e, t, n) {
1681
- let r = e.getVisitorParamsState().get("ref");
1682
- if (r) {
1683
- let n = e.getVisitorParamsState().get("descriptions");
1684
- n && (n.add(r, t.getAttribute("altText")), n.add(r, t.getAttribute("altTextSummary")));
1685
- }
1686
- return e.copyFromAttribute(t, "altText", n), e.copyFromAttribute(t, "altTextSummary", n), n;
1687
- }
1688
- }, Fe = class {
1689
- visit(e, t, n) {
1690
- let r = t.childNodes, i = r.length, a = null;
1691
- for (let e = 0; e < i; e++) {
1692
- let t = r.item(e);
1693
- if (t.nodeType === 1) {
1694
- t.localName === "externalBook" && (a = t);
1695
- break;
1696
- }
1697
- }
1698
- if (!a) return n;
1699
- t.getAttribute("mc:Ignorable") && (n.mceIgnorable = !0);
1700
- let o = a.getAttribute("r:id");
1701
- o && (n.__bookRelId = o);
1702
- let s = this._findAbsoluteUrlRelId(a);
1703
- return s && (n.__absoluteUrlRelId = s), n.sheetNames = [], this.processSheetNames(e, a, n), this.processDefinedNames(e, a, n), this.processSheetDataSet(e, a, n), n;
1704
- }
1705
- processSheetNames(e, t, n) {
1706
- let r = this._findChild(t, "sheetNames");
1707
- if (!r) return;
1708
- let i = r.childNodes, a = i.length;
1709
- for (let e = 0; e < a; e++) {
1710
- let t = i.item(e);
1711
- t.nodeType === 1 && t.localName === "sheetName" && n.sheetNames.push(t.getAttribute("val") ?? "");
1712
- }
1713
- }
1714
- processDefinedNames(e, t, n) {
1715
- let r = this._findChild(t, "definedNames");
1716
- if (!r) return;
1717
- let i = [], a = r.childNodes, o = a.length;
1718
- for (let e = 0; e < o; e++) {
1719
- let t = a.item(e);
1720
- if (t.nodeType !== 1 || t.localName !== "definedName") continue;
1721
- let n = t.getAttribute("name");
1722
- if (!n) continue;
1723
- let r = {
1724
- name: n,
1725
- refersTo: t.getAttribute("refersTo") ?? ""
1726
- }, o = t.getAttribute("sheetId");
1727
- o !== null && (r.sheetIndex = parseInt(o, 10)), i.push(r);
1728
- }
1729
- i.length > 0 && (n.definedNames = i);
1730
- }
1731
- processSheetDataSet(e, t, n) {
1732
- let r = this._findChild(t, "sheetDataSet");
1733
- if (!r) return;
1734
- let i = [], a = r.childNodes, o = a.length;
1735
- for (let t = 0; t < o; t++) {
1736
- let n = a.item(t);
1737
- if (n.nodeType !== 1 || n.localName !== "sheetData") continue;
1738
- let r = n.getAttribute("sheetId");
1739
- if (r === null) continue;
1740
- let o = this.processSheetData(e, n);
1741
- o.sheetIndex = parseInt(r, 10), n.getAttribute("refreshError") === "1" && (o.refreshError = !0), i.push(o);
1742
- }
1743
- i.length > 0 && (n.sheetDataSet = i);
1744
- }
1745
- processSheetData(e, t) {
1746
- let n = new ee.Builder(), r = t.childNodes, i = r.length;
1747
- for (let e = 0; e < i; e++) {
1748
- let t = r.item(e);
1749
- if (t.nodeType !== 1 || t.localName !== "row") continue;
1750
- let i = t.childNodes, a = i.length;
1751
- for (let e = 0; e < a; e++) {
1752
- let t = i.item(e);
1753
- if (t.nodeType !== 1 || t.localName !== "cell") continue;
1754
- let r = t.getAttribute("r");
1755
- if (!r) continue;
1756
- let a = m.fastStringToCell(r);
1757
- if (a?.rowIndex === void 0 || a?.colIndex === void 0) continue;
1758
- let o = this._readCellValue(t);
1759
- o !== void 0 && n.pushAt(a.rowIndex, a.colIndex, o);
1760
- }
1761
- }
1762
- return {
1763
- sheetIndex: -1,
1764
- data: n.build()?.tuples ?? []
1765
- };
1766
- }
1767
- _readCellValue(e) {
1768
- let t = this._findChild(e, "v")?.textContent?.trim();
1769
- if (t !== void 0 && t !== "") switch (e.getAttribute("t")) {
1770
- case null:
1771
- case "n": return parseFloat(t);
1772
- case "b": return t === "1" || t === "true";
1773
- case "str":
1774
- default: return t;
1775
- case "e": {
1776
- let e = h.getBuiltInByLabel(t);
1777
- return e ? {
1778
- t: "e",
1779
- v: e.getCode()
1780
- } : t;
1781
- }
1782
- }
1783
- }
1784
- _findChild(e, t) {
1785
- let n = e.childNodes, r = n.length;
1786
- for (let e = 0; e < r; e++) {
1787
- let r = n.item(e);
1788
- if (r.nodeType === 1 && r.localName === t) return r;
1789
- }
1790
- return null;
1791
- }
1792
- _findAbsoluteUrlRelId(e) {
1793
- let t = this._findChild(e, "alternateUrls");
1794
- return t ? this._findChild(t, "absoluteUrl")?.getAttribute("r:id") ?? null : null;
1795
- }
1796
- }, Ie = class {
1797
- visit(e, t, n) {
1798
- e.copyFromAttribute(t, "name", n), e.copyFromAttribute(t, "sourceName", n);
1799
- let r = e.evaluate("*/tableSlicerCache", t);
1800
- return r ? (e.copyFromAttribute(r, "tableId", n), e.copyFromAttribute(r, "column", n, "columnId"), e.copyFromAttribute(r, "crossFilter", n), n) : (e.warn("A slicer names no table; it was not imported.", { onceKey: "xlsx.slicer.cacheDefinition" }), n);
1801
- }
1802
- }, Le = class {
1803
- visit(e, t, n) {
1804
- let r = n.slicers;
1805
- r || (r = {}, n.slicers = r);
1806
- let i = t.childNodes, a = i.length;
1807
- for (let t = 0; t < a; t++) {
1808
- let n = i.item(t);
1809
- n.nodeType === 1 && n.localName === "slicer" && this.processSlicer(e, n, r);
1810
- }
1811
- return r;
1812
- }
1813
- processSlicer(e, t, n) {
1814
- if (!t) return;
1815
- let r = {};
1816
- n[t.getAttribute("name")] = r;
1817
- let i = t.getAttribute("cache"), a = e.getVisitorParamsState().get("slicerCaches");
1818
- if (i) {
1819
- let e = a.get(i);
1820
- e && (r.columnId = e.columnId, r.tableId = e.tableId);
1821
- }
1822
- e.copyFromAttribute(t, "caption", r), e.copyFromAttribute(t, "startItem", r, "startItem", e.INT_COPY), e.copyFromAttribute(t, "columnCount", r, "columnCount", e.INT_COPY), e.copyFromAttribute(t, "showCaption", r, "showCaption", e.BOOLEAN_COPY), e.copyFromAttribute(t, "level", r, "level", e.INT_COPY), e.copyFromAttribute(t, "style", r), e.copyFromAttribute(t, "locked", r, "locked", e.BOOLEAN_COPY), e.copyFromAttribute(t, "rowHeight", r, "rowHeight", e.INT_COPY);
1823
- }
1824
- }, Re = class {
1825
- visit(e, t, n) {
1826
- return n;
1827
- }
1828
- }, Q = class {
1829
- visit(e, t, n) {
1830
- if (!t) return;
1831
- let r = {};
1832
- return e.copyFromAttribute(t, "editAs", r, "anchorType"), r.anchor = {}, t.localName === "absoluteAnchor" ? (r.anchorType = "absolute", this.processAbsoluteCoord(e, e.evaluate("xdr:pos", t), r.anchor, "from", "x", "y"), this.processAbsoluteCoord(e, e.evaluate("xdr:ext", t), r.anchor, "to", "cx", "cy")) : t.localName === "oneCellAnchor" ? (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processAbsoluteCoord(e, e.evaluate("xdr:ext", t), r.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(e, e.evaluate("from", t), r.anchor, "from"), this.processOffsetCoord(e, e.evaluate("to", t), r.anchor, "to")), n.movables ||= [], n.movables.push(r), r;
1833
- }
1834
- processAbsoluteCoord(e, t, n, r, i, a) {
1835
- if (!t) return;
1836
- let o = {
1837
- x: 0,
1838
- y: 0
1839
- };
1840
- return o.x = d(t.getAttribute(i)), o.y = d(t.getAttribute(a)), r === "from" ? n.tl = o : n.br = o, n;
1841
- }
1842
- processOffsetCoord(e, t, n, r) {
1843
- if (!t) return;
1844
- let i = {
1845
- c: 0,
1846
- r: 0,
1847
- x: 0,
1848
- y: 0
1849
- };
1850
- return e.evaluate("col", t) && (i.c = parseInt(e.evaluate("col", t).textContent)), e.evaluate("row", t) && (i.r = parseInt(e.evaluate("row", t).textContent)), e.evaluate("colOff", t) && (i.x = d(e.evaluate("colOff", t).textContent)), e.evaluate("rowOff", t) && (i.y = d(e.evaluate("rowOff", t).textContent)), r === "from" ? n.tl = i : n.br = i, n;
1851
- }
1852
- }, ze = class extends H {
1853
- visit(e, t, n) {
1854
- if (!t) return;
1855
- n = super.visit(e, t, n);
1856
- let r = e.evaluate("nvGraphicFramePr/cNvGraphicFramePr", t);
1857
- if (r) {
1858
- let t = e.evaluate("graphicFrameLocks", r);
1859
- if (t) {
1860
- t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
1861
- let e = {};
1862
- Object.keys(e).length > 0 && (n.locks = e);
1863
- }
1864
- }
1865
- let i = {
1866
- type: "graphicFrame",
1867
- json: {}
1868
- }, a = e.evaluate("graphic/graphicData", t).childNodes, o = a.length;
1869
- for (let n = 0; n < o; n++) {
1870
- let r = a.item(n);
1871
- if (r.nodeType === 1) try {
1872
- let n = r.localName;
1873
- n === "chart" ? n = "chart" : n === "slicer" && (n = "slicer"), i.type = n;
1874
- let a = r.getAttribute("r:id");
1875
- if (n === "chart" && a) {
1876
- let n = e.evaluate("*/cNvPr", t);
1877
- n?.item && (n = n.item(0));
1878
- let r = n?.getAttribute?.("id"), o = r ? parseInt(r, 10) : void 0;
1879
- i.json = {
1880
- xml: e.serializeElement(t) ?? void 0,
1881
- sourceId: o === void 0 || isNaN(o) ? void 0 : o,
1882
- part: e.readEmbeddedPart(a) ?? void 0
1883
- };
1884
- } else a && (i.json = e.getRef(a));
1885
- } catch (t) {
1886
- e.warn(`Unable to read a graphic frame: ${t?.message ?? t}`, { onceKey: "xlsx.drawing.graphicFrame" });
1887
- }
1888
- }
1889
- return i && (n.content = i), i;
1890
- }
1891
- }, Be = U, Ve = class extends H {
1892
- visit(e, t, n) {
1893
- if (!t) return;
1894
- let r = super.visit(e, t, n), i = e.evaluate("nvPicPr/cNvPicPr", t);
1895
- if (i) {
1896
- e.copyFromAttribute(t, "preferRelativeResize", r, "preferRelativeResize", e.BOOLEAN_COPY);
1897
- let n = e.evaluate("picLocks", i);
1898
- if (n) {
1899
- n.hasAttribute("noChangeAspect") && (r.lockAspect = n.getAttribute("noChangeAspect") === "1");
1900
- let t = {};
1901
- e.copyFromAttribute(n, "noChangeArrowheads", r, "noChangeArrowheads", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noChangeShapeType", r, "noChangeShapeType", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noEditPoints", r, "noEditPoints", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noAdjustHandles", r, "noAdjustHandles", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noCrop", r, "noCrop", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noGrp", r, "noGrp", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noMove", r, "noMove", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noResize", r, "noResize", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noRot", r, "noRot", e.BOOLEAN_COPY), e.copyFromAttribute(n, "noSelect", r, "noSelect", e.BOOLEAN_COPY), Object.keys(t).length > 0 && (r.locks = t);
1902
- }
1903
- }
1904
- let a = e.evaluate("blipFill/blip", t), o;
1905
- if (a) {
1906
- let t;
1907
- if (t = a.getAttribute("r:embed") ?? a.getAttribute("embed"), t ||= a.getAttribute("r:link") ?? a.getAttribute("link"), !t) return void e.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" });
1908
- o = e.getRef(t, !0);
1909
- }
1910
- return n.content = {
1911
- type: "picture",
1912
- json: { resId: o }
1913
- }, r;
1914
- }
1915
- }, He = class extends U {
1916
- visit(e, t, n) {
1917
- if (!t) return;
1918
- n = super.visit(e, t, n);
1919
- let r = e.evaluate("nvGrpSpPr/cNvGrpSpPr", t);
1920
- if (r) {
1921
- let t = e.evaluate("grpSpLocks", r);
1922
- if (t) {
1923
- t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
1924
- let e = {};
1925
- Object.keys(e).length > 0 && (n.locks = e);
1926
- }
1927
- }
1928
- e.warn(`Unable to import '${n.name}', group shapes are not supported.`);
1929
- let i = {};
1930
- return n.content = {
1931
- type: "grpSp",
1932
- json: i
1933
- }, i;
1934
- }
1935
- }, Ue = class extends U {
1936
- visit(e, t, n) {
1937
- if (!t) return;
1938
- n = super.visit(e, t, n);
1939
- let r = e.evaluate("nvCxnSpPr/cNvCxnSpPr", t);
1940
- if (r) {
1941
- let t = e.evaluate("cxnSpLocks", r);
1942
- if (t) {
1943
- t.hasAttribute("noChangeAspect") && (n.lockAspect = t.getAttribute("noChangeAspect") === "1");
1944
- let e = {};
1945
- Object.keys(e).length > 0 && (n.locks = e);
1946
- }
1947
- }
1948
- let i = e.evaluate("*/cNvPr", t);
1949
- i?.item && (i = i.item(0));
1950
- let a = i?.getAttribute?.("id"), o = a ? parseInt(a, 10) : void 0, s = {
1951
- type: "cxnSp",
1952
- xml: e.serializeElement(t) ?? void 0,
1953
- sourceId: o === void 0 || isNaN(o) ? void 0 : o
1954
- };
1955
- return n.content = {
1956
- type: "cxnSp",
1957
- json: s
1958
- }, s;
1959
- }
1960
- }, We = class {
1961
- visit(e, t, n) {
1962
- let r = [], i = /* @__PURE__ */ new Map(), a = {
1963
- cells: [],
1964
- values: []
1965
- }, o = t.childNodes;
1966
- for (let e = 0; e < o.length; e++) {
1967
- let t = o.item(e);
1968
- if (t.nodeType === 1) switch (t.localName) {
1969
- case "metadataTypes":
1970
- this._parseMetadataTypes(t, r, i);
1971
- break;
1972
- case "futureMetadata":
1973
- this._attachFutureMetadata(t, i);
1974
- break;
1975
- case "cellMetadata":
1976
- this._resolveBlocks(t, r, a.cells);
1977
- break;
1978
- case "valueMetadata": this._resolveBlocks(t, r, a.values);
1979
- }
1980
- }
1981
- return n.metadata = a, a;
1982
- }
1983
- _parseMetadataTypes(e, t, n) {
1984
- let r = e.childNodes;
1985
- for (let e = 0; e < r.length; e++) {
1986
- let i = r.item(e);
1987
- if (i.nodeType === 1 && i.localName === "metadataType") {
1988
- let e = this._parseMetadataType(i);
1989
- t.push(e), n.set(e.name, e);
1990
- }
1991
- }
1992
- }
1993
- _parseMetadataType(e) {
1994
- let t = {
1995
- name: e.getAttribute("name") ?? "",
1996
- _blocks: []
1997
- }, n = e.getAttribute("minSupportedVersion");
1998
- n != null && (t.minSupportedVersion = Number(n));
1999
- for (let n of [
2000
- "copy",
2001
- "pasteAll",
2002
- "pasteValues",
2003
- "merge",
2004
- "splitFirst",
2005
- "splitAll",
2006
- "rowColShift",
2007
- "clearFormats",
2008
- "clearComments",
2009
- "assign",
2010
- "coerce",
2011
- "cellMeta",
2012
- "adjust",
2013
- "trans",
2014
- "delete",
2015
- "edit"
2016
- ]) e.getAttribute(n) === "1" && (t[n] = !0);
2017
- return t;
2018
- }
2019
- _attachFutureMetadata(e, t) {
2020
- let n = e.getAttribute("name") ?? "", r = t.get(n);
2021
- if (!r) return;
2022
- let i = e.childNodes;
2023
- for (let e = 0; e < i.length; e++) {
2024
- let t = i.item(e);
2025
- t.nodeType === 1 && t.localName === "bk" && r._blocks.push(this._parseFutureBlock(t));
2026
- }
2027
- }
2028
- _parseFutureBlock(e) {
2029
- let t = {}, n = e.childNodes;
2030
- for (let e = 0; e < n.length; e++) {
2031
- let r = n.item(e);
2032
- if (r.nodeType !== 1 || r.localName !== "extLst") continue;
2033
- let i = r.childNodes;
2034
- for (let e = 0; e < i.length; e++) {
2035
- let n = i.item(e);
2036
- if (n.nodeType !== 1 || n.localName !== "ext") continue;
2037
- let r = n.childNodes;
2038
- for (let e = 0; e < r.length; e++) {
2039
- let n = r.item(e);
2040
- n.nodeType === 1 && (n.localName === "dynamicArrayProperties" ? (t.fDynamic = n.getAttribute("fDynamic") === "1", t.fCollapsed = n.getAttribute("fCollapsed") === "1") : n.localName === "rvb" && (t.richValueIndex = Number(n.getAttribute("i") ?? "0")));
2041
- }
2042
- }
2043
- }
2044
- return t;
2045
- }
2046
- _resolveBlocks(e, t, n) {
2047
- let r = e.childNodes;
2048
- for (let e = 0; e < r.length; e++) {
2049
- let i = r.item(e);
2050
- i.nodeType === 1 && i.localName === "bk" && n.push(this._resolveBlock(i, t));
2051
- }
2052
- }
2053
- _resolveBlock(e, t) {
2054
- let n = /* @__PURE__ */ new Map(), r = e.childNodes;
2055
- for (let e = 0; e < r.length; e++) {
2056
- let i = r.item(e);
2057
- if (i.nodeType !== 1 || i.localName !== "rc") continue;
2058
- let a = Number(i.getAttribute("t")), o = Number(i.getAttribute("v")), s = t[a - 1];
2059
- if (!s) continue;
2060
- let { _blocks: c, ...l } = s, u = { ...l };
2061
- for (let e of Object.keys(u)) u[e] === void 0 && delete u[e];
2062
- let d = c[o];
2063
- d && (d.fDynamic !== void 0 && (u.fDynamic = d.fDynamic, u.fCollapsed = d.fCollapsed ?? !1), d.richValueIndex !== void 0 && (u.richValueIndex = d.richValueIndex)), n.set(s.name, u);
2064
- }
2065
- return n;
2066
- }
2067
- }, $ = class {
2068
- visit(e, t, n) {
2069
- let r = e.getVisitorParamsState().get(W);
2070
- r || (r = [], e.getVisitorParamsState().set(W, r));
2071
- let i = t.childNodes, a = i.length;
2072
- for (let t = 0; t < a; t++) {
2073
- let n = i.item(t);
2074
- if (n.nodeType === 1 && n.localName === "s") {
2075
- let t = {
2076
- type: n.getAttribute("t") ?? "n",
2077
- keys: []
2078
- };
2079
- this.processKeys(e, n, t), r.push(t);
2080
- }
2081
- }
2082
- return n.richTypes = r, r;
2083
- }
2084
- processKeys(e, t, n) {
2085
- let r = t.childNodes, i = r.length, a = n.keys;
2086
- for (let e = 0; e < i; e++) {
2087
- let t = r.item(e);
2088
- if (t.nodeType === 1 && t.localName === "k") {
2089
- let e = t.getAttribute("n"), n = t.getAttribute("t");
2090
- a.push([e, n]);
2091
- }
2092
- }
2093
- }
2094
- }, Ge = class {
2095
- visit(e, t, n) {
2096
- let r = e.getVisitorParamsState().get("richTypes");
2097
- if (!r) return void e.warn("RichValueFound but not type.");
2098
- let i = e.getVisitorParamsState().get(G);
2099
- i || (i = [], e.getVisitorParamsState().set(G, i));
2100
- let a = t.childNodes, o = a.length;
2101
- for (let t = 0; t < o; t++) {
2102
- let n = a.item(t);
2103
- if (n.nodeType === 1 && n.localName === "rv") {
2104
- let t = r[n.getAttribute("s")], a = { type: t.type };
2105
- this.processValues(e, n, a, t);
2106
- let o = this.mapType(e, a);
2107
- i.push(o);
2108
- }
2109
- }
2110
- return n.richData = i, i;
2111
- }
2112
- mapType(e, t) {
2113
- if (t.type === "_error") {
2114
- let e = t.errorType;
2115
- if (e) try {
2116
- t = h.getBuiltInByCode(e + 1) ?? h.BuiltIn.Unknown;
2117
- } catch {}
2118
- }
2119
- return t;
2120
- }
2121
- processValues(e, t, n, r) {
2122
- let i = t.childNodes, a = i.length;
2123
- r.type;
2124
- let o = r.keys;
2125
- for (let t = 0; t < a; t++) {
2126
- let r = i.item(t);
2127
- if (r.nodeType === 1 && r.localName === "v") {
2128
- let i = o[t];
2129
- if (!i) return void e.warn("Invalid richData");
2130
- let a = i[0], s = i[1], c = r.textContent;
2131
- s === "i" && (c = Number(c)), n[a] = c;
2132
- }
2133
- }
2134
- }
2135
- }, Ke = class {
2136
- visit(e, t, n) {
2137
- if (!t) return;
2138
- let r = [];
2139
- this.processAuthors(e, e.evaluate("authors", t), r), r.length > 0 && (n.authors = r);
2140
- let i = [];
2141
- return n.comments = i, i;
2142
- }
2143
- processAuthors(e, t, n) {
2144
- if (!t) return;
2145
- let r = t.childNodes, i = r.length;
2146
- for (let e = 0; e < i; e++) {
2147
- let t = r.item(e);
2148
- if (t.nodeType === 1 && t.localName === "author") {
2149
- let e = t.firstChild;
2150
- e && e.nodeType === 3 && n.push(e.textContent);
2151
- }
2152
- }
2153
- }
2154
- }, qe = class {
2155
- visit(e, t, n) {
2156
- if (!t) return;
2157
- let r = t.getAttribute("ref");
2158
- if (!r) return;
2159
- let i = { content: "" };
2160
- if (t.hasAttribute("authorId")) {
2161
- let e = parseInt(t.getAttribute("authorId"), 10);
2162
- isNaN(e) || (i.authorId = e);
2163
- }
2164
- return i.content = function(e) {
2165
- if (!e) return "";
2166
- let t = [], n = !0, r = e.childNodes;
2167
- for (let e = 0; e < r.length; e++) {
2168
- let i = r.item(e);
2169
- if (i.nodeType === 1) {
2170
- if (i.localName === "t") t.push({ text: i.textContent ?? "" });
2171
- else if (i.localName === "r") {
2172
- let e = { text: "" }, r = i.childNodes;
2173
- for (let t = 0; t < r.length; t++) {
2174
- let n = r.item(t);
2175
- n.nodeType === 1 && (n.localName === "t" ? e.text += n.textContent ?? "" : n.localName === "rPr" && ue(n, e));
2176
- }
2177
- Object.keys(e).length > 1 && (n = !1), t.push(e);
2178
- }
2179
- }
2180
- }
2181
- return t.length === 0 ? e.textContent ?? "" : n ? t.map((e) => e.text).join("") : { runs: t };
2182
- }(e.evaluate("text", t)), n.push({
2183
- r,
2184
- v: i
2185
- }), i;
2186
- }
2187
- }, Je = class {
2188
- visit(e, t, n) {
2189
- if (!t) return;
2190
- let r = [];
2191
- return n.comments = r, r;
2192
- }
2193
- }, Ye = class {
2194
- visit(e, t, n) {
2195
- if (!t) return;
2196
- let r = {};
2197
- e.copyFromAttribute(t, "id", r, "id", s);
2198
- let a = t.getAttribute("ref");
2199
- return e.copyFromAttribute(t, "personId", r, "personId", s), e.copyFromAttribute(t, "parentId", r, "parentId", s), e.copyFromAttribute(t, "dT", r, "dt"), t.hasAttribute("done") && (r.done = i(t.getAttribute("done"))), n.push({
2200
- r: a,
2201
- v: r
2202
- }), r;
2203
- }
2204
- }, Xe = class {
2205
- visit(e, t, n) {
2206
- let r = [], i = t.childNodes, a = i.length;
2207
- for (let t = 0; t < a; t++) {
2208
- let n = i.item(t);
2209
- if (n.nodeType === 1 && n.localName === "person") {
2210
- let t = {};
2211
- e.copyFromAttribute(n, "id", t, "id", s), e.copyFromAttribute(n, "displayName", t), e.copyFromAttribute(n, "userId", t, "userId", s), e.copyFromAttribute(n, "providerId", t), r.push(t);
2212
- }
2213
- }
2214
- return r.length > 0 && (n.persons = r), r;
2215
- }
2216
- }, Ze = class {
2217
- constructor(e, t) {
2218
- this.path = e, this.visitor = t;
2219
- }
2220
- }, Qe = class {
2221
- constructor() {
2222
- this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new de()), this.registerVisitor("cp:coreProperties", new fe()), this.registerVisitor("Properties", new pe()), this.registerVisitor("spPr", new ge()), this.registerVisitor("txBody", new Y()), this.registerVisitor("txPr", new Y()), this.registerVisitor("c:chartSpace", new me()), this.registerVisitor("c:plotArea", new he()), this.registerVisitor("c:barChart", new _e()), this.registerVisitor("c:doughnutChart", new K()), this.registerVisitor("c:lineChart", new K()), this.registerVisitor("c:ofPieType", new K()), this.registerVisitor("c:pieChart", new K()), this.registerVisitor("c:scatterChart", new K()), this.registerVisitor("c:barChart", new q("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new q("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new q("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new q("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new q("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new q("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new ve()), this.registerVisitor("c:dPt", new ye()), this.registerVisitor("c:marker", new be()), this.registerVisitor("c:catAx", new J()), this.registerVisitor("c:valAx", new J()), this.registerVisitor("c:dateAx", new J()), this.registerVisitor("c:majorGridlines", new P("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new P("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new Y("labels.text"), "txPr"), this.registerVisitor("c:valAx", new Y("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new Y("labels.text"), "txPr"), this.registerVisitor("c:legend", new Se()), this.registerVisitor("c:legend", new Y("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new xe()), this.registerVisitor("c:ser", new Ce(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new q("labels"), "dLbls"), this.registerVisitor("c:dLbl", new q("points")), this.registerVisitor("c:title", new X()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new we()), this.registerVisitor("c:dispUnits", new P("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new X("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new Y(), "tx/rich"), this.registerVisitor("a:theme", new Te()), this.registerVisitor("a:theme", new Ee(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new De(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new Oe(), "themeElements/fmtScheme"), this.registerVisitor("autoFilter", new Ae()), this.registerVisitor("sortState", new je()), this.registerVisitor("s:workbook", new Me()), this.registerVisitor("styleSheet", new Z()), this.registerVisitor("x14:table", new Pe()), this.registerVisitor("table", new Ne()), this.registerVisitor("externalLink", new Fe()), this.registerVisitor("hlinkClick", new ke()), this.registerVisitor("wsDr", new Re()), this.registerVisitor("twoCellAnchor", new Q()), this.registerVisitor("oneCellAnchor", new Q()), this.registerVisitor("absoluteAnchor", new Q()), this.registerVisitor("graphicFrame", new ze()), this.registerVisitor("sp", new Be()), this.registerVisitor("grpSp", new He()), this.registerVisitor("cxnSp", new Ue()), this.registerVisitor("pic", new Ve()), this.registerVisitor("metadata", new We()), this.registerVisitor("rvStructures", new $()), this.registerVisitor("rvData", new Ge()), this.registerVisitor("comments", new Ke()), this.registerVisitor("comment", new qe()), this.registerVisitor("ThreadedComments", new Je()), this.registerVisitor("threadedComment", new Ye()), this.registerVisitor("threadedComment", new Y("content"), "text"), this.registerVisitor("personList", new Xe()), this.registerVisitor("slicerCacheDefinition", new Ie()), this.registerVisitor("slicers", new Le());
2223
- }
2224
- registerVisitor(e, t, n = null) {
2225
- e.indexOf(":") === -1 && (e = "*:" + e);
2226
- let r = e.split(":"), i = r.length > 1 ? r[1] : r[0];
2227
- if (!n) return this.visitorsByXmlTagName.set(i, t), void this.visitorsByXmlTagName.set(e, t);
2228
- let a = this.scopedVisitorsByXmlTagName.get(i);
2229
- a || (a = [], this.scopedVisitorsByXmlTagName.set(i, a), this.scopedVisitorsByXmlTagName.set(e, a)), a.push(new Ze(n, t));
2230
- }
2231
- parseDxf(e, t = "", n = p.EmptyObject) {
2232
- this.visitorParamsState ||= /* @__PURE__ */ new Map();
2233
- let r = this.visitorParamsState, i = r.get("processingDXFs");
2234
- r.set("processingDXFs", !0);
2235
- try {
2236
- let r = new T(null, this, "/dxf", e, {}, t, n), i = {};
2237
- return new Z().processDXF(r, e, i), i;
2238
- } finally {
2239
- i === void 0 ? r.delete("processingDXFs") : r.set("processingDXFs", i);
2240
- }
2241
- }
2242
- getVisitorParamsState() {
2243
- return this.visitorParamsState;
2244
- }
2245
- transform(e, t, n = p.EmptyObject) {
2246
- let r = e.documentElement;
2247
- this.visitorParamsState && !n?.paramMap || (this.visitorParamsState = n?.paramMap ?? /* @__PURE__ */ new Map());
2248
- let i = {}, a = this.visitorsByXmlTagName.get(r.nodeName);
2249
- if (a ||= this.visitorsByXmlTagName.get(r.localName), !a) throw Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
2250
- let o = "/" + r.localName, s = new T(null, this, o, r, i, t, n), c = [];
2251
- this._doWalk(a, s, c, r, i, t, n);
2252
- let l = c.length;
2253
- for (let e = 0; e < l; e++) {
2254
- let t = c[e];
2255
- try {
2256
- t.visitor?.afterVisit?.(t.context, t.elemParent, t.jsonParent);
2257
- } catch (e) {
2258
- t.context.warn(`Unable to finish reading '${t.context.getPath()}': ${e?.message ?? e}`, { onceKey: "xlsx.transform.afterVisit" });
2259
- }
2260
- }
2261
- return i;
2262
- }
2263
- _walkScoped(e, t, n, r, i, a, o) {
2264
- let s = this.scopedVisitorsByXmlTagName.get(e), c = s ? s.length : 0;
2265
- for (let l = 0; l < c; l++) {
2266
- let c = s[l], u = null;
2267
- try {
2268
- u = t.evaluate(c.path, r);
2269
- } catch {
2270
- t.warn(`Invalid path '${c.path}' for '${e}'.`, { onceKey: "xlsx.transform.invalidPath" });
2271
- }
2272
- if (!u) continue;
2273
- let d = (e) => {
2274
- let s = e.localName, l = e.parentNode;
2275
- for (; l && l !== r;) s = l.localName + "/" + s, l = l.parentNode;
2276
- let u = t.getPath() + "/" + s;
2277
- if (c.visitor) {
2278
- let r = new T(t, this, u, t.getElemRoot(), t.getJsonRoot(), a, o);
2279
- this._doWalk(c.visitor, r, n, e, i, a, o);
2280
- }
2281
- };
2282
- if (u.length > 0) {
2283
- let e = u, t = e.length;
2284
- for (let n = 0; n < t; n++) d(e.item(n));
2285
- } else d(u);
2286
- }
2287
- }
2288
- _doWalk(e, t, n, r, i, a, o) {
2289
- let s = null;
2290
- e && (n.push({
2291
- visitor: e,
2292
- context: t,
2293
- elemParent: r,
2294
- jsonParent: i
2295
- }), s = e.visit(t, r, i)), s ||= i;
2296
- let c = r.localName;
2297
- this._walkScoped(c, t, n, r, s, a, o);
2298
- let l = this.visitorsByXmlTagName, u = t.getElemRoot(), d = t.getJsonRoot(), f = r.childNodes, p = f.length;
2299
- for (let e = 0; e < p; e++) {
2300
- let r = f.item(e);
2301
- if (r.nodeType !== 1) continue;
2302
- let c = r, p = c.nodeName, m = l.get(p);
2303
- m ||= (p = c.localName, l.get(p));
2304
- let h = t.getPath() + "/" + p, g = new T(t, this, h, u, d, a, o);
2305
- this._doWalk(m, g, n, c, s ?? i, a, o);
2306
- }
2307
- return s;
2308
- }
2309
- };
2310
- export { Qe as DOMTransformer, T as ExecutionContext, u as NumberUtils, oe as VisitorUtils };