@sheetxl/io-xlsx 0.7.23-beta.1

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 (340) hide show
  1. package/LICENSE.md +11 -0
  2. package/README.md +23 -0
  3. package/browser/cjs/5QaWZ2tRVhz1rf3W.cjs +1 -0
  4. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +1 -0
  5. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +1 -0
  6. package/browser/cjs/BE7AtU1GCShmJ8Yu.cjs +1 -0
  7. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +6 -0
  8. package/browser/cjs/Chkqh5BZ-MJjAcPF.cjs +5 -0
  9. package/browser/cjs/D-8WoJkvdPf-79sB.cjs +2 -0
  10. package/browser/cjs/D5Y4KQhKdukOkjvA.cjs +2 -0
  11. package/browser/cjs/DWkuoJSgvcXJTdN1.cjs +1 -0
  12. package/browser/cjs/index.cjs +1 -0
  13. package/browser/cjs/sEmMmxaNBSY_o-Zb.cjs +1 -0
  14. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +1 -0
  15. package/browser/esm/B20zuEvdeypuSU5s.mjs +3851 -0
  16. package/browser/esm/BVAAJynubTdvPOQA.mjs +24 -0
  17. package/browser/esm/CLo2oPoIised6GbD.mjs +3617 -0
  18. package/browser/esm/COSdjubnJ_UgB-Gr.mjs +111 -0
  19. package/browser/esm/CS1t46OUALKkZxTa.mjs +494 -0
  20. package/browser/esm/CS8eRkAhoCN8KdGO.mjs +52 -0
  21. package/browser/esm/CcXnQZ4Fk_nkbq2G.mjs +99 -0
  22. package/browser/esm/Ch5gA6g56cOtRvJA.mjs +2193 -0
  23. package/browser/esm/DRuB-nlH4kq_OQJ5.mjs +196 -0
  24. package/browser/esm/DoKP-E832M9vPWgU.mjs +4675 -0
  25. package/browser/esm/XoDWB6uCJVrra-pE.mjs +2623 -0
  26. package/browser/esm/index.mjs +8 -0
  27. package/licenses/dependencies.txt +60 -0
  28. package/node/esm/B3Hb3GSFs_FIoXoI.mjs +209 -0
  29. package/node/esm/BqwG-e5ddQ45fg8w.mjs +2702 -0
  30. package/node/esm/C81WoKHbCRwhcHWd.mjs +2413 -0
  31. package/node/esm/CIzCy_gyysEIa_HI.mjs +3700 -0
  32. package/node/esm/CL8002u21KKQkkL0.mjs +108 -0
  33. package/node/esm/DF893ovKIDS88O7b.mjs +2237 -0
  34. package/node/esm/DTuPlHBTHnbLGvxd.mjs +504 -0
  35. package/node/esm/DVJuJqAXDwgA-ge8.mjs +118 -0
  36. package/node/esm/index.mjs +52 -0
  37. package/package.json +55 -0
  38. package/types/index.d.ts +2 -0
  39. package/types/src/ConditionalFormatRules.d.ts +86 -0
  40. package/types/src/ConditionalFormatRules.d.ts.map +1 -0
  41. package/types/src/DataValidationRules.d.ts +59 -0
  42. package/types/src/DataValidationRules.d.ts.map +1 -0
  43. package/types/src/ExcelCompat.d.ts +142 -0
  44. package/types/src/ExcelCompat.d.ts.map +1 -0
  45. package/types/src/ExcelFunctionFacts.d.ts +375 -0
  46. package/types/src/ExcelFunctionFacts.d.ts.map +1 -0
  47. package/types/src/ExcelReservedNames.d.ts +67 -0
  48. package/types/src/ExcelReservedNames.d.ts.map +1 -0
  49. package/types/src/LegacyFormula.d.ts +74 -0
  50. package/types/src/LegacyFormula.d.ts.map +1 -0
  51. package/types/src/OOXMLEscape.d.ts +28 -0
  52. package/types/src/OOXMLEscape.d.ts.map +1 -0
  53. package/types/src/OOXMLExtensions.d.ts +53 -0
  54. package/types/src/OOXMLExtensions.d.ts.map +1 -0
  55. package/types/src/OperandLiterals.d.ts +34 -0
  56. package/types/src/OperandLiterals.d.ts.map +1 -0
  57. package/types/src/Plugin.d.ts +16 -0
  58. package/types/src/Plugin.d.ts.map +1 -0
  59. package/types/src/SourcePackage.d.ts +76 -0
  60. package/types/src/SourcePackage.d.ts.map +1 -0
  61. package/types/src/Types.d.ts +44 -0
  62. package/types/src/Types.d.ts.map +1 -0
  63. package/types/src/cfb/CompoundFileReader.d.ts +73 -0
  64. package/types/src/cfb/CompoundFileReader.d.ts.map +1 -0
  65. package/types/src/cfb/CompoundFileWriter.d.ts +57 -0
  66. package/types/src/cfb/CompoundFileWriter.d.ts.map +1 -0
  67. package/types/src/cfb/index.d.ts +3 -0
  68. package/types/src/cfb/index.d.ts.map +1 -0
  69. package/types/src/index.d.ts +3 -0
  70. package/types/src/index.d.ts.map +1 -0
  71. package/types/src/legacyChart/OOXMLMappings.d.ts +8 -0
  72. package/types/src/legacyChart/OOXMLMappings.d.ts.map +1 -0
  73. package/types/src/legacyChart/OOXMLUtils.d.ts +78 -0
  74. package/types/src/legacyChart/OOXMLUtils.d.ts.map +1 -0
  75. package/types/src/legacyChart/ToOOXMLConverter.d.ts +30 -0
  76. package/types/src/legacyChart/ToOOXMLConverter.d.ts.map +1 -0
  77. package/types/src/offcrypto/AgileCrypto.d.ts +85 -0
  78. package/types/src/offcrypto/AgileCrypto.d.ts.map +1 -0
  79. package/types/src/offcrypto/EncryptionInfo.d.ts +109 -0
  80. package/types/src/offcrypto/EncryptionInfo.d.ts.map +1 -0
  81. package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts +18 -0
  82. package/types/src/offcrypto/LazyOffCryptoEncryption.d.ts.map +1 -0
  83. package/types/src/offcrypto/OffCryptoEncryption.d.ts +15 -0
  84. package/types/src/offcrypto/OffCryptoEncryption.d.ts.map +1 -0
  85. package/types/src/offcrypto/index.d.ts +5 -0
  86. package/types/src/offcrypto/index.d.ts.map +1 -0
  87. package/types/src/reader/DummyFunctionUnwrap.d.ts +58 -0
  88. package/types/src/reader/DummyFunctionUnwrap.d.ts.map +1 -0
  89. package/types/src/reader/ReaderProfiler.d.ts +45 -0
  90. package/types/src/reader/ReaderProfiler.d.ts.map +1 -0
  91. package/types/src/reader/ReaderUtils.d.ts +66 -0
  92. package/types/src/reader/ReaderUtils.d.ts.map +1 -0
  93. package/types/src/reader/XLSXReader.d.ts +11 -0
  94. package/types/src/reader/XLSXReader.d.ts.map +1 -0
  95. package/types/src/reader/ZipReader.d.ts +62 -0
  96. package/types/src/reader/ZipReader.d.ts.map +1 -0
  97. package/types/src/reader/dom/DOMTransformer.d.ts +22 -0
  98. package/types/src/reader/dom/DOMTransformer.d.ts.map +1 -0
  99. package/types/src/reader/dom/DefaultVisitor.d.ts +8 -0
  100. package/types/src/reader/dom/DefaultVisitor.d.ts.map +1 -0
  101. package/types/src/reader/dom/ExecutionContext.d.ts +78 -0
  102. package/types/src/reader/dom/ExecutionContext.d.ts.map +1 -0
  103. package/types/src/reader/dom/NumberUtils.d.ts +17 -0
  104. package/types/src/reader/dom/NumberUtils.d.ts.map +1 -0
  105. package/types/src/reader/dom/Types.d.ts +27 -0
  106. package/types/src/reader/dom/Types.d.ts.map +1 -0
  107. package/types/src/reader/dom/VisitContext.d.ts +10 -0
  108. package/types/src/reader/dom/VisitContext.d.ts.map +1 -0
  109. package/types/src/reader/dom/Visitor.d.ts +23 -0
  110. package/types/src/reader/dom/Visitor.d.ts.map +1 -0
  111. package/types/src/reader/dom/VisitorUtils.d.ts +16 -0
  112. package/types/src/reader/dom/VisitorUtils.d.ts.map +1 -0
  113. package/types/src/reader/dom/index.d.ts +7 -0
  114. package/types/src/reader/dom/index.d.ts.map +1 -0
  115. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +11 -0
  116. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts.map +1 -0
  117. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +25 -0
  118. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts.map +1 -0
  119. package/types/src/reader/domVisitors/AxisVisitor.d.ts +12 -0
  120. package/types/src/reader/domVisitors/AxisVisitor.d.ts.map +1 -0
  121. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +6 -0
  122. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts.map +1 -0
  123. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +6 -0
  124. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts.map +1 -0
  125. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +7 -0
  126. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts.map +1 -0
  127. package/types/src/reader/domVisitors/ChartVisitor.d.ts +7 -0
  128. package/types/src/reader/domVisitors/ChartVisitor.d.ts.map +1 -0
  129. package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts +7 -0
  130. package/types/src/reader/domVisitors/ClrSchemeVisitor.d.ts.map +1 -0
  131. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +37 -0
  132. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts.map +1 -0
  133. package/types/src/reader/domVisitors/CommentVisitor.d.ts +6 -0
  134. package/types/src/reader/domVisitors/CommentVisitor.d.ts.map +1 -0
  135. package/types/src/reader/domVisitors/CommentsVisitor.d.ts +7 -0
  136. package/types/src/reader/domVisitors/CommentsVisitor.d.ts.map +1 -0
  137. package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts +11 -0
  138. package/types/src/reader/domVisitors/CorePropertiesVisitor.d.ts.map +1 -0
  139. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +8 -0
  140. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts.map +1 -0
  141. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +6 -0
  142. package/types/src/reader/domVisitors/DataPointVisitor.d.ts.map +1 -0
  143. package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts +8 -0
  144. package/types/src/reader/domVisitors/DrawingAnchorVisitor.d.ts.map +1 -0
  145. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +7 -0
  146. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts.map +1 -0
  147. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +6 -0
  148. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts.map +1 -0
  149. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +7 -0
  150. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts.map +1 -0
  151. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +7 -0
  152. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts.map +1 -0
  153. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +7 -0
  154. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts.map +1 -0
  155. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +7 -0
  156. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts.map +1 -0
  157. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +5 -0
  158. package/types/src/reader/domVisitors/DrawingVisitor.d.ts.map +1 -0
  159. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +32 -0
  160. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts.map +1 -0
  161. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +22 -0
  162. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts.map +1 -0
  163. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +7 -0
  164. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts.map +1 -0
  165. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +6 -0
  166. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts.map +1 -0
  167. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +5 -0
  168. package/types/src/reader/domVisitors/LayoutVisitor.d.ts.map +1 -0
  169. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +5 -0
  170. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts.map +1 -0
  171. package/types/src/reader/domVisitors/LegendVisitor.d.ts +5 -0
  172. package/types/src/reader/domVisitors/LegendVisitor.d.ts.map +1 -0
  173. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +5 -0
  174. package/types/src/reader/domVisitors/MarkerVisitor.d.ts.map +1 -0
  175. package/types/src/reader/domVisitors/MetadataVisitor.d.ts +104 -0
  176. package/types/src/reader/domVisitors/MetadataVisitor.d.ts.map +1 -0
  177. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +6 -0
  178. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts.map +1 -0
  179. package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts +3 -0
  180. package/types/src/reader/domVisitors/OOXMLVisitorUtils.d.ts.map +1 -0
  181. package/types/src/reader/domVisitors/PersonListVisitor.d.ts +5 -0
  182. package/types/src/reader/domVisitors/PersonListVisitor.d.ts.map +1 -0
  183. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +5 -0
  184. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts.map +1 -0
  185. package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts +8 -0
  186. package/types/src/reader/domVisitors/PresetTableStylesVisitor.d.ts.map +1 -0
  187. package/types/src/reader/domVisitors/RelsVisitor.d.ts +9 -0
  188. package/types/src/reader/domVisitors/RelsVisitor.d.ts.map +1 -0
  189. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +7 -0
  190. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts.map +1 -0
  191. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +6 -0
  192. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts.map +1 -0
  193. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +8 -0
  194. package/types/src/reader/domVisitors/SeriesVisitor.d.ts.map +1 -0
  195. package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts +6 -0
  196. package/types/src/reader/domVisitors/ShapePropertiesVisitor.d.ts.map +1 -0
  197. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +28 -0
  198. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts.map +1 -0
  199. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +20 -0
  200. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts.map +1 -0
  201. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -0
  202. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts.map +1 -0
  203. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +7 -0
  204. package/types/src/reader/domVisitors/SlicersVisitor.d.ts.map +1 -0
  205. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +8 -0
  206. package/types/src/reader/domVisitors/SortStateVisitor.d.ts.map +1 -0
  207. package/types/src/reader/domVisitors/TableVisitor.d.ts +10 -0
  208. package/types/src/reader/domVisitors/TableVisitor.d.ts.map +1 -0
  209. package/types/src/reader/domVisitors/TableX14Visitor.d.ts +6 -0
  210. package/types/src/reader/domVisitors/TableX14Visitor.d.ts.map +1 -0
  211. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +11 -0
  212. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts.map +1 -0
  213. package/types/src/reader/domVisitors/ThemeVisitor.d.ts +6 -0
  214. package/types/src/reader/domVisitors/ThemeVisitor.d.ts.map +1 -0
  215. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
  216. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts.map +1 -0
  217. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +6 -0
  218. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts.map +1 -0
  219. package/types/src/reader/domVisitors/TitleVisitor.d.ts +9 -0
  220. package/types/src/reader/domVisitors/TitleVisitor.d.ts.map +1 -0
  221. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +30 -0
  222. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts.map +1 -0
  223. package/types/src/reader/domVisitors/index.d.ts +101 -0
  224. package/types/src/reader/domVisitors/index.d.ts.map +1 -0
  225. package/types/src/reader/sax/SaxParser.d.ts +34 -0
  226. package/types/src/reader/sax/SaxParser.d.ts.map +1 -0
  227. package/types/src/reader/sax/SaxVisitor.d.ts +59 -0
  228. package/types/src/reader/sax/SaxVisitor.d.ts.map +1 -0
  229. package/types/src/reader/sax/Saxes.d.ts +641 -0
  230. package/types/src/reader/sax/Saxes.d.ts.map +1 -0
  231. package/types/src/reader/sax/index.d.ts +3 -0
  232. package/types/src/reader/sax/index.d.ts.map +1 -0
  233. package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts +32 -0
  234. package/types/src/reader/sax/xmlchars/xml/1.0/ed4.d.ts.map +1 -0
  235. package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts +52 -0
  236. package/types/src/reader/sax/xmlchars/xml/1.0/ed5.d.ts.map +1 -0
  237. package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts +74 -0
  238. package/types/src/reader/sax/xmlchars/xml/1.1/ed2.d.ts.map +1 -0
  239. package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts +29 -0
  240. package/types/src/reader/sax/xmlchars/xmlns/1.0/ed3.d.ts.map +1 -0
  241. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +54 -0
  242. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts.map +1 -0
  243. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +22 -0
  244. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts.map +1 -0
  245. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +25 -0
  246. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts.map +1 -0
  247. package/types/src/vba/CompoundDocumentCompression.d.ts +37 -0
  248. package/types/src/vba/CompoundDocumentCompression.d.ts.map +1 -0
  249. package/types/src/vba/VBAProject.d.ts +47 -0
  250. package/types/src/vba/VBAProject.d.ts.map +1 -0
  251. package/types/src/vba/index.d.ts +3 -0
  252. package/types/src/vba/index.d.ts.map +1 -0
  253. package/types/src/writer/XLSXWriter.d.ts +4 -0
  254. package/types/src/writer/XLSXWriter.d.ts.map +1 -0
  255. package/types/src/writer/builder/ContentTypes.d.ts +18 -0
  256. package/types/src/writer/builder/ContentTypes.d.ts.map +1 -0
  257. package/types/src/writer/builder/Emitter.d.ts +25 -0
  258. package/types/src/writer/builder/Emitter.d.ts.map +1 -0
  259. package/types/src/writer/builder/EmitterRegistry.d.ts +29 -0
  260. package/types/src/writer/builder/EmitterRegistry.d.ts.map +1 -0
  261. package/types/src/writer/builder/OpcXmlUtils.d.ts +26 -0
  262. package/types/src/writer/builder/OpcXmlUtils.d.ts.map +1 -0
  263. package/types/src/writer/builder/PackageBuilder.d.ts +148 -0
  264. package/types/src/writer/builder/PackageBuilder.d.ts.map +1 -0
  265. package/types/src/writer/builder/PartWriter.d.ts +24 -0
  266. package/types/src/writer/builder/PartWriter.d.ts.map +1 -0
  267. package/types/src/writer/builder/RelationshipSet.d.ts +18 -0
  268. package/types/src/writer/builder/RelationshipSet.d.ts.map +1 -0
  269. package/types/src/writer/builder/Types.d.ts +311 -0
  270. package/types/src/writer/builder/Types.d.ts.map +1 -0
  271. package/types/src/writer/builder/Utils.d.ts +63 -0
  272. package/types/src/writer/builder/Utils.d.ts.map +1 -0
  273. package/types/src/writer/builder/XmlWriter.d.ts +3 -0
  274. package/types/src/writer/builder/XmlWriter.d.ts.map +1 -0
  275. package/types/src/writer/builder/ZipBackend.d.ts +21 -0
  276. package/types/src/writer/builder/ZipBackend.d.ts.map +1 -0
  277. package/types/src/writer/builder/_Types.d.ts +102 -0
  278. package/types/src/writer/builder/_Types.d.ts.map +1 -0
  279. package/types/src/writer/builder/index.d.ts +6 -0
  280. package/types/src/writer/builder/index.d.ts.map +1 -0
  281. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +7 -0
  282. package/types/src/writer/emitters/ChartColorsEmitter.d.ts.map +1 -0
  283. package/types/src/writer/emitters/ChartEmitter.d.ts +14 -0
  284. package/types/src/writer/emitters/ChartEmitter.d.ts.map +1 -0
  285. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +46 -0
  286. package/types/src/writer/emitters/ChartStyleEmitter.d.ts.map +1 -0
  287. package/types/src/writer/emitters/DrawingEmitter.d.ts +15 -0
  288. package/types/src/writer/emitters/DrawingEmitter.d.ts.map +1 -0
  289. package/types/src/writer/emitters/MetadataEmitter.d.ts +8 -0
  290. package/types/src/writer/emitters/MetadataEmitter.d.ts.map +1 -0
  291. package/types/src/writer/emitters/PropsAppEmitter.d.ts +12 -0
  292. package/types/src/writer/emitters/PropsAppEmitter.d.ts.map +1 -0
  293. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -0
  294. package/types/src/writer/emitters/PropsCoreEmitter.d.ts.map +1 -0
  295. package/types/src/writer/emitters/RichValueEmitter.d.ts +8 -0
  296. package/types/src/writer/emitters/RichValueEmitter.d.ts.map +1 -0
  297. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +28 -0
  298. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts.map +1 -0
  299. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +10 -0
  300. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts.map +1 -0
  301. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +13 -0
  302. package/types/src/writer/emitters/SharedStringsEmitter.d.ts.map +1 -0
  303. package/types/src/writer/emitters/StylesEmitter.d.ts +17 -0
  304. package/types/src/writer/emitters/StylesEmitter.d.ts.map +1 -0
  305. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  306. package/types/src/writer/emitters/TableEmitter.d.ts.map +1 -0
  307. package/types/src/writer/emitters/ThemeEmitter.d.ts +16 -0
  308. package/types/src/writer/emitters/ThemeEmitter.d.ts.map +1 -0
  309. package/types/src/writer/emitters/WorkbookEmitter.d.ts +11 -0
  310. package/types/src/writer/emitters/WorkbookEmitter.d.ts.map +1 -0
  311. package/types/src/writer/emitters/WorksheetEmitter.d.ts +18 -0
  312. package/types/src/writer/emitters/WorksheetEmitter.d.ts.map +1 -0
  313. package/types/src/writer/emitters/index.d.ts +3 -0
  314. package/types/src/writer/emitters/index.d.ts.map +1 -0
  315. package/types/src/writer/utils/AutoFilter.d.ts +15 -0
  316. package/types/src/writer/utils/AutoFilter.d.ts.map +1 -0
  317. package/types/src/writer/utils/ColorUtils.d.ts +46 -0
  318. package/types/src/writer/utils/ColorUtils.d.ts.map +1 -0
  319. package/types/src/writer/utils/DrawMLUtils.d.ts +26 -0
  320. package/types/src/writer/utils/DrawMLUtils.d.ts.map +1 -0
  321. package/types/src/writer/utils/DummyFunction.d.ts +66 -0
  322. package/types/src/writer/utils/DummyFunction.d.ts.map +1 -0
  323. package/types/src/writer/utils/DxfCollector.d.ts +22 -0
  324. package/types/src/writer/utils/DxfCollector.d.ts.map +1 -0
  325. package/types/src/writer/utils/ExtLstUtils.d.ts +3 -0
  326. package/types/src/writer/utils/ExtLstUtils.d.ts.map +1 -0
  327. package/types/src/writer/utils/IDUtils.d.ts +2 -0
  328. package/types/src/writer/utils/IDUtils.d.ts.map +1 -0
  329. package/types/src/writer/utils/MetadataCollector.d.ts +146 -0
  330. package/types/src/writer/utils/MetadataCollector.d.ts.map +1 -0
  331. package/types/src/writer/utils/ProtectionUtils.d.ts +3 -0
  332. package/types/src/writer/utils/ProtectionUtils.d.ts.map +1 -0
  333. package/types/src/writer/utils/RichValueCollector.d.ts +200 -0
  334. package/types/src/writer/utils/RichValueCollector.d.ts.map +1 -0
  335. package/types/src/writer/utils/TextUtils.d.ts +8 -0
  336. package/types/src/writer/utils/TextUtils.d.ts.map +1 -0
  337. package/types/src/writer/utils/UnsupportedFunctions.d.ts +19 -0
  338. package/types/src/writer/utils/UnsupportedFunctions.d.ts.map +1 -0
  339. package/types/src/writer/utils/VersionUtils.d.ts +26 -0
  340. package/types/src/writer/utils/VersionUtils.d.ts.map +1 -0
@@ -0,0 +1,2623 @@
1
+ /**
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.7.23-beta.1
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 { r as e } from "./BVAAJynubTdvPOQA.mjs";
8
+ import { c as t, d as n, f as r, l as i, p as a, r as o, s, u as c } from "./CcXnQZ4Fk_nkbq2G.mjs";
9
+ import { A as l, B as u, C as d, D as f, M as p, O as m, P as h, S as g, U as _, W as v, _ as ee, a as te, b as ne, f as re, h as ie, i as ae, j as oe, l as se, n as ce, o as le, p as ue, r as y, t as b, u as x, z as S } from "./DoKP-E832M9vPWgU.mjs";
10
+ import { BufferUtils as de, CommonUtils as C, ExpectedError as fe } from "@sheetxl/utils";
11
+ import { AddressUtils as w, CommonUtils as pe, CoordUtils as T, FormulaError as E, ICondition as D, IConditionalFormat as O, IRange as me, OutOfBoundsError as k, ResourceCollection as he, Theme as ge, Tuple as _e, Workbook as ve } from "@sheetxl/sdk";
12
+ var A = /* @__PURE__ */ new Uint8Array(), j = class e {
13
+ constructor(e, t, n) {
14
+ this.buffers = /* @__PURE__ */ new Map(), this.zip = e, this.entries = t, this.rawBuffer = n;
15
+ }
16
+ static normalize(e) {
17
+ return e.startsWith("/") ? e.slice(1) : e;
18
+ }
19
+ static async create(t) {
20
+ let n = t instanceof Blob ? A : t instanceof Uint8Array ? t : new Uint8Array(t), r = new S(t instanceof Blob ? new u(t) : new _(n)), i = /* @__PURE__ */ new Map();
21
+ for (let e of await r.getEntries()) e.directory || i.set(e.filename, e);
22
+ return new e(r, i, n);
23
+ }
24
+ getNames() {
25
+ return [...this.entries.keys()];
26
+ }
27
+ has(t) {
28
+ return this.entries.has(e.normalize(t));
29
+ }
30
+ uncompressedSize(t) {
31
+ return this.entries.get(e.normalize(t))?.uncompressedSize ?? 0;
32
+ }
33
+ async getBuffer(t) {
34
+ let n = e.normalize(t), r = this.buffers.get(n);
35
+ if (r) return r;
36
+ let i = this.entries.get(n);
37
+ if (!i) return null;
38
+ let a = await i.getData(new v());
39
+ return this.buffers.set(n, a), a;
40
+ }
41
+ async prefetch(e) {
42
+ let t = [];
43
+ for (let [n, r] of this.entries) !this.buffers.has(n) && e(n, r) && t.push(r.getData(new v()).then((e) => {
44
+ this.buffers.set(n, e);
45
+ }));
46
+ await Promise.all(t);
47
+ }
48
+ getEntry(t) {
49
+ return this.buffers.get(e.normalize(t)) ?? null;
50
+ }
51
+ async getTextStream(t, n) {
52
+ let r = this.entries.get(e.normalize(t));
53
+ if (!r) return null;
54
+ let i = new TransformStream();
55
+ r.getData(i.writable).catch(() => {});
56
+ let a = i.readable.getReader(), o = new TextDecoder("utf-8");
57
+ return new ReadableStream({ async pull(e) {
58
+ let { value: t, done: r } = await a.read();
59
+ if (r) {
60
+ let t = o.decode();
61
+ t && e.enqueue(t), e.close();
62
+ return;
63
+ }
64
+ n?.(t.byteLength);
65
+ let i = o.decode(t, { stream: !0 });
66
+ i && e.enqueue(i);
67
+ } }).getReader();
68
+ }
69
+ getRawEntry(t) {
70
+ let n = this.entries.get(e.normalize(t));
71
+ if (!n || n.encrypted) return null;
72
+ let r = n.offset;
73
+ if (r + 30 > this.rawBuffer.byteLength) return null;
74
+ let i = new DataView(this.rawBuffer.buffer, this.rawBuffer.byteOffset + r, 30);
75
+ if (i.getUint32(0, !0) !== 67324752) return null;
76
+ let a = r + 30 + i.getUint16(26, !0) + i.getUint16(28, !0), o = a + n.compressedSize;
77
+ return o > this.rawBuffer.byteLength ? null : {
78
+ data: this.rawBuffer.subarray(a, o),
79
+ compressionMethod: n.compressionMethod,
80
+ signature: n.signature
81
+ };
82
+ }
83
+ async close() {
84
+ await this.zip.close();
85
+ }
86
+ }, ye = class {
87
+ constructor(e) {
88
+ this._sink = e, this._samples = [], this._t0 = M(), this._tPrev = this._t0, this._heapPrev = be();
89
+ }
90
+ mark(e) {
91
+ let t = M(), n = be(), r = {
92
+ label: e,
93
+ tMs: t - this._t0,
94
+ dtMs: t - this._tPrev,
95
+ heapBytes: n,
96
+ dHeapBytes: n !== void 0 && this._heapPrev !== void 0 ? n - this._heapPrev : void 0,
97
+ rssBytes: N()
98
+ };
99
+ this._tPrev = t, this._heapPrev = n, this._samples.push(r), this._sink?.(r);
100
+ }
101
+ samples() {
102
+ return this._samples;
103
+ }
104
+ toTable() {
105
+ return this._samples.map((e) => ({
106
+ phase: e.label,
107
+ tMs: Math.round(e.tMs),
108
+ dtMs: Math.round(e.dtMs),
109
+ heapMB: e.heapBytes === void 0 ? "—" : xe(e.heapBytes / 1048576),
110
+ dHeapMB: e.dHeapBytes === void 0 ? "—" : xe(e.dHeapBytes / 1048576),
111
+ rssMB: e.rssBytes === void 0 ? "—" : xe(e.rssBytes / 1048576)
112
+ }));
113
+ }
114
+ }, M = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now();
115
+ function be() {
116
+ let e = typeof performance == "object" ? performance.memory : void 0;
117
+ if (e && typeof e.usedJSHeapSize == "number") return e.usedJSHeapSize;
118
+ let t = globalThis.process;
119
+ return typeof t == "object" && typeof t.memoryUsage == "function" ? t.memoryUsage().heapUsed : void 0;
120
+ }
121
+ function N() {
122
+ let e = globalThis.process;
123
+ if (typeof e == "object" && typeof e.memoryUsage == "function") return e.memoryUsage().rss;
124
+ }
125
+ function xe(e) {
126
+ return Math.round(10 * e) / 10;
127
+ }
128
+ var Se = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ce = `-${Se}.0-9·̀-ͯ‿-⁀`, P = (RegExp(`^[${Se}]$`, "u"), RegExp(`^[${Ce}]$`, "u"), RegExp(`^[${Se}][${Ce}]*$`, "u")), F = (RegExp(`^[${Ce}]+$`, "u"), [
129
+ 32,
130
+ 10,
131
+ 13,
132
+ 9
133
+ ]);
134
+ function I(e) {
135
+ return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 58 || e === 95 || e === 8204 || e === 8205 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
136
+ }
137
+ var we = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", L = `-${we}.0-9·̀-ͯ‿-⁀`;
138
+ RegExp(`^[${we}]$`, "u"), RegExp(`^[${L}]$`, "u"), RegExp(`^[${we}][${L}]*$`, "u"), RegExp(`^[${L}]+$`, "u");
139
+ var Te = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", R = `-${Te}.0-9·̀-ͯ‿-⁀`, Ee = (RegExp(`^[${Te}]$`, "u"), RegExp(`^[${R}]$`, "u"), RegExp(`^[${Te}][${R}]*$`, "u"));
140
+ function De(e) {
141
+ return e >= 65 && e <= 90 || e === 95 || e >= 97 && e <= 122 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
142
+ }
143
+ var z = function(e) {
144
+ return e === 32 || e === 10 || e === 13 || e === 9;
145
+ }, Oe = function(e) {
146
+ return e >= 32 && e <= 55295 || e === 10 || e === 13 || e === 9 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
147
+ }, B = I, ke = function(e) {
148
+ return I(e) || e >= 48 && e <= 57 || e === 45 || e === 46 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
149
+ }, V = F, Ae = P, je = function(e) {
150
+ return e >= 1 && e <= 55295 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
151
+ }, Me = De, Ne = function(e) {
152
+ return De(e) || e === 45 || e === 46 || e >= 48 && e <= 57 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
153
+ }, Pe = Ee, Fe = "http://www.w3.org/XML/1998/namespace", Ie = "http://www.w3.org/2000/xmlns/", Le = {
154
+ __proto__: null,
155
+ xml: Fe,
156
+ xmlns: Ie
157
+ }, Re = {
158
+ __proto__: null,
159
+ amp: "&",
160
+ gt: ">",
161
+ lt: "<",
162
+ quot: "\"",
163
+ apos: "'"
164
+ }, H = -1, U = -2, W = 13, ze = 33, G = 10, Be = 60, K = 61, q = 62, J = 63, Y = 93, Ve = (e) => e === 34 || e === 39, He = [34, 39], Ue = [
165
+ ...He,
166
+ 91,
167
+ q
168
+ ], We = [
169
+ ...He,
170
+ Be,
171
+ Y
172
+ ], Ge = [
173
+ K,
174
+ J,
175
+ ...V
176
+ ], Ke = [
177
+ ...V,
178
+ q,
179
+ 38,
180
+ Be
181
+ ];
182
+ function qe(e, t, n) {
183
+ switch (t) {
184
+ case "xml":
185
+ n !== Fe && e.fail(`xml prefix must be bound to ${Fe}.`);
186
+ break;
187
+ case "xmlns": n !== Ie && e.fail(`xmlns prefix must be bound to ${Ie}.`);
188
+ }
189
+ switch (n) {
190
+ case Ie:
191
+ e.fail(t === "" ? `the default namespace may not be set to ${n}.` : `may not assign a prefix (even "xmlns") to the URI ${Ie}.`);
192
+ break;
193
+ case Fe: switch (t) {
194
+ case "xml": break;
195
+ case "":
196
+ e.fail(`the default namespace may not be set to ${n}.`);
197
+ break;
198
+ default: e.fail("may not assign the xml namespace to another prefix.");
199
+ }
200
+ }
201
+ }
202
+ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
203
+ xmldecl: "xmlDeclHandler",
204
+ text: "textHandler",
205
+ processinginstruction: "piHandler",
206
+ doctype: "doctypeHandler",
207
+ comment: "commentHandler",
208
+ opentagstart: "openTagStartHandler",
209
+ attribute: "attributeHandler",
210
+ opentag: "openTagHandler",
211
+ closetag: "closeTagHandler",
212
+ cdata: "cdataHandler",
213
+ error: "errorHandler",
214
+ end: "endHandler",
215
+ ready: "readyHandler"
216
+ }, $e = class {
217
+ get closed() {
218
+ return this._closed;
219
+ }
220
+ constructor(e) {
221
+ this.i = 0, this.prevI = 0, this.opt = e ?? {}, this.fragmentOpt = !!this.opt.fragment;
222
+ let t = this.xmlnsOpt = !!this.opt.xmlns;
223
+ if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, t) {
224
+ this.nameStartCheck = Me, this.nameCheck = Ne, this.isName = Xe, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
225
+ __proto__: null,
226
+ ...Le
227
+ };
228
+ let e = this.opt.additionalNamespaces;
229
+ e != null && (function(e, t) {
230
+ for (let n of Object.keys(t)) qe(e, n, t[n]);
231
+ }(this, e), Object.assign(this.ns, e));
232
+ } else this.nameStartCheck = B, this.nameCheck = ke, this.isName = Ze, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
233
+ this.stateTable = [
234
+ this.sBegin,
235
+ this.sBeginWhitespace,
236
+ this.sDoctype,
237
+ this.sDoctypeQuote,
238
+ this.sDTD,
239
+ this.sDTDQuoted,
240
+ this.sDTDOpenWaka,
241
+ this.sDTDOpenWakaBang,
242
+ this.sDTDComment,
243
+ this.sDTDCommentEnding,
244
+ this.sDTDCommentEnded,
245
+ this.sDTDPI,
246
+ this.sDTDPIEnding,
247
+ this.sText,
248
+ this.sEntity,
249
+ this.sOpenWaka,
250
+ this.sOpenWakaBang,
251
+ this.sComment,
252
+ this.sCommentEnding,
253
+ this.sCommentEnded,
254
+ this.sCData,
255
+ this.sCDataEnding,
256
+ this.sCDataEnding2,
257
+ this.sPIFirstChar,
258
+ this.sPIRest,
259
+ this.sPIBody,
260
+ this.sPIEnding,
261
+ this.sXMLDeclNameStart,
262
+ this.sXMLDeclName,
263
+ this.sXMLDeclEq,
264
+ this.sXMLDeclValueStart,
265
+ this.sXMLDeclValue,
266
+ this.sXMLDeclSeparator,
267
+ this.sXMLDeclEnding,
268
+ this.sOpenTag,
269
+ this.sOpenTagSlash,
270
+ this.sAttrib,
271
+ this.sAttribName,
272
+ this.sAttribNameSawWhite,
273
+ this.sAttribValue,
274
+ this.sAttribValueQuoted,
275
+ this.sAttribValueClosed,
276
+ this.sAttribValueUnquoted,
277
+ this.sCloseTag,
278
+ this.sCloseTagSawWhite
279
+ ], this._init();
280
+ }
281
+ _init() {
282
+ this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
283
+ let { fragmentOpt: e } = this;
284
+ this.state = e ? W : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = e, this.xmlDeclPossible = !e, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
285
+ let { defaultXMLVersion: t } = this.opt;
286
+ if (t === void 0) {
287
+ if (!0 === this.opt.forceXMLVersion) throw Error("forceXMLVersion set but defaultXMLVersion is not set");
288
+ t = "1.0";
289
+ }
290
+ this.setXMLVersion(t), this.positionAtNewLine = 0, this.doctype = !1, this._closed = !1, this.xmlDecl = {
291
+ version: void 0,
292
+ encoding: void 0,
293
+ standalone: void 0
294
+ }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Re), this.readyHandler?.();
295
+ }
296
+ get position() {
297
+ return this.chunkPosition + this.i;
298
+ }
299
+ get columnIndex() {
300
+ return this.position - this.positionAtNewLine;
301
+ }
302
+ on(e, t) {
303
+ this[Qe[e]] = t;
304
+ }
305
+ off(e) {
306
+ this[Qe[e]] = void 0;
307
+ }
308
+ makeError(e) {
309
+ let t = this.fileName ?? "";
310
+ return this.trackPosition && (t.length > 0 && (t += ":"), t += `${this.line}:${this.column}`), t.length > 0 && (t += ": "), Error(t + e);
311
+ }
312
+ fail(e) {
313
+ let t = this.makeError(e), n = this.errorHandler;
314
+ if (n === void 0) throw t;
315
+ return n(t), this;
316
+ }
317
+ write(e) {
318
+ if (this.closed) return this.fail("cannot write after close.");
319
+ let t = !1;
320
+ e === null ? (t = !0, e = "") : typeof e == "object" && (e = e.toString()), this.carriedFromPrevious !== void 0 && (e = `${this.carriedFromPrevious}${e}`, this.carriedFromPrevious = void 0);
321
+ let n = e.length, r = e.charCodeAt(n - 1);
322
+ !t && (r === 13 || r >= 55296 && r <= 56319) && (this.carriedFromPrevious = e[n - 1], n--, e = e.slice(0, n));
323
+ let { stateTable: i } = this;
324
+ for (this.chunk = e, this.i = 0; this.i < n;) i[this.state].call(this);
325
+ return this.chunkPosition += n, t ? this.end() : this;
326
+ }
327
+ close() {
328
+ return this.write(null);
329
+ }
330
+ getCode10() {
331
+ let e = this.chunk, t = this.i;
332
+ if (this.prevI = t, this.i++, t >= e.length) return H;
333
+ let n = e.charCodeAt(t);
334
+ if (this.column++, n < 55296) {
335
+ if (n >= 32 || n === 9) return n;
336
+ switch (n) {
337
+ case G: return this.line++, this.column = 0, this.positionAtNewLine = this.position, G;
338
+ case 13: return e.charCodeAt(t + 1) === G && (this.i = t + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, U;
339
+ default: return this.fail("disallowed character."), n;
340
+ }
341
+ }
342
+ if (n > 56319) return n >= 57344 && n <= 65533 || this.fail("disallowed character."), n;
343
+ let r = 65536 + 1024 * (n - 55296) + (e.charCodeAt(t + 1) - 56320);
344
+ return this.i = t + 2, r > 1114111 && this.fail("disallowed character."), r;
345
+ }
346
+ getCode11() {
347
+ let { chunk: e, i: t } = this;
348
+ if (this.prevI = t, this.i = t + 1, t >= e.length) return H;
349
+ let n = e.charCodeAt(t);
350
+ if (this.column++, n < 55296) {
351
+ if (n > 31 && n < 127 || n > 159 && n !== 8232 || n === 9) return n;
352
+ switch (n) {
353
+ case G: return this.line++, this.column = 0, this.positionAtNewLine = this.position, G;
354
+ case 13: {
355
+ let n = e.charCodeAt(t + 1);
356
+ n !== G && n !== 133 || (this.i = t + 2);
357
+ }
358
+ case 133:
359
+ case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, U;
360
+ default: return this.fail("disallowed character."), n;
361
+ }
362
+ }
363
+ if (n > 56319) return n >= 57344 && n <= 65533 || this.fail("disallowed character."), n;
364
+ let r = 65536 + 1024 * (n - 55296) + (e.charCodeAt(t + 1) - 56320);
365
+ return this.i = t + 2, r > 1114111 && this.fail("disallowed character."), r;
366
+ }
367
+ getCodeNorm() {
368
+ let e = this.getCode();
369
+ return e === U ? G : e;
370
+ }
371
+ unGet() {
372
+ this.i = this.prevI, this.column--;
373
+ }
374
+ captureTo(e) {
375
+ let { i: t } = this, { chunk: n } = this;
376
+ for (;;) {
377
+ let r = this.getCode(), i = r === U, a = i ? G : r;
378
+ if (a === H || e.includes(a)) return this.text += n.slice(t, this.prevI), a;
379
+ i && (this.text += `${n.slice(t, this.prevI)}\n`, t = this.i);
380
+ }
381
+ }
382
+ captureToChar(e) {
383
+ let { i: t } = this, { chunk: n } = this;
384
+ for (;;) {
385
+ let r = this.getCode();
386
+ switch (r) {
387
+ case U:
388
+ this.text += `${n.slice(t, this.prevI)}\n`, t = this.i, r = G;
389
+ break;
390
+ case H: return this.text += n.slice(t), !1;
391
+ }
392
+ if (r === e) return this.text += n.slice(t, this.prevI), !0;
393
+ }
394
+ }
395
+ captureNameChars() {
396
+ let { chunk: e, i: t } = this;
397
+ for (;;) {
398
+ let n = this.getCode();
399
+ if (n === H) return this.name += e.slice(t), H;
400
+ if (!ke(n)) return this.name += e.slice(t, this.prevI), n === U ? G : n;
401
+ }
402
+ }
403
+ skipSpaces() {
404
+ for (;;) {
405
+ let e = this.getCodeNorm();
406
+ if (e === H || !z(e)) return e;
407
+ }
408
+ }
409
+ setXMLVersion(e) {
410
+ this.currentXMLVersion = e, e === "1.0" ? (this.isChar = Oe, this.getCode = this.getCode10) : (this.isChar = je, this.getCode = this.getCode11);
411
+ }
412
+ sBegin() {
413
+ this.chunk.charCodeAt(0) === 65279 && (this.i++, this.column++), this.state = 1;
414
+ }
415
+ sBeginWhitespace() {
416
+ let e = this.i, t = this.skipSpaces();
417
+ switch (this.prevI !== e && (this.xmlDeclPossible = !1), t) {
418
+ case Be:
419
+ if (this.state = 15, this.text.length !== 0) throw Error("no-empty text at start");
420
+ break;
421
+ case H: break;
422
+ default: this.unGet(), this.state = W, this.xmlDeclPossible = !1;
423
+ }
424
+ }
425
+ sDoctype() {
426
+ let e = this.captureTo(Ue);
427
+ switch (e) {
428
+ case q:
429
+ this.doctypeHandler?.(this.text), this.text = "", this.state = W, this.doctype = !0;
430
+ break;
431
+ case H: break;
432
+ default: this.text += String.fromCodePoint(e), e === 91 ? this.state = 4 : Ve(e) && (this.state = 3, this.q = e);
433
+ }
434
+ }
435
+ sDoctypeQuote() {
436
+ let e = this.q;
437
+ this.captureToChar(e) && (this.text += String.fromCodePoint(e), this.q = null, this.state = 2);
438
+ }
439
+ sDTD() {
440
+ let e = this.captureTo(We);
441
+ e !== H && (this.text += String.fromCodePoint(e), e === Y ? this.state = 2 : e === Be ? this.state = 6 : Ve(e) && (this.state = 5, this.q = e));
442
+ }
443
+ sDTDQuoted() {
444
+ let e = this.q;
445
+ this.captureToChar(e) && (this.text += String.fromCodePoint(e), this.state = 4, this.q = null);
446
+ }
447
+ sDTDOpenWaka() {
448
+ let e = this.getCodeNorm();
449
+ switch (this.text += String.fromCodePoint(e), e) {
450
+ case 33:
451
+ this.state = 7, this.openWakaBang = "";
452
+ break;
453
+ case J:
454
+ this.state = 11;
455
+ break;
456
+ default: this.state = 4;
457
+ }
458
+ }
459
+ sDTDOpenWakaBang() {
460
+ let e = String.fromCodePoint(this.getCodeNorm()), t = this.openWakaBang += e;
461
+ this.text += e, t !== "-" && (this.state = t === "--" ? 8 : 4, this.openWakaBang = "");
462
+ }
463
+ sDTDComment() {
464
+ this.captureToChar(45) && (this.text += "-", this.state = 9);
465
+ }
466
+ sDTDCommentEnding() {
467
+ let e = this.getCodeNorm();
468
+ this.text += String.fromCodePoint(e), this.state = e === 45 ? 10 : 8;
469
+ }
470
+ sDTDCommentEnded() {
471
+ let e = this.getCodeNorm();
472
+ this.text += String.fromCodePoint(e), e === q ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
473
+ }
474
+ sDTDPI() {
475
+ this.captureToChar(J) && (this.text += "?", this.state = 12);
476
+ }
477
+ sDTDPIEnding() {
478
+ let e = this.getCodeNorm();
479
+ this.text += String.fromCodePoint(e), e === q && (this.state = 4);
480
+ }
481
+ sText() {
482
+ this.tags.length === 0 ? this.handleTextOutsideRoot() : this.handleTextInRoot();
483
+ }
484
+ sEntity() {
485
+ let { i: e } = this, { chunk: t } = this;
486
+ t: for (;;) switch (this.getCode()) {
487
+ case U:
488
+ this.entity += `${t.slice(e, this.prevI)}\n`, e = this.i;
489
+ break;
490
+ case 59: {
491
+ let { entityReturnState: n } = this, r = this.entity + t.slice(e, this.prevI), i;
492
+ this.state = n, r === "" ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(r), this.entity = ""), n === W && this.textHandler === void 0 || (this.text += i);
493
+ break t;
494
+ }
495
+ case H:
496
+ this.entity += t.slice(e);
497
+ break t;
498
+ }
499
+ }
500
+ sOpenWaka() {
501
+ let e = this.getCode();
502
+ if (B(e)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
503
+ else switch (e) {
504
+ case 47:
505
+ this.state = 43, this.xmlDeclPossible = !1;
506
+ break;
507
+ case 33:
508
+ this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
509
+ break;
510
+ case J:
511
+ this.state = 23;
512
+ break;
513
+ default: this.fail("disallowed character in tag name"), this.state = W, this.xmlDeclPossible = !1;
514
+ }
515
+ }
516
+ sOpenWakaBang() {
517
+ switch (this.openWakaBang += String.fromCodePoint(this.getCodeNorm()), this.openWakaBang) {
518
+ case "[CDATA[":
519
+ this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0), this.state = 20, this.openWakaBang = "";
520
+ break;
521
+ case "--":
522
+ this.state = 17, this.openWakaBang = "";
523
+ break;
524
+ case "DOCTYPE":
525
+ this.state = 2, (this.doctype || this.sawRoot) && this.fail("inappropriately located doctype declaration."), this.openWakaBang = "";
526
+ break;
527
+ default: this.openWakaBang.length >= 7 && this.fail("incorrect syntax.");
528
+ }
529
+ }
530
+ sComment() {
531
+ this.captureToChar(45) && (this.state = 18);
532
+ }
533
+ sCommentEnding() {
534
+ let e = this.getCodeNorm();
535
+ e === 45 ? (this.state = 19, this.commentHandler?.(this.text), this.text = "") : (this.text += `-${String.fromCodePoint(e)}`, this.state = 17);
536
+ }
537
+ sCommentEnded() {
538
+ let e = this.getCodeNorm();
539
+ e === q ? this.state = W : (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(e)}`, this.state = 17);
540
+ }
541
+ sCData() {
542
+ this.captureToChar(Y) && (this.state = 21);
543
+ }
544
+ sCDataEnding() {
545
+ let e = this.getCodeNorm();
546
+ e === Y ? this.state = 22 : (this.text += `]${String.fromCodePoint(e)}`, this.state = 20);
547
+ }
548
+ sCDataEnding2() {
549
+ let e = this.getCodeNorm();
550
+ switch (e) {
551
+ case q:
552
+ this.cdataHandler?.(this.text), this.text = "", this.state = W;
553
+ break;
554
+ case Y:
555
+ this.text += "]";
556
+ break;
557
+ default: this.text += `]]${String.fromCodePoint(e)}`, this.state = 20;
558
+ }
559
+ }
560
+ sPIFirstChar() {
561
+ let e = this.getCodeNorm();
562
+ this.nameStartCheck(e) ? (this.piTarget += String.fromCodePoint(e), this.state = 24) : e === J || z(e) ? (this.fail("processing instruction without a target."), this.state = e === J ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(e), this.state = 24);
563
+ }
564
+ sPIRest() {
565
+ let { chunk: e, i: t } = this;
566
+ for (;;) {
567
+ let n = this.getCodeNorm();
568
+ if (n === H) return void (this.piTarget += e.slice(t));
569
+ if (!this.nameCheck(n)) {
570
+ this.piTarget += e.slice(t, this.prevI);
571
+ let r = n === J;
572
+ r || z(n) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = r ? ze : 27) : this.state = r ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(n));
573
+ break;
574
+ }
575
+ }
576
+ }
577
+ sPIBody() {
578
+ if (this.text.length === 0) {
579
+ let e = this.getCodeNorm();
580
+ e === J ? this.state = 26 : z(e) || (this.text = String.fromCodePoint(e));
581
+ } else this.captureToChar(J) && (this.state = 26);
582
+ }
583
+ sPIEnding() {
584
+ let e = this.getCodeNorm();
585
+ if (e === q) {
586
+ let { piTarget: e } = this;
587
+ e.toLowerCase() === "xml" && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
588
+ target: e,
589
+ body: this.text
590
+ }), this.piTarget = this.text = "", this.state = W;
591
+ } else e === J ? this.text += "?" : (this.text += `?${String.fromCodePoint(e)}`, this.state = 25);
592
+ this.xmlDeclPossible = !1;
593
+ }
594
+ sXMLDeclNameStart() {
595
+ let e = this.skipSpaces();
596
+ e === J ? this.state = ze : e !== H && (this.state = 28, this.name = String.fromCodePoint(e));
597
+ }
598
+ sXMLDeclName() {
599
+ let e = this.captureTo(Ge);
600
+ if (e === J) return this.state = ze, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
601
+ if (z(e) || e === K) {
602
+ if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
603
+ case 0:
604
+ this.fail("did not expect any more name/value pairs.");
605
+ break;
606
+ case 1:
607
+ this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);
608
+ break;
609
+ default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
610
+ }
611
+ this.state = e === K ? 30 : 29;
612
+ }
613
+ }
614
+ sXMLDeclEq() {
615
+ let e = this.getCodeNorm();
616
+ if (e === J) return this.state = ze, void this.fail("XML declaration is incomplete.");
617
+ z(e) || (e !== K && this.fail("value required."), this.state = 30);
618
+ }
619
+ sXMLDeclValueStart() {
620
+ let e = this.getCodeNorm();
621
+ if (e === J) return this.state = ze, void this.fail("XML declaration is incomplete.");
622
+ z(e) || (Ve(e) ? this.q = e : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
623
+ }
624
+ sXMLDeclValue() {
625
+ let e = this.captureTo([this.q, J]);
626
+ if (e === J) return this.state = ze, this.text = "", void this.fail("XML declaration is incomplete.");
627
+ if (e === H) return;
628
+ let t = this.text;
629
+ switch (this.text = "", this.name) {
630
+ case "version": {
631
+ this.xmlDeclExpects = ["encoding", "standalone"];
632
+ let e = t;
633
+ this.xmlDecl.version = e, /^1\.[0-9]+$/.test(e) ? this.opt.forceXMLVersion || this.setXMLVersion(e) : this.fail("version number must match /^1\\.[0-9]+$/.");
634
+ break;
635
+ }
636
+ case "encoding":
637
+ /^[A-Za-z][A-Za-z0-9._-]*$/.test(t) || this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."), this.xmlDeclExpects = ["standalone"], this.xmlDecl.encoding = t;
638
+ break;
639
+ case "standalone": t !== "yes" && t !== "no" && this.fail("standalone value must match \"yes\" or \"no\"."), this.xmlDeclExpects = [], this.xmlDecl.standalone = t;
640
+ }
641
+ this.name = "", this.state = 32;
642
+ }
643
+ sXMLDeclSeparator() {
644
+ let e = this.getCodeNorm();
645
+ e === J ? this.state = ze : (z(e) || (this.fail("whitespace required."), this.unGet()), this.state = 27);
646
+ }
647
+ sXMLDeclEnding() {
648
+ this.getCodeNorm() === q ? (this.piTarget === "xml" ? this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version.") : this.fail("processing instructions are not allowed before root."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = W) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
649
+ }
650
+ sOpenTag() {
651
+ let e = this.captureNameChars();
652
+ if (e === H) return;
653
+ let t = this.tag = {
654
+ name: this.name,
655
+ attributes: Object.create(null)
656
+ };
657
+ switch (this.name = "", this.xmlnsOpt && (this.topNS = t.ns = Object.create(null)), this.openTagStartHandler?.(t), this.sawRoot = !0, !this.fragmentOpt && this.closedRoot && this.fail("documents may contain only one root."), e) {
658
+ case q:
659
+ this.openTag();
660
+ break;
661
+ case 47:
662
+ this.state = 35;
663
+ break;
664
+ default: z(e) || this.fail("disallowed character in tag name."), this.state = 36;
665
+ }
666
+ }
667
+ sOpenTagSlash() {
668
+ this.getCode() === q ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
669
+ }
670
+ sAttrib() {
671
+ let e = this.skipSpaces();
672
+ e !== H && (B(e) ? (this.unGet(), this.state = 37) : e === q ? this.openTag() : e === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
673
+ }
674
+ sAttribName() {
675
+ let e = this.captureNameChars();
676
+ e === K ? this.state = 39 : z(e) ? this.state = 38 : e === q ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : e !== H && this.fail("disallowed character in attribute name.");
677
+ }
678
+ sAttribNameSawWhite() {
679
+ let e = this.skipSpaces();
680
+ switch (e) {
681
+ case H: return;
682
+ case K:
683
+ this.state = 39;
684
+ break;
685
+ default: this.fail("attribute without value."), this.text = "", this.name = "", e === q ? this.openTag() : B(e) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
686
+ }
687
+ }
688
+ sAttribValue() {
689
+ let e = this.getCodeNorm();
690
+ Ve(e) ? (this.q = e, this.state = 40) : z(e) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
691
+ }
692
+ sAttribValueQuoted() {
693
+ let { q: e, chunk: t } = this, { i: n } = this;
694
+ for (;;) switch (this.getCode()) {
695
+ case e:
696
+ this.pushAttrib(this.name, this.text + t.slice(n, this.prevI)), this.name = this.text = "", this.q = null, this.state = 41;
697
+ return;
698
+ case 38:
699
+ this.text += t.slice(n, this.prevI), this.state = 14, this.entityReturnState = 40;
700
+ return;
701
+ case G:
702
+ case U:
703
+ case 9:
704
+ this.text += `${t.slice(n, this.prevI)} `, n = this.i;
705
+ break;
706
+ case Be:
707
+ this.text += t.slice(n, this.prevI), this.fail("disallowed character.");
708
+ return;
709
+ case H:
710
+ this.text += t.slice(n);
711
+ return;
712
+ }
713
+ }
714
+ sAttribValueClosed() {
715
+ let e = this.getCodeNorm();
716
+ z(e) ? this.state = 36 : e === q ? this.openTag() : e === 47 ? this.state = 35 : B(e) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
717
+ }
718
+ sAttribValueUnquoted() {
719
+ let e = this.captureTo(Ke);
720
+ switch (e) {
721
+ case 38:
722
+ this.state = 14, this.entityReturnState = 42;
723
+ break;
724
+ case Be:
725
+ this.fail("disallowed character.");
726
+ break;
727
+ case H: break;
728
+ default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", e === q ? this.openTag() : this.state = 36;
729
+ }
730
+ }
731
+ sCloseTag() {
732
+ let e = this.captureNameChars();
733
+ e === q ? this.closeTag() : z(e) ? this.state = 44 : e !== H && this.fail("disallowed character in closing tag.");
734
+ }
735
+ sCloseTagSawWhite() {
736
+ switch (this.skipSpaces()) {
737
+ case q:
738
+ this.closeTag();
739
+ break;
740
+ case H: break;
741
+ default: this.fail("disallowed character in closing tag.");
742
+ }
743
+ }
744
+ handleTextInRoot() {
745
+ let { i: e, forbiddenState: t } = this, { chunk: n, textHandler: r } = this;
746
+ t: for (;;) switch (this.getCode()) {
747
+ case Be:
748
+ if (this.state = 15, r !== void 0) {
749
+ let { text: t } = this, i = n.slice(e, this.prevI);
750
+ t.length === 0 ? i.length !== 0 && r(i) : (r(t + i), this.text = "");
751
+ }
752
+ t = 0;
753
+ break t;
754
+ case 38:
755
+ this.state = 14, this.entityReturnState = W, r !== void 0 && (this.text += n.slice(e, this.prevI)), t = 0;
756
+ break t;
757
+ case Y:
758
+ switch (t) {
759
+ case 0:
760
+ t = 1;
761
+ break;
762
+ case 1:
763
+ t = 2;
764
+ break;
765
+ case 2: break;
766
+ default: throw Error("impossible state");
767
+ }
768
+ break;
769
+ case q:
770
+ t === 2 && this.fail("the string \"]]>\" is disallowed in char data."), t = 0;
771
+ break;
772
+ case U:
773
+ r !== void 0 && (this.text += `${n.slice(e, this.prevI)}\n`), e = this.i, t = 0;
774
+ break;
775
+ case H:
776
+ r !== void 0 && (this.text += n.slice(e));
777
+ break t;
778
+ default: t = 0;
779
+ }
780
+ this.forbiddenState = t;
781
+ }
782
+ handleTextOutsideRoot() {
783
+ let { i: e } = this, { chunk: t, textHandler: n } = this, r = !1;
784
+ t: for (;;) {
785
+ let i = this.getCode();
786
+ switch (i) {
787
+ case Be:
788
+ if (this.state = 15, n !== void 0) {
789
+ let { text: r } = this, i = t.slice(e, this.prevI);
790
+ r.length === 0 ? i.length !== 0 && n(i) : (n(r + i), this.text = "");
791
+ }
792
+ break t;
793
+ case 38:
794
+ this.state = 14, this.entityReturnState = W, n !== void 0 && (this.text += t.slice(e, this.prevI)), r = !0;
795
+ break t;
796
+ case U:
797
+ n !== void 0 && (this.text += `${t.slice(e, this.prevI)}\n`), e = this.i;
798
+ break;
799
+ case H:
800
+ n !== void 0 && (this.text += t.slice(e));
801
+ break t;
802
+ default: z(i) || (r = !0);
803
+ }
804
+ }
805
+ r && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
806
+ }
807
+ pushAttribNS(e, t) {
808
+ let { prefix: n, local: r } = this.qName(e), i = {
809
+ name: e,
810
+ prefix: n,
811
+ local: r,
812
+ value: t
813
+ };
814
+ if (this.attribList.push(i), this.attributeHandler?.(i), n === "xmlns") {
815
+ let e = t.trim();
816
+ this.currentXMLVersion === "1.0" && e === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[r] = e, qe(this, r, e);
817
+ } else if (e === "xmlns") {
818
+ let e = t.trim();
819
+ this.topNS[""] = e, qe(this, "", e);
820
+ }
821
+ }
822
+ pushAttribPlain(e, t) {
823
+ let n = {
824
+ name: e,
825
+ value: t
826
+ };
827
+ this.attribList.push(n), this.attributeHandler?.(n);
828
+ }
829
+ end() {
830
+ this.sawRoot || this.fail("document must contain a root element.");
831
+ let { tags: e } = this;
832
+ for (; e.length > 0;) {
833
+ let t = e.pop();
834
+ this.fail(`unclosed tag: ${t.name}`);
835
+ }
836
+ this.state !== 0 && this.state !== W && this.fail("unexpected end.");
837
+ let { text: t } = this;
838
+ return t.length !== 0 && (this.textHandler?.(t), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
839
+ }
840
+ resolve(e) {
841
+ let t = this.topNS[e];
842
+ if (t !== void 0) return t;
843
+ let { tags: n } = this;
844
+ for (let r = n.length - 1; r >= 0; r--) if (t = n[r].ns[e], t !== void 0) return t;
845
+ return t = this.ns[e], t === void 0 ? this.opt.resolvePrefix?.(e) : t;
846
+ }
847
+ qName(e) {
848
+ let t = e.indexOf(":");
849
+ if (t === -1) return {
850
+ prefix: "",
851
+ local: e
852
+ };
853
+ let n = e.slice(t + 1), r = e.slice(0, t);
854
+ return (r === "" || n === "" || n.includes(":")) && this.fail(`malformed name: ${e}.`), {
855
+ prefix: r,
856
+ local: n
857
+ };
858
+ }
859
+ processAttribsNS() {
860
+ let { attribList: e } = this, t = this.tag;
861
+ {
862
+ let { prefix: e, local: n } = this.qName(t.name);
863
+ t.prefix = e, t.local = n;
864
+ let r = t.uri = this.resolve(e) ?? "";
865
+ e !== "" && (e === "xmlns" && this.fail("tags may not have \"xmlns\" as prefix."), r === "" && (this.fail(`unbound namespace prefix: ${JSON.stringify(e)}.`), t.uri = e));
866
+ }
867
+ if (e.length === 0) return;
868
+ let { attributes: n } = t, r = /* @__PURE__ */ new Set();
869
+ for (let t of e) {
870
+ let { name: e, prefix: i, local: a } = t, o, s;
871
+ i === "" ? (o = e === "xmlns" ? Ie : "", s = e) : (o = this.resolve(i), o === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`), o = i), s = `{${o}}${a}`), r.has(s) && this.fail(`duplicate attribute: ${s}.`), r.add(s), t.uri = o, n[e] = t;
872
+ }
873
+ this.attribList = [];
874
+ }
875
+ processAttribsPlain() {
876
+ let { attribList: e } = this, t = this.tag.attributes;
877
+ for (let { name: n, value: r } of e) t[n] !== void 0 && this.fail(`duplicate attribute: ${n}.`), t[n] = r;
878
+ this.attribList = [];
879
+ }
880
+ openTag() {
881
+ this.processAttribs();
882
+ let { tags: e } = this, t = this.tag;
883
+ t.isSelfClosing = !1, this.openTagHandler?.(t), e.push(t), this.state = W, this.name = "";
884
+ }
885
+ openSelfClosingTag() {
886
+ this.processAttribs();
887
+ let { tags: e } = this, t = this.tag;
888
+ t.isSelfClosing = !0, this.openTagHandler?.(t), this.closeTagHandler?.(t), (this.tag = e[e.length - 1] ?? null) === null && (this.closedRoot = !0), this.state = W, this.name = "";
889
+ }
890
+ closeTag() {
891
+ let { tags: e, name: t } = this;
892
+ if (this.state = W, this.name = "", t === "") return this.fail("weird empty close tag."), void (this.text += "</>");
893
+ let n = this.closeTagHandler, r = e.length;
894
+ for (; r-- > 0;) {
895
+ let r = this.tag = e.pop();
896
+ if (this.topNS = r.ns, n?.(r), r.name === t) break;
897
+ this.fail(`unexpected close tag: ${t}.`);
898
+ }
899
+ r === 0 ? this.closedRoot = !0 : r < 0 && (this.fail(`unmatched closing tag: ${t}.`), this.text += `</${t}>`);
900
+ }
901
+ parseEntity(e) {
902
+ if (e[0] !== "#") {
903
+ let t = this.ENTITIES[e];
904
+ return t === void 0 ? (this.fail(this.isName(e) ? "undefined entity." : "disallowed character in entity name."), `&${e};`) : t;
905
+ }
906
+ let t = NaN;
907
+ return e[1] === "x" && /^#x[0-9a-f]+$/i.test(e) ? t = parseInt(e.slice(2), 16) : /^#[0-9]+$/.test(e) && (t = parseInt(e.slice(1), 10)), this.isChar(t) ? String.fromCodePoint(t) : (this.fail("malformed character entity."), `&${e};`);
908
+ }
909
+ };
910
+ (Ye = Je ||= {}).Events = {
911
+ XmlDecl: "xmldecl",
912
+ Text: "text",
913
+ ProcessingInstruction: "processinginstruction",
914
+ Doctype: "doctype",
915
+ Comment: "comment",
916
+ OpenTagStart: "opentagstart",
917
+ Attribute: "attribute",
918
+ OpenTag: "opentag",
919
+ CloseTag: "closetag",
920
+ CDdata: "cdata",
921
+ Error: "error",
922
+ End: "end",
923
+ Ready: "ready"
924
+ }, Ye.parseStream = async (e, t, n) => {
925
+ let r = new $e({
926
+ position: !1,
927
+ ...n
928
+ }), i;
929
+ t.onOpenTagStart && r.on(Je.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && r.on(Je.Events.OpenTag, t.onOpenTag), t.onCloseTag && r.on(Je.Events.CloseTag, t.onCloseTag), t.onAttribute && r.on(Je.Events.Attribute, t.onAttribute), t.onText && r.on(Je.Events.Text, t.onText), t.onError && r.on(Je.Events.Error, t.onError);
930
+ let a = t.onEnd;
931
+ for (a && r.on(Je.Events.End, () => {
932
+ i = a();
933
+ });;) {
934
+ let { value: t, done: n } = await e.read();
935
+ if (n) break;
936
+ r.write(t);
937
+ }
938
+ return r.close(), i;
939
+ };
940
+ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null, Z = (e) => {
941
+ let t = parseInt(e);
942
+ return isNaN(t) ? null : t;
943
+ }, Q = (e) => {
944
+ let t = parseFloat(e);
945
+ return isNaN(t) ? null : t;
946
+ }, $ = null, et = class {
947
+ constructor() {
948
+ this._registeredVisitors = /* @__PURE__ */ new Map();
949
+ }
950
+ registerVisitor(e) {
951
+ this._registeredVisitors.set(e.from, e);
952
+ }
953
+ createEventHandler(e, t, n) {
954
+ let r = this._registeredVisitors, i = [], a = [], o = null, s = null, c = null, l = null, u = [], d = {
955
+ key: null,
956
+ source: e,
957
+ parent: null
958
+ }, f = null, p = !1, m = (e, t) => {
959
+ let n = c.attributes[e];
960
+ if (t) {
961
+ if (Array.isArray(t)) {
962
+ let e = t.length;
963
+ for (let r = 0; r < e; r++) if (n == null || (n = t[r](n), n == null)) return;
964
+ } else if (n == null || (n = t(n), n == null)) return;
965
+ }
966
+ return n;
967
+ }, h = {
968
+ getSource: () => f?.source ?? null,
969
+ setSource: (e) => {
970
+ f.source = e;
971
+ },
972
+ setKey: (e) => {
973
+ f.key = e;
974
+ },
975
+ getFrom: () => c,
976
+ getAttribute: (e, t) => m(e, t) ?? null,
977
+ hasAttribute: (e) => h.getAttribute(e) !== null,
978
+ getParent: () => {
979
+ let e = u[u.length - 2];
980
+ return e.parent ?? e.source;
981
+ },
982
+ getPath: () => {
983
+ let e = [], t = a.length;
984
+ for (let n = 0; n < t; n++) e.push(a[n].local);
985
+ return e.join("\\");
986
+ },
987
+ parseAttribute: m,
988
+ copyToObject: (e, t, n, r) => {
989
+ let i = m(r ?? t, n);
990
+ i !== void 0 && (e[t] = i);
991
+ },
992
+ copyTo: (e, t, n) => {
993
+ let r = m(n ?? e, t);
994
+ r !== void 0 && (f.source[e] = r);
995
+ },
996
+ warn: (e) => {
997
+ n ? n?.(e) : console.warn(e);
998
+ }
999
+ };
1000
+ return {
1001
+ onOpenTag: (e) => {
1002
+ let t = e.name, n = t.indexOf(":");
1003
+ n !== -1 && (t = t.slice(n + 1));
1004
+ let m = (i.length > 0 ? i[i.length - 1] : r).get(t);
1005
+ if (o = {
1006
+ local: t,
1007
+ visitor: m,
1008
+ tag: e,
1009
+ destination: null
1010
+ }, p) return a.push(o), s = t, void (c = e);
1011
+ l = o?.visitor ?? null, s = t, c = e;
1012
+ let g = !!m && m.to === null;
1013
+ if (m && !g && m.scope) {
1014
+ let e = m.scope(h);
1015
+ e === null ? g = !0 : e && (i.push(e), o.pushedScope = !0);
1016
+ }
1017
+ m && (a.length === 0 ? (f = d, o.destination = f, o.pushedDestination = !0, u.push(f)) : g ? (f = null, o.destination = null) : m.transparent ? o.destination = f : (f = {
1018
+ key: null,
1019
+ source: {},
1020
+ parent: null
1021
+ }, o.destination = f, o.pushedDestination = !0, u.push(f))), a.push(o), p = g;
1022
+ let _ = l?.openTag?.(h);
1023
+ _ !== void 0 && (f.parent = _);
1024
+ },
1025
+ onCloseTag: (e) => {
1026
+ let t = e.name, r = t.indexOf(":");
1027
+ if (r !== -1 && (t = t.slice(r + 1)), t !== s) throw Error(`mismatch open/close tag: '${t}'/'${s}'`);
1028
+ p || l?.closeTag?.(h);
1029
+ let m = a.pop() ?? null;
1030
+ o = a[a.length - 1] ?? null, m?.pushedScope && i.pop();
1031
+ let g = m?.destination;
1032
+ if (g && m.pushedDestination) {
1033
+ u.pop(), f = u[u.length - 1] ?? d;
1034
+ let e = m.visitor;
1035
+ e && e.to && g.source !== void 0 && (Array.isArray(e.to) ? f.source.push ? f.source.push(g.source) : n?.(`Unable to parse array for ${e.from} at ${h.getPath()}`) : g.key ? f.source[g.key] = g.source : typeof e.to == "string" && (f.source[e.to] = g.source));
1036
+ }
1037
+ s = o?.local ?? null, c = o?.tag ?? null, l = o?.visitor ?? null, p = !o?.destination;
1038
+ },
1039
+ onText: (e) => {
1040
+ l?.text?.(e, h);
1041
+ },
1042
+ onEnd: t
1043
+ };
1044
+ }
1045
+ }, tt = `IFERROR(${d}(`, nt = tt.toUpperCase(), rt = g.toUpperCase(), it = { kind: "none" }, at = { kind: "spilled" }, ot = (e, t) => {
1046
+ if (e.charCodeAt(t) !== 34) return null;
1047
+ let n = "", r = t + 1;
1048
+ for (; r < e.length;) if (e.charCodeAt(r) === 34) {
1049
+ if (e.charCodeAt(r + 1) !== 34) return {
1050
+ value: n,
1051
+ end: r + 1
1052
+ };
1053
+ n += "\"", r += 2;
1054
+ } else n += e[r], r++;
1055
+ return null;
1056
+ }, st = (e) => {
1057
+ let t = [], n = 0;
1058
+ for (; n < e.length;) {
1059
+ let r = e.charCodeAt(n);
1060
+ if (r === 34) {
1061
+ let t = ot(e, n);
1062
+ if (t === null) break;
1063
+ n = t.end;
1064
+ continue;
1065
+ }
1066
+ if (!(r >= 65 && r <= 90 || r >= 97 && r <= 122 || r === 95)) {
1067
+ n++;
1068
+ continue;
1069
+ }
1070
+ let i = n + 1;
1071
+ for (; i < e.length;) {
1072
+ let t = e.charCodeAt(i);
1073
+ if (!(t >= 65 && t <= 90 || t >= 97 && t <= 122 || t >= 48 && t <= 57 || t === 95 || t === 46)) break;
1074
+ i++;
1075
+ }
1076
+ e.charCodeAt(i) === 40 && t.push(e.slice(n, i).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), n = i;
1077
+ }
1078
+ return t;
1079
+ }, ct = (e) => {
1080
+ let t = 0, n = 0;
1081
+ for (let r = 0; r < e.length; r++) {
1082
+ let i = e[r];
1083
+ if (i !== "\"" && i !== "'") {
1084
+ if (i === "[") n++;
1085
+ else if (i === "]") n > 0 && n--;
1086
+ else if (n === 0) {
1087
+ if (i === "(") t++;
1088
+ else if (i === ")" && (t--, t < 0)) return !1;
1089
+ }
1090
+ } else {
1091
+ for (r++; r < e.length;) {
1092
+ if (e[r] === i) {
1093
+ if (e[r + 1] === i) {
1094
+ r += 2;
1095
+ continue;
1096
+ }
1097
+ break;
1098
+ }
1099
+ r++;
1100
+ }
1101
+ if (r >= e.length) return !1;
1102
+ }
1103
+ }
1104
+ return t === 0 && n === 0;
1105
+ }, lt = class {
1106
+ static {
1107
+ this.Collapsed = 1;
1108
+ }
1109
+ static {
1110
+ this.CustomFormat = 2;
1111
+ }
1112
+ static {
1113
+ this.CustomHeight = 4;
1114
+ }
1115
+ static {
1116
+ this.Hidden = 8;
1117
+ }
1118
+ static {
1119
+ this.Ht = 16;
1120
+ }
1121
+ static {
1122
+ this.OutlineLevel = 32;
1123
+ }
1124
+ static {
1125
+ this.Ph = 64;
1126
+ }
1127
+ static {
1128
+ this.R = 128;
1129
+ }
1130
+ static {
1131
+ this.S = 256;
1132
+ }
1133
+ static {
1134
+ this.Spans = 512;
1135
+ }
1136
+ static {
1137
+ this.ThickBot = 1024;
1138
+ }
1139
+ static {
1140
+ this.ThickTop = 2048;
1141
+ }
1142
+ }, ut = (e, t, n) => {
1143
+ if (e[0].value[0] === e[1].value[0]) return t;
1144
+ }, dt = {
1145
+ colStart: 0,
1146
+ colEnd: 0,
1147
+ rowStart: 0,
1148
+ rowEnd: 0
1149
+ }, ft = (e, t, n, r, i, a, o) => {
1150
+ let s = !1, c = !1, l = [], u = !1, d = null, f = null, m = null, h = null, g = null, _ = null, v = o?.get("richData") ?? pe.EmptyArray, ee = o?.get("dummyWrapped") ?? null, te = w.normalizeA1ToR1C1, ne = T.createConflatingRanges(), re = /* @__PURE__ */ new Map(), ie = [], ae = !1, oe = !1, se = null, ce = !1, le = T.createConflatingRanges(), ue = !1, y = -1, b = -1, x = null, S = null, de = null, C = [], fe = null, D = -2, O = 0, k = "", he = "", ge = "", _e = "", ve = "", A = "", j = "", ye = "", M = "", be = "", N = "", xe = "", Se = "", Ce = "", P = !0, F = null, I = !1, we = !1, L = null, Te = 0;
1151
+ return {
1152
+ ...n,
1153
+ onEnd: () => {
1154
+ C.length > 0 && (t.rows = w.runsToRefs(C, !1));
1155
+ let r = ne.done(ut), i = r.length;
1156
+ if (i > 0) {
1157
+ let e = /* @__PURE__ */ new Set();
1158
+ for (let t = 0; t < ie.length; t++) e.add(ie[t][0].split(":")[0]);
1159
+ let n = Array(i);
1160
+ for (let t = 0; t < i; t++) {
1161
+ let i = r[t], a = w.rangeToString(i), o = i.value[1], s = w.resolveRelativeToA1(o, i.rowStart, i.colStart);
1162
+ s && !e.has(a.split(":")[0]) && ct(s) && (s = `${p}(${s})`), n[t] = [a, s];
1163
+ }
1164
+ t.formulas = n;
1165
+ }
1166
+ let a = le.done(!0), o = a.length;
1167
+ if (o > 0) {
1168
+ let e = Array(o);
1169
+ for (let t = 0; t < o; t++) {
1170
+ let n = a[t];
1171
+ e[t] = w.rangeToString(n);
1172
+ }
1173
+ t.volatile = e;
1174
+ }
1175
+ ie.length > 0 && (t.formulaArray = [...ie]);
1176
+ let s = l.length;
1177
+ if (s > 0) {
1178
+ l.sort(T.createRangeComparator(me.Axis.Column));
1179
+ let e = l[0], n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value, o = [];
1180
+ o.push(e);
1181
+ let c = null;
1182
+ for (let t = 1; t < s; t++) c = l[t], a !== c.value || n !== c.colStart || r !== c.colEnd || i + 1 !== c.rowEnd ? (o.push(c), e = c, n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value) : (i = c.rowEnd, e.rowEnd = i);
1183
+ let u = o.length, d = Array(u);
1184
+ for (let e = 0; e < u; e++) {
1185
+ let t = o[e];
1186
+ d[e] = [w.rangeToString(t), t.value];
1187
+ }
1188
+ t.directStyles = d;
1189
+ }
1190
+ let c = e.build();
1191
+ c && (t.data = c.tuples), n?.onEnd?.();
1192
+ },
1193
+ onOpenTag: (e) => {
1194
+ let r = e.name, p = r.indexOf(":");
1195
+ if (p !== -1 && (r = r.slice(p + 1)), Te++, Te % 196608 == 0 && i?.(Te), S) {
1196
+ let t = e.attributes;
1197
+ switch (r) {
1198
+ case "v":
1199
+ c = !0;
1200
+ break;
1201
+ case "f":
1202
+ switch (u = !0, t.t ?? null) {
1203
+ case null:
1204
+ case "normal": break;
1205
+ case "shared":
1206
+ let e = t.si;
1207
+ f = t.ref, d = e;
1208
+ break;
1209
+ case "array":
1210
+ f = t.ref, se = f;
1211
+ break;
1212
+ case "datatable": f = t.ref, u = !0;
1213
+ }
1214
+ let e = t.ca;
1215
+ e !== void 0 && (ce = e === "1");
1216
+ break;
1217
+ case "is":
1218
+ ue = !0;
1219
+ return;
1220
+ }
1221
+ ue && !u && a?.onOpenTag?.(e);
1222
+ return;
1223
+ }
1224
+ if (s) {
1225
+ if (r === "c") {
1226
+ S = e;
1227
+ let t = e.attributes, n = t.r;
1228
+ b = w.fastStringToCol(n);
1229
+ let r = t.t;
1230
+ r === void 0 ? de = null : (de = r, de === "str" && (ue = !0));
1231
+ let i = t.s;
1232
+ i === void 0 && (L !== null || we) && (i = "0"), i !== void 0 && (i = parseInt(i), F && F.value === i && F.colEnd + 1 === b ? F.colEnd = b : (F = {
1233
+ colStart: b,
1234
+ rowStart: y,
1235
+ colEnd: b,
1236
+ rowEnd: y,
1237
+ value: i
1238
+ }, l.push(F))), se = null, oe = !1;
1239
+ let a = t.cm;
1240
+ ae = a !== void 0 && ((e) => {
1241
+ let t = o?.get("metadata")?.cells;
1242
+ if (!t) return !1;
1243
+ let n = parseInt(e, 10);
1244
+ return !(!Number.isFinite(n) || n < 1) && !0 === t[n - 1]?.get("XLDAPR")?.fDynamic;
1245
+ })(a);
1246
+ let s = t.vm;
1247
+ if (s !== void 0) {
1248
+ let e = v[parseInt(s) - 1];
1249
+ if (E.isError(e)) {
1250
+ let t = e.getCode();
1251
+ x = {
1252
+ t: "e",
1253
+ v: t
1254
+ }, ae && t === E.Code.Spill && (oe = !0);
1255
+ }
1256
+ }
1257
+ }
1258
+ } else {
1259
+ if (r === "row") {
1260
+ s = !0;
1261
+ let t = e.attributes.r;
1262
+ if (y = parseInt(t) - 1, O = 0, he = e.attributes.customHeight, he !== void 0 && (O |= lt.CustomHeight), he !== M && (P = !0, M = he), k = e.attributes.ht, k !== void 0 && (O |= lt.Ht), k !== ye && (P = !0, ye = k), ge = e.attributes.hidden, ge !== void 0 && (O |= lt.Hidden), ge !== be && (P = !0, be = ge), ve = e.attributes.s, ve !== void 0 && (O |= lt.S), ve !== xe && (P = !0, xe = ve), _e = e.attributes.customFormat, _e !== void 0 && (O |= lt.CustomFormat), _e !== N && (P = !0, N = _e), A = e.attributes.outlineLevel, A !== void 0 && (O |= lt.OutlineLevel), A !== Se && (P = !0, Se = A), j = e.attributes.collapsed, j !== void 0 && (O |= lt.Collapsed), j !== Ce && (P = !0, Ce = j), O !== 0) if (D + 1 !== y || P) {
1263
+ let e = he !== void 0 && (he === "1" || he === "true"), t = _e !== void 0 && (_e === "1" || _e === "true");
1264
+ L = t && ve !== void 0 ? ve : null, t && L === null && (L = "0"), fe = {
1265
+ min: y,
1266
+ max: y,
1267
+ value: {
1268
+ sz: k === void 0 ? -1 : parseFloat(k),
1269
+ csz: e,
1270
+ h: ge !== void 0 && (ge === "1" || ge === "true"),
1271
+ s: L === null ? void 0 : L === "0" ? 0 : parseInt(L),
1272
+ l: A === void 0 || A === "0" ? 0 : parseInt(A),
1273
+ cl: j !== void 0 && (j === "1" || j === "true")
1274
+ }
1275
+ }, C.push(fe);
1276
+ } else fe.max = y;
1277
+ D = y, P = !1;
1278
+ return;
1279
+ }
1280
+ if (!I && r === "sheetData") {
1281
+ I = !0;
1282
+ let e = t.cols, n = e ? e.length : 0;
1283
+ for (let t = 0; !we && t < n; t++) e[t].v.s && (we = !0);
1284
+ }
1285
+ n?.onOpenTag?.(e);
1286
+ }
1287
+ },
1288
+ onCloseTag: (t) => {
1289
+ let r = t.name;
1290
+ if (!u || r !== "c" && r !== "f" || (d && (h = re.get(d) ?? null), h && (ne.append(y, b, h), ce && le.append(y, b)), se !== null && ie.push([se, ae ? oe ? "dynamicSpillError" : "dynamic" : "static"]), u = !1, h = null, d = null, f = null, c = !1, ce = !1, se = null, ae = !1, oe = !1), S) {
1291
+ let n = r.indexOf(":");
1292
+ if (n !== -1 && (r = r.slice(n + 1)), ue) if (r === "is" || r === "v") {
1293
+ let t = a?.onEnd?.();
1294
+ t != null && e.pushAt(y, b, "" + t);
1295
+ } else r !== "f" && a?.onCloseTag?.(t);
1296
+ c &&= !1, r === "c" && (S = null, ue = !1);
1297
+ return;
1298
+ }
1299
+ if (s) return s = !1, void (F = null);
1300
+ n?.onCloseTag?.(t);
1301
+ },
1302
+ onText: (i) => {
1303
+ let o = i.trim();
1304
+ if (c) {
1305
+ switch (x = null, de) {
1306
+ case null:
1307
+ case "n":
1308
+ x = parseFloat(o);
1309
+ break;
1310
+ case "b":
1311
+ x = o === "1" || o === "true";
1312
+ break;
1313
+ case "s":
1314
+ x = o;
1315
+ break;
1316
+ case "e":
1317
+ if (o === "#VALUE!") {
1318
+ let e = S.attributes.vm;
1319
+ if (e !== void 0) {
1320
+ let t = v[parseInt(e) - 1];
1321
+ if (E.isError(t)) {
1322
+ x = {
1323
+ t: "e",
1324
+ v: t.getCode()
1325
+ };
1326
+ break;
1327
+ }
1328
+ }
1329
+ }
1330
+ let e = E.getBuiltInByLabel(o);
1331
+ e ? x = {
1332
+ t: "e",
1333
+ v: e.getCode()
1334
+ } : (x = o, r?.(`Unknown formula error '${o}' in cell ${w.cellToString({
1335
+ colIndex: b,
1336
+ rowIndex: y
1337
+ })}`));
1338
+ break;
1339
+ case "str":
1340
+ case "inlineStr": ue = !0;
1341
+ }
1342
+ x !== null && e.pushAt(y, b, x);
1343
+ }
1344
+ if (d) {
1345
+ if (g === d) h = _;
1346
+ else {
1347
+ if (h = re.get(d) ?? null, !h) {
1348
+ let e = [];
1349
+ m = te(o, y, b, e), h = [
1350
+ m,
1351
+ e,
1352
+ o
1353
+ ], re.set(d, h);
1354
+ }
1355
+ g = d, _ = h;
1356
+ }
1357
+ d = null;
1358
+ }
1359
+ if (u) {
1360
+ if (ee !== null) {
1361
+ let e = ((e) => {
1362
+ if (e.length < tt.length || e.slice(0, tt.length).toUpperCase() !== nt) return it;
1363
+ let t = ot(e, tt.length);
1364
+ if (t === null || e.charCodeAt(t.end) !== 41 || e.charCodeAt(t.end + 1) !== 44 || e.charCodeAt(e.length - 1) !== 41) return it;
1365
+ let n = t.value;
1366
+ return n.toUpperCase() === rt ? at : n.length === 0 ? it : {
1367
+ kind: "formula",
1368
+ formula: n
1369
+ };
1370
+ })(o);
1371
+ e.kind !== "none" && ee.push({
1372
+ sheet: t,
1373
+ rowIndex: y,
1374
+ colIndex: b,
1375
+ formula: e.kind === "formula" ? e.formula : null
1376
+ });
1377
+ }
1378
+ let e = [];
1379
+ m = te(o, y, b, e), h = [
1380
+ m,
1381
+ e,
1382
+ o
1383
+ ];
1384
+ }
1385
+ ue ? a?.onText?.(i) : s || n?.onText?.(o);
1386
+ }
1387
+ };
1388
+ }, pt = (e) => {
1389
+ let t = e.indexOf(":");
1390
+ return t === -1 ? e : e.slice(t + 1);
1391
+ }, mt = {
1392
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
1393
+ "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
1394
+ "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
1395
+ "application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
1396
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
1397
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
1398
+ "application/vnd.ms-excel.worksheet": "sheets",
1399
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
1400
+ "application/vnd.ms-excel.chartsheet": "charts",
1401
+ "application/vnd.ms-excel.macrosheet+xml": "macros",
1402
+ "application/vnd.ms-excel.macrosheet": "macros",
1403
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
1404
+ "application/vnd.ms-excel.dialogsheet": "dialogs",
1405
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
1406
+ "application/vnd.ms-excel.sharedStrings": "strs",
1407
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": "styles",
1408
+ "application/vnd.ms-excel.styles": "styles",
1409
+ "application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
1410
+ "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
1411
+ "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
1412
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments",
1413
+ "application/vnd.ms-excel.comments": "comments",
1414
+ "application/vnd.ms-excel.threadedcomments+xml": "threadedcomments",
1415
+ "application/vnd.ms-excel.person+xml": "people",
1416
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata",
1417
+ "application/vnd.ms-excel.sheetMetadata": "metadata",
1418
+ "application/vnd.ms-excel.externalLink": "links",
1419
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
1420
+ "application/vnd.openxmlformats-officedocument.theme+xml": "themes"
1421
+ }, ht = (e) => e.startsWith("/") ? e.slice(1) : e, gt = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, _t = async (u, d) => {
1422
+ let { password: p, onVBA: g, profile: _, createWorkbookOptions: v = {}, ...S } = d ?? {}, pe = v.origin && typeof v.origin != "string" ? v.origin : null, T = _ ? new ye(typeof _ == "function" ? _ : void 0) : null, E = [], me = d?.progress, A = me?.onProgress ? me.onProgress.bind(me) : void 0, M = u.byteLength, be = 0, N = 0, xe = A ? (e) => {
1423
+ if (be <= 0) return;
1424
+ N += e;
1425
+ let t = Math.min(M, Math.round(N / be * M));
1426
+ A(t, M);
1427
+ } : void 0, Se = import("./Ch5gA6g56cOtRvJA.mjs"), Ce = null;
1428
+ try {
1429
+ Ce = new DOMParser();
1430
+ } catch {}
1431
+ let P = null;
1432
+ try {
1433
+ P = new XMLSerializer();
1434
+ } catch {}
1435
+ let F, I, we, L = null;
1436
+ Ce || (L = import("./B20zuEvdeypuSU5s.mjs").then((t) => e(t.default, 1)));
1437
+ try {
1438
+ let [e, t] = await Promise.all([L, Se]);
1439
+ F = new t.DOMTransformer(), I = Ce ?? new e.DOMParser(), we = P ?? new e.XMLSerializer();
1440
+ } catch (e) {
1441
+ throw Error("Unable to load XLSX parser.", { cause: e });
1442
+ }
1443
+ let Te = (e) => we.serializeToString(e), R;
1444
+ try {
1445
+ R = await j.create(u);
1446
+ } catch (e) {
1447
+ throw new fe("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: e });
1448
+ }
1449
+ T?.mark("zip-open");
1450
+ try {
1451
+ if (!R.has("[Content_Types].xml")) throw new fe("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1452
+ let e = (e) => {
1453
+ let t = R.getEntry(e);
1454
+ return t ? { content: t } : void 0;
1455
+ }, u = {
1456
+ workbooks: [],
1457
+ sheets: [],
1458
+ charts: [],
1459
+ dialogs: [],
1460
+ macros: [],
1461
+ strs: [],
1462
+ comments: [],
1463
+ threadedcomments: [],
1464
+ links: [],
1465
+ coreprops: [],
1466
+ extprops: [],
1467
+ custprops: [],
1468
+ themes: [],
1469
+ styles: [],
1470
+ metadata: [],
1471
+ people: [],
1472
+ sst: "",
1473
+ style: "",
1474
+ defaults: {}
1475
+ };
1476
+ {
1477
+ let e = ((e, t) => ({
1478
+ onOpenTag: (t) => {
1479
+ let n = ((e) => {
1480
+ let t = e.indexOf(":");
1481
+ return t === -1 ? e : e.slice(t + 1);
1482
+ })(t.name), r = t.attributes;
1483
+ if (n === "Override") {
1484
+ let t = r.ContentType, n = r.PartName;
1485
+ if (!t || !n) return;
1486
+ let i = mt[t], a = i ? e[i] : void 0;
1487
+ Array.isArray(a) && a.push(n);
1488
+ } else if (n === "Default") {
1489
+ let t = r.Extension, n = r.ContentType;
1490
+ t && (e.defaults[t.toLowerCase()] = n);
1491
+ }
1492
+ },
1493
+ onEnd: () => {
1494
+ e.sst = e.strs.length > 0 ? e.strs[0] : "", e.style = e.styles.length > 0 ? e.styles[0] : "";
1495
+ },
1496
+ onError: (e) => {
1497
+ t?.(`Error parsing content types: ${e?.message ?? e}`);
1498
+ }
1499
+ }))(u, (e) => {
1500
+ E.push([e, "[Content_Types].xml"]);
1501
+ }), t = await R.getTextStream("[Content_Types].xml");
1502
+ if (!t) throw Error("Error parsing content types: '[Content_Types].xml'");
1503
+ try {
1504
+ await Je.parseStream(t, e, { xmlns: !1 });
1505
+ } catch (e) {
1506
+ throw Error("Error parsing content types: '[Content_Types].xml'", { cause: e });
1507
+ }
1508
+ pe && await R.getBuffer("[Content_Types].xml");
1509
+ }
1510
+ T?.mark("content-types");
1511
+ let d = u.sst, p = /* @__PURE__ */ new Set();
1512
+ for (let e of u.sheets) p.add(ht(e));
1513
+ d && p.add(ht(d));
1514
+ for (let e of p) be += R.uncompressedSize(e);
1515
+ if (await R.prefetch((e) => !p.has(e) && !gt.test(e)), T?.mark("prefetch-side-parts"), u.workbooks.length === 0) {
1516
+ let t = s("_rels/.rels", e, I, F);
1517
+ if (t) {
1518
+ for (let e of t.values()) if (e.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" && e.target) {
1519
+ u.workbooks.push(e.target);
1520
+ break;
1521
+ }
1522
+ }
1523
+ }
1524
+ if (u.workbooks.length === 0) throw new fe("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1525
+ u.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], u.richdata = ["/xl/richData/rdrichvalue.xml"];
1526
+ let S = v?.resources ?? new he(), k = S.beginPersist(), j = {}, ye = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Map();
1527
+ N.set("richTypes", []);
1528
+ let Se = [];
1529
+ N.set("dummyWrapped", Se);
1530
+ let Ce = c("metadata", u, e, I, F).entries().next()?.value?.[1]?.metadata;
1531
+ Ce && N.set("metadata", Ce);
1532
+ let P = /* @__PURE__ */ new Map(), we = [], L = (t, n = P) => {
1533
+ let r = t.lastIndexOf("/"), i = t.substring(0, r + 1) + "_rels/" + t.substring(r + 1, t.length) + ".rels", a = n.get(i);
1534
+ return a || (a = s(i, e, I, F, V), n.set(i, a)), a;
1535
+ }, Ee = (s, c, l, u = P) => {
1536
+ let d = L(c, u).get(s), f = d?.target;
1537
+ if (!f) return null;
1538
+ if (d.targetMode === "External") {
1539
+ if (!l) return d.target;
1540
+ let e = S.add({ source: { external: d.target } });
1541
+ return e.addReference(j), ye.add(e), k.toResourceId(e);
1542
+ }
1543
+ let p = c.lastIndexOf("/"), m = c.substring(0, p + 1);
1544
+ f.startsWith("/") || (f = m + f), f = a(f);
1545
+ let h = F?.getVisitorParamsState().get("dxfs"), g = u.get(f);
1546
+ if (!g) if (d.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
1547
+ let e = {};
1548
+ g = e, we.push((async () => {
1549
+ let t = ((e, t, r, i, a, s, c, l) => {
1550
+ let u = new et(), d = new _e.TransposedBuilder(), f = null;
1551
+ u.registerVisitor({
1552
+ from: "autoFilter",
1553
+ to: "autoTable",
1554
+ openTag: (e) => {
1555
+ let t = e.getAttribute("ref"), n = w.fastStringToRange(t);
1556
+ e.getSource().r = n, e.getSource().v = {};
1557
+ },
1558
+ closeTag: (e) => {
1559
+ let t = e.getSource(), n = t.v, r = n.hiddenButtons;
1560
+ if (Array.isArray(r)) {
1561
+ let e = r.length, i = t.r, a = i.colEnd - i.colStart + 1;
1562
+ e === 0 ? n.hiddenButtons = !1 : e === a && (n.hiddenButtons = !0);
1563
+ }
1564
+ }
1565
+ }), u.registerVisitor({
1566
+ from: "conditionalFormatting",
1567
+ to: {},
1568
+ openTag: (e) => {
1569
+ let t = e.getParent();
1570
+ t.conditionals ||= [];
1571
+ let n = e.getAttribute("sqref");
1572
+ n &&= n.trim().split(/\s+/).join(",");
1573
+ let r = {
1574
+ r: n,
1575
+ conditionals: t.conditionals
1576
+ }, i = e.getAttribute("pivot", X);
1577
+ i !== null && (r.pivot = i), e.setSource(r);
1578
+ }
1579
+ }), u.registerVisitor({
1580
+ from: "cfRule",
1581
+ to: {},
1582
+ openTag: (e) => {
1583
+ let t = e.getParent();
1584
+ if (!t?.r) return;
1585
+ let n = e.getSource() ?? {};
1586
+ t.pivot !== void 0 && (n.pivot = t.pivot), t.conditionals.push({
1587
+ r: t.r,
1588
+ v: null,
1589
+ rule: n
1590
+ }), e.copyToObject(n, "type", $), e.copyToObject(n, "priority", Z), e.copyToObject(n, "stopIfTrue", X);
1591
+ let r = e.getAttribute("dxfId", Z);
1592
+ if (r !== null) {
1593
+ let t = i?.get(r);
1594
+ t ||= (s?.(`Unable to load conditional color. Invalid dxfI: '${r}' at '${e.getPath()}'.`), {}), n.style = t;
1595
+ }
1596
+ e.copyToObject(n, "aboveAverage", X), e.copyToObject(n, "equalAverage", X), e.copyToObject(n, "stdDev", Z), e.copyToObject(n, "bottom", X), e.copyToObject(n, "percent", X), e.copyToObject(n, "rank", Z), e.copyToObject(n, "operator", $), e.copyToObject(n, "text", $), e.copyToObject(n, "timePeriod", $);
1597
+ },
1598
+ closeTag: (e) => {
1599
+ let t = e.getParent();
1600
+ if (!t?.r) return;
1601
+ let n = t.conditionals[t.conditionals.length - 1], r = n?.rule;
1602
+ if (!r) return;
1603
+ let i = {}, a = ee(r, s);
1604
+ a && (i.condition = a), r.style && (i.style = r.style), r.scale && (i.scale = r.scale), r.stopIfTrue && (i.stopIfTrue = !0), r.pivot && (i.pivot = !0), n.v = i, n.priority = r.priority, r.x14Id && (n.x14Id = r.x14Id), delete n.rule;
1605
+ }
1606
+ });
1607
+ let p = (e) => {
1608
+ let t = e.conditions ?? [], n = [];
1609
+ for (let e = 0; e < t.length; e++) {
1610
+ let r = t[e], i = {};
1611
+ r.type && (i.type = r.type), r.value !== void 0 && (i.value = r.value), r.exclusive && (i.exclusive = !0), n.push(i);
1612
+ }
1613
+ return n;
1614
+ };
1615
+ u.registerVisitor({
1616
+ from: "colorScale",
1617
+ to: {},
1618
+ openTag: (e) => {},
1619
+ closeTag: (e) => {
1620
+ let t = e.getSource(), n = t.colors ?? [], r = p(t);
1621
+ for (let e = 0; e < r.length; e++) r[e].color = n[e];
1622
+ e.getParent().scale = {
1623
+ type: O.ScaleType.ColorScale,
1624
+ stops: r
1625
+ };
1626
+ }
1627
+ }), u.registerVisitor({
1628
+ from: "dataBar",
1629
+ to: {},
1630
+ openTag: (e) => {
1631
+ e.copyTo("maxLength", Z), e.copyTo("minLength", Z), e.copyTo("showValue", X);
1632
+ },
1633
+ closeTag: (e) => {
1634
+ let t = e.getSource(), n = {
1635
+ type: O.ScaleType.DataBar,
1636
+ stops: p(t)
1637
+ }, r = t.colors?.[0];
1638
+ r && (n.color = r), t.minLength !== void 0 && (n.minLength = t.minLength), t.maxLength !== void 0 && (n.maxLength = t.maxLength), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
1639
+ }
1640
+ }), u.registerVisitor({
1641
+ from: "iconSet",
1642
+ to: {},
1643
+ openTag: (e) => {
1644
+ e.copyTo("iconSet", $), e.copyTo("reverse", X), e.copyTo("showValue", X);
1645
+ },
1646
+ closeTag: (e) => {
1647
+ let t = e.getSource(), n = {
1648
+ type: O.ScaleType.IconSet,
1649
+ stops: p(t)
1650
+ };
1651
+ t.iconSet !== void 0 && (n.iconSet = t.iconSet), t.reverse !== void 0 && (n.reverse = t.reverse), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
1652
+ }
1653
+ }), u.registerVisitor({
1654
+ from: "formula",
1655
+ to: {},
1656
+ text: (e, t) => {
1657
+ let n = t.getParent(), r = n.formulas;
1658
+ r || (r = [], n.formulas = r), r.push(e);
1659
+ }
1660
+ }), u.registerVisitor({
1661
+ from: "cfvo",
1662
+ to: {},
1663
+ openTag: (e) => {
1664
+ let t = e.getParent();
1665
+ t.conditions ||= [];
1666
+ let n = e.getSource();
1667
+ t.conditions.push(n), e.copyTo("type", $), n.type === O.ColorStopType.Formula ? e.copyTo("value", $, "val") : e.copyTo("value", Q, "val"), !1 === e.getAttribute("gte", X) && (n.exclusive = !0);
1668
+ }
1669
+ }), u.registerVisitor({
1670
+ from: "color",
1671
+ to: {},
1672
+ openTag: (e) => {
1673
+ let t = e.getParent();
1674
+ t.colors ||= [];
1675
+ let r = n((t) => e.getAttribute(t));
1676
+ t.colors.push(r);
1677
+ }
1678
+ }), u.registerVisitor({
1679
+ from: "filterColumn",
1680
+ to: {},
1681
+ openTag: (e) => {
1682
+ let t = e.getParent().v, n = parseInt(e.getAttribute("colId")), r = e.getSource();
1683
+ r.index = n;
1684
+ let i = t.filter;
1685
+ i || (i = { conditions: [] }, t.filter = i);
1686
+ let a = i.conditions;
1687
+ if (a || (a = [], i.conditions = a), a.push(r), e.getAttribute("hiddenButton", X) && t) {
1688
+ let e = t.hiddenButtons;
1689
+ e || (e = [], t.hiddenButtons = e), e.push(n);
1690
+ }
1691
+ if (e.getAttribute("showButton", X) && t) {
1692
+ let e = t.showButtons;
1693
+ e || (e = [], t.showButtons = e), e.push(n);
1694
+ }
1695
+ return r;
1696
+ }
1697
+ }), u.registerVisitor({
1698
+ from: "colorFilter",
1699
+ openTag: (e) => {
1700
+ let t = e.getParent(), n = {};
1701
+ t.operator = D.BuiltInOperatorNames.Color, t.param = n, e.copyToObject(n, "cellColor"), e.copyToObject(n, "styleId", Z, "dxfId");
1702
+ }
1703
+ }), u.registerVisitor({
1704
+ from: "iconFilter",
1705
+ openTag: (e) => {
1706
+ let t = e.getParent(), n = {};
1707
+ t.operator = D.BuiltInOperatorNames.Icon, t.param = n, e.copyToObject(n, "iconId", Z), e.copyToObject(n, "iconSet", $);
1708
+ }
1709
+ }), u.registerVisitor({
1710
+ from: "top10",
1711
+ openTag: (e) => {
1712
+ let t = e.getParent(), n = {};
1713
+ t.operator = D.BuiltInOperatorNames.TopN, t.param = n, e.copyToObject(n, "filterVal", Q), e.copyToObject(n, "percent", X), e.copyToObject(n, "top", X), e.copyToObject(n, "limit", Q, "val");
1714
+ }
1715
+ }), u.registerVisitor({
1716
+ from: "dynamicFilter",
1717
+ openTag: (e) => {
1718
+ let t = e.getParent(), n = {};
1719
+ t.operator = D.BuiltInOperatorNames.TimePeriod, t.param = n;
1720
+ let r = e.getAttribute("type");
1721
+ Object.values(D.AverageType).includes(r) ? (t.operator = D.BuiltInOperatorNames.Average, e.copyToObject(n, "stdDevs", Z, "val")) : e.copyToObject(n, "anchorDate", Z, "val"), e.copyToObject(n, "operator", $, "type"), e.copyToObject(n, "maxVal", Q, "maxVal");
1722
+ }
1723
+ }), u.registerVisitor({
1724
+ from: "filters",
1725
+ to: {},
1726
+ openTag: (e) => {
1727
+ let t = e.getParent(), n = {};
1728
+ return t.operator = D.BuiltInOperatorNames.InSet, t.param = n, e.copyToObject(n, "blank", X), e.copyToObject(n, "calendarType", $), n;
1729
+ }
1730
+ }), u.registerVisitor({
1731
+ from: "filter",
1732
+ openTag: (e) => {
1733
+ let t = e.getParent(), n = t.items;
1734
+ n || (n = [], t.items = n), n.push(e.getAttribute("val", $));
1735
+ }
1736
+ }), u.registerVisitor({
1737
+ from: "dateGroupItem",
1738
+ to: {},
1739
+ openTag: (e) => {
1740
+ let t = e.getParent(), n = t.dateGroups;
1741
+ n || (n = [], t.dateGroups = n), n.push(e.getSource()), e.copyTo("group", $, "dateTimeGrouping"), e.copyTo("day", Z), e.copyTo("hour", Z), e.copyTo("minute", Z), e.copyTo("month", Z), e.copyTo("second", Z), e.copyTo("year", Z);
1742
+ }
1743
+ }), u.registerVisitor({
1744
+ from: "customFilters",
1745
+ openTag: (e) => {
1746
+ let t = e.getParent(), n = e.getAttribute("and"), r = n === "and" || n === "1";
1747
+ e.getAttribute("val");
1748
+ let i = [];
1749
+ return t.operator = r ? D.BuiltInOperatorNames.And : D.BuiltInOperatorNames.Or, t.param = { conditions: i }, e.setSource(t), i;
1750
+ },
1751
+ closeTag: (e) => {
1752
+ e.getSource().param.conditions.length;
1753
+ }
1754
+ }), u.registerVisitor({
1755
+ from: "customFilter",
1756
+ openTag: (e) => {
1757
+ let t = e.getParent(), n;
1758
+ Array.isArray(t) ? (n = {}, t.push(n)) : n = t, e.copyToObject(n, "operator"), e.copyToObject(n, "param", $, "val");
1759
+ }
1760
+ }), u.registerVisitor({
1761
+ from: "sortState",
1762
+ to: {},
1763
+ openTag: (e) => {
1764
+ let t = e.getParent(), n = t.v;
1765
+ n && (n.sort = {}, e.setSource(t));
1766
+ }
1767
+ }), u.registerVisitor({
1768
+ from: "sortCondition",
1769
+ to: {},
1770
+ openTag: (e) => {
1771
+ let t = e.getParent(), n = t.v;
1772
+ if (!n) return;
1773
+ let r = n.sort;
1774
+ if (!r) return;
1775
+ let i = r.sorts;
1776
+ i || (i = [], r.sorts = i);
1777
+ let a = e.getAttribute("ref"), o = 0;
1778
+ if (a) {
1779
+ let e = w.fastStringToRange(a, dt).colStart, n = t.r, r = n.colStart;
1780
+ o = n ? e - r : e;
1781
+ }
1782
+ let s = {};
1783
+ e.copyToObject(s, "sortOn", $, "sortBy"), e.copyToObject(s, "dxfId", $, "sortBy"), e.copyToObject(s, "iconSet", $), e.copyToObject(s, "customList", $), s.reverse = e.getAttribute("descending", X) ?? !1;
1784
+ let c = {
1785
+ index: o,
1786
+ criteria: s
1787
+ };
1788
+ i.push(c);
1789
+ }
1790
+ }), u.registerVisitor({
1791
+ from: "AlternateContent",
1792
+ to: null
1793
+ });
1794
+ let m = (e) => {
1795
+ f = e.getSource(), e.copyTo("topLeft", $, "topLeftCell");
1796
+ let t = o(e.getAttribute("defaultGridColor")), n = e.getAttribute("colorId");
1797
+ n === null || t || (e.getSource().gridLineColor = "index" + parseFloat(n)), e.copyTo("showZeros", X), e.copyTo("showFormulas", X), e.copyTo("zoomScale", Z), e.copyTo("showRowHeaders", X, "showRowColHeaders"), e.copyTo("showColumnHeaders", X, "showRowColHeaders"), e.copyTo("showRowGridlines", X, "showGridLines"), e.copyTo("showColumnGridlines", X, "showGridLines"), e.copyTo("rightToLeft", X);
1798
+ };
1799
+ u.registerVisitor({
1800
+ from: "sheetView",
1801
+ to: "view",
1802
+ openTag: (e) => {
1803
+ m(e);
1804
+ },
1805
+ closeTag: () => {
1806
+ f = null;
1807
+ }
1808
+ }), u.registerVisitor({
1809
+ from: "customSheetViews",
1810
+ to: "customSheetViews",
1811
+ openTag: (e) => {
1812
+ e.setSource([]);
1813
+ }
1814
+ }), u.registerVisitor({
1815
+ from: "customSheetView",
1816
+ to: [],
1817
+ openTag: (e) => {
1818
+ m(e);
1819
+ },
1820
+ closeTag: () => {
1821
+ f = null;
1822
+ }
1823
+ }), u.registerVisitor({
1824
+ from: "selection",
1825
+ to: "selection",
1826
+ openTag: (e) => {
1827
+ if (!f) return;
1828
+ e.copyTo("cell", $, "activeCell"), e.copyTo("rangeIndex", Z, "activeCellId");
1829
+ let t = e.getAttribute("activeCell"), n = e.getAttribute("sqref");
1830
+ n && n !== t && (e.getSource().ranges = n.trim().split(/\s+/));
1831
+ }
1832
+ }), u.registerVisitor({
1833
+ from: "pane",
1834
+ to: null,
1835
+ openTag: (e) => {
1836
+ if (f && e.getAttribute("state") === "frozen") {
1837
+ let t = {};
1838
+ f.freezePanes = t, e.copyToObject(t, "topLeft", $, "topLeftCell");
1839
+ let n = (f.topLeft ? w.fastStringToCell(f.topLeft) : void 0) ?? {
1840
+ colIndex: 0,
1841
+ rowIndex: 0
1842
+ }, r = {
1843
+ colIndex: 0,
1844
+ rowIndex: 0
1845
+ };
1846
+ e.copyToObject(r, "colIndex", Z, "xSplit"), e.copyToObject(r, "rowIndex", Z, "ySplit");
1847
+ let i = {
1848
+ colIndex: n.colIndex + r.colIndex,
1849
+ rowIndex: n.rowIndex + r.rowIndex
1850
+ };
1851
+ t.coords = w.cellToString(i);
1852
+ }
1853
+ }
1854
+ }), u.registerVisitor({
1855
+ from: "tabColor",
1856
+ to: null,
1857
+ openTag: (t) => {
1858
+ let r = n((e) => t.getAttribute(e));
1859
+ r && (e.tabColor = r);
1860
+ }
1861
+ }), u.registerVisitor({
1862
+ from: "pageSetUpPr",
1863
+ to: "pageSetUpPr",
1864
+ openTag: (e) => {}
1865
+ }), u.registerVisitor({
1866
+ from: "outlinePr",
1867
+ to: "outlinePr",
1868
+ openTag: (e) => {}
1869
+ }), u.registerVisitor({
1870
+ from: "pageMargins",
1871
+ to: "pageMargins",
1872
+ openTag: (e) => {
1873
+ e.copyTo("bottom", Q), e.copyTo("footer", Q), e.copyTo("header", Q), e.copyTo("left", Q), e.copyTo("right", Q), e.copyTo("top", Q), e.copyTo("bottom", Q);
1874
+ }
1875
+ }), u.registerVisitor({
1876
+ from: "pageSetup",
1877
+ to: "pageSetup",
1878
+ openTag: (e) => {
1879
+ e.copyTo("blackAndWhite", X), e.copyTo("cellComments"), e.copyTo("copies", Z), e.copyTo("draft", X), e.copyTo("errors"), e.copyTo("firstPageNumber", Z), e.copyTo("fitToHeight", Z), e.copyTo("fitToWidth", Z), e.copyTo("horizontalDpi", Z), e.copyTo("orientation"), e.copyTo("pageOrder"), e.copyTo("paperSize", Z), e.copyTo("scale", Z), e.copyTo("useFirstPageNumber", X), e.copyTo("usePrinterDefaults", X), e.copyTo("verticalDpi", Z);
1880
+ }
1881
+ }), u.registerVisitor({
1882
+ from: "printOptions",
1883
+ to: "printOptions",
1884
+ openTag: (e) => {
1885
+ e.copyTo("gridLines", X), e.copyTo("gridLinesSet", X), e.copyTo("headings", X), e.copyTo("horizontalCentered", X), e.copyTo("verticalCentered", X);
1886
+ }
1887
+ }), u.registerVisitor({
1888
+ from: "headerFoot",
1889
+ to: "headerFoot",
1890
+ openTag: (e) => {}
1891
+ }), u.registerVisitor({
1892
+ from: "mergeCells",
1893
+ to: "merges",
1894
+ openTag: (e) => {
1895
+ e.setSource([]);
1896
+ }
1897
+ }), u.registerVisitor({
1898
+ from: "dataValidations",
1899
+ to: "validations",
1900
+ openTag: (e) => {
1901
+ e.setSource([]);
1902
+ }
1903
+ });
1904
+ let h = {
1905
+ from: "dataValidation",
1906
+ to: [],
1907
+ openTag: (e) => {
1908
+ let t = e.getAttribute("sqref");
1909
+ t &&= t.trim().split(/\s+/).join(",");
1910
+ let n = {}, r = {
1911
+ r: t,
1912
+ v: n,
1913
+ rule: {
1914
+ type: e.getAttribute("type") ?? void 0,
1915
+ operator: e.getAttribute("operator") ?? void 0
1916
+ }
1917
+ };
1918
+ !0 === e.getAttribute("showDropDown", X) && (n.hideDropdown = !0), e.copyToObject(n, "alert", $, "error"), e.copyToObject(n, "alertTitle", $, "errorTitle"), e.copyToObject(n, "showAlertMessage", X, "showErrorMessage"), n.alertStyle = e.getAttribute("errorStyle") ?? "stop", e.copyToObject(n, "imeMode"), e.copyToObject(n, "prompt"), e.copyToObject(n, "promptTitle"), e.copyToObject(n, "showPromptMessage", X, "showInputMessage"), e.setSource(r);
1919
+ },
1920
+ closeTag: (e) => {
1921
+ let t = e.getSource();
1922
+ if (!t?.rule) return;
1923
+ let n = ie(t.rule, s);
1924
+ n && (e.getAttribute("allowBlank", X) && (n.includeBlanks = !0), t.v.condition = n), delete t.rule;
1925
+ }
1926
+ };
1927
+ u.registerVisitor(h), u.registerVisitor({
1928
+ from: "formula1",
1929
+ to: {},
1930
+ text: (e, t) => {
1931
+ let n = t.getParent().rule;
1932
+ n?.type && (n.formula1 = ue(e, n.type));
1933
+ }
1934
+ }), u.registerVisitor({
1935
+ from: "formula2",
1936
+ to: {},
1937
+ text: (e, t) => {
1938
+ let n = t.getParent().rule;
1939
+ n?.type && (n.formula2 = ue(e, n.type));
1940
+ }
1941
+ }), u.registerVisitor({
1942
+ from: "picture",
1943
+ to: "picture",
1944
+ openTag: (e) => {
1945
+ let n = e.getAttribute("r:id");
1946
+ if (!n) return void console.warn("no rId found for picture", e.getPath());
1947
+ let r = t(n, !0);
1948
+ e.getSource().resId = r;
1949
+ }
1950
+ });
1951
+ let g = {
1952
+ from: "slicer",
1953
+ to: {},
1954
+ openTag: (e) => {
1955
+ let n = e.getAttribute("r:id");
1956
+ if (!n) return void console.warn("no rId found for picture", e.getPath());
1957
+ let r = t(n)?.slicers, i = e.getParent();
1958
+ i.slicers ||= {};
1959
+ let a = Object.keys(r);
1960
+ for (let e of a) i.slicers[e] = r[e];
1961
+ }
1962
+ };
1963
+ u.registerVisitor(g);
1964
+ let _ = (e, t) => ({
1965
+ from: e,
1966
+ to: {},
1967
+ openTag: (e) => {
1968
+ e.setSource("");
1969
+ },
1970
+ text: (e, t) => {
1971
+ t.setSource((t.getSource() ?? "") + e);
1972
+ },
1973
+ closeTag: (e) => {
1974
+ t(String(e.getSource() ?? ""), e);
1975
+ }
1976
+ }), v = /* @__PURE__ */ new Map();
1977
+ v.set("dataValidations", {
1978
+ from: "dataValidations",
1979
+ to: "validations",
1980
+ openTag: (e) => {
1981
+ let t = e.getParent();
1982
+ e.setSource(t.validations ?? []);
1983
+ },
1984
+ closeTag: (e) => {
1985
+ (e.getSource()?.length ?? 0) === 0 && e.setSource(void 0);
1986
+ }
1987
+ }), v.set("dataValidation", {
1988
+ ...h,
1989
+ closeTag: (e) => {
1990
+ h.closeTag(e);
1991
+ let t = e.getSource();
1992
+ t && !t.r && (e.warn("x14 dataValidation with no xm:sqref was dropped."), e.setSource(void 0));
1993
+ }
1994
+ });
1995
+ let oe = (e) => ({
1996
+ from: e,
1997
+ to: {},
1998
+ openTag: (t) => {
1999
+ t.setSource({
2000
+ rule: t.getParent()?.rule,
2001
+ key: e
2002
+ });
2003
+ }
2004
+ });
2005
+ v.set("formula1", oe("formula1")), v.set("formula2", oe("formula2")), v.set("f", _("f", (e, t) => {
2006
+ let n = t.getParent(), r = n?.rule;
2007
+ r && (r[n.key] = ue(e, r.type));
2008
+ })), v.set("sqref", _("sqref", (e, t) => {
2009
+ let n = t.getParent(), r = e.trim();
2010
+ n && r && (n.r = r.split(/\s+/).join(","));
2011
+ }));
2012
+ let S = /* @__PURE__ */ new Map(), de = [], C = /* @__PURE__ */ new Map();
2013
+ C.set("conditionalFormattings", {
2014
+ from: "conditionalFormattings",
2015
+ transparent: !0
2016
+ }), C.set("conditionalFormatting", {
2017
+ from: "conditionalFormatting",
2018
+ to: {},
2019
+ openTag: (e) => {
2020
+ e.setSource({ rules: [] });
2021
+ },
2022
+ closeTag: (e) => {
2023
+ let t = e.getSource(), n = t?.rules ?? [];
2024
+ for (let e = 0; e < n.length; e++) {
2025
+ let r = n[e];
2026
+ r.sqref = t.sqref, r.id ? S.set(r.id, r) : de.push(r);
2027
+ }
2028
+ }
2029
+ }), C.set("cfRule", {
2030
+ from: "cfRule",
2031
+ to: {},
2032
+ openTag: (e) => {
2033
+ e.copyTo("id", $), e.copyTo("type", $), e.copyTo("priority", Z);
2034
+ },
2035
+ closeTag: (e) => {
2036
+ let t = e.getSource();
2037
+ t && e.getParent()?.rules?.push(t);
2038
+ }
2039
+ }), C.set("sqref", _("sqref", (e, t) => {
2040
+ let n = t.getParent(), r = e.trim();
2041
+ n && r && (n.sqref = r);
2042
+ })), C.set("dataBar", {
2043
+ from: "dataBar",
2044
+ to: {},
2045
+ openTag: (e) => {
2046
+ e.copyTo("minLength", Z), e.copyTo("maxLength", Z), e.copyTo("gradient", X), e.copyTo("border", X), e.copyTo("direction", $), e.copyTo("axisPosition", $), e.copyTo("negativeBarColorSameAsPositive", X), e.copyTo("negativeBarBorderColorSameAsPositive", X);
2047
+ },
2048
+ closeTag: (e) => {
2049
+ e.getParent().dataBar = e.getSource();
2050
+ }
2051
+ }), C.set("iconSet", {
2052
+ from: "iconSet",
2053
+ to: {},
2054
+ openTag: (e) => {
2055
+ e.copyTo("iconSet", $), e.copyTo("custom", X), e.copyTo("reverse", X), e.copyTo("showValue", X);
2056
+ },
2057
+ closeTag: (e) => {
2058
+ e.getParent().iconSet = e.getSource();
2059
+ }
2060
+ }), C.set("cfvo", {
2061
+ from: "cfvo",
2062
+ to: {},
2063
+ openTag: (e) => {
2064
+ let t = e.getParent();
2065
+ t.conditions ||= [];
2066
+ let n = e.getSource();
2067
+ t.conditions.push(n), e.copyTo("type", $), !1 === e.getAttribute("gte", X) && (n.exclusive = !0);
2068
+ }
2069
+ }), C.set("f", _("f", (e, t) => {
2070
+ let n = t.getParent();
2071
+ if (!n) return;
2072
+ let r = e.trim(), i = Number(r);
2073
+ n.value = r.length > 0 && Number.isFinite(i) ? i : e;
2074
+ }));
2075
+ let fe = (e) => ({
2076
+ from: e,
2077
+ to: {},
2078
+ openTag: (t) => {
2079
+ let r = n((e) => t.getAttribute(e));
2080
+ r && (t.getParent()[e] = r);
2081
+ }
2082
+ });
2083
+ C.set("borderColor", fe("borderColor")), C.set("negativeFillColor", fe("negativeFillColor")), C.set("negativeBorderColor", fe("negativeBorderColor")), C.set("axisColor", fe("axisColor")), C.set("cfIcon", {
2084
+ from: "cfIcon",
2085
+ to: {},
2086
+ openTag: (e) => {
2087
+ let t = e.getAttribute("iconSet"), n = e.getAttribute("iconId", Z);
2088
+ if (t === null || n === null) return;
2089
+ let r = e.getParent();
2090
+ r.icons ||= [], r.icons.push({
2091
+ set: t,
2092
+ id: n
2093
+ });
2094
+ }
2095
+ });
2096
+ let pe = /* @__PURE__ */ new Map();
2097
+ pe.set("id", _("id", (e, t) => {
2098
+ let n = t.getParent(), r = e.trim();
2099
+ n && r && (n.x14Id = r);
2100
+ }));
2101
+ let T = /* @__PURE__ */ new Map();
2102
+ T.set("slicerList", {
2103
+ from: "slicerList",
2104
+ transparent: !0
2105
+ }), T.set("slicer", g);
2106
+ let E = /* @__PURE__ */ new Map([
2107
+ [re(ae), v],
2108
+ [re(ce), C],
2109
+ [re(y), C],
2110
+ [re(b), pe],
2111
+ [re(te), T],
2112
+ [re(le), T]
2113
+ ]), me = /* @__PURE__ */ new Set();
2114
+ u.registerVisitor({
2115
+ from: "extLst",
2116
+ transparent: !0
2117
+ }), u.registerVisitor({
2118
+ from: "ext",
2119
+ transparent: !0,
2120
+ scope: (e) => {
2121
+ let t = e.getAttribute("uri"), n = re(t), r = E.get(n);
2122
+ if (r) return r;
2123
+ if (!se.has(n) && !me.has(n)) {
2124
+ me.add(n);
2125
+ let r = x[n];
2126
+ e.warn(r ? `Extension content '${r}' (${t}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${t}) is not read; it will be lost on resave.`);
2127
+ }
2128
+ return null;
2129
+ }
2130
+ }), u.registerVisitor({
2131
+ from: "mergeCell",
2132
+ to: [],
2133
+ openTag: (e) => {
2134
+ let t = e.getAttribute("ref");
2135
+ e.setSource(t);
2136
+ }
2137
+ }), u.registerVisitor({
2138
+ from: "hyperlinks",
2139
+ to: "hyperlinks",
2140
+ openTag: (e) => {
2141
+ e.setSource([]);
2142
+ }
2143
+ }), u.registerVisitor({
2144
+ from: "hyperlink",
2145
+ to: [],
2146
+ openTag: (e) => {
2147
+ let n = e.getAttribute("r:id"), r = e.getAttribute("ref");
2148
+ if (!r) return void console.warn("No ref found for hyperlink");
2149
+ e.setKey(r);
2150
+ let i = n ? t(n) : "";
2151
+ if (typeof i != "string") return void console.warn("Invalid address ", i);
2152
+ i.endsWith("\\") && (i = i.substring(0, i.length - 1));
2153
+ let a = e.getAttribute("location");
2154
+ if (a && (i += "#" + a), !i) return void console.warn("No address found for hyperlink. r:id", n);
2155
+ let o, s = e.getAttribute("tooltip");
2156
+ o = s ? {
2157
+ address: i,
2158
+ screenTip: s
2159
+ } : i, e.setSource({
2160
+ r,
2161
+ v: o
2162
+ });
2163
+ }
2164
+ }), u.registerVisitor({
2165
+ from: "drawing",
2166
+ to: "movables",
2167
+ openTag: (e) => {
2168
+ let n = e.getAttribute("r:id");
2169
+ if (!n) return;
2170
+ let r = t(n);
2171
+ r ? e.setSource(r.movables) : console.warn("no drawing found for rId", n);
2172
+ }
2173
+ }), u.registerVisitor({
2174
+ from: "tableParts",
2175
+ to: "tables",
2176
+ openTag: (e) => {
2177
+ e.setSource([]);
2178
+ }
2179
+ }), u.registerVisitor({
2180
+ from: "tablePart",
2181
+ to: [],
2182
+ openTag: (e) => {
2183
+ let n = e.getAttribute("r:id");
2184
+ if (!n) return;
2185
+ let r = t(n);
2186
+ r ? e.setSource(r) : console.warn("no table found for rId", n);
2187
+ }
2188
+ });
2189
+ let k = (e, t) => {
2190
+ t.conditions?.length && (e.stops = p(t)), t.minLength !== void 0 && (e.minLength = t.minLength), t.maxLength !== void 0 && (e.maxLength = t.maxLength), (t.gradient ?? 1) && (e.gradient = !0), t.border && t.borderColor && (e.borderColor = t.borderColor), !t.negativeBarColorSameAsPositive && t.negativeFillColor && (e.negativeFillColor = t.negativeFillColor), !(t.negativeBarBorderColorSameAsPositive ?? 1) && t.negativeBorderColor && (e.negativeBorderColor = t.negativeBorderColor), t.axisColor && (e.axisColor = t.axisColor), t.axisPosition !== "middle" && t.axisPosition !== "none" || (e.axisPosition = t.axisPosition), t.direction !== "leftToRight" && t.direction !== "rightToLeft" || (e.direction = t.direction);
2191
+ }, he = (e, t) => {
2192
+ t.conditions?.length && (e.stops = p(t)), t.iconSet && t.iconSet !== e.iconSet && (e.iconSet = t.iconSet), t.icons?.length && (e.icon = t.icons), t.reverse !== void 0 && (e.reverse = t.reverse), t.showValue !== void 0 && (e.showValue = t.showValue);
2193
+ }, ge = (e) => {
2194
+ if (e.type !== "iconSet" || !e.iconSet || !e.sqref) return null;
2195
+ let t = {
2196
+ type: O.ScaleType.IconSet,
2197
+ stops: []
2198
+ };
2199
+ return he(t, e.iconSet), {
2200
+ r: e.sqref.split(/\s+/).join(","),
2201
+ v: { scale: t },
2202
+ priority: e.priority
2203
+ };
2204
+ };
2205
+ u.registerVisitor({
2206
+ from: "worksheet",
2207
+ to: {},
2208
+ openTag: (e) => {},
2209
+ closeTag: (e) => {
2210
+ let t = e.getSource(), n = t?.conditionals;
2211
+ if (n) for (let e = 0; e < n.length; e++) {
2212
+ let t = n[e], r = t.x14Id;
2213
+ if (!r) continue;
2214
+ delete t.x14Id;
2215
+ let i = S.get(r);
2216
+ if (!i) continue;
2217
+ S.delete(r);
2218
+ let a = t.v?.scale;
2219
+ i.dataBar && a?.type === O.ScaleType.DataBar ? k(a, i.dataBar) : i.iconSet && a?.type === O.ScaleType.IconSet && he(a, i.iconSet);
2220
+ }
2221
+ let r = [...S.values(), ...de];
2222
+ for (let e = 0; e < r.length; e++) {
2223
+ let i = ge(r[e]);
2224
+ i ? (n || (n = [], t.conditionals = n), n.push(i)) : s?.(`x14-only conditional formatting rule (type '${r[e].type ?? "unknown"}') is not read and will be lost on resave.`);
2225
+ }
2226
+ if (n) {
2227
+ n.length > 1 && n.sort((e, t) => (e.priority ?? Infinity) - (t.priority ?? Infinity));
2228
+ for (let e = 0; e < n.length; e++) delete n[e].priority;
2229
+ }
2230
+ }
2231
+ }), u.registerVisitor({
2232
+ from: "customProperties",
2233
+ to: "customProperties",
2234
+ openTag: (e) => {
2235
+ e.setSource([]);
2236
+ },
2237
+ closeTag: (e) => {
2238
+ let t = e.getSource();
2239
+ t.length > 0 && (e.getParent().customProperties = t);
2240
+ }
2241
+ }), u.registerVisitor({
2242
+ from: "customPr",
2243
+ to: {},
2244
+ openTag: (e) => {
2245
+ let n = e.getParent();
2246
+ e.copyTo("name");
2247
+ let r = e.getAttribute("r:id");
2248
+ if (!r) return void console.warn("no rId found for customProperties", e.getPath());
2249
+ let i = t(r, !0), a = e.getSource();
2250
+ a.resId = i, n.push(a);
2251
+ }
2252
+ }), u.registerVisitor({
2253
+ from: "sheetProtection",
2254
+ to: "protection",
2255
+ openTag: (e) => {
2256
+ let t = !1;
2257
+ if (e.hasAttribute("sheet") && X(e.getAttribute("sheet")) && (t = !0), !t) return void e.setSource(void 0);
2258
+ let n = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e && e !== "0" && e !== "off" && e !== "false" && null;
2259
+ e.copyTo("autoTable", n), e.copyTo("deleteColumns", n), e.copyTo("formatCells", n), e.copyTo("formatColumns", n), e.copyTo("formatRows", n), e.copyTo("insertColumns", n), e.copyTo("insertHyperlinks", n), e.copyTo("insertRows", n), e.copyTo("objects", n), e.copyTo("pivotTables", n), e.copyTo("scenarios", n), e.copyTo("selectLockedCells", n), e.copyTo("selectUnlockedCells", n), e.copyTo("sort", n);
2260
+ let r = {};
2261
+ e.copyToObject(r, "hash", $, "hashValue"), e.copyToObject(r, "algorithm", $, "algorithmName"), e.copyToObject(r, "salt", $, "saltValue"), e.copyToObject(r, "spinCount", Z), Object.keys(r).length > 0 && (e.getSource().password = r);
2262
+ }
2263
+ }), u.registerVisitor({
2264
+ from: "protectedRanges",
2265
+ to: "protectedRanges",
2266
+ openTag: (e) => {
2267
+ e.setSource([]);
2268
+ }
2269
+ }), u.registerVisitor({
2270
+ from: "protectedRange",
2271
+ to: [],
2272
+ openTag: (e) => {
2273
+ let t = e.getAttribute("sqref");
2274
+ t &&= t.trim().split(/\s+/).join(",");
2275
+ let n = {}, r = {
2276
+ r: t,
2277
+ v: n
2278
+ };
2279
+ e.copyToObject(n, "name"), e.copyToObject(n, "securityDescriptor");
2280
+ let i = {};
2281
+ e.copyToObject(i, "hash", $, "hashValue"), e.copyToObject(i, "algorithm", $, "algorithmName"), e.copyToObject(i, "salt", $, "saltValue"), e.copyToObject(i, "spinCount", Z), Object.keys(i).length > 0 && (n.password = i), e.setSource(r);
2282
+ },
2283
+ closeTag: (e) => {
2284
+ let t = e.getSource();
2285
+ t?.r && t.v.name || e.setSource(void 0);
2286
+ }
2287
+ }), u.registerVisitor({
2288
+ from: "sheetFormatPr",
2289
+ to: "sheetFormatPr",
2290
+ openTag: (t) => {
2291
+ t.copyToObject(e, "defaultColSize", Q, "defaultColWidth"), t.copyToObject(e, "outlineLevelCol", Z, "outlineLevelCol");
2292
+ let n = t.getAttribute("customHeight");
2293
+ n !== "1" && n !== "true" || t.copyToObject(e, "defaultRowSize", Q, "defaultRowHeight"), t.copyToObject(e, "outlineLevelRow", Z, "outlineLevelRow");
2294
+ }
2295
+ }), u.registerVisitor({
2296
+ from: "cols",
2297
+ to: "cols",
2298
+ openTag: (e) => {
2299
+ e.setSource([]);
2300
+ }
2301
+ }), u.registerVisitor({
2302
+ from: "col",
2303
+ to: [],
2304
+ openTag: (e) => {
2305
+ let t = e.getSource(), n = e.getAttribute("min"), r = e.getAttribute("max"), i = n === void 0 ? 0 : parseInt(n) - 1, a = r === void 0 ? i : parseInt(r) - 1;
2306
+ t.r = w.runToString(i, a, !0);
2307
+ let o = {};
2308
+ t.v = o, e.copyToObject(o, "sz", Q, "width"), e.copyToObject(o, "csz", X, "customWidth"), e.copyToObject(o, "h", X, "hidden"), e.copyToObject(o, "l", Z, "outlineLevel"), e.copyToObject(o, "s", Z, "style");
2309
+ }
2310
+ }), u.registerVisitor({
2311
+ from: "oleObjects",
2312
+ to: null,
2313
+ openTag: (e) => {
2314
+ e.warn("'OLE Objects' are not supported.");
2315
+ }
2316
+ });
2317
+ let ve = !1, A = !1, j = 0, ye = "", M = (e) => {
2318
+ let t = e.indexOf(":");
2319
+ return t === -1 ? e : e.slice(t + 1);
2320
+ };
2321
+ return ft(d, e, u.createEventHandler(e, a, s), s, c, {
2322
+ onOpenTag: (e) => {
2323
+ ve = !0;
2324
+ let t = M(e.name);
2325
+ t === "t" || t === "v" ? j === 0 && (A = !0) : t !== "rPh" && t !== "phoneticPr" || j++;
2326
+ },
2327
+ onText: (e) => {
2328
+ A && (ye += e);
2329
+ },
2330
+ onCloseTag: (e) => {
2331
+ let t = M(e.name);
2332
+ t === "t" || t === "v" ? A = !1 : t !== "rPh" && t !== "phoneticPr" || j > 0 && j--;
2333
+ },
2334
+ onEnd: () => {
2335
+ if (!ve) return;
2336
+ let e = r(ne(ye));
2337
+ return ve = !1, A = !1, j = 0, ye = "", e;
2338
+ },
2339
+ onError: (e) => {}
2340
+ }, l);
2341
+ })(e, (e, t = !1) => Ee(e, f, t) ?? null, Pe, h, () => {}, (e, t) => {
2342
+ let n = t ? `${t} (${f})` : f;
2343
+ E.push([e, n]);
2344
+ }, void 0, N), i = await R.getTextStream(f, xe);
2345
+ if (i) try {
2346
+ await Je.parseStream(i, t, { xmlns: !1 });
2347
+ } catch (e) {
2348
+ throw console.warn(`Error parsing sheet: '${f}'`, e), Error(`Error parsing sheet: '${f}'`, { cause: e });
2349
+ }
2350
+ let a = L(f, u), s, c = /* @__PURE__ */ new Map();
2351
+ if (a) {
2352
+ let t;
2353
+ if (a.forEach((e, t) => {
2354
+ e.type === "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" && (s = Ee(t, f, !1, u)?.comments, s && s.forEach((e) => {
2355
+ let t = e.v;
2356
+ c.set(t.id, e);
2357
+ }));
2358
+ }), a.forEach((e, n) => {
2359
+ e.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" && (t = Ee(n, f, !1, u));
2360
+ }), t || s) {
2361
+ let n = s ?? [], i = t?.authors, a = t?.comments, o = a ? a.length : 0;
2362
+ if (a) for (let e = 0; e < o; e++) {
2363
+ let t = a[e];
2364
+ if (!t) continue;
2365
+ let o = t.v, s = i && o.personId !== void 0 ? i[o.personId] : o.personId;
2366
+ if (s && s.startsWith("tc=") && (s = r(s.substring(3)), c.has(s))) continue;
2367
+ let l = ke({ displayName: s }), u = {
2368
+ id: C.uuidV4(),
2369
+ personId: l.id,
2370
+ done: !1,
2371
+ asNote: !0,
2372
+ content: o.content
2373
+ };
2374
+ n.push({
2375
+ r: t.r,
2376
+ v: u
2377
+ });
2378
+ }
2379
+ e.comments = n;
2380
+ }
2381
+ }
2382
+ })());
2383
+ } else if (d.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink") {
2384
+ let t = i(f, e, I, F, V);
2385
+ if (t && Object.keys(t).length !== 0) {
2386
+ let e = t, n = [];
2387
+ L(f, u)?.forEach((e) => {
2388
+ e.targetMode === "External" && e.type && e.target && n.push({
2389
+ type: e.type,
2390
+ target: e.target
2391
+ });
2392
+ }), e.identity = n, g = e;
2393
+ } else g = null;
2394
+ } else g = l ? t(f, e, (e, t) => {
2395
+ let n = S.add({ source: { buffer: e } });
2396
+ return n.addReference(j), ye.add(n), k.toResourceId(n);
2397
+ }, V) : i(f, e, I, F, V);
2398
+ return g;
2399
+ };
2400
+ c("coreprops", u, e, I, F), c("extprops", u, e, I, F);
2401
+ let De = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), Oe = c("people", u, e, I, F), B = null;
2402
+ if (Oe.size > 0 && (B = Oe.entries().next()?.value?.[1]?.persons, B)) {
2403
+ let e = B.length;
2404
+ for (let t = 0; t < e; t++) {
2405
+ let e = B[t];
2406
+ De.set(e.id, e), e.displayName !== void 0 && z.set(e.displayName, e);
2407
+ }
2408
+ }
2409
+ let ke = (e) => {
2410
+ if (!e) return;
2411
+ if (e.id && De.has(e.id)) return De.get(e.id);
2412
+ let t = e.displayName;
2413
+ if (!e.id) {
2414
+ if (t) {
2415
+ let e = z.get(t);
2416
+ if (e) return e;
2417
+ }
2418
+ e.id = C.uuidV4();
2419
+ }
2420
+ let n = De.get(e.id);
2421
+ if (n) return n;
2422
+ let r = e;
2423
+ return De.set(e.id, r), t && z.set(t, r), B ||= [], B.push(r), r;
2424
+ }, V = {
2425
+ paramMap: N,
2426
+ getRefs: L,
2427
+ getRef: Ee,
2428
+ parsedRefs: P,
2429
+ addPerson: ke,
2430
+ serializeElement: Te
2431
+ }, Ae = [];
2432
+ if (d) {
2433
+ let e = await R.getTextStream(d, xe);
2434
+ if (e) {
2435
+ let t = ((e, t) => {
2436
+ let n = !1, r = !1, i = 0, a = "";
2437
+ return {
2438
+ onOpenTag: (e) => {
2439
+ let t = pt(e.name);
2440
+ t === "t" ? n && i === 0 && (r = !0) : t === "si" ? (n = !0, a = "", i = 0) : t !== "rPh" && t !== "phoneticPr" || i++;
2441
+ },
2442
+ onText: (e) => {
2443
+ r && (a += e);
2444
+ },
2445
+ onCloseTag: (t) => {
2446
+ let o = pt(t.name);
2447
+ o === "t" ? r = !1 : o === "si" ? (e(ne(a)), n = !1, a = "") : o !== "rPh" && o !== "phoneticPr" || i > 0 && i--;
2448
+ },
2449
+ onError: (e) => {
2450
+ t?.(`Error parsing shared strings: ${e?.message ?? e}`);
2451
+ }
2452
+ };
2453
+ })((e) => {
2454
+ Ae.push(e);
2455
+ }, (e) => {
2456
+ E.push([e, d]);
2457
+ });
2458
+ try {
2459
+ await Je.parseStream(e, t, { xmlns: !1 });
2460
+ } catch (e) {
2461
+ throw console.warn(`Error parsing shared strings: '${d}'`, e), Error(`Error parsing shared strings: '${d}'`, { cause: e });
2462
+ }
2463
+ }
2464
+ }
2465
+ T?.mark("shared-strings");
2466
+ let je = Ae.length, Me = /* @__PURE__ */ new Map(), Ne = je, Pe = (e) => {
2467
+ let t = Me.get(e);
2468
+ if (t !== void 0) return t;
2469
+ let n = Ne;
2470
+ return Me.set(e, Ne++), Ae.push(e), n;
2471
+ }, Fe = [];
2472
+ u.slicersCache = Fe;
2473
+ let Ie = R.getNames(), Le = Ie.length;
2474
+ for (let e = 0; e < Le; e++) {
2475
+ let t = Ie[e];
2476
+ t && t.startsWith("xl/slicerCache") && Fe.push(`/${t}`);
2477
+ }
2478
+ let Re = c("slicersCache", u, e, I, F, V), H = /* @__PURE__ */ new Map();
2479
+ Re.forEach((e) => {
2480
+ let t = e.name;
2481
+ delete e.name, H.set(t, e);
2482
+ }), N.set("slicerCaches", H), c("richstructure", u, e, I, F, V), c("richdata", u, e, I, F, V);
2483
+ let U = c("themes", u, e, I, F, V), W = null;
2484
+ if (U && U.entries) {
2485
+ let e = U.entries().next();
2486
+ e?.value?.[1] && (W = e.value[1]);
2487
+ }
2488
+ let ze = new ge(W), G = c("styles", u, e, I, F, V).entries().next()?.value?.[1];
2489
+ G &&= JSON.parse(de.JSONStableStringify(G));
2490
+ let Be = c("workbooks", u, e, I, F, V);
2491
+ T?.mark("side-parts-json"), await Promise.all(we), A && be > 0 && (A(M, M), await new Promise((e) => setTimeout(e, 0))), T?.mark("sheets");
2492
+ let K = {
2493
+ ...Be.entries().next().value?.[1],
2494
+ styles: G,
2495
+ theme: ze.toJSON()
2496
+ };
2497
+ if (Ae.length > 0 && (K.strings = Ae), B && B.length > 0 && (K.people = B), g) {
2498
+ let e = R.getEntry("xl/vbaProject.bin");
2499
+ if (e) try {
2500
+ let { VBAProject: t } = await import("./DRuB-nlH4kq_OQJ5.mjs"), n = t.extract(e);
2501
+ n ? (g?.(n), K.vba = n) : E.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
2502
+ } catch (e) {
2503
+ E.push([`Error extracting VBA: ${e?.message ?? e}`, "xl/vbaProject.bin"]);
2504
+ }
2505
+ }
2506
+ let q = null, J = {
2507
+ ...v,
2508
+ resources: S,
2509
+ json: K,
2510
+ formulaTransform: h(() => q?.getCalculation())
2511
+ };
2512
+ J.disableLoadAutoFit === void 0 && (J.disableLoadAutoFit = !1), T?.mark("json-assembled");
2513
+ let Y = new ve(J);
2514
+ if (q = Y, T?.mark("workbook-constructed"), Se.length > 0) {
2515
+ await Y.whenCalculationReady();
2516
+ let e = /* @__PURE__ */ new Map(), t = K.sheets ?? [], n = Y.getSheets().getItems();
2517
+ for (let r = 0; r < t.length; r++) {
2518
+ let i = t[r]?.sheet, a = n[r];
2519
+ i && a && e.set(i, a);
2520
+ }
2521
+ ((e, t, n) => {
2522
+ if (t.length === 0) return;
2523
+ let r = e.getCalculation().getFunctions(), i = /* @__PURE__ */ new Map(), a = (e) => {
2524
+ let t = i.get(e);
2525
+ return t === void 0 && (t = r.getByName(e) !== null, i.set(e, t)), t;
2526
+ }, o = /* @__PURE__ */ new Map();
2527
+ for (let e of t) {
2528
+ let t = o.get(e.sheet);
2529
+ t || (t = [], o.set(e.sheet, t)), t.push(e);
2530
+ }
2531
+ for (let [e, t] of o) {
2532
+ let r = n.get(e);
2533
+ if (!r) continue;
2534
+ let i = (e, t) => `${e},${t}`, o = /* @__PURE__ */ new Set();
2535
+ for (let e of t) e.formula === null && o.add(i(e.rowIndex, e.colIndex));
2536
+ for (let e of t) {
2537
+ if (e.formula === null) continue;
2538
+ let t = st(e.formula), n = !0;
2539
+ for (let e of t) if (!a(e)) {
2540
+ n = !1;
2541
+ break;
2542
+ }
2543
+ if (!n) continue;
2544
+ let s = [], c = [[e.rowIndex, e.colIndex]], l = /* @__PURE__ */ new Set([i(e.rowIndex, e.colIndex)]);
2545
+ for (; c.length > 0;) {
2546
+ let [e, t] = c.pop(), n = [
2547
+ [e + 1, t],
2548
+ [e - 1, t],
2549
+ [e, t + 1],
2550
+ [e, t - 1]
2551
+ ];
2552
+ for (let [e, t] of n) {
2553
+ let n = i(e, t);
2554
+ !l.has(n) && o.has(n) && (l.add(n), s.push([e, t]), c.push([e, t]));
2555
+ }
2556
+ }
2557
+ for (let [e, t] of s) o.delete(i(e, t)), r.getRange({
2558
+ rowStart: e,
2559
+ colStart: t,
2560
+ rowEnd: e,
2561
+ colEnd: t
2562
+ }).clear();
2563
+ r.getRange({
2564
+ rowStart: e.rowIndex,
2565
+ colStart: e.colIndex,
2566
+ rowEnd: e.rowIndex,
2567
+ colEnd: e.colIndex
2568
+ }).setValue("=" + e.formula);
2569
+ }
2570
+ }
2571
+ })(Y, Se, e);
2572
+ }
2573
+ if (ye.forEach((e) => {
2574
+ e.deleteReference(j);
2575
+ }), k.endPersist(), pe) {
2576
+ l(pe);
2577
+ let e = /* @__PURE__ */ new Map(), t = 0;
2578
+ for (let n of R.getNames()) {
2579
+ let r = R.getEntry(n);
2580
+ if (!r) continue;
2581
+ let i = R.getRawEntry(n), a = i ? {
2582
+ data: r,
2583
+ uncompressedSize: R.uncompressedSize(n),
2584
+ raw: {
2585
+ compressedData: i.data,
2586
+ compressionMethod: i.compressionMethod,
2587
+ signature: i.signature
2588
+ }
2589
+ } : {
2590
+ data: r,
2591
+ uncompressedSize: R.uncompressedSize(n)
2592
+ };
2593
+ e.set(n, a), t += r.byteLength;
2594
+ }
2595
+ if (t > 67108864) E.push([`Source package too large to retain (${t} bytes, limit ${f}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
2596
+ else if (e.size > 0) {
2597
+ let t = new m(e);
2598
+ oe(pe, t);
2599
+ let n = Y.getSheets().getItems(), r = Y.getTransactions().addListener({ onCommitEnd: (e) => {
2600
+ let n = e.getOperation()?.name;
2601
+ n !== "insertCells" && n !== "deleteCells" || t.markStructuralChange();
2602
+ } }), i = Y.addListeners({ onSheetsChange: () => {
2603
+ let e = Y.getSheets().getItems();
2604
+ (e.length !== n.length || e.some((e, t) => e !== n[t])) && t.markStructuralChange(), n = e;
2605
+ } });
2606
+ Y.addListeners({ onClose: () => {
2607
+ r(), i(), l(pe);
2608
+ } });
2609
+ }
2610
+ }
2611
+ if (E.length && me?.onWarning) for (let e of E) {
2612
+ let [t, n] = e;
2613
+ me.onWarning(t, n);
2614
+ }
2615
+ return T && !0 === _ && console.table(T.toTable()), Y;
2616
+ } catch (e) {
2617
+ let t = "Unable to parse XLSX.";
2618
+ throw e instanceof k && (t = "Unable to open XLSX. There are too many rows or columns."), Error(t, { cause: e });
2619
+ } finally {
2620
+ await R.close().catch(() => {});
2621
+ }
2622
+ };
2623
+ export { _t as readXLSX };